11 #ifndef __FN_FINALIZE_T_DEFINED
12 typedef int (*fn_finalize_t)(void**);
13 #define __FN_FINALIZE_T_DEFINED
28 #ifndef __LINK_T_DEFINED
29 typedef struct s_link_t
31 void* item; /* the item associated with the link */
32 struct s_link_t* next; /* address to the next link */
33 struct s_link_t* prev; /* address to the prev link */
35 #define __LINK_T_DEFINED
40 void* item; /* not used */
41 link_t next; /* point to the last node of the list */
42 link_t prev; /* point to the first node of the list */
43 fn_finalize_t fn_finalize; /* not used */
44 int size; /* the number of node contained by the list */
50 list_new(fn_finalize_t fn_finalize);
53 list_rewind(list_t list);
56 list_unwind(list_t list);
59 list_clear(list_t list);
62 list_free(list_t* list_ptr);
65 list_push_front(list_t list, void* item);
68 list_push_back(list_t list, void* item);
71 list_pop_back(list_t list);
74 list_pop_front(list_t list);
77 list_remove(list_t list, void* item);
80 list_get_size(list_t list);
82 list_contains(list_t list, void* item);
85 list_is_empty(list_t list);
88 list_is_autodelete(list_t list);
91 list_move_next(list_t list);
94 list_get(list_t list);
97 list_set(list_t list, void* item);
100 list_get_at(list_t list, int pos);
103 list_set_at(list_t list, int pos, void* item);
106 list_move_prev(list_t list);
109 list_seek(list_t list, int offset, int whence);
112 list_tell(list_t list);
115 list_getpos(list_t list, int* pos);
118 list_setpos(list_t list, int pos);
122 list_get_front(list_t list);
125 list_get_back(list_t list);
128 list_insert_after(list_t list, void* what, void* where);
131 list_insert_before(list_t list, void* what, void* where);
139 #endif /* !__list_H */