1 <refentry id="gnome-vfs-20-gnome-vfs-context">
3 <refentrytitle>GnomeVFSContext</refentrytitle>
4 <manvolnum>3</manvolnum>
5 <refmiscinfo>GNOME-VFS-2.0 Library</refmiscinfo>
9 <refname>GnomeVFSContext</refname><refpurpose>
10 contexts allows modules to track thread usage and cancellation properly</refpurpose>
13 <refsynopsisdiv><title>Synopsis</title>
19 <link linkend="GnomeVFSContext">GnomeVFSContext</link>* <link linkend="gnome-vfs-context-new">gnome_vfs_context_new</link> (void);
20 <link linkend="void">void</link> <link linkend="gnome-vfs-context-free">gnome_vfs_context_free</link> (<link linkend="GnomeVFSContext">GnomeVFSContext</link> *ctx);
21 <link linkend="GnomeVFSCancellation">GnomeVFSCancellation</link>* <link linkend="gnome-vfs-context-get-cancellation">gnome_vfs_context_get_cancellation</link>
22 (const <link linkend="GnomeVFSContext">GnomeVFSContext</link> *ctx);
23 #define <link linkend="gnome-vfs-context-check-cancellation">gnome_vfs_context_check_cancellation</link>(x)
24 const <link linkend="GnomeVFSContext">GnomeVFSContext</link>* <link linkend="gnome-vfs-context-peek-current">gnome_vfs_context_peek_current</link>
26 <link linkend="gboolean">gboolean</link> <link linkend="gnome-vfs-context-check-cancellation-current">gnome_vfs_context_check_cancellation_current</link>
40 <title>Description</title>
47 <title>Details</title>
49 <title><anchor id="gnome-vfs-context-new"/>gnome_vfs_context_new ()</title>
50 <indexterm><primary>gnome_vfs_context_new</primary></indexterm><programlisting><link linkend="GnomeVFSContext">GnomeVFSContext</link>* gnome_vfs_context_new (void);</programlisting>
52 Creates a new context and cancellation object. Must be called
53 from the main glib event loop.</para>
56 </para><variablelist role="params">
57 <varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a newly allocated <link linkend="GnomeVFSContext"><type>GnomeVFSContext</type></link>
58 </simpara></listitem></varlistentry>
59 </variablelist></refsect2>
61 <title><anchor id="gnome-vfs-context-free"/>gnome_vfs_context_free ()</title>
62 <indexterm><primary>gnome_vfs_context_free</primary></indexterm><programlisting><link linkend="void">void</link> gnome_vfs_context_free (<link linkend="GnomeVFSContext">GnomeVFSContext</link> *ctx);</programlisting>
64 Free <parameter>ctx</parameter> and destroy the associated <link linkend="GnomeVFSCancellation"><type>GnomeVFSCancellation</type></link>.</para>
67 </para><variablelist role="params">
68 <varlistentry><term><parameter>ctx</parameter> :</term>
69 <listitem><simpara> context to be freed
70 </simpara></listitem></varlistentry>
71 </variablelist></refsect2>
73 <title><anchor id="gnome-vfs-context-get-cancellation"/>gnome_vfs_context_get_cancellation ()</title>
74 <indexterm><primary>gnome_vfs_context_get_cancellation</primary></indexterm><programlisting><link linkend="GnomeVFSCancellation">GnomeVFSCancellation</link>* gnome_vfs_context_get_cancellation
75 (const <link linkend="GnomeVFSContext">GnomeVFSContext</link> *ctx);</programlisting>
77 Retrieve the <link linkend="GnomeVFSCancellation"><type>GnomeVFSCancellation</type></link> associated with <parameter>ctx</parameter>.</para>
80 </para><variablelist role="params">
81 <varlistentry><term><parameter>ctx</parameter> :</term>
82 <listitem><simpara> context to get the <link linkend="GnomeVFSCancellation"><type>GnomeVFSCancellation</type></link> from
83 </simpara></listitem></varlistentry>
84 <varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <parameter>ctx</parameter> 's <link linkend="GnomeVFSCancellation"><type>GnomeVFSCancellation</type></link>
85 </simpara></listitem></varlistentry>
86 </variablelist></refsect2>
88 <title><anchor id="gnome-vfs-context-check-cancellation"/>gnome_vfs_context_check_cancellation()</title>
89 <indexterm><primary>gnome_vfs_context_check_cancellation</primary></indexterm><programlisting>#define gnome_vfs_context_check_cancellation(x)</programlisting>
92 </para><variablelist role="params">
93 <varlistentry><term><parameter>x</parameter> :</term>
97 </simpara></listitem></varlistentry>
98 </variablelist></refsect2>
100 <title><anchor id="gnome-vfs-context-peek-current"/>gnome_vfs_context_peek_current ()</title>
101 <indexterm><primary>gnome_vfs_context_peek_current</primary></indexterm><programlisting>const <link linkend="GnomeVFSContext">GnomeVFSContext</link>* gnome_vfs_context_peek_current
102 (void);</programlisting>
104 Get the currently active context. It shouldn't be
105 manipulated but can be compared to context's the module
106 holds to determine whether they are active.</para>
109 </para><variablelist role="params">
110 <varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the currently active <link linkend="GnomeVFSContext"><type>GnomeVFSContext</type></link>
111 </simpara></listitem></varlistentry>
112 </variablelist></refsect2>
114 <title><anchor id="gnome-vfs-context-check-cancellation-current"/>gnome_vfs_context_check_cancellation_current ()</title>
115 <indexterm><primary>gnome_vfs_context_check_cancellation_current</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> gnome_vfs_context_check_cancellation_current
116 (void);</programlisting>
118 Check to see if the currently active context has been cancelled.</para>
121 </para><variablelist role="params">
122 <varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <literal>TRUE</literal> if the currently active context has been cancelled, otherwise <literal>FALSE</literal>
123 </simpara></listitem></varlistentry>
124 </variablelist></refsect2>