• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src/router/db-4.8.30/docs/api_reference/CXX/
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>Dbc::cmp()</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="dbc.html" title="Chapter 3.  The Dbc Handle" />
11    <link rel="prev" href="dbcclose.html" title="Dbc::close()" />
12    <link rel="next" href="dbccount.html" title="Dbc::count()" />
13  </head>
14  <body>
15    <div class="navheader">
16      <table width="100%" summary="Navigation header">
17        <tr>
18          <th colspan="3" align="center">Dbc::cmp()</th>
19        </tr>
20        <tr>
21          <td width="20%" align="left"><a accesskey="p" href="dbcclose.html">Prev</a> </td>
22          <th width="60%" align="center">Chapter 3. 
23                The Dbc Handle
24        </th>
25          <td width="20%" align="right"> <a accesskey="n" href="dbccount.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="dbccmp"></a>Dbc::cmp()</h2>
35          </div>
36        </div>
37      </div>
38      <pre class="programlisting">#include &lt;db_cxx.h&gt;
39 
40int
41Dbc::cmp(Dbc *other_cursor, int *result, u_int32_t flags);</pre>
42      <p>
43         The <code class="methodname">Dbc::cmp()</code> method compares two cursors for equality. Two cursors are equal if and only if they are positioned on the same item in the same database.
44    </p>
45      <p>
46         The <code class="methodname">Dbc::cmp()</code> <span>
47            
48            <span>
49                method either returns a non-zero error value or throws an
50                exception that encapsulates a non-zero error value on
51                failure, and returns 0 on success.
52            </span>
53        </span>
54    </p>
55      <div class="sect2" lang="en" xml:lang="en">
56        <div class="titlepage">
57          <div>
58            <div>
59              <h3 class="title"><a id="id1655110"></a>Parameters</h3>
60            </div>
61          </div>
62        </div>
63        <div class="sect3" lang="en" xml:lang="en">
64          <div class="titlepage">
65            <div>
66              <div>
67                <h4 class="title"><a id="id1655076"></a>other_cursor</h4>
68              </div>
69            </div>
70          </div>
71          <p>
72                          The <span class="bold"><strong>other_cursor</strong></span> parameter references
73                          another cursor handle that will be used as the comparator.
74                     </p>
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="id1654974"></a>result</h4>
81              </div>
82            </div>
83          </div>
84          <p>
85		          If the call is successful and both cursors are positioned on the same item, result is set to zero. If the call is successful but the cursors are not positioned on the same item, result is set to a non-zero value. If the call is unsuccessful, the value of result should be ignored.
86                     </p>
87        </div>
88        <div class="sect3" lang="en" xml:lang="en">
89          <div class="titlepage">
90            <div>
91              <div>
92                <h4 class="title"><a id="id1655229"></a>flags</h4>
93              </div>
94            </div>
95          </div>
96          <p>
97                          The <span class="bold"><strong>flags</strong></span> parameter is currently
98                          unused, and must be set to 0.
99                     </p>
100        </div>
101      </div>
102      <div class="sect2" lang="en" xml:lang="en">
103        <div class="titlepage">
104          <div>
105            <div>
106              <h3 class="title"><a id="id1655315"></a>Errors</h3>
107            </div>
108          </div>
109        </div>
110        <p>
111                         The <code class="methodname">Dbc::cmp()</code> <span>
112            
113            <span>
114                method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a> 
115                exception, encapsulating one of the following non-zero errors, or return one
116                of the following non-zero errors:
117            </span>
118        </span>
119                    </p>
120        <div class="sect3" lang="en" xml:lang="en">
121          <div class="titlepage">
122            <div>
123              <div>
124                <h4 class="title"><a id="id1655119"></a>EINVAL</h4>
125              </div>
126            </div>
127          </div>
128          <p>
129	    </p>
130          <div class="itemizedlist">
131            <ul type="disc">
132              <li>
133                <p>
134                If either of the cursors are already closed.
135	    </p>
136              </li>
137              <li>
138                <p>
139                If the cursors have been opened against different databases.
140	    </p>
141              </li>
142              <li>
143                <p>
144                If either of the cursors have not been positioned.
145	    </p>
146              </li>
147              <li>
148                <p>
149                If the other_dbc parameter is NULL.
150	    </p>
151              </li>
152              <li>
153                <p>
154                If the result parameter is NULL.
155	    </p>
156              </li>
157            </ul>
158          </div>
159          <p>
160            </p>
161        </div>
162      </div>
163      <div class="sect2" lang="en" xml:lang="en">
164        <div class="titlepage">
165          <div>
166            <div>
167              <h3 class="title"><a id="id1655120"></a>Class</h3>
168            </div>
169          </div>
170        </div>
171        <p>
172                     <a class="link" href="dbc.html" title="Chapter 3.  The Dbc Handle">Dbc</a>  
173            </p>
174      </div>
175      <div class="sect2" lang="en" xml:lang="en">
176        <div class="titlepage">
177          <div>
178            <div>
179              <h3 class="title"><a id="id1655406"></a>See Also</h3>
180            </div>
181          </div>
182        </div>
183        <p>
184                     <a class="xref" href="dbc.html#dbclist" title="Database Cursors and Related Methods">Database Cursors and Related Methods</a> 
185                </p>
186      </div>
187    </div>
188    <div class="navfooter">
189      <hr />
190      <table width="100%" summary="Navigation footer">
191        <tr>
192          <td width="40%" align="left"><a accesskey="p" href="dbcclose.html">Prev</a> </td>
193          <td width="20%" align="center">
194            <a accesskey="u" href="dbc.html">Up</a>
195          </td>
196          <td width="40%" align="right"> <a accesskey="n" href="dbccount.html">Next</a></td>
197        </tr>
198        <tr>
199          <td width="40%" align="left" valign="top">Dbc::close() </td>
200          <td width="20%" align="center">
201            <a accesskey="h" href="index.html">Home</a>
202          </td>
203          <td width="40%" align="right" valign="top"> Dbc::count()</td>
204        </tr>
205      </table>
206    </div>
207  </body>
208</html>
209