aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_container_lib.h
diff options
context:
space:
mode:
authorGabor X Toth <*@tg-x.net>2014-05-06 10:26:21 +0000
committerGabor X Toth <*@tg-x.net>2014-05-06 10:26:21 +0000
commitb2061e704ac6309bb7ee4427a89a1572aa9f339e (patch)
tree1a7419be23bd4d7fe04f21def91e0a8e0e818fd8 /src/include/gnunet_container_lib.h
parent0b49a42584ffd952f83eec54800f2c23c8066d97 (diff)
downloadgnunet-b2061e704ac6309bb7ee4427a89a1572aa9f339e.tar.gz
gnunet-b2061e704ac6309bb7ee4427a89a1572aa9f339e.zip
add GNUNET_CONTAINER_heap_peek2()
Diffstat (limited to 'src/include/gnunet_container_lib.h')
-rw-r--r--src/include/gnunet_container_lib.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/include/gnunet_container_lib.h b/src/include/gnunet_container_lib.h
index a9c1f4b45..1aa3ad00e 100644
--- a/src/include/gnunet_container_lib.h
+++ b/src/include/gnunet_container_lib.h
@@ -1670,16 +1670,31 @@ GNUNET_CONTAINER_heap_destroy (struct GNUNET_CONTAINER_Heap *heap);
1670 1670
1671/** 1671/**
1672 * @ingroup heap 1672 * @ingroup heap
1673 * Get element stored at root of heap. 1673 * Get element stored at the root of @a heap.
1674 * 1674 *
1675 * @param heap heap to inspect 1675 * @param heap Heap to inspect.
1676 * @return NULL if heap is empty 1676 * @return Element at the root, or NULL if heap is empty.
1677 */ 1677 */
1678void * 1678void *
1679GNUNET_CONTAINER_heap_peek (const struct GNUNET_CONTAINER_Heap *heap); 1679GNUNET_CONTAINER_heap_peek (const struct GNUNET_CONTAINER_Heap *heap);
1680 1680
1681 1681
1682/** 1682/**
1683 * Get @a element and @a cost stored at the root of @a heap.
1684 *
1685 * @param[in] heap Heap to inspect.
1686 * @param[out] element Root element is returned here.
1687 * @param[out] cost Cost of @a element is returned here.
1688 * @return #GNUNET_YES if an element is returned,
1689 * #GNUNET_NO if the heap is empty.
1690 */
1691int
1692GNUNET_CONTAINER_heap_peek2 (const struct GNUNET_CONTAINER_Heap *heap,
1693 void **element,
1694 GNUNET_CONTAINER_HeapCostType *cost);
1695
1696
1697/**
1683 * @ingroup heap 1698 * @ingroup heap
1684 * Get the current size of the heap 1699 * Get the current size of the heap
1685 * 1700 *