mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-17 19:03:42 +01:00
plugins/libplugin: make headers update-mocks friendly.
In particular, it expects return type at start of line. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
6f71aae336
commit
52e5ca3c11
@ -229,8 +229,8 @@ static struct command_result *command_complete(struct command *cmd,
|
|||||||
return &complete;
|
return &complete;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct command_result *WARN_UNUSED_RESULT
|
struct command_result *command_finished(struct command *cmd,
|
||||||
command_finished(struct command *cmd, struct json_stream *response)
|
struct json_stream *response)
|
||||||
{
|
{
|
||||||
/* "result" or "error" object */
|
/* "result" or "error" object */
|
||||||
json_object_end(response);
|
json_object_end(response);
|
||||||
|
@ -101,18 +101,18 @@ struct plugin_hook {
|
|||||||
const struct feature_set *plugin_feature_set(const struct plugin *p);
|
const struct feature_set *plugin_feature_set(const struct plugin *p);
|
||||||
|
|
||||||
/* Helper to create a JSONRPC2 request stream. Send it with `send_outreq`. */
|
/* Helper to create a JSONRPC2 request stream. Send it with `send_outreq`. */
|
||||||
struct out_req *
|
struct out_req *jsonrpc_request_start_(struct plugin *plugin,
|
||||||
jsonrpc_request_start_(struct plugin *plugin, struct command *cmd,
|
struct command *cmd,
|
||||||
const char *method,
|
const char *method,
|
||||||
struct command_result *(*cb)(struct command *command,
|
struct command_result *(*cb)(struct command *command,
|
||||||
const char *buf,
|
const char *buf,
|
||||||
const jsmntok_t *result,
|
const jsmntok_t *result,
|
||||||
void *arg),
|
void *arg),
|
||||||
struct command_result *(*errcb)(struct command *command,
|
struct command_result *(*errcb)(struct command *command,
|
||||||
const char *buf,
|
const char *buf,
|
||||||
const jsmntok_t *result,
|
const jsmntok_t *result,
|
||||||
void *arg),
|
void *arg),
|
||||||
void *arg);
|
void *arg);
|
||||||
|
|
||||||
#define jsonrpc_request_start(plugin, cmd, method, cb, errcb, arg) \
|
#define jsonrpc_request_start(plugin, cmd, method, cb, errcb, arg) \
|
||||||
jsonrpc_request_start_((plugin), (cmd), (method), \
|
jsonrpc_request_start_((plugin), (cmd), (method), \
|
||||||
@ -145,12 +145,12 @@ struct json_stream *jsonrpc_stream_fail_data(struct command *cmd,
|
|||||||
|
|
||||||
/* This command is finished, here's the response (the content of the
|
/* This command is finished, here's the response (the content of the
|
||||||
* "result" or "error" field) */
|
* "result" or "error" field) */
|
||||||
struct command_result *WARN_UNUSED_RESULT
|
WARN_UNUSED_RESULT
|
||||||
command_finished(struct command *cmd, struct json_stream *response);
|
struct command_result *command_finished(struct command *cmd, struct json_stream *response);
|
||||||
|
|
||||||
/* Helper for a command that'll be finished in a callback. */
|
/* Helper for a command that'll be finished in a callback. */
|
||||||
struct command_result *WARN_UNUSED_RESULT
|
WARN_UNUSED_RESULT
|
||||||
command_still_pending(struct command *cmd);
|
struct command_result *command_still_pending(struct command *cmd);
|
||||||
|
|
||||||
/* Helper to create a zero or single-value JSON object; if @str is NULL,
|
/* Helper to create a zero or single-value JSON object; if @str is NULL,
|
||||||
* object is empty. */
|
* object is empty. */
|
||||||
@ -199,8 +199,8 @@ void rpc_scan(struct plugin *plugin,
|
|||||||
...);
|
...);
|
||||||
|
|
||||||
/* Send an async rpc request to lightningd. */
|
/* Send an async rpc request to lightningd. */
|
||||||
struct command_result *
|
struct command_result *send_outreq(struct plugin *plugin,
|
||||||
send_outreq(struct plugin *plugin, const struct out_req *req);
|
const struct out_req *req);
|
||||||
|
|
||||||
/* Callback to just forward error and close request; @cmd cannot be NULL */
|
/* Callback to just forward error and close request; @cmd cannot be NULL */
|
||||||
struct command_result *forward_error(struct command *cmd,
|
struct command_result *forward_error(struct command *cmd,
|
||||||
|
Loading…
Reference in New Issue
Block a user