Debian Codegraph @

docs/api_reference/C/dbset_errfile.html

raw symbols SCIP
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6 <title>DB-&gt;set_errfile()</title>
7 <link rel="stylesheet" href="apiReference.css" type="text/css" />
8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
9 <link rel="start" href="index.html" title="Berkeley DB C API Reference" />
10 <link rel="up" href="db.html" title="Chapter 2.  The DB Handle" />
11 <link rel="prev" href="dbset_errcall.html" title="DB-&gt;set_errcall()" />
12 <link rel="next" href="dbset_errpfx.html" title="DB-&gt;set_errpfx()" />
13 </head>
14 <body>
15 <div xmlns="" class="navheader">
16 <div class="libver">
17 <p>Library Version 11.2.5.3</p>
18 </div>
19 <table width="100%" summary="Navigation header">
20 <tr>
21 <th colspan="3" align="center">DB-&gt;set_errfile()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="dbset_errcall.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 2. 
26 The DB Handle
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="dbset_errpfx.html">Next</a></td>
29 </tr>
30 </table>
31 <hr />
32 </div>
33 <div class="sect1" lang="en" xml:lang="en">
34 <div class="titlepage">
35 <div>
36 <div>
37 <h2 class="title" style="clear: both"><a id="dbset_errfile"></a>DB-&gt;set_errfile()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db.h&gt;
42
43 void
44 DB-&gt;set_errfile(DB *db, FILE *errfile); </pre>
45 <p>
46 When an error occurs in the Berkeley DB library,
47 <span>
48 a Berkeley DB error
49 </span>
50
51 or an error return value is returned by the interface. In some cases,
52 however, the <span class="bold"><strong>errno</strong></span> value may be
53 insufficient to completely describe the cause of the error, especially
54 during initial application debugging.
55 </p>
56 <p>
57 The <a class="xref" href="envset_errfile.html" title="DB_ENV-&gt;set_errfile()">DB_ENV-&gt;set_errfile()</a> and
58 <code class="methodname">DB-&gt;set_errfile()</code> methods are used to enhance the mechanism for
59 reporting error messages to the application by setting a C library
60 FILE * to be used for displaying additional Berkeley DB error
61 messages. In some cases, when an error occurs, Berkeley DB will
62 output an additional error message to the specified file reference.
63 </p>
64 <p>
65 Alternatively, you can use the
66
67
68 <a class="xref" href="envset_errcall.html" title="DB_ENV-&gt;set_errcall()">DB_ENV-&gt;set_errcall()</a> or
69 <a class="xref" href="dbset_errcall.html" title="DB-&gt;set_errcall()">DB-&gt;set_errcall()</a>
70 methods to capture the additional error information in a way that does
71 not use C library FILE *'s.
72
73 </p>
74 <p>
75 The error message will consist of the prefix string and a colon
76 ("<span class="bold"><strong>:</strong></span>") (if a prefix string was
77 previously specified using
78 <a class="xref" href="dbset_errpfx.html" title="DB-&gt;set_errpfx()">DB-&gt;set_errpfx()</a> or
79 <a class="xref" href="envset_errpfx.html" title="DB_ENV-&gt;set_errpfx()">DB_ENV-&gt;set_errpfx()</a> ), an
80 error string, and a trailing &lt;newline&gt; character.
81 </p>
82 <p>
83 The default configuration when applications first create
84 <a class="link" href="db.html" title="Chapter 2.  The DB Handle">DB</a> or
85 <a class="link" href="env.html" title="Chapter 5.  The DB_ENV Handle">DB_ENV</a> handles is as if the
86 <a class="xref" href="envset_errfile.html" title="DB_ENV-&gt;set_errfile()">DB_ENV-&gt;set_errfile()</a> or
87 <code class="methodname">DB-&gt;set_errfile()</code> methods were called with the standard error output
88 (stderr) specified as the FILE * argument. Applications wanting no
89 output at all can turn off this default configuration by calling the
90 <a class="xref" href="envset_errfile.html" title="DB_ENV-&gt;set_errfile()">DB_ENV-&gt;set_errfile()</a> or
91 <code class="methodname">DB-&gt;set_errfile()</code> methods with NULL as the FILE * argument.
92 Additionally, explicitly configuring the error output channel using
93 any of the following methods will also turn off this default output for the application:
94 </p>
95 <div class="itemizedlist">
96 <ul type="disc">
97 <li>
98 <p>
99 <code class="methodname">DB-&gt;set_errfile()</code>
100 </p>
101 </li>
102 <li>
103 <p>
104 <a class="xref" href="envset_errfile.html" title="DB_ENV-&gt;set_errfile()">DB_ENV-&gt;set_errfile()</a>
105 </p>
106 </li>
107 <li>
108 <p>
109 <a class="xref" href="envset_errcall.html" title="DB_ENV-&gt;set_errcall()">DB_ENV-&gt;set_errcall()</a>
110 </p>
111 </li>
112 <li>
113 <p>
114 <a class="xref" href="dbset_errcall.html" title="DB-&gt;set_errcall()">DB-&gt;set_errcall()</a>
115 </p>
116 </li>
117 </ul>
118 </div>
119 <p>
120 This error logging enhancement does not slow performance or
121 significantly increase application size, and may be run during normal
122 operation as well as during application debugging.
123 </p>
124 <p>
125 For <a class="link" href="db.html" title="Chapter 2.  The DB Handle">DB</a> handles opened
126 inside of Berkeley DB environments, calling the
127 <code class="methodname">DB-&gt;set_errfile()</code>
128 method affects the entire environment and is equivalent to calling the
129 <a class="xref" href="envset_errfile.html" title="DB_ENV-&gt;set_errfile()">DB_ENV-&gt;set_errfile()</a>
130 method.
131 </p>
132 <p>
133 When used on a database that was <span class="emphasis"><em>not</em></span> opened in
134 an environment, the <code class="methodname">DB-&gt;set_errfile()</code>
135 method configures operations performed using the specified
136 <a class="link" href="db.html" title="Chapter 2.  The DB Handle">DB</a> handle, not all operations
137 performed on the underlying database.
138 </p>
139 <p>
140 The <code class="methodname">DB-&gt;set_errfile()</code> method may be called at any time during the
141 life of the application.
142 </p>
143 <div class="sect2" lang="en" xml:lang="en">
144 <div class="titlepage">
145 <div>
146 <div>
147 <h3 class="title"><a id="idp50265376"></a>Parameters</h3>
148 </div>
149 </div>
150 </div>
151 <div class="sect3" lang="en" xml:lang="en">
152 <div class="titlepage">
153 <div>
154 <div>
155 <h4 class="title"><a id="idp50265568"></a>errfile</h4>
156 </div>
157 </div>
158 </div>
159 <p>
160 The <span class="bold"><strong>errfile</strong></span> parameter is a C library
161 <code class="literal">FILE *</code> to be used for displaying additional Berkeley DB error
162 information.
163 </p>
164 </div>
165 </div>
166 <div class="sect2" lang="en" xml:lang="en">
167 <div class="titlepage">
168 <div>
169 <div>
170 <h3 class="title"><a id="idp50261048"></a>Class</h3>
171 </div>
172 </div>
173 </div>
174 <p>
175 <a class="link" href="db.html" title="Chapter 2.  The DB Handle">DB</a>
176 </p>
177 </div>
178 <div class="sect2" lang="en" xml:lang="en">
179 <div class="titlepage">
180 <div>
181 <div>
182 <h3 class="title"><a id="idp50257896"></a>See Also</h3>
183 </div>
184 </div>
185 </div>
186 <p>
187 <a class="xref" href="db.html#dblist" title="Database and Related Methods">Database and Related Methods</a>
188 </p>
189 </div>
190 </div>
191 <div class="navfooter">
192 <hr />
193 <table width="100%" summary="Navigation footer">
194 <tr>
195 <td width="40%" align="left"><a accesskey="p" href="dbset_errcall.html">Prev</a> </td>
196 <td width="20%" align="center">
197 <a accesskey="u" href="db.html">Up</a>
198 </td>
199 <td width="40%" align="right"> <a accesskey="n" href="dbset_errpfx.html">Next</a></td>
200 </tr>
201 <tr>
202 <td width="40%" align="left" valign="top">DB-&gt;set_errcall() </td>
203 <td width="20%" align="center">
204 <a accesskey="h" href="index.html">Home</a>
205 </td>
206 <td width="40%" align="right" valign="top"> DB-&gt;set_errpfx()</td>
207 </tr>
208 </table>
209 </div>
210 </body>
211 </html>