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