Redland RDF Library Manual | ||||
---|---|---|---|---|
Top | Description |
typedef librdf_list; librdf_list * librdf_new_list (librdf_world *world
); void librdf_free_list (librdf_list *list
); void librdf_list_clear (librdf_list *list
); int librdf_list_add (librdf_list *list
,void *data
); int librdf_list_unshift (librdf_list *list
,void *data
); void * librdf_list_shift (librdf_list *list
); void * librdf_list_pop (librdf_list *list
); void * librdf_list_remove (librdf_list *list
,void *data
); int librdf_list_contains (librdf_list *list
,void *data
); int librdf_list_size (librdf_list *list
); void librdf_list_set_equals (librdf_list *list
,int (*equals) (void* data1, void *data2)
); librdf_iterator * librdf_list_get_iterator (librdf_list *list
); void librdf_list_foreach (librdf_list *list
,void (*fn) (void *, void *)
,void *user_data
);
librdf_list * librdf_new_list (librdf_world *world
);
Constructor - create a new librdf_list.
|
redland world object |
Returns : |
a new librdf_list or NULL on failure |
void librdf_free_list (librdf_list *list
);
Destructor - destroy a librdf_list object.
|
librdf_list object |
void librdf_list_clear (librdf_list *list
);
Empty an librdf_list.
|
librdf_list object |
int librdf_list_add (librdf_list *list
,void *data
);
Add a data item to the end of a librdf_list.
Equivalent to the list 'push' notion, thus if librdf_list_pop()
is called after this, it will return the value added here.
|
librdf_list object |
|
the data value |
Returns : |
non 0 on failure |
int librdf_list_unshift (librdf_list *list
,void *data
);
Add a data item to the start of a librdf_list.
if librdf_list_shift()
is called after this, it will return the value
added here.
|
librdf_list object |
|
the data value |
Returns : |
non 0 on failure |
void * librdf_list_shift (librdf_list *list
);
Remove and return the data at the start of the list.
|
librdf_list object |
Returns : |
the data object or NULL if the list is empty |
void * librdf_list_pop (librdf_list *list
);
Remove and return the data at the end of the list.
|
librdf_list object |
Returns : |
the data object or NULL if the list is empty |
void * librdf_list_remove (librdf_list *list
,void *data
);
Remove a data item from an librdf_list.
The search is done using the 'equals' function which may be set
by librdf_list_set_equals()
or by straight comparison of pointers
if not set.
|
librdf_list object |
|
the data item |
Returns : |
the data stored or NULL on failure (not found or list empty) |
int librdf_list_contains (librdf_list *list
,void *data
);
Check for presence of data item in list.
The search is done using the 'equals' function which may be set
by librdf_list_set_equals()
or by straight comparison of pointers
if not set.
|
librdf_list object |
|
the data value |
Returns : |
non 0 if item was found |
int librdf_list_size (librdf_list *list
);
Return the length of the list.
|
librdf_list object |
Returns : |
length of the list |
void librdf_list_set_equals (librdf_list *list
,int (*equals) (void* data1, void *data2)
);
Set the equals function for the list.
The function given is used when comparing items in the list
during searches such as those done in librdf_list_remove()
or
librdf_list_contains()
.
|
librdf_list object |
|
the equals function |
librdf_iterator * librdf_list_get_iterator (librdf_list *list
);
Get an iterator for the list.
|
librdf_list object |
Returns : |
a new librdf_iterator object or NULL on failure |
void librdf_list_foreach (librdf_list *list
,void (*fn) (void *, void *)
,void *user_data
);
Apply a function for each data item in a librdf_list.
|
librdf_list object |
|
pointer to function to apply that takes data pointer and user data parameters |
|
user data for applied function |