1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2024-10-27 20:44:10 +00:00
falk-werner_webfuse-provider/lib/webfuse/adapter/impl/jsonrpc/util.c

14 lines
329 B
C
Raw Normal View History

2019-03-26 22:04:53 +00:00
#include "webfuse/adapter/impl/jsonrpc/util.h"
2019-02-09 02:08:02 +00:00
2019-03-26 22:04:53 +00:00
int wf_impl_json_get_int(json_t const * object, char const * key, int default_value)
2019-02-09 02:08:02 +00:00
{
int result = default_value;
json_t * holder = json_object_get(object, key);
if ((NULL != holder) && (json_is_integer(holder)))
{
result = json_integer_value(holder);
}
return result;
}