signed types: add handlers for signed types

We're adding signed types to the spec! This adds the support mechanisms
for them.
This commit is contained in:
Dustin Dettmer
2023-05-05 15:10:53 -04:00
committed by Rusty Russell
parent ad592d8b0d
commit aba4d18ed1
19 changed files with 266 additions and 77 deletions

View File

@@ -35,6 +35,9 @@ char *json_strdup(const tal_t *ctx, const char *buffer, const jsmntok_t *tok);
/* Extract number from this (may be a string, or a number literal) */
bool json_to_u64(const char *buffer, const jsmntok_t *tok, u64 *num);
/* Extract signed 64 bit integer from this (may be a string, or a number literal) */
bool json_to_s64(const char *buffer, const jsmntok_t *tok, s64 *num);
/* Extract number from string. The number must be the entirety of the
* string between the '"' */
bool json_str_to_u64(const char *buffer, const jsmntok_t *tok, u64 *num);