X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fhtable%2F_info;h=7e06c3867a3f977797720e54368f25cb3084d6c6;hb=b7cb7dfdf27243696183698b2f82522003cc1216;hp=ed9a8a5dac60ef9657bb84839feeba25323f1ae3;hpb=d4941bf8047d16007f19a3b5b2211e1e7571f068;p=ccan diff --git a/ccan/htable/_info b/ccan/htable/_info index ed9a8a5d..7e06c386 100644 --- a/ccan/htable/_info +++ b/ccan/htable/_info @@ -1,3 +1,4 @@ +#include "config.h" #include #include @@ -62,7 +63,7 @@ * * int main(int argc, char *argv[]) * { - * struct htable *ht; + * struct htable ht; * unsigned int i; * unsigned long val; * @@ -71,14 +72,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 +87,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]);