From e1374049678842f5086f174d97ae916345686f87 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 5 Dec 2011 16:42:48 +1030 Subject: lib/ccan/htable: HTABLE_INITIALIZER() for static initialization. Unfortunately it's a bit of a pain to use for typed hashtables, but it works. Signed-off-by: Rusty Russell (Imported from CCAN commit 60cc720d0797fc49325437ea36a9ffd909c75ed0) --- lib/ccan/htable/htable_type.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/ccan/htable/htable_type.h') diff --git a/lib/ccan/htable/htable_type.h b/lib/ccan/htable/htable_type.h index 3b555cde4a..03cc46fc58 100644 --- a/lib/ccan/htable/htable_type.h +++ b/lib/ccan/htable/htable_type.h @@ -38,6 +38,9 @@ * * It's currently safe to iterate over a changing hashtable, but you might * miss an element. Iteration isn't very efficient, either. + * + * You can use HTABLE_INITIALIZER like so: + * struct ht = { HTABLE_INITIALIZER(ht.raw, _hash, NULL) }; */ #define HTABLE_DEFINE_TYPE(type, keyof, hashfn, eqfn, name) \ struct name { struct htable raw; }; \ -- cgit