]> git.ozlabs.org Git - ccan/blob - ccan/str/_info
hex: fix comment
[ccan] / ccan / str / _info
1 #include "config.h"
2 #include <stdio.h>
3 #include <string.h>
4
5 /**
6  * str - string helper routines
7  *
8  * This is a grab bag of functions for string operations, designed to enhance
9  * the standard string.h.
10  *
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!).
14  *
15  *      strstr, strchr, strrchr:
16  *              Return const char * if first argument is const (gcc only).
17  *
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!).
22  *
23  * Example:
24  *      #include <stdio.h>
25  *      #include <ccan/str/str.h>
26  *
27  *      int main(int argc, char *argv[])
28  *      {
29  *              if (argc > 1 && streq(argv[1], "--verbose"))
30  *                      printf("verbose set\n");
31  *              if (argc > 1 && strstarts(argv[1], "--"))
32  *                      printf("Some option set\n");
33  *              if (argc > 1 && strends(argv[1], "cow-powers"))
34  *                      printf("Magic option set\n");
35  *              return 0;
36  *      }
37  *
38  * License: CC0 (Public domain)
39  * Author: Rusty Russell <rusty@rustcorp.com.au>
40  */
41 int main(int argc, char *argv[])
42 {
43         if (argc != 2)
44                 return 1;
45
46         if (strcmp(argv[1], "depends") == 0) {
47                 printf("ccan/build_assert\n");
48                 return 0;
49         }
50
51         return 1;
52 }