<refentry id="thunar-vfs-ThunarVfsPath">
<refmeta>
<refentrytitle>ThunarVfsPath</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>THUNAR-VFS Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>ThunarVfsPath</refname><refpurpose></refpurpose>
</refnamediv>

<refsynopsisdiv><title>Synopsis</title>

<synopsis>

#include &lt;thunar-vfs/thunar-vfs.h&gt;


            <link linkend="ThunarVfsPath">ThunarVfsPath</link>;
<link linkend="ThunarVfsPath">ThunarVfsPath</link>* <link linkend="thunar-vfs-path-new">thunar_vfs_path_new</link>          (const <link linkend="gchar">gchar</link> *identifier,
                                             <link linkend="GError">GError</link> **error);
<link linkend="ThunarVfsPath">ThunarVfsPath</link>* <link linkend="thunar-vfs-path-get-for-home">thunar_vfs_path_get_for_home</link> (void);
<link linkend="ThunarVfsPath">ThunarVfsPath</link>* <link linkend="thunar-vfs-path-get-for-root">thunar_vfs_path_get_for_root</link> (void);
<link linkend="ThunarVfsPath">ThunarVfsPath</link>* <link linkend="thunar-vfs-path-ref">thunar_vfs_path_ref</link>          (<link linkend="ThunarVfsPath">ThunarVfsPath</link> *path);
<link linkend="void">void</link>        <link linkend="thunar-vfs-path-unref">thunar_vfs_path_unref</link>           (<link linkend="ThunarVfsPath">ThunarVfsPath</link> *path);
<link linkend="guint">guint</link>       <link linkend="thunar-vfs-path-hash">thunar_vfs_path_hash</link>            (<link linkend="gconstpointer">gconstpointer</link> path_ptr);
<link linkend="gboolean">gboolean</link>    <link linkend="thunar-vfs-path-equal">thunar_vfs_path_equal</link>           (<link linkend="gconstpointer">gconstpointer</link> path_ptr_a,
                                             <link linkend="gconstpointer">gconstpointer</link> path_ptr_b);
<link linkend="gboolean">gboolean</link>    <link linkend="thunar-vfs-path-is-home">thunar_vfs_path_is_home</link>         (const <link linkend="ThunarVfsPath">ThunarVfsPath</link> *path);
<link linkend="gboolean">gboolean</link>    <link linkend="thunar-vfs-path-is-root">thunar_vfs_path_is_root</link>         (const <link linkend="ThunarVfsPath">ThunarVfsPath</link> *path);
<link linkend="ThunarVfsPath">ThunarVfsPath</link>* <link linkend="thunar-vfs-path-relative">thunar_vfs_path_relative</link>     (<link linkend="ThunarVfsPath">ThunarVfsPath</link> *parent,
                                             const <link linkend="gchar">gchar</link> *name);
const <link linkend="gchar">gchar</link>* <link linkend="thunar-vfs-path-get-name">thunar_vfs_path_get_name</link>       (const <link linkend="ThunarVfsPath">ThunarVfsPath</link> *path);
<link linkend="ThunarVfsPath">ThunarVfsPath</link>* <link linkend="thunar-vfs-path-get-parent">thunar_vfs_path_get_parent</link>   (const <link linkend="ThunarVfsPath">ThunarVfsPath</link> *path);
<link linkend="gchar">gchar</link>*      <link linkend="thunar-vfs-path-dup-string">thunar_vfs_path_dup_string</link>      (const <link linkend="ThunarVfsPath">ThunarVfsPath</link> *path);
<link linkend="gssize">gssize</link>      <link linkend="thunar-vfs-path-to-string">thunar_vfs_path_to_string</link>       (const <link linkend="ThunarVfsPath">ThunarVfsPath</link> *path,
                                             <link linkend="gchar">gchar</link> *buffer,
                                             <link linkend="gsize">gsize</link> bufsize,
                                             <link linkend="GError">GError</link> **error);
