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

#endif