]> git.ozlabs.org Git - ponghero.git/blobdiff - ccan/string/_info.c
Prepare for release: rename to ponghero and pull in ccan.
[ponghero.git] / ccan / string / _info.c
diff --git a/ccan/string/_info.c b/ccan/string/_info.c
new file mode 100644 (file)
index 0000000..2d1709f
--- /dev/null
@@ -0,0 +1,35 @@
+#include <stdio.h>
+#include <string.h>
+#include "config.h"
+
+/**
+ * string - string helper routines
+ *
+ * This is a grab bag of modules for string comparisons, designed to enhance
+ * the standard string.h.
+ *
+ * Example:
+ *     #include "ccan/string.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;
+ *     }
+ */
+int main(int argc, char *argv[])
+{
+       if (argc != 2)
+               return 1;
+
+       if (strcmp(argv[1], "depends") == 0)
+               /* Nothing. */
+               return 0;
+
+       return 1;
+}