This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
DB_File 1.803
authorPaul Marquess <paul.marquess@btinternet.com>
Sat, 2 Mar 2002 14:33:32 +0000 (14:33 +0000)
committerAbhijit Menon-Sen <ams@wiw.org>
Sat, 2 Mar 2002 13:54:35 +0000 (13:54 +0000)
   From: "Paul Marquess" <paul_marquess@yahoo.co.uk>
   Message-Id: <AIEAJICLCBDNAAOLLOKLAEHGDOAA.paul_marquess@yahoo.co.uk>

p4raw-id: //depot/perl@14944

ext/DB_File/Changes
ext/DB_File/DB_File.pm
ext/DB_File/DB_File.xs
ext/DB_File/t/db-btree.t

index 6676d8a..409f62f 100644 (file)
 
    * 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.
+
index 3d3efbb..1e29090 100644 (file)
@@ -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<seq> 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<tree> 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<THE API INTERFACE>).
 
     use warnings ;
     use strict ;
-    our (@h, $H, $file, $i) ;
+    my (@h, $H, $file, $i) ;
     use DB_File ;
     use Fcntl ;
 
@@ -2004,7 +2004,7 @@ F<authors/id/TOMC/scripts/nshist.gz>).
     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";
index 26e2160..fc2f63e 100644 (file)
@@ -3,8 +3,8 @@
  DB_File.xs -- 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
 
  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.
 
 */
 
 #    undef __attribute__
 #endif
 
-
-
 #ifdef COMPAT185
 #    include <db_185.h>
 #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)
index ef05de6..74b0cba 100755 (executable)
@@ -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
     {