osip_list.h

Go to the documentation of this file.
00001 
00024 #ifndef _LIST_H_
00025 #define _LIST_H_
00026 
00027 #ifdef ENABLE_MPATROL
00028 #include <mpatrol.h>
00029 #endif
00030 
00031 #ifdef __cplusplus
00032 extern "C"
00033 {
00034 #endif
00035 
00036 #ifndef DOXYGEN
00037 
00041   typedef struct __node __node_t;
00042 
00047   struct __node
00048   {
00049     void *next;                 
00050     void *element;              
00051   };
00052 #endif
00053 
00058   typedef struct osip_list osip_list_t;
00059 
00060 /* added by bennewit@cs.tu-berlin.de */
00061   typedef struct
00062   {
00063     __node_t *actual;
00064     __node_t **prev;
00065     osip_list_t *li;
00066     int pos;
00067   } osip_list_iterator_t;
00068 
00073   struct osip_list
00074   {
00075 
00076     int nb_elt;         
00077     __node_t *node;     
00079   };
00080 
00081 /* added by bennewit@cs.tu-berlin.de */
00082 #define osip_list_iterator_has_elem( it ) ( 0 != (it).actual && (it).pos < (it).li->nb_elt )
00083 
00093   int osip_list_init (osip_list_t * li);
00100   void osip_list_special_free (osip_list_t * li, void *(*free_func) (void *));
00105   void osip_list_ofchar_free (osip_list_t * li);
00110   int osip_list_size (const osip_list_t * li);
00116   int osip_list_eol (const osip_list_t * li, int pos);
00123   int osip_list_add (osip_list_t * li, void *element, int pos);
00129   void *osip_list_get (const osip_list_t * li, int pos);
00135   int osip_list_remove (osip_list_t * li, int pos);
00136 
00137 /* added by bennewit@cs.tu-berlin.de */
00138   void *osip_list_get_first (osip_list_t * li, osip_list_iterator_t * it);
00139 /* added by bennewit@cs.tu-berlin.de */
00140   void *osip_list_get_next (osip_list_iterator_t * it);
00141 /* added by bennewit@cs.tu-berlin.de */
00142   void *osip_list_iterator_remove (osip_list_iterator_t * it);
00143 
00144 #ifdef __cplusplus
00145 }
00146 #endif
00147 
00148 #endif

Generated on Fri Mar 9 19:59:55 2007 for MAD-FCL by  doxygen 1.5.0