X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fnamespacize.c;h=759ef938482f98a3b3aabd267f7e79c2fe56962d;hp=3e656c84a4346344bd7b90749c1f0aa50c7a798d;hb=794a6678aa37e8864845c72b14213ca44b9e159e;hpb=437fa285d12183a0f1e7450b3a01cbe5620a3507 diff --git a/tools/namespacize.c b/tools/namespacize.c index 3e656c84..759ef938 100644 --- a/tools/namespacize.c +++ b/tools/namespacize.c @@ -10,7 +10,8 @@ #include #include #include -#include "talloc/talloc.h" +#include "ccan/string/string.h" +#include "ccan/talloc/talloc.h" #include "tools.h" #define IDENT_CHARS "ABCDEFGHIJKLMNOPQRSTUVWXYZ" \ @@ -29,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; @@ -465,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; }