]> git.ozlabs.org Git - ccan/blob - ccan/str/_info
Import from SAMBA tdb:
[ccan] / ccan / str / _info
1 #include <stdio.h>
2 #include <string.h>
3 #include "config.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  * Example:
12  *      #include <stdio.h>
13  *      #include <ccan/str/str.h>
14  *
15  *      int main(int argc, char *argv[])
16  *      {
17  *              if (argv[1] && streq(argv[1], "--verbose"))
18  *                      printf("verbose set\n");
19  *              if (argv[1] && strstarts(argv[1], "--"))
20  *                      printf("Some option set\n");
21  *              if (argv[1] && strends(argv[1], "cow-powers"))
22  *                      printf("Magic option set\n");
23  *              return 0;
24  *      }
25  *
26  * Licence: LGPL (2 or any later version)
27  */
28 int main(int argc, char *argv[])
29 {
30         if (argc != 2)
31                 return 1;
32
33         if (strcmp(argv[1], "depends") == 0) {
34                 return 0;
35         }
36
37         return 1;
38 }