mirror of
https://github.com/libretro/RetroArch.git
synced 2025-01-31 14:04:21 +00:00
Add config_save_keybinds_file
This commit is contained in:
parent
85482945bf
commit
de53f9980d
34
settings.c
34
settings.c
@ -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;
|
||||
|
12
settings.h
12
settings.h
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user