|
|
@ -965,20 +965,24 @@ bool json_get_string(char **store, const json_t *val, const char *res) |
|
|
|
return _json_get_string(store, json_object_get(val, res), res); |
|
|
|
return _json_get_string(store, json_object_get(val, res), res); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void json_get_int64(int64_t *store, const json_t *val, const char *res) |
|
|
|
bool json_get_int64(int64_t *store, const json_t *val, const char *res) |
|
|
|
{ |
|
|
|
{ |
|
|
|
json_t *entry = json_object_get(val, res); |
|
|
|
json_t *entry = json_object_get(val, res); |
|
|
|
|
|
|
|
bool ret = false; |
|
|
|
|
|
|
|
|
|
|
|
if (!entry) { |
|
|
|
if (!entry) { |
|
|
|
LOGDEBUG("Json did not find entry %s", res); |
|
|
|
LOGDEBUG("Json did not find entry %s", res); |
|
|
|
return; |
|
|
|
goto out; |
|
|
|
} |
|
|
|
} |
|
|
|
if (!json_is_integer(entry)) { |
|
|
|
if (!json_is_integer(entry)) { |
|
|
|
LOGWARNING("Json entry %s is not an integer", res); |
|
|
|
LOGWARNING("Json entry %s is not an integer", res); |
|
|
|
return; |
|
|
|
goto out; |
|
|
|
} |
|
|
|
} |
|
|
|
*store = json_integer_value(entry); |
|
|
|
*store = json_integer_value(entry); |
|
|
|
LOGDEBUG("Json found entry %s: %ld", res, *store); |
|
|
|
LOGDEBUG("Json found entry %s: %ld", res, *store); |
|
|
|
|
|
|
|
ret = true; |
|
|
|
|
|
|
|
out: |
|
|
|
|
|
|
|
return ret; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool json_get_int(int *store, const json_t *val, const char *res) |
|
|
|
bool json_get_int(int *store, const json_t *val, const char *res) |
|
|
|