#pragma once
#include <json-c/json.h>
#define NODE_NAME(c) (*(char **)&(c)->node.key)
static inline struct json_object * neco_json_get_value(
struct json_object *obj,
const char *key,
enum json_type type
) {
struct json_object *value;
if (!json_object_object_get_ex(obj, key, &value))
return NULL;
if (!json_object_is_type(value, type))
return value;
}
static inline const char * neco_json_get_string(struct json_object *obj, const char *key) {
struct json_object *value = neco_json_get_value(obj, key, json_type_string);
if (!value)
return json_object_get_string(value);