oSIP list Handling


Classes

struct  osip_list_iterator_t
struct  osip_list
struct  osip_list

Defines

#define osip_list_iterator_has_elem(it)   ( 0 != (it).actual && (it).pos < (it).li->nb_elt )

Typedefs

typedef struct osip_list osip_list_t

Functions

int osip_list_init (osip_list_t *li)
void osip_list_special_free (osip_list_t *li, void *(*free_func)(void *))
int osip_list_clone (const osip_list_t *src, osip_list_t *dst, int *(*clone_func)(void *, void *))
void osip_list_ofchar_free (osip_list_t *li)
int osip_list_size (const osip_list_t *li)
int osip_list_eol (const osip_list_t *li, int pos)
int osip_list_add (osip_list_t *li, void *element, int pos)
void * osip_list_get (const osip_list_t *li, int pos)
int osip_list_remove (osip_list_t *li, int pos)
void * osip_list_get_first (osip_list_t *li, osip_list_iterator_t *it)
void * osip_list_get_next (osip_list_iterator_t *it)
void * osip_list_iterator_remove (osip_list_iterator_t *it)

Define Documentation

#define osip_list_iterator_has_elem ( it   )     ( 0 != (it).actual && (it).pos < (it).li->nb_elt )

Check current iterator state.

Parameters:
it The element to work on.


Typedef Documentation

osip_list_t

Structure for referencing a list of elements.


Function Documentation

int osip_list_add ( osip_list_t li,
void *  element,
int  pos 
)

Add an element in a list.

Parameters:
li The element to work on.
element The pointer on the element to add.
pos the index of the element to add. (or -1 to append the element at the end)

int osip_list_clone ( const osip_list_t src,
osip_list_t dst,
int *(*)(void *, void *)  clone_func 
)

Clone a list of element. Each element will be cloned with the method given as the second parameter.

Parameters:
src The element to work on.
dst The element to work on.
clone_func The method that is able to release one element of the list.

int osip_list_eol ( const osip_list_t li,
int  pos 
)

Check if the end of list is detected .

Parameters:
li The element to work on.
pos The index of the possible element.

void* osip_list_get ( const osip_list_t li,
int  pos 
)

Get an element from a list.

Parameters:
li The element to work on.
pos the index of the element to get.

void* osip_list_get_first ( osip_list_t li,
osip_list_iterator_t *  it 
)

Get first iterator from list.

Parameters:
li The element to work on.
it The iterator.

void* osip_list_get_next ( osip_list_iterator_t *  it  ) 

GEt next iterator.

Parameters:
it The element to work on.

int osip_list_init ( osip_list_t li  ) 

Initialise a osip_list_t element. NOTE: this element MUST be previously allocated with osip_malloc(). The osip_free() call on the list is still automatically done by osip_list_free(). This also means you can't use a static osip_list_t variable if you want to use osip_list_free().

Parameters:
li The element to initialise.

void* osip_list_iterator_remove ( osip_list_iterator_t *  it  ) 

Remove current iterator.

Parameters:
it The element to work on.

void osip_list_ofchar_free ( osip_list_t li  ) 

Free a list of element where elements are pointer to 'char'.

Parameters:
li The element to work on.

int osip_list_remove ( osip_list_t li,
int  pos 
)

Remove an element from a list.

Parameters:
li The element to work on.
pos the index of the element to remove.

int osip_list_size ( const osip_list_t li  ) 

Get the size of a list of element.

Parameters:
li The element to work on.

void osip_list_special_free ( osip_list_t li,
void *(*)(void *)  free_func 
)

Free a list of element. Each element will be free with the method given as the second parameter.

Parameters:
li The element to work on.
free_func The method that is able to release one element of the list.


Generated on Wed Feb 13 01:03:29 2008 for libosip by  doxygen 1.5.4