Main Page | Modules | Data Structures | File List | Data Fields

Lists


Functions

int u_list_create (u_list_t **plist)
 Create a new list object.

void u_list_free (u_list_t *list)
 Free the list object: note the list doesn't own the pointers in it, the client must free them.

int u_list_add (u_list_t *list, void *ptr)
 Push an element to the list.

int u_list_del (u_list_t *list, void *ptr)
 Pop an element from the list.

size_t u_list_count (u_list_t *list)
 Count elements in list.

void * u_list_get_n (u_list_t *list, size_t n)
 Get the n-th element in list.


Function Documentation

int u_list_add u_list_t *  list,
void *  ptr
 

list the partent list object (created via u_list_new) ptr the element that has to be push'd

Returns:
0 on success, ~0 on error

Definition at line 88 of file list.c.

References u_free(), and u_zalloc().

size_t u_list_count u_list_t *  list  ) 
 

list a list object

Returns:
the number of elements in list

Definition at line 143 of file list.c.

int u_list_create u_list_t **  plist  ) 
 

plist the newly created list object as a result argument

Returns:
0 on success, ~0 on error

Definition at line 36 of file list.c.

References u_free(), and u_zalloc().

int u_list_del u_list_t *  list,
void *  ptr
 

list the partent list object (created via u_list_new) ptr the element that has to be pop'd

Returns:
0 if ptr has been removed, ~0 if ptr was not found

Definition at line 118 of file list.c.

References u_free().

void u_list_free u_list_t *  list  ) 
 

list the list object that has to be disposed

Returns:
nothing

Definition at line 62 of file list.c.

References u_free().

void* u_list_get_n u_list_t *  list,
size_t  n
 

list a list object n the ordinal of the element that should be retrieved

Returns:
the pointer to the n-th element or NULL if no n-th element has been found

Definition at line 158 of file list.c.


←Products
© 2005-2008 - KoanLogic S.r.l. - All rights reserved