<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC '-//OASIS//DTD DocBook XML V4.5//EN'
                      'http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd' [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="glib-URI-Functions">
<refmeta>
<refentrytitle role="top_of_page" id="glib-URI-Functions.top_of_page">URI Functions</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GLIB Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>URI Functions</refname>
<refpurpose>URI-handling utilities</refpurpose>
</refnamediv>

<refsect1 id="glib-URI-Functions.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_proto_type" colwidth="150px"/>
<colspec colname="functions_proto_name"/>
<tbody>
<row><entry role="function_type"><link linkend="GUri"><returnvalue>GUri</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-uri-ref">g_uri_ref</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-uri-unref">g_uri_unref</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-uri-split">g_uri_split</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-uri-split-with-user">g_uri_split_with_user</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-uri-split-network">g_uri_split_network</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-uri-is-valid">g_uri_is_valid</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-uri-join">g_uri_join</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-uri-join-with-user">g_uri_join_with_user</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GUri"><returnvalue>GUri</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-uri-parse">g_uri_parse</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GUri"><returnvalue>GUri</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-uri-parse-relative">g_uri_parse_relative</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-uri-resolve-relative">g_uri_resolve_relative</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GUri"><returnvalue>GUri</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-uri-build">g_uri_build</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GUri"><returnvalue>GUri</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-uri-build-with-user">g_uri_build_with_user</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-uri-peek-scheme">g_uri_peek_scheme</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-uri-parse-scheme">g_uri_parse_scheme</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="function_type"><link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-uri-to-string">g_uri_to_string</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-uri-to-string-partial">g_uri_to_string_partial</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="function_type">const <link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-uri-get-scheme">g_uri_get_scheme</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-uri-get-userinfo">g_uri_get_userinfo</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-uri-get-user">g_uri_get_user</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-uri-get-password">g_uri_get_password</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-uri-get-auth-params">g_uri_get_auth_params</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-uri-get-host">g_uri_get_host</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gint"><returnvalue>gint</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-uri-get-port">g_uri_get_port</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-uri-get-path">g_uri_get_path</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-uri-get-query">g_uri_get_query</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-uri-get-fragment">g_uri_get_fragment</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GUriFlags"><returnvalue>GUriFlags</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-uri-get-flags">g_uri_get_flags</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-uri-params-iter-init">g_uri_params_iter_init</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-uri-params-iter-next">g_uri_params_iter_next</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GHashTable"><returnvalue>GHashTable</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-uri-parse-params">g_uri_parse_params</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="function_type"><link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-uri-escape-string">g_uri_escape_string</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-uri-unescape-string">g_uri_unescape_string</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-uri-escape-bytes">g_uri_escape_bytes</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GBytes"><returnvalue>GBytes</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-uri-unescape-bytes">g_uri_unescape_bytes</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-uri-unescape-segment">g_uri_unescape_segment</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="function_type"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;**
</entry><entry role="function_name"><link linkend="g-uri-list-extract-uris">g_uri_list_extract_uris</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-filename-from-uri">g_filename_from_uri</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-filename-to-uri">g_filename_to_uri</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="glib-URI-Functions.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="other_proto_type" colwidth="150px"/>
<colspec colname="other_proto_name"/>
<tbody>
<row><entry role="datatype_keyword"></entry><entry role="function_name"><link linkend="GUri">GUri</link></entry></row>

<row><entry role="datatype_keyword">enum</entry><entry role="function_name"><link linkend="GUriFlags">GUriFlags</link></entry></row>

<row><entry role="datatype_keyword">enum</entry><entry role="function_name"><link linkend="GUriHideFlags">GUriHideFlags</link></entry></row>


<row><entry role="datatype_keyword">struct</entry><entry role="function_name"><link linkend="GUriParamsIter">GUriParamsIter</link></entry></row>
<row><entry role="datatype_keyword">enum</entry><entry role="function_name"><link linkend="GUriParamsFlags">GUriParamsFlags</link></entry></row>

<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-URI-RESERVED-CHARS-ALLOWED-IN-PATH:CAPS">G_URI_RESERVED_CHARS_ALLOWED_IN_PATH</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-URI-RESERVED-CHARS-ALLOWED-IN-PATH-ELEMENT:CAPS">G_URI_RESERVED_CHARS_ALLOWED_IN_PATH_ELEMENT</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-URI-RESERVED-CHARS-ALLOWED-IN-USERINFO:CAPS">G_URI_RESERVED_CHARS_ALLOWED_IN_USERINFO</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-URI-RESERVED-CHARS-GENERIC-DELIMITERS:CAPS">G_URI_RESERVED_CHARS_GENERIC_DELIMITERS</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-URI-RESERVED-CHARS-SUBCOMPONENT-DELIMITERS:CAPS">G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS</link></entry></row>


<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-URI-ERROR:CAPS">G_URI_ERROR</link></entry></row>
<row><entry role="datatype_keyword">enum</entry><entry role="function_name"><link linkend="GUriError">GUriError</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>

<refsect1 id="glib-URI-Functions.includes"><title>Includes</title><synopsis>#include &lt;glib.h&gt;
</synopsis></refsect1>

<refsect1 id="glib-URI-Functions.description" role="desc">
<title role="desc.title">Description</title>
<para>The <link linkend="GUri"><type>GUri</type></link> type and related functions can be used to parse URIs into
their components, and build valid URIs from individual components.</para>
<para>Note that <link linkend="GUri"><type>GUri</type></link> scope is to help manipulate URIs in various applications,
following <ulink url="https://tools.ietf.org/html/rfc3986">RFC 3986</ulink>. In particular,
it doesn't intend to cover web browser needs, and doesn't implement the
<ulink url="https://url.spec.whatwg.org/">WHATWG URL</ulink> standard. No APIs are provided to
help prevent
<ulink url="https://en.wikipedia.org/wiki/IDN_homograph_attack">homograph attacks</ulink>, so
<link linkend="GUri"><type>GUri</type></link> is not suitable for formatting URIs for display to the user for making
security-sensitive decisions.</para>
<refsect3 id="relative-absolute-uris"><title>Relative and absolute URIs</title><para>As defined in <ulink url="https://tools.ietf.org/html/rfc3986#section-4">RFC 3986</ulink>, the
hierarchical nature of URIs means that they can either be ‘relative
references’ (sometimes referred to as ‘relative URIs’) or ‘URIs’ (for
clarity, ‘URIs’ are referred to in this documentation as
‘absolute URIs’ — although
<ulink url="https://tools.ietf.org/html/rfc3986#section-4.3">in constrast to RFC 3986</ulink>,
fragment identifiers are always allowed).</para>
<para>Relative references have one or more components of the URI missing. In
particular, they have no scheme. Any other component, such as hostname,
query, etc. may be missing, apart from a path, which has to be specified (but
may be empty). The path may be relative, starting with <literal>./</literal> rather than <literal>/</literal>.</para>
<para>For example, a valid relative reference is <literal>./path?query</literal>,
<literal>/?query#fragment</literal> or <literal>//example.com</literal>.</para>
<para>Absolute URIs have a scheme specified. Any other components of the URI which
are missing are specified as explicitly unset in the URI, rather than being
resolved relative to a base URI using <link linkend="g-uri-parse-relative"><function>g_uri_parse_relative()</function></link>.</para>
<para>For example, a valid absolute URI is <literal>file:///home/bob</literal> or
<literal>https://search.com?query=string</literal>.</para>
<para>A <link linkend="GUri"><type>GUri</type></link> instance is always an absolute URI. A string may be an absolute URI
or a relative reference; see the documentation for individual functions as to
what forms they accept.</para>
</refsect3>
<refsect3><title>Parsing URIs</title><para>The most minimalist APIs for parsing URIs are <link linkend="g-uri-split"><function>g_uri_split()</function></link> and
<link linkend="g-uri-split-with-user"><function>g_uri_split_with_user()</function></link>. These split a URI into its component
parts, and return the parts; the difference between the two is that
<link linkend="g-uri-split"><function>g_uri_split()</function></link> treats the ‘userinfo’ component of the URI as a
single element, while <link linkend="g-uri-split-with-user"><function>g_uri_split_with_user()</function></link> can (depending on the
<link linkend="GUriFlags"><type>GUriFlags</type></link> you pass) treat it as containing a username, password,
and authentication parameters. Alternatively, <link linkend="g-uri-split-network"><function>g_uri_split_network()</function></link>
can be used when you are only interested in the components that are
needed to initiate a network connection to the service (scheme,
host, and port).</para>
<para>g_uri_parse() is similar to <link linkend="g-uri-split"><function>g_uri_split()</function></link>, but instead of returning
individual strings, it returns a <link linkend="GUri"><type>GUri</type></link> structure (and it requires
that the URI be an absolute URI).</para>
<para>g_uri_resolve_relative() and <link linkend="g-uri-parse-relative"><function>g_uri_parse_relative()</function></link> allow you to
resolve a relative URI relative to a base URI.
<link linkend="g-uri-resolve-relative"><function>g_uri_resolve_relative()</function></link> takes two strings and returns a string,
and <link linkend="g-uri-parse-relative"><function>g_uri_parse_relative()</function></link> takes a <link linkend="GUri"><type>GUri</type></link> and a string and returns a
<link linkend="GUri"><type>GUri</type></link>.</para>
<para>All of the parsing functions take a <link linkend="GUriFlags"><type>GUriFlags</type></link> argument describing
exactly how to parse the URI; see the documentation for that type
for more details on the specific flags that you can pass. If you
need to choose different flags based on the type of URI, you can
use <link linkend="g-uri-peek-scheme"><function>g_uri_peek_scheme()</function></link> on the URI string to check the scheme
first, and use that to decide what flags to parse it with.</para>
<para>For example, you might want to use <link linkend="G-URI-PARAMS-WWW-FORM:CAPS"><literal>G_URI_PARAMS_WWW_FORM</literal></link> when parsing the
params for a web URI, so compare the result of <link linkend="g-uri-peek-scheme"><function>g_uri_peek_scheme()</function></link> against
<literal>http</literal> and <literal>https</literal>.</para>
</refsect3>
<refsect3><title>Building URIs</title><para>g_uri_join() and <link linkend="g-uri-join-with-user"><function>g_uri_join_with_user()</function></link> can be used to construct
valid URI strings from a set of component strings. They are the
inverse of <link linkend="g-uri-split"><function>g_uri_split()</function></link> and <link linkend="g-uri-split-with-user"><function>g_uri_split_with_user()</function></link>.</para>
<para>Similarly, <link linkend="g-uri-build"><function>g_uri_build()</function></link> and <link linkend="g-uri-build-with-user"><function>g_uri_build_with_user()</function></link> can be used to
construct a <link linkend="GUri"><type>GUri</type></link> from a set of component strings.</para>
<para>As with the parsing functions, the building functions take a
<link linkend="GUriFlags"><type>GUriFlags</type></link> argument. In particular, it is important to keep in mind
whether the URI components you are using are already <literal>%</literal>-encoded. If so,
you must pass the <link linkend="G-URI-FLAGS-ENCODED:CAPS"><literal>G_URI_FLAGS_ENCODED</literal></link> flag.</para>
</refsect3>
<refsect3><title><literal>file://</literal> URIs</title><para>Note that Windows and Unix both define special rules for parsing
<literal>file://</literal> URIs (involving non-UTF-8 character sets on Unix, and the
interpretation of path separators on Windows). <link linkend="GUri"><type>GUri</type></link> does not
implement these rules. Use <link linkend="g-filename-from-uri"><function>g_filename_from_uri()</function></link> and
<link linkend="g-filename-to-uri"><function>g_filename_to_uri()</function></link> if you want to properly convert between
<literal>file://</literal> URIs and local filenames.</para>
</refsect3>
<refsect3><title>URI Equality</title><para>Note that there is no <literal><link linkend="g-uri-equal"><function>g_uri_equal()</function></link></literal> function, because comparing
URIs usefully requires scheme-specific knowledge that <link linkend="GUri"><type>GUri</type></link> does
not have. For example, <literal>http://example.com/</literal> and
<literal>http://EXAMPLE.COM:80</literal> have exactly the same meaning according
to the HTTP specification, and <literal>data:,foo</literal> and
<literal>data:;base64,Zm9v</literal> resolve to the same thing according to the
<literal>data:</literal> URI specification.</para>
</refsect3>

</refsect1>
<refsect1 id="glib-URI-Functions.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="g-uri-ref" role="function" condition="since:2.66">
<title>g_uri_ref&#160;()</title>
<indexterm zone="g-uri-ref" role="2.66"><primary sortas="uri_ref">g_uri_ref</primary></indexterm>
<programlisting language="C"><link linkend="GUri"><returnvalue>GUri</returnvalue></link>&#160;*
g_uri_ref (<parameter><link linkend="GUri"><type>GUri</type></link> *uri</parameter>);</programlisting>
<para>Increments the reference count of <parameter>uri</parameter>
 by one.</para>

