summaryrefslogtreecommitdiff
path: root/lib/ccan/htable/_info
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-12-05 16:42:47 +1030
committerRusty Russell <rusty@rustcorp.com.au>2011-12-05 16:42:47 +1030
commit0ac7deefbf190e11d38cc47807e0f5f6cfb1775e (patch)
treeeb45e5db11b9d051b117e63a2cd4f4d69e7e9c19 /lib/ccan/htable/_info
parent19409ddaf2414dd1d8ef183c834b37c8767034b0 (diff)
downloadsamba-0ac7deefbf190e11d38cc47807e0f5f6cfb1775e.tar.gz
samba-0ac7deefbf190e11d38cc47807e0f5f6cfb1775e.tar.bz2
samba-0ac7deefbf190e11d38cc47807e0f5f6cfb1775e.zip
lib/ccan/htable: clean up interface, document htable_type better.
We change from htable_new()/htable_free() to htable_init/htable_clear. We also change HTABLE_DEFINE_TYPE() to be the full name, without automatically prepending htable_. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 0c3590dc33d644f73bb8587db454c491830aaf26)
Diffstat (limited to 'lib/ccan/htable/_info')
-rw-r--r--lib/ccan/htable/_info10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/ccan/htable/_info b/lib/ccan/htable/_info
index ed9a8a5dac..1553da2b0e 100644
--- a/lib/ccan/htable/_info
+++ b/lib/ccan/htable/_info
@@ -62,7 +62,7 @@
*
* int main(int argc, char *argv[])
* {
- * struct htable *ht;
+ * struct htable ht;
* unsigned int i;
* unsigned long val;
*
@@ -71,14 +71,14 @@
* argv[0]);
*
* // Create and populate hash table.
- * ht = htable_new(rehash, NULL);
+ * htable_init(&ht, rehash, NULL);
* for (i = 0; i < sizeof(map)/sizeof(map[0]); i++)
- * htable_add(ht, hash_string(map[i].name), &map[i]);
+ * htable_add(&ht, hash_string(map[i].name), &map[i]);
*
* // Add any aliases to the hash table.
* for (i = 1; i < argc; i++) {
* if (!strncmp(argv[i], "--alias=", strlen("--alias=")))
- * add_alias(ht, argv[i] + strlen("--alias="));
+ * add_alias(&ht, argv[i] + strlen("--alias="));
* else
* break;
* }
@@ -86,7 +86,7 @@
* // Find the other args in the hash table.
* for (val = 0; i < argc; i++) {
* struct name_to_digit *n;
- * n = htable_get(ht, hash_string(argv[i]),
+ * n = htable_get(&ht, hash_string(argv[i]),
* streq, argv[i]);
* if (!n)
* errx(1, "Invalid digit name %s", argv[i]);