From: Paul Marquess Date: Sat, 2 Mar 2002 14:33:32 +0000 (+0000) Subject: DB_File 1.803 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=962cee9facffd14ed2b33ddb0626baaefda942b8;p=p5sagit%2Fp5-mst-13.2.git DB_File 1.803 From: "Paul Marquess" Message-Id: p4raw-id: //depot/perl@14944 --- diff --git a/ext/DB_File/Changes b/ext/DB_File/Changes index 6676d8a..409f62f 100644 --- a/ext/DB_File/Changes +++ b/ext/DB_File/Changes @@ -395,10 +395,18 @@ * Added "clean" attribute to Makefile.PL -1.802 6th January 2001 +1.802 6th January 2002 * The message about some test failing in db-recno.t had the wrong test numbers. Fixed. * merged core patch 13942. +1.803 1st March 2002 + + * Fixed a problem with db-btree.t where it complained about an "our" + variable redeclaation. + + * FETCH, STORE & DELETE don't map the flags parameter into the + equivalent Berkeley DB function anymore. + diff --git a/ext/DB_File/DB_File.pm b/ext/DB_File/DB_File.pm index 3d3efbb..1e29090 100644 --- a/ext/DB_File/DB_File.pm +++ b/ext/DB_File/DB_File.pm @@ -1,8 +1,8 @@ # DB_File.pm -- Perl 5 interface to Berkeley DB # # written by Paul Marquess (Paul.Marquess@btinternet.com) -# last modified 6th Jan 2002 -# version 1.802 +# last modified 1st March 2002 +# version 1.803 # # Copyright (c) 1995-2002 Paul Marquess. All rights reserved. # This program is free software; you can redistribute it and/or @@ -150,7 +150,7 @@ our ($db_version, $use_XSLoader); use Carp; -$VERSION = "1.802" ; +$VERSION = "1.803" ; #typedef enum { DB_BTREE, DB_HASH, DB_RECNO } DBTYPE; $DB_BTREE = new DB_File::BTREEINFO ; @@ -978,7 +978,7 @@ code: use strict ; use DB_File ; - our ($filename, %h) ; + my ($filename, %h) ; $filename = "tree" ; unlink $filename ; @@ -1033,7 +1033,7 @@ Here is the script above rewritten using the C API method. use strict ; use DB_File ; - our ($filename, $x, %h, $status, $key, $value) ; + my ($filename, $x, %h, $status, $key, $value) ; $filename = "tree" ; unlink $filename ; @@ -1105,7 +1105,7 @@ this: use strict ; use DB_File ; - our ($filename, $x, %h) ; + my ($filename, $x, %h) ; $filename = "tree" ; @@ -1155,7 +1155,7 @@ Assuming the database from the previous example: use strict ; use DB_File ; - our ($filename, $x, %h, $found) ; + my ($filename, $x, %h, $found) ; $filename = "tree" ; @@ -1194,7 +1194,7 @@ Again assuming the existence of the C database use strict ; use DB_File ; - our ($filename, $x, %h, $found) ; + my ($filename, $x, %h, $found) ; $filename = "tree" ; @@ -1240,7 +1240,7 @@ and print the first matching key/value pair given a partial key. use DB_File ; use Fcntl ; - our ($filename, $x, %h, $st, $key, $value) ; + my ($filename, $x, %h, $st, $key, $value) ; sub match { @@ -1439,7 +1439,7 @@ L). use warnings ; use strict ; - our (@h, $H, $file, $i) ; + my (@h, $H, $file, $i) ; use DB_File ; use Fcntl ; @@ -2004,7 +2004,7 @@ F). use DB_File ; use Fcntl ; - our ($dotdir, $HISTORY, %hist_db, $href, $binary_time, $date) ; + my ($dotdir, $HISTORY, %hist_db, $href, $binary_time, $date) ; $dotdir = $ENV{HOME} || $ENV{LOGNAME}; $HISTORY = "$dotdir/.netscape/history.db"; diff --git a/ext/DB_File/DB_File.xs b/ext/DB_File/DB_File.xs index 26e2160..fc2f63e 100644 --- a/ext/DB_File/DB_File.xs +++ b/ext/DB_File/DB_File.xs @@ -3,8 +3,8 @@ DB_File.xs -- Perl 5 interface to Berkeley DB written by Paul Marquess - last modified 6th Jan 2002 - version 1.802 + last modified 1st March 2002 + version 1.803 All comments/suggestions/problems are welcome @@ -99,6 +99,8 @@ Use the new constants code. 1.801 - No change to DB_File.xs 1.802 - No change to DB_File.xs + 1.803 - FETCH, STORE & DELETE don't map the flags parameter + into the equivalent Berkeley DB function anymore. */ @@ -123,8 +125,6 @@ # undef __attribute__ #endif - - #ifdef COMPAT185 # include #else @@ -327,9 +327,9 @@ typedef union INFO { -#define db_DELETE(db, key, flags) ((db->dbp)->del)(db->dbp, TXN &key, flags) -#define db_STORE(db, key, value, flags) ((db->dbp)->put)(db->dbp, TXN &key, &value, flags) -#define db_FETCH(db, key, flags) ((db->dbp)->get)(db->dbp, TXN &key, &value, flags) +#define db_DELETE(db, key, flags) ((db->dbp)->del)(db->dbp, TXN &key, 0) +#define db_STORE(db, key, value, flags) ((db->dbp)->put)(db->dbp, TXN &key, &value, 0) +#define db_FETCH(db, key, flags) ((db->dbp)->get)(db->dbp, TXN &key, &value, 0) #define db_sync(db, flags) ((db->dbp)->sync)(db->dbp, flags) #define db_get(db, key, value, flags) ((db->dbp)->get)(db->dbp, TXN &key, &value, flags) diff --git a/ext/DB_File/t/db-btree.t b/ext/DB_File/t/db-btree.t index ef05de6..74b0cba 100755 --- a/ext/DB_File/t/db-btree.t +++ b/ext/DB_File/t/db-btree.t @@ -958,7 +958,7 @@ EOM use strict ; use DB_File ; - our ($filename, %h); + my ($filename, %h); $filename = "tree" ; unlink $filename ; @@ -1010,7 +1010,7 @@ EOM use strict ; use DB_File ; - our ($filename, $x, %h, $status, $key, $value); + my ($filename, $x, %h, $status, $key, $value); $filename = "tree" ; unlink $filename ; @@ -1066,7 +1066,7 @@ EOM use strict ; use DB_File ; - our ($filename, $x, %h); + my ($filename, $x, %h); $filename = "tree" ; @@ -1115,7 +1115,7 @@ EOM use strict ; use DB_File ; - our ($filename, $x, %h, $found); + my ($filename, $x, %h, $found); $filename = "tree" ; @@ -1150,7 +1150,7 @@ EOM use strict ; use DB_File ; - our ($filename, $x, %h, $found); + my ($filename, $x, %h, $found); $filename = "tree" ; @@ -1186,7 +1186,7 @@ EOM use DB_File ; use Fcntl ; - our ($filename, $x, %h, $st, $key, $value); + my ($filename, $x, %h, $st, $key, $value); sub match {