-static int j_get_boolean(struct json_object *obj, const char *key, int defval)
-{
- struct json_object *o;
- return json_object_object_get_ex(obj, key, &o) && json_object_get_type(o) == json_type_boolean ? json_object_get_boolean(o) : defval;
-}
-
-static int json_add(struct json_object *obj, const char *key, struct json_object *val)
-{
- json_object_object_add(obj, key, val);
- return 0;
-}
-
-static int json_add_str(struct json_object *obj, const char *key, const char *val)
-{
- struct json_object *str = json_object_new_string (val ? val : "");
- return str ? json_add(obj, key, str) : (errno = ENOMEM, -1);
-}
-/*
-static int json_add_int(struct json_object *obj, const char *key, int val)
-{
- struct json_object *v = json_object_new_int (val);
- return v ? json_add(obj, key, v) : (errno = ENOMEM, -1);
-}
-*/
-static void on_install(struct jreq *jreq, struct json_object *req)