mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-02-07 21:56:44 +01:00
config: Add DeleteConfigOption function
This commit is contained in:
parent
e57db1d127
commit
58f97730db
2 changed files with 9 additions and 2 deletions
|
@ -62,6 +62,11 @@ SYMBOL_EXPORT const char* GetConfigOptionDefault(struct Game* game, char* sectio
|
|||
return ret;
|
||||
}
|
||||
|
||||
SYMBOL_EXPORT void DeleteConfigOption(struct Game* game, char* section, char* name) {
|
||||
al_remove_config_key(game->_priv.config, section, name);
|
||||
StoreConfig(game);
|
||||
}
|
||||
|
||||
SYMBOL_EXPORT void DeinitConfig(struct Game* game) {
|
||||
al_destroy_config(game->_priv.config);
|
||||
}
|
||||
|
|
|
@ -27,10 +27,12 @@
|
|||
void InitConfig(struct Game* game);
|
||||
/*! \brief Returns value of requested config entry. */
|
||||
const char* GetConfigOption(struct Game* game, char* section, char* name);
|
||||
/*! \brief Returns value of requested config entry, or def if no such entry exists. */
|
||||
/*! \brief Returns value of requested config entry, or `def` if no such entry exists. */
|
||||
const char* GetConfigOptionDefault(struct Game* game, char* section, char* name, const char* def);
|
||||
/*! \brief Sets new value of requested config entry, or created new if no such entry exists. */
|
||||
/*! \brief Sets a new value of requested config entry, or creates a new one if no such entry exists. */
|
||||
void SetConfigOption(struct Game* game, char* section, char* name, char* value);
|
||||
/*! \brief Deletes an existing config entry. */
|
||||
void DeleteConfigOption(struct Game* game, char* section, char* name);
|
||||
/*! \brief Writes config from memory to file. */
|
||||
void DeinitConfig(struct Game* game);
|
||||
|
||||
|
|
Loading…
Reference in a new issue