<para><emphasis role="annotation">[<acronym>skip</acronym>]</emphasis></para><refsect3 id="g-uri-ref.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>uri</para></entry>
<entry role="parameter_description"><para>a <link linkend="GUri"><type>GUri</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-ref.returns" role="returns">
<title>Returns</title>
<para> <parameter>uri</parameter>
</para>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-unref" role="function" condition="since:2.66">
<title>g_uri_unref&#160;()</title>
<indexterm zone="g-uri-unref" role="2.66"><primary sortas="uri_unref">g_uri_unref</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_uri_unref (<parameter><link linkend="GUri"><type>GUri</type></link> *uri</parameter>);</programlisting>
<para>Atomically decrements the reference count of <parameter>uri</parameter>
 by one.</para>
<para>When the reference count reaches zero, the resources allocated by
<parameter>uri</parameter>
 are freed</para>

<para><emphasis role="annotation">[<acronym>skip</acronym>]</emphasis></para><refsect3 id="g-uri-unref.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>uri</para></entry>
<entry role="parameter_description"><para>a <link linkend="GUri"><type>GUri</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-split" role="function" condition="since:2.66">
<title>g_uri_split&#160;()</title>
<indexterm zone="g-uri-split" role="2.66"><primary sortas="uri_split">g_uri_split</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
g_uri_split (<parameter>const <link linkend="gchar"><type>gchar</type></link> *uri_ref</parameter>,
             <parameter><link linkend="GUriFlags"><type>GUriFlags</type></link> flags</parameter>,
             <parameter><link linkend="gchar"><type>gchar</type></link> **scheme</parameter>,
             <parameter><link linkend="gchar"><type>gchar</type></link> **userinfo</parameter>,
             <parameter><link linkend="gchar"><type>gchar</type></link> **host</parameter>,
             <parameter><link linkend="gint"><type>gint</type></link> *port</parameter>,
             <parameter><link linkend="gchar"><type>gchar</type></link> **path</parameter>,
             <parameter><link linkend="gchar"><type>gchar</type></link> **query</parameter>,
             <parameter><link linkend="gchar"><type>gchar</type></link> **fragment</parameter>,
             <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Parses <parameter>uri_ref</parameter>
 (which can be an
<link linkend="relative-absolute-uris">absolute or relative URI</link>) according to <parameter>flags</parameter>
, and
returns the pieces. Any component that doesn't appear in <parameter>uri_ref</parameter>
 will be
returned as <link linkend="NULL:CAPS"><literal>NULL</literal></link> (but note that all URIs always have a path component,
though it may be the empty string).</para>
<para>If <parameter>flags</parameter>
 contains <link linkend="G-URI-FLAGS-ENCODED:CAPS"><literal>G_URI_FLAGS_ENCODED</literal></link>, then <literal>%</literal>-encoded characters in
<parameter>uri_ref</parameter>
 will remain encoded in the output strings. (If not,
then all such characters will be decoded.) Note that decoding will
only work if the URI components are ASCII or UTF-8, so you will
need to use <link linkend="G-URI-FLAGS-ENCODED:CAPS"><literal>G_URI_FLAGS_ENCODED</literal></link> if they are not.</para>
<para>Note that the <link linkend="G-URI-FLAGS-HAS-PASSWORD:CAPS"><literal>G_URI_FLAGS_HAS_PASSWORD</literal></link> and
<link linkend="G-URI-FLAGS-HAS-AUTH-PARAMS:CAPS"><literal>G_URI_FLAGS_HAS_AUTH_PARAMS</literal></link> <parameter>flags</parameter>
 are ignored by <link linkend="g-uri-split"><function>g_uri_split()</function></link>,
since it always returns only the full userinfo; use
<link linkend="g-uri-split-with-user"><function>g_uri_split_with_user()</function></link> if you want it split up.</para>
<refsect3 id="g-uri-split.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>uri_ref</para></entry>
<entry role="parameter_description"><para>a string containing a relative or absolute URI</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>flags</para></entry>
<entry role="parameter_description"><para>flags for parsing <parameter>uri_ref</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>scheme</para></entry>
<entry role="parameter_description"><para>on return, contains
the scheme (converted to lowercase), or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>nullable</acronym>][<acronym>optional</acronym>][<acronym>transfer full</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>userinfo</para></entry>
<entry role="parameter_description"><para>on return, contains
the userinfo, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>nullable</acronym>][<acronym>optional</acronym>][<acronym>transfer full</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>host</para></entry>
<entry role="parameter_description"><para>on return, contains the
host, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>nullable</acronym>][<acronym>optional</acronym>][<acronym>transfer full</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>port</para></entry>
<entry role="parameter_description"><para>on return, contains the
port, or <literal>-1</literal>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>optional</acronym>][<acronym>transfer full</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>path</para></entry>
<entry role="parameter_description"><para>on return, contains the
path. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>not nullable</acronym>][<acronym>optional</acronym>][<acronym>transfer full</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>query</para></entry>
<entry role="parameter_description"><para>on return, contains the
query, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>nullable</acronym>][<acronym>optional</acronym>][<acronym>transfer full</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>fragment</para></entry>
<entry role="parameter_description"><para>on return, contains
the fragment, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>nullable</acronym>][<acronym>optional</acronym>][<acronym>transfer full</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para><link linkend="GError"><type>GError</type></link> for error reporting, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to ignore.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-split.returns" role="returns">
<title>Returns</title>
<para><link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if <parameter>uri_ref</parameter>
parsed successfully, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>
on error. </para>
<para><emphasis role="annotation">[<acronym>skip</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-split-with-user" role="function" condition="since:2.66">
<title>g_uri_split_with_user&#160;()</title>
<indexterm zone="g-uri-split-with-user" role="2.66"><primary sortas="uri_split_with_user">g_uri_split_with_user</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
g_uri_split_with_user (<parameter>const <link linkend="gchar"><type>gchar</type></link> *uri_ref</parameter>,
                       <parameter><link linkend="GUriFlags"><type>GUriFlags</type></link> flags</parameter>,
                       <parameter><link linkend="gchar"><type>gchar</type></link> **scheme</parameter>,
                       <parameter><link linkend="gchar"><type>gchar</type></link> **user</parameter>,
                       <parameter><link linkend="gchar"><type>gchar</type></link> **password</parameter>,
                       <parameter><link linkend="gchar"><type>gchar</type></link> **auth_params</parameter>,
                       <parameter><link linkend="gchar"><type>gchar</type></link> **host</parameter>,
                       <parameter><link linkend="gint"><type>gint</type></link> *port</parameter>,
                       <parameter><link linkend="gchar"><type>gchar</type></link> **path</parameter>,
                       <parameter><link linkend="gchar"><type>gchar</type></link> **query</parameter>,
                       <parameter><link linkend="gchar"><type>gchar</type></link> **fragment</parameter>,
                       <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Parses <parameter>uri_ref</parameter>
 (which can be an
<link linkend="relative-absolute-uris">absolute or relative URI</link>) according to <parameter>flags</parameter>
, and
returns the pieces. Any component that doesn't appear in <parameter>uri_ref</parameter>
 will be
returned as <link linkend="NULL:CAPS"><literal>NULL</literal></link> (but note that all URIs always have a path component,
though it may be the empty string).</para>
<para>See <link linkend="g-uri-split"><function>g_uri_split()</function></link>, and the definition of <link linkend="GUriFlags"><type>GUriFlags</type></link>, for more
information on the effect of <parameter>flags</parameter>
. Note that <parameter>password</parameter>
 will only
be parsed out if <parameter>flags</parameter>
 contains <link linkend="G-URI-FLAGS-HAS-PASSWORD:CAPS"><literal>G_URI_FLAGS_HAS_PASSWORD</literal></link>, and
<parameter>auth_params</parameter>
 will only be parsed out if <parameter>flags</parameter>
 contains
<link linkend="G-URI-FLAGS-HAS-AUTH-PARAMS:CAPS"><literal>G_URI_FLAGS_HAS_AUTH_PARAMS</literal></link>.</para>
<refsect3 id="g-uri-split-with-user.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>uri_ref</para></entry>
<entry role="parameter_description"><para>a string containing a relative or absolute URI</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>flags</para></entry>
<entry role="parameter_description"><para>flags for parsing <parameter>uri_ref</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>scheme</para></entry>
<entry role="parameter_description"><para>on return, contains
the scheme (converted to lowercase), or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>nullable</acronym>][<acronym>optional</acronym>][<acronym>transfer full</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>user</para></entry>
<entry role="parameter_description"><para>on return, contains
the user, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>nullable</acronym>][<acronym>optional</acronym>][<acronym>transfer full</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>password</para></entry>
<entry role="parameter_description"><para>on return, contains
the password, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>nullable</acronym>][<acronym>optional</acronym>][<acronym>transfer full</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>auth_params</para></entry>
<entry role="parameter_description"><para>on return, contains
the auth_params, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>nullable</acronym>][<acronym>optional</acronym>][<acronym>transfer full</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>host</para></entry>
<entry role="parameter_description"><para>on return, contains the
host, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>nullable</acronym>][<acronym>optional</acronym>][<acronym>transfer full</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>port</para></entry>
<entry role="parameter_description"><para>on return, contains the
port, or <literal>-1</literal>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>optional</acronym>][<acronym>transfer full</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>path</para></entry>
<entry role="parameter_description"><para>on return, contains the
path. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>not nullable</acronym>][<acronym>optional</acronym>][<acronym>transfer full</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>query</para></entry>
<entry role="parameter_description"><para>on return, contains the
query, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>nullable</acronym>][<acronym>optional</acronym>][<acronym>transfer full</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>fragment</para></entry>
<entry role="parameter_description"><para>on return, contains
the fragment, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>nullable</acronym>][<acronym>optional</acronym>][<acronym>transfer full</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para><link linkend="GError"><type>GError</type></link> for error reporting, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to ignore.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-split-with-user.returns" role="returns">
<title>Returns</title>
<para><link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if <parameter>uri_ref</parameter>
parsed successfully, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>
on error. </para>
<para><emphasis role="annotation">[<acronym>skip</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-split-network" role="function" condition="since:2.66">
<title>g_uri_split_network&#160;()</title>
<indexterm zone="g-uri-split-network" role="2.66"><primary sortas="uri_split_network">g_uri_split_network</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
g_uri_split_network (<parameter>const <link linkend="gchar"><type>gchar</type></link> *uri_string</parameter>,
                     <parameter><link linkend="GUriFlags"><type>GUriFlags</type></link> flags</parameter>,
                     <parameter><link linkend="gchar"><type>gchar</type></link> **scheme</parameter>,
                     <parameter><link linkend="gchar"><type>gchar</type></link> **host</parameter>,
                     <parameter><link linkend="gint"><type>gint</type></link> *port</parameter>,
                     <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Parses <parameter>uri_string</parameter>
 (which must be an <link linkend="relative-absolute-uris">absolute URI</link>)
according to <parameter>flags</parameter>
, and returns the pieces relevant to connecting to a host.
See the documentation for <link linkend="g-uri-split"><function>g_uri_split()</function></link> for more details; this is
mostly a wrapper around that function with simpler arguments.
However, it will return an error if <parameter>uri_string</parameter>
 is a relative URI,
or does not contain a hostname component.</para>
<refsect3 id="g-uri-split-network.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>uri_string</para></entry>
<entry role="parameter_description"><para>a string containing an absolute URI</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>flags</para></entry>
<entry role="parameter_description"><para>flags for parsing <parameter>uri_string</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>scheme</para></entry>
<entry role="parameter_description"><para>on return, contains
the scheme (converted to lowercase), or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>nullable</acronym>][<acronym>optional</acronym>][<acronym>transfer full</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>host</para></entry>
<entry role="parameter_description"><para>on return, contains the
host, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>nullable</acronym>][<acronym>optional</acronym>][<acronym>transfer full</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>port</para></entry>
<entry role="parameter_description"><para>on return, contains the
port, or <literal>-1</literal>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>optional</acronym>][<acronym>transfer full</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para><link linkend="GError"><type>GError</type></link> for error reporting, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to ignore.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-split-network.returns" role="returns">
<title>Returns</title>
<para><link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if <parameter>uri_string</parameter>
parsed successfully,
<link linkend="FALSE:CAPS"><literal>FALSE</literal></link> on error. </para>
<para><emphasis role="annotation">[<acronym>skip</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-is-valid" role="function" condition="since:2.66">
<title>g_uri_is_valid&#160;()</title>
<indexterm zone="g-uri-is-valid" role="2.66"><primary sortas="uri_is_valid">g_uri_is_valid</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
g_uri_is_valid (<parameter>const <link linkend="gchar"><type>gchar</type></link> *uri_string</parameter>,
                <parameter><link linkend="GUriFlags"><type>GUriFlags</type></link> flags</parameter>,
                <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Parses <parameter>uri_string</parameter>
 according to <parameter>flags</parameter>
, to determine whether it is a valid
<link linkend="relative-absolute-uris">absolute URI</link>, i.e. it does not need to be resolved
relative to another URI using <link linkend="g-uri-parse-relative"><function>g_uri_parse_relative()</function></link>.</para>
<para>If it’s not a valid URI, an error is returned explaining how it’s invalid.</para>
<para>See <link linkend="g-uri-split"><function>g_uri_split()</function></link>, and the definition of <link linkend="GUriFlags"><type>GUriFlags</type></link>, for more
information on the effect of <parameter>flags</parameter>
.</para>
<refsect3 id="g-uri-is-valid.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>uri_string</para></entry>
<entry role="parameter_description"><para>a string containing an absolute URI</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>flags</para></entry>
<entry role="parameter_description"><para>flags for parsing <parameter>uri_string</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para><link linkend="GError"><type>GError</type></link> for error reporting, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to ignore.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-is-valid.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if <parameter>uri_string</parameter>
is a valid absolute URI, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> on error.</para>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-join" role="function" condition="since:2.66">
<title>g_uri_join&#160;()</title>
<indexterm zone="g-uri-join" role="2.66"><primary sortas="uri_join">g_uri_join</primary></indexterm>
<programlisting language="C"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
g_uri_join (<parameter><link linkend="GUriFlags"><type>GUriFlags</type></link> flags</parameter>,
            <parameter>const <link linkend="gchar"><type>gchar</type></link> *scheme</parameter>,
            <parameter>const <link linkend="gchar"><type>gchar</type></link> *userinfo</parameter>,
            <parameter>const <link linkend="gchar"><type>gchar</type></link> *host</parameter>,
            <parameter><link linkend="gint"><type>gint</type></link> port</parameter>,
            <parameter>const <link linkend="gchar"><type>gchar</type></link> *path</parameter>,
            <parameter>const <link linkend="gchar"><type>gchar</type></link> *query</parameter>,
            <parameter>const <link linkend="gchar"><type>gchar</type></link> *fragment</parameter>);</programlisting>
<para>Joins the given components together according to <parameter>flags</parameter>
 to create
an absolute URI string. <parameter>path</parameter>
 may not be <link linkend="NULL:CAPS"><literal>NULL</literal></link> (though it may be the empty
string).</para>
<para>When <parameter>host</parameter>
 is present, <parameter>path</parameter>
 must either be empty or begin with a slash (<literal>/</literal>)
character. When <parameter>host</parameter>
 is not present, <parameter>path</parameter>
 cannot begin with two slash
   characters (<literal>//</literal>). See
<ulink url="https://tools.ietf.org/html/rfc3986#section-3">RFC 3986, section 3</ulink>.</para>
<para>See also <link linkend="g-uri-join-with-user"><function>g_uri_join_with_user()</function></link>, which allows specifying the
components of the ‘userinfo’ separately.</para>
<para><link linkend="G-URI-FLAGS-HAS-PASSWORD:CAPS"><literal>G_URI_FLAGS_HAS_PASSWORD</literal></link> and <link linkend="G-URI-FLAGS-HAS-AUTH-PARAMS:CAPS"><literal>G_URI_FLAGS_HAS_AUTH_PARAMS</literal></link> are ignored if set
in <parameter>flags</parameter>
.</para>
<refsect3 id="g-uri-join.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>flags</para></entry>
<entry role="parameter_description"><para>flags describing how to build the URI string</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>scheme</para></entry>
<entry role="parameter_description"><para>the URI scheme, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>userinfo</para></entry>
<entry role="parameter_description"><para>the userinfo component, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>host</para></entry>
<entry role="parameter_description"><para>the host component, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>port</para></entry>
<entry role="parameter_description"><para>the port, or <literal>-1</literal></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>path</para></entry>
<entry role="parameter_description"><para>the path component. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>not nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>query</para></entry>
<entry role="parameter_description"><para>the query component, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>fragment</para></entry>
<entry role="parameter_description"><para>the fragment, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-join.returns" role="returns">
<title>Returns</title>
<para>an absolute URI string. </para>
<para><emphasis role="annotation">[<acronym>not nullable</acronym>][<acronym>transfer full</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-join-with-user" role="function" condition="since:2.66">
<title>g_uri_join_with_user&#160;()</title>
<indexterm zone="g-uri-join-with-user" role="2.66"><primary sortas="uri_join_with_user">g_uri_join_with_user</primary></indexterm>
<programlisting language="C"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
g_uri_join_with_user (<parameter><link linkend="GUriFlags"><type>GUriFlags</type></link> flags</parameter>,
                      <parameter>const <link linkend="gchar"><type>gchar</type></link> *scheme</parameter>,
                      <parameter>const <link linkend="gchar"><type>gchar</type></link> *user</parameter>,
                      <parameter>const <link linkend="gchar"><type>gchar</type></link> *password</parameter>,
                      <parameter>const <link linkend="gchar"><type>gchar</type></link> *auth_params</parameter>,
                      <parameter>const <link linkend="gchar"><type>gchar</type></link> *host</parameter>,
                      <parameter><link linkend="gint"><type>gint</type></link> port</parameter>,
                      <parameter>const <link linkend="gchar"><type>gchar</type></link> *path</parameter>,
                      <parameter>const <link linkend="gchar"><type>gchar</type></link> *query</parameter>,
                      <parameter>const <link linkend="gchar"><type>gchar</type></link> *fragment</parameter>);</programlisting>
<para>Joins the given components together according to <parameter>flags</parameter>
 to create
an absolute URI string. <parameter>path</parameter>
 may not be <link linkend="NULL:CAPS"><literal>NULL</literal></link> (though it may be the empty
string).</para>
<para>In contrast to <link linkend="g-uri-join"><function>g_uri_join()</function></link>, this allows specifying the components
of the ‘userinfo’ separately. It otherwise behaves the same.</para>
<para><link linkend="G-URI-FLAGS-HAS-PASSWORD:CAPS"><literal>G_URI_FLAGS_HAS_PASSWORD</literal></link> and <link linkend="G-URI-FLAGS-HAS-AUTH-PARAMS:CAPS"><literal>G_URI_FLAGS_HAS_AUTH_PARAMS</literal></link> are ignored if set
in <parameter>flags</parameter>
.</para>
<refsect3 id="g-uri-join-with-user.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>flags</para></entry>
<entry role="parameter_description"><para>flags describing how to build the URI string</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>scheme</para></entry>
<entry role="parameter_description"><para>the URI scheme, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>user</para></entry>
<entry role="parameter_description"><para>the user component of the userinfo, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>password</para></entry>
<entry role="parameter_description"><para>the password component of the userinfo, or
<link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>auth_params</para></entry>
<entry role="parameter_description"><para>the auth params of the userinfo, or
<link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>host</para></entry>
<entry role="parameter_description"><para>the host component, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>port</para></entry>
<entry role="parameter_description"><para>the port, or <literal>-1</literal></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>path</para></entry>
<entry role="parameter_description"><para>the path component. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>not nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>query</para></entry>
<entry role="parameter_description"><para>the query component, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>fragment</para></entry>
<entry role="parameter_description"><para>the fragment, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-join-with-user.returns" role="returns">
<title>Returns</title>
<para>an absolute URI string. </para>
<para><emphasis role="annotation">[<acronym>not nullable</acronym>][<acronym>transfer full</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-parse" role="function" condition="since:2.66">
<title>g_uri_parse&#160;()</title>
<indexterm zone="g-uri-parse" role="2.66"><primary sortas="uri_parse">g_uri_parse</primary></indexterm>
<programlisting language="C"><link linkend="GUri"><returnvalue>GUri</returnvalue></link>&#160;*
g_uri_parse (<parameter>const <link linkend="gchar"><type>gchar</type></link> *uri_string</parameter>,
             <parameter><link linkend="GUriFlags"><type>GUriFlags</type></link> flags</parameter>,
             <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Parses <parameter>uri_string</parameter>
 according to <parameter>flags</parameter>
. If the result is not a
valid <link linkend="relative-absolute-uris">absolute URI</link>, it will be discarded, and an
error returned.</para>
<refsect3 id="g-uri-parse.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>uri_string</para></entry>
<entry role="parameter_description"><para>a string representing an absolute URI</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>flags</para></entry>
<entry role="parameter_description"><para>flags describing how to parse <parameter>uri_string</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para><link linkend="GError"><type>GError</type></link> for error reporting, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to ignore.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-parse.returns" role="returns">
<title>Returns</title>
<para>a new <link linkend="GUri"><type>GUri</type></link>, or NULL on error. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-parse-relative" role="function" condition="since:2.66">
<title>g_uri_parse_relative&#160;()</title>
<indexterm zone="g-uri-parse-relative" role="2.66"><primary sortas="uri_parse_relative">g_uri_parse_relative</primary></indexterm>
<programlisting language="C"><link linkend="GUri"><returnvalue>GUri</returnvalue></link>&#160;*
g_uri_parse_relative (<parameter><link linkend="GUri"><type>GUri</type></link> *base_uri</parameter>,
                      <parameter>const <link linkend="gchar"><type>gchar</type></link> *uri_ref</parameter>,
                      <parameter><link linkend="GUriFlags"><type>GUriFlags</type></link> flags</parameter>,
                      <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Parses <parameter>uri_ref</parameter>
 according to <parameter>flags</parameter>
 and, if it is a
<link linkend="relative-absolute-uris">relative URI</link>, resolves it relative to <parameter>base_uri</parameter>
.
If the result is not a valid absolute URI, it will be discarded, and an error
returned.</para>
<refsect3 id="g-uri-parse-relative.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>base_uri</para></entry>
<entry role="parameter_description"><para>a base absolute URI. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>transfer none</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>uri_ref</para></entry>
<entry role="parameter_description"><para>a string representing a relative or absolute URI</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>flags</para></entry>
<entry role="parameter_description"><para>flags describing how to parse <parameter>uri_ref</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para><link linkend="GError"><type>GError</type></link> for error reporting, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to ignore.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-parse-relative.returns" role="returns">
<title>Returns</title>
<para>a new <link linkend="GUri"><type>GUri</type></link>, or NULL on error. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-resolve-relative" role="function" condition="since:2.66">
<title>g_uri_resolve_relative&#160;()</title>
<indexterm zone="g-uri-resolve-relative" role="2.66"><primary sortas="uri_resolve_relative">g_uri_resolve_relative</primary></indexterm>
<programlisting language="C"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
g_uri_resolve_relative (<parameter>const <link linkend="gchar"><type>gchar</type></link> *base_uri_string</parameter>,
                        <parameter>const <link linkend="gchar"><type>gchar</type></link> *uri_ref</parameter>,
                        <parameter><link linkend="GUriFlags"><type>GUriFlags</type></link> flags</parameter>,
                        <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Parses <parameter>uri_ref</parameter>
 according to <parameter>flags</parameter>
 and, if it is a
<link linkend="relative-absolute-uris">relative URI</link>, resolves it relative to
<parameter>base_uri_string</parameter>
. If the result is not a valid absolute URI, it will be
discarded, and an error returned.</para>
<para>(If <parameter>base_uri_string</parameter>
 is <link linkend="NULL:CAPS"><literal>NULL</literal></link>, this just returns <parameter>uri_ref</parameter>
, or
<link linkend="NULL:CAPS"><literal>NULL</literal></link> if <parameter>uri_ref</parameter>
 is invalid or not absolute.)</para>
<refsect3 id="g-uri-resolve-relative.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>base_uri_string</para></entry>
<entry role="parameter_description"><para>a string representing a base URI. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>uri_ref</para></entry>
<entry role="parameter_description"><para>a string representing a relative or absolute URI</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>flags</para></entry>
<entry role="parameter_description"><para>flags describing how to parse <parameter>uri_ref</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para><link linkend="GError"><type>GError</type></link> for error reporting, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to ignore.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-resolve-relative.returns" role="returns">
<title>Returns</title>
<para>the resolved URI string,
or NULL on error. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-build" role="function" condition="since:2.66">
<title>g_uri_build&#160;()</title>
<indexterm zone="g-uri-build" role="2.66"><primary sortas="uri_build">g_uri_build</primary></indexterm>
<programlisting language="C"><link linkend="GUri"><returnvalue>GUri</returnvalue></link>&#160;*
g_uri_build (<parameter><link linkend="GUriFlags"><type>GUriFlags</type></link> flags</parameter>,
             <parameter>const <link linkend="gchar"><type>gchar</type></link> *scheme</parameter>,
             <parameter>const <link linkend="gchar"><type>gchar</type></link> *userinfo</parameter>,
             <parameter>const <link linkend="gchar"><type>gchar</type></link> *host</parameter>,
             <parameter><link linkend="gint"><type>gint</type></link> port</parameter>,
             <parameter>const <link linkend="gchar"><type>gchar</type></link> *path</parameter>,
             <parameter>const <link linkend="gchar"><type>gchar</type></link> *query</parameter>,
             <parameter>const <link linkend="gchar"><type>gchar</type></link> *fragment</parameter>);</programlisting>
<para>Creates a new <link linkend="GUri"><type>GUri</type></link> from the given components according to <parameter>flags</parameter>
.</para>
<para>See also <link linkend="g-uri-build-with-user"><function>g_uri_build_with_user()</function></link>, which allows specifying the
components of the "userinfo" separately.</para>
<refsect3 id="g-uri-build.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>flags</para></entry>
<entry role="parameter_description"><para>flags describing how to build the <link linkend="GUri"><type>GUri</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>scheme</para></entry>
<entry role="parameter_description"><para>the URI scheme. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>not nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>userinfo</para></entry>
<entry role="parameter_description"><para>the userinfo component, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>host</para></entry>
<entry role="parameter_description"><para>the host component, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>port</para></entry>
<entry role="parameter_description"><para>the port, or <literal>-1</literal></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>path</para></entry>
<entry role="parameter_description"><para>the path component. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>not nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>query</para></entry>
<entry role="parameter_description"><para>the query component, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>fragment</para></entry>
<entry role="parameter_description"><para>the fragment, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-build.returns" role="returns">
<title>Returns</title>
<para>a new <link linkend="GUri"><type>GUri</type></link>. </para>
<para><emphasis role="annotation">[<acronym>not nullable</acronym>][<acronym>transfer full</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-build-with-user" role="function" condition="since:2.66">
<title>g_uri_build_with_user&#160;()</title>
<indexterm zone="g-uri-build-with-user" role="2.66"><primary sortas="uri_build_with_user">g_uri_build_with_user</primary></indexterm>
<programlisting language="C"><link linkend="GUri"><returnvalue>GUri</returnvalue></link>&#160;*
g_uri_build_with_user (<parameter><link linkend="GUriFlags"><type>GUriFlags</type></link> flags</parameter>,
                       <parameter>const <link linkend="gchar"><type>gchar</type></link> *scheme</parameter>,
                       <parameter>const <link linkend="gchar"><type>gchar</type></link> *user</parameter>,
                       <parameter>const <link linkend="gchar"><type>gchar</type></link> *password</parameter>,
                       <parameter>const <link linkend="gchar"><type>gchar</type></link> *auth_params</parameter>,
                       <parameter>const <link linkend="gchar"><type>gchar</type></link> *host</parameter>,
                       <parameter><link linkend="gint"><type>gint</type></link> port</parameter>,
                       <parameter>const <link linkend="gchar"><type>gchar</type></link> *path</parameter>,
                       <parameter>const <link linkend="gchar"><type>gchar</type></link> *query</parameter>,
                       <parameter>const <link linkend="gchar"><type>gchar</type></link> *fragment</parameter>);</programlisting>
<para>Creates a new <link linkend="GUri"><type>GUri</type></link> from the given components according to <parameter>flags</parameter>

(<link linkend="G-URI-FLAGS-HAS-PASSWORD:CAPS"><literal>G_URI_FLAGS_HAS_PASSWORD</literal></link> is added unconditionally). The <parameter>flags</parameter>
 must be
coherent with the passed values, in particular use <literal>%</literal>-encoded values with
<link linkend="G-URI-FLAGS-ENCODED:CAPS"><literal>G_URI_FLAGS_ENCODED</literal></link>.</para>
<para>In contrast to <link linkend="g-uri-build"><function>g_uri_build()</function></link>, this allows specifying the components
of the ‘userinfo’ field separately. Note that <parameter>user</parameter>
 must be non-<link linkend="NULL:CAPS"><literal>NULL</literal></link>
if either <parameter>password</parameter>
 or <parameter>auth_params</parameter>
 is non-<link linkend="NULL:CAPS"><literal>NULL</literal></link>.</para>
<refsect3 id="g-uri-build-with-user.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>flags</para></entry>
<entry role="parameter_description"><para>flags describing how to build the <link linkend="GUri"><type>GUri</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>scheme</para></entry>
<entry role="parameter_description"><para>the URI scheme. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>not nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>user</para></entry>
<entry role="parameter_description"><para>the user component of the userinfo, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>password</para></entry>
<entry role="parameter_description"><para>the password component of the userinfo, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>auth_params</para></entry>
<entry role="parameter_description"><para>the auth params of the userinfo, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>host</para></entry>
<entry role="parameter_description"><para>the host component, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>port</para></entry>
<entry role="parameter_description"><para>the port, or <literal>-1</literal></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>path</para></entry>
<entry role="parameter_description"><para>the path component. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>not nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>query</para></entry>
<entry role="parameter_description"><para>the query component, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>fragment</para></entry>
<entry role="parameter_description"><para>the fragment, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-build-with-user.returns" role="returns">
<title>Returns</title>
<para>a new <link linkend="GUri"><type>GUri</type></link>. </para>
<para><emphasis role="annotation">[<acronym>not nullable</acronym>][<acronym>transfer full</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-peek-scheme" role="function" condition="since:2.66">
<title>g_uri_peek_scheme&#160;()</title>
<indexterm zone="g-uri-peek-scheme" role="2.66"><primary sortas="uri_peek_scheme">g_uri_peek_scheme</primary></indexterm>
<programlisting language="C">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
g_uri_peek_scheme (<parameter>const <link linkend="char"><type>char</type></link> *uri</parameter>);</programlisting>
<para>Gets the scheme portion of a URI string.
<ulink url="https://tools.ietf.org/html/rfc3986#section-3">RFC 3986</ulink> decodes the scheme
as:</para>
<informalexample><programlisting role="example"><![CDATA[
URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
]]></programlisting></informalexample>
<para>
Common schemes include <literal>file</literal>, <literal>https</literal>, <literal>svn+ssh</literal>, etc.</para>
<para>Unlike <link linkend="g-uri-parse-scheme"><function>g_uri_parse_scheme()</function></link>, the returned scheme is normalized to
all-lowercase and does not need to be freed.</para>
<refsect3 id="g-uri-peek-scheme.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>uri</para></entry>
<entry role="parameter_description"><para>a valid URI.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-peek-scheme.returns" role="returns">
<title>Returns</title>
<para>The ‘scheme’ component of the URI, or
<link linkend="NULL:CAPS"><literal>NULL</literal></link> on error. The returned string is normalized to all-lowercase, and
interned via <link linkend="g-intern-string"><function>g_intern_string()</function></link>, so it does not need to be freed. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>][<acronym>nullable</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-parse-scheme" role="function" condition="since:2.16">
<title>g_uri_parse_scheme&#160;()</title>
<indexterm zone="g-uri-parse-scheme" role="2.16"><primary sortas="uri_parse_scheme">g_uri_parse_scheme</primary></indexterm>
<programlisting language="C"><link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
g_uri_parse_scheme (<parameter>const <link linkend="char"><type>char</type></link> *uri</parameter>);</programlisting>
<para>Gets the scheme portion of a URI string.
<ulink url="https://tools.ietf.org/html/rfc3986#section-3">RFC 3986</ulink> decodes the scheme
as:</para>
<informalexample><programlisting role="example"><![CDATA[
URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
]]></programlisting></informalexample>
<para>
Common schemes include <literal>file</literal>, <literal>https</literal>, <literal>svn+ssh</literal>, etc.</para>
<refsect3 id="g-uri-parse-scheme.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>uri</para></entry>
<entry role="parameter_description"><para>a valid URI.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-parse-scheme.returns" role="returns">
<title>Returns</title>
<para>The ‘scheme’ component of the URI, or
<link linkend="NULL:CAPS"><literal>NULL</literal></link> on error. The returned string should be freed when no longer needed. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>][<acronym>nullable</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.16">2.16</link></para></refsect2>
<refsect2 id="g-uri-to-string" role="function" condition="since:2.66">
<title>g_uri_to_string&#160;()</title>
<indexterm zone="g-uri-to-string" role="2.66"><primary sortas="uri_to_string">g_uri_to_string</primary></indexterm>
<programlisting language="C"><link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
g_uri_to_string (<parameter><link linkend="GUri"><type>GUri</type></link> *uri</parameter>);</programlisting>
<para>Returns a string representing <parameter>uri</parameter>
.</para>
<para>This is not guaranteed to return a string which is identical to the
string that <parameter>uri</parameter>
 was parsed from. However, if the source URI was
syntactically correct (according to RFC 3986), and it was parsed
with <link linkend="G-URI-FLAGS-ENCODED:CAPS"><literal>G_URI_FLAGS_ENCODED</literal></link>, then <link linkend="g-uri-to-string"><function>g_uri_to_string()</function></link> is guaranteed to return
a string which is at least semantically equivalent to the source
URI (according to RFC 3986).</para>
<para>If <parameter>uri</parameter>
 might contain sensitive details, such as authentication parameters,
or private data in its query string, and the returned string is going to be
logged, then consider using <link linkend="g-uri-to-string-partial"><function>g_uri_to_string_partial()</function></link> to redact parts.</para>
<refsect3 id="g-uri-to-string.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>uri</para></entry>
<entry role="parameter_description"><para>a <link linkend="GUri"><type>GUri</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-to-string.returns" role="returns">
<title>Returns</title>
<para>a string representing <parameter>uri</parameter>
,
which the caller must free. </para>
<para><emphasis role="annotation">[<acronym>not nullable</acronym>][<acronym>transfer full</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-to-string-partial" role="function" condition="since:2.66">
<title>g_uri_to_string_partial&#160;()</title>
<indexterm zone="g-uri-to-string-partial" role="2.66"><primary sortas="uri_to_string_partial">g_uri_to_string_partial</primary></indexterm>
<programlisting language="C"><link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
g_uri_to_string_partial (<parameter><link linkend="GUri"><type>GUri</type></link> *uri</parameter>,
                         <parameter><link linkend="GUriHideFlags"><type>GUriHideFlags</type></link> flags</parameter>);</programlisting>
<para>Returns a string representing <parameter>uri</parameter>
, subject to the options in
<parameter>flags</parameter>
. See <link linkend="g-uri-to-string"><function>g_uri_to_string()</function></link> and <link linkend="GUriHideFlags"><type>GUriHideFlags</type></link> for more details.</para>
<refsect3 id="g-uri-to-string-partial.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>uri</para></entry>
<entry role="parameter_description"><para>a <link linkend="GUri"><type>GUri</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>flags</para></entry>
<entry role="parameter_description"><para>flags describing what parts of <parameter>uri</parameter>
to hide</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-to-string-partial.returns" role="returns">
<title>Returns</title>
<para>a string representing
<parameter>uri</parameter>
, which the caller must free. </para>
<para><emphasis role="annotation">[<acronym>not nullable</acronym>][<acronym>transfer full</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-get-scheme" role="function" condition="since:2.66">
<title>g_uri_get_scheme&#160;()</title>
<indexterm zone="g-uri-get-scheme" role="2.66"><primary sortas="uri_get_scheme">g_uri_get_scheme</primary></indexterm>
<programlisting language="C">const <link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
g_uri_get_scheme (<parameter><link linkend="GUri"><type>GUri</type></link> *uri</parameter>);</programlisting>
<para>Gets <parameter>uri</parameter>
's scheme. Note that this will always be all-lowercase,
regardless of the string or strings that <parameter>uri</parameter>
 was created from.</para>
<refsect3 id="g-uri-get-scheme.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>uri</para></entry>
<entry role="parameter_description"><para>a <link linkend="GUri"><type>GUri</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-get-scheme.returns" role="returns">
<title>Returns</title>
<para><parameter>uri</parameter>
's scheme. </para>
<para><emphasis role="annotation">[<acronym>not nullable</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-get-userinfo" role="function" condition="since:2.66">
<title>g_uri_get_userinfo&#160;()</title>
<indexterm zone="g-uri-get-userinfo" role="2.66"><primary sortas="uri_get_userinfo">g_uri_get_userinfo</primary></indexterm>
<programlisting language="C">const <link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
g_uri_get_userinfo (<parameter><link linkend="GUri"><type>GUri</type></link> *uri</parameter>);</programlisting>
<para>Gets <parameter>uri</parameter>
's userinfo, which may contain <literal>%</literal>-encoding, depending on
the flags with which <parameter>uri</parameter>
 was created.</para>
<refsect3 id="g-uri-get-userinfo.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>uri</para></entry>
<entry role="parameter_description"><para>a <link linkend="GUri"><type>GUri</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-get-userinfo.returns" role="returns">
<title>Returns</title>
<para><parameter>uri</parameter>
's userinfo. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-get-user" role="function" condition="since:2.66">
<title>g_uri_get_user&#160;()</title>
<indexterm zone="g-uri-get-user" role="2.66"><primary sortas="uri_get_user">g_uri_get_user</primary></indexterm>
<programlisting language="C">const <link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
g_uri_get_user (<parameter><link linkend="GUri"><type>GUri</type></link> *uri</parameter>);</programlisting>
<para>Gets the ‘username’ component of <parameter>uri</parameter>
's userinfo, which may contain
<literal>%</literal>-encoding, depending on the flags with which <parameter>uri</parameter>
 was created.
If <parameter>uri</parameter>
 was not created with <link linkend="G-URI-FLAGS-HAS-PASSWORD:CAPS"><literal>G_URI_FLAGS_HAS_PASSWORD</literal></link> or
<link linkend="G-URI-FLAGS-HAS-AUTH-PARAMS:CAPS"><literal>G_URI_FLAGS_HAS_AUTH_PARAMS</literal></link>, this is the same as <link linkend="g-uri-get-userinfo"><function>g_uri_get_userinfo()</function></link>.</para>
<refsect3 id="g-uri-get-user.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>uri</para></entry>
<entry role="parameter_description"><para>a <link linkend="GUri"><type>GUri</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-get-user.returns" role="returns">
<title>Returns</title>
<para><parameter>uri</parameter>
's user. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-get-password" role="function" condition="since:2.66">
<title>g_uri_get_password&#160;()</title>
<indexterm zone="g-uri-get-password" role="2.66"><primary sortas="uri_get_password">g_uri_get_password</primary></indexterm>
<programlisting language="C">const <link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
g_uri_get_password (<parameter><link linkend="GUri"><type>GUri</type></link> *uri</parameter>);</programlisting>
<para>Gets <parameter>uri</parameter>
's password, which may contain <literal>%</literal>-encoding, depending on
the flags with which <parameter>uri</parameter>
 was created. (If <parameter>uri</parameter>
 was not created
with <link linkend="G-URI-FLAGS-HAS-PASSWORD:CAPS"><literal>G_URI_FLAGS_HAS_PASSWORD</literal></link> then this will be <link linkend="NULL:CAPS"><literal>NULL</literal></link>.)</para>
<refsect3 id="g-uri-get-password.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>uri</para></entry>
<entry role="parameter_description"><para>a <link linkend="GUri"><type>GUri</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-get-password.returns" role="returns">
<title>Returns</title>
<para><parameter>uri</parameter>
's password. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-get-auth-params" role="function" condition="since:2.66">
<title>g_uri_get_auth_params&#160;()</title>
<indexterm zone="g-uri-get-auth-params" role="2.66"><primary sortas="uri_get_auth_params">g_uri_get_auth_params</primary></indexterm>
<programlisting language="C">const <link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
g_uri_get_auth_params (<parameter><link linkend="GUri"><type>GUri</type></link> *uri</parameter>);</programlisting>
<para>Gets <parameter>uri</parameter>
's authentication parameters, which may contain
<literal>%</literal>-encoding, depending on the flags with which <parameter>uri</parameter>
 was created.
(If <parameter>uri</parameter>
 was not created with <link linkend="G-URI-FLAGS-HAS-AUTH-PARAMS:CAPS"><literal>G_URI_FLAGS_HAS_AUTH_PARAMS</literal></link> then this will
be <link linkend="NULL:CAPS"><literal>NULL</literal></link>.)</para>
<para>Depending on the URI scheme, <link linkend="g-uri-parse-params"><function>g_uri_parse_params()</function></link> may be useful for
further parsing this information.</para>
<refsect3 id="g-uri-get-auth-params.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>uri</para></entry>
<entry role="parameter_description"><para>a <link linkend="GUri"><type>GUri</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-get-auth-params.returns" role="returns">
<title>Returns</title>
<para><parameter>uri</parameter>
's authentication parameters. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-get-host" role="function" condition="since:2.66">
<title>g_uri_get_host&#160;()</title>
<indexterm zone="g-uri-get-host" role="2.66"><primary sortas="uri_get_host">g_uri_get_host</primary></indexterm>
<programlisting language="C">const <link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
g_uri_get_host (<parameter><link linkend="GUri"><type>GUri</type></link> *uri</parameter>);</programlisting>
<para>Gets <parameter>uri</parameter>
's host. This will never have <literal>%</literal>-encoded characters,
unless it is non-UTF-8 (which can only be the case if <parameter>uri</parameter>
 was
created with <link linkend="G-URI-FLAGS-NON-DNS:CAPS"><literal>G_URI_FLAGS_NON_DNS</literal></link>).</para>
<para>If <parameter>uri</parameter>
 contained an IPv6 address literal, this value will be just
that address, without the brackets around it that are necessary in
the string form of the URI. Note that in this case there may also
be a scope ID attached to the address. Eg, `fe80::1234%`<literal>em1</literal> (or
`fe80::1234%`<literal>25em1</literal> if the string is still encoded).</para>
<refsect3 id="g-uri-get-host.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>uri</para></entry>
<entry role="parameter_description"><para>a <link linkend="GUri"><type>GUri</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-get-host.returns" role="returns">
<title>Returns</title>
<para><parameter>uri</parameter>
's host. </para>
<para><emphasis role="annotation">[<acronym>not nullable</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-get-port" role="function" condition="since:2.66">
<title>g_uri_get_port&#160;()</title>
<indexterm zone="g-uri-get-port" role="2.66"><primary sortas="uri_get_port">g_uri_get_port</primary></indexterm>
<programlisting language="C"><link linkend="gint"><returnvalue>gint</returnvalue></link>
g_uri_get_port (<parameter><link linkend="GUri"><type>GUri</type></link> *uri</parameter>);</programlisting>
<para>Gets <parameter>uri</parameter>
's port.</para>
<refsect3 id="g-uri-get-port.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>uri</para></entry>
<entry role="parameter_description"><para>a <link linkend="GUri"><type>GUri</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-get-port.returns" role="returns">
<title>Returns</title>
<para> <parameter>uri</parameter>
's port, or <literal>-1</literal> if no port was specified.</para>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-get-path" role="function" condition="since:2.66">
<title>g_uri_get_path&#160;()</title>
<indexterm zone="g-uri-get-path" role="2.66"><primary sortas="uri_get_path">g_uri_get_path</primary></indexterm>
<programlisting language="C">const <link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
g_uri_get_path (<parameter><link linkend="GUri"><type>GUri</type></link> *uri</parameter>);</programlisting>
<para>Gets <parameter>uri</parameter>
's path, which may contain <literal>%</literal>-encoding, depending on the
flags with which <parameter>uri</parameter>
 was created.</para>
<refsect3 id="g-uri-get-path.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>uri</para></entry>
<entry role="parameter_description"><para>a <link linkend="GUri"><type>GUri</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-get-path.returns" role="returns">
<title>Returns</title>
<para><parameter>uri</parameter>
's path. </para>
<para><emphasis role="annotation">[<acronym>not nullable</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-get-query" role="function" condition="since:2.66">
<title>g_uri_get_query&#160;()</title>
<indexterm zone="g-uri-get-query" role="2.66"><primary sortas="uri_get_query">g_uri_get_query</primary></indexterm>
<programlisting language="C">const <link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
g_uri_get_query (<parameter><link linkend="GUri"><type>GUri</type></link> *uri</parameter>);</programlisting>
<para>Gets <parameter>uri</parameter>
's query, which may contain <literal>%</literal>-encoding, depending on the
flags with which <parameter>uri</parameter>
 was created.</para>
<para>For queries consisting of a series of <literal>name=value</literal> parameters,
<link linkend="GUriParamsIter"><type>GUriParamsIter</type></link> or <link linkend="g-uri-parse-params"><function>g_uri_parse_params()</function></link> may be useful.</para>
<refsect3 id="g-uri-get-query.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>uri</para></entry>
<entry role="parameter_description"><para>a <link linkend="GUri"><type>GUri</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-get-query.returns" role="returns">
<title>Returns</title>
<para><parameter>uri</parameter>
's query. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-get-fragment" role="function" condition="since:2.66">
<title>g_uri_get_fragment&#160;()</title>
<indexterm zone="g-uri-get-fragment" role="2.66"><primary sortas="uri_get_fragment">g_uri_get_fragment</primary></indexterm>
<programlisting language="C">const <link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
g_uri_get_fragment (<parameter><link linkend="GUri"><type>GUri</type></link> *uri</parameter>);</programlisting>
<para>Gets <parameter>uri</parameter>
's fragment, which may contain <literal>%</literal>-encoding, depending on
the flags with which <parameter>uri</parameter>
 was created.</para>
<refsect3 id="g-uri-get-fragment.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>uri</para></entry>
<entry role="parameter_description"><para>a <link linkend="GUri"><type>GUri</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-get-fragment.returns" role="returns">
<title>Returns</title>
<para><parameter>uri</parameter>
's fragment. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-get-flags" role="function" condition="since:2.66">
<title>g_uri_get_flags&#160;()</title>
<indexterm zone="g-uri-get-flags" role="2.66"><primary sortas="uri_get_flags">g_uri_get_flags</primary></indexterm>
<programlisting language="C"><link linkend="GUriFlags"><returnvalue>GUriFlags</returnvalue></link>
g_uri_get_flags (<parameter><link linkend="GUri"><type>GUri</type></link> *uri</parameter>);</programlisting>
<para>Gets <parameter>uri</parameter>
's flags set upon construction.</para>
<refsect3 id="g-uri-get-flags.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>uri</para></entry>
<entry role="parameter_description"><para>a <link linkend="GUri"><type>GUri</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-get-flags.returns" role="returns">
<title>Returns</title>
<para> <parameter>uri</parameter>
's flags.</para>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-params-iter-init" role="function" condition="since:2.66">
<title>g_uri_params_iter_init&#160;()</title>
<indexterm zone="g-uri-params-iter-init" role="2.66"><primary sortas="uri_params_iter_init">g_uri_params_iter_init</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_uri_params_iter_init (<parameter><link linkend="GUriParamsIter"><type>GUriParamsIter</type></link> *iter</parameter>,
                        <parameter>const <link linkend="gchar"><type>gchar</type></link> *params</parameter>,
                        <parameter><link linkend="gssize"><type>gssize</type></link> length</parameter>,
                        <parameter>const <link linkend="gchar"><type>gchar</type></link> *separators</parameter>,
                        <parameter><link linkend="GUriParamsFlags"><type>GUriParamsFlags</type></link> flags</parameter>);</programlisting>
<para>Initializes an attribute/value pair iterator.</para>
<para>The iterator keeps pointers to the <parameter>params</parameter>
 and <parameter>separators</parameter>
 arguments, those
variables must thus outlive the iterator and not be modified during the
iteration.</para>
<para>If <link linkend="G-URI-PARAMS-WWW-FORM:CAPS"><literal>G_URI_PARAMS_WWW_FORM</literal></link> is passed in <parameter>flags</parameter>
, <literal>+</literal> characters in the param
string will be replaced with spaces in the output. For example, <literal>foo=bar+baz</literal>
will give attribute <literal>foo</literal> with value <literal>bar baz</literal>. This is commonly used on the
web (the <literal>https</literal> and <literal>http</literal> schemes only), but is deprecated in favour of
the equivalent of encoding spaces as <literal>%20</literal>.</para>
<para>Unlike with <link linkend="g-uri-parse-params"><function>g_uri_parse_params()</function></link>, <link linkend="G-URI-PARAMS-CASE-INSENSITIVE:CAPS"><literal>G_URI_PARAMS_CASE_INSENSITIVE</literal></link> has no
effect if passed to <parameter>flags</parameter>
 for <link linkend="g-uri-params-iter-init"><function>g_uri_params_iter_init()</function></link>. The caller is
responsible for doing their own case-insensitive comparisons.</para>
<informalexample><programlisting role="example"><![CDATA[
GUriParamsIter iter;
GError *error = NULL;
gchar *unowned_attr, *unowned_value;

g_uri_params_iter_init (&iter, "foo=bar&baz=bar&Foo=frob&baz=bar2", -1, "&", G_URI_PARAMS_NONE);
while (g_uri_params_iter_next (&iter, &unowned_attr, &unowned_value, &error))
  {
    g_autofree gchar *attr = g_steal_pointer (&unowned_attr);
    g_autofree gchar *value = g_steal_pointer (&unowned_value);
    // do something with attr and value; this code will be called 4 times
    // for the params string in this example: once with attr=foo and value=bar,
    // then with baz/bar, then Foo/frob, then baz/bar2.
  }
if (error)
  // handle parsing error
]]></programlisting></informalexample>
<para></para>
<refsect3 id="g-uri-params-iter-init.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>iter</para></entry>
<entry role="parameter_description"><para>an uninitialized <link linkend="GUriParamsIter"><type>GUriParamsIter</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>params</para></entry>
<entry role="parameter_description"><para>a <literal>%</literal>-encoded string containing <literal>attribute=value</literal>
parameters</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>length</para></entry>
<entry role="parameter_description"><para>the length of <parameter>params</parameter>
, or <literal>-1</literal> if it is nul-terminated</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>separators</para></entry>
<entry role="parameter_description"><para>the separator byte character set between parameters. (usually
<literal>&amp;amp;</literal>, but sometimes <literal>;</literal> or both <literal>&amp;amp;;</literal>). Note that this function works on
bytes not characters, so it can't be used to delimit UTF-8 strings for
anything but ASCII characters. You may pass an empty set, in which case
no splitting will occur.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>flags</para></entry>
<entry role="parameter_description"><para>flags to modify the way the parameters are handled.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-params-iter-next" role="function" condition="since:2.66">
<title>g_uri_params_iter_next&#160;()</title>
<indexterm zone="g-uri-params-iter-next" role="2.66"><primary sortas="uri_params_iter_next">g_uri_params_iter_next</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
g_uri_params_iter_next (<parameter><link linkend="GUriParamsIter"><type>GUriParamsIter</type></link> *iter</parameter>,
                        <parameter><link linkend="gchar"><type>gchar</type></link> **attribute</parameter>,
                        <parameter><link linkend="gchar"><type>gchar</type></link> **value</parameter>,
                        <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Advances <parameter>iter</parameter>
 and retrieves the next attribute/value. <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> is returned if
an error has occurred (in which case <parameter>error</parameter>
 is set), or if the end of the
iteration is reached (in which case <parameter>attribute</parameter>
 and <parameter>value</parameter>
 are set to <link linkend="NULL:CAPS"><literal>NULL</literal></link>
and the iterator becomes invalid). If <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> is returned,
<link linkend="g-uri-params-iter-next"><function>g_uri_params_iter_next()</function></link> may be called again to receive another
attribute/value pair.</para>
<para>Note that the same <parameter>attribute</parameter>
 may be returned multiple times, since URIs
allow repeated attributes.</para>
<refsect3 id="g-uri-params-iter-next.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>iter</para></entry>
<entry role="parameter_description"><para>an initialized <link linkend="GUriParamsIter"><type>GUriParamsIter</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>attribute</para></entry>
<entry role="parameter_description"><para>on return, contains
the attribute, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>nullable</acronym>][<acronym>optional</acronym>][<acronym>transfer full</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>value</para></entry>
<entry role="parameter_description"><para>on return, contains
the value, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>nullable</acronym>][<acronym>optional</acronym>][<acronym>transfer full</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para><link linkend="GError"><type>GError</type></link> for error reporting, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to ignore.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-params-iter-next.returns" role="returns">
<title>Returns</title>
<para> <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> if the end of the parameters has been reached or an error was
encountered. <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> otherwise.</para>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-parse-params" role="function" condition="since:2.66">
<title>g_uri_parse_params&#160;()</title>
<indexterm zone="g-uri-parse-params" role="2.66"><primary sortas="uri_parse_params">g_uri_parse_params</primary></indexterm>
<programlisting language="C"><link linkend="GHashTable"><returnvalue>GHashTable</returnvalue></link>&#160;*
g_uri_parse_params (<parameter>const <link linkend="gchar"><type>gchar</type></link> *params</parameter>,
                    <parameter><link linkend="gssize"><type>gssize</type></link> length</parameter>,
                    <parameter>const <link linkend="gchar"><type>gchar</type></link> *separators</parameter>,
                    <parameter><link linkend="GUriParamsFlags"><type>GUriParamsFlags</type></link> flags</parameter>,
                    <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Many URI schemes include one or more attribute/value pairs as part of the URI
value. This method can be used to parse them into a hash table. When an
attribute has multiple occurrences, the last value is the final returned
value. If you need to handle repeated attributes differently, use
<link linkend="GUriParamsIter"><type>GUriParamsIter</type></link>.</para>
<para>The <parameter>params</parameter>
 string is assumed to still be <literal>%</literal>-encoded, but the returned
values will be fully decoded. (Thus it is possible that the returned values
may contain <literal>=</literal> or <parameter>separators</parameter>
, if the value was encoded in the input.)
Invalid <literal>%</literal>-encoding is treated as with the <link linkend="G-URI-FLAGS-PARSE-RELAXED:CAPS"><literal>G_URI_FLAGS_PARSE_RELAXED</literal></link>
rules for <link linkend="g-uri-parse"><function>g_uri_parse()</function></link>. (However, if <parameter>params</parameter>
 is the path or query string
from a <link linkend="GUri"><type>GUri</type></link> that was parsed without <link linkend="G-URI-FLAGS-PARSE-RELAXED:CAPS"><literal>G_URI_FLAGS_PARSE_RELAXED</literal></link> and
<link linkend="G-URI-FLAGS-ENCODED:CAPS"><literal>G_URI_FLAGS_ENCODED</literal></link>, then you already know that it does not contain any
invalid encoding.)</para>
<para><link linkend="G-URI-PARAMS-WWW-FORM:CAPS"><literal>G_URI_PARAMS_WWW_FORM</literal></link> is handled as documented for <link linkend="g-uri-params-iter-init"><function>g_uri_params_iter_init()</function></link>.</para>
<para>If <link linkend="G-URI-PARAMS-CASE-INSENSITIVE:CAPS"><literal>G_URI_PARAMS_CASE_INSENSITIVE</literal></link> is passed to <parameter>flags</parameter>
, attributes will be
compared case-insensitively, so a params string <literal>attr=123&amp;amp;Attr=456</literal> will only
return a single attribute–value pair, <literal>Attr=456</literal>. Case will be preserved in
the returned attributes.</para>
<para>If <parameter>params</parameter>
 cannot be parsed (for example, it contains two <parameter>separators</parameter>

characters in a row), then <parameter>error</parameter>
 is set and <link linkend="NULL:CAPS"><literal>NULL</literal></link> is returned.</para>
<refsect3 id="g-uri-parse-params.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>params</para></entry>
<entry role="parameter_description"><para>a <literal>%</literal>-encoded string containing <literal>attribute=value</literal>
parameters</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>length</para></entry>
<entry role="parameter_description"><para>the length of <parameter>params</parameter>
, or <literal>-1</literal> if it is nul-terminated</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>separators</para></entry>
<entry role="parameter_description"><para>the separator byte character set between parameters. (usually
<literal>&amp;amp;</literal>, but sometimes <literal>;</literal> or both <literal>&amp;amp;;</literal>). Note that this function works on
bytes not characters, so it can't be used to delimit UTF-8 strings for
anything but ASCII characters. You may pass an empty set, in which case
no splitting will occur.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>flags</para></entry>
<entry role="parameter_description"><para>flags to modify the way the parameters are handled.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para><link linkend="GError"><type>GError</type></link> for error reporting, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to ignore.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-parse-params.returns" role="returns">
<title>Returns</title>
<para>A hash table of attribute/value pairs, with both names and values
fully-decoded; or <link linkend="NULL:CAPS"><literal>NULL</literal></link> on error. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>][<acronym>element-type</acronym> utf8 utf8]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-escape-string" role="function" condition="since:2.16">
<title>g_uri_escape_string&#160;()</title>
<indexterm zone="g-uri-escape-string" role="2.16"><primary sortas="uri_escape_string">g_uri_escape_string</primary></indexterm>
<programlisting language="C"><link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
g_uri_escape_string (<parameter>const <link linkend="char"><type>char</type></link> *unescaped</parameter>,
                     <parameter>const <link linkend="char"><type>char</type></link> *reserved_chars_allowed</parameter>,
                     <parameter><link linkend="gboolean"><type>gboolean</type></link> allow_utf8</parameter>);</programlisting>
<para>Escapes a string for use in a URI.</para>
<para>Normally all characters that are not "unreserved" (i.e. ASCII
alphanumerical characters plus dash, dot, underscore and tilde) are
escaped. But if you specify characters in <parameter>reserved_chars_allowed</parameter>

they are not escaped. This is useful for the "reserved" characters
in the URI specification, since those are allowed unescaped in some
portions of a URI.</para>
<refsect3 id="g-uri-escape-string.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>unescaped</para></entry>
<entry role="parameter_description"><para>the unescaped input string.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>reserved_chars_allowed</para></entry>
<entry role="parameter_description"><para>a string of reserved
characters that are allowed to be used, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>allow_utf8</para></entry>
<entry role="parameter_description"><para><link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the result can include UTF-8 characters.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-escape-string.returns" role="returns">
<title>Returns</title>
<para>an escaped version of <parameter>unescaped</parameter>
. The
returned string should be freed when no longer needed. </para>
<para><emphasis role="annotation">[<acronym>not nullable</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.16">2.16</link></para></refsect2>
<refsect2 id="g-uri-unescape-string" role="function" condition="since:2.16">
<title>g_uri_unescape_string&#160;()</title>
<indexterm zone="g-uri-unescape-string" role="2.16"><primary sortas="uri_unescape_string">g_uri_unescape_string</primary></indexterm>
<programlisting language="C"><link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
g_uri_unescape_string (<parameter>const <link linkend="char"><type>char</type></link> *escaped_string</parameter>,
                       <parameter>const <link linkend="char"><type>char</type></link> *illegal_characters</parameter>);</programlisting>
<para>Unescapes a whole escaped string.</para>
<para>If any of the characters in <parameter>illegal_characters</parameter>
 or the NUL
character appears as an escaped character in <parameter>escaped_string</parameter>
, then
that is an error and <link linkend="NULL:CAPS"><literal>NULL</literal></link> will be returned. This is useful if you
want to avoid for instance having a slash being expanded in an
escaped path element, which might confuse pathname handling.</para>
<refsect3 id="g-uri-unescape-string.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>escaped_string</para></entry>
<entry role="parameter_description"><para>an escaped string to be unescaped.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>illegal_characters</para></entry>
<entry role="parameter_description"><para>a string of illegal characters
not to be allowed, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-unescape-string.returns" role="returns">
<title>Returns</title>
<para>an unescaped version of <parameter>escaped_string</parameter>
.
The returned string should be freed when no longer needed. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.16">2.16</link></para></refsect2>
<refsect2 id="g-uri-escape-bytes" role="function" condition="since:2.66">
<title>g_uri_escape_bytes&#160;()</title>
<indexterm zone="g-uri-escape-bytes" role="2.66"><primary sortas="uri_escape_bytes">g_uri_escape_bytes</primary></indexterm>
<programlisting language="C"><link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
g_uri_escape_bytes (<parameter>const <link linkend="guint8"><type>guint8</type></link> *unescaped</parameter>,
                    <parameter><link linkend="gsize"><type>gsize</type></link> length</parameter>,
                    <parameter>const <link linkend="char"><type>char</type></link> *reserved_chars_allowed</parameter>);</programlisting>
<para>Escapes arbitrary data for use in a URI.</para>
<para>Normally all characters that are not ‘unreserved’ (i.e. ASCII
alphanumerical characters plus dash, dot, underscore and tilde) are
escaped. But if you specify characters in <parameter>reserved_chars_allowed</parameter>

they are not escaped. This is useful for the ‘reserved’ characters
in the URI specification, since those are allowed unescaped in some
portions of a URI.</para>
<para>Though technically incorrect, this will also allow escaping nul
bytes as `%`<literal>00</literal>.</para>
<refsect3 id="g-uri-escape-bytes.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>unescaped</para></entry>
<entry role="parameter_description"><para>the unescaped input data. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>array</acronym> length=length]</emphasis></entry></row>
<row><entry role="parameter_name"><para>length</para></entry>
<entry role="parameter_description"><para>the length of <parameter>unescaped</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>reserved_chars_allowed</para></entry>
<entry role="parameter_description"><para>a string of reserved
characters that are allowed to be used, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-escape-bytes.returns" role="returns">
<title>Returns</title>
<para>an escaped version of <parameter>unescaped</parameter>
.
The returned string should be freed when no longer needed. </para>
<para><emphasis role="annotation">[<acronym>not nullable</acronym>][<acronym>transfer full</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-unescape-bytes" role="function" condition="since:2.66">
<title>g_uri_unescape_bytes&#160;()</title>
<indexterm zone="g-uri-unescape-bytes" role="2.66"><primary sortas="uri_unescape_bytes">g_uri_unescape_bytes</primary></indexterm>
<programlisting language="C"><link linkend="GBytes"><returnvalue>GBytes</returnvalue></link>&#160;*
g_uri_unescape_bytes (<parameter>const <link linkend="char"><type>char</type></link> *escaped_string</parameter>,
                      <parameter><link linkend="gssize"><type>gssize</type></link> length</parameter>,
                      <parameter>const <link linkend="char"><type>char</type></link> *illegal_characters</parameter>,
                      <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Unescapes a segment of an escaped string as binary data.</para>
<para>Note that in contrast to <link linkend="g-uri-unescape-string"><function>g_uri_unescape_string()</function></link>, this does allow
nul bytes to appear in the output.</para>
<para>If any of the characters in <parameter>illegal_characters</parameter>
 appears as an escaped
character in <parameter>escaped_string</parameter>
, then that is an error and <link linkend="NULL:CAPS"><literal>NULL</literal></link> will be
returned. This is useful if you want to avoid for instance having a slash
being expanded in an escaped path element, which might confuse pathname
handling.</para>
<refsect3 id="g-uri-unescape-bytes.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>escaped_string</para></entry>
<entry role="parameter_description"><para>A URI-escaped string</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>length</para></entry>
<entry role="parameter_description"><para>the length (in bytes) of <parameter>escaped_string</parameter>
to escape, or <literal>-1</literal> if it
is nul-terminated.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>illegal_characters</para></entry>
<entry role="parameter_description"><para>a string of illegal characters
not to be allowed, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para><link linkend="GError"><type>GError</type></link> for error reporting, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to ignore.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-unescape-bytes.returns" role="returns">
<title>Returns</title>
<para>an unescaped version of <parameter>escaped_string</parameter>
or <link linkend="NULL:CAPS"><literal>NULL</literal></link> on error (if decoding failed, using <link linkend="G-URI-ERROR-FAILED:CAPS"><literal>G_URI_ERROR_FAILED</literal></link> error
code). The returned <link linkend="GBytes"><type>GBytes</type></link> should be unreffed when no longer needed. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="g-uri-unescape-segment" role="function" condition="since:2.16">
<title>g_uri_unescape_segment&#160;()</title>
<indexterm zone="g-uri-unescape-segment" role="2.16"><primary sortas="uri_unescape_segment">g_uri_unescape_segment</primary></indexterm>
<programlisting language="C"><link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
g_uri_unescape_segment (<parameter>const <link linkend="char"><type>char</type></link> *escaped_string</parameter>,
                        <parameter>const <link linkend="char"><type>char</type></link> *escaped_string_end</parameter>,
                        <parameter>const <link linkend="char"><type>char</type></link> *illegal_characters</parameter>);</programlisting>
<para>Unescapes a segment of an escaped string.</para>
<para>If any of the characters in <parameter>illegal_characters</parameter>
 or the NUL
character appears as an escaped character in <parameter>escaped_string</parameter>
, then
that is an error and <link linkend="NULL:CAPS"><literal>NULL</literal></link> will be returned. This is useful if you
want to avoid for instance having a slash being expanded in an
escaped path element, which might confuse pathname handling.</para>
<para>Note: <literal>NUL</literal> byte is not accepted in the output, in contrast to
<link linkend="g-uri-unescape-bytes"><function>g_uri_unescape_bytes()</function></link>.</para>
<refsect3 id="g-uri-unescape-segment.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>escaped_string</para></entry>
<entry role="parameter_description"><para>A string, may be <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>escaped_string_end</para></entry>
<entry role="parameter_description"><para>Pointer to end of <parameter>escaped_string</parameter>
,
may be <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>illegal_characters</para></entry>
<entry role="parameter_description"><para>An optional string of illegal
characters not to be allowed, may be <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-unescape-segment.returns" role="returns">
<title>Returns</title>
<para>an unescaped version of <parameter>escaped_string</parameter>
,
or <link linkend="NULL:CAPS"><literal>NULL</literal></link> on error. The returned string should be freed when no longer
needed.  As a special case if <link linkend="NULL:CAPS"><literal>NULL</literal></link> is given for <parameter>escaped_string</parameter>
, this
function will return <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.16">2.16</link></para></refsect2>
<refsect2 id="g-uri-list-extract-uris" role="function" condition="since:2.6">
<title>g_uri_list_extract_uris&#160;()</title>
<indexterm zone="g-uri-list-extract-uris" role="2.6"><primary sortas="uri_list_extract_uris">g_uri_list_extract_uris</primary></indexterm>
<programlisting language="C"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;**
g_uri_list_extract_uris (<parameter>const <link linkend="gchar"><type>gchar</type></link> *uri_list</parameter>);</programlisting>
<para>Splits an URI list conforming to the text/uri-list
mime type defined in RFC 2483 into individual URIs,
discarding any comments. The URIs are not validated.</para>
<refsect3 id="g-uri-list-extract-uris.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>uri_list</para></entry>
<entry role="parameter_description"><para>an URI list </para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-uri-list-extract-uris.returns" role="returns">
<title>Returns</title>
<para>a newly allocated <link linkend="NULL:CAPS"><literal>NULL</literal></link>-terminated list
of strings holding the individual URIs. The array should be freed
with <link linkend="g-strfreev"><function>g_strfreev()</function></link>. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-filename-from-uri" role="function">
<title>g_filename_from_uri&#160;()</title>
<indexterm zone="g-filename-from-uri"><primary sortas="filename_from_uri">g_filename_from_uri</primary></indexterm>
<programlisting language="C"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
g_filename_from_uri (<parameter>const <link linkend="gchar"><type>gchar</type></link> *uri</parameter>,
                     <parameter><link linkend="gchar"><type>gchar</type></link> **hostname</parameter>,
                     <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Converts an escaped ASCII-encoded URI to a local filename in the
encoding used for filenames.</para>
<refsect3 id="g-filename-from-uri.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>uri</para></entry>
<entry role="parameter_description"><para>a uri describing a filename (escaped, encoded in ASCII).</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>hostname</para></entry>
<entry role="parameter_description"><para>Location to store hostname for the URI.
If there is no hostname in the URI, <link linkend="NULL:CAPS"><literal>NULL</literal></link> will be
stored in this location. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>optional</acronym>][<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>location to store the error occurring, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to ignore
errors. Any of the errors in <link linkend="GConvertError"><type>GConvertError</type></link> may occur.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-filename-from-uri.returns" role="returns">
<title>Returns</title>
<para>a newly-allocated string holding
the resulting filename, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> on an error. </para>
<para><emphasis role="annotation">[<acronym>type</acronym> filename]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="g-filename-to-uri" role="function">
<title>g_filename_to_uri&#160;()</title>
<indexterm zone="g-filename-to-uri"><primary sortas="filename_to_uri">g_filename_to_uri</primary></indexterm>
<programlisting language="C"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
g_filename_to_uri (<parameter>const <link linkend="gchar"><type>gchar</type></link> *filename</parameter>,
                   <parameter>const <link linkend="gchar"><type>gchar</type></link> *hostname</parameter>,
                   <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Converts an absolute filename to an escaped ASCII-encoded URI, with the path
component following Section 3.3. of RFC 2396.</para>
<refsect3 id="g-filename-to-uri.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>filename</para></entry>
<entry role="parameter_description"><para>an absolute filename specified in the GLib file
name encoding, which is the on-disk file name bytes on Unix, and UTF-8
on Windows. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>type</acronym> filename]</emphasis></entry></row>
<row><entry role="parameter_name"><para>hostname</para></entry>
<entry role="parameter_description"><para>A UTF-8 encoded hostname, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> for none. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>location to store the error occurring, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to ignore
errors. Any of the errors in <link linkend="GConvertError"><type>GConvertError</type></link> may occur.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-filename-to-uri.returns" role="returns">
<title>Returns</title>
<para> a newly-allocated string holding the resulting
URI, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> on an error.</para>
</refsect3></refsect2>

</refsect1>
<refsect1 id="glib-URI-Functions.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GUri" role="struct" condition="since:2.66">
<title>GUri</title>
<indexterm zone="GUri" role="2.66"><primary sortas="Uri">GUri</primary></indexterm>
<programlisting language="C">typedef struct _GUri GUri;</programlisting>
<para>A parsed absolute URI.</para>
<para>Since <link linkend="GUri"><type>GUri</type></link> only represents absolute URIs, all <link linkend="GUris"><type>GUris</type></link> will have a
URI scheme, so <link linkend="g-uri-get-scheme"><function>g_uri_get_scheme()</function></link> will always return a non-<link linkend="NULL:CAPS"><literal>NULL</literal></link>
answer. Likewise, by definition, all URIs have a path component, so
<link linkend="g-uri-get-path"><function>g_uri_get_path()</function></link> will always return a non-<link linkend="NULL:CAPS"><literal>NULL</literal></link> string (which may be empty).</para>
<para>If the URI string has an
<ulink url="https://tools.ietf.org/html/rfc3986#section-3">‘authority’ component</ulink> (that
is, if the scheme is followed by <literal>://</literal> rather than just <literal>:</literal>), then the
<link linkend="GUri"><type>GUri</type></link> will contain a hostname, and possibly a port and ‘userinfo’.
Additionally, depending on how the <link linkend="GUri"><type>GUri</type></link> was constructed/parsed (for example,
using the <link linkend="G-URI-FLAGS-HAS-PASSWORD:CAPS"><literal>G_URI_FLAGS_HAS_PASSWORD</literal></link> and <link linkend="G-URI-FLAGS-HAS-AUTH-PARAMS:CAPS"><literal>G_URI_FLAGS_HAS_AUTH_PARAMS</literal></link> flags),
the userinfo may be split out into a username, password, and
additional authorization-related parameters.</para>
<para>Normally, the components of a <link linkend="GUri"><type>GUri</type></link> will have all <literal>%</literal>-encoded
characters decoded. However, if you construct/parse a <link linkend="GUri"><type>GUri</type></link> with
<link linkend="G-URI-FLAGS-ENCODED:CAPS"><literal>G_URI_FLAGS_ENCODED</literal></link>, then the <literal>%</literal>-encoding will be preserved instead in
the userinfo, path, and query fields (and in the host field if also
created with <link linkend="G-URI-FLAGS-NON-DNS:CAPS"><literal>G_URI_FLAGS_NON_DNS</literal></link>). In particular, this is necessary if
the URI may contain binary data or non-UTF-8 text, or if decoding
the components might change the interpretation of the URI.</para>
<para>For example, with the encoded flag:</para>
<informalexample><programlisting role="example"><![CDATA[
  g_autoptr(GUri) uri = g_uri_parse ("http://host/path?query=http%3A%2F%2Fhost%2Fpath%3Fparam%3Dvalue", G_URI_FLAGS_ENCODED, &err);
  g_assert_cmpstr (g_uri_get_query (uri), ==, "query=http%3A%2F%2Fhost%2Fpath%3Fparam%3Dvalue");
]]></programlisting></informalexample>
<para></para>
<para>While the default <literal>%</literal>-decoding behaviour would give:</para>
<informalexample><programlisting role="example"><![CDATA[
  g_autoptr(GUri) uri = g_uri_parse ("http://host/path?query=http%3A%2F%2Fhost%2Fpath%3Fparam%3Dvalue", G_URI_FLAGS_NONE, &err);
  g_assert_cmpstr (g_uri_get_query (uri), ==, "query=http://host/path?param=value");
]]></programlisting></informalexample>
<para></para>
<para>During decoding, if an invalid UTF-8 string is encountered, parsing will fail
with an error indicating the bad string location:</para>
<informalexample><programlisting role="example"><![CDATA[
  g_autoptr(GUri) uri = g_uri_parse ("http://host/path?query=http%3A%2F%2Fhost%2Fpath%3Fbad%3D%00alue", G_URI_FLAGS_NONE, &err);
  g_assert_error (err, G_URI_ERROR, G_URI_ERROR_BAD_QUERY);
]]></programlisting></informalexample>
<para></para>
<para>You should pass <link linkend="G-URI-FLAGS-ENCODED:CAPS"><literal>G_URI_FLAGS_ENCODED</literal></link> or <link linkend="G-URI-FLAGS-ENCODED-QUERY:CAPS"><literal>G_URI_FLAGS_ENCODED_QUERY</literal></link> if you
need to handle that case manually. In particular, if the query string
contains <literal>=</literal> characters that are <literal>%</literal>-encoded, you should let
<link linkend="g-uri-parse-params"><function>g_uri_parse_params()</function></link> do the decoding once of the query.</para>
<para><link linkend="GUri"><type>GUri</type></link> is immutable once constructed, and can safely be accessed from
multiple threads. Its reference counting is atomic.</para>
<para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="GUriFlags" role="enum" condition="since:2.66">
<title>enum GUriFlags</title>
<indexterm zone="GUriFlags" role="2.66"><primary sortas="UriFlags">GUriFlags</primary></indexterm>
<para>Flags that describe a URI.</para>
<para>When parsing a URI, if you need to choose different flags based on
the type of URI, you can use <link linkend="g-uri-peek-scheme"><function>g_uri_peek_scheme()</function></link> on the URI string
to check the scheme first, and use that to decide what flags to
parse it with.</para>
<refsect3 id="GUriFlags.members" role="enum_members">
<title>Members</title>
<informaltable role="enum_members_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="enum_members_name" colwidth="300px"/>
<colspec colname="enum_members_description"/>
<colspec colname="enum_members_annotations" colwidth="200px"/>
<tbody>
<row role="constant"><entry role="enum_member_name"><para id="G-URI-FLAGS-NONE:CAPS">G_URI_FLAGS_NONE</para></entry>
<entry role="enum_member_description"><para>No flags set.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-URI-FLAGS-PARSE-RELAXED:CAPS">G_URI_FLAGS_PARSE_RELAXED</para></entry>
<entry role="enum_member_description"><para>Parse the URI more relaxedly than the
<ulink url="https://tools.ietf.org/html/rfc3986">RFC 3986</ulink> grammar specifies,
fixing up or ignoring common mistakes in URIs coming from external
sources. This is also needed for some obscure URI schemes where <literal>;</literal>
separates the host from the path. Don’t use this flag unless you need to.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-URI-FLAGS-HAS-PASSWORD:CAPS">G_URI_FLAGS_HAS_PASSWORD</para></entry>
<entry role="enum_member_description"><para>The userinfo field may contain a password,
which will be separated from the username by <literal>:</literal>.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-URI-FLAGS-HAS-AUTH-PARAMS:CAPS">G_URI_FLAGS_HAS_AUTH_PARAMS</para></entry>
<entry role="enum_member_description"><para>The userinfo may contain additional
authentication-related parameters, which will be separated from
the username and/or password by <literal>;</literal>.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-URI-FLAGS-ENCODED:CAPS">G_URI_FLAGS_ENCODED</para></entry>
<entry role="enum_member_description"><para>When parsing a URI, this indicates that <literal>%</literal>-encoded
characters in the userinfo, path, query, and fragment fields
should not be decoded. (And likewise the host field if
<link linkend="G-URI-FLAGS-NON-DNS:CAPS"><literal>G_URI_FLAGS_NON_DNS</literal></link> is also set.) When building a URI, it indicates
that you have already <literal>%</literal>-encoded the components, and so <link linkend="GUri"><type>GUri</type></link>
should not do any encoding itself.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-URI-FLAGS-NON-DNS:CAPS">G_URI_FLAGS_NON_DNS</para></entry>
<entry role="enum_member_description"><para>The host component should not be assumed to be a
DNS hostname or IP address (for example, for <literal>smb</literal> URIs with NetBIOS
hostnames).</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-URI-FLAGS-ENCODED-QUERY:CAPS">G_URI_FLAGS_ENCODED_QUERY</para></entry>
<entry role="enum_member_description"><para>Same as <link linkend="G-URI-FLAGS-ENCODED:CAPS"><literal>G_URI_FLAGS_ENCODED</literal></link>, for the query
field only.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-URI-FLAGS-ENCODED-PATH:CAPS">G_URI_FLAGS_ENCODED_PATH</para></entry>
<entry role="enum_member_description"><para>Same as <link linkend="G-URI-FLAGS-ENCODED:CAPS"><literal>G_URI_FLAGS_ENCODED</literal></link>, for the path only.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-URI-FLAGS-ENCODED-FRAGMENT:CAPS">G_URI_FLAGS_ENCODED_FRAGMENT</para></entry>
<entry role="enum_member_description"><para>Same as <link linkend="G-URI-FLAGS-ENCODED:CAPS"><literal>G_URI_FLAGS_ENCODED</literal></link>, for the
fragment only.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="GUriHideFlags" role="enum" condition="since:2.66">
<title>enum GUriHideFlags</title>
<indexterm zone="GUriHideFlags" role="2.66"><primary sortas="UriHideFlags">GUriHideFlags</primary></indexterm>
<para>Flags describing what parts of the URI to hide in
<link linkend="g-uri-to-string-partial"><function>g_uri_to_string_partial()</function></link>. Note that <link linkend="G-URI-HIDE-PASSWORD:CAPS"><literal>G_URI_HIDE_PASSWORD</literal></link> and
<link linkend="G-URI-HIDE-AUTH-PARAMS:CAPS"><literal>G_URI_HIDE_AUTH_PARAMS</literal></link> will only work if the <link linkend="GUri"><type>GUri</type></link> was parsed with
the corresponding flags.</para>
<refsect3 id="GUriHideFlags.members" role="enum_members">
<title>Members</title>
<informaltable role="enum_members_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="enum_members_name" colwidth="300px"/>
<colspec colname="enum_members_description"/>
<colspec colname="enum_members_annotations" colwidth="200px"/>
<tbody>
<row role="constant"><entry role="enum_member_name"><para id="G-URI-HIDE-NONE:CAPS">G_URI_HIDE_NONE</para></entry>
<entry role="enum_member_description"><para>No flags set.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-URI-HIDE-USERINFO:CAPS">G_URI_HIDE_USERINFO</para></entry>
<entry role="enum_member_description"><para>Hide the userinfo.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-URI-HIDE-PASSWORD:CAPS">G_URI_HIDE_PASSWORD</para></entry>
<entry role="enum_member_description"><para>Hide the password.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-URI-HIDE-AUTH-PARAMS:CAPS">G_URI_HIDE_AUTH_PARAMS</para></entry>
<entry role="enum_member_description"><para>Hide the auth_params.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-URI-HIDE-QUERY:CAPS">G_URI_HIDE_QUERY</para></entry>
<entry role="enum_member_description"><para>Hide the query.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-URI-HIDE-FRAGMENT:CAPS">G_URI_HIDE_FRAGMENT</para></entry>
<entry role="enum_member_description"><para>Hide the fragment.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="GUriParamsIter" role="struct" condition="since:2.66">
<title>struct GUriParamsIter</title>
<indexterm zone="GUriParamsIter" role="2.66"><primary sortas="UriParamsIter">GUriParamsIter</primary></indexterm>
<programlisting language="C">struct GUriParamsIter {
};
</programlisting>
<para>Many URI schemes include one or more attribute/value pairs as part of the URI
value. For example <literal>scheme://server/path?query=string&amp;amp;is=there</literal> has two
attributes – <literal>query=string</literal> and <literal>is=there</literal> – in its query part.</para>
<para>A <link linkend="GUriParamsIter"><type>GUriParamsIter</type></link> structure represents an iterator that can be used to
iterate over the attribute/value pairs of a URI query string. <link linkend="GUriParamsIter"><type>GUriParamsIter</type></link>
structures are typically allocated on the stack and then initialized with
<link linkend="g-uri-params-iter-init"><function>g_uri_params_iter_init()</function></link>. See the documentation for <link linkend="g-uri-params-iter-init"><function>g_uri_params_iter_init()</function></link>
for a usage example.</para>
<para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="GUriParamsFlags" role="enum" condition="since:2.66">
<title>enum GUriParamsFlags</title>
<indexterm zone="GUriParamsFlags" role="2.66"><primary sortas="UriParamsFlags">GUriParamsFlags</primary></indexterm>
<para>Flags modifying the way parameters are handled by <link linkend="g-uri-parse-params"><function>g_uri_parse_params()</function></link> and
<link linkend="GUriParamsIter"><type>GUriParamsIter</type></link>.</para>
<refsect3 id="GUriParamsFlags.members" role="enum_members">
<title>Members</title>
<informaltable role="enum_members_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="enum_members_name" colwidth="300px"/>
<colspec colname="enum_members_description"/>
<colspec colname="enum_members_annotations" colwidth="200px"/>
<tbody>
<row role="constant"><entry role="enum_member_name"><para id="G-URI-PARAMS-NONE:CAPS">G_URI_PARAMS_NONE</para></entry>
<entry role="enum_member_description"><para>No flags set.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-URI-PARAMS-CASE-INSENSITIVE:CAPS">G_URI_PARAMS_CASE_INSENSITIVE</para></entry>
<entry role="enum_member_description"><para>Parameter names are case insensitive.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-URI-PARAMS-WWW-FORM:CAPS">G_URI_PARAMS_WWW_FORM</para></entry>
<entry role="enum_member_description"><para>Replace <literal>+</literal> with space character. Only useful for
URLs on the web, using the <literal>https</literal> or <literal>http</literal> schemas.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-URI-PARAMS-PARSE-RELAXED:CAPS">G_URI_PARAMS_PARSE_RELAXED</para></entry>
<entry role="enum_member_description"><para>See <link linkend="G-URI-FLAGS-PARSE-RELAXED:CAPS"><literal>G_URI_FLAGS_PARSE_RELAXED</literal></link>.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="G-URI-RESERVED-CHARS-ALLOWED-IN-PATH:CAPS" role="macro" condition="since:2.16">
<title>G_URI_RESERVED_CHARS_ALLOWED_IN_PATH</title>
<indexterm zone="G-URI-RESERVED-CHARS-ALLOWED-IN-PATH:CAPS" role="2.16"><primary sortas="URI_RESERVED_CHARS_ALLOWED_IN_PATH">G_URI_RESERVED_CHARS_ALLOWED_IN_PATH</primary></indexterm>
<programlisting language="C">#define G_URI_RESERVED_CHARS_ALLOWED_IN_PATH G_URI_RESERVED_CHARS_ALLOWED_IN_PATH_ELEMENT "/"
</programlisting>
<para>Allowed characters in a path. Includes <literal>!$&amp;amp;'()*+,;=:@/</literal>.</para>
<para role="since">Since: <link linkend="api-index-2.16">2.16</link></para></refsect2>
<refsect2 id="G-URI-RESERVED-CHARS-ALLOWED-IN-PATH-ELEMENT:CAPS" role="macro" condition="since:2.16">
<title>G_URI_RESERVED_CHARS_ALLOWED_IN_PATH_ELEMENT</title>
<indexterm zone="G-URI-RESERVED-CHARS-ALLOWED-IN-PATH-ELEMENT:CAPS" role="2.16"><primary sortas="URI_RESERVED_CHARS_ALLOWED_IN_PATH_ELEMENT">G_URI_RESERVED_CHARS_ALLOWED_IN_PATH_ELEMENT</primary></indexterm>
<programlisting language="C">#define G_URI_RESERVED_CHARS_ALLOWED_IN_PATH_ELEMENT G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS ":@"
</programlisting>
<para>Allowed characters in path elements. Includes <literal>!$&amp;amp;'()*+,;=:@</literal>.</para>
<para role="since">Since: <link linkend="api-index-2.16">2.16</link></para></refsect2>
<refsect2 id="G-URI-RESERVED-CHARS-ALLOWED-IN-USERINFO:CAPS" role="macro" condition="since:2.16">
<title>G_URI_RESERVED_CHARS_ALLOWED_IN_USERINFO</title>
<indexterm zone="G-URI-RESERVED-CHARS-ALLOWED-IN-USERINFO:CAPS" role="2.16"><primary sortas="URI_RESERVED_CHARS_ALLOWED_IN_USERINFO">G_URI_RESERVED_CHARS_ALLOWED_IN_USERINFO</primary></indexterm>
<programlisting language="C">#define G_URI_RESERVED_CHARS_ALLOWED_IN_USERINFO G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS ":"
</programlisting>
<para>Allowed characters in userinfo as defined in
<ulink url="https://tools.ietf.org/html/rfc3986">RFC 3986</ulink>. Includes <literal>!$&amp;amp;'()*+,;=:</literal>.</para>
<para role="since">Since: <link linkend="api-index-2.16">2.16</link></para></refsect2>
<refsect2 id="G-URI-RESERVED-CHARS-GENERIC-DELIMITERS:CAPS" role="macro" condition="since:2.16">
<title>G_URI_RESERVED_CHARS_GENERIC_DELIMITERS</title>
<indexterm zone="G-URI-RESERVED-CHARS-GENERIC-DELIMITERS:CAPS" role="2.16"><primary sortas="URI_RESERVED_CHARS_GENERIC_DELIMITERS">G_URI_RESERVED_CHARS_GENERIC_DELIMITERS</primary></indexterm>
<programlisting language="C">#define G_URI_RESERVED_CHARS_GENERIC_DELIMITERS ":/?#[]@"
</programlisting>
<para>Generic delimiters characters as defined in
<ulink url="https://tools.ietf.org/html/rfc3986">RFC 3986</ulink>. Includes <literal>:/?#[]@</literal>.</para>
<para role="since">Since: <link linkend="api-index-2.16">2.16</link></para></refsect2>
<refsect2 id="G-URI-RESERVED-CHARS-SUBCOMPONENT-DELIMITERS:CAPS" role="macro" condition="since:2.16">
<title>G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS</title>
<indexterm zone="G-URI-RESERVED-CHARS-SUBCOMPONENT-DELIMITERS:CAPS" role="2.16"><primary sortas="URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS">G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS</primary></indexterm>
<programlisting language="C">#define G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS "!$&amp;'()*+,;="
</programlisting>
<para>Subcomponent delimiter characters as defined in
<ulink url="https://tools.ietf.org/html/rfc3986">RFC 3986</ulink>. Includes <literal>!$&amp;amp;'()*+,;=</literal>.</para>
<para role="since">Since: <link linkend="api-index-2.16">2.16</link></para></refsect2>
<refsect2 id="G-URI-ERROR:CAPS" role="macro" condition="since:2.66">
<title>G_URI_ERROR</title>
<indexterm zone="G-URI-ERROR:CAPS" role="2.66"><primary sortas="URI_ERROR">G_URI_ERROR</primary></indexterm>
<programlisting language="C">#define G_URI_ERROR (g_uri_error_quark ()) GLIB_AVAILABLE_MACRO_IN_2_66
</programlisting>
<para>Error domain for URI methods. Errors in this domain will be from
the <link linkend="GUriError"><type>GUriError</type></link> enumeration. See <link linkend="GError"><type>GError</type></link> for information on error
domains.</para>
<para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>
<refsect2 id="GUriError" role="enum" condition="since:2.66">
<title>enum GUriError</title>
<indexterm zone="GUriError" role="2.66"><primary sortas="UriError">GUriError</primary></indexterm>
<para>Error codes returned by <link linkend="GUri"><type>GUri</type></link> methods.</para>
<refsect3 id="GUriError.members" role="enum_members">
<title>Members</title>
<informaltable role="enum_members_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="enum_members_name" colwidth="300px"/>
<colspec colname="enum_members_description"/>
<colspec colname="enum_members_annotations" colwidth="200px"/>
<tbody>
<row role="constant"><entry role="enum_member_name"><para id="G-URI-ERROR-FAILED:CAPS">G_URI_ERROR_FAILED</para></entry>
<entry role="enum_member_description"><para>Generic error if no more specific error is available.
See the error message for details.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-URI-ERROR-BAD-SCHEME:CAPS">G_URI_ERROR_BAD_SCHEME</para></entry>
<entry role="enum_member_description"><para>The scheme of a URI could not be parsed.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-URI-ERROR-BAD-USER:CAPS">G_URI_ERROR_BAD_USER</para></entry>
<entry role="enum_member_description"><para>The user/userinfo of a URI could not be parsed.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-URI-ERROR-BAD-PASSWORD:CAPS">G_URI_ERROR_BAD_PASSWORD</para></entry>
<entry role="enum_member_description"><para>The password of a URI could not be parsed.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-URI-ERROR-BAD-AUTH-PARAMS:CAPS">G_URI_ERROR_BAD_AUTH_PARAMS</para></entry>
<entry role="enum_member_description"><para>The authentication parameters of a URI could not be parsed.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-URI-ERROR-BAD-HOST:CAPS">G_URI_ERROR_BAD_HOST</para></entry>
<entry role="enum_member_description"><para>The host of a URI could not be parsed.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-URI-ERROR-BAD-PORT:CAPS">G_URI_ERROR_BAD_PORT</para></entry>
<entry role="enum_member_description"><para>The port of a URI could not be parsed.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-URI-ERROR-BAD-PATH:CAPS">G_URI_ERROR_BAD_PATH</para></entry>
<entry role="enum_member_description"><para>The path of a URI could not be parsed.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-URI-ERROR-BAD-QUERY:CAPS">G_URI_ERROR_BAD_QUERY</para></entry>
<entry role="enum_member_description"><para>The query of a URI could not be parsed.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-URI-ERROR-BAD-FRAGMENT:CAPS">G_URI_ERROR_BAD_FRAGMENT</para></entry>
<entry role="enum_member_description"><para>The fragment of a URI could not be parsed.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-2.66">2.66</link></para></refsect2>

</refsect1>

</refentry>