<link linkend="gchar">gchar</link>*      <link linkend="thunar-vfs-path-dup-uri">thunar_vfs_path_dup_uri</link>         (const <link linkend="ThunarVfsPath">ThunarVfsPath</link> *path);
<link linkend="gssize">gssize</link>      <link linkend="thunar-vfs-path-to-uri">thunar_vfs_path_to_uri</link>          (const <link linkend="ThunarVfsPath">ThunarVfsPath</link> *path,
                                             <link linkend="gchar">gchar</link> *buffer,
                                             <link linkend="gsize">gsize</link> bufsize,
                                             <link linkend="GError">GError</link> **error);
<link linkend="GList">GList</link>*      <link linkend="thunar-vfs-path-list-from-string">thunar_vfs_path_list_from_string</link>
                                            (const <link linkend="gchar">gchar</link> *uri_string,
                                             <link linkend="GError">GError</link> **error);
<link linkend="gchar">gchar</link>*      <link linkend="thunar-vfs-path-list-to-string">thunar_vfs_path_list_to_string</link>  (<link linkend="GList">GList</link> *path_list);
<link linkend="GList">GList</link>*      <link linkend="thunar-vfs-path-list-append">thunar_vfs_path_list_append</link>     (<link linkend="GList">GList</link> *path_list,
                                             <link linkend="ThunarVfsPath">ThunarVfsPath</link> *path);
<link linkend="GList">GList</link>*      <link linkend="thunar-vfs-path-list-prepend">thunar_vfs_path_list_prepend</link>    (<link linkend="GList">GList</link> *path_list,
                                             <link linkend="ThunarVfsPath">ThunarVfsPath</link> *path);
<link linkend="GList">GList</link>*      <link linkend="thunar-vfs-path-list-copy">thunar_vfs_path_list_copy</link>       (<link linkend="GList">GList</link> *path_list);
<link linkend="void">void</link>        <link linkend="thunar-vfs-path-list-free">thunar_vfs_path_list_free</link>       (<link linkend="GList">GList</link> *path_list);


</synopsis>
</refsynopsisdiv>









<refsect1>
<title>Description</title>
<para>

</para>
</refsect1>

<refsect1>
<title>Details</title>
<refsect2>
<title><anchor id="ThunarVfsPath"/>ThunarVfsPath</title>
<indexterm><primary>ThunarVfsPath</primary></indexterm><programlisting>typedef struct {
} ThunarVfsPath;
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="thunar-vfs-path-new"/>thunar_vfs_path_new ()</title>
<indexterm><primary>thunar_vfs_path_new</primary></indexterm><programlisting><link linkend="ThunarVfsPath">ThunarVfsPath</link>* thunar_vfs_path_new          (const <link linkend="gchar">gchar</link> *identifier,
                                             <link linkend="GError">GError</link> **error);</programlisting>
<para>
Returns a <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link> that represents the given
<parameter>identifier</parameter> or <literal>NULL</literal> on error. In the latter case
<parameter>error</parameter> will be set to point to an <link linkend="GError"><type>GError</type></link> describing
the problem.
</para>
<para>
The caller is responsible to free the returned
object using <link linkend="thunar-vfs-path-unref"><function>thunar_vfs_path_unref()</function></link> when no
longer needed.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>identifier</parameter>&nbsp;:</term>
<listitem><simpara> an URI identifier or an absolute path.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&nbsp;:</term>
<listitem><simpara> return location for errors or <literal>NULL</literal>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link> for <parameter>identifier</parameter>
              or <literal>NULL</literal> on error.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="thunar-vfs-path-get-for-home"/>thunar_vfs_path_get_for_home ()</title>
<indexterm><primary>thunar_vfs_path_get_for_home</primary></indexterm><programlisting><link linkend="ThunarVfsPath">ThunarVfsPath</link>* thunar_vfs_path_get_for_home (void);</programlisting>
<para>
Returns the <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link> that represents
the current users home directory.
</para>
<para>
The caller is responsible to free the
returned object using <link linkend="thunar-vfs-path-unref"><function>thunar_vfs_path_unref()</function></link>
when no longer needed.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link> for the 
              current users home directory.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="thunar-vfs-path-get-for-root"/>thunar_vfs_path_get_for_root ()</title>
