diff --git a/conf/config_file.c b/conf/config_file.c index 9b84205b21..827df88831 100644 --- a/conf/config_file.c +++ b/conf/config_file.c @@ -23,7 +23,6 @@ #include #include #include -#include "../general.h" #if !defined(_WIN32) && !defined(__CELLOS_LV2__) && !defined(_XBOX) #include /* PATH_MAX */ @@ -36,31 +35,6 @@ #define MAX_INCLUDE_DEPTH 16 -struct config_entry_list -{ - /* If we got this from an #include, - * do not allow overwrite. */ - bool readonly; - char *key; - char *value; - struct config_entry_list *next; -}; - -struct include_list -{ - char *path; - struct include_list *next; -}; - -struct config_file -{ - char *path; - struct config_entry_list *entries; - struct config_entry_list *tail; - unsigned include_depth; - - struct include_list *includes; -}; static config_file_t *config_file_new_internal(const char *path, unsigned depth); void config_file_free(config_file_t *conf); @@ -184,8 +158,8 @@ static void add_child_list(config_file_t *parent, config_file_t *child) static void add_include_list(config_file_t *conf, const char *path) { - struct include_list *head = conf->includes; - struct include_list *node = (struct include_list*)calloc(1, sizeof(*node)); + struct config_include_list *head = conf->includes; + struct config_include_list *node = (struct config_include_list*)calloc(1, sizeof(*node)); if (!node) return; @@ -507,11 +481,11 @@ void config_file_free(config_file_t *conf) free(hold); } - struct include_list *inc_tmp = conf->includes; + struct config_include_list *inc_tmp = conf->includes; while (inc_tmp) { free(inc_tmp->path); - struct include_list *hold = inc_tmp; + struct config_include_list *hold = inc_tmp; inc_tmp = inc_tmp->next; free(hold); } @@ -858,7 +832,7 @@ bool config_file_write(config_file_t *conf, const char *path) void config_file_dump(config_file_t *conf, FILE *file) { - struct include_list *includes = conf->includes; + struct config_include_list *includes = conf->includes; while (includes) { fprintf(file, "#include \"%s\"\n", includes->path); @@ -874,26 +848,6 @@ void config_file_dump(config_file_t *conf, FILE *file) } } -#ifdef RARCH_INTERNAL -void config_file_dump_all(config_file_t *conf) -{ - struct include_list *includes = conf->includes; - while (includes) - { - RARCH_LOG("#include \"%s\"\n", includes->path); - includes = includes->next; - } - - struct config_entry_list *list = conf->entries; - while (list) - { - RARCH_LOG("%s = \"%s\" %s\n", list->key, - list->value, list->readonly ? "(included)" : ""); - list = list->next; - } -} -#endif - bool config_entry_exists(config_file_t *conf, const char *entry) { struct config_entry_list *list = conf->entries; diff --git a/conf/config_file.h b/conf/config_file.h index de2f841025..28ff0bbf0a 100644 --- a/conf/config_file.h +++ b/conf/config_file.h @@ -26,6 +26,32 @@ extern "C" { #include #include +struct config_entry_list +{ + /* If we got this from an #include, + * do not allow overwrite. */ + bool readonly; + char *key; + char *value; + struct config_entry_list *next; +}; + +struct config_include_list +{ + char *path; + struct config_include_list *next; +}; + +struct config_file +{ + char *path; + struct config_entry_list *entries; + struct config_entry_list *tail; + unsigned include_depth; + + struct config_include_list *includes; +}; + typedef struct config_file config_file_t; /* Config file format @@ -126,11 +152,6 @@ bool config_file_write(config_file_t *conf, const char *path); * Does not close the file. */ void config_file_dump(config_file_t *conf, FILE *file); -#ifdef RARCH_INTERNAL -/* Also dumps inherited values, useful for logging. */ -void config_file_dump_all(config_file_t *conf); -#endif - #ifdef __cplusplus } #endif diff --git a/settings.c b/settings.c index a0ee8331d5..78a1204a41 100644 --- a/settings.c +++ b/settings.c @@ -801,6 +801,26 @@ static config_file_t *open_default_config_file(void) static void config_read_keybinds_conf(config_file_t *conf); +/* Also dumps inherited values, useful for logging. */ + +static void config_file_dump_all(config_file_t *conf) +{ + struct config_include_list *includes = conf->includes; + while (includes) + { + RARCH_LOG("#include \"%s\"\n", includes->path); + includes = includes->next; + } + + struct config_entry_list *list = conf->entries; + while (list) + { + RARCH_LOG("%s = \"%s\" %s\n", list->key, + list->value, list->readonly ? "(included)" : ""); + list = list->next; + } +} + static bool config_load_file(const char *path, bool set_defaults) { unsigned i;