X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftal%2Fpath%2F_info;fp=ccan%2Ftal%2Fpath%2F_info;h=24b9e468fe96a83c9f30025b5e74cc3b1a5ea7e5;hb=892f59bdc1830443f87ad3aaeddaab2eeefb5937;hp=0000000000000000000000000000000000000000;hpb=1322fd3377cc817720f7552a80d56dba447bcfea;p=ccan diff --git a/ccan/tal/path/_info b/ccan/tal/path/_info new file mode 100644 index 00000000..24b9e468 --- /dev/null +++ b/ccan/tal/path/_info @@ -0,0 +1,62 @@ +#include +#include "config.h" + +/** + * tal/path - routines to manipulate paths + * + * This code helps manage paths. + * + * License: BSD-MIT + * Author: Rusty Russell + * + * Example: + * // Program to print out full path names, recursively. + * #include + * #include + * #include + * #include + * #include + * + * static void dump(const char *dir) + * { + * struct dirent *di; + * DIR *d = opendir(dir); + * if (!d) { + * warn("Failed to open %s", dir); + * return; + * } + * printf("%s\n", dir); + * while ((di = readdir(d)) != NULL) { + * char *path; + * if (streq(di->d_name, ".") || streq(di->d_name, "..")) + * continue; + * path = path_join(NULL, dir, di->d_name); + * if (path_is_dir(path)) + * dump(path); + * tal_free(path); + * } + * closedir(d); + * } + * + * int main(void) + * { + * dump(path_cwd(NULL)); + * return 0; + * } + */ +int main(int argc, char *argv[]) +{ + /* Expect exactly one argument */ + if (argc != 2) + return 1; + + if (strcmp(argv[1], "depends") == 0) { + printf("ccan/str\n"); + printf("ccan/take\n"); + printf("ccan/tal\n"); + printf("ccan/tal/str\n"); + return 0; + } + + return 1; +}