From d8cd4422e9d88a0c8180976179662ae2e890db6d Mon Sep 17 00:00:00 2001 From: David Brodski Date: Tue, 12 Apr 2011 23:32:17 +0000 Subject: [PATCH] Added GNUNET_CONTAINER_node_get_cost --- src/include/gnunet_container_lib.h | 9 +++++++++ src/util/container_heap.c | 12 ++++++++++++ 2 files changed, 21 insertions(+) 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 @@ -918,6 +918,15 @@ unsigned int GNUNET_CONTAINER_heap_get_size (const struct GNUNET_CONTAINER_Heap *heap); +/** + * Get the current cost of the node + * + * @param node the node to get the cost of + * @return cost of the node + */ +GNUNET_CONTAINER_HeapCostType +GNUNET_CONTAINER_node_get_cost (const struct GNUNET_CONTAINER_HeapNode *node); + /** * Iterator for heap * 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 @@ -187,6 +187,18 @@ GNUNET_CONTAINER_heap_get_size (const struct GNUNET_CONTAINER_Heap *heap) } +/** + * Get the current cost of the node + * + * @param node the node to get the cost of + * @return cost of the node + */ +GNUNET_CONTAINER_HeapCostType +GNUNET_CONTAINER_node_get_cost (const struct GNUNET_CONTAINER_HeapNode *node) +{ + return node->cost; +} + /** * Iterate over the children of the given node. * -- 2.25.1