~ubuntu-branches/ubuntu/utopic/libuser/utopic-proposed

« back to all changes in this revision

Viewing changes to docs/reference/xml/error.xml

  • Committer: Bazaar Package Importer
  • Author(s): Ghe Rivero
  • Date: 2005-09-30 16:22:04 UTC
  • Revision ID: james.westby@ubuntu.com-20050930162204-qubxaa7e2lbovdgh
Tags: upstream-0.54.dfsg.1
ImportĀ upstreamĀ versionĀ 0.54.dfsg.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<refentry id="libuser-error">
 
2
<refmeta>
 
3
<refentrytitle>error</refentrytitle>
 
4
<manvolnum>3</manvolnum>
 
5
<refmiscinfo>LIBUSER Library</refmiscinfo>
 
6
</refmeta>
 
7
 
 
8
<refnamediv>
 
9
<refname>error</refname><refpurpose>Functions for allocating and manipulating <link linkend="lu-error"><type>lu_error</type></link> structures.</refpurpose>
 
10
</refnamediv>
 
11
 
 
12
<refsynopsisdiv><title>Synopsis</title>
 
13
 
 
14
<synopsis>
 
15
 
 
16
 
 
17
 
 
18
#define     <link linkend="LU-ERROR-CHECK:CAPS">LU_ERROR_CHECK</link>                  (err_p_p)
 
19
<link linkend="void">void</link>        <link linkend="lu-error-new">lu_error_new</link>                    (<link linkend="lu-error-t">lu_error_t</link> **error,
 
20
                                             <link linkend="lu-status-t">lu_status_t</link> code,
 
21
                                             const <link linkend="char">char</link> *fmt,
 
22
                                             ...);
 
23
<link linkend="void">void</link>        <link linkend="lu-error-free">lu_error_free</link>                   (<link linkend="lu-error-t">lu_error_t</link> **error);
 
24
<link linkend="gboolean">gboolean</link>    <link linkend="lu-error-is-success">lu_error_is_success</link>             (<link linkend="lu-status-t">lu_status_t</link> status);
 
25
<link linkend="gboolean">gboolean</link>    <link linkend="lu-error-is-warning">lu_error_is_warning</link>             (<link linkend="lu-status-t">lu_status_t</link> status);
 
26
<link linkend="gboolean">gboolean</link>    <link linkend="lu-error-is-error">lu_error_is_error</link>               (<link linkend="lu-status-t">lu_status_t</link> status);
 
27
const <link linkend="char">char</link>* <link linkend="lu-strerror">lu_strerror</link>                     (<link linkend="lu-error-t">lu_error_t</link> *error);
 
28
</synopsis>
 
29
</refsynopsisdiv>
 
30
 
 
31
 
 
32
 
 
33
 
 
34
 
 
35
 
 
36
 
 
37
 
 
38
 
 
39
<refsect1>
 
40
<title>Description</title>
 
41
<para>
 
42
<filename>error.h</filename> includes declarations for allocating and
 
43
manipulating <link linkend="lu-error"><type>lu_error</type></link> structures.  These structures hold error and status
 
44
information passed between libuser, its modules, and applications.
 
45
</para>
 
46
 
 
47
<para>
 
48
A struct <link linkend="lu-error"><type>lu_error</type></link> contains an error code and a human-readable, possibly
 
49
translated error string.  The error string is using the encoding specified
 
50
by <literal>LC_CTYPE</literal> locale category.
 
51
</para>
 
52
</refsect1>
 
53
 
 
54
<refsect1>
 
55
<title>Details</title>
 
56
<refsect2>
 
57
<title><anchor id="LU-ERROR-CHECK:CAPS"/>LU_ERROR_CHECK()</title>
 
58
<indexterm><primary>LU_ERROR_CHECK</primary></indexterm><programlisting>#define     LU_ERROR_CHECK(err_p_p)</programlisting>
 
59
<para>
 
60
Checks that the given pointer to a pointer to a struct does not already point
 
61
to a valid <link linkend="lu-error"><type>lu_error</type></link> structure.  This macro is used by many internal functions
 
62
to check that an error has not already occurred when they are invoked.
 
63
</para><variablelist role="params">
 
64
<varlistentry><term><parameter>err_p_p</parameter>&nbsp;:</term>
 
65
<listitem><simpara>A pointer to a struct <link linkend="lu-error"><type>lu_error</type></link> * which will be checked.  If there
 
66
 
 
67
 
 
68
</simpara></listitem></varlistentry>
 
69
</variablelist></refsect2>
 
70
<refsect2>
 
71
<title><anchor id="lu-error-new"/>lu_error_new ()</title>
 
72
<indexterm><primary>lu_error_new</primary></indexterm><programlisting><link linkend="void">void</link>        lu_error_new                    (<link linkend="lu-error-t">lu_error_t</link> **error,
 
73
                                             <link linkend="lu-status-t">lu_status_t</link> code,
 
74
                                             const <link linkend="char">char</link> *fmt,
 
75
                                             ...);</programlisting>
 
76
<para>
 
77
Creates a new <link linkend="lu-error"><type>lu_error</type></link> structure.
 
78
</para><variablelist role="params">
 
79
<varlistentry><term><parameter>error</parameter>&nbsp;:</term>
 
80
<listitem><simpara>A pointer to a struct <link linkend="lu-error"><type>lu_error</type></link> * which will hold the newly-created
 
