Updated project to use eclipse build tools and make system.
[C-Data-Structures.git] / lib_vstack.h
blobc3a81c859aa743c498975ae0a446b4f98b737867
1 #ifndef LIB_VSTACK_H_
2 #define LIB_VSTACK_H_
4 #define Stack_Head List_Head
5 #define Stack_Node List_Node
7 /* create a new stack */
8 #define vstack_new() list_new()
10 /* push node onto stack */
11 #define vstack_push(pHead) list_ins_head(pHead)
13 /* push node onto stack - with data */
14 #define vstack_push_data(pHead, pData) list_ins_head_data(pHead, pData)
16 /* remove node from stack */
17 #define vstack_pop(pHead) list_rm_node(pHead, pHead->pNext)
19 /* view next node in stack */
20 #define vstack_peek(pHead) pHead->pNext
22 /* number of elements in stack */
23 #define vstack_size(pHead) pHead->count
25 /* empty contents of stack */
26 #define vstack_clear(pHead) list_clear(pHead)
28 /* delete and free contents of this queue */
29 #define vstack_delete(pHead) list_delete(pHead)
31 /* make a deep copy of list */
32 #define vstack_copy(pHead) list_copy(pDest, pSrc)
34 /* print out contents of list to stdout */
35 #define vstack_print(pHead) list_print(pHead)
37 /* reverse contents of list */
38 #define vstack_reverse(pHead) list_reverse(pHead)
40 /* append high list to last node of low list - does not modify pHi list */
41 #define vstack_append(pLo, pHi) list_append(pLo, pHi)
43 /* return an array of pointers to data payload in list - does not modify list */
44 #define vstack_data_array(pHead, pArr, len) list_data_array(pHead, pArr, len)
46 /* return an array of pointers to nodes in list - does not modify list */
47 #define vstack_node_array(pHead, pArr, len) list_node_array(pHead, pArr, len)
49 #endif /* LIB_VSTACK_H_ */