13 #ifndef __L4UTIL__SLL_H__ 14 #define __L4UTIL__SLL_H__ 26 typedef struct slist_t
35 static inline slist_t*
36 list_new_entry(
void *data);
38 static inline slist_t*
39 list_append(slist_t *list, slist_t *new_node);
41 static inline slist_t*
42 list_remove(slist_t *list, slist_t *node);
45 list_free_entry(slist_t **list);
47 static inline unsigned char 48 list_is_empty(slist_t *list);
50 static inline slist_t*
51 list_get_at(slist_t *list,
int n);
53 static inline slist_t*
54 list_add(slist_t *list, slist_t *new_node);
57 list_insert_after(slist_t *after, slist_t *new_node);
60 list_elements(slist_t *head);
74 static inline slist_t*
75 list_new_entry(
void *data)
79 sll = (slist_t *)malloc(
sizeof(slist_t));
81 return ((slist_t *) NULL);
101 static inline slist_t*
102 list_append(slist_t *head, slist_t *new_node)
110 head->next = new_node;
126 static inline slist_t*
127 list_add(slist_t *head, slist_t *new_node)
131 new_node->next = head;
148 list_insert_after(slist_t *after, slist_t *new_node)
154 new_node->next = after->next;
155 after->next = new_node;
171 static inline unsigned char 172 list_is_empty(slist_t *list)
174 return ((list) ? 0 : 1);
189 static inline slist_t*
190 list_remove(slist_t *head, slist_t *node)
193 if (list_is_empty(head))
204 while (head && (head->next != node))
209 head->next = node->next;
211 list_free_entry(&node);
227 list_free_entry(slist_t **list)
231 free ((
void *) (*list));
249 static inline slist_t*
250 list_get_at(slist_t *list,
int n)
262 return ((slist_t *) NULL);
277 list_elements(slist_t *head)
280 for (n=0; head; head=head->next) n++;
#define EXTERN_C_END
End section with C types and functions.
L4 compiler related defines.
#define EXTERN_C_BEGIN
Start section with C types and functions.