summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorAndy Dougherty <doughera@lafcol.lafayette.edu>1996-02-28 16:49:33 -0800
committerAndy Dougherty <doughera@lafcol.lafayette.edu>1996-02-28 16:49:33 -0800
commita5f75d667838e8e7bb037880391f5c44476d33b4 (patch)
tree5005e888355c1508bc47da697efe119c1615b123 /ext
parent2920c5d2b358b11ace52104b6944bfa0e89256a7 (diff)
downloadperl-a5f75d667838e8e7bb037880391f5c44476d33b4.tar.gz
perl 5.002perl-5.002
[editor's note: changes seem to be mostly module updates, documentation changes and some perl API macro additions]
Diffstat (limited to 'ext')
-rw-r--r--ext/FileHandle/FileHandle.pm20
-rw-r--r--ext/NDBM_File/NDBM_File.pm18
-rw-r--r--ext/NDBM_File/hints/svr4.pl4
-rw-r--r--ext/ODBM_File/ODBM_File.pm18
-rw-r--r--ext/SDBM_File/SDBM_File.pm18
-rw-r--r--ext/Safe/Safe.xs15
6 files changed, 87 insertions, 6 deletions
diff --git a/ext/FileHandle/FileHandle.pm b/ext/FileHandle/FileHandle.pm
index d6832dbd0b..1d1fe18e53 100644
--- a/ext/FileHandle/FileHandle.pm
+++ b/ext/FileHandle/FileHandle.pm
@@ -32,6 +32,11 @@ FileHandle - supply object methods for filehandles
undef $fh; # automatically closes the file
}
+ $pos = $fh->getpos;
+ $fh->setpos $pos;
+
+ $fh->setvbuf($buffer_var, _IOLBF, 1024);
+
($readfh, $writefh) = FileHandle::pipe;
autoflush STDOUT 1;
@@ -60,6 +65,21 @@ C<FileHandle::fdopen> is like C<open> except that its first parameter
is not a filename but rather a file handle name, a FileHandle object,
or a file descriptor number.
+If the C functions fgetpos() and fsetpos() are available, then
+C<FileHandle::getpos> returns an opaque value that represents the
+current position of the FileHandle, and C<FileHandle::setpos> uses
+that value to return to a previously visited position.
+
+If the C function setvbuf() is available, then C<FileHandle::setvbuf>
+sets the buffering policy for the FileHandle. The calling sequence
+for the Perl function is the same as its C counterpart, including the
+macros C<_IOFBF>, C<_IOLBF>, and C<_IONBF>, except that the buffer
+parameter specifies a scalar variable to use as a buffer. WARNING: A
+variable used as a buffer by C<FileHandle::setvbuf> must not be
+modified in any way until the FileHandle is closed or until
+C<FileHandle::setvbuf> is called again, or memory corruption may
+result!
+
See L<perlfunc> for complete descriptions of each of the following
supported C<FileHandle> methods, which are just front ends for the
corresponding built-in functions:
diff --git a/ext/NDBM_File/NDBM_File.pm b/ext/NDBM_File/NDBM_File.pm
index 339439c98f..601a3c2a0e 100644
--- a/ext/NDBM_File/NDBM_File.pm
+++ b/ext/NDBM_File/NDBM_File.pm
@@ -15,3 +15,21 @@ bootstrap NDBM_File $VERSION;
1;
__END__
+
+=head1 NAME
+
+NDBM_File - Tied access to ndbm files
+
+=head1 SYNOPSIS
+
+ use NDBM_File;
+
+ tie(%h,NDBM_File,'Op.dbmx', O_RDWR|O_CREAT, 0640);
+
+ untie %h;
+
+=head1 DESCRIPTION
+
+See L<perlfunc/tie>
+
+=cut
diff --git a/ext/NDBM_File/hints/svr4.pl b/ext/NDBM_File/hints/svr4.pl
new file mode 100644
index 0000000000..3285d9a685
--- /dev/null
+++ b/ext/NDBM_File/hints/svr4.pl
@@ -0,0 +1,4 @@
+# Some SVR4 systems may need to link against routines in -lucb for
+# odbm. Some may also need to link against -lc to pick up things like
+# ecvt.
+$self->{LIBS} = ['-ldbm -lucb -lc'];
diff --git a/ext/ODBM_File/ODBM_File.pm b/ext/ODBM_File/ODBM_File.pm
index a96916b6e0..e5386e853b 100644
--- a/ext/ODBM_File/ODBM_File.pm
+++ b/ext/ODBM_File/ODBM_File.pm
@@ -15,3 +15,21 @@ bootstrap ODBM_File $VERSION;
1;
__END__
+
+=head1 NAME
+
+ODBM_File - Tied access to odbm files
+
+=head1 SYNOPSIS
+
+ use ODBM_File;
+
+ tie(%h,ODBM_File,'Op.dbmx', O_RDWR|O_CREAT, 0640);
+
+ untie %h;
+
+=head1 DESCRIPTION
+
+See L<perlfunc/tie>
+
+=cut
diff --git a/ext/SDBM_File/SDBM_File.pm b/ext/SDBM_File/SDBM_File.pm
index deb72f1966..9b7acc1e09 100644
--- a/ext/SDBM_File/SDBM_File.pm
+++ b/ext/SDBM_File/SDBM_File.pm
@@ -15,3 +15,21 @@ bootstrap SDBM_File $VERSION;
1;
__END__
+
+=head1 NAME
+
+SDBM_File - Tied access to sdbm files
+
+=head1 SYNOPSIS
+
+ use SDBM_File;
+
+ tie(%h,SDBM_File,'Op.dbmx', O_RDWR|O_CREAT, 0640);
+
+ untie %h;
+
+=head1 DESCRIPTION
+
+See L<perlfunc/tie>
+
+=cut
diff --git a/ext/Safe/Safe.xs b/ext/Safe/Safe.xs
index f970a626ac..6b25924a33 100644
--- a/ext/Safe/Safe.xs
+++ b/ext/Safe/Safe.xs
@@ -2,6 +2,9 @@
#include "perl.h"
#include "XSUB.h"
+/* maxo should never differ from MAXO but leave some room anyway */
+#define OP_MASK_BUF_SIZE (MAXO + 100)
+
MODULE = Safe PACKAGE = Safe
void
@@ -13,14 +16,15 @@ safe_call_sv(package, mask, codesv)
int i;
char *str;
STRLEN len;
+ char op_mask_buf[OP_MASK_BUF_SIZE];
+ assert(maxo < OP_MASK_BUF_SIZE);
ENTER;
SAVETMPS;
save_hptr(&defstash);
save_aptr(&endav);
SAVEPPTR(op_mask);
- Newz(666, op_mask, maxo+1, char);
- SAVEFREEPV(op_mask);
+ op_mask = &op_mask_buf[0];
str = SvPV(mask, len);
if (maxo != len)
croak("Bad mask length");
@@ -62,8 +66,8 @@ void
ops_to_mask(...)
CODE:
int i, j;
- char *mask, *op;
- Newz(666, mask, maxo+1, char);
+ char mask[OP_MASK_BUF_SIZE], *op;
+ Zero(mask, sizeof mask, char);
for (i = 0; i < items; i++)
{
op = SvPV(ST(i), na);
@@ -76,8 +80,7 @@ ops_to_mask(...)
croak("bad op name \"%s\" in mask", op);
}
}
- ST(0) = sv_newmortal();
- sv_usepvn(ST(0), mask, maxo);
+ ST(0) = sv_2mortal(newSVpv(mask,maxo));
void
opname(...)