X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=handler.h;h=e96c05af13a3bbf9616d25b1c60a447b580d50e2;hp=d4b03344a41d820500b85398c2d0ea76c49b217a;hb=258b79f7a912abc84a3066c90266d8835597362e;hpb=72adf25cf21490aef012bb9314357f9b381934f9 diff --git a/handler.h b/handler.h index d4b0334..e96c05a 100644 --- a/handler.h +++ b/handler.h @@ -15,6 +15,8 @@ #define __NETIFD_HANDLER_H #include +#include +#include "config.h" typedef void (*script_dump_cb)(const char *script, const char *name, json_object *obj); @@ -33,7 +35,8 @@ json_check_type(json_object *obj, json_type type) static inline json_object * json_get_field(json_object *obj, const char *name, json_type type) { - return json_check_type(json_object_object_get(obj, name), type); + return json_object_object_get_ex(obj, name, &obj) ? + json_check_type(obj, type) : NULL; } int netifd_open_subdir(const char *name);