Debian Codegraph @

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