Deprecate fill_pathname_base_noext

This commit is contained in:
libretroadmin 2022-07-11 20:13:44 +02:00
parent 7186d75c44
commit adf9994828
12 changed files with 53 additions and 35 deletions

View File

@ -1405,7 +1405,8 @@ void audio_driver_load_system_sounds(void)
if (audio_driver_mixer_extension_supported(ext))
{
basename_noext[0] = '\0';
fill_pathname_base_noext(basename_noext, path, sizeof(basename_noext));
fill_pathname_base(basename_noext, path, sizeof(basename_noext));
path_remove_extension(basename_noext);
if (string_is_equal_noncase(basename_noext, "ok"))
path_ok = path;

View File

@ -1457,10 +1457,8 @@ bool command_event_save_core_config(
char tmp[PATH_MAX_LENGTH + 8];
RARCH_LOG("[Config]: %s\n", msg_hash_to_str(MSG_USING_CORE_NAME_FOR_NEW_CONFIG));
fill_pathname_base_noext(
config_name,
core_path,
sizeof(config_name));
fill_pathname_base(config_name, core_path, sizeof(config_name));
path_remove_extension(config_name);
fill_pathname_join(config_path, config_dir, config_name,
sizeof(config_path));

View File

@ -395,8 +395,9 @@ bool gfx_widget_start_load_content_animation(void)
if (!string_is_empty(playlist_path))
{
fill_pathname_base_noext(state->system_name, playlist_path,
fill_pathname_base(state->system_name, playlist_path,
sizeof(state->system_name));
path_remove_extension(state->system_name);
/* Exclude history and favourites playlists */
if (string_ends_with_size(state->system_name, "_history",
@ -418,8 +419,11 @@ bool gfx_widget_start_load_content_animation(void)
/* If we haven't yet set the content name,
* use content file name as a fallback */
if (!has_content)
fill_pathname_base_noext(state->content_name, content_path,
{
fill_pathname_base(state->content_name, content_path,
sizeof(state->content_name));
path_remove_extension(state->content_name);
}
/* Check whether system name has been set */
if (!has_system)

View File

@ -381,22 +381,12 @@ size_t fill_pathname_base(char *out, const char *in_path, size_t size)
return strlcpy(out, in_path, size);
}
void fill_pathname_base_noext(char *out,
const char *in_path, size_t size)
{
const char *ptr = path_basename(in_path);
if (ptr)
strlcpy(out, ptr, size);
else
strlcpy(out, in_path, size);
path_remove_extension(out);
}
size_t fill_pathname_base_ext(char *out,
const char *in_path, const char *ext,
size_t size)
{
fill_pathname_base_noext(out, in_path, size);
fill_pathname_base(out, in_path, size);
path_remove_extension(out);
return strlcat(out, ext, size);
}
@ -1446,3 +1436,14 @@ size_t fill_pathname_noext(char *out_path, const char *in_path,
strlcpy(out_path, in_path, size);
return strlcat(out_path, replace, size);
}
void fill_pathname_base_noext(char *out,
const char *in_path, size_t size)
{
const char *ptr = path_basename(in_path);
if (ptr)
strlcpy(out, ptr, size);
else
strlcpy(out, in_path, size);
path_remove_extension(out);
}

View File

@ -308,9 +308,6 @@ size_t fill_pathname_dir(char *in_dir, const char *in_basename,
**/
size_t fill_pathname_base(char *out_path, const char *in_path, size_t size);
void fill_pathname_base_noext(char *out_dir,
const char *in_path, size_t size);
size_t fill_pathname_base_ext(char *out,
const char *in_path, const char *ext,
size_t size);
@ -556,6 +553,9 @@ size_t fill_pathname_join_delim_concat(char *out_path, const char *dir,
size_t fill_pathname_noext(char *out_path, const char *in_path,
const char *replace, size_t size);
void fill_pathname_base_noext(char *out_dir,
const char *in_path, size_t size);
RETRO_END_DECLS
#endif

View File

@ -1367,7 +1367,8 @@ int generic_action_ok_displaylist_push(const char *path,
settings->paths.path_content_database,
path, sizeof(tmp));
fill_pathname_base_noext(lpl_basename, path, sizeof(lpl_basename));
fill_pathname_base(lpl_basename, path, sizeof(lpl_basename));
path_remove_extension(lpl_basename);
menu_driver_set_thumbnail_system(lpl_basename, sizeof(lpl_basename));
info.directory_ptr = idx;

View File

@ -4252,8 +4252,9 @@ static void ozone_init_horizontal_list(ozone_handle_t *ozone,
}
/* Remove extension */
fill_pathname_base_noext(playlist_file_noext,
fill_pathname_base(playlist_file_noext,
playlist_file, sizeof(playlist_file_noext));
path_remove_extension(playlist_file_noext);
console_name = playlist_file_noext;
@ -4377,7 +4378,8 @@ static void ozone_context_reset_horizontal_list(ozone_handle_t *ozone)
sysname[0] = texturepath[0] = content_texturepath[0] = '\0';
fill_pathname_base_noext(sysname, path, sizeof(sysname));
fill_pathname_base(sysname, path, sizeof(sysname));
path_remove_extension(sysname);
fill_pathname_join(texturepath, icons_path, sysname,
sizeof(texturepath));

View File

@ -1937,8 +1937,9 @@ static void xmb_set_title(xmb_handle_t *xmb)
if (!path)
return;
fill_pathname_base_noext(
fill_pathname_base(
xmb->title_name, path, sizeof(xmb->title_name));
path_remove_extension(xmb->title_name);
/* Add current search terms */
menu_entries_search_append_terms_string(
@ -2262,7 +2263,8 @@ static void xmb_context_reset_horizontal_list(
iconpath[0] = sysname[0] =
texturepath[0] = content_texturepath[0] = '\0';
fill_pathname_base_noext(sysname, path, sizeof(sysname));
fill_pathname_base(sysname, path, sizeof(sysname));
path_remove_extension(sysname);
fill_pathname_application_special(iconpath, sizeof(iconpath),
APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_ICONS);

View File

@ -2157,7 +2157,8 @@ static int menu_displaylist_parse_playlist(menu_displaylist_info_t *info,
char lpl_basename[256];
lpl_basename[0] = '\0';
fill_pathname_base_noext(lpl_basename, info->path, sizeof(lpl_basename));
fill_pathname_base(lpl_basename, info->path, sizeof(lpl_basename));
path_remove_extension(lpl_basename);
menu_driver_set_thumbnail_system(lpl_basename, sizeof(lpl_basename));
}
@ -3300,7 +3301,8 @@ static int menu_displaylist_parse_horizontal_list(
/* Thumbnail system must be set *after* playlist
* is loaded/cached */
fill_pathname_base_noext(lpl_basename, item->path, sizeof(lpl_basename));
fill_pathname_base(lpl_basename, item->path, sizeof(lpl_basename));
path_remove_extension(lpl_basename);
menu_driver_set_thumbnail_system(lpl_basename, sizeof(lpl_basename));
}

View File

@ -1269,7 +1269,9 @@ bool playlist_push(playlist_t *playlist,
if (string_is_empty(core_name))
{
static char base_path[255] = {0};
fill_pathname_base_noext(base_path, real_core_path, sizeof(base_path));
fill_pathname_base(base_path, real_core_path, sizeof(base_path));
path_remove_extension(base_path);
core_name = base_path;
if (string_is_empty(core_name))

View File

@ -596,7 +596,8 @@ static bool content_file_list_set_info(
* searching related content. For archived content,
* this is the basename of the archive file without
* extension */
fill_pathname_base_noext(name, archive_path, sizeof(name));
fill_pathname_base(name, archive_path, sizeof(name));
path_remove_extension(name);
file_info->file_in_archive = true;
}
@ -609,7 +610,8 @@ static bool content_file_list_set_info(
/* For uncompressed content, 'canonical' name/id
* is the basename of the content file, without
* extension */
fill_pathname_base_noext(name, path, sizeof(name));
fill_pathname_base(name, path, sizeof(name));
path_remove_extension(name);
}
if (!string_is_empty(dir))

View File

@ -211,7 +211,8 @@ static void task_pl_manager_reset_cores_handler(retro_task_t *task)
char entry_name[PATH_MAX_LENGTH];
entry_name[0] = '\0';
fill_pathname_base_noext(entry_name, entry->path, sizeof(entry_name));
fill_pathname_base(entry_name, entry->path, sizeof(entry_name));
path_remove_extension(entry_name);
strlcat(task_title, entry_name, sizeof(task_title));
}
@ -305,8 +306,9 @@ bool task_push_pl_manager_reset_cores(const playlist_config_t *playlist_config)
if (string_is_empty(playlist_config->path))
goto error;
fill_pathname_base_noext(playlist_name,
fill_pathname_base(playlist_name,
playlist_config->path, sizeof(playlist_name));
path_remove_extension(playlist_name);
if (string_is_empty(playlist_name))
goto error;
@ -735,8 +737,9 @@ bool task_push_pl_manager_clean_playlist(
if (string_is_empty(playlist_config->path))
goto error;
fill_pathname_base_noext(playlist_name,
fill_pathname_base(playlist_name,
playlist_config->path, sizeof(playlist_name));
path_remove_extension(playlist_name);
if (string_is_empty(playlist_name))
goto error;