From 747e945d29e847403cec928ca4a3df7f27864cfc Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 1 Jun 2010 08:23:29 +0200 Subject: playlist_list: move fallback g_uri_parse_scheme() to glib_compat.h --- src/glib_compat.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/glib_compat.h') diff --git a/src/glib_compat.h b/src/glib_compat.h index 732f12753..4d0e7040d 100644 --- a/src/glib_compat.h +++ b/src/glib_compat.h @@ -59,4 +59,19 @@ g_uri_escape_string(const char *unescaped, #endif /* !2.16 */ +#if !GLIB_CHECK_VERSION(2,16,0) + +#include + +static inline char * +g_uri_parse_scheme(const char *uri) +{ + const char *end = strstr(uri, "://"); + if (end == NULL) + return NULL; + return g_strndup(uri, end - uri); +} + +#endif + #endif -- cgit v1.2.3