ls: adding get_archive_by_suffix() function

This commit is contained in:
Viliam Mateicka
2008-12-16 21:42:42 +01:00
parent c73ebac4af
commit 4d604a7540
2 changed files with 19 additions and 0 deletions

View File

@@ -128,3 +128,18 @@ hasMusicSuffix(const char *utf8file, unsigned int next)
return ret;
}
const struct archive_plugin *
get_archive_by_suffix(const char *utf8file)
{
const struct archive_plugin *ret = NULL;
const char *s = getSuffix(utf8file);
if (s) {
ret = archive_plugin_from_suffix(s);
} else {
g_debug("get_archive_by_suffix: The file: %s has no valid suffix\n",
utf8file);
}
return ret;
}