summaryrefslogtreecommitdiff
path: root/linked_list.h
blob: d18b859db6c4c4a12d51f6a2823ebc0921106bcf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#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 *get_head(linked_list *node);
extern linked_list *get_tail(linked_list *node);
extern linked_list *add_node(linked_list **tail, void *data);
extern void remove_node(linked_list *node);
extern void cleanup_linked_list(linked_list *node);
extern int linked_list_size(linked_list *tail);

#endif