summaryrefslogtreecommitdiffstats
path: root/validate_data.c
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2013-11-11 15:54:29 +0100
committerJohn Crispin <blogic@openwrt.org>2013-11-12 10:32:32 +0100
commitcd4af8eb78c30718f999c487c93e257bbd969cb1 (patch)
tree4efeb2684dbe11b153ed168198d31c6208744f95 /validate_data.c
parent582c88fdb55e01f3814e9c09a860651ed51a659d (diff)
downloadunitd-cd4af8eb78c30718f999c487c93e257bbd969cb1.tar
unitd-cd4af8eb78c30718f999c487c93e257bbd969cb1.zip
add data type validator
Signed-off-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'validate_data.c')
-rw-r--r--validate_data.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/validate_data.c b/validate_data.c
new file mode 100644
index 0000000..dc5e96b
--- /dev/null
+++ b/validate_data.c
@@ -0,0 +1,28 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdbool.h>
+#include <ctype.h>
+
+#include <arpa/inet.h>
+#include <netinet/ether.h>
+#include <sys/stat.h>
+
+#include "libvalidate.h"
+
+int main(int argc, char **argv)
+{
+ bool rv;
+
+ if (argc == 3) {
+ rv = dt_parse(argv[1], argv[2]);
+
+ printf("%s - %s = %s\n", argv[1], argv[2], rv ? "true" : "false");
+
+ return rv ? 0 : 1;
+ } else if (argc > 3) {
+
+ }
+
+ return 0;
+}