Debian Codegraph @

docs/upgrading/upgrade_3_0_dbinfo.html

raw
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>DBINFO structure</title>
7 <link rel="stylesheet" href="gettingStarted.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 Upgrade Guide" />
10 <link rel="up" href="upgrade_3_0_toc.html" title="Chapter 14. Upgrading Berkeley DB 2.X applications to Berkeley DB 3.0" />
11 <link rel="prev" href="upgrade_3_0_db.html" title="DB structure" />
12 <link rel="next" href="upgrade_3_0_join.html" title="DB-&gt;join" />
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">DBINFO structure</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="upgrade_3_0_db.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 14. Upgrading Berkeley DB 2.X applications to Berkeley DB 3.0</th>
26 <td width="20%" align="right"> <a accesskey="n" href="upgrade_3_0_join.html">Next</a></td>
27 </tr>
28 </table>
29 <hr />
30 </div>
31 <div class="sect1" lang="en" xml:lang="en">
32 <div class="titlepage">
33 <div>
34 <div>
35 <h2 class="title" style="clear: both"><a id="upgrade_3_0_dbinfo"></a>DBINFO structure</h2>
36 </div>
37 </div>
38 </div>
39 <p>The DB_INFO structure has been removed from the Berkeley DB 3.0 release.
40 Accesses to any fields within that structure by the application should be
41 replaced with method calls on the <a href="../api_reference/C/db.html" class="olink">DB</a> handle. The following
42 example illustrates this using the historic db_cachesize structure field.
43 In the Berkeley DB 2.X releases, applications could set the size of an
44 underlying database cache using code similar to the following:</p>
45 <pre class="programlisting">DB_INFO dbinfo;
46
47 memset(dbinfo, 0, sizeof(dbinfo));
48 dbinfo.db_cachesize = 1024 * 1024;</pre>
49 <p>in the Berkeley DB 3.X releases, this should be done using the
50 <a href="../api_reference/C/dbset_cachesize.html" class="olink">DB-&gt;set_cachesize()</a> method, as follows:</p>
51 <pre class="programlisting">DB *db;
52 int ret;
53
54 ret = db-&gt;set_cachesize(db, 0, 1024 * 1024, 0);</pre>
55 <p>The DB_INFO structure is no longer used in any way by the Berkeley DB 3.0
56 release, and should be removed from the application.</p>
57 <p>The following table lists the DB_INFO fields previously used by
58 applications and the methods that should now be used to set
59 them. Because these calls provide configuration for the
60 database open, they must precede the call to <a href="../api_reference/C/dbopen.html" class="olink">DB-&gt;open()</a>.
61 Calling them after the call to <a href="../api_reference/C/dbopen.html" class="olink">DB-&gt;open()</a> will return an
62 error.</p>
63 <div class="informaltable">
64 <table border="1" width="80%">
65 <colgroup>
66 <col />
67 <col />
68 </colgroup>
69 <thead>
70 <tr>
71 <th>DB_INFO field</th>
72 <th>Berkeley DB 3.X method</th>
73 </tr>
74 </thead>
75 <tbody>
76 <tr>
77 <td>bt_compare</td>
78 <td>
79 <a href="../api_reference/C/dbset_bt_compare.html" class="olink">DB-&gt;set_bt_compare()</a>
80 </td>
81 </tr>
82 <tr>
83 <td>bt_minkey</td>
84 <td>
85 <a href="../api_reference/C/dbset_bt_minkey.html" class="olink">DB-&gt;set_bt_minkey()</a>
86 </td>
87 </tr>
88 <tr>
89 <td>bt_prefix</td>
90 <td>
91 <a href="../api_reference/C/dbset_bt_prefix.html" class="olink">DB-&gt;set_bt_prefix()</a>
92 </td>
93 </tr>
94 <tr>
95 <td>db_cachesize</td>
96 <td><a href="../api_reference/C/dbset_cachesize.html" class="olink">DB-&gt;set_cachesize()</a>
97 <p>Note: the <a href="../api_reference/C/dbset_cachesize.html" class="olink">DB-&gt;set_cachesize()</a> function takes additional arguments.
98 Setting both the second argument (the number of GB in the pool) and the
99 last argument (the number of memory pools to create) to 0 will result in
100 behavior that is backward-compatible with previous Berkeley DB releases.</p></td>
101 </tr>
102 <tr>
103 <td>db_lorder</td>
104 <td>
105 <a href="../api_reference/C/dbset_lorder.html" class="olink">DB-&gt;set_lorder()</a>
106 </td>
107 </tr>
108 <tr>
109 <td>db_malloc</td>
110 <td>DB-&gt;set_malloc</td>
111 </tr>
112 <tr>
113 <td>db_pagesize</td>
114 <td>
115 <a href="../api_reference/C/dbset_pagesize.html" class="olink">DB-&gt;set_pagesize()</a>
116 </td>
117 </tr>
118 <tr>
119 <td>dup_compare</td>
120 <td>
121 <a href="../api_reference/C/dbset_dup_compare.html" class="olink">DB-&gt;set_dup_compare()</a>
122 </td>
123 </tr>
124 <tr>
125 <td>flags</td>
126 <td><a href="../api_reference/C/dbset_flags.html" class="olink">DB-&gt;set_flags()</a>
127 <p>Note: the DB_DELIMITER, DB_FIXEDLEN and DB_PAD flags no longer need to be
128 set as there are specific methods off the <a href="../api_reference/C/db.html" class="olink">DB</a> handle that set the
129 file delimiter, the length of fixed-length records and the fixed-length
130 record pad character. They should simply be discarded from the application.</p></td>
131 </tr>
132 <tr>
133 <td>h_ffactor</td>
134 <td>
135 <a href="../api_reference/C/dbset_h_ffactor.html" class="olink">DB-&gt;set_h_ffactor()</a>
136 </td>
137 </tr>
138 <tr>
139 <td>h_hash</td>
140 <td>
141 <a href="../api_reference/C/dbset_h_hash.html" class="olink">DB-&gt;set_h_hash()</a>
142 </td>
143 </tr>
144 <tr>
145 <td>h_nelem</td>
146 <td>
147 <a href="../api_reference/C/dbset_h_nelem.html" class="olink">DB-&gt;set_h_nelem()</a>
148 </td>
149 </tr>
150 <tr>
151 <td>re_delim</td>
152 <td>
153 <a href="../api_reference/C/dbset_re_delim.html" class="olink">DB-&gt;set_re_delim()</a>
154 </td>
155 </tr>
156 <tr>
157 <td>re_len</td>
158 <td>
159 <a href="../api_reference/C/dbset_re_len.html" class="olink">DB-&gt;set_re_len()</a>
160 </td>
161 </tr>
162 <tr>
163 <td>re_pad</td>
164 <td>
165 <a href="../api_reference/C/dbset_re_pad.html" class="olink">DB-&gt;set_re_pad()</a>
166 </td>
167 </tr>
168 <tr>
169 <td>re_source</td>
170 <td>
171 <a href="../api_reference/C/dbset_re_source.html" class="olink">DB-&gt;set_re_source()</a>
172 </td>
173 </tr>
174 </tbody>
175 </table>
176 </div>
177 </div>
178 <div class="navfooter">
179 <hr />
180 <table width="100%" summary="Navigation footer">
181 <tr>
182 <td width="40%" align="left"><a accesskey="p" href="upgrade_3_0_db.html">Prev</a> </td>
183 <td width="20%" align="center">
184 <a accesskey="u" href="upgrade_3_0_toc.html">Up</a>
185 </td>
186 <td width="40%" align="right"> <a accesskey="n" href="upgrade_3_0_join.html">Next</a></td>
187 </tr>
188 <tr>
189 <td width="40%" align="left" valign="top">DB structure </td>
190 <td width="20%" align="center">
191 <a accesskey="h" href="index.html">Home</a>
192 </td>
193 <td width="40%" align="right" valign="top"> DB-&gt;join</td>
194 </tr>
195 </table>
196 </div>
197 </body>
198 </html>