1 #ifndef ERUNTIME_LIST_H
2 # define ERUNTIME_LIST_H
6 # define LIST_FOREACH(list, cur) \
7 for ((cur) = (list)->head; (cur); (cur) = (cur)->next)
9 typedef struct _list_node_struct list_node_t
;
11 typedef struct _list_struct
13 /* list head pointer. */
16 /* list tail pointer. */
24 struct _list_node_struct
26 /* pointer to previous node in the chain. */
29 /* pointer to next node in the chain. */
32 /* pointer to node data. */
36 typedef void (*list_apply_func_t
) (void *, void *);
38 int8_t list_init (list_t
*list
);
39 list_t
*list_create (void);
40 int8_t list_append (list_t
*list
, void *data
);
41 int8_t list_prepend (list_t
*list
, void *data
);
42 int32_t list_apply (list_t
*list
, list_apply_func_t func
, void *arg
);
43 void list_clear (list_t
*list
);
44 void list_destroy (list_t
*list
);
46 #endif /* ! ERUNTIME_LIST_H */
49 * vim: ts=8 sw=8 noet fdm=marker tw=80