X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fstrset%2F_info;h=982a9c0f851ae7d5485b42cc2e53578125613e14;hp=81e8f53cca08b73a3c1322d2da1cb6b7d4064c9a;hb=b87f63cb8228c8fcbf760defdcf9e4c332da7667;hpb=ab83de953730f5e5e571dbf69ffb3cc685a102dc diff --git a/ccan/strset/_info b/ccan/strset/_info index 81e8f53c..982a9c0f 100644 --- a/ccan/strset/_info +++ b/ccan/strset/_info @@ -1,5 +1,6 @@ -#include #include "config.h" +#include +#include /** * strset - an ordered set of strings @@ -15,14 +16,14 @@ * Example: * // Print all words in order. * #include - * #include + * #include * #include * #include * * static bool dump(const char *member, void *unused) * { * printf("%s ", member); - * return false; + * return true; // Keep going with iteration. * } * * int main(void) @@ -31,23 +32,23 @@ * char *file, *word; * * strset_init(&words); - * file = grab_fd(NULL, 0, NULL); + * file = grab_fd(NULL, 0); * if (!file) * err(1, "Reading stdin"); * * for (word = strtok(file, " \t\r\n"); * word; * word = strtok(NULL, " \t\r\n")) { - * strset_set(&words, word); + * strset_add(&words, word); * } * strset_iterate(&words, dump, NULL); * printf("\n"); * return 0; * } - * // Given "foo bar" outputs "bar foo " - * // Given "foo foo bar" outputs "bar foo " + * // Given "foo bar" outputs "bar foo \n" + * // Given "foo foo bar" outputs "bar foo \n" * - * License: Public domain (but some dependencies are LGPL!) + * License: CC0 (but some dependencies are LGPL!) * Author: Rusty Russell * Ccanlint: * license_depends_compat FAIL