28 #ifndef __LIBFREEWRL_LIST_H__
29 #define __LIBFREEWRL_LIST_H__
44 #define ml_elem(_item) (_item->elem)
45 #define ml_next(_item) (_item->next)
47 typedef void f_free_t(
void *ptr);
48 #if defined(DEBUG_MALLOC) && defined(DEBUG_MALLOC_LIST)
49 extern s_list_t* _ml_new(
const void *elem,
int line,
char *fi);
50 #define ml_new(elem) _ml_new(elem,__LINE__,__FILE__)
52 extern s_list_t* ml_new(
const void *elem);
64 extern void ml_delete_all(
s_list_t *list);
65 extern void ml_delete_all2(
s_list_t *list, f_free_t f);
71 #define ml_foreach(_list,_action) {\
74 for(__l=_list;__l!=NULL;) {\
75 next = ml_next(__l); \
81 extern void ml_dump_char(
s_list_t *list);
91 #define cdl_elem(_item) (_item->elem)
92 #define cdl_next(_item) (_item->next)
93 #define cdl_prev(_item) (_item->prev)
94 #define cdl_last(_head) (_head->prev)
96 extern cd_list_t* cdl_new(
const void *elem);
104 extern void cdl_delete_all(
cd_list_t *head);
105 extern void cdl_delete_all2(
cd_list_t *head, f_free_t f);
108 #define cdl_foreach(_head,_action) {\
113 next = cdl_next(__l); \
116 }while(__l != head);\
119 extern void cdl_dump_char(
cd_list_t *list);