Debian Codegraph @

docs/api_reference/CXX/dbset_msgcall.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::set_msgcall()</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_message_stream.html" title="Db::set_message_stream()" />
12 <link rel="next" href="dbset_msgfile.html" title="Db::set_msgfile()" />
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::set_msgcall()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="dbset_message_stream.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_msgfile.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_msgcall"></a>Db::set_msgcall()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db_cxx.h&gt;
42
43 void Db::set_msgcall(void (*db_msgcall_fcn)(const DbEnv *dbenv,
44 char *msg));</pre>
45 <p>
46 There are interfaces in the Berkeley DB library which either directly
47 output informational messages or statistical information, or configure
48 the library to output such messages when performing other operations,
49 for example, <a class="xref" href="envset_verbose.html" title="DbEnv::set_verbose()">DbEnv::set_verbose()</a> and
50 <a class="xref" href="envstat.html" title="DbEnv::stat_print()">DbEnv::stat_print()</a>.
51 </p>
52 <p>
53 The <a class="xref" href="envset_msgcall.html" title="DbEnv::set_msgcall()">DbEnv::set_msgcall()</a> and
54 <code class="methodname">Db::set_msgcall()</code> methods are used to
55 pass these messages to the application, and Berkeley DB will call
56 <span class="bold"><strong>db_msgcall_fcn</strong></span> with each message. It
57 is up to the <span class="bold"><strong>db_msgcall_fcn</strong></span> function
58 to display the message in an appropriate manner.
59 </p>
60 <p>
61 Setting <span class="bold"><strong>db_msgcall_fcn</strong></span> to NULL
62 unconfigures the callback interface.
63 </p>
64 <p>
65 Alternatively, you can use the
66 <span>
67 <a class="xref" href="envset_error_stream.html" title="DbEnv::set_error_stream()">DbEnv::set_error_stream()</a>
68 and
69 <a class="xref" href="dbset_error_stream.html" title="Db::set_error_stream()">Db::set_error_stream()</a>
70 methods to display the messages via an output stream, or the
71 </span>
72 <a class="xref" href="dbset_msgfile.html" title="Db::set_msgfile()">Db::set_msgfile()</a> or
73 <a class="xref" href="envset_msgfile.html" title="DbEnv::set_msgfile()">Db::set_msgfile()</a>
74 methods to display the messages via a C library FILE *.
75 <span>You should not mix these approaches.</span>
76 </p>
77 <p>
78 For <a class="link" href="db.html" title="Chapter 2.  The Db Handle">Db</a> handles opened
79 inside of Berkeley DB environments, calling the <code class="methodname">Db::set_msgcall()</code>
80 method affects the entire environment and is equivalent to calling the
81 <code class="methodname">DbEnv::set_msgcall()</code> method.
82 </p>
83 <p>
84 The <code class="methodname">Db::set_msgcall()</code> method configures operations performed using
85 the specified <a class="link" href="db.html" title="Chapter 2.  The Db Handle">Db</a> handle,
86 not all operations performed on the underlying database.
87 </p>
88 <p>
89 The <code class="methodname">Db::set_msgcall()</code> method may be called at any time during the
90 life of the application.
91 </p>
92 <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
93 <h3 class="title">Note</h3>
94 <p>
95 Berkeley DB is not re-entrant. Callback functions should not attempt to make
96 library calls (for example, to release locks or close open handles). Re-entering
97 Berkeley DB is not guaranteed to work correctly, and the results are undefined.
98 </p>
99 </div>
100 <div class="sect2" lang="en" xml:lang="en">
101 <div class="titlepage">
102 <div>
103 <div>
104 <h3 class="title"><a id="idp5726776"></a>Parameters</h3>
105 </div>
106 </div>
107 </div>
108 <div class="sect3" lang="en" xml:lang="en">
109 <div class="titlepage">
110 <div>
111 <div>
112 <h4 class="title"><a id="idp5726968"></a>db_msgcall_fcn</h4>
113 </div>
114 </div>
115 </div>
116 <p>
117 The <span class="bold"><strong>db_msgcall_fcn</strong></span> parameter is the
118 application-specified message reporting function. The function takes
119 two parameters:
120 </p>
121 <div class="itemizedlist">
122 <ul type="disc">
123 <li>
124 <p>
125 <code class="literal">dbenv</code>
126 </p>
127 <p>
128 The <span class="bold"><strong>dbenv</strong></span> parameter is the enclosing
129 database environment.
130 </p>
131 </li>
132 <li>
133 <p>
134 <code class="literal">msg</code>
135 </p>
136 <p>
137 The <span class="bold"><strong>msg</strong></span> parameter is the message
138 string.
139 </p>
140 </li>
141 </ul>
142 </div>
143 </div>
144 </div>
145 <div class="sect2" lang="en" xml:lang="en">
146 <div class="titlepage">
147 <div>
148 <div>
149 <h3 class="title"><a id="idp5730624"></a>Class</h3>
150 </div>
151 </div>
152 </div>
153 <p>
154 <a class="link" href="db.html" title="Chapter 2.  The Db Handle">Db</a>
155 </p>
156 </div>
157 <div class="sect2" lang="en" xml:lang="en">
158 <div class="titlepage">
159 <div>
160 <div>
161 <h3 class="title"><a id="idp5721896"></a>See Also</h3>
162 </div>
163 </div>
164 </div>
165 <p>
166 <a class="xref" href="db.html#dblist" title="Database and Related Methods">Database and Related Methods</a>
167 </p>
168 </div>
169 </div>
170 <div class="navfooter">
171 <hr />
172 <table width="100%" summary="Navigation footer">
173 <tr>
174 <td width="40%" align="left"><a accesskey="p" href="dbset_message_stream.html">Prev</a> </td>
175 <td width="20%" align="center">
176 <a accesskey="u" href="db.html">Up</a>
177 </td>
178 <td width="40%" align="right"> <a accesskey="n" href="dbset_msgfile.html">Next</a></td>
179 </tr>
180 <tr>
181 <td width="40%" align="left" valign="top">Db::set_message_stream() </td>
182 <td width="20%" align="center">
183 <a accesskey="h" href="index.html">Home</a>
184 </td>
185 <td width="40%" align="right" valign="top"> Db::set_msgfile()</td>
186 </tr>
187 </table>
188 </div>
189 </body>
190 </html>