00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _LIST_H_
00022 #define _LIST_H_
00023
00024 #ifdef ENABLE_MPATROL
00025 #include <mpatrol.h>
00026 #endif
00027
00044 #ifdef __cplusplus
00045 extern "C"
00046 {
00047 #endif
00048
00049 #ifndef DOXYGEN
00050
00054 typedef struct __node __node_t;
00055
00060 struct __node
00061 {
00062 void *next;
00063 void *element;
00064 };
00065 #endif
00066
00071 typedef struct osip_list osip_list_t;
00072
00077 typedef struct
00078 {
00079 __node_t *actual;
00080 __node_t **prev;
00081 osip_list_t *li;
00082 int pos;
00083 } osip_list_iterator_t;
00084
00089 struct osip_list
00090 {
00091
00092 int nb_elt;
00093 __node_t *node;
00095 };
00096
00106 int osip_list_init (osip_list_t * li);
00113 void osip_list_special_free (osip_list_t * li, void *(*free_func) (void *));
00121 int osip_list_clone (const osip_list_t * src, osip_list_t * dst, int *(*clone_func) (void *, void *));
00126 void osip_list_ofchar_free (osip_list_t * li);
00131 int osip_list_size (const osip_list_t * li);
00137 int osip_list_eol (const osip_list_t * li, int pos);
00144 int osip_list_add (osip_list_t * li, void *element, int pos);
00150 void *osip_list_get (const osip_list_t * li, int pos);
00156 int osip_list_remove (osip_list_t * li, int pos);
00157
00162 #define osip_list_iterator_has_elem( it ) ( 0 != (it).actual && (it).pos < (it).li->nb_elt )
00163
00168 void *osip_list_get_first (osip_list_t * li, osip_list_iterator_t * it);
00173 void *osip_list_get_next (osip_list_iterator_t * it);
00178 void *osip_list_iterator_remove (osip_list_iterator_t * it);
00179
00180 #ifdef __cplusplus
00181 }
00182 #endif
00183
00184
00187 #endif