Main Page   Modules   Compound List   File List   Compound Members   File Members   Related Pages  

WBXML Lists
[WBXML Library]


Files

file  wbxml_lists.c
 Generic Lists Functions.

file  wbxml_lists.h
 Generic Lists Functions.


Defines

#define wbxml_list_create()   wbxml_mem_cleam(wbxml_list_create_real())

Typedefs

typedef void WBXMLListEltCleaner (void *item)
 A List Element Cleaner Function prototype.


Functions

WBXMLListwbxml_list_create_real (void)
 Create a List.

void wbxml_list_destroy (WBXMLList *list, WBXMLListEltCleaner *destructor)
 Destroy a List.

unsigned int wbxml_list_len (WBXMLList *list)
 Get list length.

unsigned char wbxml_list_append (WBXMLList *list, void *item)
 Append an element at end of list.

WB_BOOL wbxml_list_insert (WBXMLList *list, void *elt, WB_ULONG pos)
 Append an element to a list.

void * wbxml_list_get (WBXMLList *list, WB_ULONG index)
 Get an Element from list.

void * wbxml_list_extract_first (WBXMLList *list)
 Extract first element of a List.


Define Documentation

 
#define wbxml_list_create      wbxml_mem_cleam(wbxml_list_create_real())
 

Definition at line 64 of file wbxml_lists.h.

Referenced by wbxml_buffer_split_words_real(), and wbxml_encoder_create_real().


Typedef Documentation

typedef void WBXMLListEltCleaner(void *item)
 

A List Element Cleaner Function prototype.

Definition at line 56 of file wbxml_lists.h.

Referenced by wbxml_list_destroy().


Function Documentation

unsigned char wbxml_list_append WBXMLList   list,
void *    elt
 

Append an element at end of list.

Parameters:
list The List
elt The element to append
Returns:
TRUE if element appended, FALSE if not enought memory

Definition at line 105 of file wbxml_lists.c.

References FALSE, WBXMLList_s::head, WBXMLList_s::len, WBXMLListElt_s::next, NULL, WBXMLList_s::tail, TRUE, WB_BOOL, and wbxml_elt_create.

Referenced by wbxml_buffer_split_words_real().

WBXMLList* wbxml_list_create_real void   
 

Create a List.

Returns:
The newly created List, or NULL if not enought memory
Warning:
Do NOT use this function directly, use wbxml_list_create() macro instead

Definition at line 62 of file wbxml_lists.c.

References WBXMLList_s::head, WBXMLList_s::len, NULL, WBXMLList_s::tail, and wbxml_malloc().

void wbxml_list_destroy WBXMLList   list,
WBXMLListEltCleaner   destructor
 

Destroy a List.

Parameters:
list The List to destroy
destructor The function to destroy an element from list (if NULL, items are not destroyed from list)

Definition at line 77 of file wbxml_lists.c.

References WBXMLList_s::head, WBXMLListElt_s::next, NULL, wbxml_elt_destroy(), wbxml_free(), and WBXMLListEltCleaner.

Referenced by wbxml_buffer_split_words_real(), and wbxml_encoder_destroy().

void* wbxml_list_extract_first WBXMLList   list
 

Extract first element of a List.

Parameters:
list The List
Returns:
The element extracted, or NULL if not found
Note:
The element is removed from this list

Definition at line 199 of file wbxml_lists.c.

References WBXMLList_s::head, WBXMLListElt_s::item, WBXMLList_s::len, WBXMLListElt_s::next, NULL, WBXMLList_s::tail, wbxml_elt_destroy(), and wbxml_list_len().

void* wbxml_list_get WBXMLList   list,
WB_ULONG    index
 

Get an Element from list.

Parameters:
list The List
index Index of element to get (index in start starts at '0')
Returns:
The element, or NULL if not found

WB_BOOL wbxml_list_insert WBXMLList   list,
void *    elt,
WB_ULONG    pos
 

Append an element to a list.

Parameters:
list The List
elt The element to insert
pos The index where to insert this element
Returns:
TRUE if element appended, FALSE if not enought memory

unsigned int wbxml_list_len WBXMLList   list
 

Get list length.

Parameters:
list The List
Returns:
The List length

Definition at line 96 of file wbxml_lists.c.

References WBXMLList_s::len, NULL, and WB_ULONG.

Referenced by wbxml_list_extract_first(), and wbxml_list_get().


Generated on Mon Nov 24 20:09:48 2003 for WBXML Library by doxygen1.3-rc1