| 1 |
|
| 2 |
#ifndef LWIP_LIST_H |
| 3 |
#define LWIP_LIST_H |
| 4 |
|
| 5 |
#ifdef __cplusplus |
| 6 |
extern "C" { |
| 7 |
#endif |
| 8 |
|
| 9 |
struct elem; |
| 10 |
|
| 11 |
struct list { |
| 12 |
struct elem *first, *last; |
| 13 |
int size, elems; |
| 14 |
}; |
| 15 |
|
| 16 |
struct elem { |
| 17 |
struct elem *next; |
| 18 |
void *data; |
| 19 |
}; |
| 20 |
|
| 21 |
struct list *list_new(int size); |
| 22 |
int list_push(struct list *list, void *data); |
| 23 |
void *list_pop(struct list *list); |
| 24 |
void *list_first(struct list *list); |
| 25 |
int list_elems(struct list *list); |
| 26 |
void list_delete(struct list *list); |
| 27 |
int list_remove(struct list *list, void *elem); |
| 28 |
void list_map(struct list *list, void (* func)(void *arg)); |
| 29 |
|
| 30 |
#ifdef __cplusplus |
| 31 |
} |
| 32 |
#endif |
| 33 |
|
| 34 |
#endif |