X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftal%2Fstr%2F_info;fp=ccan%2Ftal%2Fstr%2F_info;h=63081a1b189b101d378450752ce7873e64260bde;hb=d873aaec1339baf45c37db7cbaa2d687656343ba;hp=0000000000000000000000000000000000000000;hpb=d379e0ae835bdd047a5d277f7ded41f180134e27;p=ccan diff --git a/ccan/tal/str/_info b/ccan/tal/str/_info new file mode 100644 index 00000000..63081a1b --- /dev/null +++ b/ccan/tal/str/_info @@ -0,0 +1,52 @@ +#include +#include +#include "config.h" + +/** + * tal/str - string helper routines which use tal + * + * This is a grab bag of functions for string operations, designed to enhance + * the standard string.h; these are separated from the non-tal-needing + * string utilities in "str.h". + * + * Example: + * #include + * #include + * #include + * + * // Dumb demo program to double-linespace a file. + * int main(int argc, char *argv[]) + * { + * char *textfile; + * char **lines; + * + * // Grab lines in file. + * textfile = grab_file(NULL, argv[1], NULL); + * if (!textfile) + * err(1, "Failed reading %s", argv[1]); + * lines = strsplit(textfile, textfile, "\n", STR_EMPTY_OK); + * + * // Join them back together with two linefeeds. + * printf("%s", strjoin(textfile, lines, "\n\n", STR_TRAIL)); + * + * // Free everything, just because we can. + * tal_free(textfile); + * return 0; + * } + * + * License: BSD-MIT + * Author: Rusty Russell + */ +int main(int argc, char *argv[]) +{ + if (argc != 2) + return 1; + + if (strcmp(argv[1], "depends") == 0) { + printf("ccan/str\n"); + printf("ccan/tal\n"); + return 0; + } + + return 1; +}