Create fill_pathname_join_concat_noext and use it

This commit is contained in:
twinaphex 2018-01-31 22:43:55 +01:00
parent 19c537db52
commit f9a412dc11
3 changed files with 48 additions and 36 deletions

View File

@ -863,6 +863,16 @@ void fill_pathname_join_special_ext(char *out_path,
strlcat(out_path, ext, size);
}
void fill_pathname_join_concat_noext(
char *out_path,
const char *dir, const char *path,
const char *concat,
size_t size)
{
fill_pathname_noext(out_path, dir, path, size);
strlcat(out_path, concat, size);
}
void fill_pathname_join_concat(char *out_path,
const char *dir, const char *path,
const char *concat,

View File

@ -348,6 +348,12 @@ void fill_pathname_join_special_ext(char *out_path,
const char *last, const char *ext,
size_t size);
void fill_pathname_join_concat_noext(
char *out_path,
const char *dir, const char *path,
const char *concat,
size_t size);
void fill_pathname_join_concat(char *out_path,
const char *dir, const char *path,
const char *concat,

View File

@ -196,23 +196,23 @@ static int menu_displaylist_parse_core_info(menu_displaylist_info_t *info)
if (core_info->systemname)
{
fill_pathname_noext(tmp,
fill_pathname_join_concat_noext(tmp,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_CORE_INFO_SYSTEM_NAME),
": ",
core_info->systemname,
sizeof(tmp));
strlcat(tmp, core_info->systemname, sizeof(tmp));
menu_entries_append_enum(info->list, tmp, "",
MENU_ENUM_LABEL_CORE_INFO_ENTRY, MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
}
if (core_info->system_manufacturer)
{
fill_pathname_noext(tmp,
fill_pathname_join_concat_noext(tmp,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_INFO_SYSTEM_MANUFACTURER),
": ",
core_info->system_manufacturer,
sizeof(tmp));
strlcat(tmp, core_info->system_manufacturer, sizeof(tmp));
menu_entries_append_enum(info->list, tmp, "",
MENU_ENUM_LABEL_CORE_INFO_ENTRY, MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
}
@ -381,11 +381,12 @@ static int menu_displaylist_parse_system_info(menu_displaylist_info_t *info)
(void)tmp_string;
#ifdef HAVE_GIT_VERSION
fill_pathname_noext(tmp,
fill_pathname_join_concat_noext(
tmp,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_GIT_VERSION),
": ",
retroarch_git_version,
sizeof(tmp));
strlcat(tmp, retroarch_git_version, sizeof(tmp));
menu_entries_append_enum(info->list, tmp, "",
MENU_ENUM_LABEL_SYSTEM_INFO_ENTRY, MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
#endif
@ -530,11 +531,12 @@ static int menu_displaylist_parse_system_info(menu_displaylist_info_t *info)
tmp2[0] = '\0';
fill_pathname_noext(tmp,
fill_pathname_join_concat_noext(
tmp,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_FRONTEND_IDENTIFIER),
": ",
frontend->ident,
sizeof(tmp));
strlcat(tmp, frontend->ident, sizeof(tmp));
menu_entries_append_enum(info->list, tmp, "",
MENU_ENUM_LABEL_SYSTEM_INFO_ENTRY,
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
@ -544,11 +546,10 @@ static int menu_displaylist_parse_system_info(menu_displaylist_info_t *info)
{
frontend->get_lakka_version(tmp2, sizeof(tmp2));
fill_pathname_noext(tmp,
fill_pathname_join_concat_noext(tmp,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_LAKKA_VERSION),
": ",
sizeof(tmp));
strlcat(tmp, frontend->get_lakka_version ?
frontend->get_lakka_version ?
tmp2 : msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE),
sizeof(tmp));
menu_entries_append_enum(info->list, tmp, "",
@ -561,11 +562,10 @@ static int menu_displaylist_parse_system_info(menu_displaylist_info_t *info)
{
frontend->get_name(tmp2, sizeof(tmp2));
fill_pathname_noext(tmp,
fill_pathname_join_concat_noext(tmp,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_FRONTEND_NAME),
": ",
sizeof(tmp));
strlcat(tmp, frontend->get_name ?
frontend->get_name ?
tmp2 : msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE),
sizeof(tmp));
menu_entries_append_enum(info->list, tmp, "",
@ -690,12 +690,12 @@ static int menu_displaylist_parse_system_info(menu_displaylist_info_t *info)
break;
}
fill_pathname_noext(tmp,
fill_pathname_join_concat_noext(tmp,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_POWER_SOURCE),
": ",
tmp2,
sizeof(tmp));
strlcat(tmp, tmp2, sizeof(tmp));
menu_entries_append_enum(info->list, tmp, "",
MENU_ENUM_LABEL_SYSTEM_INFO_ENTRY,
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
@ -706,12 +706,11 @@ static int menu_displaylist_parse_system_info(menu_displaylist_info_t *info)
video_context_driver_get_ident(&ident_info);
tmp_string = ident_info.ident;
fill_pathname_noext(tmp,
fill_pathname_join_concat_noext(tmp,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_VIDEO_CONTEXT_DRIVER),
": ",
sizeof(tmp));
strlcat(tmp, tmp_string ? tmp_string
tmp_string ? tmp_string
: msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE),
sizeof(tmp));
menu_entries_append_enum(info->list, tmp, "",
@ -764,12 +763,10 @@ static int menu_displaylist_parse_system_info(menu_displaylist_info_t *info)
}
#endif
fill_pathname_noext(feat_str,
fill_pathname_join_concat_noext(feat_str,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_LIBRETRODB_SUPPORT),
": ",
sizeof(feat_str));
strlcat(feat_str,
_libretrodb_supp ?
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_YES) :
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO),
@ -778,12 +775,11 @@ static int menu_displaylist_parse_system_info(menu_displaylist_info_t *info)
MENU_ENUM_LABEL_SYSTEM_INFO_ENTRY,
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
fill_pathname_noext(feat_str,
fill_pathname_join_concat_noext(feat_str,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_OVERLAY_SUPPORT),
": ",
sizeof(feat_str));
strlcat(feat_str, _overlay_supp ?
_overlay_supp ?
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_YES) :
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO),
sizeof(feat_str));
@ -791,12 +787,11 @@ static int menu_displaylist_parse_system_info(menu_displaylist_info_t *info)
MENU_ENUM_LABEL_SYSTEM_INFO_ENTRY,
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
fill_pathname_noext(feat_str,
fill_pathname_join_concat_noext(feat_str,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_COMMAND_IFACE_SUPPORT),
": ",
sizeof(feat_str));
strlcat(feat_str, _command_supp
_command_supp
? msg_hash_to_str(MENU_ENUM_LABEL_VALUE_YES)
: msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO),
sizeof(feat_str));
@ -1489,8 +1484,9 @@ static int create_string_list_rdb_entry_string(
string_list_join_concat(output_label, str_len, str_list, "|");
fill_pathname_noext(tmp, desc, ": ", path_size);
strlcat(tmp, actual_string, path_size);
fill_pathname_join_concat_noext(tmp, desc, ": ",
actual_string,
path_size);
menu_entries_append_enum(list, tmp, output_label,
enum_idx,
0, 0, 0);
@ -1684,11 +1680,11 @@ static int menu_displaylist_parse_database_entry(menu_displaylist_info_t *info)
if (db_info_entry->name)
{
fill_pathname_noext(tmp,
fill_pathname_join_concat_noext(tmp,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_NAME),
": ",
db_info_entry->name,
sizeof(tmp));
strlcat(tmp, db_info_entry->name, sizeof(tmp));
menu_entries_append_enum(info->list, tmp,
msg_hash_to_str(MENU_ENUM_LABEL_RDB_ENTRY_NAME),
MENU_ENUM_LABEL_RDB_ENTRY_NAME,
@ -1696,11 +1692,11 @@ static int menu_displaylist_parse_database_entry(menu_displaylist_info_t *info)
}
if (db_info_entry->description)
{
fill_pathname_noext(tmp,
fill_pathname_join_concat_noext(tmp,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_DESCRIPTION),
": ",
db_info_entry->description,
sizeof(tmp));
strlcat(tmp, db_info_entry->description, sizeof(tmp));
menu_entries_append_enum(info->list, tmp,
msg_hash_to_str(MENU_ENUM_LABEL_RDB_ENTRY_DESCRIPTION),
MENU_ENUM_LABEL_RDB_ENTRY_DESCRIPTION,
@ -1708,11 +1704,11 @@ static int menu_displaylist_parse_database_entry(menu_displaylist_info_t *info)
}
if (db_info_entry->genre)
{
fill_pathname_noext(tmp,
fill_pathname_join_concat_noext(tmp,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_GENRE),
": ",
db_info_entry->genre,
sizeof(tmp));
strlcat(tmp, db_info_entry->genre, sizeof(tmp));
menu_entries_append_enum(info->list, tmp,
msg_hash_to_str(MENU_ENUM_LABEL_RDB_ENTRY_GENRE),
MENU_ENUM_LABEL_RDB_ENTRY_GENRE,