<indexterm><primary>thunar_vfs_path_get_for_root</primary></indexterm><programlisting><link linkend="ThunarVfsPath">ThunarVfsPath</link>* thunar_vfs_path_get_for_root (void);</programlisting>
<para>
Returns the <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link> that represents the
file systems root directory.
</para>
<para>
The caller is responsible to free the returned
object using <link linkend="thunar-vfs-path-unref"><function>thunar_vfs_path_unref()</function></link> when no
longer needed.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link> for the file
              systems root directory.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="thunar-vfs-path-ref"/>thunar_vfs_path_ref ()</title>
<indexterm><primary>thunar_vfs_path_ref</primary></indexterm><programlisting><link linkend="ThunarVfsPath">ThunarVfsPath</link>* thunar_vfs_path_ref          (<link linkend="ThunarVfsPath">ThunarVfsPath</link> *path);</programlisting>
<para>
Increments the reference count on <parameter>path</parameter>
and returns a reference to <parameter>path</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>path</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a reference to <parameter>path</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="thunar-vfs-path-unref"/>thunar_vfs_path_unref ()</title>
<indexterm><primary>thunar_vfs_path_unref</primary></indexterm><programlisting><link linkend="void">void</link>        thunar_vfs_path_unref           (<link linkend="ThunarVfsPath">ThunarVfsPath</link> *path);</programlisting>
<para>
Decreases the reference count on <parameter>path</parameter> and
frees the resources allocated for <parameter>path</parameter>
once the reference count drops to zero.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>path</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="thunar-vfs-path-hash"/>thunar_vfs_path_hash ()</title>
<indexterm><primary>thunar_vfs_path_hash</primary></indexterm><programlisting><link linkend="guint">guint</link>       thunar_vfs_path_hash            (<link linkend="gconstpointer">gconstpointer</link> path_ptr);</programlisting>
<para>
Generates a hash value for the given <parameter>path_ptr</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>path_ptr</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the hash value for <parameter>path_ptr</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="thunar-vfs-path-equal"/>thunar_vfs_path_equal ()</title>
<indexterm><primary>thunar_vfs_path_equal</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    thunar_vfs_path_equal           (<link linkend="gconstpointer">gconstpointer</link> path_ptr_a,
                                             <link linkend="gconstpointer">gconstpointer</link> path_ptr_b);</programlisting>
<para>
Checks whether <parameter>path_ptr_a</parameter> and <parameter>path_ptr_b</parameter> refer
to the same local path.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>path_ptr_a</parameter>&nbsp;:</term>
<listitem><simpara> first <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>path_ptr_b</parameter>&nbsp;:</term>
<listitem><simpara> second <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <literal>TRUE</literal> if <parameter>path_ptr_a</parameter> and <parameter>path_ptr_b</parameter>
              are equal.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="thunar-vfs-path-is-home"/>thunar_vfs_path_is_home ()</title>
<indexterm><primary>thunar_vfs_path_is_home</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    thunar_vfs_path_is_home         (const <link linkend="ThunarVfsPath">ThunarVfsPath</link> *path);</programlisting>
<para>
Checks whether <parameter>path</parameter> refers to the users home
directory.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>path</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <literal>TRUE</literal> if <parameter>path</parameter> refers to the users
              home directory.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="thunar-vfs-path-is-root"/>thunar_vfs_path_is_root ()</title>
<indexterm><primary>thunar_vfs_path_is_root</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    thunar_vfs_path_is_root         (const <link linkend="ThunarVfsPath">ThunarVfsPath</link> *path);</programlisting>
<para>
Checks whether path refers to the root directory.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>path</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <literal>TRUE</literal> if <parameter>path</parameter> refers to the root
              directory.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="thunar-vfs-path-relative"/>thunar_vfs_path_relative ()</title>
<indexterm><primary>thunar_vfs_path_relative</primary></indexterm><programlisting><link linkend="ThunarVfsPath">ThunarVfsPath</link>* thunar_vfs_path_relative     (<link linkend="ThunarVfsPath">ThunarVfsPath</link> *parent,
                                             const <link linkend="gchar">gchar</link> *name);</programlisting>
