diff options
Diffstat (limited to 'libcnary/include/node.h')
| -rw-r--r-- | libcnary/include/node.h | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/libcnary/include/node.h b/libcnary/include/node.h index 7e9da50..123241a 100644 --- a/libcnary/include/node.h +++ b/libcnary/include/node.h | |||
| @@ -24,42 +24,42 @@ | |||
| 24 | #ifndef NODE_H_ | 24 | #ifndef NODE_H_ |
| 25 | #define NODE_H_ | 25 | #define NODE_H_ |
| 26 | 26 | ||
| 27 | #include "node_list.h" | ||
| 27 | #include "object.h" | 28 | #include "object.h" |
| 28 | 29 | ||
| 29 | #define NODE_TYPE 1; | 30 | #define NODE_TYPE 1; |
| 30 | 31 | ||
| 31 | struct node_list_t; | ||
| 32 | |||
| 33 | // This class implements the abstract iterator class | 32 | // This class implements the abstract iterator class |
| 34 | typedef struct node_t { | 33 | typedef struct node* node_t; |
| 34 | struct node { | ||
| 35 | // Super class | 35 | // Super class |
| 36 | struct node_t* next; | 36 | node_t next; |
| 37 | struct node_t* prev; | 37 | node_t prev; |
| 38 | unsigned int count; | 38 | unsigned int count; |
| 39 | 39 | ||
| 40 | // Local Members | 40 | // Local Members |
| 41 | void *data; | 41 | void *data; |
| 42 | struct node_t* parent; | 42 | node_t parent; |
| 43 | struct node_list_t* children; | 43 | node_list_t children; |
| 44 | } node_t; | 44 | }; |
| 45 | 45 | ||
| 46 | void node_destroy(struct node_t* node); | 46 | void node_destroy(node_t node); |
| 47 | struct node_t* node_create(struct node_t* parent, void* data); | 47 | node_t node_create(node_t parent, void* data); |
| 48 | 48 | ||
| 49 | int node_attach(struct node_t* parent, struct node_t* child); | 49 | int node_attach(node_t parent, node_t child); |
| 50 | int node_detach(struct node_t* parent, struct node_t* child); | 50 | int node_detach(node_t parent, node_t child); |
| 51 | int node_insert(struct node_t* parent, unsigned int index, struct node_t* child); | 51 | int node_insert(node_t parent, unsigned int index, node_t child); |
| 52 | 52 | ||
| 53 | unsigned int node_n_children(struct node_t* node); | 53 | unsigned int node_n_children(node_t node); |
| 54 | node_t* node_nth_child(struct node_t* node, unsigned int n); | 54 | node_t node_nth_child(node_t node, unsigned int n); |
| 55 | node_t* node_first_child(struct node_t* node); | 55 | node_t node_first_child(node_t node); |
| 56 | node_t* node_prev_sibling(struct node_t* node); | 56 | node_t node_prev_sibling(node_t node); |
| 57 | node_t* node_next_sibling(struct node_t* node); | 57 | node_t node_next_sibling(node_t node); |
| 58 | int node_child_position(struct node_t* parent, node_t* child); | 58 | int node_child_position(node_t parent, node_t child); |
| 59 | 59 | ||
| 60 | typedef void* (*copy_func_t)(const void *src); | 60 | typedef void* (*copy_func_t)(const void *src); |
| 61 | node_t* node_copy_deep(node_t* node, copy_func_t copy_func); | 61 | node_t node_copy_deep(node_t node, copy_func_t copy_func); |
| 62 | 62 | ||
| 63 | void node_debug(struct node_t* node); | 63 | void node_debug(node_t node); |
| 64 | 64 | ||
| 65 | #endif /* NODE_H_ */ | 65 | #endif /* NODE_H_ */ |
