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[])
24 * errx(1, "Takes 0 or 1 arguments");
25 * // Grab lines in file.
26 * textfile = grab_file(NULL, argv[1]);
28 * err(1, "Failed reading %s", argv[1]);
29 * lines = tal_strsplit(textfile, textfile, "\n", STR_EMPTY_OK);
31 * // Join them back together with two linefeeds.
32 * printf("%s", tal_strjoin(textfile, lines, "\n\n", STR_TRAIL));
34 * // Free everything, just because we can.
40 * Author: Rusty Russell <rusty@rustcorp.com.au>
42 int main(int argc, char *argv[])
47 if (strcmp(argv[1], "depends") == 0) {
50 printf("ccan/tal/talloc\n");
54 printf("ccan/take\n");