forked from github/server
change visibility of configuration data structures, local to config.c only
This commit is contained in:
parent
fe173e9551
commit
74b1f9872e
|
@ -1571,30 +1571,32 @@ bool markets_module(void)
|
||||||
return config_get_int("modules.markets", 0);
|
return config_get_int("modules.markets", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct param *configuration;
|
||||||
|
|
||||||
void config_set(const char *key, const char *value) {
|
void config_set(const char *key, const char *value) {
|
||||||
set_param(&global.parameters_, key, value);
|
set_param(&configuration, key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *config_get(const char *key) {
|
const char *config_get(const char *key) {
|
||||||
return get_param(global.parameters_, key);
|
return get_param(configuration, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
int config_get_int(const char *key, int def) {
|
int config_get_int(const char *key, int def) {
|
||||||
return get_param_int(global.parameters_, key, def);
|
return get_param_int(configuration, key, def);
|
||||||
}
|
}
|
||||||
|
|
||||||
double config_get_flt(const char *key, double def) {
|
double config_get_flt(const char *key, double def) {
|
||||||
return get_param_flt(global.parameters_, key, def);
|
return get_param_flt(configuration, key, def);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool config_token(const char *key, const char *tok) {
|
bool config_token(const char *key, const char *tok) {
|
||||||
return !!check_param(global.parameters_, key, tok);
|
return !!check_param(configuration, key, tok);
|
||||||
}
|
}
|
||||||
|
|
||||||
void free_config(void) {
|
void free_config(void) {
|
||||||
global.functions.maintenance = NULL;
|
global.functions.maintenance = NULL;
|
||||||
global.functions.wage = NULL;
|
global.functions.wage = NULL;
|
||||||
free_params(&global.parameters_);
|
free_params(&configuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** releases all memory associated with the game state.
|
/** releases all memory associated with the game state.
|
||||||
|
|
|
@ -246,7 +246,6 @@ extern "C" {
|
||||||
const char *gamename;
|
const char *gamename;
|
||||||
struct attrib *attribs;
|
struct attrib *attribs;
|
||||||
unsigned int data_turn;
|
unsigned int data_turn;
|
||||||
struct param *parameters_;
|
|
||||||
void *vm_state;
|
void *vm_state;
|
||||||
int data_version; /* TODO: eliminate in favor of gamedata.version */
|
int data_version; /* TODO: eliminate in favor of gamedata.version */
|
||||||
struct _dictionary_ *inifile;
|
struct _dictionary_ *inifile;
|
||||||
|
|
Loading…
Reference in New Issue