1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-08 08:02:39 +02:00
audacity/lib-src/redland/docs/html/redland-list.html
2010-01-24 09:19:39 +00:00

460 lines
20 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>List</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
<link rel="start" href="index.html" title="Redland RDF Library Manual">
<link rel="up" href="reference-manual.html" title="Part II. Reference Manual">
<link rel="prev" href="redland-iterator.html" title="Iterator">
<link rel="next" href="redland-log.html" title="Logging.">
<meta name="generator" content="GTK-Doc V1.10 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="redland.html" title="Redland Overview">
<link rel="chapter" href="introduction.html" title="Introduction">
<link rel="part" href="tutorial.html" title="Part I. Tutorial">
<link rel="part" href="reference-manual.html" title="Part II. Reference Manual">
<link rel="chapter" href="objects.html" title="Objects in C">
<link rel="chapter" href="redland-storage-modules.html" title="Storage Modules">
<link rel="index" href="indexes.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="redland-iterator.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="reference-manual.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">Redland RDF Library Manual</th>
<td><a accesskey="n" href="redland-log.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="#redland-list.synopsis" class="shortcut">Top</a>
 | 
<a href="#redland-list.description" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="redland-list"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="redland-list.top_of_page"></a>List</span></h2>
<p>List — Simple list class.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="redland-list.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
typedef <a class="link" href="redland-list.html#librdf-list" title="librdf_list">librdf_list</a>;
<a class="link" href="redland-list.html#librdf-list" title="librdf_list">librdf_list</a>* <a class="link" href="redland-list.html#librdf-new-list" title="librdf_new_list ()">librdf_new_list</a> (<a class="link" href="redland-world.html#librdf-world" title="librdf_world">librdf_world</a> *world);
void <a class="link" href="redland-list.html#librdf-free-list" title="librdf_free_list ()">librdf_free_list</a> (<a class="link" href="redland-list.html#librdf-list" title="librdf_list">librdf_list</a> *list);
void <a class="link" href="redland-list.html#librdf-list-clear" title="librdf_list_clear ()">librdf_list_clear</a> (<a class="link" href="redland-list.html#librdf-list" title="librdf_list">librdf_list</a> *list);
int <a class="link" href="redland-list.html#librdf-list-add" title="librdf_list_add ()">librdf_list_add</a> (<a class="link" href="redland-list.html#librdf-list" title="librdf_list">librdf_list</a> *list,
void *data);
int <a class="link" href="redland-list.html#librdf-list-unshift" title="librdf_list_unshift ()">librdf_list_unshift</a> (<a class="link" href="redland-list.html#librdf-list" title="librdf_list">librdf_list</a> *list,
void *data);
void* <a class="link" href="redland-list.html#librdf-list-shift" title="librdf_list_shift ()">librdf_list_shift</a> (<a class="link" href="redland-list.html#librdf-list" title="librdf_list">librdf_list</a> *list);
void* <a class="link" href="redland-list.html#librdf-list-pop" title="librdf_list_pop ()">librdf_list_pop</a> (<a class="link" href="redland-list.html#librdf-list" title="librdf_list">librdf_list</a> *list);
void* <a class="link" href="redland-list.html#librdf-list-remove" title="librdf_list_remove ()">librdf_list_remove</a> (<a class="link" href="redland-list.html#librdf-list" title="librdf_list">librdf_list</a> *list,
void *data);
int <a class="link" href="redland-list.html#librdf-list-contains" title="librdf_list_contains ()">librdf_list_contains</a> (<a class="link" href="redland-list.html#librdf-list" title="librdf_list">librdf_list</a> *list,
void *data);
int <a class="link" href="redland-list.html#librdf-list-size" title="librdf_list_size ()">librdf_list_size</a> (<a class="link" href="redland-list.html#librdf-list" title="librdf_list">librdf_list</a> *list);
void <a class="link" href="redland-list.html#librdf-list-set-equals" title="librdf_list_set_equals ()">librdf_list_set_equals</a> (<a class="link" href="redland-list.html#librdf-list" title="librdf_list">librdf_list</a> *list,
int (equalsvoid* data1, void *data2) ());
<a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator">librdf_iterator</a>* <a class="link" href="redland-list.html#librdf-list-get-iterator" title="librdf_list_get_iterator ()">librdf_list_get_iterator</a> (<a class="link" href="redland-list.html#librdf-list" title="librdf_list">librdf_list</a> *list);
void <a class="link" href="redland-list.html#librdf-list-foreach" title="librdf_list_foreach ()">librdf_list_foreach</a> (<a class="link" href="redland-list.html#librdf-list" title="librdf_list">librdf_list</a> *list,
void (fnvoid *, void *) (),
void *user_data);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="redland-list.description"></a><h2>Description</h2>
<p>
A simple list class used internally.
</p>
</div>
<div class="refsect1" lang="en">
<a name="redland-list.details"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="librdf-list"></a><h3>librdf_list</h3>
<pre class="programlisting">typedef struct librdf_list_s librdf_list;
</pre>
<p>
Redland list class.</p>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="librdf-new-list"></a><h3>librdf_new_list ()</h3>
<pre class="programlisting"><a class="link" href="redland-list.html#librdf-list" title="librdf_list">librdf_list</a>* librdf_new_list (<a class="link" href="redland-world.html#librdf-world" title="librdf_world">librdf_world</a> *world);</pre>
<p>
Constructor - create a new <a class="link" href="redland-list.html#librdf-list" title="librdf_list"><span class="type">librdf_list</span></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>world</code></em> :</span></p></td>
<td> redland world object
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a new <a class="link" href="redland-list.html#librdf-list" title="librdf_list"><span class="type">librdf_list</span></a> or NULL on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="librdf-free-list"></a><h3>librdf_free_list ()</h3>
<pre class="programlisting">void librdf_free_list (<a class="link" href="redland-list.html#librdf-list" title="librdf_list">librdf_list</a> *list);</pre>
<p>
Destructor - destroy a <a class="link" href="redland-list.html#librdf-list" title="librdf_list"><span class="type">librdf_list</span></a> object.</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>list</code></em> :</span></p></td>
<td> <a class="link" href="redland-list.html#librdf-list" title="librdf_list"><span class="type">librdf_list</span></a> object
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="librdf-list-clear"></a><h3>librdf_list_clear ()</h3>
<pre class="programlisting">void librdf_list_clear (<a class="link" href="redland-list.html#librdf-list" title="librdf_list">librdf_list</a> *list);</pre>
<p>
Empty an librdf_list.</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>list</code></em> :</span></p></td>
<td> <a class="link" href="redland-list.html#librdf-list" title="librdf_list"><span class="type">librdf_list</span></a> object
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="librdf-list-add"></a><h3>librdf_list_add ()</h3>
<pre class="programlisting">int librdf_list_add (<a class="link" href="redland-list.html#librdf-list" title="librdf_list">librdf_list</a> *list,
void *data);</pre>
<p>
Add a data item to the end of a librdf_list.
</p>
<p>
Equivalent to the list 'push' notion, thus if <a class="link" href="redland-list.html#librdf-list-pop" title="librdf_list_pop ()"><code class="function">librdf_list_pop()</code></a>
is called after this, it will return the value added here.</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>list</code></em> :</span></p></td>
<td> <a class="link" href="redland-list.html#librdf-list" title="librdf_list"><span class="type">librdf_list</span></a> object
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td> the data value
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> non 0 on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="librdf-list-unshift"></a><h3>librdf_list_unshift ()</h3>
<pre class="programlisting">int librdf_list_unshift (<a class="link" href="redland-list.html#librdf-list" title="librdf_list">librdf_list</a> *list,
void *data);</pre>
<p>
Add a data item to the start of a librdf_list.
</p>
<p>
if <a class="link" href="redland-list.html#librdf-list-shift" title="librdf_list_shift ()"><code class="function">librdf_list_shift()</code></a> is called after this, it will return the value
added here.</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>list</code></em> :</span></p></td>
<td> <a class="link" href="redland-list.html#librdf-list" title="librdf_list"><span class="type">librdf_list</span></a> object
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td> the data value
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> non 0 on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="librdf-list-shift"></a><h3>librdf_list_shift ()</h3>
<pre class="programlisting">void* librdf_list_shift (<a class="link" href="redland-list.html#librdf-list" title="librdf_list">librdf_list</a> *list);</pre>
<p>
Remove and return the data at the start of the list.</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>list</code></em> :</span></p></td>
<td> <a class="link" href="redland-list.html#librdf-list" title="librdf_list"><span class="type">librdf_list</span></a> object
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the data object or NULL if the list is empty
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="librdf-list-pop"></a><h3>librdf_list_pop ()</h3>
<pre class="programlisting">void* librdf_list_pop (<a class="link" href="redland-list.html#librdf-list" title="librdf_list">librdf_list</a> *list);</pre>
<p>
Remove and return the data at the end of the list.</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>list</code></em> :</span></p></td>
<td> <a class="link" href="redland-list.html#librdf-list" title="librdf_list"><span class="type">librdf_list</span></a> object
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the data object or NULL if the list is empty
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="librdf-list-remove"></a><h3>librdf_list_remove ()</h3>
<pre class="programlisting">void* librdf_list_remove (<a class="link" href="redland-list.html#librdf-list" title="librdf_list">librdf_list</a> *list,
void *data);</pre>
<p>
Remove a data item from an librdf_list.
</p>
<p>
The search is done using the 'equals' function which may be set
by <a class="link" href="redland-list.html#librdf-list-set-equals" title="librdf_list_set_equals ()"><code class="function">librdf_list_set_equals()</code></a> or by straight comparison of pointers
if not set.</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>list</code></em> :</span></p></td>
<td> <a class="link" href="redland-list.html#librdf-list" title="librdf_list"><span class="type">librdf_list</span></a> object
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td> the data item
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the data stored or NULL on failure (not found or list empty)
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="librdf-list-contains"></a><h3>librdf_list_contains ()</h3>
<pre class="programlisting">int librdf_list_contains (<a class="link" href="redland-list.html#librdf-list" title="librdf_list">librdf_list</a> *list,
void *data);</pre>
<p>
Check for presence of data item in list.
</p>
<p>
The search is done using the 'equals' function which may be set
by <a class="link" href="redland-list.html#librdf-list-set-equals" title="librdf_list_set_equals ()"><code class="function">librdf_list_set_equals()</code></a> or by straight comparison of pointers
if not set.</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>list</code></em> :</span></p></td>
<td> <a class="link" href="redland-list.html#librdf-list" title="librdf_list"><span class="type">librdf_list</span></a> object
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td> the data value
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> non 0 if item was found
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="librdf-list-size"></a><h3>librdf_list_size ()</h3>
<pre class="programlisting">int librdf_list_size (<a class="link" href="redland-list.html#librdf-list" title="librdf_list">librdf_list</a> *list);</pre>
<p>
Return the length of the list.</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>list</code></em> :</span></p></td>
<td> <a class="link" href="redland-list.html#librdf-list" title="librdf_list"><span class="type">librdf_list</span></a> object
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> length of the list
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="librdf-list-set-equals"></a><h3>librdf_list_set_equals ()</h3>
<pre class="programlisting">void librdf_list_set_equals (<a class="link" href="redland-list.html#librdf-list" title="librdf_list">librdf_list</a> *list,
int (equalsvoid* data1, void *data2) ());</pre>
<p>
Set the equals function for the list.
</p>
<p>
The function given is used when comparing items in the list
during searches such as those done in <a class="link" href="redland-list.html#librdf-list-remove" title="librdf_list_remove ()"><code class="function">librdf_list_remove()</code></a> or
<a class="link" href="redland-list.html#librdf-list-contains" title="librdf_list_contains ()"><code class="function">librdf_list_contains()</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>list</code></em> :</span></p></td>
<td> <a class="link" href="redland-list.html#librdf-list" title="librdf_list"><span class="type">librdf_list</span></a> object
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>equals</code></em> :</span></p></td>
<td> the equals function
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="librdf-list-get-iterator"></a><h3>librdf_list_get_iterator ()</h3>
<pre class="programlisting"><a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator">librdf_iterator</a>* librdf_list_get_iterator (<a class="link" href="redland-list.html#librdf-list" title="librdf_list">librdf_list</a> *list);</pre>
<p>
Get an iterator for the list.</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>list</code></em> :</span></p></td>
<td> <a class="link" href="redland-list.html#librdf-list" title="librdf_list"><span class="type">librdf_list</span></a> object
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a new <a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> object or NULL on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="librdf-list-foreach"></a><h3>librdf_list_foreach ()</h3>
<pre class="programlisting">void librdf_list_foreach (<a class="link" href="redland-list.html#librdf-list" title="librdf_list">librdf_list</a> *list,
void (fnvoid *, void *) (),
void *user_data);</pre>
<p>
Apply a function for each data item in a librdf_list.</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>list</code></em> :</span></p></td>
<td> <a class="link" href="redland-list.html#librdf-list" title="librdf_list"><span class="type">librdf_list</span></a> object
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>fn</code></em> :</span></p></td>
<td> pointer to function to apply that takes data pointer and user data parameters
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td> user data for applied function
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.10</div>
</body>
</html>