<para>
Returns a <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link> for the file <parameter>name</parameter> relative to
<parameter>parent</parameter>. <parameter>name</parameter> must be a valid filename in the local file
system encoding and it may not contain any slashes.
</para>
<para>
The caller is responsible to free the returned object
using <link linkend="thunar-vfs-path-unref"><function>thunar_vfs_path_unref()</function></link> when no longer needed.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>parent</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter>&nbsp;:</term>
<listitem><simpara> a valid filename in the local file system encoding.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the path to <parameter>name</parameter> relative to <parameter>parent</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="thunar-vfs-path-get-name"/>thunar_vfs_path_get_name ()</title>
<indexterm><primary>thunar_vfs_path_get_name</primary></indexterm><programlisting>const <link linkend="gchar">gchar</link>* thunar_vfs_path_get_name       (const <link linkend="ThunarVfsPath">ThunarVfsPath</link> *path);</programlisting>
<para>
Returns the base name of the <parameter>path</parameter> in the local
file system encoding.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>path</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the base name of <parameter>path</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="thunar-vfs-path-get-parent"/>thunar_vfs_path_get_parent ()</title>
<indexterm><primary>thunar_vfs_path_get_parent</primary></indexterm><programlisting><link linkend="ThunarVfsPath">ThunarVfsPath</link>* thunar_vfs_path_get_parent   (const <link linkend="ThunarVfsPath">ThunarVfsPath</link> *path);</programlisting>
<para>
Returns the <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link> that refers to the parent
directory of <parameter>path</parameter> or <literal>NULL</literal> if <parameter>path</parameter> refers to the
root file system node.
</para>
<para>
No additional reference is taken on the parent, so
you'll need to call <link linkend="thunar-vfs-path-ref"><function>thunar_vfs_path_ref()</function></link> yourself
if you need to keep a reference.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>path</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the parent of <parameter>path</parameter> or <literal>NULL</literal>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="thunar-vfs-path-dup-string"/>thunar_vfs_path_dup_string ()</title>
<indexterm><primary>thunar_vfs_path_dup_string</primary></indexterm><programlisting><link linkend="gchar">gchar</link>*      thunar_vfs_path_dup_string      (const <link linkend="ThunarVfsPath">ThunarVfsPath</link> *path);</programlisting>
<para>
Like <link linkend="thunar-vfs-path-to-string"><function>thunar_vfs_path_to_string()</function></link>, this function transform
the <parameter>path</parameter> to its string representation, but unlike
<link linkend="thunar-vfs-path-to-string"><function>thunar_vfs_path_to_string()</function></link>, this function automatically
allocates the required amount of memory from the heap.
The returned string must be freed by the caller when
no longer needed.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>path</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the string representation of <parameter>path</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="thunar-vfs-path-to-string"/>thunar_vfs_path_to_string ()</title>
<indexterm><primary>thunar_vfs_path_to_string</primary></indexterm><programlisting><link linkend="gssize">gssize</link>      thunar_vfs_path_to_string       (const <link linkend="ThunarVfsPath">ThunarVfsPath</link> *path,
                                             <link linkend="gchar">gchar</link> *buffer,
                                             <link linkend="gsize">gsize</link> bufsize,
                                             <link linkend="GError">GError</link> **error);</programlisting>
<para>
Stores the <parameter>path</parameter> into the string pointed to by <parameter>buffer</parameter>,
so it can be used for system path operations. Returns
the number of bytes stored to <parameter>buffer</parameter> or a negative
value if <parameter>bufsize</parameter> is too small to store the whole <parameter>path</parameter>.
In the latter case <parameter>error</parameter> will be set to point to an
error describing the problem.
</para>
<para>
If <parameter>buffer</parameter> is allocated on the stack, it is suggested
to use <link linkend="THUNAR-VFS-PATH-MAXSTRLEN:CAPS"><type>THUNAR_VFS_PATH_MAXSTRLEN</type></link> for the buffer size
in most cases. The stack should never be used in recursive
functions; use <link linkend="thunar-vfs-path-dup-string"><function>thunar_vfs_path_dup_string()</function></link> instead there.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>path</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>buffer</parameter>&nbsp;:</term>
<listitem><simpara> the buffer to store the path string to.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>bufsize</parameter>&nbsp;:</term>
<listitem><simpara> the size of <parameter>buffer</parameter> in bytes.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&nbsp;:</term>
<listitem><simpara> return location for errors or <literal>NULL</literal>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the number of bytes (including the null
              byte) stored to <parameter>buffer</parameter> or a negative
              value if <parameter>buffer</parameter> cannot hold the whole
              <parameter>path</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="thunar-vfs-path-dup-uri"/>thunar_vfs_path_dup_uri ()</title>
