summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Marquess <paul.marquess@btinternet.com>1999-03-14 14:43:57 +0000
committerJarkko Hietaniemi <jhi@iki.fi>1999-03-16 14:23:54 +0000
commit5a4724ee428f7c08669162fcb68dee455ffa09d6 (patch)
tree0c56126d9135198cb235442e00c615348fdb6ec9
parent4f2cd770c453b4914c856ae1a1dccb985c345857 (diff)
downloadperl-5a4724ee428f7c08669162fcb68dee455ffa09d6.tar.gz
Upgrade DB_File to version 1.65
To: Gurusamy Sarathy <gsar@activestate.com>, Graham Barr <gbarr@pobox.com> Cc: Perl5 Porters <perl5-porters@perl.org>, "Paul.Marquess" <Paul.Marquess@btinternet.com> Message-Id: <199903141841.NAA17040@defender.perl.org> p4raw-id: //depot/maint-5.005/perl@3115
-rw-r--r--ext/DB_File/Changes3
-rw-r--r--ext/DB_File/DB_File.pm6
-rw-r--r--ext/DB_File/DB_File.xs39
-rw-r--r--ext/DB_File/typemap2
4 files changed, 25 insertions, 25 deletions
diff --git a/ext/DB_File/Changes b/ext/DB_File/Changes
index c71d5b8c34..2fab919229 100644
--- a/ext/DB_File/Changes
+++ b/ext/DB_File/Changes
@@ -229,3 +229,6 @@
mapping problem with O_RDONLY on the Hurd
* Updated the message that db-recno.t prints when tests 51, 53 or 55 fail.
+1.65 6th March 1999
+ * Fixed a bug in the recno PUSH logic.
+ * The BOOT version check now needs 2.3.4 when using Berkeley DB version 2
diff --git a/ext/DB_File/DB_File.pm b/ext/DB_File/DB_File.pm
index 738de7ce85..e5759ff558 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 21st February 1999
-# version 1.64
+# last modified 6th March 1999
+# version 1.65
#
# Copyright (c) 1995-9 Paul Marquess. All rights reserved.
# This program is free software; you can redistribute it and/or
@@ -145,7 +145,7 @@ use vars qw($VERSION @ISA @EXPORT $AUTOLOAD $DB_BTREE $DB_HASH $DB_RECNO $db_ver
use Carp;
-$VERSION = "1.64" ;
+$VERSION = "1.65" ;
#typedef enum { DB_BTREE, DB_HASH, DB_RECNO } DBTYPE;
$DB_BTREE = new DB_File::BTREEINFO ;
diff --git a/ext/DB_File/DB_File.xs b/ext/DB_File/DB_File.xs
index 540fa9cd97..94113eb4e2 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 <Paul.Marquess@btinternet.com>
- last modified 21st February 1999
- version 1.64
+ last modified 6th March 1999
+ version 1.65
All comments/suggestions/problems are welcome
@@ -63,6 +63,8 @@
1.64 - Tidied up the 1.x to 2.x flags mapping code.
Added a patch from Mark Kettenis <kettenis@wins.uva.nl>
to fix a flag mapping problem with O_RDONLY on the Hurd
+ 1.65 - Fixed a bug in the PUSH logic.
+ Added BOOT check that using 2.3.4 or greater
@@ -346,9 +348,9 @@ GetVersionInfo()
(void)db_version(&Major, &Minor, &Patch) ;
- /* check that libdb is recent enough */
- if (Major == 2 && Minor == 0 && Patch < 5)
- croak("DB_File needs Berkeley DB 2.0.5 or greater, you have %d.%d.%d\n",
+ /* check that libdb is recent enough -- we need 2.3.4 or greater */
+ if (Major == 2 && (Minor < 3 || (Minor == 3 && Patch < 4)))
+ croak("DB_File needs Berkeley DB 2.3.4 or greater, you have %d.%d.%d\n",
Major, Minor, Patch) ;
#if PERL_VERSION > 3
@@ -1228,7 +1230,6 @@ db_FIRSTKEY(db)
{
DBTKEY key ;
DBT value ;
- DB * Db = db->dbp ;
DBT_flags(key) ;
DBT_flags(value) ;
@@ -1245,7 +1246,6 @@ db_NEXTKEY(db, key)
CODE:
{
DBT value ;
- DB * Db = db->dbp ;
DBT_flags(value) ;
CurrentDB = db ;
@@ -1308,7 +1308,6 @@ pop(db)
{
DBTKEY key ;
DBT value ;
- DB * Db = db->dbp ;
DBT_flags(key) ;
DBT_flags(value) ;
@@ -1336,7 +1335,6 @@ shift(db)
{
DBT value ;
DBTKEY key ;
- DB * Db = db->dbp ;
DBT_flags(key) ;
DBT_flags(value) ;
@@ -1363,7 +1361,6 @@ push(db, ...)
CODE:
{
DBTKEY key ;
- DBTKEY * keyptr = &key ;
DBT value ;
DB * Db = db->dbp ;
int i ;
@@ -1372,34 +1369,34 @@ push(db, ...)
DBT_flags(key) ;
DBT_flags(value) ;
CurrentDB = db ;
- /* Set the Cursor to the Last element */
- RETVAL = do_SEQ(db, key, value, R_LAST) ;
- if (RETVAL >= 0)
- {
- if (RETVAL == 1)
- keyptr = &empty ;
#ifdef DB_VERSION_MAJOR
+ RETVAL = 0 ;
+ key = empty ;
for (i = 1 ; i < items ; ++i)
{
-
- ++ (* (int*)key.data) ;
value.data = SvPV(ST(i), n_a) ;
value.size = n_a ;
- RETVAL = (Db->put)(Db, NULL, &key, &value, 0) ;
+ RETVAL = (Db->put)(Db, NULL, &key, &value, DB_APPEND) ;
if (RETVAL != 0)
break;
}
#else
+ /* Set the Cursor to the Last element */
+ RETVAL = do_SEQ(db, key, value, R_LAST) ;
+ if (RETVAL >= 0)
+ {
+ if (RETVAL == 1)
+ key = empty ;
for (i = items - 1 ; i > 0 ; --i)
{
value.data = SvPV(ST(i), n_a) ;
value.size = n_a ;
- RETVAL = (Db->put)(Db, keyptr, &value, R_IAFTER) ;
+ RETVAL = (Db->put)(Db, &key, &value, R_IAFTER) ;
if (RETVAL != 0)
break;
}
-#endif
}
+#endif
}
OUTPUT:
RETVAL
diff --git a/ext/DB_File/typemap b/ext/DB_File/typemap
index 3463ec0b0f..994ba27232 100644
--- a/ext/DB_File/typemap
+++ b/ext/DB_File/typemap
@@ -2,7 +2,7 @@
#
# written by Paul Marquess <Paul.Marquess@btinternet.com>
# last modified 21st February 1999
-# version 1.64
+# version 1.65
#
#################################### DB SECTION
#