6 * str - string helper routines
8 * This is a grab bag of functions for string operations, designed to enhance
9 * the standard string.h.
11 * Note that if you define CCAN_STR_DEBUG, you will get extra compile
12 * checks on common misuses of the following functions (they will now
13 * be out-of-line, so there is a runtime penalty!).
15 * strstr, strchr, strrchr:
16 * Return const char * if first argument is const (gcc only).
18 * isalnum, isalpha, isascii, isblank, iscntrl, isdigit, isgraph,
19 * islower, isprint, ispunct, isspace, isupper, isxdigit:
20 * Static and runtime check that input is EOF or an *unsigned*
21 * char, as per C standard (really!).
25 * #include <ccan/str/str.h>
27 * int main(int argc, char *argv[])
29 * if (argv[1] && streq(argv[1], "--verbose"))
30 * printf("verbose set\n");
31 * if (argv[1] && strstarts(argv[1], "--"))
32 * printf("Some option set\n");
33 * if (argv[1] && strends(argv[1], "cow-powers"))
34 * printf("Magic option set\n");
38 * License: Public domain
39 * Author: Rusty Russell <rusty@rustcorp.com.au>
41 int main(int argc, char *argv[])
46 if (strcmp(argv[1], "depends") == 0) {
47 printf("ccan/build_assert\n");