forked from ElementsProject/lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjson_command.h
26 lines (20 loc) · 881 Bytes
/
json_command.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* These functions must be supplied by any binary linking with common/param
* so it can fail commands. */
#ifndef LIGHTNING_COMMON_JSON_COMMAND_H
#define LIGHTNING_COMMON_JSON_COMMAND_H
#include "config.h"
#include <ccan/compiler/compiler.h>
#include <stdbool.h>
struct command;
struct command_result;
/* Caller supplied this: param assumes it can call it. */
struct command_result *command_fail(struct command *cmd, int code,
const char *fmt, ...)
PRINTF_FMT(3, 4) WARN_UNUSED_RESULT;
/* Also caller supplied: is this invoked simply to get usage? */
bool command_usage_only(const struct command *cmd);
/* If so, this is called. */
void command_set_usage(struct command *cmd, const char *usage);
/* Also caller supplied: is this invoked simply to check parameters? */
bool command_check_only(const struct command *cmd);
#endif /* LIGHTNING_COMMON_JSON_COMMAND_H */