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

wbxml_lists.h File Reference

Generic Lists Functions. More...

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define wbxml_list_create()   wbxml_mem_cleam(wbxml_list_create_real())

Typedefs

typedef WBXMLList_s WBXMLList
 WBXML Generic List.

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.

WB_ULONG wbxml_list_len (WBXMLList *list)
 Get list length.

WB_BOOL wbxml_list_append (WBXMLList *list, void *elt)
 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.


Detailed Description

Generic Lists Functions.

Author:
Aymerick Jéhanne <libwbxml@jehanne.org>
Date:
02/12/06

Definition in file wbxml_lists.h.


Typedef Documentation

typedef struct WBXMLList_s WBXMLList
 

WBXML Generic List.

Definition at line 46 of file wbxml_lists.h.


Function Documentation

WB_BOOL 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().

WB_ULONG 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:45 2003 for WBXML Library by doxygen1.3-rc1