]> git.ozlabs.org Git - ccan/blobdiff - ccan/order/_info
order: Module for comparison callbacks
[ccan] / ccan / order / _info
diff --git a/ccan/order/_info b/ccan/order/_info
new file mode 100644 (file)
index 0000000..5a68f67
--- /dev/null
@@ -0,0 +1,30 @@
+#include "config.h"
+#include <stdio.h>
+#include <string.h>
+
+/**
+ * order - Simple, common value comparison functions
+ *
+ * This implements a number of commonly useful comparison functions in
+ * a form which can be used with qsort() and bsearch() in the standard
+ * library, or asort() and asearch() in ccan amongst other places.
+ *
+ * License: CC0
+ * Author: David Gibson <david@gibson.dropbear.id.au>
+ */
+int main(int argc, char *argv[])
+{
+       /* Expect exactly one argument */
+       if (argc != 2)
+               return 1;
+
+       if (strcmp(argv[1], "depends") == 0) {
+               printf("ccan/typesafe_cb\n");
+               return 0;
+       }
+       if (strcmp(argv[1], "testdepends") == 0) {
+               return 0;
+       }
+
+       return 1;
+}