summaryrefslogtreecommitdiff
path: root/lib/ccan/htable/htable_type.h
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-12-05 16:42:48 +1030
committerRusty Russell <rusty@rustcorp.com.au>2011-12-05 16:42:48 +1030
commite1374049678842f5086f174d97ae916345686f87 (patch)
treee00cc49a635530c28c5d03d1cc4ca060ab57c2e9 /lib/ccan/htable/htable_type.h
parent0ac7deefbf190e11d38cc47807e0f5f6cfb1775e (diff)
downloadsamba-e1374049678842f5086f174d97ae916345686f87.tar.gz
samba-e1374049678842f5086f174d97ae916345686f87.tar.bz2
samba-e1374049678842f5086f174d97ae916345686f87.zip
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 <rusty@rustcorp.com.au> (Imported from CCAN commit 60cc720d0797fc49325437ea36a9ffd909c75ed0)
Diffstat (limited to 'lib/ccan/htable/htable_type.h')
-rw-r--r--lib/ccan/htable/htable_type.h3
1 files changed, 3 insertions, 0 deletions
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 <name> ht = { HTABLE_INITIALIZER(ht.raw, <name>_hash, NULL) };
*/
#define HTABLE_DEFINE_TYPE(type, keyof, hashfn, eqfn, name) \
struct name { struct htable raw; }; \