diff --git a/src/kernel/config.c b/src/kernel/config.c index a6c631573..27dcb2480 100644 --- a/src/kernel/config.c +++ b/src/kernel/config.c @@ -62,7 +62,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include #include #include #include @@ -2332,41 +2331,3 @@ int game_id(void) { return get_param_int(global.parameters, "game.id", 0); } -void load_inifile(dictionary * d) -{ - const char *reportdir = reportpath(); - const char *datadir = datapath(); - const char *basedir = basepath(); - const char *str; - - assert(d); - - str = iniparser_getstring(d, "eressea:base", basedir); - if (str != basedir) { - set_basepath(str); - } - str = iniparser_getstring(d, "eressea:report", reportdir); - if (str != reportdir) { - set_reportpath(str); - } - str = iniparser_getstring(d, "eressea:data", datadir); - if (str != datadir) { - set_datapath(str); - } - - lomem = iniparser_getint(d, "eressea:lomem", lomem) ? 1 : 0; - - str = iniparser_getstring(d, "eressea:encoding", NULL); - if (str && (_strcmpl(str, "utf8") == 0 || _strcmpl(str, "utf-8") == 0)) { - enc_gamedata = ENCODING_UTF8; - } - - verbosity = iniparser_getint(d, "eressea:verbose", 2); - battledebug = iniparser_getint(d, "eressea:debug", battledebug) ? 1 : 0; - - str = iniparser_getstring(d, "eressea:locales", "de,en"); - make_locales(str); - - if (global.inifile) iniparser_free(global.inifile); - global.inifile = d; -} diff --git a/src/kernel/config.h b/src/kernel/config.h index cf0429993..a3e218a82 100644 --- a/src/kernel/config.h +++ b/src/kernel/config.h @@ -301,7 +301,6 @@ extern "C" { const char *basepath(void); void set_basepath(const char *); - void load_inifile(struct _dictionary_ *d); const char *reportpath(void); void set_reportpath(const char *); diff --git a/src/main.c b/src/main.c index 7f74c9ea4..6868d36e9 100644 --- a/src/main.c +++ b/src/main.c @@ -22,6 +22,8 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include +#include +#include #include "eressea.h" #ifdef USE_CURSES #include "gmtool.h" @@ -43,6 +45,45 @@ static const char *luafile = 0; static const char *inifile = "eressea.ini"; static int memdebug = 0; +static void load_inifile(dictionary * d) +{ + const char *reportdir = reportpath(); + const char *datadir = datapath(); + const char *basedir = basepath(); + const char *str; + + assert(d); + + str = iniparser_getstring(d, "eressea:base", basedir); + if (str != basedir) { + set_basepath(str); + } + str = iniparser_getstring(d, "eressea:report", reportdir); + if (str != reportdir) { + set_reportpath(str); + } + str = iniparser_getstring(d, "eressea:data", datadir); + if (str != datadir) { + set_datapath(str); + } + + lomem = iniparser_getint(d, "eressea:lomem", lomem) ? 1 : 0; + + str = iniparser_getstring(d, "eressea:encoding", NULL); + if (str && (_strcmpl(str, "utf8") == 0 || _strcmpl(str, "utf-8") == 0)) { + enc_gamedata = ENCODING_UTF8; + } + + verbosity = iniparser_getint(d, "eressea:verbose", 2); + battledebug = iniparser_getint(d, "eressea:debug", battledebug) ? 1 : 0; + + str = iniparser_getstring(d, "eressea:locales", "de,en"); + make_locales(str); + + if (global.inifile) iniparser_free(global.inifile); + global.inifile = d; +} + static void parse_config(const char *filename) { dictionary *d = iniparser_new(filename);