SIP Witch 1.9.15
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Macros | Typedefs | Functions
oSIP list Handling

Data Structures

struct  __node
 Structure for referencing a node in a osip_list_t element. More...
 
struct  osip_list_iterator_t
 
struct  osip_list
 Structure for referencing a list of elements. More...
 

Macros

#define osip_list_iterator_has_elem(it)   ( 0 != (it).actual && (it).pos < (it).li->nb_elt )
 Check current iterator state. More...
 

Typedefs

typedef struct __node __node_t
 Structure for referencing a node in a osip_list_t element. More...
 
typedef struct osip_list osip_list_t
 Structure for referencing a list of elements. More...
 

Functions

int osip_list_init (osip_list_t *li)
 Initialise a osip_list_t element. More...
 
void osip_list_special_free (osip_list_t *li, void(*free_func)(void *))
 Free a list of element. More...
 
int osip_list_clone (const osip_list_t *src, osip_list_t *dst, int(*clone_func)(void *, void **))
 Clone a list of element. More...
 
void osip_list_ofchar_free (osip_list_t *li)
 Free a list of element where elements are pointer to 'char'. More...
 
int osip_list_size (const osip_list_t *li)
 Get the size of a list of element. More...
 
int osip_list_eol (const osip_list_t *li, int pos)
 Check if the end of list is detected . More...
 
int osip_list_add (osip_list_t *li, void *element, int pos)
 Add an element in a list. More...
 
void * osip_list_get (const osip_list_t *li, int pos)
 Get an element from a list. More...
 
int osip_list_remove (osip_list_t *li, int pos)
 Remove an element from a list. More...
 
void * osip_list_get_first (const osip_list_t *li, osip_list_iterator_t *it)
 Get first iterator from list. More...
 
void * osip_list_get_next (osip_list_iterator_t *it)
 GEt next iterator. More...
 
void * osip_list_iterator_remove (osip_list_iterator_t *it)
 Remove current iterator. More...
 

Detailed Description

Macro Definition Documentation

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

#include <osip_list.h>

Check current iterator state.

Parameters
itThe element to work on.

Definition at line 154 of file osip_list.h.

Typedef Documentation

#include <osip_list.h>

Structure for referencing a node in a osip_list_t element.

Definition at line 49 of file osip_list.h.

#include <osip_list.h>

Structure for referencing a list of elements.

Definition at line 65 of file osip_list.h.

Function Documentation

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

#include <osip_list.h>

Add an element in a list.

Parameters
liThe element to work on.
elementThe pointer on the element to add.
posthe 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 
)

#include <osip_list.h>

Clone a list of element.

Each element will be cloned with the method given as the second parameter.

Parameters
srcThe element to work on.
dstThe element to work on.
clone_funcThe method that is able to release one element of the list.
int osip_list_eol ( const osip_list_t li,
int  pos 
)

#include <osip_list.h>

Check if the end of list is detected .

Parameters
liThe element to work on.
posThe index of the possible element.
void* osip_list_get ( const osip_list_t li,
int  pos 
)

#include <osip_list.h>

Get an element from a list.

Parameters
liThe element to work on.
posthe index of the element to get.
void* osip_list_get_first ( const osip_list_t li,
osip_list_iterator_t it 
)

#include <osip_list.h>

Get first iterator from list.

Parameters
liThe element to work on.
itThe iterator.
void* osip_list_get_next ( osip_list_iterator_t it)

#include <osip_list.h>

GEt next iterator.

Parameters
itThe element to work on.
int osip_list_init ( osip_list_t li)

#include <osip_list.h>

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
liThe element to initialise.
void* osip_list_iterator_remove ( osip_list_iterator_t it)

#include <osip_list.h>

Remove current iterator.

Parameters
itThe element to work on.
void osip_list_ofchar_free ( osip_list_t li)

#include <osip_list.h>

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

Parameters
liThe element to work on.
int osip_list_remove ( osip_list_t li,
int  pos 
)

#include <osip_list.h>

Remove an element from a list.

Parameters
liThe element to work on.
posthe index of the element to remove.
int osip_list_size ( const osip_list_t li)

#include <osip_list.h>

Get the size of a list of element.

Parameters
liThe element to work on.
void osip_list_special_free ( osip_list_t li,
void(*)(void *)  free_func 
)

#include <osip_list.h>

Free a list of element.

Each element will be free with the method given as the second parameter.

Parameters
liThe element to work on.
free_funcThe method that is able to release one element of the list.