ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/BDB/BDB.pm
(Generate patch)

Comparing BDB/BDB.pm (file contents):
Revision 1.40 by root, Tue Jul 8 08:35:12 2008 UTC vs.
Revision 1.43 by root, Wed Jul 9 21:00:13 2008 UTC

109use strict 'vars'; 109use strict 'vars';
110 110
111use base 'Exporter'; 111use base 'Exporter';
112 112
113BEGIN { 113BEGIN {
114 our $VERSION = '1.6'; 114 our $VERSION = '1.7';
115 115
116 our @BDB_REQ = qw( 116 our @BDB_REQ = qw(
117 db_env_open db_env_close db_env_txn_checkpoint db_env_lock_detect 117 db_env_open db_env_close db_env_txn_checkpoint db_env_lock_detect
118 db_env_memp_sync db_env_memp_trickle db_env_dbrename db_env_dbremove 118 db_env_memp_sync db_env_memp_trickle db_env_dbrename db_env_dbremove
119 db_open db_close db_compact db_sync db_upgrade 119 db_open db_close db_compact db_sync db_upgrade
160In the following, C<$int> signifies an integer return value, 160In the following, C<$int> signifies an integer return value,
161C<bdb_filename> is a "filename" (octets on unix, madness on windows), 161C<bdb_filename> is a "filename" (octets on unix, madness on windows),
162C<U32> is an unsigned 32 bit integer, C<int> is some integer, C<NV> is a 162C<U32> is an unsigned 32 bit integer, C<int> is some integer, C<NV> is a
163floating point value. 163floating point value.
164 164
165The C<SV *> types are generic perl scalars (for input and output of data 165Most C<SV *> types are generic perl scalars (for input and output of data
166values), and the C<SV *callback> is the optional callback function to call 166values).
167when the request is completed.
168 167
169The various C<DB_ENV> etc. arguments are handles return by 168The various C<DB_ENV> etc. arguments are handles return by
170C<db_env_create>, C<db_create>, C<txn_begin> and so on. If they have an 169C<db_env_create>, C<db_create>, C<txn_begin> and so on. If they have an
171appended C<_ornull> this means they are optional and you can pass C<undef> 170appended C<_ornull> this means they are optional and you can pass C<undef>
172for them, resulting a NULL pointer on the C level. 171for them, resulting a NULL pointer on the C level.
172
173The C<SV *callback> is the optional callback function to call when the
174request is completed. This last callback argument is special: the callback
175is simply the last argument passed. If there are "optional" arguments
176before the callback they can be left out. The callback itself can be left
177out or specified as C<undef>, in which case the function will be executed
178synchronously.
179
180For example, C<db_env_txn_checkpoint> usually is called with all integer
181arguments zero. These can be left out, so all of these specify a call
182to C<< DB_ENV->txn_checkpoint >>, to be executed asynchronously with a
183callback to be called:
184
185 db_env_txn_checkpoint $db_env, 0, 0, 0, sub { };
186 db_env_txn_checkpoint $db_env, 0, 0, sub { };
187 db_env_txn_checkpoint $db_env, sub { };
188
189While these all specify a call to C<< DB_ENV->txn_checkpoint >> to be
190executed synchronously:
191
192 db_env_txn_checkpoint $db_env, 0, 0, 0, undef;
193 db_env_txn_checkpoint $db_env, 0, 0, 0;
194 db_env_txn_checkpoint $db_env, 0;
173 195
174=head3 BDB functions 196=head3 BDB functions
175 197
176Functions in the BDB namespace, exported by default: 198Functions in the BDB namespace, exported by default:
177 199
302 $int = $env->mutex_set_max (U32 max) 324 $int = $env->mutex_set_max (U32 max)
303 $int = $env->mutex_set_align (U32 align) 325 $int = $env->mutex_set_align (U32 align)
304 326
305 $txn = $env->txn_begin (DB_TXN_ornull *parent = 0, U32 flags = 0) 327 $txn = $env->txn_begin (DB_TXN_ornull *parent = 0, U32 flags = 0)
306 flags: READ_COMMITTED READ_UNCOMMITTED TXN_NOSYNC TXN_NOWAIT TXN_SNAPSHOT TXN_SYNC TXN_WAIT TXN_WRITE_NOSYNC 328 flags: READ_COMMITTED READ_UNCOMMITTED TXN_NOSYNC TXN_NOWAIT TXN_SNAPSHOT TXN_SYNC TXN_WAIT TXN_WRITE_NOSYNC
329 $txn = $env->cdsgroup_begin;
307 330
308=head4 Example: 331=head4 Example:
309 332
310 use AnyEvent; 333 use AnyEvent;
311 use BDB; 334 use BDB;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines