common/json: move declaration into correct header.

Reported-by: @ZmnSCPxj
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-03-26 10:38:47 +10:30
parent 7ae013202f
commit dfce8b5efd
2 changed files with 7 additions and 4 deletions

View File

@@ -11,6 +11,7 @@
#define JSMN_STRICT 1
# include <external/jsmn/jsmn.h>
struct json_escaped;
struct json_result;
struct short_channel_id;
@@ -80,6 +81,12 @@ struct json_result *new_json_result(const tal_t *ctx);
*/
void json_add_string(struct json_result *result, const char *fieldname, const char *value);
/* '"fieldname" : "value"' or '"value"' if fieldname is NULL. String must
* already be JSON escaped as necessary. */
void json_add_escaped_string(struct json_result *result,
const char *fieldname,
const struct json_escaped *esc TAKES);
/* '"fieldname" : literal' or 'literal' if fieldname is NULL*/
void json_add_literal(struct json_result *result, const char *fieldname,
const char *literal, int len);