diff --git a/configfile.c b/configfile.c index 9283b976..2d7f8e6a 100644 --- a/configfile.c +++ b/configfile.c @@ -33,6 +33,7 @@ const static char *_progname = NULL; char config_file_path[MAXPGPATH] = ""; static bool config_file_provided = false; bool config_file_found = false; +t_configuration_options config_file_options = T_CONFIGURATION_OPTIONS_INITIALIZER; static void parse_config(t_configuration_options *options, bool terse); static void _parse_config(t_configuration_options *options, ItemList *error_list, ItemList *warning_list); diff --git a/configfile.h b/configfile.h index d1eef273..9515e60c 100644 --- a/configfile.h +++ b/configfile.h @@ -191,6 +191,11 @@ typedef struct int promote_delay; } t_configuration_options; + +/* Declare the main configfile structure for client applications */ +extern t_configuration_options config_file_options; + + /* * The following will initialize the structure with a minimal set of options; * actual defaults are set in parse_config() before parsing the configuration file diff --git a/repmgr-client-global.h b/repmgr-client-global.h index 19e2619a..7a27af14 100644 --- a/repmgr-client-global.h +++ b/repmgr-client-global.h @@ -240,19 +240,16 @@ typedef struct ColHeader -/* global configuration structures */ +/* globally available configuration structures */ extern t_runtime_options runtime_options; -extern t_configuration_options config_file_options; - -t_conninfo_param_list source_conninfo; - +extern t_conninfo_param_list source_conninfo; +extern t_node_info target_node_info; +/* global variables */ extern bool config_file_required; extern char pg_bindir[MAXLEN]; -extern t_node_info target_node_info; - - +/* global functions */ extern int check_server_version(PGconn *conn, char *server_type, bool exit_on_error, char *server_version_string); extern void check_93_config(void); extern bool create_repmgr_extension(PGconn *conn); diff --git a/repmgr-client.c b/repmgr-client.c index d7f33fc7..70df0237 100644 --- a/repmgr-client.c +++ b/repmgr-client.c @@ -75,7 +75,6 @@ * ============================ */ t_runtime_options runtime_options = T_RUNTIME_OPTIONS_INITIALIZER; -t_configuration_options config_file_options = T_CONFIGURATION_OPTIONS_INITIALIZER; /* conninfo params for the node we're operating on */ t_conninfo_param_list source_conninfo = T_CONNINFO_PARAM_LIST_INITIALIZER; diff --git a/repmgrd.c b/repmgrd.c index 383a6aa9..4f01ce47 100644 --- a/repmgrd.c +++ b/repmgrd.c @@ -39,13 +39,9 @@ static bool daemonize = true; static bool show_pid_file = false; static bool no_pid_file = false; -t_configuration_options config_file_options = T_CONFIGURATION_OPTIONS_INITIALIZER; - t_node_info local_node_info = T_NODE_INFO_INITIALIZER; PGconn *local_conn = NULL; - - /* Collate command line errors here for friendlier reporting */ static ItemList cli_errors = {NULL, NULL}; diff --git a/repmgrd.h b/repmgrd.h index 646d67a7..a4648d42 100644 --- a/repmgrd.h +++ b/repmgrd.h @@ -17,7 +17,6 @@ extern volatile sig_atomic_t got_SIGHUP; extern MonitoringState monitoring_state; extern instr_time degraded_monitoring_start; -extern t_configuration_options config_file_options; extern t_node_info local_node_info; extern PGconn *local_conn; extern bool startup_event_logged;