Revert "eina: new API: eina_file_path_basename"

This reverts commit 68282f8c42.

This is actually not needed because of presence of basename in Evil.
This commit is contained in:
Daniel Kolesa 2014-07-23 19:38:08 +01:00
parent a3182948ad
commit 987cde5f35
2 changed files with 0 additions and 43 deletions

View File

@ -415,22 +415,6 @@ EAPI Eina_Iterator *eina_file_direct_ls(const char *dir) EINA_WARN_UNUSED_RESULT
*/
EAPI char *eina_file_path_sanitize(const char *path);
/**
* @brief When given a path, delete everything up to last slash and return
* the result.
*
* @param path The path string
* @param suffix An optional suffix to strip out
*
* @return an allocated string with the base name.
*
* When @c suffix is not NULL, it's stripped out from the final path. When
* the suffix doesn't match the actual suffix of the base name, nothing is
* stripped. Path delimiters used depend on the operating system.
*
* @since 1.11
*/
EAPI char *eina_file_path_basename(const char *path, const char *suffix);
/**
* @typedef Eina_File_Copy_Progress

View File

@ -361,33 +361,6 @@ eina_file_path_sanitize(const char *path)
return _eina_file_escape(eina_file_cleanup(result), len);
}
EAPI char *
eina_file_path_basename(const char *path, const char *suffix)
{
char *str = eina_file_path_sanitize(path), *fname, *ret;
Eina_Array *arr = eina_file_split(str);
if (!arr)
{
free(str);
return NULL;
}
fname = eina_array_data_get(arr, eina_array_count_get(arr) - 1);
if (suffix && suffix[0])
{
size_t flen = strlen(fname);
size_t slen = strlen(suffix);
if (slen <= flen)
{
char *sf = fname + flen - slen;
if (!strcmp(suffix, sf)) *sf = '\0';
}
}
ret = strdup(fname);
free(str);
eina_array_free(arr);
return ret;
}
EAPI Eina_File *
eina_file_virtualize(const char *virtual_name, const void *data, unsigned long long length, Eina_Bool copy)
{