2017-08-29 01:36:01 +09:30
|
|
|
#ifndef LIGHTNING_COMMON_CONFIGDIR_H
|
|
|
|
#define LIGHTNING_COMMON_CONFIGDIR_H
|
2016-01-22 06:41:48 +10:30
|
|
|
#include "config.h"
|
|
|
|
#include <ccan/tal/tal.h>
|
|
|
|
|
2023-06-02 12:05:51 +09:30
|
|
|
/* Unless overridden, we exit with status 1 when option parsing fails */
|
|
|
|
extern int opt_exitcode;
|
|
|
|
|
2017-12-14 06:30:24 +10:30
|
|
|
/* Helper for options which are tal() strings. */
|
|
|
|
char *opt_set_talstr(const char *arg, char **p);
|
|
|
|
|
2019-11-23 12:15:53 +10:30
|
|
|
/* Initial options setup */
|
|
|
|
void setup_option_allocators(void);
|
2019-07-25 15:05:36 +09:30
|
|
|
|
2023-06-02 12:05:51 +09:30
|
|
|
/* Minimal config parsing for tools: use opt_early_parse/opt_parse after */
|
|
|
|
void minimal_config_opts(const tal_t *ctx,
|
2019-11-23 12:15:53 +10:30
|
|
|
int argc, char *argv[],
|
2019-11-23 12:16:40 +10:30
|
|
|
char **config_netdir,
|
2019-11-23 12:15:53 +10:30
|
|
|
char **rpc_filename);
|
|
|
|
|
2023-06-02 12:05:51 +09:30
|
|
|
/* Parse initial config options and files */
|
|
|
|
struct configvar **initial_config_opts(const tal_t *ctx,
|
|
|
|
int *argc, char *argv[],
|
|
|
|
bool remove_args,
|
|
|
|
char **config_filename,
|
|
|
|
char **config_basedir,
|
|
|
|
char **config_netdir,
|
|
|
|
char **rpc_filename);
|
|
|
|
|
|
|
|
/* This is called before we know all the options. */
|
|
|
|
void parse_configvars_early(struct configvar **cvs);
|
|
|
|
|
|
|
|
/* This is called once, after we know all the options (if full_knowledge
|
|
|
|
* is false, ignore unknown non-cmdline options). */
|
|
|
|
void parse_configvars_final(struct configvar **cvs,
|
|
|
|
bool full_knowledge);
|
2019-11-23 12:15:53 +10:30
|
|
|
|
2019-11-23 12:16:58 +10:30
|
|
|
/* For listconfigs to detect. */
|
|
|
|
bool is_restricted_ignored(const void *fn);
|
|
|
|
bool is_restricted_print_if_nonnull(const void *fn);
|
2016-01-22 06:41:48 +10:30
|
|
|
|
2017-08-29 01:36:01 +09:30
|
|
|
#endif /* LIGHTNING_COMMON_CONFIGDIR_H */
|