MOON
Server: Apache/2.2.31 (Unix) mod_ssl/2.2.31 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4
System: Linux csr818.wilogic.com 2.6.18-419.el5xen #1 SMP Fri Feb 24 22:50:37 UTC 2017 x86_64
User: digitals (531)
PHP: 5.4.45
Disabled: NONE
Upload Files
File: //usr/local/ssl/share/gtk-doc/html/glib/glib-Relations-and-Tuples.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Relations and Tuples</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
<link rel="start" href="index.html" title="GLib Reference Manual">
<link rel="up" href="glib-data-types.html" title="GLib Data Types">
<link rel="prev" href="glib-Datasets.html" title="Datasets">
<link rel="next" href="glib-Caches.html" title="Caches">
<meta name="generator" content="GTK-Doc V1.6 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="glib.html" title="GLib Overview">
<link rel="chapter" href="glib-fundamentals.html" title="GLib Fundamentals">
<link rel="chapter" href="glib-core.html" title="GLib Core Application Support">
<link rel="chapter" href="glib-utilities.html" title="GLib Utilities">
<link rel="chapter" href="glib-data-types.html" title="GLib Data Types">
<link rel="chapter" href="tools.html" title="GLib Tools">
<link rel="index" href="ix01.html" title="Index">
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
<link rel="index" href="ix03.html" title="Index of new symbols in 2.2">
<link rel="index" href="ix04.html" title="Index of new symbols in 2.4">
<link rel="index" href="ix05.html" title="Index of new symbols in 2.6">
<link rel="index" href="ix06.html" title="Index of new symbols in 2.8">
<link rel="index" href="ix07.html" title="Index of new symbols in 2.10">
<link rel="index" href="ix08.html" title="Index of new symbols in 2.12">
</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="glib-Datasets.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="glib-data-types.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">GLib Reference Manual</th>
<td><a accesskey="n" href="glib-Caches.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="#id3302655" class="shortcut">Top</a>
                  &#160;|&#160;
                  <a href="#id3303016" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="glib-Relations-and-Tuples"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id3302655"></a><span class="refentrytitle">Relations and Tuples</span>
</h2>
<p>Relations and Tuples &#8212; tables of data which can be indexed on any number of fields.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">

#include &lt;glib.h&gt;


            <a href="glib-Relations-and-Tuples.html#GRelation">GRelation</a>;
<a href="glib-Relations-and-Tuples.html#GRelation">GRelation</a>*  <a href="glib-Relations-and-Tuples.html#g-relation-new">g_relation_new</a>                  (<a href="glib-Basic-Types.html#gint">gint</a> fields);
void        <a href="glib-Relations-and-Tuples.html#g-relation-index">g_relation_index</a>                (<a href="glib-Relations-and-Tuples.html#GRelation">GRelation</a> *relation,
                                             <a href="glib-Basic-Types.html#gint">gint</a> field,
                                             <a href="glib-Hash-Tables.html#GHashFunc">GHashFunc</a> hash_func,
                                             <a href="glib-Hash-Tables.html#GEqualFunc">GEqualFunc</a> key_equal_func);
void        <a href="glib-Relations-and-Tuples.html#g-relation-insert">g_relation_insert</a>               (<a href="glib-Relations-and-Tuples.html#GRelation">GRelation</a> *relation,
                                             ...);
<a href="glib-Basic-Types.html#gboolean">gboolean</a>    <a href="glib-Relations-and-Tuples.html#g-relation-exists">g_relation_exists</a>               (<a href="glib-Relations-and-Tuples.html#GRelation">GRelation</a> *relation,
                                             ...);
<a href="glib-Basic-Types.html#gint">gint</a>        <a href="glib-Relations-and-Tuples.html#g-relation-count">g_relation_count</a>                (<a href="glib-Relations-and-Tuples.html#GRelation">GRelation</a> *relation,
                                             <a href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> key,
                                             <a href="glib-Basic-Types.html#gint">gint</a> field);
