diff options
| author | Alistair Popple <alistair@popple.id.au> | 2016-12-19 21:07:51 +1100 |
|---|---|---|
| committer | Alistair Popple <alistair@popple.id.au> | 2017-03-30 15:37:41 +1100 |
| commit | f045f14437ef63e10f57580978dc9ca3e0256007 (patch) | |
| tree | 86c0bdfe2fd6a54d5517ee5313e89765cd801a08 /ccan/str/_info | |
| parent | 72bf33c09f06ae63cd9f8d05e412b64622b340d1 (diff) | |
| download | pdbg-f045f14437ef63e10f57580978dc9ca3e0256007.tar.gz pdbg-f045f14437ef63e10f57580978dc9ca3e0256007.zip | |
Clean-up target configuration in preparation for adding P9 support
The previous implementation of targeting was hardcoded, cumbersome
and difficult to reconfigure for different chip types. This moves to a
method of configuring targets using device-tree which is much easier
to maintain and allows methods to be added to support operations like
getmem on POWER9.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Diffstat (limited to 'ccan/str/_info')
| -rw-r--r-- | ccan/str/_info | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/ccan/str/_info b/ccan/str/_info new file mode 100644 index 0000000..548f059 --- /dev/null +++ b/ccan/str/_info @@ -0,0 +1,52 @@ +#include <stdio.h> +#include <string.h> +#include "config.h" + +/** + * 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 <stdio.h> + * #include <ccan/str/str.h> + * + * int main(int argc, char *argv[]) + * { + * if (argv[1] && streq(argv[1], "--verbose")) + * printf("verbose set\n"); + * if (argv[1] && strstarts(argv[1], "--")) + * printf("Some option set\n"); + * if (argv[1] && strends(argv[1], "cow-powers")) + * printf("Magic option set\n"); + * return 0; + * } + * + * License: CC0 (Public domain) + * Author: Rusty Russell <rusty@rustcorp.com.au> + */ +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; +} |