<indexterm><primary>thunar_vfs_path_dup_uri</primary></indexterm><programlisting><link linkend="gchar">gchar</link>*      thunar_vfs_path_dup_uri         (const <link linkend="ThunarVfsPath">ThunarVfsPath</link> *path);</programlisting>
<para>
Similar to <link linkend="thunar-vfs-path-to-uri"><function>thunar_vfs_path_to_uri()</function></link>, but automatically
allocates memory on the heap instead of using a user
supplied buffer for the URI.
</para>
<para>
The caller is responsible to free the returned string
using <link linkend="g-free"><function>g_free()</function></link> when no longer needed.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>path</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the escaped URI for <parameter>path</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="thunar-vfs-path-to-uri"/>thunar_vfs_path_to_uri ()</title>
<indexterm><primary>thunar_vfs_path_to_uri</primary></indexterm><programlisting><link linkend="gssize">gssize</link>      thunar_vfs_path_to_uri          (const <link linkend="ThunarVfsPath">ThunarVfsPath</link> *path,
                                             <link linkend="gchar">gchar</link> *buffer,
                                             <link linkend="gsize">gsize</link> bufsize,
                                             <link linkend="GError">GError</link> **error);</programlisting>
<para>
Escapes <parameter>path</parameter> according to the rules of the file URI
specification and stores the escaped URI to <parameter>buffer</parameter>.
Returns the number of bytes stored to <parameter>buffer</parameter> or a
negative value if <parameter>bufsize</parameter> is too small to store the
escaped URI. In the latter case <parameter>error</parameter> will be set to
point to an <link linkend="GError"><type>GError</type></link> describing the problem.
</para>
<para>
When using the stack for <parameter>buffer</parameter>, it is suggested to
use <link linkend="THUNAR-VFS-PATH-MAXURILEN:CAPS"><type>THUNAR_VFS_PATH_MAXURILEN</type></link> for the buffer size in
most cases. The stack should never be used in recursive
functions; use <link linkend="thunar-vfs-path-dup-uri"><function>thunar_vfs_path_dup_uri()</function></link> instead there.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>path</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>buffer</parameter>&nbsp;:</term>
<listitem><simpara> the buffer to store the URI string to.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>bufsize</parameter>&nbsp;:</term>
<listitem><simpara> the size of <parameter>buffer</parameter> in bytes.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&nbsp;:</term>
<listitem><simpara> return location for errors or <literal>NULL</literal>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the number of bytes (including the null
              byte) stored to <parameter>buffer</parameter> or a negative
              value if <parameter>buffer</parameter> cannot hold the URI.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="thunar-vfs-path-list-from-string"/>thunar_vfs_path_list_from_string ()</title>
<indexterm><primary>thunar_vfs_path_list_from_string</primary></indexterm><programlisting><link linkend="GList">GList</link>*      thunar_vfs_path_list_from_string
                                            (const <link linkend="gchar">gchar</link> *uri_string,
                                             <link linkend="GError">GError</link> **error);</programlisting>
