--- a/config.h +++ b/config.h @@ -1,6 +1,6 @@ #define CONF_UPDATE_CONFIG_FILE "/etc/conf-update/conf-update.conf" -struct configuration { +extern struct configuration { bool automerge_trivial; bool automerge_unmodified; bool check_actions; --- a/helpers.c +++ b/helpers.c @@ -184,7 +184,6 @@ } } void sanity_checks() { - extern struct configuration config; unsigned int i; FILE *pipe; char *cmd = NULL; --- a/core.c +++ b/core.c @@ -73,7 +73,6 @@ } int show_diff(char *update) { - extern struct configuration config; char *realfile = get_real_filename(update); char *esc_realfile = g_shell_quote(realfile); char *esc_update = g_shell_quote(update); @@ -98,7 +97,6 @@ } int edit_update(char *update) { - extern struct configuration config; char *esc_update = g_shell_quote(update); char *cmd = calloc(strlen(config.edit_tool) + strlen(" ") + strlen(esc_update), sizeof(char)); int ret; @@ -116,7 +114,6 @@ char **merge_interactively(char *update, char **index) { // customized versions are ._cfg????- with a minus instead of a underscore // that way get_real_filename() works without modification - extern struct configuration config; char *realfile = get_real_filename(update); char *esc_realfile = g_shell_quote(realfile); char *esc_update = g_shell_quote(update); --- a/config.c +++ b/config.c @@ -1,5 +1,7 @@ #include "conf-update.h" +struct configuration config; + bool get_boolean(GKeyFile *conffile, const char *key, bool default_value) { GError *error = NULL; bool value, invalid_value, key_not_found; @@ -26,7 +28,6 @@ } void read_config() { - extern struct configuration config; GKeyFile *conffile; // set reasonable defaults