Function

GLib-2.0GLiburi_peek_schemeSince 2.66

  • Gets the scheme portion of a URI string. RFC 3986 decodes the scheme as:

    URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
    

    Common schemes include file, https, svn+ssh, etc.

    Unlike g_uri_parse_scheme(), the returned scheme is normalized to all-lowercase and does not need to be freed.

    Parameters

    • uri: string

      a valid URI.

    Returns string

    The ‘scheme’ component of the URI, or null on error. The returned string is normalized to all-lowercase, and interned via g_intern_string(), so it does not need to be freed.

    2.66