81
error structure. It must point to <link linkend="NULL:CAPS"><type>NULL</type></link> before calling this function.
 
82
</simpara></listitem></varlistentry>
 
83
<varlistentry><term><parameter>code</parameter>&nbsp;:</term>
 
84
<listitem><simpara>An error code
 
85
</simpara></listitem></varlistentry>
 
86
<varlistentry><term><parameter>fmt</parameter>&nbsp;:</term>
 
87
<listitem><simpara>Format string describing the error. If <link linkend="NULL:CAPS"><type>NULL</type></link>, a default string is used.
 
88
</simpara></listitem></varlistentry>
 
89
<varlistentry><term><parameter>...</parameter>&nbsp;:</term>
 
90
<listitem><simpara>Arguments for <parameter>fmt</parameter>, if necessary
 
91
 
 
92
 
 
93
</simpara></listitem></varlistentry>
 
94
</variablelist></refsect2>
 
95
<refsect2>
 
96
<title><anchor id="lu-error-free"/>lu_error_free ()</title>
 
97
<indexterm><primary>lu_error_free</primary></indexterm><programlisting><link linkend="void">void</link>        lu_error_free                   (<link linkend="lu-error-t">lu_error_t</link> **error);</programlisting>
 
98
<para>
 
99
Frees an <link linkend="lu-error"><type>lu_error</type></link> structure.
 
100
</para><variablelist role="params">
 
101
<varlistentry><term><parameter>error</parameter>&nbsp;:</term>
 
102
<listitem><simpara>A pointer to a pointer to the structure to be freed.  The pointer is set
 
103
to NULL after the error is freed.
 
104
 
 
105
 
 
106
</simpara></listitem></varlistentry>
 
107
</variablelist></refsect2>
 
108
<refsect2>
 
109
<title><anchor id="lu-error-is-success"/>lu_error_is_success ()</title>
 
110
<indexterm><primary>lu_error_is_success</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    lu_error_is_success             (<link linkend="lu-status-t">lu_status_t</link> status);</programlisting>
 
111
<para>
 
112
Check if the error code held by an error structure is a success code.
 
113
</para><variablelist role="params">
 
114
<varlistentry><term><parameter>status</parameter>&nbsp;:</term>
 
115
<listitem><simpara>
 
116
</simpara></listitem></varlistentry>
 
117
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>a <link linkend="gboolean"><type>gboolean</type></link> indicating whether or not the error is a success code.
 
118
 
 
119
 
 
120
</simpara></listitem></varlistentry>
 
121
</variablelist></refsect2>
 
122
<refsect2>
 
123
<title><anchor id="lu-error-is-warning"/>lu_error_is_warning ()</title>
 
124
<indexterm><primary>lu_error_is_warning</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    lu_error_is_warning             (<link linkend="lu-status-t">lu_status_t</link> status);</programlisting>
 
125
<para>
 
126
Check if the error code held by an error structure is a warning code.
 
127
</para><variablelist role="params">
 
128
<varlistentry><term><parameter>status</parameter>&nbsp;:</term>
 
129
<listitem><simpara>
 
130
</simpara></listitem></varlistentry>
 
131
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>a <link linkend="gboolean"><type>gboolean</type></link> indicating whether or not the error is a warning code.
 
132
 
 
133
 
 
134
</simpara></listitem></varlistentry>
 
135
</variablelist></refsect2>
 
136
<refsect2>
 
137
<title><anchor id="lu-error-is-error"/>lu_error_is_error ()</title>
 
138
<indexterm><primary>lu_error_is_error</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    lu_error_is_error               (<link linkend="lu-status-t">lu_status_t</link> status);</programlisting>
 
139
<para>
 
140
Check if the error code held by an error structure is an error code.
 
141
</para><variablelist role="params">
 
142
<varlistentry><term><parameter>status</parameter>&nbsp;:</term>
 
143
<listitem><simpara>
 
144
</simpara></listitem></varlistentry>
 
145
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>a <link linkend="gboolean"><type>gboolean</type></link> indicating whether or not the error is an error code.
 
146
 
 
147
 
 
148
</simpara></listitem></varlistentry>
 
149
</variablelist></refsect2>
 
150
<refsect2>
 
151
<title><anchor id="lu-strerror"/>lu_strerror ()</title>
 
152
<indexterm><primary>lu_strerror</primary></indexterm><programlisting>const <link linkend="char">char</link>* lu_strerror                     (<link linkend="lu-error-t">lu_error_t</link> *error);</programlisting>
 
153
<para>
 
154
Converts an <link linkend="lu-error"><type>lu_error</type></link> structure to a string describing the error.
 
155
If the <parameter>error->string</parameter> is <literal>NULL</literal>, returns a text representation of
 
156
 <parameter>error->code</parameter>.
 
157
</para><variablelist role="params">
 
158
<varlistentry><term><parameter>error</parameter>&nbsp;:</term>
 
159
<listitem><simpara>An error
 
160
</simpara></listitem></varlistentry>
 
161
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>error string valid at least until <parameter>error</parameter> is freed.
 
162
 
 
163
 
 
164
</simpara></listitem></varlistentry>
 
165
</variablelist></refsect2>
 
166
 
 
167
</refsect1>
 
168
 
 
169
 
 
170
 
 
171
 
 
172
</refentry>