Exemplo n.º 1
0
static void parse_config(const char *filename)
{
    dictionary *d = iniparser_load(filename);
    if (d) {
        load_inifile(d);
        log_debug("reading from configuration file %s\n", filename);

        memdebug = iniparser_getint(d, "eressea:memcheck", memdebug);
#ifdef USE_CURSES
        /* only one value in the [editor] section */
        force_color = iniparser_getint(d, "editor:color", force_color);
#endif
    }
}
Exemplo n.º 2
0
static void parse_config(const char *filename)
{
  dictionary *d = iniparser_new(filename);
  if (d) {
    load_inifile(d);
    log_debug("reading from configuration file %s\n", filename);

    memdebug = iniparser_getint(d, "eressea:memcheck", memdebug);
#ifdef USE_CURSES
    /* only one value in the [editor] section */
    force_color = iniparser_getint(d, "editor:color", force_color);
#endif
    /* excerpt from [config] (the rest is used in bindings.c) */
    game_name = iniparser_getstring(d, "config:game", game_name);
  } else {
    log_warning("could not open configuration file %s\n", filename);
  }
  global.inifile = d;
}
Exemplo n.º 3
0
static dictionary *parse_config(const char *filename)
{
    dictionary *d;
    const char *str, *cfgpath = config_get("config.path");

    if (cfgpath) {
        char path[PATH_MAX];
        path_join(cfgpath, filename, path, sizeof(path));
        log_debug("reading from configuration file %s\n", path);
        d = iniparser_load(path);
    }
    else {
        log_debug("reading from configuration file %s\n", filename);
        d = iniparser_load(filename);
    }
    if (d) {
        config_set_from(d, valid_keys);
        load_inifile();
    }
    str = config_get("game.locales");
    make_locales(str ? str : "de,en");
    return d;
}