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
|
<!--Id: mp.so,v 1.2 2001/09/27 02:25:52 bostic Exp -->
<!--Copyright 1997-2002 by Sleepycat Software, Inc.-->
<!--All rights reserved.-->
<!--See the file LICENSE for redistribution information.-->
<html>
<head>
<title>Berkeley DB Reference Guide: Release 4.0: memp_XXX</title>
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
</head>
<body bgcolor=white>
<table width="100%"><tr valign=top>
<td><h3><dl><dt>Berkeley DB Reference Guide:<dd>Upgrading Berkeley DB Applications</dl></h3></td>
<td align=right><a href="../../ref/upgrade.4.0/log.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../../reftoc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../../ref/upgrade.4.0/txn.html"><img src="../../images/next.gif" alt="Next"></a>
</td></tr></table>
<p>
<h1 align=center>Release 4.0: memp_XXX</h1>
<p>The C API for the Berkeley DB Memory Pool subsystem was reworked in the 4.0
release as follows:
<p><table border=1 align=center>
<tr><th>Historic functional interface</th><th>Berkeley DB 4.X method</th></tr>
<tr><td>memp_register</td><td><a href="../../api_c/memp_register.html">DB_ENV->memp_register</a></td></tr>
<tr><td>memp_stat</td><td><a href="../../api_c/memp_stat.html">DB_ENV->memp_stat</a></td></tr>
<tr><td>memp_sync</td><td><a href="../../api_c/memp_sync.html">DB_ENV->memp_sync</a></td></tr>
<tr><td>memp_trickle</td><td><a href="../../api_c/memp_trickle.html">DB_ENV->memp_trickle</a></td></tr>
<tr><td>memp_fopen</td><td><a href="../../api_c/memp_fcreate.html">DB_ENV->memp_fcreate</a></td></tr>
<tr><td>DB_MPOOL_FINFO: ftype</td><td><a href="../../api_c/memp_set_ftype.html">DB_MPOOLFILE->set_ftype</a></td></tr>
<tr><td>DB_MPOOL_FINFO: pgcookie</td><td><a href="../../api_c/memp_set_pgcookie.html">DB_MPOOLFILE->set_pgcookie</a></td></tr>
<tr><td>DB_MPOOL_FINFO: fileid</td><td><a href="../../api_c/memp_set_fileid.html">DB_MPOOLFILE->set_fileid</a></td></tr>
<tr><td>DB_MPOOL_FINFO: lsn_offset</td><td><a href="../../api_c/memp_set_lsn_offset.html">DB_MPOOLFILE->set_lsn_offset</a></td></tr>
<tr><td>DB_MPOOL_FINFO: clear_len</td><td><a href="../../api_c/memp_set_clear_len.html">DB_MPOOLFILE->set_clear_len</a></td></tr>
<tr><td>memp_fopen</td><td><a href="../../api_c/memp_fopen.html">DB_MPOOLFILE->open</a></td></tr>
<tr><td>memp_fclose</td><td><a href="../../api_c/memp_fclose.html">DB_MPOOLFILE->close</a></td></tr>
<tr><td>memp_fput</td><td><a href="../../api_c/memp_fput.html">DB_MPOOLFILE->put</a></td></tr>
<tr><td>memp_fset</td><td><a href="../../api_c/memp_fset.html">DB_MPOOLFILE->set</a></td></tr>
<tr><td>memp_fsync</td><td><a href="../../api_c/memp_fsync.html">DB_MPOOLFILE->sync</a></td></tr>
</table>
<p>Applications calling any of the memp_register, memp_stat, memp_sync or
memp_trickle interfaces should update those calls to use the enclosing
<a href="../../api_c/env_create.html">DB_ENV</a> handle's method (easily done as the first argument to the
existing call is the correct <a href="../../api_c/env_create.html">DB_ENV</a> handle).
<p>In addition, the <a href="../../api_c/memp_stat.html">DB_ENV->memp_stat</a> call has been changed in the 4.0
release to take a flags argument. To leave their historic behavior
unchanged, applications should add a final argument of 0 to any calls
made to <a href="../../api_c/memp_stat.html">DB_ENV->memp_stat</a>.
<p>Applications calling the memp_fopen interface should update those calls
as follows: First, acquire a <a href="../../api_c/memp_fcreate.html">DB_MPOOLFILE</a> handle using the
<a href="../../api_c/memp_fcreate.html">DB_ENV->memp_fcreate</a> function. Second, if the DB_MPOOL_FINFO structure
reference passed to the memp_fopen interface was non-NULL, call the
<a href="../../api_c/memp_fcreate.html">DB_MPOOLFILE</a> method corresponding to each initialized field in
the DB_MPOOL_FINFO structure. Third, call the <a href="../../api_c/memp_fopen.html">DB_MPOOLFILE->open</a> function
method to open the underlying file. If the <a href="../../api_c/memp_fopen.html">DB_MPOOLFILE->open</a> function call
fails, then <a href="../../api_c/memp_fclose.html">DB_MPOOLFILE->close</a> function must be called to destroy the allocated
handle.
<p>Applications calling the memp_fopen, memp_fclose, memp_fput, memp_fset,
or memp_fsync interfaces should update those calls to use the enclosing
<a href="../../api_c/memp_fcreate.html">DB_MPOOLFILE</a> handle's method. Again, this is easily done as the
first argument to the existing call is the correct <a href="../../api_c/memp_fcreate.html">DB_MPOOLFILE</a>
handle. With one exception, the calling conventions of the old a new
interfaces are identical; the one exception is the <a href="../../api_c/memp_fclose.html">DB_MPOOLFILE->close</a> function,
which requires an additional flag parameter that should be set to 0.
<table width="100%"><tr><td><br></td><td align=right><a href="../../ref/upgrade.4.0/log.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../../reftoc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../../ref/upgrade.4.0/txn.html"><img src="../../images/next.gif" alt="Next"></a>
</td></tr></table>
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>
</body>
</html>
|