summaryrefslogtreecommitdiffstats
path: root/src/libutil/heap.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/heap.h')
-rw-r--r--src/libutil/heap.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/libutil/heap.h b/src/libutil/heap.h
index 7d6ef4fff..94501a740 100644
--- a/src/libutil/heap.h
+++ b/src/libutil/heap.h
@@ -18,6 +18,10 @@
#include "config.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* Binary minimal heap interface based on glib
*/
@@ -44,14 +48,14 @@ struct rspamd_min_heap *rspamd_min_heap_create (gsize reserved_size);
* @param elt element to push
*/
void rspamd_min_heap_push (struct rspamd_min_heap *heap,
- struct rspamd_min_heap_elt *elt);
+ struct rspamd_min_heap_elt *elt);
/**
* Pops the minimum element from the heap and reorder the queue
* @param heap heap structure
* @return minimum element
*/
-struct rspamd_min_heap_elt* rspamd_min_heap_pop (struct rspamd_min_heap *heap);
+struct rspamd_min_heap_elt *rspamd_min_heap_pop (struct rspamd_min_heap *heap);
/**
* Updates priority for the element. It must be in queue (so `idx` should be sane)
@@ -60,7 +64,7 @@ struct rspamd_min_heap_elt* rspamd_min_heap_pop (struct rspamd_min_heap *heap);
* @param npri new priority
*/
void rspamd_min_heap_update_elt (struct rspamd_min_heap *heap,
- struct rspamd_min_heap_elt *elt, guint npri);
+ struct rspamd_min_heap_elt *elt, guint npri);
/**
@@ -69,7 +73,7 @@ void rspamd_min_heap_update_elt (struct rspamd_min_heap *heap,
* @param elt
*/
void rspamd_min_heap_remove_elt (struct rspamd_min_heap *heap,
- struct rspamd_min_heap_elt *elt);
+ struct rspamd_min_heap_elt *elt);
/**
* Destroys heap (elements are not destroyed themselves)
@@ -83,7 +87,11 @@ void rspamd_min_heap_destroy (struct rspamd_min_heap *heap);
* @param idx
* @return
*/
-struct rspamd_min_heap_elt* rspamd_min_heap_index (struct rspamd_min_heap *heap,
- guint idx);
+struct rspamd_min_heap_elt *rspamd_min_heap_index (struct rspamd_min_heap *heap,
+ guint idx);
+
+#ifdef __cplusplus
+}
+#endif
#endif /* SRC_LIBUTIL_HEAP_H_ */