summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-10-08 10:19:27 +0000
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-10-08 10:19:27 +0000
commit93af7a870f71dbbb13443b4087703de0221add17 (patch)
treee767c53d4d4f1783640e5410f94655e45b58b3d0 /ext
parentc116a00cf797ec2e6795338ee18b88d975e760c5 (diff)
parent2269e8ecc334a5a77bdb915666547431c0171402 (diff)
downloadperl-93af7a870f71dbbb13443b4087703de0221add17.tar.gz
Merge maint-5.004 branch (5.004_03) with mainline.
MANIFEST is out of sync. p4raw-id: //depot/perl@114
Diffstat (limited to 'ext')
-rw-r--r--ext/DB_File/DB_File.pm38
-rw-r--r--ext/DB_File/DB_File.xs17
-rw-r--r--ext/DB_File/typemap2
-rw-r--r--ext/DynaLoader/DynaLoader.pm6
-rw-r--r--ext/GDBM_File/typemap2
-rw-r--r--ext/IO/IO.xs2
-rw-r--r--ext/IO/lib/IO/File.pm23
-rw-r--r--ext/IO/lib/IO/Handle.pm4
-rw-r--r--ext/IO/lib/IO/Socket.pm3
-rw-r--r--ext/NDBM_File/typemap2
-rw-r--r--ext/ODBM_File/ODBM_File.xs2
-rw-r--r--ext/POSIX/POSIX.xs11
-rw-r--r--ext/SDBM_File/typemap2
13 files changed, 68 insertions, 46 deletions
diff --git a/ext/DB_File/DB_File.pm b/ext/DB_File/DB_File.pm
index e097046718..9ed5185c6d 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 (pmarquess@bfsec.bt.co.uk)
-# last modified 31st May 1997
-# version 1.15
+# last modified 8th Oct 1997
+# version 1.16
#
# Copyright (c) 1995, 1996, 1997 Paul Marquess. All rights reserved.
# This program is free software; you can redistribute it and/or
@@ -98,7 +98,6 @@ sub NotHere
croak ref($self) . " does not define the method ${method}" ;
}
-sub DESTROY { undef %{$_[0]} }
sub FIRSTKEY { my $self = shift ; $self->NotHere("FIRSTKEY") }
sub NEXTKEY { my $self = shift ; $self->NotHere("NEXTKEY") }
sub CLEAR { my $self = shift ; $self->NotHere("CLEAR") }
@@ -212,17 +211,13 @@ sub AUTOLOAD {
}
-# import borrowed from IO::File
-# exports Fcntl constants if available.
-sub import {
- my $pkg = shift;
- my $callpkg = caller;
- Exporter::export $pkg, $callpkg, @_;
- eval {
- require Fcntl;
- Exporter::export 'Fcntl', $callpkg, '/^O_/';
- };
-}
+eval {
+ # Make all Fcntl O_XXX constants available for importing
+ require Fcntl;
+ my @O = grep /^O_/, @Fcntl::EXPORT;
+ Fcntl->import(@O); # first we import what we want to export
+ push(@EXPORT, @O);
+};
bootstrap DB_File $VERSION;
@@ -1668,6 +1663,21 @@ ordinary array to a HASH or BTREE database.
=item 1.15
+Patch from Gisle Aas <gisle@aas.no> to suppress "use of undefined
+value" warning with db_get and db_seq.
+
+Patch from Gisle Aas <gisle@aas.no> to make DB_File export only the O_*
+constants from Fcntl.
+
+Removed the DESTROY method from the DB_File::HASHINFO module.
+
+Previously DB_File hard-wired the class name of any object that it
+created to "DB_File". This makes sub-classing difficult. Now DB_File
+creats objects in the namespace of the package it has been inherited
+into.
+
+=item 1.16
+
Minor changes to DB_File.xs to support multithreaded perl.
=back
diff --git a/ext/DB_File/DB_File.xs b/ext/DB_File/DB_File.xs
index cc70b5d7b9..bd0c933329 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 (pmarquess@bfsec.bt.co.uk)
- last modified 31st May 1997
- version 1.15
+ last modified 8th Oct 1997
+ version 1.16
All comments/suggestions/problems are welcome
@@ -42,7 +42,9 @@
1.13 - Tidied up a few casts.
1.14 - Made it illegal to tie an associative array to a RECNO
database and an ordinary array to a HASH or BTREE database.
- 1.15 - Minor additions to DB_File.xs to support multithreaded perl.
+ 1.15 - Patch from Gisle Aas <gisle@aas.no> to suppress "use of
+ undefined value" warning with db_get and db_seq.
+ 1.16 - Minor additions to DB_File.xs to support multithreaded perl.
*/
@@ -51,6 +53,9 @@
#include "XSUB.h"
#include <db.h>
+/* #ifdef DB_VERSION_MAJOR */
+/* #include <db_185.h> */
+/* #endif */
#include <fcntl.h>
@@ -88,7 +93,7 @@ typedef DB_File_type * DB_File ;
typedef DBT DBTKEY ;
-/* #define TRACE */
+/* #define TRACE */
#define db_DESTROY(db) ((db->dbp)->close)(db->dbp)
#define db_DELETE(db, key, flags) ((db->dbp)->del)(db->dbp, &key, flags)
@@ -1066,7 +1071,7 @@ int
db_get(db, key, value, flags=0)
DB_File db
DBTKEY key
- DBT value
+ DBT value = NO_INIT
u_int flags
INIT:
CurrentDB = db ;
@@ -1102,7 +1107,7 @@ int
db_seq(db, key, value, flags)
DB_File db
DBTKEY key
- DBT value
+ DBT value = NO_INIT
u_int flags
INIT:
CurrentDB = db ;
diff --git a/ext/DB_File/typemap b/ext/DB_File/typemap
index 5ca9c54f72..a6212243de 100644
--- a/ext/DB_File/typemap
+++ b/ext/DB_File/typemap
@@ -34,3 +34,5 @@ T_dbtkeydatum
OutputKey($arg, $var)
T_dbtdatum
OutputValue($arg, $var)
+T_PTROBJ
+ sv_setref_pv($arg, dbtype, (void*)$var);
diff --git a/ext/DynaLoader/DynaLoader.pm b/ext/DynaLoader/DynaLoader.pm
index 67043102a5..04404b7ee9 100644
--- a/ext/DynaLoader/DynaLoader.pm
+++ b/ext/DynaLoader/DynaLoader.pm
@@ -335,9 +335,9 @@ etc and also allow pseudo-dynamic linking (using C<ld -A> at runtime).
It must be stressed that the DynaLoader, by itself, is practically
useless for accessing non-Perl libraries because it provides almost no
Perl-to-C 'glue'. There is, for example, no mechanism for calling a C
-library function or supplying arguments. It is anticipated that any
-glue that may be developed in the future will be implemented in a
-separate dynamically loaded module.
+library function or supplying arguments. A ExtUtils::DynaLib module
+is available from CPAN sites which performs that function for some
+common system types.
DynaLoader Interface Summary
diff --git a/ext/GDBM_File/typemap b/ext/GDBM_File/typemap
index a6b0e5faa8..a9b73d8b81 100644
--- a/ext/GDBM_File/typemap
+++ b/ext/GDBM_File/typemap
@@ -23,3 +23,5 @@ T_DATUM
sv_setpvn($arg, $var.dptr, $var.dsize);
T_GDATUM
sv_usepvn($arg, $var.dptr, $var.dsize);
+T_PTROBJ
+ sv_setref_pv($arg, dbtype, (void*)$var);
diff --git a/ext/IO/IO.xs b/ext/IO/IO.xs
index 2eb16f40ec..e558d5c4e0 100644
--- a/ext/IO/IO.xs
+++ b/ext/IO/IO.xs
@@ -271,6 +271,8 @@ setvbuf(handle, buf, type, size)
CODE:
/* Should check HAS_SETVBUF once Configure tests for that */
#if defined(PERLIO_IS_STDIO) && defined(_IOFBF)
+ if (!handle) /* Try input stream. */
+ handle = IoIFP(sv_2io(ST(0)));
if (handle)
RETVAL = setvbuf(handle, buf, type, size);
else {
diff --git a/ext/IO/lib/IO/File.pm b/ext/IO/lib/IO/File.pm
index b1aecffb5d..de7fabc6f2 100644
--- a/ext/IO/lib/IO/File.pm
+++ b/ext/IO/lib/IO/File.pm
@@ -115,24 +115,17 @@ require DynaLoader;
@ISA = qw(IO::Handle IO::Seekable Exporter DynaLoader);
-$VERSION = "1.0602";
+$VERSION = "1.06021";
@EXPORT = @IO::Seekable::EXPORT;
-sub import {
- my $pkg = shift;
- my $callpkg = caller;
- Exporter::export $pkg, $callpkg, @_;
-
- #
- # If the Fcntl extension is available,
- # export its constants for sysopen().
- #
- eval {
- require Fcntl;
- Exporter::export 'Fcntl', $callpkg, '/^O_/';
- };
-}
+eval {
+ # Make all Fcntl O_XXX constants available for importing
+ require Fcntl;
+ my @O = grep /^O_/, @Fcntl::EXPORT;
+ Fcntl->import(@O); # first we import what we want to export
+ push(@EXPORT, @O);
+};
################################################
diff --git a/ext/IO/lib/IO/Handle.pm b/ext/IO/lib/IO/Handle.pm
index f270f3ff98..39e32f05ab 100644
--- a/ext/IO/lib/IO/Handle.pm
+++ b/ext/IO/lib/IO/Handle.pm
@@ -20,6 +20,7 @@ IO::Handle - supply object methods for I/O handles
$fh->print("Some text\n");
}
+ use IO::Handle '_IOLBF';
$fh->setvbuf($buffer_var, _IOLBF, 1024);
undef $fh; # automatically closes the file if it's open
@@ -151,7 +152,8 @@ C<_IOLBF>, and C<_IONBF> for setvbuf()--except that the buffer parameter
specifies a scalar variable to use as a buffer. WARNING: A variable
used as a buffer by C<setbuf> or C<setvbuf> must not be modified in any
way until the IO::Handle is closed or C<setbuf> or C<setvbuf> is called
-again, or memory corruption may result!
+again, or memory corruption may result! Note that you need to import
+the constants C<_IOFBF>, C<_IOLBF>, and C<_IONBF> explicitly.
Lastly, there is a special method for working under B<-T> and setuid/gid
scripts:
diff --git a/ext/IO/lib/IO/Socket.pm b/ext/IO/lib/IO/Socket.pm
index 171042cccc..ab1917031d 100644
--- a/ext/IO/lib/IO/Socket.pm
+++ b/ext/IO/lib/IO/Socket.pm
@@ -380,6 +380,7 @@ IO::Socket::INET->register_domain( AF_INET );
my %socket_type = ( tcp => SOCK_STREAM,
udp => SOCK_DGRAM,
+ icmp => SOCK_RAW,
);
=head2 IO::Socket::INET
@@ -557,7 +558,7 @@ sub configure {
}
else {
return _error($fh,'Cannot determine remote port')
- unless($rport || $type == SOCK_DGRAM);
+ unless($rport || $type == SOCK_DGRAM || $type == SOCK_RAW);
if($type == SOCK_STREAM || defined $raddr) {
return _error($fh,'Bad peer address')
diff --git a/ext/NDBM_File/typemap b/ext/NDBM_File/typemap
index a6b0e5faa8..a9b73d8b81 100644
--- a/ext/NDBM_File/typemap
+++ b/ext/NDBM_File/typemap
@@ -23,3 +23,5 @@ T_DATUM
sv_setpvn($arg, $var.dptr, $var.dsize);
T_GDATUM
sv_usepvn($arg, $var.dptr, $var.dsize);
+T_PTROBJ
+ sv_setref_pv($arg, dbtype, (void*)$var);
diff --git a/ext/ODBM_File/ODBM_File.xs b/ext/ODBM_File/ODBM_File.xs
index d23b318e0d..b57e560bd3 100644
--- a/ext/ODBM_File/ODBM_File.xs
+++ b/ext/ODBM_File/ODBM_File.xs
@@ -73,7 +73,7 @@ odbm_TIEHASH(dbtype, filename, flags, mode)
}
RETVAL = (void*)(dbminit(filename) >= 0 ? &dbmrefcnt : 0);
ST(0) = sv_mortalcopy(&sv_undef);
- sv_setptrobj(ST(0), RETVAL, "ODBM_File");
+ sv_setptrobj(ST(0), RETVAL, dbtype);
}
void
diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs
index f723db796a..a09eafe37a 100644
--- a/ext/POSIX/POSIX.xs
+++ b/ext/POSIX/POSIX.xs
@@ -40,7 +40,7 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <time.h>
-#include <unistd.h>
+#include <unistd.h> /* see hints/sunos_4_1.sh */
#include <fcntl.h>
#if defined(__VMS) && !defined(__POSIX_SOURCE)
@@ -55,7 +55,10 @@
# define mkfifo(a,b) (not_here("mkfifo"),-1)
# define tzset() not_here("tzset")
-# if __VMS_VER < 70000000
+#if ((__VMS_VER >= 70000000) && (__DECC_VER >= 50200000)) || (__CRTL_VER >= 70000000)
+# define HAS_TZNAME /* shows up in VMS 7.0 or Dec C 5.6 */
+# include <utsname.h>
+#else
/* The default VMS emulation of Unix signals isn't very POSIXish */
typedef int sigset_t;
# define sigpending(a) (not_here("sigpending"),0)
@@ -125,9 +128,7 @@
# define sa_handler sv_handler
# define sa_mask sv_mask
# define sigsuspend(set) sigpause(*set)
-# else
-# define HAS_TZNAME /* shows up in VMS 7.0 */
-# endif /* __VMS_VER < 70000000 */
+# endif /* __VMS_VER >= 70000000 or Dec C 5.6 */
/* The POSIX notion of ttyname() is better served by getname() under VMS */
static char ttnambuf[64];
diff --git a/ext/SDBM_File/typemap b/ext/SDBM_File/typemap
index a6b0e5faa8..a9b73d8b81 100644
--- a/ext/SDBM_File/typemap
+++ b/ext/SDBM_File/typemap
@@ -23,3 +23,5 @@ T_DATUM
sv_setpvn($arg, $var.dptr, $var.dsize);
T_GDATUM
sv_usepvn($arg, $var.dptr, $var.dsize);
+T_PTROBJ
+ sv_setref_pv($arg, dbtype, (void*)$var);