Rename struct json_result to struct json_stream (RENAMEONLY)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-10-19 11:47:49 +10:30
parent 66dcba099d
commit 0dcd66880c
23 changed files with 178 additions and 178 deletions

View File

@@ -18,7 +18,7 @@ struct bitcoin_txid;
struct channel_id;
struct command;
struct json_escaped;
struct json_result;
struct json_stream;
struct pubkey;
struct route_hop;
struct sha256;
@@ -28,21 +28,21 @@ struct wireaddr;
struct wireaddr_internal;
/* Output a route array. */
void json_add_route(struct json_result *r, char const *n,
void json_add_route(struct json_stream *r, char const *n,
const struct route_hop *hops, size_t hops_len);
/* Output the fields of a wallet payment.
* Should be used within an object context. */
void json_add_payment_fields(struct json_result *response,
void json_add_payment_fields(struct json_stream *response,
const struct wallet_payment *t);
/* '"fieldname" : "0289abcdef..."' or "0289abcdef..." if fieldname is NULL */
void json_add_pubkey(struct json_result *response,
void json_add_pubkey(struct json_stream *response,
const char *fieldname,
const struct pubkey *key);
/* '"fieldname" : <hexrev>' or "<hexrev>" if fieldname is NULL */
void json_add_txid(struct json_result *result, const char *fieldname,
void json_add_txid(struct json_stream *result, const char *fieldname,
const struct bitcoin_txid *txid);
/* Extract json array token */
@@ -134,7 +134,7 @@ bool json_tok_feerate(struct command *cmd, const char *name,
u32 **feerate);
/* '"fieldname" : "1234:5:6"' */
void json_add_short_channel_id(struct json_result *response,
void json_add_short_channel_id(struct json_stream *response,
const char *fieldname,
const struct short_channel_id *id);
@@ -142,11 +142,11 @@ bool json_tok_channel_id(const char *buffer, const jsmntok_t *tok,
struct channel_id *cid);
/* JSON serialize a network address for a node */
void json_add_address(struct json_result *response, const char *fieldname,
void json_add_address(struct json_stream *response, const char *fieldname,
const struct wireaddr *addr);
/* JSON serialize a network address for a node. */
void json_add_address_internal(struct json_result *response,
void json_add_address_internal(struct json_stream *response,
const char *fieldname,
const struct wireaddr_internal *addr);
@@ -162,13 +162,13 @@ bool json_tok_tok(struct command *cmd, const char *name,
/* Creating JSON output */
/* '"fieldname" : [ ' or '[ ' if fieldname is NULL */
void json_array_start(struct json_result *ptr, const char *fieldname);
void json_array_start(struct json_stream *ptr, const char *fieldname);
/* '"fieldname" : { ' or '{ ' if fieldname is NULL */
void json_object_start(struct json_result *ptr, const char *fieldname);
void json_object_start(struct json_stream *ptr, const char *fieldname);
/* ' ], ' */
void json_array_end(struct json_result *ptr);
void json_array_end(struct json_stream *ptr);
/* ' }, ' */
void json_object_end(struct json_result *ptr);
void json_object_end(struct json_stream *ptr);
/**
* json_stream_success - start streaming a successful json result.
@@ -177,7 +177,7 @@ void json_object_end(struct json_result *ptr);
* The returned value should go to command_success() when done.
* json_add_* will be placed into the 'result' field of the JSON reply.
*/
struct json_result *json_stream_success(struct command *cmd);
struct json_stream *json_stream_success(struct command *cmd);
/**
* json_stream_fail - start streaming a failed json result.
@@ -188,7 +188,7 @@ struct json_result *json_stream_success(struct command *cmd);
* The returned value should go to command_failed() when done;
* json_add_* will be placed into the 'data' field of the 'error' JSON reply.
*/
struct json_result *json_stream_fail(struct command *cmd,
struct json_stream *json_stream_fail(struct command *cmd,
int code,
const char *errmsg);
@@ -200,43 +200,43 @@ struct json_result *json_stream_fail(struct command *cmd,
*
* This is used by command_fail(), which doesn't add any JSON data.
*/
struct json_result *json_stream_fail_nodata(struct command *cmd,
struct json_stream *json_stream_fail_nodata(struct command *cmd,
int code,
const char *errmsg);
/* '"fieldname" : "value"' or '"value"' if fieldname is NULL. Turns
* any non-printable chars into JSON escapes, but leaves existing escapes alone.
*/
void json_add_string(struct json_result *result, const char *fieldname, const char *value);
void json_add_string(struct json_stream *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,
void json_add_escaped_string(struct json_stream *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,
void json_add_literal(struct json_stream *result, const char *fieldname,
const char *literal, int len);
/* '"fieldname" : value' or 'value' if fieldname is NULL */
void json_add_double(struct json_result *result, const char *fieldname,
void json_add_double(struct json_stream *result, const char *fieldname,
double value);
/* '"fieldname" : value' or 'value' if fieldname is NULL */
void json_add_num(struct json_result *result, const char *fieldname,
void json_add_num(struct json_stream *result, const char *fieldname,
unsigned int value);
/* '"fieldname" : value' or 'value' if fieldname is NULL */
void json_add_u64(struct json_result *result, const char *fieldname,
void json_add_u64(struct json_stream *result, const char *fieldname,
uint64_t value);
/* '"fieldname" : true|false' or 'true|false' if fieldname is NULL */
void json_add_bool(struct json_result *result, const char *fieldname,
void json_add_bool(struct json_stream *result, const char *fieldname,
bool value);
/* '"fieldname" : "0189abcdef..."' or "0189abcdef..." if fieldname is NULL */
void json_add_hex(struct json_result *result, const char *fieldname,
void json_add_hex(struct json_stream *result, const char *fieldname,
const void *data, size_t len);
/* '"fieldname" : "0189abcdef..."' or "0189abcdef..." if fieldname is NULL */
void json_add_hex_talarr(struct json_result *result,
void json_add_hex_talarr(struct json_stream *result,
const char *fieldname,
const tal_t *data);
void json_add_object(struct json_result *result, ...);
void json_add_object(struct json_stream *result, ...);
#endif /* LIGHTNING_LIGHTNINGD_JSON_H */