<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="GMount">
<refmeta>
<refentrytitle role="top_of_page" id="GMount.top_of_page">GMount</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GIO Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GMount</refname>
<refpurpose>Mount management</refpurpose>
</refnamediv>

<refsynopsisdiv id="GMount.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>

#include &lt;gio/gio.h
@see also: GVolume&gt;
#include &lt;GUnixMount&gt;

                    <link linkend="GMount-struct">GMount</link>;
                    <link linkend="GMountIface">GMountIface</link>;
<link linkend="char">char</link> *              <link linkend="g-mount-get-name">g_mount_get_name</link>                    (<link linkend="GMount">GMount</link> *mount);
<link linkend="char">char</link> *              <link linkend="g-mount-get-uuid">g_mount_get_uuid</link>                    (<link linkend="GMount">GMount</link> *mount);
<link linkend="GIcon">GIcon</link> *             <link linkend="g-mount-get-icon">g_mount_get_icon</link>                    (<link linkend="GMount">GMount</link> *mount);
<link linkend="GDrive">GDrive</link> *            <link linkend="g-mount-get-drive">g_mount_get_drive</link>                   (<link linkend="GMount">GMount</link> *mount);
<link linkend="GFile">GFile</link> *             <link linkend="g-mount-get-root">g_mount_get_root</link>                    (<link linkend="GMount">GMount</link> *mount);
<link linkend="GVolume">GVolume</link> *           <link linkend="g-mount-get-volume">g_mount_get_volume</link>                  (<link linkend="GMount">GMount</link> *mount);
<link linkend="gboolean">gboolean</link>            <link linkend="g-mount-can-unmount">g_mount_can_unmount</link>                 (<link linkend="GMount">GMount</link> *mount);
enum                <link linkend="GMountMountFlags">GMountMountFlags</link>;
enum                <link linkend="GMountUnmountFlags">GMountUnmountFlags</link>;
<link linkend="void">void</link>                <link linkend="g-mount-unmount">g_mount_unmount</link>                     (<link linkend="GMount">GMount</link> *mount,
                                                         <link linkend="GMountUnmountFlags">GMountUnmountFlags</link> flags,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);
