From 91f1037064d503f2e5f1756f66c10f3926960836 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Thu, 24 May 2018 15:44:54 +0000 Subject: lib: add hash_to_list() Convenience function to convert hash table to an unsorted linked list. Signed-off-by: Quentin Young --- lib/hash.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/hash.h') diff --git a/lib/hash.h b/lib/hash.h index b6fe27e25..2510422e2 100644 --- a/lib/hash.h +++ b/lib/hash.h @@ -106,6 +106,15 @@ extern void hash_walk(struct hash *, int (*)(struct hash_backet *, void *), extern void hash_clean(struct hash *, void (*)(void *)); extern void hash_free(struct hash *); +/* + * Converts a hash table to an unsorted linked list. + * Does not modify the hash table in any way. + * + * hash + * the hash to convert + */ +extern struct list *hash_to_list(struct hash *hash); + extern unsigned int string_hash_make(const char *); extern void hash_cmd_init(void); -- cgit v1.2.3