28 #ifndef __c_LINKLIST__
29 #define __c_LINKLIST__
75 #define LISTADDCURR 0x300
76 #define LISTADDHEAD 0x100
77 #define LISTADDTAIL 0x200
78 #define LISTADDSPLAY 0x400
79 #define LISTDELCURR 0x030
80 #define LISTDELHEAD 0x010
81 #define LISTDELTAIL 0x020
82 #define LISTDELSPLAY 0x040
83 #define LISTREADCURR 0x003
84 #define LISTREADHEAD 0x001
85 #define LISTREADTAIL 0x002
87 #define LISTDELREAD 0x1000
88 #define LISTCIRCULAR 0x2000
89 #define LISTBTREE 0x4000
92 #define LISTADDMASK 0xF00
93 #define LISTDELMASK 0x0F0
94 #define LISTREADMASK 0x00F
95 #define LISTFLAGMASK 0xF000
98 #define LIST (LISTADDCURR | LISTREADCURR | LISTDELCURR)
99 #define FIFO (LISTADDTAIL | LISTREADHEAD | LISTDELHEAD)
100 #define LIFO (LISTADDHEAD | LISTREADHEAD | LISTDELHEAD)
101 #define QUEUE (FIFO | LISTDELREAD)
102 #define STACK (LIFO | LISTDELREAD)
103 #define CIRCULAR_QUEUE (QUEUE | LISTCIRCULAR)
104 #define STREE (LISTBTREE | LISTADDSPLAY | LISTDELSPLAY | LISTREADCURR)
109 #define LLIST_NOERROR 0
111 #define LLIST_ERROR -1
113 #define LLIST_OK LLIST_NOERROR
114 #define LLIST_BADVALUE LLIST_NULL
123 typedef void *(* ListAlloc)(
size_t size);
164 #define DMALLOC malloc
170 #define DCOUNT dcount
190 #define NewList(Type) NewListAlloc(Type, NULL, NULL, NULL)
202 #define NewNode(Data) NewListNode(NULL, Data)
216 void *
FindNode(listPtr List,
void *Data);
228 void *
BTFind(listPtr List,
void *Data);
235 int AddNode(listPtr List, listnodePtr Node);
246 int InsertList(listPtr List, listnodePtr Node);
247 int HeadList(listPtr List, listnodePtr Node);
248 int TailList(listPtr List, listnodePtr Node);
305 void *
IndexNode(listPtr List,
int Index);
334 void *
SplayList(listPtr List,
void *Data);
356 int PrintList(listPtr List,
char *DataFmt);
361 int PrintTree(listPtr List,
char *DataFmt);