1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>error</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
<link rel="start" href="index.html" title="libuser Reference Manual">
<link rel="up" href="ch01.html" title="libuser">
<link rel="prev" href="libuser-entity.html" title="entity">
<link rel="next" href="libuser-prompt.html" title="prompt">
<meta name="generator" content="GTK-Doc V1.9 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="ch01.html" title="libuser">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="libuser-entity.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">libuser Reference Manual</th>
<td><a accesskey="n" href="libuser-prompt.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id3087054" class="shortcut">Top</a>
 | 
<a href="#id3087234" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="libuser-error"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id3087054"></a><span class="refentrytitle">error</span>
</h2>
<p>error — Functions for allocating and manipulating <span class="type">lu_error</span> structures.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">
#define <a class="link" href="libuser-error.html#LU-ERROR-CHECK:CAPS">LU_ERROR_CHECK</a> (err_p_p)
void <a class="link" href="libuser-error.html#lu-error-new">lu_error_new</a> (lu_error_t **error,
lu_status_t code,
const char *fmt,
...);
void <a class="link" href="libuser-error.html#lu-error-free">lu_error_free</a> (lu_error_t **error);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a> <a class="link" href="libuser-error.html#lu-error-is-success">lu_error_is_success</a> (lu_status_t status);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a> <a class="link" href="libuser-error.html#lu-error-is-warning">lu_error_is_warning</a> (lu_status_t status);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a> <a class="link" href="libuser-error.html#lu-error-is-error">lu_error_is_error</a> (lu_status_t status);
const char* <a class="link" href="libuser-error.html#lu-strerror">lu_strerror</a> (lu_error_t *error);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3087234"></a><h2>Description</h2>
<p>
<code class="filename">error.h</code> includes declarations for allocating and
manipulating <span class="type">lu_error</span> structures. These structures hold error and status
information passed between libuser, its modules, and applications.
</p>
<p>
A struct <span class="type">lu_error</span> contains an error code and a human-readable, possibly
translated error string. The error string is using the encoding specified
by <code class="literal">LC_CTYPE</code> locale category.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id3087290"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id3087300"></a><h3>
<a name="LU-ERROR-CHECK:CAPS"></a>LU_ERROR_CHECK()</h3>
<a class="indexterm" name="id3087312"></a><pre class="programlisting">#define LU_ERROR_CHECK(err_p_p)</pre>
<p>
Checks that the given pointer to a pointer to a struct does not already point
to a valid <span class="type">lu_error</span> structure. This macro is used by many internal functions
to check that an error has not already occurred when they are invoked.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>err_p_p</code></em> :</span></p></td>
<td>A pointer to a struct <span class="type">lu_error</span> * which will be checked. If there
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3087366"></a><h3>
<a name="lu-error-new"></a>lu_error_new ()</h3>
<a class="indexterm" name="id3087379"></a><pre class="programlisting">void lu_error_new (lu_error_t **error,
lu_status_t code,
const char *fmt,
...);</pre>
<p>
Creates a new <span class="type">lu_error</span> structure.
</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 pointer to a struct <span class="type">lu_error</span> * which will hold the newly-created
error structure. It must point to <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
><span class="type">NULL</span></a> before calling this function.
</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"><em class="parameter"><code>fmt</code></em> :</span></p></td>
<td>Format string describing the error. If <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
><span class="type">NULL</span></a>, a default string is used.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
<td>Arguments for <em class="parameter"><code>fmt</code></em>, if necessary
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3087525"></a><h3>
<a name="lu-error-free"></a>lu_error_free ()</h3>
<a class="indexterm" name="id3087537"></a><pre class="programlisting">void lu_error_free (lu_error_t **error);</pre>
<p>
Frees an <span class="type">lu_error</span> structure.
</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 pointer to a pointer to the structure to be freed. The pointer is set
to NULL after the error is freed.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3087594"></a><h3>
<a name="lu-error-is-success"></a>lu_error_is_success ()</h3>
<a class="indexterm" name="id3087607"></a><pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a> lu_error_is_success (lu_status_t status);</pre>
<p>
Check if the error code held by an error structure is a success code.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>status</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>a <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
><span class="type">gboolean</span></a> indicating whether or not the error is a success code.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3087673"></a><h3>
<a name="lu-error-is-warning"></a>lu_error_is_warning ()</h3>
<a class="indexterm" name="id3087686"></a><pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a> lu_error_is_warning (lu_status_t status);</pre>
<p>
Check if the error code held by an error structure is a warning code.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>status</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>a <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
><span class="type">gboolean</span></a> indicating whether or not the error is a warning code.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3087752"></a><h3>
<a name="lu-error-is-error"></a>lu_error_is_error ()</h3>
<a class="indexterm" name="id3087765"></a><pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a> lu_error_is_error (lu_status_t status);</pre>
<p>
Check if the error code held by an error structure is an error code.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>status</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>a <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
><span class="type">gboolean</span></a> indicating whether or not the error is an error code.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3087831"></a><h3>
<a name="lu-strerror"></a>lu_strerror ()</h3>
<a class="indexterm" name="id3087843"></a><pre class="programlisting">const char* lu_strerror (lu_error_t *error);</pre>
<p>
Converts an <span class="type">lu_error</span> structure to a string describing the error.
If the <em class="parameter"><code>error->string</code></em> is <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a>, returns a text representation of
<em class="parameter"><code>error->code</code></em>.
</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>An error
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>error string valid at least until <em class="parameter"><code>error</code></em> is freed.
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id3087941"></a><div class="refsect2" lang="en"><a name="id3087942"></a></div>
<hr>
<div class="refsect2" lang="en"><a name="id3087943"></a></div>
</div>
</div>
</body>
</html>
|