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

Comparing BDB/BDB.pm (file contents):
Revision 1.38 by root, Mon Jul 7 22:11:04 2008 UTC vs.
Revision 1.39 by root, Tue Jul 8 08:25:31 2008 UTC

109use strict 'vars'; 109use strict 'vars';
110 110
111use base 'Exporter'; 111use base 'Exporter';
112 112
113BEGIN { 113BEGIN {
114 our $VERSION = '1.5'; 114 our $VERSION = '1.6';
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
278 $int = $env->set_data_dir (const char *dir) 278 $int = $env->set_data_dir (const char *dir)
279 $int = $env->set_tmp_dir (const char *dir) 279 $int = $env->set_tmp_dir (const char *dir)
280 $int = $env->set_lg_dir (const char *dir) 280 $int = $env->set_lg_dir (const char *dir)
281 $int = $env->set_shm_key (long shm_key) 281 $int = $env->set_shm_key (long shm_key)
282 $int = $env->set_cachesize (U32 gbytes, U32 bytes, int ncache = 0) 282 $int = $env->set_cachesize (U32 gbytes, U32 bytes, int ncache = 0)
283 $int = $env->set_flags (U32 flags, int onoff) 283 $int = $env->set_flags (U32 flags, int onoff = 1)
284 $int = $env->log_set_config (U32 flags, int onoff = 1) [v4.7]
285 $int = $env->set_intermediate_dir_mode (const char *modestring) [v4.7]
284 $env->set_errfile (FILE *errfile = 0) 286 $env->set_errfile (FILE *errfile = 0)
285 $env->set_msgfile (FILE *msgfile = 0) 287 $env->set_msgfile (FILE *msgfile = 0)
286 $int = $env->set_verbose (U32 which, int onoff = 1) 288 $int = $env->set_verbose (U32 which, int onoff = 1)
287 $int = $env->set_encrypt (const char *password, U32 flags = 0) 289 $int = $env->set_encrypt (const char *password, U32 flags = 0)
288 $int = $env->set_timeout (NV timeout_seconds, U32 flags = SET_TXN_TIMEOUT) 290 $int = $env->set_timeout (NV timeout_seconds, U32 flags = SET_TXN_TIMEOUT)
538 BDB::poll_wait, BDB::poll_cb 540 BDB::poll_wait, BDB::poll_cb
539 while BDB::nreqs; 541 while BDB::nreqs;
540 542
541=back 543=back
542 544
545=head3 VERSION CHECKING
546
547BerkeleyDB comes in various versions, many of them have minor
548incompatibilities. This means that traditional "at least version x.x"
549checks are often not sufficient.
550
551=over 4
552
553=item BDB::VERSION
554
555The C<BDB::VERSION> function, when called without arguments, returns the
556Berkeley DB version as a v-string (usually with 3 components). You should
557use C<lt> and C<ge> operators exclusively to make comparisons.
558
559Example: check for at least version 4.7.
560
561 BDB::VERSION ge v4.7 or die;
562
563=item BDB::VERSION min-version
564
565Returns true if the BDB version is at least the given version (specified
566as a v-string), false otherwise.
567
568Example: check for at least version 4.5.
569
570 BDB::VERSION v4.7 or die;
571
572=item BDB::VERSION min-version, max-version
573
574Returns true of the BDB version is at least version C<min-version> (specify C<undef> or C<v0> for any minimum version)
575and less then C<max-version>.
576
577Example: check wether version is strictly less then v4.7.
578
579 BDB::VERSION v0, v4.7
580 or die "version 4.7 is not yet supported";
581
582=back
583
584=cut
585
586sub VERSION {
587 if (@_ > 0) {
588 return undef if VERSION_v lt $_[0];
589 if (@_ > 1) {
590 return undef if VERSION_v ge $_[1];
591 }
592 }
593
594 VERSION_v
595}
596
543=head3 CONTROLLING THE NUMBER OF THREADS 597=head3 CONTROLLING THE NUMBER OF THREADS
544 598
545=over 4 599=over 4
546 600
547=item BDB::min_parallel $nthreads 601=item BDB::min_parallel $nthreads

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines