From f88b0173d22e7f86ad8441c9a5bc76cee77f721a Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 24 Sep 2013 11:01:07 +0200 Subject: proto-shell: move script handler config parse code to handler.c Signed-off-by: Felix Fietkau --- handler.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'handler.h') 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 -- cgit v1.2.3