<link linkend="gboolean">gboolean</link>            <link linkend="g-mount-unmount-finish">g_mount_unmount_finish</link>              (<link linkend="GMount">GMount</link> *mount,
                                                         <link linkend="GAsyncResult">GAsyncResult</link> *result,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="void">void</link>                <link linkend="g-mount-unmount-with-operation">g_mount_unmount_with_operation</link>      (<link linkend="GMount">GMount</link> *mount,
                                                         <link linkend="GMountUnmountFlags">GMountUnmountFlags</link> flags,
                                                         <link linkend="GMountOperation">GMountOperation</link> *mount_operation,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);
<link linkend="gboolean">gboolean</link>            <link linkend="g-mount-unmount-with-operation-finish">g_mount_unmount_with_operation_finish</link>
                                                        (<link linkend="GMount">GMount</link> *mount,
                                                         <link linkend="GAsyncResult">GAsyncResult</link> *result,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="void">void</link>                <link linkend="g-mount-remount">g_mount_remount</link>                     (<link linkend="GMount">GMount</link> *mount,
                                                         <link linkend="GMountMountFlags">GMountMountFlags</link> flags,
                                                         <link linkend="GMountOperation">GMountOperation</link> *mount_operation,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);
<link linkend="gboolean">gboolean</link>            <link linkend="g-mount-remount-finish">g_mount_remount_finish</link>              (<link linkend="GMount">GMount</link> *mount,
                                                         <link linkend="GAsyncResult">GAsyncResult</link> *result,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="gboolean">gboolean</link>            <link linkend="g-mount-can-eject">g_mount_can_eject</link>                   (<link linkend="GMount">GMount</link> *mount);
<link linkend="void">void</link>                <link linkend="g-mount-eject">g_mount_eject</link>                       (<link linkend="GMount">GMount</link> *mount,
                                                         <link linkend="GMountUnmountFlags">GMountUnmountFlags</link> flags,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);
<link linkend="gboolean">gboolean</link>            <link linkend="g-mount-eject-finish">g_mount_eject_finish</link>                (<link linkend="GMount">GMount</link> *mount,
                                                         <link linkend="GAsyncResult">GAsyncResult</link> *result,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="void">void</link>                <link linkend="g-mount-eject-with-operation">g_mount_eject_with_operation</link>        (<link linkend="GMount">GMount</link> *mount,
                                                         <link linkend="GMountUnmountFlags">GMountUnmountFlags</link> flags,
                                                         <link linkend="GMountOperation">GMountOperation</link> *mount_operation,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);
<link linkend="gboolean">gboolean</link>            <link linkend="g-mount-eject-with-operation-finish">g_mount_eject_with_operation_finish</link> (<link linkend="GMount">GMount</link> *mount,
                                                         <link linkend="GAsyncResult">GAsyncResult</link> *result,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="void">void</link>                <link linkend="g-mount-guess-content-type">g_mount_guess_content_type</link>          (<link linkend="GMount">GMount</link> *mount,
                                                         <link linkend="gboolean">gboolean</link> force_rescan,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);
<link linkend="gchar">gchar</link> **            <link linkend="g-mount-guess-content-type-finish">g_mount_guess_content_type_finish</link>   (<link linkend="GMount">GMount</link> *mount,
                                                         <link linkend="GAsyncResult">GAsyncResult</link> *result,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="gchar">gchar</link> **            <link linkend="g-mount-guess-content-type-sync">g_mount_guess_content_type_sync</link>     (<link linkend="GMount">GMount</link> *mount,
                                                         <link linkend="gboolean">gboolean</link> force_rescan,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="gboolean">gboolean</link>            <link linkend="g-mount-is-shadowed">g_mount_is_shadowed</link>                 (<link linkend="GMount">GMount</link> *mount);
<link linkend="void">void</link>                <link linkend="g-mount-shadow">g_mount_shadow</link>                      (<link linkend="GMount">GMount</link> *mount);
<link linkend="void">void</link>                <link linkend="g-mount-unshadow">g_mount_unshadow</link>                    (<link linkend="GMount">GMount</link> *mount);
</synopsis>
</refsynopsisdiv>

<refsect1 id="GMount.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GInterface">GInterface</link>
   +----GMount
</synopsis>
</refsect1>

<refsect1 id="GMount.prerequisites" role="prerequisites">
<title role="prerequisites.title">Prerequisites</title>
<para>
GMount requires
 <link linkend="GObject">GObject</link>.</para>
</refsect1>





<refsect1 id="GMount.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<synopsis>
  &quot;<link linkend="GMount-changed">changed</link>&quot;                                        : Run Last
  &quot;<link linkend="GMount-pre-unmount">pre-unmount</link>&quot;                                    : Run Last
  &quot;<link linkend="GMount-unmounted">unmounted</link>&quot;                                      : Run Last
</synopsis>
</refsect1>


<refsect1 id="GMount.description" role="desc">
<title role="desc.title">Description</title>
<para>
The <link linkend="GMount"><type>GMount</type></link> interface represents user-visible mounts. Note, when 
porting from GnomeVFS, <link linkend="GMount"><type>GMount</type></link> is the moral equivalent of <link linkend="GnomeVFSVolume"><type>GnomeVFSVolume</type></link>.
</para>
<para>
<link linkend="GMount"><type>GMount</type></link> is a "mounted" filesystem that you can access. Mounted is in
quotes because it's not the same as a unix mount, it might be a gvfs
mount, but you can still access the files on it if you use GIO. Might or
might not be related to a volume object.
</para>
<para>
Unmounting a <link linkend="GMount"><type>GMount</type></link> instance is an asynchronous operation. For
more information about asynchronous operations, see <link linkend="GAsyncReady"><type>GAsyncReady</type></link>
and <link linkend="GSimpleAsyncReady"><type>GSimpleAsyncReady</type></link>. To unmount a <link linkend="GMount"><type>GMount</type></link> instance, first call
<link linkend="g-mount-unmount-with-operation"><function>g_mount_unmount_with_operation()</function></link> with (at least) the <link linkend="GMount"><type>GMount</type></link> instance and a
<link linkend="GAsyncReadyCallback"><type>GAsyncReadyCallback</type></link>.  The callback will be fired when the
operation has resolved (either with success or failure), and a
<link linkend="GAsyncReady"><type>GAsyncReady</type></link> structure will be passed to the callback.  That
callback should then call <link linkend="g-mount-unmount-with-operation-finish"><function>g_mount_unmount_with_operation_finish()</function></link> with the <link linkend="GMount"><type>GMount</type></link>
and the <link linkend="GAsyncReady"><type>GAsyncReady</type></link> data to see if the operation was completed
successfully.  If an <parameter>error</parameter> is present when <link linkend="g-mount-unmount-with-operation-finish"><function>g_mount_unmount_with_operation_finish()</function></link> 
is called, then it will be filled with any error information.</para>
<para>
</para>
</refsect1>

<refsect1 id="GMount.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GMount-struct" role="struct">
<title>GMount</title>
<indexterm zone="GMount-struct"><primary sortas="Mount">GMount</primary></indexterm><programlisting>typedef struct _GMount GMount;</programlisting>
<para>
A handle to an object implementing the <link linkend="GMountIface"><type>GMountIface</type></link> interface.</para>
<para>
</para></refsect2>
<refsect2 id="GMountIface" role="struct">
<title>GMountIface</title>
<indexterm zone="GMountIface"><primary sortas="MountIface">GMountIface</primary></indexterm><programlisting>typedef struct {
  GTypeInterface g_iface;

  /* signals */

  void        (* changed)                   (GMount              *mount);
  void        (* unmounted)                 (GMount              *mount);

  /* Virtual Table */

  GFile     * (* get_root)                  (GMount              *mount);
  char      * (* get_name)                  (GMount              *mount);
  GIcon     * (* get_icon)                  (GMount              *mount);
  char      * (* get_uuid)                  (GMount              *mount);
  GVolume   * (* get_volume)                (GMount              *mount);
  GDrive    * (* get_drive)                 (GMount              *mount);
  gboolean    (* can_unmount)               (GMount              *mount);
  gboolean    (* can_eject)                 (GMount              *mount);

  void        (* unmount)                   (GMount              *mount,
                                             GMountUnmountFlags   flags,
                                             GCancellable        *cancellable,
                                             GAsyncReadyCallback  callback,
                                             gpointer             user_data);
  gboolean    (* unmount_finish)            (GMount              *mount,
                                             GAsyncResult        *result,
                                             GError             **error);

  void        (* eject)                     (GMount              *mount,
                                             GMountUnmountFlags   flags,
                                             GCancellable        *cancellable,
                                             GAsyncReadyCallback  callback,
                                             gpointer             user_data);
  gboolean    (* eject_finish)              (GMount              *mount,
                                             GAsyncResult        *result,
                                             GError             **error);

  void        (* remount)                   (GMount              *mount,
                                             GMountMountFlags     flags,
                                             GMountOperation     *mount_operation,
                                             GCancellable        *cancellable,
                                             GAsyncReadyCallback  callback,
                                             gpointer             user_data);
  gboolean    (* remount_finish)            (GMount              *mount,
                                             GAsyncResult        *result,
                                             GError             **error);

  void        (* guess_content_type)        (GMount              *mount,
                                             gboolean             force_rescan,
                                             GCancellable        *cancellable,
                                             GAsyncReadyCallback  callback,
                                             gpointer             user_data);
  gchar    ** (* guess_content_type_finish) (GMount              *mount,
                                             GAsyncResult        *result,
                                             GError             **error);
  gchar    ** (* guess_content_type_sync)   (GMount              *mount,
                                             gboolean             force_rescan,
                                             GCancellable        *cancellable,
                                             GError             **error);

  /* Signal, not VFunc */
  void        (* pre_unmount)               (GMount              *mount);

  void        (* unmount_with_operation)    (GMount              *mount,
                                             GMountUnmountFlags   flags,
                                             GMountOperation     *mount_operation,
                                             GCancellable        *cancellable,
                                             GAsyncReadyCallback  callback,
                                             gpointer             user_data);
  gboolean    (* unmount_with_operation_finish) (GMount          *mount,
                                             GAsyncResult        *result,
                                             GError             **error);

  void        (* eject_with_operation)      (GMount              *mount,
                                             GMountUnmountFlags   flags,
                                             GMountOperation     *mount_operation,
                                             GCancellable        *cancellable,
                                             GAsyncReadyCallback  callback,
                                             gpointer             user_data);
  gboolean    (* eject_with_operation_finish) (GMount            *mount,
                                             GAsyncResult        *result,
                                             GError             **error);
} GMountIface;
</programlisting>
<para>
Interface for implementing operations for mounts.</para>
<para>
</para><variablelist role="struct">
<varlistentry>
<term><link linkend="GTypeInterface">GTypeInterface</link>&#160;<structfield>g_iface</structfield>;</term>
<listitem><simpara> The parent interface.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>changed</structfield>&#160;()</term>
<listitem><simpara> Changed signal that is emitted when the mount's state has changed.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>unmounted</structfield>&#160;()</term>
<listitem><simpara> The unmounted signal that is emitted when the <link linkend="GMount"><type>GMount</type></link> have been unmounted. If the recipient is holding references to the object they should release them so the object can be finalized.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>get_root</structfield>&#160;()</term>
<listitem><simpara> Gets a <link linkend="GFile"><type>GFile</type></link> to the root directory of the <link linkend="GMount"><type>GMount</type></link>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>get_name</structfield>&#160;()</term>
<listitem><simpara> Gets a string containing the name of the <link linkend="GMount"><type>GMount</type></link>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>get_icon</structfield>&#160;()</term>
<listitem><simpara> Gets a <link linkend="GIcon"><type>GIcon</type></link> for the <link linkend="GMount"><type>GMount</type></link>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>get_uuid</structfield>&#160;()</term>
<listitem><simpara> Gets the UUID for the <link linkend="GMount"><type>GMount</type></link>. The reference is typically based on the file system UUID for the mount in question and should be considered an opaque string. Returns <link linkend="NULL--CAPS"><literal>NULL</literal></link> if there is no UUID available.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>get_volume</structfield>&#160;()</term>
<listitem><simpara> Gets a <link linkend="GVolume"><type>GVolume</type></link> the mount is located on. Returns <link linkend="NULL--CAPS"><literal>NULL</literal></link> if the <link linkend="GMount"><type>GMount</type></link> is not associated with a <link linkend="GVolume"><type>GVolume</type></link>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>get_drive</structfield>&#160;()</term>
<listitem><simpara> Gets a <link linkend="GDrive"><type>GDrive</type></link> the volume of the mount is located on. Returns <link linkend="NULL--CAPS"><literal>NULL</literal></link> if the <link linkend="GMount"><type>GMount</type></link> is not associated with a <link linkend="GDrive"><type>GDrive</type></link> or a <link linkend="GVolume"><type>GVolume</type></link>. This is convenience method for getting the <link linkend="GVolume"><type>GVolume</type></link> and using that to get the <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>can_unmount</structfield>&#160;()</term>
<listitem><simpara> Checks if a <link linkend="GMount"><type>GMount</type></link> can be unmounted.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>can_eject</structfield>&#160;()</term>
<listitem><simpara> Checks if a <link linkend="GMount"><type>GMount</type></link> can be ejected.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>unmount</structfield>&#160;()</term>
<listitem><simpara> Starts unmounting a <link linkend="GMount"><type>GMount</type></link>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>unmount_finish</structfield>&#160;()</term>
<listitem><simpara> Finishes an unmounting operation.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>eject</structfield>&#160;()</term>
<listitem><simpara> Starts ejecting a <link linkend="GMount"><type>GMount</type></link>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>eject_finish</structfield>&#160;()</term>
<listitem><simpara> Finishes an eject operation.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>remount</structfield>&#160;()</term>
<listitem><simpara> Starts remounting a <link linkend="GMount"><type>GMount</type></link>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>remount_finish</structfield>&#160;()</term>
<listitem><simpara> Finishes a remounting operation.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>guess_content_type</structfield>&#160;()</term>
<listitem><simpara> Starts guessing the type of the content of a <link linkend="GMount"><type>GMount</type></link>.
    See <link linkend="g-mount-guess-content-type"><function>g_mount_guess_content_type()</function></link> for more information on content
    type guessing. This operation was added in 2.18.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>guess_content_type_finish</structfield>&#160;()</term>
<listitem><simpara> Finishes a contenet type guessing operation. Added in 2.18.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>guess_content_type_sync</structfield>&#160;()</term>
<listitem><simpara> Synchronous variant of <parameter>guess_content_type</parameter>. Added in 2.18
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>pre_unmount</structfield>&#160;()</term>
<listitem><simpara> The pre_unmout signal that is emitted when the <link linkend="GMount"><type>GMount</type></link> will soon be emitted. If the recipient is somehow holding the mount open by keeping an open file on it it should close the file.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>unmount_with_operation</structfield>&#160;()</term>
<listitem><simpara> Starts unmounting a <link linkend="GMount"><type>GMount</type></link> using a <link linkend="GMountOperation"><type>GMountOperation</type></link>. Since 2.22.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>unmount_with_operation_finish</structfield>&#160;()</term>
<listitem><simpara> Finishes an unmounting operation using a <link linkend="GMountOperation"><type>GMountOperation</type></link>. Since 2.22.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>eject_with_operation</structfield>&#160;()</term>
<listitem><simpara> Starts ejecting a <link linkend="GMount"><type>GMount</type></link> using a <link linkend="GMountOperation"><type>GMountOperation</type></link>. Since 2.22.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>eject_with_operation_finish</structfield>&#160;()</term>
<listitem><simpara> Finishes an eject operation using a <link linkend="GMountOperation"><type>GMountOperation</type></link>. Since 2.22.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mount-get-name" role="function">
<title>g_mount_get_name ()</title>
<indexterm zone="g-mount-get-name"><primary sortas="mount_get_name">g_mount_get_name</primary></indexterm><programlisting><link linkend="char">char</link> *              g_mount_get_name                    (<link linkend="GMount">GMount</link> *mount);</programlisting>
<para>
Gets the name of <parameter>mount</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mount</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMount"><type>GMount</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the name for the given <parameter>mount</parameter>. 
    The returned string should be freed with <link linkend="g-free"><function>g_free()</function></link>
    when no longer needed.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mount-get-uuid" role="function">
<title>g_mount_get_uuid ()</title>
<indexterm zone="g-mount-get-uuid"><primary sortas="mount_get_uuid">g_mount_get_uuid</primary></indexterm><programlisting><link linkend="char">char</link> *              g_mount_get_uuid                    (<link linkend="GMount">GMount</link> *mount);</programlisting>
<para>
Gets the UUID for the <parameter>mount</parameter>. The reference is typically based on
the file system UUID for the mount in question and should be
considered an opaque string. Returns <link linkend="NULL--CAPS"><literal>NULL</literal></link> if there is no UUID
available.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mount</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMount"><type>GMount</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the UUID for <parameter>mount</parameter> or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if no UUID can be computed.
    The returned string should be freed with <link linkend="g-free"><function>g_free()</function></link>
    when no longer needed.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mount-get-icon" role="function">
<title>g_mount_get_icon ()</title>
<indexterm zone="g-mount-get-icon"><primary sortas="mount_get_icon">g_mount_get_icon</primary></indexterm><programlisting><link linkend="GIcon">GIcon</link> *             g_mount_get_icon                    (<link linkend="GMount">GMount</link> *mount);</programlisting>
<para>
Gets the icon for <parameter>mount</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mount</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMount"><type>GMount</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="GIcon"><type>GIcon</type></link>.
     The returned object should be unreffed with 
     <link linkend="g-object-unref"><function>g_object_unref()</function></link> when no longer needed.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mount-get-drive" role="function">
<title>g_mount_get_drive ()</title>
<indexterm zone="g-mount-get-drive"><primary sortas="mount_get_drive">g_mount_get_drive</primary></indexterm><programlisting><link linkend="GDrive">GDrive</link> *            g_mount_get_drive                   (<link linkend="GMount">GMount</link> *mount);</programlisting>
<para>
Gets the drive for the <parameter>mount</parameter>.
</para>
<para>
This is a convenience method for getting the <link linkend="GVolume"><type>GVolume</type></link> and then
using that object to get the <link linkend="GDrive"><type>GDrive</type></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mount</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMount"><type>GMount</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link> or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if <parameter>mount</parameter> is not associated with a volume or a drive.
     The returned object should be unreffed with 
     <link linkend="g-object-unref"><function>g_object_unref()</function></link> when no longer needed.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mount-get-root" role="function">
<title>g_mount_get_root ()</title>
<indexterm zone="g-mount-get-root"><primary sortas="mount_get_root">g_mount_get_root</primary></indexterm><programlisting><link linkend="GFile">GFile</link> *             g_mount_get_root                    (<link linkend="GMount">GMount</link> *mount);</programlisting>
<para>
Gets the root directory on <parameter>mount</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mount</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMount"><type>GMount</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="GFile"><type>GFile</type></link>. 
     The returned object should be unreffed with 
     <link linkend="g-object-unref"><function>g_object_unref()</function></link> when no longer needed.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mount-get-volume" role="function">
<title>g_mount_get_volume ()</title>
<indexterm zone="g-mount-get-volume"><primary sortas="mount_get_volume">g_mount_get_volume</primary></indexterm><programlisting><link linkend="GVolume">GVolume</link> *           g_mount_get_volume                  (<link linkend="GMount">GMount</link> *mount);</programlisting>
<para>
Gets the volume for the <parameter>mount</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mount</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMount"><type>GMount</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="GVolume"><type>GVolume</type></link> or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if <parameter>mount</parameter> is not associated with a volume.
     The returned object should be unreffed with 
     <link linkend="g-object-unref"><function>g_object_unref()</function></link> when no longer needed.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mount-can-unmount" role="function">
<title>g_mount_can_unmount ()</title>
<indexterm zone="g-mount-can-unmount"><primary sortas="mount_can_unmount">g_mount_can_unmount</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_mount_can_unmount                 (<link linkend="GMount">GMount</link> *mount);</programlisting>
<para>
Checks if <parameter>mount</parameter> can be mounted.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mount</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMount"><type>GMount</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the <parameter>mount</parameter> can be unmounted.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GMountMountFlags" role="enum">
<title>enum GMountMountFlags</title>
<indexterm zone="GMountMountFlags"><primary sortas="MountMountFlags">GMountMountFlags</primary></indexterm><programlisting>typedef enum {
  G_MOUNT_MOUNT_NONE = 0
} GMountMountFlags;
</programlisting>
<para>
Flags used when mounting a mount.</para>
<para>
</para><variablelist role="enum">
<varlistentry id="G-MOUNT-MOUNT-NONE--CAPS" role="constant">
<term><literal>G_MOUNT_MOUNT_NONE</literal></term>
<listitem><simpara> No flags set.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="GMountUnmountFlags" role="enum">
<title>enum GMountUnmountFlags</title>
<indexterm zone="GMountUnmountFlags"><primary sortas="MountUnmountFlags">GMountUnmountFlags</primary></indexterm><programlisting>typedef enum {
  G_MOUNT_UNMOUNT_NONE  = 0,
  G_MOUNT_UNMOUNT_FORCE = (1 &lt;&lt; 0)
} GMountUnmountFlags;
</programlisting>
<para>
Flags used when an unmounting a mount.</para>
<para>
</para><variablelist role="enum">
<varlistentry id="G-MOUNT-UNMOUNT-NONE--CAPS" role="constant">
<term><literal>G_MOUNT_UNMOUNT_NONE</literal></term>
<listitem><simpara> No flags set.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-MOUNT-UNMOUNT-FORCE--CAPS" role="constant">
<term><literal>G_MOUNT_UNMOUNT_FORCE</literal></term>
<listitem><simpara> Unmount even if there are outstanding
 file operations on the mount.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mount-unmount" role="function" condition="deprecated:2.22: Use g_mount_unmount_with_operation() instead.">
<title>g_mount_unmount ()</title>
<indexterm zone="g-mount-unmount" role="deprecated"><primary sortas="mount_unmount">g_mount_unmount</primary></indexterm><programlisting><link linkend="void">void</link>                g_mount_unmount                     (<link linkend="GMount">GMount</link> *mount,
                                                         <link linkend="GMountUnmountFlags">GMountUnmountFlags</link> flags,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<warning><para><literal>g_mount_unmount</literal> has been deprecated since version 2.22 and should not be used in newly-written code. Use <link linkend="g-mount-unmount-with-operation"><function>g_mount_unmount_with_operation()</function></link> instead.</para></warning>
<para>
Unmounts a mount. This is an asynchronous operation, and is 
finished by calling <link linkend="g-mount-unmount-finish"><function>g_mount_unmount_finish()</function></link> with the <parameter>mount</parameter> 
and <link linkend="GAsyncResult"><type>GAsyncResult</type></link> data returned in the <parameter>callback</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mount</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMount"><type>GMount</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>flags</parameter>&#160;:</term>
<listitem><simpara> flags affecting the operation
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>cancellable</parameter>&#160;:</term>
<listitem><simpara> optional <link linkend="GCancellable"><type>GCancellable</type></link> object, <link linkend="NULL--CAPS"><literal>NULL</literal></link> to ignore.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>callback</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAsyncReadyCallback"><type>GAsyncReadyCallback</type></link>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara> user data passed to <parameter>callback</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mount-unmount-finish" role="function" condition="deprecated:2.22: Use g_mount_unmount_with_operation_finish() instead.">
<title>g_mount_unmount_finish ()</title>
<indexterm zone="g-mount-unmount-finish" role="deprecated"><primary sortas="mount_unmount_finish">g_mount_unmount_finish</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_mount_unmount_finish              (<link linkend="GMount">GMount</link> *mount,
                                                         <link linkend="GAsyncResult">GAsyncResult</link> *result,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<warning><para><literal>g_mount_unmount_finish</literal> has been deprecated since version 2.22 and should not be used in newly-written code. Use <link linkend="g-mount-unmount-with-operation-finish"><function>g_mount_unmount_with_operation_finish()</function></link> instead.</para></warning>
<para>
Finishes unmounting a mount. If any errors occurred during the operation, 
<parameter>error</parameter> will be set to contain the errors and <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> will be returned.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mount</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMount"><type>GMount</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>result</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAsyncResult"><type>GAsyncResult</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GError"><type>GError</type></link> location to store the error occuring, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> to 
    ignore.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the mount was successfully unmounted. <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.

</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mount-unmount-with-operation" role="function" condition="since:2.22">
<title>g_mount_unmount_with_operation ()</title>
<indexterm zone="g-mount-unmount-with-operation" role="2.22"><primary sortas="mount_unmount_with_operation">g_mount_unmount_with_operation</primary></indexterm><programlisting><link linkend="void">void</link>                g_mount_unmount_with_operation      (<link linkend="GMount">GMount</link> *mount,
                                                         <link linkend="GMountUnmountFlags">GMountUnmountFlags</link> flags,
                                                         <link linkend="GMountOperation">GMountOperation</link> *mount_operation,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>
Unmounts a mount. This is an asynchronous operation, and is
finished by calling <link linkend="g-mount-unmount-with-operation-finish"><function>g_mount_unmount_with_operation_finish()</function></link> with the <parameter>mount</parameter> 
and <link linkend="GAsyncResult"><type>GAsyncResult</type></link> data returned in the <parameter>callback</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mount</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMount"><type>GMount</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>flags</parameter>&#160;:</term>
<listitem><simpara> flags affecting the operation
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mount_operation</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMountOperation"><type>GMountOperation</type></link> or <link linkend="NULL--CAPS"><literal>NULL</literal></link> to avoid user interaction.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>cancellable</parameter>&#160;:</term>
<listitem><simpara> optional <link linkend="GCancellable"><type>GCancellable</type></link> object, <link linkend="NULL--CAPS"><literal>NULL</literal></link> to ignore.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>callback</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAsyncReadyCallback"><type>GAsyncReadyCallback</type></link>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara> user data passed to <parameter>callback</parameter>.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.22</para></refsect2>
<refsect2 id="g-mount-unmount-with-operation-finish" role="function" condition="since:2.22">
<title>g_mount_unmount_with_operation_finish ()</title>
<indexterm zone="g-mount-unmount-with-operation-finish" role="2.22"><primary sortas="mount_unmount_with_operation_finish">g_mount_unmount_with_operation_finish</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_mount_unmount_with_operation_finish
                                                        (<link linkend="GMount">GMount</link> *mount,
                                                         <link linkend="GAsyncResult">GAsyncResult</link> *result,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Finishes unmounting a mount. If any errors occurred during the operation,
<parameter>error</parameter> will be set to contain the errors and <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> will be returned.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mount</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMount"><type>GMount</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>result</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAsyncResult"><type>GAsyncResult</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GError"><type>GError</type></link> location to store the error occuring, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> to
    ignore.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the mount was successfully unmounted. <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.22</para></refsect2>
<refsect2 id="g-mount-remount" role="function">
<title>g_mount_remount ()</title>
<indexterm zone="g-mount-remount"><primary sortas="mount_remount">g_mount_remount</primary></indexterm><programlisting><link linkend="void">void</link>                g_mount_remount                     (<link linkend="GMount">GMount</link> *mount,
                                                         <link linkend="GMountMountFlags">GMountMountFlags</link> flags,
                                                         <link linkend="GMountOperation">GMountOperation</link> *mount_operation,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>
Remounts a mount. This is an asynchronous operation, and is 
finished by calling <link linkend="g-mount-remount-finish"><function>g_mount_remount_finish()</function></link> with the <parameter>mount</parameter> 
and <link linkend="GAsyncResults"><type>GAsyncResults</type></link> data returned in the <parameter>callback</parameter>.
</para>
<para>
Remounting is useful when some setting affecting the operation
of the volume has been changed, as these may need a remount to
take affect. While this is semantically equivalent with unmounting
and then remounting not all backends might need to actually be
unmounted.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mount</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMount"><type>GMount</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>flags</parameter>&#160;:</term>
<listitem><simpara> flags affecting the operation
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mount_operation</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMountOperation"><type>GMountOperation</type></link> or <link linkend="NULL--CAPS"><literal>NULL</literal></link> to avoid user interaction.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>cancellable</parameter>&#160;:</term>
<listitem><simpara> optional <link linkend="GCancellable"><type>GCancellable</type></link> object, <link linkend="NULL--CAPS"><literal>NULL</literal></link> to ignore.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>callback</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAsyncReadyCallback"><type>GAsyncReadyCallback</type></link>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara> user data passed to <parameter>callback</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mount-remount-finish" role="function">
<title>g_mount_remount_finish ()</title>
<indexterm zone="g-mount-remount-finish"><primary sortas="mount_remount_finish">g_mount_remount_finish</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_mount_remount_finish              (<link linkend="GMount">GMount</link> *mount,
                                                         <link linkend="GAsyncResult">GAsyncResult</link> *result,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Finishes remounting a mount. If any errors occurred during the operation, 
<parameter>error</parameter> will be set to contain the errors and <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> will be returned.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mount</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMount"><type>GMount</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>result</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAsyncResult"><type>GAsyncResult</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GError"><type>GError</type></link> location to store the error occuring, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> to 
    ignore.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the mount was successfully remounted. <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mount-can-eject" role="function">
<title>g_mount_can_eject ()</title>
<indexterm zone="g-mount-can-eject"><primary sortas="mount_can_eject">g_mount_can_eject</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_mount_can_eject                   (<link linkend="GMount">GMount</link> *mount);</programlisting>
<para>
Checks if <parameter>mount</parameter> can be eject.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mount</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMount"><type>GMount</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the <parameter>mount</parameter> can be ejected.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mount-eject" role="function" condition="deprecated:2.22: Use g_mount_eject_with_operation() instead.">
<title>g_mount_eject ()</title>
<indexterm zone="g-mount-eject" role="deprecated"><primary sortas="mount_eject">g_mount_eject</primary></indexterm><programlisting><link linkend="void">void</link>                g_mount_eject                       (<link linkend="GMount">GMount</link> *mount,
                                                         <link linkend="GMountUnmountFlags">GMountUnmountFlags</link> flags,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<warning><para><literal>g_mount_eject</literal> has been deprecated since version 2.22 and should not be used in newly-written code. Use <link linkend="g-mount-eject-with-operation"><function>g_mount_eject_with_operation()</function></link> instead.</para></warning>
<para>
Ejects a mount. This is an asynchronous operation, and is 
finished by calling <link linkend="g-mount-eject-finish"><function>g_mount_eject_finish()</function></link> with the <parameter>mount</parameter> 
and <link linkend="GAsyncResult"><type>GAsyncResult</type></link> data returned in the <parameter>callback</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mount</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMount"><type>GMount</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>flags</parameter>&#160;:</term>
<listitem><simpara> flags affecting the unmount if required for eject
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>cancellable</parameter>&#160;:</term>
<listitem><simpara> optional <link linkend="GCancellable"><type>GCancellable</type></link> object, <link linkend="NULL--CAPS"><literal>NULL</literal></link> to ignore.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>callback</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAsyncReadyCallback"><type>GAsyncReadyCallback</type></link>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara> user data passed to <parameter>callback</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mount-eject-finish" role="function" condition="deprecated:2.22: Use g_mount_eject_with_operation_finish() instead.">
<title>g_mount_eject_finish ()</title>
<indexterm zone="g-mount-eject-finish" role="deprecated"><primary sortas="mount_eject_finish">g_mount_eject_finish</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_mount_eject_finish                (<link linkend="GMount">GMount</link> *mount,
                                                         <link linkend="GAsyncResult">GAsyncResult</link> *result,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<warning><para><literal>g_mount_eject_finish</literal> has been deprecated since version 2.22 and should not be used in newly-written code. Use <link linkend="g-mount-eject-with-operation-finish"><function>g_mount_eject_with_operation_finish()</function></link> instead.</para></warning>
<para>
Finishes ejecting a mount. If any errors occurred during the operation, 
<parameter>error</parameter> will be set to contain the errors and <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> will be returned.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mount</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMount"><type>GMount</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>result</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAsyncResult"><type>GAsyncResult</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GError"><type>GError</type></link> location to store the error occuring, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> to 
    ignore.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the mount was successfully ejected. <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.

</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mount-eject-with-operation" role="function" condition="since:2.22">
<title>g_mount_eject_with_operation ()</title>
<indexterm zone="g-mount-eject-with-operation" role="2.22"><primary sortas="mount_eject_with_operation">g_mount_eject_with_operation</primary></indexterm><programlisting><link linkend="void">void</link>                g_mount_eject_with_operation        (<link linkend="GMount">GMount</link> *mount,
                                                         <link linkend="GMountUnmountFlags">GMountUnmountFlags</link> flags,
                                                         <link linkend="GMountOperation">GMountOperation</link> *mount_operation,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>
Ejects a mount. This is an asynchronous operation, and is
finished by calling <link linkend="g-mount-eject-with-operation-finish"><function>g_mount_eject_with_operation_finish()</function></link> with the <parameter>mount</parameter>
and <link linkend="GAsyncResult"><type>GAsyncResult</type></link> data returned in the <parameter>callback</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mount</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMount"><type>GMount</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>flags</parameter>&#160;:</term>
<listitem><simpara> flags affecting the unmount if required for eject
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mount_operation</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMountOperation"><type>GMountOperation</type></link> or <link linkend="NULL--CAPS"><literal>NULL</literal></link> to avoid user interaction.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>cancellable</parameter>&#160;:</term>
<listitem><simpara> optional <link linkend="GCancellable"><type>GCancellable</type></link> object, <link linkend="NULL--CAPS"><literal>NULL</literal></link> to ignore.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>callback</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAsyncReadyCallback"><type>GAsyncReadyCallback</type></link>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara> user data passed to <parameter>callback</parameter>.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.22</para></refsect2>
<refsect2 id="g-mount-eject-with-operation-finish" role="function" condition="since:2.22">
<title>g_mount_eject_with_operation_finish ()</title>
<indexterm zone="g-mount-eject-with-operation-finish" role="2.22"><primary sortas="mount_eject_with_operation_finish">g_mount_eject_with_operation_finish</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_mount_eject_with_operation_finish (<link linkend="GMount">GMount</link> *mount,
                                                         <link linkend="GAsyncResult">GAsyncResult</link> *result,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Finishes ejecting a mount. If any errors occurred during the operation,
<parameter>error</parameter> will be set to contain the errors and <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> will be returned.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mount</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMount"><type>GMount</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>result</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAsyncResult"><type>GAsyncResult</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GError"><type>GError</type></link> location to store the error occuring, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> to
    ignore.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the mount was successfully ejected. <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.22</para></refsect2>
<refsect2 id="g-mount-guess-content-type" role="function" condition="since:2.18">
<title>g_mount_guess_content_type ()</title>
<indexterm zone="g-mount-guess-content-type" role="2.18"><primary sortas="mount_guess_content_type">g_mount_guess_content_type</primary></indexterm><programlisting><link linkend="void">void</link>                g_mount_guess_content_type          (<link linkend="GMount">GMount</link> *mount,
                                                         <link linkend="gboolean">gboolean</link> force_rescan,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>
Tries to guess the type of content stored on <parameter>mount</parameter>. Returns one or
more textual identifiers of well-known content types (typically
prefixed with "x-content/"), e.g. x-content/image-dcf for camera 
memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
specification for more on x-content types.
</para>
<para>
This is an asynchronous operation (see
<link linkend="g-mount-guess-content-type-sync"><function>g_mount_guess_content_type_sync()</function></link> for the synchronous version), and
is finished by calling <link linkend="g-mount-guess-content-type-finish"><function>g_mount_guess_content_type_finish()</function></link> with the
<parameter>mount</parameter> and <link linkend="GAsyncResult"><type>GAsyncResult</type></link> data returned in the <parameter>callback</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mount</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMount"><type>GMount</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>force_rescan</parameter>&#160;:</term>
<listitem><simpara> Whether to force a rescan of the content. 
    Otherwise a cached result will be used if available
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>cancellable</parameter>&#160;:</term>
<listitem><simpara> optional <link linkend="GCancellable"><type>GCancellable</type></link> object, <link linkend="NULL--CAPS"><literal>NULL</literal></link> to ignore
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>callback</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAsyncReadyCallback"><type>GAsyncReadyCallback</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara> user data passed to <parameter>callback</parameter>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.18</para></refsect2>
<refsect2 id="g-mount-guess-content-type-finish" role="function" condition="since:2.18">
<title>g_mount_guess_content_type_finish ()</title>
<indexterm zone="g-mount-guess-content-type-finish" role="2.18"><primary sortas="mount_guess_content_type_finish">g_mount_guess_content_type_finish</primary></indexterm><programlisting><link linkend="gchar">gchar</link> **            g_mount_guess_content_type_finish   (<link linkend="GMount">GMount</link> *mount,
                                                         <link linkend="GAsyncResult">GAsyncResult</link> *result,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Finishes guessing content types of <parameter>mount</parameter>. If any errors occured
during the operation, <parameter>error</parameter> will be set to contain the errors and
<link linkend="FALSE--CAPS"><literal>FALSE</literal></link> will be returned. In particular, you may get an 
<link linkend="G-IO-ERROR-NOT-SUPPORTED--CAPS"><literal>G_IO_ERROR_NOT_SUPPORTED</literal></link> if the mount does not support content 
guessing.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mount</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMount"><type>GMount</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>result</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAsyncResult"><type>GAsyncResult</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GError"><type>GError</type></link> location to store the error occuring, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> to 
    ignore
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="NULL--CAPS"><literal>NULL</literal></link>-terminated array of content types or <link linkend="NULL--CAPS"><literal>NULL</literal></link> on error. 
    Caller should free this array with <link linkend="g-strfreev"><function>g_strfreev()</function></link> when done with it.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.18</para></refsect2>
<refsect2 id="g-mount-guess-content-type-sync" role="function" condition="since:2.18">
<title>g_mount_guess_content_type_sync ()</title>
<indexterm zone="g-mount-guess-content-type-sync" role="2.18"><primary sortas="mount_guess_content_type_sync">g_mount_guess_content_type_sync</primary></indexterm><programlisting><link linkend="gchar">gchar</link> **            g_mount_guess_content_type_sync     (<link linkend="GMount">GMount</link> *mount,
                                                         <link linkend="gboolean">gboolean</link> force_rescan,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Tries to guess the type of content stored on <parameter>mount</parameter>. Returns one or
more textual identifiers of well-known content types (typically
prefixed with "x-content/"), e.g. x-content/image-dcf for camera 
memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
specification for more on x-content types.
</para>
<para>
This is an synchronous operation and as such may block doing IO;
see <link linkend="g-mount-guess-content-type"><function>g_mount_guess_content_type()</function></link> for the asynchronous version.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mount</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMount"><type>GMount</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>force_rescan</parameter>&#160;:</term>
<listitem><simpara> Whether to force a rescan of the content.
    Otherwise a cached result will be used if available
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>cancellable</parameter>&#160;:</term>
<listitem><simpara> optional <link linkend="GCancellable"><type>GCancellable</type></link> object, <link linkend="NULL--CAPS"><literal>NULL</literal></link> to ignore
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GError"><type>GError</type></link> location to store the error occuring, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> to
    ignore
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="NULL--CAPS"><literal>NULL</literal></link>-terminated array of content types or <link linkend="NULL--CAPS"><literal>NULL</literal></link> on error.
    Caller should free this array with <link linkend="g-strfreev"><function>g_strfreev()</function></link> when done with it.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.18</para></refsect2>
<refsect2 id="g-mount-is-shadowed" role="function" condition="since:2.20">
<title>g_mount_is_shadowed ()</title>
<indexterm zone="g-mount-is-shadowed" role="2.20"><primary sortas="mount_is_shadowed">g_mount_is_shadowed</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_mount_is_shadowed                 (<link linkend="GMount">GMount</link> *mount);</programlisting>
<para>
Determines if <parameter>mount</parameter> is shadowed. Applications or libraries should
avoid displaying <parameter>mount</parameter> in the user interface if it is shadowed.
</para>
<para>
A mount is said to be shadowed if there exists one or more user
visible objects (currently <link linkend="GMount"><type>GMount</type></link> objects) with a root that is
inside the root of <parameter>mount</parameter>.
</para>
<para>
One application of shadow mounts is when exposing a single file
system that is used to address several logical volumes. In this
situation, a <link linkend="GVolumeMonitor"><type>GVolumeMonitor</type></link> implementation would create two
<link linkend="GVolume"><type>GVolume</type></link> objects (for example, one for the camera functionality of
the device and one for a SD card reader on the device) with
activation URIs <literal>gphoto2://[usb:001,002]/store1/</literal>
and <literal>gphoto2://[usb:001,002]/store2/</literal>. When the
underlying mount (with root
<literal>gphoto2://[usb:001,002]/</literal>) is mounted, said
<link linkend="GVolumeMonitor"><type>GVolumeMonitor</type></link> implementation would create two <link linkend="GMount"><type>GMount</type></link> objects
(each with their root matching the corresponding volume activation
root) that would shadow the original mount.
</para>
<para>
The proxy monitor in GVfs 2.26 and later, automatically creates and
manage shadow mounts (and shadows the underlying mount) if the
activation root on a <link linkend="GVolume"><type>GVolume</type></link> is set.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mount</parameter>&#160;:</term>
<listitem><simpara> A <link linkend="GMount"><type>GMount</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if <parameter>mount</parameter> is shadowed.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.20</para></refsect2>
<refsect2 id="g-mount-shadow" role="function" condition="since:2.20">
<title>g_mount_shadow ()</title>
<indexterm zone="g-mount-shadow" role="2.20"><primary sortas="mount_shadow">g_mount_shadow</primary></indexterm><programlisting><link linkend="void">void</link>                g_mount_shadow                      (<link linkend="GMount">GMount</link> *mount);</programlisting>
<para>
Increments the shadow count on <parameter>mount</parameter>. Usually used by
<link linkend="GVolumeMonitor"><type>GVolumeMonitor</type></link> implementations when creating a shadow mount for
<parameter>mount</parameter>, see <link linkend="g-mount-is-shadowed"><function>g_mount_is_shadowed()</function></link> for more information. The caller
will need to emit the <link linkend="GMount-changed"><type>"changed"</type></link> signal on <parameter>mount</parameter> manually.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mount</parameter>&#160;:</term>
<listitem><simpara> A <link linkend="GMount"><type>GMount</type></link>.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.20</para></refsect2>
<refsect2 id="g-mount-unshadow" role="function" condition="since:2.20">
<title>g_mount_unshadow ()</title>
<indexterm zone="g-mount-unshadow" role="2.20"><primary sortas="mount_unshadow">g_mount_unshadow</primary></indexterm><programlisting><link linkend="void">void</link>                g_mount_unshadow                    (<link linkend="GMount">GMount</link> *mount);</programlisting>
<para>
Decrements the shadow count on <parameter>mount</parameter>. Usually used by
<link linkend="GVolumeMonitor"><type>GVolumeMonitor</type></link> implementations when destroying a shadow mount for
<parameter>mount</parameter>, see <link linkend="g-mount-is-shadowed"><function>g_mount_is_shadowed()</function></link> for more information. The caller
will need to emit the <link linkend="GMount-changed"><type>"changed"</type></link> signal on <parameter>mount</parameter> manually.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mount</parameter>&#160;:</term>
<listitem><simpara> A <link linkend="GMount"><type>GMount</type></link>.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.20</para></refsect2>

</refsect1>

<refsect1 id="GMount.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GMount-changed" role="signal"><title>The <literal>&quot;changed&quot;</literal> signal</title>
<indexterm zone="GMount-changed"><primary sortas="Mount::changed">GMount::changed</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GMount">GMount</link>  *mount,
                                                        <link linkend="gpointer">gpointer</link> user_data)      : Run Last</programlisting>
<para>
Emitted when the mount has been changed.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mount</parameter>&#160;:</term>
<listitem><simpara> the object on which the signal is emitted
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="GMount-pre-unmount" role="signal"><title>The <literal>&quot;pre-unmount&quot;</literal> signal</title>
<indexterm zone="GMount-pre-unmount" role="2.22"><primary sortas="Mount::pre-unmount">GMount::pre-unmount</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GMount">GMount</link>  *mount,
                                                        <link linkend="gpointer">gpointer</link> user_data)      : Run Last</programlisting>
<para>
This signal is emitted when the <link linkend="GMount"><type>GMount</type></link> is about to be
unmounted.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mount</parameter>&#160;:</term>
<listitem><simpara> the object on which the signal is emitted
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist><para>Since 2.22</para></refsect2><refsect2 id="GMount-unmounted" role="signal"><title>The <literal>&quot;unmounted&quot;</literal> signal</title>
<indexterm zone="GMount-unmounted"><primary sortas="Mount::unmounted">GMount::unmounted</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GMount">GMount</link>  *mount,
                                                        <link linkend="gpointer">gpointer</link> user_data)      : Run Last</programlisting>
<para>
This signal is emitted when the <link linkend="GMount"><type>GMount</type></link> have been
unmounted. If the recipient is holding references to the
object they should release them so the object can be
finalized.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mount</parameter>&#160;:</term>
<listitem><simpara> the object on which the signal is emitted
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2>
</refsect1>



</refentry>
