Browse Source

common/json: move declaration into correct header.

Reported-by: @ZmnSCPxj
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 7 years ago
parent
commit
dfce8b5efd
  1. 7
      common/json.h
  2. 4
      common/json_escaped.h

7
common/json.h

@ -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);

4
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);

Loading…
Cancel
Save