mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
json: add print, copy, and remove functions
Needed for check command. I left the print function in since it was so convenient for debugging purposes. Signed-off-by: Mark Beckwith <wythe@intrig.com>
This commit is contained in:
committed by
Rusty Russell
parent
f5a3f1f0a2
commit
7cd6d39276
@@ -57,4 +57,19 @@ const jsmntok_t *json_get_arr(const jsmntok_t tok[], size_t index);
|
||||
/* If input is complete and valid, return tokens. */
|
||||
jsmntok_t *json_parse_input(const char *input, int len, bool *valid);
|
||||
|
||||
/* Convert a jsmntype_t enum to a human readable string. */
|
||||
const char *jsmntype_to_string(jsmntype_t t);
|
||||
|
||||
/* Print a json value for debugging purposes. */
|
||||
void json_tok_print(const char *buffer, const jsmntok_t *params);
|
||||
|
||||
/* Return a copy of a json value as an array. */
|
||||
jsmntok_t *json_tok_copy(const tal_t *ctx, const jsmntok_t *tok);
|
||||
|
||||
/*
|
||||
* Remove @num json values from a json array or object. @tok points
|
||||
* to the first value to remove. The array will be resized.
|
||||
*/
|
||||
void json_tok_remove(jsmntok_t **tokens, jsmntok_t *tok, size_t num);
|
||||
|
||||
#endif /* LIGHTNING_COMMON_JSON_H */
|
||||
|
||||
Reference in New Issue
Block a user