From c50115f9a2c0b5f8fc89906629386b74139212cf Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 16 Dec 2008 21:22:10 +0100 Subject: 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. --- src/ls.c | 4 ++++ src/ls.h | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/src/ls.c b/src/ls.c index 27962ad9..164b543c 100644 --- a/src/ls.c +++ b/src/ls.c @@ -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) { diff --git a/src/ls.h b/src/ls.h index 5ea65faf..799d5dd4 100644 --- a/src/ls.h +++ b/src/ls.h @@ -28,6 +28,12 @@ struct client; 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); const struct decoder_plugin * -- cgit v1.2.3