|
Server : Apache/2.2.2 (Fedora) System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686 User : apache ( 48) PHP Version : 5.2.9 Disable Function : NONE Directory : /usr/share/gtk-doc/html/libuser/ |
Upload File : |
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>error</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
<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.4 (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" 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></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><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 href="libuser-error.html#LU-ERROR-CHECK:CAPS">LU_ERROR_CHECK</a> (err_p_p)
void <a href="libuser-error.html#lu-error-new">lu_error_new</a> (lu_error_t **error,
lu_status_t code,
const char *fmt,
...);
void <a href="libuser-error.html#lu-error-free">lu_error_free</a> (lu_error_t **error);
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> <a href="libuser-error.html#lu-error-is-success">lu_error_is_success</a> (lu_status_t status);
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> <a href="libuser-error.html#lu-error-is-warning">lu_error_is_warning</a> (lu_status_t status);
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> <a href="libuser-error.html#lu-error-is-error">lu_error_is_error</a> (lu_status_t status);
const char* <a href="libuser-error.html#lu-strerror">lu_strerror</a> (lu_error_t *error);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id2534043"></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="id2534089"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id2534095"></a><h3>
<a name="LU-ERROR-CHECK:CAPS"></a>LU_ERROR_CHECK()</h3>
<a class="indexterm" name="id2534105"></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>
<span class="term"><em class="parameter"><code>err_p_p</code></em> :</span></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="id2534159"></a><h3>
<a name="lu-error-new"></a>lu_error_new ()</h3>
<a class="indexterm" name="id2534169"></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>
<span class="term"><em class="parameter"><code>error</code></em> :</span></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="../glib/glib-Standard-Macros.html#NULL:CAPS"
><span class="type">NULL</span></a> before calling this function.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>code</code></em> :</span></td>
<td>An error code
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>fmt</code></em> :</span></td>
<td>Format string describing the error. If <a
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
><span class="type">NULL</span></a>, a default string is used.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>...</code></em> :</span></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="id2534314"></a><h3>
<a name="lu-error-free"></a>lu_error_free ()</h3>
<a class="indexterm" name="id2534324"></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>
<span class="term"><em class="parameter"><code>error</code></em> :</span></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="id2534381"></a><h3>
<a name="lu-error-is-success"></a>lu_error_is_success ()</h3>
<a class="indexterm" name="id2534391"></a><pre class="programlisting"><a
href="../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>
<span class="term"><em class="parameter"><code>status</code></em> :</span></td>
<td>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td>a <a
href="../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="id2534457"></a><h3>
<a name="lu-error-is-warning"></a>lu_error_is_warning ()</h3>
<a class="indexterm" name="id2534468"></a><pre class="programlisting"><a
href="../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>
<span class="term"><em class="parameter"><code>status</code></em> :</span></td>
<td>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td>a <a
href="../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="id2534534"></a><h3>
<a name="lu-error-is-error"></a>lu_error_is_error ()</h3>
<a class="indexterm" name="id2534544"></a><pre class="programlisting"><a
href="../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>
<span class="term"><em class="parameter"><code>status</code></em> :</span></td>
<td>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td>a <a
href="../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="id2534610"></a><h3>
<a name="lu-strerror"></a>lu_strerror ()</h3>
<a class="indexterm" name="id2534620"></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 <code class="literal">NULL</code>, 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>
<span class="term"><em class="parameter"><code>error</code></em> :</span></td>
<td>An error
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></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>
<table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle">
<td align="left"><a accesskey="p" href="libuser-entity.html"><b><< entity</b></a></td>
<td align="right"><a accesskey="n" href="libuser-prompt.html"><b>prompt >></b></a></td>
</tr></table>
</body>
</html>