X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fnamespacize.c;h=759ef938482f98a3b3aabd267f7e79c2fe56962d;hp=8c6c6632f51fad49ef735cd4023140e790a6554e;hb=b772f4d9252df33303c142e5750c24ca211ccfc2;hpb=37ca11df87fa3cc97aca321a76e564e4058d6900;ds=sidebyside diff --git a/tools/namespacize.c b/tools/namespacize.c index 8c6c6632..759ef938 100644 --- a/tools/namespacize.c +++ b/tools/namespacize.c @@ -10,8 +10,8 @@ #include #include #include -#include "string/string.h" -#include "talloc/talloc.h" +#include "ccan/string/string.h" +#include "ccan/talloc/talloc.h" #include "tools.h" #define IDENT_CHARS "ABCDEFGHIJKLMNOPQRSTUVWXYZ" \ @@ -30,16 +30,6 @@ static int indent = 0; #define verbose_indent() (indent += 2) #define verbose_unindent() (indent -= 2) -#define strstarts(str,prefix) (strncmp((str),(prefix),strlen(prefix)) == 0) - -static inline bool strends(const char *str, const char *postfix) -{ - if (strlen(str) < strlen(postfix)) - return false; - - return streq(str + strlen(str) - strlen(postfix), postfix); -} - static int unlink_no_errno(const char *filename) { int ret = 0, serrno = errno; @@ -466,7 +456,7 @@ static struct replace *read_replacement_file(const char *depdir) return NULL; } - for (line = split(file, file, "\n", NULL); *line; line++) + for (line = strsplit(file, file, "\n", NULL); *line; line++) add_replace(&repl, *line); return repl; }