From dfce8b5efd6e28a429d6bd534915624258963fb1 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 26 Mar 2018 10:38:47 +1030 Subject: [PATCH] common/json: move declaration into correct header. Reported-by: @ZmnSCPxj Signed-off-by: Rusty Russell --- common/json.h | 7 +++++++ common/json_escaped.h | 4 ---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/common/json.h b/common/json.h index 81265d993..96d804310 100644 --- a/common/json.h +++ b/common/json.h @@ -11,6 +11,7 @@ #define JSMN_STRICT 1 # include +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); diff --git a/common/json_escaped.h b/common/json_escaped.h index fe5b29eeb..333849f5f 100644 --- a/common/json_escaped.h +++ b/common/json_escaped.h @@ -29,10 +29,6 @@ bool json_escaped_streq(const struct json_escaped *esc, const char *str); bool json_escaped_eq(const struct json_escaped *a, const struct json_escaped *b); -void json_add_escaped_string(struct json_result *result, - const char *fieldname, - const struct json_escaped *esc TAKES); - /* Internal routine for creating json_escaped from bytes. */ struct json_escaped *json_escaped_string_(const tal_t *ctx, const void *bytes, size_t len);