<a href="glib-Relations-and-Tuples.html#GTuples">GTuples</a>*    <a href="glib-Relations-and-Tuples.html#g-relation-select">g_relation_select</a>               (<a href="glib-Relations-and-Tuples.html#GRelation">GRelation</a> *relation,
                                             <a href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> key,
                                             <a href="glib-Basic-Types.html#gint">gint</a> field);
<a href="glib-Basic-Types.html#gint">gint</a>        <a href="glib-Relations-and-Tuples.html#g-relation-delete">g_relation_delete</a>               (<a href="glib-Relations-and-Tuples.html#GRelation">GRelation</a> *relation,
                                             <a href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> key,
                                             <a href="glib-Basic-Types.html#gint">gint</a> field);
void        <a href="glib-Relations-and-Tuples.html#g-relation-destroy">g_relation_destroy</a>              (<a href="glib-Relations-and-Tuples.html#GRelation">GRelation</a> *relation);

void        <a href="glib-Relations-and-Tuples.html#g-relation-print">g_relation_print</a>                (<a href="glib-Relations-and-Tuples.html#GRelation">GRelation</a> *relation);

            <a href="glib-Relations-and-Tuples.html#GTuples">GTuples</a>;
void        <a href="glib-Relations-and-Tuples.html#g-tuples-destroy">g_tuples_destroy</a>                (<a href="glib-Relations-and-Tuples.html#GTuples">GTuples</a> *tuples);
<a href="glib-Basic-Types.html#gpointer">gpointer</a>    <a href="glib-Relations-and-Tuples.html#g-tuples-index">g_tuples_index</a>                  (<a href="glib-Relations-and-Tuples.html#GTuples">GTuples</a> *tuples,
                                             <a href="glib-Basic-Types.html#gint">gint</a> index_,
                                             <a href="glib-Basic-Types.html#gint">gint</a> field);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3303016"></a><h2>Description</h2>
