1<!--$Id: env_set_feedback.so,v 10.43 2006/05/17 20:47:46 bostic Exp $-->
2<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
3<!--See the file LICENSE for redistribution information.-->
4<html>
5<head>
6<title>Berkeley DB: DB_ENV-&gt;set_feedback</title>
7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
9</head>
10<body bgcolor=white>
11<table width="100%"><tr valign=top>
12<td>
13<b>DB_ENV-&gt;set_feedback</b>
14</td>
15<td align=right>
16<a href="../api_c/api_core.html"><img src="../images/api.gif" alt="API"></a>
17<a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a></td>
18</tr></table>
19<hr size=1 noshade>
20<tt>
21<b><pre>
22#include &lt;db.h&gt;
23<p>
24int
25DB_ENV-&gt;set_feedback(DB_ENV *dbenv,
26    void (*db_feedback_fcn)(DB_ENV *dbenv, int opcode, int percent));
27</pre></b>
28<hr size=1 noshade>
29<b>Description: DB_ENV-&gt;set_feedback</b>
30<p>Some operations performed by the Berkeley DB library can take non-trivial
31amounts of time.  The DB_ENV-&gt;set_feedback method can be used by applications
32to monitor progress within these operations.  When an operation is
33likely to take a long time, Berkeley DB will call the specified callback
34function with progress information.</p>
35<p>It is up to the callback function to display this information in an
36appropriate manner.</p>
37<p>The DB_ENV-&gt;set_feedback method configures operations performed using the specified
38<a href="../api_c/env_class.html">DB_ENV</a> handle
39<p>The DB_ENV-&gt;set_feedback method may be called at any time during the life of the
40application.</p>
41<p>The DB_ENV-&gt;set_feedback method
42returns a non-zero error value on failure
43and 0 on success.
44</p>
45<b>Parameters</b> <br>
46 <b>db_feedback_fcn</b><ul compact><li>The <b>db_feedback_fcn</b> parameter is the application-specified
47feedback function called to report Berkeley DB operation progress.  The
48callback function must take three parameters:
49<br>
50<b><b>dbenv</b></b><ul compact><li>The <b>dbenv</b> parameter is a reference to the enclosing database
51environment.</ul>
52<b><b>opcode</b></b><ul compact><li>The <b>opcode</b> parameter is an operation code.  The <b>opcode</b>
53parameter may take on any of the following values:
54<br>
55<b><a name="DB_RECOVER">DB_RECOVER</a></b><ul compact><li>The environment is being recovered.</ul>
56<br></ul>
57<b><b>percent</b></b><ul compact><li>The <b>percent</b> parameter is the percent of the operation that has
58been completed, specified as an integer value between 0 and 100.</ul>
59<br></ul>
60<p>Berkeley DB is not re-entrant.  Callback functions should not attempt to make
61library calls (for example, to release locks or close open handles).
62Re-entering Berkeley DB is not guaranteed to work correctly, and the results
63are undefined.</p>
64<br>
65<hr size=1 noshade>
66<br><b>Class</b>
67<a href="../api_c/env_class.html">DB_ENV</a>
68<br><b>See Also</b>
69<a href="../api_c/env_list.html">Database Environments and Related Methods</a>
70</tt>
71<table width="100%"><tr><td><br></td><td align=right>
72<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>
73</td></tr></table>
74<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
75</body>
76</html>
77