Browse Source

Add json_getdel_int64 helper

master
Con Kolivas 10 years ago
parent
commit
48f7702bd6
  1. 10
      src/ckpool.c
  2. 1
      src/ckpool.h

10
src/ckpool.c

@ -1061,6 +1061,16 @@ bool json_getdel_int(int *store, json_t *val, const char *res)
return ret;
}
bool json_getdel_int64(int64_t *store, json_t *val, const char *res)
{
bool ret;
ret = json_get_int64(store, val, res);
if (ret)
json_object_del(val, res);
return ret;
}
static void parse_btcds(ckpool_t *ckp, const json_t *arr_val, const int arr_size)
{
json_t *val;

1
src/ckpool.h

@ -228,5 +228,6 @@ bool json_get_int(int *store, const json_t *val, const char *res);
bool json_get_double(double *store, const json_t *val, const char *res);
bool json_get_bool(bool *store, const json_t *val, const char *res);
bool json_getdel_int(int *store, json_t *val, const char *res);
bool json_getdel_int64(int64_t *store, json_t *val, const char *res);
#endif /* CKPOOL_H */

Loading…
Cancel
Save