<p>
A <a href="glib-Relations-and-Tuples.html#GRelation"><span class="type">GRelation</span></a> is a table of data which can be indexed on any number of fields,
rather like simple database tables. A <a href="glib-Relations-and-Tuples.html#GRelation"><span class="type">GRelation</span></a> contains a number of
records, called tuples. Each record contains a number of fields.
Records are not ordered, so it is not possible to find the record at a
particular index.
</p>
<p>
Note that <a href="glib-Relations-and-Tuples.html#GRelation"><span class="type">GRelation</span></a> tables are currently limited to 2 fields.
</p>
<p>
To create a GRelation, use <a href="glib-Relations-and-Tuples.html#g-relation-new"><code class="function">g_relation_new()</code></a>.
</p>
<p>
To specify which fields should be indexed, use <a href="glib-Relations-and-Tuples.html#g-relation-index"><code class="function">g_relation_index()</code></a>.
Note that this must be called before any tuples are added to the <a href="glib-Relations-and-Tuples.html#GRelation"><span class="type">GRelation</span></a>.
</p>
<p>
To add records to a <a href="glib-Relations-and-Tuples.html#GRelation"><span class="type">GRelation</span></a> use <a href="glib-Relations-and-Tuples.html#g-relation-insert"><code class="function">g_relation_insert()</code></a>.
</p>
<p>
To determine if a given record appears in a <a href="glib-Relations-and-Tuples.html#GRelation"><span class="type">GRelation</span></a>, use
<a href="glib-Relations-and-Tuples.html#g-relation-exists"><code class="function">g_relation_exists()</code></a>. Note that fields are compared directly, so pointers
must point to the exact same position (i.e. different copies of the same
string will not match.)
</p>
<p>
To count the number of records which have a particular value in a given
field, use <a href="glib-Relations-and-Tuples.html#g-relation-count"><code class="function">g_relation_count()</code></a>.
</p>
<p>
To get all the records which have a particular value in a given field,
use <a href="glib-Relations-and-Tuples.html#g-relation-select"><code class="function">g_relation_select()</code></a>. To access fields of the resulting records,
use <a href="glib-Relations-and-Tuples.html#g-tuples-index"><code class="function">g_tuples_index()</code></a>. To free the resulting records use <a href="glib-Relations-and-Tuples.html#g-tuples-destroy"><code class="function">g_tuples_destroy()</code></a>.
</p>
<p>
To delete all records which have a particular value in a given field,
use <a href="glib-Relations-and-Tuples.html#g-relation-delete"><code class="function">g_relation_delete()</code></a>.
</p>
<p>
To destroy the <a href="glib-Relations-and-Tuples.html#GRelation"><span class="type">GRelation</span></a>, use <a href="glib-Relations-and-Tuples.html#g-relation-destroy"><code class="function">g_relation_destroy()</code></a>.
</p>
<p>
To help debug <a href="glib-Relations-and-Tuples.html#GRelation"><span class="type">GRelation</span></a> objects, use <a href="glib-Relations-and-Tuples.html#g-relation-print"><code class="function">g_relation_print()</code></a>.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id3303260"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id3303270"></a><h3>
<a name="GRelation"></a>GRelation</h3>
<a class="indexterm" name="id3303283"></a><pre class="programlisting">typedef struct _GRelation GRelation;</pre>
<p>
The <a href="glib-Relations-and-Tuples.html#GRelation"><span class="type">GRelation</span></a> struct is an opaque data structure to represent a
<a href="glib-Relations-and-Tuples.html" title="Relations and Tuples">Relation</a>.
It should only be accessed via the following functions.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3303317"></a><h3>
<a name="g-relation-new"></a>g_relation_new ()</h3>
<a class="indexterm" name="id3303329"></a><pre class="programlisting"><a href="glib-Relations-and-Tuples.html#GRelation">GRelation</a>*  g_relation_new                  (<a href="glib-Basic-Types.html#gint">gint</a> fields);</pre>
<p>
Creates a new <a href="glib-Relations-and-Tuples.html#GRelation"><span class="type">GRelation</span></a> with the given number of fields.
Note that currently the number of fields must be 2.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>fields</code></em>&#160;:</span></td>
<td>the number of fields.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td>a new <a href="glib-Relations-and-Tuples.html#GRelation"><span class="type">GRelation</span></a>.


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3303404"></a><h3>
<a name="g-relation-index"></a>g_relation_index ()</h3>
<a class="indexterm" name="id3303416"></a><pre class="programlisting">void        g_relation_index                (<a href="glib-Relations-and-Tuples.html#GRelation">GRelation</a> *relation,
                                             <a href="glib-Basic-Types.html#gint">gint</a> field,
                                             <a href="glib-Hash-Tables.html#GHashFunc">GHashFunc</a> hash_func,
                                             <a href="glib-Hash-Tables.html#GEqualFunc">GEqualFunc</a> key_equal_func);</pre>
<p>
Creates an index on the given field.
Note that this must be called before any records are added to the <a href="glib-Relations-and-Tuples.html#GRelation"><span class="type">GRelation</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>relation</code></em>&#160;:</span></td>
<td>a <a href="glib-Relations-and-Tuples.html#GRelation"><span class="type">GRelation</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>field</code></em>&#160;:</span></td>
<td>the field to index, counting from 0.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>hash_func</code></em>&#160;:</span></td>
<td>a function to produce a hash value from the field data.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>key_equal_func</code></em>&#160;:</span></td>
<td>a function to compare two values of the given field.


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3303546"></a><h3>
<a name="g-relation-insert"></a>g_relation_insert ()</h3>
<a class="indexterm" name="id3303559"></a><pre class="programlisting">void        g_relation_insert               (<a href="glib-Relations-and-Tuples.html#GRelation">GRelation</a> *relation,
                                             ...);</pre>
<p>
Inserts a record into a <a href="glib-Relations-and-Tuples.html#GRelation"><span class="type">GRelation</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>relation</code></em>&#160;:</span></td>
<td>a <a href="glib-Relations-and-Tuples.html#GRelation"><span class="type">GRelation</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>...</code></em>&#160;:</span></td>
<td>the fields of the record to add. These must match the number of
fields in the <a href="glib-Relations-and-Tuples.html#GRelation"><span class="type">GRelation</span></a>, and of type <a href="glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> or <a href="glib-Basic-Types.html#gconstpointer"><span class="type">gconstpointer</span></a>.


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3303660"></a><h3>
<a name="g-relation-exists"></a>g_relation_exists ()</h3>
<a class="indexterm" name="id3303674"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a>    g_relation_exists               (<a href="glib-Relations-and-Tuples.html#GRelation">GRelation</a> *relation,
                                             ...);</pre>
