summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-01-17 09:02:07 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-01-17 09:02:07 +0000
commitbe59e445a231e0102a0fd9822727ddbe3e12d0bb (patch)
tree4c547e81e163e9470a1090d056d83c6a0083a308 /ext
parentf244e06d4740a118d980f79807cb4f393cc3087b (diff)
parentf828431348b2bbf6fe06182e862634247523af66 (diff)
downloadperl-be59e445a231e0102a0fd9822727ddbe3e12d0bb.tar.gz
integrate cfgperl changes into mainline, fix conflicts
p4raw-id: //depot/perl@2620
Diffstat (limited to 'ext')
-rw-r--r--ext/B/B.xs15
-rw-r--r--ext/B/B/C.pm15
-rw-r--r--ext/B/B/CC.pm18
-rw-r--r--ext/DB_File/Changes10
-rw-r--r--ext/DB_File/DB_File.pm164
-rw-r--r--ext/DB_File/DB_File.xs12
-rw-r--r--ext/DB_File/dbinfo2
-rw-r--r--ext/DB_File/typemap2
-rw-r--r--ext/DynaLoader/hints/linux.pl4
-rw-r--r--ext/IO/lib/IO/Pipe.pm4
-rw-r--r--ext/IO/lib/IO/Seekable.pm2
-rw-r--r--ext/POSIX/POSIX.pm2
-rw-r--r--ext/POSIX/POSIX.pod18
-rw-r--r--ext/POSIX/hints/mint.pl2
-rw-r--r--ext/Socket/Socket.pm4
-rw-r--r--ext/Socket/Socket.xs30
-rw-r--r--ext/re/re.pm5
17 files changed, 262 insertions, 47 deletions
diff --git a/ext/B/B.xs b/ext/B/B.xs
index e6b2f9d47b..d525e4e798 100644
--- a/ext/B/B.xs
+++ b/ext/B/B.xs
@@ -923,6 +923,7 @@ SvSTASH(sv)
#define MgTYPE(mg) mg->mg_type
#define MgFLAGS(mg) mg->mg_flags
#define MgOBJ(mg) mg->mg_obj
+#define MgLENGTH(mg) mg->mg_len
MODULE = B PACKAGE = B::MAGIC PREFIX = Mg
@@ -946,13 +947,23 @@ B::SV
MgOBJ(mg)
B::MAGIC mg
+I32
+MgLENGTH(mg)
+ B::MAGIC mg
+
void
MgPTR(mg)
B::MAGIC mg
CODE:
ST(0) = sv_newmortal();
- if (mg->mg_ptr)
- sv_setpvn(ST(0), mg->mg_ptr, mg->mg_len);
+ if (mg->mg_ptr){
+ if (mg->mg_len >= 0){
+ sv_setpvn(ST(0), mg->mg_ptr, mg->mg_len);
+ } else {
+ if (mg->mg_len == HEf_SVKEY)
+ sv_setsv(ST(0),newRV((SV*)mg->mg_ptr));
+ }
+ }
MODULE = B PACKAGE = B::PVLV PREFIX = Lv
diff --git a/ext/B/B/C.pm b/ext/B/B/C.pm
index b742bc427a..336784c8a7 100644
--- a/ext/B/B/C.pm
+++ b/ext/B/B/C.pm
@@ -103,6 +103,8 @@ sub walk_and_save_optree {
# to "know" that op_seq is a U16 and use 65535. Ugh.
my $op_seq = 65535;
+sub define HEf_SVKEY () { -2 }
+
# Look this up here so we can do just a number compare
# rather than looking up the name of every BASEOP in B::OP
my $OP_THREADSV = opnumber('threadsv');
@@ -506,19 +508,26 @@ sub B::PVMG::save_magic {
$init->add(sprintf("SvSTASH(s\\_%x) = s\\_%x;", $$sv, $$stash));
}
my @mgchain = $sv->MAGIC;
- my ($mg, $type, $obj, $ptr);
+ my ($mg, $type, $obj, $ptr,$len,$ptrsv);
foreach $mg (@mgchain) {
$type = $mg->TYPE;
$obj = $mg->OBJ;
$ptr = $mg->PTR;
- my $len = defined($ptr) ? length($ptr) : 0;
+ $len=$mg->LENGTH;
if ($debug_mg) {
warn sprintf("magic %s (0x%x), obj %s (0x%x), type %s, ptr %s\n",
class($sv), $$sv, class($obj), $$obj,
cchar($type), cstring($ptr));
}
- $init->add(sprintf("sv_magic((SV*)s\\_%x, (SV*)s\\_%x, %s, %s, %d);",
+ if ($len == HEf_SVKEY){
+ #The pointer is an SV*
+ $ptrsv=svref_2object($ptr)->save;
+ $init->add(sprintf("sv_magic((SV*)s\\_%x, (SV*)s\\_%x, %s, %s, %d);",
+ $$sv, $$obj, cchar($type),$ptrsv,$len));
+ }else{
+ $init->add(sprintf("sv_magic((SV*)s\\_%x, (SV*)s\\_%x, %s, %s, %d);",
$$sv, $$obj, cchar($type),cstring($ptr),$len));
+ }
}
}
diff --git a/ext/B/B/CC.pm b/ext/B/B/CC.pm
index 3de70c67a6..d9cf11966c 100644
--- a/ext/B/B/CC.pm
+++ b/ext/B/B/CC.pm
@@ -51,6 +51,7 @@ my %skip_stack; # Hash of PP names which don't need write_back_stack
my %skip_lexicals; # Hash of PP names which don't need write_back_lexicals
my %skip_invalidate; # Hash of PP names which don't need invalidate_lexicals
my %ignore_op; # Hash of ops which do nothing except returning op_next
+my %need_curcop; # Hash of ops which need PL_curcop
BEGIN {
foreach (qw(pp_scalar pp_regcmaybe pp_lineseq pp_scope pp_null)) {
@@ -91,6 +92,7 @@ sub init_hash { map { $_ => 1 } @_ }
#
%skip_lexicals = init_hash qw(pp_enter pp_enterloop);
%skip_invalidate = init_hash qw(pp_enter pp_enterloop);
+%need_curcop = init_hash qw(pp_rv2gv pp_bless pp_repeat pp_sort pp_caller pp_reset pp_rv2cv pp_entereval pp_require pp_dofile pp_entertry pp_enterloop pp_enteriter );
sub debug {
if ($debug_runtime) {
@@ -565,14 +567,15 @@ sub pp_dbstate {
return default_pp($op);
}
-sub pp_rv2gv { $curcop->write_back; default_pp(@_) }
-sub pp_bless { $curcop->write_back; default_pp(@_) }
-sub pp_repeat { $curcop->write_back; default_pp(@_) }
+#default_pp will handle this:
+#sub pp_rv2gv { $curcop->write_back; default_pp(@_) }
+#sub pp_bless { $curcop->write_back; default_pp(@_) }
+#sub pp_repeat { $curcop->write_back; default_pp(@_) }
# The following subs need $curcop->write_back if we decide to support arybase:
# pp_pos, pp_substr, pp_index, pp_rindex, pp_aslice, pp_lslice, pp_splice
-sub pp_sort { $curcop->write_back; default_pp(@_) }
-sub pp_caller { $curcop->write_back; default_pp(@_) }
-sub pp_reset { $curcop->write_back; default_pp(@_) }
+#sub pp_sort { $curcop->write_back; default_pp(@_) }
+#sub pp_caller { $curcop->write_back; default_pp(@_) }
+#sub pp_reset { $curcop->write_back; default_pp(@_) }
sub pp_gv {
my $op = shift;
@@ -1263,6 +1266,9 @@ sub pp_substcont {
sub default_pp {
my $op = shift;
my $ppname = $op->ppaddr;
+ if ($curcop and $need_curcop{$ppname}){
+ $curcop->write_back;
+ }
write_back_lexicals() unless $skip_lexicals{$ppname};
write_back_stack() unless $skip_stack{$ppname};
doop($op);
diff --git a/ext/DB_File/Changes b/ext/DB_File/Changes
index e13178c4e8..212ae5fe05 100644
--- a/ext/DB_File/Changes
+++ b/ext/DB_File/Changes
@@ -211,3 +211,13 @@
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.
+1.62 30th November 1998
+
+ Added hints/dynixptx.pl.
+ Fixed typemap -- 1.61 used PL_na instead of na
+
+1.63 19th December 1998
+
+ Fix to allow DB 2.6.x to build with DB_File
+ Documentation upadated to use push,pop etc in the RECNO example & to
+ include the find_dup & del_dup methods.
diff --git a/ext/DB_File/DB_File.pm b/ext/DB_File/DB_File.pm
index 3d3b9ff854..dc68974f38 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 19th November 1998
-# version 1.61
+# written by Paul Marquess (Paul.Marquess@btinternet.com)
+# last modified 2nd December 1998
+# version 1.63
#
# 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.61" ;
+$VERSION = "1.63" ;
#typedef enum { DB_BTREE, DB_HASH, DB_RECNO } DBTYPE;
$DB_BTREE = new DB_File::BTREEINFO ;
@@ -300,6 +300,40 @@ sub STORESIZE
}
}
+sub find_dup
+{
+ croak "Usage: \$db->find_dup(key,value)\n"
+ unless @_ == 3 ;
+
+ my $db = shift ;
+ my ($origkey, $value_wanted) = @_ ;
+ my ($key, $value) = ($origkey, 0);
+ my ($status) = 0 ;
+
+ for ($status = $db->seq($key, $value, R_CURSOR() ) ;
+ $status == 0 ;
+ $status = $db->seq($key, $value, R_NEXT() ) ) {
+
+ return 0 if $key eq $origkey and $value eq $value_wanted ;
+ }
+
+ return $status ;
+}
+
+sub del_dup
+{
+ croak "Usage: \$db->del_dup(key,value)\n"
+ unless @_ == 3 ;
+
+ my $db = shift ;
+ my ($key, $value) = @_ ;
+ my ($status) = $db->find_dup($key, $value) ;
+ return $status if $status != 0 ;
+
+ $status = $db->del($key, R_CURSOR() ) ;
+ return $status ;
+}
+
sub get_dup
{
croak "Usage: \$db->get_dup(key [,flag])\n"
@@ -364,6 +398,8 @@ DB_File - Perl5 access to Berkeley DB version 1.x
$count = $X->get_dup($key) ;
@list = $X->get_dup($key) ;
%list = $X->get_dup($key, 1) ;
+ $status = $X->find_dup($key, $value) ;
+ $status = $X->del_dup($key, $value) ;
# RECNO only
$a = $X->length;
@@ -443,11 +479,11 @@ is considered stable enough for real work.
B<Note:> The database file format has changed in Berkeley DB version 2.
If you cannot recreate your databases, you must dump any existing
databases with the C<db_dump185> utility that comes with Berkeley DB.
-Once you have upgraded DB_File to use Berkeley DB version 2, your
+Once you have rebuilt DB_File to use Berkeley DB version 2, your
databases can be recreated using C<db_load>. Refer to the Berkeley DB
documentation for further details.
-Please read L<COPYRIGHT> before using version 2.x of Berkeley DB with
+Please read L<"COPYRIGHT"> before using version 2.x of Berkeley DB with
DB_File.
=head2 Interface to Berkeley DB
@@ -837,9 +873,12 @@ that prints:
This time we have got all the key/value pairs, including the multiple
values associated with the key C<Wall>.
+To make life easier when dealing with duplicate keys, B<DB_File> comes with
+a few utility methods.
+
=head2 The get_dup() Method
-B<DB_File> comes with a utility method, called C<get_dup>, to assist in
+The C<get_dup> method assists in
reading duplicate values from BTREE databases. The method can take the
following forms:
@@ -888,6 +927,79 @@ and it will print:
Smith => [John]
Dog => []
+=head2 The find_dup() Method
+
+ $status = $X->find_dup($key, $value) ;
+
+This method checks for the existance of a specific key/value pair. If the
+pair exists, the cursor is left pointing to the pair and the method
+returns 0. Otherwise the method returns a non-zero value.
+
+Assuming the database from the previous example:
+
+ use strict ;
+ use DB_File ;
+
+ use vars qw($filename $x %h $found) ;
+
+ my $filename = "tree" ;
+
+ # Enable duplicate records
+ $DB_BTREE->{'flags'} = R_DUP ;
+
+ $x = tie %h, "DB_File", $filename, O_RDWR|O_CREAT, 0640, $DB_BTREE
+ or die "Cannot open $filename: $!\n";
+
+ $found = ( $x->find_dup("Wall", "Larry") == 0 ? "" : "not") ;
+ print "Larry Wall is $found there\n" ;
+
+ $found = ( $x->find_dup("Wall", "Harry") == 0 ? "" : "not") ;
+ print "Harry Wall is $found there\n" ;
+
+ undef $x ;
+ untie %h ;
+
+prints this
+
+ Larry Wall is there
+ Harry Wall is not there
+
+
+=head2 The del_dup() Method
+
+ $status = $X->del_dup($key, $value) ;
+
+This method deletes a specific key/value pair. It returns
+0 if they exist and have been deleted successfully.
+Otherwise the method returns a non-zero value.
+
+Again assuming the existance of the C<tree> database
+
+ use strict ;
+ use DB_File ;
+
+ use vars qw($filename $x %h $found) ;
+
+ my $filename = "tree" ;
+
+ # Enable duplicate records
+ $DB_BTREE->{'flags'} = R_DUP ;
+
+ $x = tie %h, "DB_File", $filename, O_RDWR|O_CREAT, 0640, $DB_BTREE
+ or die "Cannot open $filename: $!\n";
+
+ $x->del_dup("Wall", "Larry") ;
+
+ $found = ( $x->find_dup("Wall", "Larry") == 0 ? "" : "not") ;
+ print "Larry Wall is $found there\n" ;
+
+ undef $x ;
+ untie %h ;
+
+prints this
+
+ Larry Wall is not there
+
=head2 Matching Partial Keys
The BTREE interface has a feature which allows partial keys to be
@@ -970,7 +1082,7 @@ Here is the output:
DB_RECNO provides an interface to flat text files. Both variable and
fixed length records are supported.
-In order to make RECNO more compatible with Perl the array offset for
+In order to make RECNO more compatible with Perl, the array offset for
all RECNO arrays begins at 0 rather than 1 as in Berkeley DB.
As with normal Perl arrays, a RECNO array can be accessed using
@@ -999,7 +1111,7 @@ error will be fixed in the next release of Berkeley DB.
That clarifies the situation with regards Berkeley DB itself. What
about B<DB_File>? Well, the behavior defined in the quote above is
-quite useful, so B<DB_File> conforms it.
+quite useful, so B<DB_File> conforms to it.
That means that you can specify other options (e.g. cachesize) and
still have bval default to C<"\n"> for variable length records, and
@@ -1007,7 +1119,9 @@ space for fixed length records.
=head2 A Simple Example
-Here is a simple example that uses RECNO.
+Here is a simple example that uses RECNO (if you are using a version
+of Perl earlier than 5.004_57 this example won't work -- see
+L<Extra RECNO Methods> for a workaround).
use strict ;
use DB_File ;
@@ -1021,6 +1135,18 @@ Here is a simple example that uses RECNO.
$h[1] = "blue" ;
$h[2] = "yellow" ;
+ push @h, "green", "black" ;
+
+ my $elements = scalar @h ;
+ print "The array contains $elements entries\n" ;
+
+ my $last = pop @h ;
+ print "popped $last\n" ;
+
+ unshift @h, "white" ;
+ my $first = shift @h ;
+ print "shifted $first\n" ;
+
# Check for existence of a key
print "Element 1 Exists with value $h[1]\n" if $h[1] ;
@@ -1032,17 +1158,19 @@ Here is a simple example that uses RECNO.
Here is the output from the script:
-
+ The array contains 5 entries
+ popped black
+ unshifted white
Element 1 Exists with value blue
- The last element is yellow
- The 2nd last element is blue
+ The last element is green
+ The 2nd last element is yellow
-=head2 Extra Methods
+=head2 Extra RECNO Methods
If you are using a version of Perl earlier than 5.004_57, the tied
-array interface is quite limited. The example script above will work,
-but you won't be able to use C<push>, C<pop>, C<shift>, C<unshift>
-etc. with the tied array.
+array interface is quite limited. In the example script above
+C<push>, C<pop>, C<shift>, C<unshift>
+or determining the array length will not work with a tied array.
To make the interface more useful for older versions of Perl, a number
of methods are supplied with B<DB_File> to simulate the missing array
@@ -1688,7 +1816,7 @@ L<perl(1)>, L<dbopen(3)>, L<hash(3)>, L<recno(3)>, L<btree(3)>
=head1 AUTHOR
The DB_File interface was written by Paul Marquess
-E<lt>pmarquess@bfsec.bt.co.ukE<gt>.
+E<lt>Paul.Marquess@btinternet.comE<gt>.
Questions about the DB system itself may be addressed to
E<lt>db@sleepycat.com<gt>.
diff --git a/ext/DB_File/DB_File.xs b/ext/DB_File/DB_File.xs
index aa76cb9481..723454eea4 100644
--- a/ext/DB_File/DB_File.xs
+++ b/ext/DB_File/DB_File.xs
@@ -2,9 +2,9 @@
DB_File.xs -- Perl 5 interface to Berkeley DB
- written by Paul Marquess (pmarquess@bfsec.bt.co.uk)
+ written by Paul Marquess <Paul.Marquess@btinternet.com>
last modified 19th November 1998
- version 1.61
+ version 1.63
All comments/suggestions/problems are welcome
@@ -58,6 +58,9 @@
1.60 - Some code tidy up
1.61 - added flagSet macro for DB 2.5.x
fixed typo in O_RDONLY test.
+ 1.62 - No change to DB_File.xs
+ 1.63 - Fix to alllow DB 2.6.x to build.
+
@@ -836,7 +839,12 @@ SV * sv ;
status = db_open(name, RETVAL->type, Flags, mode, NULL, openinfo, &RETVAL->dbp) ;
if (status == 0)
+#if DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR < 6
status = (RETVAL->dbp->cursor)(RETVAL->dbp, NULL, &RETVAL->cursor) ;
+#else
+ status = (RETVAL->dbp->cursor)(RETVAL->dbp, NULL, &RETVAL->cursor,
+ 0) ;
+#endif
if (status)
RETVAL->dbp = NULL ;
diff --git a/ext/DB_File/dbinfo b/ext/DB_File/dbinfo
index 9640ba442e..24a794448f 100644
--- a/ext/DB_File/dbinfo
+++ b/ext/DB_File/dbinfo
@@ -3,7 +3,7 @@
# Name: dbinfo -- identify berkeley DB version used to create
# a database file
#
-# Author: Paul Marquess
+# Author: Paul Marquess <Paul.Marquess@btinternet.com>
# Version: 1.01
# Date 16th April 1998
#
diff --git a/ext/DB_File/typemap b/ext/DB_File/typemap
index 7af55aec21..8a953421d5 100644
--- a/ext/DB_File/typemap
+++ b/ext/DB_File/typemap
@@ -1,6 +1,6 @@
# typemap for Perl 5 interface to Berkeley
#
-# written by Paul Marquess (pmarquess@bfsec.bt.co.uk)
+# written by Paul Marquess <Paul.Marquess@btinternet.com>
# last modified 13th May 1998
# version 1.59
#
diff --git a/ext/DynaLoader/hints/linux.pl b/ext/DynaLoader/hints/linux.pl
new file mode 100644
index 0000000000..06f4f4c1f8
--- /dev/null
+++ b/ext/DynaLoader/hints/linux.pl
@@ -0,0 +1,4 @@
+# XXX Configure test needed.
+# Some Linux releases like to hide their <nlist.h>
+$self->{CCFLAGS} = $Config{ccflags} . ' -I/usr/include/libelf'
+ if -f "/usr/include/libelf/nlist.h";
diff --git a/ext/IO/lib/IO/Pipe.pm b/ext/IO/lib/IO/Pipe.pm
index 59f62933d0..3a91b9e90d 100644
--- a/ext/IO/lib/IO/Pipe.pm
+++ b/ext/IO/lib/IO/Pipe.pm
@@ -189,10 +189,10 @@ IO::Pipe - supply object methods for pipes
=head1 DESCRIPTION
-C<IO::Pipe> provides an interface to createing pipes between
+C<IO::Pipe> provides an interface to creating pipes between
processes.
-=head1 CONSTRCUTOR
+=head1 CONSTRUCTOR
=over 4
diff --git a/ext/IO/lib/IO/Seekable.pm b/ext/IO/lib/IO/Seekable.pm
index de982ed2a7..6c07e94ada 100644
--- a/ext/IO/lib/IO/Seekable.pm
+++ b/ext/IO/lib/IO/Seekable.pm
@@ -14,7 +14,7 @@ IO::Seekable - supply seek based methods for I/O objects
=head1 DESCRIPTION
-C<IO::Seekable> does not have a constuctor of its own as is intended to
+C<IO::Seekable> does not have a constructor of its own as it is intended to
be inherited by other C<IO::Handle> based objects. It provides methods
which allow seeking of the file descriptors.
diff --git a/ext/POSIX/POSIX.pm b/ext/POSIX/POSIX.pm
index 8687eb8375..76455f70dd 100644
--- a/ext/POSIX/POSIX.pm
+++ b/ext/POSIX/POSIX.pm
@@ -866,7 +866,7 @@ sub getlogin {
sub getpgrp {
usage "getpgrp()" if @_ != 0;
- CORE::getpgrp($_[0]);
+ CORE::getpgrp;
}
sub getpid {
diff --git a/ext/POSIX/POSIX.pod b/ext/POSIX/POSIX.pod
index 6a4a61aca6..7b21810567 100644
--- a/ext/POSIX/POSIX.pod
+++ b/ext/POSIX/POSIX.pod
@@ -847,31 +847,35 @@ setjmp() is C-specific: use eval {} instead.
=item setlocale
-Modifies and queries program's locale.
+Modifies and queries program's locale. The following examples assume
+
+ use POSIX qw(setlocale LC_ALL LC_CTYPE);
+
+has been issued.
The following will set the traditional UNIX system locale behavior
(the second argument C<"C">).
- $loc = POSIX::setlocale( &POSIX::LC_ALL, "C" );
+ $loc = setlocale( LC_ALL, "C" );
-The following will query (the missing second argument) the current
-LC_CTYPE category.
+The following will query the current LC_CTYPE category. (No second
+argument means 'query'.)
- $loc = POSIX::setlocale( &POSIX::LC_CTYPE);
+ $loc = setlocale( LC_CTYPE );
The following will set the LC_CTYPE behaviour according to the locale
environment variables (the second argument C<"">).
Please see your systems L<setlocale(3)> documentation for the locale
environment variables' meaning or consult L<perllocale>.
- $loc = POSIX::setlocale( &POSIX::LC_CTYPE, "");
+ $loc = setlocale( LC_CTYPE, "" );
The following will set the LC_COLLATE behaviour to Argentinian
Spanish. B<NOTE>: The naming and availability of locales depends on
your operating system. Please consult L<perllocale> for how to find
out which locales are available in your system.
- $loc = POSIX::setlocale( &POSIX::LC_ALL, "es_AR.ISO8859-1" );
+ $loc = setlocale( LC_ALL, "es_AR.ISO8859-1" );
=item setpgid
diff --git a/ext/POSIX/hints/mint.pl b/ext/POSIX/hints/mint.pl
new file mode 100644
index 0000000000..b975cbb2ee
--- /dev/null
+++ b/ext/POSIX/hints/mint.pl
@@ -0,0 +1,2 @@
+$self->{CCFLAGS} = $Config{ccflags} . ' -DNO_LOCALECONV_GROUPING -DNO_LOCALECONV_MON_GROUPING';
+
diff --git a/ext/Socket/Socket.pm b/ext/Socket/Socket.pm
index 1ed19f713d..1654b164bb 100644
--- a/ext/Socket/Socket.pm
+++ b/ext/Socket/Socket.pm
@@ -193,6 +193,8 @@ require DynaLoader;
AF_UNIX
AF_UNSPEC
AF_X25
+ IOV_MAX
+ MSG_BCAST
MSG_CTLFLAGS
MSG_CTLIGNORE
MSG_CTRUNC
@@ -203,6 +205,7 @@ require DynaLoader;
MSG_ERRQUEUE
MSG_FIN
MSG_MAXIOVLEN
+ MSG_MCAST
MSG_NOSIGNAL
MSG_OOB
MSG_PEEK
@@ -266,6 +269,7 @@ require DynaLoader;
SO_SNDTIMEO
SO_TYPE
SO_USELOOPBACK
+ UIO_MAXIOV
);
@EXPORT_OK = qw(CR LF CRLF $CR $LF $CRLF);
diff --git a/ext/Socket/Socket.xs b/ext/Socket/Socket.xs
index 1c541d7cef..30499483d0 100644
--- a/ext/Socket/Socket.xs
+++ b/ext/Socket/Socket.xs
@@ -26,6 +26,10 @@
#include "sockadapt.h"
#endif
+#ifdef I_SYSUIO
+# include <sys/uio.h>
+#endif
+
#ifndef AF_NBS
#undef PF_NBS
#endif
@@ -322,6 +326,12 @@ constant(char *name, int arg)
case 'H':
break;
case 'I':
+ if (strEQ(name, "IOV_MAX"))
+#ifdef IOV_MAX
+ return IOV_MAX;
+#else
+ goto not_there;
+#endif
break;
case 'J':
break;
@@ -330,6 +340,12 @@ constant(char *name, int arg)
case 'L':
break;
case 'M':
+ if (strEQ(name, "MSG_BCAST"))
+#ifdef MSG_BCAST
+ return MSG_BCAST;
+#else
+ goto not_there;
+#endif
if (strEQ(name, "MSG_CTLFLAGS"))
#ifdef MSG_CTLFLAGS
return MSG_CTLFLAGS;
@@ -390,6 +406,12 @@ constant(char *name, int arg)
#else
goto not_there;
#endif
+ if (strEQ(name, "MSG_MCAST"))
+#ifdef MSG_MCAST
+ return MSG_MCAST;
+#else
+ goto not_there;
+#endif
if (strEQ(name, "MSG_NOSIGNAL"))
#ifdef MSG_NOSIGNAL
return MSG_NOSIGNAL;
@@ -602,7 +624,7 @@ constant(char *name, int arg)
#endif
if (strEQ(name, "SCM_CREDENTIALS"))
#ifdef SCM_CREDENTIALS
- return SCM_CREDENTIALSS;
+ return SCM_CREDENTIALS;
#else
goto not_there;
#endif
@@ -784,6 +806,12 @@ constant(char *name, int arg)
case 'T':
break;
case 'U':
+ if (strEQ(name, "UIO_MAXIOV"))
+#ifdef UIO_MAXIOV
+ return UIO_MAXIOV;
+#else
+ goto not_there;
+#endif
break;
case 'V':
break;
diff --git a/ext/re/re.pm b/ext/re/re.pm
index 1c225e3a7c..09f52d6086 100644
--- a/ext/re/re.pm
+++ b/ext/re/re.pm
@@ -86,9 +86,10 @@ sub setcolor {
my $terminal = Tgetent Term::Cap ({OSPEED => 9600}); # Avoid warning.
my $props = $ENV{PERL_RE_TC} || 'md,me,so,se,us,ue';
my @props = split /,/, $props;
+ my $colors = join "\t", map {$terminal->Tputs($_,1)} @props;
-
- $ENV{PERL_RE_COLORS} = join "\t", map {$terminal->Tputs($_,1)} @props;
+ $colors =~ s/\0//g;
+ $ENV{PERL_RE_COLORS} = $colors;
};
}