diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-09-24 11:01:07 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2013-10-22 14:10:33 +0200 |
commit | f88b0173d22e7f86ad8441c9a5bc76cee77f721a (patch) | |
tree | 54a3d4837e5c07c3ab57b6625d81275d5ef118f5 /handler.h | |
parent | f16a15c39c872c5f42eb554deb4d956264c0c823 (diff) |
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.h | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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 |