<p>
Returns <a href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if a record with the given values exists in a <a href="glib-Relations-and-Tuples.html#GRelation"><span class="type">GRelation</span></a>.
Note that the values are compared directly, so that, for example, two
copies of the same string will not match.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>relation</code></em>&#160;:</span></td>
<td>a <a href="glib-Relations-and-Tuples.html#GRelation"><span class="type">GRelation</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>...</code></em>&#160;:</span></td>
<td>the fields of the record to compare. The number must match the
number of fields in the <a href="glib-Relations-and-Tuples.html#GRelation"><span class="type">GRelation</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td>
<a href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if a record matches.


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3303791"></a><h3>
<a name="g-relation-count"></a>g_relation_count ()</h3>
<a class="indexterm" name="id3303804"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gint">gint</a>        g_relation_count                (<a href="glib-Relations-and-Tuples.html#GRelation">GRelation</a> *relation,
                                             <a href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> key,
                                             <a href="glib-Basic-Types.html#gint">gint</a> field);</pre>
<p>
Returns the number of tuples in a <a href="glib-Relations-and-Tuples.html#GRelation"><span class="type">GRelation</span></a> that have the given value
in the given field.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>relation</code></em>&#160;:</span></td>
<td>a <a href="glib-Relations-and-Tuples.html#GRelation"><span class="type">GRelation</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>key</code></em>&#160;:</span></td>
<td>the value to compare with.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>field</code></em>&#160;:</span></td>
<td>the field of each record to match.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td>the number of matches.


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3303921"></a><h3>
<a name="g-relation-select"></a>g_relation_select ()</h3>
<a class="indexterm" name="id3303935"></a><pre class="programlisting"><a href="glib-Relations-and-Tuples.html#GTuples">GTuples</a>*    g_relation_select               (<a href="glib-Relations-and-Tuples.html#GRelation">GRelation</a> *relation,
                                             <a href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> key,
                                             <a href="glib-Basic-Types.html#gint">gint</a> field);</pre>
<p>
Returns all of the tuples which have the given key in the given field.
Use <a href="glib-Relations-and-Tuples.html#g-tuples-index"><code class="function">g_tuples_index()</code></a> to access the returned records.
The returned records should be freed with <a href="glib-Relations-and-Tuples.html#g-tuples-destroy"><code class="function">g_tuples_destroy()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>relation</code></em>&#160;:</span></td>
<td>a <a href="glib-Relations-and-Tuples.html#GRelation"><span class="type">GRelation</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>key</code></em>&#160;:</span></td>
<td>the value to compare with.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>field</code></em>&#160;:</span></td>
<td>the field of each record to match.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td>the records (tuples) that matched.


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3304066"></a><h3>
<a name="g-relation-delete"></a>g_relation_delete ()</h3>
<a class="indexterm" name="id3304079"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gint">gint</a>        g_relation_delete               (<a href="glib-Relations-and-Tuples.html#GRelation">GRelation</a> *relation,
                                             <a href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> key,
                                             <a href="glib-Basic-Types.html#gint">gint</a> field);</pre>
<p>
Deletes any records from a <a href="glib-Relations-and-Tuples.html#GRelation"><span class="type">GRelation</span></a> that have the given key value in
the given field.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>relation</code></em>&#160;:</span></td>
<td>a <a href="glib-Relations-and-Tuples.html#GRelation"><span class="type">GRelation</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>key</code></em>&#160;:</span></td>
<td>the value to compare with.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>field</code></em>&#160;:</span></td>
<td>the field of each record to match.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td>the number of records deleted.


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3304196"></a><h3>
<a name="g-relation-destroy"></a>g_relation_destroy ()</h3>
<a class="indexterm" name="id3304209"></a><pre class="programlisting">void        g_relation_destroy              (<a href="glib-Relations-and-Tuples.html#GRelation">GRelation</a> *relation);</pre>
<p>
Destroys the <a href="glib-Relations-and-Tuples.html#GRelation"><span class="type">GRelation</span></a>, freeing all memory allocated.
However, it does not free memory allocated for the
tuple data, so you should free that first if appropriate.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>relation</code></em>&#160;:</span></td>
<td>a <a href="glib-Relations-and-Tuples.html#GRelation"><span class="type">GRelation</span></a>.


</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3304274"></a><h3>
<a name="g-relation-print"></a>g_relation_print ()</h3>
<a class="indexterm" name="id3304287"></a><pre class="programlisting">void        g_relation_print                (<a href="glib-Relations-and-Tuples.html#GRelation">GRelation</a> *relation);</pre>
<p>
Outputs information about all records in a <a href="glib-Relations-and-Tuples.html#GRelation"><span class="type">GRelation</span></a>, as well as the indexes.
It is for debugging.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>relation</code></em>&#160;:</span></td>
<td>a <a href="glib-Relations-and-Tuples.html#GRelation"><span class="type">GRelation</span></a>.


</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3304350"></a><h3>
<a name="GTuples"></a>GTuples</h3>
<a class="indexterm" name="id3304363"></a><pre class="programlisting">typedef struct {
  guint len;
} GTuples;
</pre>
<p>
The <a href="glib-Relations-and-Tuples.html#GTuples"><span class="type">GTuples</span></a> struct is used to return records (or tuples) from the
<a href="glib-Relations-and-Tuples.html#GRelation"><span class="type">GRelation</span></a> by <a href="glib-Relations-and-Tuples.html#g-relation-select"><code class="function">g_relation_select()</code></a>.
It only contains one public member - the number of records that matched.
To access the matched records, you must use <a href="glib-Relations-and-Tuples.html#g-tuples-index"><code class="function">g_tuples_index()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><a href="glib-Basic-Types.html#guint">guint</a>&#160;<em class="structfield"><code>len</code></em>;</span></td>
<td>the number of records that matched.

</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3304443"></a><h3>
<a name="g-tuples-destroy"></a>g_tuples_destroy ()</h3>
<a class="indexterm" name="id3304455"></a><pre class="programlisting">void        g_tuples_destroy                (<a href="glib-Relations-and-Tuples.html#GTuples">GTuples</a> *tuples);</pre>
<p>
Frees the records which were returned by <a href="glib-Relations-and-Tuples.html#g-relation-select"><code class="function">g_relation_select()</code></a>.
This should always be called after <a href="glib-Relations-and-Tuples.html#g-relation-select"><code class="function">g_relation_select()</code></a> when you are
finished with the records.
The records are not removed from the <a href="glib-Relations-and-Tuples.html#GRelation"><span class="type">GRelation</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>tuples</code></em>&#160;:</span></td>
<td>the tuple data to free.


</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3304533"></a><h3>
<a name="g-tuples-index"></a>g_tuples_index ()</h3>
<a class="indexterm" name="id3304546"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gpointer">gpointer</a>    g_tuples_index                  (<a href="glib-Relations-and-Tuples.html#GTuples">GTuples</a> *tuples,
                                             <a href="glib-Basic-Types.html#gint">gint</a> index_,
                                             <a href="glib-Basic-Types.html#gint">gint</a> field);</pre>
<p>
Gets a field from the records returned by <a href="glib-Relations-and-Tuples.html#g-relation-select"><code class="function">g_relation_select()</code></a>.
It returns the given field of the record at the given index.
The returned value should not be changed.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>tuples</code></em>&#160;:</span></td>
<td>the tuple data, returned by <a href="glib-Relations-and-Tuples.html#g-relation-select"><code class="function">g_relation_select()</code></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>index_</code></em>&#160;:</span></td>
<td>the index of the record.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>field</code></em>&#160;:</span></td>
<td>the field to return.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td>the field of the record.


</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
</body>
</html>