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