Imported Upstream version 5.3.21
[platform/upstream/libdb.git] / docs / upgrading / upgrade_3_0_db.html
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 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_xa.html" title="db_xa_open" />
12     <link rel="next" href="upgrade_3_0_dbinfo.html" title="DBINFO structure" />
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 structure</th>
22         </tr>
23         <tr>
24           <td width="20%" align="left"><a accesskey="p" href="upgrade_3_0_xa.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_dbinfo.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_db"></a>DB structure</h2>
36           </div>
37         </div>
38       </div>
39       <p>The <a href="../api_reference/C/db.html" class="olink">DB</a> structure is now opaque for applications in the Berkeley DB 3.0
40 release.  Accesses to any fields within that structure by the application
41 should be replaced with method calls.  The following example illustrates
42 this using the historic type structure field.  In the Berkeley DB 2.X releases,
43 applications could find the type of an underlying database using code
44 similar to the following:</p>
45       <pre class="programlisting">DB *db;
46 DB_TYPE type;
47
48 type = db-&gt;type;</pre>
49       <p>in the Berkeley DB 3.X releases, this should be done using the
50 <a href="../api_reference/C/dbget_type.html" class="olink">DB-&gt;get_type()</a> method, as follows:</p>
51       <pre class="programlisting">DB *db;
52 DB_TYPE type;
53
54 type = db-&gt;get_type(db);</pre>
55       <p>The following table lists the <a href="../api_reference/C/db.html" class="olink">DB</a> fields previously used by
56 applications and the methods that should now be used to get or set them.</p>
57       <div class="informaltable">
58         <table border="1" width="80%">
59           <colgroup>
60             <col />
61             <col />
62           </colgroup>
63           <thead>
64             <tr>
65               <th><a href="../api_reference/C/db.html" class="olink">DB</a> field</th>
66               <th>Berkeley DB 3.X method</th>
67             </tr>
68           </thead>
69           <tbody>
70             <tr>
71               <td>byteswapped</td>
72               <td>
73                 <a href="../api_reference/C/dbget_byteswapped.html" class="olink">DB-&gt;get_byteswapped()</a>
74               </td>
75             </tr>
76             <tr>
77               <td>db_errcall</td>
78               <td>
79                 <a href="../api_reference/C/dbset_errcall.html" class="olink">DB-&gt;set_errcall()</a>
80               </td>
81             </tr>
82             <tr>
83               <td>db_errfile</td>
84               <td>
85                 <a href="../api_reference/C/dbset_errfile.html" class="olink">DB-&gt;set_errfile()</a>
86               </td>
87             </tr>
88             <tr>
89               <td>db_errpfx</td>
90               <td>
91                 <a href="../api_reference/C/dbset_errpfx.html" class="olink">DB-&gt;set_errpfx()</a>
92               </td>
93             </tr>
94             <tr>
95               <td>db_paniccall</td>
96               <td>DB-&gt;set_paniccall</td>
97             </tr>
98             <tr>
99               <td>type</td>
100               <td>
101                 <a href="../api_reference/C/dbget_type.html" class="olink">DB-&gt;get_type()</a>
102               </td>
103             </tr>
104           </tbody>
105         </table>
106       </div>
107     </div>
108     <div class="navfooter">
109       <hr />
110       <table width="100%" summary="Navigation footer">
111         <tr>
112           <td width="40%" align="left"><a accesskey="p" href="upgrade_3_0_xa.html">Prev</a> </td>
113           <td width="20%" align="center">
114             <a accesskey="u" href="upgrade_3_0_toc.html">Up</a>
115           </td>
116           <td width="40%" align="right"> <a accesskey="n" href="upgrade_3_0_dbinfo.html">Next</a></td>
117         </tr>
118         <tr>
119           <td width="40%" align="left" valign="top">db_xa_open </td>
120           <td width="20%" align="center">
121             <a accesskey="h" href="index.html">Home</a>
122           </td>
123           <td width="40%" align="right" valign="top"> DBINFO structure</td>
124         </tr>
125       </table>
126     </div>
127   </body>
128 </html>