1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-11 14:41:06 +02:00
audacity/lib-src/redland/rasqal/docs/html/rasqal-section-general.html
2010-01-24 09:19:39 +00:00

547 lines
22 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>General library facilities</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
<link rel="start" href="index.html" title="Rasqal RDF Query Library Manual">
<link rel="up" href="pt01.html" title="Part I. Reference Manual">
<link rel="prev" href="pt01.html" title="Part I. Reference Manual">
<link rel="next" href="rasqal-section-data.html" title="Data Graphs">
<meta name="generator" content="GTK-Doc V1.10 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="rasqal.html" title="Rasqal Overview">
<link rel="part" href="pt01.html" title="Part I. Reference Manual">
<link rel="index" href="ix01.html" title="Index">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="pt01.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="pt01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">Rasqal RDF Query Library Manual</th>
<td><a accesskey="n" href="rasqal-section-data.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#rasqal-section-general.synopsis" class="shortcut">Top</a>
 | 
<a href="#rasqal-section-general.description" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="rasqal-section-general"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="rasqal-section-general.top_of_page"></a>General library facilities</span></h2>
<p>General library facilities — Startup and shutdown, memory handling, version checks and misc functions.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="rasqal-section-general.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
typedef <a class="link" href="rasqal-section-general.html#rasqal-world" title="rasqal_world">rasqal_world</a>;
void <a class="link" href="rasqal-section-general.html#rasqal-free-world" title="rasqal_free_world ()">rasqal_free_world</a> (<a class="link" href="rasqal-section-general.html#rasqal-world" title="rasqal_world">rasqal_world</a> *world);
<a class="link" href="rasqal-section-general.html#rasqal-world" title="rasqal_world">rasqal_world</a>* <a class="link" href="rasqal-section-general.html#rasqal-new-world" title="rasqal_new_world ()">rasqal_new_world</a> (void);
extern const unsigned int <a class="link" href="rasqal-section-general.html#rasqal-version-decimal" title="rasqal_version_decimal">rasqal_version_decimal</a>;
extern const unsigned int <a class="link" href="rasqal-section-general.html#rasqal-version-major" title="rasqal_version_major">rasqal_version_major</a>;
extern const unsigned int <a class="link" href="rasqal-section-general.html#rasqal-version-minor" title="rasqal_version_minor">rasqal_version_minor</a>;
extern const unsigned int <a class="link" href="rasqal-section-general.html#rasqal-version-release" title="rasqal_version_release">rasqal_version_release</a>;
enum <a class="link" href="rasqal-section-general.html#rasqal-feature" title="enum rasqal_feature">rasqal_feature</a>;
int <a class="link" href="rasqal-section-general.html#rasqal-language-name-check" title="rasqal_language_name_check ()">rasqal_language_name_check</a> (<a class="link" href="rasqal-section-general.html#rasqal-world" title="rasqal_world">rasqal_world</a> *world,
const char *name);
int <a class="link" href="rasqal-section-general.html#rasqal-languages-enumerate" title="rasqal_languages_enumerate ()">rasqal_languages_enumerate</a> (<a class="link" href="rasqal-section-general.html#rasqal-world" title="rasqal_world">rasqal_world</a> *world,
unsigned int counter,
const char **name,
const char **label,
unsigned char **uri_string);
void* <a class="link" href="rasqal-section-general.html#rasqal-alloc-memory" title="rasqal_alloc_memory ()">rasqal_alloc_memory</a> (size_t size);
void* <a class="link" href="rasqal-section-general.html#rasqal-calloc-memory" title="rasqal_calloc_memory ()">rasqal_calloc_memory</a> (size_t nmemb,
size_t size);
void <a class="link" href="rasqal-section-general.html#rasqal-free-memory" title="rasqal_free_memory ()">rasqal_free_memory</a> (void *ptr);
<a class="link" href="rasqal-section-general.html#rasqal-feature" title="enum rasqal_feature">rasqal_feature</a> <a class="link" href="rasqal-section-general.html#rasqal-feature-from-uri" title="rasqal_feature_from_uri ()">rasqal_feature_from_uri</a> (<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-uri.html#raptor-uri"
>raptor_uri</a> *uri);
int <a class="link" href="rasqal-section-general.html#rasqal-feature-value-type" title="rasqal_feature_value_type ()">rasqal_feature_value_type</a> (const <a class="link" href="rasqal-section-general.html#rasqal-feature" title="enum rasqal_feature">rasqal_feature</a> feature);
int <a class="link" href="rasqal-section-general.html#rasqal-features-enumerate" title="rasqal_features_enumerate ()">rasqal_features_enumerate</a> (const <a class="link" href="rasqal-section-general.html#rasqal-feature" title="enum rasqal_feature">rasqal_feature</a> feature,
const char **name,
<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-uri.html#raptor-uri"
>raptor_uri</a> **uri,
const char **label);
unsigned int <a class="link" href="rasqal-section-general.html#rasqal-get-feature-count" title="rasqal_get_feature_count ()">rasqal_get_feature_count</a> (void);
#define <a class="link" href="rasqal-section-general.html#RASQAL-DEPRECATED:CAPS" title="RASQAL_DEPRECATED">RASQAL_DEPRECATED</a>
</pre>
</div>
<div class="refsect1" lang="en">
<a name="rasqal-section-general.description"></a><h2>Description</h2>
<p>
The functions in this section cover general library features such
as startup and shutdown, checking the current library version and
dealing with memory allocation and freeing. It also provides
functions to enumerate and check the supported query languages,
their names, labels and URI.
</p>
</div>
<div class="refsect1" lang="en">
<a name="rasqal-section-general.details"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="rasqal-world"></a><h3>rasqal_world</h3>
<pre class="programlisting">rasqal_world* world;
</pre>
<p>
Rasqal world class.</p>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="rasqal-free-world"></a><h3>rasqal_free_world ()</h3>
<pre class="programlisting">void rasqal_free_world (<a class="link" href="rasqal-section-general.html#rasqal-world" title="rasqal_world">rasqal_world</a> *world);</pre>
<p>
Terminate the rasqal library.
</p>
<p>
Destroys a rasqal_world object and all static information.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>world</code></em> :</span></p></td>
<td> rasqal_world object
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="rasqal-new-world"></a><h3>rasqal_new_world ()</h3>
<pre class="programlisting"><a class="link" href="rasqal-section-general.html#rasqal-world" title="rasqal_world">rasqal_world</a>* rasqal_new_world (void);</pre>
<p>
Initialise the rasqal library.
</p>
<p>
Creates a rasqal_world object and initializes it.
</p>
<p>
The returned world object is used with subsequent rasqal API calls.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> rasqal_world object or NULL on failure
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="rasqal-version-decimal"></a><h3>rasqal_version_decimal</h3>
<pre class="programlisting">extern const unsigned int rasqal_version_decimal;
</pre>
<p>
Library full version as a decimal integer.
</p>
<p>
See also <span class="type">rasqal_version_string</span>.</p>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="rasqal-version-major"></a><h3>rasqal_version_major</h3>
<pre class="programlisting">extern const unsigned int rasqal_version_major;
</pre>
<p>
Library major version number as a decimal integer.</p>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="rasqal-version-minor"></a><h3>rasqal_version_minor</h3>
<pre class="programlisting">extern const unsigned int rasqal_version_minor;
</pre>
<p>
Library minor version number as a decimal integer.</p>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="rasqal-version-release"></a><h3>rasqal_version_release</h3>
<pre class="programlisting">extern const unsigned int rasqal_version_release;
</pre>
<p>
Library release version number as a decimal integer.</p>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="rasqal-feature"></a><h3>enum rasqal_feature</h3>
<pre class="programlisting">typedef enum {
RASQAL_FEATURE_NO_NET,
RASQAL_FEATURE_LAST = RASQAL_FEATURE_NO_NET
} rasqal_feature;
</pre>
<p>
Query features.
</p>
<p>
None currently defined.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="RASQAL-FEATURE-NO-NET:CAPS"></a><span class="term"><code class="literal">RASQAL_FEATURE_NO_NET</code></span></p></td>
<td> Deny network requests.
</td>
</tr>
<tr>
<td><p><a name="RASQAL-FEATURE-LAST:CAPS"></a><span class="term"><code class="literal">RASQAL_FEATURE_LAST</code></span></p></td>
<td> Internal.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="rasqal-language-name-check"></a><h3>rasqal_language_name_check ()</h3>
<pre class="programlisting">int rasqal_language_name_check (<a class="link" href="rasqal-section-general.html#rasqal-world" title="rasqal_world">rasqal_world</a> *world,
const char *name);</pre>
<p>
Check name of a query language.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>world</code></em> :</span></p></td>
<td> rasqal_world object
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
<td> the query language name
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> non 0 if name is a known query language
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="rasqal-languages-enumerate"></a><h3>rasqal_languages_enumerate ()</h3>
<pre class="programlisting">int rasqal_languages_enumerate (<a class="link" href="rasqal-section-general.html#rasqal-world" title="rasqal_world">rasqal_world</a> *world,
unsigned int counter,
const char **name,
const char **label,
unsigned char **uri_string);</pre>
<p>
Get information on query languages.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>world</code></em> :</span></p></td>
<td> rasqal_world object
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>counter</code></em> :</span></p></td>
<td> index into the list of syntaxes
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
<td> pointer to store the name of the syntax (or NULL)
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>label</code></em> :</span></p></td>
<td> pointer to store syntax readable label (or NULL)
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>uri_string</code></em> :</span></p></td>
<td> pointer to store syntax URI string (or NULL)
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> non 0 on failure of if counter is out of range
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="rasqal-alloc-memory"></a><h3>rasqal_alloc_memory ()</h3>
<pre class="programlisting">void* rasqal_alloc_memory (size_t size);</pre>
<p>
Allocate memory inside rasqal.
</p>
<p>
Some systems require memory allocated in a library to
be deallocated in that library. This function allows
memory to be allocated inside the rasqal shared library
that can be freed inside rasqal either internally or via
<a class="link" href="rasqal-section-general.html#rasqal-free-memory" title="rasqal_free_memory ()"><code class="function">rasqal_free_memory()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>size</code></em> :</span></p></td>
<td> size of memory to allocate
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the address of the allocated memory or NULL on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="rasqal-calloc-memory"></a><h3>rasqal_calloc_memory ()</h3>
<pre class="programlisting">void* rasqal_calloc_memory (size_t nmemb,
size_t size);</pre>
<p>
Allocate zeroed array of items inside rasqal.
</p>
<p>
Some systems require memory allocated in a library to
be deallocated in that library. This function allows
memory to be allocated inside the rasqal shared library
that can be freed inside rasqal either internally or via
<a class="link" href="rasqal-section-general.html#rasqal-free-memory" title="rasqal_free_memory ()"><code class="function">rasqal_free_memory()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>nmemb</code></em> :</span></p></td>
<td> number of members
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>size</code></em> :</span></p></td>
<td> size of item
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the address of the allocated memory or NULL on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="rasqal-free-memory"></a><h3>rasqal_free_memory ()</h3>
<pre class="programlisting">void rasqal_free_memory (void *ptr);</pre>
<p>
Free memory allocated inside rasqal.
</p>
<p>
Some systems require memory allocated in a library to
be deallocated in that library. This function allows
memory allocated by rasqal to be freed.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>ptr</code></em> :</span></p></td>
<td> memory pointer
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="rasqal-feature-from-uri"></a><h3>rasqal_feature_from_uri ()</h3>
<pre class="programlisting"><a class="link" href="rasqal-section-general.html#rasqal-feature" title="enum rasqal_feature">rasqal_feature</a> rasqal_feature_from_uri (<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-uri.html#raptor-uri"
>raptor_uri</a> *uri);</pre>
<p>
Turn a feature URI into an feature enum.
</p>
<p>
The allowed feature URIs are available via <a class="link" href="rasqal-section-general.html#rasqal-features-enumerate" title="rasqal_features_enumerate ()"><code class="function">rasqal_features_enumerate()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>uri</code></em> :</span></p></td>
<td> feature URI
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> &lt; 0 if the feature is unknown
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="rasqal-feature-value-type"></a><h3>rasqal_feature_value_type ()</h3>
<pre class="programlisting">int rasqal_feature_value_type (const <a class="link" href="rasqal-section-general.html#rasqal-feature" title="enum rasqal_feature">rasqal_feature</a> feature);</pre>
<p>
Get the type of a features.
</p>
<p>
The type of the <em class="parameter"><code>feature</code></em> is 0=integer , 1=string. Other values are
undefined. Most features are integer values and use
rasqal_query_set_feature <a class="link" href="rasqal-section-query.html#rasqal-query-get-feature" title="rasqal_query_get_feature ()"><code class="function">rasqal_query_get_feature()</code></a></p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>feature</code></em> :</span></p></td>
<td> rasqal query feature
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the type of the feature or &lt;0 if <em class="parameter"><code>feature</code></em> is unknown
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="rasqal-features-enumerate"></a><h3>rasqal_features_enumerate ()</h3>
<pre class="programlisting">int rasqal_features_enumerate (const <a class="link" href="rasqal-section-general.html#rasqal-feature" title="enum rasqal_feature">rasqal_feature</a> feature,
const char **name,
<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-uri.html#raptor-uri"
>raptor_uri</a> **uri,
const char **label);</pre>
<p>
Get list of rasqal features.
</p>
<p>
If uri is not NULL, a pointer to a new raptor_uri is returned
that must be freed by the caller with <a
href="/usr/share/gtk-doc/html/raptor/raptor-section-uri.html#raptor-free-uri"
><code class="function">raptor_free_uri()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>feature</code></em> :</span></p></td>
<td> feature enumeration (0+)
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
<td> pointer to store feature short name (or NULL)
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>uri</code></em> :</span></p></td>
<td> pointer to store feature URI (or NULL)
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>label</code></em> :</span></p></td>
<td> pointer to feature label (or NULL)
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> 0 on success, &lt;0 on failure, &gt;0 if feature is unknown
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="rasqal-get-feature-count"></a><h3>rasqal_get_feature_count ()</h3>
<pre class="programlisting">unsigned int rasqal_get_feature_count (void);</pre>
<p>
Get the count of features defined.
</p>
<p>
This is prefered to the compile time-only symbol <a class="link" href="rasqal-section-general.html#RASQAL-FEATURE-LAST:CAPS"><span class="type">RASQAL_FEATURE_LAST</span></a>
and returns a count of the number of features which is
<a class="link" href="rasqal-section-general.html#RASQAL-FEATURE-LAST:CAPS"><span class="type">RASQAL_FEATURE_LAST</span></a>+1.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> count of features in the <a class="link" href="rasqal-section-general.html#rasqal-feature" title="enum rasqal_feature"><span class="type">rasqal_feature</span></a> enumeration
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="RASQAL-DEPRECATED:CAPS"></a><h3>RASQAL_DEPRECATED</h3>
<pre class="programlisting">#define RASQAL_DEPRECATED</pre>
<p>
When defined before a function, indicates that the function
has been deprecated and may be replaced in a future release.
With some versions of gcc this may give a compilation warning.
</p>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.10</div>
</body>
</html>