summaryrefslogtreecommitdiff
path: root/docs/upgrading/upgrade_3_0_func.html
blob: 1bd9c25ef8064a9c3633405b04c3f8e6410204c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>function arguments</title>
    <link rel="stylesheet" href="gettingStarted.css" type="text/css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
    <link rel="start" href="index.html" title="Berkeley DB Upgrade Guide" />
    <link rel="up" href="upgrade_3_0_toc.html" title="Chapter 14. Upgrading Berkeley DB 2.X applications to Berkeley DB 3.0" />
    <link rel="prev" href="upgrade_3_0_envopen.html" title="environment open/close/unlink" />
    <link rel="next" href="upgrade_3_0_dbenv.html" title="DB_ENV structure" />
  </head>
  <body>
    <div xmlns="" class="navheader">
      <div class="libver">
        <p>Library Version 12.1.6.1</p>
      </div>
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">function arguments</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="upgrade_3_0_envopen.html">Prev</a> </td>
          <th width="60%" align="center">Chapter 14. Upgrading Berkeley DB 2.X applications to Berkeley DB 3.0</th>
          <td width="20%" align="right"> <a accesskey="n" href="upgrade_3_0_dbenv.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="sect1" lang="en" xml:lang="en">
      <div class="titlepage">
        <div>
          <div>
            <h2 class="title" style="clear: both"><a id="upgrade_3_0_func"></a>function arguments</h2>
          </div>
        </div>
      </div>
      <p>In Berkeley DB 3.0, there are no longer separate structures that represent
each subsystem (for example, DB_LOCKTAB or DB_TXNMGR), and an overall
<a href="../api_reference/C/env.html" class="olink">DB_ENV</a> environment structure.  Instead there is only the
<a href="../api_reference/C/env.html" class="olink">DB_ENV</a> references
should be passed around by your application instead of passing around
DB_LOCKTAB or DB_TXNMGR references.</p>
      <p>Each of the following functions:</p>
      <pre class="programlisting">lock_detect
lock_get
lock_id
lock_put
lock_stat
lock_vec</pre>
      <p>should have its first argument, a reference to the DB_LOCKTAB structure,
replaced with a reference to the enclosing <a href="../api_reference/C/env.html" class="olink">DB_ENV</a> structure.  For
example, the following line of code from a Berkeley DB 2.X application:</p>
      <pre class="programlisting">DB_LOCKTAB *lt;
DB_LOCK lock;

ret = lock_put(lt, lock);</pre>
      <p>should now be written as follows:</p>
      <pre class="programlisting">DB_ENV *dbenv;
DB_LOCK *lock;

ret = lock_put(dbenv, lock);</pre>
      <p>Similarly, all of the functions:</p>
      <pre class="programlisting">log_archive
log_compare
log_file
log_flush
log_get
log_put
log_register
log_stat
log_unregister</pre>
      <p>should have their DB_LOG argument replaced with a reference to a
<a href="../api_reference/C/env.html" class="olink">DB_ENV</a> structure, and the functions:</p>
      <pre class="programlisting">memp_fopen
memp_register
memp_stat
memp_sync
memp_trickle</pre>
      <p>should have their DB_MPOOL argument replaced with a reference to a
<a href="../api_reference/C/env.html" class="olink">DB_ENV</a> structure.</p>
      <p>You should remove all references to DB_LOCKTAB, DB_LOG, DB_MPOOL, and
DB_TXNMGR structures from your application, they are no longer useful
in any way.  In fact, a simple way to identify all of the places that
need to be upgraded is to remove all such structures and variables
they declare, and then compile.  You will see a warning message from
your compiler in each case that needs to be upgraded.</p>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="upgrade_3_0_envopen.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="upgrade_3_0_toc.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="upgrade_3_0_dbenv.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">environment open/close/unlink </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> DB_ENV structure</td>
        </tr>
      </table>
    </div>
  </body>
</html>