diff options
author | David Brodski <david@brodski.eu> | 2010-11-09 22:24:58 +0000 |
---|---|---|
committer | David Brodski <david@brodski.eu> | 2010-11-09 22:24:58 +0000 |
commit | 3db08333ec2b301cc8f204ad74f5aa8a25e3426f (patch) | |
tree | eaee71e79c7f8bbc91e0c21842bd18af792b159d /src/include/gnunet_container_lib.h | |
parent | e0dd7bcc0b9417f5bbd2bf910ec8c6a967a66c77 (diff) | |
download | gnunet-3db08333ec2b301cc8f204ad74f5aa8a25e3426f.tar.gz gnunet-3db08333ec2b301cc8f204ad74f5aa8a25e3426f.zip |
wlan: seperate fragment and session queue
wlan: schedule for timeouts used
dll: insert at tail
dll: insert before element
Diffstat (limited to 'src/include/gnunet_container_lib.h')
-rw-r--r-- | src/include/gnunet_container_lib.h | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/src/include/gnunet_container_lib.h b/src/include/gnunet_container_lib.h index 2abbfadc8..480b98be8 100644 --- a/src/include/gnunet_container_lib.h +++ b/src/include/gnunet_container_lib.h | |||
@@ -694,6 +694,23 @@ int GNUNET_CONTAINER_multihashmap_get_multiple (const struct | |||
694 | (head) = (element); } while (0) | 694 | (head) = (element); } while (0) |
695 | 695 | ||
696 | /** | 696 | /** |
697 | * Insert an element at the tail of a DLL. Assumes that head, tail and | ||
698 | * element are structs with prev and next fields. | ||
699 | * | ||
700 | * @param head pointer to the head of the DLL | ||
701 | * @param tail pointer to the tail of the DLL | ||
702 | * @param element element to insert | ||
703 | */ | ||
704 | #define GNUNET_CONTAINER_DLL_insert_tail(head,tail,element) do { \ | ||
705 | (element)->prev = (tail); \ | ||
706 | (element)->next = NULL; \ | ||
707 | if ((head) == NULL) \ | ||
708 | (head) = element; \ | ||
709 | else \ | ||
710 | (tail)->next = element; \ | ||
711 | (tail) = (element); } while (0) | ||
712 | |||
713 | /** | ||
697 | * Insert an element into a DLL after the given other element. Insert | 714 | * Insert an element into a DLL after the given other element. Insert |
698 | * at the head if the other element is NULL. | 715 | * at the head if the other element is NULL. |
699 | * | 716 | * |
@@ -719,7 +736,31 @@ int GNUNET_CONTAINER_multihashmap_get_multiple (const struct | |||
719 | else \ | 736 | else \ |
720 | (element)->next->prev = (element); } while (0) | 737 | (element)->next->prev = (element); } while (0) |
721 | 738 | ||
722 | 739 | /** | |
740 | * Insert an element into a DLL before the given other element. Insert | ||
741 | * at the tail if the other element is NULL. | ||
742 | * | ||
743 | * @param head pointer to the head of the DLL | ||
744 | * @param tail pointer to the tail of the DLL | ||
745 | * @param other prior element, NULL for insertion at head of DLL | ||
746 | * @param element element to insert | ||
747 | */ | ||
748 | #define GNUNET_CONTAINER_DLL_insert_before(head,tail,other,element) do { \ | ||
749 | (element)->next = (other); \ | ||
750 | if (NULL == other) \ | ||
751 | { \ | ||
752 | (element)->prev = (tail); \ | ||
753 | (tail) = (element); \ | ||
754 | } \ | ||
755 | else \ | ||
756 | { \ | ||
757 | (element)->prev = (other)->prev; \ | ||
758 | (other)->prev = (element); \ | ||
759 | } \ | ||
760 | if (NULL == (element)->prev) \ | ||
761 | (head) = (element); \ | ||
762 | else \ | ||
763 | (element)->prev->next = (element); } while (0) | ||
723 | 764 | ||
724 | 765 | ||
725 | /** | 766 | /** |