1<!--$Id: func.so,v 11.9 2001/03/01 15:58:20 bostic Exp $--> 2<!--Copyright (c) 1997,2008 Oracle. All rights reserved.--> 3<!--See the file LICENSE for redistribution information.--> 4<html> 5<head> 6<title>Berkeley DB Reference Guide: Release 3.0: function arguments</title> 7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> 8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> 9</head> 10<body bgcolor=white> 11<table width="100%"><tr valign=top> 12<td><b><dl><dt>Berkeley DB Reference Guide:<dd>Upgrading Berkeley DB Applications</dl></b></td> 13<td align=right><a href="../upgrade.3.0/envopen.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../upgrade.3.0/dbenv.html"><img src="../../images/next.gif" alt="Next"></a> 14</td></tr></table> 15<p align=center><b>Release 3.0: function arguments</b></p> 16<p>In Berkeley DB 3.0, there are no longer separate structures that represent 17each subsystem (for example, DB_LOCKTAB or DB_TXNMGR), and an overall 18<a href="../../api_c/env_class.html">DB_ENV</a> environment structure. Instead there is only the 19<a href="../../api_c/env_class.html">DB_ENV</a> structure. This means that <a href="../../api_c/env_class.html">DB_ENV</a> references 20should be passed around by your application instead of passing around 21DB_LOCKTAB or DB_TXNMGR references.</p> 22<p>Each of the following functions:</p> 23<blockquote><pre>lock_detect 24lock_get 25lock_id 26lock_put 27lock_stat 28lock_vec</pre></blockquote> 29<p>should have its first argument, a reference to the DB_LOCKTAB structure, 30replaced with a reference to the enclosing <a href="../../api_c/env_class.html">DB_ENV</a> structure. For 31example, the following line of code from a Berkeley DB 2.X application:</p> 32<blockquote><pre>DB_LOCKTAB *lt; 33DB_LOCK lock; 34 ret = lock_put(lt, lock);</pre></blockquote> 35<p>should now be written as follows:</p> 36<blockquote><pre>DB_ENV *dbenv; 37DB_LOCK *lock; 38 ret = lock_put(dbenv, lock);</pre></blockquote> 39<p>Similarly, all of the functions:</p> 40<blockquote><pre>log_archive 41log_compare 42log_file 43log_flush 44log_get 45log_put 46log_register 47log_stat 48log_unregister</pre></blockquote> 49<p>should have their DB_LOG argument replaced with a reference to a 50<a href="../../api_c/env_class.html">DB_ENV</a> structure, and the functions:</p> 51<blockquote><pre>memp_fopen 52memp_register 53memp_stat 54memp_sync 55memp_trickle</pre></blockquote> 56<p>should have their DB_MPOOL argument replaced with a reference to a 57<a href="../../api_c/env_class.html">DB_ENV</a> structure.</p> 58<p>You should remove all references to DB_LOCKTAB, DB_LOG, DB_MPOOL, and 59DB_TXNMGR structures from your application, they are no longer useful 60in any way. In fact, a simple way to identify all of the places that 61need to be upgraded is to remove all such structures and variables 62they declare, and then compile. You will see a warning message from 63your compiler in each case that needs to be upgraded.</p> 64<table width="100%"><tr><td><br></td><td align=right><a href="../upgrade.3.0/envopen.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../upgrade.3.0/dbenv.html"><img src="../../images/next.gif" alt="Next"></a> 65</td></tr></table> 66<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 67</body> 68</html> 69