| 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>DbEnv::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="env.html" title="Chapter 5. The DbEnv Handle" /> |
| 11 | <link rel="prev" href="envset_errpfx.html" title="DbEnv::set_errpfx()" /> |
| 12 | <link rel="next" href="envset_flags.html" title="DbEnv::set_flags()" /> |
| 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">DbEnv::set_feedback()</th> |
| 22 | </tr> |
| 23 | <tr> |
| 24 | <td width="20%" align="left"><a accesskey="p" href="envset_errpfx.html">Prev</a> </td> |
| 25 | <th width="60%" align="center">Chapter 5. |
| 26 | The DbEnv Handle |
| 27 | </th> |
| 28 | <td width="20%" align="right"> <a accesskey="n" href="envset_flags.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="envset_feedback"></a>DbEnv::set_feedback()</h2> |
| 38 | </div> |
| 39 | </div> |
| 40 | </div> |
| 41 | <pre class="programlisting">#include <db_cxx.h> |
| 42 | |
| 43 | int |
| 44 | DbEnv::set_feedback(void (*db_feedback_fcn)(DbEnv *dbenv, int opcode, |
| 45 | int percent));</pre> |
| 46 | <p> |
| 47 | Some operations performed by the Berkeley DB library can take |
| 48 | non-trivial amounts of time. The <code class="methodname">DbEnv::set_feedback()</code> method can |
| 49 | be used by applications to monitor progress within these operations. |
| 50 | When an operation is likely to take a long time, Berkeley DB will call |
| 51 | the specified callback function with progress information. |
| 52 | </p> |
| 53 | <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> |
| 54 | <h3 class="title">Note</h3> |
| 55 | <p> |
| 56 | Berkeley DB is not re-entrant. Callback functions should not attempt to make library calls (for |
| 57 | example, to release locks or close open handles). Re-entering Berkeley DB is not guaranteed to work |
| 58 | correctly, and the results are undefined. |
| 59 | </p> |
| 60 | </div> |
| 61 | <p> |
| 62 | It is up to the callback function to display this information in an |
| 63 | appropriate manner. |
| 64 | </p> |
| 65 | <p> |
| 66 | The <code class="methodname">DbEnv::set_feedback()</code> method configures operations performed |
| 67 | using the specified <a class="link" href="env.html" title="Chapter 5. The DbEnv Handle">DbEnv</a> handle. |
| 68 | </p> |
| 69 | <p> |
| 70 | The <code class="methodname">DbEnv::set_feedback()</code> method may be called at any time during |
| 71 | the life of the application. |
| 72 | </p> |
| 73 | <p> |
| 74 | The <code class="methodname">DbEnv::set_feedback()</code> method returns a non-zero error value on |
| 75 | failure and 0 on success. |
| 76 | </p> |
| 77 | <div class="sect2" lang="en" xml:lang="en"> |
| 78 | <div class="titlepage"> |
| 79 | <div> |
| 80 | <div> |
| 81 | <h3 class="title"><a id="idp7373832"></a>Parameters</h3> |
| 82 | </div> |
| 83 | </div> |
| 84 | </div> |
| 85 | <div class="sect3" lang="en" xml:lang="en"> |
| 86 | <div class="titlepage"> |
| 87 | <div> |
| 88 | <div> |
| 89 | <h4 class="title"><a id="idp7374024"></a>db_feedback_fcn</h4> |
| 90 | </div> |
| 91 | </div> |
| 92 | </div> |
| 93 | <p> |
| 94 | The <span class="bold"><strong>db_feedback_fcn</strong></span> parameter is the |
| 95 | application-specified feedback function called to report Berkeley DB |
| 96 | operation progress. The callback function must take three parameters: |
| 97 | </p> |
| 98 | <div class="itemizedlist"> |
| 99 | <ul type="disc"> |
| 100 | <li> |
| 101 | <p> |
| 102 | <code class="literal">dbenv</code> |
| 103 | </p> |
| 104 | <p> |
| 105 | The <span class="bold"><strong>dbenv</strong></span> parameter is a reference to |
| 106 | the enclosing database environment. |
| 107 | </p> |
| 108 | </li> |
| 109 | <li> |
| 110 | <p> |
| 111 | <code class="literal">opcode</code> |
| 112 | </p> |
| 113 | <p> |
| 114 | The <span class="bold"><strong>opcode</strong></span> parameter is an operation |
| 115 | code. The <span class="bold"><strong>opcode</strong></span> parameter may take |
| 116 | on any of the following values: |
| 117 | </p> |
| 118 | <div class="itemizedlist"> |
| 119 | <ul type="circle"> |
| 120 | <li> |
| 121 | <p><a id="set_feedback_DB_RECOVER"></a> |
| 122 | <code class="literal">DB_RECOVER</code> |
| 123 | </p> |
| 124 | <p> |
| 125 | The environment is being recovered. |
| 126 | </p> |
| 127 | </li> |
| 128 | </ul> |
| 129 | </div> |
| 130 | </li> |
| 131 | <li> |
| 132 | <p> |
| 133 | <code class="literal">percent</code> |
| 134 | </p> |
| 135 | <p> |
| 136 | The <span class="bold"><strong>percent</strong></span> parameter is the percent |
| 137 | of the operation that has been completed, specified as an integer |
| 138 | value between 0 and 100. |
| 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="idp7396480"></a>Class</h3> |
| 150 | </div> |
| 151 | </div> |
| 152 | </div> |
| 153 | <p> |
| 154 | <a class="link" href="env.html" title="Chapter 5. The DbEnv Handle">DbEnv</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="idp7375896"></a>See Also</h3> |
| 162 | </div> |
| 163 | </div> |
| 164 | </div> |
| 165 | <p> |
| 166 | <a class="xref" href="env.html#envlist" title="Database Environments and Related Methods">Database Environments 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="envset_errpfx.html">Prev</a> </td> |
| 175 | <td width="20%" align="center"> |
| 176 | <a accesskey="u" href="env.html">Up</a> |
| 177 | </td> |
| 178 | <td width="40%" align="right"> <a accesskey="n" href="envset_flags.html">Next</a></td> |
| 179 | </tr> |
| 180 | <tr> |
| 181 | <td width="40%" align="left" valign="top">DbEnv::set_errpfx() </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"> DbEnv::set_flags()</td> |
| 186 | </tr> |
| 187 | </table> |
| 188 | </div> |
| 189 | </body> |
| 190 | </html> |