Added test for list search.
[C-Data-Structures.git] / lib_vqueue.h
blob547f5255ba990eeb6ca6697c1557caa1d57ee431
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 /* remove node from queue */
14 #define vq_deq(pHead) list_rm_node(pHead, list_tail(pHead))
16 /* view next node in line */
17 #define vq_peek(pHead) list_tail(pHead)
19 /* number of elements in queue */
20 #define vq_size(pHead) pHead->count
22 /* empty contents of queue */
23 #define vq_clear(pHead) list_clear(pHead)
25 /* delete and free contents of this queue */
26 #define vq_delete(pHead) list_delete(pHead)
28 /* make a deep copy of queue */
29 #define vq_copy(pDest, pSrc) list_copy(pDest, pSrc)
31 /* print out contents of queue to stdout */
32 #define vq_print(pHead) list_print(pHead)
34 /* get address of node at num - first node is 1 */
35 #define vq_get_num(pHead, count) list_get_num(pHead, count)
37 /* reverse current nodes - modify pointer to next in each */
38 #define vq_node_swap(pPrev, pCurr) list_node_swap(pPrev, pCurr)
40 /* reverse contents of list */
41 #define vq_reverse(pHead) list_reverse(pHead)
43 #endif /* LIB_VQUEUE_H_ */