New Upstream Release - libberkeleydb-perl
Ready changes
Summary
Merged new upstream version: 0.65 (was: 0.64).
Resulting package
Built on 2022-12-14T22:46 (took 3m9s)
The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:
apt install -t fresh-releases libberkeleydb-perl-dbgsymapt install -t fresh-releases libberkeleydb-perl
Lintian Result
Diff
diff --git a/BerkeleyDB.pm b/BerkeleyDB.pm
index 926a4db..23d8e2f 100644
--- a/BerkeleyDB.pm
+++ b/BerkeleyDB.pm
@@ -2,7 +2,7 @@
package BerkeleyDB;
-# Copyright (c) 1997-2020 Paul Marquess. All rights reserved.
+# Copyright (c) 1997-2022 Paul Marquess. All rights reserved.
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
#
@@ -17,7 +17,7 @@ use Carp;
use vars qw($VERSION @ISA @EXPORT $AUTOLOAD
$use_XSLoader);
-$VERSION = '0.64';
+$VERSION = '0.65';
require Exporter;
diff --git a/BerkeleyDB.pod b/BerkeleyDB.pod
index 7b2e5ed..ad6ed82 100644
--- a/BerkeleyDB.pod
+++ b/BerkeleyDB.pod
@@ -2724,29 +2724,15 @@ The official web site for Berkeley DB is F<http://www.oracle.com/technology/prod
=head1 COPYRIGHT
-Copyright (c) 1997-2020 Paul Marquess. All rights reserved. This program
+Copyright (c) 1997-2022 Paul Marquess. All rights reserved. This program
is free software; you can redistribute it and/or modify it under the
same terms as Perl itself.
Although B<BerkeleyDB> is covered by the Perl license, the library it
makes use of, namely Berkeley DB, is not. Berkeley DB has its own
-copyright and its own license. Please take the time to read it.
-
-Here are few words taken from the Berkeley DB FAQ (at
-F<http://www.oracle.com/technology/products/berkeley-db/db/index.html>) regarding the license:
-
- Do I have to license DB to use it in Perl scripts?
-
- No. The Berkeley DB license requires that software that uses
- Berkeley DB be freely redistributable. In the case of Perl, that
- software is Perl, and not your scripts. Any Perl scripts that you
- write are your property, including scripts that make use of Berkeley
- DB. Neither the Perl license nor the Berkeley DB license
- place any restriction on what you may do with them.
-
-If you are in any doubt about the license situation, contact either the
-Berkeley DB authors or the author of BerkeleyDB.
-See L<"AUTHOR"> for details.
+copyright and its own license.
+See L<AGPL|https://www.oracle.com/downloads/licenses/berkeleydb-oslicense.html> for more details.
+Please take the time to read the Berkeley DB license and decide how it impacts your use of this Perl module.
=head1 AUTHOR
diff --git a/BerkeleyDB.pod.P b/BerkeleyDB.pod.P
index b9dd394..5f773e2 100755
--- a/BerkeleyDB.pod.P
+++ b/BerkeleyDB.pod.P
@@ -2491,29 +2491,15 @@ The official web site for Berkeley DB is F<http://www.oracle.com/technology/prod
=head1 COPYRIGHT
-Copyright (c) 1997-2020 Paul Marquess. All rights reserved. This program
+Copyright (c) 1997-2022 Paul Marquess. All rights reserved. This program
is free software; you can redistribute it and/or modify it under the
same terms as Perl itself.
Although B<BerkeleyDB> is covered by the Perl license, the library it
makes use of, namely Berkeley DB, is not. Berkeley DB has its own
-copyright and its own license. Please take the time to read it.
-
-Here are few words taken from the Berkeley DB FAQ (at
-F<http://www.oracle.com/technology/products/berkeley-db/db/index.html>) regarding the license:
-
- Do I have to license DB to use it in Perl scripts?
-
- No. The Berkeley DB license requires that software that uses
- Berkeley DB be freely redistributable. In the case of Perl, that
- software is Perl, and not your scripts. Any Perl scripts that you
- write are your property, including scripts that make use of Berkeley
- DB. Neither the Perl license nor the Berkeley DB license
- place any restriction on what you may do with them.
-
-If you are in any doubt about the license situation, contact either the
-Berkeley DB authors or the author of BerkeleyDB.
-See L<"AUTHOR"> for details.
+copyright and its own license.
+See L<AGPL|https://www.oracle.com/downloads/licenses/berkeleydb-oslicense.html> for more details.
+Please take the time to read the Berkeley DB license and decide how it impacts your use of this Perl module.
=head1 AUTHOR
diff --git a/BerkeleyDB.xs b/BerkeleyDB.xs
index fd01c51..2490066 100644
--- a/BerkeleyDB.xs
+++ b/BerkeleyDB.xs
@@ -169,7 +169,7 @@ extern "C" {
# define AT_LEAST_DB_5_3
#endif
-#if DB_VERSION_MAJOR >= 6
+#if DB_VERSION_MAJOR >= 6
# define AT_LEAST_DB_6_0
#endif
@@ -194,7 +194,7 @@ extern "C" {
# define DB_QUEUE 4
#endif /* DB_VERSION_MAJOR == 2 */
-#if DB_VERSION_MAJOR == 2
+#if DB_VERSION_MAJOR == 2
# define BackRef internal
#else
# if DB_VERSION_MAJOR == 3 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR == 0)
@@ -504,7 +504,7 @@ hash_delete(char * hash, char * key);
# define flagSetBoth() (flagSet(DB_GET_BOTH) || flagSet(DB_GET_BOTH_RANGE))
#else
# define flagSetBoth() (flagSet(DB_GET_BOTH))
-#endif
+#endif
#ifndef AT_LEAST_DB_4
typedef int db_timeout_t ;
@@ -650,7 +650,7 @@ typedef int db_off_t;
}
#else
#define InputKey_seq(arg, var)
-#define OutputKey_seq(arg, name)
+#define OutputKey_seq(arg, name)
#endif
#define OutputKey_B(arg, name) \
@@ -718,10 +718,10 @@ typedef int db_off_t;
#ifdef AT_LEAST_DB_4_3
#define ckActive_Sequence(a) ckActive(a, "Sequence")
#else
-#define ckActive_Sequence(a)
+#define ckActive_Sequence(a)
#endif
-#define dieIfEnvOpened(e, m) if (e->opened) softCrash("Cannot call method BerkeleyDB::Env::%s after environment has been opened", m);
+#define dieIfEnvOpened(e, m) if (e->opened) softCrash("Cannot call method BerkeleyDB::Env::%s after environment has been opened", m);
#define isSTDOUT_ERR(f) ((f) == stdout || (f) == stderr)
@@ -730,7 +730,7 @@ typedef int db_off_t;
#define MY_CXT_KEY "BerkeleyDB::_guts" XS_VERSION
typedef struct {
- db_recno_t x_Value;
+ db_recno_t x_Value;
db_recno_t x_zero;
DBTKEY x_empty;
#ifndef AT_LEAST_DB_3_2
@@ -742,17 +742,17 @@ START_MY_CXT
#define Value (MY_CXT.x_Value)
#define zero (MY_CXT.x_zero)
-#define empty (MY_CXT.x_empty)
+#define empty (MY_CXT.x_empty)
#ifdef AT_LEAST_DB_3_2
-# define CurrentDB ((BerkeleyDB)db->BackRef)
+# define CurrentDB ((BerkeleyDB)db->BackRef)
#else
# define CurrentDB (MY_CXT.x_CurrentDB)
#endif
#ifdef AT_LEAST_DB_3_2
-# define getCurrentDB ((BerkeleyDB)db->BackRef)
-# define saveCurrentDB(db)
+# define getCurrentDB ((BerkeleyDB)db->BackRef)
+# define saveCurrentDB(db)
#else
# define getCurrentDB (MY_CXT.x_CurrentDB)
# define saveCurrentDB(db) (MY_CXT.x_CurrentDB) = db
@@ -769,8 +769,8 @@ static char ErrBuff[1000] ;
void *
MyRealloc(void * ptr, size_t size)
{
- if (ptr == NULL )
- return safemalloc(size) ;
+ if (ptr == NULL )
+ return safemalloc(size) ;
else
return saferealloc(ptr, size) ;
}
@@ -855,7 +855,7 @@ close_everything(void)
{
#ifdef dTHX
dTHX;
-#endif
+#endif
Trace(("close_everything\n")) ;
/* Abort All Transactions */
{
@@ -991,7 +991,7 @@ destroyDB(BerkeleyDB db)
{
#ifdef dTHX
dTHX;
-#endif
+#endif
if (! PL_dirty && db->active) {
if (db->parent_env && db->parent_env->open_dbs)
-- db->parent_env->open_dbs ;
@@ -1089,7 +1089,7 @@ GetArrayLength(BerkeleyDB db)
DB_BTREE_STAT * stat ;
#ifdef AT_LEAST_DB_4_3
db->Status = ((db->dbp)->stat)(db->dbp, db->txn, &stat, 0) ;
-#else
+#else
#ifdef AT_LEAST_DB_3_3
db->Status = ((db->dbp)->stat)(db->dbp, &stat, 0) ;
#else
@@ -1117,7 +1117,7 @@ GetQueueLength(BerkeleyDB db)
DB_QUEUE_STAT * stat ;
#ifdef AT_LEAST_DB_4_3
db->Status = ((db->dbp)->stat)(db->dbp, db->txn, &stat, 0) ;
-#else
+#else
#ifdef AT_LEAST_DB_3_3
db->Status = ((db->dbp)->stat)(db->dbp, &stat, 0) ;
#else
@@ -1226,9 +1226,9 @@ btree_compare(DB_callback const DBT * key1, const DBT * key2 )
{
#ifdef dTHX
dTHX;
-#endif
+#endif
dSP ;
- dMY_CXT ;
+ dMY_CXT ;
char * data1, * data2 ;
int retval ;
int count ;
@@ -1286,9 +1286,9 @@ dup_compare(DB_callback const DBT * key1, const DBT * key2 )
{
#ifdef dTHX
dTHX;
-#endif
+#endif
dSP ;
- dMY_CXT ;
+ dMY_CXT ;
char * data1, * data2 ;
int retval ;
int count ;
@@ -1347,9 +1347,9 @@ btree_prefix(DB_callback const DBT * key1, const DBT * key2 )
{
#ifdef dTHX
dTHX;
-#endif
+#endif
dSP ;
- dMY_CXT ;
+ dMY_CXT ;
char * data1, * data2 ;
int retval ;
int count ;
@@ -1401,9 +1401,9 @@ hash_cb(DB_callback const void * data, u_int32_t size)
{
#ifdef dTHX
dTHX;
-#endif
+#endif
dSP ;
- dMY_CXT ;
+ dMY_CXT ;
int retval ;
int count ;
/* BerkeleyDB keepDB = CurrentDB ; */
@@ -1446,9 +1446,9 @@ associate_cb(DB_callback const DBT * pkey, const DBT * pdata, DBT * skey)
{
#ifdef dTHX
dTHX;
-#endif
+#endif
dSP ;
- dMY_CXT ;
+ dMY_CXT ;
char * pk_dat, * pd_dat ;
int retval ;
int count ;
@@ -1501,7 +1501,7 @@ associate_cb(DB_callback const DBT * pkey, const DBT * pdata, DBT * skey)
retval = POPi ;
PUTBACK ;
-
+
if (retval != DB_DONOTINDEX)
{
/* retrieve the secondary key */
@@ -1551,7 +1551,7 @@ associate_cb(DB_callback const DBT * pkey, const DBT * pdata, DBT * skey)
} else {
croak("Not an array reference");
}
- } else
+ } else
#endif
{
skey_ptr = SvPV(skey_SV, skey_len);
@@ -1575,9 +1575,9 @@ associate_cb_recno(DB_callback const DBT * pkey, const DBT * pdata, DBT * skey)
{
#ifdef dTHX
dTHX;
-#endif
+#endif
dSP ;
- dMY_CXT ;
+ dMY_CXT ;
char * pk_dat, * pd_dat ;
int retval ;
int count ;
@@ -1628,13 +1628,13 @@ associate_cb_recno(DB_callback const DBT * pkey, const DBT * pdata, DBT * skey)
retval = POPi ;
PUTBACK ;
-
+
/* retrieve the secondary key */
DBT_clear(*skey);
if (retval != DB_DONOTINDEX)
{
- Value = GetRecnoKey(getCurrentDB, SvIV(skey_SV)) ;
+ Value = GetRecnoKey(getCurrentDB, SvIV(skey_SV)) ;
skey->flags = DB_DBT_APPMALLOC;
skey->size = (int)sizeof(db_recno_t);
skey->data = (char*)safemalloc(skey->size);
@@ -1651,10 +1651,10 @@ associate_cb_recno(DB_callback const DBT * pkey, const DBT * pdata, DBT * skey)
#ifdef AT_LEAST_DB_4_8
-typedef int (*bt_compress_fcn_type)(DB *db, const DBT *prevKey,
+typedef int (*bt_compress_fcn_type)(DB *db, const DBT *prevKey,
const DBT *prevData, const DBT *key, const DBT *data, DBT *dest);
-typedef int (*bt_decompress_fcn_type)(DB *db, const DBT *prevKey,
+typedef int (*bt_decompress_fcn_type)(DB *db, const DBT *prevKey,
const DBT *prevData, DBT *compressed, DBT *destKey, DBT *destData);
#endif /* AT_LEAST_DB_4_8 */
@@ -1668,9 +1668,9 @@ associate_foreign_cb(DB* db, const DBT * key, DBT * data, const DBT * foreignkey
{
#ifdef dTHX
dTHX;
-#endif
+#endif
dSP ;
- dMY_CXT ;
+ dMY_CXT ;
char * k_dat, * d_dat, * f_dat;
int retval ;
int count ;
@@ -1755,9 +1755,9 @@ associate_foreign_cb_recno(DB* db, const DBT * key, DBT * data, const DBT * fore
{
#ifdef dTHX
dTHX;
-#endif
+#endif
dSP ;
- dMY_CXT ;
+ dMY_CXT ;
char * k_dat, * d_dat, * f_dat;
int retval ;
int count ;
@@ -1821,7 +1821,7 @@ associate_foreign_cb_recno(DB* db, const DBT * key, DBT * data, const DBT * fore
if (*changed)
{
DBT_clear(*data);
- Value = GetRecnoKey(getCurrentDB, SvIV(data_sv)) ;
+ Value = GetRecnoKey(getCurrentDB, SvIV(data_sv)) ;
data->flags = DB_DBT_APPMALLOC;
data->size = (int)sizeof(db_recno_t);
data->data = (char*)safemalloc(data->size);
@@ -1846,7 +1846,7 @@ db_errcall_cb(const char * db_errpfx, char * buffer)
{
#ifdef dTHX
dTHX;
-#endif
+#endif
SV * sv;
Trace(("In errcall_cb \n")) ;
@@ -1893,7 +1893,7 @@ readHash(HV * hash, char * key)
{
#ifdef dTHX
dTHX;
-#endif
+#endif
SV ** svp;
svp = hv_fetch(hash, key, strlen(key), FALSE);
@@ -1912,7 +1912,7 @@ hash_delete(char * hash, char * key)
{
#ifdef dTHX
dTHX;
-#endif
+#endif
HV * hv = perl_get_hv(hash, TRUE);
(void) hv_delete(hv, (char*)&key, sizeof(key), G_DISCARD);
}
@@ -1922,7 +1922,7 @@ hash_store_iv(char * hash, char * key, IV value)
{
#ifdef dTHX
dTHX;
-#endif
+#endif
HV * hv = perl_get_hv(hash, TRUE);
(void)hv_store(hv, (char*)&key, sizeof(key), newSViv(value), 0);
/* printf("hv_store returned %d\n", ret) ; */
@@ -1933,7 +1933,7 @@ hv_store_iv(HV * hash, char * key, IV value)
{
#ifdef dTHX
dTHX;
-#endif
+#endif
hv_store(hash, key, strlen(key), newSViv(value), 0);
}
@@ -1950,11 +1950,11 @@ GetKey(BerkeleyDB_type * db, SV * sv, DBTKEY * key)
{
#ifdef dTHX
dTHX;
-#endif
- dMY_CXT ;
+#endif
+ dMY_CXT ;
if (db->recno_or_queue) {
- Value = GetRecnoKey(db, SvIV(sv)) ;
- key->data = & Value;
+ Value = GetRecnoKey(db, SvIV(sv)) ;
+ key->data = & Value;
key->size = (int)sizeof(db_recno_t);
}
else {
@@ -1969,7 +1969,7 @@ my_db_open(
SV * ref,
SV * ref_dbenv ,
BerkeleyDB__Env dbenv ,
- BerkeleyDB__Txn txn,
+ BerkeleyDB__Txn txn,
const char * file,
const char * subname,
DBTYPE type,
@@ -1983,7 +1983,7 @@ my_db_open(
{
#ifdef dTHX
dTHX;
-#endif
+#endif
DB_ENV * env = NULL ;
BerkeleyDB RETVAL = NULL ;
DB * dbp ;
@@ -1994,7 +1994,7 @@ my_db_open(
Trace(("_db_open(dbenv[%p] ref_dbenv [%p] file[%s] subname [%s] type[%d] flags[%d] mode[%d]\n",
dbenv, ref_dbenv, file, subname, type, flags, mode)) ;
-
+
if (dbenv)
env = dbenv->Env ;
@@ -2076,13 +2076,13 @@ my_db_open(
if (password)
{
Status = dbp->set_encrypt(dbp, password, enc_flags);
- Trace(("DB->set_encrypt passwd = %s, flags %d returned %s\n",
+ Trace(("DB->set_encrypt passwd = %s, flags %d returned %s\n",
password, enc_flags,
my_db_strerror(Status))) ;
if (Status)
return RETVAL ;
}
-#endif
+#endif
if (info->re_source) {
Status = dbp->set_re_source(dbp, info->re_source) ;
@@ -2236,7 +2236,7 @@ my_db_open(
#else
{
Status = dbp->set_blob_threshold(dbp, info->blob_threshold, 0);
- Trace(("ENV->set_blob_threshold value = %d returned %s\n",
+ Trace(("ENV->set_blob_threshold value = %d returned %s\n",
info->blob_threshold,
my_db_strerror(Status))) ;
if (Status)
@@ -2388,7 +2388,7 @@ _db_remove(ref)
RETVAL = env->Status = env->Env->dbremove(env->Env, txn->txn, db, subdb, flags);
#else
softCrash("transactional db_remove requires Berkeley DB 4.1 or better");
-#endif
+#endif
} else {
if (env)
dbenv = env->Env ;
@@ -2441,11 +2441,11 @@ _db_verify(ref)
RETVAL = db_create(&dbp, dbenv, 0) ;
if (RETVAL == 0) {
RETVAL = dbp->verify(dbp, db, subdb, ofh, flags) ;
-#ifndef AT_LEAST_DB_4_2
- dbp->close(dbp, 0) ;
+#ifndef AT_LEAST_DB_4_2
+ dbp->close(dbp, 0) ;
#endif
}
- if (outfile)
+ if (outfile)
fclose(ofh);
}
#endif
@@ -2528,7 +2528,7 @@ create(flags=0)
env->set_alloc(env, safemalloc, MyRealloc, safefree) ;
env->set_errcall(env, db_errcall_cb) ;
}
-#endif
+#endif
}
OUTPUT:
RETVAL
@@ -2603,7 +2603,7 @@ BerkeleyDB::Env::Raw
_db_appinit(self, ref, errfile=NULL)
char * self
SV * ref
- SV * errfile
+ SV * errfile
PREINIT:
dMY_CXT;
CODE:
@@ -2737,7 +2737,7 @@ _db_appinit(self, ref, errfile=NULL)
Trace(("copying errprefix\n" )) ;
RETVAL->ErrPrefix = newSVsv(errprefix) ;
SvPOK_only(RETVAL->ErrPrefix) ;
- }
+ }
if (RETVAL->ErrPrefix)
RETVAL->Env->db_errpfx = SvPVX(RETVAL->ErrPrefix) ;
@@ -2813,7 +2813,7 @@ _db_appinit(self, ref, errfile=NULL)
Trace(("set_lg_dir [%s] returned %s\n", log_dir,
my_db_strerror(status)));
}
-#endif
+#endif
#ifdef AT_LEAST_DB_4_4
if (status == 0 && log_filemode) {
status = env->set_lg_filemode(env, log_filemode) ;
@@ -2826,7 +2826,7 @@ _db_appinit(self, ref, errfile=NULL)
Trace(("set_cachesize [%d] returned %s\n",
cachesize, my_db_strerror(status)));
}
-
+
if (status == 0 && lk_detect) {
status = env->set_lk_detect(env, lk_detect) ;
Trace(("set_lk_detect [%d] returned %s\n",
@@ -2869,11 +2869,11 @@ _db_appinit(self, ref, errfile=NULL)
if (enc_passwd && status == 0)
{
status = env->set_encrypt(env, enc_passwd, enc_flags);
- Trace(("ENV->set_encrypt passwd = %s, flags %d returned %s\n",
+ Trace(("ENV->set_encrypt passwd = %s, flags %d returned %s\n",
enc_passwd, enc_flags,
my_db_strerror(status))) ;
}
-#endif
+#endif
#if ! defined(AT_LEAST_DB_5_1)
#ifdef AT_LEAST_DB_4
/* set the server */
@@ -2963,7 +2963,7 @@ _db_appinit(self, ref, errfile=NULL)
SetValue_iv(mode, "Mode") ;
env->set_errcall(env, db_errcall_cb) ;
RETVAL->active = TRUE ;
- RETVAL->cds_enabled = ((flags & DB_INIT_CDB) != 0 ? TRUE : FALSE) ;
+ RETVAL->cds_enabled = ((flags & DB_INIT_CDB) != 0 ? TRUE : FALSE) ;
#ifdef IS_DB_3_0_x
status = (env->open)(env, home, config, flags, mode) ;
#else /* > 3.0 */
@@ -3008,7 +3008,7 @@ DB_ENV(env)
else
RETVAL = NULL;
OUTPUT:
- RETVAL
+ RETVAL
void
@@ -3134,7 +3134,7 @@ _txn_begin(env, pid=NULL, flags=0)
#if DB_VERSION_MAJOR == 2
# define env_txn_checkpoint(e,k,m,f) txn_checkpoint(e->Env->tx_info, k, m)
#else /* DB 3.0 or better */
-# ifdef AT_LEAST_DB_4
+# ifdef AT_LEAST_DB_4
# define env_txn_checkpoint(e,k,m,f) e->Env->txn_checkpoint(e->Env, k, m, f)
# else
# ifdef AT_LEAST_DB_3_1
@@ -3349,7 +3349,7 @@ get_shm_key(env, id)
softCrash("$env->get_shm_key needs Berkeley DB 4.2 or better") ;
#else
RETVAL = env->Env->get_shm_key(env->Env, &id);
-#endif
+#endif
OUTPUT:
RETVAL
id
@@ -3392,7 +3392,7 @@ set_lg_bsize(env, bsize)
int
set_lg_filemode(env, filemode)
BerkeleyDB::Env env
- u_int32_t filemode
+ u_int32_t filemode
PREINIT:
dMY_CXT;
INIT:
@@ -3729,7 +3729,7 @@ get_blob_dir(env, dir)
DualType
set_region_dir(env, dir)
BerkeleyDB::Env env
- const char* dir
+ const char* dir
PREINIT:
dMY_CXT;
CODE:
@@ -3875,7 +3875,7 @@ db_stat(db, flags=0)
DB_HASH_STAT * stat ;
#ifdef AT_LEAST_DB_4_3
db->Status = ((db->dbp)->stat)(db->dbp, db->txn, &stat, flags) ;
-#else
+#else
#ifdef AT_LEAST_DB_3_3
db->Status = ((db->dbp)->stat)(db->dbp, &stat, flags) ;
#else
@@ -4048,7 +4048,7 @@ _db_open_btree(self, ref)
db->prefix = newSVsv(sv) ;
}
- RETVAL = my_db_open(db, ref, ref_dbenv, dbenv, txn, file, subname,
+ RETVAL = my_db_open(db, ref, ref_dbenv, dbenv, txn, file, subname,
DB_BTREE, flags, mode, &info, enc_passwd, enc_flags, hash) ;
}
OUTPUT:
@@ -4069,7 +4069,7 @@ db_stat(db, flags=0)
DB_BTREE_STAT * stat ;
#ifdef AT_LEAST_DB_4_3
db->Status = ((db->dbp)->stat)(db->dbp, db->txn, &stat, flags) ;
-#else
+#else
#ifdef AT_LEAST_DB_3_3
db->Status = ((db->dbp)->stat)(db->dbp, &stat, flags) ;
#else
@@ -4180,7 +4180,7 @@ _db_open_heap(self, ref)
SetValue_pv(info.blob_dir, "BlobDir", char*) ;
#endif
ZMALLOC(db, BerkeleyDB_type) ;
- RETVAL = my_db_open(db, ref, ref_dbenv, dbenv, txn, file, subname,
+ RETVAL = my_db_open(db, ref, ref_dbenv, dbenv, txn, file, subname,
DB_HEAP, flags, mode, &info, enc_passwd, enc_flags, hash) ;
#endif
}
@@ -4250,7 +4250,7 @@ _db_open_recno(self, ref)
db->array_base = (db->array_base == 0 ? 1 : 0) ;
#endif /* ALLOW_RECNO_OFFSET */
- RETVAL = my_db_open(db, ref, ref_dbenv, dbenv, txn, file, subname,
+ RETVAL = my_db_open(db, ref, ref_dbenv, dbenv, txn, file, subname,
DB_RECNO, flags, mode, &info, enc_passwd, enc_flags, hash) ;
}
OUTPUT:
@@ -4318,7 +4318,7 @@ _db_open_queue(self, ref)
db->array_base = (db->array_base == 0 ? 1 : 0) ;
#endif /* ALLOW_RECNO_OFFSET */
- RETVAL = my_db_open(db, ref, ref_dbenv, dbenv, txn, file, subname,
+ RETVAL = my_db_open(db, ref, ref_dbenv, dbenv, txn, file, subname,
DB_QUEUE, flags, mode, &info, enc_passwd, enc_flags, hash) ;
#endif
}
@@ -4342,7 +4342,7 @@ db_stat(db, flags=0)
DB_QUEUE_STAT * stat ;
#ifdef AT_LEAST_DB_4_3
db->Status = ((db->dbp)->stat)(db->dbp, db->txn, &stat, flags) ;
-#else
+#else
#ifdef AT_LEAST_DB_3_3
db->Status = ((db->dbp)->stat)(db->dbp, &stat, flags) ;
#else
@@ -4451,9 +4451,9 @@ _db_cursor(db, flags=0)
if (ix == 1 && db->cds_enabled) {
#ifdef AT_LEAST_DB_3
flags |= DB_WRITECURSOR;
-#else
+#else
flags |= DB_RMW;
-#endif
+#endif
}
if ((db->Status = db_cursor(db, db->txn, &cursor, flags)) == 0){
ZMALLOC(RETVAL, BerkeleyDB__Cursor_type) ;
@@ -4807,7 +4807,7 @@ db_get(db, key, data, flags=0)
RETVAL
key if (writeToKey()) OutputKey(ST(1), key) ;
data
-
+
#define db_exists(db, key, flags) \
(db->Status = ((db->dbp)->exists)(db->dbp, db->txn, &key, flags))
DualType
@@ -4838,7 +4838,7 @@ db_pget(db, key, pkey, data, flags=0)
u_int flags
BerkeleyDB::Common db
DBTKEY_B key
- DBTKEY_Bpr pkey
+ DBTKEY_Bpr pkey
DBT_OPT data
PREINIT:
dMY_CXT;
@@ -5041,8 +5041,8 @@ associate_foreign(db, secondary, callback, flags)
{
//softCrash("associate_foreign does not support callbacks yet") ;
secondary->associated_foreign = newSVsv(callback) ;
- callback_ptr = ( secondary->recno_or_queue
- ? associate_foreign_cb_recno
+ callback_ptr = ( secondary->recno_or_queue
+ ? associate_foreign_cb_recno
: associate_foreign_cb);
}
secondary->primary_recno_or_queue = db->recno_or_queue ;
@@ -5064,7 +5064,7 @@ compact(db, start=NULL, stop=NULL, c_data=NULL, flags=0, end=NULL)
SVnull* stop
SVnull* c_data
u_int32_t flags
- SVnull* end
+ SVnull* end
CODE:
{
#ifndef AT_LEAST_DB_4_4
@@ -5103,7 +5103,7 @@ compact(db, start=NULL, stop=NULL, c_data=NULL, flags=0, end=NULL)
hash = (HV*) SvRV(c_data) ;
cmpt_p = & cmpt;
cmpt.compact_fillpercent = GetValue_iv(hash,"compact_fillpercent") ;
- cmpt.compact_timeout = (db_timeout_t) GetValue_iv(hash, "compact_timeout");
+ cmpt.compact_timeout = (db_timeout_t) GetValue_iv(hash, "compact_timeout");
}
RETVAL = (db->dbp)->compact(db->dbp, db->txn, start_p, stop_p, cmpt_p, flags, end_p);
if (RETVAL == 0 && hash) {
@@ -5210,7 +5210,7 @@ _c_dup(db, flags=0)
/* RETVAL->info ; */
hash_store_iv("BerkeleyDB::Term::Cursor", (char *)RETVAL, 1) ;
}
-#endif
+#endif
}
OUTPUT:
RETVAL
@@ -5280,8 +5280,8 @@ DualType
cu_c_get(db, key, data, flags=0)
int flags
BerkeleyDB::Cursor db
- DBTKEY_B key
- DBT_B data
+ DBTKEY_B key
+ DBT_B data
PREINIT:
dMY_CXT;
INIT:
@@ -5303,7 +5303,7 @@ cu_c_pget(db, key, pkey, data, flags=0)
int flags
BerkeleyDB::Cursor db
DBTKEY_B key
- DBTKEY_Bpr pkey
+ DBTKEY_Bpr pkey
DBT_B data
PREINIT:
dMY_CXT;
@@ -5322,7 +5322,7 @@ cu_c_pget(db, key, pkey, data, flags=0)
RETVAL
key if (writeToKey()) OutputKey(ST(1), key) ;
pkey
- data
+ data
@@ -5428,7 +5428,7 @@ _db_stream(db, flags)
{
Trace(("db_stream [%s]\n", my_db_strerror(db->Status)));
}
-#endif
+#endif
}
OUTPUT:
RETVAL
@@ -5436,7 +5436,7 @@ _db_stream(db, flags)
BerkeleyDB::DbStream::Raw
_c_get_db_stream(db, key, cflags, sflags)
BerkeleyDB::Cursor db
- DBTKEY_B4Blob key
+ DBTKEY_B4Blob key
u_int32_t cflags
u_int32_t sflags
BerkeleyDB::DbStream RETVAL = NULL ;
@@ -5452,7 +5452,7 @@ _c_get_db_stream(db, key, cflags, sflags)
#else
DBT data;
DB_STREAM * stream = NULL ;
- DBT_clear(data);
+ DBT_clear(data);
data.flags = DB_DBT_PARTIAL;
db->Status = (db->cursor->c_get)(db->cursor, &key, &data, cflags);
if (db->Status == 0)
@@ -5470,7 +5470,7 @@ _c_get_db_stream(db, key, cflags, sflags)
{
Trace(("db_stream [%s]\n", my_db_strerror(db->Status)));
}
-#endif
+#endif
}
OUTPUT:
RETVAL
@@ -5516,7 +5516,7 @@ close(dbstream, flags=0)
DualType
read(db, data, offset, size, flags=0)
BerkeleyDB::DbStream db
- DBT_Blob data
+ DBT_Blob data
db_off_t offset
u_int32_t size
u_int32_t flags
@@ -5648,7 +5648,7 @@ txn_close(txnp)
#if DB_VERSION_MAJOR == 2
# define xx_txn_checkpoint(t,k,m,f) txn_checkpoint(t->env->Env->tx_info, k, m)
#else
-# ifdef AT_LEAST_DB_4
+# ifdef AT_LEAST_DB_4
# define xx_txn_checkpoint(e,k,m,f) e->env->Env->txn_checkpoint(e->env->Env, k, m, f)
# else
# ifdef AT_LEAST_DB_3_1
@@ -5989,7 +5989,7 @@ FETCHSIZE(db)
OUTPUT:
RETVAL
-
+
MODULE = BerkeleyDB::Common PACKAGE = BerkeleyDB::Common
BerkeleyDB::Sequence
@@ -6019,9 +6019,9 @@ db_create_sequence(db, flags=0)
OUTPUT:
RETVAL
-
+
MODULE = BerkeleyDB::Sequence PACKAGE = BerkeleyDB::Sequence PREFIX = seq_
-
+
DualType
open(seq, key, flags=0)
BerkeleyDB::Sequence seq
@@ -6052,7 +6052,7 @@ close(seq,flags=0)
#ifndef AT_LEAST_DB_4_3
softCrash("$seq->close needs Berkeley DB 4.3.x or better") ;
#else
- RETVAL = 0;
+ RETVAL = 0;
if (seq->active) {
-- seq->db->open_sequences;
RETVAL = (seq->seq->close)(seq->seq, flags);
@@ -6061,7 +6061,7 @@ close(seq,flags=0)
#endif
OUTPUT:
RETVAL
-
+
DualType
remove(seq,flags=0)
BerkeleyDB::Sequence seq;
@@ -6074,14 +6074,14 @@ remove(seq,flags=0)
#ifndef AT_LEAST_DB_4_3
softCrash("$seq->remove needs Berkeley DB 4.3.x or better") ;
#else
- RETVAL = 0;
+ RETVAL = 0;
if (seq->active)
RETVAL = seq->seq->remove(seq->seq, seq->db->txn, flags);
seq->active = FALSE;
#endif
OUTPUT:
RETVAL
-
+
void
DESTROY(seq)
BerkeleyDB::Sequence seq
@@ -6112,8 +6112,8 @@ get(seq, element, delta=1, flags=0)
#endif
OUTPUT:
RETVAL
- element
-
+ element
+
DualType
get_key(seq, key)
BerkeleyDB::Sequence seq;
@@ -6131,8 +6131,8 @@ get_key(seq, key)
#endif
OUTPUT:
RETVAL
- key
-
+ key
+
DualType
initial_value(seq, low, high=0)
BerkeleyDB::Sequence seq;
@@ -6150,7 +6150,7 @@ initial_value(seq, low, high=0)
#endif
OUTPUT:
RETVAL
-
+
DualType
set_cachesize(seq, size)
BerkeleyDB::Sequence seq;
@@ -6167,7 +6167,7 @@ set_cachesize(seq, size)
#endif
OUTPUT:
RETVAL
-
+
DualType
get_cachesize(seq, size)
BerkeleyDB::Sequence seq;
@@ -6184,7 +6184,7 @@ get_cachesize(seq, size)
#endif
OUTPUT:
RETVAL
- size
+ size
DualType
set_flags(seq, flags)
@@ -6202,7 +6202,7 @@ set_flags(seq, flags)
#endif
OUTPUT:
RETVAL
-
+
DualType
get_flags(seq, flags)
BerkeleyDB::Sequence seq;
@@ -6219,8 +6219,8 @@ get_flags(seq, flags)
#endif
OUTPUT:
RETVAL
- flags
-
+ flags
+
DualType
set_range(seq)
BerkeleyDB::Sequence seq;
@@ -6238,7 +6238,7 @@ BOOT:
{
#ifdef dTHX
dTHX;
-#endif
+#endif
SV * sv_err = perl_get_sv(ERR_BUFF, GV_ADD|GV_ADDMULTI) ;
SV * version_sv = perl_get_sv("BerkeleyDB::db_version", GV_ADD|GV_ADDMULTI) ;
SV * ver_sv = perl_get_sv("BerkeleyDB::db_ver", GV_ADD|GV_ADDMULTI) ;
@@ -6267,4 +6267,3 @@ BOOT:
empty.flags = 0 ;
}
-
diff --git a/Changes b/Changes
index f89a1e5..bd84a53 100755
--- a/Changes
+++ b/Changes
@@ -1,5 +1,11 @@
Revision history for Perl extension BerkeleyDB.
+0.65 13 May 2022
+
+ * Update to license wording
+ Fri May 13 07:50:38 2022 +0100
+ 0fb21f12d1938f0cd5c3cfe2f674f0c41863fb55
+
0.64 17 September 2020
* Refresh ppport.h
diff --git a/META.json b/META.json
index 2b0cf3a..5cad540 100644
--- a/META.json
+++ b/META.json
@@ -43,6 +43,6 @@
"web" : "https://github.com/pmqs/BerkeleyDB"
}
},
- "version" : "0.64",
+ "version" : "0.65",
"x_serialization_backend" : "JSON::PP version 4.02"
}
diff --git a/META.yml b/META.yml
index 0c5d74e..4f0bacb 100644
--- a/META.yml
+++ b/META.yml
@@ -21,5 +21,5 @@ resources:
bugtracker: https://github.com/pmqs/BerkeleyDB/issues
homepage: https://github.com/pmqs/BerkeleyDB
repository: git://github.com/pmqs/BerkeleyDB.git
-version: '0.64'
+version: '0.65'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff --git a/Makefile.PL b/Makefile.PL
index f57f97a..715bff4 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -54,30 +54,30 @@ $TRACE = "-DTRACE" if $ENV{BERKELEYDB_DEFINE_TRACE} ;
WriteMakefile(
NAME => 'BerkeleyDB',
LIBS => ["-L${LIB_DIR} $LIBS"],
- #MAN3PODS => {}, # Pods will be built by installman.
+ #MAN3PODS => {}, # Pods will be built by installman.
INC => "-I$INC_DIR",
VERSION_FROM => 'BerkeleyDB.pm',
XSPROTOARG => '-noprototypes',
DEFINE => "$OS2 $WALL $TRACE",
#'macro' => { INSTALLDIRS => 'perl' },
- 'dist' => {COMPRESS=>'gzip', SUFFIX=>'gz'},
+ 'dist' => {COMPRESS=>'gzip', SUFFIX=>'gz'},
($] >= 5.005
? (ABSTRACT_FROM => 'BerkeleyDB.pod',
AUTHOR => 'Paul Marquess <pmqs@cpan.org>')
: ()
),
- ((ExtUtils::MakeMaker->VERSION() gt '6.30')
- ? ('LICENSE' => 'perl')
+ ((ExtUtils::MakeMaker->VERSION() gt '6.30')
+ ? ('LICENSE' => 'perl')
: ()
),
- ( eval { ExtUtils::MakeMaker->VERSION(6.46) }
+ ( eval { ExtUtils::MakeMaker->VERSION(6.46) }
? ( META_MERGE => {
-
+
"meta-spec" => { version => 2 },
-
+
resources => {
-
+
bugtracker => {
web => 'https://github.com/pmqs/BerkeleyDB/issues'
},
@@ -88,10 +88,10 @@ WriteMakefile(
type => 'git',
url => 'git://github.com/pmqs/BerkeleyDB.git',
web => 'https://github.com/pmqs/BerkeleyDB',
- },
+ },
},
- }
- )
+ }
+ )
: ()
),
@@ -104,13 +104,13 @@ sub MY::libscan
my $path = shift ;
return undef
- if $path =~ /(~|\.bak)$/ ||
+ if $path =~ /(~|\.bak)$/ ||
$path =~ /^\..*\.swp$/ ;
- return $path;
+ return $path;
}
-
+
sub MY::postamble {
'
$(NAME).pod: $(NAME).pod.P t/examples.t.T t/examples3.t.T mkpod
@@ -119,7 +119,7 @@ $(NAME).pod: $(NAME).pod.P t/examples.t.T t/examples3.t.T mkpod
$(NAME).xs: typemap
$(TOUCH) $(NAME).xs
-Makefile: config.in
+Makefile: config.in
' ;
@@ -163,7 +163,7 @@ sub ParseCONFIG
# check parsed values
my @missing = () ;
- die "The following keys are missing from $CONFIG file: [@missing]\n"
+ die "The following keys are missing from $CONFIG file: [@missing]\n"
if @missing = keys %Parsed ;
$INC_DIR = $ENV{'BERKELEYDB_INCLUDE'} || $Info{'INCLUDE'} ;
diff --git a/README b/README
index d833f03..bf46599 100755
--- a/README
+++ b/README
@@ -1,11 +1,11 @@
BerkeleyDB
- Version 0.64
+ Version 0.65
- 17th August 2020
+ 13th May 2022
- Copyright (c) 1997-2020 Paul Marquess. All rights reserved. This
+ Copyright (c) 1997-2022 Paul Marquess. All rights reserved. This
program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
diff --git a/Todo b/Todo
index 12d53bc..0c7ec95 100644
--- a/Todo
+++ b/Todo
@@ -28,7 +28,7 @@ Possibles
* allow recno to allow base offset for arrays to be either 0 or 1.
- * when duplicate keys are enabled, allow db_put($key, [$val1, $val2,...])
+ * when duplicate keys are enabled, allow db_put($key, [$val1, $val2,...])
2.x -> 3.x Upgrade
diff --git a/config.in b/config.in
index b6f036a..7a4b2b9 100644
--- a/config.in
+++ b/config.in
@@ -31,7 +31,7 @@ LIB = /usr/local/BerkeleyDB/lib
# Berkeley DB library from libdb.a to libdb-2.6.4.a and change the
# DBNAME line below to look like this:
#
-# DBNAME = -ldb-2.6.4
+# DBNAME = -ldb-2.6.4
#
# Note: If you are building this module with Win32, -llibdb will be
# used by default.
diff --git a/dbinfo b/dbinfo
index e6ba7fd..b2dadbc 100755
--- a/dbinfo
+++ b/dbinfo
@@ -7,7 +7,7 @@
# Version: 1.07
# Date 2nd April 2011
#
-# Copyright (c) 1998-2020 Paul Marquess. All rights reserved.
+# Copyright (c) 1998-2022 Paul Marquess. All rights reserved.
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
diff --git a/debian/changelog b/debian/changelog
index 725bf60..76e74f4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+libberkeleydb-perl (0.65-1) UNRELEASED; urgency=low
+
+ * New upstream release.
+
+ -- Debian Janitor <janitor@jelmer.uk> Wed, 14 Dec 2022 22:43:47 -0000
+
libberkeleydb-perl (0.64-2) unstable; urgency=medium
* Enable the autopkgtest-pkg-perl test suite.
diff --git a/debian/patches/ignore_patchlevel_check b/debian/patches/ignore_patchlevel_check
index 6c157ee..eddbb23 100644
--- a/debian/patches/ignore_patchlevel_check
+++ b/debian/patches/ignore_patchlevel_check
@@ -4,9 +4,11 @@ Description: accept as valid different patchlevels
Bug-Debian: http://bugs.debian.org/290988
Forwarded: no
---- a/BerkeleyDB.xs
-+++ b/BerkeleyDB.xs
-@@ -6167,7 +6167,7 @@ BOOT:
+Index: libberkeleydb-perl.git/BerkeleyDB.xs
+===================================================================
+--- libberkeleydb-perl.git.orig/BerkeleyDB.xs
++++ libberkeleydb-perl.git/BerkeleyDB.xs
+@@ -6247,7 +6247,7 @@ BOOT:
(void)db_version(&Major, &Minor, &Patch) ;
/* Check that the versions of db.h and libdb.a are the same */
if (Major != DB_VERSION_MAJOR || Minor != DB_VERSION_MINOR
diff --git a/mkconsts.pl b/mkconsts.pl
index 48c143e..d4d5b48 100755
--- a/mkconsts.pl
+++ b/mkconsts.pl
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-use ExtUtils::Constant qw(WriteConstants);
+use ExtUtils::Constant qw(WriteConstants);
use constant DEFINE => 'define' ;
use constant STRING => 'string' ;
@@ -1177,7 +1177,7 @@ sub enum_Macro
my $str = shift ;
my ($major, $minor, $patch) = split /\./, $str ;
- my $macro =
+ my $macro =
"#if (DB_VERSION_MAJOR > $major) || \\\n" .
" (DB_VERSION_MAJOR == $major && DB_VERSION_MINOR > $minor) || \\\n" .
" (DB_VERSION_MAJOR == $major && DB_VERSION_MINOR == $minor && \\\n" .
@@ -1232,12 +1232,12 @@ sub OutputPM
if ( /^\s*$START_re/ )
{
# skip to the end marker.
- while (<IN>)
+ while (<IN>)
{ last OUTER if /^\s*$END_re/ }
}
print OUT ;
}
-
+
print OUT "$START\n";
foreach my $key (sort keys %constants)
{
@@ -1245,7 +1245,7 @@ sub OutputPM
print OUT "\t$key\n";
}
print OUT "\t$END\n";
-
+
while (<IN>)
{
print OUT ;
diff --git a/mkpod b/mkpod
index 44bbf3f..285627a 100755
--- a/mkpod
+++ b/mkpod
@@ -10,7 +10,7 @@
# Tagged source files end with .T
# Output from the code ends with .O
# Pre-Pod file ends with .P
-#
+#
# Tags
#
# ## BEGIN tagname
@@ -35,8 +35,8 @@ foreach $file (glob("*.M"))
{
# Skip blank & comment lines
next if /^\s*$/ || /^\s*#/ ;
-
- #
+
+ #
($name, $expand) = split (/\t+/, $_, 2) ;
$expand =~ s/^\s*// ;
@@ -130,7 +130,7 @@ foreach $ppod (@ppods)
{
warn "No code insert '$1' available\n"
unless $Section{$1} ;
-
+
print "Expanding section $1\n" if $Verbose ;
print POD $Section{$1} ;
}
@@ -140,7 +140,7 @@ foreach $ppod (@ppods)
print POD $line ;
}
}
-
+
close PPOD ;
close POD ;
}
diff --git a/scan.pl b/scan.pl
index 8f93c19..6f2f1e9 100644
--- a/scan.pl
+++ b/scan.pl
@@ -1,6 +1,6 @@
#!/usr/local/bin/perl
-my $ignore_re = '^(' . join("|",
+my $ignore_re = '^(' . join("|",
qw(
_
[a-z]
@@ -45,7 +45,7 @@ foreach my $name (sort tuple glob("[2-9]*"), glob("[1-9][0-9]*"))
my $file = readFile($inc) ;
StripCommentsAndStrings($file) ;
my $result = scan($name, $file) ;
- print "\n\t#########\n\t# $name\n\t#########\n\n$result"
+ print "\n\t#########\n\t# $name\n\t#########\n\n$result"
if $result;
}
exit ;
@@ -60,7 +60,7 @@ sub scan
my $result = "" ;
if (1) {
- # Preprocess all tri-graphs
+ # Preprocess all tri-graphs
# including things stuck in quoted string constants.
$file =~ s/\?\?=/#/g; # | ??=| #|
$file =~ s/\?\?\!/|/g; # | ??!| ||
@@ -72,52 +72,52 @@ sub scan
$file =~ s/\?\?</{/g; # | ??<| {|
$file =~ s/\?\?>/}/g; # | ??>| }|
}
-
- while ( $file =~ /^\s*#\s*define\s+([\$\w]+)\b(?!\()\s*(.*)/gm )
+
+ while ( $file =~ /^\s*#\s*define\s+([\$\w]+)\b(?!\()\s*(.*)/gm )
{
my $def = $1;
my $rest = $2;
my $ignore = 0 ;
-
+
$ignore = 1 if $ignore_def{$def} || $def =~ /$ignore_re/o ;
-
+
# Cannot do: (-1) and ((LHANDLE)3) are OK:
#print("Skip non-wordy $def => $rest\n"),
-
+
$rest =~ s/\s*$//;
#next if $rest =~ /[^\w\$]/;
-
+
#print "Matched $_ ($def)\n" ;
next if $before{$def} ++ ;
-
+
if ($ignore)
{ $seen_define{$def} = 'IGNORE' }
- elsif ($rest =~ /"/)
+ elsif ($rest =~ /"/)
{ $seen_define{$def} = 'STRING' }
else
{ $seen_define{$def} = 'DEFINE' }
}
-
+
foreach $define (sort keys %seen_define)
- {
+ {
my $out = $filler ;
substr($out,0, length $define) = $define;
$result .= "\t$out => $seen_define{$define},\n" ;
}
-
+
while ($file =~ /\btypedef\s+enum\s*{(.*?)}\s*(\w+)/gs )
{
my $enum = $1 ;
my $name = $2 ;
my $ignore = 0 ;
-
+
$ignore = 1 if $ignore_enums{$name} ;
-
+
#$enum =~ s/\s*=\s*\S+\s*(,?)\s*\n/$1/g;
$enum =~ s/^\s*//;
$enum =~ s/\s*$//;
-
+
my @tokens = map { s/\s*=.*// ; $_} split /\s*,\s*/, $enum ;
my @new = grep { ! $Enums{$_}++ } @tokens ;
@@ -160,13 +160,13 @@ sub StripCommentsAndStrings
)* ## 0-or-more things which don't start with /
## but do end with '*'
/ ## End of /* ... */ comment
-
+
| ## OR C++ Comment
- // ## Start of C++ comment //
+ // ## Start of C++ comment //
[^\n]* ## followed by 0-or-more non end of line characters
| ## OR various things which aren't comments:
-
+
(
" ## Start of " ... " string
(
@@ -175,9 +175,9 @@ sub StripCommentsAndStrings
[^"\\] ## Non "\
)*
" ## End of " ... " string
-
+
| ## OR
-
+
' ## Start of ' ... ' string
(
\\. ## Escaped char
@@ -185,9 +185,9 @@ sub StripCommentsAndStrings
[^'\\] ## Non '\
)*
' ## End of ' ... ' string
-
+
| ## OR
-
+
. ## Anything other char
[^/"'\\]* ## Chars which doesn't start a comment, string or escape
)
@@ -236,7 +236,6 @@ sub tuple
$A == $B or return $A <=> $B ;
}
return 0;
-}
+}
__END__
-
diff --git a/t/000prereq.t b/t/000prereq.t
index 1e90a09..48bd595 100644
--- a/t/000prereq.t
+++ b/t/000prereq.t
@@ -21,7 +21,7 @@ BEGIN
plan tests => 1 + $extra ;
- use_ok('BerkeleyDB', '0.64');
+ use_ok('BerkeleyDB', '0.65');
}
if (defined $BerkeleyDB::VERSION)
diff --git a/t/blob.t b/t/blob.t
index 6931418..e46d100 100644
--- a/t/blob.t
+++ b/t/blob.t
@@ -3,7 +3,7 @@
use strict ;
use lib 't';
-use BerkeleyDB;
+use BerkeleyDB;
use util ;
use Test::More;
@@ -39,13 +39,13 @@ for my $TYPE ( qw(BerkeleyDB::Hash BerkeleyDB::Btree ))
my $lexd = new LexDir $home ;
my $threshold = 1234 ;
- ok my $env = new BerkeleyDB::Env
+ ok my $env = new BerkeleyDB::Env
Flags => DB_CREATE|DB_INIT_MPOOL,
- #@StdErrFile,
+ #@StdErrFile,
BlobDir => $home,
Home => $home ;
- ok my $db = new $TYPE Filename => $Dfile,
+ ok my $db = new $TYPE Filename => $Dfile,
Env => $env,
BlobThreshold => $threshold,
Flags => DB_CREATE ;
@@ -102,7 +102,7 @@ for my $TYPE ( qw(BerkeleyDB::Hash BerkeleyDB::Btree ))
ok $dbstream->write($newData) == 0 , "write";
substr($bigData, 0, length($newData)) = $newData;
-
+
my $new1;
ok $dbstream->read($new, 0, 5) == 0 , "read";
is $new, "hello";
@@ -163,4 +163,3 @@ for my $TYPE ( qw(BerkeleyDB::Hash BerkeleyDB::Btree ))
is $d2, $smallData;
}
-
diff --git a/t/btree.t b/t/btree.t
index adef0c4..61598b9 100644
--- a/t/btree.t
+++ b/t/btree.t
@@ -3,7 +3,7 @@
use strict ;
use lib 't';
-use BerkeleyDB;
+use BerkeleyDB;
use util ;
use Test::More;
@@ -25,7 +25,7 @@ umask(0) ;
ok $@ =~ /unknown key value\(s\) Stupid/ ;
eval ' $db = new BerkeleyDB::Btree -Bad => 2, -Mode => 0345, -Stupid => 3; ' ;
- ok $@ =~ /unknown key value\(s\) (Bad,? |Stupid,? ){2}/
+ ok $@ =~ /unknown key value\(s\) (Bad,? |Stupid,? ){2}/
or print "# $@" ;
eval ' $db = new BerkeleyDB::Btree -Env => 2 ' ;
@@ -44,7 +44,7 @@ umask(0) ;
{
my $lex = new LexFile $Dfile ;
- ok my $db = new BerkeleyDB::Btree -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Btree -Filename => $Dfile,
-Flags => DB_CREATE ;
# Add a k/v pair
@@ -61,7 +61,7 @@ umask(0) ;
ok $db->db_del("some key") == 0 ;
ok $db->db_get("some key", $value) == DB_NOTFOUND ;
ok $db->status() == DB_NOTFOUND ;
- ok $db->status() =~ $DB_errors{'DB_NOTFOUND'}
+ ok $db->status() =~ $DB_errors{'DB_NOTFOUND'}
or diag "Status is [" . $db->status() . "]";
ok $db->db_sync() == 0 ;
@@ -101,7 +101,7 @@ umask(0) ;
ok my $env = new BerkeleyDB::Env -Flags => DB_CREATE|DB_INIT_MPOOL,
@StdErrFile, -Home => $home ;
- ok my $db = new BerkeleyDB::Btree -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Btree -Filename => $Dfile,
-Env => $env,
-Flags => DB_CREATE ;
@@ -117,16 +117,16 @@ umask(0) ;
undef $env ;
}
-
+
{
# cursors
my $lex = new LexFile $Dfile ;
my %hash ;
my ($k, $v) ;
- ok my $db = new BerkeleyDB::Btree -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Btree -Filename => $Dfile,
-Flags => DB_CREATE ;
- #print "[$db] [$!] $BerkeleyDB::Error\n" ;
+ #print "[$db] [$!] $BerkeleyDB::Error\n" ;
# create some data
my %data = (
@@ -149,7 +149,7 @@ umask(0) ;
my $extras = 0 ;
# sequence forwards
while ($cursor->c_get($k, $v, DB_NEXT) == 0) {
- if ( $copy{$k} eq $v )
+ if ( $copy{$k} eq $v )
{ delete $copy{$k} }
else
{ ++ $extras }
@@ -166,7 +166,7 @@ umask(0) ;
for ( $status = $cursor->c_get($k, $v, DB_LAST) ;
$status == 0 ;
$status = $cursor->c_get($k, $v, DB_PREV)) {
- if ( $copy{$k} eq $v )
+ if ( $copy{$k} eq $v )
{ delete $copy{$k} }
else
{ ++ $extras }
@@ -188,7 +188,7 @@ umask(0) ;
ok $cursor->c_get($k, $v, DB_GET_BOTH) == DB_NOTFOUND ;
}
-
+
{
# Tied Hash interface
@@ -253,29 +253,29 @@ umask(0) ;
my $lex = new LexFile $Dfile, $Dfile2, $Dfile3 ;
my $value ;
my (%h, %g, %k) ;
- my @Keys = qw( 0123 12 -1234 9 987654321 def ) ;
- ok tie %h, "BerkeleyDB::Btree", -Filename => $Dfile,
+ my @Keys = qw( 0123 12 -1234 9 987654321 def ) ;
+ ok tie %h, "BerkeleyDB::Btree", -Filename => $Dfile,
-Compare => sub { $_[0] <=> $_[1] },
-Flags => DB_CREATE ;
- ok tie %g, 'BerkeleyDB::Btree', -Filename => $Dfile2,
+ ok tie %g, 'BerkeleyDB::Btree', -Filename => $Dfile2,
-Compare => sub { $_[0] cmp $_[1] },
-Flags => DB_CREATE ;
- ok tie %k, 'BerkeleyDB::Btree', -Filename => $Dfile3,
+ ok tie %k, 'BerkeleyDB::Btree', -Filename => $Dfile3,
-Compare => sub { length $_[0] <=> length $_[1] },
-Flags => DB_CREATE ;
my @srt_1 ;
{ local $^W = 0 ;
- @srt_1 = sort { $a <=> $b } @Keys ;
+ @srt_1 = sort { $a <=> $b } @Keys ;
}
my @srt_2 = sort { $a cmp $b } @Keys ;
my @srt_3 = sort { length $a <=> length $b } @Keys ;
foreach (@Keys) {
local $^W = 0 ;
- $h{$_} = 1 ;
+ $h{$_} = 1 ;
$g{$_} = 1 ;
$k{$_} = 1 ;
}
@@ -290,26 +290,26 @@ umask(0) ;
my $lex = new LexFile $Dfile, $Dfile2, $Dfile3 ;
my $value ;
my (%h, %g, %k) ;
- my @Keys = qw( 0123 9 12 -1234 9 987654321 def ) ;
- my @Values = qw( 1 0 3 dd x abc 0 ) ;
- ok tie %h, "BerkeleyDB::Btree", -Filename => $Dfile,
+ my @Keys = qw( 0123 9 12 -1234 9 987654321 def ) ;
+ my @Values = qw( 1 0 3 dd x abc 0 ) ;
+ ok tie %h, "BerkeleyDB::Btree", -Filename => $Dfile,
-Compare => sub { $_[0] <=> $_[1] },
-Property => DB_DUP,
-Flags => DB_CREATE ;
- ok tie %g, 'BerkeleyDB::Btree', -Filename => $Dfile2,
+ ok tie %g, 'BerkeleyDB::Btree', -Filename => $Dfile2,
-Compare => sub { $_[0] cmp $_[1] },
-Property => DB_DUP,
-Flags => DB_CREATE ;
- ok tie %k, 'BerkeleyDB::Btree', -Filename => $Dfile3,
+ ok tie %k, 'BerkeleyDB::Btree', -Filename => $Dfile3,
-Compare => sub { length $_[0] <=> length $_[1] },
-Property => DB_DUP,
-Flags => DB_CREATE ;
my @srt_1 ;
{ local $^W = 0 ;
- @srt_1 = sort { $a <=> $b } @Keys ;
+ @srt_1 = sort { $a <=> $b } @Keys ;
}
my @srt_2 = sort { $a cmp $b } @Keys ;
my @srt_3 = sort { length $a <=> length $b } @Keys ;
@@ -317,7 +317,7 @@ umask(0) ;
foreach (@Keys) {
local $^W = 0 ;
my $value = shift @Values ;
- $h{$_} = $value ;
+ $h{$_} = $value ;
$g{$_} = $value ;
$k{$_} = $value ;
}
@@ -359,33 +359,33 @@ umask(0) ;
my $lex = new LexFile $Dfile, $Dfile2;
my $value ;
my (%h, %g) ;
- my @Keys = qw( 0123 9 12 -1234 9 987654321 9 def ) ;
- my @Values = qw( 1 11 3 dd x abc 2 0 ) ;
- ok tie %h, "BerkeleyDB::Btree", -Filename => $Dfile,
+ my @Keys = qw( 0123 9 12 -1234 9 987654321 9 def ) ;
+ my @Values = qw( 1 11 3 dd x abc 2 0 ) ;
+ ok tie %h, "BerkeleyDB::Btree", -Filename => $Dfile,
-Compare => sub { $_[0] <=> $_[1] },
-DupCompare => sub { $_[0] cmp $_[1] },
-Property => DB_DUP,
-Flags => DB_CREATE ;
- ok tie %g, 'BerkeleyDB::Btree', -Filename => $Dfile2,
+ ok tie %g, 'BerkeleyDB::Btree', -Filename => $Dfile2,
-Compare => sub { $_[0] cmp $_[1] },
-DupCompare => sub { $_[0] <=> $_[1] },
-Property => DB_DUP,
-
-
-
+
+
+
-Flags => DB_CREATE ;
my @srt_1 ;
{ local $^W = 0 ;
- @srt_1 = sort { $a <=> $b } @Keys ;
+ @srt_1 = sort { $a <=> $b } @Keys ;
}
my @srt_2 = sort { $a cmp $b } @Keys ;
foreach (@Keys) {
local $^W = 0 ;
my $value = shift @Values ;
- $h{$_} = $value ;
+ $h{$_} = $value ;
$g{$_} = $value ;
}
@@ -401,7 +401,7 @@ umask(0) ;
my $lex = new LexFile $Dfile;
my %hh ;
- ok my $YY = tie %hh, "BerkeleyDB::Btree", -Filename => $Dfile,
+ ok my $YY = tie %hh, "BerkeleyDB::Btree", -Filename => $Dfile,
-DupCompare => sub { $_[0] cmp $_[1] },
-Property => DB_DUP,
-Flags => DB_CREATE ;
@@ -411,37 +411,37 @@ umask(0) ;
$hh{'Wall'} = 'Brick' ; # Note the duplicate key
$hh{'Smith'} = 'John' ;
$hh{'mouse'} = 'mickey' ;
-
+
# first work in scalar context
ok scalar $YY->get_dup('Unknown') == 0 ;
ok scalar $YY->get_dup('Smith') == 1 ;
ok scalar $YY->get_dup('Wall') == 3 ;
-
+
# now in list context
my @unknown = $YY->get_dup('Unknown') ;
ok "@unknown" eq "" ;
-
+
my @smith = $YY->get_dup('Smith') ;
ok "@smith" eq "John" ;
-
+
{
my @wall = $YY->get_dup('Wall') ;
my %wall ;
@wall{@wall} = @wall ;
ok (@wall == 3 && $wall{'Larry'} && $wall{'Stone'} && $wall{'Brick'});
}
-
+
# hash
my %unknown = $YY->get_dup('Unknown', 1) ;
ok keys %unknown == 0 ;
-
+
my %smith = $YY->get_dup('Smith', 1) ;
ok keys %smith == 1 && $smith{'John'} ;
-
+
my %wall = $YY->get_dup('Wall', 1) ;
- ok keys %wall == 3 && $wall{'Larry'} == 1 && $wall{'Stone'} == 1
+ ok keys %wall == 3 && $wall{'Larry'} == 1 && $wall{'Stone'} == 1
&& $wall{'Brick'} == 1 ;
-
+
undef $YY ;
untie %hh ;
@@ -461,7 +461,7 @@ umask(0) ;
ok $value eq "some value" ;
}
-
+
{
# partial
# check works via API
@@ -545,7 +545,7 @@ umask(0) ;
{
# partial
- # check works via tied hash
+ # check works via tied hash
my $lex = new LexFile $Dfile ;
my %hash ;
@@ -634,7 +634,7 @@ umask(0) ;
ok ((my $Z = $txn->txn_commit()) == 0) ;
ok $txn = $env->txn_begin() ;
$db1->Txn($txn);
-
+
# create some data
my %data = (
"red" => "boat",
@@ -712,7 +712,7 @@ umask(0) ;
ok $cursor->c_get($key, $value, DB_NEXT) == 0 ;
ok $key eq "Wall" && $value eq "Brick" ;
- #my $ref = $db->db_stat() ;
+ #my $ref = $db->db_stat() ;
#ok ($ref->{bt_flags} | DB_DUP) == DB_DUP ;
#print "bt_flags " . $ref->{bt_flags} . " DB_DUP " . DB_DUP ."\n";
@@ -729,13 +729,13 @@ umask(0) ;
my $recs = ($BerkeleyDB::db_version >= 3.1 ? "bt_ndata" : "bt_nrecs") ;
my %hash ;
my ($k, $v) ;
- ok my $db = new BerkeleyDB::Btree -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Btree -Filename => $Dfile,
-Flags => DB_CREATE,
-Minkey =>3 ,
- -Pagesize => 2 **12
+ -Pagesize => 2 **12
;
- my $ref = $db->db_stat() ;
+ my $ref = $db->db_stat() ;
ok $ref->{$recs} == 0;
ok $ref->{'bt_minkey'} == 3;
ok $ref->{'bt_pagesize'} == 2 ** 12;
@@ -753,7 +753,7 @@ umask(0) ;
}
ok $ret == 0 ;
- $ref = $db->db_stat() ;
+ $ref = $db->db_stat() ;
ok $ref->{$recs} == 3;
}
@@ -777,14 +777,14 @@ umask(0) ;
@ISA=qw(BerkeleyDB BerkeleyDB::Btree );
@EXPORT = @BerkeleyDB::EXPORT ;
- sub db_put {
+ sub db_put {
my $self = shift ;
my $key = shift ;
my $value = shift ;
$self->SUPER::db_put($key, $value * 3) ;
}
- sub db_get {
+ sub db_get {
my $self = shift ;
$self->SUPER::db_get($_[0], $_[1]) ;
$_[1] -= 2 ;
@@ -804,13 +804,13 @@ EOM
close FILE ;
use Test::More;
- BEGIN { push @INC, '.'; }
+ BEGIN { push @INC, '.'; }
eval 'use SubDB ; ';
ok $@ eq "" ;
my %h ;
my $X ;
eval '
- $X = tie(%h, "SubDB", -Filename => "dbbtree.tmp",
+ $X = tie(%h, "SubDB", -Filename => "dbbtree.tmp",
-Flags => DB_CREATE,
-Mode => 0640 );
' ;
@@ -846,8 +846,8 @@ EOM
my $lex = new LexFile $Dfile ;
my %hash ;
my ($k, $v) = ("", "");
- ok my $db = new BerkeleyDB::Btree
- -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Btree
+ -Filename => $Dfile,
-Flags => DB_CREATE,
-Property => DB_RECNUM ;
@@ -920,4 +920,3 @@ EOM
ok $v == 4 ;
}
-
diff --git a/t/cds.t b/t/cds.t
index 2cea90a..ea94ae6 100644
--- a/t/cds.t
+++ b/t/cds.t
@@ -5,7 +5,7 @@
use strict ;
use lib 't' ;
-use BerkeleyDB;
+use BerkeleyDB;
use util ;
use Test::More;
@@ -15,7 +15,7 @@ BEGIN {
plan(skip_all => "this needs BerkeleyDB 2.x or better" )
if $BerkeleyDB::db_version < 2;
- plan tests => 12;
+ plan tests => 12;
}
@@ -35,7 +35,7 @@ umask(0) ;
ok my $env = new BerkeleyDB::Env -Flags => DB_CREATE|DB_INIT_MPOOL,
-Home => $home, @StdErrFile ;
- ok my $db = new BerkeleyDB::Btree -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Btree -Filename => $Dfile,
-Env => $env,
-Flags => DB_CREATE ;
@@ -58,7 +58,7 @@ umask(0) ;
ok my $env = new BerkeleyDB::Env -Flags => DB_INIT_CDB|DB_CREATE|DB_INIT_MPOOL,
-Home => $home, @StdErrFile ;
- ok my $db = new BerkeleyDB::Btree -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Btree -Filename => $Dfile,
-Env => $env,
-Flags => DB_CREATE ;
diff --git a/t/db-3.0.t b/t/db-3.0.t
index eb8f18a..a91f8b3 100644
--- a/t/db-3.0.t
+++ b/t/db-3.0.t
@@ -5,7 +5,7 @@
use strict ;
use lib 't';
-use BerkeleyDB;
+use BerkeleyDB;
use util ;
use Test::More ;
@@ -14,7 +14,7 @@ BEGIN {
plan(skip_all => "this needs BerkeleyDB 3.x or better" )
if $BerkeleyDB::db_version < 3;
- plan tests => 14;
+ plan tests => 14;
}
my $Dfile = "dbhash.tmp";
@@ -40,7 +40,7 @@ umask(0);
my $lex = new LexFile $Dfile ;
my %hash ;
my ($k, $v) ;
- ok my $db = new BerkeleyDB::Hash -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Hash -Filename => $Dfile,
-Flags => DB_CREATE ;
# create some data
@@ -80,6 +80,5 @@ umask(0);
ok $dup_cursor->c_get($k, $v, DB_CURRENT) == 0;
ok $k eq "green" ;
ok $v eq "house" ;
-
-}
+}
diff --git a/t/db-3.1.t b/t/db-3.1.t
index 3950fe5..5cd336e 100644
--- a/t/db-3.1.t
+++ b/t/db-3.1.t
@@ -5,11 +5,11 @@ use strict ;
use lib 't';
use util ;
-use Test::More ;
+use Test::More ;
-use BerkeleyDB;
+use BerkeleyDB;
-plan(skip_all => "1..0 # Skip: this needs Berkeley DB 3.1.x or better\n")
+plan(skip_all => "1..0 # Skip: this needs Berkeley DB 3.1.x or better\n")
if $BerkeleyDB::db_version < 3.1 ;
plan(tests => 48) ;
@@ -122,13 +122,13 @@ umask(0) ;
title "rename a subdb";
my $lex = new LexFile $Dfile ;
-
- my $db1 = new BerkeleyDB::Hash -Filename => $Dfile,
+
+ my $db1 = new BerkeleyDB::Hash -Filename => $Dfile,
-Subname => "fred" ,
-Flags => DB_CREATE ;
isa_ok $db1, 'BerkeleyDB::Hash', " create database ok";
- my $db2 = new BerkeleyDB::Btree -Filename => $Dfile,
+ my $db2 = new BerkeleyDB::Btree -Filename => $Dfile,
-Subname => "joe" ,
-Flags => DB_CREATE ;
isa_ok $db2, 'BerkeleyDB::Btree', " create database ok";
@@ -148,12 +148,12 @@ umask(0) ;
undef $db1 ;
undef $db2 ;
- # now rename
- cmp_ok BerkeleyDB::db_rename(-Filename => $Dfile,
+ # now rename
+ cmp_ok BerkeleyDB::db_rename(-Filename => $Dfile,
-Subname => "fred",
-Newname => "harry"), '==', 0, " rename ok";
-
- my $db3 = new BerkeleyDB::Hash -Filename => $Dfile,
+
+ my $db3 = new BerkeleyDB::Hash -Filename => $Dfile,
-Subname => "harry" ;
isa_ok $db3, 'BerkeleyDB::Hash', " verify rename";
@@ -163,13 +163,13 @@ umask(0) ;
title "rename a file";
my $lex = new LexFile $Dfile, $Dfile2 ;
-
- my $db1 = new BerkeleyDB::Hash -Filename => $Dfile,
+
+ my $db1 = new BerkeleyDB::Hash -Filename => $Dfile,
-Subname => "fred" ,
-Flags => DB_CREATE;
isa_ok $db1, 'BerkeleyDB::Hash', " create database ok";
- my $db2 = new BerkeleyDB::Hash -Filename => $Dfile,
+ my $db2 = new BerkeleyDB::Hash -Filename => $Dfile,
-Subname => "joe" ,
-Flags => DB_CREATE ;
isa_ok $db2, 'BerkeleyDB::Hash', " create database ok";
@@ -189,11 +189,11 @@ umask(0) ;
undef $db1 ;
undef $db2 ;
- # now rename
- cmp_ok BerkeleyDB::db_rename(-Filename => $Dfile, -Newname => $Dfile2),
+ # now rename
+ cmp_ok BerkeleyDB::db_rename(-Filename => $Dfile, -Newname => $Dfile2),
'==', 0, " rename file to $Dfile2 ok";
-
- my $db3 = new BerkeleyDB::Hash -Filename => $Dfile2,
+
+ my $db3 = new BerkeleyDB::Hash -Filename => $Dfile2,
-Subname => "fred" ;
isa_ok $db3, 'BerkeleyDB::Hash', " verify rename"
or diag "$! $BerkeleyDB::Error";
@@ -206,8 +206,8 @@ umask(0) ;
title "verify";
my $lex = new LexFile $Dfile, $Dfile2 ;
-
- my $db1 = new BerkeleyDB::Hash -Filename => $Dfile,
+
+ my $db1 = new BerkeleyDB::Hash -Filename => $Dfile,
-Subname => "fred" ,
-Flags => DB_CREATE ;
isa_ok $db1, 'BerkeleyDB::Hash', " create database ok";
@@ -225,18 +225,17 @@ umask(0) ;
undef $db1 ;
- # now verify
- cmp_ok BerkeleyDB::db_verify(-Filename => $Dfile,
+ # now verify
+ cmp_ok BerkeleyDB::db_verify(-Filename => $Dfile,
-Subname => "fred",
), '==', 0, " verify ok";
# now verify & dump
- cmp_ok BerkeleyDB::db_verify(-Filename => $Dfile,
+ cmp_ok BerkeleyDB::db_verify(-Filename => $Dfile,
-Subname => "fred",
-Outfile => $Dfile2,
), '==', 0, " verify and dump ok";
-
+
}
# db_remove with env
-
diff --git a/t/db-3.2.t b/t/db-3.2.t
index 54c2807..b51789a 100644
--- a/t/db-3.2.t
+++ b/t/db-3.2.t
@@ -1,11 +1,11 @@
#!./perl -w
-# ID: %I%, %G%
+# ID: %I%, %G%
use strict ;
use lib 't' ;
-use BerkeleyDB;
+use BerkeleyDB;
use util ;
use Test::More ;
@@ -14,7 +14,7 @@ BEGIN {
plan(skip_all => "this needs BerkeleyDB 3.2.x or better" )
if $BerkeleyDB::db_version < 3.2;
- plan tests => 6;
+ plan tests => 6;
}
my $Dfile = "dbhash.tmp";
@@ -40,8 +40,8 @@ umask(0) ;
ok my $env = new BerkeleyDB::Env -Home => $home, @StdErrFile,
-Flags => DB_CREATE ,
-SetFlags => DB_NOMMAP ;
-
- undef $env ;
+
+ undef $env ;
}
{
@@ -52,6 +52,6 @@ umask(0) ;
ok my $env = new BerkeleyDB::Env -Home => $home, @StdErrFile,
-Flags => DB_CREATE ;
ok ! $env->set_flags(DB_NOMMAP, 1);
-
- undef $env ;
+
+ undef $env ;
}
diff --git a/t/db-3.3.t b/t/db-3.3.t
index 4539a8c..ac5c188 100644
--- a/t/db-3.3.t
+++ b/t/db-3.3.t
@@ -5,7 +5,7 @@ use strict ;
use lib 't' ;
-use BerkeleyDB;
+use BerkeleyDB;
use util ;
use Test::More;
@@ -13,7 +13,7 @@ BEGIN {
plan(skip_all => "this needs BerkeleyDB 3.3.x or better" )
if $BerkeleyDB::db_version < 3.3;
- plan tests => 130;
+ plan tests => 130;
}
umask(0);
@@ -25,7 +25,7 @@ umask(0);
my $lex = new LexFile $Dfile ;
my %hash ;
my ($k, $v) ;
- ok my $db = new BerkeleyDB::Hash -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Hash -Filename => $Dfile,
-Flags => DB_CREATE ;
# create some data
@@ -73,11 +73,11 @@ umask(0);
my ($k, $v, $pk) = ('','','');
# create primary database
- ok my $primary = new BerkeleyDB::Hash -Filename => $Dfile1,
+ ok my $primary = new BerkeleyDB::Hash -Filename => $Dfile1,
-Flags => DB_CREATE ;
# create secondary database
- ok my $secondary = new BerkeleyDB::Hash -Filename => $Dfile2,
+ ok my $secondary = new BerkeleyDB::Hash -Filename => $Dfile2,
-Flags => DB_CREATE ;
# associate primary with secondary
@@ -121,7 +121,7 @@ umask(0);
ok my $p_cursor = $primary->db_cursor();
ok my $s_cursor = $secondary->db_cursor();
- # c_get from primary
+ # c_get from primary
$k = 'green';
ok $p_cursor->c_get($k, $v, DB_SET) == 0;
is $k, 'green';
@@ -137,7 +137,7 @@ umask(0);
$k = 1;
ok $p_cursor->c_pget($k, $pk, $v, DB_FIRST) != 0;
- # c_pget from secondary database
+ # c_pget from secondary database
$k = 'flag';
ok $s_cursor->c_pget($k, $pk, $v, DB_SET) == 0
or diag "$BerkeleyDB::Error\n";
@@ -195,12 +195,12 @@ umask(0);
my ($k, $v, $pk) = ('','','');
# create primary database
- ok my $primary = new BerkeleyDB::Btree -Filename => $Dfile1,
+ ok my $primary = new BerkeleyDB::Btree -Filename => $Dfile1,
-Compare => sub { return $_[0] cmp $_[1]},
-Flags => DB_CREATE ;
# create secondary database
- ok my $secondary = new BerkeleyDB::Btree -Filename => $Dfile2,
+ ok my $secondary = new BerkeleyDB::Btree -Filename => $Dfile2,
-Compare => sub { return $_[0] <=> $_[1]},
-Property => DB_DUP,
-Flags => DB_CREATE ;
@@ -260,11 +260,11 @@ umask(0);
my ($k, $v, $pk) = ('','','');
# create primary database
- ok my $primary = new BerkeleyDB::Recno -Filename => $Dfile1,
+ ok my $primary = new BerkeleyDB::Recno -Filename => $Dfile1,
-Flags => DB_CREATE ;
# create secondary database
- ok my $secondary = new BerkeleyDB::Hash -Filename => $Dfile2,
+ ok my $secondary = new BerkeleyDB::Hash -Filename => $Dfile2,
-Flags => DB_CREATE ;
# associate primary with secondary
@@ -308,7 +308,7 @@ umask(0);
ok my $p_cursor = $primary->db_cursor();
ok my $s_cursor = $secondary->db_cursor();
- # c_get from primary
+ # c_get from primary
$k = 1;
ok $p_cursor->c_get($k, $v, DB_SET) == 0;
is $k, 1;
@@ -317,7 +317,7 @@ umask(0);
# c_get from secondary
$k = 'sea';
ok $s_cursor->c_get($k, $v, DB_SET) == 0;
- is $k, 'sea'
+ is $k, 'sea'
or warn "# key [$k]\n";
is $v, 'sea';
@@ -325,7 +325,7 @@ umask(0);
$k = 1;
ok $p_cursor->c_pget($k, $pk, $v, DB_FIRST) != 0;
- # c_pget from secondary database
+ # c_pget from secondary database
$k = 'sea';
ok $s_cursor->c_pget($k, $pk, $v, DB_SET) == 0;
is $k, 'sea' ;
@@ -375,11 +375,11 @@ umask(0);
my ($k, $v, $pk) = ('','','');
# create primary database
- ok my $primary = new BerkeleyDB::Hash -Filename => $Dfile1,
+ ok my $primary = new BerkeleyDB::Hash -Filename => $Dfile1,
-Flags => DB_CREATE ;
# create secondary database
- ok my $secondary = new BerkeleyDB::Recno -Filename => $Dfile2,
+ ok my $secondary = new BerkeleyDB::Recno -Filename => $Dfile2,
#-Property => DB_DUP,
-Flags => DB_CREATE ;
@@ -428,7 +428,7 @@ umask(0);
ok my $p_cursor = $primary->db_cursor();
ok my $s_cursor = $secondary->db_cursor();
- # c_get from primary
+ # c_get from primary
$k = 'green';
ok $p_cursor->c_get($k, $v, DB_SET) == 0;
is $k, 'green';
@@ -444,7 +444,7 @@ umask(0);
$k = 1;
ok $p_cursor->c_pget($k, $pk, $v, DB_SET) != 0;
- # c_pget from secondary database
+ # c_pget from secondary database
$k = 5;
ok $s_cursor->c_pget($k, $pk, $v, DB_SET) == 0
or diag "$BerkeleyDB::Error\n";
diff --git a/t/db-4.3.t b/t/db-4.3.t
index 3eed824..c8d17af 100644
--- a/t/db-4.3.t
+++ b/t/db-4.3.t
@@ -3,7 +3,7 @@
use strict ;
use lib 't' ;
-use BerkeleyDB;
+use BerkeleyDB;
use Test::More ;
use util ;
@@ -20,7 +20,7 @@ if (1)
my $home = "./fred" ;
ok my $lexD = new LexDir($home) ;
my $lex = new LexFile $msgfile ;
- ok my $env = new BerkeleyDB::Env( -MsgFile => $msgfile,
+ ok my $env = new BerkeleyDB::Env( -MsgFile => $msgfile,
-Flags => DB_CREATE,
-Home => $home) ;
$env->stat_print();
@@ -38,7 +38,7 @@ if (1)
ok my $lexD = new LexDir($home) ;
my $lex = new LexFile $msgfile ;
my $fh = new IO::File ">$msgfile" ;
- ok my $env = new BerkeleyDB::Env( -MsgFile => $fh,
+ ok my $env = new BerkeleyDB::Env( -MsgFile => $fh,
-Flags => DB_CREATE,
-Home => $home) ;
is $env->stat_print(), 0;
@@ -58,10 +58,10 @@ if (1)
my $Dfile = "db.db";
my $lex1 = new LexFile $Dfile ;
my $fh = new IO::File ">$msgfile" ;
- ok my $env = new BerkeleyDB::Env( -MsgFile => $fh,
+ ok my $env = new BerkeleyDB::Env( -MsgFile => $fh,
-Flags => DB_CREATE|DB_INIT_MPOOL,
-Home => $home) ;
- ok my $db = new BerkeleyDB::Btree -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Btree -Filename => $Dfile,
-Env => $env,
-Flags => DB_CREATE ;
is $db->stat_print(), 0;
@@ -80,7 +80,7 @@ if (1)
ok my $lexD = new LexDir($home) ;
my $lex = new LexFile $msgfile ;
my $fh = new IO::File ">$msgfile" ;
- ok my $env = new BerkeleyDB::Env( -MsgFile => $fh,
+ ok my $env = new BerkeleyDB::Env( -MsgFile => $fh,
-Flags => DB_CREATE|DB_INIT_TXN,
-Home => $home) ;
is $env->txn_stat_print(), 0
diff --git a/t/db-4.4.t b/t/db-4.4.t
index 3489bef..f34a7da 100644
--- a/t/db-4.4.t
+++ b/t/db-4.4.t
@@ -3,7 +3,7 @@
use strict ;
use lib 't' ;
-use BerkeleyDB;
+use BerkeleyDB;
use Test::More ;
use util ;
@@ -20,7 +20,7 @@ plan tests => 12;
my $Dfile;
my $lex = new LexFile $Dfile ;
my ($k, $v) ;
- ok my $db = new BerkeleyDB::Btree -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Btree -Filename => $Dfile,
-Flags => DB_CREATE ;
# create some data
@@ -74,7 +74,7 @@ plan tests => 12;
ok $env ;
# something crazy small
- #is($env->set_lg_max(1024), 0);
+ #is($env->set_lg_max(1024), 0);
ok my $txn = $env->txn_begin() ;
diff --git a/t/db-4.6.t b/t/db-4.6.t
index 927b985..30ebf77 100755
--- a/t/db-4.6.t
+++ b/t/db-4.6.t
@@ -5,7 +5,7 @@ use strict ;
use lib 't' ;
-use BerkeleyDB;
+use BerkeleyDB;
use util ;
use Test::More ;
@@ -14,7 +14,7 @@ BEGIN {
plan(skip_all => "this needs BerkeleyDB 4.6.x or better" )
if $BerkeleyDB::db_version < 4.6;
- plan tests => 69;
+ plan tests => 69;
}
umask(0);
@@ -39,11 +39,11 @@ umask(0);
my ($k, $v, $pk) = ('','','');
# create primary database
- ok my $primary = new BerkeleyDB::Hash -Filename => $Dfile1,
+ ok my $primary = new BerkeleyDB::Hash -Filename => $Dfile1,
-Flags => DB_CREATE ;
# create secondary database
- ok my $secondary = new BerkeleyDB::Hash -Filename => $Dfile2,
+ ok my $secondary = new BerkeleyDB::Hash -Filename => $Dfile2,
-Flags => DB_CREATE ;
# associate primary with secondary
@@ -86,11 +86,11 @@ umask(0);
my ($k, $v, $pk) = ('','','');
# create primary database
- ok my $primary = new BerkeleyDB::Hash -Filename => $Dfile1,
+ ok my $primary = new BerkeleyDB::Hash -Filename => $Dfile1,
-Flags => DB_CREATE ;
# create secondary database
- ok my $secondary = new BerkeleyDB::Hash -Filename => $Dfile2,
+ ok my $secondary = new BerkeleyDB::Hash -Filename => $Dfile2,
-Flags => DB_CREATE ;
# associate primary with secondary
@@ -184,7 +184,7 @@ umask(0);
ok $pk eq 'bar';
ok $v eq 'hello,goodbye';
- # pget to DB_GET_BOTH from secondary database
+ # pget to DB_GET_BOTH from secondary database
$k = 'house';
$pk = 'green';
ok $secondary->db_pget($k, $pk, $v, DB_GET_BOTH) == 0 ;
@@ -245,4 +245,3 @@ umask(0);
ok $primary->db_get("red", $v) != 0;
is countRecords($primary), 3 ;
}
-
diff --git a/t/db-4.7.t b/t/db-4.7.t
index 810a50b..554cc94 100644
--- a/t/db-4.7.t
+++ b/t/db-4.7.t
@@ -5,7 +5,7 @@ use strict ;
use lib 't' ;
-use BerkeleyDB;
+use BerkeleyDB;
use util ;
use Test::More ;
diff --git a/t/db-4.8.t b/t/db-4.8.t
index e3beae7..c0b7e1a 100644
--- a/t/db-4.8.t
+++ b/t/db-4.8.t
@@ -5,7 +5,7 @@ use strict ;
use lib 't' ;
-use BerkeleyDB;
+use BerkeleyDB;
use util ;
use Test::More ;
@@ -39,18 +39,18 @@ umask(0);
my ($k, $v, $pk) = ('','','');
# create primary database
- ok my $primary = new BerkeleyDB::Hash -Filename => $Dfile1,
+ ok my $primary = new BerkeleyDB::Hash -Filename => $Dfile1,
-Flags => DB_CREATE ;
# create secondary database
- ok my $secondary = new BerkeleyDB::Hash -Filename => $Dfile2,
+ ok my $secondary = new BerkeleyDB::Hash -Filename => $Dfile2,
-Flags => DB_CREATE ;
# associate primary with secondary
ok $primary->associate($secondary, \&sec_key) == 0;
# create secondary database
- ok my $foreign = new BerkeleyDB::Hash -Filename => $Dfile3,
+ ok my $foreign = new BerkeleyDB::Hash -Filename => $Dfile3,
-Flags => DB_CREATE ;
# associate primary with secondary
@@ -125,18 +125,18 @@ umask(0);
my ($k, $v, $pk) = ('','','');
# create primary database
- ok my $primary = new BerkeleyDB::Hash -Filename => $Dfile1,
+ ok my $primary = new BerkeleyDB::Hash -Filename => $Dfile1,
-Flags => DB_CREATE ;
# create secondary database
- ok my $secondary = new BerkeleyDB::Hash -Filename => $Dfile2,
+ ok my $secondary = new BerkeleyDB::Hash -Filename => $Dfile2,
-Flags => DB_CREATE ;
# associate primary with secondary
ok $primary->associate($secondary, \&sec_key2) == 0;
# create secondary database
- ok my $foreign = new BerkeleyDB::Hash -Filename => $Dfile3,
+ ok my $foreign = new BerkeleyDB::Hash -Filename => $Dfile3,
-Flags => DB_CREATE ;
# associate primary with secondary
@@ -226,18 +226,18 @@ umask(0);
my ($k, $v, $pk) = ('','','');
# create primary database
- ok my $primary = new BerkeleyDB::Hash -Filename => $Dfile1,
+ ok my $primary = new BerkeleyDB::Hash -Filename => $Dfile1,
-Flags => DB_CREATE ;
# create secondary database
- ok my $secondary = new BerkeleyDB::Hash -Filename => $Dfile2,
+ ok my $secondary = new BerkeleyDB::Hash -Filename => $Dfile2,
-Flags => DB_CREATE ;
# associate primary with secondary
ok $primary->associate($secondary, \&sec_key3) == 0;
# create secondary database
- ok my $foreign = new BerkeleyDB::Hash -Filename => $Dfile3,
+ ok my $foreign = new BerkeleyDB::Hash -Filename => $Dfile3,
-Flags => DB_CREATE ;
# associate primary with secondary
@@ -300,7 +300,7 @@ umask(0);
my ($k, $v, $pk) = ('','','');
# create primary database
- ok my $primary = new BerkeleyDB::Btree -Filename => $Dfile1,
+ ok my $primary = new BerkeleyDB::Btree -Filename => $Dfile1,
-set_bt_compress => 1,
-Flags => DB_CREATE ;
diff --git a/t/db-4.x.t b/t/db-4.x.t
index 73ded4b..ebb2182 100755
--- a/t/db-4.x.t
+++ b/t/db-4.x.t
@@ -2,7 +2,7 @@
use strict ;
use lib 't';
-use BerkeleyDB;
+use BerkeleyDB;
use Test::More;
use util ;
diff --git a/t/destroy.t b/t/destroy.t
index c8f3c96..5ba4d02 100644
--- a/t/destroy.t
+++ b/t/destroy.t
@@ -3,7 +3,7 @@
use strict ;
use lib 't' ;
-use BerkeleyDB;
+use BerkeleyDB;
use util ;
use Test::More;
@@ -34,7 +34,7 @@ umask(0);
ok $txn->txn_commit() == 0 ;
ok $txn = $env->txn_begin() ;
$db1->Txn($txn);
-
+
# create some data
my %data = (
"red" => "boat",
@@ -85,7 +85,7 @@ umask(0);
my %hash ;
my $cursor ;
my ($k, $v) = ("", "") ;
- ok my $db1 = tie %hash, 'BerkeleyDB::Hash',
+ ok my $db1 = tie %hash, 'BerkeleyDB::Hash',
-Filename => $Dfile,
-Flags => DB_CREATE ;
my $count = 0 ;
@@ -96,5 +96,3 @@ umask(0);
}
is $count, 0 ;
}
-
-
diff --git a/t/encode.t b/t/encode.t
index 096f806..ebfa1a4 100644
--- a/t/encode.t
+++ b/t/encode.t
@@ -3,14 +3,14 @@
use strict ;
use lib 't' ;
-use BerkeleyDB;
+use BerkeleyDB;
use util ;
use Test::More ;
-BEGIN
+BEGIN
{
eval { require Encode; };
-
+
plan skip_all => "Encode is not available"
if $@;
@@ -37,9 +37,9 @@ umask(0) ;
my (%h, $db) ;
unlink $Dfile;
- ok $db = tie %h, 'BerkeleyDB::Hash',
- -Filename => $Dfile,
- -Flags => DB_CREATE;
+ ok $db = tie %h, 'BerkeleyDB::Hash',
+ -Filename => $Dfile,
+ -Flags => DB_CREATE;
$db->filter_fetch_key (sub { $_ = Encode::decode_utf8($_) if defined $_ });
$db->filter_store_key (sub { $_ = Encode::encode_utf8($_) if defined $_ });
@@ -56,9 +56,9 @@ umask(0) ;
untie %h;
my %newH;
- ok $db = tie %newH, 'BerkeleyDB::Hash',
- -Filename => $Dfile,
- -Flags => DB_CREATE;
+ ok $db = tie %newH, 'BerkeleyDB::Hash',
+ -Filename => $Dfile,
+ -Flags => DB_CREATE;
$newH{"fred"} = "joe" ;
is $newH{"fred"}, "joe";
diff --git a/t/encrypt.t b/t/encrypt.t
index f8167a6..5f9eaa8 100644
--- a/t/encrypt.t
+++ b/t/encrypt.t
@@ -1,11 +1,11 @@
#!./perl -w
-# ID: %I%, %G%
+# ID: %I%, %G%
use strict ;
use lib 't' ;
-use BerkeleyDB;
+use BerkeleyDB;
use util ;
use Test::More;
@@ -28,7 +28,7 @@ BEGIN {
umask(0);
-{
+{
eval
{
my $env = new BerkeleyDB::Env @StdErrFile,
@@ -91,9 +91,9 @@ umask(0);
my $lex = new LexFile $Dfile ;
my %hash ;
my ($k, $v) ;
- ok my $db = new BerkeleyDB::Hash -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Hash -Filename => $Dfile,
-Env => $env,
- -Flags => DB_CREATE,
+ -Flags => DB_CREATE,
-Property => DB_ENCRYPT ;
# create some data
@@ -115,19 +115,19 @@ umask(0);
undef $db;
# once the database is created, do not need to specify DB_ENCRYPT
- ok my $db1 = new BerkeleyDB::Hash -Filename => $Dfile,
+ ok my $db1 = new BerkeleyDB::Hash -Filename => $Dfile,
-Env => $env,
-Flags => DB_CREATE ;
- $v = '';
+ $v = '';
ok ! $db1->db_get("red", $v) ;
ok $v eq $data{"red"},
undef $db1;
undef $env;
# open a database without specifying encryption
- ok ! new BerkeleyDB::Hash -Filename => "$home/$Dfile";
+ ok ! new BerkeleyDB::Hash -Filename => "$home/$Dfile";
- ok ! new BerkeleyDB::Env
+ ok ! new BerkeleyDB::Env
-Home => $home,
-Encrypt => {Password => "def",
Flags => DB_ENCRYPT_AES
@@ -135,10 +135,10 @@ umask(0);
-Flags => DB_CREATE | DB_INIT_MPOOL ;
}
-{
+{
eval
{
- my $env = new BerkeleyDB::Hash
+ my $env = new BerkeleyDB::Hash
-Encrypt => 1,
-Flags => DB_CREATE ;
};
@@ -146,7 +146,7 @@ umask(0);
eval
{
- my $env = new BerkeleyDB::Hash
+ my $env = new BerkeleyDB::Hash
-Encrypt => {},
-Flags => DB_CREATE ;
};
@@ -154,7 +154,7 @@ umask(0);
eval
{
- my $env = new BerkeleyDB::Hash
+ my $env = new BerkeleyDB::Hash
-Encrypt => {Password => "fred"},
-Flags => DB_CREATE ;
};
@@ -162,7 +162,7 @@ umask(0);
eval
{
- my $env = new BerkeleyDB::Hash
+ my $env = new BerkeleyDB::Hash
-Encrypt => {Flags => 1},
-Flags => DB_CREATE ;
};
@@ -170,7 +170,7 @@ umask(0);
eval
{
- my $env = new BerkeleyDB::Hash
+ my $env = new BerkeleyDB::Hash
-Encrypt => {Fred => 1},
-Flags => DB_CREATE ;
};
@@ -178,10 +178,10 @@ umask(0);
}
-{
+{
eval
{
- my $env = new BerkeleyDB::Btree
+ my $env = new BerkeleyDB::Btree
-Encrypt => 1,
-Flags => DB_CREATE ;
};
@@ -189,7 +189,7 @@ umask(0);
eval
{
- my $env = new BerkeleyDB::Btree
+ my $env = new BerkeleyDB::Btree
-Encrypt => {},
-Flags => DB_CREATE ;
};
@@ -197,7 +197,7 @@ umask(0);
eval
{
- my $env = new BerkeleyDB::Btree
+ my $env = new BerkeleyDB::Btree
-Encrypt => {Password => "fred"},
-Flags => DB_CREATE ;
};
@@ -205,7 +205,7 @@ umask(0);
eval
{
- my $env = new BerkeleyDB::Btree
+ my $env = new BerkeleyDB::Btree
-Encrypt => {Flags => 1},
-Flags => DB_CREATE ;
};
@@ -213,7 +213,7 @@ umask(0);
eval
{
- my $env = new BerkeleyDB::Btree
+ my $env = new BerkeleyDB::Btree
-Encrypt => {Fred => 1},
-Flags => DB_CREATE ;
};
@@ -221,10 +221,10 @@ umask(0);
}
-{
+{
eval
{
- my $env = new BerkeleyDB::Queue
+ my $env = new BerkeleyDB::Queue
-Encrypt => 1,
-Flags => DB_CREATE ;
};
@@ -232,7 +232,7 @@ umask(0);
eval
{
- my $env = new BerkeleyDB::Queue
+ my $env = new BerkeleyDB::Queue
-Encrypt => {},
-Flags => DB_CREATE ;
};
@@ -240,7 +240,7 @@ umask(0);
eval
{
- my $env = new BerkeleyDB::Queue
+ my $env = new BerkeleyDB::Queue
-Encrypt => {Password => "fred"},
-Flags => DB_CREATE ;
};
@@ -248,7 +248,7 @@ umask(0);
eval
{
- my $env = new BerkeleyDB::Queue
+ my $env = new BerkeleyDB::Queue
-Encrypt => {Flags => 1},
-Flags => DB_CREATE ;
};
@@ -256,7 +256,7 @@ umask(0);
eval
{
- my $env = new BerkeleyDB::Queue
+ my $env = new BerkeleyDB::Queue
-Encrypt => {Fred => 1},
-Flags => DB_CREATE ;
};
@@ -264,10 +264,10 @@ umask(0);
}
-{
+{
eval
{
- my $env = new BerkeleyDB::Recno
+ my $env = new BerkeleyDB::Recno
-Encrypt => 1,
-Flags => DB_CREATE ;
};
@@ -275,7 +275,7 @@ umask(0);
eval
{
- my $env = new BerkeleyDB::Recno
+ my $env = new BerkeleyDB::Recno
-Encrypt => {},
-Flags => DB_CREATE ;
};
@@ -283,7 +283,7 @@ umask(0);
eval
{
- my $env = new BerkeleyDB::Recno
+ my $env = new BerkeleyDB::Recno
-Encrypt => {Password => "fred"},
-Flags => DB_CREATE ;
};
@@ -291,7 +291,7 @@ umask(0);
eval
{
- my $env = new BerkeleyDB::Recno
+ my $env = new BerkeleyDB::Recno
-Encrypt => {Flags => 1},
-Flags => DB_CREATE ;
};
@@ -299,7 +299,7 @@ umask(0);
eval
{
- my $env = new BerkeleyDB::Recno
+ my $env = new BerkeleyDB::Recno
-Encrypt => {Fred => 1},
-Flags => DB_CREATE ;
};
@@ -315,9 +315,9 @@ umask(0);
my $lex = new LexFile $Dfile ;
my %hash ;
my ($k, $v) ;
- ok my $db = new BerkeleyDB::Hash
- -Filename => $Dfile,
- -Flags => DB_CREATE,
+ ok my $db = new BerkeleyDB::Hash
+ -Filename => $Dfile,
+ -Flags => DB_CREATE,
-Encrypt => {Password => "beta",
Flags => DB_ENCRYPT_AES
},
@@ -342,29 +342,29 @@ umask(0);
undef $db;
# attempt to open a database without specifying encryption
- ok ! new BerkeleyDB::Hash -Filename => $Dfile,
+ ok ! new BerkeleyDB::Hash -Filename => $Dfile,
-Flags => DB_CREATE ;
- # try opening with the wrong password
- ok ! new BerkeleyDB::Hash -Filename => $Dfile,
- -Filename => $Dfile,
+ # try opening with the wrong password
+ ok ! new BerkeleyDB::Hash -Filename => $Dfile,
+ -Filename => $Dfile,
-Encrypt => {Password => "def",
Flags => DB_ENCRYPT_AES
},
-Property => DB_ENCRYPT ;
- # read the encrypted data
- ok my $db1 = new BerkeleyDB::Hash -Filename => $Dfile,
- -Filename => $Dfile,
+ # read the encrypted data
+ ok my $db1 = new BerkeleyDB::Hash -Filename => $Dfile,
+ -Filename => $Dfile,
-Encrypt => {Password => "beta",
Flags => DB_ENCRYPT_AES
},
-Property => DB_ENCRYPT ;
- $v = '';
+ $v = '';
ok ! $db1->db_get("red", $v) ;
ok $v eq $data{"red"};
# check there are three records
@@ -379,9 +379,9 @@ umask(0);
my $lex = new LexFile $Dfile ;
my %hash ;
my ($k, $v) ;
- ok my $db = new BerkeleyDB::Btree
- -Filename => $Dfile,
- -Flags => DB_CREATE,
+ ok my $db = new BerkeleyDB::Btree
+ -Filename => $Dfile,
+ -Flags => DB_CREATE,
-Encrypt => {Password => "beta",
Flags => DB_ENCRYPT_AES
},
@@ -406,29 +406,29 @@ umask(0);
undef $db;
# attempt to open a database without specifying encryption
- ok ! new BerkeleyDB::Btree -Filename => $Dfile,
+ ok ! new BerkeleyDB::Btree -Filename => $Dfile,
-Flags => DB_CREATE ;
- # try opening with the wrong password
- ok ! new BerkeleyDB::Btree -Filename => $Dfile,
- -Filename => $Dfile,
+ # try opening with the wrong password
+ ok ! new BerkeleyDB::Btree -Filename => $Dfile,
+ -Filename => $Dfile,
-Encrypt => {Password => "def",
Flags => DB_ENCRYPT_AES
},
-Property => DB_ENCRYPT ;
- # read the encrypted data
- ok my $db1 = new BerkeleyDB::Btree -Filename => $Dfile,
- -Filename => $Dfile,
+ # read the encrypted data
+ ok my $db1 = new BerkeleyDB::Btree -Filename => $Dfile,
+ -Filename => $Dfile,
-Encrypt => {Password => "beta",
Flags => DB_ENCRYPT_AES
},
-Property => DB_ENCRYPT ;
- $v = '';
+ $v = '';
ok ! $db1->db_get("red", $v) ;
ok $v eq $data{"red"};
# check there are three records
@@ -443,11 +443,11 @@ umask(0);
my $lex = new LexFile $Dfile ;
my %hash ;
my ($k, $v) ;
- ok my $db = new BerkeleyDB::Queue
- -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Queue
+ -Filename => $Dfile,
-Len => 5,
-Pad => "x",
- -Flags => DB_CREATE,
+ -Flags => DB_CREATE,
-Encrypt => {Password => "beta",
Flags => DB_ENCRYPT_AES
},
@@ -472,14 +472,14 @@ umask(0);
undef $db;
# attempt to open a database without specifying encryption
- ok ! new BerkeleyDB::Queue -Filename => $Dfile,
+ ok ! new BerkeleyDB::Queue -Filename => $Dfile,
-Len => 5,
-Pad => "x",
-Flags => DB_CREATE ;
- # try opening with the wrong password
- ok ! new BerkeleyDB::Queue -Filename => $Dfile,
+ # try opening with the wrong password
+ ok ! new BerkeleyDB::Queue -Filename => $Dfile,
-Len => 5,
-Pad => "x",
-Encrypt => {Password => "def",
@@ -488,8 +488,8 @@ umask(0);
-Property => DB_ENCRYPT ;
- # read the encrypted data
- ok my $db1 = new BerkeleyDB::Queue -Filename => $Dfile,
+ # read the encrypted data
+ ok my $db1 = new BerkeleyDB::Queue -Filename => $Dfile,
-Len => 5,
-Pad => "x",
-Encrypt => {Password => "beta",
@@ -498,7 +498,7 @@ umask(0);
-Property => DB_ENCRYPT ;
- $v = '';
+ $v = '';
ok ! $db1->db_get(3, $v) ;
ok $v eq fillout($data{3}, 5, 'x');
# check there are three records
@@ -513,9 +513,9 @@ umask(0);
my $lex = new LexFile $Dfile ;
my %hash ;
my ($k, $v) ;
- ok my $db = new BerkeleyDB::Recno
- -Filename => $Dfile,
- -Flags => DB_CREATE,
+ ok my $db = new BerkeleyDB::Recno
+ -Filename => $Dfile,
+ -Flags => DB_CREATE,
-Encrypt => {Password => "beta",
Flags => DB_ENCRYPT_AES
},
@@ -540,29 +540,29 @@ umask(0);
undef $db;
# attempt to open a database without specifying encryption
- ok ! new BerkeleyDB::Recno -Filename => $Dfile,
+ ok ! new BerkeleyDB::Recno -Filename => $Dfile,
-Flags => DB_CREATE ;
- # try opening with the wrong password
- ok ! new BerkeleyDB::Recno -Filename => $Dfile,
- -Filename => $Dfile,
+ # try opening with the wrong password
+ ok ! new BerkeleyDB::Recno -Filename => $Dfile,
+ -Filename => $Dfile,
-Encrypt => {Password => "def",
Flags => DB_ENCRYPT_AES
},
-Property => DB_ENCRYPT ;
- # read the encrypted data
- ok my $db1 = new BerkeleyDB::Recno -Filename => $Dfile,
- -Filename => $Dfile,
+ # read the encrypted data
+ ok my $db1 = new BerkeleyDB::Recno -Filename => $Dfile,
+ -Filename => $Dfile,
-Encrypt => {Password => "beta",
Flags => DB_ENCRYPT_AES
},
-Property => DB_ENCRYPT ;
- $v = '';
+ $v = '';
ok ! $db1->db_get(3, $v) ;
ok $v eq $data{3};
# check there are three records
@@ -577,9 +577,9 @@ umask(0);
my $lex = new LexFile $Dfile ;
my %hash ;
my ($k, $v) ;
- ok my $db = new BerkeleyDB::Hash
- -Filename => $Dfile,
- -Flags => DB_CREATE,
+ ok my $db = new BerkeleyDB::Hash
+ -Filename => $Dfile,
+ -Flags => DB_CREATE,
-Encrypt => {Password => "beta",
Flags => DB_ENCRYPT_AES
},
@@ -604,33 +604,32 @@ umask(0);
undef $db;
# attempt to open a database without specifying encryption
- ok ! new BerkeleyDB::Unknown -Filename => $Dfile,
+ ok ! new BerkeleyDB::Unknown -Filename => $Dfile,
-Flags => DB_CREATE ;
- # try opening with the wrong password
- ok ! new BerkeleyDB::Unknown -Filename => $Dfile,
- -Filename => $Dfile,
+ # try opening with the wrong password
+ ok ! new BerkeleyDB::Unknown -Filename => $Dfile,
+ -Filename => $Dfile,
-Encrypt => {Password => "def",
Flags => DB_ENCRYPT_AES
},
-Property => DB_ENCRYPT ;
- # read the encrypted data
- ok my $db1 = new BerkeleyDB::Unknown -Filename => $Dfile,
- -Filename => $Dfile,
+ # read the encrypted data
+ ok my $db1 = new BerkeleyDB::Unknown -Filename => $Dfile,
+ -Filename => $Dfile,
-Encrypt => {Password => "beta",
Flags => DB_ENCRYPT_AES
},
-Property => DB_ENCRYPT ;
- $v = '';
+ $v = '';
ok ! $db1->db_get("red", $v) ;
ok $v eq $data{"red"};
# check there are three records
ok countRecords($db1) == 3 ;
undef $db1;
}
-
diff --git a/t/env.t b/t/env.t
index b859d42..a1c0ead 100644
--- a/t/env.t
+++ b/t/env.t
@@ -9,7 +9,7 @@ BEGIN {
$ENV{LC_ALL} = 'de_DE@euro';
}
-use BerkeleyDB;
+use BerkeleyDB;
use util ;
use Test::More ;
@@ -130,7 +130,7 @@ sub chkMsg
my $ErrMsg = join "|", map { "$prefix$_" }
'illegal flag specified to (db_open|DB->open)',
'(BDB\d+ )?DB_AUTO_COMMIT may not be specified in non-transactional environment';
-
+
return 1 if $BerkeleyDB::Error =~ /^$ErrMsg/ ;
warn "# $BerkeleyDB::Error\n" ;
return 0;
@@ -142,7 +142,7 @@ sub chkMsg
my $home = "./fred" ;
ok my $lexD = new LexDir($home), "lexdir" ;
my $lex = new LexFile $errfile ;
- ok my $env = new BerkeleyDB::Env( -ErrFile => $errfile,
+ ok my $env = new BerkeleyDB::Env( -ErrFile => $errfile,
-Flags => DB_CREATE,
-Home => $home) ;
my $db = new BerkeleyDB::Hash -Filename => $Dfile,
@@ -152,7 +152,7 @@ sub chkMsg
my $ErrMsg = join "'", 'illegal flag specified to (db_open|DB->open)',
'DB_AUTO_COMMIT may not be specified in non-transactional environment';
-
+
ok chkMsg();
ok -e $errfile ;
my $contents = docat($errfile) ;
@@ -170,7 +170,7 @@ sub chkMsg
ok my $lexD = new LexDir($home) ;
my $lex = new LexFile $errfile ;
my $fh = new IO::File ">$errfile" ;
- ok my $env = new BerkeleyDB::Env( -ErrFile => $fh,
+ ok my $env = new BerkeleyDB::Env( -ErrFile => $fh,
-Flags => DB_CREATE,
-Home => $home) ;
my $db = new BerkeleyDB::Hash -Filename => $Dfile,
@@ -261,7 +261,7 @@ sub chkMsg
# The test below is not portable -- the error message returned by
# $BerkeleyDB::Error is locale dependant.
- #ok $version_major == 2 ? 1
+ #ok $version_major == 2 ? 1
# : $BerkeleyDB::Error =~ /No such file or directory/ ;
# or print "# BerkeleyDB::Error is $BerkeleyDB::Error\n";
chdir ".." ;
diff --git a/t/examples.t b/t/examples.t
index b70fba6..9eaae1c 100644
--- a/t/examples.t
+++ b/t/examples.t
@@ -1,6 +1,6 @@
#!./perl -w
-use strict ;
+use strict ;
BEGIN {
unless(grep /blib/, @INC) {
@@ -10,7 +10,7 @@ BEGIN {
}
use lib 't';
-use BerkeleyDB;
+use BerkeleyDB;
use Test::More;
use util;
@@ -35,11 +35,11 @@ my $redirect = "xyzt" ;
use strict ;
use BerkeleyDB ;
use vars qw( %h $k $v ) ;
-
+
my $filename = "fruit" ;
unlink $filename ;
- tie %h, "BerkeleyDB::Hash",
- -Filename => $filename,
+ tie %h, "BerkeleyDB::Hash",
+ -Filename => $filename,
-Flags => DB_CREATE
or die "Cannot open file $filename: $! $BerkeleyDB::Error\n" ;
@@ -48,17 +48,17 @@ my $redirect = "xyzt" ;
$h{"orange"} = "orange" ;
$h{"banana"} = "yellow" ;
$h{"tomato"} = "red" ;
-
+
# Check for existence of a key
print "Banana Exists\n\n" if $h{"banana"} ;
-
+
# Delete a key/value pair.
delete $h{"apple"} ;
-
+
# print the contents of the file
while (($k, $v) = each %h)
{ print "$k -> $v\n" }
-
+
untie %h ;
unlink $filename ;
}
@@ -83,11 +83,11 @@ my $redirect = "xyzt" ;
use strict ;
use BerkeleyDB ;
-
+
my $filename = "fruit" ;
unlink $filename ;
- my $db = new BerkeleyDB::Hash
- -Filename => $filename,
+ my $db = new BerkeleyDB::Hash
+ -Filename => $filename,
-Flags => DB_CREATE
or die "Cannot open file $filename: $! $BerkeleyDB::Error\n" ;
@@ -96,19 +96,19 @@ my $redirect = "xyzt" ;
$db->db_put("orange", "orange") ;
$db->db_put("banana", "yellow") ;
$db->db_put("tomato", "red") ;
-
+
# Check for existence of a key
print "Banana Exists\n\n" if $db->db_get("banana", $v) == 0;
-
+
# Delete a key/value pair.
$db->db_del("apple") ;
-
+
# print the contents of the file
my ($k, $v) = ("", "") ;
my $cursor = $db->db_cursor() ;
while ($cursor->c_get($k, $v, DB_NEXT) == 0)
{ print "$k -> $v\n" }
-
+
undef $cursor ;
undef $db ;
unlink $filename ;
@@ -137,8 +137,8 @@ my $redirect = "xyzt" ;
my $filename = "tree" ;
unlink $filename ;
my %h ;
- tie %h, 'BerkeleyDB::Btree',
- -Filename => $filename,
+ tie %h, 'BerkeleyDB::Btree',
+ -Filename => $filename,
-Flags => DB_CREATE
or die "Cannot open $filename: $! $BerkeleyDB::Error\n" ;
@@ -182,8 +182,8 @@ my $redirect = "xyzt" ;
my $filename = "tree" ;
unlink $filename ;
my %h ;
- tie %h, 'BerkeleyDB::Btree',
- -Filename => $filename,
+ tie %h, 'BerkeleyDB::Btree',
+ -Filename => $filename,
-Flags => DB_CREATE,
-Compare => sub { lc $_[0] cmp lc $_[1] }
or die "Cannot open $filename: $!\n" ;
@@ -229,8 +229,8 @@ my $redirect = "xyzt" ;
my $filename = "filt.db" ;
unlink $filename ;
- my $db = tie %hash, 'BerkeleyDB::Hash',
- -Filename => $filename,
+ my $db = tie %hash, 'BerkeleyDB::Hash',
+ -Filename => $filename,
-Flags => DB_CREATE
or die "Cannot open $filename: $!\n" ;
@@ -245,8 +245,8 @@ my $redirect = "xyzt" ;
# ...
undef $db ;
untie %hash ;
- $db = tie %hash, 'BerkeleyDB::Hash',
- -Filename => $filename,
+ $db = tie %hash, 'BerkeleyDB::Hash',
+ -Filename => $filename,
-Flags => DB_CREATE
or die "Cannot open $filename: $!\n" ;
while (($k, $v) = each %hash)
@@ -277,8 +277,8 @@ my $redirect = "xyzt" ;
unlink $filename ;
- my $db = tie %hash, 'BerkeleyDB::Btree',
- -Filename => $filename,
+ my $db = tie %hash, 'BerkeleyDB::Btree',
+ -Filename => $filename,
-Flags => DB_CREATE
or die "Cannot open $filename: $!\n" ;
@@ -288,8 +288,8 @@ my $redirect = "xyzt" ;
# ...
undef $db ;
untie %hash ;
- $db = tie %hash, 'BerkeleyDB::Btree',
- -Filename => $filename,
+ $db = tie %hash, 'BerkeleyDB::Btree',
+ -Filename => $filename,
-Flags => DB_CREATE
or die "Cannot Open $filename: $!\n" ;
while (($k, $v) = each %hash)
@@ -322,8 +322,8 @@ my $redirect = "xyzt" ;
unlink $filename ;
my @h ;
- tie @h, 'BerkeleyDB::Recno',
- -Filename => $filename,
+ tie @h, 'BerkeleyDB::Recno',
+ -Filename => $filename,
-Flags => DB_CREATE,
-Property => DB_RENUMBER
or die "Cannot open $filename: $!\n" ;
@@ -358,8 +358,8 @@ my $redirect = "xyzt" ;
unlink $filename ;
my @h ;
- my $db = tie @h, 'BerkeleyDB::Recno',
- -Filename => $filename,
+ my $db = tie @h, 'BerkeleyDB::Recno',
+ -Filename => $filename,
-Flags => DB_CREATE,
-Property => DB_RENUMBER
or die "Cannot open $filename: $!\n" ;
@@ -400,4 +400,3 @@ Element 1 Exists with value blue
EOM
}
-
diff --git a/t/examples.t.T b/t/examples.t.T
index 7b9abb5..47f7264 100644
--- a/t/examples.t.T
+++ b/t/examples.t.T
@@ -1,6 +1,6 @@
#!./perl -w
-use strict ;
+use strict ;
BEGIN {
unless(grep /blib/, @INC) {
@@ -10,7 +10,7 @@ BEGIN {
}
use lib 't';
-use BerkeleyDB;
+use BerkeleyDB;
use Test::More;
use util;
@@ -36,11 +36,11 @@ my $redirect = "xyzt" ;
use strict ;
use BerkeleyDB ;
use vars qw( %h $k $v ) ;
-
+
my $filename = "fruit" ;
unlink $filename ;
- tie %h, "BerkeleyDB::Hash",
- -Filename => $filename,
+ tie %h, "BerkeleyDB::Hash",
+ -Filename => $filename,
-Flags => DB_CREATE
or die "Cannot open file $filename: $! $BerkeleyDB::Error\n" ;
@@ -49,17 +49,17 @@ my $redirect = "xyzt" ;
$h{"orange"} = "orange" ;
$h{"banana"} = "yellow" ;
$h{"tomato"} = "red" ;
-
+
# Check for existence of a key
print "Banana Exists\n\n" if $h{"banana"} ;
-
+
# Delete a key/value pair.
delete $h{"apple"} ;
-
+
# print the contents of the file
while (($k, $v) = each %h)
{ print "$k -> $v\n" }
-
+
untie %h ;
## END simpleHash
unlink $filename ;
@@ -86,11 +86,11 @@ my $redirect = "xyzt" ;
## BEGIN simpleHash2
use strict ;
use BerkeleyDB ;
-
+
my $filename = "fruit" ;
unlink $filename ;
- my $db = new BerkeleyDB::Hash
- -Filename => $filename,
+ my $db = new BerkeleyDB::Hash
+ -Filename => $filename,
-Flags => DB_CREATE
or die "Cannot open file $filename: $! $BerkeleyDB::Error\n" ;
@@ -99,19 +99,19 @@ my $redirect = "xyzt" ;
$db->db_put("orange", "orange") ;
$db->db_put("banana", "yellow") ;
$db->db_put("tomato", "red") ;
-
+
# Check for existence of a key
print "Banana Exists\n\n" if $db->db_get("banana", $v) == 0;
-
+
# Delete a key/value pair.
$db->db_del("apple") ;
-
+
# print the contents of the file
my ($k, $v) = ("", "") ;
my $cursor = $db->db_cursor() ;
while ($cursor->c_get($k, $v, DB_NEXT) == 0)
{ print "$k -> $v\n" }
-
+
undef $cursor ;
undef $db ;
## END simpleHash2
@@ -142,8 +142,8 @@ my $redirect = "xyzt" ;
my $filename = "tree" ;
unlink $filename ;
my %h ;
- tie %h, 'BerkeleyDB::Btree',
- -Filename => $filename,
+ tie %h, 'BerkeleyDB::Btree',
+ -Filename => $filename,
-Flags => DB_CREATE
or die "Cannot open $filename: $! $BerkeleyDB::Error\n" ;
@@ -189,8 +189,8 @@ my $redirect = "xyzt" ;
my $filename = "tree" ;
unlink $filename ;
my %h ;
- tie %h, 'BerkeleyDB::Btree',
- -Filename => $filename,
+ tie %h, 'BerkeleyDB::Btree',
+ -Filename => $filename,
-Flags => DB_CREATE,
-Compare => sub { lc $_[0] cmp lc $_[1] }
or die "Cannot open $filename: $!\n" ;
@@ -238,8 +238,8 @@ my $redirect = "xyzt" ;
my $filename = "filt.db" ;
unlink $filename ;
- my $db = tie %hash, 'BerkeleyDB::Hash',
- -Filename => $filename,
+ my $db = tie %hash, 'BerkeleyDB::Hash',
+ -Filename => $filename,
-Flags => DB_CREATE
or die "Cannot open $filename: $!\n" ;
@@ -255,8 +255,8 @@ my $redirect = "xyzt" ;
undef $db ;
untie %hash ;
## END nullFilter
- $db = tie %hash, 'BerkeleyDB::Hash',
- -Filename => $filename,
+ $db = tie %hash, 'BerkeleyDB::Hash',
+ -Filename => $filename,
-Flags => DB_CREATE
or die "Cannot open $filename: $!\n" ;
while (($k, $v) = each %hash)
@@ -288,8 +288,8 @@ my $redirect = "xyzt" ;
unlink $filename ;
- my $db = tie %hash, 'BerkeleyDB::Btree',
- -Filename => $filename,
+ my $db = tie %hash, 'BerkeleyDB::Btree',
+ -Filename => $filename,
-Flags => DB_CREATE
or die "Cannot open $filename: $!\n" ;
@@ -300,8 +300,8 @@ my $redirect = "xyzt" ;
undef $db ;
untie %hash ;
## END intFilter
- $db = tie %hash, 'BerkeleyDB::Btree',
- -Filename => $filename,
+ $db = tie %hash, 'BerkeleyDB::Btree',
+ -Filename => $filename,
-Flags => DB_CREATE
or die "Cannot Open $filename: $!\n" ;
while (($k, $v) = each %hash)
@@ -335,8 +335,8 @@ my $redirect = "xyzt" ;
unlink $filename ;
my @h ;
- tie @h, 'BerkeleyDB::Recno',
- -Filename => $filename,
+ tie @h, 'BerkeleyDB::Recno',
+ -Filename => $filename,
-Flags => DB_CREATE,
-Property => DB_RENUMBER
or die "Cannot open $filename: $!\n" ;
@@ -372,8 +372,8 @@ my $redirect = "xyzt" ;
unlink $filename ;
my @h ;
- my $db = tie @h, 'BerkeleyDB::Recno',
- -Filename => $filename,
+ my $db = tie @h, 'BerkeleyDB::Recno',
+ -Filename => $filename,
-Flags => DB_CREATE,
-Property => DB_RENUMBER
or die "Cannot open $filename: $!\n" ;
@@ -414,4 +414,3 @@ Element 1 Exists with value blue
EOM
}
-
diff --git a/t/examples3.t b/t/examples3.t
index 93069b2..6279778 100644
--- a/t/examples3.t
+++ b/t/examples3.t
@@ -1,6 +1,6 @@
#!./perl -w
-use strict ;
+use strict ;
BEGIN {
unless(grep /blib/, @INC) {
@@ -10,11 +10,11 @@ BEGIN {
}
use lib 't';
-use BerkeleyDB;
+use BerkeleyDB;
use Test::More;
use util ;
-#BEGIN
+#BEGIN
#{
# if ($BerkeleyDB::db_version < 3) {
# print "1..0 # Skipping test, this needs Berkeley DB 3.x or better\n" ;
@@ -48,11 +48,11 @@ my $redirect = "xyzt" ;
use strict ;
use BerkeleyDB ;
-
+
my $filename = "fruit" ;
unlink $filename ;
- my $db = new BerkeleyDB::Hash
- -Filename => $filename,
+ my $db = new BerkeleyDB::Hash
+ -Filename => $filename,
-Flags => DB_CREATE,
-Property => DB_DUP
or die "Cannot open file $filename: $! $BerkeleyDB::Error\n" ;
@@ -64,13 +64,13 @@ my $redirect = "xyzt" ;
$db->db_put("yellow", "banana") ;
$db->db_put("red", "tomato") ;
$db->db_put("green", "apple") ;
-
+
# print the contents of the file
my ($k, $v) = ("", "") ;
my $cursor = $db->db_cursor() ;
while ($cursor->c_get($k, $v, DB_NEXT) == 0)
{ print "$k -> $v\n" }
-
+
undef $cursor ;
undef $db ;
unlink $filename ;
@@ -96,11 +96,11 @@ my $redirect = "xyzt" ;
use strict ;
use BerkeleyDB ;
-
+
my $filename = "fruit" ;
unlink $filename ;
- my $db = new BerkeleyDB::Hash
- -Filename => $filename,
+ my $db = new BerkeleyDB::Hash
+ -Filename => $filename,
-Flags => DB_CREATE,
-Property => DB_DUP | DB_DUPSORT
or die "Cannot open file $filename: $! $BerkeleyDB::Error\n" ;
@@ -112,13 +112,13 @@ my $redirect = "xyzt" ;
$db->db_put("yellow", "banana") ;
$db->db_put("red", "tomato") ;
$db->db_put("green", "apple") ;
-
+
# print the contents of the file
my ($k, $v) = ("", "") ;
my $cursor = $db->db_cursor() ;
while ($cursor->c_get($k, $v, DB_NEXT) == 0)
{ print "$k -> $v\n" }
-
+
undef $cursor ;
undef $db ;
unlink $filename ;
@@ -135,5 +135,3 @@ yellow -> banana
EOM
}
-
-
diff --git a/t/examples3.t.T b/t/examples3.t.T
index 8ba8ab9..276cca1 100644
--- a/t/examples3.t.T
+++ b/t/examples3.t.T
@@ -1,6 +1,6 @@
#!./perl -w
-use strict ;
+use strict ;
BEGIN {
unless(grep /blib/, @INC) {
@@ -10,11 +10,11 @@ BEGIN {
}
use lib 't';
-use BerkeleyDB;
+use BerkeleyDB;
use Test::More;
use util ;
-#BEGIN
+#BEGIN
#{
# if ($BerkeleyDB::db_version < 3) {
# print "1..0 # Skipping test, this needs Berkeley DB 3.x or better\n" ;
@@ -49,11 +49,11 @@ my $redirect = "xyzt" ;
## BEGIN dupHash
use strict ;
use BerkeleyDB ;
-
+
my $filename = "fruit" ;
unlink $filename ;
- my $db = new BerkeleyDB::Hash
- -Filename => $filename,
+ my $db = new BerkeleyDB::Hash
+ -Filename => $filename,
-Flags => DB_CREATE,
-Property => DB_DUP
or die "Cannot open file $filename: $! $BerkeleyDB::Error\n" ;
@@ -65,13 +65,13 @@ my $redirect = "xyzt" ;
$db->db_put("yellow", "banana") ;
$db->db_put("red", "tomato") ;
$db->db_put("green", "apple") ;
-
+
# print the contents of the file
my ($k, $v) = ("", "") ;
my $cursor = $db->db_cursor() ;
while ($cursor->c_get($k, $v, DB_NEXT) == 0)
{ print "$k -> $v\n" }
-
+
undef $cursor ;
undef $db ;
## END dupHash
@@ -99,11 +99,11 @@ my $redirect = "xyzt" ;
## BEGIN dupSortHash
use strict ;
use BerkeleyDB ;
-
+
my $filename = "fruit" ;
unlink $filename ;
- my $db = new BerkeleyDB::Hash
- -Filename => $filename,
+ my $db = new BerkeleyDB::Hash
+ -Filename => $filename,
-Flags => DB_CREATE,
-Property => DB_DUP | DB_DUPSORT
or die "Cannot open file $filename: $! $BerkeleyDB::Error\n" ;
@@ -115,13 +115,13 @@ my $redirect = "xyzt" ;
$db->db_put("yellow", "banana") ;
$db->db_put("red", "tomato") ;
$db->db_put("green", "apple") ;
-
+
# print the contents of the file
my ($k, $v) = ("", "") ;
my $cursor = $db->db_cursor() ;
while ($cursor->c_get($k, $v, DB_NEXT) == 0)
{ print "$k -> $v\n" }
-
+
undef $cursor ;
undef $db ;
## END dupSortHash
@@ -139,5 +139,3 @@ yellow -> banana
EOM
}
-
-
diff --git a/t/filter.t b/t/filter.t
index edb264f..85c1ba9 100644
--- a/t/filter.t
+++ b/t/filter.t
@@ -1,11 +1,11 @@
#!./perl -w
-# ID: %I%, %G%
+# ID: %I%, %G%
use strict ;
use lib 't' ;
-use BerkeleyDB;
+use BerkeleyDB;
use util ;
use Test::More;
@@ -28,14 +28,14 @@ umask(0) ;
{
my($fk, $sk, $fv, $sv) = @_ ;
return
- $fetch_key eq $fk && $store_key eq $sk &&
+ $fetch_key eq $fk && $store_key eq $sk &&
$fetch_value eq $fv && $store_value eq $sv &&
$_ eq 'original' ;
}
-
- ok $db = tie %h, 'BerkeleyDB::Hash',
- -Filename => $Dfile,
- -Flags => DB_CREATE;
+
+ ok $db = tie %h, 'BerkeleyDB::Hash',
+ -Filename => $Dfile,
+ -Flags => DB_CREATE;
$db->filter_fetch_key (sub { $fetch_key = $_ }) ;
$db->filter_store_key (sub { $store_key = $_ }) ;
@@ -59,15 +59,15 @@ umask(0) ;
ok checkOutput( "fred", "", "", "") ;
# replace the filters, but remember the previous set
- my ($old_fk) = $db->filter_fetch_key
+ my ($old_fk) = $db->filter_fetch_key
(sub { $_ = uc $_ ; $fetch_key = $_ }) ;
- my ($old_sk) = $db->filter_store_key
+ my ($old_sk) = $db->filter_store_key
(sub { $_ = lc $_ ; $store_key = $_ }) ;
- my ($old_fv) = $db->filter_fetch_value
+ my ($old_fv) = $db->filter_fetch_value
(sub { $_ = "[$_]"; $fetch_value = $_ }) ;
- my ($old_sv) = $db->filter_store_value
+ my ($old_sv) = $db->filter_store_value
(sub { s/o/x/g; $store_value = $_ }) ;
-
+
($fetch_key, $store_key, $fetch_value, $store_value) = ("") x 4 ;
$h{"Fred"} = "Joe" ;
# fk sk fv sv
@@ -125,16 +125,16 @@ umask(0) ;
unlink $Dfile;
}
-{
+{
# DBM Filter with a closure
use strict ;
my (%h, $db) ;
unlink $Dfile;
- ok $db = tie %h, 'BerkeleyDB::Hash',
- -Filename => $Dfile,
- -Flags => DB_CREATE;
+ ok $db = tie %h, 'BerkeleyDB::Hash',
+ -Filename => $Dfile,
+ -Flags => DB_CREATE;
my %result = () ;
@@ -144,8 +144,8 @@ umask(0) ;
my $count = 0 ;
my @kept = () ;
- return sub { ++$count ;
- push @kept, $_ ;
+ return sub { ++$count ;
+ push @kept, $_ ;
$result{$name} = "$name - $count: [@kept]" ;
}
}
@@ -188,7 +188,7 @@ umask(0) ;
undef $db ;
untie %h;
unlink $Dfile;
-}
+}
{
# DBM Filter recursion detection
@@ -196,15 +196,15 @@ umask(0) ;
my (%h, $db) ;
unlink $Dfile;
- ok $db = tie %h, 'BerkeleyDB::Hash',
- -Filename => $Dfile,
- -Flags => DB_CREATE;
+ ok $db = tie %h, 'BerkeleyDB::Hash',
+ -Filename => $Dfile,
+ -Flags => DB_CREATE;
$db->filter_store_key (sub { $_ = $h{$_} }) ;
eval '$h{1} = 1234' ;
ok $@ =~ /^recursion detected in filter_store_key at/ ;
-
+
undef $db ;
untie %h;
unlink $Dfile;
@@ -218,9 +218,9 @@ umask(0) ;
my (%h, $db) ;
unlink $Dfile;
- ok $db = tie %h, 'BerkeleyDB::Hash',
- -Filename => $Dfile,
- -Flags => DB_CREATE;
+ ok $db = tie %h, 'BerkeleyDB::Hash',
+ -Filename => $Dfile,
+ -Flags => DB_CREATE;
$db->filter_fetch_key (sub { }) ;
$db->filter_store_key (sub { }) ;
@@ -247,7 +247,7 @@ umask(0) ;
ok($h{"fred"} eq "joe");
ok($db->FIRSTKEY() eq "fred") ;
-
+
eval { grep { $h{$_} } (1, 2, 3) };
ok (! $@);
@@ -263,9 +263,9 @@ if(0)
my (%h, $db) ;
unlink $Dfile;
- ok $db = tie %h, 'BerkeleyDB::Hash',
- -Filename => $Dfile,
- -Flags => DB_CREATE;
+ ok $db = tie %h, 'BerkeleyDB::Hash',
+ -Filename => $Dfile,
+ -Flags => DB_CREATE;
my %result = () ;
@@ -323,4 +323,3 @@ if(0)
untie %h;
unlink $Dfile;
}
-
diff --git a/t/hash.t b/t/hash.t
index 875db12..e4ff014 100644
--- a/t/hash.t
+++ b/t/hash.t
@@ -1,11 +1,11 @@
#!./perl -w
-# ID: %I%, %G%
+# ID: %I%, %G%
use strict ;
use lib 't' ;
-use BerkeleyDB;
+use BerkeleyDB;
use util ;
use Test::More;
@@ -45,7 +45,7 @@ umask(0) ;
{
my $lex = new LexFile $Dfile ;
- ok my $db = new BerkeleyDB::Hash -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Hash -Filename => $Dfile,
-Flags => DB_CREATE ;
# Add a k/v pair
@@ -101,12 +101,12 @@ umask(0) ;
ok my $env = new BerkeleyDB::Env -Flags => DB_CREATE| DB_INIT_MPOOL,@StdErrFile,
-Home => $home ;
- ok my $db = new BerkeleyDB::Hash -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Hash -Filename => $Dfile,
-Env => $env,
-Flags => DB_CREATE ;
isa_ok $db->Env, 'BerkeleyDB::Env';
-
+
# Add a k/v pair
my $value ;
ok $db->db_put("some key", "some value") == 0 ;
@@ -122,7 +122,7 @@ umask(0) ;
my $lex = new LexFile $Dfile ;
my $value ;
$::count = 0 ;
- ok my $db = new BerkeleyDB::Hash -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Hash -Filename => $Dfile,
-Hash => sub { ++$::count ; length $_[0] },
-Flags => DB_CREATE ;
@@ -132,14 +132,14 @@ umask(0) ;
ok $::count > 0 ;
}
-
+
{
# cursors
my $lex = new LexFile $Dfile ;
my %hash ;
my ($k, $v) ;
- ok my $db = new BerkeleyDB::Hash -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Hash -Filename => $Dfile,
-Flags => DB_CREATE ;
# create some data
@@ -163,7 +163,7 @@ umask(0) ;
my $extras = 0 ;
# sequence forwards
while ($cursor->c_get($k, $v, DB_NEXT) == 0) {
- if ( $copy{$k} eq $v )
+ if ( $copy{$k} eq $v )
{ delete $copy{$k} }
else
{ ++ $extras }
@@ -180,7 +180,7 @@ umask(0) ;
for ( $status = $cursor->c_get($k, $v, DB_LAST) ;
$status == 0 ;
$status = $cursor->c_get($k, $v, DB_PREV)) {
- if ( $copy{$k} eq $v )
+ if ( $copy{$k} eq $v )
{ delete $copy{$k} }
else
{ ++ $extras }
@@ -200,9 +200,9 @@ umask(0) ;
($k, $v) = ("black", "house") ;
ok $cursor->c_get($k, $v, DB_GET_BOTH) == DB_NOTFOUND ;
-
+
}
-
+
{
# Tied Hash interface
@@ -278,7 +278,7 @@ umask(0) ;
undef $db ;
untie %hash ;
}
-
+
{
# partial
# check works via API
@@ -363,7 +363,7 @@ umask(0) ;
{
# partial
- # check works via tied hash
+ # check works via tied hash
my $lex = new LexFile $Dfile ;
my %hash ;
@@ -530,7 +530,7 @@ umask(0) ;
ok $cursor->c_get($key, $value, DB_NEXT) == 0 ;
ok $key eq "Wall" && $value eq "Brick" ;
- #my $ref = $db->db_stat() ;
+ #my $ref = $db->db_stat() ;
#ok $ref->{bt_flags} | DB_DUP ;
# test DB_DUP_NEXT
@@ -544,7 +544,7 @@ umask(0) ;
ok $cursor->c_get($k, $v, DB_NEXT_DUP) == 0 ;
ok $k eq "Wall" && $v eq "Brick" ;
ok $cursor->c_get($k, $v, DB_NEXT_DUP) == DB_NOTFOUND ;
-
+
undef $db ;
undef $cursor ;
@@ -557,15 +557,15 @@ umask(0) ;
my $lex = new LexFile $Dfile, $Dfile2;
my ($key, $value) ;
my (%h, %g) ;
- my @Keys = qw( 0123 9 12 -1234 9 987654321 9 def ) ;
- my @Values = qw( 1 11 3 dd x abc 2 0 ) ;
+ my @Keys = qw( 0123 9 12 -1234 9 987654321 9 def ) ;
+ my @Values = qw( 1 11 3 dd x abc 2 0 ) ;
- ok tie %h, "BerkeleyDB::Hash", -Filename => $Dfile,
+ ok tie %h, "BerkeleyDB::Hash", -Filename => $Dfile,
-DupCompare => sub { $_[0] cmp $_[1] },
-Property => DB_DUP|DB_DUPSORT,
-Flags => DB_CREATE ;
- ok tie %g, 'BerkeleyDB::Hash', -Filename => $Dfile2,
+ ok tie %g, 'BerkeleyDB::Hash', -Filename => $Dfile2,
-DupCompare => sub { $_[0] <=> $_[1] },
-Property => DB_DUP|DB_DUPSORT,
-Flags => DB_CREATE ;
@@ -573,7 +573,7 @@ umask(0) ;
foreach (@Keys) {
local $^W = 0 ;
my $value = shift @Values ;
- $h{$_} = $value ;
+ $h{$_} = $value ;
$g{$_} = $value ;
}
@@ -603,7 +603,7 @@ umask(0) ;
my $lex = new LexFile $Dfile;
my %hh ;
- ok my $YY = tie %hh, "BerkeleyDB::Hash", -Filename => $Dfile,
+ ok my $YY = tie %hh, "BerkeleyDB::Hash", -Filename => $Dfile,
-DupCompare => sub { $_[0] cmp $_[1] },
-Property => DB_DUP,
-Flags => DB_CREATE ;
@@ -613,38 +613,38 @@ umask(0) ;
$hh{'Wall'} = 'Brick' ; # Note the duplicate key
$hh{'Smith'} = 'John' ;
$hh{'mouse'} = 'mickey' ;
-
+
# first work in scalar context
ok scalar $YY->get_dup('Unknown') == 0 ;
ok scalar $YY->get_dup('Smith') == 1 ;
ok scalar $YY->get_dup('Wall') == 3 ;
-
+
# now in list context
my @unknown = $YY->get_dup('Unknown') ;
ok "@unknown" eq "" ;
-
+
my @smith = $YY->get_dup('Smith') ;
ok "@smith" eq "John" ;
-
+
{
my @wall = $YY->get_dup('Wall') ;
my %wall ;
@wall{@wall} = @wall ;
- ok (@wall == 3 && $wall{'Larry'}
+ ok (@wall == 3 && $wall{'Larry'}
&& $wall{'Stone'} && $wall{'Brick'});
}
-
+
# hash
my %unknown = $YY->get_dup('Unknown', 1) ;
ok keys %unknown == 0 ;
-
+
my %smith = $YY->get_dup('Smith', 1) ;
ok keys %smith == 1 && $smith{'John'} ;
-
+
my %wall = $YY->get_dup('Wall', 1) ;
- ok keys %wall == 3 && $wall{'Larry'} == 1 && $wall{'Stone'} == 1
+ ok keys %wall == 3 && $wall{'Larry'} == 1 && $wall{'Stone'} == 1
&& $wall{'Brick'} == 1 ;
-
+
undef $YY ;
untie %hh ;
@@ -670,14 +670,14 @@ umask(0) ;
@ISA=qw(BerkeleyDB BerkeleyDB::Hash);
@EXPORT = @BerkeleyDB::EXPORT ;
- sub db_put {
+ sub db_put {
my $self = shift ;
my $key = shift ;
my $value = shift ;
$self->SUPER::db_put($key, $value * 3) ;
}
- sub db_get {
+ sub db_get {
my $self = shift ;
$self->SUPER::db_get($_[0], $_[1]) ;
$_[1] -= 2 ;
@@ -697,13 +697,13 @@ EOM
close FILE ;
use Test::More;
- BEGIN { push @INC, '.'; }
+ BEGIN { push @INC, '.'; }
eval 'use SubDB ; ';
ok $@ eq "" ;
my %h ;
my $X ;
eval '
- $X = tie(%h, "SubDB", -Filename => "dbhash.tmp",
+ $X = tie(%h, "SubDB", -Filename => "dbhash.tmp",
-Flags => DB_CREATE,
-Mode => 0640 );
' ;
diff --git a/t/heap.t b/t/heap.t
index f8a51ae..54b8129 100644
--- a/t/heap.t
+++ b/t/heap.t
@@ -3,7 +3,7 @@
use strict ;
use lib 't';
-use BerkeleyDB;
+use BerkeleyDB;
use util ;
use Test::More;
@@ -32,7 +32,7 @@ umask(0) ;
ok $@ =~ /unknown key value\(s\) Stupid/ ;
eval ' $db = new BerkeleyDB::Heap -Bad => 2, -Mode => 0345, -Stupid => 3; ' ;
- ok $@ =~ /unknown key value\(s\) (Bad,? |Stupid,? ){2}/
+ ok $@ =~ /unknown key value\(s\) (Bad,? |Stupid,? ){2}/
or print "# $@" ;
eval ' $db = new BerkeleyDB::Heap -Env => 2 ' ;
@@ -61,8 +61,8 @@ umask(0) ;
{
my $lex = new LexFile $Dfile ;
- ok my $db = new BerkeleyDB::Heap -Filename => $Dfile,
- -Flags => DB_CREATE
+ ok my $db = new BerkeleyDB::Heap -Filename => $Dfile,
+ -Flags => DB_CREATE
or diag "Cannot create Heap: [$!][$BerkeleyDB::Error]\n" ;
# Add a k/v pair
@@ -71,20 +71,20 @@ umask(0) ;
my $key1;
my $key2;
is $db->Env, undef;
- ok $db->db_put($key1, "some value", DB_APPEND) == 0
+ ok $db->db_put($key1, "some value", DB_APPEND) == 0
or diag "Cannot db_put: " . $db->status() . "[$!][$BerkeleyDB::Error]\n" ;
ok $db->status() == 0 ;
- ok $db->db_get($key1, $value) == 0
+ ok $db->db_get($key1, $value) == 0
or diag "Cannot db_get: [$!][$BerkeleyDB::Error]\n" ;
ok $value eq "some value" ;
ok $db->db_put($key2, "value", DB_APPEND) == 0 ;
- ok $db->db_get($key2, $value) == 0
+ ok $db->db_get($key2, $value) == 0
or diag "Cannot db_get: [$!][$BerkeleyDB::Error]\n" ;
ok $value eq "value" ;
ok $db->db_del($key1) == 0 ;
ok $db->db_get($key1, $value) == DB_NOTFOUND ;
ok $db->status() == DB_NOTFOUND ;
- ok $db->status() =~ $DB_errors{'DB_NOTFOUND'}
+ ok $db->status() =~ $DB_errors{'DB_NOTFOUND'}
or diag "Status is [" . $db->status() . "]";
ok $db->db_sync() == 0 ;
@@ -125,7 +125,7 @@ umask(0) ;
ok my $env = new BerkeleyDB::Env -Flags => DB_CREATE|DB_INIT_MPOOL,
@StdErrFile, -Home => $home ;
- ok my $db = new BerkeleyDB::Heap -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Heap -Filename => $Dfile,
-Env => $env,
-Flags => DB_CREATE ;
@@ -142,16 +142,16 @@ umask(0) ;
undef $env ;
}
-
+
{
# cursors
my $lex = new LexFile $Dfile ;
my %hash ;
my ($k, $v) ;
- ok my $db = new BerkeleyDB::Heap -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Heap -Filename => $Dfile,
-Flags => DB_CREATE ;
- #print "[$db] [$!] $BerkeleyDB::Error\n" ;
+ #print "[$db] [$!] $BerkeleyDB::Error\n" ;
# create some data
my %data = ();
@@ -175,7 +175,7 @@ umask(0) ;
my $extras = 0 ;
# sequence forwards
while ($cursor->c_get($k, $v, DB_NEXT) == 0) {
- if ( $copy{$k} eq $v )
+ if ( $copy{$k} eq $v )
{ delete $copy{$k} }
else
{ ++ $extras }
@@ -192,7 +192,7 @@ umask(0) ;
for ( $status = $cursor->c_get($k, $v, DB_LAST) ;
$status == 0 ;
$status = $cursor->c_get($k, $v, DB_PREV)) {
- if ( $copy{$k} eq $v )
+ if ( $copy{$k} eq $v )
{ delete $copy{$k} }
else
{ ++ $extras }
@@ -214,7 +214,7 @@ umask(0) ;
ok $cursor->c_get($k, $v, DB_GET_BOTH) == DB_NOTFOUND, "DB_NOTFOUND" ;
}
-
+
@@ -226,7 +226,7 @@ umask(0) ;
my $fd ;
my $value ;
#ok my $db = tie %hash, 'BerkeleyDB::Heap' ;
- my $db = new BerkeleyDB::Heap
+ my $db = new BerkeleyDB::Heap
-Flags => DB_CREATE ;
isa_ok $db, 'BerkeleyDB::Heap' ;
@@ -236,7 +236,7 @@ umask(0) ;
ok $value eq "some value", "some value" ;
}
-
+
if (0)
{
# partial
@@ -353,7 +353,7 @@ if (0)
ok ((my $Z = $txn->txn_commit()) == 0) ;
ok $txn = $env->txn_begin() ;
$db1->Txn($txn);
-
+
# create some data
my %data = (
"red" => "boat",
@@ -433,7 +433,7 @@ exit;
ok $cursor->c_get($key, $value, DB_NEXT) == 0 ;
ok $key eq "Wall" && $value eq "Brick" ;
- #my $ref = $db->db_stat() ;
+ #my $ref = $db->db_stat() ;
#ok ($ref->{bt_flags} | DB_DUP) == DB_DUP ;
#print "bt_flags " . $ref->{bt_flags} . " DB_DUP " . DB_DUP ."\n";
@@ -450,13 +450,13 @@ exit;
my $recs = ($BerkeleyDB::db_version >= 3.1 ? "bt_ndata" : "bt_nrecs") ;
my %hash ;
my ($k, $v) ;
- ok my $db = new BerkeleyDB::Heap -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Heap -Filename => $Dfile,
-Flags => DB_CREATE,
-Minkey =>3 ,
- -Pagesize => 2 **12
+ -Pagesize => 2 **12
;
- my $ref = $db->db_stat() ;
+ my $ref = $db->db_stat() ;
ok $ref->{$recs} == 0;
ok $ref->{'bt_minkey'} == 3;
ok $ref->{'bt_pagesize'} == 2 ** 12;
@@ -474,7 +474,7 @@ exit;
}
ok $ret == 0 ;
- $ref = $db->db_stat() ;
+ $ref = $db->db_stat() ;
ok $ref->{$recs} == 3;
}
@@ -498,14 +498,14 @@ exit;
@ISA=qw(BerkeleyDB BerkeleyDB::Heap );
@EXPORT = @BerkeleyDB::EXPORT ;
- sub db_put {
+ sub db_put {
my $self = shift ;
my $key = shift ;
my $value = shift ;
$self->SUPER::db_put($key, $value * 3) ;
}
- sub db_get {
+ sub db_get {
my $self = shift ;
$self->SUPER::db_get($_[0], $_[1]) ;
$_[1] -= 2 ;
@@ -525,13 +525,13 @@ EOM
close FILE ;
use Test::More;
- BEGIN { push @INC, '.'; }
+ BEGIN { push @INC, '.'; }
eval 'use SubDB ; ';
ok $@ eq "" ;
my %h ;
my $X ;
eval '
- $X = tie(%h, "SubDB", -Filename => "dbbtree.tmp",
+ $X = tie(%h, "SubDB", -Filename => "dbbtree.tmp",
-Flags => DB_CREATE,
-Mode => 0640 );
' ;
@@ -560,5 +560,3 @@ EOM
unlink "SubDB.pm", "dbbtree.tmp" ;
}
-
-
diff --git a/t/join.t b/t/join.t
index 5744c80..2374adf 100644
--- a/t/join.t
+++ b/t/join.t
@@ -1,11 +1,11 @@
#!./perl -w
-# ID: %I%, %G%
+# ID: %I%, %G%
use strict ;
use lib 't';
-use BerkeleyDB;
+use BerkeleyDB;
use util ;
use Test::More;
@@ -13,7 +13,7 @@ BEGIN {
plan(skip_all => "this needs BerkeleyDB 2.5.2 or better" )
if $BerkeleyDB::db_ver < 2.005002;
- plan tests => 42;
+ plan tests => 42;
}
my $Dfile1 = "dbhash1.tmp";
@@ -31,7 +31,7 @@ umask(0) ;
my $status ;
my $cursor ;
- ok my $db1 = tie %hash1, 'BerkeleyDB::Hash',
+ ok my $db1 = tie %hash1, 'BerkeleyDB::Hash',
-Filename => $Dfile1,
-Flags => DB_CREATE,
-DupCompare => sub { $_[0] lt $_[1] },
@@ -79,7 +79,7 @@ umask(0) ;
|DB_INIT_MPOOL;
#|DB_INIT_MPOOL| DB_INIT_LOCK;
ok my $txn = $env->txn_begin() ;
- ok my $db1 = tie %hash1, 'BerkeleyDB::Hash',
+ ok my $db1 = tie %hash1, 'BerkeleyDB::Hash',
-Filename => $Dfile1,
-Flags => DB_CREATE,
-DupCompare => sub { $_[0] cmp $_[1] },
@@ -88,7 +88,7 @@ umask(0) ;
-Txn => $txn ;
;
- ok my $db2 = tie %hash2, 'BerkeleyDB::Hash',
+ ok my $db2 = tie %hash2, 'BerkeleyDB::Hash',
-Filename => $Dfile2,
-Flags => DB_CREATE,
-DupCompare => sub { $_[0] cmp $_[1] },
@@ -96,7 +96,7 @@ umask(0) ;
-Env => $env,
-Txn => $txn ;
- ok my $db3 = tie %hash3, 'BerkeleyDB::Btree',
+ ok my $db3 = tie %hash3, 'BerkeleyDB::Btree',
-Filename => $Dfile3,
-Flags => DB_CREATE,
-DupCompare => sub { $_[0] cmp $_[1] },
@@ -104,7 +104,7 @@ umask(0) ;
-Env => $env,
-Txn => $txn ;
-
+
ok addData($db1, qw( apple Convenience
peach Shopway
pear Farmer
@@ -145,7 +145,7 @@ umask(0) ;
# sequence forwards
while ($cursor1->c_get($k, $v) == 0) {
- delete $expected{$k}
+ delete $expected{$k}
if defined $expected{$k} && $expected{$k} eq $v ;
#print "[$k] [$v]\n" ;
}
@@ -170,7 +170,7 @@ umask(0) ;
# sequence forwards
while ($cursor1->c_get($k, $v) == 0) {
- delete $expected{$k}
+ delete $expected{$k}
if defined $expected{$k} && $expected{$k} eq $v ;
#print "[$k] [$v]\n" ;
}
@@ -183,17 +183,17 @@ umask(0) ;
$k = "red" ;
$v = "" ;
ok $cursor2->c_get($k, $v, DB_SET) == 0 ;
-
+
ok $cursor3 = $db3->db_cursor() ;
$k = "expensive" ;
$v = "" ;
ok $cursor3->c_get($k, $v, DB_SET) == 0 ;
ok $cursor1 = $db1->db_join([$cursor2, $cursor3]) ;
-
+
%expected = qw( apple 1
strawberry 1
) ;
-
+
# sequence forwards
$k = "" ;
$v = "" ;
diff --git a/t/mldbm.t b/t/mldbm.t
index 4c50d19..3b6ec30 100644
--- a/t/mldbm.t
+++ b/t/mldbm.t
@@ -5,7 +5,7 @@ use strict ;
use lib 't';
use Test::More ;
-BEGIN
+BEGIN
{
plan skip_all => "this is Perl $], skipping test\n"
if $] < 5.005 ;
@@ -25,7 +25,7 @@ BEGIN
plan skip_all => "MLDBM is not installed on this system.\n";
}
- plan tests => 12;
+ plan tests => 12;
}
use lib 't' ;
@@ -33,15 +33,15 @@ use util ;
{
package BTREE ;
-
+
use BerkeleyDB ;
- use MLDBM qw(BerkeleyDB::Btree) ;
+ use MLDBM qw(BerkeleyDB::Btree) ;
use Data::Dumper;
use Test::More;
-
+
my $filename = "";
my $lex = new LexFile $filename;
-
+
$MLDBM::UseDB = "BerkeleyDB::Btree" ;
my %o ;
my $db = tie %o, 'MLDBM', -Filename => $filename,
@@ -49,7 +49,7 @@ use util ;
or die $!;
ok $db ;
ok $db->type() == DB_BTREE ;
-
+
my $c = [\'c'];
my $b = {};
my $a = [1, $b, $c];
@@ -60,13 +60,13 @@ use util ;
$o{d} = "{once upon a time}";
$o{e} = 1024;
$o{f} = 1024.1024;
-
+
my $struct = [@o{qw(a b c)}];
ok ::_compare([$a, $b, $c], $struct);
ok $o{d} eq "{once upon a time}" ;
ok $o{e} == 1024 ;
ok $o{f} eq 1024.1024 ;
-
+
}
{
@@ -74,7 +74,7 @@ use util ;
package HASH ;
use BerkeleyDB ;
- use MLDBM qw(BerkeleyDB::Hash) ;
+ use MLDBM qw(BerkeleyDB::Hash) ;
use Data::Dumper;
my $filename = "";
diff --git a/t/queue.t b/t/queue.t
index a2ffa76..95338bc 100644
--- a/t/queue.t
+++ b/t/queue.t
@@ -1,17 +1,17 @@
#!./perl -w
-# ID: %I%, %G%
+# ID: %I%, %G%
use strict ;
use lib 't' ;
-use BerkeleyDB;
+use BerkeleyDB;
use Test::More;
use util;
plan(skip_all => "Queue needs Berkeley DB 3.3.x or better\n" )
if $BerkeleyDB::db_version < 3.3;
-
+
plan tests => 260;
@@ -51,7 +51,7 @@ umask(0) ;
my $rec_len = 10 ;
my $pad = "x" ;
- ok my $db = new BerkeleyDB::Queue -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Queue -Filename => $Dfile,
-Flags => DB_CREATE,
-Len => $rec_len,
-Pad => $pad;
@@ -109,13 +109,13 @@ umask(0) ;
ok my $env = new BerkeleyDB::Env -Flags => DB_CREATE|DB_INIT_MPOOL,@StdErrFile,
-Home => $home ;
- ok my $db = new BerkeleyDB::Queue -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Queue -Filename => $Dfile,
-Env => $env,
-Flags => DB_CREATE,
-Len => $rec_len;
isa_ok $db->Env, 'BerkeleyDB::Env';
-
+
# Add a k/v pair
my $value ;
ok $db->db_put(1, "some value") == 0 ;
@@ -125,7 +125,7 @@ umask(0) ;
undef $env ;
}
-
+
{
# cursors
@@ -133,7 +133,7 @@ umask(0) ;
my @array ;
my ($k, $v) ;
my $rec_len = 5 ;
- ok my $db = new BerkeleyDB::Queue -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Queue -Filename => $Dfile,
-ArrayBase => 0,
-Flags => DB_CREATE ,
-Len => $rec_len;
@@ -161,9 +161,9 @@ umask(0) ;
my %copy = %data;
my $extras = 0 ;
# sequence forwards
- while ($cursor->c_get($k, $v, DB_NEXT) == 0)
+ while ($cursor->c_get($k, $v, DB_NEXT) == 0)
{
- if ( fillout($copy{$k}, $rec_len) eq $v )
+ if ( fillout($copy{$k}, $rec_len) eq $v )
{ delete $copy{$k} }
else
{ ++ $extras }
@@ -181,7 +181,7 @@ umask(0) ;
for ( $status = $cursor->c_get($k, $v, DB_LAST) ;
$status == 0 ;
$status = $cursor->c_get($k, $v, DB_PREV)) {
- if ( fillout($copy{$k}, $rec_len) eq $v )
+ if ( fillout($copy{$k}, $rec_len) eq $v )
{ delete $copy{$k} }
else
{ ++ $extras }
@@ -193,7 +193,7 @@ umask(0) ;
ok keys %copy == 0 ;
ok $extras == 0 ;
}
-
+
{
# Tied Array interface
@@ -247,10 +247,10 @@ umask(0) ;
# unshift isn't allowed
# eval {
-# $FA ? unshift @array, "red", "green", "blue"
+# $FA ? unshift @array, "red", "green", "blue"
# : $db->unshift("red", "green", "blue" ) ;
# } ;
-# ok $@ =~ /^unshift is unsupported with Queue databases/ ;
+# ok $@ =~ /^unshift is unsupported with Queue databases/ ;
$array[0] = "red" ;
$array[1] = "green" ;
$array[2] = "blue" ;
@@ -279,7 +279,7 @@ umask(0) ;
ok (($FA ? shift @array : $db->shift()) == 2) ;
# push
- $FA ? push @array, "the", "end"
+ $FA ? push @array, "the", "end"
: $db->push("the", "end") ;
ok $cursor->c_get($k, $v, DB_LAST) == 0 ;
ok $k == 102 ;
@@ -298,8 +298,8 @@ umask(0) ;
undef $cursor;
- # now clear the array
- $FA ? @array = ()
+ # now clear the array
+ $FA ? @array = ()
: $db->clear() ;
ok $cursor = (tied @array)->db_cursor() ;
ok $cursor->c_get($k, $v, DB_FIRST) == DB_NOTFOUND ;
@@ -324,7 +324,7 @@ umask(0) ;
ok $value eq fillout("some value", $rec_len) ;
}
-
+
{
# partial
# check works via API
@@ -414,7 +414,7 @@ umask(0) ;
{
# partial
- # check works via tied array
+ # check works via tied array
my $lex = new LexFile $Dfile ;
my @array ;
@@ -509,7 +509,7 @@ umask(0) ;
-Flags => DB_CREATE|DB_INIT_TXN|
DB_INIT_MPOOL|DB_INIT_LOCK ;
ok my $txn = $env->txn_begin() ;
- ok my $db1 = tie @array, 'BerkeleyDB::Queue',
+ ok my $db1 = tie @array, 'BerkeleyDB::Queue',
-Filename => $Dfile,
-ArrayBase => 0,
-Flags => DB_CREATE ,
@@ -518,7 +518,7 @@ umask(0) ;
-Len => $rec_len,
-Pad => " " ;
-
+
ok $txn->txn_commit() == 0 ;
ok $txn = $env->txn_begin() ;
$db1->Txn($txn);
@@ -577,14 +577,14 @@ umask(0) ;
my @array ;
my ($k, $v) ;
my $rec_len = 7 ;
- ok my $db = new BerkeleyDB::Queue -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Queue -Filename => $Dfile,
-Flags => DB_CREATE,
-Pagesize => 4 * 1024,
-Len => $rec_len,
- -Pad => " "
+ -Pad => " "
;
- my $ref = $db->db_stat() ;
+ my $ref = $db->db_stat() ;
ok $ref->{$recs} == 0;
ok $ref->{'qs_pagesize'} == 4 * 1024;
@@ -602,7 +602,7 @@ umask(0) ;
}
ok $ret == 0 ;
- $ref = $db->db_stat() ;
+ $ref = $db->db_stat() ;
ok $ref->{$recs} == 3;
}
@@ -626,14 +626,14 @@ umask(0) ;
@ISA=qw(BerkeleyDB BerkeleyDB::Queue);
@EXPORT = @BerkeleyDB::EXPORT ;
- sub db_put {
+ sub db_put {
my $self = shift ;
my $key = shift ;
my $value = shift ;
$self->SUPER::db_put($key, $value * 3) ;
}
- sub db_get {
+ sub db_get {
my $self = shift ;
$self->SUPER::db_get($_[0], $_[1]) ;
$_[1] -= 2 ;
@@ -653,19 +653,19 @@ EOM
close FILE ;
use Test::More;
- BEGIN { push @INC, '.'; }
+ BEGIN { push @INC, '.'; }
eval 'use SubDB ; ';
ok $@ eq "" ;
my @h ;
my $X ;
my $rec_len = 34 ;
eval '
- $X = tie(@h, "SubDB", -Filename => "dbqueue.tmp",
+ $X = tie(@h, "SubDB", -Filename => "dbqueue.tmp",
-Flags => DB_CREATE,
-Mode => 0640 ,
-Len => $rec_len,
- -Pad => " "
- );
+ -Pad => " "
+ );
' ;
ok $@ eq "" ;
@@ -700,7 +700,7 @@ EOM
my @array ;
my $value ;
my $rec_len = 21 ;
- ok my $db = tie @array, 'BerkeleyDB::Queue',
+ ok my $db = tie @array, 'BerkeleyDB::Queue',
-Filename => $Dfile,
-Flags => DB_CREATE ,
-Len => $rec_len,
@@ -725,7 +725,7 @@ EOM
my @array ;
my $db ;
my $rec_len = 21 ;
- ok $db = tie @array, 'BerkeleyDB::Queue',
+ ok $db = tie @array, 'BerkeleyDB::Queue',
-Flags => DB_CREATE ,
-ArrayBase => 0,
-Len => $rec_len,
@@ -806,10 +806,10 @@ EOM
# unshift isn't allowed
# eval {
-# $FA ? unshift @array, "red", "green", "blue"
+# $FA ? unshift @array, "red", "green", "blue"
# : $db->unshift("red", "green", "blue" ) ;
# } ;
-# ok $@ =~ /^unshift is unsupported with Queue databases/ ;
+# ok $@ =~ /^unshift is unsupported with Queue databases/ ;
$array[0] = "red" ;
$array[1] = "green" ;
$array[2] = "blue" ;
@@ -838,7 +838,7 @@ EOM
ok (($FA ? shift @array : $db->shift()) == 2) ;
# push
- $FA ? push @array, "the", "end"
+ $FA ? push @array, "the", "end"
: $db->push("the", "end") ;
ok $cursor->c_get($k, $v, DB_LAST) == 0 ;
ok $k == 102 ;
@@ -856,8 +856,8 @@ EOM
ok (( $FA ? pop @array : $db->pop ) == 200 ) ;
undef $cursor ;
- # now clear the array
- $FA ? @array = ()
+ # now clear the array
+ $FA ? @array = ()
: $db->clear() ;
ok $cursor = (tied @array)->db_cursor() ;
ok $cursor->c_get($k, $v, DB_FIRST) == DB_NOTFOUND ;
@@ -873,11 +873,11 @@ EOM
my $lex = new LexFile $Dfile ;
my @array ;
my $db ;
- $db = tie @array, 'BerkeleyDB::Queue',
+ $db = tie @array, 'BerkeleyDB::Queue',
-Flags => DB_CREATE ,
-Len => 2,
-Filename => $Dfile ;
- isa_ok $db, 'BerkeleyDB::Queue';
+ isa_ok $db, 'BerkeleyDB::Queue';
$FA ? push @array, "ab", "cd", "ef", "gh"
: $db->push("ab", "cd", "ef", "gh") ;
is scalar(@array), 4;
diff --git a/t/recno.t b/t/recno.t
index 1ebe0b4..d7faa39 100644
--- a/t/recno.t
+++ b/t/recno.t
@@ -1,11 +1,11 @@
#!./perl -w
-# ID: %I%, %G%
+# ID: %I%, %G%
use strict ;
use lib 't' ;
-use BerkeleyDB;
+use BerkeleyDB;
use util ;
use Test::More;
@@ -44,7 +44,7 @@ umask(0) ;
{
my $lex = new LexFile $Dfile ;
- ok my $db = new BerkeleyDB::Recno -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Recno -Filename => $Dfile,
-Flags => DB_CREATE ;
is $db->Env, undef;
@@ -97,12 +97,12 @@ umask(0) ;
ok my $env = new BerkeleyDB::Env -Flags => DB_CREATE|DB_INIT_MPOOL,@StdErrFile,
-Home => $home ;
- ok my $db = new BerkeleyDB::Recno -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Recno -Filename => $Dfile,
-Env => $env,
-Flags => DB_CREATE ;
isa_ok $db->Env, 'BerkeleyDB::Env';
-
+
# Add a k/v pair
my $value ;
ok $db->db_put(1, "some value") == 0 ;
@@ -112,14 +112,14 @@ umask(0) ;
undef $env ;
}
-
+
{
# cursors
my $lex = new LexFile $Dfile ;
my @array ;
my ($k, $v) ;
- ok my $db = new BerkeleyDB::Recno -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Recno -Filename => $Dfile,
-ArrayBase => 0,
-Flags => DB_CREATE ;
@@ -146,9 +146,9 @@ umask(0) ;
my %copy = %data;
my $extras = 0 ;
# sequence forwards
- while ($cursor->c_get($k, $v, DB_NEXT) == 0)
+ while ($cursor->c_get($k, $v, DB_NEXT) == 0)
{
- if ( $copy{$k} eq $v )
+ if ( $copy{$k} eq $v )
{ delete $copy{$k} }
else
{ ++ $extras }
@@ -166,7 +166,7 @@ umask(0) ;
for ( $status = $cursor->c_get($k, $v, DB_LAST) ;
$status == 0 ;
$status = $cursor->c_get($k, $v, DB_PREV)) {
- if ( $copy{$k} eq $v )
+ if ( $copy{$k} eq $v )
{ delete $copy{$k} }
else
{ ++ $extras }
@@ -178,7 +178,7 @@ umask(0) ;
ok keys %copy == 0 ;
ok $extras == 0 ;
}
-
+
{
# Tied Array interface
@@ -236,7 +236,7 @@ umask(0) ;
ok $values == 2022 ;
# unshift
- $FA ? unshift @array, "red", "green", "blue"
+ $FA ? unshift @array, "red", "green", "blue"
: $db->unshift("red", "green", "blue" ) ;
ok $array[1] eq "red" ;
ok $cursor->c_get($k, $v, DB_FIRST) == 0 ;
@@ -262,7 +262,7 @@ umask(0) ;
ok (($FA ? shift @array : $db->shift()) == 2) ;
# push
- $FA ? push @array, "the", "end"
+ $FA ? push @array, "the", "end"
: $db->push("the", "end") ;
ok $cursor->c_get($k, $v, DB_LAST) == 0 ;
ok $k == 1001 ;
@@ -280,8 +280,8 @@ umask(0) ;
ok (( $FA ? pop @array : $db->pop ) == 2000) ;
undef $cursor;
- # now clear the array
- $FA ? @array = ()
+ # now clear the array
+ $FA ? @array = ()
: $db->clear() ;
ok $cursor = $db->db_cursor() ;
ok $cursor->c_get($k, $v, DB_FIRST) == DB_NOTFOUND ;
@@ -304,7 +304,7 @@ umask(0) ;
ok $value eq "some value" ;
}
-
+
{
# partial
# check works via API
@@ -390,7 +390,7 @@ umask(0) ;
{
# partial
- # check works via tied array
+ # check works via tied array
my $lex = new LexFile $Dfile ;
my @array ;
@@ -470,14 +470,14 @@ umask(0) ;
-Flags => DB_CREATE|DB_INIT_TXN|
DB_INIT_MPOOL|DB_INIT_LOCK ;
ok my $txn = $env->txn_begin() ;
- ok my $db1 = tie @array, 'BerkeleyDB::Recno',
+ ok my $db1 = tie @array, 'BerkeleyDB::Recno',
-Filename => $Dfile,
-ArrayBase => 0,
-Flags => DB_CREATE ,
-Env => $env,
-Txn => $txn ;
-
+
ok $txn->txn_commit() == 0 ;
ok $txn = $env->txn_begin() ;
$db1->Txn($txn);
@@ -535,12 +535,12 @@ umask(0) ;
my $recs = ($BerkeleyDB::db_version >= 3.1 ? "bt_ndata" : "bt_nrecs") ;
my @array ;
my ($k, $v) ;
- ok my $db = new BerkeleyDB::Recno -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Recno -Filename => $Dfile,
-Flags => DB_CREATE,
-Pagesize => 4 * 1024,
;
- my $ref = $db->db_stat() ;
+ my $ref = $db->db_stat() ;
ok $ref->{$recs} == 0;
ok $ref->{'bt_pagesize'} == 4 * 1024;
@@ -558,7 +558,7 @@ umask(0) ;
}
ok $ret == 0 ;
- $ref = $db->db_stat() ;
+ $ref = $db->db_stat() ;
ok $ref->{$recs} == 3;
}
@@ -582,14 +582,14 @@ umask(0) ;
@ISA=qw(BerkeleyDB BerkeleyDB::Recno);
@EXPORT = @BerkeleyDB::EXPORT ;
- sub db_put {
+ sub db_put {
my $self = shift ;
my $key = shift ;
my $value = shift ;
$self->SUPER::db_put($key, $value * 3) ;
}
- sub db_get {
+ sub db_get {
my $self = shift ;
$self->SUPER::db_get($_[0], $_[1]) ;
$_[1] -= 2 ;
@@ -608,14 +608,14 @@ EOM
close FILE ;
- BEGIN { push @INC, '.'; }
+ BEGIN { push @INC, '.'; }
use Test::More;
eval 'use SubDB ; ';
ok $@ eq "" ;
my @h ;
my $X ;
eval '
- $X = tie(@h, "SubDB", -Filename => "dbrecno.tmp",
+ $X = tie(@h, "SubDB", -Filename => "dbrecno.tmp",
-Flags => DB_CREATE,
-Mode => 0640 );
' ;
@@ -764,7 +764,7 @@ EOM
my $lex = new LexFile $Dfile;
my @array ;
my $value ;
- ok my $db = tie @array, 'BerkeleyDB::Recno',
+ ok my $db = tie @array, 'BerkeleyDB::Recno',
-Filename => $Dfile,
-Flags => DB_CREATE ;
@@ -807,7 +807,7 @@ EOM
touch $Dfile2 ;
my @array ;
my $value ;
- ok tie @array, 'BerkeleyDB::Recno',
+ ok tie @array, 'BerkeleyDB::Recno',
-ArrayBase => 0,
-Flags => DB_CREATE ,
-Source => $Dfile2 ,
@@ -850,7 +850,7 @@ EOM
touch $Dfile2 ;
my @array ;
my $value ;
- ok tie @array, 'BerkeleyDB::Recno',
+ ok tie @array, 'BerkeleyDB::Recno',
-ArrayBase => 0,
-Flags => DB_CREATE ,
-Property => DB_RENUMBER,
@@ -871,7 +871,7 @@ EOM
my $lex = new LexFile $Dfile ;
my @array ;
my $db ;
- ok $db = tie @array, 'BerkeleyDB::Recno',
+ ok $db = tie @array, 'BerkeleyDB::Recno',
-ArrayBase => 0,
-Flags => DB_CREATE ,
-Property => DB_RENUMBER,
@@ -892,7 +892,7 @@ EOM
my $lex = new LexFile $Dfile ;
my @array ;
my $db ;
- ok $db = tie @array, 'BerkeleyDB::Recno',
+ ok $db = tie @array, 'BerkeleyDB::Recno',
-ArrayBase => 0,
-Flags => DB_CREATE ,
-Property => DB_RENUMBER,
@@ -912,13 +912,13 @@ SKIP:
if(0)
{
# RT #75691: scalar(@array) returns incorrect value after shift() on tied array
- skip "Test needs Berkeley DB 3.2 or better", 4
+ skip "Test needs Berkeley DB 3.2 or better", 4
if $BerkeleyDB::db_version < 3.3;
my $lex = new LexFile $Dfile ;
my @array ;
my $db ;
- ok $db = tie @array, 'BerkeleyDB::Recno',
+ ok $db = tie @array, 'BerkeleyDB::Recno',
-Flags => DB_CREATE ,
-Filename => $Dfile ;
diff --git a/t/sequence.t b/t/sequence.t
index f35f0fd..4df984a 100755
--- a/t/sequence.t
+++ b/t/sequence.t
@@ -3,12 +3,12 @@ use strict ;
use lib 't' ;
use Test::More;
-use BerkeleyDB;
+use BerkeleyDB;
use util;
plan(skip_all => "Sequence needs Berkeley DB 4.3.x or better\n" )
if $BerkeleyDB::db_version < 4.3;
-
+
plan tests => 13;
{
@@ -25,7 +25,7 @@ isa_ok($env, "BerkeleyDB::Env");
my $db = BerkeleyDB::Btree->new(
Env => $env,
- -Filename => $Dfile,
+ -Filename => $Dfile,
-Flags => DB_CREATE
);
diff --git a/t/strict.t b/t/strict.t
index 6e13051..f123547 100644
--- a/t/strict.t
+++ b/t/strict.t
@@ -3,12 +3,12 @@
use strict ;
use lib 't' ;
-use BerkeleyDB;
+use BerkeleyDB;
use util ;
use Test::More ;
-plan tests => 44;
+plan tests => 44;
my $Dfile = "dbhash.tmp";
my $home = "./fred" ;
@@ -25,12 +25,12 @@ umask(0);
ok my $env = new BerkeleyDB::Env -Home => $home,@StdErrFile,
-Flags => DB_CREATE|DB_INIT_TXN|
DB_INIT_MPOOL|DB_INIT_LOCK ;
-
+
ok my $db1 = tie %hash, 'BerkeleyDB::Hash', -Filename => $Dfile,
-Flags => DB_CREATE ,
-Env => $env;
- ok $db1->db_close() == 0 ;
+ ok $db1->db_close() == 0 ;
eval { $status = $env->db_appexit() ; } ;
ok $status == 0 ;
@@ -48,7 +48,7 @@ umask(0);
ok my $env = new BerkeleyDB::Env -Home => $home,@StdErrFile,
-Flags => DB_CREATE|DB_INIT_TXN|
DB_INIT_MPOOL|DB_INIT_LOCK ;
-
+
ok my $db1 = tie %hash, 'BerkeleyDB::Hash', -Filename => $Dfile,
-Flags => DB_CREATE ,
-Env => $env;
@@ -63,7 +63,7 @@ umask(0);
}
{
- # closing a transaction & a database
+ # closing a transaction & a database
my $lex = new LexFile $Dfile ;
my %hash ;
my $status ;
@@ -114,7 +114,7 @@ umask(0);
}
{
- # closing a cursor & a database
+ # closing a cursor & a database
my $lex = new LexFile $Dfile ;
my %hash ;
my $status ;
@@ -141,7 +141,7 @@ umask(0);
}
{
- # closing a transaction & a cursor
+ # closing a transaction & a cursor
my $lex = new LexFile $Dfile ;
my %hash ;
my $status ;
@@ -170,4 +170,3 @@ umask(0);
ok $@ eq "" ;
#print "[$@]\n" ;
}
-
diff --git a/t/subdb.t b/t/subdb.t
index 110b4a9..19c6862 100644
--- a/t/subdb.t
+++ b/t/subdb.t
@@ -3,7 +3,7 @@
use strict ;
use lib 't' ;
-use BerkeleyDB;
+use BerkeleyDB;
use Test::More ;
use util ;
@@ -38,7 +38,7 @@ sub countDatabases
ok $status == DB_NOTFOUND;
return wantarray ? sort @dbnames : scalar @dbnames ;
-
+
}
@@ -73,7 +73,7 @@ sub countDatabases
my $lex = new LexFile $Dfile ;
- ok my $db = new BerkeleyDB::Hash -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Hash -Filename => $Dfile,
-Flags => DB_CREATE ;
# Add a k/v pair
@@ -89,9 +89,9 @@ sub countDatabases
undef $db ;
- $db = new BerkeleyDB::Hash -Filename => $Dfile,
+ $db = new BerkeleyDB::Hash -Filename => $Dfile,
-Subname => "fred" ;
- ok ! $db ;
+ ok ! $db ;
ok -e $Dfile ;
ok ! BerkeleyDB::db_remove(-Filename => $Dfile) ;
@@ -105,7 +105,7 @@ sub countDatabases
my $lex = new LexFile $Dfile ;
- ok my $db = new BerkeleyDB::Hash -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Hash -Filename => $Dfile,
-Subname => "fred" ,
-Flags => DB_CREATE ;
@@ -122,10 +122,10 @@ sub countDatabases
undef $db ;
- $db = new BerkeleyDB::Hash -Filename => $Dfile,
+ $db = new BerkeleyDB::Hash -Filename => $Dfile,
-Subname => "joe" ;
- ok !$db ;
+ ok !$db ;
}
@@ -134,7 +134,7 @@ sub countDatabases
my $lex = new LexFile $Dfile ;
- ok my $db = new BerkeleyDB::Hash -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Hash -Filename => $Dfile,
-Subname => "fred" ,
-Flags => DB_CREATE ;
@@ -161,12 +161,12 @@ sub countDatabases
# of the subdatabase names
my $lex = new LexFile $Dfile ;
-
- ok my $db1 = new BerkeleyDB::Hash -Filename => $Dfile,
+
+ ok my $db1 = new BerkeleyDB::Hash -Filename => $Dfile,
-Subname => "fred" ,
-Flags => DB_CREATE ;
- ok my $db2 = new BerkeleyDB::Btree -Filename => $Dfile,
+ ok my $db2 = new BerkeleyDB::Btree -Filename => $Dfile,
-Subname => "joe" ,
-Flags => DB_CREATE ;
@@ -184,20 +184,20 @@ sub countDatabases
undef $db1 ;
undef $db2 ;
-
+
is join(",", countDatabases($Dfile)), "fred,joe";
ok BerkeleyDB::db_remove(-Filename => $Dfile, -Subname => "harry") != 0;
ok BerkeleyDB::db_remove(-Filename => $Dfile, -Subname => "fred") == 0 ;
-
+
# should only be one subdatabase
is join(",", countDatabases($Dfile)), "joe";
# can't delete an already deleted subdatabase
ok BerkeleyDB::db_remove(-Filename => $Dfile, -Subname => "fred") != 0;
-
+
ok BerkeleyDB::db_remove(-Filename => $Dfile, -Subname => "joe") == 0 ;
-
+
# should only be one subdatabase
is countDatabases($Dfile), 0;
diff --git a/t/txn.t b/t/txn.t
index 51699c5..c4f2069 100644
--- a/t/txn.t
+++ b/t/txn.t
@@ -3,12 +3,12 @@
use strict ;
use lib 't' ;
-use BerkeleyDB;
+use BerkeleyDB;
use util ;
use Test::More ;
-plan tests => 58;
+plan tests => 58;
my $Dfile = "dbhash.tmp";
@@ -52,7 +52,7 @@ umask(0);
-Env => $env,
-Txn => $txn ;
-
+
ok $txn->txn_commit() == 0 ;
ok $txn = $env->txn_begin() ;
$db1->Txn($txn);
@@ -126,7 +126,7 @@ umask(0);
ok $txn->txn_commit() == 0 ;
ok $txn = $env->txn_begin() ;
$db1->Txn($txn);
-
+
# create some data
my %data = (
"red" => "boat",
@@ -193,7 +193,7 @@ umask(0);
-Env => $env,
-Txn => $txn ;
-
+
ok $txn->txn_commit() == 0 ;
ok $txn = $env->txn_begin() ;
$db1->Txn($txn);
@@ -266,7 +266,7 @@ umask(0);
ok $txn->txn_commit() == 0 ;
ok $txn = $env->txn_begin() ;
$db1->Txn($txn);
-
+
# create some data
my %data = (
"red" => "boat",
@@ -313,4 +313,3 @@ umask(0);
undef $env ;
untie %hash ;
}
-
diff --git a/t/unknown.t b/t/unknown.t
index 3e31c63..70f21f5 100755
--- a/t/unknown.t
+++ b/t/unknown.t
@@ -1,11 +1,11 @@
#!./perl -w
-# ID: %I%, %G%
+# ID: %I%, %G%
use strict ;
use lib 't' ;
-use BerkeleyDB;
+use BerkeleyDB;
use util ;
use Test::More;
plan tests => 50;
@@ -43,11 +43,11 @@ umask(0) ;
my $lex = new LexFile $Dfile ;
ok writeFile($Dfile, "") ;
- ok ! (new BerkeleyDB::Unknown -Filename => $Dfile);
+ ok ! (new BerkeleyDB::Unknown -Filename => $Dfile);
# now a non-database file
writeFile($Dfile, "\x2af6") ;
- ok ! (new BerkeleyDB::Unknown -Filename => $Dfile);
+ ok ! (new BerkeleyDB::Unknown -Filename => $Dfile);
}
# check the interface to a Hash database
@@ -56,13 +56,13 @@ umask(0) ;
my $lex = new LexFile $Dfile ;
# create a hash database
- ok my $db = new BerkeleyDB::Hash -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Hash -Filename => $Dfile,
-Flags => DB_CREATE ;
# Add a few k/v pairs
my $value ;
my $status ;
- ok $db->db_put("some key", "some value") == 0
+ ok $db->db_put("some key", "some value") == 0
or diag "Cannot db_put: [$!][$BerkeleyDB::Error]\n" ;
ok $db->db_put("key", "value") == 0 ;
@@ -71,7 +71,7 @@ umask(0) ;
undef $db ;
# now open it with Unknown
- ok $db = new BerkeleyDB::Unknown -Filename => $Dfile;
+ ok $db = new BerkeleyDB::Unknown -Filename => $Dfile;
ok $db->type() == DB_HASH ;
ok $db->db_get("some key", $value) == 0 ;
@@ -95,7 +95,7 @@ umask(0) ;
my $lex = new LexFile $Dfile ;
# create a hash database
- ok my $db = new BerkeleyDB::Btree -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Btree -Filename => $Dfile,
-Flags => DB_CREATE ;
# Add a few k/v pairs
@@ -109,7 +109,7 @@ umask(0) ;
# now open it with Unknown
# create a hash database
- ok $db = new BerkeleyDB::Unknown -Filename => $Dfile;
+ ok $db = new BerkeleyDB::Unknown -Filename => $Dfile;
ok $db->type() == DB_BTREE ;
ok $db->db_get("some key", $value) == 0 ;
@@ -136,7 +136,7 @@ if(1)
my $lex = new LexFile $Dfile ;
# create a recno database
- ok my $db = new BerkeleyDB::Recno -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Recno -Filename => $Dfile,
-Flags => DB_CREATE ;
# Add a few k/v pairs
@@ -150,7 +150,7 @@ if(1)
# now open it with Unknown
# create a hash database
- ok $db = new BerkeleyDB::Unknown -Filename => $Dfile;
+ ok $db = new BerkeleyDB::Unknown -Filename => $Dfile;
ok $db->type() == DB_RECNO ;
ok $db->db_get(0, $value) == 0 ;
@@ -180,7 +180,7 @@ SKIP:
my $lex = new LexFile $Dfile ;
# create a hash database
- ok my $db = new BerkeleyDB::Heap -Filename => $Dfile,
+ ok my $db = new BerkeleyDB::Heap -Filename => $Dfile,
-Flags => DB_CREATE ;
# Add a few k/v pairs
@@ -196,10 +196,10 @@ SKIP:
# now open it with Unknown
# create a hash database
- ok $db = new BerkeleyDB::Unknown -Filename => $Dfile;
+ ok $db = new BerkeleyDB::Unknown -Filename => $Dfile;
ok $db->type() == DB_HEAP ;
- ok $db->db_get($key1, $value) == 0
+ ok $db->db_get($key1, $value) == 0
or diag "Cannot db_get: [$!][$BerkeleyDB::Error]\n" ;
ok $value eq "some value" ;
ok $db->db_get($key2, $value) == 0 ;
diff --git a/t/util.pm b/t/util.pm
index 3a683c0..97b2eb9 100644
--- a/t/util.pm
+++ b/t/util.pm
@@ -33,7 +33,7 @@ $FA = 0 ;
{
sub try::TIEARRAY { bless [], "try" }
sub try::FETCHSIZE { $FA = 1 }
- my @a ;
+ my @a ;
tie @a, 'try' ;
my $a = @a ;
}
@@ -83,15 +83,15 @@ $FA = 0 ;
{
my $self = shift ;
my $dir = shift ;
-
+
rmtree $dir if -e $dir ;
-
+
mkdir $dir, 0777 or return undef ;
return bless [ $dir ], $self ;
}
-
- sub DESTROY
+
+ sub DESTROY
{
my $self = shift ;
my $dir = $self->[0];
@@ -152,7 +152,7 @@ sub docat
}
sub docat_del
-{
+{
my $file = shift;
local $/ = undef;
open(CAT,$file) || die "Cannot open $file: $!";
@@ -161,10 +161,10 @@ sub docat_del
unlink $file ;
$result = normalise($result);
return $result;
-}
+}
sub docat_del_sort
-{
+{
my $file = shift;
open(CAT,$file) || die "Cannot open $file: $!";
my @got = <CAT>;
@@ -175,7 +175,7 @@ sub docat_del_sort
unlink $file ;
$result = normalise($result);
return $result;
-}
+}
sub readFile
{
diff --git a/typemap b/typemap
index 829a780..36b2e3b 100644
--- a/typemap
+++ b/typemap
@@ -1,12 +1,12 @@
# typemap for Perl 5 interface to Berkeley DB version 2 & 3
#
-# SCCS: %I%, %G%
+# SCCS: %I%, %G%
#
# written by Paul Marquess <pmqs@cpan.org>
#
#################################### DB SECTION
#
-#
+#
SVnull* T_SV_NULL
void * T_PV
@@ -175,8 +175,8 @@ T_PV_64
T_IO_NULL
if ($arg == &PL_sv_undef)
- $var = NULL ;
- else
+ $var = NULL ;
+ else
$var = IoOFP(sv_2io($arg))
T_PTROBJ_NULL
@@ -217,8 +217,8 @@ T_dbtkeydatum
DBT_clear($var) ;
SvGETMAGIC($arg) ;
if (db->recno_or_queue) {
- Value = GetRecnoKey(db, SvIV(my_sv)) ;
- $var.data = & Value;
+ Value = GetRecnoKey(db, SvIV(my_sv)) ;
+ $var.data = & Value;
$var.size = (int)sizeof(db_recno_t);
}
else {
@@ -251,8 +251,8 @@ T_dbtkeydatum_btree
SvGETMAGIC($arg) ;
if (db->recno_or_queue ||
(db->type == DB_BTREE && flagSet(DB_SET_RECNO))) {
- Value = GetRecnoKey(db, SvIV(my_sv)) ;
- $var.data = & Value;
+ Value = GetRecnoKey(db, SvIV(my_sv)) ;
+ $var.data = & Value;
$var.size = (int)sizeof(db_recno_t);
}
else {
@@ -292,10 +292,10 @@ T_dbtkeydatum_btree_r
DBM_ckFilter(my_sv, filter_store_key, \"filter_store_key\");
DBT_clear($var) ;
SvGETMAGIC($arg) ;
- if (db->recno_or_queue ||
+ if (db->recno_or_queue ||
(db->type == DB_BTREE && flagSet(DB_SET_RECNO))) {
- Value = GetRecnoKey(db, SvIV(my_sv)) ;
- $var.data = & Value;
+ Value = GetRecnoKey(db, SvIV(my_sv)) ;
+ $var.data = & Value;
$var.size = (int)sizeof(db_recno_t);
}
else {
@@ -313,10 +313,10 @@ T_dbtkeydatum_btree_pr
DBM_ckFilter(my_sv, filter_store_key, \"filter_store_key\");
DBT_clear($var) ;
SvGETMAGIC($arg) ;
- if (db->recno_or_queue ||
+ if (db->recno_or_queue ||
(db->type == DB_BTREE && flagSet(DB_SET_RECNO))) {
- Value = GetRecnoKey(db, SvIV(my_sv)) ;
- $var.data = & Value;
+ Value = GetRecnoKey(db, SvIV(my_sv)) ;
+ $var.data = & Value;
$var.size = (int)sizeof(db_recno_t);
}
else {
@@ -344,7 +344,7 @@ T_dbtdatum
$var.dlen = db->dlen ;
$var.doff = db->doff ;
}
-
+
T_dbtdatum_opt
DBT_clear($var) ;
if (flagSetBoth()) {
@@ -358,7 +358,7 @@ T_dbtdatum_opt
$var.dlen = db->dlen ;
$var.doff = db->doff ;
}
-
+
T_dbtdatum_btree
DBT_clear($var) ;
if (flagSetBoth()) {
@@ -372,7 +372,7 @@ T_dbtdatum_btree
$var.dlen = db->dlen ;
$var.doff = db->doff ;
}
-
+
OUTPUT
Debdiff
[The following lists of changes regard files as different if they have different names, permissions or owners.]
Files in second set of .debs but not in first
-rw-r--r-- root/root /usr/lib/debug/.build-id/31/4a2fbcd15fb20a2ca71b125e1405307c3aab70.debug
Files in first set of .debs but not in second
-rw-r--r-- root/root /usr/lib/debug/.build-id/dc/8b20193129a1deb3c434a66f22cfda77b1a805.debug
Control files of package libberkeleydb-perl: lines which differ (wdiff format)
Depends: libc6 (>= 2.14), libdb5.3, perl (>= 5.36.0-7), 5.36.0-6), perlapi-5.36.0
Control files of package libberkeleydb-perl-dbgsym: lines which differ (wdiff format)
Build-Ids: dc8b20193129a1deb3c434a66f22cfda77b1a805 314a2fbcd15fb20a2ca71b125e1405307c3aab70