aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-02-16 09:25:11 +0000
committerChristian Grothoff <christian@grothoff.org>2010-02-16 09:25:11 +0000
commite9656b2a24386a7f7bd92c8596e5333337f7b30c (patch)
tree34722d6a80ee7f5f3fa32172cd84a9cee849d101 /src/include
parentc67e80d3bb342bdac0a4d06c521f7d0bef5f0507 (diff)
downloadgnunet-e9656b2a24386a7f7bd92c8596e5333337f7b30c.tar.gz
gnunet-e9656b2a24386a7f7bd92c8596e5333337f7b30c.zip
block it
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_container_lib.h22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/include/gnunet_container_lib.h b/src/include/gnunet_container_lib.h
index 21ee59688..bc72e2e09 100644
--- a/src/include/gnunet_container_lib.h
+++ b/src/include/gnunet_container_lib.h
@@ -654,34 +654,32 @@ int GNUNET_CONTAINER_multihashmap_get_multiple (const struct
654/* ******************** doubly-linked list *************** */ 654/* ******************** doubly-linked list *************** */
655 655
656/** 656/**
657 * Insert an element into a DLL. Assumes 657 * Insert an element at the head of a DLL. Assumes that head, tail and
658 * that head, tail and element are structs 658 * element are structs with prev and next fields.
659 * with prev and next fields.
660 * 659 *
661 * @param head pointer to the head of the DLL 660 * @param head pointer to the head of the DLL
662 * @param tail pointer to the tail of the DLL 661 * @param tail pointer to the tail of the DLL
663 * @param element element to insert 662 * @param element element to insert
664 */ 663 */
665#define GNUNET_CONTAINER_DLL_insert(head,tail,element) \ 664#define GNUNET_CONTAINER_DLL_insert(head,tail,element) do { \
666 (element)->next = (head); \ 665 (element)->next = (head); \
667 (element)->prev = NULL; \ 666 (element)->prev = NULL; \
668 if ((tail) == NULL) \ 667 if ((tail) == NULL) \
669 (tail) = element; \ 668 (tail) = element; \
670 else \ 669 else \
671 (head)->prev = element; \ 670 (head)->prev = element; \
672 (head) = (element); 671 (head) = (element); } while (0)
673 672
674/** 673/**
675 * Insert an element into a DLL after the given other 674 * Insert an element into a DLL after the given other element. Insert
676 * element. Insert at the head if the other 675 * at the head if the other element is NULL.
677 * element is NULL.
678 * 676 *
679 * @param head pointer to the head of the DLL 677 * @param head pointer to the head of the DLL
680 * @param tail pointer to the tail of the DLL 678 * @param tail pointer to the tail of the DLL
681 * @param other prior element, NULL for insertion at head of DLL 679 * @param other prior element, NULL for insertion at head of DLL
682 * @param element element to insert 680 * @param element element to insert
683 */ 681 */
684#define GNUNET_CONTAINER_DLL_insert_after(head,tail,other,element) \ 682#define GNUNET_CONTAINER_DLL_insert_after(head,tail,other,element) do { \
685 (element)->prev = (other); \ 683 (element)->prev = (other); \
686 if (NULL == other) \ 684 if (NULL == other) \
687 { \ 685 { \
@@ -696,7 +694,7 @@ int GNUNET_CONTAINER_multihashmap_get_multiple (const struct
696 if (NULL == (element)->next) \ 694 if (NULL == (element)->next) \
697 (tail) = (element); \ 695 (tail) = (element); \
698 else \ 696 else \
699 (element)->next->prev = (element); 697 (element)->next->prev = (element); } while (0)
700 698
701 699
702 700
@@ -710,7 +708,7 @@ int GNUNET_CONTAINER_multihashmap_get_multiple (const struct
710 * @param tail pointer to the tail of the DLL 708 * @param tail pointer to the tail of the DLL
711 * @param element element to remove 709 * @param element element to remove
712 */ 710 */
713#define GNUNET_CONTAINER_DLL_remove(head,tail,element) \ 711#define GNUNET_CONTAINER_DLL_remove(head,tail,element) do { \
714 if ((element)->prev == NULL) \ 712 if ((element)->prev == NULL) \
715 (head) = (element)->next; \ 713 (head) = (element)->next; \
716 else \ 714 else \
@@ -718,7 +716,7 @@ int GNUNET_CONTAINER_multihashmap_get_multiple (const struct
718 if ((element)->next == NULL) \ 716 if ((element)->next == NULL) \
719 (tail) = (element)->prev; \ 717 (tail) = (element)->prev; \
720 else \ 718 else \
721 (element)->next->prev = (element)->prev; 719 (element)->next->prev = (element)->prev; } while (0)
722 720
723 721
724 722