summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/DB_File/Changes8
-rw-r--r--ext/DB_File/DB_File.pm6
-rw-r--r--ext/DB_File/DB_File.xs28
-rw-r--r--ext/DB_File/hints/dynixptx.pl3
-rw-r--r--ext/DynaLoader/dl_mpeix.xs11
-rw-r--r--ext/POSIX/hints/dynixptx.pl4
-rw-r--r--ext/Socket/Socket.pm20
-rw-r--r--ext/Socket/Socket.xs112
8 files changed, 173 insertions, 19 deletions
diff --git a/ext/DB_File/Changes b/ext/DB_File/Changes
index 993fe3228c..e13178c4e8 100644
--- a/ext/DB_File/Changes
+++ b/ext/DB_File/Changes
@@ -203,3 +203,11 @@
1.60
Changed the test to check for full tied array support
+
+1.61 19th November 1998
+
+ Added a note to README about how to build Berkeley DB 2.x when
+ using HP-UX.
+ Minor modifications to get the module to build with DB 2.5.x
+ Fixed a typo in the definition of O_RDONLY, courtesy of Mark Kettenis.
+
diff --git a/ext/DB_File/DB_File.pm b/ext/DB_File/DB_File.pm
index fcd0746a5e..3d3b9ff854 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 16th May 1998
-# version 1.60
+# last modified 19th November 1998
+# version 1.61
#
# Copyright (c) 1995-8 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.60" ;
+$VERSION = "1.61" ;
#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 c661023a33..5856f4f862 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 16th May 1998
- version 1.60
+ last modified 19th November 1998
+ version 1.61
All comments/suggestions/problems are welcome
@@ -56,6 +56,8 @@
This was ok for DB 1.x, but isn't for DB 2.x.
1.59 - No change to DB_File.xs
1.60 - Some code tidy up
+ 1.61 - added flagSet macro for DB 2.5.x
+ fixed typo in O_RDONLY test.
@@ -153,6 +155,12 @@ typedef db_recno_t recno_t;
#define DBT_flags(x) x.flags = 0
#define DB_flags(x, v) x |= v
+#if DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR < 5
+#define flagSet(flags, bitmask) ((flags) & (bitmask))
+#else
+#define flagSet(flags, bitmask) (((flags) & DB_OPFLAGS_MASK) == (bitmask))
+#endif
+
#else /* db version 1.x */
typedef union INFO {
@@ -205,6 +213,7 @@ typedef union INFO {
#define do_SEQ(db, key, value, flag) (db->dbp->seq)(db->dbp, &key, &value, flag)
#define DBT_flags(x)
#define DB_flags(x, v)
+#define flagSet(flags, bitmask) ((flags) & (bitmask))
#endif /* db version 1 */
@@ -216,10 +225,11 @@ typedef union INFO {
#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)
+
#ifdef DB_VERSION_MAJOR
#define db_DESTROY(db) ((db->dbp)->close)(db->dbp, 0)
#define db_close(db) ((db->dbp)->close)(db->dbp, 0)
-#define db_del(db, key, flags) ((flags & R_CURSOR) \
+#define db_del(db, key, flags) (flagSet(flags, R_CURSOR) \
? ((db->cursor)->c_del)(db->cursor, 0) \
: ((db->dbp)->del)(db->dbp, NULL, &key, flags) )
@@ -232,6 +242,7 @@ typedef union INFO {
#endif
+
#define db_seq(db, key, value, flags) do_SEQ(db, key, value, flags)
typedef struct {
@@ -288,12 +299,17 @@ u_int flags ;
{
int status ;
- if (flags & R_CURSOR) {
+ if (flagSet(flags, R_CURSOR)) {
status = ((db->cursor)->c_del)(db->cursor, 0);
if (status != 0)
return status ;
+#if DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR < 5
flags &= ~R_CURSOR ;
+#else
+ flags &= ~DB_OPFLAGS_MASK ;
+#endif
+
}
return ((db->dbp)->put)(db->dbp, NULL, &key, &value, flags) ;
@@ -808,7 +824,7 @@ SV * sv ;
#if O_RDONLY == 0
if (flags == O_RDONLY)
#else
- if (flags & O_RDONLY) == O_RDONLY)
+ if ((flags & O_RDONLY) == O_RDONLY)
#endif
Flags |= DB_RDONLY ;
@@ -1436,7 +1452,7 @@ db_put(db, key, value, flags=0)
#endif
OUTPUT:
RETVAL
- key if (flags & (R_IAFTER|R_IBEFORE)) OutputKey(ST(1), key);
+ key if (flagSet(flags, R_IAFTER) || flagSet(flags, R_IBEFORE)) OutputKey(ST(1), key);
int
db_fd(db)
diff --git a/ext/DB_File/hints/dynixptx.pl b/ext/DB_File/hints/dynixptx.pl
new file mode 100644
index 0000000000..bb5ffa56e6
--- /dev/null
+++ b/ext/DB_File/hints/dynixptx.pl
@@ -0,0 +1,3 @@
+# Need to add an extra '-lc' to the end to work around a DYNIX/ptx bug
+
+$self->{LIBS} = ['-lm -lc'];
diff --git a/ext/DynaLoader/dl_mpeix.xs b/ext/DynaLoader/dl_mpeix.xs
index 808c3b0f19..4cc07ec4c3 100644
--- a/ext/DynaLoader/dl_mpeix.xs
+++ b/ext/DynaLoader/dl_mpeix.xs
@@ -2,6 +2,7 @@
* Author: Mark Klein (mklein@dis.com)
* Version: 2.1, 1996/07/25
* Version: 2.2, 1997/09/25 Mark Bixby (markb@cccd.edu)
+ * Version: 2.3, 1998/11/19 Mark Bixby (markb@cccd.edu)
*/
#include "EXTERN.h"
@@ -59,13 +60,13 @@ flags));
",filename);
obj = (p_mpe_dld) safemalloc(sizeof(t_mpe_dld));
memzero(obj, sizeof(t_mpe_dld));
- if (filename[0] == '.')
+ if (filename[0] != '/')
{
getcwd(buf,sizeof(buf));
- sprintf(obj->filename,"$%s/%s$",buf,filename);
+ sprintf(obj->filename," %s/%s ",buf,filename);
}
else
- sprintf(obj->filename,"$%s$",filename);
+ sprintf(obj->filename," %s ",filename);
DLDEBUG(2,PerlIO_printf(PerlIO_stderr()," libref=%x\n", obj));
@@ -90,11 +91,11 @@ dl_find_symbol(libhandle, symbolname)
ST(0) = sv_newmortal() ;
errno = 0;
- sprintf(symname, "$%s$", symbolname);
+ sprintf(symname, " %s ", symbolname);
HPGETPROCPLABEL(8, symname, &symaddr, &status, obj->filename, 1,
0, &datalen, 1, 0, 0);
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr()," symbolref(PROCEDURE) = %x\n", symaddr));
+ DLDEBUG(2,PerlIO_printf(PerlIO_stderr()," symbolref(PROCEDURE) = %x, status=%x\n", symaddr, status));
if (status != 0) {
SaveError("%s",(errno) ? Strerror(errno) : "Symbol not found") ;
diff --git a/ext/POSIX/hints/dynixptx.pl b/ext/POSIX/hints/dynixptx.pl
new file mode 100644
index 0000000000..05cf0f8765
--- /dev/null
+++ b/ext/POSIX/hints/dynixptx.pl
@@ -0,0 +1,4 @@
+# Need to add an extra '-lc' to the end to work around a DYNIX/ptx bug
+# PR#227670 - linker error on fpgetround()
+
+$self->{LIBS} = ['-ldb -lc'];
diff --git a/ext/Socket/Socket.pm b/ext/Socket/Socket.pm
index 5a4870f4af..1ed19f713d 100644
--- a/ext/Socket/Socket.pm
+++ b/ext/Socket/Socket.pm
@@ -193,10 +193,25 @@ require DynaLoader;
AF_UNIX
AF_UNSPEC
AF_X25
+ MSG_CTLFLAGS
+ MSG_CTLIGNORE
+ MSG_CTRUNC
MSG_DONTROUTE
+ MSG_DONTWAIT
+ MSG_EOF
+ MSG_EOR
+ MSG_ERRQUEUE
+ MSG_FIN
MSG_MAXIOVLEN
+ MSG_NOSIGNAL
MSG_OOB
MSG_PEEK
+ MSG_PROXY
+ MSG_RST
+ MSG_SYN
+ MSG_TRUNC
+ MSG_URG
+ MSG_WAITALL
PF_802
PF_APPLETALK
PF_CCITT
@@ -221,6 +236,11 @@ require DynaLoader;
PF_UNIX
PF_UNSPEC
PF_X25
+ SCM_CONNECT
+ SCM_CREDENTIALS
+ SCM_CREDS
+ SCM_RIGHTS
+ SCM_TIMESTAMP
SOCK_DGRAM
SOCK_RAW
SOCK_RDM
diff --git a/ext/Socket/Socket.xs b/ext/Socket/Socket.xs
index de0217bdb4..1c541d7cef 100644
--- a/ext/Socket/Socket.xs
+++ b/ext/Socket/Socket.xs
@@ -330,42 +330,114 @@ constant(char *name, int arg)
case 'L':
break;
case 'M':
+ if (strEQ(name, "MSG_CTLFLAGS"))
+#ifdef MSG_CTLFLAGS
+ return MSG_CTLFLAGS;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "MSG_CTLIGNORE"))
+#ifdef MSG_CTLIGNORE
+ return MSG_CTLIGNORE;
+#else
+ goto not_there;
+#endif
if (strEQ(name, "MSG_CTRUNC"))
-#if defined(MSG_CTRUNC) || defined(HAS_GNULIBC) /* XXX it's an enum */
+#if defined(MSG_TRUNC) || defined(HAS_MSG_CTRUNC) /* might be an enum */
return MSG_CTRUNC;
#else
goto not_there;
#endif
if (strEQ(name, "MSG_DONTROUTE"))
-#if defined(MSG_DONTROUTE) || defined(HAS_GNULIBC) /* XXX it's an enum */
+#if defined(MSG_DONTROUTE) || defined(HAS_MSG_DONTROUTE) /* might be an enum */
return MSG_DONTROUTE;
#else
goto not_there;
#endif
+ if (strEQ(name, "MSG_DONTWAIT"))
+#ifdef MSG_DONTWAIT
+ return MSG_DONTWAIT;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "MSG_EOF"))
+#ifdef MSG_EOF
+ return MSG_EOF;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "MSG_EOR"))
+#ifdef MSG_EOR
+ return MSG_EOR;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "MSG_ERRQUEUE"))
+#ifdef MSG_ERRQUEUE
+ return MSG_ERRQUEUE;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "MSG_FIN"))
+#ifdef MSG_FIN
+ return MSG_FIN;
+#else
+ goto not_there;
+#endif
if (strEQ(name, "MSG_MAXIOVLEN"))
#ifdef MSG_MAXIOVLEN
return MSG_MAXIOVLEN;
#else
goto not_there;
#endif
+ if (strEQ(name, "MSG_NOSIGNAL"))
+#ifdef MSG_NOSIGNAL
+ return MSG_NOSIGNAL;
+#else
+ goto not_there;
+#endif
if (strEQ(name, "MSG_OOB"))
-#if defined(MSG_OOB) || defined(HAS_GNULIBC) /* XXX it's an enum */
+#if defined(MSG_OOB) || defined(HAS_MSG_OOB) /* might be an enum */
return MSG_OOB;
#else
goto not_there;
#endif
if (strEQ(name, "MSG_PEEK"))
-#if defined(MSG_PEEK) || defined(HAS_GNULIBC) /* XXX it's an enum */
+#if defined(MSG_PEEK) || defined(HAS_MSG_PEEK) /* might be an enum */
return MSG_PEEK;
#else
goto not_there;
#endif
if (strEQ(name, "MSG_PROXY"))
-#if defined(MSG_PROXY) || defined(HAS_GNULIBC) /* XXX it's an enum */
+#if defined(MSG_PROXY) || defined(HAS_MSG_PROXY) /* might be an enum */
return MSG_PROXY;
#else
goto not_there;
#endif
+ if (strEQ(name, "MSG_RST"))
+#ifdef MSG_RST
+ return MSG_RST;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "MSG_SYN"))
+#ifdef MSG_SYN
+ return MSG_SYN;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "MSG_TRUNC"))
+#ifdef MSG_TRUNC
+ return MSG_TRUNC;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "MSG_WAITALL"))
+#ifdef MSG_WAITALL
+ return MSG_WAITALL;
+#else
+ goto not_there;
+#endif
break;
case 'N':
break;
@@ -522,6 +594,36 @@ constant(char *name, int arg)
case 'R':
break;
case 'S':
+ if (strEQ(name, "SCM_CONNECT"))
+#ifdef SCM_CONNECT
+ return SCM_CONNECT;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "SCM_CREDENTIALS"))
+#ifdef SCM_CREDENTIALS
+ return SCM_CREDENTIALSS;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "SCM_CREDS"))
+#ifdef SCM_CREDS
+ return SCM_CREDS;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "SCM_RIGHTS"))
+#if defined(SCM_RIGHTS) || defined(HAS_SCM_RIGHTS) /* might be an enum */
+ return SCM_RIGHTS;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "SCM_TIMESTAMP"))
+#ifdef SCM_TIMESTAMP
+ return SCM_TIMESTAMP;
+#else
+ goto not_there;
+#endif
if (strEQ(name, "SOCK_DGRAM"))
#ifdef SOCK_DGRAM
return SOCK_DGRAM;