Commit c50115f9 authored by Max Kellermann's avatar Max Kellermann

ls: added uri_has_scheme()

uri_has_scheme() checks if an URI contains the sub string "://", which makes MPD assume that it is a remote URI.
parent e0be4400
...@@ -42,6 +42,10 @@ void printRemoteUrlHandlers(struct client *client) ...@@ -42,6 +42,10 @@ void printRemoteUrlHandlers(struct client *client)
} }
} }
bool uri_has_scheme(const char *uri)
{
return strstr(uri, "://") != NULL;
}
bool isRemoteUrl(const char *url) bool isRemoteUrl(const char *url)
{ {
......
...@@ -28,6 +28,12 @@ struct client; ...@@ -28,6 +28,12 @@ struct client;
const char *getSuffix(const char *utf8file); const char *getSuffix(const char *utf8file);
/**
* Checks whether the specified URI has a schema in the form
* "scheme://".
*/
bool uri_has_scheme(const char *uri);
bool isRemoteUrl(const char *url); bool isRemoteUrl(const char *url);
const struct decoder_plugin * const struct decoder_plugin *
......
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