mirror of
https://github.com/libretro/RetroArch
synced 2025-02-28 12:40:23 +00:00
Remove fill_short_pathname_representation
This commit is contained in:
parent
b1c9f93903
commit
b7926605f4
@ -493,8 +493,9 @@ bool gfx_thumbnail_set_content_playlist(
|
|||||||
strlcpy(path_data->content_label,
|
strlcpy(path_data->content_label,
|
||||||
content_label, sizeof(path_data->content_label));
|
content_label, sizeof(path_data->content_label));
|
||||||
else
|
else
|
||||||
fill_short_pathname_representation(path_data->content_label,
|
fill_pathname(path_data->content_label,
|
||||||
content_path, sizeof(path_data->content_label));
|
path_basename(content_path),
|
||||||
|
"", sizeof(path_data->content_label));
|
||||||
|
|
||||||
/* Determine content image name */
|
/* Determine content image name */
|
||||||
fill_content_img(path_data);
|
fill_content_img(path_data);
|
||||||
|
@ -963,34 +963,6 @@ size_t fill_pathname_join_delim(char *out_path, const char *dir,
|
|||||||
return copied;
|
return copied;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* fill_short_pathname_representation:
|
|
||||||
* @out_rep : output representation
|
|
||||||
* @in_path : input path
|
|
||||||
* @size : size of output representation
|
|
||||||
*
|
|
||||||
* Generates a short representation of path. It should only
|
|
||||||
* be used for displaying the result; the output representation is not
|
|
||||||
* binding in any meaningful way (for a normal path, this is the same as basename)
|
|
||||||
* In case of more complex URLs, this should cut everything except for
|
|
||||||
* the main image file.
|
|
||||||
*
|
|
||||||
* E.g.: "/path/to/game.img" -> game.img
|
|
||||||
* "/path/to/myarchive.7z#folder/to/game.img" -> game.img
|
|
||||||
*/
|
|
||||||
size_t fill_short_pathname_representation(char* out_rep,
|
|
||||||
const char *in_path, size_t size)
|
|
||||||
{
|
|
||||||
char path_short[NAME_MAX_LENGTH];
|
|
||||||
|
|
||||||
path_short[0] = '\0';
|
|
||||||
|
|
||||||
fill_pathname(path_short, path_basename(in_path), "",
|
|
||||||
sizeof(path_short));
|
|
||||||
|
|
||||||
return strlcpy(out_rep, path_short, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
void fill_pathname_expand_special(char *out_path,
|
void fill_pathname_expand_special(char *out_path,
|
||||||
const char *in_path, size_t size)
|
const char *in_path, size_t size)
|
||||||
{
|
{
|
||||||
@ -1133,7 +1105,7 @@ void pathname_conform_slashes_to_os(char *path)
|
|||||||
*p = PATH_DEFAULT_SLASH_C();
|
*p = PATH_DEFAULT_SLASH_C();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Change all shashes to forward so they are more portable between windows and linux */
|
/* Change all shashes to forward so they are more portable between Windows and Linux */
|
||||||
void pathname_make_slashes_portable(char *path)
|
void pathname_make_slashes_portable(char *path)
|
||||||
{
|
{
|
||||||
/* Conform slashes to os standard so we get proper matching */
|
/* Conform slashes to os standard so we get proper matching */
|
||||||
|
@ -406,24 +406,6 @@ size_t fill_pathname_join_concat_noext(char *out_path,
|
|||||||
size_t fill_pathname_join_delim(char *out_path, const char *dir,
|
size_t fill_pathname_join_delim(char *out_path, const char *dir,
|
||||||
const char *path, const char delim, size_t size);
|
const char *path, const char delim, size_t size);
|
||||||
|
|
||||||
/**
|
|
||||||
* fill_short_pathname_representation:
|
|
||||||
* @out_rep : output representation
|
|
||||||
* @in_path : input path
|
|
||||||
* @size : size of output representation
|
|
||||||
*
|
|
||||||
* Generates a short representation of path. It should only
|
|
||||||
* be used for displaying the result; the output representation is not
|
|
||||||
* binding in any meaningful way (for a normal path, this is the same as basename)
|
|
||||||
* In case of more complex URLs, this should cut everything except for
|
|
||||||
* the main image file.
|
|
||||||
*
|
|
||||||
* E.g.: "/path/to/game.img" -> game.img
|
|
||||||
* "/path/to/myarchive.7z#folder/to/game.img" -> game.img
|
|
||||||
*/
|
|
||||||
size_t fill_short_pathname_representation(char* out_rep,
|
|
||||||
const char *in_path, size_t size);
|
|
||||||
|
|
||||||
void fill_pathname_expand_special(char *out_path,
|
void fill_pathname_expand_special(char *out_path,
|
||||||
const char *in_path, size_t size);
|
const char *in_path, size_t size);
|
||||||
|
|
||||||
|
@ -1312,8 +1312,8 @@ static bool manual_content_scan_get_playlist_content_label(
|
|||||||
|
|
||||||
/* In most cases, content label is just the
|
/* In most cases, content label is just the
|
||||||
* filename without extension */
|
* filename without extension */
|
||||||
fill_short_pathname_representation(
|
fill_pathname(content_label, path_basename(content_path),
|
||||||
content_label, content_path, len);
|
"", len);
|
||||||
|
|
||||||
if (string_is_empty(content_label))
|
if (string_is_empty(content_label))
|
||||||
return false;
|
return false;
|
||||||
|
@ -5441,8 +5441,9 @@ static int action_ok_add_to_favorites(const char *path,
|
|||||||
|
|
||||||
/* Label is empty - use file name instead */
|
/* Label is empty - use file name instead */
|
||||||
if (string_is_empty(content_label))
|
if (string_is_empty(content_label))
|
||||||
fill_short_pathname_representation(content_label,
|
fill_pathname(content_label,
|
||||||
content_path, sizeof(content_label));
|
path_basename(content_path), "",
|
||||||
|
sizeof(content_label));
|
||||||
|
|
||||||
/* > core_path + core_name */
|
/* > core_path + core_name */
|
||||||
if (system)
|
if (system)
|
||||||
@ -5579,7 +5580,9 @@ static int action_ok_add_to_favorites_playlist(const char *path,
|
|||||||
/* Label is empty - use file name instead */
|
/* Label is empty - use file name instead */
|
||||||
char fallback_content_label[PATH_MAX_LENGTH];
|
char fallback_content_label[PATH_MAX_LENGTH];
|
||||||
fallback_content_label[0] = '\0';
|
fallback_content_label[0] = '\0';
|
||||||
fill_short_pathname_representation(fallback_content_label, entry->path, sizeof(fallback_content_label));
|
fill_pathname(fallback_content_label,
|
||||||
|
path_basename(entry->path), "",
|
||||||
|
sizeof(fallback_content_label));
|
||||||
string_list_append(str_list, fallback_content_label, attr);
|
string_list_append(str_list, fallback_content_label, attr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3283,7 +3283,7 @@ static int xmb_draw_item(
|
|||||||
entry_path[0] = '\0';
|
entry_path[0] = '\0';
|
||||||
strlcpy(entry_path, entry.path, sizeof(entry_path));
|
strlcpy(entry_path, entry.path, sizeof(entry_path));
|
||||||
|
|
||||||
fill_short_pathname_representation(entry_path, entry_path,
|
fill_pathname(entry_path, path_basename(entry_path), "",
|
||||||
sizeof(entry_path));
|
sizeof(entry_path));
|
||||||
|
|
||||||
if (!string_is_empty(entry_path))
|
if (!string_is_empty(entry_path))
|
||||||
|
@ -2210,7 +2210,9 @@ static int menu_displaylist_parse_playlist(menu_displaylist_info_t *info,
|
|||||||
* no further action is necessary */
|
* no further action is necessary */
|
||||||
|
|
||||||
if (string_is_empty(entry->label))
|
if (string_is_empty(entry->label))
|
||||||
fill_short_pathname_representation(menu_entry_label, entry->path, sizeof(menu_entry_label));
|
fill_pathname(menu_entry_label,
|
||||||
|
path_basename(entry->path),
|
||||||
|
"", sizeof(menu_entry_label));
|
||||||
else
|
else
|
||||||
strlcpy(menu_entry_label, entry->label, sizeof(menu_entry_label));
|
strlcpy(menu_entry_label, entry->label, sizeof(menu_entry_label));
|
||||||
|
|
||||||
@ -2411,11 +2413,10 @@ static int menu_displaylist_parse_database_entry(menu_handle_t *menu,
|
|||||||
database_info_build_query_enum(query, sizeof(query),
|
database_info_build_query_enum(query, sizeof(query),
|
||||||
DATABASE_QUERY_ENTRY, info->path_b);
|
DATABASE_QUERY_ENTRY, info->path_b);
|
||||||
|
|
||||||
db_info = database_info_list_new(info->path, query);
|
if (!(db_info = database_info_list_new(info->path, query)))
|
||||||
if (!db_info)
|
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
fill_short_pathname_representation(path_base, info->path,
|
fill_pathname(path_base, path_basename(info->path), "",
|
||||||
sizeof(path_base));
|
sizeof(path_base));
|
||||||
path_remove_extension(path_base);
|
path_remove_extension(path_base);
|
||||||
|
|
||||||
@ -2427,9 +2428,8 @@ static int menu_displaylist_parse_database_entry(menu_handle_t *menu,
|
|||||||
sizeof(path_playlist));
|
sizeof(path_playlist));
|
||||||
|
|
||||||
playlist_config_set_path(&playlist_config, path_playlist);
|
playlist_config_set_path(&playlist_config, path_playlist);
|
||||||
playlist = playlist_init(&playlist_config);
|
|
||||||
|
|
||||||
if (playlist)
|
if ((playlist = playlist_init(&playlist_config)))
|
||||||
strlcpy(menu->db_playlist_file, path_playlist,
|
strlcpy(menu->db_playlist_file, path_playlist,
|
||||||
sizeof(menu->db_playlist_file));
|
sizeof(menu->db_playlist_file));
|
||||||
|
|
||||||
|
@ -1292,7 +1292,8 @@ static void setting_get_string_representation_st_path(rarch_setting_t *setting,
|
|||||||
char *s, size_t len)
|
char *s, size_t len)
|
||||||
{
|
{
|
||||||
if (setting)
|
if (setting)
|
||||||
fill_short_pathname_representation(s, setting->value.target.string, len);
|
fill_pathname(s, path_basename(setting->value.target.string),
|
||||||
|
"", len);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setting_get_string_representation_st_string(rarch_setting_t *setting,
|
static void setting_get_string_representation_st_string(rarch_setting_t *setting,
|
||||||
@ -3069,7 +3070,8 @@ static void setting_get_string_representation_video_filter(rarch_setting_t *sett
|
|||||||
if (!setting)
|
if (!setting)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fill_short_pathname_representation(s, setting->value.target.string, len);
|
fill_pathname(s, path_basename(setting->value.target.string),
|
||||||
|
"", len);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setting_get_string_representation_state_slot(rarch_setting_t *setting,
|
static void setting_get_string_representation_state_slot(rarch_setting_t *setting,
|
||||||
|
@ -2984,7 +2984,8 @@ static int playlist_qsort_func(const struct playlist_entry *a,
|
|||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
if (!string_is_empty(a->path))
|
if (!string_is_empty(a->path))
|
||||||
fill_short_pathname_representation(a_fallback_label, a->path, PATH_MAX_LENGTH * sizeof(char));
|
fill_pathname(a_fallback_label, path_basename(a->path),
|
||||||
|
"", PATH_MAX_LENGTH * sizeof(char));
|
||||||
/* If filename is also empty, use core name
|
/* If filename is also empty, use core name
|
||||||
* instead -> this matches the behaviour of
|
* instead -> this matches the behaviour of
|
||||||
* menu_displaylist_parse_playlist() */
|
* menu_displaylist_parse_playlist() */
|
||||||
@ -3007,7 +3008,8 @@ static int playlist_qsort_func(const struct playlist_entry *a,
|
|||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
if (!string_is_empty(b->path))
|
if (!string_is_empty(b->path))
|
||||||
fill_short_pathname_representation(b_fallback_label, b->path, PATH_MAX_LENGTH * sizeof(char));
|
fill_pathname(b_fallback_label, path_basename(b->path), "",
|
||||||
|
PATH_MAX_LENGTH * sizeof(char));
|
||||||
else if (!string_is_empty(b->core_name))
|
else if (!string_is_empty(b->core_name))
|
||||||
strlcpy(b_fallback_label, b->core_name, PATH_MAX_LENGTH * sizeof(char));
|
strlcpy(b_fallback_label, b->core_name, PATH_MAX_LENGTH * sizeof(char));
|
||||||
|
|
||||||
|
@ -756,8 +756,8 @@ static int database_info_list_iterate_found_match(
|
|||||||
db_playlist_base_str[0] = '\0';
|
db_playlist_base_str[0] = '\0';
|
||||||
entry_path_str[0] = '\0';
|
entry_path_str[0] = '\0';
|
||||||
|
|
||||||
fill_short_pathname_representation(db_playlist_base_str,
|
fill_pathname(db_playlist_base_str,
|
||||||
db_path, str_len);
|
path_basename(db_path), "", str_len);
|
||||||
path_remove_extension(db_playlist_base_str);
|
path_remove_extension(db_playlist_base_str);
|
||||||
|
|
||||||
strlcat(db_playlist_base_str, ".lpl", str_len);
|
strlcat(db_playlist_base_str, ".lpl", str_len);
|
||||||
@ -1012,8 +1012,8 @@ static int task_database_iterate_playlist_lutro(
|
|||||||
|
|
||||||
game_title[0] = '\0';
|
game_title[0] = '\0';
|
||||||
|
|
||||||
fill_short_pathname_representation(game_title,
|
fill_pathname(game_title,
|
||||||
path, sizeof(game_title));
|
path_basename(path), "", sizeof(game_title));
|
||||||
path_remove_extension(game_title);
|
path_remove_extension(game_title);
|
||||||
|
|
||||||
/* the push function reads our entry as const,
|
/* the push function reads our entry as const,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user