aboutsummaryrefslogtreecommitdiff
path: root/oidmap.h
diff options
context:
space:
mode:
Diffstat (limited to 'oidmap.h')
-rw-r--r--oidmap.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/oidmap.h b/oidmap.h
index 67fb32290f..acddcaecdd 100644
--- a/oidmap.h
+++ b/oidmap.h
@@ -36,6 +36,21 @@ struct oidmap {
void oidmap_init(struct oidmap *map, size_t initial_size);
/*
+ * Function type for functions that free oidmap entries.
+ */
+typedef void (*oidmap_free_fn)(void *);
+
+/*
+ * Clear an oidmap, freeing any allocated memory. The map is empty and
+ * can be reused without another explicit init.
+ *
+ * The `free_fn`, if not NULL, is called for each oidmap entry in the map
+ * to free any user data associated with the entry.
+ */
+void oidmap_clear_with_free(struct oidmap *map,
+ oidmap_free_fn free_fn);
+
+/*
* Clear an oidmap, freeing any allocated memory. The map is empty and
* can be reused without another explicit init.
*