Commit 4d604a75 authored by Viliam Mateicka's avatar Viliam Mateicka

ls: adding get_archive_by_suffix() function

parent c73ebac4
......@@ -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;
}
......@@ -20,6 +20,7 @@
#define MPD_LS_H
#include "decoder_list.h"
#include "archive_list.h"
#include <sys/time.h>
......@@ -35,6 +36,9 @@ int isRemoteUrl(const char *url);
const struct decoder_plugin *
hasMusicSuffix(const char *utf8file, unsigned int next);
const struct archive_plugin *
get_archive_by_suffix(const char *utf8file);
int printRemoteUrlHandlers(struct client *client);
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment