Add config_save_keybinds_file

This commit is contained in:
twinaphex 2015-01-19 07:43:28 +01:00
parent 85482945bf
commit de53f9980d
2 changed files with 44 additions and 2 deletions

View file

@ -1699,6 +1699,8 @@ static void save_keybind(config_file_t *conf, const char *prefix,
save_keybind_axis(conf, prefix, base, bind);
}
/**
* save_keybinds_user:
* @conf : pointer to config file object
@ -1747,6 +1749,36 @@ void config_load(void)
config_load_core_specific();
}
/**
* config_save_keybinds_file:
* @path : Path that shall be written to.
*
* Writes a keybinds config file to disk.
*
* Returns: true (1) on success, otherwise returns false (0).
**/
bool config_save_keybinds_file(const char *path)
{
unsigned i = 0;
bool ret = false;
config_file_t *conf = config_file_new(path);
if (!conf)
conf = config_file_new(NULL);
if (!conf)
return false;
RARCH_LOG("Saving keybinds config at path: \"%s\"\n", path);
for (i = 0; i < MAX_USERS; i++)
save_keybinds_user(conf, i);
ret = config_file_write(conf, path);
config_file_free(conf);
return ret;
}
/**
* config_save_file:
* @path : Path that shall be written to.
@ -1754,7 +1786,7 @@ void config_load(void)
* Writes a config file to disk.
*
* Returns: true (1) on success, otherwise returns false (0).
*/
**/
bool config_save_file(const char *path)
{
unsigned i = 0;

View file

@ -112,6 +112,16 @@ const char *config_get_default_menu(void);
*/
void config_load(void);
/**
* config_save_keybinds_file:
* @path : Path that shall be written to.
*
* Writes a keybinds config file to disk.
*
* Returns: true (1) on success, otherwise returns false (0).
**/
bool config_save_keybinds_file(const char *path);
/**
* config_save_file:
* @path : Path that shall be written to.
@ -119,7 +129,7 @@ void config_load(void);
* Writes a config file to disk.
*
* Returns: true (1) on success, otherwise returns false (0).
*/
**/
bool config_save_file(const char *path);
#ifdef __cplusplus