Initial Import
[glAntsMech.git] / glants_mech / linux / src / plist.h
blob544bd2f1c396f55d2728fe2f39cced5a6da07692
1 //
2 // list.h
3 #ifndef _P_LIST_H_
4 #define _P_LIST_H_
6 typedef struct tagPtrNode {
7 void *ptr;
9 struct tagPtrNode *next;
10 } PtrNode;
12 typedef struct tagPtrList {
13 PtrNode *head;
14 int items;
15 } PtrList;
17 void InsertFront(PtrList *list, void *data);
19 void PtrLinkTest(void);
21 PtrList *CreatePtrList();
22 void DestroyPtrList(PtrList *list);
23 int isempty(PtrList *list);
24 void DeletePtrNode(PtrList *list, void *val);
25 void *RemoveFront(PtrList *list);
26 void PrintPtrList(PtrList *list);
28 // STACK MACROS
29 #define POP_STACK(list) RemoveFront(list)
30 #define PUSH_STACK(list, data) InsertFront(list, data)
31 #define CREATE_STACK CreatePtrList()
32 #define DESTROY_STACK(list) DestroyPtrList(list)
35 #endif