+2006-03-09 Tim-Philipp Müller <tim at centricular dot net>
+
+ * docs/gst/gstreamer-sections.txt:
+ * gst/gsturi.c: (gst_uri_has_protocol):
+ * gst/gsturi.h:
+ Add new API: gst_uri_has_protocol() (#333779).
+
2006-03-09 Wim Taymans <wim@fluendo.com>
* gst/gstclock.c: (gst_clock_entry_new),
GST_URI_TYPE_IS_VALID
gst_uri_protocol_is_valid
gst_uri_is_valid
+gst_uri_has_protocol
gst_uri_get_protocol
gst_uri_get_location
gst_uri_construct
}
/**
+ * gst_uri_has_protocol:
+ * @uri: an URI string
+ * @protocol: a protocol string (e.g. "http")
+ *
+ * Returns TRUE if the protocol of a given valid URI matches @protocol.
+ *
+ * Since: 0.10.4
+ */
+gboolean
+gst_uri_has_protocol (const gchar * uri, const gchar * protocol)
+{
+ gchar *colon;
+
+ g_return_val_if_fail (uri != NULL, FALSE);
+ g_return_val_if_fail (protocol != NULL, FALSE);
+ g_return_val_if_fail (gst_uri_is_valid (uri), FALSE);
+
+ colon = strstr (uri, "://");
+
+ if (colon == NULL)
+ return FALSE;
+
+ return (strncmp (uri, protocol, (size_t) (colon - uri)) == 0);
+}
+
+/**
* gst_uri_get_location:
* @uri: A URI string
*
gboolean gst_uri_protocol_is_valid (const gchar * protocol);
gboolean gst_uri_is_valid (const gchar * uri);
gchar * gst_uri_get_protocol (const gchar * uri);
+gboolean gst_uri_has_protocol (const gchar * uri,
+ const gchar * protocol);
gchar * gst_uri_get_location (const gchar * uri);
gchar * gst_uri_construct (const gchar * protocol,
const gchar * location);