38
38
<div class="refsynopsisdiv" title="Synopsis">
39
39
<a name="gconf-gconf-error.synopsis"></a><h2>Synopsis</h2>
40
40
<pre class="synopsis">enum <a class="link" href="gconf-gconf-error.html#GConfError" title="enum GConfError">GConfError</a>;
41
<a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="returnvalue">GError</span></a>* <a class="link" href="gconf-gconf-error.html#gconf-error-new" title="gconf_error_new ()">gconf_error_new</a> (<em class="parameter"><code><a class="link" href="gconf-gconf-error.html#GConfError" title="enum GConfError"><span class="type">GConfError</span></a> en</code></em>,
42
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *format</code></em>,
41
<a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="returnvalue">GError</span></a>* <a class="link" href="gconf-gconf-error.html#gconf-error-new" title="gconf_error_new ()">gconf_error_new</a> (<em class="parameter"><code><a class="link" href="gconf-gconf-error.html#GConfError" title="enum GConfError"><span class="type">GConfError</span></a> en</code></em>,
42
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *format</code></em>,
43
43
<em class="parameter"><code>...</code></em>);
44
<a href="/usr/share/gtk-doc/html/glib/glib-Quarks.html#GQuark"><span class="returnvalue">GQuark</span></a> <a class="link" href="gconf-gconf-error.html#gconf-error-quark" title="gconf_error_quark ()">gconf_error_quark</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
45
<span class="returnvalue">void</span> <a class="link" href="gconf-gconf-error.html#gconf-set-error" title="gconf_set_error ()">gconf_set_error</a> (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **err</code></em>,
44
<a href="http://library.gnome.org/devel/glib/unstable/glib-Quarks.html#GQuark"><span class="returnvalue">GQuark</span></a> <a class="link" href="gconf-gconf-error.html#gconf-error-quark" title="gconf_error_quark ()">gconf_error_quark</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
45
<span class="returnvalue">void</span> <a class="link" href="gconf-gconf-error.html#gconf-set-error" title="gconf_set_error ()">gconf_set_error</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **err</code></em>,
46
46
<em class="parameter"><code><a class="link" href="gconf-gconf-error.html#GConfError" title="enum GConfError"><span class="type">GConfError</span></a> en</code></em>,
47
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *format</code></em>,
47
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *format</code></em>,
48
48
<em class="parameter"><code>...</code></em>);
49
<a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="returnvalue">GError</span></a>* <a class="link" href="gconf-gconf-error.html#gconf-compose-errors" title="gconf_compose_errors ()">gconf_compose_errors</a> (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *err1</code></em>,
50
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *err2</code></em>);
49
<a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="returnvalue">GError</span></a>* <a class="link" href="gconf-gconf-error.html#gconf-compose-errors" title="gconf_compose_errors ()">gconf_compose_errors</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *err1</code></em>,
50
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *err2</code></em>);
53
53
<div class="refsect1" title="Description">
54
54
<a name="gconf-gconf-error.description"></a><h2>Description</h2>
56
The <a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> object is used to report errors that occur in GConf
56
The <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> object is used to report errors that occur in GConf
57
57
library routines. All functions that report errors work the same way:
59
59
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
60
60
<li class="listitem"><p>
61
The last argument to the function is a <a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>**, a pointer to a
62
location where a <a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>* can be placed.
61
The last argument to the function is a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>**, a pointer to a
62
location where a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>* can be placed.
64
64
<li class="listitem"><p>
65
65
This last argument may be <span class="symbol">NULL</span>, in which case no
68
68
<li class="listitem"><p>
69
69
If non-<span class="symbol">NULL</span>, the argument should be the address of a
70
<a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>* variable, which should be initialized to
70
<a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>* variable, which should be initialized to
71
71
<span class="symbol">NULL</span>.
73
73
<li class="listitem"><p>
74
If an error occurs, a <a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> will be allocated and placed in the
75
return location; the caller must free the <a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> with
76
<a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#g-error-free"><code class="function">g_error_free()</code></a>. If no error occurs, the return location will be
74
If an error occurs, a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> will be allocated and placed in the
75
return location; the caller must free the <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> with
76
<a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#g-error-free"><code class="function">g_error_free()</code></a>. If no error occurs, the return location will be
77
77
left untouched. That is, the test <code class="literal">error != NULL</code>
78
78
should always be a reliable indicator of whether the operation failed.
86
86
on success. In some cases, a <span class="symbol">NULL</span> return value
87
87
indicates failure. Either way, if the return value indicates failure
88
88
and you passed a non-<span class="symbol">NULL</span> value for the last argument
89
to the function, a <a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> will be returned. If the return value
90
indicates success, then a <a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> will never be returned. These
89
to the function, a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> will be returned. If the return value
90
indicates success, then a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> will never be returned. These
91
91
relationships are guaranteed; that is, you can reliably use the return
92
value to decide whether a <a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> was placed in the return
92
value to decide whether a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> was placed in the return
93
93
location. If a function does <span class="emphasis"><em>not</em></span> indicate
94
94
success/failure by return value, you must check whether the
95
<a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> is <span class="symbol">NULL</span> to detect errors.
95
<a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> is <span class="symbol">NULL</span> to detect errors.
98
98
Here's a short error handling example:
236
236
<div class="refsect2" title="gconf_error_new ()">
237
237
<a name="gconf-error-new"></a><h3>gconf_error_new ()</h3>
238
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="returnvalue">GError</span></a>* gconf_error_new (<em class="parameter"><code><a class="link" href="gconf-gconf-error.html#GConfError" title="enum GConfError"><span class="type">GConfError</span></a> en</code></em>,
239
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *format</code></em>,
238
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="returnvalue">GError</span></a>* gconf_error_new (<em class="parameter"><code><a class="link" href="gconf-gconf-error.html#GConfError" title="enum GConfError"><span class="type">GConfError</span></a> en</code></em>,
239
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *format</code></em>,
240
240
<em class="parameter"><code>...</code></em>);</pre>
242
242
Creates a new error. Normally the GConf library does this, but you
274
274
<div class="refsect2" title="gconf_error_quark ()">
275
275
<a name="gconf-error-quark"></a><h3>gconf_error_quark ()</h3>
276
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Quarks.html#GQuark"><span class="returnvalue">GQuark</span></a> gconf_error_quark (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
276
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Quarks.html#GQuark"><span class="returnvalue">GQuark</span></a> gconf_error_quark (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
278
Converts the string 'gconf-error-quark' to a <a href="/usr/share/gtk-doc/html/glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> and returns the value.
278
Converts the string 'gconf-error-quark' to a <a href="http://library.gnome.org/devel/glib/unstable/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> and returns the value.
280
280
<div class="variablelist"><table border="0">
281
281
<col align="left" valign="top">
283
283
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
284
<td>the <a href="/usr/share/gtk-doc/html/glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> representing the string.
284
<td>the <a href="http://library.gnome.org/devel/glib/unstable/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> representing the string.
290
290
<div class="refsect2" title="gconf_set_error ()">
291
291
<a name="gconf-set-error"></a><h3>gconf_set_error ()</h3>
292
<pre class="programlisting"><span class="returnvalue">void</span> gconf_set_error (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **err</code></em>,
292
<pre class="programlisting"><span class="returnvalue">void</span> gconf_set_error (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **err</code></em>,
293
293
<em class="parameter"><code><a class="link" href="gconf-gconf-error.html#GConfError" title="enum GConfError"><span class="type">GConfError</span></a> en</code></em>,
294
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *format</code></em>,
294
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *format</code></em>,
295
295
<em class="parameter"><code>...</code></em>);</pre>
297
297
Internal function.
326
326
<div class="refsect2" title="gconf_compose_errors ()">
327
327
<a name="gconf-compose-errors"></a><h3>gconf_compose_errors ()</h3>
328
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="returnvalue">GError</span></a>* gconf_compose_errors (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *err1</code></em>,
329
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *err2</code></em>);</pre>
328
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="returnvalue">GError</span></a>* gconf_compose_errors (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *err1</code></em>,
329
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *err2</code></em>);</pre>
331
331
Internal function.