1 |
/* RCSid: $Id$ */ |
2 |
/* |
3 |
* list.h |
4 |
* Linked list data structure and routines |
5 |
*/ |
6 |
|
7 |
#ifndef TRUE |
8 |
#define TRUE 1 |
9 |
#define FALSE 0 |
10 |
#endif |
11 |
|
12 |
typedef struct _LIST { |
13 |
int d; |
14 |
struct _LIST *next; |
15 |
}LIST; |
16 |
|
17 |
|
18 |
#define LIST_NEXT(l) ((l)->next) |
19 |
#define LIST_DATA(l) ((l)->d) |
20 |
#define SET_LIST_NEXT(l,d) ((l)->next = (d)) |
21 |
#define SET_LIST_DATA(l,id) ((l)->d = (int)(id)) |
22 |
|
23 |
/* |
24 |
LIST *new_list(void); |
25 |
LIST *free_list(LIST *l); |
26 |
LIST *append_list(LIST *a, LIST *b); |
27 |
|
28 |
int pop_data(LIST **l); |
29 |
LIST *add_data_to_circular_list(LIST *l,LIST **end,int d) |
30 |
int remove_from_list(int d,LIST **list) |
31 |
*/ |
32 |
LIST *new_list(); |
33 |
LIST *free_list(); |
34 |
LIST *append_list(); |
35 |
int pop_data(); |
36 |
LIST *push_data(); |
37 |
LIST *add_data_to_circular_list(); |
38 |
int remove_from_list(); |
39 |
LIST *add_data(); |
40 |
|
41 |
|
42 |
|
43 |
|