common/json.c: Implement json_to_u32.

This commit is contained in:
ZmnSCPxj jxPCSnmZ
2020-01-15 16:04:03 +08:00
committed by Christian Decker
parent fb7c006187
commit 44e8256338
2 changed files with 19 additions and 0 deletions

View File

@@ -37,6 +37,10 @@ bool json_to_number(const char *buffer, const jsmntok_t *tok,
bool json_to_u64(const char *buffer, const jsmntok_t *tok,
uint64_t *num);
/* Extract number from this (may be a string, or a number literal) */
bool json_to_u32(const char *buffer, const jsmntok_t *tok,
uint32_t *num);
/* Extract number from this (may be a string, or a number literal) */
bool json_to_u16(const char *buffer, const jsmntok_t *tok,
uint16_t *num);