4
4
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
6
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
6
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
7
7
<link rel="start" href="index.html" title="libuser Reference Manual">
8
8
<link rel="up" href="ch01.html" title="libuser">
9
9
<link rel="prev" href="libuser-entity.html" title="entity">
10
10
<link rel="next" href="libuser-prompt.html" title="prompt">
11
<meta name="generator" content="GTK-Doc V1.6 (XML mode)">
11
<meta name="generator" content="GTK-Doc V1.8 (XML mode)">
12
12
<link rel="stylesheet" href="style.css" type="text/css">
13
13
<link rel="chapter" href="ch01.html" title="libuser">
21
21
<th width="100%" align="center">libuser Reference Manual</th>
22
22
<td><a accesskey="n" href="libuser-prompt.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
24
<tr><td colspan="5" class="shortcuts"><nobr><a href="#top_of_page" class="shortcut">Top</a>
24
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2870961" class="shortcut">Top</a>
26
<a href="#desc" class="shortcut">Description</a></nobr></td></tr>
26
<a href="#id2871140" class="shortcut">Description</a></nobr></td></tr>
28
28
<div class="refentry" lang="en">
29
29
<a name="libuser-error"></a><div class="titlepage"></div>
30
30
<div class="refnamediv"><table width="100%"><tr>
32
<h2><span class="refentrytitle"><a name="top_of_page"></a>error</span></h2>
33
<a name="id2870961"></a><span class="refentrytitle">error</span>
33
35
<p>error — Functions for allocating and manipulating <span class="type">lu_error</span> structures.</p>
35
37
<td valign="top" align="right"></td>
36
38
</tr></table></div>
37
39
<div class="refsynopsisdiv">
38
<a name="synopsis"></a><h2>Synopsis</h2>
39
41
<pre class="synopsis">
43
#define <a href="libuser-error.html#LU-ERROR-CHECK:CAPS">LU_ERROR_CHECK</a> (err_p_p)
44
void <a href="libuser-error.html#lu-error-new">lu_error_new</a> (lu_error_t **error,
48
void <a href="libuser-error.html#lu-error-free">lu_error_free</a> (lu_error_t **error);
50
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
51
>gboolean</a> <a href="libuser-error.html#lu-error-is-success">lu_error_is_success</a> (lu_status_t status);
53
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
54
>gboolean</a> <a href="libuser-error.html#lu-error-is-warning">lu_error_is_warning</a> (lu_status_t status);
56
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
57
>gboolean</a> <a href="libuser-error.html#lu-error-is-error">lu_error_is_error</a> (lu_status_t status);
58
const char* <a href="libuser-error.html#lu-strerror">lu_strerror</a> (lu_error_t *error);
45
#define <a class="link" href="libuser-error.html#LU-ERROR-CHECK:CAPS">LU_ERROR_CHECK</a> (err_p_p)
46
void <a class="link" href="libuser-error.html#lu-error-new">lu_error_new</a> (lu_error_t **error,
50
void <a class="link" href="libuser-error.html#lu-error-free">lu_error_free</a> (lu_error_t **error);
52
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
53
>gboolean</a> <a class="link" href="libuser-error.html#lu-error-is-success">lu_error_is_success</a> (lu_status_t status);
55
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
56
>gboolean</a> <a class="link" href="libuser-error.html#lu-error-is-warning">lu_error_is_warning</a> (lu_status_t status);
58
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
59
>gboolean</a> <a class="link" href="libuser-error.html#lu-error-is-error">lu_error_is_error</a> (lu_status_t status);
60
const char* <a class="link" href="libuser-error.html#lu-strerror">lu_strerror</a> (lu_error_t *error);
61
63
<div class="refsect1" lang="en">
62
<a name="desc"></a><h2>Description</h2>
64
<a name="id2871140"></a><h2>Description</h2>
64
66
<code class="filename">error.h</code> includes declarations for allocating and
65
67
manipulating <span class="type">lu_error</span> structures. These structures hold error and status
74
76
<div class="refsect1" lang="en">
75
<a name="details"></a><h2>Details</h2>
77
<a name="id2871197"></a><h2>Details</h2>
76
78
<div class="refsect2" lang="en">
77
<a name="id3072148"></a><h3>
79
<a name="id2871207"></a><h3>
78
80
<a name="LU-ERROR-CHECK:CAPS"></a>LU_ERROR_CHECK()</h3>
79
<a class="indexterm" name="id3072158"></a><pre class="programlisting">#define LU_ERROR_CHECK(err_p_p)</pre>
81
<a class="indexterm" name="id2871219"></a><pre class="programlisting">#define LU_ERROR_CHECK(err_p_p)</pre>
81
83
Checks that the given pointer to a pointer to a struct does not already point
82
84
to a valid <span class="type">lu_error</span> structure. This macro is used by many internal functions
98
99
<div class="refsect2" lang="en">
99
<a name="id3072212"></a><h3>
100
<a name="id2871273"></a><h3>
100
101
<a name="lu-error-new"></a>lu_error_new ()</h3>
101
<a class="indexterm" name="id3072225"></a><pre class="programlisting">void lu_error_new (lu_error_t **error,
102
<a class="indexterm" name="id2871286"></a><pre class="programlisting">void lu_error_new (lu_error_t **error,
106
107
Creates a new <span class="type">lu_error</span> structure.
109
110
<col align="left" valign="top">
113
<span class="term"><em class="parameter"><code>error</code></em> :</span></td>
113
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
114
114
<td>A pointer to a struct <span class="type">lu_error</span> * which will hold the newly-created
115
115
error structure. It must point to <a
116
116
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
122
<span class="term"><em class="parameter"><code>code</code></em> :</span></td>
121
<td><p><span class="term"><em class="parameter"><code>code</code></em> :</span></p></td>
123
122
<td>An error code
128
<span class="term"><em class="parameter"><code>fmt</code></em> :</span></td>
126
<td><p><span class="term"><em class="parameter"><code>fmt</code></em> :</span></p></td>
129
127
<td>Format string describing the error. If <a
130
128
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
131
129
><span class="type">NULL</span></a>, a default string is used.
136
<span class="term"><em class="parameter"><code>...</code></em> :</span></td>
133
<td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
137
134
<td>Arguments for <em class="parameter"><code>fmt</code></em>, if necessary
146
143
<div class="refsect2" lang="en">
147
<a name="id3072370"></a><h3>
144
<a name="id2871432"></a><h3>
148
145
<a name="lu-error-free"></a>lu_error_free ()</h3>
149
<a class="indexterm" name="id3072382"></a><pre class="programlisting">void lu_error_free (lu_error_t **error);</pre>
146
<a class="indexterm" name="id2871444"></a><pre class="programlisting">void lu_error_free (lu_error_t **error);</pre>
151
148
Frees an <span class="type">lu_error</span> structure.
153
150
<div class="variablelist"><table border="0">
154
151
<col align="left" valign="top">
157
<span class="term"><em class="parameter"><code>error</code></em> :</span></td>
153
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
158
154
<td>A pointer to a pointer to the structure to be freed. The pointer is set
159
155
to NULL after the error is freed.
167
163
<div class="refsect2" lang="en">
168
<a name="id3072438"></a><h3>
164
<a name="id2871500"></a><h3>
169
165
<a name="lu-error-is-success"></a>lu_error_is_success ()</h3>
170
<a class="indexterm" name="id3072452"></a><pre class="programlisting"><a
166
<a class="indexterm" name="id2871513"></a><pre class="programlisting"><a
171
167
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
172
>gboolean</a> lu_error_is_success (lu_status_t status);</pre>
168
>gboolean</a> lu_error_is_success (lu_status_t status);</pre>
174
170
Check if the error code held by an error structure is a success code.
177
173
<col align="left" valign="top">
181
<span class="term"><em class="parameter"><code>status</code></em> :</span></td>
176
<td><p><span class="term"><em class="parameter"><code>status</code></em> :</span></p></td>
187
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
181
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
189
183
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
190
184
><span class="type">gboolean</span></a> indicating whether or not the error is a success code.
199
193
<div class="refsect2" lang="en">
200
<a name="id3072518"></a><h3>
194
<a name="id2871580"></a><h3>
201
195
<a name="lu-error-is-warning"></a>lu_error_is_warning ()</h3>
202
<a class="indexterm" name="id3072530"></a><pre class="programlisting"><a
196
<a class="indexterm" name="id2871593"></a><pre class="programlisting"><a
203
197
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
204
>gboolean</a> lu_error_is_warning (lu_status_t status);</pre>
198
>gboolean</a> lu_error_is_warning (lu_status_t status);</pre>
206
200
Check if the error code held by an error structure is a warning code.
209
203
<col align="left" valign="top">
213
<span class="term"><em class="parameter"><code>status</code></em> :</span></td>
206
<td><p><span class="term"><em class="parameter"><code>status</code></em> :</span></p></td>
219
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
211
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
221
213
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
222
214
><span class="type">gboolean</span></a> indicating whether or not the error is a warning code.
231
223
<div class="refsect2" lang="en">
232
<a name="id3072596"></a><h3>
224
<a name="id2871659"></a><h3>
233
225
<a name="lu-error-is-error"></a>lu_error_is_error ()</h3>
234
<a class="indexterm" name="id3072609"></a><pre class="programlisting"><a
226
<a class="indexterm" name="id2871672"></a><pre class="programlisting"><a
235
227
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
236
>gboolean</a> lu_error_is_error (lu_status_t status);</pre>
228
>gboolean</a> lu_error_is_error (lu_status_t status);</pre>
238
230
Check if the error code held by an error structure is an error code.
241
233
<col align="left" valign="top">
245
<span class="term"><em class="parameter"><code>status</code></em> :</span></td>
236
<td><p><span class="term"><em class="parameter"><code>status</code></em> :</span></p></td>
251
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
241
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
253
243
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
254
244
><span class="type">gboolean</span></a> indicating whether or not the error is an error code.
263
253
<div class="refsect2" lang="en">
264
<a name="id3072675"></a><h3>
254
<a name="id2871738"></a><h3>
265
255
<a name="lu-strerror"></a>lu_strerror ()</h3>
266
<a class="indexterm" name="id3072687"></a><pre class="programlisting">const char* lu_strerror (lu_error_t *error);</pre>
256
<a class="indexterm" name="id2871750"></a><pre class="programlisting">const char* lu_strerror (lu_error_t *error);</pre>
268
258
Converts an <span class="type">lu_error</span> structure to a string describing the error.
269
259
If the <em class="parameter"><code>error->string</code></em> is <a
275
265
<col align="left" valign="top">
279
<span class="term"><em class="parameter"><code>error</code></em> :</span></td>
268
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
285
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
273
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
286
274
<td>error string valid at least until <em class="parameter"><code>error</code></em> is freed.