Software: Apache/2.0.54 (Fedora). PHP/5.0.4 uname -a: Linux mina-info.me 2.6.17-1.2142_FC4smp #1 SMP Tue Jul 11 22:57:02 EDT 2006 i686 uid=48(apache) gid=48(apache) groups=48(apache) Safe-mode: OFF (not secure) /usr/share/gtk-doc/html/glib/ drwxr-xr-x |
Viewing file: Select action/file-type:
Synopsis#include <glib.h> GRelation; GRelation* g_relation_new (gint fields); void g_relation_index (GRelation *relation, gint field, GHashFunc hash_func, GEqualFunc key_equal_func); void g_relation_insert (GRelation *relation, ...); gboolean g_relation_exists (GRelation *relation, ...); gint g_relation_count (GRelation *relation, gconstpointer key, gint field); GTuples* g_relation_select (GRelation *relation, gconstpointer key, gint field); gint g_relation_delete (GRelation *relation, gconstpointer key, gint field); void g_relation_destroy (GRelation *relation); void g_relation_print (GRelation *relation); GTuples; void g_tuples_destroy (GTuples *tuples); gpointer g_tuples_index (GTuples *tuples, gint index_, gint field); DescriptionA GRelation is a table of data which can be indexed on any number of fields, rather like simple database tables. A GRelation 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. Note that GRelation tables are currently limited to 2 fields.
To create a GRelation, use
To specify which fields should be indexed, use
To add records to a GRelation use
To determine if a given record appears in a GRelation, use
To count the number of records which have a particular value in a given
field, use
To get all the records which have a particular value in a given field,
use
To delete all records which have a particular value in a given field,
use
To destroy the GRelation, use
To help debug GRelation objects, use DetailsGRelationtypedef struct _GRelation GRelation; The GRelation struct is an opaque data structure to represent a Relation. It should only be accessed via the following functions. g_relation_new ()GRelation* g_relation_new (gint fields); Creates a new GRelation with the given number of fields. Note that currently the number of fields must be 2.
g_relation_index ()void g_relation_index (GRelation *relation, gint field, GHashFunc hash_func, GEqualFunc key_equal_func); Creates an index on the given field. Note that this must be called before any records are added to the GRelation.
g_relation_insert ()void g_relation_insert (GRelation *relation, ...); Inserts a record into a GRelation. g_relation_exists ()gboolean g_relation_exists (GRelation *relation, ...);
Returns g_relation_count ()gint g_relation_count (GRelation *relation, gconstpointer key, gint field); Returns the number of tuples in a GRelation that have the given value in the given field.
g_relation_select ()GTuples* g_relation_select (GRelation *relation, gconstpointer key, gint field);
Returns all of the tuples which have the given key in the given field.
Use
g_relation_delete ()gint g_relation_delete (GRelation *relation, gconstpointer key, gint field); Deletes any records from a GRelation that have the given key value in the given field.
g_relation_destroy ()void g_relation_destroy (GRelation *relation); Destroys the GRelation, freeing all memory allocated. However, it does not free memory allocated for the tuple data, so you should free that first if appropriate.
g_relation_print ()void g_relation_print (GRelation *relation); Outputs information about all records in a GRelation, as well as the indexes. It is for debugging.
GTuplestypedef struct { guint len; } GTuples;
The GTuples struct is used to return records (or tuples) from the
GRelation by
g_tuples_destroy ()void g_tuples_destroy (GTuples *tuples);
Frees the records which were returned by
g_tuples_index ()gpointer g_tuples_index (GTuples *tuples, gint index_, gint field);
Gets a field from the records returned by
|
:: Command execute :: | |
--[ c99shell v. 1.0 pre-release build #16 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0036 ]-- |