2017-08-28 18:06:01 +02:00
|
|
|
#ifndef LIGHTNING_LIGHTNINGD_OPTIONS_H
|
|
|
|
#define LIGHTNING_LIGHTNINGD_OPTIONS_H
|
2017-01-04 03:52:29 +01:00
|
|
|
#include "config.h"
|
2022-12-20 17:44:45 +01:00
|
|
|
#include <ccan/ccan/opt/opt.h>
|
2017-01-04 03:52:29 +01:00
|
|
|
|
2023-06-05 16:17:21 +02:00
|
|
|
struct json_stream;
|
2017-08-28 18:09:01 +02:00
|
|
|
struct lightningd;
|
2017-01-04 03:52:29 +01:00
|
|
|
|
2019-07-25 08:37:58 +02:00
|
|
|
/* After this, early config file and cmdline options parsed. */
|
2018-10-31 18:00:44 +01:00
|
|
|
void handle_early_opts(struct lightningd *ld, int argc, char *argv[]);
|
|
|
|
|
2019-07-25 08:37:58 +02:00
|
|
|
/* After this we're in the .lightning dir, and we've parsed all options */
|
2023-06-02 04:35:51 +02:00
|
|
|
void handle_opts(struct lightningd *ld);
|
2017-01-04 03:52:29 +01:00
|
|
|
|
2017-10-23 07:05:28 +02:00
|
|
|
/* Derive default color and alias from the pubkey. */
|
|
|
|
void setup_color_and_alias(struct lightningd *ld);
|
2018-01-16 20:43:14 +01:00
|
|
|
|
2022-12-20 17:44:45 +01:00
|
|
|
enum opt_autobool {
|
|
|
|
OPT_AUTOBOOL_FALSE = 0,
|
|
|
|
OPT_AUTOBOOL_TRUE = 1,
|
|
|
|
OPT_AUTOBOOL_AUTO = 2,
|
|
|
|
};
|
|
|
|
char *opt_set_autobool_arg(const char *arg, enum opt_autobool *b);
|
2023-06-01 06:16:21 +02:00
|
|
|
bool opt_show_autobool(char *buf, size_t len, const enum opt_autobool *b);
|
2022-12-20 17:44:45 +01:00
|
|
|
|
2023-06-02 04:36:04 +02:00
|
|
|
/* opt_bool is quite loose; you should use this if wanting to add it to JSON */
|
|
|
|
bool opt_canon_bool(const char *val);
|
2023-06-05 16:17:21 +02:00
|
|
|
|
|
|
|
void add_config_deprecated(struct lightningd *ld,
|
|
|
|
struct json_stream *response,
|
|
|
|
const struct opt_table *opt,
|
|
|
|
const char *name, size_t len);
|
|
|
|
bool is_known_opt_cb_arg(char *(*cb_arg)(const char *, void *));
|
2017-08-28 18:06:01 +02:00
|
|
|
#endif /* LIGHTNING_LIGHTNINGD_OPTIONS_H */
|