]> git.ozlabs.org Git - ccan/blob - ccan/string/_info.c
strsplit()
[ccan] / ccan / string / _info.c
1 #include <stdio.h>
2 #include <string.h>
3 #include "config.h"
4
5 /**
6  * string - string helper routines
7  *
8  * This is a grab bag of modules for string operations, designed to enhance
9  * the standard string.h.
10  *
11  * Example:
12  *      #include "string/string.h"
13  *
14  *      int main(int argc, char *argv[])
15  *      {
16  *              if (argv[1] && streq(argv[1], "--verbose"))
17  *                      printf("verbose set\n");
18  *              if (argv[1] && strstarts(argv[1], "--"))
19  *                      printf("Some option set\n");
20  *              if (argv[1] && strends(argv[1], "cow-powers"))
21  *                      printf("Magic option set\n");
22  *              return 0;
23  *      }
24  */
25 int main(int argc, char *argv[])
26 {
27         if (argc != 2)
28                 return 1;
29
30         if (strcmp(argv[1], "depends") == 0) {
31                 printf("ccan/talloc\n");
32                 return 0;
33         }
34
35         return 1;
36 }