From 3945f3269b3e2763faa1ab22d225ca4dd1856b82 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 14 Jul 2022 20:53:09 +0200 Subject: Adding upstream version 1.0. Signed-off-by: Daniel Baumann --- ccan/ccan/str/_info | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 ccan/ccan/str/_info (limited to 'ccan/ccan/str/_info') diff --git a/ccan/ccan/str/_info b/ccan/ccan/str/_info new file mode 100644 index 0000000..b579525 --- /dev/null +++ b/ccan/ccan/str/_info @@ -0,0 +1,52 @@ +#include "config.h" +#include +#include + +/** + * str - string helper routines + * + * This is a grab bag of functions for string operations, designed to enhance + * the standard string.h. + * + * Note that if you define CCAN_STR_DEBUG, you will get extra compile + * checks on common misuses of the following functions (they will now + * be out-of-line, so there is a runtime penalty!). + * + * strstr, strchr, strrchr: + * Return const char * if first argument is const (gcc only). + * + * isalnum, isalpha, isascii, isblank, iscntrl, isdigit, isgraph, + * islower, isprint, ispunct, isspace, isupper, isxdigit: + * Static and runtime check that input is EOF or an *unsigned* + * char, as per C standard (really!). + * + * Example: + * #include + * #include + * + * int main(int argc, char *argv[]) + * { + * if (argc > 1 && streq(argv[1], "--verbose")) + * printf("verbose set\n"); + * if (argc > 1 && strstarts(argv[1], "--")) + * printf("Some option set\n"); + * if (argc > 1 && strends(argv[1], "cow-powers")) + * printf("Magic option set\n"); + * return 0; + * } + * + * License: CC0 (Public domain) + * Author: Rusty Russell + */ +int main(int argc, char *argv[]) +{ + if (argc != 2) + return 1; + + if (strcmp(argv[1], "depends") == 0) { + printf("ccan/build_assert\n"); + return 0; + } + + return 1; +} -- cgit v1.2.3