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_feedback()</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_errpfx.html" title="Db::set_errpfx()" /> 12 <link rel="next" href="dbset_flags.html" title="Db::set_flags()" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">Db::set_feedback()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="dbset_errpfx.html">Prev</a> </td> 22 <th width="60%" align="center">Chapter 2. 23 The Db Handle 24 </th> 25 <td width="20%" align="right"> <a accesskey="n" href="dbset_flags.html">Next</a></td> 26 </tr> 27 </table> 28 <hr /> 29 </div> 30 <div class="sect1" lang="en" xml:lang="en"> 31 <div class="titlepage"> 32 <div> 33 <div> 34 <h2 class="title" style="clear: both"><a id="dbset_feedback"></a>Db::set_feedback()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db_cxx.h> 39 40int 41Db::set_feedback(void (*db_feedback_fcn)(DB *dbp, int opcode, int percent));</pre> 42 <p> 43 Some operations performed by the Berkeley DB library can take non-trivial amounts of time. 44 The <code class="methodname">Db::set_feedback()</code> method can be used by applications to 45 monitor progress within these operations. When an operation is likely to take a long time, 46 Berkeley DB will call the specified callback function with progress information. 47 </p> 48 <p> 49 It is up to the callback function to display this information in an 50 appropriate manner. 51 </p> 52 <p> 53 The <code class="methodname">Db::set_feedback()</code> method may be called at any time during the 54 life of the application. 55 </p> 56 <p> 57 The <code class="methodname">Db::set_feedback()</code> method returns a non-zero error value on 58 failure and 0 on success. 59 </p> 60 <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> 61 <h3 class="title">Note</h3> 62 <p> 63 Berkeley DB is not re-entrant. Callback functions should not attempt to make 64 library calls (for example, to release locks or close open handles). Re-entering 65 Berkeley DB is not guaranteed to work correctly, and the results are undefined. 66 </p> 67 </div> 68 <div class="sect2" lang="en" xml:lang="en"> 69 <div class="titlepage"> 70 <div> 71 <div> 72 <h3 class="title"><a id="id1646619"></a>Parameters</h3> 73 </div> 74 </div> 75 </div> 76 <div class="sect3" lang="en" xml:lang="en"> 77 <div class="titlepage"> 78 <div> 79 <div> 80 <h4 class="title"><a id="id1646855"></a>db_feedback_fcn</h4> 81 </div> 82 </div> 83 </div> 84 <p> 85 The <span class="bold"><strong>db_feedback_fcn</strong></span> parameter is the 86 application-specified feedback function called to report Berkeley DB 87 operation progress. The callback function must take three parameters: 88 </p> 89 <div class="itemizedlist"> 90 <ul type="disc"> 91 <li> 92 <p> 93 <code class="literal">dbp</code> 94 </p> 95 <p> 96 The <span class="bold"><strong>dbp</strong></span> parameter is a reference to 97 the enclosing database. 98 </p> 99 </li> 100 <li> 101 <p> 102 <code class="literal">opcode</code> 103 </p> 104 <p> 105 The <span class="bold"><strong>opcode</strong></span> parameter is an operation 106 code. The <span class="bold"><strong>opcode</strong></span> parameter may take 107 on any of the following values: 108 </p> 109 <div class="itemizedlist"> 110 <ul type="circle"> 111 <li> 112 <p><a id="set_feedback_DB_UPGRADE"></a> 113 <code class="literal">DB_UPGRADE</code> 114 </p> 115 <p> 116 The underlying database is being upgraded. 117 </p> 118 </li> 119 <li> 120 <p><a id="set_feedback_DB_VERIFY"></a> 121 <code class="literal">DB_VERIFY</code> 122 </p> 123 <p> 124 The underlying database is being verified. 125 </p> 126 </li> 127 </ul> 128 </div> 129 </li> 130 <li> 131 <p> 132 <code class="literal">percent</code> 133 </p> 134 <p> 135 The <span class="bold"><strong>percent</strong></span> parameter is the percent 136 of the operation that has been completed, specified as an integer 137 value between 0 and 100. 138 </p> 139 </li> 140 </ul> 141 </div> 142 </div> 143 </div> 144 <div class="sect2" lang="en" xml:lang="en"> 145 <div class="titlepage"> 146 <div> 147 <div> 148 <h3 class="title"><a id="id1646999"></a>Class</h3> 149 </div> 150 </div> 151 </div> 152 <p> 153 <a class="link" href="db.html" title="Chapter 2. The Db Handle">Db</a> 154 </p> 155 </div> 156 <div class="sect2" lang="en" xml:lang="en"> 157 <div class="titlepage"> 158 <div> 159 <div> 160 <h3 class="title"><a id="id1647149"></a>See Also</h3> 161 </div> 162 </div> 163 </div> 164 <p> 165 <a class="xref" href="db.html#dblist" title="Database and Related Methods">Database and Related Methods</a> 166 </p> 167 </div> 168 </div> 169 <div class="navfooter"> 170 <hr /> 171 <table width="100%" summary="Navigation footer"> 172 <tr> 173 <td width="40%" align="left"><a accesskey="p" href="dbset_errpfx.html">Prev</a> </td> 174 <td width="20%" align="center"> 175 <a accesskey="u" href="db.html">Up</a> 176 </td> 177 <td width="40%" align="right"> <a accesskey="n" href="dbset_flags.html">Next</a></td> 178 </tr> 179 <tr> 180 <td width="40%" align="left" valign="top">Db::set_errpfx() </td> 181 <td width="20%" align="center"> 182 <a accesskey="h" href="index.html">Home</a> 183 </td> 184 <td width="40%" align="right" valign="top"> Db::set_flags()</td> 185 </tr> 186 </table> 187 </div> 188 </body> 189</html> 190