Functions from linked list moved to vqueue and vstack.
authorSteven Schronk <[email protected]>
Thu, 3 Feb 2011 00:07:26 +0000 (2 18:07 -0600)
committerSteven Schronk <[email protected]>
Thu, 3 Feb 2011 00:07:26 +0000 (2 18:07 -0600)
lib_vqueue.h
lib_vstack.h

index 547f525..5ff0ebf 100644 (file)
@@ -10,6 +10,9 @@
 /* add node to queue */
 #define vq_enq(pHead) list_ins_head(pHead)
 
+/* push node onto stack - with data */
+#define vq_enq_data(pHead, pData) list_ins_head_data(pHead, pData)
+
 /* remove node from queue */
 #define vq_deq(pHead) list_rm_node(pHead, list_tail(pHead))
 
 /* print out contents of queue to stdout */
 #define vq_print(pHead) list_print(pHead)
 
+/* reverse contents of list */
+#define vq_reverse(pHead) list_reverse(pHead)
+
 /* get address of node at num - first node is 1 */
 #define vq_get_num(pHead, count) list_get_num(pHead, count)
 
+/* append high list to last node of low list - does not modify pHi list */
+#define vq_append(pLo, pHi) list_append(pLo, pHi)
+
 /* reverse current nodes - modify pointer to next in each */
 #define vq_node_swap(pPrev, pCurr) list_node_swap(pPrev, pCurr)
 
-/* reverse contents of list */
-#define vq_reverse(pHead) list_reverse(pHead)
+/* return an array of pointers to data payload in list - does not modify list */
+#define vq_data_array(pHead, pArr, len) list_data_array(pHead, pArr, len)
+
+/* return an array of pointers to nodes in list - does not modify list */
+#define vq_node_array(pHead, pArr, len) list_node_array(pHead, pArr, len)
 
 #endif /* LIB_VQUEUE_H_ */
index 580bc31..c3a81c8 100644 (file)
 /* delete and free contents of this queue */
 #define vstack_delete(pHead) list_delete(pHead)
 
+/* make a deep copy of list */
+#define vstack_copy(pHead) list_copy(pDest, pSrc)
+
+/* print out contents of list to stdout */
+#define vstack_print(pHead) list_print(pHead)
+
+/* reverse contents of list */
+#define vstack_reverse(pHead) list_reverse(pHead)
+
+/* append high list to last node of low list - does not modify pHi list */
+#define vstack_append(pLo, pHi) list_append(pLo, pHi)
+
+/* return an array of pointers to data payload in list - does not modify list */
+#define vstack_data_array(pHead, pArr, len) list_data_array(pHead, pArr, len)
+
+/* return an array of pointers to nodes in list - does not modify list */
+#define vstack_node_array(pHead, pArr, len) list_node_array(pHead, pArr, len)
+
 #endif /* LIB_VSTACK_H_ */