<para>
Splits an URI list conforming to the text/uri-list
mime type defined in RFC 2483 into individual URIs,
discarding any comments and whitespace.
</para>
<para>
If all URIs were successfully parsed into <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link>
objects, the list of parsed URIs will be returned, and
you'll need to call <link linkend="thunar-vfs-path-list-free"><function>thunar_vfs_path_list_free()</function></link> to
release the list resources. Else if the parsing fails
at some point, <literal>NULL</literal> will be returned and <parameter>error</parameter> will
be set to describe the cause.
</para>
<para>
Note, that if <parameter>string</parameter> contains no URIs, this function
will also return <literal>NULL</literal>, but <parameter>error</parameter> won't be set. So
take care when checking for an error condition!</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>uri_string</parameter>&nbsp;:</term>
<listitem><simpara> a string representation of an URI list.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&nbsp;:</term>
<listitem><simpara> return location for errors.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the list of <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link>'s or <literal>NULL</literal>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="thunar-vfs-path-list-to-string"/>thunar_vfs_path_list_to_string ()</title>
<indexterm><primary>thunar_vfs_path_list_to_string</primary></indexterm><programlisting><link linkend="gchar">gchar</link>*      thunar_vfs_path_list_to_string  (<link linkend="GList">GList</link> *path_list);</programlisting>
<para>
Free the returned value using <link linkend="g-free"><function>g_free()</function></link> when you
are done with it.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>path_list</parameter>&nbsp;:</term>
<listitem><simpara> a list of <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link><!---->s.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the string representation of <parameter>path_list</parameter> conforming to the
              text/uri-list mime type defined in RFC 2483.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="thunar-vfs-path-list-append"/>thunar_vfs_path_list_append ()</title>
<indexterm><primary>thunar_vfs_path_list_append</primary></indexterm><programlisting><link linkend="GList">GList</link>*      thunar_vfs_path_list_append     (<link linkend="GList">GList</link> *path_list,
                                             <link linkend="ThunarVfsPath">ThunarVfsPath</link> *path);</programlisting>
<para>
Appends <parameter>path</parameter> to the <parameter>path_list</parameter> while taking
an additional reference for <parameter>path</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>path_list</parameter>&nbsp;:</term>
<listitem><simpara> a list of <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link><!---->s.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>path</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> pointer to the extended <parameter>path_list</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="thunar-vfs-path-list-prepend"/>thunar_vfs_path_list_prepend ()</title>
<indexterm><primary>thunar_vfs_path_list_prepend</primary></indexterm><programlisting><link linkend="GList">GList</link>*      thunar_vfs_path_list_prepend    (<link linkend="GList">GList</link> *path_list,
                                             <link linkend="ThunarVfsPath">ThunarVfsPath</link> *path);</programlisting>
<para>
Similar to <link linkend="thunar-vfs-path-list-append"><function>thunar_vfs_path_list_append()</function></link>, but
prepends the <parameter>path</parameter> to the <parameter>path_list</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>path_list</parameter>&nbsp;:</term>
<listitem><simpara> a list of <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link><!---->s.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>path</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> pointer to the extended <parameter>path_list</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="thunar-vfs-path-list-copy"/>thunar_vfs_path_list_copy ()</title>
<indexterm><primary>thunar_vfs_path_list_copy</primary></indexterm><programlisting><link linkend="GList">GList</link>*      thunar_vfs_path_list_copy       (<link linkend="GList">GList</link> *path_list);</programlisting>
<para>
Takes a deep copy of <parameter>path_list</parameter> and returns the
result. The caller is responsible to free the
returned list using <link linkend="thunar-vfs-path-list-free"><function>thunar_vfs_path_list_free()</function></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>path_list</parameter>&nbsp;:</term>
<listitem><simpara> a list of <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link><!---->s.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a deep copy of <parameter>path_list</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="thunar-vfs-path-list-free"/>thunar_vfs_path_list_free ()</title>
<indexterm><primary>thunar_vfs_path_list_free</primary></indexterm><programlisting><link linkend="void">void</link>        thunar_vfs_path_list_free       (<link linkend="GList">GList</link> *path_list);</programlisting>
<para>
Frees the <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link><!---->s in <parameter>path_list</parameter> and
the <parameter>path_list</parameter> itself.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>path_list</parameter>&nbsp;:</term>
<listitem><simpara> a list of <link linkend="ThunarVfsPath"><type>ThunarVfsPath</type></link><!---->s.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
