aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_container_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2009-09-25 22:10:51 +0000
committerChristian Grothoff <christian@grothoff.org>2009-09-25 22:10:51 +0000
commitf1b9c5c115139b02cac1cae4f053792e1e5b1ccb (patch)
treecd9047d73ba498d05f67c7e06ae4bd5ed89511e7 /src/include/gnunet_container_lib.h
parentc2d3d24cd9b4f552d7ca8ad6283f9819c1cfefc7 (diff)
downloadgnunet-f1b9c5c115139b02cac1cae4f053792e1e5b1ccb.tar.gz
gnunet-f1b9c5c115139b02cac1cae4f053792e1e5b1ccb.zip
improving style and docs
Diffstat (limited to 'src/include/gnunet_container_lib.h')
-rw-r--r--src/include/gnunet_container_lib.h38
1 files changed, 36 insertions, 2 deletions
diff --git a/src/include/gnunet_container_lib.h b/src/include/gnunet_container_lib.h
index 61dee9918..b376af3c8 100644
--- a/src/include/gnunet_container_lib.h
+++ b/src/include/gnunet_container_lib.h
@@ -344,15 +344,30 @@ int GNUNET_CONTAINER_meta_data_extract_from_file (struct
344 EXTRACTOR_ExtractorList * 344 EXTRACTOR_ExtractorList *
345 extractors); 345 extractors);
346 346
347
348/**
349 * Options for metadata serialization.
350 */
347enum GNUNET_CONTAINER_MetaDataSerializationOptions 351enum GNUNET_CONTAINER_MetaDataSerializationOptions
348{ 352{
353 /**
354 * Serialize all of the data.
355 */
349 GNUNET_CONTAINER_META_DATA_SERIALIZE_FULL = 0, 356 GNUNET_CONTAINER_META_DATA_SERIALIZE_FULL = 0,
357
358 /**
359 * If not enough space is available, it is acceptable
360 * to only serialize some of the metadata.
361 */
350 GNUNET_CONTAINER_META_DATA_SERIALIZE_PART = 1, 362 GNUNET_CONTAINER_META_DATA_SERIALIZE_PART = 1,
363
364 /**
365 * Speed is of the essence, do not allow compression.
366 */
351 GNUNET_CONTAINER_META_DATA_SERIALIZE_NO_COMPRESS = 2 367 GNUNET_CONTAINER_META_DATA_SERIALIZE_NO_COMPRESS = 2
352}; 368};
353 369
354 370
355
356/** 371/**
357 * Serialize meta-data to target. 372 * Serialize meta-data to target.
358 * 373 *
@@ -631,6 +646,10 @@ void *GNUNET_CONTAINER_multihashmap_get_random (const struct
631 * Insert an element into a DLL. Assumes 646 * Insert an element into a DLL. Assumes
632 * that head, tail and element are structs 647 * that head, tail and element are structs
633 * with prev and next fields. 648 * with prev and next fields.
649 *
650 * @param head pointer to the head of the DLL
651 * @param tail pointer to the tail of the DLL
652 * @param element element to insert
634 */ 653 */
635#define GNUNET_CONTAINER_DLL_insert(head,tail,element) \ 654#define GNUNET_CONTAINER_DLL_insert(head,tail,element) \
636 (element)->next = (head); \ 655 (element)->next = (head); \
@@ -645,6 +664,11 @@ void *GNUNET_CONTAINER_multihashmap_get_random (const struct
645 * Insert an element into a DLL after the given other 664 * Insert an element into a DLL after the given other
646 * element. Insert at the head if the other 665 * element. Insert at the head if the other
647 * element is NULL. 666 * element is NULL.
667 *
668 * @param head pointer to the head of the DLL
669 * @param tail pointer to the tail of the DLL
670 * @param other prior element, NULL for insertion at head of DLL
671 * @param element element to insert
648 */ 672 */
649#define GNUNET_CONTAINER_DLL_insert_after(head,tail,other,element) \ 673#define GNUNET_CONTAINER_DLL_insert_after(head,tail,other,element) \
650 (element)->prev = (other); \ 674 (element)->prev = (other); \
@@ -670,6 +694,10 @@ void *GNUNET_CONTAINER_multihashmap_get_random (const struct
670 * Remove an element from a DLL. Assumes 694 * Remove an element from a DLL. Assumes
671 * that head, tail and element are structs 695 * that head, tail and element are structs
672 * with prev and next fields. 696 * with prev and next fields.
697 *
698 * @param head pointer to the head of the DLL
699 * @param tail pointer to the tail of the DLL
700 * @param element element to remove
673 */ 701 */
674#define GNUNET_CONTAINER_DLL_remove(head,tail,element) \ 702#define GNUNET_CONTAINER_DLL_remove(head,tail,element) \
675 if ((element)->prev == NULL) \ 703 if ((element)->prev == NULL) \
@@ -766,6 +794,9 @@ int GNUNET_CONTAINER_heap_iterate (struct GNUNET_CONTAINER_Heap *heap,
766/** 794/**
767 * Inserts a new item into the heap, item is always neighbor now. 795 * Inserts a new item into the heap, item is always neighbor now.
768 * @param heap the heap 796 * @param heap the heap
797 * @param element element to insert
798 * @param cost cost of the element
799 * @return FIXME
769 */ 800 */
770int 801int
771GNUNET_CONTAINER_heap_insert (struct GNUNET_CONTAINER_Heap *heap, 802GNUNET_CONTAINER_heap_insert (struct GNUNET_CONTAINER_Heap *heap,
@@ -795,7 +826,10 @@ void *GNUNET_CONTAINER_heap_peek (struct GNUNET_CONTAINER_Heap *heap);
795 * Removes any node from the tree based on the neighbor given, does 826 * Removes any node from the tree based on the neighbor given, does
796 * not traverse the tree (backpointers) but may take more time due to 827 * not traverse the tree (backpointers) but may take more time due to
797 * percolation of nodes. 828 * percolation of nodes.
829 *
798 * @param heap the heap 830 * @param heap the heap
831 * @param element element to remove
832 * @return FIXME
799 */ 833 */
800void *GNUNET_CONTAINER_heap_remove_node (struct GNUNET_CONTAINER_Heap *heap, 834void *GNUNET_CONTAINER_heap_remove_node (struct GNUNET_CONTAINER_Heap *heap,
801 void *element); 835 void *element);
@@ -807,7 +841,7 @@ void *GNUNET_CONTAINER_heap_remove_node (struct GNUNET_CONTAINER_Heap *heap,
807 * @param heap the heap 841 * @param heap the heap
808 * @param element the element for which the cost is updated 842 * @param element the element for which the cost is updated
809 * @param new_cost new cost for the element 843 * @param new_cost new cost for the element
810 * @return WHAT? 844 * @return FIXME
811 */ 845 */
812int 846int
813GNUNET_CONTAINER_heap_update_cost (struct GNUNET_CONTAINER_Heap *heap, 847GNUNET_CONTAINER_heap_update_cost (struct GNUNET_CONTAINER_Heap *heap,