X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fgrab_file%2Fgrab_file.h;h=96381875781e6db100876b3ee9a0ce8052b7a19d;hp=5f7e37c6de004a634d04441dcdb031b197581cfd;hb=c438ec17d7b2efe76e56e5fc5ab88bd4a02735e8;hpb=9965fc25fcc92dc76d1cd4cf9595dc3dc9ebc586;ds=sidebyside diff --git a/ccan/grab_file/grab_file.h b/ccan/grab_file/grab_file.h index 5f7e37c6..96381875 100644 --- a/ccan/grab_file/grab_file.h +++ b/ccan/grab_file/grab_file.h @@ -1,3 +1,4 @@ +/* Licensed under LGPLv2+ - see LICENSE file for details */ #ifndef CCAN_GRAB_FILE_H #define CCAN_GRAB_FILE_H #include // For size_t @@ -14,15 +15,18 @@ * byte after the end of the content will always be NUL. * * Example: + * #include + * #include + * ... * // Return all of standard input, as lines. - * char **read_as_lines(void) + * static char **read_stdin_as_lines(void) * { * char **lines, *all; * * all = grab_fd(NULL, 0, NULL); * if (!all) * return NULL; - * lines = strsplit(NULL, all, "\n", NULL); + * lines = strsplit(NULL, all, "\n"); * talloc_free(all); * return lines; * } @@ -42,14 +46,14 @@ void *grab_fd(const void *ctx, int fd, size_t *size); * * Example: * // Return all of a given file, as lines. - * char **read_as_lines(const char *filename) + * static char **read_file_as_lines(const char *filename) * { * char **lines, *all; * * all = grab_file(NULL, filename, NULL); * if (!all) * return NULL; - * lines = strsplit(NULL, all, "\n", NULL); + * lines = strsplit(NULL, all, "\n"); * talloc_free(all); * return lines; * }