Updated project to use eclipse build tools and make system.
[C-Data-Structures.git] / lib_vqueue.h
blob5ff0ebf07812af7ec403be1eac55597514bab117
1 #ifndef LIB_VQUEUE_H_
2 #define LIB_VQUEUE_H_
4 #define Queue_Head List_Head
5 #define Queue_Node List_Node
7 /* create a new queue */
8 #define vq_new() list_new()
10 /* add node to queue */
11 #define vq_enq(pHead) list_ins_head(pHead)
13 /* push node onto stack - with data */
14 #define vq_enq_data(pHead, pData) list_ins_head_data(pHead, pData)
16 /* remove node from queue */
17 #define vq_deq(pHead) list_rm_node(pHead, list_tail(pHead))
19 /* view next node in line */
20 #define vq_peek(pHead) list_tail(pHead)
22 /* number of elements in queue */
23 #define vq_size(pHead) pHead->count
25 /* empty contents of queue */
26 #define vq_clear(pHead) list_clear(pHead)
28 /* delete and free contents of this queue */
29 #define vq_delete(pHead) list_delete(pHead)
31 /* make a deep copy of queue */
32 #define vq_copy(pDest, pSrc) list_copy(pDest, pSrc)
34 /* print out contents of queue to stdout */
35 #define vq_print(pHead) list_print(pHead)
37 /* reverse contents of list */
38 #define vq_reverse(pHead) list_reverse(pHead)
40 /* get address of node at num - first node is 1 */
41 #define vq_get_num(pHead, count) list_get_num(pHead, count)
43 /* append high list to last node of low list - does not modify pHi list */
44 #define vq_append(pLo, pHi) list_append(pLo, pHi)
46 /* reverse current nodes - modify pointer to next in each */
47 #define vq_node_swap(pPrev, pCurr) list_node_swap(pPrev, pCurr)
49 /* return an array of pointers to data payload in list - does not modify list */
50 #define vq_data_array(pHead, pArr, len) list_data_array(pHead, pArr, len)
52 /* return an array of pointers to nodes in list - does not modify list */
53 #define vq_node_array(pHead, pArr, len) list_node_array(pHead, pArr, len)
55 #endif /* LIB_VQUEUE_H_ */