Reimplement core_info_get_first_custom_config

This commit is contained in:
twinaphex 2014-10-18 07:47:51 +02:00
parent e0f5fb4c20
commit ba11aa1312
2 changed files with 18 additions and 0 deletions

View File

@ -490,3 +490,18 @@ void core_info_list_get_missing_firmware(core_info_list_t *core_info_list,
core_info_firmware_cmp);
}
bool core_info_get_first_custom_config(const char *core_id,
char *buf, size_t sizeof_buf)
{
if (!core_id || !buf || !sizeof_buf)
return false;
fill_pathname_join(buf, g_defaults.menu_config_dir,
path_basename(core_id), sizeof_buf);
fill_pathname(buf, buf, ".cfg", sizeof_buf);
if (buf[0] == '\0')
return false;
return path_file_exists(buf);
}

View File

@ -101,6 +101,9 @@ bool core_info_list_get_display_name(core_info_list_t *list,
bool core_info_list_get_by_id(core_info_list_t *core_info_list,
core_info_t *out_info, const char *core_id);
bool core_info_get_first_custom_config(const char *core_id,
char *buf, size_t sizeof_buf);
#ifdef __cplusplus
}
#endif