summaryrefslogtreecommitdiff
path: root/list.h
blob: ecd2bfbb5ef0fc3115cd5818d1c0ca1698346ca8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
struct item
{
    void *data;
    struct item *prev;
    struct item *next;
};

/*
 * Move element in item to the head of list mainlist.
 */
void movetohead(struct item **mainlist, struct item *item);

/*
 * Create space for a new item and add it to the head of mainlist.
 *
 * Returns item or NULL if out of memory.
 */
struct item *additem(struct item **mainlist);

/*
 *
 */ 
void delitem(struct item **mainlist, struct item *item);

/*
 *
 */ 
void listitems(struct item *mainlist);