diff options
Diffstat (limited to 'linked_list.h')
-rw-r--r-- | linked_list.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/linked_list.h b/linked_list.h new file mode 100644 index 0000000..643e4f2 --- /dev/null +++ b/linked_list.h @@ -0,0 +1,18 @@ +#ifndef LINKED_LIST_H +#define LINKED_LIST_H + +typedef struct linked_list linked_list; + +struct linked_list { + linked_list *next; /* Next node in the list. */ + linked_list *prev; /* Previous node in the list. */ + void *data; /* Pointer to data. */ +}; + +extern linked_list *add_node(linked_list **tail, void *data); +extern void remove_node(linked_list *node); +extern linked_list *get_head(linked_list *node); +extern linked_list *get_tail(linked_list *node); +extern int linked_list_size(linked_list *tail); + +#endif |