diff options
-rw-r--r-- | src/include/gnunet_container_lib.h | 9 | ||||
-rw-r--r-- | src/util/container_heap.c | 12 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/include/gnunet_container_lib.h b/src/include/gnunet_container_lib.h index 2aa7e020a..3d1a2c97a 100644 --- a/src/include/gnunet_container_lib.h +++ b/src/include/gnunet_container_lib.h | |||
@@ -919,6 +919,15 @@ GNUNET_CONTAINER_heap_get_size (const struct GNUNET_CONTAINER_Heap *heap); | |||
919 | 919 | ||
920 | 920 | ||
921 | /** | 921 | /** |
922 | * Get the current cost of the node | ||
923 | * | ||
924 | * @param node the node to get the cost of | ||
925 | * @return cost of the node | ||
926 | */ | ||
927 | GNUNET_CONTAINER_HeapCostType | ||
928 | GNUNET_CONTAINER_node_get_cost (const struct GNUNET_CONTAINER_HeapNode *node); | ||
929 | |||
930 | /** | ||
922 | * Iterator for heap | 931 | * Iterator for heap |
923 | * | 932 | * |
924 | * @param cls closure | 933 | * @param cls closure |
diff --git a/src/util/container_heap.c b/src/util/container_heap.c index c332cdd63..89e65b270 100644 --- a/src/util/container_heap.c +++ b/src/util/container_heap.c | |||
@@ -188,6 +188,18 @@ GNUNET_CONTAINER_heap_get_size (const struct GNUNET_CONTAINER_Heap *heap) | |||
188 | 188 | ||
189 | 189 | ||
190 | /** | 190 | /** |
191 | * Get the current cost of the node | ||
192 | * | ||
193 | * @param node the node to get the cost of | ||
194 | * @return cost of the node | ||
195 | */ | ||
196 | GNUNET_CONTAINER_HeapCostType | ||
197 | GNUNET_CONTAINER_node_get_cost (const struct GNUNET_CONTAINER_HeapNode *node) | ||
198 | { | ||
199 | return node->cost; | ||
200 | } | ||
201 | |||
202 | /** | ||
191 | * Iterate over the children of the given node. | 203 | * Iterate over the children of the given node. |
192 | * | 204 | * |
193 | * @param heap argument to give to iterator | 205 | * @param heap argument to give to iterator |