diff options
Diffstat (limited to 'libcnary/include/node_list.h')
| -rw-r--r-- | libcnary/include/node_list.h | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/libcnary/include/node_list.h b/libcnary/include/node_list.h index 380916e..d566b00 100644 --- a/libcnary/include/node_list.h +++ b/libcnary/include/node_list.h | |||
| @@ -24,24 +24,27 @@ | |||
| 24 | #ifndef NODE_LIST_H_ | 24 | #ifndef NODE_LIST_H_ |
| 25 | #define NODE_LIST_H_ | 25 | #define NODE_LIST_H_ |
| 26 | 26 | ||
| 27 | struct node_t; | 27 | #include "node.h" |
| 28 | |||
| 29 | typedef struct node* node_t; | ||
| 28 | 30 | ||
| 29 | // This class implements the list_t abstract class | 31 | // This class implements the list_t abstract class |
| 30 | typedef struct node_list_t { | 32 | struct node_list { |
| 31 | // list_t members | 33 | // list_t members |
| 32 | struct node_t* begin; | 34 | node_t begin; |
| 33 | struct node_t* end; | 35 | node_t end; |
| 34 | 36 | ||
| 35 | // node_list_t members | 37 | // node_list_t members |
| 36 | unsigned int count; | 38 | unsigned int count; |
| 37 | 39 | ||
| 38 | } node_list_t; | 40 | }; |
| 41 | typedef struct node_list* node_list_t; | ||
| 39 | 42 | ||
| 40 | void node_list_destroy(struct node_list_t* list); | 43 | void node_list_destroy(node_list_t list); |
| 41 | struct node_list_t* node_list_create(); | 44 | node_list_t node_list_create(); |
| 42 | 45 | ||
| 43 | int node_list_add(node_list_t* list, node_t* node); | 46 | int node_list_add(node_list_t list, node_t node); |
| 44 | int node_list_insert(node_list_t* list, unsigned int index, node_t* node); | 47 | int node_list_insert(node_list_t list, unsigned int index, node_t node); |
| 45 | int node_list_remove(node_list_t* list, node_t* node); | 48 | int node_list_remove(node_list_t list, node_t node); |
| 46 | 49 | ||
| 47 | #endif /* NODE_LIST_H_ */ | 50 | #endif /* NODE_LIST_H_ */ |
