summaryrefslogtreecommitdiff
path: root/handler.h
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-09-24 11:01:07 +0200
committerFelix Fietkau <nbd@openwrt.org>2013-10-22 14:10:33 +0200
commitf88b0173d22e7f86ad8441c9a5bc76cee77f721a (patch)
tree54a3d4837e5c07c3ab57b6625d81275d5ef118f5 /handler.h
parentf16a15c39c872c5f42eb554deb4d956264c0c823 (diff)
downloadnetifd-f88b0173d22e7f86ad8441c9a5bc76cee77f721a.tar.gz
proto-shell: move script handler config parse code to handler.c
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'handler.h')
-rw-r--r--handler.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/handler.h b/handler.h
index 02438f2..de403e1 100644
--- a/handler.h
+++ b/handler.h
@@ -18,7 +18,20 @@
typedef void (*script_dump_cb)(const char *name, json_object *obj);
+static inline json_object *
+json_check_type(json_object *obj, json_type type)
+{
+ if (!obj)
+ return NULL;
+
+ if (json_object_get_type(obj) != type)
+ return NULL;
+
+ return obj;
+}
+
int netifd_open_subdir(const char *name);
void netifd_init_script_handlers(int dir_fd, script_dump_cb cb);
+char *netifd_handler_parse_config(struct uci_blob_param_list *config, json_object *obj);
#endif