?? glib-error-reporting.html
字號:
<hr><div class="refsect2" lang="en"><a name="id2949055"></a><h3><a name="g-error-free"></a>g_error_free ()</h3><a class="indexterm" name="id2949068"></a><pre class="programlisting">void g_error_free (<a class="link" href="glib-Error-Reporting.html#GError">GError</a> *error);</pre><p>Frees a <a class="link" href="glib-Error-Reporting.html#GError"><span class="type">GError</span></a> and associated resources.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td><td> a <a class="link" href="glib-Error-Reporting.html#GError"><span class="type">GError</span></a></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2949134"></a><h3><a name="g-error-copy"></a>g_error_copy ()</h3><a class="indexterm" name="id2949147"></a><pre class="programlisting"><a class="link" href="glib-Error-Reporting.html#GError">GError</a>* g_error_copy (const <a class="link" href="glib-Error-Reporting.html#GError">GError</a> *error);</pre><p>Makes a copy of <em class="parameter"><code>error</code></em>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td><td> a <a class="link" href="glib-Error-Reporting.html#GError"><span class="type">GError</span></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> a new <a class="link" href="glib-Error-Reporting.html#GError"><span class="type">GError</span></a></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2949228"></a><h3><a name="g-error-matches"></a>g_error_matches ()</h3><a class="indexterm" name="id2949241"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> g_error_matches (const <a class="link" href="glib-Error-Reporting.html#GError">GError</a> *error, <a class="link" href="glib-Quarks.html#GQuark">GQuark</a> domain, <a class="link" href="glib-Basic-Types.html#gint">gint</a> code);</pre><p>Returns <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>error</code></em> matches <em class="parameter"><code>domain</code></em> and <em class="parameter"><code>code</code></em>, <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>otherwise.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td><td> a <a class="link" href="glib-Error-Reporting.html#GError"><span class="type">GError</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td><td> an error domain</td></tr><tr><td><p><span class="term"><em class="parameter"><code>code</code></em> :</span></p></td><td> an error code</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> whether <em class="parameter"><code>error</code></em> has <em class="parameter"><code>domain</code></em> and <em class="parameter"><code>code</code></em></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2949408"></a><h3><a name="g-set-error"></a>g_set_error ()</h3><a class="indexterm" name="id2949421"></a><pre class="programlisting">void g_set_error (<a class="link" href="glib-Error-Reporting.html#GError">GError</a> **err, <a class="link" href="glib-Quarks.html#GQuark">GQuark</a> domain, <a class="link" href="glib-Basic-Types.html#gint">gint</a> code, const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *format, ...);</pre><p>Does nothing if <em class="parameter"><code>err</code></em> is <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>; if <em class="parameter"><code>err</code></em> is non-<a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, then *<em class="parameter"><code>err</code></em> mustbe <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. A new <a class="link" href="glib-Error-Reporting.html#GError"><span class="type">GError</span></a> is created and assigned to *<em class="parameter"><code>err</code></em>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>err</code></em> :</span></p></td><td> a return location for a <a class="link" href="glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td><td> error domain</td></tr><tr><td><p><span class="term"><em class="parameter"><code>code</code></em> :</span></p></td><td> error code </td></tr><tr><td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td><td> <code class="function">printf()</code>-style format</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td> args for <em class="parameter"><code>format</code></em> </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2949646"></a><h3><a name="g-propagate-error"></a>g_propagate_error ()</h3><a class="indexterm" name="id2949660"></a><pre class="programlisting">void g_propagate_error (<a class="link" href="glib-Error-Reporting.html#GError">GError</a> **dest, <a class="link" href="glib-Error-Reporting.html#GError">GError</a> *src);</pre><p>If <em class="parameter"><code>dest</code></em> is <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, free <em class="parameter"><code>src</code></em>; otherwise, moves <em class="parameter"><code>src</code></em> into *<em class="parameter"><code>dest</code></em>.The error variable <em class="parameter"><code>dest</code></em> points to must be <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>dest</code></em> :</span></p></td><td> error return location</td></tr><tr><td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td><td> error to move into the return location</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2949781"></a><h3><a name="g-clear-error"></a>g_clear_error ()</h3><a class="indexterm" name="id2949794"></a><pre class="programlisting">void g_clear_error (<a class="link" href="glib-Error-Reporting.html#GError">GError</a> **err);</pre><p>If <em class="parameter"><code>err</code></em> is <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, does nothing. If <em class="parameter"><code>err</code></em> is non-<a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>,calls <a class="link" href="glib-Error-Reporting.html#g-error-free"><code class="function">g_error_free()</code></a> on *<em class="parameter"><code>err</code></em> and sets *<em class="parameter"><code>err</code></em> to <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>err</code></em> :</span></p></td><td> a <a class="link" href="glib-Error-Reporting.html#GError"><span class="type">GError</span></a> return location</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2949916"></a><h3><a name="g-prefix-error"></a>g_prefix_error ()</h3><a class="indexterm" name="id2949931"></a><pre class="programlisting">void g_prefix_error (<a class="link" href="glib-Error-Reporting.html#GError">GError</a> **err, const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *format, ...);</pre><p>Formats a string according to <em class="parameter"><code>format</code></em> andprefix it to an existing error message. If<em class="parameter"><code>err</code></em> is <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> (ie: no error variable) then donothing.</p><p>If *<em class="parameter"><code>err</code></em> is <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> (ie: an error variable ispresent but there is no error condition) thenalso do nothing. Whether or not it makessense to take advantage of this feature is upto you.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>err</code></em> :</span></p></td><td> a return location for a <a class="link" href="glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td><td> <code class="function">printf()</code>-style format string</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td> arguments to <em class="parameter"><code>format</code></em></td></tr></tbody></table></div><p class="since">Since 2.16</p></div><hr><div class="refsect2" lang="en"><a name="id2950104"></a><h3><a name="g-propagate-prefixed-error"></a>g_propagate_prefixed_error ()</h3><a class="indexterm" name="id2950121"></a><pre class="programlisting">void g_propagate_prefixed_error (<a class="link" href="glib-Error-Reporting.html#GError">GError</a> **dest, <a class="link" href="glib-Error-Reporting.html#GError">GError</a> *src, const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *format, ...);</pre><p>If <em class="parameter"><code>dest</code></em> is <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, free <em class="parameter"><code>src</code></em>; otherwise,moves <em class="parameter"><code>src</code></em> into *<em class="parameter"><code>dest</code></em>. *<em class="parameter"><code>dest</code></em> must be <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.After the move, add a prefix as with <a class="link" href="glib-Error-Reporting.html#g-prefix-error"><code class="function">g_prefix_error()</code></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>dest</code></em> :</span></p></td><td> error return location</td></tr><tr><td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td><td> error to move into the return location</td></tr><tr><td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td><td> <code class="function">printf()</code>-style format string</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td> arguments to <em class="parameter"><code>format</code></em></td></tr></tbody></table></div><p class="since">Since 2.16</p></div></div><div class="refsect1" lang="en"><a name="id2950314"></a><div class="refsect2" lang="en"><a name="id2950315"></a></div><hr><div class="refsect2" lang="en"><a name="id2950316"></a></div></div></div></body></html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -