6 * tal/str - string helper routines which use tal
8 * This is a grab bag of functions for string operations, designed to enhance
9 * the standard string.h; these are separated from the non-tal-needing
10 * string utilities in "str.h".
13 * #include <ccan/tal/str/str.h>
14 * #include <ccan/tal/grab_file/grab_file.h>
17 * // Dumb demo program to double-linespace a file.
18 * int main(int argc, char *argv[])
23 * // Grab lines in file.
24 * textfile = grab_file(NULL, argv[1]);
26 * err(1, "Failed reading %s", argv[1]);
27 * lines = tal_strsplit(textfile, textfile, "\n", STR_EMPTY_OK);
29 * // Join them back together with two linefeeds.
30 * printf("%s", tal_strjoin(textfile, lines, "\n\n", STR_TRAIL));
32 * // Free everything, just because we can.
38 * Author: Rusty Russell <rusty@rustcorp.com.au>
40 int main(int argc, char *argv[])
45 if (strcmp(argv[1], "depends") == 0) {
48 printf("ccan/tal/talloc\n");
52 printf("ccan/take\n");