2017-08-28 18:06:01 +02:00
|
|
|
#ifndef LIGHTNING_COMMON_CONFIGDIR_H
|
|
|
|
#define LIGHTNING_COMMON_CONFIGDIR_H
|
2016-01-21 21:11:48 +01:00
|
|
|
#include "config.h"
|
|
|
|
#include <ccan/tal/tal.h>
|
|
|
|
|
2019-11-23 02:46:58 +01:00
|
|
|
/* Put things we're going to get rid of behind this, so testers can catch
|
|
|
|
* them early. */
|
|
|
|
extern bool deprecated_apis;
|
|
|
|
|
2017-12-13 21:00:24 +01:00
|
|
|
/* Helper for options which are tal() strings. */
|
|
|
|
char *opt_set_talstr(const char *arg, char **p);
|
|
|
|
|
2019-11-23 02:45:53 +01:00
|
|
|
/* Initial options setup */
|
|
|
|
void setup_option_allocators(void);
|
2019-07-25 07:35:36 +02:00
|
|
|
|
2019-11-23 02:45:53 +01:00
|
|
|
/* Parse minimal config options and files */
|
|
|
|
void initial_config_opts(const tal_t *ctx,
|
|
|
|
int argc, char *argv[],
|
|
|
|
char **config_filename,
|
2019-11-23 02:46:40 +01:00
|
|
|
char **config_basedir,
|
|
|
|
char **config_netdir,
|
2019-11-23 02:45:53 +01:00
|
|
|
char **rpc_filename);
|
|
|
|
|
2019-11-23 02:45:53 +01:00
|
|
|
/* If they specify --conf, we just read that.
|
2019-11-23 02:46:40 +01:00
|
|
|
* Otherwise, we read basedir/config (toplevel), and basedir/<network>/config
|
|
|
|
* (network-level) */
|
2019-11-23 02:45:53 +01:00
|
|
|
void parse_config_files(const char *config_filename,
|
2019-11-23 02:46:40 +01:00
|
|
|
const char *config_basedir,
|
2019-11-23 02:45:53 +01:00
|
|
|
bool early);
|
2019-11-23 02:45:53 +01:00
|
|
|
|
2019-11-23 02:46:58 +01:00
|
|
|
/* For listconfigs to detect. */
|
|
|
|
bool is_restricted_ignored(const void *fn);
|
|
|
|
bool is_restricted_print_if_nonnull(const void *fn);
|
2016-01-21 21:11:48 +01:00
|
|
|
|
2017-08-28 18:06:01 +02:00
|
|
|
#endif /* LIGHTNING_COMMON_CONFIGDIR_H */
|