1<!--$Id: db_set_msgcall.so,v 10.1 2004/04/16 19:01:56 bostic Exp $-->
2<!--$Id: env_set_msgcall.so,v 10.7 2006/05/17 20:47:46 bostic Exp $-->
3<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
4<!--See the file LICENSE for redistribution information.-->
5<html>
6<head>
7<title>Berkeley DB: DB-&gt;set_msgcall</title>
8<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
9<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
10</head>
11<body bgcolor=white>
12<table width="100%"><tr valign=top>
13<td>
14<b>DB-&gt;set_msgcall</b>
15</td>
16<td align=right>
17<a href="/api_c/api_core.html"><img src="/images/api.gif" alt="API"></a>
18<a href="/ref/toc.html"><img src="/images/ref.gif" alt="Ref"></a></td>
19</tr></table>
20<hr size=1 noshade>
21<tt>
22<b><pre>
23#include &lt;db.h&gt;
24<p>
25void
26DB-&gt;set_msgcall(DB *,
27    void (*db_msgcall_fcn)(const DB_ENV *dbenv, char *msg));
28</pre></b>
29<hr size=1 noshade>
30<b>Description: DB-&gt;set_msgcall</b>
31<p>There are interfaces in the Berkeley DB library which either directly output
32informational messages or statistical information, or configure the
33library to output such messages when performing other operations, for
34example, <a href="/api_c/env_set_verbose.html">DB_ENV-&gt;set_verbose</a> and <a href="/api_c/env_stat.html">DB_ENV-&gt;stat_print</a>.</p>
35<p>The DB_ENV-&gt;set_msgcall and DB-&gt;set_msgcall methods are used to
36pass these messages to the application, and Berkeley DB will call
37<b>db_msgcall_fcn</b> with each message.  It is up to the
38<b>db_msgcall_fcn</b> function to display the message in an appropriate
39manner.</p>
40<p>Setting <b>db_msgcall_fcn</b> to NULL unconfigures the callback interface.</p>
41<p>Alternatively, you can use the <a href="/api_c/db_set_msgfile.html">DB-&gt;set_msgfile</a> or
42<a href="/api_c/env_set_msgfile.html">DB_ENV-&gt;set_msgfile</a> methods to display the messages via a C library FILE *.</p>
43<p>For <a href="/api_c/db_class.html">DB</a> handles opened inside of Berkeley DB environments, calling the
44DB-&gt;set_msgcall method affects the entire environment and is equivalent to calling
45the DB_ENV-&gt;set_msgcall method.</p>
46<p>The DB-&gt;set_msgcall method configures operations performed using the specified
47<a href="/api_c/db_class.html">DB</a> handle, not all operations performed on the underlying
48database.</p>
49<p>The DB-&gt;set_msgcall method may be called at any time during the life of the
50application.</p>
51<b>Parameters</b> <br>
52 <b>db_msgcall_fcn</b><ul compact><li>The <b>db_msgcall_fcn</b> parameter is the application-specified message
53reporting function.  The function takes two parameters:
54<br>
55<b><b>dbenv</b></b><ul compact><li>The <b>dbenv</b> parameter is the enclosing database environment.</ul>
56<b><b>msg</b></b><ul compact><li>The <b>msg</b> parameter is the message string.</ul>
57<br></ul>
58<p>Berkeley DB is not re-entrant.  Callback functions should not attempt to make
59library calls (for example, to release locks or close open handles).
60Re-entering Berkeley DB is not guaranteed to work correctly, and the results
61are undefined.</p>
62<br>
63<hr size=1 noshade>
64<br><b>Class</b>
65<a href="/api_c/db_class.html">DB</a>
66<br><b>See Also</b>
67<a href="/api_c/db_list.html">Databases and Related Methods</a>
68</tt>
69<table width="100%"><tr><td><br></td><td align=right>
70<a href="/api_c/api_core.html"><img src="/images/api.gif" alt="API"></a><a href="/ref/toc.html"><img src="/images/ref.gif" alt="Ref"></a>
71</td></tr></table>
72<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
73</body>
74</html>
75