gerti Gerd Knops gerti@BITart.com
gibreel Stephen Zander gibreel@pobox.com
gnat Nathan Torkington gnat@frii.com
-gsar Gurusamy Sarathy gsar@umich.edu
+gsar Gurusamy Sarathy gsar@activestate.com
hansmu Hans Mulder hansmu@xs4all.nl
ilya Ilya Zakharevich ilya@math.ohio-state.edu
jbuehler Joe Buehler jbuehler@hekimian.com
nik Nick Ing-Simmons nik@tiuk.ti.com
okamoto Jeff Okamoto okamoto@corp.hp.com
paul_green Paul Green Paul_Green@stratus.com
-pmarquess Paul Marquess pmarquess@bfsec.bt.co.uk
+pmarquess Paul Marquess Paul.Marquess@btinternet.com
pomeranz Hal Pomeranz pomeranz@netcom.com
pudge Chris Nandor pudge@pobox.com
pueschel Norbert Pueschel pueschel@imsdd.meb.uni-bonn.de
pvhp Peter Prymmer pvhp@forte.com
-raphael Raphael Manfredi Raphael_Manfredi@grenoble.hp.com
+raphael Raphael Manfredi Raphael_Manfredi@pobox.com
rdieter Rex Dieter rdieter@math.unl.edu
rsanders Robert Sanders Robert.Sanders@linux.org
roberto Ollivier Robert roberto@keltia.freenix.fr
Nick Ing-Simmons <nik@tiuk.ti.com>
Andreas Koenig <a.koenig@mind.de>
Doug MacEachern <dougm@opengroup.org>
- Paul Marquess <pmarquess@bfsec.bt.co.uk>
+ Paul Marquess <Paul.Marquess@btinternet.com>
Stephen McCamant <alias@mcs.com>
Laszlo Molnar <laszlo.molnar@eth.ericsson.se>
Hans Mulder <hansmu@xs4all.nl>
Malcolm Beattie <mbeattie@sable.ox.ac.uk>
Tim Bunce <Tim.Bunce@ig.co.uk>
Andy Dougherty <doughera@lafcol.lafayette.edu>
- Gurusamy Sarathy <gsar@umich.edu>
+ Gurusamy Sarathy <gsar@activestate.com>
Chip Salzenberg <chip@perl.com>
And, of course, the Author of Perl:
----------------
-Version 5.005_62 Development release working toward 5.006
+Version v5.5.640 Development release working toward 5.6
----------------
____________________________________________________________________________
+[ 4813] By: jhi on 2000/01/18 19:41:33
+ Log: metaconfig todo note from Andy.
+ Branch: cfgperl
+ ! Configure config_h.SH
+ Branch: metaconfig
+ ! U/installdirs/inc_version_list.U
+____________________________________________________________________________
+[ 4812] By: jhi on 2000/01/18 15:02:55
+ Log: More -V.
+ Branch: cfgperl
+ ! perl.c
+____________________________________________________________________________
+[ 4811] By: jhi on 2000/01/18 10:35:30
+ Log: More compile-time options shown with -V.
+ Branch: cfgperl
+ ! perl.c
+____________________________________________________________________________
+[ 4810] By: jhi on 2000/01/17 08:35:49
+ Log: Add -D_GNU_SOURCE into ccflags for gcc (for now to expose
+ the strtold() and qgcvt() prototypes for long doubles, but
+ it should be okay in any case); fix bad assumptions in the
+ test suite about string->float conversions; though the out
+ parameter of strtold() (and strtoll()) is unused, it is nicer
+ to have it in correct type.
+ Branch: cfgperl
+ ! Configure config_h.SH perl.h t/lib/posix.t t/op/pack.t
+ Branch: metaconfig
+ ! U/modified/cc.U
+____________________________________________________________________________
+[ 4809] By: jhi on 2000/01/16 19:21:18
+ Log: strtoll works better ternary.
+ Branch: cfgperl
+ ! perl.h
+____________________________________________________________________________
+[ 4808] By: jhi on 2000/01/16 19:12:58
+ Log: Know strtoll.
+ Branch: cfgperl
+ ! Configure Porting/Glossary Porting/config.sh Porting/config_H
+ ! config_h.SH perl.h
+____________________________________________________________________________
+[ 4807] By: jhi on 2000/01/16 17:57:03
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ !> dump.c gv.c gv.h lib/vars.pm op.c op.h perl.h pod/perlfunc.pod
+ !> sv.c sv.h t/pragma/strict-vars toke.c util.c
+____________________________________________________________________________
+[ 4806] By: jhi on 2000/01/16 16:37:47
+ Log: Continue qgcvt work; closer now but not yet there.
+ Branch: cfgperl
+ ! Configure Porting/Glossary Porting/config.sh Porting/config_H
+ ! config_h.SH doop.c utf8.c
+ Branch: metaconfig
+ ! U/compline/d_gconvert.U
+ Branch: metaconfig/U/perl
+ ! d_qgcvt.U
+____________________________________________________________________________
+[ 4805] By: jhi on 2000/01/15 22:26:16
+ Log: Metaconfig and Porting patches from Andy; start using the new
+ long long and long double thingies from #4804; regen Configure.
+ Branch: cfgperl
+ ! Configure Porting/Glossary Porting/config.sh Porting/config_H
+ ! Porting/pumpkin.pod config_h.SH patchlevel.h perl.h util.c
+ Branch: metaconfig
+ + U/dist_patches/dist-p70a U/dist_patches/dist-p70b
+ + U/dist_patches/dist-p70c U/installdirs/inc_version_list.U
+ + U/modified/myhostname.U U/modified/nis.U U/nullified/fpu.U
+ + U/nullified/lib.U
+ ! U/README U/compline/d_gconvert.U U/installdirs/sitearch.U
+ ! U/installdirs/sitelib.U U/installdirs/vendorarch.U
+ ! U/installdirs/vendorlib.U U/modified/Cppsym.U U/modified/Loc.U
+ ! U/modified/Oldconfig.U U/modified/Signal.U
+ ! U/modified/sig_name.U U/threads/usethreads.U
+ Branch: metaconfig/U/perl
+ ! d_qgcvt.U d_strtold.U d_strtoll.U d_strtoq.U d_strtoull.U
+ ! d_strtouq.U dlsrc.U i_db.U libperl.U patchlevel.U
+ ! usemultiplicity.U
+ Branch: perl
+ ! perl.h util.c
+____________________________________________________________________________
+[ 4804] By: jhi on 2000/01/14 14:22:24
+ Log: Add more quad/long long/long double sciency.
+ Branch: metaconfig/U/perl
+ + d_qgcvt.U d_strtold.U d_strtoll.U d_strtoq.U d_strtoull.U
+ + d_strtouq.U
+____________________________________________________________________________
+[ 4803] By: gsar on 2000/01/14 04:40:49
+ Log: minor optimization (avoid double sv_upgrade() for "our Foo $bar;")
+ Branch: perl
+ ! op.c
+____________________________________________________________________________
+[ 4802] By: gsar on 2000/01/14 04:35:55
+ Log: add note about "our"
+ Branch: perl
+ ! lib/vars.pm
+____________________________________________________________________________
+[ 4801] By: gsar on 2000/01/14 04:16:51
+ Log: nailed "our" declarations, and better warnings on duplicate
+ "our" declarations
+ Branch: perl
+ ! dump.c gv.c gv.h op.c pod/perlfunc.pod sv.c sv.h
+ ! t/pragma/strict-vars toke.c
+____________________________________________________________________________
+[ 4800] By: gsar on 2000/01/14 01:27:13
+ Log: avoid spurious "Useless use of variable" warning on C<our $foo;>
+ Branch: perl
+ ! dump.c op.c op.h
+____________________________________________________________________________
+[ 4799] By: gsar on 2000/01/14 01:17:15
+ Log: doc typo
+ Branch: perl
+ ! pod/perlfunc.pod
+____________________________________________________________________________
+[ 4798] By: jhi on 2000/01/13 16:31:34
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ +> epoc/config.sh epoc/epocish.c epoc/link.pl
+ +> ext/DynaLoader/XSLoader_pm.PL ext/DynaLoader/hints/openbsd.pl
+ +> ext/IPC/SysV/hints/cygwin.pl ext/NDBM_File/hints/cygwin.pl
+ +> ext/ODBM_File/hints/cygwin.pl lib/byte.pm lib/byte_heavy.pl
+ +> lib/unicode/Unicode.300 pod/perlfork.pod t/lib/glob-case.t
+ +> win32/perlhost.h win32/vdir.h win32/vmem.h
+ - epoc/Config.pm epoc/autosplit.pl epoc/config.h epoc/perl.mmp
+ - epoc/perl.pkg ext/DynaLoader/dl_cygwin.xs
+ - lib/unicode/UnicodeData-Latest.txt os2/POSIX.mkfifo
+ !> (integrate 282 files)
+____________________________________________________________________________
+[ 4797] By: gsar on 2000/01/13 08:12:56
+ Log: clearer docs for change#4796; faster av_exists()
+ Branch: perl
+ ! av.c pod/perldelta.pod pod/perldiag.pod pod/perlfunc.pod
+____________________________________________________________________________
+[ 4796] By: gsar on 2000/01/13 06:49:03
+ Log: support delete() and exists() on array, tied array, and pseudo-hash
+ elements or slices
+ Branch: perl
+ ! av.c embed.h embed.pl global.sym lib/Tie/Array.pm
+ ! lib/Tie/Hash.pm objXSUB.h op.c perlapi.c pod/perldelta.pod
+ ! pod/perlfunc.pod pod/perlref.pod pod/perltie.pod pp.c proto.h
+ ! t/op/avhv.t t/op/delete.t
+____________________________________________________________________________
+[ 4795] By: gsar on 2000/01/11 20:52:30
+ Log: extend site_perl changes change#4773 to vendor_perl as well
+ Branch: perl
+ ! Configure
+____________________________________________________________________________
+[ 4794] By: gsar on 2000/01/11 19:18:50
+ Log: rework INSTALL to reflect new logic for versioning sitelibs
+ Branch: perl
+ ! INSTALL
+____________________________________________________________________________
+[ 4793] By: gsar on 2000/01/11 01:44:00
+ Log: test for change#4792
+ Branch: perl
+ ! t/op/fork.t
+____________________________________________________________________________
+[ 4792] By: gsar on 2000/01/11 01:22:36
+ Log: pseudo forked children inherit environment correctly
+ Branch: perl
+ ! win32/perlhost.h
+____________________________________________________________________________
+[ 4791] By: gsar on 2000/01/10 19:14:03
+ Log: test tweak
+ Branch: perl
+ ! t/op/fork.t
+____________________________________________________________________________
+[ 4790] By: gsar on 2000/01/10 18:56:16
+ Log: check for USE_ITHREADS sanity was too restrictive
+ Branch: perl
+ ! perl.h
+____________________________________________________________________________
+[ 4789] By: gsar on 2000/01/10 18:30:24
+ Log: add workaround for textmode read() bug in MSVCRT; make chdir() do
+ a real SetCurrentDirectory() in toplevel host
+ Branch: perl
+ ! README.win32 win32/Makefile win32/makefile.mk win32/perlhost.h
+ ! win32/vdir.h win32/win32.c
+____________________________________________________________________________
+[ 4788] By: chip on 2000/01/10 17:52:39
+ Log: Integrate #4779 from mainline:
+ terminate -s switch processing only on C<-->, not on C<--foo>
+ Branch: maint-5.005/perl
+ ! perl.c
+____________________________________________________________________________
+[ 4787] By: chip on 2000/01/10 17:51:17
+ Log: Tweak change #4785.
+ Branch: maint-5.005/perl
+ ! win32/win32.c
+____________________________________________________________________________
+[ 4786] By: chip on 2000/01/10 17:11:40
+ Log: Make automatically-generated files +w (type "text+w").
+ Branch: maint-5.005/perl
+ ! embed.h embedvar.h ext/B/B/Asmdata.pm keywords.h objXSUB.h
+ ! opcode.h pod/perltoc.pod pp_proto.h regnodes.h
+ ! win32/config_H.bc win32/config_H.gc win32/config_H.vc
+____________________________________________________________________________
+[ 4785] By: chip on 2000/01/10 17:08:48
+ Log: Patch from Sarathy to integrate changes from mainline: 2751,
+ 2821, 2916, 2930, 2931, 2937 2990, 3033, 3036, 3042, 3061, 3097,
+ 3123, 3134, 3135, 3269, 3270, 3300, 3316, 3345 3350, 3353, 3362,
+ 3363, 3396, 3419, 3423, 3445, 3446, 3447, 3449, 3450, 3451, 3487
+ 3493, 3514, 3533, 3548, 3549, 3588, 3682, 3685, 3699, 3785,
+ 3804, 3811, 3897, 4057 4102, 4103, 4230, 4401, 4420, 4504
+ --
+ enable better Win32::DomainName() by demand loading netapi32.dll
+ (from Jan Dubois)
+ --
+ win32_utime() on directories should use localtime() rather
+ than gmtime() (from Jan Dubois)
+ --
+ serious bug introduced by G_VOID changes in 5.003_96: scalar
+ eval"" did not pop stack correctly; C<$a = eval "(1,2)x1">
+ is one symptom of the problem
+ --
+ add $installarchlib/CORE to default linker search path on windows
+ --
+ fix memory leak in C<sub f { split ' ', "a b" } f() while 1>
+ --
+ fix memory leak in C<sub f { @_ = 1 } f() while 1>
+ --
+ avoid hiding child process window
+ --
+ optimizations could sometimes bypass bareword check
+ --
+ fix typo that caused INSTALLPRIVLIB to have doubled 'perl5'
+ --
+ Pod::Html tweak
+ From: jan.dubois@ibm.net (Jan Dubois)
+ To: perl5-porters@perl.org
+ Subject: [PATCH 5.005_58] pod2html: Missing chunk for VMS filenames
+ Date: Tue, 27 Jul 1999 22:14:12 +0200
+ Message-ID: <37a50af0.46171380@smtp1.ibm.net>
+ --
+ don't quit if =head* wasn't found (suggested by Roland Bauer
+ <roland.bauer@fff.at>)
+ --
+ avoid bug in win32_str_os_error() (from Jan Dubois)
+ --
+ applied suggested patch, along with later tweak
+ From: jan.dubois@ibm.net (Jan Dubois)
+ Date: Wed, 14 Jul 1999 23:53:43 +0200
+ Message-ID: <37a902e7.15977234@smtp1.ibm.net>
+ Subject: Merge ActivePerl Stylesheet support etc into Pod::Html.pm
+ --
+ use a better prefixify() heuristic than m/perl/ (prefix/lib/perl5
+ and prefix/lib/perl5/man are ass_u_med only if those directories
+ actually exist; else prefix/{lib,man} are used)
+ --
+ allow C<-foo> under C<use integer> (behavior of C<-$string>
+ is unchanged still)
+ --
+ avoid race condition in the CAPI extension bootstrap handler
+ --
+ sanity check to cover the case when perl is installed into the
+ X:\ (drive root)
+ --
+ truncate() has a peculiar exemption from strict barewords, even
+ though it has a non-filehandle prototype
+ --
+ change#3447 didn't do enough to exempt Foo->bar(qw/.../) from
+ strict 'subs'
+ --
+ change#3449 wasn't doing enough
+ --
+ make win32_spawnvp() inherit standard handles even when they
+ may be redirected
+ --
+ minor logic tweak for reserved word warning
+ --
+ oops, some files missing in change#3449
+ --
+ allow '*' prototype to autoquote even barewords that happen to be
+ function names; parens or ampersand continue to force the other
+ interpretation; makes C<sub Foo {'bar'} CORE::GLOBAL::require Foo;>
+ do the right thing, for example
+ --
+ redo change#2061 and parts of change#1169 with code in the
+ parser; PL_last_proto hackery gone, strict 'subs' in now
+ implemented in the optimizer where specifying the exceptional
+ cases is much more robust; '*' (bareword) prototype now works
+ reliably when used in second and subsequent arguments
+ --
+ remove redundant part of change#1169 superceded by change#2061;
+ avoid "future reserved word" warning on prototypical bearwords
+ --
+ s/isspace/isSPACE/g and make sure the CRT version is always
+ passed an unsigned char (fixes random occurrence of spaces in
+ arguments containing high-bit chars passed to spawned children,
+ on win32)
+ --
+ on win32, look for "site/5.XXX/lib" if "site/5.XXXYY/lib" isn't
+ found (brings sitelib intuition in line with privlib)
+ --
+ mortalize string allocations by win32_get_{priv,site}lib()
+ (fixes small memory leak in interpreter)
+ --
+ opendir(D,"x:") on win32 opens cwd() for drive rather than root;
+ stat() behaves similarly
+ --
+ documentation for Win32 builtins (somewhat modified)
+ From: jan.dubois@ibm.net (Jan Dubois)
+ Date: Tue, 30 Mar 1999 08:05:03 +0200
+ Message-ID: <37006783.1926460@smtp1.ibm.net>
+ Subject: Re: Issues with build 509
+ --
+ provide File::Copy::syscopy() via Win32::CopyFile() on win32
+ --
+ more bulletproof workaround for mangled paths;
+ provide Win32::GetLongPathName()
+ --
+ normalize $^X to full pathname on win32
+ --
+ work around mangled archname on win32 while finding privlib/sitelib;
+ normalize lib paths to forward slashes internally
+ --
+ avoid negative return value from Win32::GetTickCount()
+ From: jan.dubois@ibm.net (Jan Dubois)
+ Date: Sat, 03 Apr 1999 19:04:18 +0200
+ Message-ID: <37084742.22824479@smtp1.ibm.net>
+ Subject: Re: Win32::GetTickCount
+ --
+ adjust win32_stat() to cope with FindFirstFile() and stat() bugs
+ (makes opendir(D,"c:") work reliably)
+ --
+ fix buggy reference count on refs to SVs with autoviv magic
+ (resulted in C<my @a; $a[1] = 1; print \$_ for @a> and Data::Dumper
+ accessing free()d memory)
+ --
+ fix bug in change#3123 (off-by-one, caused C<qx[noargs]> to fail
+ on win32)
+ --
+ flip release & version in win32_uname()
+ --
+ support POSIX::uname() via win32_uname()
+ --
+ implement win32_spawnvp() internally, making it return true PIDs
+ for asynchronous spawns; fix win32_kill() to always deal with
+ PIDs
+ --
+ use yyerror() instead of croak() so that compile-time failures in
+ my(LIST) don't confuse globals with lexicals
+ --
+ allow custom comparison function in File::Compare::compare_text()
+ From: jan.dubois@ibm.net (Jan Dubois)
+ Date: Fri, 26 Feb 1999 21:56:09 +0100
+ Message-ID: <36db0838.8805651@smtp1.ibm.net>
+ Subject: Re: PodParser 1.07 (was: RE: C<stuff()> vs stuff())
+ --
+ slightly edited version of suggested patch
+ From: jan.dubois@ibm.net (Jan Dubois)
+ Date: Mon, 01 Mar 1999 00:32:05 +0100
+ Message-ID: <36dbcf2c.12325433@smtp1.ibm.net>
+ Subject: Re: [PATCH 5.005_55] Cleanup of File::Spec module
+ --
+ revert parts of change#2990 to preserve predictable usage of
+ Win32::Foo() as stacked list values
+ From: jan.dubois@ibm.net (Jan Dubois)
+ Date: Sat, 27 Feb 1999 18:24:17 +0100
+ Message-ID: <36e22849.36531259@smtp1.ibm.net>
+ Subject: Re: resend [PATCH 5.005_55] Various win32/win32.c cleanup
+ --
+ add File::Compare::compare_text()
+ From: jan.dubois@ibm.net (Jan Dubois)
+ Date: Fri, 26 Feb 1999 00:20:41 +0100
+ Message-ID: <36dcd8ab.20195659@smtp1.ibm.net>
+ Subject: Re: PodParser 1.07 (was: RE: C<stuff()> vs stuff())
+ --
+ From: jan.dubois@ibm.net (Jan Dubois)
+ Date: Thu, 18 Feb 1999 19:14:07 +0100
+ Message-ID: <36d15809.40853323@smtp1.ibm.net>
+ Subject: resend [PATCH 5.005_55] Various win32/win32.c cleanup
+ --
+ support Win32::GetFullPathName() and Win32::SetLastError()
+ From: jan.dubois@ibm.net (Jan Dubois)
+ Date: Tue, 09 Feb 1999 22:27:31 +0100
+ Message-ID: <36c1a2ed.8007554@smtp1.ibm.net>
+ Subject: [PATCH _54] Win32::GetFullPathName
+ --
+ backout change#2811 and add newer version based on File::Spec
+ From: Barrie Slaymaker <rbs@telerama.com>
+ Date: Thu, 11 Feb 1999 16:29:24 -0500
+ Message-ID: <36C34BB4.A62090E0@telerama.com>
+ Subject: (pod2html) Relative URLs using new File::Spec
+ --
+ From: Barrie Slaymaker <rbs@telerama.com>
+ Date: Thu, 11 Feb 1999 19:39:48 -0500
+ Message-ID: <36C37854.707D139@telerama.com>
+ Subject: Merging File::PathConvert in to File::Spec
+ --
+ back out change#2751, apply updated version
+ From: jan.dubois@ibm.net (Jan Dubois)
+ Date: Sat, 06 Feb 1999 01:06:29 +0100
+ Message-ID: <36bc844c.18763049@smtp1.ibm.net>
+ Subject: [PATCH] Cleanup of File::Spec module
+ --
+ pod2html misinterprets Foo::Bar as a URL
+ (fix suggested by Alexander Barilo
+ <Alexander.Barilo@aexp.com>)
+ --
+ devnull() support from Jan Dubois <jan.dubois@ibm.net> and others
+ Branch: maint-5.005/perl
+ + lib/File/Spec/Functions.pm pod/Win32.pod
+ ! MANIFEST cop.h dump.c embed.h ext/SDBM_File/sdbm/dbe.c
+ ! global.sym iperlsys.h lib/CGI.pm lib/CGI/Carp.pm
+ ! lib/ExtUtils/MM_Unix.pm lib/ExtUtils/xsubpp
+ ! lib/File/Compare.pm lib/File/Copy.pm lib/File/Spec.pm
+ ! lib/File/Spec/Mac.pm lib/File/Spec/OS2.pm
+ ! lib/File/Spec/Unix.pm lib/File/Spec/VMS.pm
+ ! lib/File/Spec/Win32.pm lib/Pod/Html.pm objXSUB.h objpp.h op.c
+ ! op.h perl.h pp.c pp_ctl.c pp_hot.c proto.h t/comp/proto.t
+ ! t/io/fs.t t/lib/fatal.t t/op/eval.t t/op/magic.t t/op/ref.t
+ ! t/pragma/strict-subs toke.c utils/perldoc.PL win32/GenCAPI.pl
+ ! win32/Makefile win32/config.bc win32/config.gc win32/config.vc
+ ! win32/config_H.bc win32/config_H.gc win32/config_H.vc
+ ! win32/makedef.pl win32/makefile.mk win32/perlhost.h
+ ! win32/runperl.c win32/win32.c win32/win32.h win32/win32iop.h
+ ! win32/win32sck.c
+____________________________________________________________________________
+[ 4784] By: chip on 2000/01/10 09:04:34
+ Log: various documentation tweaks suggested by M. J. T. Guy
+ Branch: maint-5.005/perl
+ ! INSTALL lib/strict.pm pod/perlfunc.pod pod/perlsyn.pod
+____________________________________________________________________________
+[ 4783] By: chip on 2000/01/10 08:11:39
+ Log: Refresh Getopt::Long to v2.20.
+ Branch: maint-5.005/perl
+ ! lib/Getopt/Long.pm
+____________________________________________________________________________
+[ 4782] By: gsar on 2000/01/10 05:27:03
+ Log: EPOC port update (from Olaf Flebbe <O.Flebbe@science-computing.de>)
+ Branch: perl
+ + epoc/config.sh epoc/epocish.c epoc/link.pl
+ - epoc/Config.pm epoc/autosplit.pl epoc/config.h epoc/perl.mmp
+ - epoc/perl.pkg
+ ! MANIFEST README.epoc epoc/createpkg.pl epoc/epoc.c
+ ! epoc/epoc_stubs.c epoc/epocish.h ext/IO/lib/IO/Socket.pm
+ ! lib/Sys/Hostname.pm
+____________________________________________________________________________
+[ 4781] By: gsar on 2000/01/10 05:11:03
+ Log: pod typos (from Abigail <abigail@delanet.com>)
+ Branch: perl
+ ! pod/perl.pod pod/perllexwarn.pod pod/perlxstut.pod
+____________________________________________________________________________
+[ 4780] By: gsar on 2000/01/10 05:07:35
+ Log: failing RE test added (from Robert Cunningham <rkc@ll.mit.edu>)
+ Branch: perl
+ ! t/lib/thread.t
+____________________________________________________________________________
+[ 4779] By: gsar on 2000/01/10 05:06:16
+ Log: terminate -s switch processing only on C<-->, not on C<--foo>
+ Branch: perl
+ ! perl.c
+____________________________________________________________________________
+[ 4778] By: gsar on 2000/01/10 04:38:45
+ Log: useithreads needs usemultiplicity
+ Branch: perl
+ ! Configure perl.h
+____________________________________________________________________________
+[ 4777] By: gsar on 2000/01/10 01:18:04
+ Log: use $Config{version} rather than $] where appropriate
+ Branch: perl
+ ! lib/CPAN.pm lib/ExtUtils/Installed.pm lib/ExtUtils/MM_Unix.pm
+ ! lib/ExtUtils/Mksymlists.pm lib/Pod/Man.pm lib/diagnostics.pm
+ ! lib/lib.pm
+____________________________________________________________________________
+[ 4776] By: gsar on 2000/01/10 00:11:34
+ Log: enable fork.t on windows
+ Branch: perl
+ ! t/op/fork.t
+____________________________________________________________________________
+[ 4775] By: gsar on 2000/01/10 00:07:29
+ Log: broken test for use5005threads
+ Branch: perl
+ ! t/lib/safe2.t
+____________________________________________________________________________
+[ 4774] By: gsar on 2000/01/09 23:56:37
+ Log: more windows build tweaks
+ Branch: perl
+ ! installperl makedef.pl win32/Makefile win32/config_H.bc
+ ! win32/config_H.gc win32/config_H.vc win32/config_sh.PL
+ ! win32/makefile.mk
+____________________________________________________________________________
+[ 4773] By: gsar on 2000/01/09 22:27:19
+ Log: more changes for new-style version numbers (versions numbers on
+ the filesystem look like 5.5.640, except on DOS-DJGPP and VMS where
+ they look like 5_5_640; delete @Config{pm_apiversion,xs_apiversion};
+ split $Config{apiversion} into three, @Config{apirevision,apiversion,
+ apisubversion} for CPP friendliness; $Config{sitelib} now defaults
+ to .../site_perl/$version, just like $Config{privlib}, making sitelib
+ completely independent across versions and substantially eliminating
+ chances of breaking older installations by overwriting newly built
+ extensions; all this means compatibility inclusions for @INC will need
+ to take into account older sitelib versions (this still TODO)
+
+ windows, vms, dos tweaks for the above
+ Branch: perl
+ ! Changes Configure INSTALL Porting/config.sh Porting/config_H
+ ! config_h.SH configure.com dosish.h installman installperl
+ ! patchlevel.h perl.c perl.h vms/vmsish.h win32/Makefile
+ ! win32/config.bc win32/config.gc win32/config.vc
+ ! win32/config_H.bc win32/config_H.gc win32/config_H.vc
+ ! win32/config_h.PL win32/config_sh.PL win32/makefile.mk
+ ! win32/win32.c
+____________________________________________________________________________
+[ 4772] By: gsar on 2000/01/09 19:05:33
+ Log: s/usethreads/use5005threads/g
+ Branch: perl
+ ! myconfig.SH t/lib/english.t t/lib/thread.t t/op/nothread.t
+____________________________________________________________________________
+[ 4771] By: gsar on 2000/01/09 18:51:50
+ Log: Configure changes for new-style version numbers (from Andy Dougherty,
+ slightly altered)
+ Branch: perl
+ ! Configure INSTALL Porting/Glossary Porting/config.sh
+ ! Porting/config_H config_h.SH perl.h win32/Makefile
+ ! win32/config.bc win32/config.gc win32/config.vc
+ ! win32/makefile.mk
+____________________________________________________________________________
+[ 4770] By: gsar on 2000/01/07 22:18:54
+ Log: fix for 'make utest' failures (from Ilya Zakharevich)
+ Branch: perl
+ ! regexec.c
+____________________________________________________________________________
+[ 4769] By: gsar on 2000/01/07 18:23:16
+ Log: cygwin update (from Eric Fifer <EFifer@sanwaint.com>)
+ Branch: perl
+ + ext/IPC/SysV/hints/cygwin.pl ext/NDBM_File/hints/cygwin.pl
+ + ext/ODBM_File/hints/cygwin.pl
+ ! Configure INSTALL MANIFEST ext/POSIX/Makefile.PL
+ ! hints/cygwin.sh installman installperl lib/Cwd.pm
+ ! lib/ExtUtils/MakeMaker.pm lib/File/Spec/Unix.pm lib/perl5db.pl
+ ! perlsdio.h t/op/magic.t t/op/stat.t utils/perlcc.PL
+____________________________________________________________________________
+[ 4768] By: gsar on 2000/01/07 18:12:15
+ Log: typo on h2xs.PL (from Helmut Jarausch)
+ Branch: perl
+ ! utils/h2xs.PL
+____________________________________________________________________________
+[ 4767] By: gsar on 2000/01/07 17:58:45
+ Log: VMS update (from Peter Prymmer <pvhp@forte.com>)
+ Branch: perl
+ ! README.vms configure.com vms/subconfigure.com
+____________________________________________________________________________
+[ 4766] By: gsar on 2000/01/07 17:54:05
+ Log: os2/POSIX.mkfifo not needed (from Yitzchak Scott-Thoennes
+ <sthoenna@efn.org>)
+ Branch: perl
+ - os2/POSIX.mkfifo
+ ! MANIFEST README.os2
+____________________________________________________________________________
+[ 4765] By: gsar on 2000/01/06 20:11:46
+ Log: add workaround for dlopen() bug on OpenBSD (relative paths that
+ match /^lib/ won't load properly)
+ Branch: perl
+ + ext/DynaLoader/hints/openbsd.pl
+ ! Changes MANIFEST ext/DynaLoader/dl_dlopen.xs
+____________________________________________________________________________
+[ 4764] By: gsar on 2000/01/06 19:51:08
+ Log: add undocumented globals for compatibility--find.pl, and find2perl
+ generated code need them (from Helmut Jarausch <jarausch@igpm.rwth-aachen.de>)
+ Branch: perl
+ ! lib/File/Find.pm
+____________________________________________________________________________
+[ 4763] By: gsar on 2000/01/06 10:51:07
+ Log: fix various C-backend shenanigans
+ Branch: perl
+ ! ext/B/B/C.pm
+____________________________________________________________________________
+[ 4762] By: gsar on 2000/01/06 04:09:00
+ Log: tweak test in change#4757 for Windows
+ Branch: perl
+ ! t/io/open.t
+____________________________________________________________________________
+[ 4761] By: gsar on 2000/01/06 02:55:30
+ Log: USE_ITHREADS tweak (reused pad values could be SvREADONLY if
+ they belonged to freed OP_CONSTs)
+ Branch: perl
+ ! op.c
+____________________________________________________________________________
+[ 4760] By: gsar on 2000/01/06 00:22:40
+ Log: constant ranges could escape bareword check in list context
+ Branch: perl
+ ! op.c t/pragma/strict-subs
+____________________________________________________________________________
+[ 4759] By: gsar on 2000/01/05 20:52:50
+ Log: From: Ilya Zakharevich <ilya@math.ohio-state.edu>
+ Date: Wed, 05 Jan 2000 15:23:18 EST
+ Message-Id: <20000105152318.A7400@monk.mps.ohio-state.edu>
+ Subject: Re: minimal m//g matches appear busted
+ Branch: perl
+ ! regexec.c t/op/pat.t
+____________________________________________________________________________
+[ 4758] By: gsar on 2000/01/05 12:49:40
+ Log: various nits identified by warnings unmasked by recent changes
+ Branch: perl
+ ! ext/B/Makefile.PL lib/ExtUtils/Install.pm pod/perlfunc.pod
+____________________________________________________________________________
+[ 4757] By: gsar on 2000/01/05 12:48:10
+ Log: severe bugs in change#3786 fixed
+ Branch: perl
+ ! doio.c t/io/open.t
+____________________________________________________________________________
+[ 4756] By: gsar on 2000/01/05 11:25:10
+ Log: tweak change#4745 to make ebcdic output match for chars <= 037
+ Branch: perl
+ ! ext/Data/Dumper/Dumper.pm
+____________________________________________________________________________
+[ 4755] By: gsar on 2000/01/05 06:56:05
+ Log: cygwin support tweaks (from Eric Fifer <EFifer@sanwaint.com>)
+ Branch: perl
+ ! Configure util.c utils/perlcc.PL
+____________________________________________________________________________
+[ 4754] By: gsar on 2000/01/05 06:52:25
+ Log: avoid expensive Version_check (from Andreas Koenig)
+ Branch: perl
+ ! Changes lib/ExtUtils/MM_Unix.pm lib/ExtUtils/MM_VMS.pm
+ ! lib/ExtUtils/MM_Win32.pm lib/ExtUtils/MakeMaker.pm
+____________________________________________________________________________
+[ 4753] By: gsar on 2000/01/05 06:48:22
+ Log: From: andreas.koenig@anima.de (Andreas J. Koenig)
+ Date: 03 Jan 2000 21:56:02 +0100
+ Message-ID: <sfcvh5azxgd.fsf@hohenstaufen.in-berlin.de>
+ Subject: Reloading File::Copy
+ Branch: perl
+ ! Changes lib/File/Copy.pm t/lib/filecopy.t
+____________________________________________________________________________
+[ 4752] By: gsar on 2000/01/04 01:19:20
+ Log: s/USE_TEXTMODE_SCRIPTS/PERL_TEXTMODE_SCRIPTS/g
+ Branch: perl
+ ! win32/Makefile win32/makefile.mk win32/win32.h
+____________________________________________________________________________
+[ 4751] By: gsar on 2000/01/03 18:26:08
+ Log: avoid using (custom) autoloader in MakeMaker (from Andreas Koenig)
+ Branch: perl
+ ! lib/ExtUtils/MakeMaker.pm
+____________________________________________________________________________
+[ 4750] By: gsar on 2000/01/02 21:58:02
+ Log: make DProf look at $ENV{PERL_DPROF_OUT_FILE_NAME} to make it possible
+ to write to a file other than tmon.out (suggested by Haakon Alstadheim
+ <Haakon.Alstadheim@sds.no>)
+ Branch: perl
+ ! ext/Devel/DProf/DProf.pm ext/Devel/DProf/DProf.xs
+____________________________________________________________________________
+[ 4749] By: gsar on 2000/01/02 21:37:29
+ Log: disable optimization in change#3612 for join() and quotemeta()--this
+ removes all the gross hacks for the special cases in that change; fix
+ pp_concat() for when TARG == arg (modified version of patch suggested
+ by Ilya Zakharevich)
+ Branch: perl
+ ! op.c opcode.h opcode.pl pp_hot.c sv.c t/op/lex_assign.t
+____________________________________________________________________________
+[ 4748] By: gsar on 2000/01/02 20:26:06
+ Log: MakeMaker should attempt to "require" rather than "use" prerequisites
+ to avoid imports (from Michael G Schwern <schwern@pobox.com>)
+ Branch: perl
+ ! lib/ExtUtils/MakeMaker.pm
+____________________________________________________________________________
+[ 4747] By: gsar on 2000/01/02 20:17:36
+ Log: fix 4-arg substr() when used as argument to subroutine
+ Branch: perl
+ ! pp.c t/op/substr.t
+____________________________________________________________________________
+[ 4746] By: gsar on 2000/01/02 18:45:58
+ Log: usethreads build fixups for NeXTstep (as suggested by Hans Mulder)
+ Branch: perl
+ ! embed.h embed.pl ext/DynaLoader/dl_beos.xs
+ ! ext/DynaLoader/dl_dlopen.xs ext/DynaLoader/dl_hpux.xs
+ ! ext/DynaLoader/dl_next.xs ext/DynaLoader/dl_rhapsody.xs
+ ! perlapi.c proto.h thread.h util.c
+____________________________________________________________________________
+[ 4745] By: gsar on 2000/01/02 18:15:44
+ Log: ebcdic fix for Data::Dumper from Peter Prymmer
+ Branch: perl
+ ! ext/Data/Dumper/Dumper.pm regcomp.c
+____________________________________________________________________________
+[ 4744] By: gsar on 1999/12/31 22:42:23
+ Log: missing files in previous submit
+ Branch: perl
+ ! embed.h embed.pl ext/Devel/DProf/DProf.xs globals.c
+ ! lib/ExtUtils/MM_Unix.pm objXSUB.h perlapi.c proto.h
+____________________________________________________________________________
+[ 4743] By: gsar on 1999/12/31 06:47:18
+ Log: various Windows build tweaks
+ Branch: perl
+ ! win32/win32.h
+____________________________________________________________________________
+[ 4742] By: gsar on 1999/12/30 21:32:36
+ Log: change#4705 breaks code that interpolates $], so leave string value
+ of $] as it was for compatibility (and perhaps introduce $^V or similar
+ for the utf8 representation, maybe?)
+ Branch: perl
+ ! configpm gv.c
+____________________________________________________________________________
+[ 4741] By: gsar on 1999/12/30 19:36:21
+ Log: avoid CRLF in byteloadable files created by perlcc
+ Branch: perl
+ ! utils/perlcc.PL
+____________________________________________________________________________
+[ 4740] By: gsar on 1999/12/30 19:35:07
+ Log: leave DATA open in binmode if __END__ line doesn't have CRLF
+ Branch: perl
+ ! pod/perldelta.pod toke.c
+____________________________________________________________________________
+[ 4739] By: gsar on 1999/12/30 05:44:21
+ Log: enable the PERL_BINMODE_SCRIPTS behavior by default on Windows
+ to allow ByteLoader to work; the DATA filehandles continue to
+ be left open in text mode for compatibility
+ Branch: perl
+ ! embed.h embed.pl objXSUB.h pod/perldelta.pod proto.h sv.c
+ ! toke.c win32/Makefile win32/makefile.mk win32/win32.c
+ ! win32/win32.h
+____________________________________________________________________________
+[ 4738] By: gsar on 1999/12/30 04:36:12
+ Log: CR-LF support broken for formats
+ Branch: perl
+ ! toke.c
+____________________________________________________________________________
+[ 4737] By: gsar on 1999/12/29 22:30:52
+ Log: make DProf functional under pseudo-fork()
+ Branch: perl
+ ! ext/Devel/DProf/DProf.xs
+____________________________________________________________________________
+[ 4736] By: gsar on 1999/12/29 21:04:59
+ Log: slurp mode fix in change#2910 wasn't quite right (spotted by Hans
+ Mulder)
+ Branch: perl
+ ! doio.c pp_hot.c t/io/argv.t
+____________________________________________________________________________
+[ 4735] By: gsar on 1999/12/29 18:12:40
+ Log: re.pm is needed earlier, xsubpp now uses it (spotted by Andreas
+ Koenig)
+ Branch: perl
+ ! Makefile.SH
+____________________________________________________________________________
+[ 4734] By: gsar on 1999/12/28 21:10:37
+ Log: Windows build tweaks
+ Branch: perl
+ ! INTERN.h sv.c
+____________________________________________________________________________
+[ 4733] By: gsar on 1999/12/28 20:45:15
+ Log: remove never-taken branch for making getc() operate on ARGV (spotted
+ by Ralph Corderoy <ralph@inputplus.demon.co.uk>)
+ Branch: perl
+ ! pp_sys.c
+____________________________________________________________________________
+[ 4732] By: gsar on 1999/12/28 20:42:13
+ Log: tests for change#4642 and pod fixups suggested by Ralph Corderoy
+ <ralph@inputplus.demon.co.uk>
+ Branch: perl
+ ! pod/perldelta.pod pod/perlfunc.pod pod/perlre.pod t/io/argv.t
+____________________________________________________________________________
+[ 4731] By: gsar on 1999/12/28 20:23:17
+ Log: optimize XSUBs to use targets if the -nooptimize xsubpp option is
+ not supplied (variant of patch suggested by Ilya Zakharevich)
+ Branch: perl
+ ! XSUB.h lib/ExtUtils/xsubpp
+____________________________________________________________________________
+[ 4730] By: gsar on 1999/12/28 19:55:56
+ Log: range operator does magical string increment iff both operands
+ are non-numbers, from Tom Phoenix <rootbeer@redcat.com>; fixed
+ the "foreach (RANGE)" case as well
+ Branch: perl
+ ! pp_ctl.c t/op/range.t
+____________________________________________________________________________
+[ 4729] By: gsar on 1999/12/28 18:40:19
+ Log: Win9x + GCC update from Benjamin Stuhl <sho_pi@hotmail.com>
+ Branch: perl
+ - win32/PerlCRT.def win32/gstartup.c win32/oldnames.def
+ ! EXTERN.h INTERN.h MANIFEST README.win32 iperlsys.h
+ ! lib/ExtUtils/MM_Win32.pm makedef.pl win32/Makefile
+ ! win32/config.gc win32/genmk95.pl win32/makefile.mk
+ ! win32/perlhost.h win32/perllib.c win32/runperl.c win32/win32.c
+ ! win32/win32.h
+____________________________________________________________________________
+[ 4728] By: gsar on 1999/12/28 07:44:19
+ Log: typecasts needed
+ Branch: perl
+ ! toke.c
+____________________________________________________________________________
+[ 4727] By: gsar on 1999/12/28 06:23:08
+ Log: change#4721 needed line number adjustments
+ Branch: perl
+ ! MANIFEST global.sym proto.h t/pragma/warn/doop
+ ! t/pragma/warn/pp t/pragma/warn/regcomp t/pragma/warn/sv
+ ! t/pragma/warn/toke t/pragma/warn/utf8
+____________________________________________________________________________
+[ 4726] By: gsar on 1999/12/28 04:18:15
+ Log: integrate utfperl contents into mainline
+ Branch: perl
+ +> lib/byte.pm lib/byte_heavy.pl
+ !> configpm embed.h embed.pl embedvar.h gv.c intrpvar.h objXSUB.h
+ !> patchlevel.h perl.c perl.h perlapi.c pp_ctl.c pp_hot.c proto.h
+ !> regnodes.h sv.c sv.h t/comp/require.t toke.c utf8.h
+____________________________________________________________________________
+[ 4725] By: gsar on 1999/12/28 04:08:09
+ Log: integrate mainline contents
+ Branch: utfperl
+ - ext/DynaLoader/dl_cygwin.xs lib/unicode/Eq/Latin1
+ - lib/unicode/Eq/Unicode
+ !> (integrate 60 files)
+____________________________________________________________________________
+[ 4724] By: gsar on 1999/12/28 03:44:10
+ Log: fix for /(^|a)b/ breakage from Ilya Zakharevich
+ Branch: perl
+ ! regcomp.c t/op/re_tests
+____________________________________________________________________________
+[ 4723] By: gsar on 1999/12/28 03:28:39
+ Log: more ebcdic testsuite fixups (from Peter Prymmer)
+ Branch: perl
+ ! Changes lib/bigfloat.pl t/lib/charnames.t t/lib/dumper.t
+ ! t/pragma/overload.t t/pragma/utf8.t
+____________________________________________________________________________
+[ 4722] By: gsar on 1999/12/28 03:14:48
+ Log: avoid "used once" warning
+ Branch: perl
+ ! lib/diagnostics.pm
+____________________________________________________________________________
+[ 4721] By: gsar on 1999/12/28 03:10:32
+ Log: ebcdic tweaks for tests from Peter Prymmer
+ Branch: perl
+ ! t/pragma/warn/doop t/pragma/warn/pp t/pragma/warn/regcomp
+ ! t/pragma/warn/sv t/pragma/warn/toke t/pragma/warn/utf8
+____________________________________________________________________________
+[ 4720] By: gsar on 1999/12/28 03:08:39
+ Log: pod nits from Simon Cozens <simon@brecon.co.uk> and others
+ Branch: perl
+ ! README.os2 lib/ExtUtils/Embed.pm lib/ExtUtils/Install.pm
+ ! lib/ExtUtils/Liblist.pm lib/ExtUtils/MakeMaker.pm
+ ! lib/ExtUtils/Mkbootstrap.pm pod/perlop.pod
+____________________________________________________________________________
+[ 4719] By: gsar on 1999/12/28 03:01:04
+ Log: perlport v1.45 from Chris Nandor
+ Branch: perl
+ ! pod/perlport.pod
+____________________________________________________________________________
+[ 4718] By: gsar on 1999/12/28 02:59:16
+ Log: newer version of constant.pm from Tom Phoenix; added Tom's notes to
+ perldelta; added STOP, DESTROY and AUTOLOAD to specials list
+ Branch: perl
+ ! lib/constant.pm pod/perldelta.pod pod/perlvar.pod
+ ! t/pragma/constant.t
+____________________________________________________________________________
+[ 4717] By: gsar on 1999/12/28 02:47:04
+ Log: cygwin update from Eric Fifer <EFifer@sanwaint.com>
+ Branch: perl
+ - ext/DynaLoader/dl_cygwin.xs
+ ! MAINTAIN MANIFEST ext/POSIX/POSIX.xs ext/SDBM_File/sdbm/pair.c
+ ! hints/cygwin.sh installperl mg.c pod/perlfaq3.pod t/op/stat.t
+ ! util.c
+____________________________________________________________________________
+[ 4716] By: gsar on 1999/12/28 02:40:51
+ Log: tweak to show up db-linked-with-libpthread-but-not-perl problem
+ (from Andy Dougherty)
+ Branch: perl
+ ! Configure
+____________________________________________________________________________
+[ 4715] By: gsar on 1999/12/28 02:38:44
+ Log: better variant of change#4644 (from Andy Dougherty)
+ Branch: perl
+ ! Configure
+____________________________________________________________________________
+[ 4714] By: gsar on 1999/12/28 02:36:40
+ Log: be defensive about setting {host,group,pass}cat (from Andy Dougherty)
+ Branch: perl
+ ! Configure
+____________________________________________________________________________
+[ 4713] By: gsar on 1999/12/28 02:35:15
+ Log: $sitelib should be $prefix/lib/perl5/site_perl, as documented in
+ INSTALL (from Andy Dougherty)
+ Branch: perl
+ ! Configure
+____________________________________________________________________________
+[ 4712] By: gsar on 1999/12/28 02:30:55
+ Log: avoid creating new files during make install
+ Branch: perl
+ ! Makefile.SH
+____________________________________________________________________________
+[ 4711] By: gsar on 1999/12/28 02:24:44
+ Log: pod edits from Paul Marquess and Mark-Jason Dominus
+ Branch: perl
+ ! AUTHORS Changes ext/DynaLoader/dl_aix.xs
+ ! ext/DynaLoader/dl_dlopen.xs lib/Net/Ping.pm pod/perlcall.pod
+ ! pod/perldelta.pod
+____________________________________________________________________________
+[ 4710] By: gsar on 1999/12/28 02:05:23
+ Log: miniperl build fixes for os2 (from Yitzchak Scott-Thoennes
+ <sthoenna@efn.org>); add explicit target for opmini.o
+ Branch: perl
+ ! Makefile.SH cygwin/Makefile.SHs os2/Makefile.SHs
+____________________________________________________________________________
+[ 4709] By: gsar on 1999/12/28 01:20:39
+ Log: partly fix perldiag regressions identified by Tom Christiansen
+ Branch: perl
+ ! doio.c lib/diagnostics.pm pod/perldiag.pod pp_hot.c pp_sys.c
+ ! t/pragma/warn/4lint t/pragma/warn/doio t/pragma/warn/pp_hot
+ ! t/pragma/warn/pp_sys
+____________________________________________________________________________
+[ 4708] By: gsar on 1999/12/27 23:33:24
+ Log: update perldiag for change#4707
+ Branch: perl
+ ! perl.c pod/perldiag.pod
+____________________________________________________________________________
+[ 4707] By: gsar on 1999/12/27 23:23:39
+ Log: allow spaces in -I switch argument
+ Branch: perl
+ ! perl.c
+____________________________________________________________________________
+[ 4706] By: gsar on 1999/12/26 23:44:53
+ Log: fix typos
+ Branch: utfperl
+ ! sv.h toke.c
+____________________________________________________________________________
+[ 4705] By: gsar on 1999/12/24 04:02:35
+ Log: support for v5.5.640 style version numbers
+ Branch: utfperl
+ ! configpm embedvar.h gv.c intrpvar.h objXSUB.h patchlevel.h
+ ! perl.c perl.h pp_ctl.c sv.c sv.h t/comp/require.t toke.c
+____________________________________________________________________________
+[ 4704] By: gsar on 1999/12/23 08:54:27
+ Log: bring in basic threads stuff under USE_ITHREADS
+ Branch: perl
+ ! makedef.pl op.c perl.c perl.h perlvars.h pp_sys.c thread.h
+ ! util.c
+____________________________________________________________________________
+[ 4703] By: gsar on 1999/12/23 00:10:06
+ Log: integrate mainline contents into utfperl
+ Branch: utfperl
+ !> (integrate 33 files)
+____________________________________________________________________________
+[ 4702] By: gsar on 1999/12/20 17:18:23
+ Log: virtual directory handling broken on paths with trailing slash
+ Branch: perl
+ ! win32/Makefile win32/makefile.mk win32/vdir.h
+____________________________________________________________________________
+[ 4701] By: gsar on 1999/12/20 17:09:55
+ Log: revert optimization in change#4700 (it appears OPpRUNTIME flag
+ isn't set for all m/$foo/o)
+ Branch: perl
+ ! pp_ctl.c
+____________________________________________________________________________
+[ 4700] By: gsar on 1999/12/20 16:28:51
+ Log: avoid pp_regcomp() changing optree at run time under USE_*THREADS (or
+ we have a race on our hands)
+ Branch: perl
+ ! pp_ctl.c
+____________________________________________________________________________
+[ 4699] By: gsar on 1999/12/20 16:19:00
+ Log: pod tweaks
+ Branch: perl
+ ! pod/perldelta.pod pod/perlfilter.pod pod/perlopentut.pod
+____________________________________________________________________________
+[ 4698] By: gsar on 1999/12/20 07:55:07
+ Log: uv_to_utf8() could lose 37th bit on HAS_QUAD platforms
+ Branch: perl
+ ! utf8.c
+____________________________________________________________________________
+[ 4697] By: gsar on 1999/12/18 01:35:50
+ Log: fix from Larry for parsing C<{ 0x1 => 'foo'}> as an
+ anon hash rather than a block; test case for the same
+ Branch: perl
+ ! t/comp/term.t toke.c
+____________________________________________________________________________
+[ 4696] By: gsar on 1999/12/17 19:55:03
+ Log: leak in change#4694 spotted by Larry
+ Branch: perl
+ ! hv.c
+____________________________________________________________________________
+[ 4695] By: gsar on 1999/12/17 18:14:11
+ Log: test case for change#4694
+ Branch: perl
+ ! t/op/delete.t
+____________________________________________________________________________
+[ 4694] By: gsar on 1999/12/17 18:09:08
+ Log: delete() should return the value as is, not a copy thereof
+ Branch: perl
+ ! hv.c pod/perldelta.pod
+____________________________________________________________________________
+[ 4693] By: gsar on 1999/12/17 17:45:58
+ Log: fix for C<"\nx\taa\n" =~ /^\S\s+aa$/m> (from Ilya Zakharevich)
+ Branch: perl
+ ! regexec.c t/op/re_tests
+____________________________________________________________________________
+[ 4692] By: gsar on 1999/12/17 17:41:10
+ Log: credits tweak
+ Branch: perl
+ ! lib/File/Spec.pm
+____________________________________________________________________________
+[ 4691] By: gsar on 1999/12/17 07:12:53
+ Log: DynaLoader doesn't build properly when $(DLSRC) changes
+ (fix suggested by Hans Mulder)
+ Branch: perl
+ ! ext/DynaLoader/Makefile.PL
+____________________________________________________________________________
+[ 4690] By: gsar on 1999/12/17 06:26:34
+ Log: add missing new ops
+ Branch: perl
+ ! ext/B/ramblings/runtime.porting
+____________________________________________________________________________
+[ 4689] By: gsar on 1999/12/17 06:16:49
+ Log: test harness tweak from Hans Mulder
+ Branch: perl
+ ! t/TEST
+____________________________________________________________________________
+[ 4688] By: gsar on 1999/12/17 06:14:23
+ Log: miniperl build fixes for NeXTstep and cygwin (from Hans Mulder
+ and Lucian CIONCA <Lucian.Cionca@algoritma.ro>)
+ Branch: perl
+ ! Makefile.SH cygwin/Makefile.SHs
+____________________________________________________________________________
+[ 4687] By: gsar on 1999/12/17 06:06:46
+ Log: applied suggested patch with whitespace adjustments
+ From: Helmut Jarausch <jarausch@numa1.igpm.rwth-aachen.de>
+ Date: Thu, 16 Dec 1999 08:57:55 +0100
+ Message-id: <38589B82.C4668E10@numa1.igpm.rwth-aachen.de>
+ Subject: Re: [ID 19991215.001] patch 5.005_63: Find::Fill cannot handle /
+ Branch: perl
+ ! lib/File/Find.pm
+____________________________________________________________________________
+[ 4686] By: gsar on 1999/12/17 05:48:53
+ Log: avoid warnings due to symbols unintroduced by XSLoader (spotted
+ by Hans Mulder)
+ Branch: perl
+ ! ext/DynaLoader/dl_dld.xs ext/DynaLoader/dl_hpux.xs
+ ! ext/DynaLoader/dl_mpeix.xs ext/DynaLoader/dl_next.xs
+ ! ext/DynaLoader/dl_rhapsody.xs
+____________________________________________________________________________
+[ 4685] By: gsar on 1999/12/17 05:37:51
+ Log: fix bug when one of the operands is +0E+0 (from Ronald J Kimball
+ <rjk@linguist.dartmouth.edu>)
+ Branch: perl
+ ! lib/Math/BigFloat.pm t/lib/bigfltpm.t
+____________________________________________________________________________
+[ 4684] By: gsar on 1999/12/16 09:32:48
+ Log: spell out how to get 4-digit year (from Micheal G Schwern
+ <schwern@pobox.com>)
+ Branch: perl
+ ! pod/perlfunc.pod
+____________________________________________________________________________
+[ 4683] By: gsar on 1999/12/16 09:26:53
+ Log: type mismatch for %c format argument (spotted by Robin Barker
+ <rmb1@cise.npl.co.uk>)
+ Branch: perl
+ ! regcomp.c
+____________________________________________________________________________
+[ 4682] By: gsar on 1999/12/16 08:33:28
+ Log: mingw32 doesn't have anonymous union (from Benjamin Stuhl
+ <sho_pi@hotmail.com>)
+ Branch: perl
+ ! win32/win32.c
+____________________________________________________________________________
+[ 4681] By: gsar on 1999/12/16 08:31:15
+ Log: missing backslash (spotted by Johan Vromans)
+ Branch: perl
+ ! perl.c
+____________________________________________________________________________
+[ 4680] By: gsar on 1999/12/16 08:26:00
+ Log: avoid coredump on diagnostics when STDERR is closed
+ Branch: perl
+ ! perl.h
+____________________________________________________________________________
+[ 4679] By: gsar on 1999/12/12 18:09:41
+ Log: integrate mainline changes
+ Branch: utfperl
+ +> (branch 39 files)
+ - lib/unicode/Jamo-2.txt lib/unicode/Unicode.html
+ - lib/unicode/UnicodeData-Latest.txt
+ !> (integrate 447 files)
+____________________________________________________________________________
+[ 4678] By: gsar on 1999/12/10 01:39:13
+ Log: interpreter structure should be nulled under -DMULTIPLICITY
+ Branch: perl
+ ! perl.c
+____________________________________________________________________________
+[ 4677] By: gsar on 1999/12/09 11:10:27
+ Log: update Changes
+ Branch: perl
+ ! Changes
+
+----------------
+Version 5.005_63
+----------------
+
+____________________________________________________________________________
+[ 4676] By: gsar on 1999/12/09 10:51:43
+ Log: fix File::Find testsuite bugs in symlink-less places
+ Branch: perl
+ ! t/lib/filefind.t
+____________________________________________________________________________
+[ 4675] By: gsar on 1999/12/09 10:22:31
+ Log: USE_ITHREADS tweaks and notes
+ Branch: perl
+ ! op.c pod/perldelta.pod sv.c
+____________________________________________________________________________
+[ 4674] By: gsar on 1999/12/09 10:21:53
+ Log: allow new style sort subs to work under usethreads
+ Branch: perl
+ ! pp_ctl.c
+____________________________________________________________________________
+[ 4673] By: gsar on 1999/12/09 04:00:23
+ Log: document compatibility issue with literal list slices and NOTOP
+ (C<not (1,2,3)[0]> is now a syntax error)
+ Branch: perl
+ ! pod/perldelta.pod
+____________________________________________________________________________
+[ 4672] By: gsar on 1999/12/09 01:14:46
+ Log: avoid mismatched expectation <-> int types for C++ builds
+ Branch: perl
+ ! embed.pl intrpvar.h proto.h toke.c
+____________________________________________________________________________
+[ 4671] By: gsar on 1999/12/09 00:36:24
+ Log: newer version of File::Find with support for following symlinks and
+ other features, from Helmut Jarausch <jarausch@igpm.rwth-aachen.de>
+ Branch: perl
+ ! lib/File/Find.pm pod/perldelta.pod t/lib/filefind.t
+____________________________________________________________________________
+[ 4670] By: gsar on 1999/12/09 00:13:06
+ Log: avoid initializing GvCV slot for autovivified filehandles
+ Branch: perl
+ ! pp.c
+____________________________________________________________________________
+[ 4669] By: gsar on 1999/12/08 19:09:27
+ Log: apply change#4618 again along with Ilya's patch to fix bugs
+ in it (see change#4622)
+ Branch: perl
+ ! embed.h embed.pl perl.h proto.h regcomp.c regcomp.h regexec.c
+ ! t/op/re_tests t/op/subst.t
+____________________________________________________________________________
+[ 4668] By: gsar on 1999/12/08 18:56:53
+ Log: patch to fix parser bug in C<${h{${a[0]}}} = 13>
+ From: Larry Wall <larry@wall.org>
+ Date: Tue, 7 Dec 1999 12:39:30 -0800 (PST)
+ Message-Id: <199912072039.MAA13257@kiev.wall.org>
+ Subject: Re: [ID 19991204.002] Inconsistency of ${hash{key}}
+ Branch: perl
+ ! embedvar.h intrpvar.h objXSUB.h sv.c toke.c
+____________________________________________________________________________
+[ 4667] By: gsar on 1999/12/08 18:47:37
+ Log: patch to fix aix hints from ortmann@vnet.ibm.com
+ Branch: perl
+ ! hints/aix.sh
+____________________________________________________________________________
+[ 4666] By: gsar on 1999/12/08 18:29:02
+ Log: documentation tweaks from M. J. T. Guy, Micheal Schwern, and
+ Tim Meadowcroft
+ Branch: perl
+ ! Changes lib/Benchmark.pm pod/perlipc.pod pod/perlre.pod
+____________________________________________________________________________
+[ 4665] By: gsar on 1999/12/08 02:22:31
+ Log: introduce save_I8() for saving byte values
+ Branch: perl
+ ! embed.h embed.pl global.sym objXSUB.h perlapi.c proto.h
+ ! regcomp.c regexec.c scope.c scope.h sv.c
+____________________________________________________________________________
+[ 4664] By: gsar on 1999/12/08 02:02:33
+ Log: use SAVEINT() rather than SAVEDESTRUCTOR() for saving PL_expect etc.
+ Branch: perl
+ ! toke.c
+____________________________________________________________________________
+[ 4663] By: gsar on 1999/12/08 01:11:44
+ Log: longstanding typo in lexer: PL_lex_expect was not properly
+ saved on reentry
+ Branch: perl
+ ! toke.c
+____________________________________________________________________________
+[ 4662] By: gsar on 1999/12/07 23:16:21
+ Log: typos in change#4546
+ Branch: perl
+ ! ext/B/B.xs ext/B/B/Bytecode.pm ext/B/B/C.pm sv.c
+____________________________________________________________________________
+[ 4661] By: gsar on 1999/12/07 09:33:50
+ Log: typos in change#4660
+ Branch: perl
+ ! embed.h embed.pl objXSUB.h perl.h perlapi.c pp_sys.c proto.h
+____________________________________________________________________________
+[ 4660] By: gsar on 1999/12/06 23:42:55
+ Log: tweaks for building with -DUSE_ITHREADS on !WIN32 platforms;
+ fix bug where lc($readonly) could result in bogus errors
+ Branch: perl
+ ! embed.h embed.pl iperlsys.h makedef.pl objXSUB.h perlapi.c
+ ! pp.c pp_sys.c proto.h sv.c
+____________________________________________________________________________
+[ 4659] By: gsar on 1999/12/06 15:24:31
+ Log: allow IRIX 6.5 to build perl (from Helmut Jarausch
+ <jarausch@igpm.rwth-aachen.de>)
+ Branch: perl
+ ! perl.h
+____________________________________________________________________________
+[ 4658] By: gsar on 1999/12/06 15:18:30
+ Log: fix for -Dp via $^D (suggested by Stephane Payrard
+ <stef@adnaccess.com>)
+ Branch: perl
+ ! mg.c
+____________________________________________________________________________
+[ 4657] By: gsar on 1999/12/06 06:50:01
+ Log: change#4641 needs perldiag.pod edit
+ Branch: perl
+ - lib/unicode/UnicodeData-Latest.txt
+ ! pod/perldiag.pod
+____________________________________________________________________________
+[ 4656] By: gsar on 1999/12/06 01:36:56
+ Log: Makefile tweak for change#4649
+ Branch: perl
+ ! Makefile.SH
+____________________________________________________________________________
+[ 4655] By: gsar on 1999/12/05 17:23:57
+ Log: change#4653 was missing a patch reject
+ Branch: perl
+ ! win32/makefile.mk
+____________________________________________________________________________
+[ 4654] By: gsar on 1999/12/05 11:41:04
+ Log: windows build tweaks for Borland compiler
+ Branch: perl
+ ! win32/makefile.mk win32/perlhost.h win32/win32.c win32/win32.h
+____________________________________________________________________________
+[ 4653] By: gsar on 1999/12/05 11:07:37
+ Log: applied somewhat modified version of suggested patch
+ From: "Benjamin Stuhl" <sho_pi@hotmail.com>
+ Date: Thu, 18 Nov 1999 18:45:27 PST
+ Message-ID: <19991119024527.72749.qmail@hotmail.com>
+ Subject: [PATCH 5.005_62] Perl on Win95, Mark IIB
+ Branch: perl
+ + win32/PerlCRT.def win32/gstartup.c win32/oldnames.def
+ ! MANIFEST ext/SDBM_File/Makefile.PL lib/ExtUtils/MM_Unix.pm
+ ! lib/ExtUtils/MM_Win32.pm win32/config_sh.PL win32/genmk95.pl
+ ! win32/makefile.mk win32/win32.h
+____________________________________________________________________________
+[ 4652] By: gsar on 1999/12/05 09:24:45
+ Log: From: Mike Hopkirk (hops) <hops@scoot.pdev.sco.com>
+ Date: Thu, 4 Nov 1999 16:34:23 -0800 (PST)
+ Message-Id: <199911050034.QAA06499@scoot.pdev.sco.com>
+ Subject: [ID 19991104.005] modified hints file for UnixWare7 ( svr5)
+ Branch: perl
+ ! Changes hints/svr5.sh
+____________________________________________________________________________
+[ 4651] By: gsar on 1999/12/05 09:01:19
+ Log: on dosish platforms, avoid infinite recursion in File::Path::mkpath()
+ when given non-existent drive names
+ Branch: perl
+ ! lib/File/Path.pm
+____________________________________________________________________________
+[ 4650] By: gsar on 1999/12/05 08:47:11
+ Log: windows build tweaks for change#4649
+ Branch: perl
+ ! win32/Makefile win32/makefile.mk
+____________________________________________________________________________
+[ 4649] By: gsar on 1999/12/05 07:49:28
+ Log: make File::Glob::glob() the default for CORE::glob()
+ (old csh glob can still be had with -DPERL_EXTERNAL_GLOB)
+ Branch: perl
+ ! Makefile.SH op.c pod/perldelta.pod win32/Makefile
+ ! win32/makefile.mk
+____________________________________________________________________________
+[ 4648] By: gsar on 1999/12/05 00:33:34
+ Log: fix bug in processing L<> tags (from j.vavruska@post.cz)
+ Branch: perl
+ ! lib/Pod/Html.pm
+____________________________________________________________________________
+[ 4647] By: gsar on 1999/12/05 00:14:01
+ Log: remove outdated entry
+ Branch: perl
+ ! pod/perltrap.pod
+____________________________________________________________________________
+[ 4646] By: gsar on 1999/12/04 22:48:51
+ Log: s/block/loop block/ in diagnostics about next, last, redo
+ Branch: perl
+ ! pod/perldiag.pod pp_ctl.c t/op/runlevel.t t/pragma/warn/pp_ctl
+____________________________________________________________________________
+[ 4645] By: gsar on 1999/12/04 22:25:32
+ Log: readability tweak suggested by GRommel@sears.com
+ Branch: perl
+ ! pp.c
+____________________________________________________________________________
+[ 4644] By: gsar on 1999/12/04 22:05:00
+ Log: Configure tweak from Peter Prymmer
+ Branch: perl
+ ! Configure
+____________________________________________________________________________
+[ 4643] By: gsar on 1999/12/04 21:55:27
+ Log: make weak keyword check look for defined(&lock), not
+ merely defined(*lock)
+ Branch: perl
+ ! toke.c
+____________________________________________________________________________
+[ 4642] By: gsar on 1999/12/04 21:11:51
+ Log: make eof() open ARGV if it isn't open already; also fixes bug
+ where eof() would operate on any last-read filehandle, not
+ just ARGV
+ Branch: perl
+ ! pp_sys.c
+____________________________________________________________________________
+[ 4641] By: gsar on 1999/12/04 04:42:25
+ Log: make uninitialized value warnings report opcode
+ Branch: perl
+ ! doio.c embed.h embed.pl global.sym objXSUB.h opcode.h
+ ! opcode.pl perl.h perlapi.c pp.c pp_hot.c proto.h sv.c
+ ! t/op/misc.t t/pragma/warn/1global t/pragma/warn/2use
+ ! t/pragma/warn/3both t/pragma/warn/4lint t/pragma/warn/7fatal
+ ! t/pragma/warn/doio t/pragma/warn/pp t/pragma/warn/pp_hot
+ ! t/pragma/warn/sv
+____________________________________________________________________________
+[ 4640] By: gsar on 1999/12/04 02:40:44
+ Log: provide explicit functions timegm_nocheck() and timelocal_nocheck()
+ that don't do range checking
+ Branch: perl
+ ! lib/Time/Local.pm
+____________________________________________________________________________
+[ 4639] By: gsar on 1999/12/04 01:00:49
+ Log: better implementation of change#3326; open(local $foo,...) now
+ allowed in addition to any uninitialized variable, for consistency
+ with how autovivification works elsewhere; add code to use the
+ variable name as the name of the handle for simple variables, so
+ that diagnostics report the handle: "... at - line 1, <$foo> line 10."
+ Branch: perl
+ ! op.c pod/perldelta.pod pp.c t/io/open.t
+____________________________________________________________________________
+[ 4638] By: gsar on 1999/12/03 21:20:00
+ Log: pod nits
+ Branch: perl
+ ! pod/perlfunc.pod pod/perlrun.pod
+____________________________________________________________________________
+[ 4637] By: gsar on 1999/12/03 08:59:04
+ Log: change#4431 was flawed
+ Branch: perl
+ ! Makefile.SH
+____________________________________________________________________________
+[ 4636] By: gsar on 1999/12/03 07:59:52
+ Log: pod embellishments from Nathan Torkington
+ Branch: perl
+ ! pod/perlfaq2.pod pod/perlhack.pod
+____________________________________________________________________________
+[ 4635] By: gsar on 1999/12/03 07:56:04
+ Log: perlfaq4 typo (from Jeff Pinyan <jeffp@crusoe.net>)
+ Branch: perl
+ ! pod/perlfaq4.pod
+____________________________________________________________________________
+[ 4634] By: gsar on 1999/12/03 07:47:47
+ Log: test tweak for VMS (from Craig A. Berry)
+ Branch: perl
+ ! t/io/nargv.t
+____________________________________________________________________________
+[ 4633] By: gsar on 1999/12/03 07:44:52
+ Log: patchls tweak from Andreas Koenig
+ Branch: perl
+ ! Porting/patchls
+____________________________________________________________________________
+[ 4632] By: gsar on 1999/12/03 07:42:23
+ Log: don't mess with the umask()
+ Branch: perl
+ ! installhtml installman installperl lib/ExtUtils/Install.pm
+ ! lib/ExtUtils/Manifest.pm
+____________________________________________________________________________
+[ 4631] By: gsar on 1999/12/03 06:52:50
+ Log: support -a switch to append bytecode to an existing file and make
+ perlcc use it (from Tom Hughes <tom@compton.nu>)
+ Branch: perl
+ ! ext/B/B/Bytecode.pm utils/perlcc.PL
+____________________________________________________________________________
+[ 4630] By: gsar on 1999/12/03 06:46:16
+ Log: document incompatible perl4 vec() vs bitwise ops interaction trap
+ (from Tom Phoenix)
+ Branch: perl
+ ! pod/perltrap.pod
+____________________________________________________________________________
+[ 4629] By: gsar on 1999/12/03 06:40:15
+ Log: use PerlIO abstraction rather than straight stdio (from
+ Chip Salzenberg)
+ Branch: perl
+ ! ext/ByteLoader/ByteLoader.xs
+____________________________________________________________________________
+[ 4628] By: gsar on 1999/12/03 06:15:54
+ Log: avoid warning in IO::Select::exists() if socket doesn't exist
+ Branch: perl
+ ! ext/IO/lib/IO/Select.pm
+____________________________________________________________________________
+[ 4627] By: gsar on 1999/12/03 06:05:19
+ Log: two small patches from Peter Prymmer <pvhp@forte.com>
+ Branch: perl
+ ! makedepend.SH win32/Makefile win32/makefile.mk
+____________________________________________________________________________
+[ 4626] By: gsar on 1999/12/03 05:36:38
+ Log: From: Peter Prymmer <pvhp@forte.com>
+ Date: Thu, 25 Nov 1999 21:06:19 -0800 (PST)
+ Message-Id: <199911260506.VAA17230@brio.forte.com>
+ Subject: [PATCH: 5.005_62] implement /[:ascii:]/ on ebcdic machines
+ Branch: perl
+ ! regcomp.c
+____________________________________________________________________________
+[ 4625] By: gsar on 1999/12/03 05:20:21
+ Log: Windows build tweaks due to change#4623
+ Branch: perl
+ ! win32/Makefile win32/makefile.mk win32/perlhost.h
+____________________________________________________________________________
+[ 4624] By: gsar on 1999/12/03 04:58:30
+ Log: add missing file
+ Branch: perl
+ + ext/DynaLoader/XSLoader_pm.PL
+____________________________________________________________________________
+[ 4623] By: gsar on 1999/12/03 04:47:03
+ Log: applied suggested patch; removed $VERSION = $VERSION hack
+ (change#4043 fixed the need for that)
+ From: Ilya Zakharevich <ilya@math.ohio-state.edu>
+ Date: Tue, 16 Nov 1999 01:50:31 EST
+ Message-Id: <199911160650.BAA18874@monk.mps.ohio-state.edu>
+ Subject: [PATCH 5.005_62] XSLoader.pm
+ Branch: perl
+ ! MANIFEST ext/B/B.pm ext/ByteLoader/ByteLoader.pm
+ ! ext/DB_File/DB_File.pm ext/Data/Dumper/Dumper.pm
+ ! ext/Devel/DProf/DProf.pm ext/Devel/Peek/Peek.pm
+ ! ext/DynaLoader/DynaLoader_pm.PL ext/DynaLoader/Makefile.PL
+ ! ext/DynaLoader/dlutils.c ext/Fcntl/Fcntl.pm
+ ! ext/File/Glob/Glob.pm ext/GDBM_File/GDBM_File.pm ext/IO/IO.pm
+ ! ext/NDBM_File/NDBM_File.pm ext/ODBM_File/ODBM_File.pm
+ ! ext/Opcode/Opcode.pm ext/POSIX/POSIX.pm
+ ! ext/SDBM_File/SDBM_File.pm ext/Socket/Socket.pm
+ ! ext/Thread/Thread.pm ext/attrs/attrs.pm ext/re/re.pm
+ ! lib/AutoLoader.pm lib/FindBin.pm lib/Getopt/Std.pm
+____________________________________________________________________________
+[ 4622] By: gsar on 1999/12/03 04:02:39
+ Log: revert change#4618 (breaks C<$_ = 'A:B'; s/^[a-z]:/x/>)
+ Branch: perl
+ ! Changes embed.h embed.pl perl.h proto.h regcomp.c regcomp.h
+____________________________________________________________________________
+[ 4621] By: gsar on 1999/12/02 22:24:53
+ Log: caveat about thread-safety of extensions
+ Branch: perl
+ ! pod/perlfork.pod
+____________________________________________________________________________
+[ 4620] By: gsar on 1999/12/02 20:31:02
+ Log: XS documentation patches suggested by Ilya, severally adjusted
+ Branch: perl
+ ! pod/perlxs.pod pod/perlxstut.pod
+____________________________________________________________________________
+[ 4619] By: gsar on 1999/12/02 17:52:50
+ Log: re-add missing Unicode database master
+ Branch: perl
+ + lib/unicode/Unicode.300
+____________________________________________________________________________
+[ 4618] By: gsar on 1999/12/02 06:56:18
+ Log: applied suggested patch with prototype changes
+ From: Ilya Zakharevich <ilya@math.ohio-state.edu>
+ Date: Tue, 23 Nov 1999 22:55:55 EST
+ Message-Id: <199911240355.WAA23033@monk.mps.ohio-state.edu>
+ Subject: [PATCH 5.005_62] First char cognizance
+ Branch: perl
+ ! embed.h embed.pl perl.h proto.h regcomp.c regcomp.h
+____________________________________________________________________________
+[ 4617] By: gsar on 1999/12/02 06:04:57
+ Log: fixes for bugs in change#4586 and OS/2 pod tweak, from Ilya
+ Branch: perl
+ ! os2/OS2/REXX/REXX.pm regexec.c t/op/re_tests
+____________________________________________________________________________
+[ 4616] By: gsar on 1999/12/02 04:30:22
+ Log: various documentation tweaks suggested by M. J. T. Guy
+ Branch: perl
+ ! INSTALL lib/strict.pm pod/perlfunc.pod pod/perlsyn.pod
+____________________________________________________________________________
+[ 4615] By: gsar on 1999/12/02 04:17:43
+ Log: various File::Glob fixes for DOSISH platforms
+ From: "Moore, Paul" <Paul.Moore@uk.origin-it.com>
+ Date: Tue, 02 Nov 1999 11:11:25 GMT
+ Message-Id: <714DFA46B9BBD0119CD000805FC1F53BDC38E3@UKRUX002.rundc.uk.origin-it.com>
+ Subject: File::Glob again. Final patch, honest!
+ Branch: perl
+ + t/lib/glob-case.t
+ ! MANIFEST ext/File/Glob/Changes ext/File/Glob/Glob.pm
+ ! ext/File/Glob/Glob.xs ext/File/Glob/bsd_glob.c
+ ! ext/File/Glob/bsd_glob.h op.c t/lib/glob-global.t
+____________________________________________________________________________
+[ 4614] By: gsar on 1999/12/02 03:42:55
+ Log: allow XSUBs and prototyped subroutines to be used with sort() (tweaked
+ variant of patch suggested by Peter Haworth <pmh@edison.ioppublishing.com>)
+ Branch: perl
+ ! pod/perldelta.pod pod/perlfunc.pod pp_ctl.c t/op/sort.t
+____________________________________________________________________________
+[ 4613] By: gsar on 1999/12/02 01:59:19
+ Log: ignore yet another known scalar leak
+ Branch: perl
+ ! t/pragma/warn/regcomp
+____________________________________________________________________________
+[ 4612] By: gsar on 1999/12/02 01:15:02
+ Log: avoid potential stack extension bug in pp_unpack() (spotted by Ilya)
+ Branch: perl
+ ! pp.c
+____________________________________________________________________________
+[ 4611] By: gsar on 1999/12/02 00:31:43
+ Log: a somewhat tweaked version of suggested patch
+ From: Ilya Zakharevich <ilya@math.ohio-state.edu>
+ Date: Wed, 27 Oct 1999 18:57:41 -0400 (EDT)
+ Message-Id: <199910272257.SAA29928@monk.mps.ohio-state.edu>
+ Subject: [PATCH 5.005_62] Another round of pack/vec docs patches
+ Branch: perl
+ ! pod/perlfunc.pod
+____________________________________________________________________________
+[ 4610] By: gsar on 1999/12/01 19:09:31
+ Log: more accurate require() pseudocode (from James P. Williams
+ <James.P.Williams@USAHQ.UnitedSpaceAlliance.com>)
+ Branch: perl
+ ! pod/perlfunc.pod
+____________________________________________________________________________
+[ 4609] By: gsar on 1999/12/01 18:43:49
+ Log: avoid "Callback called exit" error on intentional exit()
+ Branch: perl
+ ! embedvar.h intrpvar.h objXSUB.h perl.c perl.h pp_ctl.c
+____________________________________________________________________________
+[ 4608] By: gsar on 1999/12/01 18:42:38
+ Log: find_byclass() prototype was incoherent
+ Branch: perl
+ ! regexec.c
+____________________________________________________________________________
+[ 4607] By: gsar on 1999/12/01 05:45:10
+ Log: better documentation for goto &NAME (from M. J. T. Guy)
+ Branch: perl
+ ! pod/perlfunc.pod
+____________________________________________________________________________
+[ 4606] By: gsar on 1999/12/01 05:33:14
+ Log: integrate cfgperl contents into mainline
+ Branch: perl
+ +> lib/unicode/Jamo.txt lib/unicode/NamesList.html
+ +> lib/unicode/UCD300.html lib/unicode/Unicode3.html
+ - lib/unicode/Jamo-2.txt lib/unicode/Unicode.html
+ ! Changes
+ !> (integrate 210 files)
+____________________________________________________________________________
+[ 4605] By: gsar on 1999/12/01 05:15:27
+ Log: avoid PTR->IV cast warnings
+ Branch: perl
+ ! mg.c op.c scope.h
+____________________________________________________________________________
+[ 4604] By: gsar on 1999/12/01 03:59:56
+ Log: email address changes
+ Branch: perl
+ ! AUTHORS Changes Porting/genlog Porting/p4d2p Porting/p4desc
+ ! README.win32 ext/Data/Dumper/Dumper.pm lib/DB.pm
+ ! lib/File/DosGlob.pm lib/Math/Complex.pm lib/Math/Trig.pm
+ ! pod/perl5005delta.pod pod/perlport.pod t/op/runlevel.t
+ ! utils/perlbug.PL utils/perldoc.PL win32/bin/perlglob.pl
+____________________________________________________________________________
+[ 4603] By: gsar on 1999/12/01 03:45:13
+ Log: minor USE_ITHREADS tweaks
+ Branch: perl
+ ! doio.c op.c op.h pp_hot.c pp_sys.c run.c win32/Makefile
+ ! win32/perllib.c win32/win32.h
+____________________________________________________________________________
+[ 4602] By: gsar on 1999/12/01 01:00:09
+ Log: more complete pseudo-fork() support for Windows
+ Branch: perl
+ + pod/perlfork.pod win32/perlhost.h win32/vdir.h win32/vmem.h
+ ! MANIFEST XSUB.h cop.h dump.c embed.h embed.pl embedvar.h
+ ! ext/B/B/CC.pm ext/Opcode/Opcode.xs global.sym globals.c
+ ! globvar.sym gv.c hv.c intrpvar.h iperlsys.h makedef.pl mg.c
+ ! mpeix/mpeixish.h objXSUB.h op.c op.h os2/os2ish.h perl.c
+ ! perl.h perlapi.c plan9/plan9ish.h pod/Makefile pod/buildtoc
+ ! pod/perl.pod pod/roffitall pp.c pp_ctl.c pp_hot.c pp_sys.c
+ ! proto.h regcomp.c run.c scope.c scope.h sv.c t/op/fork.t
+ ! toke.c unixish.h util.c vos/vosish.h win32/Makefile
+ ! win32/makefile.mk win32/perllib.c win32/win32.c win32/win32.h
+ ! win32/win32iop.h win32/win32thread.h
+____________________________________________________________________________
+[ 4601] By: gsar on 1999/12/01 00:45:38
+ Log: rudimentary support for remote debugging, from aeons ago (somewhat
+ modified)
+ From: Graham TerMarsch <grahamt@ActiveState.com>
+ Date: Sat, 12 Sep 1998 10:46:55 -0700
+ Message-ID: <35FAB38F.EA9AAC50@activestate.com>
+ Subject: Re: Patches to perl5db.pl to allow for remote debugging
+ Branch: perl
+ ! lib/perl5db.pl
+____________________________________________________________________________
+[ 4600] By: chip on 1999/11/19 21:16:00
+ Log: Document known limitations of fdopen() on some systems,
+ as they apply to open() and sysopen().
+ Branch: perl
+ ! pod/perlfunc.pod
+____________________________________________________________________________
+[ 4599] By: chip on 1999/11/19 17:20:19
+ Log: Undef printf before redirecting it to PerlIO_stdoutf.
+ (Avoids an irritating warning when compiling with PerlIO.)
+ Branch: perl
+ ! perl.h
+____________________________________________________________________________
+[ 4598] By: jhi on 1999/11/22 21:30:17
+ Log: Small VMS nits from Craig A. Berry, <craig.berry@metamor.com>.
+ Branch: cfgperl
+ ! README.vms t/io/open.t
+____________________________________________________________________________
+[ 4597] By: jhi on 1999/11/21 16:21:21
+ Log: Replace #4596 with the change done in 5.005_03.
+ Branch: cfgperl
+ ! ext/Errno/Errno_pm.PL
+____________________________________________________________________________
+[ 4596] By: jhi on 1999/11/21 16:07:20
+ Log: Skip processing a file if the file to be opened is '-'
+ (can happen in UNICOS)
+ Branch: cfgperl
+ ! ext/Errno/Errno_pm.PL
+____________________________________________________________________________
+[ 4595] By: jhi on 1999/11/21 14:05:10
+ Log: VMS patches from Peter Prymmer.
+ Branch: cfgperl
+ ! doio.c mg.c taint.c vms/subconfigure.com vms/vms.c
+____________________________________________________________________________
+[ 4594] By: jhi on 1999/11/18 17:07:14
+ Log: The find_byclass prototype is already in proto.h.
+ Branch: cfgperl
+ ! regexec.c
+____________________________________________________________________________
+[ 4593] By: gsar on 1999/11/16 21:25:21
+ Log: typo in flag checks
+ Branch: utfperl
+ ! sv.h
+____________________________________________________________________________
+[ 4592] By: jhi on 1999/11/16 21:17:25
+ Log: Regen Configure.
+ Branch: cfgperl
+ ! Configure config_h.SH pp.c pp.h vms/subconfigure.com
+ Branch: metaconfig
+ ! U/a_dvisory/quadtype.U
+____________________________________________________________________________
+[ 4591] By: jhi on 1999/11/16 14:53:19
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ !> cop.h deb.c embed.h embed.pl global.sym lib/Pod/Checker.pm
+ !> lib/Pod/InputObjects.pm lib/Pod/Parser.pm lib/Pod/Select.pm
+ !> lib/Pod/Usage.pm makedef.pl objXSUB.h perl.c perlapi.c
+ !> pod/podchecker.PL pp_sys.c proto.h sv.c t/pod/poderrs.t
+ !> t/pod/poderrs.xr
+____________________________________________________________________________
+[ 4590] By: gsar on 1999/11/16 05:57:56
+ Log: Pod::Parser updates (v1.091) from Brad Appleton <bradapp@enteract.com>
+ Branch: perl
+ ! lib/Pod/Checker.pm lib/Pod/InputObjects.pm lib/Pod/Parser.pm
+ ! lib/Pod/Select.pm lib/Pod/Usage.pm pod/podchecker.PL
+ ! t/pod/poderrs.t t/pod/poderrs.xr
+____________________________________________________________________________
+[ 4589] By: gsar on 1999/11/15 18:47:34
+ Log: add a synchronous stub fork() for USE_ITHREADS to prove that a simple
+ C<if (fork()) { print "parent" } else { print "child" }> works on
+ Windows (incidentally running a cloned^2 interpreter :)
+ Branch: perl
+ ! embed.h embed.pl global.sym makedef.pl objXSUB.h perlapi.c
+ ! pp_sys.c proto.h sv.c
+____________________________________________________________________________
+[ 4588] By: gsar on 1999/11/15 14:34:36
+ Log: cloning the stack (part 1)
+ Branch: perl
+ ! cop.h deb.c perl.c sv.c
+____________________________________________________________________________
+[ 4587] By: jhi on 1999/11/15 00:22:20
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ !> Changes embed.h embed.pl embedvar.h global.sym intrpvar.h
+ !> makedef.pl objXSUB.h op.c perl.h perlapi.c proto.h run.c sv.c
+ !> win32/perllib.c
+____________________________________________________________________________
+[ 4586] By: jhi on 1999/11/14 21:17:26
+ Log: Ilya's "hopscotch" patch, reworked by Ilya to fit.
+ Branch: cfgperl
+ ! embed.h embed.pl embedvar.h proto.h regexec.c t/op/re_tests
+____________________________________________________________________________
+[ 4585] By: gsar on 1999/11/14 20:01:45
+ Log: tweak for win32 build
+ Branch: perl
+ ! embed.h embed.pl op.c proto.h
+____________________________________________________________________________
+[ 4584] By: gsar on 1999/11/14 19:46:25
+ Log: cosmetic tweaks
+ Branch: perl
+ ! embed.h embed.pl embedvar.h global.sym intrpvar.h makedef.pl
+ ! objXSUB.h perl.h perlapi.c proto.h sv.c win32/perllib.c
+____________________________________________________________________________
+[ 4583] By: gsar on 1999/11/14 17:38:32
+ Log: fix problem pointer casts
+ Branch: perl
+ ! Changes run.c sv.c
+____________________________________________________________________________
+[ 4582] By: jhi on 1999/11/14 17:10:01
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ !> cop.h dump.c ext/Opcode/Opcode.xs gv.c op.c perl.c perly.c
+ !> perly.y pp_ctl.c pp_sys.c sv.c t/op/misc.t toke.c util.c
+ !> vms/perly_c.vms win32/perllib.c
+____________________________________________________________________________
+[ 4581] By: jhi on 1999/11/14 17:08:23
+ Log: The separation of 64-bitness and largefileness continues
+ (with a setback, see hpux.sh).
+ Branch: cfgperl
+ ! Configure MANIFEST config_h.SH hints/aix.sh hints/hpux.sh
+ ! hints/solaris_2.sh
+ Branch: metaconfig
+ ! U/threads/archname.U U/typedefs/lseektype.U
+ Branch: metaconfig/U/perl
+ ! fpossize.U use64bits.U uselfs.U
+____________________________________________________________________________
+[ 4580] By: jhi on 1999/11/14 13:26:41
+ Log: Another Unicode update.
+ Branch: cfgperl
+ + lib/unicode/Jamo.txt lib/unicode/NamesList.html
+ + lib/unicode/UCD300.html lib/unicode/Unicode3.html
+ - lib/unicode/Jamo-2.txt lib/unicode/Unicode.html
+ ! (edit 189 files)
+____________________________________________________________________________
+[ 4579] By: gsar on 1999/11/14 10:21:49
+ Log: sundry cleanups for cloned interpreters (only known failure mode
+ is due to regexps keeping non-constant data in their compiled
+ structures)
+ Branch: perl
+ ! cop.h dump.c ext/Opcode/Opcode.xs gv.c op.c perl.c pp_ctl.c
+ ! pp_sys.c sv.c toke.c util.c win32/perllib.c
+____________________________________________________________________________
+[ 4578] By: gsar on 1999/11/14 03:37:37
+ Log: fix bug in change#4515 (STOP blocks now see @ARGV like the rest)
+ Branch: perl
+ ! perly.c perly.y t/op/misc.t vms/perly_c.vms
+____________________________________________________________________________
+[ 4577] By: jhi on 1999/11/13 19:50:24
+ Log: Change #4576 accidentally leaked also parts of
+ Ilya's patch that won't apply cleanly anymore.
+ Branch: cfgperl
+ ! regexec.c t/op/re_tests
+____________________________________________________________________________
+[ 4576] By: jhi on 1999/11/13 19:43:37
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ ! embed.h embed.pl embedvar.h proto.h regexec.c t/op/re_tests
+ !> ext/Errno/Errno_pm.PL ext/IO/lib/IO/Socket.pm t/lib/dumper.t
+ !> t/op/regexp.t t/pragma/overload.t
+____________________________________________________________________________
+[ 4575] By: gsar on 1999/11/13 19:41:46
+ Log: typos in change#4561 and change#4565
+ Branch: perl
+ ! ext/Errno/Errno_pm.PL ext/IO/lib/IO/Socket.pm
+____________________________________________________________________________
+[ 4574] By: gsar on 1999/11/13 19:31:19
+ Log: revert non-kosher parts of change#4562 (sort order problems
+ should be ignored (on ebcdic) by fixing dumper.t/T() to sort
+ result and expected lines; /[:ascii:]/ not working should be
+ fixed, not ignored in regexp.t; result from sort should be
+ fixed to be ascii portable on ebcdic, not ebcdic-specific)
+ Branch: perl
+ ! t/lib/dumper.t t/op/regexp.t t/pragma/overload.t
+____________________________________________________________________________
+[ 4573] By: gsar on 1999/11/13 19:13:04
+ Log: integrate cfgperl changes into mainline
+ Branch: perl
+ +> lib/unicode/Eq/Latin1.pl lib/unicode/Eq/Unicode.pl
+ +> lib/unicode/In/BopomofoExtended.pl
+ +> lib/unicode/In/BraillePatterns.pl
+ +> lib/unicode/In/CJKRadicalsSupplement.pl
+ +> lib/unicode/In/CJKUnifiedIdeographsExtensionA.pl
+ +> lib/unicode/In/Cherokee.pl
+ +> lib/unicode/In/IdeographicDescriptionCharacters.pl
+ +> lib/unicode/In/KangxiRadicals.pl lib/unicode/In/Khmer.pl
+ +> lib/unicode/In/Mongolian.pl lib/unicode/In/Myanmar.pl
+ +> lib/unicode/In/Ogham.pl lib/unicode/In/Runic.pl
+ +> lib/unicode/In/Sinhala.pl lib/unicode/In/Syriac.pl
+ +> lib/unicode/In/Thaana.pl
+ +> lib/unicode/In/UnifiedCanadianAboriginalSyllabics.pl
+ +> lib/unicode/In/YiRadicals.pl lib/unicode/In/YiSyllables.pl
+ - lib/unicode/Eq/Latin1 lib/unicode/Eq/Unicode
+ !> (integrate 213 files)
+____________________________________________________________________________
+[ 4572] By: jhi on 1999/11/13 18:44:50
+ Log: From: "Craig A. Berry" <craig.berry@metamor.com>
+ To: perl5-porters@perl.org, VMSPERL@perl.org
+ Subject: [PATCH 5.005_03 and 5.005_62] updates to README.vms
+ Date: Wed, 27 Oct 1999 11:02:54 -0500
+ Message-Id: <4.2.0.58.19991027105257.00addc10@mmtnt11.metamor.com>
+ Branch: cfgperl
+ ! README.vms
+____________________________________________________________________________
+[ 4571] By: jhi on 1999/11/13 18:33:39
+ Log: From: jand@activestate.com (Jan Dubois)
+ To: perl5-porters@perl.org, Perl-Win32-Porters@activestate.com
+ Cc: Douglas Lankshear <dougl@activestate.com>,
+ Gurusamy Sarathy <gsar@activestate.com>
+ Subject: [5.005_62 PATCH] support link() on WinNT and NTFS
+ Date: Tue, 09 Nov 1999 00:38:33 +0100
+ Message-ID: <382b5d24.10899522@smtprelay.t-online.de>
+ Branch: cfgperl
+ ! XSUB.h iperlsys.h pp_sys.c t/io/fs.t win32/config.bc
+ ! win32/config.gc win32/config.vc win32/config_H.bc
+ ! win32/config_H.gc win32/config_H.vc win32/perllib.c
+ ! win32/win32.c win32/win32iop.h
+____________________________________________________________________________
+[ 4570] By: jhi on 1999/11/13 18:30:37
+ Log: From: Ilya Zakharevich <ilya@math.ohio-state.edu>
+ To: perl5-porters@perl.org (Mailing list Perl5)
+ Subject: [PATCH 5.005_62] makedef.pl goof
+ Date: Mon, 8 Nov 1999 23:55:21 -0500 (EST)
+ Message-Id: <199911090455.XAA25627@monk.mps.ohio-state.edu>
+ Branch: cfgperl
+ ! makedef.pl
+____________________________________________________________________________
+[ 4569] By: jhi on 1999/11/13 18:06:54
+ Log: From: Michael G Schwern <schwern@pobox.com>
+ To: perl5-porters@perl.org, pod-people@perl.org
+ Cc: tchrist@mox.perl.com, gnat@frii.com
+ Subject: [DOCPATCH 5.005_62 perlfaq9.pod] Mention HTML::FormatText
+ Date: Wed, 10 Nov 1999 17:21:46 -0500
+ Message-ID: <19991110172146.A23527@athens.aocn.com>
+ Branch: cfgperl
+ ! pod/perlfaq9.pod
+____________________________________________________________________________
+[ 4568] By: jhi on 1999/11/13 18:05:33
+ Log: From: "Paul Moore" <gustav@morpheus.demon.co.uk>
+ To: <perl5-porters@perl.org>
+ Subject: DynaLoader_pm.PL patch (backslashes in strings)
+ Date: Wed, 10 Nov 1999 22:52:02 -0000
+ Message-ID: <LPBBIIMJKJMPNOGHGLLCMEBFCAAA.gustav@morpheus.demon.co.uk>
+ Branch: cfgperl
+ ! ext/DynaLoader/DynaLoader_pm.PL
+____________________________________________________________________________
+[ 4567] By: jhi on 1999/11/13 18:03:52
+ Log: From: JD Laub <jdl@access-health.com>
+ To: perl5-porters@perl.org
+ Subject: [ID 19991112.002] patch: Exporter.pm not reporting path
+ Date: Fri, 12 Nov 1999 08:58:28 -0700 (MST)
+ Message-Id: <199911121558.IAA08915@mocha.iasi.com>
+ Branch: cfgperl
+ ! lib/Exporter/Heavy.pm
+____________________________________________________________________________
+[ 4566] By: jhi on 1999/11/13 18:01:24
+ Log: From: Bernard Quatermass <bernard@quatermass.co.uk>
+ To: perl5-porters@perl.org
+ Subject: small patch for perldoc
+ Date: Fri, 12 Nov 1999 23:11:43 GMT
+ Message-Id: <VA.0000001c.00d1e05a@quatermass.co.uk>
+ Branch: cfgperl
+ ! utils/perldoc.PL
+____________________________________________________________________________
+[ 4565] By: jhi on 1999/11/13 17:58:54
+ Log: From: Scott Gifford <sgifford@tir.com>
+ To: perl5-porters@perl.org
+ Cc: gbarr@pobox.com
+ Subject: [ID 19991112.004] Bug in IO::Socket (patch included)
+ Date: 12 Nov 1999 18:55:30 -0500
+ Message-Id: <m3emdvw9hp.fsf@sgifford.tir.com>
+ Branch: cfgperl
+ ! ext/IO/lib/IO/Socket.pm
+____________________________________________________________________________
+[ 4564] By: jhi on 1999/11/13 17:45:39
+ Log: Applied manually:
+ From: "Craig A. Berry" <craig.berry@metamor.com>
+ To: perl5-porters@perl.org, VMSPERL@perl.org
+ Subject: [PATCH 5.005_62] patches required to build on VMS
+ Date: Tue, 09 Nov 1999 18:16:14 -0600
+ Message-Id: <4.2.2.19991109173839.00d12630@mmtnt11.metamor.com>
+ Branch: cfgperl
+ ! configure.com vms/descrip_mms.template vms/subconfigure.com
+ ! vms/vms.c vms/vmsish.h
+____________________________________________________________________________
+[ 4563] By: jhi on 1999/11/13 17:18:41
+ Log: Regen Unicode tables to include a warning:
+ Thou Shalt Not Edit Them By Hand; add missing
+ (Unicode 2.0 -introduced) tables to MANIFEST;
+ convert the equivalence tables to be valid Perl code.
+ Branch: cfgperl
+ + lib/unicode/Eq/Latin1.pl lib/unicode/Eq/Unicode.pl
+ + lib/unicode/In/BopomofoExtended.pl
+ + lib/unicode/In/BraillePatterns.pl
+ + lib/unicode/In/CJKRadicalsSupplement.pl
+ + lib/unicode/In/CJKUnifiedIdeographsExtensionA.pl
+ + lib/unicode/In/Cherokee.pl
+ + lib/unicode/In/IdeographicDescriptionCharacters.pl
+ + lib/unicode/In/KangxiRadicals.pl lib/unicode/In/Khmer.pl
+ + lib/unicode/In/Mongolian.pl lib/unicode/In/Myanmar.pl
+ + lib/unicode/In/Ogham.pl lib/unicode/In/Runic.pl
+ + lib/unicode/In/Sinhala.pl lib/unicode/In/Syriac.pl
+ + lib/unicode/In/Thaana.pl
+ + lib/unicode/In/UnifiedCanadianAboriginalSyllabics.pl
+ + lib/unicode/In/YiRadicals.pl lib/unicode/In/YiSyllables.pl
+ - lib/unicode/Eq/Latin1 lib/unicode/Eq/Unicode
+ ! (edit 169 files)
+____________________________________________________________________________
+[ 4562] By: jhi on 1999/11/13 16:53:00
+ Log: From: Peter Prymmer <pvhp@forte.com>
+ To: gsar@activestate.com, perl-mvs@perl.org, perlbug@perl.com
+ Subject: [PATCH: 5.005_62]was Re: [ID 19991102.003] perl on os390
+ Date: Wed, 10 Nov 1999 14:34:36 -0800 (PST)
+ Message-Id: <199911102234.OAA01018@brio.forte.com>
+ Branch: cfgperl
+ ! t/lib/dumper.t t/op/pack.t t/op/regexp.t t/pragma/locale.t
+ ! t/pragma/overload.t
+____________________________________________________________________________
+[ 4561] By: jhi on 1999/11/13 16:29:37
+ Log: $Config{myarchname} is not a good architecture identifier
+ because it may contain host/node identification like
+ CPU serial numbers.
+ Branch: cfgperl
+ ! ext/Errno/Errno_pm.PL
+____________________________________________________________________________
+[ 4560] By: jhi on 1999/11/13 16:26:13
+ Log: Continue largefileness separation from quadness;
+ move nv-preserving test out of perl.h into Configure;
+ use HAS_SETVBUF in IO.
+ Branch: cfgperl
+ ! Configure Porting/Glossary Porting/config.sh Porting/config_H
+ ! config_h.SH ext/IO/IO.xs hints/solaris_2.sh perl.h pp_sys.c
+ Branch: metaconfig
+ ! U/a_dvisory/quadtype.U
+ Branch: metaconfig/U/perl
+ + nvpresuv.U
+ ! d_fseeko.U d_ftello.U io64.U perlxv.U
+____________________________________________________________________________
+[ 4559] By: jhi on 1999/11/13 13:46:38
+ Log: Try to fix largefileness so that it "works" without a quad IV.
+ Branch: cfgperl
+ ! Configure Porting/Glossary Porting/config.sh Porting/config_H
+ ! config_h.SH perl.h pp_sys.c t/lib/syslfs.t t/op/lfs.t
+ Branch: metaconfig
+ ! U/a_dvisory/quadtype.U U/typedefs/lseektype.U
+ Branch: metaconfig/U/perl
+ ! io64.U
+____________________________________________________________________________
+[ 4558] By: jhi on 1999/11/13 11:36:19
+ Log: Undo drift from mainline.
+ Branch: cfgperl
+ ! regcomp.c util.c utils/h2xs.PL
+____________________________________________________________________________
+[ 4557] By: gsar on 1999/11/13 10:54:46
+ Log: typo
+ Branch: perl
+ ! util.c
+____________________________________________________________________________
+[ 4556] By: gsar on 1999/11/13 10:53:41
+ Log: integrate cfgperl contents (op.[ch] needed manual resolve)
+ Branch: perl
+ +> epoc/Config.pm epoc/autosplit.pl epoc/createpkg.pl
+ +> epoc/epoc_stubs.c
+ !> (integrate 48 files)
+____________________________________________________________________________
+[ 4555] By: jhi on 1999/11/13 10:05:54
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ !> dump.c ext/Devel/DProf/DProf.xs gv.c mg.c op.c perl.c pp.c
+ !> sv.c warnings.h warnings.pl win32/Makefile win32/perllib.c
+____________________________________________________________________________
+[ 4554] By: jhi on 1999/11/13 10:03:07
+ Log: s/_SIGN$/_sign/g;
+ Branch: metaconfig
+ ! U/typedefs/gidsign.U U/typedefs/pidsign.U U/typedefs/uidsign.U
+____________________________________________________________________________
+[ 4553] By: gsar on 1999/11/13 02:17:53
+ Log: cloned interpreters now actually run and pass all but 55/10386
+ subtests; various subtle bugs, new and old, observed when running
+ cloned interpreters have been fixed
+
+ still to do:
+ | * dup psig_ptr table
+ | * merge PADOP GVs support with "our" SVs (existing PADOPs are too
+ | simple-minded and grab one pad entry each, heavily bloating
+ | the pad by not avoiding dups)
+ | * overloaded constants are not really immutable--they need to
+ | be PADOPs
+ | * allocator for constants and OPs need to be spelled differently
+ | (shared vs interpreter-local allocations)
+ | * optree refcounting is still missing locking (macros are in place)
+ | * curstackinfo, {mark,scope,save,ret}stack need to be cloned so
+ | perl_clone() can be called from within runops*()
+ Branch: perl
+ ! dump.c ext/Devel/DProf/DProf.xs gv.c mg.c op.c perl.c pp.c
+ ! sv.c warnings.h warnings.pl win32/Makefile win32/perllib.c
+____________________________________________________________________________
+[ 4552] By: jhi on 1999/11/11 23:17:43
+ Log: Turn on largefileness always if available and
+ continue 64-bit fixes.
+ Branch: cfgperl
+ ! Configure config_h.SH handy.h hints/aix.sh hints/dec_osf.sh
+ ! hints/hpux.sh hints/irix_6.sh hints/solaris_2.sh perl.h pp.c
+ ! sv.c t/lib/syslfs.t t/op/lfs.t utf8.c
+____________________________________________________________________________
+[ 4551] By: jhi on 1999/11/11 23:16:15
+ Log: Split int64type from i_inttypes, rename quadcase into quadkind.
+ Branch: metaconfig
+ ! U/a_dvisory/quadtype.U
+ Branch: metaconfig/U/perl
+ + d_int64t.U
+ ! i_inttypes.U io64.U
+____________________________________________________________________________
+[ 4550] By: jhi on 1999/11/11 20:24:55
+ Log: Fix a thinko in 4548.
+ Branch: cfgperl
+ ! pp_sys.c
+____________________________________________________________________________
+[ 4549] By: jhi on 1999/11/11 19:48:21
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ !> (integrate 56 files)
+____________________________________________________________________________
+[ 4548] By: jhi on 1999/11/11 19:41:56
+ Log: Try to do something if st_size, st_uid, st_gid are too big for an IV;
+ regen Configure.
+ Branch: cfgperl
+ ! Configure Porting/Glossary Porting/config.sh Porting/config_H
+ ! config_h.SH pp_sys.c
+____________________________________________________________________________
+[ 4547] By: jhi on 1999/11/11 19:40:38
+ Log: s/_SIZE$/_size/g; add sizesize and ssizesize.
+ Branch: metaconfig
+ + U/typedefs/sizesize.U U/typedefs/ssizesize.U
+ ! U/typedefs/gidsize.U U/typedefs/pidsize.U U/typedefs/uidsize.U
+____________________________________________________________________________
+[ 4546] By: gsar on 1999/11/11 10:32:54
+ Log: avoid stash pointers in optree under USE_ITHREADS
+ Branch: perl
+ ! bytecode.pl cop.h ext/B/B.xs ext/B/B/Asmdata.pm
+ ! ext/B/B/Bytecode.pm ext/B/B/C.pm ext/B/B/Debug.pm
+ ! ext/B/B/Deparse.pm ext/ByteLoader/bytecode.h
+ ! ext/ByteLoader/byterun.c ext/ByteLoader/byterun.h
+ ! ext/Opcode/Opcode.xs gv.c op.c perl.c pp.c pp_ctl.c pp_hot.c
+ ! scope.h sv.c
+____________________________________________________________________________
+[ 4545] By: gsar on 1999/11/11 06:04:20
+ Log: another change towards a shareable optree: avoid pointer to filegv
+ in COP; revert parts of change#4485 and s/xcv_filegv/xcv_file/
+ (CvFILE() may yet come in handy somewhere); adjust compiler doodads
+ to suit
+ Branch: perl
+ ! bytecode.pl cop.h cv.h dump.c ext/B/B.pm ext/B/B.xs
+ ! ext/B/B/Asmdata.pm ext/B/B/Bytecode.pm ext/B/B/C.pm
+ ! ext/B/B/CC.pm ext/B/B/Debug.pm ext/B/B/Deparse.pm
+ ! ext/B/B/Lint.pm ext/B/B/Xref.pm ext/ByteLoader/bytecode.h
+ ! ext/ByteLoader/byterun.c ext/ByteLoader/byterun.h
+ ! ext/Devel/Peek/Peek.pm gv.c gv.h op.c perl.c pp.c pp_ctl.c
+ ! pp_sys.c scope.c scope.h sv.c sv.h toke.c util.c util.h
+ ! win32/perllib.c
+____________________________________________________________________________
+[ 4544] By: gsar on 1999/11/10 18:19:12
+ Log: more cleanups for change#4539
+ Branch: perl
+ ! gv.h op.c op.h pp_ctl.c pp_hot.c
+____________________________________________________________________________
+[ 4543] By: gsar on 1999/11/10 01:52:22
+ Log: remove dead branch/infinite looper in change#3612
+ Branch: perl
+ ! op.c
+____________________________________________________________________________
+[ 4542] By: gsar on 1999/11/09 20:05:47
+ Log: IoDIRP may be fake when used in source filters, mark as such
+ Branch: perl
+ ! sv.c sv.h toke.c
+____________________________________________________________________________
+[ 4541] By: gsar on 1999/11/09 05:47:53
+ Log: small nits in changes#4538,4539
+ Branch: perl
+ ! op.c sv.c
+____________________________________________________________________________
+[ 4540] By: gsar on 1999/11/08 20:30:58
+ Log: win32 symbol export tweak
+ Branch: perl
+ ! makedef.pl win32/win32.c win32/win32iop.h
+____________________________________________________________________________
+[ 4539] By: gsar on 1999/11/08 18:50:40
+ Log: preliminary support for GVOP indirection via pad
+ Branch: perl
+ ! doio.c dump.c embed.h embed.pl global.sym objXSUB.h op.c op.h
+ ! opcode.pl perlapi.c pp_hot.c pp_sys.c proto.h run.c
+____________________________________________________________________________
+[ 4538] By: gsar on 1999/11/08 11:25:49
+ Log: preliminary support for perl_clone() (still needs work in
+ the following areas: SVOPs must indirect via pad; context
+ stack, scope stack, and runlevels must be cloned; must
+ hook up the virtualized pseudo-process support provided by
+ "host"; ...)
+ Branch: perl
+ ! av.h embed.h embed.pl embedvar.h global.sym hv.c hv.h
+ ! intrpvar.h makedef.pl objXSUB.h perl.h perlapi.c proto.h sv.c
+ ! win32/perllib.c win32/win32.c
+____________________________________________________________________________
+[ 4537] By: gsar on 1999/11/08 11:19:18
+ Log: more thorough cleanup in perl_destroy()
+ Branch: perl
+ ! perl.c util.c
+____________________________________________________________________________
+[ 4536] By: gsar on 1999/11/08 07:16:10
+ Log: win32 internal data must be interpreter-local
+ Branch: perl
+ ! win32/win32.c win32/win32.h win32/win32sck.c
+____________________________________________________________________________
+[ 4535] By: gsar on 1999/11/08 04:17:28
+ Log: tweak change#4502
+ Branch: perl
+ ! doio.c perl.c
+____________________________________________________________________________
+[ 4534] By: jhi on 1999/11/07 13:17:03
+ Log: Four special class subs, not three.
+ Branch: cfgperl
+ ! pod/perlmod.pod
+____________________________________________________________________________
+[ 4533] By: jhi on 1999/11/07 13:13:15
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ !> mg.c t/io/print.t
+____________________________________________________________________________
+[ 4532] By: jhi on 1999/11/07 12:36:10
+ Log: More test program maintenance.
+ Branch: cfgperl
+ ! Configure config_h.SH
+ Branch: metaconfig
+ ! U/a_dvisory/intsize.U U/compline/alignbytes.U
+ ! U/compline/charsize.U U/compline/d_sigaction.U
+ ! U/compline/doublesize.U U/compline/floatsize.U
+ ! U/compline/nblock_io.U U/compline/ptrsize.U
+ ! U/modified/Signal.U U/typedefs/gidsize.U U/typedefs/pidsize.U
+ ! U/typedefs/uidsize.U
+ Branch: metaconfig/U/perl
+ ! fpossize.U
+____________________________________________________________________________
+[ 4531] By: jhi on 1999/11/07 00:34:09
+ Log: Tidy up the metaconfig test programs.
+ Branch: cfgperl
+ ! Configure config_h.SH
+ Branch: metaconfig
+ ! U/a_dvisory/intsize.U U/compline/alignbytes.U
+ ! U/compline/charsize.U U/compline/doublesize.U
+ ! U/compline/nblock_io.U U/compline/ptrsize.U
+ ! U/modified/d_longlong.U U/typedefs/gidsize.U
+ ! U/typedefs/lseektype.U U/typedefs/pidsize.U
+ ! U/typedefs/uidsize.U
+ Branch: metaconfig/U/perl
+ ! fpossize.U
+____________________________________________________________________________
+[ 4530] By: jhi on 1999/11/06 23:51:34
+ Log: So many printfs, so little time.
+ Branch: cfgperl
+ ! op.c perl.c regcomp.c scope.c util.c
+____________________________________________________________________________
+[ 4529] By: jhi on 1999/11/06 23:27:35
+ Log: Replace the explicit zeros with NOOPs.
+ Branch: cfgperl
+ ! perl.h
+____________________________________________________________________________
+[ 4528] By: jhi on 1999/11/06 23:10:54
+ Log: From: jand@activestate.com (Jan Dubois)
+ To: perl5-porters@perl.org
+ Cc: Mike Blazer <blazer@mail.nevalink.ru>,
+ Mark Borgerding <mborgerding@acm.org>
+ Subject: [5.005_62 PATCH] binmode and locale support for -T and -B filetest operators
+ Date: Sat, 06 Nov 1999 22:16:43 +0100
+ Message-ID: <38279207.46448719@smtprelay.t-online.de>
+ Branch: cfgperl
+ ! op.c op.h
+____________________________________________________________________________
+[ 4527] By: jhi on 1999/11/06 20:22:14
+ Log: ...and fewer.
+ Branch: cfgperl
+ ! dump.c
+____________________________________________________________________________
+[ 4526] By: jhi on 1999/11/06 20:19:04
+ Log: ...and they are getting fewer.
+ Branch: cfgperl
+ ! dump.c op.c util.c
+____________________________________________________________________________
+[ 4525] By: jhi on 1999/11/06 19:59:59
+ Log: More printf miscasts flushed out.
+ Branch: cfgperl
+ ! dump.c ext/B/B.xs ext/Data/Dumper/Dumper.xs regcomp.c
+ ! regexec.c
+____________________________________________________________________________
+[ 4524] By: jhi on 1999/11/06 15:39:05
+ Log: Crushing the remaining %ld guerillas.
+ Branch: cfgperl
+ ! ext/Devel/DProf/DProf.xs
+____________________________________________________________________________
+[ 4523] By: jhi on 1999/11/06 15:11:38
+ Log: Update CPAN sites list.
+ Branch: cfgperl
+ ! pod/perlmodlib.pod
+____________________________________________________________________________
+[ 4522] By: jhi on 1999/11/05 19:50:46
+ Log: The -n32 is normally part of $cc, not $ccflags.
+ Branch: cfgperl
+ ! hints/irix_6.sh
+____________________________________________________________________________
+[ 4521] By: gsar on 1999/11/05 04:35:30
+ Log: allow $\ to work right when set to a string with embedded nulls
+ Branch: perl
+ ! mg.c t/io/print.t
+____________________________________________________________________________
+[ 4520] By: jhi on 1999/11/04 23:30:09
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ !> embedvar.h ext/B/B/Bytecode.pm ext/B/B/Lint.pm
+ !> ext/B/B/Stash.pm ext/B/NOTES ext/B/O.pm ext/File/Glob/Glob.pm
+ !> ext/File/Glob/bsd_glob.c ext/File/Glob/bsd_glob.h intrpvar.h
+ !> keywords.h keywords.pl objXSUB.h op.c perl.c pod/perldelta.pod
+ !> pod/perldiag.pod pod/perlfunc.pod pod/perlmod.pod
+ !> pod/perlrun.pod pod/perlsub.pod pod/perltodo.pod toke.c
+____________________________________________________________________________
+[ 4519] By: jhi on 1999/11/04 23:09:25
+ Log: From: Ilya Zakharevich <ilya@math.ohio-state.edu>
+ To: perl5-porters@perl.org (Mailing list Perl5)
+ Subject: [PATCH 5.005_62] ref to non-lvalue method
+ Date: Wed, 3 Nov 1999 03:52:48 -0500 (EST)
+ Message-Id: <199911030852.DAA06563@monk.mps.ohio-state.edu>
+ Branch: cfgperl
+ ! op.c
+____________________________________________________________________________
+[ 4518] By: jhi on 1999/11/04 23:07:27
+ Log: From: Ilya Zakharevich <ilya@math.ohio-state.edu>
+ To: perl5-porters@perl.org (Mailing list Perl5)
+ Subject: [PATCH 5.005_62] xsubpp dependency
+ Date: Wed, 3 Nov 1999 02:57:23 -0500 (EST)
+ Message-Id: <199911030757.CAA06325@monk.mps.ohio-state.edu>
+ Branch: cfgperl
+ ! lib/ExtUtils/MM_Unix.pm
+____________________________________________________________________________
+[ 4517] By: jhi on 1999/11/04 23:05:59
+ Log: From: Ilya Zakharevich <ilya@math.ohio-state.edu>
+ To: perl5-porters@perl.org (Mailing list Perl5)
+ Subject: [PATCH 5.005_62] regexp.h
+ Date: Wed, 3 Nov 1999 02:55:21 -0500 (EST)
+ Message-Id: <199911030755.CAA06311@monk.mps.ohio-state.edu>
+ Branch: cfgperl
+ ! regexp.h
+____________________________________________________________________________
+[ 4516] By: gsar on 1999/11/04 18:25:45
+ Log: change#4485 didn't do the right thing for B::Bytecode
+ Branch: perl
+ ! ext/B/B/Bytecode.pm
+____________________________________________________________________________
+[ 4515] By: gsar on 1999/11/04 17:28:29
+ Log: implement STOP blocks and fix compiler to use them (minimally
+ tested)
+ Branch: perl
+ ! embedvar.h ext/B/B/Lint.pm ext/B/B/Stash.pm ext/B/NOTES
+ ! ext/B/O.pm intrpvar.h keywords.h keywords.pl objXSUB.h op.c
+ ! perl.c pod/perldelta.pod pod/perldiag.pod pod/perlfunc.pod
+ ! pod/perlmod.pod pod/perlrun.pod pod/perlsub.pod
+ ! pod/perltodo.pod toke.c
+____________________________________________________________________________
+[ 4514] By: gsar on 1999/11/04 15:59:46
+ Log: display BSD license in Glob.pm (for clause #2 conformity)
+ Branch: perl
+ ! ext/File/Glob/Glob.pm ext/File/Glob/bsd_glob.c
+ ! ext/File/Glob/bsd_glob.h
+____________________________________________________________________________
+[ 4513] By: jhi on 1999/11/04 08:26:19
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ +> t/io/nargv.t
+ !> (integrate 34 files)
+____________________________________________________________________________
+[ 4512] By: jhi on 1999/11/04 08:01:25
+ Log: Incremental Mac integration from Matthias.
+ Branch: cfgperl
+ ! perl.c perl.h pp_ctl.c pp_hot.c run.c sv.c t/pod/testpchk.pl
+ ! toke.c util.c
+____________________________________________________________________________
+[ 4511] By: gsar on 1999/11/04 02:53:37
+ Log: remove VIRTUAL tag, PERL_OBJECT doesn't need it anymore
+ Branch: perl
+ ! dosish.h embed.pl mg.c os2/os2ish.h perl.c perl.h perly.c
+ ! perly_c.diff pp_ctl.c proto.h regcomp.c regexec.c sv.c toke.c
+ ! universal.c vms/perly_c.vms vms/vmsish.h win32/win32.h
+ ! xsutils.c
+____________________________________________________________________________
+[ 4510] By: jhi on 1999/11/02 22:12:29
+ Log: S_init_interp is a better place to diddle with PL_opargs
+ than perl_construct.
+ Branch: cfgperl
+ ! perl.c
+____________________________________________________________________________
+[ 4509] By: jhi on 1999/11/02 21:30:02
+ Log: From: "M.J.T. Guy" <mjtg@cus.cam.ac.uk>
+ To: ben@mucus.advanced.org, perl5-porters@perl.org
+ Subject: Re: [ID 19991102.002] unpack('N', pack('N', -1)) not idempotent
+ Date: Tue, 02 Nov 1999 21:36:00 +0000
+ Message-Id: <E11ilay-00020o-00@taurus.cus.cam.ac.uk>
+ Branch: cfgperl
+ ! pod/perlfunc.pod
+____________________________________________________________________________
+[ 4508] By: jhi on 1999/11/02 20:46:27
+ Log: Initial integration of the MacPerl changes form Matthias.
+ Branch: cfgperl
+ ! doio.c ext/DynaLoader/DynaLoader_pm.PL ext/Fcntl/Fcntl.pm
+ ! ext/Fcntl/Fcntl.xs gv.c mg.c opcode.pl perl.c perl.h pp_ctl.c
+ ! pp_hot.c pp_sys.c run.c sv.c toke.c util.c
+____________________________________________________________________________
+[ 4507] By: jhi on 1999/11/01 23:05:07
+ Log: From: Ilya Zakharevich <ilya@math.ohio-state.edu>
+ To: lvirden@cas.org (Larry W. Virden)
+ Cc: perl5-porters@perl.org, lvirden@cas.org
+ Subject: Re: [ID 19991026.001] perl segmentation fault report
+ Date: Mon, 1 Nov 1999 18:14:16 -0500 (EST)
+ Message-Id: <199911012314.SAA22664@monk.mps.ohio-state.edu>
+ Branch: cfgperl
+ ! regexec.c t/op/pat.t
+____________________________________________________________________________
+[ 4506] By: jhi on 1999/11/01 19:56:28
+ Log: From: Olaf Flebbe <olaf@science-computing.de>
+ To: perl5-porters@perl.org
+ Subject: [PATCH: 5.005_62] Patch for EPOC Support
+ Date: Mon, 1 Nov 1999 20:46:54 +0100 (MET)
+ Message-ID: <Pine.LNX.4.10.9911012045190.411-100000@dragon.science-computing.de>
+ Branch: cfgperl
+ + epoc/Config.pm epoc/autosplit.pl epoc/createpkg.pl
+ + epoc/epoc_stubs.c
+ ! MANIFEST README.epoc epoc/epocish.h epoc/perl.mmp
+ ! epoc/perl.pkg
+____________________________________________________________________________
+[ 4505] By: gsar on 1999/11/01 17:09:44
+ Log: macros for COP.cop_filegv access
+ Branch: perl
+ ! cop.h deb.c gv.c op.c perl.c pp_ctl.c pp_sys.c scope.c toke.c
+ ! util.c
+____________________________________________________________________________
+[ 4504] By: gsar on 1999/11/01 17:08:28
+ Log: enable better Win32::DomainName() by demand loading netapi32.dll
+ (from Jan Dubois)
+ Branch: perl
+ ! pod/Win32.pod win32/win32.c
+____________________________________________________________________________
+[ 4503] By: gsar on 1999/10/31 20:56:06
+ Log: change#4502 was missing a file
+ Branch: perl
+ + t/io/nargv.t
+____________________________________________________________________________
+[ 4502] By: gsar on 1999/10/31 20:46:02
+ Log: make nested ARGV/$^I loops work correctly; fixes several bugs
+ in the way ARGV state was handled in readline(); writing a
+ subroutine to do inplace edits is now possible, provided *ARGV,
+ *ARGVOUT, $^I and $_ are localized where needed
+ Branch: perl
+ ! MANIFEST doio.c embedvar.h intrpvar.h objXSUB.h perl.c
+ ! pp_hot.c scope.c
+____________________________________________________________________________
+[ 4501] By: jhi on 1999/10/31 12:43:54
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ !> perl.h win32/config.bc win32/config.gc win32/config.vc
+ !> win32/config_H.bc win32/config_H.gc win32/config_H.vc
+____________________________________________________________________________
+[ 4500] By: gsar on 1999/10/31 10:01:17
+ Log: updated windows config* files
+ Branch: perl
+ ! win32/config.bc win32/config.gc win32/config.vc
+ ! win32/config_H.bc win32/config_H.gc win32/config_H.vc
+____________________________________________________________________________
+[ 4499] By: gsar on 1999/10/31 09:15:17
+ Log: integrate cfgperl contents into mainline
+ Branch: perl
+ !> Configure Porting/Glossary Porting/config.sh Porting/config_H
+ !> config_h.SH perl.h
+____________________________________________________________________________
+[ 4498] By: gsar on 1999/10/31 09:13:41
+ Log: remove unused struct Outrec
+ Branch: perl
+ ! perl.h
+____________________________________________________________________________
+[ 4497] By: jhi on 1999/10/30 12:41:50
+ Log: Add HAS_QUAD ($Config{d_quad}); use it.
+ Branch: cfgperl
+ ! Configure Porting/Glossary Porting/config.sh Porting/config_H
+ ! config_h.SH perl.h
+ Branch: metaconfig
+ ! U/a_dvisory/quadtype.U U/compline/charsize.U U/typedefs/gidf.U
+ ! U/typedefs/uidf.U
+ Branch: metaconfig/U/perl
+ ! perlxv.U
+____________________________________________________________________________
+[ 4496] By: gsar on 1999/10/30 00:28:32
+ Log: integrate cfgperl contents into mainline
+ Branch: perl
+ !> Configure Policy_sh.SH Porting/Glossary Porting/config.sh
+ !> Porting/config_H README.hurd config_h.SH doop.c handy.h
+ !> hints/aix.sh hints/irix_6.sh hints/solaris_2.sh mg.c perl.c
+ !> perl.h pp.c pp.h regexec.c sv.c taint.c
+____________________________________________________________________________
+[ 4495] By: jhi on 1999/10/29 23:36:19
+ Log: Continue what #4494 started; introduce uid and gid formats.
+ Branch: cfgperl
+ ! Configure Porting/Glossary Porting/config.sh Porting/config_H
+ ! config_h.SH handy.h perl.h
+ Branch: metaconfig
+ + U/a_dvisory/quadtype.U U/typedefs/gidf.U U/typedefs/uidf.U
+ - U/typedefs/quadtype.U
+ Branch: metaconfig/U/perl
+ ! perlxv.U
+____________________________________________________________________________
+[ 4494] By: jhi on 1999/10/29 22:09:01
+ Log: Move the IV, UV, I8, U8, ..., and NV to metaconfig
+ from perl.h and handy.h.
+ Branch: cfgperl
+ ! Configure Porting/Glossary Porting/config.sh Porting/config_H
+ ! config_h.SH handy.h perl.h
+ Branch: metaconfig/U/perl
+ + perlxv.U perlxvf.U
+____________________________________________________________________________
+[ 4493] By: jhi on 1999/10/29 22:08:06
+ Log: Finetuning the output continues along the lines of #4490 and #4491.
+ Branch: metaconfig
+ ! U/modified/i_sysuio.U U/threads/d_pthreadj.U
+ ! U/typedefs/fpostype.U
+ Branch: metaconfig/U/perl
+ + fpossize.U
+ ! d_cmsghdr_s.U d_fs_data_s.U d_msghdr_s.U d_statfs3.U
+ ! d_statfs4.U d_statfs_f_flags.U d_statfs_s.U io64.U
+____________________________________________________________________________
+[ 4492] By: jhi on 1999/10/29 21:14:53
+ Log: Hurd update from Mark Kettenis.
+ Branch: cfgperl
+ ! README.hurd
+____________________________________________________________________________
+[ 4491] By: jhi on 1999/10/29 20:37:02
+ Log: A new try at what #4490 tried to accomplish.
+ Branch: metaconfig
+ ! U/modified/i_sysuio.U U/threads/d_pthreadj.U
+ Branch: metaconfig/U/perl
+ ! d_cmsghdr_s.U d_fs_data_s.U d_msghdr_s.U d_statfs3.U
+ ! d_statfs4.U d_statfs_f_flags.U d_statfs_s.U io64.U
+____________________________________________________________________________
+[ 4490] By: jhi on 1999/10/29 20:19:41
+ Log: metaconfig nits.
+ Branch: metaconfig
+ ! U/modified/i_sysuio.U U/threads/d_pthreadj.U
+ Branch: metaconfig/U/perl
+ + d_iovec_s.U
+ ! d_cmsghdr_s.U d_fs_data_s.U d_msghdr_s.U d_statfs3.U
+ ! d_statfs4.U d_statfs_f_flags.U d_statfs_s.U io64.U
+____________________________________________________________________________
+[ 4489] By: jhi on 1999/10/29 16:08:43
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ !> (integrate 31 files)
+____________________________________________________________________________
+[ 4488] By: jhi on 1999/10/29 15:30:30
+ Log: Regen Configure and Glossary.
+ Branch: cfgperl
+ ! Configure Porting/Glossary Porting/config.sh Porting/config_H
+ ! config_h.SH
+____________________________________________________________________________
+[ 4487] By: jhi on 1999/10/29 15:24:13
+ Log: Remove quad logic from perl.h; regen Configure;
+ add -DUSE_LONG_LONG to ccflags if not already there.
+ Branch: cfgperl
+ ! Configure config_h.SH doop.c hints/aix.sh hints/irix_6.sh
+ ! hints/solaris_2.sh perl.h pp.c pp.h regexec.c sv.c
+____________________________________________________________________________
+[ 4486] By: jhi on 1999/10/29 15:22:38
+ Log: metaconfig: moved quad logic from perl.h to Configure (quadtype.U);
+ fixed the use*.U to define their stuff only iff not already defined
+ (so that ccflags can have any -DUSE_* it wants);
+ uselonglong.U added; various small nits fixed.
+ Branch: metaconfig
+ + U/typedefs/quadtype.U
+ ! U/modified/d_longdbl.U U/modified/d_longlong.U
+ ! U/modified/d_statblks.U U/modified/usenm.U
+ ! U/threads/usethreads.U
+ Branch: metaconfig/U/perl
+ + uselonglong.U
+ ! d_cmsghdr_s.U d_fs_data_s.U d_msghdr_s.U d_statfs3.U
+ ! d_statfs4.U d_statfs_f_flags.U d_statfs_s.U i_inttypes.U
+ ! quadfio.U use64bits.U uselfs.U uselongdbl.U usemorebits.U
+ ! usemultiplicity.U useperlio.U usesocks.U
+____________________________________________________________________________
+[ 4485] By: gsar on 1999/10/29 06:08:50
+ Log: more cleanup: avoid unused knowledge of "file GV" notion in CV and GV
+ Branch: perl
+ ! bytecode.pl cv.h dump.c ext/B/B.pm ext/B/B.xs
+ ! ext/B/B/Asmdata.pm ext/B/B/Bytecode.pm ext/B/B/C.pm
+ ! ext/B/B/Debug.pm ext/B/B/Xref.pm ext/ByteLoader/byterun.c
+ ! ext/ByteLoader/byterun.h ext/Devel/Peek/Peek.pm gv.c gv.h op.c
+ ! sv.h
+____________________________________________________________________________
+[ 4484] By: gsar on 1999/10/29 03:00:21
+ Log: usurp GVOP slot for new PADOP (one small step to making optree
+ shareable across interpreters)
+ Branch: perl
+ ! bytecode.pl doio.c dump.c ext/B/B.pm ext/B/B.xs
+ ! ext/B/B/Asmdata.pm ext/B/B/Bytecode.pm ext/B/B/C.pm
+ ! ext/B/B/Debug.pm ext/B/B/Deparse.pm ext/B/B/Lint.pm
+ ! ext/B/B/Terse.pm ext/B/typemap ext/ByteLoader/byterun.c
+ ! ext/ByteLoader/byterun.h op.c op.h opcode.h opcode.pl perl.h
+ ! pp_hot.c pp_sys.c regexec.c run.c
+____________________________________________________________________________
+[ 4483] By: jhi on 1999/10/28 22:01:12
+ Log: Regen Configure.
+ Branch: cfgperl
+ ! Configure Porting/Glossary Porting/config.sh Porting/config_H
+ ! config_h.SH
+____________________________________________________________________________
+[ 4482] By: jhi on 1999/10/28 21:45:26
+ Log: Installdirs patches from Andy.
+ Branch: metaconfig
+ ! U/installdirs/sitearch.U U/installdirs/sitebin.U
+ ! U/installdirs/sitehtml1dir.U U/installdirs/sitehtml3dir.U
+ ! U/installdirs/sitelib.U U/installdirs/siteman1dir.U
+ ! U/installdirs/siteman3dir.U U/installdirs/siteprefix.U
+ ! U/installdirs/sitescriptdir.U U/installdirs/vendorarch.U
+ ! U/installdirs/vendorbin.U U/installdirs/vendorhtml1dir.U
+ ! U/installdirs/vendorhtml3dir.U U/installdirs/vendorlib.U
+ ! U/installdirs/vendorman1dir.U U/installdirs/vendorman3dir.U
+ ! U/installdirs/vendorprefix.U U/installdirs/vendorscriptdir.U
+____________________________________________________________________________
+[ 4481] By: gsar on 1999/10/28 17:33:49
+ Log: remove C<use Time::Local 'no_range_check'> misfeature (global
+ can still be directly set)
+ Branch: perl
+ ! lib/Time/Local.pm
+____________________________________________________________________________
+[ 4480] By: jhi on 1999/10/28 13:49:26
+ Log: Fix printing of uids and gids; regen Configure.
+ Branch: cfgperl
+ ! Configure Porting/Glossary Porting/config.sh Porting/config_H
+ ! config_h.SH mg.c perl.c perl.h taint.c
+____________________________________________________________________________
+[ 4479] By: jhi on 1999/10/28 11:53:57
+ Log: Fix typo.
+ Branch: metaconfig
+ ! U/typedefs/gidsize.U
+____________________________________________________________________________
+[ 4478] By: jhi on 1999/10/28 06:50:02
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ !> Changes iperlsys.h makedef.pl patchlevel.h perl.h
+ !> win32/Makefile win32/config.bc win32/config.gc win32/config.vc
+ !> win32/config_H.bc win32/config_H.gc win32/config_H.vc
+ !> win32/config_sh.PL win32/makefile.mk win32/win32.h
+____________________________________________________________________________
+[ 4477] By: jhi on 1999/10/28 06:40:54
+ Log: (Slightly) better comments for Policy_sh.SH from Andy.
+ Branch: cfgperl
+ ! Policy_sh.SH
+____________________________________________________________________________
+[ 4476] By: gsar on 1999/10/27 23:54:36
+ Log: regen config* stuff for windows
+ Branch: perl
+ ! Changes patchlevel.h win32/Makefile win32/config.bc
+ ! win32/config.gc win32/config.vc win32/config_H.bc
+ ! win32/config_H.gc win32/config_H.vc win32/config_sh.PL
+ ! win32/makefile.mk
+____________________________________________________________________________
+[ 4475] By: gsar on 1999/10/27 21:32:30
+ Log: integrate cfgperl contents into mainline; merge conflicts
+ Branch: perl
+ !> (integrate 46 files)
+____________________________________________________________________________
+[ 4474] By: gsar on 1999/10/27 21:15:07
+ Log: patch up egcs-1.1.2-mingw32 build (builds a working miniperl, but not
+ perl; stdout/stderr redirects seem broken as well)
+ Branch: perl
+ ! iperlsys.h makedef.pl perl.h win32/makefile.mk win32/win32.h
+____________________________________________________________________________
+[ 4473] By: jhi on 1999/10/27 21:11:11
+ Log: Do not block if no message queues available.
+ Branch: cfgperl
+ ! t/lib/ipc_sysv.t
+____________________________________________________________________________
+[ 4472] By: jhi on 1999/10/27 18:27:40
+ Log: Remove unused "squatter" symbols; regen Configure.
+ Branch: cfgperl
+ ! Configure Makefile.SH Porting/Glossary Porting/config.sh
+ ! Porting/config_H config_h.SH epoc/config.h iperlsys.h perl.h
+ ! win32/config_H.bc win32/config_H.gc win32/config_H.vc
+____________________________________________________________________________
+[ 4471] By: jhi on 1999/10/27 18:26:55
+ Log: metaconfig; split socket; fix output.
+ Branch: metaconfig
+ ! U/modified/d_socket.U U/modified/d_statblks.U
+ Branch: metaconfig/U/perl
+ + d_cmsghdr_s.U d_msghdr_s.U d_recvmsg.U d_sendmsg.U
+ ! i_sysstatfs.U i_sysvfs.U
+____________________________________________________________________________
+[ 4470] By: jhi on 1999/10/27 17:19:06
+ Log: Regen Configure.
+ Branch: cfgperl
+ ! Configure Porting/Glossary Porting/config.sh Porting/config_H
+ ! config_h.SH perl.c perl.h
+____________________________________________________________________________
+[ 4469] By: jhi on 1999/10/27 17:18:41
+ Log: metaconfig; split statfs.
+ Branch: metaconfig/U/perl
+ + d_fs_data_s.U d_statfs_f_flags.U d_statfs_s.U
+ ! d_statfs.U
+____________________________________________________________________________
+[ 4468] By: jhi on 1999/10/27 14:06:44
+ Log: Integrate with Sarathy; manual resolve on regcomp.c conflicts
+ (Ilya's changes won).
+ Branch: cfgperl
+ +> os2/OS2/REXX/DLL/Changes os2/OS2/REXX/DLL/DLL.pm
+ +> os2/OS2/REXX/DLL/DLL.xs os2/OS2/REXX/DLL/MANIFEST
+ +> os2/OS2/REXX/DLL/Makefile.PL os2/OS2/REXX/t/rx_emxrv.t
+ !> (integrate 65 files)
+____________________________________________________________________________
+[ 4467] By: jhi on 1999/10/27 13:38:41
+ Log: Regen Configure.
+ Branch: cfgperl
+ ! Configure Porting/Glossary Porting/config.sh Porting/config_H
+ ! config_h.SH
+____________________________________________________________________________
+[ 4466] By: jhi on 1999/10/27 13:18:06
+ Log: metaconfig fixes from Andy.
+ Branch: metaconfig
+ + U/modified/libnlist.U U/modified/usrinc.U
+ ! U/Glossary.patch U/mkglossary U/modified/libpth.U
+____________________________________________________________________________
+[ 4465] By: jhi on 1999/10/27 13:06:27
+ Log: Nosuid checking for statfs() people.
+ Branch: cfgperl
+ ! Configure Porting/Glossary Porting/config.sh Porting/config_H
+ ! config_h.SH perl.c perl.h pod/perldiag.pod
+____________________________________________________________________________
+[ 4464] By: jhi on 1999/10/27 13:04:20
+ Log: metaconfig maintenance; fix Hasfield, statfs;
+ add Hasstruct, statfs3, statfs4, ustat, sysvfs;
+ split fstatfs away from statfs.
+ Branch: metaconfig
+ + U/protos/Hasstruct.U
+ ! U/protos/Hasfield.U
+ Branch: metaconfig/U/perl
+ + d_fstatfs.U d_statfs3.U d_statfs4.U d_ustat.U i_sysvfs.U
+ + i_ustat.U
+ ! d_statfs.U
+____________________________________________________________________________
+[ 4463] By: jhi on 1999/10/27 07:55:53
+ Log: We need cc to be able to test for cc -v.
+ Branch: cfgperl
+ ! hints/dec_osf.sh
+____________________________________________________________________________
+[ 4462] By: gsar on 1999/10/27 01:31:41
+ Log: more GCC v2.95 induced adjustments
+ Branch: perl
+ ! globals.c mg.c opcode.h opcode.pl perl.h sv.c
+ ! win32/makefile.mk win32/win32.c x2p/walk.c
+____________________________________________________________________________
+[ 4461] By: gsar on 1999/10/26 21:42:59
+ Log: warnings and const violations identified by compiling in C++ mode
+ with GCC v2.95
+ Branch: perl
+ ! doio.c embed.pl mg.c op.c perl.c perlapi.c proto.h regcomp.c
+ ! sv.c taint.c toke.c win32/win32.c
+____________________________________________________________________________
+[ 4459] By: jhi on 1999/10/26 10:15:58
+ Log: Regen Configure.
+ Branch: cfgperl
+ ! Configure Porting/Glossary Porting/config.sh Porting/config_H
+ ! config_h.SH
+____________________________________________________________________________
+[ 4458] By: jhi on 1999/10/26 09:48:37
+ Log: Minor rewordings.
+ Branch: metaconfig/U/perl
+ ! d_getmnt.U d_getmntent.U d_statfs.U d_statvfs.U
+____________________________________________________________________________
+[ 4456] By: jhi on 1999/10/26 09:11:49
+ Log: Fix d_statfsflags; add d_getmnt.
+ Branch: metaconfig/U/perl
+ + d_getmnt.U
+ ! d_statfs.U
+____________________________________________________________________________
+[ 4455] By: jhi on 1999/10/26 08:12:27
+ Log: Massive multitypo in #4446.
+ Branch: cfgperl
+ ! hints/dec_osf.sh
+____________________________________________________________________________
+[ 4454] By: jhi on 1999/10/25 08:28:45
+ Log: From: Laszlo Molnar <laszlo.molnar@eth.ericsson.se>
+ To: Perl 5 Porters <perl5-porters@perl.org>
+ Subject: [PATCH 5.005_62] dos-djgpp update
+ Date: Mon, 25 Oct 1999 10:11:30 +0200
+ Message-ID: <19991025101130.K459@crater.eth.ericsson.se>
+ Branch: cfgperl
+ ! djgpp/config.over djgpp/configure.bat djgpp/djgppsed.sh
+ ! pod/perldelta.pod t/lib/io_unix.t
+____________________________________________________________________________
+[ 4453] By: jhi on 1999/10/25 08:25:50
+ Log: From: Ilya Zakharevich <ilya@math.ohio-state.edu>
+ To: perl5-porters@perl.org (Mailing list Perl5)
+ Subject: [PATCH 5.005_62] Remove the last regnode<==>char*
+ Date: Mon, 25 Oct 1999 03:06:21 -0400 (EDT)
+ Message-Id: <199910250706.DAA16825@monk.mps.ohio-state.edu>
+ Branch: cfgperl
+ ! embed.h embed.pl proto.h regcomp.c regcomp.h regexec.c
+____________________________________________________________________________
+[ 4452] By: jhi on 1999/10/25 08:16:55
+ Log: From: Ilya Zakharevich <ilya@math.ohio-state.edu>
+ To: perl5-porters@perl.org (Mailing list Perl5)
+ Subject: [PATCH 5.005_62] Missing REx engine patch
+ Date: Sun, 24 Oct 1999 23:47:45 -0400 (EDT)
+ Message-Id: <199910250347.XAA16094@monk.mps.ohio-state.edu>
+ Branch: cfgperl
+ ! pod/perldiag.pod regcomp.c regexec.c
+____________________________________________________________________________
+[ 4451] By: jhi on 1999/10/25 08:13:06
+ Log: From: Ilya Zakharevich <ilya@math.ohio-state.edu>
+ To: perl5-porters@perl.org (Mailing list Perl5)
+ Subject: [PATCH 5.005_62] charnames and UTEST
+ Date: Sun, 24 Oct 1999 23:39:49 -0400 (EDT)
+ Message-Id: <199910250339.XAA16058@monk.mps.ohio-state.edu>
+ Branch: cfgperl
+ ! t/lib/charnames.t
+____________________________________________________________________________
+[ 4450] By: gsar on 1999/10/25 07:38:15
+ Log: win32 tweak
+ Branch: perl
+ ! win32/perllib.c
+____________________________________________________________________________
+[ 4449] By: gsar on 1999/10/24 23:20:10
+ Log: remove inconsistent tainting behavior of sprintf("%e",...)
+ (all bets are off is "C" locale is compromised)
+ Branch: perl
+ ! pod/perlfunc.pod pod/perllocale.pod sv.c
+____________________________________________________________________________
+[ 4448] By: gsar on 1999/10/24 22:20:42
+ Log: remove unused interpreter globals
+ Branch: perl
+ ! deb.c dump.c embed.h embed.pl embedvar.h ext/POSIX/POSIX.xs
+ ! global.sym gv.c gv.h intrpvar.h objXSUB.h perl.c perlapi.c
+ ! proto.h toke.c
+____________________________________________________________________________
+[ 4447] By: jhi on 1999/10/24 21:49:52
+ Log: Another hints tweak.
+ Branch: cfgperl
+ ! hints/aix.sh
+____________________________________________________________________________
+[ 4446] By: jhi on 1999/10/24 21:48:02
+ Log: Hints tweak.
+ Branch: cfgperl
+ ! hints/dec_osf.sh
+____________________________________________________________________________
+[ 4445] By: nick on 1999/10/24 21:03:28
+ Log: Integrate own changes to mainline.
+ Branch: utfperl
+ !> installperl pp.c
+____________________________________________________________________________
+[ 4444] By: nick on 1999/10/24 20:54:06
+ Log: Avoid creating GV with NULL name when vivifying nameless scalars.
+ (Fix/workround for [ID19991024.001])
+ Branch: perl
+ ! pp.c
+____________________________________________________________________________
+[ 4443] By: nick on 1999/10/24 15:09:51
+ Log: Follow that camel ... another sync.
+ Branch: utfperl
+ +> os2/OS2/REXX/DLL/Changes os2/OS2/REXX/DLL/DLL.pm
+ +> os2/OS2/REXX/DLL/DLL.xs os2/OS2/REXX/DLL/MANIFEST
+ +> os2/OS2/REXX/DLL/Makefile.PL os2/OS2/REXX/t/rx_emxrv.t
+ !> (integrate 36 files)
+____________________________________________________________________________
+[ 4442] By: gsar on 1999/10/24 14:40:01
+ Log: typo in installperl (from Paul Moore <gustav@morpheus.demon.co.uk>)
+ Branch: perl
+ ! installperl
+____________________________________________________________________________
+[ 4441] By: gsar on 1999/10/24 14:33:11
+ Log: test in change#4428 needs strict interpretation of C modulus
+ Branch: perl
+ ! t/op/int.t
+____________________________________________________________________________
+[ 4440] By: gsar on 1999/10/24 13:47:17
+ Log: don't allow SIGCHLD to be ignored at startup, or wait*() and
+ $? break
+ Branch: perl
+ ! perl.c pod/perldelta.pod pod/perldiag.pod
+____________________________________________________________________________
+[ 4439] By: jhi on 1999/10/24 13:19:17
+ Log: test for #2835 (yeah, better later than never)
+ Branch: cfgperl
+ ! t/op/array.t
+____________________________________________________________________________
+[ 4438] By: gsar on 1999/10/24 12:59:12
+ Log: typo, doc tweak
+ Branch: perl
+ ! lib/attributes.pm pod/perlop.pod
+____________________________________________________________________________
+[ 4437] By: gsar on 1999/10/24 11:59:55
+ Log: allow get() and reftype() functions to be imported (from
+ Spider Boardman)
+ Branch: perl
+ ! lib/attributes.pm
+____________________________________________________________________________
+[ 4436] By: gsar on 1999/10/24 11:52:53
+ Log: suppress scalar leak messages for known leaks (from
+ Robin Barker <rmb1@cise.npl.co.uk>)
+ Branch: perl
+ ! Changes t/op/lex_assign.t t/pragma/warn/op
+____________________________________________________________________________
+[ 4435] By: gsar on 1999/10/24 11:39:42
+ Log: VMS tweak (suggested by Craig A. Berry <craig.berry@metamor.com>)
+ Branch: perl
+ ! ext/B/defsubs_h.PL
+____________________________________________________________________________
+[ 4434] By: gsar on 1999/10/24 11:36:08
+ Log: relax range checking if they ask for it (from John L. Allen
+ <allen@grumman.com>)
+ Branch: perl
+ ! lib/Time/Local.pm
+____________________________________________________________________________
+[ 4433] By: gsar on 1999/10/24 11:25:51
+ Log: README nits pointed out by Chris Nandor <pudge@pobox.com>
+ Branch: perl
+ ! README lib/File/Path.pm
+____________________________________________________________________________
+[ 4432] By: gsar on 1999/10/24 11:11:02
+ Log: From: Ilya Zakharevich <ilya@math.ohio-state.edu>
+ Date: Sun, 24 Oct 1999 03:24:28 -0400 (EDT)
+ Message-Id: <199910240724.DAA12230@monk.mps.ohio-state.edu>
+ Subject: Re: [PATCH 5.005_62] OS/2 improvements
+ Branch: perl
+ + os2/OS2/REXX/DLL/Changes os2/OS2/REXX/DLL/DLL.pm
+ + os2/OS2/REXX/DLL/DLL.xs os2/OS2/REXX/DLL/MANIFEST
+ + os2/OS2/REXX/DLL/Makefile.PL os2/OS2/REXX/t/rx_emxrv.t
+ ! MANIFEST hints/os2.sh mg.c miniperlmain.c os2/Changes
+ ! os2/OS2/REXX/Changes os2/OS2/REXX/Makefile.PL
+ ! os2/OS2/REXX/REXX.pm os2/OS2/REXX/REXX.xs
+ ! os2/OS2/REXX/t/rx_dllld.t os2/OS2/REXX/t/rx_objcall.t
+ ! os2/OS2/REXX/t/rx_tievar.t os2/OS2/REXX/t/rx_tieydb.t
+ ! os2/OS2/REXX/t/rx_vrexx.t os2/dl_os2.c os2/os2.c os2/os2ish.h
+ ! perl.c perl.h t/io/fs.t t/op/magic.t
+____________________________________________________________________________
+[ 4431] By: gsar on 1999/10/24 10:50:14
+ Log: install all README.foo with pod content as podfoo.pod
+ Branch: perl
+ ! Makefile.SH installman
+____________________________________________________________________________
+[ 4430] By: gsar on 1999/10/24 09:28:24
+ Log: @INC needs ../lib
+ Branch: perl
+ ! t/op/int.t
+____________________________________________________________________________
+[ 4429] By: jhi on 1999/10/23 21:47:49
+ Log: More printf-fixes (see also #4426).
+ Branch: cfgperl
+ ! deb.c dump.c ext/Data/Dumper/Dumper.xs
+ ! ext/Devel/DProf/DProf.xs malloc.c mg.c op.c perl.c pp.c
+ ! pp_ctl.c regcomp.c regexec.c run.c scope.c sv.c util.c
+____________________________________________________________________________
+[ 4428] By: gsar on 1999/10/23 20:28:56
+ Log: fix accidental C modulo semantics on integer-valued operations
+ (e.g. caused C<length("abc") % -10> to return 3 rather than -7)
+ Branch: perl
+ ! op.c t/op/int.t
+____________________________________________________________________________
+[ 4427] By: jhi on 1999/10/23 16:10:10
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ !> sv.c win32/win32.c
+____________________________________________________________________________
+[ 4426] By: jhi on 1999/10/23 16:04:02
+ Log: Fix the printfing nits pointed out by using gcc -Wall and
+ Configure -Duse64bits -Dccflags=-DDEBUGGING in Solaris,
+ plus few other warnings in Dumper.xs.
+ Branch: cfgperl
+ ! ext/Data/Dumper/Dumper.xs ext/Devel/DProf/DProf.xs
+ ! ext/Devel/Peek/Peek.xs regcomp.c regexec.c sv.c util.c
+____________________________________________________________________________
+[ 4425] By: jhi on 1999/10/23 15:16:41
+ Log: Configure regen to pick up the new installation directories
+ from Policy_sh.SH. The explanations of "public add-ons" and
+ "vendor-supplied" could do with more work.
+ Branch: cfgperl
+ ! Configure config_h.SH
+____________________________________________________________________________
+[ 4424] By: nick on 1999/10/23 00:46:22
+ Log: Resolve mainline before possible hacking operertunity this weekend
+ Branch: utfperl
+ +> pod/perlfilter.pod
+ !> (integrate 32 files)
+____________________________________________________________________________
+[ 4423] By: jhi on 1999/10/22 22:53:17
+ Log: Update Policy_sh.SH to handle the newer installation directives.
+ From: Andy Dougherty <doughera@lafayette.edu>
+ To: Perl Porters <perl5-porters@perl.org>
+ Subject: [PATCH 5.005_62] Policy_sh.SH update
+ Date: Fri, 22 Oct 1999 16:47:34 -0400 (EDT)
+ Message-ID: <Pine.SOL.4.10.9910221645470.15232-100000@maxwell.phys.lafayette.edu>
+ Branch: cfgperl
+ ! Policy_sh.SH
+____________________________________________________________________________
+[ 4422] By: jhi on 1999/10/22 22:44:44
+ Log: so back to 'so', from Stephanie Beals <bealzy@us.ibm.com>
+ Branch: cfgperl
+ ! hints/aix.sh
+____________________________________________________________________________
+[ 4421] By: gsar on 1999/10/22 21:16:44
+ Log: sv_vcatpvfn() bug: fell through to assuming intsize of 'q' for
+ C<"%ld", long_val>
+ Branch: perl
+ ! sv.c
+____________________________________________________________________________
+[ 4420] By: gsar on 1999/10/22 16:36:46
+ Log: win32_utime() on directories should use localtime() rather
+ than gmtime() (from Jan Dubois)
+ Branch: perl
+ ! win32/win32.c
+____________________________________________________________________________
+[ 4419] By: jhi on 1999/10/21 10:31:41
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ !> Makefile.SH lib/CPAN/FirstTime.pm op.c opcode.h opcode.pl
+ !> t/lib/glob-basic.t t/op/sort.t
+____________________________________________________________________________
+[ 4418] By: gsar on 1999/10/20 23:49:47
+ Log: add test for change#4417
+ Branch: perl
+ ! t/op/sort.t
+____________________________________________________________________________
+[ 4417] By: gsar on 1999/10/20 23:45:03
+ Log: avoid coredump on C<sort { my $c; return $a cmp $b } ...>
+ Branch: perl
+ ! op.c
+____________________________________________________________________________
+[ 4416] By: gsar on 1999/10/20 01:00:50
+ Log: fix prototype mismatch (from Hans Mulder <hansm@xs4all.nl>)
+ Branch: perl
+ ! lib/CPAN/FirstTime.pm
+____________________________________________________________________________
+[ 4415] By: gsar on 1999/10/20 00:52:34
+ Log: disable optimizing troublesome ops in change#3612
+ (from Ilya Zakharevich)
+ Branch: perl
+ ! Makefile.SH opcode.h opcode.pl
+____________________________________________________________________________
+[ 4414] By: gsar on 1999/10/20 00:37:46
+ Log: skip unreadable directory test when running as root
+ Branch: perl
+ ! t/lib/glob-basic.t
+____________________________________________________________________________
+[ 4413] By: jhi on 1999/10/19 09:26:52
+ Log: Avoid GNU ar if HP cc is being used.
+ Branch: cfgperl
+ ! hints/hpux.sh
+____________________________________________________________________________
+[ 4412] By: jhi on 1999/10/19 07:24:29
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ !> perlvars.h
+____________________________________________________________________________
+[ 4411] By: jhi on 1999/10/19 07:22:34
+ Log: Long double support: sqrtl et al are not available everywhere,
+ e.g. not in Solaris, even when long doubles are.
+ Branch: cfgperl
+ ! Configure Porting/Glossary Porting/config.sh Porting/config_H
+ ! config_h.SH perl.h
+____________________________________________________________________________
+[ 4410] By: jhi on 1999/10/19 07:21:42
+ Log: Add sqrtl probe, add echo dependencies.
+ Branch: metaconfig
+ ! U/threads/d_pthreadj.U
+ Branch: metaconfig/U/perl
+ + d_sqrtl.U
+ ! i_inttypes.U io64.U
+____________________________________________________________________________
+[ 4409] By: gsar on 1999/10/19 02:18:54
+ Log: perl_mutex n/a if !USE_THREADS
+ Branch: perl
+ ! perlvars.h
+____________________________________________________________________________
+[ 4408] By: jhi on 1999/10/18 20:13:02
+ Log: Forgotten s/warning/warnings/.
+ Branch: cfgperl
+ ! Makefile.SH
+____________________________________________________________________________
+[ 4407] By: jhi on 1999/10/18 20:02:12
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ +> pod/perlfilter.pod
+ !> (integrate 30 files)
+____________________________________________________________________________
+[ 4406] By: gsar on 1999/10/18 16:32:10
+ Log: added intro to source filters from Paul Marquess
+ Branch: perl
+ + pod/perlfilter.pod
+ ! MANIFEST pod/perldelta.pod
+____________________________________________________________________________
+[ 4405] By: gsar on 1999/10/18 05:53:06
+ Log: missing manpages
+ Branch: perl
+ ! installman
+____________________________________________________________________________
+[ 4404] By: gsar on 1999/10/18 05:09:22
+ Log: pod updates from Tom Christiansen
+ Branch: perl
+ ! lib/Pod/Man.pm pod/perldelta.pod pod/perlmodlib.pod
+____________________________________________________________________________
+[ 4403] By: gsar on 1999/10/17 23:43:59
+ Log: PL_malloc_mutex needs to be global, not per-interpreter
+ (malloc.c has static data)
+ Branch: perl
+ ! embedvar.h intrpvar.h objXSUB.h perl.c perlvars.h
+____________________________________________________________________________
+[ 4402] By: gsar on 1999/10/17 22:30:30
+ Log: support PERL_IMPLICIT_SYS with MULTIPLICITY/USE_THREADS on
+ windows
+ Branch: perl
+ ! XSUB.h ext/POSIX/POSIX.xs intrpvar.h makedef.pl malloc.c
+ ! perl.c perl.h perlio.c win32/perllib.c win32/win32.c
+ ! win32/win32.h
+____________________________________________________________________________
+[ 4401] By: gsar on 1999/10/17 20:33:42
+ Log: serious bug introduced by G_VOID changes in 5.003_96: scalar
+ eval"" did not pop stack correctly; C<$a = eval "(1,2)x1">
+ is one symptom of the problem
+ Branch: perl
+ ! pp_ctl.c t/op/eval.t
+____________________________________________________________________________
+[ 4400] By: gsar on 1999/10/17 18:36:46
+ Log: remove FileHandle from list of PodParser dependencies (the
+ difference is 20 files vs 6 files loaded!)
+ Branch: perl
+ ! lib/Pod/Parser.pm lib/Pod/Select.pm pod/perldelta.pod
+ ! t/pod/testcmp.pl
+____________________________________________________________________________
+[ 4399] By: nick on 1999/10/17 14:51:35
+ Log: Pre-trip resolve
+ Branch: utfperl
+ !> installperl lib/Text/Tabs.pm perl.c pp_hot.c
+____________________________________________________________________________
+[ 4398] By: gsar on 1999/10/17 09:19:24
+ Log: make installperl ignore RCS files (from Michael G Schwern
+ <schwern@pobox.com>)
+ Branch: perl
+ ! installperl lib/Text/Tabs.pm
+____________________________________________________________________________
+[ 4397] By: gsar on 1999/10/16 18:30:14
+ Log: another bug in change#3386 (CATCH_SET wasn't reverted correctly)
+ Branch: perl
+ ! perl.c
+____________________________________________________________________________
+[ 4396] By: jhi on 1999/10/16 17:44:39
+ Log: Missing comma.
+ Branch: cfgperl
+ ! lib/diagnostics.pm
+____________________________________________________________________________
+[ 4395] By: gsar on 1999/10/16 17:18:36
+ Log: assumption about @_ always being non-REAL doesn't hold when
+ debugger is running; DB::sub() can call arbitrary stuff
+ that modifies @_ at will
+ Branch: perl
+ ! pp_hot.c
+____________________________________________________________________________
+[ 4394] By: nick on 1999/10/16 09:35:20
+ Log: Resolve utfperl branch against mainline as of _62
+ Branch: utfperl
+ +> eg/cgi/dna_small_gif.uu eg/cgi/wilogo_gif.uu
+ +> ext/DB_File/hints/sco.pl ext/DynaLoader/hints/aix.pl
+ +> ext/File/Glob/Changes ext/File/Glob/Glob.pm
+ +> ext/File/Glob/Glob.xs ext/File/Glob/Makefile.PL
+ +> ext/File/Glob/TODO ext/File/Glob/bsd_glob.c
+ +> ext/File/Glob/bsd_glob.h ext/NDBM_File/hints/sco.pl
+ +> pod/perlhack.pod t/lib/glob-basic.t t/lib/glob-global.t
+ +> t/lib/glob-taint.t win32/genmk95.pl
+ - eg/cgi/dna.small.gif.uu eg/cgi/wilogo.gif.uu
+ !> (integrate 144 files)
+____________________________________________________________________________
+[ 4393] By: gsar on 1999/10/16 04:07:02
+ Log: OS/2 support bits (from Ilya Zakharevich)
+ Branch: perl
+ ! hints/os2.sh makedef.pl os2/Makefile.SHs t/lib/glob-basic.t
+____________________________________________________________________________
+[ 4392] By: jhi on 1999/10/15 10:28:09
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ !> Changes MANIFEST Makefile.SH Porting/makerel lib/Pod/Man.pm
+ !> lib/Pod/Parser.pm op.c pod/perldelta.pod pod/perlopentut.pod
+ !> win32/Makefile win32/makefile.mk
+
+----------------
+Version 5.005_62
+----------------
+
+____________________________________________________________________________
+[ 4391] By: gsar on 1999/10/15 10:12:42
+ Log: here be 5.005_62
+ Branch: perl
+ ! Changes MANIFEST Porting/makerel
+____________________________________________________________________________
+[ 4390] By: gsar on 1999/10/15 09:45:51
+ Log: lvalue subs patch (change#4081) breaks C<\(Foo->Bar())>;
+ avoid tickling it in Pod::Man for now; other nits in
+ Pod::*
+ Branch: perl
+ ! lib/Pod/Man.pm lib/Pod/Parser.pm pod/perldelta.pod
+ ! pod/perlopentut.pod
+____________________________________________________________________________
+[ 4389] By: gsar on 1999/10/15 08:55:01
+ Log: disable internal globbing for miniperl (or build breaks out
+ in a rash of failed dependencies)
+ Branch: perl
+ ! Makefile.SH op.c win32/Makefile win32/makefile.mk
+____________________________________________________________________________
+[ 4388] By: jhi on 1999/10/15 08:07:49
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ !> Changes ext/POSIX/POSIX.xs lib/Benchmark.pm pod/perldelta.pod
+ !> pod/perlfaq2.pod win32/include/dirent.h win32/win32.c
+____________________________________________________________________________
+[ 4387] By: gsar on 1999/10/15 07:46:24
+ Log: integrate cfgperl contents into mainline
+ Branch: perl
+ ! Changes
+ !> pod/perldelta.pod pod/perldiag.pod regcomp.c
+ !> t/pragma/warn/regcomp
+____________________________________________________________________________
+[ 4386] By: gsar on 1999/10/15 05:45:36
+ Log: various little goofs in change#4385
+ Branch: perl
+ ! win32/include/dirent.h win32/win32.c
+____________________________________________________________________________
+[ 4385] By: gsar on 1999/10/15 04:49:09
+ Log: win32_*dir() cleanup; win32_readdir() iterates as necessary
+ rather than win32_opendir() reading all files up front (untested)
+ Branch: perl
+ ! win32/include/dirent.h win32/win32.c
+____________________________________________________________________________
+[ 4384] By: gsar on 1999/10/15 01:34:09
+ Log: Benchmark notes (from Barrie Slaymaker <barries@slaysys.com>)
+ Branch: perl
+ ! lib/Benchmark.pm pod/perldelta.pod
+____________________________________________________________________________
+[ 4383] By: gsar on 1999/10/15 01:22:32
+ Log: include info about Perl Mongers in perlfaq2 (from David H. Adler
+ <dha@panix.com>)
+ Branch: perl
+ ! pod/perlfaq2.pod
+____________________________________________________________________________
+[ 4382] By: gsar on 1999/10/15 01:14:22
+ Log: From: jand@ActiveState.com (Jan Dubois)
+ Date: Fri, 15 Oct 1999 01:14:23 +0200
+ Message-ID: <380f61ae.18202914@smtprelay.t-online.de>
+ Subject: [PATCH 5.005_61] Prevent "Out of memory" error in POSIX's strftime()
+ Branch: perl
+ ! ext/POSIX/POSIX.xs
+____________________________________________________________________________
+[ 4381] By: jhi on 1999/10/14 22:11:36
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ !> XSUB.h cop.h embed.h embed.pl ext/File/Glob/bsd_glob.c
+ !> lib/Time/Local.pm perl.c perlapi.c pod/perlop.pod pp_ctl.c
+ !> proto.h scope.c scope.h t/op/runlevel.t util.c win32/Makefile
+ !> win32/makefile.mk
+____________________________________________________________________________
+[ 4380] By: jhi on 1999/10/14 22:08:22
+ Log: Warn inside character classes about unknown backslash escapes
+ (that are not caught earlier because of being completely unknown,
+ such as \m), such as \z (because they make do sense inside regexen,
+ but not inside character classes).
+ Branch: cfgperl
+ ! pod/perldelta.pod pod/perldiag.pod regcomp.c
+ ! t/pragma/warn/regcomp
+____________________________________________________________________________
+[ 4379] By: gsar on 1999/10/14 18:26:56
+ Log: clarify significance of parens for "x" (from M.J.T. Guy
+ <mjtg@cus.cam.ac.uk>)
+ Branch: perl
+ ! pod/perlop.pod
+____________________________________________________________________________
+[ 4378] By: gsar on 1999/10/14 18:25:20
+ Log: make timelocal work better when time is close to the epoch
+ east of GMT (from Keiki SATOH <kki@wakusei.ne.jp>)
+ Branch: perl
+ ! lib/Time/Local.pm
+____________________________________________________________________________
+[ 4377] By: gsar on 1999/10/14 18:15:11
+ Log: integrate cfgperl contents into mainline
+ Branch: perl
+ +> ext/DB_File/hints/sco.pl
+ !> MANIFEST hints/aix.sh hints/linux.sh hints/svr5.sh
+ !> pod/perldelta.pod pod/perldiag.pod pod/perlop.pod
+ !> pod/perlre.pod regcomp.c t/op/re_tests t/pragma/warn/regcomp
+____________________________________________________________________________
+[ 4376] By: gsar on 1999/10/14 17:47:35
+ Log: fix POPSTACK panics that ensued from bad interaction between
+ runlevels and stack of stacks (change#3988 done right);
+ basically, we pop the runlevel if the stacklevel is not the
+ same one we started the runlevel with
+ Branch: perl
+ ! cop.h perl.c pp_ctl.c t/op/runlevel.t util.c
+____________________________________________________________________________
+[ 4375] By: gsar on 1999/10/14 15:54:48
+ Log: avoid warnings
+ Branch: perl
+ ! ext/File/Glob/bsd_glob.c
+____________________________________________________________________________
+[ 4374] By: jhi on 1999/10/14 10:08:44
+ Log: Warn about false ranges like \d-\w (see the change #4355).
+ The invalid ranges (b-a) warning message also enhanced.
+ Branch: cfgperl
+ ! pod/perldelta.pod pod/perldiag.pod regcomp.c t/op/re_tests
+ ! t/pragma/warn/regcomp
+____________________________________________________________________________
+[ 4373] By: gsar on 1999/10/14 03:49:54
+ Log: File::Glob fixes for Windows
+ Branch: perl
+ ! XSUB.h ext/File/Glob/bsd_glob.c win32/Makefile
+ ! win32/makefile.mk
+____________________________________________________________________________
+[ 4372] By: gsar on 1999/10/14 02:21:31
+ Log: avoid inefficiency in change#3386 (every longjmp() was followed
+ by an avoidable call to setjmp())
+ Branch: perl
+ ! embed.h embed.pl perl.c perlapi.c pod/perldelta.pod pp_ctl.c
+ ! proto.h scope.c scope.h
+____________________________________________________________________________
+[ 4371] By: jhi on 1999/10/13 21:17:17
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ !> op.c pod/perldelta.pod
+____________________________________________________________________________
+[ 4370] By: gsar on 1999/10/13 18:08:45
+ Log: misc tweaks
+ Branch: perl
+ ! op.c pod/perldelta.pod
+____________________________________________________________________________
+[ 4369] By: jhi on 1999/10/13 16:18:58
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ !> pod/perldelta.pod pod/perldiag.pod pod/perlfunc.pod
+____________________________________________________________________________
+[ 4368] By: gsar on 1999/10/13 16:14:16
+ Log: pod nits from various perl porters
+ Branch: perl
+ ! pod/perldelta.pod pod/perldiag.pod pod/perlfunc.pod
+____________________________________________________________________________
+[ 4367] By: jhi on 1999/10/13 12:10:30
+ Log: From: Vlad Harchev <hvv@hippo.ru>
+ To: perl5-porters@perl.org
+ Subject: [ID 19991013.002] fix for 'perlop.pod' shipped with perl5.00503
+ Date: Wed, 13 Oct 1999 15:48:59 +0500 (SAMST)
+ Message-Id: <Pine.LNX.4.10.9910131546580.3542-100000@localhost.localdomain>
+ Branch: cfgperl
+ ! pod/perlop.pod
+____________________________________________________________________________
+[ 4366] By: gsar on 1999/10/13 08:11:11
+ Log: typos and language goofs pointed out by Hugo van der Sanden
+ <hv@crypt.compulink.co.uk>
+ Branch: perl
+ ! pod/perldelta.pod pod/perldiag.pod
+____________________________________________________________________________
+[ 4365] By: jhi on 1999/10/13 07:27:44
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ +> ext/File/Glob/Changes ext/File/Glob/Glob.pm
+ +> ext/File/Glob/Glob.xs ext/File/Glob/Makefile.PL
+ +> ext/File/Glob/TODO ext/File/Glob/bsd_glob.c
+ +> ext/File/Glob/bsd_glob.h ext/NDBM_File/hints/sco.pl
+ +> t/lib/glob-basic.t t/lib/glob-global.t t/lib/glob-taint.t
+ !> Changes MANIFEST README.win32 ext/ODBM_File/hints/sco.pl
+ !> lib/perl5db.pl op.c pod/perldelta.pod pod/perlfaq8.pod
+ !> pod/perlfunc.pod pod/perlop.pod pod/perlport.pod t/op/glob.t
+ !> t/op/readdir.t t/op/taint.t t/pragma/overload.t util.c
+____________________________________________________________________________
+[ 4364] By: gsar on 1999/10/13 07:06:04
+ Log: debugger tweak (from M.J.T. Guy <mjtg@cus.cam.ac.uk>)
+ Branch: perl
+ ! lib/perl5db.pl
+____________________________________________________________________________
+[ 4363] By: jhi on 1999/10/13 07:03:43
+ Log: From: Mike Hopkirk (hops) <hops@scoot.pdev.sco.com>
+ To: perl5-porters@perl.org
+ Subject: [ID 19991012.002] Latest UnixWare7 (svr5.sh) hints file
+ Date: Tue, 12 Oct 1999 19:48:11 -0700 (PDT)
+ Message-Id: <199910130248.TAA14636@scoot.pdev.sco.com>
+ Branch: cfgperl
+ ! hints/svr5.sh
+____________________________________________________________________________
+[ 4362] By: jhi on 1999/10/13 06:57:16
+ Log: Add DB_File hint for SCO ODT.
+ From: hops@sco.com
+ To: perl5-porters@perl.org
+ Subject: [ID 19991012.004] Build patch for perl5.005_03 on ODT3 ( 3.2v4.2)
+ Date: Tue, 12 Oct 1999 20:16:04 PDT
+ Message-Id: <199910122016.aa18415@charmstr.pdev.sco.com>
+ Branch: cfgperl
+ + ext/DB_File/hints/sco.pl
+ ! MANIFEST
+____________________________________________________________________________
+[ 4361] By: gsar on 1999/10/13 06:56:08
+ Log: PL_numeric_radix used without being defined (from Ilya
+ Zakharevich)
+ Branch: perl
+ ! util.c
+____________________________________________________________________________
+[ 4360] By: gsar on 1999/10/13 06:43:03
+ Log: use libdbm.nfs.a if available (libdbm.a is missing dbmclose())
+ From: hops@sco.com
+ Date: Tue, 12 Oct 1999 20:16:04 PDT
+ Message-Id: <199910122016.aa18415@charmstr.pdev.sco.com>
+ Subject: [ID 19991012.004] Build patch for perl5.005_03 on ODT3 ( 3.2v4.2)
+ Branch: perl
+ + ext/NDBM_File/hints/sco.pl
+ ! MANIFEST ext/ODBM_File/hints/sco.pl
+____________________________________________________________________________
+[ 4359] By: gsar on 1999/10/13 06:34:53
+ Log: various pod tweaks (from M.J.T. Guy <mjtg@cus.cam.ac.uk>)
+ Branch: perl
+ ! README.win32 pod/perlfaq8.pod pod/perlfunc.pod pod/perlop.pod
+ ! pod/perlport.pod
+____________________________________________________________________________
+[ 4358] By: gsar on 1999/10/12 19:10:27
+ Log: perldelta updates
+ Branch: perl
+ ! pod/perldelta.pod
+____________________________________________________________________________
+[ 4357] By: gsar on 1999/10/12 17:11:18
+ Log: update perldelta for change#4356
+ Branch: perl
+ ! Changes pod/perldelta.pod
+____________________________________________________________________________
+[ 4356] By: gsar on 1999/10/12 16:53:31
+ Log: add File::BSDGlob as File::Glob and load it at compile-time
+ if perl was built with -DPERL_INTERNAL_GLOB
+
+ TODO: we currently get a compile-time failure if File/Glob.pm
+ can't be found; such failure needs to be made to emit a warning
+ and use the csh implementation instead
+ Branch: perl
+ + ext/File/Glob/Changes ext/File/Glob/Glob.pm
+ + ext/File/Glob/Glob.xs ext/File/Glob/Makefile.PL
+ + ext/File/Glob/TODO ext/File/Glob/bsd_glob.c
+ + ext/File/Glob/bsd_glob.h t/lib/glob-basic.t
+ + t/lib/glob-global.t t/lib/glob-taint.t
+ ! MANIFEST op.c t/op/glob.t t/op/readdir.t t/op/taint.t
+ ! t/pragma/overload.t
+____________________________________________________________________________
+[ 4355] By: jhi on 1999/10/12 15:30:05
+ Log: Revert the parts of #3926 that outlawed character ranges
+ that have character classes such as \w as either endpoint.
+ This change re-establishes the old behavior which meant that
+ such ranges weren't really ranges, the "-" was literal.
+ Moreover, this change also fixes the old behavior to be
+ more consistent: [\w-.] and [\s-\w] worked, but [.-\w] didn't.
+ Now they all do work as described above. The #3926 outlawed
+ all of those.
+ Branch: cfgperl
+ ! pod/perldiag.pod pod/perlre.pod regcomp.c t/op/re_tests
+____________________________________________________________________________
+[ 4354] By: jhi on 1999/10/12 09:58:59
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ !> (integrate 33 files)
+____________________________________________________________________________
+[ 4353] By: gsar on 1999/10/12 05:53:40
+ Log: apply parts of LynxOS patches from Alan Johnson
+ <johnson@alonn.gemse.fr>
+ Branch: perl
+ ! Changes hints/lynxos.sh pod/perldelta.pod t/lib/safe2.t
+ ! t/op/groups.t
+____________________________________________________________________________
+[ 4352] By: gsar on 1999/10/12 05:24:39
+ Log: allow any unpack specifier to take a count via '/'
+ (from Ilya Zakharevich)
+ Branch: perl
+ ! pp.c t/op/pack.t
+____________________________________________________________________________
+[ 4351] By: gsar on 1999/10/12 05:02:35
+ Log: avoid warnings
+ Branch: perl
+ ! malloc.c
+____________________________________________________________________________
+[ 4350] By: gsar on 1999/10/12 04:50:52
+ Log: various cleanups
+ Branch: perl
+ ! ext/Devel/DProf/DProf.xs op.c perl.c perly.c perly.y
+ ! perly_c.diff pp_hot.c toke.c vms/perly_c.vms win32/config.bc
+ ! win32/config.gc win32/config.vc win32/config_H.bc
+ ! win32/config_H.gc win32/config_H.vc win32/config_sh.PL
+____________________________________________________________________________
+[ 4349] By: gsar on 1999/10/12 00:23:11
+ Log: update Changes, patchlevel etc.
+ Branch: perl
+ ! Changes Porting/findvars patchlevel.h win32/Makefile
+ ! win32/config_H.bc win32/config_H.gc win32/config_H.vc
+ ! win32/makefile.mk
+____________________________________________________________________________
+[ 4348] By: gsar on 1999/10/11 23:11:57
+ Log: add vec() example from Chaim Frenkel <chaimf@pobox.com>
+ Branch: perl
+ ! pod/perlfunc.pod
+____________________________________________________________________________
+[ 4347] By: jhi on 1999/10/11 21:25:03
+ Log: Sparc Linux -Duseshrplib fix.
+
+ From: Brian Jepson <bjepson@home.com>
+ To: Nick Ing-Simmons <nick@ing-simmons.net>
+ cc: perl5-porters@perl.org
+ Subject: Re: [ID 19990813.002] Can't build Perl 5.005_60 on SPARC/Linux with -Duseshrplib
+ Date: Fri, 20 Aug 1999 11:25:17 -0500 (EST)
+ Message-ID: <Pine.LNX.4.10.9908201123570.5116-100000@cx384756-a.sking1.ri.home.com>
+ Branch: cfgperl
+ ! hints/linux.sh
+____________________________________________________________________________
+[ 4346] By: gsar on 1999/10/11 20:28:32
+ Log: more pack/unpack documentation (from Ilya Zakharevich); changed
+ the behavior of 'Z*' and 'Z3' to always pack a trailing
+ null byte; changed documentation to suit; added test
+ Branch: perl
+ ! pod/perlfunc.pod pp.c t/op/pack.t
+____________________________________________________________________________
+[ 4345] By: gsar on 1999/10/11 19:15:46
+ Log: writing to perllocal.pod fails if it was never created;
+ tweak pseudo-hash example (both suggested by Michael G Schwern
+ <schwern@pobox.com>)
+ Branch: perl
+ ! lib/ExtUtils/MM_Unix.pm pod/perlref.pod
+____________________________________________________________________________
+[ 4344] By: gsar on 1999/10/11 17:57:31
+ Log: slightly edited variant of suggested patch
+ From: Ilya Zakharevich <ilya@math.ohio-state.edu>
+ Date: Thu, 9 Sep 1999 18:35:37 -0400
+ Message-ID: <19990909183537.A28682@monk.mps.ohio-state.edu>
+ Subject: [PATCH 5.005_58] How RExen match?
+ Branch: perl
+ ! pod/perlre.pod
+____________________________________________________________________________
+[ 4343] By: gsar on 1999/10/11 16:55:48
+ Log: change#4327 was inefficient
+ Branch: perl
+ ! lib/lib.pm
+____________________________________________________________________________
+[ 4342] By: jhi on 1999/10/11 07:01:46
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ +> pod/perlhack.pod
+ !> (integrate 28 files)
+____________________________________________________________________________
+[ 4341] By: jhi on 1999/10/11 06:37:47
+ Log: The 2.5th cut at the AIX C++ extension problems.
+ Branch: cfgperl
+ ! hints/aix.sh
+____________________________________________________________________________
+[ 4340] By: gsar on 1999/10/10 23:48:07
+ Log: add perlhack.pod from Nathan Torkington <gnat@frii.com>
+ Branch: perl
+ + pod/perlhack.pod
+ ! MANIFEST pod/Makefile pod/perl.pod pod/roffitall
+____________________________________________________________________________
+[ 4339] By: gsar on 1999/10/10 20:42:40
+ Log: revert SAVEDESTRUCTOR() to accepting void(*)(void*) for source
+ compatibility; introduce SAVEDESTRUCTOR_X() that accepts
+ void(*)(pTHX_ void*)
+ Branch: perl
+ ! embed.h embed.pl ext/Devel/DProf/DProf.xs global.sym mg.c
+ ! objXSUB.h perl.h perlapi.c perly.c perly.y perly_c.diff
+ ! pod/perlguts.pod pod/perltoc.pod pp.c pp_hot.c proto.h
+ ! regcomp.h regexec.c scope.c scope.h toke.c vms/perly_c.vms
+____________________________________________________________________________
+[ 4338] By: gsar on 1999/10/10 20:38:59
+ Log: add missing new diagnostics to perldelta
+ Branch: perl
+ ! pod/perldelta.pod
+____________________________________________________________________________
+[ 4337] By: gsar on 1999/10/10 17:40:13
+ Log: update perldelta for change#3406
+ Branch: perl
+ ! embed.pl pod/perldata.pod pod/perldelta.pod
+____________________________________________________________________________
+[ 4336] By: gsar on 1999/10/10 16:33:14
+ Log: integrate cfgperl contents into mainline
+ Branch: perl
+ +> ext/DynaLoader/hints/aix.pl
+ !> MANIFEST ext/DynaLoader/dl_aix.xs hints/aix.sh hints/irix_6.sh
+ !> makedef.pl perl.h pod/perldelta.pod
+____________________________________________________________________________
+[ 4335] By: jhi on 1999/10/10 11:09:48
+ Log: Update perldelta.
+ Branch: cfgperl
+ ! pod/perldelta.pod
+____________________________________________________________________________
+[ 4334] By: jhi on 1999/10/10 10:31:46
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ +> win32/genmk95.pl
+ !> Changes MANIFEST README.win32 cop.h ext/Thread/Thread.pm
+ !> ext/Thread/Thread.xs ext/Thread/Thread/Queue.pm
+ !> ext/Thread/Thread/Semaphore.pm ext/Thread/Thread/Specific.pm
+ !> ext/Thread/sync.t ext/Thread/sync2.t installperl
+ !> lib/Exporter.pm lib/ExtUtils/MM_Unix.pm
+ !> lib/ExtUtils/MM_Win32.pm lib/diagnostics.pm lib/lib.pm perl.c
+ !> pod/perldelta.pod pod/perlfunc.pod pp_ctl.c pp_hot.c pp_sys.c
+ !> utils/perldoc.PL win32/makefile.mk
+____________________________________________________________________________
+[ 4333] By: gsar on 1999/10/10 06:33:15
+ Log: install pods to 'pods' rather than 'pod' on cygwin (modified
+ a patch suggested by cwilson@cc865179-c.chmbl1.ga.home.com)
+ Branch: perl
+ ! installperl lib/diagnostics.pm utils/perldoc.PL
+____________________________________________________________________________
+[ 4332] By: gsar on 1999/10/10 05:15:26
+ Log: add $VERSION
+ Branch: perl
+ ! lib/Exporter.pm
+____________________________________________________________________________
+[ 4331] By: gsar on 1999/10/10 05:10:22
+ Log: describe what can go in an export list (from Anno Siegel
+ <anno4000@lublin.zrz.tu-berlin.de>)
+ Branch: perl
+ ! lib/Exporter.pm
+____________________________________________________________________________
+[ 4330] By: gsar on 1999/10/10 04:50:43
+ Log: more basic support for building modules under Windows 95/98
+ (applied relevant parts from a patch suggested by
+ Jochen Wiedmann <joe@ispsoft.de>)
+ Branch: perl
+ ! lib/ExtUtils/MM_Unix.pm
+____________________________________________________________________________
+[ 4329] By: gsar on 1999/10/10 04:28:38
+ Log: rudimentary support for building under Windows 95/98 (from
+ Benjamin Stuhl <sho_pi@hotmail.com>)
+ Branch: perl
+ + win32/genmk95.pl
+ ! MANIFEST README.win32 lib/ExtUtils/MM_Win32.pm
+ ! win32/makefile.mk
+____________________________________________________________________________
+[ 4328] By: gsar on 1999/10/10 03:37:21
+ Log: fix two leaks in Thread.xs (from Eugene Alterman
+ <Eugene.Alterman@bremer-inc.com>); convert places with
+ 'use attrs' to new attributes syntax
+ Branch: perl
+ ! ext/Thread/Thread.pm ext/Thread/Thread.xs
+ ! ext/Thread/Thread/Queue.pm ext/Thread/Thread/Semaphore.pm
+ ! ext/Thread/Thread/Specific.pm ext/Thread/sync.t
+ ! ext/Thread/sync2.t
+____________________________________________________________________________
+[ 4327] By: gsar on 1999/10/10 02:23:52
+ Log: avoid duplicates in @INC, they cause leaks in mod_perl etc
+ (suggested by Tod Irwin <irwin@stockmaster.com>)
+ Branch: perl
+ ! lib/lib.pm
+____________________________________________________________________________
+[ 4326] By: gsar on 1999/10/10 00:51:48
+ Log: better documentation for recv() (from Anton Berezin
+ <tobez@plab.ku.dk>)
+ Branch: perl
+ ! pod/perlfunc.pod
+____________________________________________________________________________
+[ 4325] By: gsar on 1999/10/09 22:46:23
+ Log: perldelta updates (see TODO markers)
+ Branch: perl
+ ! Changes pod/perldelta.pod pp_sys.c
+____________________________________________________________________________
+[ 4324] By: gsar on 1999/10/09 19:43:10
+ Log: fix Exporter::export_to_level() documentation
+ Branch: perl
+ ! lib/Exporter.pm
+____________________________________________________________________________
+[ 4323] By: gsar on 1999/10/09 18:48:31
+ Log: don't run END blocks when running under -c switch (older,
+ rarely useful behavior may still be obtained by putting
+ BEGIN { $^C = 0; exit; } at the end of the script)
+ Branch: perl
+ ! perl.c
+____________________________________________________________________________
+[ 4322] By: jhi on 1999/10/09 05:31:26
+ Log: While awaiting a good test program to detect the broken gcc.
+ From: Thomas Conté <tom@fr.uu.net>
+ To: <jhi@iki.fi>
+ Cc: <perl5-porters@perl.org>
+ Subject: Re: [ID 19990825.007] test t/lib/ipc_sysv.t failing under irix 6.4
+ Date: Wed, 6 Oct 1999 19:56:29 +0200
+ Message-ID: <000a01bf1024$1d938f20$252ad0d4@eng.iway.fr>
+ Branch: cfgperl
+ ! hints/irix_6.sh perl.h
+____________________________________________________________________________
+[ 4321] By: gsar on 1999/10/09 00:41:02
+ Log: POPSUB() gave up the refcount to the CV before LEAVE had a chance to
+ clear entries in the CV's pad, leading to coredumps when CV had no
+ other references to it; this is a slightly edited version of the
+ patch suggested by Russel O'Connor <roconnor@world.std.com>
+ Branch: perl
+ ! cop.h pp_ctl.c pp_hot.c
+____________________________________________________________________________
+[ 4320] By: gsar on 1999/10/08 22:50:51
+ Log: revert POP{SUB,LOOP}{1,2} logic to the simpler pre-5.003_24
+ situation (assumptions about cx invalidation are not valid
+ anymore)
+ Branch: perl
+ ! cop.h pp_ctl.c pp_hot.c
+____________________________________________________________________________
+[ 4319] By: jhi on 1999/10/08 14:33:31
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ !> cop.h ext/Thread/Thread.xs op.c opcode.h perl.c perl.h perly.c
+ !> perly.y pod/perldiag.pod pod/perlfunc.pod pp_ctl.c pp_sys.c
+ !> t/comp/bproto.t thrdvar.h toke.c util.c
+____________________________________________________________________________
+[ 4318] By: jhi on 1999/10/08 13:51:34
+ Log: The second cut at AIX C++ extension troubles.
+ Branch: cfgperl
+ ! ext/DynaLoader/dl_aix.xs ext/DynaLoader/hints/aix.pl
+ ! hints/aix.sh
+____________________________________________________________________________
+[ 4317] By: jhi on 1999/10/08 10:44:13
+ Log: The first cut at fixing Perl extensions written in C++ in AIX,
+ statics don't get initialized right. This patch at least
+ doesn't seem to break the build in my AIX, but unfortunately
+ I don't have the IBM C++ to do further testing.
+
+ Problem reported by Stephanie Beals in
+ From: bealzy@us.ibm.com
+ To: perl5-porters@perl.org
+ Subject: [ID 19991007.005] DynaLoader/dl_aix.xs problem using load and unload on AIX
+ Date: Thu, 7 Oct 1999 15:05:54 -0400
+ Message-Id: <85256803.0068E70D.00@D51MTA03.pok.ibm.com>
+ Branch: cfgperl
+ + ext/DynaLoader/hints/aix.pl
+ ! MANIFEST ext/DynaLoader/dl_aix.xs hints/aix.sh
+____________________________________________________________________________
+[ 4316] By: gsar on 1999/10/08 10:26:15
+ Log: remove kludgey duplicate background error avoidance (caused
+ "leaks"; %@ wasn't even user-visible under -Dusethreads);
+ only repeats of most recent error are now avoided
+ Branch: perl
+ ! ext/Thread/Thread.xs perl.c perl.h pp_ctl.c thrdvar.h util.c
+____________________________________________________________________________
+[ 4315] By: jhi on 1999/10/08 09:48:59
+ Log: Fix omission.
+ Branch: cfgperl
+ ! makedef.pl
+____________________________________________________________________________
+[ 4314] By: gsar on 1999/10/08 07:17:01
+ Log: extend change#2299 to C<use> (fixes scoping problems in
+ C<if (...) { use foo; ... }>)
+ Branch: perl
+ ! op.c
+____________________________________________________________________________
+[ 4313] By: gsar on 1999/10/08 04:52:19
+ Log: small tweak for change#4309
+ Branch: perl
+ ! op.c
+____________________________________________________________________________
+[ 4312] By: gsar on 1999/10/08 02:31:13
+ Log: add suggested patch =~ s/NOTOP/OP_NOT/ with tests
+ From: Larry Wall <larry@wall.org>
+ Date: Wed, 6 Oct 1999 09:55:57 -0700 (PDT)
+ Message-Id: <199910061655.JAA11333@kiev.wall.org>
+ Subject: Re: [ID 19991001.004] apparent parsing error with not(arg)
+ Branch: perl
+ ! opcode.h t/comp/bproto.t toke.c
+____________________________________________________________________________
+[ 4311] By: gsar on 1999/10/08 00:58:19
+ Log: typo
+ Branch: perl
+ ! pp_sys.c
+____________________________________________________________________________
+[ 4310] By: gsar on 1999/10/07 23:51:38
+ Log: fix setpgrp vs getpgrp and POSIX vs BSD confusion (spotted by
+ Brian Mitchell <brian@chele.cais.net>)
+ Branch: perl
+ ! pod/perldiag.pod pod/perlfunc.pod pp_sys.c
+____________________________________________________________________________
+[ 4309] By: gsar on 1999/10/07 22:57:52
+ Log: change#3728 was flawed (loop contexts saw the wrong statement
+ info, causing loop control constructs to not find the label);
+ disable OP_SETSTATE entirely and add a fix that is specifically
+ targetted at disabling the OP_LINESEQ optimization in else BLOCK,
+ which was what the original patch was supposed to fix
+
+ TODO: remove the remainder of the setstate logic if it can't
+ be used anywhere else (it isn't used anywhere now)
+ Branch: perl
+ ! cop.h op.c perly.c perly.y
+____________________________________________________________________________
+[ 4308] By: jhi on 1999/10/07 19:21:27
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ !> lib/Pod/Man.pm lib/Pod/Text.pm pod/pod2man.PL
+____________________________________________________________________________
+[ 4307] By: gsar on 1999/10/07 15:12:24
+ Log: update to podlators-0.08 from Russ Allbery
+ Branch: perl
+ ! lib/Pod/Man.pm lib/Pod/Text.pm pod/pod2man.PL
+____________________________________________________________________________
+[ 4306] By: jhi on 1999/10/06 17:20:34
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ !> (integrate 45 files)
+____________________________________________________________________________
+[ 4305] By: gsar on 1999/10/06 16:55:45
+ Log: some versions of mingw32 have __int64, define iff it isn't
+ Branch: perl
+ ! win32/win32.h
+____________________________________________________________________________
+[ 4304] By: gsar on 1999/10/06 03:45:44
+ Log: fix typos in change#4288
+ Branch: perl
+ ! Changes dump.c sv.c
+____________________________________________________________________________
+[ 4303] By: gsar on 1999/10/06 03:22:46
+ Log: integrate cfgperl contents into mainline
+ Branch: perl
+ +> eg/cgi/dna_small_gif.uu eg/cgi/wilogo_gif.uu
+ - eg/cgi/dna.small.gif.uu eg/cgi/wilogo.gif.uu
+ !> (integrate 31 files)
+____________________________________________________________________________
+[ 4302] By: gsar on 1999/10/06 02:36:53
+ Log: make die/warn and other diagnostics go to wherever STDERR happens
+ to point at; change places that meant Perl_debug_log rather than
+ PerlIO_stderr()
+ Branch: perl
+ ! cop.h doio.c embedvar.h ext/Devel/Peek/Peek.xs
+ ! ext/DynaLoader/dl_aix.xs ext/DynaLoader/dl_beos.xs
+ ! ext/DynaLoader/dl_cygwin.xs ext/DynaLoader/dl_dld.xs
+ ! ext/DynaLoader/dl_dlopen.xs ext/DynaLoader/dl_hpux.xs
+ ! ext/DynaLoader/dl_mpeix.xs ext/DynaLoader/dl_next.xs
+ ! ext/DynaLoader/dl_rhapsody.xs ext/DynaLoader/dl_vmesa.xs
+ ! ext/DynaLoader/dl_vms.xs ext/DynaLoader/dlutils.c
+ ! ext/Thread/Thread.xs ext/Thread/typemap intrpvar.h malloc.c
+ ! mg.c objXSUB.h op.c perl.c perl.h perlio.c pp.c pp_ctl.c
+ ! pp_hot.c regexec.c scope.c scope.h sv.c thread.h toke.c util.c
+ ! win32/dl_win32.xs win32/win32.c win32/win32thread.c
+____________________________________________________________________________
+[ 4301] By: jhi on 1999/10/05 23:03:46
+ Log: From: Ilya Zakharevich <ilya@math.ohio-state.edu>
+ To: François Désarménien <desar@club-internet.fr>
+ Cc: "perl5-porters@perl.org" <perl5-porters@perl.org>
+ Subject: Re: Strange RE engine breakage in 5_61
+ Date: Mon, 4 Oct 1999 19:58:03 -0400
+ Message-ID: <19991004195803.A21760@monk.mps.ohio-state.edu>
+
+ (had to apply pat.t part manually because there
+ already were more tests than there was in _61)
+ Branch: cfgperl
+ ! regcomp.c regexec.c t/op/pat.t t/op/re_tests
+____________________________________________________________________________
+[ 4300] By: jhi on 1999/10/04 17:03:18
+ Log: From: Andy Dougherty <doughera@lafayette.edu>
+ To: Jarkko Hietaniemi <jhi@iki.fi>
+ cc: Perl Porters <perl5-porters@perl.org>, jhi@cc.hut.fi
+ Subject: Re: [ID 19991001.005] [_61] [PATCH] tarball fine on win32, zip isn't
+ Date: Mon, 4 Oct 1999 13:05:08 -0400 (EDT)
+ Message-ID: <Pine.SOL.4.10.9910041302550.6502-100000@maxwell.phys.lafayette.edu>
+ Branch: cfgperl
+ + eg/cgi/dna_small_gif.uu eg/cgi/wilogo_gif.uu
+ - eg/cgi/dna.small.gif.uu eg/cgi/wilogo.gif.uu
+ ! MANIFEST ext/B/defsubs_h.PL
+____________________________________________________________________________
+[ 4299] By: jhi on 1999/10/04 07:15:16
+ Log: From: Michael G Schwern <schwern@pobox.com>
+ To: perl5-porters@perl.org
+ Subject: Re: [PATCH av.c, op.c, perldiag.pod] "array field" -> "pseudo-hash field"
+ Date: Sun, 3 Oct 1999 17:34:17 -0400
+ Message-ID: <19991003173417.A4351@blackrider>
+ Branch: cfgperl
+ ! t/lib/fields.t t/pragma/constant.t
+____________________________________________________________________________
+[ 4298] By: gsar on 1999/10/04 04:57:53
+ Log: some compatibility macros were busted
+ Branch: perl
+ ! embed.h embed.pl toke.c
+____________________________________________________________________________
+[ 4297] By: jhi on 1999/10/03 17:50:59
+ Log: A better version of #4296.
+
+ From: Michael G Schwern <schwern@pobox.com>
+ To: perl5-porters@perl.org
+ Subject: [PATCH av.c, op.c, perldiag.pod] "array field" -> "pseudo-hash field"
+ Date: Sun, 3 Oct 1999 13:54:23 -0400
+ Message-ID: <19991003135423.A3050@blackrider>
+ Branch: cfgperl
+ ! av.c op.c pod/perldiag.pod
+____________________________________________________________________________
+[ 4296] By: jhi on 1999/10/03 17:21:01
+ Log: (Replaced by #4297.)
+
+ From: Michael G Schwern <schwern@pobox.com>
+ To: perl5-porters@perl.org
+ Subject: [PATCH av.c, perldiag.pod] Added field name to "No such array field"
+ Date: Sun, 3 Oct 1999 13:16:47 -0400
+ Message-ID: <19991003131647.A2816@blackrider>
+
+ plus changed the error message to say "No such pseudo-hash field"
+ as discussed in the above mail message.
+ Branch: cfgperl
+ ! av.c pod/perldiag.pod
+____________________________________________________________________________
+[ 4295] By: gsar on 1999/10/03 16:09:36
+ Log: avoid doing irrelevant things on 'make perl'
+ Branch: perl
+ ! Makefile.SH
+____________________________________________________________________________
+[ 4294] By: jhi on 1999/10/03 14:16:24
+ Log: Fix a typo in #4293 spotted by Graham Barr.
+ Branch: cfgperl
+ ! pod/perlref.pod
+____________________________________________________________________________
+[ 4293] By: jhi on 1999/10/03 11:31:22
+ Log: From: Michael G Schwern <schwern@blackrider.aocn.com>
+ To: perl5-porters@perl.org
+ Subject: Re: Should keys in pseudo-hashes -always- exist? [DOC PATCH]
+ Date: Sun, 3 Oct 1999 02:34:01 -0400
+ Message-ID: <19991003023401.A1520@blackrider>
+ Branch: cfgperl
+ ! pod/perlfunc.pod pod/perlref.pod
+____________________________________________________________________________
+[ 4292] By: jhi on 1999/10/03 09:23:16
+ Log: From: Barrie Slaymaker <barries@slaysys.com>
+ To: perl5-porters@perl.org
+ Subject: [PATCH 5.005_61] Benchmark.pm bugfix, tweaks
+ Date: Sun, 3 Oct 1999 00:09:51 -0400
+ Message-Id: <199910030409.AAA18228@jester.slaysys.com>
+ Branch: cfgperl
+ ! lib/Benchmark.pm
+____________________________________________________________________________
+[ 4291] By: jhi on 1999/10/02 23:43:53
+ Log: Be understanding about large file systems.
+ Branch: cfgperl
+ ! t/lib/syslfs.t t/op/lfs.t
+____________________________________________________________________________
+[ 4290] By: jhi on 1999/10/02 23:39:16
+ Log: Configure fixfest continues.
+ Branch: cfgperl
+ ! Configure config_h.SH
+ Branch: metaconfig
+ ! U/modified/d_longdbl.U U/modified/d_longlong.U
+ ! U/threads/d_pthreadj.U U/typedefs/gidsign.U
+ ! U/typedefs/gidsize.U U/typedefs/pidsign.U U/typedefs/pidsize.U
+ ! U/typedefs/uidsign.U U/typedefs/uidsize.U
+ Branch: metaconfig/U/perl
+ ! i_inttypes.U io64.U
+____________________________________________________________________________
+[ 4289] By: jhi on 1999/10/02 23:12:54
+ Log: Regen Porting stuff.
+ Branch: cfgperl
+ ! Porting/Glossary Porting/config.sh Porting/config_H
+____________________________________________________________________________
+[ 4288] By: jhi on 1999/10/02 23:05:50
+ Log: Untangle the IV_IS_QUAD jungle by introduding
+ macros to be used when doing formatted printing:
+ IVdf, UVuf, UVxf, UVof. Also introduce Uid_t_SIGN.
+ Branch: cfgperl
+ ! Configure Porting/Glossary Porting/config.sh Porting/config_H
+ ! config_h.SH doio.c dump.c op.c perl.h pp_hot.c pp_sys.c
+ ! regcomp.c sv.c taint.c toke.c util.c
+____________________________________________________________________________
+[ 4287] By: jhi on 1999/10/02 22:54:18
+ Log: metaconfig maintenance.
+ Branch: metaconfig
+ ! U/ebcdic/ebcdic.U U/typedefs/gidsign.U U/typedefs/gidsize.U
+ ! U/typedefs/pidsign.U U/typedefs/pidsize.U U/typedefs/uidsign.U
+ ! U/typedefs/uidsize.U
+____________________________________________________________________________
+[ 4286] By: nick on 1999/10/02 11:11:44
+ Log: Incremental merge of mainline
+ Branch: utfperl
+ +> README.Y2K hints/svr5.sh lib/Pod/Man.pm
+ +> lib/unicode/Unicode.html t/op/args.t t/pod/multiline_items.t
+ +> t/pod/multiline_items.xr t/pod/pod2usage.t t/pod/pod2usage.xr
+ +> t/pod/podselect.t t/pod/podselect.xr
+ - lib/Pod/PlainText.pm
+ !> (integrate 148 files)
+____________________________________________________________________________
+[ 4285] By: jhi on 1999/10/02 10:16:15
+ Log: Battle namespace pollution.
+ Branch: cfgperl
+ ! lib/Benchmark.pm
+____________________________________________________________________________
+[ 4284] By: jhi on 1999/10/02 10:11:20
+ Log: Regen Configure, all of xs_apiversion didn't take.
+ Branch: cfgperl
+ ! Configure Porting/Glossary Porting/config.sh Porting/config_H
+ ! config_h.SH patchlevel.h
+____________________________________________________________________________
+[ 4283] By: jhi on 1999/10/02 09:48:17
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ +> lib/Pod/Man.pm t/pod/multiline_items.t
+ +> t/pod/multiline_items.xr t/pod/pod2usage.t t/pod/pod2usage.xr
+ +> t/pod/podselect.t t/pod/podselect.xr
+ - lib/Pod/PlainText.pm
+ !> (integrate 50 files)
+____________________________________________________________________________
+[ 4282] By: gsar on 1999/10/02 06:39:14
+ Log: update pod2man, pod2text and related Pod:: modules with the
+ ones in podlators-0.07 from Russ Allbery
+ Branch: perl
+ + lib/Pod/Man.pm
+ ! lib/Pod/Text.pm lib/Pod/Text/Color.pm lib/Pod/Text/Termcap.pm
+ ! pod/pod2man.PL pod/pod2text.PL
+____________________________________________________________________________
+[ 4281] By: gsar on 1999/10/02 06:14:44
+ Log: fix PodParser testsuite; Pod::Text subsumes Pod::PlainText
+ Branch: perl
+ - lib/Pod/PlainText.pm
+ ! MANIFEST lib/Pod/Text.pm lib/Pod/Usage.pm pod/pod2usage.PL
+ ! pod/podchecker.PL pod/podselect.PL t/pod/emptycmd.t
+ ! t/pod/for.t t/pod/headings.t t/pod/include.t t/pod/included.t
+ ! t/pod/lref.t t/pod/multiline_items.t t/pod/nested_items.t
+ ! t/pod/nested_seqs.t t/pod/oneline_cmds.t t/pod/pod2usage.t
+ ! t/pod/poderrs.t t/pod/poderrs.xr t/pod/podselect.t
+ ! t/pod/special_seqs.t t/pod/testp2pt.pl t/pod/testpchk.pl
+____________________________________________________________________________
+[ 4280] By: gsar on 1999/10/02 04:39:38
+ Log: upgrade to PodParser-1.085 from Brad Appleton <bradapp@enteract.com>
+ Branch: perl
+ + t/pod/multiline_items.t t/pod/multiline_items.xr
+ + t/pod/pod2usage.t t/pod/pod2usage.xr t/pod/podselect.t
+ + t/pod/podselect.xr
+ ! MANIFEST lib/Pod/Checker.pm lib/Pod/InputObjects.pm
+ ! lib/Pod/Parser.pm lib/Pod/PlainText.pm lib/Pod/Select.pm
+ ! lib/Pod/Usage.pm t/pod/for.xr t/pod/headings.xr
+ ! t/pod/include.xr t/pod/included.xr t/pod/lref.xr
+ ! t/pod/nested_items.xr t/pod/nested_seqs.xr
+ ! t/pod/oneline_cmds.xr t/pod/poderrs.xr t/pod/special_seqs.xr
+ ! t/pod/testp2pt.pl
+____________________________________________________________________________
+[ 4279] By: gsar on 1999/10/02 03:36:41
+ Log: make exists() work better on pseudo-hashes (reworked a patch suggested
+ by Michael G Schwern <schwern@pobox.com>)
+ Branch: perl
+ ! av.c t/op/avhv.t
+____________________________________________________________________________
+[ 4278] By: gsar on 1999/10/02 02:36:55
+ Log: deprecate C<use attrs>
+ Branch: perl
+ ! ext/attrs/attrs.pm ext/attrs/attrs.xs t/lib/attrs.t
+ ! t/lib/thread.t t/pragma/sub_lval.t
+____________________________________________________________________________
+[ 4277] By: gsar on 1999/10/02 01:43:25
+ Log: add notes about effect of loop control statements inside
+ LABEL BLOCK continue BLOCK
+ Branch: perl
+ ! pod/perlfunc.pod
+____________________________________________________________________________
+[ 4276] By: gsar on 1999/10/02 01:23:02
+ Log: indent nested =items properly (suggested by Bill Fenner
+ <fenner@research.att.com>)
+ Branch: perl
+ ! pod/pod2man.PL
+____________________________________________________________________________
+[ 4275] By: gsar on 1999/10/02 01:09:16
+ Log: updated ptags generator from Ilya Zakharevich
+ Branch: perl
+ ! emacs/ptags
+____________________________________________________________________________
+[ 4274] By: gsar on 1999/10/01 23:08:52
+ Log: update Changes
+ Branch: perl
+ ! Changes
+____________________________________________________________________________
+[ 4273] By: gsar on 1999/10/01 22:58:55
+ Log: typo, whitespace adjustments
+ Branch: perl
+ ! utils/h2xs.PL
+____________________________________________________________________________
+[ 4272] By: gsar on 1999/10/01 22:46:06
+ Log: remove dup hunks
+ Branch: perl
+ ! configure.com vms/vms.c
+____________________________________________________________________________
+[ 4271] By: gsar on 1999/10/01 22:33:02
+ Log: integrate cfgperl contents into mainline; resolve h2xs.PL conflict
+ by declaring new globals "our" (XXX this means h2xs generated code
+ won't run on earlier versions; a switch to generate compatible
+ source is needed)
+ Branch: perl
+ !> (integrate 35 files)
+____________________________________________________________________________
+[ 4270] By: jhi on 1999/10/01 12:05:56
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ !> ext/B/B/C.pm lib/ExtUtils/typemap lib/ExtUtils/xsubpp
+ !> pod/perldiag.pod util.c
+____________________________________________________________________________
+[ 4269] By: jhi on 1999/10/01 10:26:19
+ Log: From: Piotr Klaban <makler@oryl.man.torun.pl>
+ To: perl5-porters@perl.org
+ Subject: [ID 19991001.001] perlguts man page error
+ Date: Fri, 1 Oct 1999 10:23:49 +0200 (MET DST)
+ Message-Id: <199910010823.KAA05796@oryl.man.torun.pl>
+ Branch: cfgperl
+ ! pod/perlguts.pod
+____________________________________________________________________________
+[ 4268] By: jhi on 1999/10/01 07:32:33
+ Log: There *is* a month called October.
+ Branch: cfgperl
+ ! t/op/time.t
+____________________________________________________________________________
+[ 4267] By: jhi on 1999/10/01 06:58:10
+ Log: Temp file cleanliness.
+ Branch: cfgperl
+ ! t/lib/filecopy.t
+____________________________________________________________________________
+[ 4266] By: jhi on 1999/10/01 06:46:56
+ Log: From: Barrie Slaymaker <barries@slaysys.com>
+ To: perl5-porters@perl.org
+ Subject: [PATCH 5.005_61] Benchmark.pm: Export countit(), cmpthese() by default
+ Date: Thu, 30 Sep 1999 22:16:26 -0400
+ Message-Id: <199910010216.WAA08309@jester.slaysys.com>
+ Branch: cfgperl
+ ! lib/Benchmark.pm
+____________________________________________________________________________
+[ 4265] By: jhi on 1999/09/30 20:25:35
+ Log: From: Barrie Slaymaker <barries@slaysys.com>
+ To: perl5-porters@perl.org
+ Subject: [PATCH 5.005_61] Benchmark tweaks, fixes, cmpthese()
+ Date: Thu, 30 Sep 1999 15:44:00 -0400
+ Message-Id: <199909301944.PAA07166@jester.slaysys.com>
+ (Replaces #4175.)
+ Branch: cfgperl
+ ! lib/Benchmark.pm
+____________________________________________________________________________
+[ 4264] By: gsar on 1999/09/30 17:59:26
+ Log: re-add missing "Out of memory!" entry
+ Branch: perl
+ ! pod/perldiag.pod
+____________________________________________________________________________
+[ 4263] By: jhi on 1999/09/30 17:05:43
+ Log: Regenerate Configure.
+ Branch: cfgperl
+ ! Configure Porting/Glossary Porting/config.sh Porting/config_H
+ ! config_h.SH
+____________________________________________________________________________
+[ 4261] By: jhi on 1999/09/30 16:15:05
+ Log: From: Andy Dougherty <doughera@lafayette.edu>
+ To: Perl Porters <perl5-porters@perl.org>
+ Subject: [PATCH 5.005_61] rand() advisory for perldelta.pod
+ Date: Thu, 30 Sep 1999 12:24:00 -0400 (EDT)
+ Message-ID: <Pine.SOL.4.10.9909301218390.3343-100000@maxwell.phys.lafayette.edu>
+ Branch: cfgperl
+ ! pod/perldelta.pod
+____________________________________________________________________________
+[ 4260] By: jhi on 1999/09/30 15:48:56
+ Log: From: Andy Dougherty <doughera@lafayette.edu>
+ To: Jarkko Hietaniemi <jhi@iki.fi>, Gurusamy Sarathy <gsar@activestate.com>
+ Subject: Re: Possible skeletal structure for searching multiple versions
+ Date: Thu, 30 Sep 1999 11:52:00 -0400 (EDT)
+ Message-ID: <Pine.SOL.4.10.9909301149090.3343-100000@maxwell.phys.lafayette.edu>
+ Branch: metaconfig
+ ! U/mkglossary
+ Branch: metaconfig/U/perl
+ + xs_apiversion.U
+ ! patchlevel.U
+____________________________________________________________________________
+[ 4259] By: jhi on 1999/09/30 15:07:16
+ Log: Further ?idsize.U fixing.
+ Branch: metaconfig
+ ! U/typedefs/gidsize.U U/typedefs/pidsize.U U/typedefs/uidsize.U
+____________________________________________________________________________
+[ 4258] By: jhi on 1999/09/30 15:00:14
+ Log: Fix the ?idsi{gn,ze} units, from Andy Dougherty.
+ Branch: metaconfig
+ ! U/typedefs/gidsign.U U/typedefs/gidsize.U U/typedefs/pidsign.U
+ ! U/typedefs/pidsize.U U/typedefs/uidsign.U U/typedefs/uidsize.U
+____________________________________________________________________________
+[ 4257] By: jhi on 1999/09/30 09:48:33
+ Log: From: "Kurt D. Starsinic" <kstar@chapin.edu>
+ To: Gurusamy Sarathy <gsar@ActiveState.com>
+ Cc: tchrist@perl.com, Larry Wall <larry@wall.org>,
+ The Perl Porters Mailing List <perl5-porters@perl.org>
+ Subject: [PATCH] (Was: deprecating SIGDIE)
+ Date: Wed, 29 Sep 1999 15:16:50 -0400
+ Message-ID: <19990929151650.E26675@O2.chapin.edu>
+ Branch: cfgperl
+ ! Porting/findvars embedvar.h intrpvar.h mg.c objXSUB.h perl.c
+____________________________________________________________________________
+[ 4256] By: jhi on 1999/09/30 09:45:22
+ Log: From: Ilya Zakharevich <ilya@math.ohio-state.edu>
+ To: Gurusamy Sarathy <gsar@activestate.com>
+ Cc: Barrie Slaymaker <barries@slaysys.com>, perl5-porters@perl.org
+ Subject: Re: _58, _61 Argument "" is not numeric in sprintf
+ Date: Wed, 29 Sep 1999 18:58:23 -0400
+ Message-ID: <19990929185823.A22099@monk.mps.ohio-state.edu>
+ Branch: cfgperl
+ ! Makefile.SH opcode.pl
+____________________________________________________________________________
+[ 4255] By: gsar on 1999/09/30 09:03:48
+ Log: remove prehistoric XFree() gunk
+ Branch: perl
+ ! lib/ExtUtils/typemap lib/ExtUtils/xsubpp
+____________________________________________________________________________
+[ 4254] By: gsar on 1999/09/30 08:40:14
+ Log: From: Vishal Bhatia <vishal@gol.com>
+ Date: Wed, 29 Sep 1999 23:27:28 +0900 (JST)
+ Message-ID: <Pine.LNX.4.10.9909292326280.5599-100000@localhost.localdomain>
+ Subject: [patch _61] Minor corrections in C.pm
+ Branch: perl
+ ! ext/B/B/C.pm
+____________________________________________________________________________
+[ 4253] By: gsar on 1999/09/30 08:36:27
+ Log: off-by-one in fbm_compile() (spotted by John Bley
+ <jbley@cs.cmu.edu>); whitespace adjustments
+ Branch: perl
+ ! util.c
+____________________________________________________________________________
+[ 4251] By: jhi on 1999/09/30 08:09:13
+ Log: From: Ilya Zakharevich <ilya@math.ohio-state.edu>
+ To: perl5-porters@perl.org (Mailing list Perl5)
+ Subject: [PATCH 5.00561+] Followup h2xs patch
+ Date: Thu, 30 Sep 1999 04:15:52 -0400 (EDT)
+ Message-Id: <199909300815.EAA25425@monk.mps.ohio-state.edu>
+ Branch: cfgperl
+ ! utils/h2xs.PL
+____________________________________________________________________________
+[ 4250] By: jhi on 1999/09/29 19:11:32
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ !> djgpp/configure.bat embed.h embed.pl lib/Exporter/Heavy.pm
+ !> lib/ExtUtils/MM_Unix.pm lib/Time/Local.pm proto.h
+ !> t/pragma/locale/latin1 win32/Makefile win32/makefile.mk
+____________________________________________________________________________
+[ 4249] By: bailey on 1999/09/29 02:21:31
+ Log: resync with mainline
+ Branch: vmsperl
+ +> (branch 32 files)
+ - ext/B/defsubs.h.PL lib/unicode/arabshp.txt
+ - lib/unicode/blocks.txt lib/unicode/index2.txt
+ - lib/unicode/jamo2.txt lib/unicode/names2.txt
+ - lib/unicode/props2.txt lib/unicode/readme.txt
+ - t/lib/bigfloatpm.t
+ !> (integrate 240 files)
+____________________________________________________________________________
+[ 4248] By: jhi on 1999/09/28 18:14:39
+ Log: From: Andy Dougherty <doughera@lafayette.edu>
+ To: Perl Porters <perl5-porters@perl.org>
+ Subject: [PATCH 5.005_xx] Re: [Config 5.005_03] -DDEBUGGING
+ Date: Tue, 28 Sep 1999 12:20:50 -0400 (EDT)
+ Message-ID: <Pine.SOL.4.10.9909281019360.1890-100000@maxwell.phys.lafayette.edu>
+
+ From: Andy Dougherty <doughera@lafayette.edu>
+ To: Perl Porters <perl5-porters@perl.org>
+ Subject: [ANOTHER PATCH 5.005_61] Re: [Config 5.005_03] -DDEBUGGING
+ Date: Tue, 28 Sep 1999 13:39:49 -0400 (EDT)
+ Message-ID: <Pine.SOL.4.10.9909281338180.2012-100000@maxwell.phys.lafayette.edu>
+ Branch: cfgperl
+ ! hints/README.hints hints/amigaos.sh hints/cygwin.sh
+ ! hints/dynixptx.sh hints/epix.sh hints/esix4.sh hints/mint.sh
+ ! hints/mpeix.sh hints/next_3.sh hints/next_3_0.sh
+ ! hints/next_4.sh
+____________________________________________________________________________
+[ 4247] By: gsar on 1999/09/28 17:36:59
+ Log: revert change#4115 (breaks libwww's base/date.t); could be
+ reworked to enable it conditional on $Time::Local::nocroak
+ or some such
+ Branch: perl
+ ! lib/Time/Local.pm
+____________________________________________________________________________
+[ 4246] By: gsar on 1999/09/28 17:33:14
+ Log: tweak for win32 build
+ Branch: perl
+ ! win32/Makefile win32/makefile.mk
+____________________________________________________________________________
+[ 4245] By: gsar on 1999/09/28 17:31:34
+ Log: change#4236 fallout
+ Branch: perl
+ ! lib/ExtUtils/MM_Unix.pm
+____________________________________________________________________________
+[ 4244] By: gsar on 1999/09/28 17:29:31
+ Log: remove doubled new_xpv
+ Branch: perl
+ ! embed.h embed.pl proto.h
+____________________________________________________________________________
+[ 4243] By: jhi on 1999/09/27 19:13:20
+ Log: Artistic fine-tuning.
+ Branch: cfgperl
+ ! ext/B/defsubs_h.PL
+____________________________________________________________________________
+[ 4242] By: gsar on 1999/09/27 17:05:22
+ Log: avoid implicit split to @_ in change#4181; binary -> text file
+ types in p4
+ Branch: perl
+ ! djgpp/configure.bat lib/Exporter/Heavy.pm
+ ! t/pragma/locale/latin1
+____________________________________________________________________________
+[ 4241] By: jhi on 1999/09/27 07:48:19
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ !> INSTALL embed.h embed.pl malloc.c pod/perldiag.pod pp.c
+ !> pp_ctl.c pp_hot.c pp_sys.c win32/Makefile win32/makefile.mk
+____________________________________________________________________________
+[ 4240] By: jhi on 1999/09/27 07:47:11
+ Log: Finalize change #4232.
+ From: Ilya Zakharevich <ilya@math.ohio-state.edu>
+ To: Jarkko Hietaniemi <jhi@iki.fi>
+ Cc: gsar@activestate.com, Mailing list Perl5 <perl5-porters@perl.org>
+ Subject: Re: xsubpp change breaks B, DB_File, POSIX builds
+ Date: Sun, 26 Sep 1999 16:52:31 -0400
+ Message-ID: <19990926165230.A26933@monk.mps.ohio-state.edu>
+ Branch: cfgperl
+ ! lib/ExtUtils/xsubpp
+____________________________________________________________________________
+[ 4239] By: gsar on 1999/09/27 02:48:42
+ Log: add notes in INSTALL about Configure -Accflags=-DFOO
+ Branch: perl
+ ! INSTALL
+____________________________________________________________________________
+[ 4238] By: gsar on 1999/09/27 02:03:48
+ Log: PERL_POLLUTE isn't required for bincompat, so don't enable
+ it automatically
+ Branch: perl
+ ! embed.h embed.pl
+____________________________________________________________________________
+[ 4237] By: gsar on 1999/09/27 01:52:47
+ Log: From: Ilya Zakharevich <ilya@math.ohio-state.edu>
+ Date: Fri, 24 Sep 1999 23:25:36 -0400
+ Message-ID: <19990924232536.A16257@monk.mps.ohio-state.edu>
+ Subject: [PATCH 5.005_61] Malloc fixes and docs
+ Branch: perl
+ ! malloc.c pod/perldiag.pod
+____________________________________________________________________________
+[ 4236] By: gsar on 1999/09/27 01:31:32
+ Log: avoid .exe in $Config{cc} (spotted by Vadim Konovalov
+ <vkonovalov@lucent.com>)
+ Branch: perl
+ ! win32/Makefile win32/makefile.mk
+____________________________________________________________________________
+[ 4235] By: gsar on 1999/09/26 17:02:03
+ Log: fix buggy popping of subroutine contexts in the lvalue
+ subroutines implementation (change#4081); correct the
+ plethora of cases where DIE() was more appropriate than
+ croak()
+ Branch: perl
+ ! pp.c pp_ctl.c pp_hot.c pp_sys.c
+____________________________________________________________________________
+[ 4234] By: jhi on 1999/09/26 12:06:28
+ Log: Fix #endif.
+ Branch: cfgperl
+ ! XSUB.h
+____________________________________________________________________________
+[ 4233] By: jhi on 1999/09/26 11:59:18
+ Log: Integrate with Sarathy. h2xs.PL had to be manually resolved,
+ I kept my (Ilya's) version.
+ Branch: cfgperl
+ !> gv.c gv.h intrpvar.h keywords.h keywords.pl lib/Shell.pm op.c
+ !> pod/perldiag.pod pod/perlembed.pod pod/perlfaq3.pod
+ !> pod/perlfaq7.pod pod/perlfunc.pod pod/perlmod.pod
+ !> pod/perlmodlib.pod pod/perlsub.pod pod/perltoot.pod
+ !> pod/perlxstut.pod sv.h t/pragma/strict-vars toke.c
+ !> utils/h2xs.PL win32/Makefile win32/makefile.mk
+____________________________________________________________________________
+[ 4232] By: jhi on 1999/09/26 09:53:43
+ Log: From: Ilya Zakharevich <ilya@math.ohio-state.edu>
+ To: Mailing list Perl5 <perl5-porters@perl.org>
+ Subject: [PATCH 5.005_61] teach xsubpp function pointers
+ Date: Sun, 26 Sep 1999 01:36:09 -0400
+ Message-ID: <19990926013609.A21148@monk.mps.ohio-state.edu>
+
+ From: Ilya Zakharevich <ilya@math.ohio-state.edu>
+ To: Mailing list Perl5 <perl5-porters@perl.org>
+ Subject: [PATCH 5.005_61] Make h2xs -x almost bullet-proof
+ Date: Sun, 26 Sep 1999 03:00:50 -0400
+ Message-ID: <19990926030050.A21498@monk.mps.ohio-state.edu>
+ Branch: cfgperl
+ ! lib/ExtUtils/xsubpp utils/h2xs.PL
+____________________________________________________________________________
+[ 4231] By: jhi on 1999/09/26 09:48:49
+ Log: From: "Konovalov, Vadim" <vkonovalov@lucent.com>
+ To: perl5-porters@perl.org
+ Subject: misprint in perlguts
+ Date: Sun, 26 Sep 1999 12:48:36 +0400
+ Message-ID: <402099F49BEED211999700805FC7359F20D7A5@ru0028exch01.spb.lucent.com>
+ Branch: cfgperl
+ ! pod/perlguts.pod
+____________________________________________________________________________
+[ 4230] By: gsar on 1999/09/26 00:50:08
+ Log: add $installarchlib/CORE to default linker search path on windows
+ Branch: perl
+ ! win32/Makefile win32/makefile.mk
+____________________________________________________________________________
+[ 4229] By: gsar on 1999/09/25 20:05:03
+ Log: support C<use Shell> on Windows (reworked a patch suggested
+ by Jenda Krynicky <Jenda@McCann.cz>)
+ Branch: perl
+ ! lib/Shell.pm
+____________________________________________________________________________
+[ 4228] By: gsar on 1999/09/25 07:03:34
+ Log: integrate cfgperl contents into mainline
+ Branch: perl
+ +> hints/svr5.sh
+ !> Configure MANIFEST Makefile.SH config_h.SH hints/sco.sh
+ !> lib/unicode/Eq/Latin1 lib/unicode/Eq/Unicode
+ !> lib/unicode/mktables.PL pod/perldelta.pod pod/perlfaq9.pod
+ !> regcomp.c regexec.c t/lib/syslfs.t t/op/lfs.t
+____________________________________________________________________________
+[ 4227] By: gsar on 1999/09/25 06:44:47
+ Log: From: Larry Wall <larry@wall.org>
+ Date: Fri, 24 Sep 1999 21:59:37 PDT
+ Message-Id: <199909250459.VAA27506@kiev.wall.org>
+ Subject: Re: [PATCH 5.005_61] "our" declarations
+ Branch: perl
+ ! gv.c gv.h intrpvar.h keywords.h keywords.pl op.c
+ ! pod/perldiag.pod pod/perlembed.pod pod/perlfaq3.pod
+ ! pod/perlfaq7.pod pod/perlfunc.pod pod/perlmod.pod
+ ! pod/perlmodlib.pod pod/perlsub.pod pod/perltoot.pod
+ ! pod/perlxstut.pod sv.h t/pragma/strict-vars toke.c
+ ! utils/h2xs.PL
+____________________________________________________________________________
+[ 4226] By: jhi on 1999/09/24 23:10:52
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ !> XSUB.h ext/POSIX/POSIX.pod ext/POSIX/POSIX.xs
+ !> ext/POSIX/hints/linux.pl pod/perldiag.pod pod/perlfunc.pod
+ !> pp.c t/lib/posix.t t/op/pack.t toke.c utils/perlcc.PL
+____________________________________________________________________________
+[ 4225] By: gsar on 1999/09/24 18:19:54
+ Log: avoid infinite recursive exec()s of perl.exe when shebang
+ contains "Perl" rather than "perl" on DOSISH platforms
+ Branch: perl
+ ! toke.c
+____________________________________________________________________________
+[ 4224] By: gsar on 1999/09/24 16:09:23
+ Log: support cygwin and other platforms that link to import libraries
+ rather than directly with shared libraries (from a suggestion
+ by Lucian Cionca <Lucian.Cionca@algoritma.ro>)
+ Branch: perl
+ ! utils/perlcc.PL
+____________________________________________________________________________
+[ 4223] By: gsar on 1999/09/24 05:05:06
+ Log: normalize time for strftime() (without the isdst effects of
+ mktime()) using a custom mini_mktime()
+ From: spider-perl@Orb.Nashua.NH.US
+ Date: Thu, 23 Sep 1999 17:54:53 -0400
+ Message-Id: <199909232154.RAA25151@leggy.zk3.dec.com>
+ Subject: Re: [ID 19990913.003] Possible bug using POSIX::strftime Digital UNIX Perl 5.005_03
+ Branch: perl
+ ! ext/POSIX/POSIX.pod ext/POSIX/POSIX.xs
+ ! ext/POSIX/hints/linux.pl t/lib/posix.t
+____________________________________________________________________________
+[ 4222] By: gsar on 1999/09/23 06:44:42
+ Log: change "#" to a comment starter in pack templates; "/" now
+ used for specifying counted types
+ From: Ilya Zakharevich <ilya@math.ohio-state.edu>
+ Date: Wed, 22 Sep 1999 19:41:30 -0400
+ Message-ID: <19990922194130.A864@monk.mps.ohio-state.edu>
+ Subject: [PATCH 5.005_61] Enable comments in pack()/unpack() templates
+ Branch: perl
+ ! pod/perldiag.pod pod/perlfunc.pod pp.c t/op/pack.t
+____________________________________________________________________________
+[ 4221] By: gsar on 1999/09/23 06:26:54
+ Log: From: Vishal Bhatia <vishal@gol.com>
+ Date: Thu, 23 Sep 1999 12:45:19 +0900 (JST)
+ Message-ID: <Pine.LNX.4.10.9909231218360.3428-100000@localhost.localdomain>
+ Subject: [patch _61] perlcc changes
+ Branch: perl
+ ! utils/perlcc.PL
+____________________________________________________________________________
+[ 4220] By: gsar on 1999/09/23 01:12:24
+ Log: add include guard
+ Branch: perl
+ ! XSUB.h
+____________________________________________________________________________
+[ 4219] By: jhi on 1999/09/22 20:38:15
+ Log: Cleanup cleanup.
+ Branch: cfgperl
+ ! Makefile.SH t/lib/syslfs.t t/op/lfs.t
+____________________________________________________________________________
+[ 4218] By: jhi on 1999/09/22 19:26:58
+ Log: Tweak the equivalence tables once again.
+ Branch: cfgperl
+ ! lib/unicode/Eq/Latin1 lib/unicode/Eq/Unicode
+ ! lib/unicode/mktables.PL
+____________________________________________________________________________
+[ 4215] By: jhi on 1999/09/22 06:47:03
+ Log: From: Ilya Zakharevich <ilya@math.ohio-state.edu>
+ To: Mailing list Perl5 <perl5-porters@perl.org>
+ Subject: [PATCH 5.005_61] regfree could segfault with -Mre=debug
+ Date: Tue, 21 Sep 1999 19:50:00 -0400
+ Message-ID: <19990921195000.A23938@monk.mps.ohio-state.edu>
+
+ From: Ilya Zakharevich <ilya@math.ohio-state.edu>
+ To: Mailing list Perl5 <perl5-porters@perl.org>
+ Subject: [PATCH 5.005_61] More verbose -Mre=debug
+ Date: Tue, 21 Sep 1999 22:29:55 -0400
+ Message-ID: <19990921222955.A25094@monk.mps.ohio-state.edu>
+ Branch: cfgperl
+ ! regcomp.c regexec.c
+____________________________________________________________________________
+[ 4214] By: jhi on 1999/09/21 21:08:43
+ Log: From: 0000-Admin (0000) <root@devsys0.zenez.com>
+ Reply-To: gerberb@zenez.com
+ To: perl5-porters@perl.org
+ Subject: [ID 19990921.004] Changes for SCO OpenServer and UnixWare 7
+ Date: Tue, 21 Sep 1999 11:07:46 -0600 (MDT)
+ Message-Id: <199909211707.LAA23611@devsys0.zenez.com>
+
+ (Snipped away the last lines of svr5.sh a la change #3725)
+ Branch: cfgperl
+ + hints/svr5.sh
+ ! Configure MANIFEST config_h.SH hints/sco.sh
+ Branch: metaconfig
+ ! U/modified/Cppsym.U U/modified/Oldconfig.U
+____________________________________________________________________________
+[ 4213] By: jhi on 1999/09/21 20:48:01
+ Log: From: Kragen Sitaker <kragen@dnaco.net>
+ To: perl5-porters@perl.org
+ Subject: [ID 19990921.013] accidental list context in perlfaq9
+ Date: Tue, 21 Sep 1999 16:27:53 -0400 (EDT)
+ Reply-To: kragen@pobox.com
+ Message-Id: <199909212027.QAA03450@kirk.dnaco.net>
+ Branch: cfgperl
+ ! pod/perlfaq9.pod
+____________________________________________________________________________
+[ 4212] By: jhi on 1999/09/20 19:55:42
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ +> README.Y2K
+ !> Changes MANIFEST
+____________________________________________________________________________
+[ 4211] By: jhi on 1999/09/20 19:44:44
+ Log: Rename -Duselfs to -Duselargefiles. We don't need no stnkngbbrvtns.
+ Branch: cfgperl
+ ! Configure config_h.SH pod/perldelta.pod
+ Branch: metaconfig/U/perl
+ ! use64bits.U uselfs.U uselongdbl.U
+____________________________________________________________________________
+[ 4210] By: jhi on 1999/09/20 19:38:26
+ Log: Configure -A change: -Afoo=bar is equal to -Aappend:foo=" bar".
+ Branch: cfgperl
+ ! Configure config_h.SH
+ Branch: metaconfig
+ ! U/modified/Options.U
+____________________________________________________________________________
+[ 4209] By: gsar on 1999/09/20 19:35:39
+ Log: integrate cfgperl changes into mainline
+ Branch: perl
+ +> lib/unicode/Unicode.html
+ ! Changes
+ !> Configure Porting/Glossary Porting/config.sh Porting/config_H
+ !> config_h.SH doio.c perl.h pod/perldelta.pod pod/perlfunc.pod
+____________________________________________________________________________
[ 4208] By: gsar on 1999/09/20 18:28:44
Log: add README.Y2K (from Dominic Dunlop <domo@vo.lu>)
Branch: perl
+ t/lib/gol-basic.t t/lib/gol-compat.t t/lib/gol-linkage.t
! Changes MANIFEST lib/Getopt/Long.pm
____________________________________________________________________________
-[ 4117] By: jhi on 1999/09/09 18:24:30
- Log: Remove ill-designed %B introduced by change #4111.
- Branch: cfgperl
- ! sv.c t/op/sprintf.t
-____________________________________________________________________________
[ 4116] By: jhi on 1999/09/09 15:56:52
Log: perldeltify change #4115.
Branch: cfgperl
Branch: cfgperl
! regexec.c t/op/pat.t
____________________________________________________________________________
-[ 4111] By: jhi on 1999/09/09 07:50:07
- Log: %#b in particular and %B in general were kaputt.
- Branch: cfgperl
- ! sv.c t/op/sprintf.t
-____________________________________________________________________________
[ 4110] By: jhi on 1999/09/09 07:29:17
Log: Tidy up 64-bit situation in perldelta.
Branch: cfgperl
Branch: cfgperl
! toke.c
____________________________________________________________________________
-[ 4058] By: jhi on 1999/08/31 08:57:35
- Log: For some odd reason #4056 didn't undo #3922 completely.
- Branch: cfgperl
- ! pp.c
-____________________________________________________________________________
[ 4057] By: gsar on 1999/08/30 22:08:19
Log: avoid hiding child process window
Branch: perl
! win32/win32.c
____________________________________________________________________________
-[ 4056] By: jhi on 1999/08/30 21:36:24
- Log: Retract #3922 (Rule #1 was invoked).
- (See also #4058).
- Branch: cfgperl
- ! pod/perldiag.pod pp.c regexp.h
-____________________________________________________________________________
[ 4055] By: jhi on 1999/08/30 21:20:50
Log: Document the undefinedness of overshifting.
Branch: cfgperl
Branch: metaconfig/U/perl
! d_dlsymun.U io64.U uselongdbl.U
____________________________________________________________________________
-[ 3981] By: jhi on 1999/08/13 15:11:51
- Log: Retract change #3977 (do_open9() adds O_LARGEFILE automagically).
- Branch: cfgperl
- ! t/lib/syslfs.t
-____________________________________________________________________________
[ 3980] By: jhi on 1999/08/13 15:09:11
Log: Introduce HAS_LLSEEK.
Branch: cfgperl
Branch: cfgperl
! t/op/64bit.t
____________________________________________________________________________
-[ 3977] By: jhi on 1999/08/13 09:56:25
- Log: Use O_LARGEFILE if available.
- Branch: cfgperl
- ! t/lib/syslfs.t
-____________________________________________________________________________
[ 3976] By: jhi on 1999/08/12 21:49:16
Log: IRIX64 needs more -mabi=64 with gcc.
Branch: cfgperl
Branch: cfgperl
! pp.c
____________________________________________________________________________
-[ 3924] By: jhi on 1999/08/05 09:23:00
- Log: Warning fix to change #3922.
- From: paul.marquess@bt.com
- To: ilya@math.ohio-state.edu, gsar@activestate.com
- Cc: tchrist@jhereg.perl.com, chaimf@pobox.com, ed@chronos.net,
- perl5-porters@perl.org
- Subject: RE: [PATCH 5.00557] split /^/
- Date: Thu, 5 Aug 1999 09:01:15 +0100
- Message-ID: <5104D4DBC598D211B5FE0000F8FE7EB202D49B23@mbtlipnt02.btlabs.bt.co.uk>
- Branch: cfgperl
- ! pp.c
-____________________________________________________________________________
[ 3923] By: jhi on 1999/08/05 09:16:57
Log: From: paul.marquess@bt.com
To: jhi@iki.fi, paul.marquess@bt.com
Branch: cfgperl
! t/lib/anydbm.t
____________________________________________________________________________
-[ 3922] By: jhi on 1999/08/05 08:09:59
- Log: Deprecate /^/ implictly meaning /^/m.
-
- From: Ilya Zakharevich <ilya@math.ohio-state.edu>
- To: Gurusamy Sarathy <gsar@activestate.com>
- Cc: Tom Christiansen <tchrist@jhereg.perl.com>, chaimf@pobox.com,
- ed@chronos.net, perl5-porters@perl.org
- Subject: [PATCH 5.00557] split /^/
- Date: Wed, 4 Aug 1999 16:46:57 -0400
- Message-ID: <19990804164657.A3776@monk.mps.ohio-state.edu>
- Branch: cfgperl
- ! pod/perldiag.pod pp.c regexp.h
-____________________________________________________________________________
[ 3921] By: jhi on 1999/08/05 08:05:13
Log: From: paul.marquess@bt.com
To: perl5-porters@perl.org
Branch: cfgperl
! t/op/filetest.t
____________________________________________________________________________
-[ 3913] By: jhi on 1999/08/03 21:07:57
- Log: Retract #3912, much too many compilation warnings
- under Digital UNIX.
- Branch: cfgperl
- ! doio.c iperlsys.h perl.h perlio.c perlsdio.h perlsfio.h
- ! pp_sys.c sv.c
-____________________________________________________________________________
-[ 3912] By: jhi on 1999/08/03 20:13:59
- Log: (Retracted). See #3913.
-
- From: Sven Verdoolaege <skimo@kotnet.org>
- To: perl5-porters@perl.org
- Subject: [ID 19990803.003] Not OK: perl 5.00560 on i586-linux-thread
- 2.1.125 [PATCH]
- Date: Tue, 3 Aug 1999 13:14:07 +0200
- Message-Id: <19990803131407.A30911@pool.kotnet.org>
- Branch: cfgperl
- ! doio.c iperlsys.h perl.h perlio.c perlsdio.h perlsfio.h
- ! pp_sys.c sv.c
-____________________________________________________________________________
[ 3911] By: jhi on 1999/08/03 19:52:38
Log: The "-Dusethreads -Duseperlio" combination failed.
Branch: perl
! win32/win32.c
____________________________________________________________________________
-[ 3315] By: nick on 1999/05/06 21:44:38
- Log: open(FH,undef) # creates new_tmpfile opened read/write
- Add t/io/open.t with test for above.
- Branch: perl
- + t/io/open.t
- ! pp_sys.c
-____________________________________________________________________________
[ 3314] By: gsar on 1999/05/06 08:01:23
Log: compiler fixes from Vishal Bhatia <vishalb@hotmail.com>
Date: Tue, 30 Mar 1999 23:40:34 PST
# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Wed Sep 22 00:13:58 EET DST 1999 [metaconfig 3.0 PL70]
+# Generated on Tue Jan 18 21:42:31 EET 2000 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by perlbug@perl.com)
cat >/tmp/c1$$ <<EOF
cf_email=''
cf_by=''
cf_time=''
+charsize=''
contains=''
cpp_stuff=''
cpplast=''
d_flexfnam=''
d_flock=''
d_fork=''
+d_fs_data_s=''
d_fseeko=''
d_fsetpos=''
+d_fstatfs=''
d_ftello=''
d_ftime=''
d_gettimeod=''
d_uname=''
d_gethostprotos=''
d_getlogin=''
+d_getmnt=''
d_getmntent=''
d_getnbyaddr=''
d_getnbyname=''
d_hasmntopt=''
d_htonl=''
d_inetaton=''
+d_int64t=''
d_isascii=''
d_killpg=''
d_lchown=''
d_longlong=''
longlongsize=''
d_lstat=''
-d_madvise=''
d_mblen=''
d_mbstowcs=''
d_mbtowc=''
d_mkdir=''
d_mkfifo=''
d_mktime=''
-d_mmap=''
-mmaptype=''
-d_mprotect=''
d_msg=''
d_msgctl=''
d_msgget=''
d_msgrcv=''
d_msgsnd=''
-d_msync=''
-d_munmap=''
d_nice=''
d_open3=''
d_fpathconf=''
d_seekdir=''
d_telldir=''
d_readlink=''
-d_readv=''
d_rename=''
d_rmdir=''
d_safebcpy=''
d_shmget=''
d_sigaction=''
d_sigsetjmp=''
-d_cmsghdr_s=''
d_msg_ctrunc=''
d_msg_dontroute=''
d_msg_oob=''
d_msg_peek=''
d_msg_proxy=''
-d_msghdr_s=''
d_oldsock=''
-d_recvmsg=''
d_scm_rights=''
-d_sendmsg=''
d_socket=''
d_sockpair=''
sockethdr=''
socketlib=''
+d_sqrtl=''
d_statblks=''
-d_fstatfs=''
-d_statfs=''
-d_statfsflags=''
+d_statfs_f_flags=''
+d_statfs_s=''
d_fstatvfs=''
d_statvfs=''
d_stdio_cnt_lval=''
d_syserrlst=''
d_strtod=''
d_strtol=''
+d_strtold=''
+d_strtoll=''
d_strtoul=''
+d_strtoull=''
+d_strtouq=''
d_strxfrm=''
d_symlink=''
d_syscall=''
d_semctl_semid_ds=''
d_semctl_semun=''
d_union_semun=''
+d_ustat=''
d_vfork=''
usevfork=''
d_voidsig=''
d_waitpid=''
d_wcstombs=''
d_wctomb=''
-d_writev=''
dlext=''
cccdlflags=''
ccdlflags=''
ebcdic=''
fflushNULL=''
fflushall=''
+fpossize=''
fpostype=''
+gidformat=''
+gidsign=''
+gidsize=''
gidtype=''
groupstype=''
h_fcntl=''
i_gdbm=''
d_grpasswd=''
i_grp=''
-d_int64t=''
i_inttypes=''
i_limits=''
i_locale=''
i_sysfilio=''
i_sysioctl=''
i_syssockio=''
-i_sysmman=''
i_sysmount=''
i_sysndir=''
i_sysparam=''
i_syssecrt=''
i_sysselct=''
i_sysstat=''
+i_sysstatfs=''
i_sysstatvfs=''
i_systimes=''
i_systypes=''
-d_iovec_s=''
i_sysuio=''
i_sysun=''
+i_sysvfs=''
i_syswait=''
i_sgtty=''
i_termio=''
i_time=''
timeincl=''
i_unistd=''
+i_ustat=''
i_utime=''
i_values=''
i_stdarg=''
i_varargs=''
i_varhdr=''
i_vfork=''
+inc_version_list=''
installprefix=''
installprefixexp=''
installstyle=''
longsize=''
shortsize=''
d_fpos64_t=''
-d_llseek=''
d_off64_t=''
libc=''
ldlibpthname=''
package=''
spackage=''
pager=''
-apiversion=''
+api_revision=''
+api_subversion=''
+api_version=''
+api_versionstring=''
patchlevel=''
subversion=''
version=''
perladmin=''
perlpath=''
+i16size=''
+i16type=''
+i32size=''
+i32type=''
+i64size=''
+i64type=''
+i8size=''
+i8type=''
+ivsize=''
+ivtype=''
+nvsize=''
+nvtype=''
+u16size=''
+u16type=''
+u32size=''
+u32type=''
+u64size=''
+u64type=''
+u8size=''
+u8type=''
+uvsize=''
+uvtype=''
+ivdformat=''
+uvoformat=''
+uvuformat=''
+uvxformat=''
pidtype=''
prefix=''
prefixexp=''
sPRIo64=''
sPRIu64=''
sPRIx64=''
+d_quad=''
+quadkind=''
+quadtype=''
+uquadtype=''
drand01=''
randbits=''
randfunc=''
installsitearch=''
sitearch=''
sitearchexp=''
+installsitebin=''
+sitebin=''
+sitebinexp=''
installsitelib=''
sitelib=''
sitelibexp=''
stdchar=''
d_stdio_stream_array=''
stdio_stream_array=''
-d_strtoull=''
sysman=''
trnl=''
+uidformat=''
+uidsign=''
+uidsize=''
uidtype=''
archname64=''
use64bits=''
uselargefiles=''
uselongdouble=''
+uselonglong=''
usemorebits=''
usemultiplicity=''
nm_opt=''
useperlio=''
usesocks=''
d_oldpthreads=''
+use5005threads=''
+useithreads=''
usethreads=''
incpath=''
-mips=''
mips_type=''
usrinc=''
+d_vendorbin=''
+installvendorbin=''
+vendorbin=''
+vendorbinexp=''
d_vendorlib=''
installvendorlib=''
vendorlib=''
fi
i_whoami=''
-: Possible local include directories to search.
-: Set locincpth to "" in a hint file to defeat local include searches.
-locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
-locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
-:
-: no include file wanted by default
-inclwanted=''
-
: list of known cpp symbols, sorted alphabetically
al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
al="$al xenix z8000"
+: set useposix=false in your hint file to disable the POSIX extension.
+useposix=true
+: set useopcode=false in your hint file to disable the Opcode extension.
+useopcode=true
: Trailing extension. Override this in a hint file, if needed.
_exe=''
: Extra object files, if any, needed on this platform.
archobjs=''
+: Possible local include directories to search.
+: Set locincpth to "" in a hint file to defeat local include searches.
+locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
+locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
+:
+: no include file wanted by default
+inclwanted=''
+
groupstype=''
: change the next line if compiling for Xenix/286 on Xenix/386
xlibpth='/usr/lib/386 /lib/386'
libswanted=''
: some systems want to use only the non-versioned libso:s
ignore_versioned_solibs=''
-: full support for void wanted by default
-defvoidused=15
-
-: set useposix=false in your hint file to disable the POSIX extension.
-useposix=true
-: set useopcode=false in your hint file to disable the Opcode extension.
-useopcode=true
: set usemultiplicity on the Configure command line to enable multiplicity.
: set usesocks on the Configure command line to enable socks.
: set usethreads on the Configure command line to enable threads.
+: full support for void wanted by default
+defvoidused=15
+
: List of libraries we want.
: If anyone needs -lnet, put it in a hint file.
libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
more
nm
nroff
+perl
pg
test
uname
osvers="$2.$3"
fi
fi
- $test -f /sys/posix.dll &&
- $test -f /usr/bin/what &&
- set X `/usr/bin/what /sys/posix.dll` &&
- $test "$3" = UWIN &&
- osname=uwin &&
- osvers="$5"
+
+ $test -f /sys/posix.dll &&
+ $test -f /usr/bin/what &&
+ set X `/usr/bin/what /sys/posix.dll` &&
+ $test "$3" = UWIN &&
+ osname=uwin &&
+ osvers="$5"
+
if $test -f $uname; then
set X $myuname
shift
*) osvers=$tmp;;
esac
;;
+ bsd386) osname=bsd386
+ osvers=`$uname -r`
+ ;;
+ cygwin*) osname=cygwin
+ osvers="$3"
+ ;;
*dc.osx) osname=dcosx
osvers="$3"
;;
*) osname=newsos ;;
esac
;;
- bsd386) osname=bsd386
- osvers=`$uname -r`
+ next*) osname=next ;;
+ POSIX-BC | posix-bc ) osname=posix-bc
+ osvers="$3"
;;
- POSIX-BC | posix-bc ) osname=posix-bc
- osvers="$3"
- ;;
powerux | power_ux | powermax_os | powermaxos | \
powerunix | power_unix) osname=powerux
osvers="$3"
;;
- next*) osname=next ;;
+ qnx) osname=qnx
+ osvers="$4"
+ ;;
solaris) osname=solaris
case "$3" in
5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
uts) osname=uts
osvers="$3"
;;
- qnx) osname=qnx
- osvers="$4"
- ;;
$2) case "$osname" in
*isc*) ;;
*freebsd*) ;;
rp='Build a threading Perl?'
. ./myread
case "$ans" in
-y|Y) val="$define" ;;
+y|Y) val="$define" ;;
*) val="$undef" ;;
esac
set usethreads
-eval $setvar
+eval $setvar
+
+case "$usethreads" in
+$define)
+ $cat <<EOM
+
+As of 5.5.640, Perl has two different internal threading implementations,
+the 5.005 version (5005threads) and an interpreter-based version
+(ithreads) that has one interpreter per thread. Both are very
+experimental. This arrangement exists to help developers work out
+which one is better.
+EOM
+ : Default to ithreads unless overridden on command line or with
+ : old config.sh
+ dflt='y'
+ case "$use5005threads" in
+ $define|true|[yY]*) dflt='n';;
+ esac
+ case "$useithreads" in
+ $undef|false|[nN]*) dflt='n';;
+ esac
+ rp='Use interpreter-based ithreads?'
+ . ./myread
+ case "$ans" in
+ y|Y) val="$define" ;;
+ *) val="$undef" ;;
+ esac
+ set useithreads
+ eval $setvar
+ : Now set use5005threads to the opposite value.
+ case "$useithreads" in
+ $define) val="$undef" ;;
+ *) val="$define" ;;
+ esac
+ set use5005threads
+ eval $setvar
+ ;;
+*)
+ useithreads="$undef"
+ use5005threads="$undef"
+ ;;
+esac
case "$d_oldpthreads" in
'') : Configure tests would be welcome here. For now, assume undef.
Assuming POSIX threads, then.)
EOM
fi
- ;;
+ ;;
esac
cat <<EOM
Perl can be built so that multiple Perl interpreters can coexist
-within the same Perl executable. To do so, Configure must be run with
--Dusemultiplicity.
-
-Normally you do not need this and you should answer no.
+within the same Perl executable.
+EOM
+case "$useithreads" in
+$define)
+ cat <<EOM
+This multiple interpreter support is required for interpreter-based threads.
EOM
-case "$usemultiplicity" in
-$define|true|[yY]*) dflt='y';;
-*) dflt='n';;
-esac
-rp='Build Perl for multiplicity?'
-. ./myread
-case "$ans" in
-y|Y) val="$define" ;;
-*) val="$undef" ;;
+ val="$define"
+ ;;
+*)
+ echo 'Normally you do not need this and you should answer no.'
+ case "$usemultiplicity" in
+ $define|true|[yY]*) dflt='y';;
+ *) dflt='n';;
+ esac
+ rp='Build Perl for multiplicity?'
+ . ./myread
+ case "$ans" in
+ y|Y) val="$define" ;;
+ *) val="$undef" ;;
+ esac
+ ;;
esac
set usemultiplicity
-eval $setvar
+eval $setvar
: determine where manual pages are on this system
echo " "
gccversion=`./gccvers`
case "$gccversion" in
'') echo "You are not using GNU cc." ;;
- *) echo "You are using GNU cc $gccversion." ;;
+ *) echo "You are using GNU cc $gccversion."
+ echo "Adding -D_GNU_SOURCE to ccflags."
+ ccflags="$ccflags -D_GNU_SOURCE" # expose glibc interfaces
+ ;;
esac
else
echo " "
1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
esac
-
-case "$usemorebits" in
-"$define"|true|[yY]*)
- use64bits="$define"
- uselongdouble="$define"
- usemorebits="$define"
- ;;
-*) usemorebits="$undef"
- ;;
-esac
-
-
-cat <<EOM
-
-Perl can be built to understand large files (files larger than 2 gigabytes)
-on some systems. To do so, Configure must be run with -Duselargefiles.
-
-If this doesn't make any sense to you, just accept the default.
-EOM
-case "$uselargefiles" in
-"$define"|true|[yY]*) dflt='y' ;;
-*) dflt='n' ;;
-esac
-rp='Try to understand large files?'
-. ./myread
-case "$ans" in
-y|Y) val="$define" ;;
-*) val="$undef" ;;
-esac
-set uselargefiles
-eval $setvar
-case "$uselargefiles" in
-"$define") use64bits="$define" ;;
-esac
-
-cat <<EOM
-
-Perl can be built to take advantage of explicit 64-bit interfaces,
-on some systems. To do so, Configure must be run with -Duse64bits.
-
-If this doesn't make any sense to you, just accept the default.
-EOM
-case "$use64bits" in
-$define|true|[yY]*) dflt='y';;
-*) dflt='n';;
-esac
-rp='Try to use explicit 64-bit interfaces, if available?'
-. ./myread
-case "$ans" in
-y|Y)
- val="$define"
- ;;
-*)
- val="$undef"
- ;;
-esac
-set use64bits
-eval $setvar
-
-case "$archname64" in
-'') archname64='' ;; # not a typo
-esac
-
-case "$use64bits" in
-"$define"|true|[yY]*)
-: Look for a hint-file generated 'call-back-unit'. If the
-: user has specified that a 64 bit perl is to be built,
-: we may need to set or change some other defaults.
- if $test -f use64bits.cbu; then
- echo "Your platform has some specific hints for 64-bit builds, using them..."
- . ./use64bits.cbu
- else
- $cat <<EOM
-(Your platform doesn't have any specific hints for 64-bit builds.
- This is probably okay, especially if your system is a true 64-bit system.)
-EOM
- case "$gccversion" in
- '') ;;
- *) $cat <<EOM
-But since you seem to be using gcc,
-I will now add -DUSE_LONG_LONG to the compilation flags.
-EOM
- ccflags="$ccflags -DUSE_LONG_LONG"
- ;;
- esac
- fi
- ;;
-esac
-
-: determine the architecture name
-echo " "
-if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
- tarch=`arch`"-$osname"
-elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
- if uname -m > tmparch 2>&1 ; then
- tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
- -e 's/$/'"-$osname/" tmparch`
- else
- tarch="$osname"
- fi
- $rm -f tmparch
-else
- tarch="$osname"
-fi
-case "$myarchname" in
-''|"$tarch") ;;
-*)
- echo "(Your architecture name used to be $myarchname.)"
- archname=''
- ;;
-esac
-myarchname="$tarch"
-case "$archname" in
-'') dflt="$tarch";;
-*) dflt="$archname";;
-esac
-rp='What is your architecture name'
-. ./myread
-archname="$ans"
-case "$usethreads" in
-$define)
- echo "Threads selected." >&4
- case "$archname" in
- *-thread*) echo "...and architecture name already has -thread." >&4
- ;;
- *) archname="$archname-thread"
- echo "...setting architecture name to $archname." >&4
- ;;
- esac
- ;;
-esac
-case "$usemultiplicity" in
-$define)
- echo "Multiplicity selected." >&4
- case "$archname" in
- *-multi*) echo "...and architecture name already has -multi." >&4
- ;;
- *) archname="$archname-multi"
- echo "...setting architecture name to $archname." >&4
- ;;
- esac
- ;;
-esac
-case "$use64bits" in
-$define)
- echo "Explicit 64-bitness selected." >&4
- case "$archname64" in
- '')
- ;;
- *)
- case "$archname" in
- *-$archname64*) echo "...and architecture name already has $archname64." >&4
- ;;
- *) archname="$archname-$archname64"
- echo "...setting architecture name to $archname." >&4
- ;;
- esac
- ;;
- esac
-esac
-
: decide how portable to be. Allow command line overrides.
case "$d_portable" in
"$undef") ;;
test "X$gfpthkeep" != Xy && gfpth=""
EOSC
-: determine root of directory hierarchy where package will be installed.
-case "$prefix" in
-'')
- dflt=`./loc . /usr/local /usr/local /local /opt /usr`
- ;;
-*)
- dflt="$prefix"
- ;;
-esac
-$cat <<EOM
-
-By default, $package will be installed in $dflt/bin, manual pages
-under $dflt/man, etc..., i.e. with $dflt as prefix for all
-installation directories. Typically this is something like /usr/local.
-If you wish to have binaries under /usr/bin but other parts of the
-installation under /usr/local, that's ok: you will be prompted
-separately for each of the installation directories, the prefix being
-only used to set the defaults.
-
-EOM
-fn=d~
-rp='Installation prefix to use?'
-. ./getfile
-oldprefix=''
-case "$prefix" in
+: What should the include directory be ?
+echo " "
+$echo $n "Hmm... $c"
+dflt='/usr/include'
+incpath=''
+mips_type=''
+if $test -f /bin/mips && /bin/mips; then
+ echo "Looks like a MIPS system..."
+ $cat >usr.c <<'EOCP'
+#ifdef SYSTYPE_BSD43
+/bsd43
+#endif
+EOCP
+ if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
+ dflt='/bsd43/usr/include'
+ incpath='/bsd43'
+ mips_type='BSD 4.3'
+ else
+ mips_type='System V'
+ fi
+ $rm -f usr.c usr.out
+ echo "and you're compiling with the $mips_type compiler and libraries."
+ xxx_prompt=y
+ echo "exit 0" >mips
+else
+ echo "Doesn't look like a MIPS system."
+ xxx_prompt=n
+ echo "exit 1" >mips
+fi
+chmod +x mips
+$eunicefix mips
+case "$usrinc" in
'') ;;
-*)
- case "$ans" in
- "$prefix") ;;
- *) oldprefix="$prefix";;
- esac
+*) dflt="$usrinc";;
+esac
+case "$xxx_prompt" in
+y) fn=d/
+ echo " "
+ rp='Where are the include files you want to use?'
+ . ./getfile
+ usrinc="$ans"
+ ;;
+*) usrinc="$dflt"
;;
esac
-prefix="$ans"
-prefixexp="$ansexp"
-: is AFS running?
+: see how we invoke the C preprocessor
echo " "
-case "$afs" in
-$define|true) afs=true ;;
-$undef|false) afs=false ;;
-*) if test -d /afs; then
- afs=true
+echo "Now, how can we feed standard input to your C preprocessor..." >&4
+cat <<'EOT' >testcpp.c
+#define ABC abc
+#define XYZ xyz
+ABC.XYZ
+EOT
+cd ..
+if test ! -f cppstdin; then
+ if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
+ # AIX cc -E doesn't show the absolute headerfile
+ # locations but we'll cheat by using the -M flag.
+ echo 'cat >.$$.c; rm -f .$$.u; '"$cc"' ${1+"$@"} -M -c .$$.c 2>/dev/null; test -s .$$.u && awk '"'"'$2 ~ /\.h$/ { print "# 0 \""$2"\"" }'"'"' .$$.u; rm -f .$$.o .$$.u; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' > cppstdin
else
- afs=false
+ echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
fi
- ;;
-esac
-if $afs; then
- echo "AFS may be running... I'll be extra cautious then..." >&4
else
- echo "AFS does not seem to be running..." >&4
+ echo "Keeping your $hint cppstdin wrapper."
fi
+chmod 755 cppstdin
+wrapper=`pwd`/cppstdin
+ok='false'
+cd UU
-: determine installation prefix for where package is to be installed.
-if $afs; then
-$cat <<EOM
-
-Since you are running AFS, I need to distinguish the directory in which
-files will reside from the directory in which they are installed (and from
-which they are presumably copied to the former directory by occult means).
-
-EOM
- case "$installprefix" in
- '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
- *) dflt="$installprefix";;
+if $test "X$cppstdin" != "X" && \
+ $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
+ $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
+then
+ echo "You used to use $cppstdin $cppminus so we'll use that again."
+ case "$cpprun" in
+ '') echo "But let's see if we can live without a wrapper..." ;;
+ *)
+ if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
+ $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
+ then
+ echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
+ ok='true'
+ else
+ echo "(However, $cpprun $cpplast does not work, let's see...)"
+ fi
+ ;;
esac
else
-$cat <<EOM
-
-In some special cases, particularly when building $package for distribution,
-it is convenient to distinguish between the directory in which files should
-be installed from the directory ($prefix) in which they
-will eventually reside. For most users, these two directories are the same.
-
-EOM
- case "$installprefix" in
- '') dflt=$prefix ;;
- *) dflt=$installprefix;;
- esac
-fi
-fn=d~
-rp='What installation prefix should I use for installing files?'
-. ./getfile
-installprefix="$ans"
-installprefixexp="$ansexp"
-
-: set the prefixit variable, to compute a suitable default value
-prefixit='case "$3" in
-""|none)
- case "$oldprefix" in
- "") eval "$1=\"\$$2\"";;
+ case "$cppstdin" in
+ '') ;;
*)
- case "$3" in
- "") eval "$1=";;
- none)
- eval "tp=\"\$$2\"";
- case "$tp" in
- ""|" ") eval "$1=\"\$$2\"";;
- *) eval "$1=";;
- esac;;
- esac;;
- esac;;
-*)
- eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
- case "$tp" in
- --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
- /*-$oldprefix/*|\~*-$oldprefix/*)
- eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
- *) eval "$1=\"\$$2\"";;
- esac;;
-esac'
-
-: set the base revision
-baserev=5.0
-
-: get the patchlevel
-echo " "
-echo "Getting the current patchlevel..." >&4
-if $test -r $rsrc/patchlevel.h;then
- patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
- subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
-else
- patchlevel=0
- subversion=0
+ echo "Good old $cppstdin $cppminus does not seem to be of any help..."
+ ;;
+ esac
fi
-$echo $n "(You have $package" $c
-case "$package" in
-"*$baserev") ;;
-*) $echo $n " $baserev" $c ;;
-esac
-$echo $n " patchlevel $patchlevel" $c
-test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
-echo ".)"
-if test 0 -eq "$subversion"; then
- version=`LC_ALL=C; export LC_ALL; \
- echo $baserev $patchlevel | \
- $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
-else
- version=`LC_ALL=C; export LC_ALL; \
- echo $baserev $patchlevel $subversion | \
- $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
-fi
-: Figure out perl API version. Perhaps this should be in patchlevel.h
-if test "$subversion" -lt 50; then
- apiversion=`LC_ALL=C; export LC_ALL; \
- LANGUAGE=C; export LANGUAGE; \
- echo $baserev $patchlevel | \
- $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
+if $ok; then
+ : nothing
+elif echo 'Maybe "'"$cc"' -E" will work...'; \
+ $cc -E <testcpp.c >testcpp.out 2>&1; \
+ $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+ echo "Yup, it does."
+ x_cpp="$cc -E"
+ x_minus='';
+elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
+ $cc -E - <testcpp.c >testcpp.out 2>&1; \
+ $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+ echo "Yup, it does."
+ x_cpp="$cc -E"
+ x_minus='-';
+elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
+ $cc -P <testcpp.c >testcpp.out 2>&1; \
+ $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+ echo "Yipee, that works!"
+ x_cpp="$cc -P"
+ x_minus='';
+elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
+ $cc -P - <testcpp.c >testcpp.out 2>&1; \
+ $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+ echo "At long last!"
+ x_cpp="$cc -P"
+ x_minus='-';
+elif echo 'No such luck, maybe "'$cpp'" will work...'; \
+ $cpp <testcpp.c >testcpp.out 2>&1; \
+ $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+ echo "It works!"
+ x_cpp="$cpp"
+ x_minus='';
+elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
+ $cpp - <testcpp.c >testcpp.out 2>&1; \
+ $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+ echo "Hooray, it works! I was beginning to wonder."
+ x_cpp="$cpp"
+ x_minus='-';
+elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
+ $wrapper <testcpp.c >testcpp.out 2>&1; \
+ $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+ x_cpp="$wrapper"
+ x_minus=''
+ echo "Eureka!"
else
- apiversion="$version"
+ dflt=''
+ rp="No dice. I can't find a C preprocessor. Name one:"
+ . ./myread
+ x_cpp="$ans"
+ x_minus=''
+ $x_cpp <testcpp.c >testcpp.out 2>&1
+ if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+ echo "OK, that will do." >&4
+ else
+echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
+ exit 1
+ fi
fi
-: determine installation style
-: For now, try to deduce it from prefix unless it is already set.
-: Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
-case "$installstyle" in
-'') case "$prefix" in
- *perl*) dflt='lib';;
- *) dflt='lib/perl5' ;;
+case "$ok" in
+false)
+ cppstdin="$x_cpp"
+ cppminus="$x_minus"
+ cpprun="$x_cpp"
+ cpplast="$x_minus"
+ set X $x_cpp
+ shift
+ case "$1" in
+ "$cpp")
+ echo "Perhaps can we force $cc -E using a wrapper..."
+ if $wrapper <testcpp.c >testcpp.out 2>&1; \
+ $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
+ then
+ echo "Yup, we can."
+ cppstdin="$wrapper"
+ cppminus='';
+ else
+ echo "Nope, we'll have to live without it..."
+ fi
+ ;;
+ esac
+ case "$cpprun" in
+ "$wrapper")
+ cpprun=''
+ cpplast=''
+ ;;
esac
;;
-*) dflt='lib/perl5' ;;
esac
-: Probably not worth prompting for this since we prompt for all
-: the directories individually, and the prompt would be too long and
-: confusing anyway.
-installstyle=$dflt
-: determine where private library files go
-: Usual default is /usr/local/lib/perl5/$version.
-: Also allow things like /opt/perl/lib/$version, since
-: /opt/perl/lib/perl5... would be redundant.
-: The default "style" setting is made in installstyle.U
-case "$installstyle" in
-*lib/perl5*) set dflt privlib lib/$package/$version ;;
-*) set dflt privlib lib/$version ;;
+case "$cppstdin" in
+"$wrapper"|'cppstdin') ;;
+*) $rm -f $wrapper;;
esac
-eval $prefixit
-$cat <<EOM
+$rm -f testcpp.c testcpp.out
-There are some auxiliary files for $package that need to be put into a
-private library directory that is accessible by everyone.
+: Set private lib path
+case "$plibpth" in
+'') if ./mips; then
+ plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
+ fi;;
+esac
+case "$libpth" in
+' ') dlist='';;
+'') dlist="$loclibpth $plibpth $glibpth";;
+*) dlist="$libpth";;
+esac
-EOM
-fn=d~+
-rp='Pathname where the private library files will reside?'
-. ./getfile
-privlib="$ans"
-privlibexp="$ansexp"
-: Change installation prefix, if necessary.
-if $test X"$prefix" != X"$installprefix"; then
- installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
-else
- installprivlib="$privlibexp"
-fi
+: Now check and see which directories actually exist, avoiding duplicates
+libpth=''
+for xxx in $dlist
+do
+ if $test -d $xxx; then
+ case " $libpth " in
+ *" $xxx "*) ;;
+ *) libpth="$libpth $xxx";;
+ esac
+ fi
+done
+$cat <<'EOM'
-: set the prefixup variable, to restore leading tilda escape
-prefixup='case "$prefixexp" in
-"$prefix") ;;
-*) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
-esac'
+Some systems have incompatible or broken versions of libraries. Among
+the directories listed in the question below, please remove any you
+know not to be holding relevant libraries, and add any that are needed.
+Say "none" for none.
-: determine where public architecture dependent libraries go
-set archlib archlib
-eval $prefixit
-: privlib default is /usr/local/lib/$package/$version
-: archlib default is /usr/local/lib/$package/$version/$archname
-: privlib may have an optional trailing /share.
-tdflt=`echo $privlib | $sed 's,/share$,,'`
-tdflt=$tdflt/$archname
-case "$archlib" in
-'') dflt=$tdflt
+EOM
+case "$libpth" in
+'') dflt='none';;
+*)
+ set X $libpth
+ shift
+ dflt=${1+"$@"}
;;
-*) dflt="$archlib"
- ;;
+esac
+rp="Directories to use for library searches?"
+. ./myread
+case "$ans" in
+none) libpth=' ';;
+*) libpth="$ans";;
+esac
+
+: compute shared library extension
+case "$so" in
+'')
+ if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
+ dflt='sl'
+ else
+ dflt='so'
+ fi
+ ;;
+*) dflt="$so";;
esac
$cat <<EOM
-$spackage contains architecture-dependent library files. If you are
-sharing libraries in a heterogeneous environment, you might store
-these files in a separate location. Otherwise, you can just include
-them with the rest of the public library files.
+On some systems, shared libraries may be available. Answer 'none' if
+you want to suppress searching of shared libraries for the remaining
+of this configuration.
EOM
-fn=d+~
-rp='Where do you want to put the public architecture-dependent libraries?'
-. ./getfile
-archlib="$ans"
-archlibexp="$ansexp"
-if $test X"$archlib" = X"$privlib"; then
- d_archlib="$undef"
-else
- d_archlib="$define"
-fi
-: Change installation prefix, if necessary.
-if $test X"$prefix" != X"$installprefix"; then
- installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
-else
- installarchlib="$archlibexp"
-fi
-
+rp='What is the file extension used for shared libraries?'
+. ./myread
+so="$ans"
-: Binary compatibility with 5.005 is not possible for builds
-: with advanced features
-case "$usethreads$usemultiplicity" in
-*define*)
- bincompat5005="$undef"
- d_bincompat5005="$undef"
+: Define several unixisms.
+: Hints files or command line option can be used to override them.
+: The convoluted testing is in case hints files set either the old
+: or the new name.
+case "$_exe" in
+'') case "$exe_ext" in
+ '') ;;
+ *) _exe="$exe_ext" ;;
+ esac
;;
-*) $cat <<EOM
-
-Perl 5.006 can be compiled for binary compatibility with 5.005.
-If you decide to do so, you will be able to continue using most
-of the extensions that were compiled for Perl 5.005.
-
-EOM
- case "$bincompat5005$d_bincompat5005" in
- *"$undef"*) dflt=n ;;
- *) dflt=y ;;
+esac
+case "$_a" in
+'') case "$lib_ext" in
+ '') _a='.a';;
+ *) _a="$lib_ext" ;;
esac
- rp='Binary compatibility with Perl 5.005?'
- . ./myread
- case "$ans" in
- y*) val="$define" ;;
- *) val="$undef" ;;
+ ;;
+esac
+case "$_o" in
+'') case "$obj_ext" in
+ '') _o='.o';;
+ *) _o="$obj_ext";;
esac
- set d_bincompat5005
- eval $setvar
- case "$d_bincompat5005" in
- "$define")
- bincompat5005="$define"
- ;;
- *) bincompat5005="$undef"
- d_bincompat5005="$undef"
- ;;
+ ;;
+esac
+case "$p_" in
+'') case "$path_sep" in
+ '') p_=':';;
+ *) p_="$path_sep";;
esac
;;
esac
+exe_ext=$_exe
+lib_ext=$_a
+obj_ext=$_o
+path_sep=$p_
+: Which makefile gets called first. This is used by make depend.
+case "$firstmakefile" in
+'') firstmakefile='makefile';;
+esac
-: see if setuid scripts can be secure
-$cat <<EOM
+cat <<EOM
-Some kernels have a bug that prevents setuid #! scripts from being
-secure. Some sites have disabled setuid #! scripts because of this.
+Perl can be built to use the SOCKS proxy protocol library. To do so,
+Configure must be run with -Dusesocks.
-First let's decide if your kernel supports secure setuid #! scripts.
-(If setuid #! scripts would be secure but have been disabled anyway,
-don't say that they are secure if asked.)
+Normally you do not need this and you should answer no.
EOM
+case "$usesocks" in
+$define|true|[yY]*) dflt='y';;
+*) dflt='n';;
+esac
+rp='Build Perl for SOCKS?'
+. ./myread
+case "$ans" in
+y|Y) val="$define" ;;
+*) val="$undef" ;;
+esac
+set usesocks
+eval $setvar
-val="$undef"
-if $test -d /dev/fd; then
- echo "#!$ls" >reflect
- chmod +x,u+s reflect
- ./reflect >flect 2>&1
- if $contains "/dev/fd" flect >/dev/null; then
- echo "Congratulations, your kernel has secure setuid scripts!" >&4
- val="$define"
- else
- $cat <<EOM
-If you are not sure if they are secure, I can check but I'll need a
-username and password different from the one you are using right now.
-If you don't have such a username or don't want me to test, simply
-enter 'none'.
-
-EOM
- rp='Other username to test security of setuid scripts with?'
- dflt='none'
- . ./myread
- case "$ans" in
- n|none)
- case "$d_suidsafe" in
- '') echo "I'll assume setuid scripts are *not* secure." >&4
- dflt=n;;
- "$undef")
- echo "Well, the $hint value is *not* secure." >&4
- dflt=n;;
- *) echo "Well, the $hint value *is* secure." >&4
- dflt=y;;
- esac
- ;;
- *)
- $rm -f reflect flect
- echo "#!$ls" >reflect
- chmod +x,u+s reflect
- echo >flect
- chmod a+w flect
- echo '"su" will (probably) prompt you for '"$ans's password."
- su $ans -c './reflect >flect'
- if $contains "/dev/fd" flect >/dev/null; then
- echo "Okay, it looks like setuid scripts are secure." >&4
- dflt=y
- else
- echo "I don't think setuid scripts are secure." >&4
- dflt=n
- fi
- ;;
+: Looking for optional libraries
+echo " "
+echo "Checking for optional libraries..." >&4
+case "$libs" in
+' '|'') dflt='';;
+*) dflt="$libs";;
+esac
+case "$libswanted" in
+'') libswanted='c_s';;
+esac
+case "$usesocks" in
+$define)
+ libswanted="$libswanted socks5 socks5_sh"
+ ;;
+esac
+for thislib in $libswanted; do
+
+ if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
+ $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
+ echo "Found -l$thislib (shared)."
+ case " $dflt " in
+ *"-l$thislib "*);;
+ *) dflt="$dflt -l$thislib";;
esac
- rp='Does your kernel have *secure* setuid scripts?'
- . ./myread
- case "$ans" in
- [yY]*) val="$define";;
- *) val="$undef";;
+ elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
+ echo "Found -l$thislib (shared)."
+ case " $dflt " in
+ *"-l$thislib "*);;
+ *) dflt="$dflt -l$thislib";;
+ esac
+ elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
+ echo "Found -l$thislib."
+ case " $dflt " in
+ *"-l$thislib "*);;
+ *) dflt="$dflt -l$thislib";;
+ esac
+ elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
+ echo "Found -l$thislib."
+ case " $dflt " in
+ *"-l$thislib "*);;
+ *) dflt="$dflt -l$thislib";;
+ esac
+ elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
+ echo "Found -l${thislib}_s."
+ case " $dflt " in
+ *"-l$thislib "*);;
+ *) dflt="$dflt -l${thislib}_s";;
esac
+ elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
+ echo "Found -l$thislib."
+ case " $dflt " in
+ *"-l$thislib "*);;
+ *) dflt="$dflt -l$thislib";;
+ esac
+ else
+ echo "No -l$thislib."
fi
-else
- echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
- echo "(That's for file descriptors, not floppy disks.)"
- val="$undef"
-fi
-set d_suidsafe
-eval $setvar
+done
+set X $dflt
+shift
+dflt="$*"
+case "$libs" in
+'') dflt="$dflt";;
+*) dflt="$libs";;
+esac
+case "$dflt" in
+' '|'') dflt='none';;
+esac
-$rm -f reflect flect
+$cat <<EOM
+
+In order to compile $package on your machine, a number of libraries
+are usually needed. Include any other special libraries here as well.
+Say "none" for none. The default list is almost always right.
+EOM
-: now see if they want to do setuid emulation
echo " "
-val="$undef"
-case "$d_suidsafe" in
-"$define")
- val="$undef"
- echo "No need to emulate SUID scripts since they are secure here." >& 4
- ;;
-*)
- $cat <<EOM
-Some systems have disabled setuid scripts, especially systems where
-setuid scripts cannot be secure. On systems where setuid scripts have
-been disabled, the setuid/setgid bits on scripts are currently
-useless. It is possible for $package to detect those bits and emulate
-setuid/setgid in a secure fashion. This emulation will only work if
-setuid scripts have been disabled in your kernel.
+rp="What libraries to use?"
+. ./myread
+case "$ans" in
+none) libs=' ';;
+*) libs="$ans";;
+esac
-EOM
- case "$d_dosuid" in
- "$define") dflt=y ;;
- *) dflt=n ;;
+: determine optimization, if desired, or use for debug flag also
+case "$optimize" in
+' '|$undef) dflt='none';;
+'') dflt='-O';;
+*) dflt="$optimize";;
+esac
+$cat <<EOH
+
+By default, $package compiles with the -O flag to use the optimizer.
+Alternately, you might want to use the symbolic debugger, which uses
+the -g flag (on traditional Unix systems). Either flag can be
+specified here. To use neither flag, specify the word "none".
+
+EOH
+rp="What optimizer/debugger flag should be used?"
+. ./myread
+optimize="$ans"
+case "$optimize" in
+'none') optimize=" ";;
+esac
+
+dflt=''
+: We will not override a previous value, but we might want to
+: augment a hint file
+case "$hint" in
+default|recommended)
+ case "$gccversion" in
+ 1*) dflt='-fpcc-struct-return' ;;
esac
- rp="Do you want to do setuid/setgid emulation?"
- . ./myread
- case "$ans" in
- [yY]*) val="$define";;
- *) val="$undef";;
+ case "$optimize" in
+ *-g*) dflt="$dflt -DDEBUGGING";;
+ esac
+ case "$gccversion" in
+ 2*) if test -d /etc/conf/kconfig.d &&
+ $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
+ then
+ dflt="$dflt -posix"
+ fi
+ ;;
+ esac
+ case "$gccversion" in
+ 1*) ;;
+ 2.[0-8]*) ;;
+ ?*) echo " "
+ echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
+ echo 'int main(void) { return 0; }' > gcctest.c
+ if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
+ echo "Yes, it does." 2>&1
+ case "$ccflags" in
+ *strict-aliasing*)
+ echo "Leaving current flags $ccflags alone." 2>&1
+ ;;
+ *) dflt="$dflt -fno-strict-aliasing" ;;
+ esac
+ else
+ echo "Nope, it doesn't, but that's ok." 2>&1
+ fi
+ ;;
esac
;;
esac
-set d_dosuid
-eval $setvar
-: What should the include directory be ?
-echo " "
-$echo $n "Hmm... $c"
-dflt='/usr/include'
-incpath=''
-mips_type=''
-if $test -f /bin/mips && /bin/mips; then
- echo "Looks like a MIPS system..."
- $cat >usr.c <<'EOCP'
-#ifdef SYSTYPE_BSD43
-/bsd43
-#endif
-EOCP
- if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
- dflt='/bsd43/usr/include'
- incpath='/bsd43'
- mips_type='BSD 4.3'
- else
- mips_type='System V'
+case "$mips_type" in
+*BSD*|'') inclwanted="$locincpth $usrinc";;
+*) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
+esac
+for thisincl in $inclwanted; do
+ if $test -d $thisincl; then
+ if $test x$thisincl != x$usrinc; then
+ case "$dflt" in
+ *$thisincl*);;
+ *) dflt="$dflt -I$thisincl";;
+ esac
+ fi
fi
- $rm -f usr.c usr.out
- echo "and you're compiling with the $mips_type compiler and libraries."
- xxx_prompt=y
- echo "exit 0" >mips
+done
+
+inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
+ xxx=true;
+elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
+ xxx=true;
else
- echo "Doesn't look like a MIPS system."
- xxx_prompt=n
- echo "exit 1" >mips
-fi
-chmod +x mips
-$eunicefix mips
-case "$usrinc" in
-'') ;;
-*) dflt="$usrinc";;
-esac
-case "$xxx_prompt" in
-y) fn=d/
- echo " "
- rp='Where are the include files you want to use?'
- . ./getfile
- usrinc="$ans"
- ;;
-*) usrinc="$dflt"
+ xxx=false;
+fi;
+if $xxx; then
+ case "$dflt" in
+ *$2*);;
+ *) dflt="$dflt -D$2";;
+ esac;
+fi'
+
+set signal.h LANGUAGE_C; eval $inctest
+
+case "$usesocks" in
+$define)
+ ccflags="$ccflags -DSOCKS"
;;
esac
-: see how we invoke the C preprocessor
-echo " "
-echo "Now, how can we feed standard input to your C preprocessor..." >&4
-cat <<'EOT' >testcpp.c
-#define ABC abc
-#define XYZ xyz
-ABC.XYZ
-EOT
-cd ..
-if test ! -f cppstdin; then
- if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
- # AIX cc -E doesn't show the absolute headerfile
- # locations but we'll cheat by using the -M flag.
- echo 'cat >.$$.c; rm -f .$$.u; '"$cc"' ${1+"$@"} -M -c .$$.c 2>/dev/null; test -s .$$.u && awk '"'"'$2 ~ /\.h$/ { print "# 0 \""$2"\"" }'"'"' .$$.u; rm -f .$$.o .$$.u; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' > cppstdin
- else
- echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
- fi
-else
- echo "Keeping your $hint cppstdin wrapper."
-fi
-chmod 755 cppstdin
-wrapper=`pwd`/cppstdin
-ok='false'
-cd UU
+case "$hint" in
+default|recommended) dflt="$ccflags $dflt" ;;
+*) dflt="$ccflags";;
+esac
-if $test "X$cppstdin" != "X" && \
- $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
- $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
-then
- echo "You used to use $cppstdin $cppminus so we'll use that again."
- case "$cpprun" in
- '') echo "But let's see if we can live without a wrapper..." ;;
- *)
- if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
- $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
+case "$dflt" in
+''|' ') dflt=none;;
+esac
+$cat <<EOH
+
+Your C compiler may want other flags. For this question you should include
+-I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
+but you should NOT include libraries or ld flags like -lwhatever. If you
+want $package to honor its debug switch, you should include -DDEBUGGING here.
+Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
+
+To use no flags, specify the word "none".
+
+EOH
+set X $dflt
+shift
+dflt=${1+"$@"}
+rp="Any additional cc flags?"
+. ./myread
+case "$ans" in
+none) ccflags='';;
+*) ccflags="$ans";;
+esac
+
+: the following weeds options from ccflags that are of no interest to cpp
+cppflags="$ccflags"
+case "$gccversion" in
+1*) cppflags="$cppflags -D__GNUC__"
+esac
+case "$mips_type" in
+'');;
+*BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
+esac
+case "$cppflags" in
+'');;
+*)
+ echo " "
+ echo "Let me guess what the preprocessor flags are..." >&4
+ set X $cppflags
+ shift
+ cppflags=''
+ $cat >cpp.c <<'EOM'
+#define BLURFL foo
+
+BLURFL xx LFRULB
+EOM
+ previous=''
+ for flag in $*
+ do
+ case "$flag" in
+ -*) ftry="$flag";;
+ *) ftry="$previous $flag";;
+ esac
+ if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
+ >cpp1.out 2>/dev/null && \
+ $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
+ >cpp2.out 2>/dev/null && \
+ $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
+ $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
then
- echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
- ok='true'
+ cppflags="$cppflags $ftry"
+ previous=''
else
- echo "(However, $cpprun $cpplast does not work, let's see...)"
+ previous="$flag"
fi
- ;;
+ done
+ set X $cppflags
+ shift
+ cppflags=${1+"$@"}
+ case "$cppflags" in
+ *-*) echo "They appear to be: $cppflags";;
esac
-else
- case "$cppstdin" in
- '') ;;
- *)
- echo "Good old $cppstdin $cppminus does not seem to be of any help..."
+ $rm -f cpp.c cpp?.out
+ ;;
+esac
+
+: flags used in final linking phase
+case "$ldflags" in
+'') if ./venix; then
+ dflt='-i -z'
+ else
+ dflt=''
+ fi
+ case "$ccflags" in
+ *-posix*) dflt="$dflt -posix" ;;
+ esac
+ ;;
+*) dflt="$ldflags";;
+esac
+
+: Try to guess additional flags to pick up local libraries.
+for thislibdir in $libpth; do
+ case " $loclibpth " in
+ *" $thislibdir "*)
+ case "$dflt " in
+ *"-L$thislibdir "*) ;;
+ *) dflt="$dflt -L$thislibdir" ;;
+ esac
;;
esac
-fi
+done
-if $ok; then
- : nothing
-elif echo 'Maybe "'"$cc"' -E" will work...'; \
- $cc -E <testcpp.c >testcpp.out 2>&1; \
- $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- echo "Yup, it does."
- x_cpp="$cc -E"
- x_minus='';
-elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
- $cc -E - <testcpp.c >testcpp.out 2>&1; \
- $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- echo "Yup, it does."
- x_cpp="$cc -E"
- x_minus='-';
-elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
- $cc -P <testcpp.c >testcpp.out 2>&1; \
- $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- echo "Yipee, that works!"
- x_cpp="$cc -P"
- x_minus='';
-elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
- $cc -P - <testcpp.c >testcpp.out 2>&1; \
- $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- echo "At long last!"
- x_cpp="$cc -P"
- x_minus='-';
-elif echo 'No such luck, maybe "'$cpp'" will work...'; \
- $cpp <testcpp.c >testcpp.out 2>&1; \
- $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- echo "It works!"
- x_cpp="$cpp"
- x_minus='';
-elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
- $cpp - <testcpp.c >testcpp.out 2>&1; \
- $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- echo "Hooray, it works! I was beginning to wonder."
- x_cpp="$cpp"
- x_minus='-';
-elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
- $wrapper <testcpp.c >testcpp.out 2>&1; \
- $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- x_cpp="$wrapper"
- x_minus=''
- echo "Eureka!"
-else
- dflt=''
- rp="No dice. I can't find a C preprocessor. Name one:"
- . ./myread
- x_cpp="$ans"
- x_minus=''
- $x_cpp <testcpp.c >testcpp.out 2>&1
- if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- echo "OK, that will do." >&4
+case "$dflt" in
+'') dflt='none' ;;
+esac
+
+$cat <<EOH
+
+Your C linker may need flags. For this question you should
+include -L/whatever and any other flags used by the C linker, but you
+should NOT include libraries like -lwhatever.
+
+Make sure you include the appropriate -L/path flags if your C linker
+does not normally search all of the directories you specified above,
+namely
+ $libpth
+To use no flags, specify the word "none".
+
+EOH
+
+rp="Any additional ld flags (NOT including libraries)?"
+. ./myread
+case "$ans" in
+none) ldflags='';;
+*) ldflags="$ans";;
+esac
+rmlist="$rmlist pdp11"
+
+: coherency check
+echo " "
+echo "Checking your choice of C compiler and flags for coherency..." >&4
+$cat > try.c <<'EOF'
+#include <stdio.h>
+int main() { printf("Ok\n"); exit(0); }
+EOF
+set X $cc $optimize $ccflags -o try $ldflags try.c $libs
+shift
+$cat >try.msg <<'EOM'
+I've tried to compile and run the following simple program:
+
+EOM
+$cat try.c >> try.msg
+
+$cat >> try.msg <<EOM
+
+I used the command:
+
+ $*
+ ./try
+
+and I got the following output:
+
+EOM
+dflt=y
+if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
+ if sh -c './try' >>try.msg 2>&1; then
+ xxx=`./try`
+ case "$xxx" in
+ "Ok") dflt=n ;;
+ *) echo 'The program compiled OK, but produced no output.' >> try.msg
+ case " $libs " in
+ *" -lsfio "*)
+ cat >> try.msg <<'EOQS'
+If $libs contains -lsfio, and sfio is mis-configured, then it
+sometimes (apparently) runs and exits with a 0 status, but with no
+output! It may have to do with sfio's use of _exit vs. exit.
+
+EOQS
+ rp="You have a big problem. Shall I abort Configure"
+ dflt=y
+ ;;
+ esac
+ ;;
+ esac
else
-echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
- exit 1
+ echo "The program compiled OK, but exited with status $?." >>try.msg
+ rp="You have a problem. Shall I abort Configure"
+ dflt=y
fi
+else
+ echo "I can't compile the test program." >>try.msg
+ rp="You have a BIG problem. Shall I abort Configure"
+ dflt=y
fi
-
-case "$ok" in
-false)
- cppstdin="$x_cpp"
- cppminus="$x_minus"
- cpprun="$x_cpp"
- cpplast="$x_minus"
- set X $x_cpp
- shift
- case "$1" in
- "$cpp")
- echo "Perhaps can we force $cc -E using a wrapper..."
- if $wrapper <testcpp.c >testcpp.out 2>&1; \
- $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
- then
- echo "Yup, we can."
- cppstdin="$wrapper"
- cppminus='';
- else
- echo "Nope, we'll have to live without it..."
- fi
+case "$dflt" in
+y)
+ $cat try.msg >&4
+ case "$knowitall" in
+ '')
+ echo "(The supplied flags or libraries might be incorrect.)"
;;
+ *) dflt=n;;
esac
- case "$cpprun" in
- "$wrapper")
- cpprun=''
- cpplast=''
+ echo " "
+ . ./myread
+ case "$ans" in
+ n*|N*) ;;
+ *) echo "Ok. Stopping Configure." >&4
+ exit 1
;;
esac
;;
+n) echo "OK, that should do.";;
esac
+$rm -f try try.* core
-case "$cppstdin" in
-"$wrapper"|'cppstdin') ;;
-*) $rm -f $wrapper;;
-esac
-$rm -f testcpp.c testcpp.out
-
-: Set private lib path
-case "$plibpth" in
-'') if ./mips; then
- plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
- fi;;
-esac
-case "$libpth" in
-' ') dlist='';;
-'') dlist="$loclibpth $plibpth $glibpth";;
-*) dlist="$libpth";;
-esac
+: define an is-a-typedef? function
+typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
+case "$inclist" in
+"") inclist="sys/types.h";;
+esac;
+eval "varval=\$$var";
+case "$varval" in
+"")
+ $rm -f temp.c;
+ for inc in $inclist; do
+ echo "#include <$inc>" >>temp.c;
+ done;
+ echo "#ifdef $type" >> temp.c;
+ echo "printf(\"We have $type\");" >> temp.c;
+ echo "#endif" >> temp.c;
+ $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
+ if $contains $type temp.E >/dev/null 2>&1; then
+ eval "$var=\$type";
+ else
+ eval "$var=\$def";
+ fi;
+ $rm -f temp.?;;
+*) eval "$var=\$varval";;
+esac'
-: Now check and see which directories actually exist, avoiding duplicates
-libpth=''
-for xxx in $dlist
-do
- if $test -d $xxx; then
- case " $libpth " in
- *" $xxx "*) ;;
- *) libpth="$libpth $xxx";;
- esac
- fi
-done
-$cat <<'EOM'
+: define an is-a-typedef? function that prompts if the type is not available.
+typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
+case "$inclist" in
+"") inclist="sys/types.h";;
+esac;
+eval "varval=\$$var";
+case "$varval" in
+"")
+ $rm -f temp.c;
+ for inc in $inclist; do
+ echo "#include <$inc>" >>temp.c;
+ done;
+ echo "#ifdef $type" >> temp.c;
+ echo "printf(\"We have $type\");" >> temp.c;
+ echo "#endif" >> temp.c;
+ $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
+ echo " " ;
+ echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
+ if $contains $type temp.E >/dev/null 2>&1; then
+ echo "$type found." >&4;
+ eval "$var=\$type";
+ else
+ echo "$type NOT found." >&4;
+ dflt="$def";
+ . ./myread ;
+ eval "$var=\$ans";
+ fi;
+ $rm -f temp.?;;
+*) eval "$var=\$varval";;
+esac'
-Some systems have incompatible or broken versions of libraries. Among
-the directories listed in the question below, please remove any you
-know not to be holding relevant libraries, and add any that are needed.
-Say "none" for none.
+: define a shorthand compile call
+compile='
+mc_file=$1;
+shift;
+$cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
+: define a shorthand compile call for compilations that should be ok.
+compile_ok='
+mc_file=$1;
+shift;
+$cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
+: check for lengths of integral types
+echo " "
+case "$intsize" in
+'')
+ echo "Checking to see how big your integers are..." >&4
+ $cat >intsize.c <<'EOCP'
+#include <stdio.h>
+int main()
+{
+ printf("intsize=%d;\n", (int)sizeof(int));
+ printf("longsize=%d;\n", (int)sizeof(long));
+ printf("shortsize=%d;\n", (int)sizeof(short));
+ exit(0);
+}
+EOCP
+ set intsize
+ if eval $compile_ok && ./intsize > /dev/null; then
+ eval `./intsize`
+ echo "Your integers are $intsize bytes long."
+ echo "Your long integers are $longsize bytes long."
+ echo "Your short integers are $shortsize bytes long."
+ else
+ $cat >&4 <<EOM
+!
+Help! I can't compile and run the intsize test program: please enlighten me!
+(This is probably a misconfiguration in your system or libraries, and
+you really ought to fix it. Still, I'll try anyway.)
+!
EOM
-case "$libpth" in
-'') dflt='none';;
-*)
- set X $libpth
- shift
- dflt=${1+"$@"}
+ dflt=4
+ rp="What is the size of an integer (in bytes)?"
+ . ./myread
+ intsize="$ans"
+ dflt=$intsize
+ rp="What is the size of a long integer (in bytes)?"
+ . ./myread
+ longsize="$ans"
+ dflt=2
+ rp="What is the size of a short integer (in bytes)?"
+ . ./myread
+ shortsize="$ans"
+ fi
;;
esac
-rp="Directories to use for library searches?"
-. ./myread
-case "$ans" in
-none) libpth=' ';;
-*) libpth="$ans";;
+$rm -f intsize intsize.*
+
+: see what type lseek is declared as in the kernel
+rp="What is the type used for lseek's offset on this system?"
+set off_t lseektype long stdio.h sys/types.h
+eval $typedef_ask
+
+echo " "
+$echo $n "Checking to see how big your file offsets are...$c" >&4
+$cat >try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+int main()
+{
+ printf("%d\n", (int)sizeof($lseektype));
+ return(0);
+}
+EOCP
+set try
+if eval $compile_ok; then
+ lseeksize=`./try`
+ $echo " $lseeksize bytes." >&4
+else
+ dflt=$longsize
+ echo " "
+ echo "(I can't seem to compile the test program. Guessing...)"
+ rp="What is the size of your file offsets (in bytes)?"
+ . ./myread
+ lseeksize="$ans"
+fi
+$rm -f try.c try
+
+: see what type file positions are declared as in the library
+rp="What is the type for file position used by fsetpos()?"
+set fpos_t fpostype long stdio.h sys/types.h
+eval $typedef_ask
+
+echo " "
+case "$fpostype" in
+*_t) zzz="$fpostype" ;;
+*) zzz="fpos_t" ;;
esac
+$echo $n "Checking the size of $zzz...$c" >&4
+cat > try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+ printf("%d\n", (int)sizeof($fpostype));
+ exit(0);
+}
+EOCP
+set try
+if eval $compile_ok; then
+ yyy=`./try`
+ case "$yyy" in
+ '') fpossize=4
+ echo " "
+ echo "(I can't execute the test program--guessing $fpossize.)" >&4
+ ;;
+ *) fpossize=$yyy
+ echo " $fpossize bytes."
+ ;;
+ esac
+else
+ dflt="$longsize"
+ echo " "
+ echo "(I can't compile the test program. Guessing...)" >&4
+ rp="What is the size of your file positions (in bytes)?"
+ . ./myread
+ fpossize="$ans"
+fi
-: compute shared library extension
-case "$so" in
-'')
- if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
- dflt='sl'
- else
- dflt='so'
- fi
- ;;
-*) dflt="$so";;
-esac
-$cat <<EOM
-On some systems, shared libraries may be available. Answer 'none' if
-you want to suppress searching of shared libraries for the remaining
-of this configuration.
+case "$lseeksize:$fpossize" in
+8:8) cat <<EOM
+
+You can have files larger than 2 gigabytes.
EOM
-rp='What is the file extension used for shared libraries?'
-. ./myread
-so="$ans"
+ val="$define" ;;
+*) cat <<EOM
-: Define several unixisms.
-: Hints files or command line option can be used to override them.
-: The convoluted testing is in case hints files set either the old
-: or the new name.
-case "$_exe" in
-'') case "$exe_ext" in
- '') ;;
- *) _exe="$exe_ext" ;;
- esac
- ;;
+Perl can be built to understand large files (files larger than 2 gigabytes)
+on some systems. To do so, Configure must be run with -Duselargefiles.
+
+If this doesn't make any sense to you, just accept the default 'y'.
+EOM
+ case "$uselargefiles" in
+ "$undef"|false|[nN]*) dflt='n' ;;
+ *) dflt='y' ;;
+ esac
+ rp='Try to understand large files, if available?'
+ . ./myread
+ case "$ans" in
+ y|Y) val="$define" ;;
+ *) val="$undef" ;;
+ esac
+ ;;
esac
-case "$_a" in
-'') case "$lib_ext" in
- '') _a='.a';;
- *) _a="$lib_ext" ;;
- esac
+set uselargefiles
+eval $setvar
+case "$uselargefiles" in
+"$define")
+: Look for a hint-file generated 'call-back-unit'. If the
+: user has specified that a large files perl is to be built,
+: we may need to set or change some other defaults.
+ if $test -f uselfs.cbu; then
+ echo "Your platform has some specific hints for large file builds, using them..."
+ . ./uselfs.cbu
+ echo " "
+ $echo $n "Rechecking to see how big your file offsets are...$c" >&4
+ $cat >try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+int main()
+{
+ printf("%d\n", (int)sizeof($lseektype));
+ return(0);
+}
+EOCP
+ set try
+ if eval $compile_ok; then
+ lseeksize=`./try`
+ $echo " $lseeksize bytes." >&4
+ else
+ dflt="$lseeksize"
+ echo " "
+ echo "(I can't seem to compile the test program. Guessing...)"
+ rp="What is the size of your file offsets (in bytes)?"
+ . ./myread
+ lseeksize="$ans"
+ fi
+ case "$fpostype" in
+ *_t) zzz="$fpostype" ;;
+ *) zzz="fpos_t" ;;
+ esac
+ $echo $n "Rechecking the size of $zzz...$c" >&4
+ $cat > try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+ printf("%d\n", (int)sizeof($fpostype));
+ exit(0);
+}
+EOCP
+ set try
+ if eval $compile_ok; then
+ yyy=`./try`
+ dflt="$lseeksize"
+ case "$yyy" in
+ '') echo " "
+ echo "(I can't execute the test program--guessing $fpossize.)" >&4
+ ;;
+ *) fpossize=$yyy
+ echo " $fpossize bytes."
+ ;;
+ esac
+ else
+ dflt="$fpossize"
+ echo " "
+ echo "(I can't compile the test program. Guessing...)" >&4
+ rp="What is the size of your file positions (in bytes)?"
+ . ./myread
+ fpossize="$ans"
+ fi
+ $rm -f try.c try
+ fi
;;
esac
-case "$_o" in
-'') case "$obj_ext" in
- '') _o='.o';;
- *) _o="$obj_ext";;
- esac
+
+
+case "$usemorebits" in
+"$define"|true|[yY]*)
+ use64bits="$define"
+ uselongdouble="$define"
+ usemorebits="$define"
;;
-esac
-case "$p_" in
-'') case "$path_sep" in
- '') p_=':';;
- *) p_="$path_sep";;
- esac
+*) usemorebits="$undef"
;;
esac
-exe_ext=$_exe
-lib_ext=$_a
-obj_ext=$_o
-path_sep=$p_
-: Which makefile gets called first. This is used by make depend.
-case "$firstmakefile" in
-'') firstmakefile='makefile';;
-esac
-cat <<EOM
+case "$intsize:$longsize" in
+8:*|*:8) cat <<EOM
-Perl can be built to use the SOCKS proxy protocol library. To do so,
-Configure must be run with -Dusesocks.
+You have natively 64-bit integers.
+EOM
+ val="$define" ;;
+*) cat <<EOM
-Normally you do not need this and you should answer no.
+Perl can be built to take advantage of 64-bit integer types
+on some systems. To do so, Configure must be run with -Duse64bits.
+If this doesn't make any sense to you, just accept the default.
EOM
-case "$usesocks" in
-$define|true|[yY]*) dflt='y';;
-*) dflt='n';;
-esac
-rp='Build Perl for SOCKS?'
-. ./myread
-case "$ans" in
-y|Y) val="$define" ;;
-*) val="$undef" ;;
+ case "$use64bits" in
+ $define|true|[yY]*) dflt='y';;
+ *) dflt='n';;
+ esac
+ rp='Try to use 64-bit integers, if available?'
+ . ./myread
+ case "$ans" in
+ y|Y) val="$define" ;;
+ *) val="$undef" ;;
+ esac
+ ;;
esac
-set usesocks
+set use64bits
eval $setvar
-: Looking for optional libraries
-echo " "
-echo "Checking for optional libraries..." >&4
-case "$libs" in
-' '|'') dflt='';;
-*) dflt="$libs";;
-esac
-case "$libswanted" in
-'') libswanted='c_s';;
-esac
-case "$usesocks" in
-$define)
- libswanted="$libswanted socks5 socks5_sh"
- ;;
+case "$archname64" in
+'') archname64='' ;; # not a typo
esac
-for thislib in $libswanted; do
-
- if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
- $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
- echo "Found -l$thislib (shared)."
- case " $dflt " in
- *"-l$thislib "*);;
- *) dflt="$dflt -l$thislib";;
- esac
- elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
- echo "Found -l$thislib (shared)."
- case " $dflt " in
- *"-l$thislib "*);;
- *) dflt="$dflt -l$thislib";;
- esac
- elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
- echo "Found -l$thislib."
- case " $dflt " in
- *"-l$thislib "*);;
- *) dflt="$dflt -l$thislib";;
- esac
- elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
- echo "Found -l$thislib."
- case " $dflt " in
- *"-l$thislib "*);;
- *) dflt="$dflt -l$thislib";;
- esac
- elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
- echo "Found -l${thislib}_s."
- case " $dflt " in
- *"-l$thislib "*);;
- *) dflt="$dflt -l${thislib}_s";;
- esac
- elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
- echo "Found -l$thislib."
- case " $dflt " in
- *"-l$thislib "*);;
- *) dflt="$dflt -l$thislib";;
- esac
+
+case "$use64bits" in
+"$define"|true|[yY]*)
+: Look for a hint-file generated 'call-back-unit'. If the
+: user has specified that a 64-bit perl is to be built,
+: we may need to set or change some other defaults.
+ if $test -f use64bits.cbu; then
+ echo "Your platform has some specific hints for 64-bit builds, using them..."
+ . ./use64bits.cbu
else
- echo "No -l$thislib."
+ $cat <<EOM
+(Your platform doesn't have any specific hints for 64-bit builds.)
+EOM
+ case "$intsize:$longsize" in
+8:*|*:8) cat <<EOM
+(This is probably okay, as your system is a natively 64-bit system.)
+EOM
+ ;;
+ esac
+ case "$gccversion" in
+ '') ;;
+ *) case "$ccflags" in
+ *-DUSE_LONG_LONG*) ;;
+ *) $cat <<EOM
+But since you seem to be using gcc, I will now add -DUSE_LONG_LONG
+to the compilation flags.
+EOM
+ ccflags="$ccflags -DUSE_LONG_LONG"
+ ;;
+ esac
+ ;;
+ esac
fi
-done
-set X $dflt
-shift
-dflt="$*"
-case "$libs" in
-'') dflt="$dflt";;
-*) dflt="$libs";;
-esac
-case "$dflt" in
-' '|'') dflt='none';;
+ ;;
esac
-$cat <<EOM
-
-In order to compile $package on your machine, a number of libraries
-are usually needed. Include any other special libraries here as well.
-Say "none" for none. The default list is almost always right.
-EOM
-
+: determine the architecture name
echo " "
-rp="What libraries to use?"
-. ./myread
-case "$ans" in
-none) libs=' ';;
-*) libs="$ans";;
-esac
-
-: determine optimization, if desired, or use for debug flag also
-case "$optimize" in
-' '|$undef) dflt='none';;
-'') dflt='-O';;
-*) dflt="$optimize";;
+if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
+ tarch=`arch`"-$osname"
+elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
+ if uname -m > tmparch 2>&1 ; then
+ tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
+ -e 's/$/'"-$osname/" tmparch`
+ else
+ tarch="$osname"
+ fi
+ $rm -f tmparch
+else
+ tarch="$osname"
+fi
+case "$myarchname" in
+''|"$tarch") ;;
+*)
+ echo "(Your architecture name used to be $myarchname.)"
+ archname=''
+ ;;
esac
-$cat <<EOH
-
-By default, $package compiles with the -O flag to use the optimizer.
-Alternately, you might want to use the symbolic debugger, which uses
-the -g flag (on traditional Unix systems). Either flag can be
-specified here. To use neither flag, specify the word "none".
-
-EOH
-rp="What optimizer/debugger flag should be used?"
+myarchname="$tarch"
+case "$archname" in
+'') dflt="$tarch";;
+*) dflt="$archname";;
+esac
+rp='What is your architecture name'
. ./myread
-optimize="$ans"
-case "$optimize" in
-'none') optimize=" ";;
+archname="$ans"
+case "$usethreads" in
+$define)
+ echo "Threads selected." >&4
+ case "$archname" in
+ *-thread*) echo "...and architecture name already has -thread." >&4
+ ;;
+ *) archname="$archname-thread"
+ echo "...setting architecture name to $archname." >&4
+ ;;
+ esac
+ ;;
esac
-
-dflt=''
-: We will not override a previous value, but we might want to
-: augment a hint file
-case "$hint" in
-default|recommended)
- case "$gccversion" in
- 1*) dflt='-fpcc-struct-return' ;;
- esac
- case "$optimize" in
- *-g*) dflt="$dflt -DDEBUGGING";;
- esac
- case "$gccversion" in
- 2*) if test -d /etc/conf/kconfig.d &&
- $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
- then
- dflt="$dflt -posix"
- fi
+case "$usemultiplicity" in
+$define)
+ echo "Multiplicity selected." >&4
+ case "$archname" in
+ *-multi*) echo "...and architecture name already has -multi." >&4
+ ;;
+ *) archname="$archname-multi"
+ echo "...setting architecture name to $archname." >&4
+ ;;
+ esac
+ ;;
+esac
+case "$use64bits" in
+$define)
+ case "$archname64" in
+ '')
;;
- esac
- case "$gccversion" in
- 1*) ;;
- 2.[0-8]*) ;;
- ?*) echo " "
- echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
- echo 'int main(void) { return 0; }' > gcctest.c
- if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
- echo "Yes, it does." 2>&1
- case "$ccflags" in
- *strict-aliasing*)
- echo "Leaving current flags $ccflags alone." 2>&1
- ;;
- *) dflt="$dflt -fno-strict-aliasing" ;;
- esac
- else
- echo "Nope, it doesn't, but that's ok." 2>&1
- fi
+ *)
+ case "$archname" in
+ *-$archname64*) echo "...and architecture name already has $archname64." >&4
+ ;;
+ *) archname="$archname-$archname64"
+ echo "...setting architecture name to $archname." >&4
+ ;;
+ esac
;;
esac
- ;;
esac
-case "$mips_type" in
-*BSD*|'') inclwanted="$locincpth $usrinc";;
-*) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
+: determine root of directory hierarchy where package will be installed.
+case "$prefix" in
+'')
+ dflt=`./loc . /usr/local /usr/local /local /opt /usr`
+ ;;
+*)
+ dflt="$prefix"
+ ;;
esac
-for thisincl in $inclwanted; do
- if $test -d $thisincl; then
- if $test x$thisincl != x$usrinc; then
- case "$dflt" in
- *$thisincl*);;
- *) dflt="$dflt -I$thisincl";;
- esac
- fi
- fi
-done
-
-inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
- xxx=true;
-elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
- xxx=true;
-else
- xxx=false;
-fi;
-if $xxx; then
- case "$dflt" in
- *$2*);;
- *) dflt="$dflt -D$2";;
- esac;
-fi'
+$cat <<EOM
-set signal.h LANGUAGE_C; eval $inctest
+By default, $package will be installed in $dflt/bin, manual pages
+under $dflt/man, etc..., i.e. with $dflt as prefix for all
+installation directories. Typically this is something like /usr/local.
+If you wish to have binaries under /usr/bin but other parts of the
+installation under /usr/local, that's ok: you will be prompted
+separately for each of the installation directories, the prefix being
+only used to set the defaults.
-case "$usesocks" in
-$define)
- ccflags="$ccflags -DSOCKS"
+EOM
+fn=d~
+rp='Installation prefix to use?'
+. ./getfile
+oldprefix=''
+case "$prefix" in
+'') ;;
+*)
+ case "$ans" in
+ "$prefix") ;;
+ *) oldprefix="$prefix";;
+ esac
;;
esac
+prefix="$ans"
+prefixexp="$ansexp"
-case "$hint" in
-default|recommended) dflt="$ccflags $dflt" ;;
-*) dflt="$ccflags";;
+: is AFS running?
+echo " "
+case "$afs" in
+$define|true) afs=true ;;
+$undef|false) afs=false ;;
+*) if test -d /afs; then
+ afs=true
+ else
+ afs=false
+ fi
+ ;;
esac
+if $afs; then
+ echo "AFS may be running... I'll be extra cautious then..." >&4
+else
+ echo "AFS does not seem to be running..." >&4
+fi
-case "$dflt" in
-''|' ') dflt=none;;
-esac
-$cat <<EOH
+: determine installation prefix for where package is to be installed.
+if $afs; then
+$cat <<EOM
-Your C compiler may want other flags. For this question you should include
--I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
-but you should NOT include libraries or ld flags like -lwhatever. If you
-want $package to honor its debug switch, you should include -DDEBUGGING here.
-Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
+Since you are running AFS, I need to distinguish the directory in which
+files will reside from the directory in which they are installed (and from
+which they are presumably copied to the former directory by occult means).
-To use no flags, specify the word "none".
+EOM
+ case "$installprefix" in
+ '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
+ *) dflt="$installprefix";;
+ esac
+else
+$cat <<EOM
-EOH
-set X $dflt
-shift
-dflt=${1+"$@"}
-rp="Any additional cc flags?"
-. ./myread
-case "$ans" in
-none) ccflags='';;
-*) ccflags="$ans";;
-esac
+In some special cases, particularly when building $package for distribution,
+it is convenient to distinguish between the directory in which files should
+be installed from the directory ($prefix) in which they
+will eventually reside. For most users, these two directories are the same.
-: the following weeds options from ccflags that are of no interest to cpp
-cppflags="$ccflags"
-case "$gccversion" in
-1*) cppflags="$cppflags -D__GNUC__"
-esac
-case "$mips_type" in
-'');;
-*BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
+EOM
+ case "$installprefix" in
+ '') dflt=$prefix ;;
+ *) dflt=$installprefix;;
+ esac
+fi
+fn=d~
+rp='What installation prefix should I use for installing files?'
+. ./getfile
+installprefix="$ans"
+installprefixexp="$ansexp"
+
+: set the prefixit variable, to compute a suitable default value
+prefixit='case "$3" in
+""|none)
+ case "$oldprefix" in
+ "") eval "$1=\"\$$2\"";;
+ *)
+ case "$3" in
+ "") eval "$1=";;
+ none)
+ eval "tp=\"\$$2\"";
+ case "$tp" in
+ ""|" ") eval "$1=\"\$$2\"";;
+ *) eval "$1=";;
+ esac;;
+ esac;;
+ esac;;
+*)
+ eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
+ case "$tp" in
+ --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
+ /*-$oldprefix/*|\~*-$oldprefix/*)
+ eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
+ *) eval "$1=\"\$$2\"";;
+ esac;;
+esac'
+
+: set the base revision
+baserev=5.0
+
+
+: get the patchlevel
+echo " "
+echo "Getting the current patchlevel..." >&4
+if $test -r $rsrc/patchlevel.h;then
+ patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
+ subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
+ api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
+ api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
+ api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
+else
+ patchlevel=0
+ subversion=0
+ api_revision=0
+ api_version=0
+ api_subversion=0
+fi
+$echo $n "(You have $package" $c
+case "$package" in
+"*$baserev") ;;
+*) $echo $n " $baserev" $c ;;
esac
-case "$cppflags" in
-'');;
+$echo $n " patchlevel $patchlevel" $c
+test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
+echo ".)"
+case "$osname" in
+dos|vms)
+ : XXX Should be a Configure test for double-dots in filenames.
+ version=`echo $baserev $patchlevel $subversion | \
+ $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
+ api_versionstring=`echo $api_revision $api_version $api_subversion | \
+ $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
+ ;;
*)
- echo " "
- echo "Let me guess what the preprocessor flags are..." >&4
- set X $cppflags
- shift
- cppflags=''
- $cat >cpp.c <<'EOM'
-#define BLURFL foo
-
-BLURFL xx LFRULB
-EOM
- previous=''
- for flag in $*
- do
- case "$flag" in
- -*) ftry="$flag";;
- *) ftry="$previous $flag";;
- esac
- if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
- >cpp1.out 2>/dev/null && \
- $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
- >cpp2.out 2>/dev/null && \
- $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
- $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
- then
- cppflags="$cppflags $ftry"
- previous=''
- else
- previous="$flag"
- fi
- done
- set X $cppflags
- shift
- cppflags=${1+"$@"}
- case "$cppflags" in
- *-*) echo "They appear to be: $cppflags";;
- esac
- $rm -f cpp.c cpp?.out
+ version=`echo $baserev $patchlevel $subversion | \
+ $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
+ api_versionstring=`echo $api_revision $api_version $api_subversion | \
+ $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
;;
esac
+: Special case the 5.005_xx maintenance series, which used 5.005
+: without any subversion label as a subdirectory in $sitelib
+if test "${api_revision}${api_version}${api_subversion}" = "550"; then
+ api_versionstring='5.005'
+fi
-: flags used in final linking phase
-case "$ldflags" in
-'') if ./venix; then
- dflt='-i -z'
- else
- dflt=''
- fi
- case "$ccflags" in
- *-posix*) dflt="$dflt -posix" ;;
+: determine installation style
+: For now, try to deduce it from prefix unless it is already set.
+: Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
+case "$installstyle" in
+'') case "$prefix" in
+ *perl*) dflt='lib';;
+ *) dflt='lib/perl5' ;;
esac
;;
-*) dflt="$ldflags";;
+*) dflt='lib/perl5' ;;
esac
+: Probably not worth prompting for this since we prompt for all
+: the directories individually, and the prompt would be too long and
+: confusing anyway.
+installstyle=$dflt
-: Try to guess additional flags to pick up local libraries.
-for thislibdir in $libpth; do
- case " $loclibpth " in
- *" $thislibdir "*)
- case "$dflt " in
- *"-L$thislibdir "*) ;;
- *) dflt="$dflt -L$thislibdir" ;;
- esac
- ;;
- esac
-done
-
-case "$dflt" in
-'') dflt='none' ;;
+: determine where private library files go
+: Usual default is /usr/local/lib/perl5/$version.
+: Also allow things like /opt/perl/lib/$version, since
+: /opt/perl/lib/perl5... would be redundant.
+: The default "style" setting is made in installstyle.U
+case "$installstyle" in
+*lib/perl5*) set dflt privlib lib/$package/$version ;;
+*) set dflt privlib lib/$version ;;
esac
+eval $prefixit
+$cat <<EOM
-$cat <<EOH
-
-Your C linker may need flags. For this question you should
-include -L/whatever and any other flags used by the C linker, but you
-should NOT include libraries like -lwhatever.
+There are some auxiliary files for $package that need to be put into a
+private library directory that is accessible by everyone.
-Make sure you include the appropriate -L/path flags if your C linker
-does not normally search all of the directories you specified above,
-namely
- $libpth
-To use no flags, specify the word "none".
+EOM
+fn=d~+
+rp='Pathname where the private library files will reside?'
+. ./getfile
+privlib="$ans"
+privlibexp="$ansexp"
+: Change installation prefix, if necessary.
+if $test X"$prefix" != X"$installprefix"; then
+ installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
+else
+ installprivlib="$privlibexp"
+fi
-EOH
+: set the prefixup variable, to restore leading tilda escape
+prefixup='case "$prefixexp" in
+"$prefix") ;;
+*) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
+esac'
-rp="Any additional ld flags (NOT including libraries)?"
-. ./myread
-case "$ans" in
-none) ldflags='';;
-*) ldflags="$ans";;
+: determine where public architecture dependent libraries go
+set archlib archlib
+eval $prefixit
+: privlib default is /usr/local/lib/$package/$version
+: archlib default is /usr/local/lib/$package/$version/$archname
+: privlib may have an optional trailing /share.
+tdflt=`echo $privlib | $sed 's,/share$,,'`
+tdflt=$tdflt/$archname
+case "$archlib" in
+'') dflt=$tdflt
+ ;;
+*) dflt="$archlib"
+ ;;
esac
-rmlist="$rmlist pdp11"
+$cat <<EOM
-: coherency check
-echo " "
-echo "Checking your choice of C compiler and flags for coherency..." >&4
-$cat > try.c <<'EOF'
-#include <stdio.h>
-int main() { printf("Ok\n"); exit(0); }
-EOF
-set X $cc $optimize $ccflags -o try $ldflags try.c $libs
-shift
-$cat >try.msg <<'EOM'
-I've tried to compile and run the following simple program:
+$spackage contains architecture-dependent library files. If you are
+sharing libraries in a heterogeneous environment, you might store
+these files in a separate location. Otherwise, you can just include
+them with the rest of the public library files.
EOM
-$cat try.c >> try.msg
+fn=d+~
+rp='Where do you want to put the public architecture-dependent libraries?'
+. ./getfile
+archlib="$ans"
+archlibexp="$ansexp"
+if $test X"$archlib" = X"$privlib"; then
+ d_archlib="$undef"
+else
+ d_archlib="$define"
+fi
+: Change installation prefix, if necessary.
+if $test X"$prefix" != X"$installprefix"; then
+ installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
+else
+ installarchlib="$archlibexp"
+fi
-$cat >> try.msg <<EOM
-I used the command:
+: Binary compatibility with 5.005 is not possible for builds
+: with advanced features
+case "$usethreads$usemultiplicity" in
+*define*)
+ bincompat5005="$undef"
+ d_bincompat5005="$undef"
+ ;;
+*) $cat <<EOM
- $*
- ./try
+Perl 5.006 can be compiled for binary compatibility with 5.005.
+If you decide to do so, you will be able to continue using most
+of the extensions that were compiled for Perl 5.005.
-and I got the following output:
+EOM
+ case "$bincompat5005$d_bincompat5005" in
+ *"$undef"*) dflt=n ;;
+ *) dflt=y ;;
+ esac
+ rp='Binary compatibility with Perl 5.005?'
+ . ./myread
+ case "$ans" in
+ y*) val="$define" ;;
+ *) val="$undef" ;;
+ esac
+ set d_bincompat5005
+ eval $setvar
+ case "$d_bincompat5005" in
+ "$define")
+ bincompat5005="$define"
+ ;;
+ *) bincompat5005="$undef"
+ d_bincompat5005="$undef"
+ ;;
+ esac
+ ;;
+esac
+
+
+: see if setuid scripts can be secure
+$cat <<EOM
+
+Some kernels have a bug that prevents setuid #! scripts from being
+secure. Some sites have disabled setuid #! scripts because of this.
+
+First let's decide if your kernel supports secure setuid #! scripts.
+(If setuid #! scripts would be secure but have been disabled anyway,
+don't say that they are secure if asked.)
EOM
-dflt=y
-if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
- if sh -c './try' >>try.msg 2>&1; then
- xxx=`./try`
- case "$xxx" in
- "Ok") dflt=n ;;
- *) echo 'The program compiled OK, but produced no output.' >> try.msg
- case " $libs " in
- *" -lsfio "*)
- cat >> try.msg <<'EOQS'
-If $libs contains -lsfio, and sfio is mis-configured, then it
-sometimes (apparently) runs and exits with a 0 status, but with no
-output! It may have to do with sfio's use of _exit vs. exit.
-EOQS
- rp="You have a big problem. Shall I abort Configure"
- dflt=y
- ;;
+val="$undef"
+if $test -d /dev/fd; then
+ echo "#!$ls" >reflect
+ chmod +x,u+s reflect
+ ./reflect >flect 2>&1
+ if $contains "/dev/fd" flect >/dev/null; then
+ echo "Congratulations, your kernel has secure setuid scripts!" >&4
+ val="$define"
+ else
+ $cat <<EOM
+If you are not sure if they are secure, I can check but I'll need a
+username and password different from the one you are using right now.
+If you don't have such a username or don't want me to test, simply
+enter 'none'.
+
+EOM
+ rp='Other username to test security of setuid scripts with?'
+ dflt='none'
+ . ./myread
+ case "$ans" in
+ n|none)
+ case "$d_suidsafe" in
+ '') echo "I'll assume setuid scripts are *not* secure." >&4
+ dflt=n;;
+ "$undef")
+ echo "Well, the $hint value is *not* secure." >&4
+ dflt=n;;
+ *) echo "Well, the $hint value *is* secure." >&4
+ dflt=y;;
esac
;;
+ *)
+ $rm -f reflect flect
+ echo "#!$ls" >reflect
+ chmod +x,u+s reflect
+ echo >flect
+ chmod a+w flect
+ echo '"su" will (probably) prompt you for '"$ans's password."
+ su $ans -c './reflect >flect'
+ if $contains "/dev/fd" flect >/dev/null; then
+ echo "Okay, it looks like setuid scripts are secure." >&4
+ dflt=y
+ else
+ echo "I don't think setuid scripts are secure." >&4
+ dflt=n
+ fi
+ ;;
+ esac
+ rp='Does your kernel have *secure* setuid scripts?'
+ . ./myread
+ case "$ans" in
+ [yY]*) val="$define";;
+ *) val="$undef";;
esac
- else
- echo "The program compiled OK, but exited with status $?." >>try.msg
- rp="You have a problem. Shall I abort Configure"
- dflt=y
fi
else
- echo "I can't compile the test program." >>try.msg
- rp="You have a BIG problem. Shall I abort Configure"
- dflt=y
+ echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
+ echo "(That's for file descriptors, not floppy disks.)"
+ val="$undef"
fi
-case "$dflt" in
-y)
- $cat try.msg >&4
- case "$knowitall" in
- '')
- echo "(The supplied flags or libraries might be incorrect.)"
- ;;
- *) dflt=n;;
+set d_suidsafe
+eval $setvar
+
+$rm -f reflect flect
+
+: now see if they want to do setuid emulation
+echo " "
+val="$undef"
+case "$d_suidsafe" in
+"$define")
+ val="$undef"
+ echo "No need to emulate SUID scripts since they are secure here." >& 4
+ ;;
+*)
+ $cat <<EOM
+Some systems have disabled setuid scripts, especially systems where
+setuid scripts cannot be secure. On systems where setuid scripts have
+been disabled, the setuid/setgid bits on scripts are currently
+useless. It is possible for $package to detect those bits and emulate
+setuid/setgid in a secure fashion. This emulation will only work if
+setuid scripts have been disabled in your kernel.
+
+EOM
+ case "$d_dosuid" in
+ "$define") dflt=y ;;
+ *) dflt=n ;;
esac
- echo " "
+ rp="Do you want to do setuid/setgid emulation?"
. ./myread
case "$ans" in
- n*|N*) ;;
- *) echo "Ok. Stopping Configure." >&4
- exit 1
- ;;
+ [yY]*) val="$define";;
+ *) val="$undef";;
esac
;;
-n) echo "OK, that should do.";;
esac
-$rm -f try try.* core
+set d_dosuid
+eval $setvar
: determine filename position in cpp output
echo " "
;;
*) d_vendorlib="$define"
: determine where vendor-supplied modules go.
- : Usual default is /usr/local/lib/perl5/vendor_perl
+ : Usual default is /usr/local/lib/perl5/vendor_perl/$version
prog=`echo $package | $sed 's/-*[0-9.]*$//'`
case "$installstyle" in
- *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog ;;
- *) dflt=$vendorprefix/lib/vendor_$prog ;;
+ *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
+ *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
esac
fn=d~+
rp='Pathname for the vendor-supplied library files?'
installbin="$binexp"
fi
+$cat <<EOM
+
+After $package is installed, you may wish to install various
+add-on modules and utilities. Typically, these add-ons will
+be installed under $prefix with the rest
+of this package. However, you may wish to install such add-ons
+elsewhere under a different prefix.
+
+If you do not wish to put everything under a single prefix, that's
+ok. You will be prompted for the individual locations; this siteprefix
+is only used to suggest the defaults.
+
+The default should be fine for most people.
+
+EOM
+fn=d~+
+rp='Installation prefix to use for add-on modules and utilities?'
+: XXX Here might be another good place for an installstyle setting.
+case "$siteprefix" in
+'') dflt=$prefix ;;
+*) dflt=$siteprefix ;;
+esac
+. ./getfile
+oldsiteprefix=''
+case "$siteprefix" in
+'') ;;
+*)
+ case "$ans" in
+ "$prefix") ;;
+ *) oldsiteprefix="$prefix";;
+ esac
+ ;;
+esac
+siteprefix="$ans"
+siteprefixexp="$ansexp"
+
+: determine where site specific libraries go.
+: Usual default is /usr/local/lib/perl5/site_perl/$version
+: The default "style" setting is made in installstyle.U
+: XXX No longer works with Prefixit stuff.
+prog=`echo $package | $sed 's/-*[0-9.]*$//'`
+case "$installstyle" in
+*lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
+*) dflt=$siteprefix/lib/site_$prog/$version ;;
+esac
+$cat <<EOM
+
+The installation process will create a directory for
+site-specific extensions and modules. Most users find it convenient
+to place all site-specific files in this directory rather than in the
+main distribution directory.
+
+EOM
+fn=d~+
+rp='Pathname for the site-specific library files?'
+. ./getfile
+sitelib="$ans"
+sitelibexp="$ansexp"
+: Change installation prefix, if necessary.
+if $test X"$prefix" != X"$installprefix"; then
+ installsitelib=`echo $sitelibexp | sed "s#^$prefix#$installprefix#"`
+else
+ installsitelib="$sitelibexp"
+fi
+
+: Determine list of previous versions to include in @INC
+$cat > getverlist <<EOPL
+#!$perl -w
+use File::Basename;
+\$api_versionstring = "$api_versionstring";
+\$version = "$version";
+\$sitelib = "$sitelib";
+\$archname = "$archname";
+EOPL
+ $cat >> getverlist <<'EOPL'
+# Can't have leading @ because metaconfig interprets it as a command!
+;@inc_version_list=();
+$stem=dirname($sitelib);
+# Redo to do opendir/readdir?
+if (-d $stem) {
+ chdir($stem);
+ ;@candidates = glob("5.*");
+}
+else {
+ ;@candidates = ();
+}
+
+# XXX ToDo: These comparisons must be reworked when two-digit
+# subversions come along, so that 5.7.10 compares as greater than
+# 5.7.3! By that time, hope that 5.6.x is sufficiently
+# widespread that we can use the built-in version vectors rather
+# than reinventing them here. For 5.6.0, however, we must
+# assume this script will likely be run by 5.005_0x. --AD 1/2000.
+foreach $d (@candidates) {
+ if ($d lt $version) {
+ if ($d ge $api_versionstring) {
+ unshift(@inc_version_list, "$d/$archname", $d);
+ }
+ elsif ($d ge "5.005") {
+ unshift(@inc_version_list, $d);
+ }
+ }
+ else {
+ # Skip newer version. I.e. don't look in
+ # 5.7.0 if we're installing 5.6.1.
+ }
+}
+
+if (@inc_version_list) {
+ print '"';
+ print join('", "', @inc_version_list);
+ print '"';
+}
+else {
+ # Blank space to preserve value for next Configure run.
+ print " ";
+}
+EOPL
+chmod +x getverlist
+case "$inc_version_list" in
+'') if test -x $perl; then
+ dflt=`$perl getverlist`
+ else
+ dflt=''
+ fi
+ ;;
+*) dflt="$inc_version_list" ;;
+esac
+$cat <<'EOM'
+
+In order to ease the process of upgrading, this version of perl
+can be configured to use modules built and installed with earlier
+versions of perl that were installed under $prefix. Specify here
+the list of earlier versions that this version of perl should check.
+If Configure detected no earlier versions of perl installed under
+$prefix, then the list will be empty.
+
+The default should almost always be sensible, so if you're not sure,
+just accept the default.
+EOM
+
+rp='list of earlier versions to include in @INC?'
+. ./myread
+inc_version_list="$ans"
+$rm -f getverlist
+
: determine whether to install perl also as /usr/bin/perl
echo " "
set installusrbinperl
eval $setvar
-: define a shorthand compile call
-compile='
-mc_file=$1;
-shift;
-$cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
-: define a shorthand compile call for compilations that should be ok.
-compile_ok='
-mc_file=$1;
-shift;
-$cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
-
echo " "
echo "Checking for GNU C Library..." >&4
cat >gnulibc.c <<EOM
;;
*) case "$useshrplib" in
'') case "$osname" in
- svr4*|dgux|dynixptx|esix|powerux|beos)
+ svr4*|dgux|dynixptx|esix|powerux|beos|cygwin*)
dflt=y
also='Building a shared libperl is required for dynamic loading to work on your system.'
;;
linux*) # ld won't link with a bare -lperl otherwise.
dflt=libperl.$so
;;
+ cygwin*) # include version
+ dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
+ ;;
*) # Try to guess based on whether libc has major.minor.
case "$libc" in
*libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
esac
fi
case "$hostcat" in
-'') hostcat='cat /etc/hosts';;
+'') test -f /etc/hosts && hostcat='cat /etc/hosts';;
esac
case "$groupcat" in
-'') groupcat='cat /etc/group';;
+'') test -f /etc/group && groupcat='cat /etc/group';;
esac
case "$passcat" in
-'') passcat='cat /etc/passwd';;
+'') test -f /etc/passwd && passcat='cat /etc/passwd';;
esac
: now get the host name
$sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
$test -s hosts
} || {
+ test "X$hostcat" != "X" &&
$hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
/[ ]$myhostname[ . ]/p" > hosts
}
installscript=''
fi
scriptdir="$ans"
-scriptdirexp="$ansexp"
-: Change installation prefix, if necessary.
-if $test X"$prefix" != X"$installprefix"; then
- installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
-else
- installscript="$scriptdirexp"
-fi
-
-$cat <<EOM
-
-After $package is installed, you may wish to install various
-add-on modules and utilities. Typically, these add-ons will
-be installed under $prefix with the rest
-of this package. However, you may wish to install such add-ons
-elsewhere under a different prefix.
-
-If you do not wish to put everything under a single prefix, that's
-ok. You will be prompted for the individual locations; this siteprefix
-is only used to suggest the defaults.
-
-The default should be fine for most people.
-
-EOM
-fn=d~+
-rp='Installation prefix to use for add-on modules and utilities?'
-: XXX Here might be another good place for an installstyle setting.
-case "$siteprefix" in
-'') dflt=$prefix ;;
-*) dflt=$siteprefix ;;
-esac
-. ./getfile
-oldsiteprefix=''
-case "$siteprefix" in
-'') ;;
-*)
- case "$ans" in
- "$prefix") ;;
- *) oldsiteprefix="$prefix";;
- esac
- ;;
-esac
-siteprefix="$ans"
-siteprefixexp="$ansexp"
-
-: determine where site specific libraries go.
-: Usual default is /usr/local/lib/perl5/site_perl
-: The default "style" setting is made in installstyle.U
-: XXX No longer works with Prefixit stuff.
-prog=`echo $package | $sed 's/-*[0-9.]*$//'`
-case "$installstyle" in
-*lib/perl5*) dflt=$siteprefix/lib/site_$prog ;;
-*) dflt=$siteprefix/lib/site_$prog ;;
-esac
-$cat <<EOM
-
-The installation process will create a directory for
-site-specific extensions and modules. Most users find it convenient
-to place all site-specific files in this directory rather than in the
-main distribution directory.
-
-EOM
-fn=d~+
-rp='Pathname for the site-specific library files?'
-. ./getfile
-sitelib="$ans"
-sitelibexp="$ansexp"
+scriptdirexp="$ansexp"
: Change installation prefix, if necessary.
if $test X"$prefix" != X"$installprefix"; then
- installsitelib=`echo $sitelibexp | sed "s#^$prefix#$installprefix#"`
+ installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
else
- installsitelib="$sitelibexp"
+ installscript="$scriptdirexp"
fi
: determine where site specific architecture-dependent libraries go.
-: sitelib default is /usr/local/lib/perl5/site_perl/
-: sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
+: sitelib default is /usr/local/lib/perl5/site_perl/$version
+: sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
: sitelib may have an optional trailing /share.
tdflt=`echo $sitelib | $sed 's,/share$,,'`
-tdflt="$tdflt/$apiversion/$archname"
+tdflt="$tdflt/$archname"
set sitearch sitearch none
eval $prefixit
case "$sitearch" in
installsitearch="$sitearchexp"
fi
+: determine where add-on public executables go
+case "$sitebin" in
+'') dflt=$siteprefix/bin ;;
+*) dflt=$sitebin ;;
+esac
+fn=d~
+rp='Pathname where the add-on public executables should be installed?'
+. ./getfile
+sitebin="$ans"
+sitebinexp="$ansexp"
+: Change installation prefix, if necessary.
+if $test X"$prefix" != X"$installprefix"; then
+ installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
+else
+ installsitebin="$sitebinexp"
+fi
+
cat <<EOM
Perl can be built to take advantage of long doubles which
-(if available) may give more accuracy and range for floating point
-numbers. To do so, Configure must be run with -Duselongdouble.
+(if available) may give more accuracy and range for floating point numbers.
If this doesn't make any sense to you, just accept the default 'n'.
EOM
+
+case "$ccflags" in
+*-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
+esac
+
case "$uselongdouble" in
$define|true|[yY]*) dflt='y';;
*) dflt='n';;
eval $setvar
case "$uselongdouble" in
-"$define"|true|[yY]*)
-: Look for a hint-file generated 'call-back-unit'. If the
-: user has specified that long doubles should be used,
-: we may need to set or change some other defaults.
- if $test -f uselongdouble.cbu; then
- echo "Your platform has some specific hints for long doubles, using them..."
- . ./uselongdouble.cbu
- else
- $cat <<EOM
-(Your platform doesn't have any specific hints for long doubles.)
-EOM
- fi
- ;;
-esac
-
-cat <<EOM
-
-Previous version of $package used the standard IO mechanisms as defined
-in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
-mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
-the default. This abstraction layer can use AT&T's sfio (if you already
-have sfio installed) or regular stdio. Using PerlIO with sfio may cause
-problems with some extension modules. Using PerlIO with stdio is safe,
-but it is slower than plain stdio and therefore is not the default.
-
-If this doesn't make any sense to you, just accept the default 'n'.
-EOM
-case "$useperlio" in
-$define|true|[yY]*) dflt='y';;
-*) dflt='n';;
-esac
-rp='Use the experimental PerlIO abstraction layer?'
-. ./myread
-case "$ans" in
-y|Y)
- val="$define"
- ;;
-*)
- echo "Ok, doing things the stdio way"
- val="$undef"
- ;;
-esac
-set useperlio
-eval $setvar
-
-: Check how to convert floats to strings.
-if test "X$d_Gconvert" = X; then
- echo " "
- echo "Checking for an efficient way to convert floats to strings."
- $cat >try.c <<'EOP'
-#ifdef TRY_gconvert
-#define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
-char *myname = "gconvert";
-#endif
-#ifdef TRY_gcvt
-#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
-char *myname = "gcvt";
-#endif
-#ifdef TRY_sprintf
-#define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
-char *myname = "sprintf";
-#endif
-
-#include <stdio.h>
-
-int
-checkit(expect, got)
-char *expect;
-char *got;
-{
- if (strcmp(expect, got)) {
- printf("%s oddity: Expected %s, got %s\n",
- myname, expect, got);
- exit(1);
- }
-}
-
-int main()
-{
- char buf[64];
- buf[63] = '\0';
-
- /* This must be 1st test on (which?) platform */
- /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
- Gconvert(0.1, 8, 0, buf);
- checkit("0.1", buf);
-
- Gconvert(1.0, 8, 0, buf);
- checkit("1", buf);
-
- Gconvert(0.0, 8, 0, buf);
- checkit("0", buf);
-
- Gconvert(-1.0, 8, 0, buf);
- checkit("-1", buf);
-
- /* Some Linux gcvt's give 1.e+5 here. */
- Gconvert(100000.0, 8, 0, buf);
- checkit("100000", buf);
-
- /* Some Linux gcvt's give -1.e+5 here. */
- Gconvert(-100000.0, 8, 0, buf);
- checkit("-100000", buf);
-
- exit(0);
-}
-EOP
- case "$d_Gconvert" in
- gconvert*) xxx_list='gconvert gcvt sprintf' ;;
- gcvt*) xxx_list='gcvt gconvert sprintf' ;;
- sprintf*) xxx_list='sprintf gconvert gcvt' ;;
- *) xxx_list='gconvert gcvt sprintf' ;;
- esac
-
- for xxx_convert in $xxx_list; do
- echo "Trying $xxx_convert"
- $rm -f try try$_o
- set try -DTRY_$xxx_convert
- if eval $compile; then
- echo "$xxx_convert" found. >&4
- if ./try; then
- echo "I'll use $xxx_convert to convert floats into a string." >&4
- break;
- else
- echo "...But $xxx_convert didn't work as I expected."
- fi
- else
- echo "$xxx_convert NOT found." >&4
- fi
- done
-
- case "$xxx_convert" in
- gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
- gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
- *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
- esac
-fi
-
-: see if inttypes.h is available
-: we want a real compile instead of Inhdr because some systems
-: have an inttypes.h which includes non-existent headers
-echo " "
-$cat >try.c <<EOCP
-#include <inttypes.h>
-int main() {
- static int32_t foo32 = 0x12345678;
-}
-EOCP
-set try
-if eval $compile; then
- echo "<inttypes.h> found." >&4
- val="$define"
-else
- echo "<inttypes.h> NOT found." >&4
- val="$undef"
-fi
-$rm -f try.c try
-set i_inttypes
-eval $setvar
-
-: check for int64_t
-case "$use64bits" in
-"$define" )
- echo " "
- echo $n "Checking to see if your system supports int64_t...$c" >&4
- $cat >try.c <<EOCP
-#include <sys/types.h>
-#$i_inttypes I_INTTYPES
-#ifdef I_INTTYPES
-#include <inttypes.h>
-#endif
-int64_t foo() { int64_t x; x = 7; return x; }
-EOCP
- if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
- val="$define"
- echo " Yup, it does." >&4
- else
- val="$undef"
- echo " Nope, it doesn't." >&4
- fi
- $rm -f try.*
- ;;
-*) val="$undef"
- ;;
-esac
-set d_int64t
-eval $setvar
-
-
-: check for lengths of integral types
-echo " "
-case "$intsize" in
-'')
- echo "Checking to see how big your integers are..." >&4
- $cat >intsize.c <<'EOCP'
-#include <stdio.h>
-int main()
-{
- printf("intsize=%d;\n", sizeof(int));
- printf("longsize=%d;\n", sizeof(long));
- printf("shortsize=%d;\n", sizeof(short));
- exit(0);
-}
-EOCP
- set intsize
- if eval $compile_ok && ./intsize > /dev/null; then
- eval `./intsize`
- echo "Your integers are $intsize bytes long."
- echo "Your long integers are $longsize bytes long."
- echo "Your short integers are $shortsize bytes long."
- else
- $cat >&4 <<EOM
-!
-Help! I can't compile and run the intsize test program: please enlighten me!
-(This is probably a misconfiguration in your system or libraries, and
-you really ought to fix it. Still, I'll try anyway.)
-!
-EOM
- dflt=4
- rp="What is the size of an integer (in bytes)?"
- . ./myread
- intsize="$ans"
- dflt=$intsize
- rp="What is the size of a long integer (in bytes)?"
- . ./myread
- longsize="$ans"
- dflt=2
- rp="What is the size of a short integer (in bytes)?"
- . ./myread
- shortsize="$ans"
- fi
- ;;
+true|[yY]*) uselongdouble="$define" ;;
esac
-$rm -f intsize intsize.*
-
-: check for long long
-echo " "
-echo $n "Checking to see if your system supports long long...$c" >&4
-echo 'long long foo() { long long x; x = 7; return x; }' > try.c
-if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
- val="$define"
- echo " Yup, it does." >&4
-else
- val="$undef"
- echo " Nope, it doesn't." >&4
-fi
-$rm try.*
-set d_longlong
-eval $setvar
-: check for length of long long
-case "${d_longlong}${longlongsize}" in
-$define)
- echo " "
- $echo $n "Checking to see how big your long longs are...$c" >&4
- $cat >try.c <<'EOCP'
-#include <stdio.h>
-int main()
-{
- printf("%d\n", sizeof(long long));
-}
-EOCP
- set try
- if eval $compile_ok; then
- longlongsize=`./try`
- $echo " $longlongsize bytes." >&4
+case "$uselongdouble" in
+$define)
+: Look for a hint-file generated 'call-back-unit'. If the
+: user has specified that long doubles should be used,
+: we may need to set or change some other defaults.
+ if $test -f uselongdouble.cbu; then
+ echo "Your platform has some specific hints for long doubles, using them..."
+ . ./uselongdouble.cbu
else
- dflt='8'
- echo " "
- echo "(I can't seem to compile the test program. Guessing...)"
- rp="What is the size of a long long (in bytes)?"
- . ./myread
- longlongsize="$ans"
+ $cat <<EOM
+(Your platform doesn't have any specific hints for long doubles.)
+EOM
fi
- if $test "X$longsize" = "X$longlongsize"; then
- echo "(That isn't any different from an ordinary long.)"
- fi
;;
esac
-$rm -f try.c try
-
-echo " "
-
-if $test X"$intsize" = X8 -o X"$longsize" = X8 -o X"$d_int64t" = X"$define" -o X"$d_longlong" = X"$define"; then
-echo "Checking how to print 64-bit integers..." >&4
+cat <<EOM
-if $test X"$sPRId64" = X -a X"$intsize" = X8; then
- quad=int
- $cat >try.c <<'EOCP'
-#include <sys/types.h>
-#include <stdio.h>
-int main() {
- int q = 12345678901;
- printf("%ld\n", q);
-}
-EOCP
- set try
- if eval $compile; then
- yyy=`./try$exe_ext`
- case "$yyy" in
- 12345678901)
- sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
- sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
- echo "We will use %d."
- ;;
- esac
- fi
-fi
+Perl can be built to take advantage of long longs which
+(if available) may give more range for integer numbers.
-if $test X"$sPRId64" = X -a X"$longsize" = X8; then
- quad=long
- $cat >try.c <<'EOCP'
-#include <sys/types.h>
-#include <stdio.h>
-int main() {
- long q = 12345678901;
- printf("%ld\n", q);
-}
-EOCP
- set try
- if eval $compile; then
- yyy=`./try$exe_ext`
- case "$yyy" in
- 12345678901)
- sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
- sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
- echo "We will use %ld."
- ;;
- esac
- fi
-fi
+If this doesn't make any sense to you, just accept the default 'n'.
+EOM
-if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$d_int64t" = X"$define"; then
- quad=int64_t
- $cat >try.c <<'EOCP'
-#include <sys/types.h>
-#include <inttypes.h>
-#include <stdio.h>
-int main() {
- int64_t q = 12345678901;
- printf("%" PRId64 "\n", q);
-}
-EOCP
- set try
- if eval $compile; then
- yyy=`./try$exe_ext`
- case "$yyy" in
- 12345678901)
- sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
- sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
- echo "We will use the C9X style."
- ;;
- esac
- fi
-fi
+case "$ccflags" in
+*-DUSE_LONG_LONG*) uselonglong="$define" ;;
+esac
-if $test X"$sPRId64" = X -a X"$d_longlong" = X"$define" -a X"$longlongsize" = X8; then
- quad="long long"
- $cat >try.c <<'EOCP'
-#include <sys/types.h>
-#include <stdio.h>
-int main() {
- long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
- printf("%lld\n", q);
-}
-EOCP
- set try
- if eval $compile; then
- yyy=`./try$exe_ext`
- case "$yyy" in
- 12345678901)
- sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
- sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
- echo "We will use the %lld style."
- ;;
- esac
- fi
-fi
+case "$uselonglong" in
+$define|true|[yY]*) dflt='y';;
+*) dflt='n';;
+esac
+rp='Try to use long longs if available?'
+. ./myread
+case "$ans" in
+y|Y) val="$define" ;;
+*) val="$undef" ;;
+esac
+set uselonglong
+eval $setvar
-if $test X"$sPRId64" = X -a X"$quad" != X; then
- $cat >try.c <<EOCP
-#include <sys/types.h>
-#include <stdio.h>
-int main() {
- $quad q = 12345678901;
- printf("%Ld\n", q);
-}
-EOCP
- set try
- if eval $compile; then
- yyy=`./try$exe_ext`
- case "$yyy" in
- 12345678901)
- sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
- sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
- echo "We will use %lld."
- ;;
- esac
- fi
-fi
+case "$uselonglong" in
+true|[yY]*) uselonglong="$define" ;;
+esac
-if $test X"$sPRId64" = X -a X"$quad" != X; then
- $cat >try.c <<EOCP
-#include <sys/types.h>
-#include <stdio.h>
-int main() {
- $quad q = 12345678901;
- printf("%qd\n", q);
-}
-EOCP
- set try
- if eval $compile; then
- yyy=`./try$exe_ext`
- case "$yyy" in
- 12345678901)
- sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
- sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
- echo "We will use %qd."
- ;;
- esac
+case "$uselonglong" in
+$define)
+: Look for a hint-file generated 'call-back-unit'. If the
+: user has specified that long longs should be used,
+: we may need to set or change some other defaults.
+ if $test -f uselonglong.cbu; then
+ echo "Your platform has some specific hints for long longs, using them..."
+ . ./uselonglong.cbu
+ else
+ $cat <<EOM
+(Your platform doesn't have any specific hints for long longs.)
+EOM
fi
-fi
+ ;;
+esac
-if $test X"$sPRId64" = X; then
- echo "Cannot figure out how to print 64-bit integers." >&4
-fi
+cat <<EOM
-$rm -f try try.*
+Previous version of $package used the standard IO mechanisms as defined
+in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
+mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
+the default. This abstraction layer can use AT&T's sfio (if you already
+have sfio installed) or regular stdio. Using PerlIO with sfio may cause
+problems with some extension modules. Using PerlIO with stdio is safe,
+but it is slower than plain stdio and therefore is not the default.
-fi # intsize -o longsize -o d_int64t -o d_longlong
+If this doesn't make any sense to you, just accept the default 'n'.
+EOM
+case "$useperlio" in
+$define|true|[yY]*) dflt='y';;
+*) dflt='n';;
+esac
+rp='Use the experimental PerlIO abstraction layer?'
+. ./myread
+case "$ans" in
+y|Y)
+ val="$define"
+ ;;
+*)
+ echo "Ok, doing things the stdio way"
+ val="$undef"
+ ;;
+esac
+set useperlio
+eval $setvar
-case "$sPRId64" in
-'') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
- d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
+case "$vendorprefix" in
+'') d_vendorbin="$undef"
+ vendorbin=''
+ vendorbinexp=''
;;
-*) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
- d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
+*) d_vendorbin="$define"
+ : determine where vendor-supplied executables go.
+ dflt=$vendorprefix/bin
+ fn=d~+
+ rp='Pathname for the vendor-supplied executables directory?'
+ . ./getfile
+ vendorbin="$ans"
+ vendorbinexp="$ansexp"
+ : Change installation prefix, if necessary.
+ if $test X"$prefix" != X"$installprefix"; then
+ installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
+ else
+ installvendorbin="$vendorbinexp"
+ fi
;;
esac
#include <stdio.h>
int main()
{
- printf("%d\n", sizeof(double));
+ printf("%d\n", (int)sizeof(double));
+ exit(0);
}
EOCP
set try
: check for long doubles
echo " "
-echo $n "Checking to see if your system supports long double...$c" >&4
-echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
-if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
+$echo $n "Checking to see if your system supports long double..." $c >&4
+echo 'int main() { long double x = 7.0; }' > try.c
+set try
+if eval $compile; then
val="$define"
- echo " Yup, it does." >&4
+ echo " Yes, it does." >&4
else
val="$undef"
- echo " Nope, it doesn't." >&4
+ echo " No, it doesn't." >&4
fi
$rm try.*
set d_longdbl
case "${d_longdbl}${longdblsize}" in
$define)
echo " "
- $echo $n "Checking to see how big your long doubles are...$c" >&4
+ $echo $n "Checking to see how big your long doubles are..." $c >&4
$cat >try.c <<'EOCP'
#include <stdio.h>
-int main()
+int main()
+{
+ printf("%d\n", sizeof(long double));
+}
+EOCP
+ set try
+ set try
+ if eval $compile; then
+ longdblsize=`./try$exe_ext`
+ $echo " $longdblsize bytes." >&4
+ else
+ dflt='8'
+ echo " "
+ echo "(I can't seem to compile the test program. Guessing...)" >&4
+ rp="What is the size of a long double (in bytes)?"
+ . ./myread
+ longdblsize="$ans"
+ fi
+ if $test "X$doublesize" = "X$longdblsize"; then
+ echo "(That isn't any different from an ordinary double.)"
+ fi
+ ;;
+esac
+$rm -f try.* try
+
+: Check how to convert floats to strings.
+if test "X$d_Gconvert" = X; then
+ echo " "
+ echo "Checking for an efficient way to convert floats to strings."
+ $cat >try.c <<EOP
+#ifdef TRY_gconvert
+#define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
+char *myname = "gconvert";
+#endif
+#ifdef TRY_gcvt
+#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
+char *myname = "gcvt";
+#endif
+#ifdef TRY_qgcvt
+#define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
+char *myname = "qgcvt";
+#define DOUBLETYPE long double
+#endif
+#ifdef TRY_sprintf
+#define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
+char *myname = "sprintf";
+#endif
+
+#ifndef DOUBLETYPE
+#define DOUBLETYPE double
+#endif
+
+#include <stdio.h>
+
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+
+int
+checkit(expect, got)
+char *expect;
+char *got;
{
- printf("%d\n", sizeof(long double));
+ if (strcmp(expect, got)) {
+ printf("%s oddity: Expected %s, got %s\n",
+ myname, expect, got);
+ exit(1);
+ }
}
-EOCP
- set try
- if eval $compile; then
- longdblsize=`./try`
- $echo " $longdblsize bytes." >&4
- else
- dflt='8'
- echo " "
- echo "(I can't seem to compile the test program. Guessing...)" >&4
- rp="What is the size of a long double (in bytes)?"
- . ./myread
- longdblsize="$ans"
- fi
- if $test "X$doublesize" = "X$longdblsize"; then
- echo "(That isn't any different from an ordinary double.)"
- fi
- ;;
-esac
-$rm -f try.c try
+
+int main()
+{
+ char buf[64];
+ buf[63] = '\0';
+
+ /* This must be 1st test on (which?) platform */
+ /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
+ Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
+ checkit("0.1", buf);
+
+ Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
+ checkit("1", buf);
+
+ Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
+ checkit("0", buf);
+
+ Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
+ checkit("-1", buf);
+
+ /* Some Linux gcvt's give 1.e+5 here. */
+ Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
+ checkit("100000", buf);
+
+ /* Some Linux gcvt's give -1.e+5 here. */
+ Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
+ checkit("-100000", buf);
+
+ exit(0);
+}
+EOP
+ case "$d_Gconvert" in
+ gconvert*) xxx_list='gconvert gcvt sprintf' ;;
+ gcvt*) xxx_list='gcvt gconvert sprintf' ;;
+ sprintf*) xxx_list='sprintf gconvert gcvt' ;;
+ *) xxx_list='gconvert gcvt sprintf' ;;
+ esac
+
+ case "$d_longdbl$uselongdouble" in
+ definedefine) xxx_list="`echo $xxx_list|sed 's/gcvt/qgcvt gcvt/'`" ;;
+ esac
+
+ for xxx_convert in $xxx_list; do
+ echo "Trying $xxx_convert..."
+ $rm -f try try$_o
+ set try -DTRY_$xxx_convert
+ if eval $compile; then
+ echo "$xxx_convert() found." >&4
+ if ./try; then
+ echo "I'll use $xxx_convert to convert floats into a string." >&4
+ break;
+ else
+ echo "...But $xxx_convert didn't work as I expected."
+ fi
+ else
+ echo "$xxx_convert NOT found." >&4
+ fi
+ done
+
+ case "$xxx_convert" in
+ gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
+ gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
+ qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
+ *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
+ esac
+fi
echo " "
if (result)
exit(result);
signal(SIGFPE, blech_in_list);
- sprintf(str, "123.");
- sscanf(str, "%lf", &f); /* f = 123.; */
- along = dummy_long((unsigned long)f);
- aint = dummy_int((unsigned int)f);
- ashort = dummy_short((unsigned short)f);
- if (along != (unsigned long)123)
- result |= 4;
- if (aint != (unsigned int)123)
- result |= 4;
- if (ashort != (unsigned short)123)
- result |= 4;
- exit(result);
-
-}
-EOCP
-set try
-if eval $compile_ok; then
- ./try
- castflags=$?
-else
- echo "(I can't seem to compile the test program--assuming it can't)"
- castflags=7
-fi
-case "$castflags" in
-0) val="$define"
- echo "Yup, it can."
- ;;
-*) val="$undef"
- echo "Nope, it can't."
- ;;
-esac
-set d_castneg
-eval $setvar
-$rm -f try.*
-
-: see if vprintf exists
-echo " "
-if set vprintf val -f d_vprintf; eval $csym; $val; then
- echo 'vprintf() found.' >&4
- val="$define"
- $cat >vprintf.c <<'EOF'
-#include <varargs.h>
-
-int main() { xxx("foo"); }
-
-xxx(va_alist)
-va_dcl
-{
- va_list args;
- char buf[10];
-
- va_start(args);
- exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
-}
-EOF
- set vprintf
- if eval $compile && ./vprintf; then
- echo "Your vsprintf() returns (int)." >&4
- val2="$undef"
- else
- echo "Your vsprintf() returns (char*)." >&4
- val2="$define"
- fi
-else
- echo 'vprintf() NOT found.' >&4
- val="$undef"
- val2="$undef"
-fi
-set d_vprintf
-eval $setvar
-val=$val2
-set d_charvspr
-eval $setvar
-
-: see if chown exists
-set chown d_chown
-eval $inlibc
-
-: see if chroot exists
-set chroot d_chroot
-eval $inlibc
-
-: see if chsize exists
-set chsize d_chsize
-eval $inlibc
-
-hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
-while $test $# -ge 2; do
- case "$1" in
- $define) echo "#include <$2>";;
- esac ;
- shift 2;
-done > try.c;
-echo "int main () { struct $struct foo; foo.$field = 0; }" >> try.c;
-if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
- val="$define";
-else
- val="$undef";
-fi;
-set $varname;
-eval $setvar;
-$rm -f try.c try.o'
-
-: see if this is a sys/uio.h system
-set sys/uio.h i_sysuio
-eval $inhdr
-
-echo "Checking to see if your system supports struct iovec..." >&4
-set d_iovec_s iovec iov_base $i_sysuio sys/uio.h
-eval $hasfield
-case "$d_iovec_s" in
-"$define") echo "Yup, it does." >&4
- ;;
-*) echo "Nope, it doesn't." >&4
- ;;
-esac
-
-socketlib=''
-sockethdr=''
-: see whether socket exists
-echo " "
-$echo $n "Hmm... $c" >&4
-if set socket val -f d_socket; eval $csym; $val; then
- echo "Looks like you have Berkeley networking support." >&4
- d_socket="$define"
- if set setsockopt val -f; eval $csym; $val; then
- d_oldsock="$undef"
- else
- echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
- d_oldsock="$define"
- fi
-else
- if $contains socklib libc.list >/dev/null 2>&1; then
- echo "Looks like you have Berkeley networking support." >&4
- d_socket="$define"
- : we will have to assume that it supports the 4.2 BSD interface
- d_oldsock="$undef"
- else
- echo "You don't have Berkeley networking in libc$_a..." >&4
- if test "X$d_socket" = "X$define"; then
- echo "...but you seem to believe that you have sockets." >&4
- else
- for net in net socket
- do
- if test -f /usr/lib/lib$net$_a; then
- ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
- $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
- if $contains socket libc.list >/dev/null 2>&1; then
- d_socket="$define"
- socketlib="-l$net"
- case "$net" in
- net)
- echo "...but the Wollongong group seems to have hacked it in." >&4
- sockethdr="-I/usr/netinclude"
- ;;
- esac
- echo "Found Berkeley sockets interface in lib$net." >& 4
- if $contains setsockopt libc.list >/dev/null 2>&1; then
- d_oldsock="$undef"
- else
- echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
- d_oldsock="$define"
- fi
- break
- fi
- fi
- done
- if test "X$d_socket" != "X$define"; then
- echo "or anywhere else I see." >&4
- d_socket="$undef"
- d_oldsock="$undef"
- fi
- fi
- fi
+ sprintf(str, "123.");
+ sscanf(str, "%lf", &f); /* f = 123.; */
+ along = dummy_long((unsigned long)f);
+ aint = dummy_int((unsigned int)f);
+ ashort = dummy_short((unsigned short)f);
+ if (along != (unsigned long)123)
+ result |= 4;
+ if (aint != (unsigned int)123)
+ result |= 4;
+ if (ashort != (unsigned short)123)
+ result |= 4;
+ exit(result);
+
+}
+EOCP
+set try
+if eval $compile_ok; then
+ ./try
+ castflags=$?
+else
+ echo "(I can't seem to compile the test program--assuming it can't)"
+ castflags=7
fi
+case "$castflags" in
+0) val="$define"
+ echo "Yup, it can."
+ ;;
+*) val="$undef"
+ echo "Nope, it can't."
+ ;;
+esac
+set d_castneg
+eval $setvar
+$rm -f try.*
-: see if socketpair exists
-set socketpair d_sockpair
-eval $inlibc
+: see if vprintf exists
+echo " "
+if set vprintf val -f d_vprintf; eval $csym; $val; then
+ echo 'vprintf() found.' >&4
+ val="$define"
+ $cat >vprintf.c <<'EOF'
+#include <varargs.h>
+int main() { xxx("foo"); }
-echo " "
-echo "Checking the availability of certain socket constants..." >& 4
-for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
- enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
- $cat >try.c <<EOF
-#include <sys/types.h>
-#include <sys/socket.h>
-int main() {
- int i = $ENUM;
+xxx(va_alist)
+va_dcl
+{
+ va_list args;
+ char buf[10];
+
+ va_start(args);
+ exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
}
EOF
- val="$undef"
- set try; if eval $compile; then
- val="$define"
+ set vprintf
+ if eval $compile && ./vprintf; then
+ echo "Your vsprintf() returns (int)." >&4
+ val2="$undef"
+ else
+ echo "Your vsprintf() returns (char*)." >&4
+ val2="$define"
fi
- set d_${enum}; eval $setvar
- $rm -f try.c try
-done
+else
+ echo 'vprintf() NOT found.' >&4
+ val="$undef"
+ val2="$undef"
+fi
+set d_vprintf
+eval $setvar
+val=$val2
+set d_charvspr
+eval $setvar
-set sendmsg d_sendmsg
+: see if chown exists
+set chown d_chown
eval $inlibc
-set recvmsg d_recvmsg
+: see if chroot exists
+set chroot d_chroot
eval $inlibc
-echo " "
-$echo $n "Checking to see if your system supports struct msghdr...$c" >&4
-set d_msghdr_s msghdr msg_name define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
-eval $hasfield
-case "$d_msghdr_s" in
-"$define") echo "Yup, it does." >&4
- ;;
-*) echo "Nope, it doesn't." >&4
- ;;
-esac
-
-$echo $n "Checking to see if your system supports struct cmsghdr...$c" >&4
-set d_cmsghdr_s cmsghdr cmsg_len define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
-eval $hasfield
-case "$d_cmsghdr_s" in
-"$define") echo "Yup, it does." >&4
- ;;
-*) echo "Nope, it doesn't." >&4
- ;;
-esac
+: see if chsize exists
+set chsize d_chsize
+eval $inlibc
: check for const keyword
echo " "
eval $setvar
$rm -f open3*
+: see which of string.h or strings.h is needed
+echo " "
+strings=`./findhdr string.h`
+if $test "$strings" && $test -r "$strings"; then
+ echo "Using <string.h> instead of <strings.h>." >&4
+ val="$define"
+else
+ val="$undef"
+ strings=`./findhdr strings.h`
+ if $test "$strings" && $test -r "$strings"; then
+ echo "Using <strings.h> instead of <string.h>." >&4
+ else
+ echo "No string header found -- You'll surely have problems." >&4
+ fi
+fi
+set i_string
+eval $setvar
+case "$i_string" in
+"$undef") strings=`./findhdr strings.h`;;
+*) strings=`./findhdr string.h`;;
+esac
+
: check for non-blocking I/O stuff
case "$h_sysfile" in
true) echo "#include <sys/file.h>" > head.c;;
'')
$cat head.c > try.c
$cat >>try.c <<'EOCP'
+#include <stdio.h>
int main() {
#ifdef O_NONBLOCK
printf("O_NONBLOCK\n");
#include <errno.h>
#include <sys/types.h>
#include <signal.h>
+#include <stdio.h>
#define MY_O_NONBLOCK $o_nonblock
#ifndef errno /* XXX need better Configure test */
extern int errno;
#endif
+#$i_unistd I_UNISTD
+#ifdef I_UNISTD
+#include <unistd.h>
+#endif
+#ifdef $i_string
+#include <string.h>
+#else
+#include <strings.h>
+#endif
$signal_t blech(x) int x; { exit(3); }
EOCP
$cat >> try.c <<'EOCP'
set fcntl d_fcntl
eval $inlibc
+hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
+while $test $# -ge 2; do
+ case "$1" in
+ $define) echo "#include <$2>";;
+ esac ;
+ shift 2;
+done > try.c;
+echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
+set try;
+if eval $compile; then
+ val="$define";
+else
+ val="$undef";
+fi;
+set $varname;
+eval $setvar;
+$rm -f try.c try.o'
+
+socketlib=''
+sockethdr=''
+: see whether socket exists
+echo " "
+$echo $n "Hmm... $c" >&4
+if set socket val -f d_socket; eval $csym; $val; then
+ echo "Looks like you have Berkeley networking support." >&4
+ d_socket="$define"
+ if set setsockopt val -f; eval $csym; $val; then
+ d_oldsock="$undef"
+ else
+ echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
+ d_oldsock="$define"
+ fi
+else
+ if $contains socklib libc.list >/dev/null 2>&1; then
+ echo "Looks like you have Berkeley networking support." >&4
+ d_socket="$define"
+ : we will have to assume that it supports the 4.2 BSD interface
+ d_oldsock="$undef"
+ else
+ echo "You don't have Berkeley networking in libc$_a..." >&4
+ if test "X$d_socket" = "X$define"; then
+ echo "...but you seem to believe that you have sockets." >&4
+ else
+ for net in net socket
+ do
+ if test -f /usr/lib/lib$net$_a; then
+ ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
+ $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
+ if $contains socket libc.list >/dev/null 2>&1; then
+ d_socket="$define"
+ socketlib="-l$net"
+ case "$net" in
+ net)
+ echo "...but the Wollongong group seems to have hacked it in." >&4
+ sockethdr="-I/usr/netinclude"
+ ;;
+ esac
+ echo "Found Berkeley sockets interface in lib$net." >& 4
+ if $contains setsockopt libc.list >/dev/null 2>&1; then
+ d_oldsock="$undef"
+ else
+ echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
+ d_oldsock="$define"
+ fi
+ break
+ fi
+ fi
+ done
+ if test "X$d_socket" != "X$define"; then
+ echo "or anywhere else I see." >&4
+ d_socket="$undef"
+ d_oldsock="$undef"
+ fi
+ fi
+ fi
+fi
+
+: see if socketpair exists
+set socketpair d_sockpair
+eval $inlibc
+
+
+echo " "
+echo "Checking the availability of certain socket constants..." >& 4
+for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
+ enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
+ $cat >try.c <<EOF
+#include <sys/types.h>
+#include <sys/socket.h>
+int main() {
+ int i = $ENUM;
+}
+EOF
+ val="$undef"
+ set try; if eval $compile; then
+ val="$define"
+ fi
+ set d_${enum}; eval $setvar
+ $rm -f try.c try
+done
+
: see if sys/select.h has to be included
set sys/select.h i_sysselct
eval $inhdr
eval $inlibc
-: see if llseek exists
-set llseek d_llseek
-eval $inlibc
-
: check for off64_t
echo " "
-echo $n "Checking to see if your system supports off64_t...$c" >&4
+echo "Checking to see if your system supports off64_t..." >&4
$cat >try.c <<EOCP
#include <sys/types.h>
#include <unistd.h>
-off64_t foo() { off64_t x; x = 7; return x; }'
+int main() { off64_t x = 7; }'
EOCP
-if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
+set try
+if eval $compile; then
val="$define"
- echo " Yup, it does." >&4
+ echo "Yes, it does."
else
val="$undef"
- echo " Nope, it doesn't." >&4
+ echo "No, it doesn't."
+ case "$lseeksize" in
+ 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
+ esac
fi
-$rm -f try.*
+$rm -f try.* try
set d_off64_t
eval $setvar
: check for fpos64_t
echo " "
-echo $n "Checking to see if your system supports fpos64_t...$c" >&4
+echo "Checking to see if your system supports fpos64_t..." >&4
$cat >try.c <<EOCP
#include <sys/stdio.h>
-fpos64_t foo() { fpos64_t x; x = 7; return x; }'
+int main() { fpos64_t x x = 7; }'
EOCP
-if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
+set try
+if eval $compile; then
val="$define"
- echo " Yup, it does." >&4
+ echo "Yes, it does."
else
val="$undef"
- echo " Nope, it doesn't." >&4
+ echo "No, it doesn't."
+ case "$fpossize" in
+ 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
+ esac
fi
-$rm -f try.*
+$rm -f try.* try
set d_fpos64_t
eval $setvar
-: see if fseeko exists
-set fseeko d_fseeko
-eval $inlibc
-
-: see if fsetpos exists
-set fsetpos d_fsetpos
-eval $inlibc
+hasstruct='varname=$1; struct=$2; shift; shift;
+while $test $# -ge 2; do
+ case "$1" in
+ $define) echo "#include <$2>";;
+ esac ;
+ shift 2;
+done > try.c;
+echo "int main () { struct $struct foo; }" >> try.c;
+set try;
+if eval $compile; then
+ val="$define";
+else
+ val="$undef";
+fi;
+set $varname;
+eval $setvar;
+$rm -f try.c try.o'
: see if this is a sys/param system
set sys/param.h i_sysparam
set sys/mount.h i_sysmount
eval $inhdr
+: see if sys/types.h has to be included
+set sys/types.h i_systypes
+eval $inhdr
+
+
+echo " "
+echo "Checking to see if your system supports struct fs_data..." >&4
+set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
+eval $hasstruct
+case "$d_fs_data_s" in
+"$define") echo "Yes, it does." ;;
+*) echo "No, it doesn't." ;;
+esac
+
+: see if fseeko exists
+set fseeko d_fseeko
+eval $inlibc
+case "$longsize" in
+8) echo "(Your long is 64 bits, so in a pinch you could use fseek.)" ;;
+esac
-: see if statfs exists
-set statfs d_statfs
+: see if fsetpos exists
+set fsetpos d_fsetpos
eval $inlibc
+
: see if fstatfs exists
set fstatfs d_fstatfs
eval $inlibc
-: see if statfs knows about mount flags
-set d_statfsflags statfs f_flags $i_sysparam sys/param.h $i_sysmount sys/mount.h
-eval $hasfield
-
: see if statvfs exists
set statvfs d_statvfs
: see if ftello exists
set ftello d_ftello
eval $inlibc
+case "$longsize" in
+8) echo "(Your long is 64 bits, so in a pinch you could use ftell.)" ;;
+esac
: see if getgrent exists
set getgrent d_getgrent
set getlogin d_getlogin
eval $inlibc
+: see if getmnt exists
+set getmnt d_getmnt
+eval $inlibc
+
: see if getmntent exists
set getmntent d_getmntent
eval $inlibc
set d_htonl
eval $setvar
-: see which of string.h or strings.h is needed
-echo " "
-strings=`./findhdr string.h`
-if $test "$strings" && $test -r "$strings"; then
- echo "Using <string.h> instead of <strings.h>." >&4
- val="$define"
-else
- val="$undef"
- strings=`./findhdr strings.h`
- if $test "$strings" && $test -r "$strings"; then
- echo "Using <strings.h> instead of <string.h>." >&4
- else
- echo "No string header found -- You'll surely have problems." >&4
- fi
-fi
-set i_string
-eval $setvar
-case "$i_string" in
-"$undef") strings=`./findhdr strings.h`;;
-*) strings=`./findhdr string.h`;;
-esac
-
: index or strchr
echo " "
if set index val -f; eval $csym; $val; then
set lockf d_lockf
eval $inlibc
+: check for long long
+echo " "
+$echo $n "Checking to see if your system supports long long..." $c >&4
+echo 'int main() { long long x = 7; return 0; }' > try.c
+set try
+if eval $compile; then
+ val="$define"
+ echo " Yes, it does." >&4
+else
+ val="$undef"
+ echo " No, it doesn't." >&4
+fi
+$rm try.*
+set d_longlong
+eval $setvar
+
+: check for length of long long
+case "${d_longlong}${longlongsize}" in
+$define)
+ echo " "
+ $echo $n "Checking to see how big your long longs are..." $c >&4
+ $cat >try.c <<'EOCP'
+#include <stdio.h>
+int main()
+{
+ printf("%d\n", (int)sizeof(long long));
+ return(0);
+}
+EOCP
+ set try
+ if eval $compile_ok; then
+ longlongsize=`./try$exe_ext`
+ $echo " $longlongsize bytes." >&4
+ else
+ dflt='8'
+ echo " "
+ echo "(I can't seem to compile the test program. Guessing...)"
+ rp="What is the size of a long long (in bytes)?"
+ . ./myread
+ longlongsize="$ans"
+ fi
+ if $test "X$longsize" = "X$longlongsize"; then
+ echo "(That isn't any different from an ordinary long.)"
+ fi
+ ;;
+esac
+$rm -f try.* try
+
: see if lstat exists
set lstat d_lstat
eval $inlibc
-: see if madvise exists
-set madvise d_madvise
-eval $inlibc
-
: see if mblen exists
set mblen d_mblen
eval $inlibc
set mktime d_mktime
eval $inlibc
-: see if this is a sys/mman.h system
-set sys/mman.h i_sysmman
-eval $inhdr
-
-: see if mmap exists
-set mmap d_mmap
-eval $inlibc
-: see what shmat returns
-: default to something harmless
-mmaptype='void *'
-case "$i_sysmman$d_mmap" in
-"$define$define")
- $cat >mmap.c <<'END'
-#include <sys/mman.h>
-void *mmap();
-END
- if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
- mmaptype='void *'
- else
- mmaptype='caddr_t'
- fi
- echo "and it returns ($mmaptype)." >&4
- ;;
-esac
-
-
-
-: see if mprotect exists
-set mprotect d_mprotect
-eval $inlibc
-
: see if msgctl exists
set msgctl d_msgctl
eval $inlibc
set d_msg
eval $setvar
-: see if msync exists
-set msync d_msync
-eval $inlibc
-
-: see if munmap exists
-set munmap d_munmap
-eval $inlibc
-
: see if nice exists
set nice d_nice
eval $inlibc
;;
esac
+: see if inttypes.h is available
+: we want a real compile instead of Inhdr because some systems
+: have an inttypes.h which includes non-existent headers
+echo " "
+$cat >try.c <<EOCP
+#include <inttypes.h>
+int main() {
+ static int32_t foo32 = 0x12345678;
+}
+EOCP
+set try
+if eval $compile; then
+ echo "<inttypes.h> found." >&4
+ val="$define"
+else
+ echo "<inttypes.h> NOT found." >&4
+ val="$undef"
+fi
+$rm -f try.c try
+set i_inttypes
+eval $setvar
+
+: check for int64_t
+echo " "
+$echo $n "Checking to see if your system supports int64_t...$c" >&4
+$cat >try.c <<EOCP
+#include <sys/types.h>
+#$i_inttypes I_INTTYPES
+#ifdef I_INTTYPES
+#include <inttypes.h>
+#endif
+int main() { int64_t x = 7; }
+EOCP
+set try
+if eval $compile; then
+ val="$define"
+ echo " Yes, it does." >&4
+else
+ val="$undef"
+ echo " No, it doesn't." >&4
+fi
+$rm -f try try.*
+set d_int64t
+eval $setvar
+
+
+echo " "
+echo "Checking which 64-bit integer type we could use..." >&4
+
+case "$intsize" in
+8) val=int
+ set quadtype
+ eval $setvar
+ val='"unsigned int"'
+ set uquadtype
+ eval $setvar
+ quadkind=1
+ ;;
+*) case "$longsize" in
+ 8) val=long
+ set quadtype
+ eval $setvar
+ val='"unsigned long"'
+ set uquadtype
+ eval $setvar
+ quadkind=2
+ ;;
+ *) case "$uselonglong:$d_longlong:$longlongsize" in
+ define:define:8)
+ val='"long long"'
+ set quadtype
+ eval $setvar
+ val='"unsigned long long"'
+ set uquadtype
+ eval $setvar
+ quadkind=3
+ ;;
+ *) case "$d_int64t" in
+ define)
+ val=int64_t
+ set quadtype
+ eval $setvar
+ val=uint64_t
+ set uquadtype
+ eval $setvar
+ quadkind=4
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+esac
+
+case "$quadtype" in
+'') case "$uselonglong:$d_longlong:$longlongsize" in
+ undef:define:8)
+ echo "(You would have 'long long', but you are not using it.)" >&4 ;;
+ *) echo "Alas, no 64-bit integer types in sight." >&4 ;;
+ esac
+ d_quad="$undef"
+ ;;
+*) if test X"$use64bits" = Xdefine -o X"$longsize" = X8; then
+ verb="will"
+ else
+ verb="could"
+ fi
+ echo "We $verb use '$quadtype' for 64-bit integers." >&4
+ d_quad="$define"
+ ;;
+esac
+
: see if readdir and friends exist
set readdir d_readdir
eval $inlibc
set readlink d_readlink
eval $inlibc
-: see if readv exists
-set readv d_readv
-eval $inlibc
-
: see if rename exists
set rename d_rename
eval $inlibc
struct sigaction act, oact;
act.sa_flags = 0;
oact.sa_handler = 0;
+ /* so that act and oact are used */
+ exit(act.sa_flags == 0 && oact.sa_handler == 0);
}
EOP
set try
eval $setvar
$rm -f try.c try
+: see if sqrtl exists
+set sqrtl d_sqrtl
+eval $inlibc
+
: see if sys/stat.h is available
set sys/stat.h i_sysstat
eval $inhdr
+
: see if stat knows about block sizes
echo " "
+echo "Checking to see if your struct stat has st_blocks field..." >&4
set d_statblks stat st_blocks $i_sysstat sys/stat.h
eval $hasfield
+
+: see if this is a sys/vfs.h system
+set sys/vfs.h i_sysvfs
+eval $inhdr
+
+
+: see if this is a sys/statfs.h system
+set sys/statfs.h i_sysstatfs
+eval $inhdr
+
+
+echo " "
+echo "Checking to see if your system supports struct statfs..." >&4
+set d_statfs_s statfs $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h
+eval $hasstruct
+case "$d_statfs_s" in
+"$define") echo "Yes, it does." ;;
+*) echo "No, it doesn't." ;;
+esac
+
+
+
+: see if struct statfs knows about f_flags
+case "$d_statfs_s" in
+define)
+ echo " "
+ echo "Checking to see if your struct statfs has f_flags field..." >&4
+ set d_statfs_f_flags statfs f_flags $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h
+ eval $hasfield
+ ;;
+*) val="$undef"
+ set d_statfs_f_flags
+ eval $setvar
+ ;;
+esac
+case "$d_statfs_f_flags" in
+"$define") echo "Yes, it does." ;;
+*) echo "No, it doesn't." ;;
+esac
+
: see if _ptr and _cnt from stdio act std
echo " "
if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
set strtol d_strtol
eval $inlibc
+: see if strtold exists
+set strtold d_strtold
+eval $inlibc
+
+: see if strtoll exists
+set strtoll d_strtoll
+eval $inlibc
+
: see if strtoul exists
set strtoul d_strtoul
eval $inlibc
set strtoull d_strtoull
eval $inlibc
+: see if strtouq exists
+set strtouq d_strtouq
+eval $inlibc
+
: see if strxfrm exists
set strxfrm d_strxfrm
eval $inlibc
set tcsetpgrp d_tcsetpgrp
eval $inlibc
-: see if sys/types.h has to be included
-set sys/types.h i_systypes
-eval $inhdr
-
: see if prototype for telldir is available
-echo " "
-set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
-eval $hasproto
-
-: define an is-a-typedef? function
-typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
-case "$inclist" in
-"") inclist="sys/types.h";;
-esac;
-eval "varval=\$$var";
-case "$varval" in
-"")
- $rm -f temp.c;
- for inc in $inclist; do
- echo "#include <$inc>" >>temp.c;
- done;
- echo "#ifdef $type" >> temp.c;
- echo "printf(\"We have $type\");" >> temp.c;
- echo "#endif" >> temp.c;
- $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
- if $contains $type temp.E >/dev/null 2>&1; then
- eval "$var=\$type";
- else
- eval "$var=\$def";
- fi;
- $rm -f temp.?;;
-*) eval "$var=\$varval";;
-esac'
-
-: define an is-a-typedef? function that prompts if the type is not available.
-typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
-case "$inclist" in
-"") inclist="sys/types.h";;
-esac;
-eval "varval=\$$var";
-case "$varval" in
-"")
- $rm -f temp.c;
- for inc in $inclist; do
- echo "#include <$inc>" >>temp.c;
- done;
- echo "#ifdef $type" >> temp.c;
- echo "printf(\"We have $type\");" >> temp.c;
- echo "#endif" >> temp.c;
- $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
- echo " " ;
- echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
- if $contains $type temp.E >/dev/null 2>&1; then
- echo "$type found." >&4;
- eval "$var=\$type";
- else
- echo "$type NOT found." >&4;
- dflt="$def";
- . ./myread ;
- eval "$var=\$ans";
- fi;
- $rm -f temp.?;;
-*) eval "$var=\$varval";;
-esac'
+echo " "
+set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
+eval $hasproto
: see if this is a sys/times.h system
set sys/times.h i_systimes
set umask d_umask
eval $inlibc
+: see if ustat exists
+set ustat d_ustat
+eval $inlibc
+
: backward compatibility for d_hvfork
if test X$d_hvfork != X; then
d_vfork="$d_hvfork"
set wctomb d_wctomb
eval $inlibc
-: see if writev exists
-set writev d_writev
-eval $inlibc
-
: preserve RCS keywords in files with variable substitution, grrr
Date='$Date'
Id='$Id'
case "$alignbytes" in
'') echo "Checking alignment constraints..." >&4
$cat >try.c <<'EOCP'
+#include <stdio.h>
struct foobar {
char foo;
double bar;
} try_algn;
int main()
{
- printf("%d\n", (char *)&try_algn.bar - (char *)&try_algn.foo);
+ printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
+ return(0);
}
EOCP
set try
}
EOCP
set try
- if eval $compile && ./try; then
+ if eval $compile_ok && ./try; then
echo 'Looks OK.' >&4
else
echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
#include <sys/types.h>
#include <db.h>
-#ifndef DB_VERSION_MAJOR
-size_t prefix_cb (key1, key2)
-const DBT *key1;
-const DBT *key2;
-{
-}
-BTREEINFO info;
+#ifndef DB_VERSION_MAJOR
+size_t prefix_cb (key1, key2)
+const DBT *key1;
+const DBT *key2;
+{
+}
+BTREEINFO info;
+int main()
+{
+ info.prefix = prefix_cb;
+}
+#endif
+EOCP
+ if $cc $ccflags -c try.c >try.out 2>&1 ; then
+ if $contains warning try.out >>/dev/null 2>&1 ; then
+ db_prefixtype='int'
+ else
+ db_prefixtype='size_t'
+ fi
+ else
+ db_prefixtype='size_t'
+ : XXX Maybe we should just give up here.
+ $cat try.out >&4
+ echo "Help: I can't seem to compile the db test program." >&4
+ echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
+ fi
+ $rm -f try.*
+ echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
+ ;;
+*) db_prefixtype='size_t'
+ ;;
+esac
+
+: check for void type
+echo " "
+echo "Checking to see how well your C compiler groks the void type..." >&4
+case "$voidflags" in
+'')
+ $cat >try.c <<'EOCP'
+#if TRY & 1
+void sub() {
+#else
+sub() {
+#endif
+ extern void moo(); /* function returning void */
+ void (*goo)(); /* ptr to func returning void */
+#if TRY & 8
+ void *hue; /* generic ptr */
+#endif
+#if TRY & 2
+ void (*foo[10])();
+#endif
+
+#if TRY & 4
+ if(goo == moo) {
+ exit(0);
+ }
+#endif
+ exit(0);
+}
+int main() { sub(); }
+EOCP
+ if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
+ voidflags=$defvoidused
+ echo "Good. It appears to support void to the level $package wants.">&4
+ if $contains warning .out >/dev/null 2>&1; then
+ echo "However, you might get some warnings that look like this:"
+ $cat .out
+ fi
+ else
+echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
+ if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
+ echo "It supports 1..."
+ if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
+ echo "It also supports 2..."
+ if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
+ voidflags=7
+ echo "And it supports 4 but not 8 definitely."
+ else
+ echo "It doesn't support 4..."
+ if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
+ voidflags=11
+ echo "But it supports 8."
+ else
+ voidflags=3
+ echo "Neither does it support 8."
+ fi
+ fi
+ else
+ echo "It does not support 2..."
+ if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
+ voidflags=13
+ echo "But it supports 4 and 8."
+ else
+ if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
+ voidflags=5
+ echo "And it supports 4 but has not heard about 8."
+ else
+ echo "However it supports 8 but not 4."
+ fi
+ fi
+ fi
+ else
+ echo "There is no support at all for void."
+ voidflags=0
+ fi
+ fi
+esac
+case "$voidflags" in
+"$defvoidused") ;;
+*) $cat >&4 <<'EOM'
+ Support flag bits are:
+ 1: basic void declarations.
+ 2: arrays of pointers to functions returning void.
+ 4: operations between pointers to and addresses of void functions.
+ 8: generic void pointers.
+EOM
+ dflt="$voidflags";
+ rp="Your void support flags add up to what?"
+ . ./myread
+ voidflags="$ans"
+ ;;
+esac
+$rm -f try.* .out
+
+
+: How can we generate normalized random numbers ?
+echo " "
+echo "Looking for a random number function..." >&4
+case "$randfunc" in
+'')
+ if set drand48 val -f; eval $csym; $val; then
+ dflt="drand48"
+ echo "Good, found drand48()." >&4
+ elif set random val -f; eval $csym; $val; then
+ dflt="random"
+ echo "OK, found random()." >&4
+ else
+ dflt="rand"
+ echo "Yick, looks like I have to use rand()." >&4
+ fi
+ echo " "
+ ;;
+*)
+ dflt="$randfunc"
+ ;;
+esac
+cont=true
+
+case "$ccflags" in
+*-Dmy_rand=*|*-Dmy_srand=*)
+ echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
+ ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
+ ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
+ ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
+ ;;
+esac
+
+while $test "$cont"; do
+ rp="Use which function to generate random numbers?"
+ . ./myread
+ if $test "$ans" = "$dflt"; then
+ : null
+ else
+ randbits=''
+ fi
+ randfunc="$ans"
+ if set $ans val -f; eval $csym; $val; then
+ cont=''
+ else
+ dflt=y
+ rp="I cannot find function $ans. Use that name anyway?"
+ . ./myread
+ dflt=rand
+ case "$ans" in
+ [yY]*) cont='';;
+ esac
+ fi
+ case "$cont" in
+ '')
+ case "$randfunc" in
+ drand48)
+ drand01="drand48()"
+ seedfunc="srand48"
+ randbits=48
+ randseedtype=long
+ ;;
+ rand|random)
+ case "$randbits" in
+ '')
+echo "Checking to see how many bits your $randfunc() function produces..." >&4
+ $cat >try.c <<EOCP
+#$i_unistd I_UNISTD
+#$i_stdlib I_STDLIB
+#include <stdio.h>
+#ifdef I_UNISTD
+# include <unistd.h>
+#endif
+#ifdef I_STDLIB
+# include <stdlib.h>
+#endif
+int main()
+{
+ register int i;
+ register unsigned long tmp;
+ register unsigned long max = 0L;
+
+ for (i = 1000; i; i--) {
+ tmp = (unsigned long) $randfunc();
+ if (tmp > max) max = tmp;
+ }
+ for (i = 0; max; i++)
+ max /= 2;
+ printf("%d\n",i);
+}
+EOCP
+ set try
+ if eval $compile_ok; then
+ dflt=`try`
+ else
+ dflt='?'
+ echo "(I can't seem to compile the test program...)"
+ fi
+ ;;
+ *)
+ dflt="$randbits"
+ ;;
+ esac
+ rp="How many bits does your $randfunc() function produce?"
+ . ./myread
+ randbits="$ans"
+ $rm -f try.c try
+ drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
+ seedfunc="s$randfunc"
+ randseedtype=unsigned
+ ;;
+ *)
+ dflt="31"
+ rp="How many bits does your $randfunc() function produce?"
+ . ./myread
+ randbits="$ans"
+ seedfunc="s$randfunc"
+ drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
+ if set $seedfunc val -f; eval $csym; $val; then
+ echo "(Using $seedfunc() to seed random generator)"
+ else
+ echo "(Warning: no $seedfunc() to seed random generator)"
+ seedfunc=rand
+ fi
+ randseedtype=unsigned
+ ;;
+ esac
+ ;;
+ esac
+done
+
+echo " "
+echo "Determining whether or not we are on an EBCDIC system..." >&4
+$cat >tebcdic.c <<'EOM'
int main()
{
- info.prefix = prefix_cb;
+ if ('M'==0xd4) return 0;
+ return 1;
}
-#endif
-EOCP
- if $cc $ccflags -c try.c >try.out 2>&1 ; then
- if $contains warning try.out >>/dev/null 2>&1 ; then
- db_prefixtype='int'
- else
- db_prefixtype='size_t'
- fi
+EOM
+
+val=$undef
+set tebcdic
+if eval $compile_ok; then
+ if ./tebcdic; then
+ echo "You have EBCDIC." >&4
+ val="$define"
else
- db_prefixtype='size_t'
- : XXX Maybe we should just give up here.
- $cat try.out >&4
- echo "Help: I can't seem to compile the db test program." >&4
- echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
+ echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
fi
- $rm -f try.*
- echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
- ;;
-*) db_prefixtype='size_t'
- ;;
-esac
+else
+ echo "I'm unable to compile the test program." >&4
+ echo "I'll assume ASCII or some ISO Latin." >&4
+fi
+$rm -f tebcdic.c tebcdic
+set ebcdic
+eval $setvar
-: check for void type
echo " "
-echo "Checking to see how well your C compiler groks the void type..." >&4
-case "$voidflags" in
-'')
- $cat >try.c <<'EOCP'
-#if TRY & 1
-void sub() {
-#else
-sub() {
+$cat >&4 <<EOM
+Checking how to flush all pending stdio output...
+EOM
+# I only know how to find the first 32 possibly open files on SunOS.
+# See also hints/sunos_4_1.sh and util.c --AD
+case "$osname" in
+sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
+esac
+$cat >>try.c <<EOCP
+#include <stdio.h>
+#$i_unistd I_UNISTD
+#ifdef I_UNISTD
+# include <unistd.h>
#endif
- extern void moo(); /* function returning void */
- void (*goo)(); /* ptr to func returning void */
-#if TRY & 8
- void *hue; /* generic ptr */
+#$d_sysconf HAS_SYSCONF
+#$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
+#ifdef HAS_STDIO_STREAM_ARRAY
+# define STDIO_STREAM_ARRAY $stdio_stream_array
#endif
-#if TRY & 2
- void (*foo[10])();
+int main() {
+ FILE* p = fopen("try.out", "w");
+#ifdef TRY_FPUTC
+ fputc('x', p);
+#else
+# ifdef TRY_FPRINTF
+ fprintf(p, "x");
+# endif
#endif
-
-#if TRY & 4
- if(goo == moo) {
- exit(0);
- }
+#ifdef TRY_FFLUSH_NULL
+ fflush(NULL);
#endif
- exit(0);
+#ifdef TRY_FFLUSH_ALL
+ {
+ long open_max = -1;
+# ifdef PERL_FFLUSH_ALL_FOPEN_MAX
+ open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
+# else
+# if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
+ open_max = sysconf(_SC_OPEN_MAX);
+# else
+# ifdef FOPEN_MAX
+ open_max = FOPEN_MAX;
+# else
+# ifdef OPEN_MAX
+ open_max = OPEN_MAX;
+# else
+# ifdef _NFILE
+ open_max = _NFILE;
+# endif
+# endif
+# endif
+# endif
+# endif
+# ifdef HAS_STDIO_STREAM_ARRAY
+ if (open_max > 0) {
+ long i;
+ for (i = 0; i < open_max; i++)
+ if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
+ STDIO_STREAM_ARRAY[i]._file < open_max &&
+ STDIO_STREAM_ARRAY[i]._flag)
+ fflush(&STDIO_STREAM_ARRAY[i]);
+ }
+ }
+# endif
+#endif
+ _exit(42);
}
-int main() { sub(); }
EOCP
- if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
- voidflags=$defvoidused
- echo "Good. It appears to support void to the level $package wants.">&4
- if $contains warning .out >/dev/null 2>&1; then
- echo "However, you might get some warnings that look like this:"
- $cat .out
+: first we have to find out how _not_ to flush
+if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
+ output=''
+ set try -DTRY_FPUTC
+ if eval $compile; then
+ $rm -f try.out
+ ./try$exe_ext 2>/dev/null
+ if $test ! -s try.out -a "X$?" = X42; then
+ output=-DTRY_FPUTC
+ fi
+ fi
+ case "$output" in
+ '')
+ set try -DTRY_FPRINTF
+ $rm -f try.out
+ if eval $compile; then
+ $rm -f try.out
+ ./try$exe_ext 2>/dev/null
+ if $test ! -s try.out -a "X$?" = X42; then
+ output=-DTRY_FPRINTF
+ fi
+ fi
+ ;;
+ esac
+fi
+: check for fflush NULL behaviour
+case "$fflushNULL" in
+'') set try -DTRY_FFLUSH_NULL $output
+ if eval $compile; then
+ $rm -f try.out
+ ./try$exe_ext 2>/dev/null
+ code="$?"
+ if $test -s try.out -a "X$code" = X42; then
+ fflushNULL="`$cat try.out`"
+ else
+ if $test "X$code" != X42; then
+ $cat >&4 <<EOM
+(If this test failed, don't worry, we'll try another method shortly.)
+EOM
+ fi
fi
- else
-echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
- if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
- echo "It supports 1..."
- if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
- echo "It also supports 2..."
- if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
- voidflags=7
- echo "And it supports 4 but not 8 definitely."
- else
- echo "It doesn't support 4..."
- if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
- voidflags=11
- echo "But it supports 8."
- else
- voidflags=3
- echo "Neither does it support 8."
- fi
- fi
- else
- echo "It does not support 2..."
- if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
- voidflags=13
- echo "But it supports 4 and 8."
- else
- if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
- voidflags=5
- echo "And it supports 4 but has not heard about 8."
- else
- echo "However it supports 8 but not 4."
- fi
- fi
+ fi
+ $rm -f core try.core core.try.*
+ case "$fflushNULL" in
+ x) $cat >&4 <<EOM
+Your fflush(NULL) works okay.
+EOM
+ fflushNULL="$define"
+ ;;
+ '') $cat >&4 <<EOM
+Your fflush(NULL) isn't working (contrary to ANSI C).
+EOM
+ fflushNULL="$undef"
+ ;;
+ *) $cat >&4 <<EOM
+Cannot figure out whether your fflush(NULL) works or not.
+I'm assuming it doesn't (contrary to ANSI C).
+EOM
+ fflushNULL="$undef"
+ ;;
+ esac
+ ;;
+$define|true|[yY]*)
+ fflushNULL="$define"
+ ;;
+*)
+ fflushNULL="$undef"
+ ;;
+esac
+: check explicit looping only if NULL did not work
+case "$fflushNULL" in
+"$undef")
+ : check for fflush all behaviour
+ case "$fflushall" in
+ '') set try -DTRY_FFLUSH_ALL $output
+ if eval $compile; then
+ $cat >&4 <<EOM
+(Now testing the other method--but note that also this may fail.)
+EOM
+ $rm -f try.out
+ ./try$exe_ext 2>/dev/null
+ if $test -s try.out -a "X$?" = X42; then
+ fflushall="`$cat try.out`"
fi
- else
- echo "There is no support at all for void."
- voidflags=0
fi
- fi
+ $rm -f core try.core core.try.*
+ case "$fflushall" in
+ x) $cat >&4 <<EOM
+Whew. Flushing explicitly all the stdio streams works.
+EOM
+ fflushall="$define"
+ ;;
+ '') $cat >&4 <<EOM
+Sigh. Flushing explicitly all the stdio streams doesn't work.
+EOM
+ fflushall="$undef"
+ ;;
+ *) $cat >&4 <<EOM
+Cannot figure out whether flushing stdio streams explicitly works or not.
+I'm assuming it doesn't.
+EOM
+ fflushall="$undef"
+ ;;
+ esac
+ ;;
+ "$define"|true|[yY]*)
+ fflushall="$define"
+ ;;
+ *)
+ fflushall="$undef"
+ ;;
+ esac
+ ;;
+*) fflushall="$undef"
+ ;;
esac
-case "$voidflags" in
-"$defvoidused") ;;
-*) $cat >&4 <<'EOM'
- Support flag bits are:
- 1: basic void declarations.
- 2: arrays of pointers to functions returning void.
- 4: operations between pointers to and addresses of void functions.
- 8: generic void pointers.
+case "$fflushNULL$fflushall" in
+undefundef)
+ $cat <<EOM
+I cannot figure out how to flush pending stdio output.
EOM
- dflt="$voidflags";
- rp="Your void support flags add up to what?"
- . ./myread
- voidflags="$ans"
;;
esac
-$rm -f try.* .out
+$rm -f try.* try$exe_ext
+
+: Store the full pathname to the ar program for use in the C program
+: Respect a hint or command line value for full_ar.
+case "$full_ar" in
+'') full_ar=$ar ;;
+esac
+: Store the full pathname to the sed program for use in the C program
+full_sed=$sed
-: How can we generate normalized random numbers ?
+: see what type gids are declared as in the kernel
echo " "
-echo "Looking for a random number function..." >&4
-case "$randfunc" in
-'')
- if set drand48 val -f; eval $csym; $val; then
- dflt="drand48"
- echo "Good, found drand48()." >&4
- elif set random val -f; eval $csym; $val; then
- dflt="random"
- echo "OK, found random()." >&4
- else
- dflt="rand"
- echo "Yick, looks like I have to use rand()." >&4
- fi
- echo " "
- ;;
-*)
- dflt="$randfunc"
+echo "Looking for the type for group ids returned by getgid()."
+set gid_t gidtype xxx stdio.h sys/types.h
+eval $typedef
+case "$gidtype" in
+xxx)
+ xxx=`./findhdr sys/user.h`
+ set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
+ case $1 in
+ unsigned) dflt="$1 $2" ;;
+ *) dflt="$1" ;;
+ esac
;;
+*) dflt="$gidtype";;
esac
-cont=true
-
-case "$ccflags" in
-*-Dmy_rand=*|*-Dmy_srand=*)
- echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
- ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
- ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
- ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
+case "$gidtype" in
+gid_t) echo "gid_t found." ;;
+*) rp="What is the type for group ids returned by getgid()?"
+ . ./myread
+ gidtype="$ans"
;;
esac
-while $test "$cont"; do
- rp="Use which function to generate random numbers?"
- . ./myread
- if $test "$ans" = "$dflt"; then
- : null
- else
- randbits=''
- fi
- randfunc="$ans"
- if set $ans val -f; eval $csym; $val; then
- cont=''
- else
- dflt=y
- rp="I cannot find function $ans. Use that name anyway?"
- . ./myread
- dflt=rand
- case "$ans" in
- [yY]*) cont='';;
- esac
- fi
- case "$cont" in
- '')
- case "$randfunc" in
- drand48)
- drand01="drand48()"
- seedfunc="srand48"
- randbits=48
- randseedtype=long
- ;;
- rand|random)
- case "$randbits" in
- '')
-echo "Checking to see how many bits your $randfunc() function produces..." >&4
- $cat >try.c <<EOCP
-#$i_unistd I_UNISTD
-#$i_stdlib I_STDLIB
+echo " "
+case "$gidtype" in
+*_t) zzz="$gidtype" ;;
+*) zzz="gid" ;;
+esac
+echo "Checking the size of $zzz..." >&4
+cat > try.c <<EOCP
+#include <sys/types.h>
#include <stdio.h>
-#ifdef I_UNISTD
-# include <unistd.h>
-#endif
-#ifdef I_STDLIB
-# include <stdlib.h>
-#endif
-int main()
-{
- register int i;
- register unsigned long tmp;
- register unsigned long max = 0L;
+int main() {
+ printf("%d\n", (int)sizeof($gidtype));
+ exit(0);
+}
+EOCP
+set try
+if eval $compile_ok; then
+ yyy=`./try`
+ case "$yyy" in
+ '') gidsize=4
+ echo "(I can't execute the test program--guessing $gidsize.)" >&4
+ ;;
+ *) gidsize=$yyy
+ echo "Your $zzz size is $gidsize bytes."
+ ;;
+ esac
+else
+ gidsize=4
+ echo "(I can't compile the test program--guessing $gidsize.)" >&4
+fi
- for (i = 1000; i; i--) {
- tmp = (unsigned long) $randfunc();
- if (tmp > max) max = tmp;
- }
- for (i = 0; max; i++)
- max /= 2;
- printf("%d\n",i);
+
+echo " "
+case "$gidtype" in
+*_t) zzz="$gidtype" ;;
+*) zzz="gid" ;;
+esac
+echo "Checking the sign of $zzz..." >&4
+cat > try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+ $gidtype foo = -1;
+ if (foo < 0)
+ printf("-1\n");
+ else
+ printf("1\n");
}
EOCP
- set try
- if eval $compile_ok; then
- dflt=`try`
- else
- dflt='?'
- echo "(I can't seem to compile the test program...)"
- fi
- ;;
- *)
- dflt="$randbits"
- ;;
- esac
- rp="How many bits does your $randfunc() function produce?"
- . ./myread
- randbits="$ans"
- $rm -f try.c try
- drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
- seedfunc="s$randfunc"
- randseedtype=unsigned
- ;;
- *)
- dflt="31"
- rp="How many bits does your $randfunc() function produce?"
- . ./myread
- randbits="$ans"
- seedfunc="s$randfunc"
- drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
- if set $seedfunc val -f; eval $csym; $val; then
- echo "(Using $seedfunc() to seed random generator)"
- else
- echo "(Warning: no $seedfunc() to seed random generator)"
- seedfunc=rand
- fi
- randseedtype=unsigned
- ;;
+set try
+if eval $compile; then
+ yyy=`./try`
+ case "$yyy" in
+ '') gidsign=1
+ echo "(I can't execute the test program--guessing unsigned.)" >&4
+ ;;
+ *) gidsign=$yyy
+ case "$gidsign" in
+ 1) echo "Your $zzz is unsigned." ;;
+ -1) echo "Your $zzz is signed." ;;
esac
;;
esac
-done
+else
+ gidsign=1
+ echo "(I can't compile the test program--guessing unsigned.)" >&4
+fi
+
+: check for length of character
echo " "
-echo "Determining whether or not we are on an EBCDIC system..." >&4
-$cat >tebcdic.c <<'EOM'
+case "$charsize" in
+'')
+ echo "Checking to see how big your characters are (hey, you never know)..." >&4
+ $cat >try.c <<'EOCP'
+#include <stdio.h>
int main()
{
- if ('M'==0xd4) return 0;
- return 1;
+ printf("%d\n", (int)sizeof(char));
+ exit(0);
}
-EOM
-
-val=$undef
-set tebcdic
-if eval $compile_ok; then
- if ./tebcdic; then
- echo "You have EBCDIC." >&4
- val="$define"
+EOCP
+ set try
+ if eval $compile_ok; then
+ dflt=`./try`
else
- echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin, or UTF." >&4
+ dflt='1'
+ echo "(I can't seem to compile the test program. Guessing...)"
fi
-else
- echo "I'm unable to compile the test program." >&4
- echo "I'll assume ASCII or some ISO Latin." >&4
-fi
-$rm -f tebcdic.c tebcdic
-set ebcdic
-eval $setvar
+ ;;
+*)
+ dflt="$charsize"
+ ;;
+esac
+rp="What is the size of a character (in bytes)?"
+. ./myread
+charsize="$ans"
+$rm -f try.c try
+
echo " "
-$cat >&4 <<EOM
-Checking how to flush all pending stdio output...
-EOM
-# I only know how to find the first 32 possibly open files on SunOS.
-# See also hints/sunos_4_1.sh and util.c --AD
-case "$osname" in
-sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
+$echo "Choosing the C types to be used for Perl's internal types..." >&4
+
+case "$use64bits:$d_quad:$quadtype" in
+define:define:?*)
+ ivtype="$quadtype"
+ uvtype="$uquadtype"
+ ivsize=8
+ uvsize=8
+ ;;
+*) ivtype="long"
+ uvtype="unsigned long"
+ ivsize=$longsize
+ uvsize=$longsize
+ ;;
esac
-$cat >>try.c <<EOCP
-#include <stdio.h>
-#$i_unistd I_UNISTD
-#ifdef I_UNISTD
-# include <unistd.h>
-#endif
-#$d_sysconf HAS_SYSCONF
-#$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
-#ifdef HAS_STDIO_STREAM_ARRAY
-# define STDIO_STREAM_ARRAY $stdio_stream_array
+
+case "$uselongdouble:$d_longdbl" in
+define:define)
+ nvtype="long double"
+ nvsize=$longdblsize
+ ;;
+*) nvtype=double
+ nvsize=$doublesize
+ ;;
+esac
+
+echo "(IV will be "$ivtype", $ivsize bytes)"
+echo "(UV will be "$uvtype", $uvsize bytes)"
+echo "(NV will be "$nvtype", $nvsize bytes)"
+
+$cat >try.c <<EOCP
+#$i_inttypes I_INTTYPES
+#ifdef I_INTTYPES
+#include <inttypes.h>
#endif
+#include <stdio.h>
int main() {
- FILE* p = fopen("try.out", "w");
-#ifdef TRY_FPUTC
- fputc('x', p);
-#else
-# ifdef TRY_FPRINTF
- fprintf(p, "x");
-# endif
+#ifdef INT8
+ int8_t i = INT8_MAX;
+ uint8_t u = UINT8_MAX;
+ printf("int8_t\n");
#endif
-#ifdef TRY_FFLUSH_NULL
- fflush(NULL);
+#ifdef INT16
+ int16_t i = INT16_MAX;
+ uint16_t i = UINT16_MAX;
+ printf("int16_t\n");
#endif
-#ifdef TRY_FFLUSH_ALL
- {
- long open_max = -1;
-# ifdef PERL_FFLUSH_ALL_FOPEN_MAX
- open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
-# else
-# if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
- open_max = sysconf(_SC_OPEN_MAX);
-# else
-# ifdef FOPEN_MAX
- open_max = FOPEN_MAX;
-# else
-# ifdef OPEN_MAX
- open_max = OPEN_MAX;
-# else
-# ifdef _NFILE
- open_max = _NFILE;
-# endif
-# endif
-# endif
-# endif
-# endif
-# ifdef HAS_STDIO_STREAM_ARRAY
- if (open_max > 0) {
- long i;
- for (i = 0; i < open_max; i++)
- if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
- STDIO_STREAM_ARRAY[i]._file < open_max &&
- STDIO_STREAM_ARRAY[i]._flag)
- fflush(&STDIO_STREAM_ARRAY[i]);
- }
- }
-# endif
+#ifdef INT32
+ int32_t i = INT32_MAX;
+ uint32_t u = UINT32_MAX;
+ printf("int32_t\n");
#endif
- _exit(42);
}
EOCP
-: first we have to find out how _not_ to flush
-if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
- output=''
- set try -DTRY_FPUTC
- if eval $compile; then
- $rm -f try.out
- ./try$exe_ext 2>/dev/null
- if $test ! -s try.out -a "X$?" = X42; then
- output=-DTRY_FPUTC
- fi
- fi
- case "$output" in
- '')
- set try -DTRY_FPRINTF
- $rm -f try.out
- if eval $compile; then
- $rm -f try.out
- ./try$exe_ext 2>/dev/null
- if $test ! -s try.out -a "X$?" = X42; then
- output=-DTRY_FPRINTF
- fi
- fi
+
+case "$i8type" in
+'') case "$charsize" in
+ 1) i8type=char
+ u8type="unsigned char"
+ i8size=$charsize
+ u8size=$charsize
+ ;;
+ esac
;;
- esac
-fi
-: check for fflush NULL behaviour
-case "$fflushNULL" in
-'') set try -DTRY_FFLUSH_NULL $output
+esac
+case "$i8type" in
+'') set try -DINT8
if eval $compile; then
- $rm -f try.out
- ./try$exe_ext 2>/dev/null
- code="$?"
- if $test -s try.out -a "X$code" = X42; then
- fflushNULL="`$cat try.out`"
- else
- if $test "X$code" != X42; then
- $cat >&4 <<EOM
-(If this test failed, don't worry, we'll try another method shortly.)
-EOM
- fi
- fi
+ case "`./try$exe_ext`" in
+ int8_t) i8type=int8_t
+ u8type=uint8_t
+ i8size=1
+ u8size=1
+ ;;
+ esac
fi
- $rm -f core try.core core.try.*
- case "$fflushNULL" in
- x) $cat >&4 <<EOM
-Your fflush(NULL) works okay.
-EOM
- fflushNULL="$define"
+ ;;
+esac
+case "$i8type" in
+'') if $test $charsize -ge 1; then
+ i8type=char
+ u8type="unsigned char"
+ i8size=$charsize
+ u8size=$charsize
+ fi
+ ;;
+esac
+
+case "$i16type" in
+'') case "$shortsize" in
+ 2) i16type=short
+ u16type="unsigned short"
+ i16size=$shortsize
+ u16size=$shortsize
;;
- '') $cat >&4 <<EOM
-Your fflush(NULL) isn't working (contrary to ANSI C).
-EOM
- fflushNULL="$undef"
+ esac
+ ;;
+esac
+case "$i16type" in
+'') set try -DINT16
+ if eval $compile; then
+ case "`./try$exe_ext`" in
+ int16_t)
+ i16type=int16_t
+ u16type=uint16_t
+ i16size=2
+ u16size=2
+ ;;
+ esac
+ fi
+ ;;
+esac
+case "$i16type" in
+'') if $test $shortsize -ge 2; then
+ i16type=short
+ u16type="unsigned short"
+ i16size=$shortsize
+ u16size=$shortsize
+ fi
+ ;;
+esac
+
+case "$i32type" in
+'') case "$longsize" in
+ 4) i32type=long
+ u32type="unsigned long"
+ i32size=$longsize
+ u32size=$longsize
;;
- *) $cat >&4 <<EOM
-Cannot figure out whether your fflush(NULL) works or not.
-I'm assuming it doesn't (contrary to ANSI C).
-EOM
- fflushNULL="$undef"
+ *) case "$intsize" in
+ 4) i32type=int
+ u32type="unsigned int"
+ i32size=$intsize
+ u32size=$intsize
+ ;;
+ esac
;;
esac
;;
-$define|true|[yY]*)
- fflushNULL="$define"
+esac
+case "$i32type" in
+'') set try -DINT32
+ if eval $compile; then
+ case "`./try$exe_ext`" in
+ int32_t)
+ i32type=int32_t
+ u32type=uint32_t
+ i32size=4
+ u32size=4
+ ;;
+ esac
+ fi
;;
-*)
- fflushNULL="$undef"
+esac
+case "$i32type" in
+'') if $test $intsize -ge 4; then
+ i32type=int
+ u32type="unsigned int"
+ i32size=$intsize
+ u32size=$intsize
+ fi
;;
esac
-: check explicit looping only if NULL did not work
-case "$fflushNULL" in
-"$undef")
- : check for fflush all behaviour
- case "$fflushall" in
- '') set try -DTRY_FFLUSH_ALL $output
- if eval $compile; then
- $cat >&4 <<EOM
-(Now testing the other method--but note that also this may fail.)
-EOM
- $rm -f try.out
- ./try$exe_ext 2>/dev/null
- if $test -s try.out -a "X$?" = X42; then
- fflushall="`$cat try.out`"
- fi
- fi
- $rm -f core try.core core.try.*
- case "$fflushall" in
- x) $cat >&4 <<EOM
-Whew. Flushing explicitly all the stdio streams works.
-EOM
- fflushall="$define"
+
+case "$i64type" in
+'') case "$d_quad:$quadtype" in
+ define:?*)
+ i64type="$quadtype"
+ u64type="$uquadtype"
+ i64size=8
+ u64size=8
+ ;;
+ esac
+ ;;
+esac
+
+$rm -f try.* try
+
+echo " "
+
+if $test X"$quadtype" != X; then
+
+echo "Checking how to print 64-bit integers..." >&4
+
+if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
+ $cat >try.c <<'EOCP'
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+ int q = 12345678901;
+ printf("%ld\n", q);
+}
+EOCP
+ set try
+ if eval $compile; then
+ yyy=`./try$exe_ext`
+ case "$yyy" in
+ 12345678901)
+ sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
+ sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
+ echo "We will use %d."
+ ;;
+ esac
+ fi
+fi
+
+if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
+ $cat >try.c <<'EOCP'
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+ long q = 12345678901;
+ printf("%ld\n", q);
+}
+EOCP
+ set try
+ if eval $compile; then
+ yyy=`./try$exe_ext`
+ case "$yyy" in
+ 12345678901)
+ sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
+ sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
+ echo "We will use %ld."
+ ;;
+ esac
+ fi
+fi
+
+if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$quadtype" = Xint64_t; then
+ $cat >try.c <<'EOCP'
+#include <sys/types.h>
+#include <inttypes.h>
+#include <stdio.h>
+int main() {
+ int64_t q = 12345678901;
+ printf("%" PRId64 "\n", q);
+}
+EOCP
+ set try
+ if eval $compile; then
+ yyy=`./try$exe_ext`
+ case "$yyy" in
+ 12345678901)
+ sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
+ sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
+ echo "We will use the C9X style."
;;
- '') $cat >&4 <<EOM
-Sigh. Flushing explicitly all the stdio streams doesn't work.
-EOM
- fflushall="$undef"
+ esac
+ fi
+fi
+
+if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
+ $cat >try.c <<'EOCP'
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+ long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
+ printf("%lld\n", q);
+}
+EOCP
+ set try
+ if eval $compile; then
+ yyy=`./try$exe_ext`
+ case "$yyy" in
+ 12345678901)
+ sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
+ sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
+ echo "We will use the %lld style."
;;
- *) $cat >&4 <<EOM
-Cannot figure out whether flushing stdio streams explicitly works or not.
-I'm assuming it doesn't.
-EOM
- fflushall="$undef"
+ esac
+ fi
+fi
+
+if $test X"$sPRId64" = X -a X"$quadtype" != X; then
+ $cat >try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+ $quadtype q = 12345678901;
+ printf("%Ld\n", q);
+}
+EOCP
+ set try
+ if eval $compile; then
+ yyy=`./try$exe_ext`
+ case "$yyy" in
+ 12345678901)
+ sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
+ sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
+ echo "We will use %Ld."
;;
esac
- ;;
- "$define"|true|[yY]*)
- fflushall="$define"
- ;;
- *)
- fflushall="$undef"
- ;;
- esac
- ;;
-*) fflushall="$undef"
+ fi
+fi
+
+if $test X"$sPRId64" = X -a X"$quadtype" != X; then
+ $cat >try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+ $quadtype q = 12345678901;
+ printf("%qd\n", q);
+}
+EOCP
+ set try
+ if eval $compile; then
+ yyy=`./try$exe_ext`
+ case "$yyy" in
+ 12345678901)
+ sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
+ sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
+ echo "We will use %qd."
+ ;;
+ esac
+ fi
+fi
+
+if $test X"$sPRId64" = X; then
+ echo "Cannot figure out how to print 64-bit integers." >&4
+fi
+
+$rm -f try try.*
+
+fi
+
+case "$sPRId64" in
+'') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
+ d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
;;
-esac
-case "$fflushNULL$fflushall" in
-undefundef)
- $cat <<EOM
-I cannot figure out how to flush pending stdio output.
-EOM
+*) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
+ d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
;;
esac
-$rm -f try.* try$exe_ext
-: see what type file positions are declared as in the library
-rp="What is the type for file position used by fsetpos()?"
-set fpos_t fpostype long stdio.h sys/types.h
-eval $typedef_ask
-: Store the full pathname to the ar program for use in the C program
-: Respect a hint or command line value for full_ar.
-case "$full_ar" in
-'') full_ar=$ar ;;
+echo " "
+$echo "Checking the format strings to be used for Perl's internal types..." >&4
+
+if $test X"$ivsize" = X8; then
+ ivdformat="$sPRId64"
+ uvuformat="$sPRIu64"
+ uvoformat="$sPRIo64"
+ uvxformat="$sPRIx64"
+else
+ if $test X"$ivsize" = X"$longsize"; then
+ ivdformat='"ld"'
+ uvuformat='"lu"'
+ uvoformat='"lo"'
+ uvxformat='"lx"'
+ else
+ if $test X"$ivsize" = X"$intsize"; then
+ ivdformat='"d"'
+ uvuformat='"u"'
+ uvoformat='"o"'
+ uvxformat='"x"'
+ else
+ : far out
+ if $test X"$ivsize" = X"$shortsize"; then
+ ivdformat='"hd"'
+ uvuformat='"hu"'
+ uvoformat='"ho"'
+ uvxformat='"hx"'
+ fi
+ fi
+ fi
+fi
+
+case "$ivdformat" in
+'') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
+ exit 1
+ ;;
esac
-: Store the full pathname to the sed program for use in the C program
-full_sed=$sed
-: see what type gids are declared as in the kernel
echo " "
-echo "Looking for the type for group ids returned by getgid()."
-set gid_t gidtype xxx stdio.h sys/types.h
-eval $typedef
-case "$gidtype" in
-xxx)
- xxx=`./findhdr sys/user.h`
- set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
- case $1 in
- unsigned) dflt="$1 $2" ;;
- *) dflt="$1" ;;
- esac
+$echo "Checking the format string to be used for gids..." >&4
+
+case "$gidsign" in
+-1) if $test X"$gidsize" = X"$ivsize"; then
+ gidformat="$ivdformat"
+ else
+ if $test X"$gidsize" = X"$longsize"; then
+ gidformat='"ld"'
+ else
+ if $test X"$gidsize" = X"$intsize"; then
+ gidformat='"d"'
+ else
+ if $test X"$gidsize" = X"$shortsize"; then
+ gidformat='"hd"'
+ fi
+ fi
+ fi
+ fi
;;
-*) dflt="$gidtype";;
-esac
-case "$gidtype" in
-gid_t) echo "gid_t found." ;;
-*) rp="What is the type for group ids returned by getgid()?"
- . ./myread
- gidtype="$ans"
+*) if $test X"$gidsize" = X"$uvsize"; then
+ gidformat="$uvuformat"
+ else
+ if $test X"$gidsize" = X"$longsize"; then
+ gidformat='"lu"'
+ else
+ if $test X"$gidsize" = X"$intsize"; then
+ gidformat='"u"'
+ else
+ if $test X"$gidsize" = X"$shortsize"; then
+ gidformat='"hu"'
+ fi
+ fi
+ fi
+ fi
;;
esac
*) groupstype="$gidtype";;
esac
-: see what type lseek is declared as in the kernel
-rp="What is the type used for lseek's offset on this system?"
-set off_t lseektype long stdio.h sys/types.h
-eval $typedef_ask
-
-echo " "
-$echo $n "Checking to see how big your file offsets are...$c" >&4
-$cat >try.c <<EOCP
-#include <sys/types.h>
-#include <stdio.h>
-int main()
-{
- printf("%d\n", sizeof($lseektype));
-}
-EOCP
-set try
-if eval $compile_ok; then
- lseeksize=`./try`
- $echo " $lseeksize bytes." >&4
-else
- dflt='4'
- echo " "
- echo "(I can't seem to compile the test program. Guessing...)"
- rp="What is the size of your file offsets (in bytes)?"
- . ./myread
- lseeksize="$ans"
-fi
-$rm -f try.c try
-
echo " "
echo "Checking if your $make program sets \$(MAKE)..." >&4
case "$make_set_make" in
#include <stdio.h>
int main()
{
- printf("%d\n", sizeof(VOID_PTR));
- exit(0);
+ printf("%d\n", (int)sizeof(VOID_PTR));
+ exit(0);
}
EOCP
set try
: Remove SIGSTKSIZE used by Linux.
: Remove SIGSTKSZ used by Posix.
: Remove SIGTYP void lines used by OS2.
-xxx=`echo '#include <signal.h>' |
+: Some cpps, like os390, dont give the file name anywhere
+if [ "X$fieldn" = X ]; then
+ : Just make some guesses. We check them later.
+ xxx='/usr/include/signal.h /usr/include/sys/signal.h'
+else
+ xxx=`echo '#include <signal.h>' |
$cppstdin $cppminus $cppflags 2>/dev/null |
$grep '^[ ]*#.*include' |
$awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
+fi
: Check this list of files to be sure we have parsed the cpp output ok.
: This will also avoid potentially non-existent files, such
: as ../foo/bar.h
print substr($3, 4, 20)
}' $xxxfiles`
: Append some common names just in case the awk scan failed.
-xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
-xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
-xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
-xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
+xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
+xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
+xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
+xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
+xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
+
: generate a few handy files for later
$cat > signal.c <<'EOCP'
#include <sys/types.h>
}
END {
printf "#endif /* JUST_NSIG */\n";
- printf "}\n";
+ printf "exit(0);\n}\n";
}
' >>signal.c
$cat >signal.awk <<'EOP'
;;
esac
+echo " "
+case "$uidtype" in
+*_t) zzz="$uidtype" ;;
+*) zzz="uid" ;;
+esac
+echo "Checking the size of $zzz..." >&4
+cat > try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+ printf("%d\n", (int)sizeof($uidtype));
+ exit(0);
+}
+EOCP
+set try
+if eval $compile_ok; then
+ yyy=`./try`
+ case "$yyy" in
+ '') uidsize=4
+ echo "(I can't execute the test program--guessing $uidsize.)" >&4
+ ;;
+ *) uidsize=$yyy
+ echo "Your $zzz size is $uidsize bytes."
+ ;;
+ esac
+else
+ uidsize=4
+ echo "(I can't compile the test program--guessing $uidsize.)" >&4
+fi
+
+echo " "
+case "$uidtype" in
+*_t) zzz="$uidtype" ;;
+*) zzz="uid" ;;
+esac
+echo "Checking the sign of $zzz..." >&4
+cat > try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+ $uidtype foo = -1;
+ if (foo < 0)
+ printf("-1\n");
+ else
+ printf("1\n");
+}
+EOCP
+set try
+if eval $compile; then
+ yyy=`./try`
+ case "$yyy" in
+ '') uidsign=1
+ echo "(I can't execute the test program--guessing unsigned.)" >&4
+ ;;
+ *) uidsign=$yyy
+ case "$uidsign" in
+ 1) echo "Your $zzz is unsigned." ;;
+ -1) echo "Your $zzz is signed." ;;
+ esac
+ ;;
+ esac
+else
+ uidsign=1
+ echo "(I can't compile the test program--guessing unsigned.)" >&4
+fi
+
+
+
+echo " "
+$echo "Checking the format string to be used for uids..." >&4
+
+case "$uidsign" in
+-1) if $test X"$uidsize" = X"$ivsize"; then
+ uidformat="$ivdformat"
+ else
+ if $test X"$uidsize" = X"$longsize"; then
+ uidformat='"ld"'
+ else
+ if $test X"$uidsize" = X"$intsize"; then
+ uidformat='"d"'
+ else
+ if $test X"$uidsize" = X"$shortsize"; then
+ uidformat='"hd"'
+ fi
+ fi
+ fi
+ fi
+ ;;
+*) if $test X"$uidsize" = X"$uvsize"; then
+ uidformat="$uvuformat"
+ else
+ if $test X"$uidsize" = X"$longsize"; then
+ uidformat='"lu"'
+ else
+ if $test X"$uidsize" = X"$intsize"; then
+ uidformat='"u"'
+ else
+ if $test X"$uidsize" = X"$shortsize"; then
+ uidformat='"hu"'
+ fi
+ fi
+ fi
+ fi
+ ;;
+esac
+
: see if dbm.h is available
: see if dbmclose exists
set dbmclose d_dbmclose
set sys/statvfs.h i_sysstatvfs
eval $inhdr
+: see if this is a sys/uio.h system
+set sys/uio.h i_sysuio
+eval $inhdr
+
: see if this is a sys/un.h system
set sys/un.h i_sysun
eval $inhdr
set sys/wait.h i_syswait
eval $inhdr
+: see if this is a ustat.h system
+set ustat.h i_ustat
+eval $inhdr
+
: see if this is an utime system
set utime.h i_utime
eval $inhdr
alignbytes='$alignbytes'
ansi2knr='$ansi2knr'
aphostname='$aphostname'
-apiversion='$apiversion'
+api_revision='$api_revision'
+api_subversion='$api_subversion'
+api_version='$api_version'
+api_versionstring='$api_versionstring'
ar='$ar'
archlib='$archlib'
archlibexp='$archlibexp'
cf_by='$cf_by'
cf_email='$cf_email'
cf_time='$cf_time'
+charsize='$charsize'
chgrp='$chgrp'
chmod='$chmod'
chown='$chown'
d_chroot='$d_chroot'
d_chsize='$d_chsize'
d_closedir='$d_closedir'
-d_cmsghdr_s='$d_cmsghdr_s'
d_const='$d_const'
d_crypt='$d_crypt'
d_csh='$d_csh'
d_fork='$d_fork'
d_fpathconf='$d_fpathconf'
d_fpos64_t='$d_fpos64_t'
+d_fs_data_s='$d_fs_data_s'
d_fseeko='$d_fseeko'
d_fsetpos='$d_fsetpos'
d_fstatfs='$d_fstatfs'
d_gethname='$d_gethname'
d_gethostprotos='$d_gethostprotos'
d_getlogin='$d_getlogin'
+d_getmnt='$d_getmnt'
d_getmntent='$d_getmntent'
d_getnbyaddr='$d_getnbyaddr'
d_getnbyname='$d_getnbyname'
d_index='$d_index'
d_inetaton='$d_inetaton'
d_int64t='$d_int64t'
-d_iovec_s='$d_iovec_s'
d_isascii='$d_isascii'
d_killpg='$d_killpg'
d_lchown='$d_lchown'
d_ldbl_dig='$d_ldbl_dig'
d_link='$d_link'
-d_llseek='$d_llseek'
d_locconv='$d_locconv'
d_lockf='$d_lockf'
d_longdbl='$d_longdbl'
d_longlong='$d_longlong'
d_lstat='$d_lstat'
-d_madvise='$d_madvise'
d_mblen='$d_mblen'
d_mbstowcs='$d_mbstowcs'
d_mbtowc='$d_mbtowc'
d_mkdir='$d_mkdir'
d_mkfifo='$d_mkfifo'
d_mktime='$d_mktime'
-d_mmap='$d_mmap'
-d_mprotect='$d_mprotect'
d_msg='$d_msg'
d_msg_ctrunc='$d_msg_ctrunc'
d_msg_dontroute='$d_msg_dontroute'
d_msg_proxy='$d_msg_proxy'
d_msgctl='$d_msgctl'
d_msgget='$d_msgget'
-d_msghdr_s='$d_msghdr_s'
d_msgrcv='$d_msgrcv'
d_msgsnd='$d_msgsnd'
-d_msync='$d_msync'
-d_munmap='$d_munmap'
d_mymalloc='$d_mymalloc'
d_nice='$d_nice'
d_off64_t='$d_off64_t'
d_pwgecos='$d_pwgecos'
d_pwpasswd='$d_pwpasswd'
d_pwquota='$d_pwquota'
+d_quad='$d_quad'
d_readdir='$d_readdir'
d_readlink='$d_readlink'
-d_readv='$d_readv'
-d_recvmsg='$d_recvmsg'
d_rename='$d_rename'
d_rewinddir='$d_rewinddir'
d_rmdir='$d_rmdir'
d_semctl_semun='$d_semctl_semun'
d_semget='$d_semget'
d_semop='$d_semop'
-d_sendmsg='$d_sendmsg'
d_setegid='$d_setegid'
d_seteuid='$d_seteuid'
d_setgrent='$d_setgrent'
d_sigsetjmp='$d_sigsetjmp'
d_socket='$d_socket'
d_sockpair='$d_sockpair'
+d_sqrtl='$d_sqrtl'
d_statblks='$d_statblks'
-d_statfs='$d_statfs'
-d_statfsflags='$d_statfsflags'
+d_statfs_f_flags='$d_statfs_f_flags'
+d_statfs_s='$d_statfs_s'
d_statvfs='$d_statvfs'
d_stdio_cnt_lval='$d_stdio_cnt_lval'
d_stdio_ptr_lval='$d_stdio_ptr_lval'
d_strerror='$d_strerror'
d_strtod='$d_strtod'
d_strtol='$d_strtol'
+d_strtold='$d_strtold'
+d_strtoll='$d_strtoll'
d_strtoul='$d_strtoul'
d_strtoull='$d_strtoull'
+d_strtouq='$d_strtouq'
d_strxfrm='$d_strxfrm'
d_suidsafe='$d_suidsafe'
d_symlink='$d_symlink'
d_umask='$d_umask'
d_uname='$d_uname'
d_union_semun='$d_union_semun'
+d_ustat='$d_ustat'
+d_vendorbin='$d_vendorbin'
d_vendorlib='$d_vendorlib'
d_vfork='$d_vfork'
d_void_closedir='$d_void_closedir'
d_waitpid='$d_waitpid'
d_wcstombs='$d_wcstombs'
d_wctomb='$d_wctomb'
-d_writev='$d_writev'
d_xenix='$d_xenix'
date='$date'
db_hashtype='$db_hashtype'
find='$find'
firstmakefile='$firstmakefile'
flex='$flex'
+fpossize='$fpossize'
fpostype='$fpostype'
freetype='$freetype'
full_ar='$full_ar'
full_csh='$full_csh'
full_sed='$full_sed'
gccversion='$gccversion'
+gidformat='$gidformat'
+gidsign='$gidsign'
+gidsize='$gidsize'
gidtype='$gidtype'
glibpth='$glibpth'
grep='$grep'
hint='$hint'
hostcat='$hostcat'
huge='$huge'
+i16size='$i16size'
+i16type='$i16type'
+i32size='$i32size'
+i32type='$i32type'
+i64size='$i64size'
+i64type='$i64type'
+i8size='$i8size'
+i8type='$i8type'
i_arpainet='$i_arpainet'
i_bsdioctl='$i_bsdioctl'
i_db='$i_db'
i_sysfilio='$i_sysfilio'
i_sysin='$i_sysin'
i_sysioctl='$i_sysioctl'
-i_sysmman='$i_sysmman'
i_sysmount='$i_sysmount'
i_sysndir='$i_sysndir'
i_sysparam='$i_sysparam'
i_sysselct='$i_sysselct'
i_syssockio='$i_syssockio'
i_sysstat='$i_sysstat'
+i_sysstatfs='$i_sysstatfs'
i_sysstatvfs='$i_sysstatvfs'
i_systime='$i_systime'
i_systimek='$i_systimek'
i_systypes='$i_systypes'
i_sysuio='$i_sysuio'
i_sysun='$i_sysun'
+i_sysvfs='$i_sysvfs'
i_syswait='$i_syswait'
i_termio='$i_termio'
i_termios='$i_termios'
i_time='$i_time'
i_unistd='$i_unistd'
+i_ustat='$i_ustat'
i_utime='$i_utime'
i_values='$i_values'
i_varargs='$i_varargs'
i_varhdr='$i_varhdr'
i_vfork='$i_vfork'
ignore_versioned_solibs='$ignore_versioned_solibs'
+inc_version_list='$inc_version_list'
incpath='$incpath'
inews='$inews'
installarchlib='$installarchlib'
installprivlib='$installprivlib'
installscript='$installscript'
installsitearch='$installsitearch'
+installsitebin='$installsitebin'
installsitelib='$installsitelib'
installstyle='$installstyle'
installusrbinperl='$installusrbinperl'
+installvendorbin='$installvendorbin'
installvendorlib='$installvendorlib'
intsize='$intsize'
+ivdformat='$ivdformat'
+ivsize='$ivsize'
+ivtype='$ivtype'
known_extensions='$known_extensions'
ksh='$ksh'
large='$large'
man3direxp='$man3direxp'
man3ext='$man3ext'
medium='$medium'
-mips='$mips'
mips_type='$mips_type'
mkdir='$mkdir'
-mmaptype='$mmaptype'
models='$models'
modetype='$modetype'
more='$more'
nm_so_opt='$nm_so_opt'
nonxs_ext='$nonxs_ext'
nroff='$nroff'
+nvsize='$nvsize'
+nvtype='$nvtype'
o_nonblock='$o_nonblock'
obj_ext='$obj_ext'
old_pthread_create_joinable='$old_pthread_create_joinable'
privlibexp='$privlibexp'
prototype='$prototype'
ptrsize='$ptrsize'
+quadkind='$quadkind'
+quadtype='$quadtype'
randbits='$randbits'
randfunc='$randfunc'
randseedtype='$randseedtype'
signal_t='$signal_t'
sitearch='$sitearch'
sitearchexp='$sitearchexp'
+sitebin='$sitebin'
+sitebinexp='$sitebinexp'
sitelib='$sitelib'
sitelibexp='$sitelibexp'
siteprefix='$siteprefix'
tr='$tr'
trnl='$trnl'
troff='$troff'
+u16size='$u16size'
+u16type='$u16type'
+u32size='$u32size'
+u32type='$u32type'
+u64size='$u64size'
+u64type='$u64type'
+u8size='$u8size'
+u8type='$u8type'
+uidformat='$uidformat'
+uidsign='$uidsign'
+uidsize='$uidsize'
uidtype='$uidtype'
uname='$uname'
uniq='$uniq'
+uquadtype='$uquadtype'
+use5005threads='$use5005threads'
use64bits='$use64bits'
usedl='$usedl'
+useithreads='$useithreads'
uselargefiles='$uselargefiles'
uselongdouble='$uselongdouble'
+uselonglong='$uselonglong'
usemorebits='$usemorebits'
usemultiplicity='$usemultiplicity'
usemymalloc='$usemymalloc'
usevfork='$usevfork'
usrinc='$usrinc'
uuname='$uuname'
+uvoformat='$uvoformat'
+uvsize='$uvsize'
+uvtype='$uvtype'
+uvuformat='$uvuformat'
+uvxformat='$uvxformat'
+vendorbin='$vendorbin'
+vendorbinexp='$vendorbinexp'
vendorlib='$vendorlib'
vendorlibexp='$vendorlibexp'
vendorprefix='$vendorprefix'
# define EXTCONST globalref
# define dEXTCONST globaldef {"$GLOBAL_RO_VARS"} readonly
#else
-# if defined(WIN32) && !defined(PERL_STATIC_SYMS) && !defined(__GNUC__) && !defined(PERL_OBJECT)
+# if defined(WIN32) && !defined(PERL_STATIC_SYMS) && !defined(PERL_OBJECT)
# ifdef PERLDLL
# define EXT extern __declspec(dllexport)
# define dEXT
=head1 SYNOPSIS
+First, make sure you are installing an up-to-date version of Perl. If
+you didn't get your Perl source from CPAN, check the latest version at
+<URL:http://www.perl.com/CPAN/src/>.
+
The basic steps to build and install perl5 on a Unix system are:
rm -f config.sh Policy.sh
make test
make install
-Full configuration instructions can be found in the INSTALL file.
-
For information on non-Unix systems, see the section on
L<"Porting information"> below.
By default, Configure will use the following directories for 5.6.
$version is the full perl version number, including subversion, e.g.
-5.6 or 5.6.1, and $archname is a string like sun4-sunos,
+5.6.0 or 5.6.1, and $archname is a string like sun4-sunos,
determined by Configure. The full definitions of all Configure
variables are in the file Porting/Glossary.
After perl is installed, you may later wish to add modules (e.g. from
CPAN) or scripts. Configure will set up the following directories to
-be used for installing those add-on modules and scripts. $apiversion
-is the perl version number (without subversion), e.g. 5.6.
+be used for installing those add-on modules and scripts. $version
+is the perl version number, e.g. 5.6.0.
Configure variable Default value
$siteprefix $prefix
$sitebin $siteprefix/bin
$sitescriptdir $siteprefix/bin
- $sitelib $siteprefix/lib/perl5/site_perl/
- $sitearch $siteprefix/lib/perl5/site_perl/$apiversion/$archname
+ $sitelib $siteprefix/lib/perl5/site_perl/$version
+ $sitearch $siteprefix/lib/perl5/site_perl/$version/$archname
$siteman1dir $siteprefix/man/man1
$siteman3dir $siteprefix/man/man3
$sitehtml1dir (none)
$sitehtml3dir (none)
By default, ExtUtils::MakeMaker will install architecture-independent
-modules into $sitelib/$apiversion and architecture-dependent modules
-into $sitearch.
+modules into $sitelib and architecture-dependent modules into $sitearch.
=item Directories for vendor-supplied add-on files
(The next ones are set only if vendorprefix is set.)
$vendorbin $vendorprefix/bin
$vendorscriptdir $vendorprefix/bin
- $vendorlib $vendorprefix/lib/perl5/vendor_perl/
- $vendorarch $vendorprefix/lib/perl5/vendor_perl/$apiversion/$archname
+ $vendorlib $vendorprefix/lib/perl5/vendor_perl/$version
+ $vendorarch $vendorprefix/lib/perl5/vendor_perl/$version/$archname
$vendorman1dir $vendorprefix/man/man1
$vendorman3dir $vendorprefix/man/man3
$vendorhtml1dir (none)
$sitebin /usr/local/bin
$sitescriptdir /usr/local/bin
- $sitelib /usr/local/lib/perl5/site_perl/
- $sitearch /usr/local/lib/perl5/site_perl/$apiversion/$archname
+ $sitelib /usr/local/lib/perl5/site_perl/$version
+ $sitearch /usr/local/lib/perl5/site_perl/$version/$archname
$siteman1dir /usr/local/man/man1
$siteman3dir /usr/local/man/man3
$vendorbin /usr/bin
$vendorscriptdir /usr/bin
- $vendorlib /usr/lib/perl5/vendor_perl/
- $vendorarch /usr/lib/perl5/vendor_perl/$apiversion/$archname
+ $vendorlib /usr/lib/perl5/vendor_perl/$version
+ $vendorarch /usr/lib/perl5/vendor_perl/$version/$archname
$vendorman1dir /usr/man/man1
$vendorman3dir /usr/man/man3
Note how in this example, the vendor-supplied directories are in the
/usr hierarchy, while the directories reserved for the end-user are in
-the /usr/local hierarchy. Note too how the vendor-supplied
-directories track $apiversion, rather than $version, to ease upgrading
-between maintenance subversions. See L<"Coexistence with earlier
-versions of perl5"> below for more details.
+the /usr/local hierarchy.
+
+The entire installed library hierarchy is installed in locations with
+version numbers, keeping the installations of different versions distinct.
+However, later installations of Perl can still be configured to search the
+installed libraries corresponding to compatible earlier versions.
+See L<"Coexistence with earlier versions of perl5"> below for more details
+on how Perl can be made to search older version directories.
Of course you may use these directories however you see fit. For
example, you may wish to use $siteprefix for site-specific files that
You can continue to use the old default from the command line with
- sh Configure -Dman3dir=/usr/local/lib/perl5/5.6/man/man3
+ sh Configure -Dman3dir=/usr/local/lib/perl5/5.6.0/man/man3
Some users also prefer to use a .3pm suffix. You can do that with
suggesting $prefix/lib/perl5/, Configure will suggest $prefix/lib.
Thus, for example, if you Configure with
--Dprefix=/opt/perl, then the default library directories for 5.6 are
+-Dprefix=/opt/perl, then the default library directories for 5.6.0 are
Configure variable Default value
- $privlib /opt/perl/lib/5.6
- $archlib /opt/perl/lib/5.6/$archname
- $sitelib /opt/perl/lib/site_perl/5.6
- $sitearch /opt/perl/lib/site_perl/5.6/$archname
+ $privlib /opt/perl/lib/5.6.0
+ $archlib /opt/perl/lib/5.6.0/$archname
+ $sitelib /opt/perl/lib/site_perl/5.6.0
+ $sitearch /opt/perl/lib/site_perl/5.6.0/$archname
=head2 Changing the installation directory
The default is to compile without thread support.
+As of v5.5.64, perl has two different internal threads implementations.
+The 5.005 version (5005threads) and an interpreter-based implementation
+(ithreads) with one interpreter per thread. By default, Configure selects
+ithreads if -Dusethreads is specified. However, you can select the old
+5005threads behavior instead by either
+
+ sh Configure -Dusethreads -Duse5005threads
+
+or by
+ sh Configure -Dusethreads -Uuseithreads
+
+Eventually (by perl v5.6.0) this internal confusion ought to disappear,
+and these options may disappear as well.
+
=head2 Selecting File IO mechanisms
Previous versions of perl used the standard IO mechanisms as defined in
To build a shared libperl, the environment variable controlling shared
library search (LD_LIBRARY_PATH in most systems, DYLD_LIBRARY_PATH for
NeXTSTEP/OPENSTEP/Rhapsody, LIBRARY_PATH for BeOS, SHLIB_PATH for
-HP-UX, LIBPATH for AIX, PATH for cygwin) must be set up to include
+HP-UX, LIBPATH for AIX, PATH for Cygwin) must be set up to include
the Perl build directory because that's where the shared libperl will
be created. Configure arranges makefile to have the correct shared
library search settings.
/usr/local/lib/perl5/site_perl/5.005/$archname
/usr/local/lib/perl5/site_perl/5.005
-Now, suppose you install version 5.6. The directories searched by
-version 5.6 will be
+Beginning with 5.6.0 the version number in the site libraries are
+fully versioned. Now, suppose you install version 5.6.0. The directories
+searched by version 5.6.0 will be
- /usr/local/lib/perl5/5.6/$archname
- /usr/local/lib/perl5/5.6
- /usr/local/lib/perl5/site_perl/5.6/$archname
- /usr/local/lib/perl5/site_perl/5.6
+ /usr/local/lib/perl5/5.6.0/$archname
+ /usr/local/lib/perl5/5.6.0
+ /usr/local/lib/perl5/site_perl/5.6.0/$archname
+ /usr/local/lib/perl5/site_perl/5.6.0
/usr/local/lib/perl5/site_perl/5.005/$archname
/usr/local/lib/perl5/site_perl/5.005
Notice the last two entries -- Perl understands the default structure
of the $sitelib directories and will look back in older, compatible
directories. This way, modules installed under 5.005_03 will continue
-to be usable by 5.005_03 but will also accessible to 5.6. Further,
+to be usable by 5.005_03 but will also accessible to 5.6.0. Further,
suppose that you upgrade a module to one which requires features
-present only in 5.6. That new module will get installed into
-/usr/local/lib/perl5/site_perl/5.6 and will be available to 5.6,
+present only in 5.6.0. That new module will get installed into
+/usr/local/lib/perl5/site_perl/5.6.0 and will be available to 5.6.0,
but will not interfere with the 5.005_03 version.
-Also, by default, 5.6 will look in
+Also, by default, 5.6.0 will look in
/usr/local/lib/perl5/site_perl/
for 5.004-era pure perl modules.
-Lastly, suppose you now install version 5.6.1. The directories
-searched by 5.6.1 will be
+Lastly, suppose you now install version 5.6.1, which we'll assume is
+binary compatible with 5.6.0 and 5.005. The directories searched
+by 5.6.1 (if you don't change the Configure defaults) will be:
/usr/local/lib/perl5/5.6.1/$archname
/usr/local/lib/perl5/5.6.1
- /usr/local/lib/perl5/site_perl/5.6/$archname
- /usr/local/lib/perl5/site_perl/5.6
+ /usr/local/lib/perl5/site_perl/5.6.1/$archname
+ /usr/local/lib/perl5/site_perl/5.6.1
+
+ /usr/local/lib/perl5/site_perl/5.6.0/$archname
+ /usr/local/lib/perl5/site_perl/5.6.0
/usr/local/lib/perl5/site_perl/5.005/$archname
/usr/local/lib/perl5/site_perl/5.005
/usr/local/lib/perl5/site_perl/
-When you install an add-on extension, it gets installed into $sitelib (or
-$sitearch if it is architecture-specific). This directory deliberately
-does NOT include the sub-version number (01) so that both 5.6 and
-5.6.1 can use the extension.
-
-However, if you do run into problems, and you want to continue to use the
-old version of perl along with your extension, move those extension files
-to the appropriate version directory, such as $privlib (or $archlib).
-(The extension's .packlist file lists the files installed with that
-extension. For the Tk extension, for example, the list of files installed
-is in $sitearch/auto/Tk/.packlist.) Then use your newer version of perl
-to rebuild and re-install the extension into $sitelib. This way, Perl
-5.6 will find your files in the 5.6 directory, and newer versions
-of perl will find your newer extension in the $sitelib directory.
-(This is also why perl searches the site-specific libraries last.)
-
-Alternatively, if you are willing to reinstall all your modules
-every time you upgrade perl, then you can include the subversion
-number in $sitearch and $sitelib when you run Configure.
+Assuming the users in your site are still actively using perl 5.6.0 and
+5.005 after you installed 5.6.1, you can continue to install add-on
+extensions using any of perl 5.6.1, 5.6.0, or 5.005. The installations
+of these different versions remain distinct, but remember that the newer
+versions of perl are automatically set up to search the site libraries of
+the older ones. This means that installing a new extension with 5.005
+will make it visible to all three versions. Later, if you install the
+same extension using, say, perl 5.6.1, it will override the 5.005-installed
+version, but only for perl 5.6.1.
+
+This way, you can choose to share compatible extensions, but also upgrade
+to a newer version of an extension that may be incompatible with earlier
+versions, without breaking the earlier versions' installations.
=head2 Maintaining completely separate versions
Many users prefer to keep all versions of perl in completely
separate directories. This guarantees that an update to one version
-won't interfere with another version. One convenient way to do this
-is by using a separate prefix for each version, such as
+won't interfere with another version. (The defaults guarantee this for
+libraries after 5.6.0, but not for executables. TODO?) One convenient
+way to do this is by using a separate prefix for each version, such as
sh Configure -Dprefix=/opt/perl5.004
subversions may not have all the compatibility wrinkles ironed out
yet.
-=head2 Upgrading from 5.005 to 5.6
+=head2 Upgrading from 5.005 to 5.6.0
Extensions built and installed with versions of perl prior to 5.005_50
will need to be recompiled to be used with 5.005_50 and later. You will,
however, be able to continue using 5.005 even after you install 5.6.
The 5.005 binary will still be able to find the modules built under
-5.005; the 5.6 binary will look in the new $sitearch and $sitelib
+5.005; the 5.6.0 binary will look in the new $sitearch and $sitelib
directories, and will not find them. See also your installed copy
of the perllocal.pod file for a (possibly incomplete) list of locally
installed modules. Note that you want perllocal.pod not perllocale.pod
# define EXTCONST globaldef {"$GLOBAL_RO_VARS"} readonly
# define dEXTCONST globaldef {"$GLOBAL_RO_VARS"} readonly
#else
-# ifdef __cplusplus
-# define EXT
-# define dEXT
-# define EXTCONST extern const
-# define dEXTCONST const
+#if defined(WIN32) && defined(__MINGW32__)
+# define EXT __declspec(dllexport)
+# define dEXT
+# define EXTCONST __declspec(dllexport) const
+# define dEXTCONST const
+#else
+#ifdef __cplusplus
+# define EXT
+# define dEXT
+# define EXTCONST extern const
+# define dEXTCONST const
#else
# define EXT
# define dEXT
# define dEXTCONST const
#endif
#endif
+#endif
#undef INIT
#define INIT(x) = x
ext/DynaLoader/Makefile.PL
ext/DynaLoader/README
ext/DynaLoader/dl_aix.xs aix
-ext/DynaLoader/dl_cygwin.xs cygwin
ext/DynaLoader/dl_dld.xs rsanders
ext/DynaLoader/dl_dlopen.xs timb
ext/DynaLoader/dl_hpux.xs hpux
eg/cgi/crash.cgi CGI example
eg/cgi/customize.cgi CGI example
eg/cgi/diff_upload.cgi CGI example
-eg/cgi/dna.small.gif.uu Small image for CGI examples
+eg/cgi/dna_small_gif.uu Small image for CGI examples
eg/cgi/file_upload.cgi CGI example
eg/cgi/frameset.cgi CGI example
eg/cgi/index.html Index page for CGI examples
eg/cgi/popup.cgi CGI example
eg/cgi/save_state.cgi CGI example
eg/cgi/tryit.cgi CGI example
-eg/cgi/wilogo.gif.uu Small image for CGI examples
+eg/cgi/wilogo_gif.uu Small image for CGI examples
eg/changes A program to list recently changed files
eg/client A sample client
eg/down A program to do things to subdirectories
embed.h Maps symbols to safer names
embed.pl Produces {embed,embedvar,objXSUB,proto}.h, global.sym
embedvar.h C namespace management
-epoc/config.h EPOC port
+epoc/config.sh EPOC port config.sh template
+epoc/createpkg.pl EPOC port generate PKG file
epoc/epoc.c EPOC port
+epoc/epoc_stubs.c EPOC port
+epoc/epocish.c EPOC port
epoc/epocish.h EPOC port
-epoc/perl.mmp EPOC port
-epoc/perl.pkg EPOC port
+epoc/link.pl EPOC port link a exe
ext/B/B.pm Compiler backend support functions and methods
ext/B/B.xs Compiler backend external subroutines
ext/B/B/Asmdata.pm Compiler backend data for assembler
ext/DB_File/Makefile.PL Berkeley DB extension makefile writer
ext/DB_File/dbinfo Berkeley DB database version checker
ext/DB_File/hints/dynixptx.pl Hint for DB_File for named architecture
+ext/DB_File/hints/sco.pl Hint for DB_File for named architecture
ext/DB_File/typemap Berkeley DB extension interface types
ext/DB_File/version.c Berkeley DB extension interface version check
ext/Data/Dumper/Changes Data pretty printer, changelog
ext/DynaLoader/DynaLoader_pm.PL Dynamic Loader perl module
ext/DynaLoader/Makefile.PL Dynamic Loader makefile writer
ext/DynaLoader/README Dynamic Loader notes and intro
+ext/DynaLoader/XSLoader_pm.PL Simple XS Loader perl module
ext/DynaLoader/dl_aix.xs AIX implementation
ext/DynaLoader/dl_beos.xs BeOS implementation
-ext/DynaLoader/dl_cygwin.xs Cygwin implementation
ext/DynaLoader/dl_dld.xs GNU dld style implementation
ext/DynaLoader/dl_dlopen.xs BSD/SunOS4&5 dlopen() style implementation
ext/DynaLoader/dl_hpux.xs HP-UX implementation
ext/DynaLoader/dl_vmesa.xs VM/ESA implementation
ext/DynaLoader/dl_vms.xs VMS implementation
ext/DynaLoader/dlutils.c Dynamic loader utilities for dl_*.xs files
+ext/DynaLoader/hints/aix.pl Hint for DynaLoader for named architecture
ext/DynaLoader/hints/linux.pl Hint for DynaLoader for named architecture
+ext/DynaLoader/hints/openbsd.pl Hint for DynaLoader for named architecture
ext/Errno/ChangeLog Errno perl module change log
ext/Errno/Errno_pm.PL Errno perl module create script
ext/Errno/Makefile.PL Errno extension makefile writer
ext/Fcntl/Fcntl.pm Fcntl extension Perl module
ext/Fcntl/Fcntl.xs Fcntl extension external subroutines
ext/Fcntl/Makefile.PL Fcntl extension makefile writer
+ext/File/Glob/Changes File::Glob extension changelog
+ext/File/Glob/Glob.pm File::Glob extension module
+ext/File/Glob/Glob.xs File::Glob extension external subroutines
+ext/File/Glob/Makefile.PL File::Glob extension makefile writer
+ext/File/Glob/TODO File::Glob extension todo list
+ext/File/Glob/bsd_glob.c File::Glob extension run time code
+ext/File/Glob/bsd_glob.h File::Glob extension header file
ext/GDBM_File/GDBM_File.pm GDBM extension Perl module
ext/GDBM_File/GDBM_File.xs GDBM extension external subroutines
ext/GDBM_File/Makefile.PL GDBM extension makefile writer
ext/IPC/SysV/Semaphore.pm IPC::SysV extension Perl module
ext/IPC/SysV/SysV.pm IPC::SysV extension Perl module
ext/IPC/SysV/SysV.xs IPC::SysV extension Perl module
+ext/IPC/SysV/hints/cygwin.pl Hint for IPC::SysV for named architecture
ext/IPC/SysV/hints/next_3.pl Hint for IPC::SysV for named architecture
ext/IPC/SysV/t/msg.t IPC::SysV extension Perl module
ext/IPC/SysV/t/sem.t IPC::SysV extension Perl module
ext/NDBM_File/Makefile.PL NDBM extension makefile writer
ext/NDBM_File/NDBM_File.pm NDBM extension Perl module
ext/NDBM_File/NDBM_File.xs NDBM extension external subroutines
+ext/NDBM_File/hints/cygwin.pl Hint for NDBM_File for named architecture
ext/NDBM_File/hints/dec_osf.pl Hint for NDBM_File for named architecture
ext/NDBM_File/hints/dynixptx.pl Hint for NDBM_File for named architecture
ext/NDBM_File/hints/solaris.pl Hint for NDBM_File for named architecture
+ext/NDBM_File/hints/sco.pl Hint for NDBM_File for named architecture
ext/NDBM_File/hints/svr4.pl Hint for NDBM_File for named architecture
ext/NDBM_File/typemap NDBM extension interface types
ext/ODBM_File/Makefile.PL ODBM extension makefile writer
ext/ODBM_File/ODBM_File.pm ODBM extension Perl module
ext/ODBM_File/ODBM_File.xs ODBM extension external subroutines
+ext/ODBM_File/hints/cygwin.pl Hint for ODBM_File for named architecture
ext/ODBM_File/hints/dec_osf.pl Hint for ODBM_File for named architecture
ext/ODBM_File/hints/hpux.pl Hint for ODBM_File for named architecture
ext/ODBM_File/hints/sco.pl Hint for ODBM_File for named architecture
jpl/JNI/Changes Java Native Interface changes
jpl/JNI/Closer.java Java Native Interface example
jpl/JNI/JNI.pm Java Native Interface module
-jpl/JNI/JNI.pm Java Native Interface module
+jpl/JNI/JNI.xs Java Native Interface module
jpl/JNI/JNIConfig Java Native Interface config
jpl/JNI/JNIConfig.Win32 Java Native Interface config
jpl/JNI/JNIConfig.kaffe Java Native Interface config
lib/Pod/Functions.pm used by pod/splitpod
lib/Pod/Html.pm Convert POD data to HTML
lib/Pod/InputObjects.pm Pod-Parser - define objects for input streams
+lib/Pod/Man.pm Convert POD data to *roff
lib/Pod/Parser.pm Pod-Parser - define base class for parsing POD
-lib/Pod/PlainText.pm Pod-Parser - convert POD data to formatted ASCII text
lib/Pod/Select.pm Pod-Parser - select portions of POD docs
-lib/Pod/Text.pm Convert POD data to formatted ASCII text
+lib/Pod/Text.pm Pod-Parser - convert POD data to formatted ASCII text
lib/Pod/Text/Color.pm Convert POD data to color ASCII text
lib/Pod/Text/Termcap.pm Convert POD data to ASCII text with format escapes
lib/Pod/Usage.pm Pod-Parser - print usage messages
lib/bigint.pl An arbitrary precision integer arithmetic package
lib/bigrat.pl An arbitrary precision rational arithmetic package
lib/blib.pm For "use blib"
+lib/byte.pm Pragma to enable byte operations
+lib/byte_heavy.pl Support routines for byte pragma
lib/cacheout.pl Manages output filehandles when you need too many
lib/caller.pm Inherit pragmatic attributes from caller's context
lib/charnames.pm Character names
lib/timelocal.pl Perl library supporting inverse of localtime, gmtime
lib/unicode/ArabLink.pl Unicode character database
lib/unicode/ArabLnkGrp.pl Unicode character database
+lib/unicode/ArabShap.txt Unicode character database
lib/unicode/Bidirectional.pl Unicode character database
lib/unicode/Block.pl Unicode character database
+lib/unicode/Blocks.txt Unicode character database
lib/unicode/Category.pl Unicode character database
lib/unicode/CombiningClass.pl Unicode character database
+lib/unicode/CompExcl.txt Unicode character database
lib/unicode/Decomposition.pl Unicode character database
-lib/unicode/Eq/Latin1 Unicode character database
-lib/unicode/Eq/Unicode Unicode character database
+lib/unicode/EAWidth.txt Unicode character database
+lib/unicode/Eq/Latin1.pl Unicode character database
+lib/unicode/Eq/Unicode.pl Unicode character database
lib/unicode/In/AlphabeticPresentationForms.pl Unicode character database
lib/unicode/In/Arabic.pl Unicode character database
lib/unicode/In/ArabicPresentationForms-A.pl Unicode character database
lib/unicode/In/Bengali.pl Unicode character database
lib/unicode/In/BlockElements.pl Unicode character database
lib/unicode/In/Bopomofo.pl Unicode character database
+lib/unicode/In/BopomofoExtended.pl Unicode character database
lib/unicode/In/BoxDrawing.pl Unicode character database
+lib/unicode/In/BraillePatterns.pl Unicode character database
lib/unicode/In/CJKCompatibility.pl Unicode character database
lib/unicode/In/CJKCompatibilityForms.pl Unicode character database
lib/unicode/In/CJKCompatibilityIdeographs.pl Unicode character database
+lib/unicode/In/CJKRadicalsSupplement.pl Unicode character database
lib/unicode/In/CJKSymbolsandPunctuation.pl Unicode character database
lib/unicode/In/CJKUnifiedIdeographs.pl Unicode character database
+lib/unicode/In/CJKUnifiedIdeographsExtensionA.pl Unicode character database
+lib/unicode/In/Cherokee.pl Unicode character database
lib/unicode/In/CombiningDiacriticalMarks.pl Unicode character database
lib/unicode/In/CombiningHalfMarks.pl Unicode character database
lib/unicode/In/CombiningMarksforSymbols.pl Unicode character database
lib/unicode/In/HighSurrogates.pl Unicode character database
lib/unicode/In/Hiragana.pl Unicode character database
lib/unicode/In/IPAExtensions.pl Unicode character database
+lib/unicode/In/IdeographicDescriptionCharacters.pl Unicode character database
lib/unicode/In/Kanbun.pl Unicode character database
+lib/unicode/In/KangxiRadicals.pl Unicode character database
lib/unicode/In/Kannada.pl Unicode character database
lib/unicode/In/Katakana.pl Unicode character database
+lib/unicode/In/Khmer.pl Unicode character database
lib/unicode/In/Lao.pl Unicode character database
lib/unicode/In/Latin-1Supplement.pl Unicode character database
lib/unicode/In/LatinExtended-A.pl Unicode character database
lib/unicode/In/MathematicalOperators.pl Unicode character database
lib/unicode/In/MiscellaneousSymbols.pl Unicode character database
lib/unicode/In/MiscellaneousTechnical.pl Unicode character database
+lib/unicode/In/Mongolian.pl Unicode character database
+lib/unicode/In/Myanmar.pl Unicode character database
lib/unicode/In/NumberForms.pl Unicode character database
+lib/unicode/In/Ogham.pl Unicode character database
lib/unicode/In/OpticalCharacterRecognition.pl Unicode character database
lib/unicode/In/Oriya.pl Unicode character database
lib/unicode/In/PrivateUse.pl Unicode character database
+lib/unicode/In/Runic.pl Unicode character database
+lib/unicode/In/Sinhala.pl Unicode character database
lib/unicode/In/SmallFormVariants.pl Unicode character database
lib/unicode/In/SpacingModifierLetters.pl Unicode character database
lib/unicode/In/Specials.pl Unicode character database
lib/unicode/In/SuperscriptsandSubscripts.pl Unicode character database
+lib/unicode/In/Syriac.pl Unicode character database
lib/unicode/In/Tamil.pl Unicode character database
lib/unicode/In/Telugu.pl Unicode character database
+lib/unicode/In/Thaana.pl Unicode character database
lib/unicode/In/Thai.pl Unicode character database
lib/unicode/In/Tibetan.pl Unicode character database
+lib/unicode/In/UnifiedCanadianAboriginalSyllabics.pl Unicode character database
+lib/unicode/In/YiRadicals.pl Unicode character database
+lib/unicode/In/YiSyllables.pl Unicode character database
+lib/unicode/Index.txt Unicode character database
lib/unicode/Is/ASCII.pl Unicode character database
lib/unicode/Is/Alnum.pl Unicode character database
lib/unicode/Is/Alpha.pl Unicode character database
lib/unicode/Is/SylC.pl Unicode character database
lib/unicode/Is/SylE.pl Unicode character database
lib/unicode/Is/SylI.pl Unicode character database
-lib/unicode/Is/Syllable.pl Unicode character database
lib/unicode/Is/SylO.pl Unicode character database
lib/unicode/Is/SylU.pl Unicode character database
lib/unicode/Is/SylV.pl Unicode character database
lib/unicode/Is/SylWE.pl Unicode character database
lib/unicode/Is/SylWI.pl Unicode character database
lib/unicode/Is/SylWV.pl Unicode character database
+lib/unicode/Is/Syllable.pl Unicode character database
lib/unicode/Is/Upper.pl Unicode character database
lib/unicode/Is/Word.pl Unicode character database
lib/unicode/Is/XDigit.pl Unicode character database
lib/unicode/Is/Zl.pl Unicode character database
lib/unicode/Is/Zp.pl Unicode character database
lib/unicode/Is/Zs.pl Unicode character database
+lib/unicode/Jamo.txt Unicode character database
lib/unicode/JamoShort.pl Unicode character database
+lib/unicode/LineBrk.txt Unicode character database
lib/unicode/Makefile Unicode character database
lib/unicode/Name.pl Unicode character database
+lib/unicode/Names.txt Unicode character database
+lib/unicode/NamesList.html Unicode character database
lib/unicode/Number.pl Unicode character database
+lib/unicode/Props.txt Unicode character database
lib/unicode/README.Ethiopic Unicode character database
+lib/unicode/ReadMe.txt Unicode character database info
+lib/unicode/SpecCase.txt Unicode character database
lib/unicode/To/Digit.pl Unicode character database
lib/unicode/To/Lower.pl Unicode character database
lib/unicode/To/Title.pl Unicode character database
lib/unicode/To/Upper.pl Unicode character database
-lib/unicode/UnicodeData-Latest.txt Unicode character database
-lib/unicode/ArabShap.txt Unicode character database
-lib/unicode/Blocks.txt Unicode character database
-lib/unicode/CompExcl.txt Unicode character database
-lib/unicode/EAWidth.txt Unicode character database
-lib/unicode/Index.txt Unicode character database
-lib/unicode/Jamo-2.txt Unicode character database
-lib/unicode/LineBrk.txt Unicode character database
+lib/unicode/UCD300.html Unicode character database
+lib/unicode/Unicode.300 Unicode character database
+lib/unicode/Unicode3.html Unicode character database
lib/unicode/mktables.PL Unicode character database generator
-lib/unicode/Names.txt Unicode character database
-lib/unicode/Props.txt Unicode character database
-lib/unicode/ReadMe.txt Unicode character database info
-lib/unicode/SpecCase.txt Unicode character database
lib/unicode/syllables.txt Unicode character database
-lib/unicode/Unicode.html Unicode character database
lib/utf8.pm Pragma to control Unicode support
lib/utf8_heavy.pl Support routines for utf8 pragma
lib/validate.pl Perl library supporting wholesale file mode validation
os2/OS2/Process/Process.xs system() constants in a module
os2/OS2/REXX/Changes DLL access module
os2/OS2/REXX/MANIFEST DLL access module
+os2/OS2/REXX/DLL/Changes DLL access module
+os2/OS2/REXX/DLL/DLL.pm DLL access module
+os2/OS2/REXX/DLL/DLL.xs DLL access module
+os2/OS2/REXX/DLL/MANIFEST DLL access module
+os2/OS2/REXX/DLL/Makefile.PL DLL access module
os2/OS2/REXX/Makefile.PL DLL access module
os2/OS2/REXX/REXX.pm DLL access module
os2/OS2/REXX/REXX.xs DLL access module
os2/OS2/REXX/t/rx_cmprt.t DLL access module
os2/OS2/REXX/t/rx_dllld.t DLL access module
+os2/OS2/REXX/t/rx_emxrv.t DLL access module
os2/OS2/REXX/t/rx_objcall.t DLL access module
os2/OS2/REXX/t/rx_sql.test DLL access module
os2/OS2/REXX/t/rx_tiesql.test DLL access module
os2/OS2/REXX/t/rx_tieydb.t DLL access module
os2/OS2/REXX/t/rx_varset.t DLL access module
os2/OS2/REXX/t/rx_vrexx.t DLL access module
-os2/POSIX.mkfifo OS2-specific patch
os2/diff.configure Patches to Configure
os2/dl_os2.c Addon for dl_open
os2/dlfcn.h Addon for dl_open
pod/perlfaq7.pod Frequently Asked Questions, Part 7
pod/perlfaq8.pod Frequently Asked Questions, Part 8
pod/perlfaq9.pod Frequently Asked Questions, Part 9
+pod/perlfilter.pod Source filters info
+pod/perlfork.pod Info about fork()
pod/perlform.pod Format info
pod/perlfunc.pod Function info
pod/perlguts.pod Internals info
+pod/perlhack.pod Perl hackers guide
pod/perlhist.pod Perl history info
pod/perlipc.pod IPC info
pod/perllexwarn.pod Lexical Warnings info
t/io/fs.t See if directory manipulations work
t/io/inplace.t See if inplace editing works
t/io/iprefix.t See if inplace editing works with prefixes
+t/io/nargv.t See if nested ARGV stuff works
t/io/open.t See if open works
t/io/openpid.t See if open works for subprocesses
t/io/pipe.t See if secure pipes work
t/lib/findbin.t See if FindBin works
t/lib/gdbm.t See if GDBM_File works
t/lib/getopt.t See if Getopt::Std and Getopt::Long work
+t/lib/glob-basic.t See if File::Glob works
+t/lib/glob-case.t See if File::Glob works
+t/lib/glob-global.t See if File::Glob works
+t/lib/glob-taint.t See if File::Glob works
t/lib/gol-basic.t See if Getopt::Long works
t/lib/gol-compat.t See if Getopt::Long works
t/lib/gol-linkage.t See if Getopt::Long works
t/pod/included.xr Expected results for included.t
t/pod/lref.t Test L<...> sequences
t/pod/lref.xr Expected results for lref.t
+t/pod/multiline_items.t Test multiline =items
+t/pod/multiline_items.xr Test multiline =items
t/pod/nested_items.t Test nested =items
t/pod/nested_items.xr Expected results for nested_items.t
t/pod/nested_seqs.t Test nested interior sequences
t/pod/nested_seqs.xr Expected results for nested_seqs.t
t/pod/oneline_cmds.t Test single paragraph ==cmds
t/pod/oneline_cmds.xr Expected results for oneline_cmds.t
+t/pod/pod2usage.t Test Pod::Usage
+t/pod/pod2usage.xr Expected results for pod2usage.t
t/pod/poderrs.t Test POD errors
t/pod/poderrs.xr Expected results for emptycmd.t
+t/pod/podselect.t Test Pod::Select
+t/pod/podselect.xr Expected results for podselect.t
t/pod/special_seqs.t Test "special" interior sequences
t/pod/special_seqs.xr Expected results for emptycmd.t
t/pod/testcmp.pl Module to compare output against expected results
win32/config_sh.PL Perl code to update Win32 config.sh from Makefile
win32/des_fcrypt.patch Win32 port
win32/dl_win32.xs Win32 port
+win32/genmk95.pl Perl code to generate command.com-usable makefile.95
win32/include/arpa/inet.h Win32 port
win32/include/dirent.h Win32 port
win32/include/netdb.h Win32 port
win32/include/sys/socket.h Win32 port
-win32/makefile.mk Win32 makefile for DMAKE (BC++, VC++ builds)
+win32/makefile.mk Win32 makefile for DMAKE (BC++, VC++ builds)
win32/perlglob.c Win32 port
+win32/perlhost.h Perl "host" implementation
win32/perllib.c Win32 port
win32/pod.mak Win32 port
win32/runperl.c Win32 port
win32/splittree.pl Win32 port
+win32/vdir.h Perl "host" virtual directory manager
+win32/vmem.h Perl "host" memory manager
win32/win32.c Win32 port
win32/win32.h Win32 port
win32/win32iop.h Win32 port
# how to tr(anslate) newlines
TRNL = '$trnl'
+# not used by Makefile but by installperl;
+# mentioned here so that metaconfig picks it up
+INSTALL_USR_BIN_PERL = $installusrbinperl
+
!GROK!THIS!
## In the following dollars and backticks do not need the extra backslash.
.c$(OBJ_EXT):
$(CCCMD) $(PLDLFLAGS) $*.c
-all: $(FIRSTMAKEFILE) miniperl $(private) $(plextract) $(public) $(dynamic_ext) $(nonxs_ext)
+all: $(FIRSTMAKEFILE) miniperl extra.pods $(private) $(public) $(dynamic_ext) $(nonxs_ext)
@echo " ";
@echo " Everything is up to date. 'make test' to run test suite."
translators: miniperl lib/Config.pm FORCE
@echo " "; echo " Making x2p stuff"; cd x2p; $(LDLIBPTH) $(MAKE) all
-utilities: miniperl lib/Config.pm FORCE
+utilities: miniperl lib/Config.pm $(plextract) FORCE
@echo " "; echo " Making utilities"; cd utils; $(LDLIBPTH) $(MAKE) all
FORCE:
@sh -c true
+opmini$(OBJ_EXT): op.c
+ $(CCCMD) $(PLDLFLAGS) -DPERL_EXTERNAL_GLOB -o opmini$(OBJ_EXT) op.c
+
miniperlmain$(OBJ_EXT): miniperlmain.c
$(CCCMD) $(PLDLFLAGS) $*.c
$(RMS) $(LIBPERL_NONSHR)
$(AR) rcu $(LIBPERL_NONSHR) perl$(OBJ_EXT) $(obj)
-$(MINIPERL_NONSHR): $(LIBPERL_NONSHR) miniperlmain$(OBJ_EXT)
- $(CC) $(LDFLAGS) -o $(MINIPERL_NONSHR) miniperlmain$(OBJ_EXT) $(LIBPERL_NONSHR) $(LIBS)
+$(MINIPERL_NONSHR): $(LIBPERL_NONSHR) miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT)
+ $(CC) $(LDFLAGS) -o $(MINIPERL_NONSHR) miniperlmain$(OBJ_EXT) \
+ opmini$(OBJ_EXT) $(LIBPERL_NONSHR) $(LIBS)
MINIPERLEXP = $(MINIPERL_NONSHR)
# build problems but that's not obvious to the novice.
# The Module used here must not depend on Config or any extensions.
-miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL)
- $(LDLIBPTH) $(CC) $(LARGE) $(CLDFLAGS) -o miniperl miniperlmain$(OBJ_EXT) $(LLIBPERL) $(libs)
- $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e 0 || $(MAKE) minitest
+!NO!SUBS!
+
+ case "${osname}${osvers}" in
+ next4*)
+ $spitshell >>Makefile <<'!NO!SUBS!'
+miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL) opmini$(OBJ_EXT)
+ $(CC) -o miniperl `echo $(obj) | sed 's/ op$(OBJ_EXT) / /'` \
+ miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) perl$(OBJ_EXT) $(libs)
+ $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
+!NO!SUBS!
+ ;;
+ *)
+ $spitshell >>Makefile <<'!NO!SUBS!'
+miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL) opmini$(OBJ_EXT)
+ $(LDLIBPTH) $(CC) $(LARGE) $(CLDFLAGS) -o miniperl \
+ miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) $(LLIBPERL) $(libs)
+ $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
+!NO!SUBS!
+ ;;
+ esac
+
+ $spitshell >>Makefile <<'!NO!SUBS!'
perl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT)
$(SHRPENV) $(LDLIBPTH) $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o perl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
# We have to call our ./makedir because Ultrix 4.3 make can't handle the line
# test -d lib/auto || mkdir lib/auto
#
-preplibrary: miniperl lib/Config.pm $(plextract)
+preplibrary: miniperl lib/Config.pm
@sh ./makedir lib/auto
@echo " AutoSplitting perl library"
$(LDLIBPTH) ./miniperl -Ilib -e 'use AutoSplit; \
# Take care to avoid modifying lib/Config.pm without reason
# (If trying to create a new port and having problems with the configpm script,
# try 'make minitest' and/or commenting out the tests at the end of configpm.)
-lib/Config.pm: config.sh miniperl configpm
+lib/Config.pm: config.sh miniperl configpm lib/re.pm
$(LDLIBPTH) ./miniperl configpm configpm.tmp
sh mv-if-diff configpm.tmp $@
rm -f $@
cat ext/re/re.pm > $@
-$(plextract): miniperl lib/Config.pm lib/re.pm
+$(plextract): miniperl lib/Config.pm
$(LDLIBPTH) ./miniperl -Ilib $@.PL
-
+
+extra.pods: miniperl
+ -@test -f extra.pods && rm -f `cat extra.pods`
+ -@rm -f extra.pods
+ -@for x in `grep -l '^=[a-z]' README.*` ; do \
+ nx=`echo $$x | sed -e "s/README\.//"`; \
+ $(LNS) ../$$x "pod/perl"$$nx".pod" ; \
+ echo "pod/perl"$$nx".pod" >> extra.pods ; \
+ done
+
install: all install.perl install.man
install.perl: all installperl
SYMH = perlvars.h intrpvar.h thrdvar.h
+CHMOD_W = chmod +w
+
# The following files are generated automatically
# keywords.h: keywords.pl
# opcode.h: opcode.pl
# To force them to run, type
# make regen_headers
regen_headers: FORCE
+ $(CHMOD_W) proto.h warnings.h lib/warnings.pm
perl keywords.pl
perl opcode.pl
perl embed.pl
# Do not 'make _mopup' directly.
_mopup:
rm -f *$(OBJ_EXT) *$(LIB_EXT) all perlmain.c
- rm -f perl.exp ext.libs
+ -@test -f extra.pods && rm -f `cat extra.pods`
+ -rm -f perl.exp ext.libs extra.pods
-rm -f perl.export perl.dll perl.libexp perl.map perl.def
-rm -f perl.loadmap miniperl.loadmap perl.prelmap miniperl.prelmap
rm -f perl suidperl miniperl $(LIBPERL)
'') perladmin='$perladmin' ;;
esac
-# Installation prefix. Allow a Configure -D override. You
+# Installation prefixes. Allow a Configure -D override. You
# may wish to reinstall perl under a different prefix, perhaps
# in order to test a different configuration.
+# For an explanation of the installation directories, see the
+# INSTALL file section on "Installation Directories".
case "\$prefix" in
'') prefix='$prefix' ;;
esac
+case "\$siteprefix" in
+'') siteprefix='$siteprefix' ;;
+esac
+case "\$vendorprefix" in
+'') vendorprefix='$vendorprefix' ;;
+esac
+
+# Where installperl puts things.
+case "\$installprefix" in
+'') installprefix='$installprefix' ;;
+esac
# Installation directives. Note that each one comes in three flavors.
# For example, we have privlib, privlibexp, and installprivlib.
# out automatically by Configure, so you don't have to include it here.
# installprivlib is for systems (such as those running AFS) that
# need to distinguish between the place where things
-# get installed and where they finally will reside.
+# get installed and where they finally will reside. As of 5.005_6x,
+# this too is handled automatically by Configure based on
+# $installprefix, so it isn't included here either.
+#
+# Note also that there are three broad hierarchies of installation
+# directories, as discussed in the INSTALL file under
+# "Installation Directories":
+#
+# =item Directories for the perl distribution
+#
+# =item Directories for site-specific add-on files
+#
+# =item Directories for vendor-supplied add-on files
+#
+# See Porting/Glossary for the definitions of these names, and see the
+# INSTALL file for further explanation and some examples.
#
# In each case, if your previous value was the default, leave it commented
# out. That way, if you override prefix, all of these will be
!GROK!THIS!
-for var in bin scriptdir privlib archlib \
- man1dir man3dir sitelib sitearch \
- installbin installscript installprivlib installarchlib \
- installman1dir installman3dir installsitelib installsitearch \
- man1ext man3ext; do
+for var in \
+ bin scriptdir privlib archlib man1dir man3dir html1dir html3dir \
+ sitebin sitescriptdir sitelib sitearch \
+ siteman1dir siteman3dir sitehtml1dir sitehtml3dir \
+ vendorbin vendorscript vendorlib vendorarch \
+ vendorman1 vendorman3 vendorhtml1 vendorhtml3
+do
case "$var" in
+
+ # Directories for the core perl components
bin) dflt=$prefix/bin ;;
# The scriptdir test is more complex, but this is probably usually ok.
scriptdir)
*) dflt=$prefix/lib/$package/$version ;;
esac
;;
- archlib)
- case "$prefix" in
- *perl*) dflt=$prefix/lib/$version/$archname ;;
- *) dflt=$prefix/lib/$package/$version/$archname ;;
- esac
+ archlib) dflt="$privlib/$archname" ;;
+
+ man1dir) dflt="$prefix/man/man1" ;;
+ man3dir) dflt="$prefix/man/man3" ;;
+ # Can we assume all sed's have greedy matching?
+ man1ext) dflt=`echo $man1dir | sed -e 's!.*man!!' -e 's!^\.!!'` ;;
+ man3ext) dflt=`echo $man3dir | sed -e 's!.*man!!' -e 's!^\.!!'` ;;
+
+ # We don't know what to do with these yet.
+ html1dir) dflt='' ;;
+ htm31dir) dflt='' ;;
+
+ # Directories for site-specific add-on files
+ sitebin) dflt=$siteprefix/bin ;;
+ # The scriptdir test is more complex, but this is probably usually ok.
+ sitescriptdir)
+ if $test -d $siteprefix/script; then
+ dflt=$siteprefix/script
+ else
+ dflt=$sitebin
+ fi
;;
sitelib)
- case "$prefix" in
- *perl*) dflt=$prefix/lib/site_perl/$apiversion ;;
- *) dflt=$prefix/lib/$package/site_perl/$apiversion ;;
- esac
- ;;
- sitearch)
- case "$prefix" in
- *perl*) dflt=$prefix/lib/site_perl/$apiversion/$archname ;;
- *) dflt=$prefix/lib/$package/site_perl/$apiversion/$archname ;;
- esac
- ;;
- man1dir) dflt="$prefix/man/man1" ;;
- man3dir)
- case "$prefix" in
- *perl*) dflt=`echo $man1dir |
- sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'` ;;
- *) dflt=$privlib/man/man3 ;;
+ case "$siteprefix" in
+ *perl*) dflt=$prefix/lib/site_perl ;;
+ *) dflt=$prefix/lib/$package/site_perl ;;
esac
;;
+ sitearch) dflt="$sitelib/$apiversion/$archname" ;;
- # Can we assume all sed's have greedy matching?
- man1ext) dflt=`echo $man1dir | sed -e 's!.*man!!' -e 's!^\.!!'` ;;
- man3ext) dflt=`echo $man3dir | sed -e 's!.*man!!' -e 's!^\.!!'` ;;
+ siteman1dir) dflt="$siteprefix/man/man1" ;;
+ siteman3dir) dflt="$siteprefix/man/man3" ;;
+ # We don't know what to do with these yet.
+ sitehtml1dir) dflt='' ;;
+ sitehtm31dir) dflt='' ;;
+
+ # Directories for vendor-supplied add-on files
+ # These are all usually empty.
+ vendor*)
+ if test X"$vendorprefix" = X""; then
+ dflt=''
+ else
+ case "$var" in
+ vendorbin) dflt=$vendorprefix/bin ;;
- # It might be possible to fool these next tests. Please let
- # me know if they don't work right for you.
- installbin) dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;;
- installscript) dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;;
- installprivlib) dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
- installarchlib) dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;;
- installsitelib) dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;;
- installsitearch) dflt=`echo $sitearchexp | sed 's#^/afs/#/afs/.#'`;;
- installman1dir) dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;;
- installman3dir) dflt=`echo $man3direxp | sed 's#^/afs/#/afs/.#'`;;
+ # The scriptdir test is more complex,
+ # but this is probably usually ok.
+ vendorscriptdir)
+ if $test -d $vendorprefix/script; then
+ dflt=$vendorprefix/script
+ else
+ dflt=$vendorbin
+ fi
+ ;;
+ vendorlib)
+ case "$vendorprefix" in
+ *perl*) dflt=$prefix/lib/vendor_perl ;;
+ *) dflt=$prefix/lib/$package/vendor_perl ;;
+ esac
+ ;;
+ vendorarch) dflt="$vendorlib/$apiversion/$archname" ;;
+
+ vendorman1dir) dflt="$vendorprefix/man/man1" ;;
+ vendorman3dir) dflt="$vendorprefix/man/man3" ;;
+ # We don't know what to do with these yet.
+ vendorhtml1dir) dflt='' ;;
+ vendorhtm31dir) dflt='' ;;
+
+ esac # End of vendorprefix != ''
+ fi
+ ;;
esac
eval val="\$$var"
# The original design for this Policy.sh file came from Wayne Davison,
# maintainer of trn.
# This version for Perl5.004_61 originally written by
-# Andy Dougherty <doughera@lafcol.lafayette.edu>.
+# Andy Dougherty <doughera@lafayette.edu>.
# This file may be distributed under the same terms as Perl itself.
-
host name. The command is fully qualified by its absolute path, to make
it safe when used by a process with super-user privileges.
-apiversion (patchlevel.U):
- This is a number which identifies the lowest version of perl
- to have an API (for XS extensions) compatible with the present
- version. For example, for 5.005_01, the apiversion should be
- 5.005, since 5.005_01 should be binary compatible with 5.005.
- This should probably be incremented manually somehow, perhaps
- from patchlevel.h. For now, we'll guess maintenance subversions
- will retain binary compatibility.
+api_revision (patchlevel.U):
+ The three variables, api_revision, api_version, and
+ api_subversion, specify the version of the oldest perl binary
+ compatible with the present perl. In a full version string
+ such as '5.6.1', api_revision is the '5'.
+ Prior to 5.5.640, the format was a floating point number,
+ like 5.00563.
+ perl.c:incpush() and lib/lib.pm will automatically search in
+ $sitelib/.. for older directories back to the limit specified
+ by these api_ variables. This is only useful if you have a
+ perl library directory tree structured like the default one.
+ See INSTALL for how this works. The versioned site_perl
+ directory was introduced in 5.005, so that is the lowest
+ possible value. The version list appropriate for the current
+ system is determined in inc_version_list.U.
+ XXX To do: Since compatibility can depend on compile time
+ options (such as bincompat, longlong, etc.) it should
+ (perhaps) be set by Configure, but currently it isn't.
+ Currently, we read a hard-wired value from patchlevel.h.
+ Perhaps what we ought to do is take the hard-wired value from
+ patchlevel.h but then modify it if the current Configure
+ options warrant. patchlevel.h then would use an #ifdef guard.
+
+api_subversion (patchlevel.U):
+ The three variables, api_revision, api_version, and
+ api_subversion, specify the version of the oldest perl binary
+ compatible with the present perl. In a full version string
+ such as '5.6.1', api_subversion is the '1'. See api_revision for
+ full details.
+
+api_version (patchlevel.U):
+ The three variables, api_revision, api_version, and
+ api_subversion, specify the version of the oldest perl binary
+ compatible with the present perl. In a full version string
+ such as '5.6.1', api_version is the '6'. See api_revision for
+ full details. As a special case, 5.5.0 is rendered in the
+ old-style as 5.005. (In the 5.005_0x maintenance series,
+ this was the only versioned directory in $sitelib.)
+
+api_versionstring (patchlevel.U):
+ This variable combines api_revision, api_version, and
+ api_subversion in a format such as 5.6.1 (or 5_6_1) suitable
+ for use as a directory name. This is filesystem dependent.
ar (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the ar program. After Configure runs,
the value is reset to a plain "ar" and is not useful.
include os2/os2.obj.
awk (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the awk program. After Configure runs,
the value is reset to a plain "awk" and is not useful.
The value is a plain '' and is not useful.
byacc (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the byacc program. After Configure runs,
the value is reset to a plain "byacc" and is not useful.
4 = couldn't cast in argument expression list
cat (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the cat program. After Configure runs,
the value is reset to a plain "cat" and is not useful.
Holds the output of the "date" command when the configuration file was
produced. This is used to tag both config.sh and config_h.SH.
+charsize (charsize.U):
+ This variable contains the value of the CHARSIZE symbol, which
+ indicates to the C program how many bytes there are in a character.
+
chgrp (Loc.U):
This variable is defined but not used by Configure.
The value is a plain '' and is not useful.
included).
comm (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the comm program. After Configure runs,
the value is reset to a plain "comm" and is not useful.
This variable is defined but not used by Configure.
The value is a plain '' and is not useful.
+CONFIGDOTSH (Oldsyms.U):
+ This is set to 'true' in config.sh so that a shell script
+ sourcing config.sh can tell if it has been sourced already.
+
contains (contains.U):
This variable holds the command to do a grep with a proper return
status. On most sane systems it is simply "grep". On insane systems
is primarily for the use of other Configure units.
cp (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the cp program. After Configure runs,
the value is reset to a plain "cp" and is not useful.
The value is a plain '' and is not useful.
cpp (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the cpp program. After Configure runs,
the value is reset to a plain "cpp" and is not useful.
used by the C preprocessor.
cppccsymbols (Cppsym.U):
- The variable contains the symbols defined by the C compiler when
+ The variable contains the symbols defined by the C compiler
when it calls cpp. The symbols defined by the cc alone or cpp
alone are not in this list, see ccsymbols and cppsymbols.
The list is a space-separated list of symbol=value tokens.
up to the Makefile to use this.
csh (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the csh program. After Configure runs,
the value is reset to a plain "csh" and is not useful.
This variable conditionally defines HAS_CLOSEDIR if closedir() is
available.
-d_cmsghdr_s (d_socket.U):
- This variable conditionally defines the HAS_STRUCT_CMSGHDR symbol,
- which indicates that the the struct cmsghdr is supported.
-
d_const (d_const.U):
This variable conditionally defines the HASCONST symbol, which
indicates to the C program that this C compiler knows about the
d_fpos64_t (io64.U):
This symbol will be defined if the C compiler supports fpos64_t.
+d_fs_data_s (d_fs_data_s.U):
+ This variable conditionally defines the HAS_STRUCT_FS_DATA symbol,
+ which indicates that the struct fs_data is supported.
+
d_fseeko (d_fseeko.U):
This variable conditionally defines the HAS_FSEEKO symbol, which
indicates to the C program that the fseeko() routine is available.
This variable conditionally defines HAS_FSETPOS if fsetpos() is
available to set the file position indicator.
-d_fstatfs (d_statfs.U):
+d_fstatfs (d_fstatfs.U):
This variable conditionally defines the HAS_FSTATFS symbol, which
indicates to the C program that the fstatfs() routine is available.
indicates to the C program that the getlogin() routine is available
to get the login name.
+d_getmnt (d_getmnt.U):
+ This variable conditionally defines the HAS_GETMNT symbol, which
+ indicates to the C program that the getmnt() routine is available
+ to retrieve one or more mount info blocks by filename.
+
d_getmntent (d_getmntent.U):
This variable conditionally defines the HAS_GETMNTENT symbol, which
indicates to the C program that the getmntent() routine is available
- to iterate through mounted files.
+ to iterate through mounted files to get their mount info.
d_getnbyaddr (d_getnbyad.U):
This variable conditionally defines the HAS_GETNETBYADDR symbol, which
indicates to the C program that the inet_aton() function is available
to parse IP address "dotted-quad" strings.
-d_int64t (i_inttypes.U):
+d_int64t (d_int64t.U):
This symbol will be defined if the C compiler supports int64_t.
-d_iovec_s (i_sysuio.U):
- This variable conditionally defines the HAS_STRUCT_IOVEC symbol,
- which indicates that the struct iovec is supported.
-
d_isascii (d_isascii.U):
This variable conditionally defines the HAS_ISASCII constant,
which indicates to the C program that isascii() is available.
This variable conditionally defines HAS_LINK if link() is
available to create hard links.
-d_llseek (io64.U):
- This variable conditionally defines the HAS_LLSEEK symbol, which
- indicates to the C program that the llseek() routine is available.
-
d_locconv (d_locconv.U):
This variable conditionally defines HAS_LOCALECONV if localeconv() is
available for numeric and monetary formatting conventions.
This variable conditionally defines HAS_LSTAT if lstat() is
available to do file stats on symbolic links.
-d_madvise (d_madvise.U):
- This variable conditionally defines HAS_MADVISE if madvise() is
- available to map a file into memory.
-
d_mblen (d_mblen.U):
This variable conditionally defines the HAS_MBLEN symbol, which
indicates to the C program that the mblen() routine is available
This variable conditionally defines the HAS_MKTIME symbol, which
indicates to the C program that the mktime() routine is available.
-d_mmap (d_mmap.U):
- This variable conditionally defines HAS_MMAP if mmap() is
- available to map a file into memory.
-
-d_mprotect (d_mprotect.U):
- This variable conditionally defines HAS_MPROTECT if mprotect() is
- available to modify the access protection of a memory mapped file.
-
d_msg (d_msg.U):
This variable conditionally defines the HAS_MSG symbol, which
indicates that the entire msg*(2) library is present.
This variable conditionally defines the HAS_MSGGET symbol, which
indicates to the C program that the msgget() routine is available.
-d_msghdr_s (d_socket.U):
- This variable conditionally defines the HAS_STRUCT_MSGHDR symbol,
- which indicates that the struct msghdr is supported.
-
d_msgrcv (d_msgrcv.U):
This variable conditionally defines the HAS_MSGRCV symbol, which
indicates to the C program that the msgrcv() routine is available.
This variable conditionally defines the HAS_MSGSND symbol, which
indicates to the C program that the msgsnd() routine is available.
-d_msync (d_msync.U):
- This variable conditionally defines HAS_MSYNC if msync() is
- available to synchronize a mapped file.
-
-d_munmap (d_munmap.U):
- This variable conditionally defines HAS_MUNMAP if munmap() is
- available to unmap a region mapped by mmap().
-
d_mymalloc (mallocsrc.U):
This variable conditionally defines MYMALLOC in case other parts
of the source want to take special action if MYMALLOC is used.
This variable conditionally defines PWQUOTA, which indicates
that struct passwd contains pw_quota.
+d_quad (quadtype.U):
+ This variable, if defined, tells that there's a 64-bit integer type,
+ quadtype.
+
d_readdir (d_readdir.U):
This variable conditionally defines HAS_READDIR if readdir() is
available to read directory entries.
indicates to the C program that the readlink() routine is available
to read the value of a symbolic link.
-d_readv (d_readv.U):
- This variable conditionally defines the HAS_READV symbol, which
- indicates to the C program that the readv() routine is available.
-
-d_recvmsg (d_socket.U):
- This variable conditionally defines the HAS_RECVMSG symbol,
- which indicates that the recvmsg is supported.
-
d_rename (d_rename.U):
This variable conditionally defines the HAS_RENAME symbol, which
indicates to the C program that the rename() routine is available
This variable conditionally defines the HAS_SEMOP symbol, which
indicates to the C program that the semop() routine is available.
-d_sendmsg (d_socket.U):
- This variable conditionally defines the HAS_SENDMSG symbol,
- which indicates that the sendmsg is supported.
-
d_setegid (d_setegid.U):
This variable conditionally defines the HAS_SETEGID symbol, which
indicates to the C program that the setegid() routine is available
This variable conditionally defines the HAS_SOCKETPAIR symbol, which
indicates that the BSD socketpair() is supported.
+d_sqrtl (d_sqrtl.U):
+ This variable conditionally defines the HAS_SQRTL symbol, which
+ indicates to the C program that the sqrtl() routine is available.
+
d_statblks (d_statblks.U):
This variable conditionally defines USE_STAT_BLOCKS
if this system has a stat structure declaring
st_blksize and st_blocks.
-d_statfs (d_statfs.U):
- This variable conditionally defines the HAS_STATFS symbol, which
- indicates to the C program that the statfs() routine is available.
-
-d_statfsflags (d_statfs.U):
- This variable conditionally defines the HAS_STRUCT_STATFS_FLAGS
+d_statfs_f_flags (d_statfs_f_flags.U):
+ This variable conditionally defines the HAS_STRUCT_STATFS_F_FLAGS
symbol, which indicates to struct statfs from has f_flags member.
This kind of struct statfs is coming from sys/mount.h (BSD),
not from sys/statfs.h (SYSV).
+d_statfs_s (d_statfs_s.U):
+ This variable conditionally defines the HAS_STRUCT_STATFS symbol,
+ which indicates that the struct statfs is supported.
+
d_statvfs (d_statvfs.U):
This variable conditionally defines the HAS_STATVFS symbol, which
indicates to the C program that the statvfs() routine is available.
indicates to the C program that the strtol() routine is available
to provide better numeric string conversion than atoi() and friends.
+d_strtold (d_strtold.U):
+ This variable conditionally defines the HAS_STRTOLD symbol, which
+ indicates to the C program that the strtold() routine is available.
+
+d_strtoll (d_strtoll.U):
+ This variable conditionally defines the HAS_STRTOLL symbol, which
+ indicates to the C program that the strtoll() routine is available.
+
d_strtoul (d_strtoul.U):
This variable conditionally defines the HAS_STRTOUL symbol, which
indicates to the C program that the strtoul() routine is available
to provide conversion of strings to unsigned long.
-d_strtoull (strtoull.U):
+d_strtoull (d_strtoull.U):
This variable conditionally defines the HAS_STRTOULL symbol, which
indicates to the C program that the strtoull() routine is available.
+d_strtouq (d_strtouq.U):
+ This variable conditionally defines the HAS_STRTOUQ symbol, which
+ indicates to the C program that the strtouq() routine is available.
+
d_strxfrm (d_strxfrm.U):
This variable conditionally defines HAS_STRXFRM if strxfrm() is
available to transform strings.
This variable conditionally defines HAS_UNION_SEMUN if the
union semun is defined by including <sys/sem.h>.
+d_ustat (d_ustat.U):
+ This variable conditionally defines HAS_USTAT if ustat() is
+ available to query file system statistics by dev_t.
+
+d_vendorbin (vendorbin.U):
+ This variable conditionally defines PERL_VENDORBIN.
+
d_vendorlib (vendorlib.U):
This variable conditionally defines PERL_VENDORLIB.
indicates to the C program that the wctomb() routine is available
to convert a wide character to a multibyte.
-d_writev (d_writev.U):
- This variable conditionally defines the HAS_WRITEV symbol, which
- indicates to the C program that the writev() routine is available.
-
d_xenix (Guess.U):
This variable conditionally defines the symbol XENIX, which alerts
the C program that it runs under Xenix.
date (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the date program. After Configure runs,
the value is reset to a plain "date" and is not useful.
See trnl.U
echo (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the echo program. After Configure runs,
the value is reset to a plain "echo" and is not useful.
egrep (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the egrep program. After Configure runs,
the value is reset to a plain "egrep" and is not useful.
This is an old synonym for _exe.
expr (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the expr program. After Configure runs,
the value is reset to a plain "expr" and is not useful.
This variable is defined but not used by Configure.
The value is a plain '' and is not useful.
+fpossize (fpossize.U):
+ This variable contains the size of a fpostype in bytes.
+
fpostype (fpostype.U):
- This variable defines Fpos_t to be something like fpost_t, long,
+ This variable defines Fpos_t to be something like fpos_t, long,
uint, or whatever type is used to declare file positions in libc.
freetype (mallocsrc.U):
indicate whether the compiler is version 1 or 2. This is used in
setting some of the default cflags. It is set to '' if not gcc.
+gidformat (gidf.U):
+ This variable contains the format string used for printing a Gid_t.
+
+gidsign (gidsign.U):
+ This variable contains the signedness of a gidtype.
+ 1 for unsigned, -1 for signed.
+
+gidsize (gidsize.U):
+ This variable contains the size of a gidtype in bytes.
+
gidtype (gidtype.U):
This variable defines Gid_t to be something like gid_t, int,
ushort, or whatever type is used to declare the return type
this platform, libpth is the cleaned-up version.
grep (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the grep program. After Configure runs,
the value is reset to a plain "grep" and is not useful.
This variable contains a command that produces the text of the
/etc/group file. This is normally "cat /etc/group", but can be
"ypcat group" when NIS is used.
+ On some systems, such as os390, there may be no equivalent
+ command, in which case this variable is unset.
groupstype (groupstype.U):
This variable defines Groups_t to be something like gid_t, int,
gidtype (gid_t), but sometimes it isn't.
gzip (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the gzip program. After Configure runs,
the value is reset to a plain "gzip" and is not useful.
This variable contains a command that produces the text of the
/etc/hosts file. This is normally "cat /etc/hosts", but can be
"ypcat hosts" when NIS is used.
+ On some systems, such as os390, there may be no equivalent
+ command, in which case this variable is unset.
huge (models.U):
This variable contains a flag which will tell the C compiler and loader
huge model is not supported, contains the flag to produce large
model programs. It is up to the Makefile to use this.
+i16size (perlxv.U):
+ This variable is the size of an I16 in bytes.
+
+i16type (perlxv.U):
+ This variable contains the C type used for Perl's I16.
+
+i32size (perlxv.U):
+ This variable is the size of an I32 in bytes.
+
+i32type (perlxv.U):
+ This variable contains the C type used for Perl's I32.
+
+i64size (perlxv.U):
+ This variable is the size of an I64 in bytes.
+
+i64type (perlxv.U):
+ This variable contains the C type used for Perl's I64.
+
+i8size (perlxv.U):
+ This variable is the size of an I8 in bytes.
+
+i8type (perlxv.U):
+ This variable contains the C type used for Perl's I8.
+
i_arpainet (i_arpainet.U):
This variable conditionally defines the I_ARPA_INET symbol,
and indicates whether a C program should include <arpa/inet.h>.
indicates to the C program that <sys/ioctl.h> exists and should
be included.
-i_sysmman (i_sysmman.U):
- This variable conditionally defines the I_SYS_MMAN symbol, and
- indicates whether a C program should include <sys/mman.h>.
-
i_sysmount (i_sysmount.U):
This variable conditionally defines the I_SYSMOUNT symbol,
and indicates whether a C program should include <sys/mount.h>.
This variable conditionally defines the I_SYS_STAT symbol,
and indicates whether a C program should include <sys/stat.h>.
+i_sysstatfs (i_sysstatfs.U):
+ This variable conditionally defines the I_SYSSTATFS symbol,
+ and indicates whether a C program should include <sys/statfs.h>.
+
i_sysstatvfs (i_sysstatvfs.U):
This variable conditionally defines the I_SYSSTATVFS symbol,
and indicates whether a C program should include <sys/statvfs.h>.
to the C program that it should include <sys/un.h> to get UNIX
domain socket definitions.
+i_sysvfs (i_sysvfs.U):
+ This variable conditionally defines the I_SYSVFS symbol,
+ and indicates whether a C program should include <sys/vfs.h>.
+
i_syswait (i_syswait.U):
This variable conditionally defines I_SYS_WAIT, which indicates
to the C program that it should include <sys/wait.h>.
This variable conditionally defines the I_UNISTD symbol, and indicates
whether a C program should include <unistd.h>.
+i_ustat (i_ustat.U):
+ This variable conditionally defines the I_USTAT symbol, and indicates
+ whether a C program should include <ustat.h>.
+
i_utime (i_utime.U):
This variable conditionally defines the I_UTIME symbol, and indicates
whether a C program should include <utime.h>.
libraries (libfoo.so.x.y) are to be ignored (because they
cannot be linked against).
+inc_version_list (inc_version_list.U):
+ This variable specifies the list of subdirectories in over
+ which perl.c:incpush() and lib/lib.pm will automatically
+ search when adding directories to @INC. This is only useful
+ if you have a perl library directory tree structured like the
+ default one. See INSTALL for how this works. The versioned
+ site_perl directory was introduced in 5.005, so that is the
+ lowest possible value.
+
incpath (usrinc.U):
This variable must preceed the normal include path to get hte
right one, as in "$incpath/usr/include" or "$incpath/usr/lib".
those systems using AFS. For extra portability, only this variable
should be used in makefiles.
+installsitebin (sitebin.U):
+ This variable is usually the same as sitebinexp, unless you are on
+ a system running AFS, in which case they may differ slightly. You
+ should always use this variable within your makefiles for portability.
+
installsitelib (sitelib.U):
This variable is really the same as sitelibexp but may differ on
those systems using AFS. For extra portability, only this variable
/usr/bin/perl in addition to
$installbin/perl
+installvendorbin (vendorbin.U):
+ This variable is really the same as vendorbinexp but may differ on
+ those systems using AFS. For extra portability, only this variable
+ should be used in makefiles.
+
installvendorlib (vendorlib.U):
This variable is really the same as vendorlibexp but may differ on
those systems using AFS. For extra portability, only this variable
This variable contains the value of the INTSIZE symbol, which
indicates to the C program how many bytes there are in an int.
+ivdformat (perlxvf.U):
+ This variable contains the format string used for printing
+ a Perl IV as a signed decimal integer.
+
+ivsize (perlxv.U):
+ This variable is the size of an IV in bytes.
+
+ivtype (perlxv.U):
+ This variable contains the C type used for Perl's IV.
+
known_extensions (Extensions.U):
This variable holds a list of all XS extensions included in
the package.
string, the hints file must set this to 'none'.
less (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the less program. After Configure runs,
the value is reset to a plain "less" and is not useful.
the user. It is up to the Makefile to use this.
ln (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the ln program. After Configure runs,
the value is reset to a plain "ln" and is not useful.
The value is a plain '' and is not useful.
ls (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the ls program. After Configure runs,
the value is reset to a plain "ls" and is not useful.
The value is a plain '' and is not useful.
make (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the make program. After Configure runs,
the value is reset to a plain "make" and is not useful.
See man3dir.
Mcc (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the Mcc program. After Configure runs,
the value is reset to a plain "Mcc" and is not useful.
Possible values are "BSD 4.3" and "System V".
mkdir (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the mkdir program. After Configure runs,
the value is reset to a plain "mkdir" and is not useful.
-mmaptype (d_mmap.U):
- This symbol contains the type of pointer returned by mmap()
- (and simultaneously the type of the first argument).
- It can be 'void *' or 'caddr_t'.
-
models (models.U):
This variable contains the list of memory models supported by this
system. Possible component values are none, split, unsplit, small,
modes for system calls.
more (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the more program. After Configure runs,
the value is reset to a plain "more" and is not useful.
This is only useful if you have getnetbyaddr(), naturally.
nm (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the nm program. After Configure runs,
the value is reset to a plain "nm" and is not useful.
in the package. All of them will be built.
nroff (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the nroff program. After Configure runs,
the value is reset to a plain "nroff" and is not useful.
+nvsize (perlxv.U):
+ This variable is the size of an NV in bytes.
+
+nvtype (perlxv.U):
+ This variable contains the C type used for Perl's NV.
+
o_nonblock (nblock_io.U):
This variable bears the symbol value to be used during open() or fcntl()
to turn on non-blocking I/O for a file descriptor. If you wish to switch
This variable contains a command that produces the text of the
/etc/passwd file. This is normally "cat /etc/passwd", but can be
"ypcat passwd" when NIS is used.
+ On some systems, such as os390, there may be no equivalent
+ command, in which case this variable is unset.
patchlevel (patchlevel.U):
The patchlevel level of this package.
The value of patchlevel comes from the patchlevel.h file.
+ In a version number such as 5.6.1, this is the "6".
+ In patchlevel.h, this is referred to as the "PERL_VERSION".
path_sep (Unix.U):
This is an old synonym for p_ in Head.U, the character
used to separate elements in the command shell search PATH.
perl (Loc.U):
- This variable is defined but not used by Configure.
- The value is a plain '' and is not useful.
+ This variable is used internally by Configure to determine the
+ full pathname (if any) of the perl program. After Configure runs,
+ the value is reset to a plain "perl" and is not useful.
+
+PERL_REVISION (Oldsyms.U):
+ In a Perl version number such as 5.6.2, this is the 5.
+ This value is manually set in patchlevel.h
+
+PERL_SUBVERSION (Oldsyms.U):
+ In a Perl version number such as 5.6.2, this is the 2.
+ Values greater than 50 represent potentially unstable
+ development subversions.
+ This value is manually set in patchlevel.h
+
+PERL_VERSION (Oldsyms.U):
+ In a Perl version number such as 5.6.2, this is the 6.
+ This value is manually set in patchlevel.h
perladmin (perladmin.U):
Electronic mail address of the perl5 administrator.
shell scripts and in the "eval 'exec'" idiom.
pg (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the pg program. After Configure runs,
the value is reset to a plain "pg" and is not useful.
This variable contains the value of the PTRSIZE symbol, which
indicates to the C program how many bytes there are in a pointer.
+quadkind (quadtype.U):
+ This variable, if defined, encodes the type of a quad:
+ 1 = int, 2 = long, 3 = long long, 4 = int64_t.
+
+quadtype (quadtype.U):
+ This variable defines Quad_t to be something like long, int,
+ long long, int64_t, or whatever type is used for 64-bit integers.
+
randbits (randfunc.U):
Indicates how many bits are produced by the function used to
generate normalized random numbers.
no data and an EOF.. Sigh!
rm (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the rm program. After Configure runs,
the value is reset to a plain "rm" and is not useful.
at configuration time, for programs not wanting to bother with it.
sed (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the sed program. After Configure runs,
the value is reset to a plain "sed" and is not useful.
which is the name of the private library for this package. It may
have a ~ on the front. It is up to the makefile to eventually create
this directory while performing installation (with ~ substitution).
+ The standard distribution will put nothing in this directory.
+ After perl has been installed, users may install their own local
+ architecture-dependent modules in this directory with
+ MakeMaker Makefile.PL
+ or equivalent. See INSTALL for details.
sitearchexp (sitearch.U):
This variable is the ~name expanded version of sitearch, so that you
may use it directly in Makefiles or shell scripts.
+sitebin (sitebin.U):
+ This variable holds the name of the directory in which the user wants
+ to put add-on publicly executable files for the package in question. It
+ is most often a local directory such as /usr/local/bin. Programs using
+ this variable must be prepared to deal with ~name substitution.
+ The standard distribution will put nothing in this directory.
+ After perl has been installed, users may install their own local
+ executables in this directory with
+ MakeMaker Makefile.PL
+ or equivalent. See INSTALL for details.
+
+sitebinexp (sitebin.U):
+ This is the same as the sitebin variable, but is filename expanded at
+ configuration time, for use in your makefiles.
+
sitelib (sitelib.U):
This variable contains the eventual value of the SITELIB symbol,
which is the name of the private library for this package. It may
have a ~ on the front. It is up to the makefile to eventually create
this directory while performing installation (with ~ substitution).
+ The standard distribution will put nothing in this directory.
+ After perl has been installed, users may install their own local
+ architecture-independent modules in this directory with
+ MakeMaker Makefile.PL
+ or equivalent. See INSTALL for details.
sitelibexp (sitelib.U):
This variable is the ~name expanded version of sitelib, so that you
siteprefix (siteprefix.U):
This variable holds the full absolute path of the directory below
which the user will install add-on packages.
+ See INSTALL for usage and examples.
siteprefixexp (siteprefix.U):
This variable holds the full absolute path of the directory below
This variable has the names of any libraries needed for socket support.
sort (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the sort program. After Configure runs,
the value is reset to a plain "sort" and is not useful.
subversion (patchlevel.U):
The subversion level of this package.
The value of subversion comes from the patchlevel.h file.
+ In a version number such as 5.6.1, this is the "1".
This is unique to perl.
sysman (sysman.U):
The value is a plain '' and is not useful.
test (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the test program. After Configure runs,
the value is reset to a plain "test" and is not useful.
included). Anyway, the type Time_t should be used.
touch (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the touch program. After Configure runs,
the value is reset to a plain "touch" and is not useful.
tr (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the tr program. After Configure runs,
the value is reset to a plain "tr" and is not useful.
This variable is defined but not used by Configure.
The value is a plain '' and is not useful.
+u16size (perlxv.U):
+ This variable is the size of an U16 in bytes.
+
+u16type (perlxv.U):
+ This variable contains the C type used for Perl's U16.
+
+u32size (perlxv.U):
+ This variable is the size of an U32 in bytes.
+
+u32type (perlxv.U):
+ This variable contains the C type used for Perl's U32.
+
+u64size (perlxv.U):
+ This variable is the size of an U64 in bytes.
+
+u64type (perlxv.U):
+ This variable contains the C type used for Perl's U64.
+
+u8size (perlxv.U):
+ This variable is the size of an U8 in bytes.
+
+u8type (perlxv.U):
+ This variable contains the C type used for Perl's U8.
+
+uidformat (uidf.U):
+ This variable contains the format string used for printing a Uid_t.
+
+uidsign (uidsign.U):
+ This variable contains the signedness of a uidtype.
+ 1 for unsigned, -1 for signed.
+
+uidsize (uidsize.U):
+ This variable contains the size of a uidtype in bytes.
+
uidtype (uidtype.U):
This variable defines Uid_t to be something like uid_t, int,
ushort, or whatever type is used to declare user ids in the kernel.
uname (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the uname program. After Configure runs,
the value is reset to a plain "uname" and is not useful.
uniq (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the uniq program. After Configure runs,
the value is reset to a plain "uniq" and is not useful.
+uquadtype (quadtype.U):
+ This variable defines Uquad_t to be something like unsigned long,
+ unsigned int, unsigned long long, uint64_t, or whatever type is
+ used for 64-bit integers.
+
+use5005threads (usethreads.U):
+ This variable conditionally defines the USE_5005THREADS symbol,
+ and indicates that Perl should be built to use the 5.005-based
+ threading implementation.
+
use64bits (use64bits.U):
This variable conditionally defines the USE_64_BITS symbol,
- and indicates that explicit 64-bit interfaces should be used
+ and indicates that 64-bit integer types should be used
when available.
usedl (dlsrc.U):
- This variable indicates if the the system supports dynamic
+ This variable indicates if the system supports dynamic
loading of some sort. See also dlsrc and dlobj.
-uselfs (uselfs.U):
+useithreads (usethreads.U):
+ This variable conditionally defines the USE_ITHREADS symbol,
+ and indicates that Perl should be built to use the interpreter-based
+ threading implementation.
+
+uselargefiles (uselfs.U):
This variable conditionally defines the USE_LARGE_FILES symbol,
and indicates that large file interfaces should be used when
available. The use64bits symbol will also be turned on if necessary.
This variable conditionally defines the USE_LONG_DOUBLE symbol,
and indicates that long doubles should be used when available.
+uselonglong (uselonglong.U):
+ This variable conditionally defines the USE_LONG_LONG symbol,
+ and indicates that long longs should be used when available.
+
usemorebits (usemorebits.U):
This variable conditionally defines the USE_MORE_BITS symbol,
and indicates that explicit 64-bit interfaces and long doubles
This variable is defined but not used by Configure.
The value is a plain '' and is not useful.
+uvoformat (perlxvf.U):
+ This variable contains the format string used for printing
+ a Perl UV as an unsigned octal integer.
+
+uvsize (perlxv.U):
+ This variable is the size of a UV in bytes.
+
+uvtype (perlxv.U):
+ This variable contains the C type used for Perl's UV.
+
+uvuformat (perlxvf.U):
+ This variable contains the format string used for printing
+ a Perl UV as an unsigned decimal integer.
+
+uvxformat (perlxvf.U):
+ This variable contains the format string used for printing
+ a Perl UV as an unsigned hexadecimal integer.
+
+vendorbin (vendorbin.U):
+ This variable contains the eventual value of the VENDORBIN symbol.
+ It may have a ~ on the front.
+ The standard distribution will put nothing in this directory.
+ Vendors who distribute perl may wish to place additional
+ binaries in this directory with
+ MakeMaker Makefile.PL INSTALLDIRS=vendor
+ or equivalent. See INSTALL for details.
+
+vendorbinexp (vendorbin.U):
+ This variable is the ~name expanded version of vendorbin, so that you
+ may use it directly in Makefiles or shell scripts.
+
vendorlib (vendorlib.U):
This variable contains the eventual value of the VENDORLIB symbol,
- which is the name of the private library for this package. It may
- have a ~ on the front. It is up to the makefile to eventually create
- this directory while performing installation (with ~ substitution).
- Vendors who distribute perl binaries may place their own
- extensions and modules in this directory.
+ which is the name of the private library for this package.
+ The standard distribution will put nothing in this directory.
+ Vendors who distribute perl may wish to place their own
+ modules in this directory with
+ MakeMaker Makefile.PL INSTALLDIRS=vendor
+ or equivalent. See INSTALL for details.
vendorlibexp (vendorlib.U):
This variable is the ~name expanded version of vendorlib, so that you
vendorprefix (vendorprefix.U):
This variable holds the full absolute path of the directory below
which the vendor will install add-on packages.
+ See INSTALL for usage and examples.
vendorprefixexp (vendorprefix.U):
This variable holds the full absolute path of the directory below
which the vendor will install add-on packages. Derived from vendorprefix.
version (patchlevel.U):
- The full version number of this package. This combines
- baserev, patchlevel, and subversion to get the full
- version number, including any possible subversions. Care
- is taken to use the C locale in order to get something
- like 5.004 instead of 5,004. This is unique to perl.
+ The full version number of this package, such as 5.6.1 (or 5_6_1).
+ This combines baserev, patchlevel, and subversion to get the
+ full version number, including any possible subversions.
+ This is suitable for use as a directory name, and hence is
+ filesystem dependent.
vi (Loc.U):
This variable is defined but not used by Configure.
The value is a plain '' and is not useful.
zip (Loc.U):
- This variable is be used internally by Configure to determine the
+ This variable is used internally by Configure to determine the
full pathname (if any) of the zip program. After Configure runs,
the value is reset to a plain "zip" and is not useful.
# Package name : perl5
# Source directory : .
-# Configuration time: Mon Sep 20 12:44:36 EET DST 1999
+# Configuration time: Sun Jan 16 21:10:53 EET 2000
# Configured by : jhi
# Target system : osf1 alpha.hut.fi v4.0 878 alpha
alignbytes='8'
ansi2knr=''
aphostname=''
-apiversion='5.00561'
+api_revision='5'
+api_subversion='640'
+api_version='5'
+api_versionstring='5.5.640'
ar='ar'
-archlib='/opt/perl/lib/5.00561/alpha-dec_osf-thread'
-archlibexp='/opt/perl/lib/5.00561/alpha-dec_osf-thread'
+archlib='/opt/perl/lib/5.5.640/alpha-dec_osf-thread-multi'
+archlibexp='/opt/perl/lib/5.5.640/alpha-dec_osf-thread-multi'
archname64=''
-archname='alpha-dec_osf-thread'
+archname='alpha-dec_osf-thread-multi'
archobjs=''
awk='awk'
baserev='5.0'
cat='cat'
cc='cc'
cccdlflags=' '
-ccdlflags=' -Wl,-rpath,/opt/perl/lib/5.00561/alpha-dec_osf-thread/CORE'
+ccdlflags=' -Wl,-rpath,/opt/perl/lib/5.5.640/alpha-dec_osf-thread-multi/CORE'
ccflags='-pthread -std -DLANGUAGE_C'
ccsymbols='__LANGUAGE_C__=1 _LONGLONG=1 LANGUAGE_C=1 SYSTYPE_BSD=1'
cf_by='jhi'
cf_email='yourname@yourhost.yourplace.com'
-cf_time='Mon Sep 20 12:44:36 EET DST 1999'
+cf_time='Sun Jan 16 21:10:53 EET 2000'
+charsize='1'
chgrp=''
chmod=''
chown=''
d_chroot='define'
d_chsize='undef'
d_closedir='define'
-d_cmsghdr_s='define'
d_const='define'
d_crypt='define'
d_csh='define'
d_fork='define'
d_fpathconf='define'
d_fpos64_t='undef'
+d_fs_data_s='undef'
d_fseeko='undef'
d_fsetpos='define'
d_fstatfs='define'
d_gethname='define'
d_gethostprotos='define'
d_getlogin='define'
+d_getmnt='undef'
d_getmntent='undef'
d_getnbyaddr='define'
d_getnbyname='define'
d_index='undef'
d_inetaton='define'
d_int64t='undef'
-d_iovec_s='define'
d_isascii='define'
d_killpg='define'
d_lchown='define'
d_ldbl_dig='define'
d_link='define'
-d_llseek='undef'
d_locconv='define'
d_lockf='define'
d_longdbl='define'
d_longlong='define'
d_lstat='define'
-d_madvise='define'
d_mblen='define'
d_mbstowcs='define'
d_mbtowc='define'
d_mkdir='define'
d_mkfifo='define'
d_mktime='define'
-d_mmap='define'
-d_mprotect='define'
d_msg='define'
d_msg_ctrunc='define'
d_msg_dontroute='define'
d_msg_proxy='undef'
d_msgctl='define'
d_msgget='define'
-d_msghdr_s='define'
d_msgrcv='define'
d_msgsnd='define'
-d_msync='define'
-d_munmap='define'
d_mymalloc='undef'
d_nice='define'
d_off64_t='undef'
d_pwgecos='define'
d_pwpasswd='define'
d_pwquota='define'
+d_quad='define'
d_readdir='define'
d_readlink='define'
-d_readv='define'
-d_recvmsg='define'
d_rename='define'
d_rewinddir='define'
d_rmdir='define'
d_semctl_semun='define'
d_semget='define'
d_semop='define'
-d_sendmsg='define'
d_setegid='define'
d_seteuid='define'
d_setgrent='define'
d_sigsetjmp='define'
d_socket='define'
d_sockpair='define'
+d_sqrtl='define'
d_statblks='define'
-d_statfs='define'
-d_statfsflags='define'
+d_statfs_f_flags='define'
+d_statfs_s='define'
d_statvfs='define'
d_stdio_cnt_lval='define'
d_stdio_ptr_lval='define'
d_strerror='define'
d_strtod='define'
d_strtol='define'
+d_strtold='undef'
+d_strtoll='undef'
d_strtoul='define'
d_strtoull='undef'
+d_strtouq='undef'
d_strxfrm='define'
d_suidsafe='undef'
d_symlink='define'
d_umask='define'
d_uname='define'
d_union_semun='undef'
+d_ustat='define'
+d_vendorbin='undef'
d_vendorlib='undef'
d_vfork='undef'
d_void_closedir='undef'
d_waitpid='define'
d_wcstombs='define'
d_wctomb='define'
-d_writev='define'
d_xenix='undef'
date='date'
db_hashtype='u_int32_t'
dlsrc='dl_dlopen.xs'
doublesize='8'
drand01='drand48()'
-dynamic_ext='B ByteLoader DB_File Data/Dumper Devel/DProf Devel/Peek Fcntl IO IPC/SysV NDBM_File ODBM_File Opcode POSIX SDBM_File Socket Thread attrs re'
+dynamic_ext='B ByteLoader DB_File Data/Dumper Devel/DProf Devel/Peek Fcntl File/Glob IO IPC/SysV NDBM_File ODBM_File Opcode POSIX SDBM_File Socket Thread attrs re'
eagain='EAGAIN'
ebcdic='undef'
echo='echo'
eunicefix=':'
exe_ext=''
expr='expr'
-extensions='B ByteLoader DB_File Data/Dumper Devel/DProf Devel/Peek Fcntl IO IPC/SysV NDBM_File ODBM_File Opcode POSIX SDBM_File Socket Thread attrs re Errno'
+extensions='B ByteLoader DB_File Data/Dumper Devel/DProf Devel/Peek Fcntl File/Glob IO IPC/SysV NDBM_File ODBM_File Opcode POSIX SDBM_File Socket Thread attrs re Errno'
fflushNULL='define'
fflushall='undef'
find=''
firstmakefile='makefile'
flex=''
+fpossize='8'
fpostype='fpos_t'
freetype='void'
full_ar='/usr/bin/ar'
full_csh='/usr/bin/csh'
full_sed='/usr/bin/sed'
gccversion=''
+gidformat='"u"'
+gidsign='1'
+gidsize='4'
gidtype='gid_t'
glibpth='/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib'
grep='grep'
hint='recommended'
hostcat='cat /etc/hosts'
huge=''
+i16size='2'
+i16type='short'
+i32size='4'
+i32type='int'
+i64size='8'
+i64type='long'
+i8size='1'
+i8type='char'
i_arpainet='define'
i_bsdioctl=''
i_db='define'
i_sysfilio='undef'
i_sysin='undef'
i_sysioctl='define'
-i_sysmman='define'
i_sysmount='define'
i_sysndir='undef'
i_sysparam='define'
i_sysselct='define'
i_syssockio=''
i_sysstat='define'
+i_sysstatfs='undef'
i_sysstatvfs='define'
i_systime='define'
i_systimek='undef'
i_systypes='define'
i_sysuio='define'
i_sysun='define'
+i_sysvfs='undef'
i_syswait='define'
i_termio='undef'
i_termios='define'
i_time='undef'
i_unistd='define'
+i_ustat='define'
i_utime='define'
i_values='define'
i_varargs='undef'
i_varhdr='stdarg.h'
i_vfork='undef'
ignore_versioned_solibs=''
+inc_version_list=' '
incpath=''
inews=''
-installarchlib='/opt/perl/lib/5.00561/alpha-dec_osf-thread'
+installarchlib='/opt/perl/lib/5.5.640/alpha-dec_osf-thread-multi'
installbin='/opt/perl/bin'
installman1dir='/opt/perl/man/man1'
installman3dir='/opt/perl/man/man3'
installprefix='/opt/perl'
installprefixexp='/opt/perl'
-installprivlib='/opt/perl/lib/5.00561'
+installprivlib='/opt/perl/lib/5.5.640'
installscript='/opt/perl/bin'
-installsitearch='/opt/perl/lib/site_perl/5.00561/alpha-dec_osf-thread'
-installsitelib='/opt/perl/lib/site_perl'
+installsitearch='/opt/perl/lib/site_perl/5.5.640/alpha-dec_osf-thread-multi'
+installsitebin='/opt/perl/bin'
+installsitelib='/opt/perl/lib/site_perl/5.5.640'
installstyle='lib'
installusrbinperl='define'
+installvendorbin=''
installvendorlib=''
intsize='4'
-known_extensions='B ByteLoader DB_File Data/Dumper Devel/DProf Devel/Peek Fcntl GDBM_File IO IPC/SysV NDBM_File ODBM_File Opcode POSIX SDBM_File Socket Thread attrs re'
+ivdformat='"ld"'
+ivsize='8'
+ivtype='long'
+known_extensions='B ByteLoader DB_File Data/Dumper Devel/DProf Devel/Peek Fcntl File/Glob GDBM_File IO IPC/SysV NDBM_File ODBM_File Opcode POSIX SDBM_File Socket Thread attrs re'
ksh=''
large=''
ld='ld'
man3direxp='/opt/perl/man/man3'
man3ext='3'
medium=''
-mips=''
mips_type=''
mkdir='mkdir'
-mmaptype='void *'
models='none'
modetype='mode_t'
more='more'
nm_so_opt=''
nonxs_ext='Errno'
nroff='nroff'
+nvsize='8'
+nvtype='double'
o_nonblock='O_NONBLOCK'
obj_ext='.o'
old_pthread_create_joinable=''
passcat='cat /etc/passwd'
patchlevel='5'
path_sep=':'
-perl=''
+perl='perl'
perladmin='yourname@yourhost.yourplace.com'
perlpath='/opt/perl/bin/perl'
pg='pg'
pr=''
prefix='/opt/perl'
prefixexp='/opt/perl'
-privlib='/opt/perl/lib/5.00561'
-privlibexp='/opt/perl/lib/5.00561'
+privlib='/opt/perl/lib/5.5.640'
+privlibexp='/opt/perl/lib/5.5.640'
prototype='define'
ptrsize='8'
+quadkind='2'
+quadtype='long'
randbits='48'
randfunc='drand48'
randseedtype='long'
sig_num='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 6 6 16 20 23 23 23 29 48 '
sig_num_init='0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 6, 6, 16, 20, 23, 23, 23, 29, 48, 0'
signal_t='void'
-sitearch='/opt/perl/lib/site_perl/5.00561/alpha-dec_osf-thread'
-sitearchexp='/opt/perl/lib/site_perl/5.00561/alpha-dec_osf-thread'
-sitelib='/opt/perl/lib/site_perl'
-sitelibexp='/opt/perl/lib/site_perl'
+sitearch='/opt/perl/lib/site_perl/5.5.640/alpha-dec_osf-thread-multi'
+sitearchexp='/opt/perl/lib/site_perl/5.5.640/alpha-dec_osf-thread-multi'
+sitebin='/opt/perl/bin'
+sitebinexp='/opt/perl/bin'
+sitelib='/opt/perl/lib/site_perl/5.5.640'
+sitelibexp='/opt/perl/lib/site_perl/5.5.640'
siteprefix='/opt/perl'
siteprefixexp='/opt/perl'
sizetype='size_t'
stdio_stream_array='_iob'
strings='/usr/include/string.h'
submit=''
-subversion='61'
+subversion='640'
sysman='/usr/man/man1'
tail=''
tar=''
tr='tr'
trnl='\n'
troff=''
+u16size='2'
+u16type='unsigned short'
+u32size='4'
+u32type='unsigned int'
+u64size='8'
+u64type='unsigned long'
+u8size='1'
+u8type='unsigned char'
+uidformat='"u"'
+uidsign='1'
+uidsize='4'
uidtype='uid_t'
uname='uname'
uniq='uniq'
+uquadtype='unsigned long'
+use5005threads='undef'
use64bits='define'
usedl='define'
-uselfs='define'
+useithreads='define'
+uselargefiles='define'
uselongdouble='undef'
+uselonglong='undef'
usemorebits='undef'
-usemultiplicity='undef'
+usemultiplicity='define'
usemymalloc='n'
usenm='true'
useopcode='true'
usevfork='false'
usrinc='/usr/include'
uuname=''
+uvoformat='"lo"'
+uvsize='8'
+uvtype='unsigned long'
+uvuformat='"lu"'
+uvxformat='"lx"'
+vendorbin=''
+vendorbinexp=''
vendorlib=''
vendorlibexp=''
vendorprefix=''
vendorprefixexp=''
-version='5.00561'
+version='5.5.640'
vi=''
voidflags='15'
xlibpth='/usr/lib/386 /lib/386'
config_arg11='-dE'
PERL_REVISION=5
PERL_VERSION=5
-PERL_SUBVERSION=61
+PERL_SUBVERSION=640
+PERL_API_REVISION=5
+PERL_API_VERSION=5
+PERL_API_SUBVERSION=640
CONFIGDOTSH=true
# Variables propagated from previous config.sh file.
pp_sys_cflags='ccflags="$ccflags -DNO_EFF_ONLY_OK"'
/*
* Package name : perl5
* Source directory : .
- * Configuration time: Mon Sep 20 12:44:36 EET DST 1999
+ * Configuration time: Sun Jan 16 21:10:53 EET 2000
* Configured by : jhi
* Target system : osf1 alpha.hut.fi v4.0 878 alpha
*/
*/
#define HAS_MKTIME /**/
-/* HAS_MSYNC:
- * This symbol, if defined, indicates that the msync system call is
- * available to synchronize a mapped file.
- */
-#define HAS_MSYNC /**/
-
-/* HAS_MUNMAP:
- * This symbol, if defined, indicates that the munmap system call is
- * available to unmap a region, usually mapped by mmap().
- */
-#define HAS_MUNMAP /**/
-
/* HAS_NICE:
* This symbol, if defined, indicates that the nice routine is
* available.
*/
#define STDCHAR unsigned char /**/
-/* HAS_ACCESSX:
- * This symbol, if defined, indicates that the accessx routine is
- * available to do extended access checks.
- */
-/*#define HAS_ACCESSX / **/
-
-/* HAS_EACCESS:
- * This symbol, if defined, indicates that the eaccess routine is
- * available to do extended access checks.
- */
-/*#define HAS_EACCESS / **/
-
-/* I_SYS_ACCESS:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/access.h>.
- */
-#define I_SYS_ACCESS /**/
-
-/* I_SYS_SECURITY:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/security.h>.
- */
-#define I_SYS_SECURITY /**/
-
/* CROSSCOMPILE:
* This symbol, if defined, signifies that we our
* build process is a cross-compilation.
*/
/*#define MULTIARCH / **/
+/* HAS_QUAD:
+ * This symbol, if defined, tells that there's a 64-bit integer type,
+ * Quad_t, and its unsigned counterpar, Uquad_t. QUADKIND will be one
+ * of QUAD_IS_INT, QUAD_IS_LONG, QUAD_IS_LONG_LONG, or QUAD_IS_INT64_T.
+ */
+#define HAS_QUAD /**/
+#ifdef HAS_QUAD
+# define Quad_t long /**/
+# define Uquad_t unsigned long /**/
+# define QUADKIND 2 /**/
+# define QUAD_IS_INT 1
+# define QUAD_IS_LONG 2
+# define QUAD_IS_LONG_LONG 3
+# define QUAD_IS_INT64_T 4
+#endif
+
+/* HAS_ACCESSX:
+ * This symbol, if defined, indicates that the accessx routine is
+ * available to do extended access checks.
+ */
+/*#define HAS_ACCESSX / **/
+
+/* HAS_EACCESS:
+ * This symbol, if defined, indicates that the eaccess routine is
+ * available to do extended access checks.
+ */
+/*#define HAS_EACCESS / **/
+
+/* I_SYS_ACCESS:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <sys/access.h>.
+ */
+#define I_SYS_ACCESS /**/
+
+/* I_SYS_SECURITY:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <sys/security.h>.
+ */
+#define I_SYS_SECURITY /**/
+
+/* OSNAME:
+ * This symbol contains the name of the operating system, as determined
+ * by Configure. You shouldn't rely on it too much; the specific
+ * feature tests from Configure are generally more reliable.
+ */
+#define OSNAME "dec_osf" /**/
+
/* MEM_ALIGNBYTES:
* This symbol contains the number of bytes required to align a
* double. Usual values are 2, 4 and 8. The default is eight,
#define MEM_ALIGNBYTES 8
#endif
+/* ARCHLIB:
+ * This variable, if defined, holds the name of the directory in
+ * which the user wants to put architecture-dependent public
+ * library files for perl5. It is most often a local directory
+ * such as /usr/local/lib. Programs using this variable must be
+ * prepared to deal with filename expansion. If ARCHLIB is the
+ * same as PRIVLIB, it is not defined, since presumably the
+ * program already searches PRIVLIB.
+ */
+/* ARCHLIB_EXP:
+ * This symbol contains the ~name expanded version of ARCHLIB, to be used
+ * in programs that are not prepared to deal with ~ expansion at run-time.
+ */
+#define ARCHLIB "/opt/perl/lib/5.5.640/alpha-dec_osf-thread-multi" /**/
+#define ARCHLIB_EXP "/opt/perl/lib/5.5.640/alpha-dec_osf-thread-multi" /**/
+
+/* ARCHNAME:
+ * This symbol holds a string representing the architecture name.
+ * It may be used to construct an architecture-dependant pathname
+ * where library files may be held under a private library, for
+ * instance.
+ */
+#define ARCHNAME "alpha-dec_osf-thread-multi" /**/
+
+/* HAS_ATOLF:
+ * This symbol, if defined, indicates that the atolf routine is
+ * available to convert strings into long doubles.
+ */
+/*#define HAS_ATOLF / **/
+
+/* HAS_ATOLL:
+ * This symbol, if defined, indicates that the atoll routine is
+ * available to convert strings into long longs.
+ */
+/*#define HAS_ATOLL / **/
+
+/* BIN:
+ * This symbol holds the path of the bin directory where the package will
+ * be installed. Program must be prepared to deal with ~name substitution.
+ */
+/* BIN_EXP:
+ * This symbol is the filename expanded version of the BIN symbol, for
+ * programs that do not want to deal with that at run-time.
+ */
+#define BIN "/opt/perl/bin" /**/
+#define BIN_EXP "/opt/perl/bin" /**/
+
+/* PERL_BINCOMPAT_5005:
+ * This symbol, if defined, indicates that Perl 5.006 should be
+ * binary-compatible with Perl 5.005. This is impossible for builds
+ * that use features like threads and multiplicity it is always
+ * for those versions.
+ */
+/*#define PERL_BINCOMPAT_5005 / **/
+
/* BYTEORDER:
* This symbol holds the hexadecimal constant defined in byteorder,
* i.e. 0x1234 or 0x4321, etc...
#define BYTEORDER 0x12345678 /* large digits for MSB */
#endif /* NeXT */
+/* CAT2:
+ * This macro catenates 2 tokens together.
+ */
+/* STRINGIFY:
+ * This macro surrounds its token with double quotes.
+ */
+#if 42 == 1
+#define CAT2(a,b)a/**/b
+#define STRINGIFY(a)"a"
+ /* If you can get stringification with catify, tell me how! */
+#endif
+#if 42 == 42
+#define CAT2(a,b)a ## b
+#define StGiFy(a)# a
+#define STRINGIFY(a)StGiFy(a)
+#endif
+#if 42 != 1 && 42 != 42
+#include "Bletch: How does this C preprocessor catenate tokens?"
+#endif
+
+/* CPPSTDIN:
+ * This symbol contains the first part of the string which will invoke
+ * the C preprocessor on the standard input and produce to standard
+ * output. Typical value of "cc -E" or "/lib/cpp", but it can also
+ * call a wrapper. See CPPRUN.
+ */
+/* CPPMINUS:
+ * This symbol contains the second part of the string which will invoke
+ * the C preprocessor on the standard input and produce to standard
+ * output. This symbol will have the value "-" if CPPSTDIN needs a minus
+ * to specify standard input, otherwise the value is "".
+ */
+/* CPPRUN:
+ * This symbol contains the string which will invoke a C preprocessor on
+ * the standard input and produce to standard output. It needs to end
+ * with CPPLAST, after all other preprocessor flags have been specified.
+ * The main difference with CPPSTDIN is that this program will never be a
+ * pointer to a shell wrapper, i.e. it will be empty if no preprocessor is
+ * available directly to the user. Note that it may well be different from
+ * the preprocessor used to compile the C program.
+ */
+#define CPPSTDIN "cppstdin"
+#define CPPMINUS ""
+#define CPPRUN "/usr/bin/cpp"
+
+/* HAS_ACCESS:
+ * This manifest constant lets the C program know that the access()
+ * system call is available to check for accessibility using real UID/GID.
+ * (always present on UNIX.)
+ */
+#define HAS_ACCESS /**/
+
/* CASTI32:
* This symbol is defined if the C compiler can cast negative
* or large floating point numbers to 32-bit ints.
*/
/*#define VOID_CLOSEDIR / **/
+/* HAS_CSH:
+ * This symbol, if defined, indicates that the C-shell exists.
+ */
+/* CSH:
+ * This symbol, if defined, contains the full pathname of csh.
+ */
+#define HAS_CSH /**/
+#ifdef HAS_CSH
+#define CSH "/usr/bin/csh" /**/
+#endif
+
+/* DLSYM_NEEDS_UNDERSCORE:
+ * This symbol, if defined, indicates that we need to prepend an
+ * underscore to the symbol name before calling dlsym(). This only
+ * makes sense if you *have* dlsym, which we will presume is the
+ * case if you're using dl_dlopen.xs.
+ */
+/*#define DLSYM_NEEDS_UNDERSCORE / **/
+
+/* HAS_DRAND48_PROTO:
+ * This symbol, if defined, indicates that the system provides
+ * a prototype for the drand48() function. Otherwise, it is up
+ * to the program to supply one. A good guess is
+ * extern double drand48 _((void));
+ */
+#define HAS_DRAND48_PROTO /**/
+
+/* HAS_ENDGRENT:
+ * This symbol, if defined, indicates that the getgrent routine is
+ * available for finalizing sequential access of the group database.
+ */
+#define HAS_ENDGRENT /**/
+
+/* HAS_ENDHOSTENT:
+ * This symbol, if defined, indicates that the endhostent() routine is
+ * available to close whatever was being used for host queries.
+ */
+#define HAS_ENDHOSTENT /**/
+
+/* HAS_ENDNETENT:
+ * This symbol, if defined, indicates that the endnetent() routine is
+ * available to close whatever was being used for network queries.
+ */
+#define HAS_ENDNETENT /**/
+
+/* HAS_ENDPROTOENT:
+ * This symbol, if defined, indicates that the endprotoent() routine is
+ * available to close whatever was being used for protocol queries.
+ */
+#define HAS_ENDPROTOENT /**/
+
+/* HAS_ENDPWENT:
+ * This symbol, if defined, indicates that the getgrent routine is
+ * available for finalizing sequential access of the passwd database.
+ */
+#define HAS_ENDPWENT /**/
+
+/* HAS_ENDSERVENT:
+ * This symbol, if defined, indicates that the endservent() routine is
+ * available to close whatever was being used for service queries.
+ */
+#define HAS_ENDSERVENT /**/
+
+/* HAS_ENDSPENT:
+ * This symbol, if defined, indicates that the endspent system call is
+ * available to finalize the scan of SysV shadow password entries.
+ */
+/*#define HAS_ENDSPENT / **/
+
/* HAS_FD_SET:
* This symbol, when defined, indicates presence of the fd_set typedef
* in <sys/types.h>
*/
#define HAS_FD_SET /**/
+/* HAS_STRUCT_FS_DATA:
+ * This symbol, if defined, indicates that the struct fs_data
+ * to do statfs() is supported.
+ */
+/*#define HAS_STRUCT_FS_DATA / **/
+
+/* HAS_FSEEKO:
+ * This symbol, if defined, indicates that the fseeko routine is
+ * available to fseek beyond 32 bits (useful for ILP32 hosts).
+ */
+/*#define HAS_FSEEKO / **/
+
+/* HAS_FSTATFS:
+ * This symbol, if defined, indicates that the fstatfs routine is
+ * available to stat filesystems by file descriptors.
+ */
+#define HAS_FSTATFS /**/
+/* HAS_FTELLO:
+ * This symbol, if defined, indicates that the ftello routine is
+ * available to ftell beyond 32 bits (useful for ILP32 hosts).
+ */
+/*#define HAS_FTELLO / **/
+
/* Gconvert:
* This preprocessor macro is defined to convert a floating point
* number to a string without a trailing decimal point. This
*/
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
-/* HAS_GNULIBC:
- * This symbol, if defined, indicates to the C program that
- * the GNU C library is being used.
- */
-/*#define HAS_GNULIBC / **/
-/* HAS_ISASCII:
- * This manifest constant lets the C program know that isascii
- * is available.
- */
-#define HAS_ISASCII /**/
-
-/* HAS_LCHOWN:
- * This symbol, if defined, indicates that the lchown routine is
- * available to operate on a symbolic link (instead of following the
- * link).
- */
-#define HAS_LCHOWN /**/
-
-/* HAS_OPEN3:
- * This manifest constant lets the C program know that the three
- * argument form of open(2) is available.
- */
-#define HAS_OPEN3 /**/
-
-/* HAS_SAFE_BCOPY:
- * This symbol, if defined, indicates that the bcopy routine is available
- * to copy potentially overlapping memory blocks. Otherwise you should
- * probably use memmove() or memcpy(). If neither is defined, roll your
- * own version.
- */
-#define HAS_SAFE_BCOPY /**/
-
-/* HAS_SAFE_MEMCPY:
- * This symbol, if defined, indicates that the memcpy routine is available
- * to copy potentially overlapping memory blocks. Otherwise you should
- * probably use memmove() or memcpy(). If neither is defined, roll your
- * own version.
- */
-/*#define HAS_SAFE_MEMCPY / **/
-
-/* HAS_SANE_MEMCMP:
- * This symbol, if defined, indicates that the memcmp routine is available
- * and can be used to compare relative magnitudes of chars with their high
- * bits set. If it is not defined, roll your own version.
- */
-#define HAS_SANE_MEMCMP /**/
-
-/* HAS_SIGACTION:
- * This symbol, if defined, indicates that Vr4's sigaction() routine
- * is available.
- */
-#define HAS_SIGACTION /**/
-
-/* HAS_SIGSETJMP:
- * This variable indicates to the C program that the sigsetjmp()
- * routine is available to save the calling process's registers
- * and stack environment for later use by siglongjmp(), and
- * to optionally save the process's signal mask. See
- * Sigjmp_buf, Sigsetjmp, and Siglongjmp.
- */
-/* Sigjmp_buf:
- * This is the buffer type to be used with Sigsetjmp and Siglongjmp.
- */
-/* Sigsetjmp:
- * This macro is used in the same way as sigsetjmp(), but will invoke
- * traditional setjmp() if sigsetjmp isn't available.
- * See HAS_SIGSETJMP.
- */
-/* Siglongjmp:
- * This macro is used in the same way as siglongjmp(), but will invoke
- * traditional longjmp() if siglongjmp isn't available.
- * See HAS_SIGSETJMP.
- */
-#define HAS_SIGSETJMP /**/
-#ifdef HAS_SIGSETJMP
-#define Sigjmp_buf sigjmp_buf
-#define Sigsetjmp(buf,save_mask) sigsetjmp((buf),(save_mask))
-#define Siglongjmp(buf,retval) siglongjmp((buf),(retval))
-#else
-#define Sigjmp_buf jmp_buf
-#define Sigsetjmp(buf,save_mask) setjmp((buf))
-#define Siglongjmp(buf,retval) longjmp((buf),(retval))
-#endif
-
-/* USE_STDIO_PTR:
- * This symbol is defined if the _ptr and _cnt fields (or similar)
- * of the stdio FILE structure can be used to access the stdio buffer
- * for a file handle. If this is defined, then the FILE_ptr(fp)
- * and FILE_cnt(fp) macros will also be defined and should be used
- * to access these fields.
- */
-/* FILE_ptr:
- * This macro is used to access the _ptr field (or equivalent) of the
- * FILE structure pointed to by its argument. This macro will always be
- * defined if USE_STDIO_PTR is defined.
- */
-/* STDIO_PTR_LVALUE:
- * This symbol is defined if the FILE_ptr macro can be used as an
- * lvalue.
- */
-/* FILE_cnt:
- * This macro is used to access the _cnt field (or equivalent) of the
- * FILE structure pointed to by its argument. This macro will always be
- * defined if USE_STDIO_PTR is defined.
- */
-/* STDIO_CNT_LVALUE:
- * This symbol is defined if the FILE_cnt macro can be used as an
- * lvalue.
- */
-#define USE_STDIO_PTR /**/
-#ifdef USE_STDIO_PTR
-#define FILE_ptr(fp) ((fp)->_ptr)
-#define STDIO_PTR_LVALUE /**/
-#define FILE_cnt(fp) ((fp)->_cnt)
-#define STDIO_CNT_LVALUE /**/
-#endif
-
-/* USE_STDIO_BASE:
- * This symbol is defined if the _base field (or similar) of the
- * stdio FILE structure can be used to access the stdio buffer for
- * a file handle. If this is defined, then the FILE_base(fp) macro
- * will also be defined and should be used to access this field.
- * Also, the FILE_bufsiz(fp) macro will be defined and should be used
- * to determine the number of bytes in the buffer. USE_STDIO_BASE
- * will never be defined unless USE_STDIO_PTR is.
- */
-/* FILE_base:
- * This macro is used to access the _base field (or equivalent) of the
- * FILE structure pointed to by its argument. This macro will always be
- * defined if USE_STDIO_BASE is defined.
- */
-/* FILE_bufsiz:
- * This macro is used to determine the number of bytes in the I/O
- * buffer pointed to by _base field (or equivalent) of the FILE
- * structure pointed to its argument. This macro will always be defined
- * if USE_STDIO_BASE is defined.
- */
-#define USE_STDIO_BASE /**/
-#ifdef USE_STDIO_BASE
-#define FILE_base(fp) ((fp)->_base)
-#define FILE_bufsiz(fp) ((fp)->_cnt + (fp)->_ptr - (fp)->_base)
-#endif
-
-/* HAS_VPRINTF:
- * This symbol, if defined, indicates that the vprintf routine is available
- * to printf with a pointer to an argument list. If unavailable, you
- * may need to write your own, probably in terms of _doprnt().
- */
-/* USE_CHAR_VSPRINTF:
- * This symbol is defined if this system has vsprintf() returning type
- * (char*). The trend seems to be to declare it as "int vsprintf()". It
- * is up to the package author to declare vsprintf correctly based on the
- * symbol.
- */
-#define HAS_VPRINTF /**/
-/*#define USE_CHAR_VSPRINTF / **/
-
-/* DOUBLESIZE:
- * This symbol contains the size of a double, so that the C preprocessor
- * can make decisions based on it.
- */
-#define DOUBLESIZE 8 /**/
-
-/* I_TIME:
- * This symbol, if defined, indicates to the C program that it should
- * include <time.h>.
- */
-/* I_SYS_TIME:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/time.h>.
- */
-/* I_SYS_TIME_KERNEL:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/time.h> with KERNEL defined.
- */
-/*#define I_TIME / **/
-#define I_SYS_TIME /**/
-/*#define I_SYS_TIME_KERNEL / **/
-
-/* VAL_O_NONBLOCK:
- * This symbol is to be used during open() or fcntl(F_SETFL) to turn on
- * non-blocking I/O for the file descriptor. Note that there is no way
- * back, i.e. you cannot turn it blocking again this way. If you wish to
- * alternatively switch between blocking and non-blocking, use the
- * ioctl(FIOSNBIO) call instead, but that is not supported by all devices.
- */
-/* VAL_EAGAIN:
- * This symbol holds the errno error code set by read() when no data was
- * present on the non-blocking file descriptor.
- */
-/* RD_NODATA:
- * This symbol holds the return code from read() when no data is present
- * on the non-blocking file descriptor. Be careful! If EOF_NONBLOCK is
- * not defined, then you can't distinguish between no data and EOF by
- * issuing a read(). You'll have to find another way to tell for sure!
- */
-/* EOF_NONBLOCK:
- * This symbol, if defined, indicates to the C program that a read() on
- * a non-blocking file descriptor will return 0 on EOF, and not the value
- * held in RD_NODATA (-1 usually, in that case!).
- */
-#define VAL_O_NONBLOCK O_NONBLOCK
-#define VAL_EAGAIN EAGAIN
-#define RD_NODATA -1
-#define EOF_NONBLOCK
-
-/* PTRSIZE:
- * This symbol contains the size of a pointer, so that the C preprocessor
- * can make decisions based on it. It will be sizeof(void *) if
- * the compiler supports (void *); otherwise it will be
- * sizeof(char *).
- */
-#define PTRSIZE 8 /**/
-
-/* Drand01:
- * This macro is to be used to generate uniformly distributed
- * random numbers over the range [0., 1.[. You may have to supply
- * an 'extern double drand48();' in your program since SunOS 4.1.3
- * doesn't provide you with anything relevant in it's headers.
- * See HAS_DRAND48_PROTO.
- */
-/* Rand_seed_t:
- * This symbol defines the type of the argument of the
- * random seed function.
- */
-/* seedDrand01:
- * This symbol defines the macro to be used in seeding the
- * random number generator (see Drand01).
- */
-/* RANDBITS:
- * This symbol indicates how many bits are produced by the
- * function used to generate normalized random numbers.
- * Values include 15, 16, 31, and 48.
- */
-#define Drand01() drand48() /**/
-#define Rand_seed_t long /**/
-#define seedDrand01(x) srand48((Rand_seed_t)x) /**/
-#define RANDBITS 48 /**/
-
-/* SSize_t:
- * This symbol holds the type used by functions that return
- * a count of bytes or an error condition. It must be a signed type.
- * It is usually ssize_t, but may be long or int, etc.
- * It may be necessary to include <sys/types.h> or <unistd.h>
- * to get any typedef'ed information.
- * We will pick a type such that sizeof(SSize_t) == sizeof(Size_t).
- */
-#define SSize_t ssize_t /* signed count of bytes */
-
-/* EBCDIC:
- * This symbol, if defined, indicates that this system uses
- * EBCDIC encoding.
- */
-/*#define EBCDIC / **/
-
-/* ARCHLIB:
- * This variable, if defined, holds the name of the directory in
- * which the user wants to put architecture-dependent public
- * library files for perl5. It is most often a local directory
- * such as /usr/local/lib. Programs using this variable must be
- * prepared to deal with filename expansion. If ARCHLIB is the
- * same as PRIVLIB, it is not defined, since presumably the
- * program already searches PRIVLIB.
- */
-/* ARCHLIB_EXP:
- * This symbol contains the ~name expanded version of ARCHLIB, to be used
- * in programs that are not prepared to deal with ~ expansion at run-time.
- */
-#define ARCHLIB "/opt/perl/lib/5.00561/alpha-dec_osf-thread" /**/
-#define ARCHLIB_EXP "/opt/perl/lib/5.00561/alpha-dec_osf-thread" /**/
-
-/* BIN:
- * This symbol holds the path of the bin directory where the package will
- * be installed. Program must be prepared to deal with ~name substitution.
- */
-/* BIN_EXP:
- * This symbol is the filename expanded version of the BIN symbol, for
- * programs that do not want to deal with that at run-time.
- */
-#define BIN "/opt/perl/bin" /**/
-#define BIN_EXP "/opt/perl/bin" /**/
-
-/* INSTALL_USR_BIN_PERL:
- * This symbol, if defined, indicates that Perl is to be installed
- * also as /usr/bin/perl.
- */
-#define INSTALL_USR_BIN_PERL /**/
-
-/* PRIVLIB:
- * This symbol contains the name of the private library for this package.
- * The library is private in the sense that it needn't be in anyone's
- * execution path, but it should be accessible by the world. The program
- * should be prepared to do ~ expansion.
- */
-/* PRIVLIB_EXP:
- * This symbol contains the ~name expanded version of PRIVLIB, to be used
- * in programs that are not prepared to deal with ~ expansion at run-time.
- */
-#define PRIVLIB "/opt/perl/lib/5.00561" /**/
-#define PRIVLIB_EXP "/opt/perl/lib/5.00561" /**/
-
-/* SITEARCH:
- * This symbol contains the name of the private library for this package.
- * The library is private in the sense that it needn't be in anyone's
- * execution path, but it should be accessible by the world. The program
- * should be prepared to do ~ expansion.
- * The standard distribution will put nothing in this directory.
- * Individual sites may place their own extensions and modules in
- * this directory.
- */
-/* SITEARCH_EXP:
- * This symbol contains the ~name expanded version of SITEARCH, to be used
- * in programs that are not prepared to deal with ~ expansion at run-time.
- */
-#define SITEARCH "/opt/perl/lib/site_perl/5.00561/alpha-dec_osf-thread" /**/
-#define SITEARCH_EXP "/opt/perl/lib/site_perl/5.00561/alpha-dec_osf-thread" /**/
-
-/* SITELIB:
- * This symbol contains the name of the private library for this package.
- * The library is private in the sense that it needn't be in anyone's
- * execution path, but it should be accessible by the world. The program
- * should be prepared to do ~ expansion.
- * The standard distribution will put nothing in this directory.
- * Individual sites may place their own extensions and modules in
- * this directory.
- */
-/* SITELIB_EXP:
- * This symbol contains the ~name expanded version of SITELIB, to be used
- * in programs that are not prepared to deal with ~ expansion at run-time.
- */
-#define SITELIB "/opt/perl/lib/site_perl" /**/
-#define SITELIB_EXP "/opt/perl/lib/site_perl" /**/
-
-/* PERL_VENDORLIB_EXP:
- * This symbol contains the ~name expanded version of VENDORLIB, to be used
- * in programs that are not prepared to deal with ~ expansion at run-time.
- */
-/*#define PERL_VENDORLIB_EXP "" / **/
-
-/* OSNAME:
- * This symbol contains the name of the operating system, as determined
- * by Configure. You shouldn't rely on it too much; the specific
- * feature tests from Configure are generally more reliable.
- */
-#define OSNAME "dec_osf" /**/
-
-/* CAT2:
- * This macro catenates 2 tokens together.
- */
-/* STRINGIFY:
- * This macro surrounds its token with double quotes.
- */
-#if 42 == 1
-#define CAT2(a,b)a/**/b
-#define STRINGIFY(a)"a"
- /* If you can get stringification with catify, tell me how! */
-#endif
-#if 42 == 42
-#define CAT2(a,b)a ## b
-#define StGiFy(a)# a
-#define STRINGIFY(a)StGiFy(a)
-#endif
-#if 42 != 1 && 42 != 42
-#include "Bletch: How does this C preprocessor catenate tokens?"
-#endif
-
-/* CPPSTDIN:
- * This symbol contains the first part of the string which will invoke
- * the C preprocessor on the standard input and produce to standard
- * output. Typical value of "cc -E" or "/lib/cpp", but it can also
- * call a wrapper. See CPPRUN.
- */
-/* CPPMINUS:
- * This symbol contains the second part of the string which will invoke
- * the C preprocessor on the standard input and produce to standard
- * output. This symbol will have the value "-" if CPPSTDIN needs a minus
- * to specify standard input, otherwise the value is "".
- */
-/* CPPRUN:
- * This symbol contains the string which will invoke a C preprocessor on
- * the standard input and produce to standard output. It needs to end
- * with CPPLAST, after all other preprocessor flags have been specified.
- * The main difference with CPPSTDIN is that this program will never be a
- * pointer to a shell wrapper, i.e. it will be empty if no preprocessor is
- * available directly to the user. Note that it may well be different from
- * the preprocessor used to compile the C program.
- */
-/* CPPLAST:
- * This symbol is intended to be used along with CPPRUN in the same manner
- * symbol CPPMINUS is used with CPPSTDIN. It contains either "-" or "".
- */
-#define CPPSTDIN "cppstdin"
-#define CPPMINUS ""
-#define CPPRUN "/usr/bin/cpp"
-#define CPPLAST ""
-
-/* HAS_ACCESS:
- * This manifest constant lets the C program know that the access()
- * system call is available to check for accessibility using real UID/GID.
- * (always present on UNIX.)
- */
-#define HAS_ACCESS /**/
-
-/* HAS_CSH:
- * This symbol, if defined, indicates that the C-shell exists.
- */
-/* CSH:
- * This symbol, if defined, contains the full pathname of csh.
- */
-#define HAS_CSH /**/
-#ifdef HAS_CSH
-#define CSH "/usr/bin/csh" /**/
-#endif
-
-/* HAS_ENDGRENT:
- * This symbol, if defined, indicates that the getgrent routine is
- * available for finalizing sequential access of the group database.
- */
-#define HAS_ENDGRENT /**/
-
-/* HAS_ENDHOSTENT:
- * This symbol, if defined, indicates that the endhostent() routine is
- * available to close whatever was being used for host queries.
- */
-#define HAS_ENDHOSTENT /**/
-
-/* HAS_ENDNETENT:
- * This symbol, if defined, indicates that the endnetent() routine is
- * available to close whatever was being used for network queries.
- */
-#define HAS_ENDNETENT /**/
-
-/* HAS_ENDPROTOENT:
- * This symbol, if defined, indicates that the endprotoent() routine is
- * available to close whatever was being used for protocol queries.
- */
-#define HAS_ENDPROTOENT /**/
-
-/* HAS_ENDPWENT:
- * This symbol, if defined, indicates that the getgrent routine is
- * available for finalizing sequential access of the passwd database.
- */
-#define HAS_ENDPWENT /**/
-
-/* HAS_ENDSERVENT:
- * This symbol, if defined, indicates that the endservent() routine is
- * available to close whatever was being used for service queries.
- */
-#define HAS_ENDSERVENT /**/
-
/* HAS_GETGRENT:
* This symbol, if defined, indicates that the getgrent routine is
* available for sequential access of the group database.
* so that it is safe even if used by a process with super-user
* privileges.
*/
-/* HAS_PHOSTNAME:
- * This symbol, if defined, indicates that the C program may use the
- * contents of PHOSTNAME as a command to feed to the popen() routine
- * to derive the host name.
- */
#define HAS_GETHOSTNAME /**/
#define HAS_UNAME /**/
#undef HAS_PHOSTNAME
#define PHOSTNAME "" /* How to get the host name */
#endif
+/* HAS_GETHOST_PROTOS:
+ * This symbol, if defined, indicates that <netdb.h> includes
+ * prototypes for gethostent(), gethostbyname(), and
+ * gethostbyaddr(). Otherwise, it is up to the program to guess
+ * them. See netdbtype.U for probing for various Netdb_xxx_t types.
+ */
+#define HAS_GETHOST_PROTOS /**/
+
+/* HAS_GETMNT:
+ * This symbol, if defined, indicates that the getmnt routine is
+ * available to get filesystem mount info by filename.
+ */
+/*#define HAS_GETMNT / **/
+
+/* HAS_GETMNTENT:
+ * This symbol, if defined, indicates that the getmntent routine is
+ * available to iterate through mounted file systems to get their info.
+ */
+/*#define HAS_GETMNTENT / **/
+
/* HAS_GETNETBYADDR:
* This symbol, if defined, indicates that the getnetbyaddr() routine is
* available to look up networks by their IP addresses.
*/
#define HAS_GETNETENT /**/
+/* HAS_GETNET_PROTOS:
+ * This symbol, if defined, indicates that <netdb.h> includes
+ * prototypes for getnetent(), getnetbyname(), and
+ * getnetbyaddr(). Otherwise, it is up to the program to guess
+ * them. See netdbtype.U for probing for various Netdb_xxx_t types.
+ */
+#define HAS_GETNET_PROTOS /**/
+
/* HAS_GETPROTOENT:
* This symbol, if defined, indicates that the getprotoent() routine is
* available to look up protocols in some data base or another.
#define HAS_GETPROTOBYNAME /**/
#define HAS_GETPROTOBYNUMBER /**/
+/* HAS_GETPROTO_PROTOS:
+ * This symbol, if defined, indicates that <netdb.h> includes
+ * prototypes for getprotoent(), getprotobyname(), and
+ * getprotobyaddr(). Otherwise, it is up to the program to guess
+ * them. See netdbtype.U for probing for various Netdb_xxx_t types.
+ */
+#define HAS_GETPROTO_PROTOS /**/
+
/* HAS_GETPWENT:
* This symbol, if defined, indicates that the getpwent routine is
* available for sequential access of the passwd database.
*/
#define HAS_GETSERVENT /**/
+/* HAS_GETSERV_PROTOS:
+ * This symbol, if defined, indicates that <netdb.h> includes
+ * prototypes for getservent(), getservbyname(), and
+ * getservbyaddr(). Otherwise, it is up to the program to guess
+ * them. See netdbtype.U for probing for various Netdb_xxx_t types.
+ */
+#define HAS_GETSERV_PROTOS /**/
+
+/* HAS_GETSPENT:
+ * This symbol, if defined, indicates that the getspent system call is
+ * available to retrieve SysV shadow password entries sequentially.
+ */
+/*#define HAS_GETSPENT / **/
+
+/* HAS_GETSPNAM:
+ * This symbol, if defined, indicates that the getspnam system call is
+ * available to retrieve SysV shadow password entries by name.
+ */
+/*#define HAS_GETSPNAM / **/
+
/* HAS_GETSERVBYNAME:
* This symbol, if defined, indicates that the getservbyname()
* routine is available to look up services by their name.
#define HAS_GETSERVBYNAME /**/
#define HAS_GETSERVBYPORT /**/
+/* HAS_GNULIBC:
+ * This symbol, if defined, indicates to the C program that
+ * the GNU C library is being used.
+ */
+/*#define HAS_GNULIBC / **/
+/* HAS_HASMNTOPT:
+ * This symbol, if defined, indicates that the hasmntopt routine is
+ * available to query the mount options of file systems.
+ */
+/*#define HAS_HASMNTOPT / **/
+
/* HAS_HTONL:
* This symbol, if defined, indicates that the htonl() routine (and
* friends htons() ntohl() ntohs()) are available to do network
#define HAS_NTOHL /**/
#define HAS_NTOHS /**/
+/* HAS_ISASCII:
+ * This manifest constant lets the C program know that isascii
+ * is available.
+ */
+#define HAS_ISASCII /**/
+
+/* HAS_LCHOWN:
+ * This symbol, if defined, indicates that the lchown routine is
+ * available to operate on a symbolic link (instead of following the
+ * link).
+ */
+#define HAS_LCHOWN /**/
+
+/* HAS_LDBL_DIG:
+ * This symbol, if defined, indicates that this system's <float.h>
+ * or <limits.h> defines the symbol LDBL_DIG, which is the number
+ * of significant digits in a long double precision number. Unlike
+ * for DBL_DIG, there's no good guess for LDBL_DIG if it is undefined.
+ */
+#define HAS_LDBL_DIG /* */
+
/* HAS_LONG_DOUBLE:
* This symbol will be defined if the C compiler supports long
* doubles.
* This symbol, if defined, indicates that the memchr routine is available
* to locate characters within a C string.
*/
-#define HAS_MEMCHR /**/
+#define HAS_MEMCHR /**/
+
+/* HAS_MSG:
+ * This symbol, if defined, indicates that the entire msg*(2) library is
+ * supported (IPC mechanism based on message queues).
+ */
+#define HAS_MSG /**/
+
+/* HAS_OPEN3:
+ * This manifest constant lets the C program know that the three
+ * argument form of open(2) is available.
+ */
+#define HAS_OPEN3 /**/
+
+/* OLD_PTHREAD_CREATE_JOINABLE:
+ * This symbol, if defined, indicates how to create pthread
+ * in joinable (aka undetached) state. NOTE: not defined
+ * if pthread.h already has defined PTHREAD_CREATE_JOINABLE
+ * (the new version of the constant).
+ * If defined, known values are PTHREAD_CREATE_UNDETACHED
+ * and __UNDETACHED.
+ */
+/*#define OLD_PTHREAD_CREATE_JOINABLE / **/
+
+/* HAS_PTHREAD_YIELD:
+ * This symbol, if defined, indicates that the pthread_yield
+ * routine is available to yield the execution of the current
+ * thread. sched_yield is preferable to pthread_yield.
+ */
+/* SCHED_YIELD:
+ * This symbol defines the way to yield the execution of
+ * the current thread. Known ways are sched_yield,
+ * pthread_yield, and pthread_yield with NULL.
+ */
+/* HAS_SCHED_YIELD:
+ * This symbol, if defined, indicates that the sched_yield
+ * routine is available to yield the execution of the current
+ * thread. sched_yield is preferable to pthread_yield.
+ */
+/*#define HAS_PTHREAD_YIELD / **/
+#define SCHED_YIELD sched_yield() /**/
+#define HAS_SCHED_YIELD /**/
-/* HAS_MMAP:
- * This symbol, if defined, indicates that the mmap system call is
- * available to map a file into memory.
+/* HAS_SAFE_BCOPY:
+ * This symbol, if defined, indicates that the bcopy routine is available
+ * to copy potentially overlapping memory blocks. Otherwise you should
+ * probably use memmove() or memcpy(). If neither is defined, roll your
+ * own version.
*/
-/* Mmap_t:
- * This symbol holds the return type of the mmap() system call
- * (and simultaneously the type of the first argument).
- * Usually set to 'void *' or 'cadd_t'.
+#define HAS_SAFE_BCOPY /**/
+
+/* HAS_SAFE_MEMCPY:
+ * This symbol, if defined, indicates that the memcpy routine is available
+ * to copy potentially overlapping memory blocks. Otherwise you should
+ * probably use memmove() or memcpy(). If neither is defined, roll your
+ * own version.
*/
-#define HAS_MMAP /**/
-#define Mmap_t void * /**/
+/*#define HAS_SAFE_MEMCPY / **/
-/* HAS_MSG:
- * This symbol, if defined, indicates that the entire msg*(2) library is
- * supported (IPC mechanism based on message queues).
+/* HAS_SANE_MEMCMP:
+ * This symbol, if defined, indicates that the memcmp routine is available
+ * and can be used to compare relative magnitudes of chars with their high
+ * bits set. If it is not defined, roll your own version.
*/
-#define HAS_MSG /**/
+#define HAS_SANE_MEMCMP /**/
/* HAS_SEM:
* This symbol, if defined, indicates that the entire sem*(2) library is
*/
#define HAS_SETSERVENT /**/
+/* HAS_SETSPENT:
+ * This symbol, if defined, indicates that the setspent system call is
+ * available to initialize the scan of SysV shadow password entries.
+ */
+/*#define HAS_SETSPENT / **/
+
/* HAS_SETVBUF:
* This symbol, if defined, indicates that the setvbuf routine is
* available to change buffering on an open stdio stream.
*/
#define HAS_SETVBUF /**/
+/* USE_SFIO:
+ * This symbol, if defined, indicates that sfio should
+ * be used.
+ */
+/*#define USE_SFIO / **/
+
/* HAS_SHM:
* This symbol, if defined, indicates that the entire shm*(2) library is
* supported.
*/
#define HAS_SHM /**/
+/* HAS_SIGACTION:
+ * This symbol, if defined, indicates that Vr4's sigaction() routine
+ * is available.
+ */
+#define HAS_SIGACTION /**/
+
+/* HAS_SIGSETJMP:
+ * This variable indicates to the C program that the sigsetjmp()
+ * routine is available to save the calling process's registers
+ * and stack environment for later use by siglongjmp(), and
+ * to optionally save the process's signal mask. See
+ * Sigjmp_buf, Sigsetjmp, and Siglongjmp.
+ */
+/* Sigjmp_buf:
+ * This is the buffer type to be used with Sigsetjmp and Siglongjmp.
+ */
+/* Sigsetjmp:
+ * This macro is used in the same way as sigsetjmp(), but will invoke
+ * traditional setjmp() if sigsetjmp isn't available.
+ * See HAS_SIGSETJMP.
+ */
+/* Siglongjmp:
+ * This macro is used in the same way as siglongjmp(), but will invoke
+ * traditional longjmp() if siglongjmp isn't available.
+ * See HAS_SIGSETJMP.
+ */
+#define HAS_SIGSETJMP /**/
+#ifdef HAS_SIGSETJMP
+#define Sigjmp_buf sigjmp_buf
+#define Sigsetjmp(buf,save_mask) sigsetjmp((buf),(save_mask))
+#define Siglongjmp(buf,retval) siglongjmp((buf),(retval))
+#else
+#define Sigjmp_buf jmp_buf
+#define Sigsetjmp(buf,save_mask) setjmp((buf))
+#define Siglongjmp(buf,retval) longjmp((buf),(retval))
+#endif
+
/* HAS_SOCKET:
* This symbol, if defined, indicates that the BSD socket interface is
* supported.
* Checking just with #ifdef might not be enough because this symbol
* has been known to be an enum.
*/
-/* HAS_SENDMSG:
- * This symbol, if defined, indicates that the sendmsg is supported
- * to send messages between sockets. You will also need struct
- * iovec from <sys/uio.h>, HAS_STRUCT_IOVEC and I_SYSUIO.
- */
-/* HAS_RECVMSG:
- * This symbol, if defined, indicates that the recvmsg is supported
- * to send messages between sockets. You will also need struct
- * iovec from <sys/uio.h>, HAS_STRUCT_IOVEC and I_SYSUIO.
- */
-/* HAS_STRUCT_MSGHDR:
- * This symbol, if defined, indicates that the struct msghdr
- * (BSD 4.3 or 4.4) is supported. You will also need struct
- * iovec from <sys/uio.h>, HAS_STRUCT_IOVEC and I_SYSUIO.
- */
-/* HAS_STRUCT_CMSGHDR:
- * This symbol, if defined, indicates that the struct cmsghdr
- * (BSD 4.4) is supported. You will also need struct
- * iovec from <sys/uio.h>, HAS_STRUCT_IOVEC and I_SYSUIO.
- */
#define HAS_SOCKET /**/
#define HAS_SOCKETPAIR /**/
#define HAS_MSG_CTRUNC /**/
#define HAS_MSG_PEEK /**/
/*#define HAS_MSG_PROXY / **/
#define HAS_SCM_RIGHTS /**/
-#define HAS_SENDMSG /**/
-#define HAS_RECVMSG /**/
-#define HAS_STRUCT_MSGHDR /**/
-#define HAS_STRUCT_CMSGHDR /**/
+
+/* HAS_SQRTL:
+ * This symbol, if defined, indicates that the sqrtl routine is
+ * available to do long double square roots.
+ */
+#define HAS_SQRTL /**/
/* USE_STAT_BLOCKS:
* This symbol is defined if this system has a stat structure declaring
* st_blksize and st_blocks.
*/
+#ifndef USE_STAT_BLOCKS
#define USE_STAT_BLOCKS /**/
+#endif
+
+/* HAS_STRUCT_STATFS_F_FLAGS:
+ * This symbol, if defined, indicates that the struct statfs
+ * does have the f_flags member containing the mount flags of
+ * the filesystem containing the file.
+ * This kind of struct statfs is coming from <sys/mount.h> (BSD 4.3),
+ * not from <sys/statfs.h> (SYSV). Older BSDs (like Ultrix) do not
+ * have statfs() and struct statfs, they have ustat() and getmnt()
+ * with struct ustat and struct fs_data.
+ */
+#define HAS_STRUCT_STATFS_F_FLAGS /**/
+
+/* HAS_STRUCT_STATFS:
+ * This symbol, if defined, indicates that the struct statfs
+ * to do statfs() is supported.
+ */
+#define HAS_STRUCT_STATFS /**/
+
+/* HAS_FSTATVFS:
+ * This symbol, if defined, indicates that the fstatvfs routine is
+ * available to stat filesystems by file descriptors.
+ */
+#define HAS_FSTATVFS /**/
+
+/* USE_STDIO_PTR:
+ * This symbol is defined if the _ptr and _cnt fields (or similar)
+ * of the stdio FILE structure can be used to access the stdio buffer
+ * for a file handle. If this is defined, then the FILE_ptr(fp)
+ * and FILE_cnt(fp) macros will also be defined and should be used
+ * to access these fields.
+ */
+/* FILE_ptr:
+ * This macro is used to access the _ptr field (or equivalent) of the
+ * FILE structure pointed to by its argument. This macro will always be
+ * defined if USE_STDIO_PTR is defined.
+ */
+/* STDIO_PTR_LVALUE:
+ * This symbol is defined if the FILE_ptr macro can be used as an
+ * lvalue.
+ */
+/* FILE_cnt:
+ * This macro is used to access the _cnt field (or equivalent) of the
+ * FILE structure pointed to by its argument. This macro will always be
+ * defined if USE_STDIO_PTR is defined.
+ */
+/* STDIO_CNT_LVALUE:
+ * This symbol is defined if the FILE_cnt macro can be used as an
+ * lvalue.
+ */
+#define USE_STDIO_PTR /**/
+#ifdef USE_STDIO_PTR
+#define FILE_ptr(fp) ((fp)->_ptr)
+#define STDIO_PTR_LVALUE /**/
+#define FILE_cnt(fp) ((fp)->_cnt)
+#define STDIO_CNT_LVALUE /**/
+#endif
+
+/* USE_STDIO_BASE:
+ * This symbol is defined if the _base field (or similar) of the
+ * stdio FILE structure can be used to access the stdio buffer for
+ * a file handle. If this is defined, then the FILE_base(fp) macro
+ * will also be defined and should be used to access this field.
+ * Also, the FILE_bufsiz(fp) macro will be defined and should be used
+ * to determine the number of bytes in the buffer. USE_STDIO_BASE
+ * will never be defined unless USE_STDIO_PTR is.
+ */
+/* FILE_base:
+ * This macro is used to access the _base field (or equivalent) of the
+ * FILE structure pointed to by its argument. This macro will always be
+ * defined if USE_STDIO_BASE is defined.
+ */
+/* FILE_bufsiz:
+ * This macro is used to determine the number of bytes in the I/O
+ * buffer pointed to by _base field (or equivalent) of the FILE
+ * structure pointed to its argument. This macro will always be defined
+ * if USE_STDIO_BASE is defined.
+ */
+#define USE_STDIO_BASE /**/
+#ifdef USE_STDIO_BASE
+#define FILE_base(fp) ((fp)->_base)
+#define FILE_bufsiz(fp) ((fp)->_cnt + (fp)->_ptr - (fp)->_base)
+#endif
/* HAS_STRERROR:
* This symbol, if defined, indicates that the strerror routine is
#define HAS_SYS_ERRLIST /**/
#define Strerror(e) strerror(e)
+/* HAS_STRTOLD:
+ * This symbol, if defined, indicates that the strtold routine is
+ * available to convert strings to long doubles.
+ */
+/*#define HAS_STRTOLD / **/
+
+/* HAS_STRTOLL:
+ * This symbol, if defined, indicates that the strtoll routine is
+ * available to convert strings to long longs.
+ */
+/*#define HAS_STRTOLL / **/
+
+/* HAS_STRTOULL:
+ * This symbol, if defined, indicates that the strtoull routine is
+ * available to convert strings to unsigned long longs.
+ */
+/*#define HAS_STRTOULL / **/
+
+/* HAS_STRTOUQ:
+ * This symbol, if defined, indicates that the strtouq routine is
+ * available to convert strings to unsigned long longs (quads).
+ */
+/*#define HAS_STRTOUQ / **/
+
+/* HAS_TELLDIR_PROTO:
+ * This symbol, if defined, indicates that the system provides
+ * a prototype for the telldir() function. Otherwise, it is up
+ * to the program to supply one. A good guess is
+ * extern long telldir _((DIR*));
+ */
+#define HAS_TELLDIR_PROTO /**/
+
+/* Time_t:
+ * This symbol holds the type returned by time(). It can be long,
+ * or time_t on BSD sites (in which case <sys/types.h> should be
+ * included).
+ */
+#define Time_t time_t /* Time type */
+
+/* HAS_TIMES:
+ * This symbol, if defined, indicates that the times() routine exists.
+ * Note that this became obsolete on some systems (SUNOS), which now
+ * use getrusage(). It may be necessary to include <sys/times.h>.
+ */
+#define HAS_TIMES /**/
+
/* HAS_UNION_SEMUN:
* This symbol, if defined, indicates that the union semun is
* defined by including <sys/sem.h>. If not, the user code
#define USE_SEMCTL_SEMUN /**/
#define USE_SEMCTL_SEMID_DS /**/
+/* HAS_USTAT:
+ * This symbol, if defined, indicates that the ustat system call is
+ * available to query file system statistics by dev_t.
+ */
+#define HAS_USTAT /**/
+
/* HAS_VFORK:
* This symbol, if defined, indicates that vfork() exists.
*/
*/
#define Signal_t void /* Signal handler's return type */
+/* HAS_VPRINTF:
+ * This symbol, if defined, indicates that the vprintf routine is available
+ * to printf with a pointer to an argument list. If unavailable, you
+ * may need to write your own, probably in terms of _doprnt().
+ */
+/* USE_CHAR_VSPRINTF:
+ * This symbol is defined if this system has vsprintf() returning type
+ * (char*). The trend seems to be to declare it as "int vsprintf()". It
+ * is up to the package author to declare vsprintf correctly based on the
+ * symbol.
+ */
+#define HAS_VPRINTF /**/
+/*#define USE_CHAR_VSPRINTF / **/
+
+/* USE_DYNAMIC_LOADING:
+ * This symbol, if defined, indicates that dynamic loading of
+ * some sort is available.
+ */
+#define USE_DYNAMIC_LOADING /**/
+
+/* DOUBLESIZE:
+ * This symbol contains the size of a double, so that the C preprocessor
+ * can make decisions based on it.
+ */
+#define DOUBLESIZE 8 /**/
+
+/* EBCDIC:
+ * This symbol, if defined, indicates that this system uses
+ * EBCDIC encoding.
+ */
+/*#define EBCDIC / **/
+
+/* FFLUSH_NULL:
+ * This symbol, if defined, tells that fflush(NULL) does flush
+ * all pending stdio output.
+ */
+/* FFLUSH_ALL:
+ * This symbol, if defined, tells that to flush
+ * all pending stdio output one must loop through all
+ * the stdio file handles stored in an array and fflush them.
+ * Note that if fflushNULL is defined, fflushall will not
+ * even be probed for and will be left undefined.
+ */
+#define FFLUSH_NULL /**/
+/*#define FFLUSH_ALL / **/
+
+/* Fpos_t:
+ * This symbol holds the type used to declare file positions in libc.
+ * It can be fpos_t, long, uint, etc... It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
+ */
+#define Fpos_t fpos_t /* File position type */
+
+/* Gid_t_f:
+ * This symbol defines the format string used for printing a Gid_t.
+ */
+#define Gid_t_f "u" /**/
+
+/* Gid_t_size:
+ * This symbol holds the size of a Gid_t in bytes.
+ */
+#define Gid_t_size 4 /* GID size */
+
+/* Gid_t:
+ * This symbol holds the return type of getgid() and the type of
+ * argument to setrgid() and related functions. Typically,
+ * it is the type of group ids in the kernel. It can be int, ushort,
+ * uid_t, etc... It may be necessary to include <sys/types.h> to get
+ * any typedef'ed information.
+ */
+#define Gid_t gid_t /* Type for getgid(), etc... */
+
/* Groups_t:
* This symbol holds the type used for the second argument to
* getgroups() and setgropus(). Usually, this is the same as
#define Groups_t gid_t /* Type for 2nd arg to [sg]etgroups() */
#endif
+/* DB_Prefix_t:
+ * This symbol contains the type of the prefix structure element
+ * in the <db.h> header file. In older versions of DB, it was
+ * int, while in newer ones it is u_int32_t.
+ */
+/* DB_Hash_t:
+ * This symbol contains the type of the prefix structure element
+ * in the <db.h> header file. In older versions of DB, it was
+ * int, while in newer ones it is size_t.
+ */
+#define DB_Hash_t u_int32_t /**/
+#define DB_Prefix_t size_t /**/
+
/* I_GRP:
* This symbol, if defined, indicates to the C program that it should
* include <grp.h>.
#define I_GRP /**/
#define GRPASSWD /**/
+/* I_INTTYPES:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <inttypes.h>.
+ */
+/*#define I_INTTYPES / **/
+
+/* I_MACH_CTHREADS:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <mach/cthreads.h>.
+ */
+/*#define I_MACH_CTHREADS / **/
+
+/* I_MNTENT:
+ * This symbol, if defined, indicates that <mntent.h> exists and
+ * should be included.
+ */
+/*#define I_MNTENT / **/
+
/* I_NETDB:
* This symbol, if defined, indicates that <netdb.h> exists and
* should be included.
*/
#define I_NETDB /**/
+/* I_NETINET_TCP:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <netinet/tcp.h>.
+ */
+#define I_NETINET_TCP /**/
+
+/* I_POLL:
+ * This symbol, if defined, indicates that <poll.h> exists and
+ * should be included.
+ */
+#define I_POLL /**/
+
+/* I_PTHREAD:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <pthread.h>.
+ */
+#define I_PTHREAD /**/
+
/* I_PWD:
* This symbol, if defined, indicates to the C program that it should
* include <pwd.h>.
#define PWGECOS /**/
#define PWPASSWD /**/
+/* I_SHADOW:
+ * This symbol, if defined, indicates that <shadow.h> exists and
+ * should be included.
+ */
+/*#define I_SHADOW / **/
+
+/* I_SOCKS:
+ * This symbol, if defined, indicates that <socks.h> exists and
+ * should be included.
+ */
+/*#define I_SOCKS / **/
+
+/* I_SYS_MOUNT:
+ * This symbol, if defined, indicates that <sys/mount.h> exists and
+ * should be included.
+ */
+#define I_SYS_MOUNT /**/
+
+/* I_SYS_STATFS:
+ * This symbol, if defined, indicates that <sys/statfs.h> exists.
+ */
+/*#define I_SYS_STATFS / **/
+
+/* I_SYS_STATVFS:
+ * This symbol, if defined, indicates that <sys/statvfs.h> exists and
+ * should be included.
+ */
+#define I_SYS_STATVFS /**/
+
/* I_SYSUIO:
* This symbol, if defined, indicates that <sys/uio.h> exists and
* should be included.
*/
-/* HAS_STRUCT_IOVEC:
- * This symbol, if defined, indicates that the struct iovec
- * to do scatter writes/gather reads is supported.
- */
#define I_SYSUIO /**/
-#define HAS_STRUCT_IOVEC /**/
+
+/* I_SYS_VFS:
+ * This symbol, if defined, indicates that <sys/vfs.h> exists and
+ * should be included.
+ */
+/*#define I_SYS_VFS / **/
+
+/* I_TIME:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <time.h>.
+ */
+/* I_SYS_TIME:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <sys/time.h>.
+ */
+/* I_SYS_TIME_KERNEL:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <sys/time.h> with KERNEL defined.
+ */
+/*#define I_TIME / **/
+#define I_SYS_TIME /**/
+/*#define I_SYS_TIME_KERNEL / **/
+
+/* I_USTAT:
+ * This symbol, if defined, indicates that <ustat.h> exists and
+ * should be included.
+ */
+#define I_USTAT /**/
+
+/* PERL_INC_VERSION_LIST:
+ * This variable specifies the list of subdirectories in over
+ * which perl.c:incpush() and lib/lib.pm will automatically
+ * search when adding directories to @INC, in a format suitable
+ * for a C initialization string. See the inc_version_list entry
+ * in Porting/Glossary for more details.
+ */
+#define PERL_INC_VERSION_LIST /**/
+
+/* HAS_OFF64_T:
+ * This symbol will be defined if the C compiler supports off64_t.
+ */
+/* HAS_FPOS64_T:
+ * This symbol will be defined if the C compiler supports fpos64_t.
+ */
+/*#define HAS_OFF64_T / **/
+/*#define HAS_FPOS64_T / **/
+
+/* PERL_PRIfldbl:
+ * This symbol, if defined, contains the string used by stdio to
+ * format long doubles (format 'f') for output.
+ */
+/* PERL_PRIgldbl:
+ * This symbol, if defined, contains the string used by stdio to
+ * format long doubles (format 'g') for output.
+ */
+#define PERL_PRIfldbl "f" /**/
+#define PERL_PRIgldbl "g" /**/
+
+/* Off_t:
+ * This symbol holds the type used to declare offsets in the kernel.
+ * It can be int, long, off_t, etc... It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
+ */
+/* LSEEKSIZE:
+ * This symbol holds the number of bytes used by the Off_t.
+ */
+/* Off_t_size:
+ * This symbol holds the number of bytes used by the Off_t.
+ */
+#define Off_t off_t /* <offset> type */
+#define LSEEKSIZE 8 /* <offset> size */
+#define Off_t_size 8 /* <offset> size */
/* Free_t:
* This variable contains the return type of free(). It is usually
*/
/*#define MYMALLOC / **/
-/* SIG_NAME:
- * This symbol contains a list of signal names in order of
- * signal number. This is intended
- * to be used as a static array initialization, like this:
- * char *sig_name[] = { SIG_NAME };
- * The signals in the list are separated with commas, and each signal
- * is surrounded by double quotes. There is no leading SIG in the signal
- * name, i.e. SIGQUIT is known as "QUIT".
- * Gaps in the signal numbers (up to NSIG) are filled in with NUMnn,
- * etc., where nn is the actual signal number (e.g. NUM37).
- * The signal number for sig_name[i] is stored in sig_num[i].
- * The last element is 0 to terminate the list with a NULL. This
- * corresponds to the 0 at the end of the sig_num list.
- */
-/* SIG_NUM:
- * This symbol contains a list of signal numbers, in the same order as the
- * SIG_NAME list. It is suitable for static array initialization, as in:
- * int sig_num[] = { SIG_NUM };
- * The signals in the list are separated with commas, and the indices
- * within that list and the SIG_NAME list match, so it's easy to compute
- * the signal name from a number or vice versa at the price of a small
- * dynamic linear lookup.
- * Duplicates are allowed, but are moved to the end of the list.
- * The signal number corresponding to sig_name[i] is sig_number[i].
- * if (i < NSIG) then sig_number[i] == i.
- * The last element is 0, corresponding to the 0 at the end of
- * the sig_name list.
+/* Mode_t:
+ * This symbol holds the type used to declare file modes
+ * for systems calls. It is usually mode_t, but may be
+ * int or unsigned short. It may be necessary to include <sys/types.h>
+ * to get any typedef'ed information.
*/
-#define SIG_NAME "ZERO", "HUP", "INT", "QUIT", "ILL", "TRAP", "ABRT", "EMT", "FPE", "KILL", "BUS", "SEGV", "SYS", "PIPE", "ALRM", "TERM", "IOINT", "STOP", "TSTP", "CONT", "CHLD", "TTIN", "TTOU", "AIO", "XCPU", "XFSZ", "VTALRM", "PROF", "WINCH", "INFO", "USR1", "USR2", "RESV", "RTMIN", "NUM34", "NUM35", "NUM36", "NUM37", "NUM38", "NUM39", "NUM40", "NUM41", "NUM42", "NUM43", "NUM44", "NUM45", "NUM46", "NUM47", "MAX", "IOT", "LOST", "URG", "CLD", "IO", "POLL", "PTY", "PWR", "RTMAX", 0 /**/
-#define SIG_NUM 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 6, 6, 16, 20, 23, 23, 23, 29, 48, 0 /**/
+#define Mode_t mode_t /* file mode parameter for system calls */
-/* VOIDFLAGS:
- * This symbol indicates how much support of the void type is given by this
- * compiler. What various bits mean:
- *
- * 1 = supports declaration of void
- * 2 = supports arrays of pointers to functions returning void
- * 4 = supports comparisons between pointers to void functions and
- * addresses of void functions
- * 8 = suports declaration of generic void pointers
- *
- * The package designer should define VOIDUSED to indicate the requirements
- * of the package. This can be done either by #defining VOIDUSED before
- * including config.h, or by defining defvoidused in Myinit.U. If the
- * latter approach is taken, only those flags will be tested. If the
- * level of void support necessary is not present, defines void to int.
+/* VAL_O_NONBLOCK:
+ * This symbol is to be used during open() or fcntl(F_SETFL) to turn on
+ * non-blocking I/O for the file descriptor. Note that there is no way
+ * back, i.e. you cannot turn it blocking again this way. If you wish to
+ * alternatively switch between blocking and non-blocking, use the
+ * ioctl(FIOSNBIO) call instead, but that is not supported by all devices.
*/
-#ifndef VOIDUSED
-#define VOIDUSED 15
-#endif
-#define VOIDFLAGS 15
-#if (VOIDFLAGS & VOIDUSED) != VOIDUSED
-#define void int /* is void to be avoided? */
-#define M_VOID /* Xenix strikes again */
-#endif
-
-/* HAS_ATOLF:
- * This symbol, if defined, indicates that the atolf routine is
- * available to convert strings into long doubles.
+/* VAL_EAGAIN:
+ * This symbol holds the errno error code set by read() when no data was
+ * present on the non-blocking file descriptor.
*/
-/*#define HAS_ATOLF / **/
-
-/* HAS_ATOLL:
- * This symbol, if defined, indicates that the atoll routine is
- * available to convert strings into long longs.
+/* RD_NODATA:
+ * This symbol holds the return code from read() when no data is present
+ * on the non-blocking file descriptor. Be careful! If EOF_NONBLOCK is
+ * not defined, then you can't distinguish between no data and EOF by
+ * issuing a read(). You'll have to find another way to tell for sure!
*/
-/*#define HAS_ATOLL / **/
-
-/* PERL_BINCOMPAT_5005:
- * This symbol, if defined, indicates that Perl 5.006 should be
- * binary-compatible with Perl 5.005. This is impossible for builds
- * that use features like threads and multiplicity it is always
- * for those versions.
+/* EOF_NONBLOCK:
+ * This symbol, if defined, indicates to the C program that a read() on
+ * a non-blocking file descriptor will return 0 on EOF, and not the value
+ * held in RD_NODATA (-1 usually, in that case!).
*/
-/*#define PERL_BINCOMPAT_5005 / **/
+#define VAL_O_NONBLOCK O_NONBLOCK
+#define VAL_EAGAIN EAGAIN
+#define RD_NODATA -1
+#define EOF_NONBLOCK
-/* DLSYM_NEEDS_UNDERSCORE:
- * This symbol, if defined, indicates that we need to prepend an
- * underscore to the symbol name before calling dlsym(). This only
- * makes sense if you *have* dlsym, which we will presume is the
- * case if you're using dl_dlopen.xs.
+/* Netdb_host_t:
+ * This symbol holds the type used for the 1st argument
+ * to gethostbyaddr().
*/
-/*#define DLSYM_NEEDS_UNDERSCORE / **/
-
-/* HAS_ENDSPENT:
- * This symbol, if defined, indicates that the endspent system call is
- * available to finalize the scan of SysV shadow password entries.
+/* Netdb_hlen_t:
+ * This symbol holds the type used for the 2nd argument
+ * to gethostbyaddr().
*/
-/*#define HAS_ENDSPENT / **/
-
-/* HAS_FSEEKO:
- * This symbol, if defined, indicates that the fseeko routine is
- * available to fseek beyond 32 bits (useful for ILP32 hosts).
+/* Netdb_name_t:
+ * This symbol holds the type used for the argument to
+ * gethostbyname().
+ */
+/* Netdb_net_t:
+ * This symbol holds the type used for the 1st argument to
+ * getnetbyaddr().
*/
-/*#define HAS_FSEEKO / **/
+#define Netdb_host_t const char * /**/
+#define Netdb_hlen_t int /**/
+#define Netdb_name_t const char * /**/
+#define Netdb_net_t int /**/
-/* HAS_FTELLO:
- * This symbol, if defined, indicates that the ftello routine is
- * available to ftell beyond 32 bits (useful for ILP32 hosts).
+/* IVTYPE:
+ * This symbol defines the C type used for Perl's IV.
*/
-/*#define HAS_FTELLO / **/
-
-/* HAS_GETMNTENT:
- * This symbol, if defined, indicates that the getmntent routine is
- * available to iterate through mounted file systems.
+/* UVTYPE:
+ * This symbol defines the C type used for Perl's UV.
*/
-/*#define HAS_GETMNTENT / **/
-
-/* HAS_GETSPENT:
- * This symbol, if defined, indicates that the getspent system call is
- * available to retrieve SysV shadow password entries sequentially.
+/* I8TYPE:
+ * This symbol defines the C type used for Perl's I8.
*/
-/*#define HAS_GETSPENT / **/
-
-/* HAS_GETSPNAM:
- * This symbol, if defined, indicates that the getspnam system call is
- * available to retrieve SysV shadow password entries by name.
+/* U8TYPE:
+ * This symbol defines the C type used for Perl's U8.
*/
-/*#define HAS_GETSPNAM / **/
-
-/* HAS_HASMNTOPT:
- * This symbol, if defined, indicates that the hasmntopt routine is
- * available to query the mount options of file systems.
+/* I16TYPE:
+ * This symbol defines the C type used for Perl's I16.
*/
-/*#define HAS_HASMNTOPT / **/
-
-/* HAS_LDBL_DIG:
- * This symbol, if defined, indicates that this system's <float.h>
- * or <limits.h> defines the symbol LDBL_DIG, which is the number
- * of significant digits in a long double precision number. Unlike
- * for DBL_DIG, there's no good guess for LDBL_DIG if it is undefined.
+/* U16TYPE:
+ * This symbol defines the C type used for Perl's U16.
*/
-#define HAS_LDBL_DIG /* */
-
-/* HAS_MADVISE:
- * This symbol, if defined, indicates that the madvise system call is
- * available to map a file into memory.
+/* I32TYPE:
+ * This symbol defines the C type used for Perl's I32.
*/
-#define HAS_MADVISE /**/
-
-/* HAS_MPROTECT:
- * This symbol, if defined, indicates that the mprotect system call is
- * available to modify the access protection of a memory mapped file.
+/* U32TYPE:
+ * This symbol defines the C type used for Perl's U32.
*/
-#define HAS_MPROTECT /**/
-
-/* HAS_READV:
- * This symbol, if defined, indicates that the readv routine is
- * available to do gather reads. You will also need <sys/uio.h>
- * and there I_SYSUIO.
+/* I64TYPE:
+ * This symbol defines the C type used for Perl's I64.
*/
-#define HAS_READV /**/
-
-/* HAS_SETSPENT:
- * This symbol, if defined, indicates that the setspent system call is
- * available to initialize the scan of SysV shadow password entries.
+/* U64TYPE:
+ * This symbol defines the C type used for Perl's U64.
*/
-/*#define HAS_SETSPENT / **/
-
-/* USE_SFIO:
- * This symbol, if defined, indicates that sfio should
- * be used.
+/* NVTYPE:
+ * This symbol defines the C type used for Perl's NV.
*/
-/*#define USE_SFIO / **/
-
-/* HAS_FSTATFS:
- * This symbol, if defined, indicates that the fstatfs routine is
- * available to stat filesystems of file descriptors.
+/* IVSIZE:
+ * This symbol contains the sizeof(IV).
*/
-/* HAS_STRUCT_STATFS_FLAGS:
- * This symbol, if defined, indicates that the struct statfs
- * does have the f_flags member containing the mount flags of
- * the filesystem holding the file.
- * This kind of struct statfs is coming from sys/mount.h (BSD),
- * not from sys/statfs.h (SYSV).
+/* UVSIZE:
+ * This symbol contains the sizeof(UV).
*/
-#define HAS_FSTATFS /**/
-#define HAS_STRUCT_STATFS_FLAGS /**/
-
-/* HAS_FSTATVFS:
- * This symbol, if defined, indicates that the fstatvfs routine is
- * available to stat filesystems of file descriptors.
+/* I8SIZE:
+ * This symbol contains the sizeof(I8).
*/
-#define HAS_FSTATVFS /**/
-
-/* HAS_TELLDIR_PROTO:
- * This symbol, if defined, indicates that the system provides
- * a prototype for the telldir() function. Otherwise, it is up
- * to the program to supply one. A good guess is
- * extern long telldir _((DIR*));
+/* U8SIZE:
+ * This symbol contains the sizeof(U8).
*/
-#define HAS_TELLDIR_PROTO /**/
-
-/* HAS_WRITEV:
- * This symbol, if defined, indicates that the writev routine is
- * available to do scatter writes.
+/* I16SIZE:
+ * This symbol contains the sizeof(I16).
*/
-#define HAS_WRITEV /**/
-
-/* USE_DYNAMIC_LOADING:
- * This symbol, if defined, indicates that dynamic loading of
- * some sort is available.
+/* U16SIZE:
+ * This symbol contains the sizeof(U16).
*/
-#define USE_DYNAMIC_LOADING /**/
-
-/* FFLUSH_NULL:
- * This symbol, if defined, tells that fflush(NULL) does flush
- * all pending stdio output.
+/* I32SIZE:
+ * This symbol contains the sizeof(I32).
*/
-/* FFLUSH_ALL:
- * This symbol, if defined, tells that to flush
- * all pending stdio output one must loop through all
- * the stdio file handles stored in an array and fflush them.
- * Note that if fflushNULL is defined, fflushall will not
- * even be probed for and will be left undefined.
+/* U32SIZE:
+ * This symbol contains the sizeof(U32).
*/
-#define FFLUSH_NULL /**/
-/*#define FFLUSH_ALL / **/
-
-/* DB_Prefix_t:
- * This symbol contains the type of the prefix structure element
- * in the <db.h> header file. In older versions of DB, it was
- * int, while in newer ones it is u_int32_t.
+/* I64SIZE:
+ * This symbol contains the sizeof(I64).
*/
-/* DB_Hash_t:
- * This symbol contains the type of the prefix structure element
- * in the <db.h> header file. In older versions of DB, it was
- * int, while in newer ones it is size_t.
+/* U64SIZE:
+ * This symbol contains the sizeof(U64).
*/
-#define DB_Hash_t u_int32_t /**/
-#define DB_Prefix_t size_t /**/
+#define IVTYPE long /**/
+#define UVTYPE unsigned long /**/
+#define I8TYPE char /**/
+#define U8TYPE unsigned char /**/
+#define I16TYPE short /**/
+#define U16TYPE unsigned short /**/
+#define I32TYPE int /**/
+#define U32TYPE unsigned int /**/
+#ifdef HAS_QUAD
+#define I64TYPE long /**/
+#define U64TYPE unsigned long /**/
+#endif
+#define NVTYPE double /**/
+#define IVSIZE 8 /**/
+#define UVSIZE 8 /**/
+#define I8SIZE 1 /**/
+#define U8SIZE 1 /**/
+#define I16SIZE 2 /**/
+#define U16SIZE 2 /**/
+#define I32SIZE 4 /**/
+#define U32SIZE 4 /**/
+#ifdef HAS_QUAD
+#define I64SIZE 8 /**/
+#define U64SIZE 8 /**/
+#endif
-/* I_INTTYPES:
- * This symbol, if defined, indicates to the C program that it should
- * include <inttypes.h>.
+/* IVdf:
+ * This symbol defines the format string used for printing a Perl IV
+ * as a signed decimal integer.
*/
-/* HAS_INT64_T:
- * This symbol will defined if the C compiler supports int64_t.
- * Usually the <inttypes.h> needs to be included, but sometimes
- * <sys/types.h> is enough.
+/* UVuf:
+ * This symbol defines the format string used for printing a Perl UV
+ * as an unsigned decimal integer.
*/
-/*#define I_INTTYPES / **/
-/*#define HAS_INT64_T / **/
-
-/* I_MNTENT:
- * This symbol, if defined, indicates that <mntent.h> exists and
- * should be included.
+/* UVof:
+ * This symbol defines the format string used for printing a Perl UV
+ * as an unsigned octal integer.
*/
-/*#define I_MNTENT / **/
-
-/* I_NETINET_TCP:
- * This symbol, if defined, indicates to the C program that it should
- * include <netinet/tcp.h>.
+/* UVxf:
+ * This symbol defines the format string used for printing a Perl UV
+ * as an unsigned hexadecimal integer.
*/
-#define I_NETINET_TCP /**/
+#define IVdf "ld" /**/
+#define UVuf "lu" /**/
+#define UVof "lo" /**/
+#define UVxf "lx" /**/
-/* I_POLL:
- * This symbol, if defined, indicates that <poll.h> exists and
- * should be included.
+/* Pid_t:
+ * This symbol holds the type used to declare process ids in the kernel.
+ * It can be int, uint, pid_t, etc... It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
*/
-#define I_POLL /**/
+#define Pid_t pid_t /* PID type */
-/* I_SHADOW:
- * This symbol, if defined, indicates that <shadow.h> exists and
- * should be included.
+/* PRIVLIB:
+ * This symbol contains the name of the private library for this package.
+ * The library is private in the sense that it needn't be in anyone's
+ * execution path, but it should be accessible by the world. The program
+ * should be prepared to do ~ expansion.
*/
-/*#define I_SHADOW / **/
+/* PRIVLIB_EXP:
+ * This symbol contains the ~name expanded version of PRIVLIB, to be used
+ * in programs that are not prepared to deal with ~ expansion at run-time.
+ */
+#define PRIVLIB "/opt/perl/lib/5.5.640" /**/
+#define PRIVLIB_EXP "/opt/perl/lib/5.5.640" /**/
-/* I_SOCKS:
- * This symbol, if defined, indicates that <socks.h> exists and
- * should be included.
+/* PTRSIZE:
+ * This symbol contains the size of a pointer, so that the C preprocessor
+ * can make decisions based on it. It will be sizeof(void *) if
+ * the compiler supports (void *); otherwise it will be
+ * sizeof(char *).
*/
-/*#define I_SOCKS / **/
+#define PTRSIZE 8 /**/
-/* I_SYS_MMAN:
- * This symbol, if defined, indicates that <sys/mman.h> exists and
- * should be included.
+/* Drand01:
+ * This macro is to be used to generate uniformly distributed
+ * random numbers over the range [0., 1.[. You may have to supply
+ * an 'extern double drand48();' in your program since SunOS 4.1.3
+ * doesn't provide you with anything relevant in it's headers.
+ * See HAS_DRAND48_PROTO.
+ */
+/* Rand_seed_t:
+ * This symbol defines the type of the argument of the
+ * random seed function.
+ */
+/* seedDrand01:
+ * This symbol defines the macro to be used in seeding the
+ * random number generator (see Drand01).
+ */
+/* RANDBITS:
+ * This symbol indicates how many bits are produced by the
+ * function used to generate normalized random numbers.
+ * Values include 15, 16, 31, and 48.
*/
-#define I_SYS_MMAN /**/
+#define Drand01() drand48() /**/
+#define Rand_seed_t long /**/
+#define seedDrand01(x) srand48((Rand_seed_t)x) /**/
+#define RANDBITS 48 /**/
-/* I_SYS_MOUNT:
- * This symbol, if defined, indicates that <sys/mount.h> exists and
- * should be included.
+/* SELECT_MIN_BITS:
+ * This symbol holds the minimum number of bits operated by select.
+ * That is, if you do select(n, ...), how many bits at least will be
+ * cleared in the masks if some activity is detected. Usually this
+ * is either n or 32*ceil(n/32), especially many little-endians do
+ * the latter. This is only useful if you have select(), naturally.
*/
-#define I_SYS_MOUNT /**/
+#define SELECT_MIN_BITS 32 /**/
-/* I_SYS_STATVFS:
- * This symbol, if defined, indicates that <sys/statvfs.h> exists and
- * should be included.
+/* Select_fd_set_t:
+ * This symbol holds the type used for the 2nd, 3rd, and 4th
+ * arguments to select. Usually, this is 'fd_set *', if HAS_FD_SET
+ * is defined, and 'int *' otherwise. This is only useful if you
+ * have select(), of course.
*/
-#define I_SYS_STATVFS /**/
+#define Select_fd_set_t fd_set * /**/
-/* HAS_OFF64_T:
- * This symbol will be defined if the C compiler supports off64_t.
+/* SIG_NAME:
+ * This symbol contains a list of signal names in order of
+ * signal number. This is intended
+ * to be used as a static array initialization, like this:
+ * char *sig_name[] = { SIG_NAME };
+ * The signals in the list are separated with commas, and each signal
+ * is surrounded by double quotes. There is no leading SIG in the signal
+ * name, i.e. SIGQUIT is known as "QUIT".
+ * Gaps in the signal numbers (up to NSIG) are filled in with NUMnn,
+ * etc., where nn is the actual signal number (e.g. NUM37).
+ * The signal number for sig_name[i] is stored in sig_num[i].
+ * The last element is 0 to terminate the list with a NULL. This
+ * corresponds to the 0 at the end of the sig_num list.
*/
-/* HAS_FPOS64_T:
- * This symbol will be defined if the C compiler supports fpos64_t.
+/* SIG_NUM:
+ * This symbol contains a list of signal numbers, in the same order as the
+ * SIG_NAME list. It is suitable for static array initialization, as in:
+ * int sig_num[] = { SIG_NUM };
+ * The signals in the list are separated with commas, and the indices
+ * within that list and the SIG_NAME list match, so it's easy to compute
+ * the signal name from a number or vice versa at the price of a small
+ * dynamic linear lookup.
+ * Duplicates are allowed, but are moved to the end of the list.
+ * The signal number corresponding to sig_name[i] is sig_number[i].
+ * if (i < NSIG) then sig_number[i] == i.
+ * The last element is 0, corresponding to the 0 at the end of
+ * the sig_name list.
*/
-/*#define HAS_OFF64_T / **/
-/*#define HAS_FPOS64_T / **/
+#define SIG_NAME "ZERO", "HUP", "INT", "QUIT", "ILL", "TRAP", "ABRT", "EMT", "FPE", "KILL", "BUS", "SEGV", "SYS", "PIPE", "ALRM", "TERM", "IOINT", "STOP", "TSTP", "CONT", "CHLD", "TTIN", "TTOU", "AIO", "XCPU", "XFSZ", "VTALRM", "PROF", "WINCH", "INFO", "USR1", "USR2", "RESV", "RTMIN", "NUM34", "NUM35", "NUM36", "NUM37", "NUM38", "NUM39", "NUM40", "NUM41", "NUM42", "NUM43", "NUM44", "NUM45", "NUM46", "NUM47", "MAX", "IOT", "LOST", "URG", "CLD", "IO", "POLL", "PTY", "PWR", "RTMAX", 0 /**/
+#define SIG_NUM 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 6, 6, 16, 20, 23, 23, 23, 29, 48, 0 /**/
-/* PERL_PRIfldbl:
- * This symbol, if defined, contains the string used by stdio to
- * format long doubles (format 'f') for output.
+/* SITEARCH:
+ * This symbol contains the name of the private library for this package.
+ * The library is private in the sense that it needn't be in anyone's
+ * execution path, but it should be accessible by the world. The program
+ * should be prepared to do ~ expansion.
+ * The standard distribution will put nothing in this directory.
+ * After perl has been installed, users may install their own local
+ * architecture-dependent modules in this directory with
+ * MakeMaker Makefile.PL
+ * or equivalent. See INSTALL for details.
*/
-/* PERL_PRIgldbl:
- * This symbol, if defined, contains the string used by stdio to
- * format long doubles (format 'g') for output.
+/* SITEARCH_EXP:
+ * This symbol contains the ~name expanded version of SITEARCH, to be used
+ * in programs that are not prepared to deal with ~ expansion at run-time.
*/
-#define PERL_PRIfldbl "f" /**/
-#define PERL_PRIgldbl "g" /**/
+#define SITEARCH "/opt/perl/lib/site_perl/5.5.640/alpha-dec_osf-thread-multi" /**/
+#define SITEARCH_EXP "/opt/perl/lib/site_perl/5.5.640/alpha-dec_osf-thread-multi" /**/
-/* PERL_PRId64:
- * This symbol, if defined, contains the string used by stdio to
- * format 64-bit decimal numbers (format 'd') for output.
- */
-/* PERL_PRIu64:
- * This symbol, if defined, contains the string used by stdio to
- * format 64-bit unsigned decimal numbers (format 'u') for output.
+/* SITELIB:
+ * This symbol contains the name of the private library for this package.
+ * The library is private in the sense that it needn't be in anyone's
+ * execution path, but it should be accessible by the world. The program
+ * should be prepared to do ~ expansion.
+ * The standard distribution will put nothing in this directory.
+ * After perl has been installed, users may install their own local
+ * architecture-independent modules in this directory with
+ * MakeMaker Makefile.PL
+ * or equivalent. See INSTALL for details.
*/
-/* PERL_PRIo64:
- * This symbol, if defined, contains the string used by stdio to
- * format 64-bit octal numbers (format 'o') for output.
+/* SITELIB_EXP:
+ * This symbol contains the ~name expanded version of SITELIB, to be used
+ * in programs that are not prepared to deal with ~ expansion at run-time.
*/
-/* PERL_PRIx64:
- * This symbol, if defined, contains the string used by stdio to
- * format 64-bit hexadecimal numbers (format 'x') for output.
+#define SITELIB "/opt/perl/lib/site_perl/5.5.640" /**/
+#define SITELIB_EXP "/opt/perl/lib/site_perl/5.5.640" /**/
+
+/* Size_t:
+ * This symbol holds the type used to declare length parameters
+ * for string functions. It is usually size_t, but may be
+ * unsigned long, int, etc. It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
*/
-#define PERL_PRId64 "ld" /**/
-#define PERL_PRIu64 "lu" /**/
-#define PERL_PRIo64 "lo" /**/
-#define PERL_PRIx64 "lx" /**/
+#define Size_t size_t /* length paramater for string functions */
-/* SELECT_MIN_BITS:
- * This symbol holds the minimum number of bits operated by select.
- * That is, if you do select(n, ...), how many bits at least will be
- * cleared in the masks if some activity is detected. Usually this
- * is either n or 32*ceil(n/32), especially many little-endians do
- * the latter. This is only useful if you have select(), naturally.
+/* SSize_t:
+ * This symbol holds the type used by functions that return
+ * a count of bytes or an error condition. It must be a signed type.
+ * It is usually ssize_t, but may be long or int, etc.
+ * It may be necessary to include <sys/types.h> or <unistd.h>
+ * to get any typedef'ed information.
+ * We will pick a type such that sizeof(SSize_t) == sizeof(Size_t).
*/
-#define SELECT_MIN_BITS 32 /**/
+#define SSize_t ssize_t /* signed count of bytes */
/* STARTPERL:
* This variable contains the string to put in front of a perl
#define HAS_STDIO_STREAM_ARRAY /**/
#define STDIO_STREAM_ARRAY _iob
-/* HAS_STRTOULL:
- * This symbol, if defined, indicates that the strtoull routine is
- * available to convert strings into unsigned long longs.
+/* Uid_t_f:
+ * This symbol defines the format string used for printing a Uid_t.
*/
-/*#define HAS_STRTOULL / **/
+#define Uid_t_f "u" /**/
+
+/* Uid_t_size:
+ * This symbol holds the size of a Uid_t in bytes.
+ */
+#define Uid_t_size 4 /* UID size */
+
+/* Uid_t:
+ * This symbol holds the type used to declare user ids in the kernel.
+ * It can be int, ushort, uid_t, etc... It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
+ */
+#define Uid_t uid_t /* UID type */
/* USE_64_BITS:
- * This symbol, if defined, indicates that 64-bit interfaces should
- * be used when available. If not defined, the native default interfaces
+ * This symbol, if defined, indicates that 64-bit integers should
+ * be used when available. If not defined, the native integers
* will be used (be they 32 or 64 bits).
*/
+#ifndef USE_64_BITS
#define USE_64_BITS /**/
+#endif
/* USE_LARGE_FILES:
* This symbol, if defined, indicates that large file support
* should be used when available. The USE_64_BITS symbol will
* also be turned on if necessary.
*/
+#ifndef USE_LARGE_FILES
#define USE_LARGE_FILES /**/
+#endif
/* USE_LONG_DOUBLE:
* This symbol, if defined, indicates that long doubles should
* be used when available.
*/
+#ifndef USE_LONG_DOUBLE
/*#define USE_LONG_DOUBLE / **/
+#endif
+
+/* USE_LONG_LONG:
+ * This symbol, if defined, indicates that long longs should
+ * be used when available.
+ */
+#ifndef USE_LONG_LONG
+/*#define USE_LONG_LONG / **/
+#endif
+
+#ifndef USE_MORE_BITS
+/*#define USE_MORE_BITS / **/
+#endif
/* MULTIPLICITY:
* This symbol, if defined, indicates that Perl should
* be built to use multiplicity.
*/
-/*#define MULTIPLICITY / **/
+#ifndef MULTIPLICTY
+#define MULTIPLICITY /**/
+#endif
/* USE_PERLIO:
* This symbol, if defined, indicates that the PerlIO abstraction should
* be used throughout. If not defined, stdio should be
* used in a fully backward compatible manner.
*/
+#ifndef USE_PERLIO
/*#define USE_PERLIO / **/
+#endif
/* USE_SOCKS:
* This symbol, if defined, indicates that Perl should
* be built to use socks.
*/
+#ifndef USE_SOCKS
/*#define USE_SOCKS / **/
+#endif
-/* HAS_DRAND48_PROTO:
- * This symbol, if defined, indicates that the system provides
- * a prototype for the drand48() function. Otherwise, it is up
- * to the program to supply one. A good guess is
- * extern double drand48 _((void));
- */
-#define HAS_DRAND48_PROTO /**/
-
-/* HAS_GETHOST_PROTOS:
- * This symbol, if defined, indicates that <netdb.h> includes
- * prototypes for gethostent(), gethostbyname(), and
- * gethostbyaddr(). Otherwise, it is up to the program to guess
- * them. See netdbtype.U for probing for various Netdb_xxx_t types.
- */
-#define HAS_GETHOST_PROTOS /**/
-
-/* HAS_GETNET_PROTOS:
- * This symbol, if defined, indicates that <netdb.h> includes
- * prototypes for getnetent(), getnetbyname(), and
- * getnetbyaddr(). Otherwise, it is up to the program to guess
- * them. See netdbtype.U for probing for various Netdb_xxx_t types.
- */
-#define HAS_GETNET_PROTOS /**/
-
-/* HAS_GETPROTO_PROTOS:
- * This symbol, if defined, indicates that <netdb.h> includes
- * prototypes for getprotoent(), getprotobyname(), and
- * getprotobyaddr(). Otherwise, it is up to the program to guess
- * them. See netdbtype.U for probing for various Netdb_xxx_t types.
- */
-#define HAS_GETPROTO_PROTOS /**/
-
-/* HAS_GETSERV_PROTOS:
- * This symbol, if defined, indicates that <netdb.h> includes
- * prototypes for getservent(), getservbyname(), and
- * getservbyaddr(). Otherwise, it is up to the program to guess
- * them. See netdbtype.U for probing for various Netdb_xxx_t types.
- */
-#define HAS_GETSERV_PROTOS /**/
-
-/* Netdb_host_t:
- * This symbol holds the type used for the 1st argument
- * to gethostbyaddr().
- */
-/* Netdb_hlen_t:
- * This symbol holds the type used for the 2nd argument
- * to gethostbyaddr().
- */
-/* Netdb_name_t:
- * This symbol holds the type used for the argument to
- * gethostbyname().
- */
-/* Netdb_net_t:
- * This symbol holds the type used for the 1st argument to
- * getnetbyaddr().
- */
-#define Netdb_host_t const char * /**/
-#define Netdb_hlen_t int /**/
-#define Netdb_name_t const char * /**/
-#define Netdb_net_t int /**/
-
-/* Select_fd_set_t:
- * This symbol holds the type used for the 2nd, 3rd, and 4th
- * arguments to select. Usually, this is 'fd_set *', if HAS_FD_SET
- * is defined, and 'int *' otherwise. This is only useful if you
- * have select(), of course.
- */
-#define Select_fd_set_t fd_set * /**/
-
-/* ARCHNAME:
- * This symbol holds a string representing the architecture name.
- * It may be used to construct an architecture-dependant pathname
- * where library files may be held under a private library, for
- * instance.
- */
-#define ARCHNAME "alpha-dec_osf-thread" /**/
-
-/* OLD_PTHREAD_CREATE_JOINABLE:
- * This symbol, if defined, indicates how to create pthread
- * in joinable (aka undetached) state. NOTE: not defined
- * if pthread.h already has defined PTHREAD_CREATE_JOINABLE
- * (the new version of the constant).
- * If defined, known values are PTHREAD_CREATE_UNDETACHED
- * and __UNDETACHED.
- */
-/*#define OLD_PTHREAD_CREATE_JOINABLE / **/
-
-/* HAS_PTHREAD_YIELD:
- * This symbol, if defined, indicates that the pthread_yield
- * routine is available to yield the execution of the current
- * thread. sched_yield is preferable to pthread_yield.
- */
-/* SCHED_YIELD:
- * This symbol defines the way to yield the execution of
- * the current thread. Known ways are sched_yield,
- * pthread_yield, and pthread_yield with NULL.
- */
-/* HAS_SCHED_YIELD:
- * This symbol, if defined, indicates that the sched_yield
- * routine is available to yield the execution of the current
- * thread. sched_yield is preferable to pthread_yield.
- */
-/*#define HAS_PTHREAD_YIELD / **/
-#define SCHED_YIELD sched_yield() /**/
-#define HAS_SCHED_YIELD /**/
-
-/* I_MACH_CTHREADS:
- * This symbol, if defined, indicates to the C program that it should
- * include <mach/cthreads.h>.
- */
-/*#define I_MACH_CTHREADS / **/
-
-/* I_PTHREAD:
- * This symbol, if defined, indicates to the C program that it should
- * include <pthread.h>.
+/* USE_ITHREADS:
+ * This symbol, if defined, indicates that Perl should be built to
+ * use the interpreter-based threading implementation.
*/
-#define I_PTHREAD /**/
-
-/* USE_THREADS:
- * This symbol, if defined, indicates that Perl should
- * be built to use threads.
+/* USE_5005THREADS:
+ * This symbol, if defined, indicates that Perl should be built to
+ * use the 5.005-based threading implementation.
*/
/* OLD_PTHREADS_API:
* This symbol, if defined, indicates that Perl should
* be built to use the old draft POSIX threads API.
*/
-#define USE_THREADS /**/
+/*#define USE_5005THREADS / **/
+#define USE_ITHREADS /**/
+#if defined(USE_5005THREADS) && !defined(USE_ITHREADS)
+#define USE_THREADS /* until src is revised*/
+#endif
/*#define OLD_PTHREADS_API / **/
-/* Time_t:
- * This symbol holds the type returned by time(). It can be long,
- * or time_t on BSD sites (in which case <sys/types.h> should be
- * included).
- */
-#define Time_t time_t /* Time type */
-
-/* HAS_TIMES:
- * This symbol, if defined, indicates that the times() routine exists.
- * Note that this became obsolete on some systems (SUNOS), which now
- * use getrusage(). It may be necessary to include <sys/times.h>.
- */
-#define HAS_TIMES /**/
-
-/* Fpos_t:
- * This symbol holds the type used to declare file positions in libc.
- * It can be fpos_t, long, uint, etc... It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
- */
-#define Fpos_t fpos_t /* File position type */
-
-/* Gid_t:
- * This symbol holds the return type of getgid() and the type of
- * argument to setrgid() and related functions. Typically,
- * it is the type of group ids in the kernel. It can be int, ushort,
- * uid_t, etc... It may be necessary to include <sys/types.h> to get
- * any typedef'ed information.
- */
-#define Gid_t gid_t /* Type for getgid(), etc... */
-
-/* Off_t:
- * This symbol holds the type used to declare offsets in the kernel.
- * It can be int, long, off_t, etc... It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
- */
-/* LSEEKSIZE:
- * This symbol holds the number of bytes used by the Off_t.
- */
-#define Off_t off_t /* <offset> type */
-#define LSEEKSIZE 8 /* <offset> size */
-
-/* Mode_t:
- * This symbol holds the type used to declare file modes
- * for systems calls. It is usually mode_t, but may be
- * int or unsigned short. It may be necessary to include <sys/types.h>
- * to get any typedef'ed information.
- */
-#define Mode_t mode_t /* file mode parameter for system calls */
-
-/* Pid_t:
- * This symbol holds the type used to declare process ids in the kernel.
- * It can be int, uint, pid_t, etc... It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
- */
-#define Pid_t pid_t /* PID type */
-
-/* Size_t:
- * This symbol holds the type used to declare length parameters
- * for string functions. It is usually size_t, but may be
- * unsigned long, int, etc. It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
+/* PERL_VENDORLIB_EXP:
+ * This symbol contains the ~name expanded version of VENDORLIB, to be used
+ * in programs that are not prepared to deal with ~ expansion at run-time.
*/
-#define Size_t size_t /* length paramater for string functions */
+/*#define PERL_VENDORLIB_EXP "" / **/
-/* Uid_t:
- * This symbol holds the type used to declare user ids in the kernel.
- * It can be int, ushort, uid_t, etc... It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
+/* VOIDFLAGS:
+ * This symbol indicates how much support of the void type is given by this
+ * compiler. What various bits mean:
+ *
+ * 1 = supports declaration of void
+ * 2 = supports arrays of pointers to functions returning void
+ * 4 = supports comparisons between pointers to void functions and
+ * addresses of void functions
+ * 8 = suports declaration of generic void pointers
+ *
+ * The package designer should define VOIDUSED to indicate the requirements
+ * of the package. This can be done either by #defining VOIDUSED before
+ * including config.h, or by defining defvoidused in Myinit.U. If the
+ * latter approach is taken, only those flags will be tested. If the
+ * level of void support necessary is not present, defines void to int.
*/
-#define Uid_t uid_t /* UID type */
+#ifndef VOIDUSED
+#define VOIDUSED 15
+#endif
+#define VOIDFLAGS 15
+#if (VOIDFLAGS & VOIDUSED) != VOIDUSED
+#define void int /* is void to be avoided? */
+#define M_VOID /* Xenix strikes again */
+#endif
#endif
# grep
while (<>) {
- if (/^(.*?)\b($pat)\b(.*)$/o) {
- my $head = "$1#$2#";
- $_ = $3;
- while (/^(.*?)\b($pat)\b(.*)$/o) {
- $head .= "$1#$2#";
- $_ = $3;
- }
- print "$ARGV\:$.\:$head$_\n";
- }
+ print "$ARGV\:$.\:$_" if s/\b($pat)\b/#$1#/og;
+# this variant might useful if the transformation is more complicated
+# if (/^(.*?)\b($pat)\b(.*)$/o) {
+# my $head = "$1#$2#";
+# $_ = $3;
+# while (/^(.*?)\b($pat)\b(.*)$/o) {
+# $head .= "$1#$2#";
+# $_ = $3;
+# }
+# print "$ARGV\:$.\:$head$_\n";
+# }
}
continue {
close ARGV if eof;
pad_reset_pending
padix
padix_floor
-parsehook
patchlevel
patleave
pending_ident
#
# Outputs the changelist to stdout.
#
-# Gurusamy Sarathy <gsar@umich.edu>
+# Gurusamy Sarathy <gsar@activestate.com>
#
use Text::Wrap;
ext/ByteLoader/byterun.h
global.sym
keywords.h
- lib/warning.pm
+ lib/warnings.pm
objXSUB.h
opcode.h
pp.sym
pp_proto.h
regnodes.h
- warning.h
+ warnings.h
win32/config_H.bc
win32/config_H.gc
win32/config_H.vc
# reads a perforce style diff on stdin and outputs appropriate headers
# so the diff can be applied with the patch program
#
-# Gurusamy Sarathy <gsar@umich.edu>
+# Gurusamy Sarathy <gsar@activestate.com>
#
BEGIN {
#
# Munge "p4 describe ..." output to include new files.
#
-# Gurusamy Sarathy <gsar@umich.edu>
+# Gurusamy Sarathy <gsar@activestate.com>
#
use vars qw($thisfile $change $file $fnum $h $v $p4port @addfiles);
use strict;
use vars qw($VERSION);
-$VERSION = 2.10;
+$VERSION = 2.11;
sub usage {
die qq{
(F has \$ appended unless it contains a /).
-e Expect patched files to Exist (relative to current directory)
Will print warnings for files which don't. Also affects -4 option.
+ - Read patch from STDIN
other options for special uses:
-I just gather and display summary Information about the patches.
-4 write to stdout the PerForce commands to prepare for patching.
warn "Ignored directory $in\n";
next;
}
- unless (open F, "<$in") {
+ if ($in eq "-") {
+ *F = \*STDIN;
+ } elsif (not open F, "<$in") {
warn "Unable to open $in: $!\n";
next;
}
=head2 Maintenance and Development Subversions
-Starting with version 5.004, subversions _01 through _49 is reserved
+Starting with version 5.004, subversions _01 through _49 are reserved
for bug-fix maintenance releases, and subversions _50 through _99 for
unstable development versions.
separate subdirectory (djgpp, win32) and put the files in there.
Remember to update C<MANIFEST> when you add files.
-If your system support dynamic loading but none of the existing
+If your system supports dynamic loading but none of the existing
methods at F<ext/DynaLoader/dl_*.xs> work for you, you must write
a new one. Study the existing ones to see what kind of interface
you must supply.
=back
-=head2 @INC search order
-
-By default, the list of perl library directories in @INC is the
-following:
-
- $archlib
- $privlib
- $sitearch
- $sitelib
-
-Specifically, on my Solaris/x86 system, I run
-B<sh Configure -Dprefix=/opt/perl> and I have the following
-directories:
-
- /opt/perl/lib/i86pc-solaris/5.00307
- /opt/perl/lib
- /opt/perl/lib/site_perl/i86pc-solaris
- /opt/perl/lib/site_perl
-
-That is, perl's directories come first, followed by the site-specific
-directories.
-
-The site libraries come second to support the usage of extensions
-across perl versions. Read the relevant section in F<INSTALL> for
-more information. If we ever make $sitearch version-specific, this
-topic could be revisited.
-
=head2 Why isn't there a directory to override Perl's library?
Mainly because no one's gotten around to making one. Note that
=over 4
-=item installprefix
-
-I think we ought to support
-
- Configure -Dinstallprefix=/blah/blah
-
-Currently, we support B<-Dprefix=/blah/blah>, but the changing the install
-location has to be handled by something like the F<config.over> trick
-described in F<INSTALL>. AFS users also are treated specially.
-We should probably duplicate the metaconfig prefix stuff for an
-install prefix.
-
=item Configure -Dsrc=/blah/blah
We should be able to emulate B<configure --srcdir>. Tom Tromey
back into the main distribution, but various parts of the perl
Configure/build/install process still assume src='.'.
-=item Directory for vendor-supplied modules?
-
-If a vendor supplies perl, but wants to leave $siteperl and $sitearch
-for the local user to use, where should the vendor put vendor-supplied
-modules (such as Tk.so)? If the vendor puts them in the default $archlib,
-then they need to be updated each time the perl version is updated.
-Perhaps we need a set of libries $vendorlib and $vendorarch that
-track $apiversion (like the $sitexxx directories do) rather than just
-$version (like the main perl directory).
-
-An alternative (and perhaps even better) plan might be for the vendor
-to select non-default $privlib and $archlib directories, perhaps using
-$apiversion instead of $version (or even just /usr/lib/perl5 with no
-version stuff at all), and put modules into those directories (with perl
-Makefile.PL INSTALLDIRS=perl). This would be fine unless the vendor
-wanted to support different versions of perl installed at the same time.
-(How many vendors *really* want to do that?)
-
-=item Separate directories for Perl-supplied and add-on man pages
-
-Man pages supplied with the perl distribution proper ought to go in
-an appropriate man directory. Perhaps man pages supplied with add-on
-modules ought to (at least optionally) go into a $siteman[1-9] directory.
-For example, suppose that $privlib is /usr/lib/perl5 and $man1dir
-is /usr/man/man1. Also, suppose $sitelib is /usr/local/lib/perl5.
-In this situation, it might make sense for man pages to go into
-/usr/local/lib/man/man1.
-
=item Hint file fixes
Various hint files work around Configure problems. We ought to fix
Some of the hint file information (particularly dynamic loading stuff)
ought to be fed back into the main metaconfig distribution.
-=item Catch GNU Libc "Stub" functions
-
-Some functions (such as lchown()) are present in libc, but are
-unimplmented. That is, they always fail and set errno=ENOSYS.
-
-Thomas Bushnell provided the following sample code and the explanation
-that follows:
-
- /* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char FOO(); below. */
- #include <assert.h>
- /* Override any gcc2 internal prototype to avoid an error. */
- /* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
- char FOO();
-
- int main() {
-
- /* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
- #if defined (__stub_FOO) || defined (__stub___FOO)
- choke me
- #else
- FOO();
- #endif
-
- ; return 0; }
-
-The choice of <assert.h> is essentially arbitrary. The GNU libc
-macros are found in <gnu/stubs.h>. You can include that file instead
-of <assert.h> (which itself includes <gnu/stubs.h>) if you test for
-its existence first. <assert.h> is assumed to exist on every system,
-which is why it's used here. Any GNU libc header file will include
-the stubs macros. If either __stub_NAME or __stub___NAME is defined,
-then the function doesn't actually exist. Tests using <assert.h> work
-on every system around.
-
-The declaration of FOO is there to override builtin prototypes for
-ANSI C functions.
-
=back
=head2 Probably good ideas waiting for round tuits
=head1 LAST MODIFIED
-$Id: pumpkin.pod,v 1.22 1998/07/22 16:33:55 doughera Released $
+$Id: pumpkin.pod,v 1.23 2000/01/13 19:45:13 doughera Released $
--------------------------------------------------------------------------
Perl is a language that combines some of the features of C, sed, awk
-and shell. See the manual page for more hype. There are also two Nutshell
-Handbooks published by O'Reilly & Assoc. See pod/perlbook.pod
-for more information.
+and shell. See the manual page for more hype. There are also many Perl
+books available, covering a wide variety of topics, from various publishers.
+See pod/perlbook.pod for more information.
Please read all the directions below before you proceed any further, and
then follow them carefully.
Installation
-1) Detailed instructions are in the file INSTALL which you should read.
-In brief, the following should work on most systems:
-
- rm -f config.sh Policy.sh
- sh Configure -de
- make
- make test
- make install
-
-For most systems, it should be safe to accept all the Configure defaults.
-It is recommended that you accept the defaults the first time you build
-or if you have any problems building.
-
-The above commands will install Perl to /usr/local or /opt, depending
-on the platform. If that's not okay with you, use
-
- rm -f config.sh Policy.sh
- sh Configure
- make
- make test
- make install
-
-Full configuration instructions can be found in the INSTALL file.
+1) Detailed instructions are in the file "INSTALL", which you should
+read if you are either installing on a system resembling Unix
+or porting perl to another platform. For non-Unix platforms, see the
+corresponding README.
2) Read the manual entries before running perl.
or will have the same problem. It's usually helpful if you send the
output of the "myconfig" script in the main perl directory.
-If you've succeeded in compiling perl, the perlbug script in the utils/
+If you've succeeded in compiling perl, the perlbug script in the "utils"
subdirectory can be used to help mail in a bug report.
If possible, send in patches such that the patch program will apply them.
Context diffs are the best, then normal diffs. Don't send ed scripts--
I've probably changed my copy since the version you have.
-Watch for perl patches in comp.lang.perl.announce. Patches will generally
-be in a form usable by the patch program. If you are just now bringing
-up perl and aren't sure how many patches there are, write to me and I'll
-send any you don't have. Your current patch level is shown in
-patchlevel.h.
+The latest versions of perl are always available on the various CPAN
+(Comprehensive Perl Archive Network) sites around the world.
+See <URL:http://www.perl.com/CPAN/src/>.
Just a personal note: I want you to know that I create nice things like this
-=================================================
+=====================================================================
Perl 5 README file for the EPOC operating system.
-==================================================
+=====================================================================
Olaf Flebbe <o.flebbe@gmx.de>
-http://www.fortunecity.de/wolkenkratzer/trumpet/84/perl5.html
-Aug 25, 1999
+http://www.linuxstart.com/~oflebbe/perl/perl5.html
+2000-01-08
+=====================================================================
Introduction
-------------
+=====================================================================
-This is a port of Perl version 5.005_60 to EPOC.
+EPOC is a OS for palmtops and mobile phones. For more informations look at:
+http://www.symbian.com/
-There are many features left out, because of restrictions of the POSIX
-support in the SDK.
+This is a port of Perl version 5.005_63 to EPOC. It runs on the Perl
+Series 5, Series 5mx. I have no reports about the Psion Revo, the
+Ericcson (??) and the Psion NetBook. I only have acess to an Series 5.
+Features are left out, because of restrictions of the POSIX support.
+=====================================================================
Installation/Usage
-------------------
+=====================================================================
-You will need ~4MB free space in order to run perl.
+You will need ~4MB free space in order to install and run perl.
-Install perl.sis on the EPOC machine (most likely a PSION Series
-5). If you do not know how to do that, you are on your own. You may
-have to use a CF Card in order to work with perl. The perl debugger
-uses more then 1.5 MB additional RAM. The heap is limited to 2 MB.
+Install perl.sis on the EPOC machine (most likely a PSION Series 5,
+5mx). If you do not know how to do that, you are on your own.
-Perl itself and its standard library are using 1.7MB disk space. I
-left out UTF support and modules which will not work with this
-version. (For details look into epoc/createpkg.pl).
+Perl itself and its standard library are using 2.5 MB disk space. I
+left out unicode support modules and modules which will not work with
+this version. (For details look into epoc/createpkg.pl). If you like
+to use them, you are free to copy them from a current perl release.
-Copy eshell.exe to the same location as perl. Start eshell.exe with a
-double click.
+Copy eshell.exe from the same page you got perl to your EPOC device.
+Start eshell.exe with a double tap.
Now you can enter: perl -de 0 in order to run the perl debugger. If
-you are leaving perl, you have to switch back manually to eshell.exe
-(With Ctrl-System or the button in the upper right corner of the
-System screen.) When perl is running, you will see a task with the
-name STDOUT in the task list.
+you are leaving perl, you get into the system screen. You have to
+switch back manually to eshell.exe When perl is running, you will see
+a task with the name STDOUT in the task list.
+
+======================================================================
+IO Redirection
+======================================================================
You can redirect the output with the UNIX bourne shell syntax (this is
built into perl rather then eshell) For instance the following command
perl test.pl >stdout_file <stdin_file 2>stderr_file
-Alternativly you can use 2>&1 in order to add the standard error output to
-stdout.
+Alternativly you can use 2>&1 in order to add the standard error
+output to stdout.
+
+======================================================================
+PATH Names
+======================================================================
Pathnames to executables in eshell.exe have to be written with
-backslashes, file arguments to perl with slashes. The default drive of
-perl is the same as the drive perl.exe is located on, the default path
-is the path perl.exe is / (???).
+backslashes '\', file arguments to perl with slashes '/'. The default
+drive of perl is the same as the drive perl.exe is located on, the
+default path seems to be '/'.
i.e. command lines look a little bit funny:
D:\perl.exe C:/test.pl >C:/output.txt
-In order to use Getopt::Long you have to autosplit this module by hand: run
+You can automatically search for file on all EPOC drives with a ? as
+the driver letter. For instance ?:\a.txt seraches for C:\a.txt,
+D:\b.txt (and Z:\a.txt).
-\perl.exe \autosplit.pl in order to create the necessary files.
+======================================================================
+Editors
+======================================================================
You may have a problem to create perl scripts. A cumbersome workaround
is to use the OPL Editor and exporting to text.
-Problems
---------
+The OPL+ Editor is quite good. (Shareware: http://www.twiddlebit.com)
+There is a port of vim around:
+ http://www.starship.freeserve.co.uk/index.html
+
+======================================================================
+Restrictions
+======================================================================
-The following known problems exist:
+The following things are left out of this perl port:
-1) no support for system, backquoting, pipes etc. One cannot exec a
- different process.
++ backquoting, pipes etc.
-2) no signals, kill, alarm. Do not try to use them. This may be
- impossible to implement on EPOC.
++ system() does not inherit ressources like: file descriptors,
+ environment etc.
-3) select is missing.
++ signal, kill, alarm. Do not try to use them. This may be
+ impossible to implement on EPOC.
-4) binmode does not exist. (No CR LF to LF translation for text files)
++ select is missing.
-5) Only a stub Config.pm
++ binmode does not exist. (No CR LF to LF translation for text files)
-6) EPOC does not handle the notion of current drive and current
- directory very well (i.e. not at all, but it tries hard to emulate
- one)
++ EPOC does not handle the notion of current drive and current
+ directory very well (i.e. not at all, but it tries hard to emulate
+ one) See PATH.
-7) sockets may hardly of any use.
++ sockets seems to work now!
-8) You need the shell eshell.exe in order to run perl.exe and supply
- it with arguments.
++ You need the shell eshell.exe in order to run perl.exe and supply
+ it with arguments.
++ Heap is limited to 4MB.
+===================================================================
Compiling Perl 5 on the EPOC cross compiling envionment.
---------------------------------------------------------
+===================================================================
-0. You will need the C++ SDK from
- http://developer.epocworld.com/. Install it on a separate
- drive.
+Sorry, this is far too short.
-1. Get the Perl sources from your nearest CPAN site.
- Unpack the sources of perl5.005_60 in the epoc development drive.
-
-2. Copy all files in the directory perl5.005_60/epoc to perl5.005_60.
+ You will need the C++ SDK from http://developer.epocworld.com/.
-3. Check the perl.mmp file: It should have the correct locations for
- project und subproject (see step 1)
+ You will need to set up the cross SDK from
+ http://www.linuxstart.com/~oflebbe
-4. Change to the EPOC development drive and run
- makmake perl marm
- nmake -f perl.marm
- makesis perl.pkg perl5.005.sis
+ You may have to adjust config.sh (cc, cppflags) for your epoc
+ install location.
-5. Beam the perl5.005.sis to the Psion5, install and enjoy!
+ You may have to adjust config.sh for your cross SDK location
-You can use epoc\createpkg.pl to generate a new perl.pkg file.
+ Get the Perl sources from your nearest CPAN site.
+ Unpack the sources.
-Wish List
----------
+ Build a native miniperl...
+ cp epoc/* .
+ for i in *.SH ; do
+ sh $i
+ done
+ make perl
+ cp miniperl.native miniperl
+ make perl
+ perl linkit perlmain.o lib/auto/DynaLoader/DynaLoader.a \
+ lib/auto/Data/Dumper.a \
+ lib/auto/File/Glob/Glob.a lib/auto/IO/IO.a \
+ lib/auto/Socket/Socket.a perl.a `cat ext.libs`
+ perl createpkg.pl
+ wine "G:/bin/makesis perl.pkg perl.sis"
-- Implement an OPX to get rid of eshell.exe.
-- Implement system(), in order to run the tests.
+====================================================================
+TODO
+====================================================================
-- Implement getprotcolbyname() and relatives.
+- Get the HTTPD::* working (Hey, It worked the first time for me!)
+- Threads ?
+- Acess to the GUI?
+====================================================================
Support Status
---------------
+====================================================================
I'm offering this port "as is". You can ask me questions, but I can't
guarantee I'll be able to answer them; I don't know much about Perl
Notes on Perl on the Hurd
-Last Updated: Sat, 6 Mar 1999 16:07:59 +0100
+Last Updated: Fri, 29 Oct 1999 22:50:30 +0200
Written by: Mark Kettenis <kettenis@gnu.org>
If you want to use Perl on the Hurd, I recommend using the Debian
* Known Problems
-The Perl testsuite may still report some errors on the Hurd. The
-`lib/anydbm.t' and `op/stat.t' tests will most certainly fail. The
-first fails because Berkeley DB 2 does not allow empty keys and the
-test tries to use them anyway. This is not really a Hurd bug. The
-same test fails on Linux with version 2.1 of the GNU C Library. The
-second failure is caused by a bug in the Hurd's filesystem servers,
-that we have not been able to fix yet. I don't think it is crucial.
+The Perl test suite may still report some errors on the Hurd. The
+`lib/anydbm' and `pragma/warnings' tests will almost certainly fail.
+Both failures are not really specific to the Hurd, as indicated by the
+test suite output.
The socket tests may fail if the network is not configured. You have
to make `/hurd/pfinet' the translator for `/servers/socket/2', giving
it the right arguments. Try `/hurd/pfinet --help' for more
information.
-Here are the statistics for Perl 5.005_03 on my system:
+Here are the statistics for Perl 5.005_62 on my system:
Failed Test Status Wstat Total Fail Failed List of failed
-------------------------------------------------------------------------------
lib/anydbm.t 12 1 8.33% 12
-op/stat.t 58 1 1.72% 4
-5 tests skipped, plus 14 subtests skipped.
-Failed 2/189 test scripts, 98.94% okay. 2/6669 subtests failed, 99.97% okay.
+pragma/warnings 333 1 0.30% 215
+8 tests and 24 subtests skipped.
+Failed 2/229 test scripts, 99.13% okay. 2/10850 subtests failed, 99.98% okay.
There are quite a few systems out there that do worse!
However, since I am running a very recent Hurd snapshot, in which a lot of
-bugs that were exposed by the Perl testsuite have been fixed, you may
-encounter more failures. Likely candidates are: `lib/io_pipe.t',
-`lib/io_sock.t', `lib/io_udp.t' and `lib/time.t'.
+bugs that were exposed by the Perl test suite have been fixed, you may
+encounter more failures. Likely candidates are: `op/stat', `lib/io_pipe',
+`lib/io_sock', `lib/io_udp' and `lib/time'.
+In any way, if you're seeing failures beyond those mentioned in this
+document, please consider upgrading to the latest Hurd before reporting
+the failure as a bug.
=head2 Application of the patches
-You need to apply the patches in F<./os2/diff.*> and
-F<./os2/POSIX.mkfifo> like this:
+You need to apply the patches in F<./os2/diff.*> like this:
- gnupatch -p0 < os2\POSIX.mkfifo
gnupatch -p0 < os2\diff.configure
You may also need to apply the patches supplied with the binary
=item F<op/fs.t>
+=over 4
+
=item 18
Checks C<atime> and C<mtime> of C<stat()> - unfortunately, HPFS
-Last Revised 01-March-1999 by Dan Sugalski <sugalskd@ous.edu>
+Last revised 27-October-1999 by Craig Berry <craig.berry@metamor.com>
+Revised 01-March-1999 by Dan Sugalski <dan@sidhe.org>
Originally by Charles Bailey <bailey@newman.upenn.edu>
* Important safety tip
The build and install procedures have changed significantly from the 5.004
releases! Make sure you read the "Building Perl" and "Installing Perl"
-sections before you build or install.
+sections of this document before you build or install.
Also note that, as of 5.005, an ANSI C compliant compiler is required to
build Perl. Vax C is *not* ANSI compliant, as it died a natural death some
To configure perl (a necessary first step), issue the command
-@CONFIGURE
+ @CONFIGURE
from the top of an unpacked perl directory. You'll be asked a series of
questions, and the answers to them (along with the capabilities of your C
The configuration script will print out, at the very end, the MMS or MMK
command you need to compile perl. Issue it (exactly as printed) to start
-the build.
+the build. If you have any symbols or logical names in your environment
+that may interfere with the build or regression testing of perl then
+configure.com will try to warn you about them. If a logical name is causing
+you trouble but is in an LNM table that you do not have write access to
+then try defining your own to a harmless equivalence string in a table
+such that it is resolved before the other (e.g. if TMP is defined in the
+SYSTEM table then try DEFINE TMP "NL:" or somesuch) otherwise simply deasign
+the dangerous logical names. The potentially troublesome logicals and
+symbols are:
+
+ TMP "LOGICAL"
+ LIB "LOGICAL"
+ T "LOGICAL"
+ FOO "LOGICAL"
+ EXT "LOGICAL"
+ TEST "SYMBOL"
Once you issue your MMS command, sit back and wait. Perl should build and
link without a problem. If it doesn't, check the Gotchas to watch out for
As a handy shortcut, the command:
-@CONFIGURE "-des"
+ @CONFIGURE "-des"
(note the quotation marks and case) will choose reasonable defaults. (It
takes Dec C over Gnu C, Dec C sockets over SOCKETSHR sockets, and either
If one or more tests fail, you can get more info on the failure by issuing
this command sequence:
-$ @[.VMS]TEST .typ "-v" [.subdir]test.T
+$ @[.VMS]TEST .typ "" "-v" [.subdir]test.T
where ".typ" is the file type of the Perl images you just built (if you
didn't do anything special, use .EXE), and "[.subdir]test.T" is the test
that failed. For example, with a normal Perl build, if the test indicated
that [.op]time failed, then you'd do this:
-$ @[.VMS]TEST .EXE "-v" [.OP]TIME.T
+$ @[.VMS]TEST .EXE "" "-v" [.OP]TIME.T
When you send in a bug report for failed tests, please include the output
from this command, which is run from the main source directory:
Execute the following command file to define PERL as a DCL command.
You'll need CMKRNL priv to install the new dcltables.exe.
-$ create perl.cld
-!
-! modify to reflect location of your perl.exe
-!
-define verb perl
- image perl_root:[000000]perl.exe
- cliflags (foreign)
-$!
-$ set command perl /table=sys$common:[syslib]dcltables.exe -
- /output=sys$common:[syslib]dcltables.exe
-$ install replace sys$common:[syslib]dcltables.exe
-$ exit
+ $ create perl.cld
+ !
+ ! modify to reflect location of your perl.exe
+ !
+ define verb perl
+ image perl_root:[000000]perl.exe
+ cliflags (foreign)
+ $!
+ $ set command perl /table=sys$common:[syslib]dcltables.exe -
+ /output=sys$common:[syslib]dcltables.exe
+ $ install replace sys$common:[syslib]dcltables.exe
+ $ exit
* Changing compile-time things
On systems that are using perl quite a bit, and particularly those with
minimal RAM, you can boost the performance of perl by INSTALLing it as
-a known image. PERLSHR.EXE is typically larger than 1500 blocks
+a known image. PERLSHR.EXE is typically larger than 2000 blocks
and that is a reasonably large amount of IO to load each time perl is
invoked.
* Dec C issues
Note to DECC users: Some early versions (pre-5.2, some pre-4. If you're Dec
-C 5.x or higher, with current patches if anym you're fine) of the DECCRTL
+C 5.x or higher, with current patches if any, you're fine) of the DECCRTL
contained a few bugs which affect Perl performance:
- Newlines are lost on I/O through pipes, causing lines to run together.
This shows up as RMS RTB errors when reading from a pipe. You can
there is the VMSPERL mailing list. It's usually a low-volume (10-12
messages a week) mailing list.
-The subscription address is VMSPERL-REQUEST@NEWMAN.UPENN.EDU. Send a mail
-message with just the words SUBSCRIBE VMSPERL in the body of the message.
-
-The VMSPERL mailing list address is VMSPERL@NEWMAN.UPENN.EDU. Any mail
-sent there gets echoed to all subscribers of the list.
-
+The subscription address is MAJORDOMO@PERL.ORG. Send a mail message with just
+the words SUBSCRIBE VMSPERL in the body of the message.
+
+The VMSPERL mailing list address is VMSPERL@PERL.ORG. Any mail sent there
+gets echoed to all subscribers of the list. There is a searchable archive of
+the list at <http://www.xray.mpe.mpg.de/mailing-lists/vmsperl/>.
+
To unsubscribe from VMSPERL send the message UNSUBSCRIBE VMSPERL to
-VMSPERL-REQUEST@NEWMAN.UPENN.EDU. Be sure to do so from the subscribed
-account that you are cancelling.
-
+MAJORDOMO@PERL.ORG. Be sure to do so from the subscribed account that
+you are cancelling.
* Acknowledgements
for the getredirection() code
Rich Salz <rsalz@bbn.com>
for readdir() and related routines
- Peter Prymmer <pvhp@forte.com> or <pvhp@lns62.lns.cornell.edu>
+ Peter Prymmer <pvhp@forte.com>
for extensive testing, as well as development work on
configuration and documentation for VMS Perl,
- Dan Sugalski <sugalskd@ous.edu>
+ Dan Sugalski <dan@sidhe.org>
for extensive contributions to recent version support,
development of VMS-specific extensions, and dissemination
of information about VMS Perl,
=head1 SYNOPSIS
These are instructions for building Perl under Windows NT (versions
-3.51 or 4.0). Currently, this port is reported to build
-under Windows95 using the 4DOS shell--the default shell that infests
-Windows95 will not work (see below). Note this caveat is only about
-B<building> perl. Once built, you should be able to B<use> it on
-either Win32 platform (modulo the problems arising from the inferior
-command shell).
+3.51 or 4.0). Currently, this port is reported to build under
+Windows95 using the 4DOS shell--the default shell that infests
+Windows95 may not work fully (but see below). Note that this caveat
+is only about B<building> perl. Once built, you should be able to
+B<use> it on either Win32 platform (modulo the problems arising from
+the inferior command shell).
=head1 DESCRIPTION
Borland C++ version 5.02 or later
Microsoft Visual C++ version 4.2 or later
- Mingw32 with EGCS versions 1.0.2, 1.1
- Mingw32 with GCC version 2.8.1
+ Mingw32 with GCC version 2.95.2 or better
-The last two of these are high quality freeware compilers. Support
-for them is still experimental.
+The last of these is a high quality freeware compiler. Support
+for it is still experimental. (Older versions of GCC are known
+not to work.)
This port currently supports MakeMaker (the set of modules that
is used to build extensions to perl). Therefore, you should be
Use the default "cmd" shell that comes with NT. Some versions of the
popular 4DOS/NT shell have incompatibilities that may cause you trouble.
If the build fails under that shell, try building again with the cmd
-shell. The Makefile also has known incompatibilites with the "command.com"
-shell that comes with Windows95, so building under Windows95 should
-be considered "unsupported". However, there have been reports of successful
-build attempts using 4DOS/NT version 6.01 under Windows95, using dmake, but
-your mileage may vary.
+shell. The nmake Makefile also has known incompatibilites with the
+"command.com" shell that comes with Windows95.
-The surest way to build it is on WindowsNT, using the cmd shell.
+However, there have been reports of successful build attempts using
+4DOS/NT version 6.01 under Windows95, using dmake, but your mileage
+may vary. There is also some basic support for building using dmake
+under command.com. Nevertheless, if building under command.com
+doesn't work, try 4DOS/NT.
+
+The surest way to build it is on Windows NT, using the cmd shell.
Make sure the path to the build directory does not contain spaces. The
build usually works in this circumstance, but some tests will fail.
A port of dmake for win32 platforms is available from:
- http://www-personal.umich.edu/~gsar/dmake-4.1-win32.zip
+ ftp://ftp.linux.activestate.com/pub/staff/gsar/dmake-4.1-win32.zip
+
+(This is a fixed version of original dmake sources obtained from
+http://www.wticorp.com/dmake/. As of version 4.1PL1, the original
+sources did not build as shipped, and had various other problems.
+A patch is included in the above fixed version.)
Fetch and install dmake somewhere on your path (follow the instructions
in the README.NOW file).
=item Microsoft Visual C++
-The NMAKE that comes with Visual C++ will suffice for building.
+The nmake that comes with Visual C++ will suffice for building.
You will need to run the VCVARS32.BAT file usually found somewhere
like C:\MSDEV4.2\BIN. This will set your build environment.
latter step is only essential if you want to use dmake as your default
make for building extensions using MakeMaker.
-=item Mingw32 with EGCS or GCC
+=item Mingw32 with GCC
-ECGS binaries can be downloaded from:
+GCC-2.95.2 binaries can be downloaded from:
ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/
-GCC-2.8.1 binaries are available from:
-
- http://agnes.dida.physik.uni-essen.de/~janjaap/mingw32/
+The GCC-2.95.2 bundle comes with Mingw32 libraries and headers.
-You only need either one of those, not both. Both bundles come with
-Mingw32 libraries and headers. While both of them work to build perl,
-the EGCS binaries are currently favored by the maintainers, since they
-come with more up-to-date Mingw32 libraries.
-
-Make sure you install the binaries as indicated in the web sites
-above. You will need to set up a few environment variables (usually
-run from a batch file).
+Make sure you install the binaries as indicated in the README for
+the GCC bundle. You may need to set up a few environment variables
+(usually run from a batch file).
You also need dmake. See L</"Borland C++"> above on how to get it.
Make sure you are in the "win32" subdirectory under the perl toplevel.
This directory contains a "Makefile" that will work with
-versions of NMAKE that come with Visual C++, and a dmake "makefile.mk"
+versions of nmake that come with Visual C++, and a dmake "makefile.mk"
that will work for all supported compilers. The defaults in the dmake
makefile are setup to build using the Borland compiler.
perl Makefile.PL CAPI=TRUE
PERL_OBJECT requires VC++ 5.0 (Service Pack 3 recommended) or later. It
-is not yet supported under GCC or EGCS. WARNING: Binaries built with
+is not yet supported under GCC. WARNING: Binaries built with
PERL_OBJECT enabled are B<not> compatible with binaries built without.
Perl installs PERL_OBJECT binaries under a distinct architecture name,
so they B<can> coexist, though.
from where Borland chose to install it, into the Windows system directory
(usually somewhere like C:\WINNT\SYSTEM32), and rerun the test.
-The Visual C runtime apparently has a bug that causes posix.t to fail
-test#2. This usually happens only if you extracted the files in text
-mode. Enable the USE_PERLCRT option in the Makefile to fix this bug.
-
Please report any other failures as described under L<BUGS AND CAVEATS>.
=head2 Installation
C<raise()>, i.e. it doesn't send a signal to the identified process
like it does on Unix platforms. Instead it immediately calls
C<TerminateProcess(process,signal)>. Thus the signal argument is
-used to set the exit-status of the terminated process. This behavior
-may change in future.
+used to set the exit-status of the terminated process. In particular,
+C<kill(0,$pid)> will kill the process identified by C<$pid> (unlike
+on Unix). This behavior may change in future.
=item *
Gary Ng E<lt>71564.1743@CompuServe.COME<gt>
-Gurusamy Sarathy E<lt>gsar@umich.eduE<gt>
+Gurusamy Sarathy E<lt>gsar@activestate.comE<gt>
Nick Ing-Simmons E<lt>nick@ni-s.u-net.comE<gt>
This port was originally contributed by Gary Ng around 5.003_24,
and borrowed from the Hip Communications port that was available
-at the time.
-
-Nick Ing-Simmons and Gurusamy Sarathy have made numerous and
-sundry hacks since then.
+at the time. Various people have made numerous and sundry hacks
+since then.
Borland support was added in 5.004_01 (Gurusamy Sarathy).
Support for PERL_OBJECT was added in 5.005 (ActiveState Tool Corp).
-Last updated: 18 January 1999
+Support for fork() emulation was added in 5.6 (ActiveState Tool Corp).
-=cut
+Win9x support was added in 5.6 (Benjamin Stuhl).
+Last updated: 28 December 1999
+
+=cut
#define dXSTARG SV * targ = ((PL_op->op_private & OPpENTERSUB_HASTARG) \
? PAD_SV(PL_op->op_targ) : sv_newmortal())
+/* Should be used before final PUSHi etc. if not in PPCODE section. */
+#define XSprePUSH (sp = PL_stack_base + ax - 1)
+
#define XSANY CvXSUBANY(cv)
#define dXSI32 I32 ix = XSANY.any_i32
# define aTHX_ aTHX,
#endif
-#if defined(PERL_CAPI)
+#if (defined(PERL_CAPI) || defined(PERL_IMPLICIT_SYS)) && !defined(PERL_CORE)
# ifndef NO_XSLOCKS
# undef closedir
# undef opendir
# define fstat PerlLIO_fstat
# define ioctl PerlLIO_ioctl
# define isatty PerlLIO_isatty
+# define link PerlLIO_link
# define lseek PerlLIO_lseek
# define lstat PerlLIO_lstat
# define mktemp PerlLIO_mktemp
# define read PerlLIO_read
# define rename PerlLIO_rename
# define setmode PerlLIO_setmode
-# define stat PerlLIO_stat
+# define stat(buf,sb) PerlLIO_stat(buf,sb)
# define tmpnam PerlLIO_tmpnam
# define umask PerlLIO_umask
# define unlink PerlLIO_unlink
# define setjmp PerlProc_setjmp
# define longjmp PerlProc_longjmp
# define signal PerlProc_signal
+# define getpid PerlProc_getpid
# define htonl PerlSock_htonl
# define htons PerlSock_htons
# define ntohl PerlSock_ntohl
# endif /* NO_XSLOCKS */
#endif /* PERL_CAPI */
-#endif _INC_PERL_XSUB_H /* include guard */
+#endif /* _INC_PERL_XSUB_H */ /* include guard */
(void)av_store(av,fill,&PL_sv_undef);
}
+SV *
+Perl_av_delete(pTHX_ AV *av, I32 key, I32 flags)
+{
+ SV *sv;
+
+ if (!av)
+ return Nullsv;
+ if (SvREADONLY(av))
+ Perl_croak(aTHX_ PL_no_modify);
+ if (key < 0) {
+ key += AvFILL(av) + 1;
+ if (key < 0)
+ return Nullsv;
+ }
+ if (SvRMAGICAL(av)) {
+ SV **svp;
+ if ((mg_find((SV*)av,'P') || mg_find((SV*)av,'D'))
+ && (svp = av_fetch(av, key, TRUE)))
+ {
+ sv = *svp;
+ mg_clear(sv);
+ if (mg_find(sv, 'p')) {
+ sv_unmagic(sv, 'p'); /* No longer an element */
+ return sv;
+ }
+ return Nullsv; /* element cannot be deleted */
+ }
+ }
+ if (key > AvFILLp(av))
+ return Nullsv;
+ else {
+ sv = AvARRAY(av)[key];
+ if (key == AvFILLp(av)) {
+ do {
+ AvFILLp(av)--;
+ } while (--key >= 0 && AvARRAY(av)[key] == &PL_sv_undef);
+ }
+ else
+ AvARRAY(av)[key] = &PL_sv_undef;
+ if (SvSMAGICAL(av))
+ mg_set((SV*)av);
+ }
+ if (flags & G_DISCARD) {
+ SvREFCNT_dec(sv);
+ sv = Nullsv;
+ }
+ return sv;
+}
+
+/*
+ * This relies on the fact that uninitialized array elements
+ * are set to &PL_sv_undef.
+ */
+
+bool
+Perl_av_exists(pTHX_ AV *av, I32 key)
+{
+ if (!av)
+ return FALSE;
+ if (key < 0) {
+ key += AvFILL(av) + 1;
+ if (key < 0)
+ return FALSE;
+ }
+ if (SvRMAGICAL(av)) {
+ if (mg_find((SV*)av,'P') || mg_find((SV*)av,'D')) {
+ SV *sv = sv_newmortal();
+ mg_copy((SV*)av, sv, 0, key);
+ magic_existspack(sv, mg_find(sv, 'p'));
+ return SvTRUE(sv);
+ }
+ }
+ if (key <= AvFILLp(av) && AvARRAY(av)[key] != &PL_sv_undef
+ && AvARRAY(av)[key])
+ {
+ return TRUE;
+ }
+ else
+ return FALSE;
+}
/* AVHV: Support for treating arrays as if they were hashes. The
* first element of the array should be a hash reference that maps
SV **indsvp;
HV *keys = avhv_keys(av);
HE *he;
-
+ STRLEN n_a;
+
he = hv_fetch_ent(keys, keysv, FALSE, hash);
if (!he)
- Perl_croak(aTHX_ "No such array field");
+ Perl_croak(aTHX_ "No such pseudo-hash field \"%s\"", SvPV(keysv,n_a));
return av_fetch(av, avhv_index_sv(HeVAL(he)), lval);
}
+SV *
+Perl_avhv_delete_ent(pTHX_ AV *av, SV *keysv, I32 flags, U32 hash)
+{
+ HV *keys = avhv_keys(av);
+ HE *he;
+
+ he = hv_fetch_ent(keys, keysv, FALSE, hash);
+ if (!he || !SvOK(HeVAL(he)))
+ return Nullsv;
+
+ return av_delete(av, avhv_index_sv(HeVAL(he)), flags);
+}
+
+/* Check for the existence of an element named by a given key.
+ *
+ */
bool
Perl_avhv_exists_ent(pTHX_ AV *av, SV *keysv, U32 hash)
{
HV *keys = avhv_keys(av);
- return hv_exists_ent(keys, keysv, hash);
+ HE *he;
+
+ he = hv_fetch_ent(keys, keysv, FALSE, hash);
+ if (!he || !SvOK(HeVAL(he)))
+ return FALSE;
+
+ return av_exists(av, avhv_index_sv(HeVAL(he)));
}
HE *
struct xpvav {
char* xav_array; /* pointer to first array element */
SSize_t xav_fill; /* Index of last element present */
- SSize_t xav_max; /* Number of elements for which array has space */
+ SSize_t xav_max; /* max index for which array has space */
IV xof_off; /* ptr is incremented by offset */
NV xnv_nv; /* numeric value, if any */
MAGIC* xmg_magic; /* magic for scalar array */
U8 => [qw(char)],
);
-my @optype= qw(OP UNOP BINOP LOGOP LISTOP PMOP SVOP GVOP PVOP LOOP COP);
+my @optype= qw(OP UNOP BINOP LOGOP LISTOP PMOP SVOP PADOP PVOP LOOP COP);
# Nullsv *must* come first in the following so that the condition
# ($$sv == 0) can continue to be used to test (sv == Nullsv).
xcv_start CvSTART(bytecode_sv) opindex
xcv_root CvROOT(bytecode_sv) opindex
xcv_gv *(SV**)&CvGV(bytecode_sv) svindex
-xcv_filegv *(SV**)&CvFILEGV(bytecode_sv) svindex
+xcv_file CvFILE(bytecode_sv) pvcontents
xcv_depth CvDEPTH(bytecode_sv) long
xcv_padlist *(SV**)&CvPADLIST(bytecode_sv) svindex
xcv_outside *(SV**)&CvOUTSIDE(bytecode_sv) svindex
gp_av *(SV**)&GvAV(bytecode_sv) svindex
gp_hv *(SV**)&GvHV(bytecode_sv) svindex
gp_cv *(SV**)&GvCV(bytecode_sv) svindex
-gp_filegv *(SV**)&GvFILEGV(bytecode_sv) svindex
+gp_file GvFILE(bytecode_sv) pvcontents
gp_io *(SV**)&GvIOp(bytecode_sv) svindex
gp_form *(SV**)&GvFORM(bytecode_sv) svindex
gp_cvgen GvCVGEN(bytecode_sv) U32
op_pmflags cPMOP->op_pmflags U16
op_pmpermflags cPMOP->op_pmpermflags U16
op_sv cSVOP->op_sv svindex
-op_gv *(SV**)&cGVOP->op_gv svindex
+op_padix cPADOP->op_padix PADOFFSET
op_pv cPVOP->op_pv pvcontents
op_pv_tr cPVOP->op_pv op_tr_array
op_redoop cLOOP->op_redoop opindex
op_nextop cLOOP->op_nextop opindex
op_lastop cLOOP->op_lastop opindex
cop_label cCOP->cop_label pvcontents
-cop_stash *(SV**)&cCOP->cop_stash svindex
-cop_filegv *(SV**)&cCOP->cop_filegv svindex
+cop_stashpv cCOP pvcontents x
+cop_file cCOP pvcontents x
cop_seq cCOP->cop_seq U32
cop_arybase cCOP->cop_arybase I32
-cop_line cCOP->cop_line line_t
+cop_line cCOP line_t x
cop_warnings cCOP->cop_warnings svindex
main_start PL_main_start opindex
main_root PL_main_root opindex
*/
#$d_mktime HAS_MKTIME /**/
-/* HAS_MSYNC:
- * This symbol, if defined, indicates that the msync system call is
- * available to synchronize a mapped file.
- */
-#$d_msync HAS_MSYNC /**/
-
-/* HAS_MUNMAP:
- * This symbol, if defined, indicates that the munmap system call is
- * available to unmap a region, usually mapped by mmap().
- */
-#$d_munmap HAS_MUNMAP /**/
-
/* HAS_NICE:
* This symbol, if defined, indicates that the nice routine is
* available.
*/
#define STDCHAR $stdchar /**/
-/* HAS_ACCESSX:
- * This symbol, if defined, indicates that the accessx routine is
- * available to do extended access checks.
- */
-#$d_accessx HAS_ACCESSX /**/
-
-/* HAS_EACCESS:
- * This symbol, if defined, indicates that the eaccess routine is
- * available to do extended access checks.
- */
-#$d_eaccess HAS_EACCESS /**/
-
-/* I_SYS_ACCESS:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/access.h>.
- */
-#$i_sysaccess I_SYS_ACCESS /**/
-
-/* I_SYS_SECURITY:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/security.h>.
- */
-#$i_syssecrt I_SYS_SECURITY /**/
-
/* CROSSCOMPILE:
* This symbol, if defined, signifies that we our
* build process is a cross-compilation.
*/
#$multiarch MULTIARCH /**/
+/* HAS_QUAD:
+ * This symbol, if defined, tells that there's a 64-bit integer type,
+ * Quad_t, and its unsigned counterpar, Uquad_t. QUADKIND will be one
+ * of QUAD_IS_INT, QUAD_IS_LONG, QUAD_IS_LONG_LONG, or QUAD_IS_INT64_T.
+ */
+#$d_quad HAS_QUAD /**/
+#ifdef HAS_QUAD
+# define Quad_t $quadtype /**/
+# define Uquad_t $uquadtype /**/
+# define QUADKIND $quadkind /**/
+# define QUAD_IS_INT 1
+# define QUAD_IS_LONG 2
+# define QUAD_IS_LONG_LONG 3
+# define QUAD_IS_INT64_T 4
+#endif
+
+/* HAS_ACCESSX:
+ * This symbol, if defined, indicates that the accessx routine is
+ * available to do extended access checks.
+ */
+#$d_accessx HAS_ACCESSX /**/
+
+/* HAS_EACCESS:
+ * This symbol, if defined, indicates that the eaccess routine is
+ * available to do extended access checks.
+ */
+#$d_eaccess HAS_EACCESS /**/
+
+/* I_SYS_ACCESS:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <sys/access.h>.
+ */
+#$i_sysaccess I_SYS_ACCESS /**/
+
+/* I_SYS_SECURITY:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <sys/security.h>.
+ */
+#$i_syssecrt I_SYS_SECURITY /**/
+
+/* OSNAME:
+ * This symbol contains the name of the operating system, as determined
+ * by Configure. You shouldn't rely on it too much; the specific
+ * feature tests from Configure are generally more reliable.
+ */
+#define OSNAME "$osname" /**/
+
/* MEM_ALIGNBYTES:
* This symbol contains the number of bytes required to align a
* double. Usual values are 2, 4 and 8. The default is eight,
#define MEM_ALIGNBYTES $alignbytes
#endif
+/* ARCHLIB:
+ * This variable, if defined, holds the name of the directory in
+ * which the user wants to put architecture-dependent public
+ * library files for $package. It is most often a local directory
+ * such as /usr/local/lib. Programs using this variable must be
+ * prepared to deal with filename expansion. If ARCHLIB is the
+ * same as PRIVLIB, it is not defined, since presumably the
+ * program already searches PRIVLIB.
+ */
+/* ARCHLIB_EXP:
+ * This symbol contains the ~name expanded version of ARCHLIB, to be used
+ * in programs that are not prepared to deal with ~ expansion at run-time.
+ */
+#$d_archlib ARCHLIB "$archlib" /**/
+#$d_archlib ARCHLIB_EXP "$archlibexp" /**/
+
+/* ARCHNAME:
+ * This symbol holds a string representing the architecture name.
+ * It may be used to construct an architecture-dependant pathname
+ * where library files may be held under a private library, for
+ * instance.
+ */
+#define ARCHNAME "$archname" /**/
+
+/* HAS_ATOLF:
+ * This symbol, if defined, indicates that the atolf routine is
+ * available to convert strings into long doubles.
+ */
+#$d_atolf HAS_ATOLF /**/
+
+/* HAS_ATOLL:
+ * This symbol, if defined, indicates that the atoll routine is
+ * available to convert strings into long longs.
+ */
+#$d_atoll HAS_ATOLL /**/
+
+/* BIN:
+ * This symbol holds the path of the bin directory where the package will
+ * be installed. Program must be prepared to deal with ~name substitution.
+ */
+/* BIN_EXP:
+ * This symbol is the filename expanded version of the BIN symbol, for
+ * programs that do not want to deal with that at run-time.
+ */
+#define BIN "$bin" /**/
+#define BIN_EXP "$binexp" /**/
+
+/* PERL_BINCOMPAT_5005:
+ * This symbol, if defined, indicates that Perl 5.006 should be
+ * binary-compatible with Perl 5.005. This is impossible for builds
+ * that use features like threads and multiplicity it is always $undef
+ * for those versions.
+ */
+#$d_bincompat5005 PERL_BINCOMPAT_5005 /**/
+
/* BYTEORDER:
* This symbol holds the hexadecimal constant defined in byteorder,
* i.e. 0x1234 or 0x4321, etc...
#define BYTEORDER 0x$byteorder /* large digits for MSB */
#endif /* NeXT */
+/* CAT2:
+ * This macro catenates 2 tokens together.
+ */
+/* STRINGIFY:
+ * This macro surrounds its token with double quotes.
+ */
+#if $cpp_stuff == 1
+#define CAT2(a,b)a/**/b
+#define STRINGIFY(a)"a"
+ /* If you can get stringification with catify, tell me how! */
+#endif
+#if $cpp_stuff == 42
+#define CAT2(a,b)a ## b
+#define StGiFy(a)# a
+#define STRINGIFY(a)StGiFy(a)
+#endif
+#if $cpp_stuff != 1 && $cpp_stuff != 42
+#include "Bletch: How does this C preprocessor catenate tokens?"
+#endif
+
+/* CPPSTDIN:
+ * This symbol contains the first part of the string which will invoke
+ * the C preprocessor on the standard input and produce to standard
+ * output. Typical value of "cc -E" or "/lib/cpp", but it can also
+ * call a wrapper. See CPPRUN.
+ */
+/* CPPMINUS:
+ * This symbol contains the second part of the string which will invoke
+ * the C preprocessor on the standard input and produce to standard
+ * output. This symbol will have the value "-" if CPPSTDIN needs a minus
+ * to specify standard input, otherwise the value is "".
+ */
+/* CPPRUN:
+ * This symbol contains the string which will invoke a C preprocessor on
+ * the standard input and produce to standard output. It needs to end
+ * with CPPLAST, after all other preprocessor flags have been specified.
+ * The main difference with CPPSTDIN is that this program will never be a
+ * pointer to a shell wrapper, i.e. it will be empty if no preprocessor is
+ * available directly to the user. Note that it may well be different from
+ * the preprocessor used to compile the C program.
+ */
+#define CPPSTDIN "$cppstdin"
+#define CPPMINUS "$cppminus"
+#define CPPRUN "$cpprun"
+
+/* HAS_ACCESS:
+ * This manifest constant lets the C program know that the access()
+ * system call is available to check for accessibility using real UID/GID.
+ * (always present on UNIX.)
+ */
+#$d_access HAS_ACCESS /**/
+
/* CASTI32:
* This symbol is defined if the C compiler can cast negative
* or large floating point numbers to 32-bit ints.
*/
#$d_void_closedir VOID_CLOSEDIR /**/
+/* HAS_CSH:
+ * This symbol, if defined, indicates that the C-shell exists.
+ */
+/* CSH:
+ * This symbol, if defined, contains the full pathname of csh.
+ */
+#$d_csh HAS_CSH /**/
+#ifdef HAS_CSH
+#define CSH "$full_csh" /**/
+#endif
+
+/* DLSYM_NEEDS_UNDERSCORE:
+ * This symbol, if defined, indicates that we need to prepend an
+ * underscore to the symbol name before calling dlsym(). This only
+ * makes sense if you *have* dlsym, which we will presume is the
+ * case if you're using dl_dlopen.xs.
+ */
+#$d_dlsymun DLSYM_NEEDS_UNDERSCORE /**/
+
+/* HAS_DRAND48_PROTO:
+ * This symbol, if defined, indicates that the system provides
+ * a prototype for the drand48() function. Otherwise, it is up
+ * to the program to supply one. A good guess is
+ * extern double drand48 _((void));
+ */
+#$d_drand48proto HAS_DRAND48_PROTO /**/
+
+/* HAS_ENDGRENT:
+ * This symbol, if defined, indicates that the getgrent routine is
+ * available for finalizing sequential access of the group database.
+ */
+#$d_endgrent HAS_ENDGRENT /**/
+
+/* HAS_ENDHOSTENT:
+ * This symbol, if defined, indicates that the endhostent() routine is
+ * available to close whatever was being used for host queries.
+ */
+#$d_endhent HAS_ENDHOSTENT /**/
+
+/* HAS_ENDNETENT:
+ * This symbol, if defined, indicates that the endnetent() routine is
+ * available to close whatever was being used for network queries.
+ */
+#$d_endnent HAS_ENDNETENT /**/
+
+/* HAS_ENDPROTOENT:
+ * This symbol, if defined, indicates that the endprotoent() routine is
+ * available to close whatever was being used for protocol queries.
+ */
+#$d_endpent HAS_ENDPROTOENT /**/
+
+/* HAS_ENDPWENT:
+ * This symbol, if defined, indicates that the getgrent routine is
+ * available for finalizing sequential access of the passwd database.
+ */
+#$d_endpwent HAS_ENDPWENT /**/
+
+/* HAS_ENDSERVENT:
+ * This symbol, if defined, indicates that the endservent() routine is
+ * available to close whatever was being used for service queries.
+ */
+#$d_endsent HAS_ENDSERVENT /**/
+
+/* HAS_ENDSPENT:
+ * This symbol, if defined, indicates that the endspent system call is
+ * available to finalize the scan of SysV shadow password entries.
+ */
+#$d_endspent HAS_ENDSPENT /**/
+
/* HAS_FD_SET:
* This symbol, when defined, indicates presence of the fd_set typedef
* in <sys/types.h>
*/
#$d_fd_set HAS_FD_SET /**/
+/* HAS_STRUCT_FS_DATA:
+ * This symbol, if defined, indicates that the struct fs_data
+ * to do statfs() is supported.
+ */
+#$d_fs_data_s HAS_STRUCT_FS_DATA /**/
+
+/* HAS_FSEEKO:
+ * This symbol, if defined, indicates that the fseeko routine is
+ * available to fseek beyond 32 bits (useful for ILP32 hosts).
+ */
+#$d_fseeko HAS_FSEEKO /**/
+
+/* HAS_FSTATFS:
+ * This symbol, if defined, indicates that the fstatfs routine is
+ * available to stat filesystems by file descriptors.
+ */
+#$d_fstatfs HAS_FSTATFS /**/
+/* HAS_FTELLO:
+ * This symbol, if defined, indicates that the ftello routine is
+ * available to ftell beyond 32 bits (useful for ILP32 hosts).
+ */
+#$d_ftello HAS_FTELLO /**/
+
/* Gconvert:
* This preprocessor macro is defined to convert a floating point
* number to a string without a trailing decimal point. This
*/
#define Gconvert(x,n,t,b) $d_Gconvert
-/* HAS_GNULIBC:
- * This symbol, if defined, indicates to the C program that
- * the GNU C library is being used.
- */
-#$d_gnulibc HAS_GNULIBC /**/
-/* HAS_ISASCII:
- * This manifest constant lets the C program know that isascii
- * is available.
- */
-#$d_isascii HAS_ISASCII /**/
-
-/* HAS_LCHOWN:
- * This symbol, if defined, indicates that the lchown routine is
- * available to operate on a symbolic link (instead of following the
- * link).
- */
-#$d_lchown HAS_LCHOWN /**/
-
-/* HAS_OPEN3:
- * This manifest constant lets the C program know that the three
- * argument form of open(2) is available.
- */
-#$d_open3 HAS_OPEN3 /**/
-
-/* HAS_SAFE_BCOPY:
- * This symbol, if defined, indicates that the bcopy routine is available
- * to copy potentially overlapping memory blocks. Otherwise you should
- * probably use memmove() or memcpy(). If neither is defined, roll your
- * own version.
- */
-#$d_safebcpy HAS_SAFE_BCOPY /**/
-
-/* HAS_SAFE_MEMCPY:
- * This symbol, if defined, indicates that the memcpy routine is available
- * to copy potentially overlapping memory blocks. Otherwise you should
- * probably use memmove() or memcpy(). If neither is defined, roll your
- * own version.
- */
-#$d_safemcpy HAS_SAFE_MEMCPY /**/
-
-/* HAS_SANE_MEMCMP:
- * This symbol, if defined, indicates that the memcmp routine is available
- * and can be used to compare relative magnitudes of chars with their high
- * bits set. If it is not defined, roll your own version.
- */
-#$d_sanemcmp HAS_SANE_MEMCMP /**/
-
-/* HAS_SIGACTION:
- * This symbol, if defined, indicates that Vr4's sigaction() routine
- * is available.
- */
-#$d_sigaction HAS_SIGACTION /**/
-
-/* HAS_SIGSETJMP:
- * This variable indicates to the C program that the sigsetjmp()
- * routine is available to save the calling process's registers
- * and stack environment for later use by siglongjmp(), and
- * to optionally save the process's signal mask. See
- * Sigjmp_buf, Sigsetjmp, and Siglongjmp.
- */
-/* Sigjmp_buf:
- * This is the buffer type to be used with Sigsetjmp and Siglongjmp.
- */
-/* Sigsetjmp:
- * This macro is used in the same way as sigsetjmp(), but will invoke
- * traditional setjmp() if sigsetjmp isn't available.
- * See HAS_SIGSETJMP.
- */
-/* Siglongjmp:
- * This macro is used in the same way as siglongjmp(), but will invoke
- * traditional longjmp() if siglongjmp isn't available.
- * See HAS_SIGSETJMP.
- */
-#$d_sigsetjmp HAS_SIGSETJMP /**/
-#ifdef HAS_SIGSETJMP
-#define Sigjmp_buf sigjmp_buf
-#define Sigsetjmp(buf,save_mask) sigsetjmp((buf),(save_mask))
-#define Siglongjmp(buf,retval) siglongjmp((buf),(retval))
-#else
-#define Sigjmp_buf jmp_buf
-#define Sigsetjmp(buf,save_mask) setjmp((buf))
-#define Siglongjmp(buf,retval) longjmp((buf),(retval))
-#endif
-
-/* USE_STDIO_PTR:
- * This symbol is defined if the _ptr and _cnt fields (or similar)
- * of the stdio FILE structure can be used to access the stdio buffer
- * for a file handle. If this is defined, then the FILE_ptr(fp)
- * and FILE_cnt(fp) macros will also be defined and should be used
- * to access these fields.
- */
-/* FILE_ptr:
- * This macro is used to access the _ptr field (or equivalent) of the
- * FILE structure pointed to by its argument. This macro will always be
- * defined if USE_STDIO_PTR is defined.
- */
-/* STDIO_PTR_LVALUE:
- * This symbol is defined if the FILE_ptr macro can be used as an
- * lvalue.
- */
-/* FILE_cnt:
- * This macro is used to access the _cnt field (or equivalent) of the
- * FILE structure pointed to by its argument. This macro will always be
- * defined if USE_STDIO_PTR is defined.
- */
-/* STDIO_CNT_LVALUE:
- * This symbol is defined if the FILE_cnt macro can be used as an
- * lvalue.
- */
-#$d_stdstdio USE_STDIO_PTR /**/
-#ifdef USE_STDIO_PTR
-#define FILE_ptr(fp) $stdio_ptr
-#$d_stdio_ptr_lval STDIO_PTR_LVALUE /**/
-#define FILE_cnt(fp) $stdio_cnt
-#$d_stdio_cnt_lval STDIO_CNT_LVALUE /**/
-#endif
-
-/* USE_STDIO_BASE:
- * This symbol is defined if the _base field (or similar) of the
- * stdio FILE structure can be used to access the stdio buffer for
- * a file handle. If this is defined, then the FILE_base(fp) macro
- * will also be defined and should be used to access this field.
- * Also, the FILE_bufsiz(fp) macro will be defined and should be used
- * to determine the number of bytes in the buffer. USE_STDIO_BASE
- * will never be defined unless USE_STDIO_PTR is.
- */
-/* FILE_base:
- * This macro is used to access the _base field (or equivalent) of the
- * FILE structure pointed to by its argument. This macro will always be
- * defined if USE_STDIO_BASE is defined.
- */
-/* FILE_bufsiz:
- * This macro is used to determine the number of bytes in the I/O
- * buffer pointed to by _base field (or equivalent) of the FILE
- * structure pointed to its argument. This macro will always be defined
- * if USE_STDIO_BASE is defined.
- */
-#$d_stdiobase USE_STDIO_BASE /**/
-#ifdef USE_STDIO_BASE
-#define FILE_base(fp) $stdio_base
-#define FILE_bufsiz(fp) $stdio_bufsiz
-#endif
-
-/* HAS_VPRINTF:
- * This symbol, if defined, indicates that the vprintf routine is available
- * to printf with a pointer to an argument list. If unavailable, you
- * may need to write your own, probably in terms of _doprnt().
- */
-/* USE_CHAR_VSPRINTF:
- * This symbol is defined if this system has vsprintf() returning type
- * (char*). The trend seems to be to declare it as "int vsprintf()". It
- * is up to the package author to declare vsprintf correctly based on the
- * symbol.
- */
-#$d_vprintf HAS_VPRINTF /**/
-#$d_charvspr USE_CHAR_VSPRINTF /**/
-
-/* DOUBLESIZE:
- * This symbol contains the size of a double, so that the C preprocessor
- * can make decisions based on it.
- */
-#define DOUBLESIZE $doublesize /**/
-
-/* I_TIME:
- * This symbol, if defined, indicates to the C program that it should
- * include <time.h>.
- */
-/* I_SYS_TIME:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/time.h>.
- */
-/* I_SYS_TIME_KERNEL:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/time.h> with KERNEL defined.
- */
-#$i_time I_TIME /**/
-#$i_systime I_SYS_TIME /**/
-#$i_systimek I_SYS_TIME_KERNEL /**/
-
-/* VAL_O_NONBLOCK:
- * This symbol is to be used during open() or fcntl(F_SETFL) to turn on
- * non-blocking I/O for the file descriptor. Note that there is no way
- * back, i.e. you cannot turn it blocking again this way. If you wish to
- * alternatively switch between blocking and non-blocking, use the
- * ioctl(FIOSNBIO) call instead, but that is not supported by all devices.
- */
-/* VAL_EAGAIN:
- * This symbol holds the errno error code set by read() when no data was
- * present on the non-blocking file descriptor.
- */
-/* RD_NODATA:
- * This symbol holds the return code from read() when no data is present
- * on the non-blocking file descriptor. Be careful! If EOF_NONBLOCK is
- * not defined, then you can't distinguish between no data and EOF by
- * issuing a read(). You'll have to find another way to tell for sure!
- */
-/* EOF_NONBLOCK:
- * This symbol, if defined, indicates to the C program that a read() on
- * a non-blocking file descriptor will return 0 on EOF, and not the value
- * held in RD_NODATA (-1 usually, in that case!).
- */
-#define VAL_O_NONBLOCK $o_nonblock
-#define VAL_EAGAIN $eagain
-#define RD_NODATA $rd_nodata
-#$d_eofnblk EOF_NONBLOCK
-
-/* PTRSIZE:
- * This symbol contains the size of a pointer, so that the C preprocessor
- * can make decisions based on it. It will be sizeof(void *) if
- * the compiler supports (void *); otherwise it will be
- * sizeof(char *).
- */
-#define PTRSIZE $ptrsize /**/
-
-/* Drand01:
- * This macro is to be used to generate uniformly distributed
- * random numbers over the range [0., 1.[. You may have to supply
- * an 'extern double drand48();' in your program since SunOS 4.1.3
- * doesn't provide you with anything relevant in it's headers.
- * See HAS_DRAND48_PROTO.
- */
-/* Rand_seed_t:
- * This symbol defines the type of the argument of the
- * random seed function.
- */
-/* seedDrand01:
- * This symbol defines the macro to be used in seeding the
- * random number generator (see Drand01).
- */
-/* RANDBITS:
- * This symbol indicates how many bits are produced by the
- * function used to generate normalized random numbers.
- * Values include 15, 16, 31, and 48.
- */
-#define Drand01() $drand01 /**/
-#define Rand_seed_t $randseedtype /**/
-#define seedDrand01(x) $seedfunc((Rand_seed_t)x) /**/
-#define RANDBITS $randbits /**/
-
-/* SSize_t:
- * This symbol holds the type used by functions that return
- * a count of bytes or an error condition. It must be a signed type.
- * It is usually ssize_t, but may be long or int, etc.
- * It may be necessary to include <sys/types.h> or <unistd.h>
- * to get any typedef'ed information.
- * We will pick a type such that sizeof(SSize_t) == sizeof(Size_t).
- */
-#define SSize_t $ssizetype /* signed count of bytes */
-
-/* EBCDIC:
- * This symbol, if defined, indicates that this system uses
- * EBCDIC encoding.
- */
-#$ebcdic EBCDIC /**/
-
-/* ARCHLIB:
- * This variable, if defined, holds the name of the directory in
- * which the user wants to put architecture-dependent public
- * library files for $package. It is most often a local directory
- * such as /usr/local/lib. Programs using this variable must be
- * prepared to deal with filename expansion. If ARCHLIB is the
- * same as PRIVLIB, it is not defined, since presumably the
- * program already searches PRIVLIB.
- */
-/* ARCHLIB_EXP:
- * This symbol contains the ~name expanded version of ARCHLIB, to be used
- * in programs that are not prepared to deal with ~ expansion at run-time.
- */
-#$d_archlib ARCHLIB "$archlib" /**/
-#$d_archlib ARCHLIB_EXP "$archlibexp" /**/
-
-/* BIN:
- * This symbol holds the path of the bin directory where the package will
- * be installed. Program must be prepared to deal with ~name substitution.
- */
-/* BIN_EXP:
- * This symbol is the filename expanded version of the BIN symbol, for
- * programs that do not want to deal with that at run-time.
- */
-#define BIN "$bin" /**/
-#define BIN_EXP "$binexp" /**/
-
-/* INSTALL_USR_BIN_PERL:
- * This symbol, if defined, indicates that Perl is to be installed
- * also as /usr/bin/perl.
- */
-#$installusrbinperl INSTALL_USR_BIN_PERL /**/
-
-/* PRIVLIB:
- * This symbol contains the name of the private library for this package.
- * The library is private in the sense that it needn't be in anyone's
- * execution path, but it should be accessible by the world. The program
- * should be prepared to do ~ expansion.
- */
-/* PRIVLIB_EXP:
- * This symbol contains the ~name expanded version of PRIVLIB, to be used
- * in programs that are not prepared to deal with ~ expansion at run-time.
- */
-#define PRIVLIB "$privlib" /**/
-#define PRIVLIB_EXP "$privlibexp" /**/
-
-/* SITEARCH:
- * This symbol contains the name of the private library for this package.
- * The library is private in the sense that it needn't be in anyone's
- * execution path, but it should be accessible by the world. The program
- * should be prepared to do ~ expansion.
- * The standard distribution will put nothing in this directory.
- * Individual sites may place their own extensions and modules in
- * this directory.
- */
-/* SITEARCH_EXP:
- * This symbol contains the ~name expanded version of SITEARCH, to be used
- * in programs that are not prepared to deal with ~ expansion at run-time.
- */
-#define SITEARCH "$sitearch" /**/
-#define SITEARCH_EXP "$sitearchexp" /**/
-
-/* SITELIB:
- * This symbol contains the name of the private library for this package.
- * The library is private in the sense that it needn't be in anyone's
- * execution path, but it should be accessible by the world. The program
- * should be prepared to do ~ expansion.
- * The standard distribution will put nothing in this directory.
- * Individual sites may place their own extensions and modules in
- * this directory.
- */
-/* SITELIB_EXP:
- * This symbol contains the ~name expanded version of SITELIB, to be used
- * in programs that are not prepared to deal with ~ expansion at run-time.
- */
-#define SITELIB "$sitelib" /**/
-#define SITELIB_EXP "$sitelibexp" /**/
-
-/* PERL_VENDORLIB_EXP:
- * This symbol contains the ~name expanded version of VENDORLIB, to be used
- * in programs that are not prepared to deal with ~ expansion at run-time.
- */
-#$d_vendorlib PERL_VENDORLIB_EXP "$vendorlibexp" /**/
-
-/* OSNAME:
- * This symbol contains the name of the operating system, as determined
- * by Configure. You shouldn't rely on it too much; the specific
- * feature tests from Configure are generally more reliable.
- */
-#define OSNAME "$osname" /**/
-
-/* CAT2:
- * This macro catenates 2 tokens together.
- */
-/* STRINGIFY:
- * This macro surrounds its token with double quotes.
- */
-#if $cpp_stuff == 1
-#define CAT2(a,b)a/**/b
-#define STRINGIFY(a)"a"
- /* If you can get stringification with catify, tell me how! */
-#endif
-#if $cpp_stuff == 42
-#define CAT2(a,b)a ## b
-#define StGiFy(a)# a
-#define STRINGIFY(a)StGiFy(a)
-#endif
-#if $cpp_stuff != 1 && $cpp_stuff != 42
-#include "Bletch: How does this C preprocessor catenate tokens?"
-#endif
-
-/* CPPSTDIN:
- * This symbol contains the first part of the string which will invoke
- * the C preprocessor on the standard input and produce to standard
- * output. Typical value of "cc -E" or "/lib/cpp", but it can also
- * call a wrapper. See CPPRUN.
- */
-/* CPPMINUS:
- * This symbol contains the second part of the string which will invoke
- * the C preprocessor on the standard input and produce to standard
- * output. This symbol will have the value "-" if CPPSTDIN needs a minus
- * to specify standard input, otherwise the value is "".
- */
-/* CPPRUN:
- * This symbol contains the string which will invoke a C preprocessor on
- * the standard input and produce to standard output. It needs to end
- * with CPPLAST, after all other preprocessor flags have been specified.
- * The main difference with CPPSTDIN is that this program will never be a
- * pointer to a shell wrapper, i.e. it will be empty if no preprocessor is
- * available directly to the user. Note that it may well be different from
- * the preprocessor used to compile the C program.
- */
-/* CPPLAST:
- * This symbol is intended to be used along with CPPRUN in the same manner
- * symbol CPPMINUS is used with CPPSTDIN. It contains either "-" or "".
- */
-#define CPPSTDIN "$cppstdin"
-#define CPPMINUS "$cppminus"
-#define CPPRUN "$cpprun"
-#define CPPLAST "$cpplast"
-
-/* HAS_ACCESS:
- * This manifest constant lets the C program know that the access()
- * system call is available to check for accessibility using real UID/GID.
- * (always present on UNIX.)
- */
-#$d_access HAS_ACCESS /**/
-
-/* HAS_CSH:
- * This symbol, if defined, indicates that the C-shell exists.
- */
-/* CSH:
- * This symbol, if defined, contains the full pathname of csh.
- */
-#$d_csh HAS_CSH /**/
-#ifdef HAS_CSH
-#define CSH "$full_csh" /**/
-#endif
-
-/* HAS_ENDGRENT:
- * This symbol, if defined, indicates that the getgrent routine is
- * available for finalizing sequential access of the group database.
- */
-#$d_endgrent HAS_ENDGRENT /**/
-
-/* HAS_ENDHOSTENT:
- * This symbol, if defined, indicates that the endhostent() routine is
- * available to close whatever was being used for host queries.
- */
-#$d_endhent HAS_ENDHOSTENT /**/
-
-/* HAS_ENDNETENT:
- * This symbol, if defined, indicates that the endnetent() routine is
- * available to close whatever was being used for network queries.
- */
-#$d_endnent HAS_ENDNETENT /**/
-
-/* HAS_ENDPROTOENT:
- * This symbol, if defined, indicates that the endprotoent() routine is
- * available to close whatever was being used for protocol queries.
- */
-#$d_endpent HAS_ENDPROTOENT /**/
-
-/* HAS_ENDPWENT:
- * This symbol, if defined, indicates that the getgrent routine is
- * available for finalizing sequential access of the passwd database.
- */
-#$d_endpwent HAS_ENDPWENT /**/
-
-/* HAS_ENDSERVENT:
- * This symbol, if defined, indicates that the endservent() routine is
- * available to close whatever was being used for service queries.
- */
-#$d_endsent HAS_ENDSERVENT /**/
-
/* HAS_GETGRENT:
* This symbol, if defined, indicates that the getgrent routine is
* available for sequential access of the group database.
* so that it is safe even if used by a process with super-user
* privileges.
*/
-/* HAS_PHOSTNAME:
- * This symbol, if defined, indicates that the C program may use the
- * contents of PHOSTNAME as a command to feed to the popen() routine
- * to derive the host name.
- */
#$d_gethname HAS_GETHOSTNAME /**/
#$d_uname HAS_UNAME /**/
#$d_phostname HAS_PHOSTNAME
#define PHOSTNAME "$aphostname" /* How to get the host name */
#endif
+/* HAS_GETHOST_PROTOS:
+ * This symbol, if defined, indicates that <netdb.h> includes
+ * prototypes for gethostent(), gethostbyname(), and
+ * gethostbyaddr(). Otherwise, it is up to the program to guess
+ * them. See netdbtype.U for probing for various Netdb_xxx_t types.
+ */
+#$d_gethostprotos HAS_GETHOST_PROTOS /**/
+
+/* HAS_GETMNT:
+ * This symbol, if defined, indicates that the getmnt routine is
+ * available to get filesystem mount info by filename.
+ */
+#$d_getmnt HAS_GETMNT /**/
+
+/* HAS_GETMNTENT:
+ * This symbol, if defined, indicates that the getmntent routine is
+ * available to iterate through mounted file systems to get their info.
+ */
+#$d_getmntent HAS_GETMNTENT /**/
+
/* HAS_GETNETBYADDR:
* This symbol, if defined, indicates that the getnetbyaddr() routine is
* available to look up networks by their IP addresses.
*/
#$d_getnent HAS_GETNETENT /**/
+/* HAS_GETNET_PROTOS:
+ * This symbol, if defined, indicates that <netdb.h> includes
+ * prototypes for getnetent(), getnetbyname(), and
+ * getnetbyaddr(). Otherwise, it is up to the program to guess
+ * them. See netdbtype.U for probing for various Netdb_xxx_t types.
+ */
+#$d_getnetprotos HAS_GETNET_PROTOS /**/
+
/* HAS_GETPROTOENT:
* This symbol, if defined, indicates that the getprotoent() routine is
* available to look up protocols in some data base or another.
#$d_getpbyname HAS_GETPROTOBYNAME /**/
#$d_getpbynumber HAS_GETPROTOBYNUMBER /**/
+/* HAS_GETPROTO_PROTOS:
+ * This symbol, if defined, indicates that <netdb.h> includes
+ * prototypes for getprotoent(), getprotobyname(), and
+ * getprotobyaddr(). Otherwise, it is up to the program to guess
+ * them. See netdbtype.U for probing for various Netdb_xxx_t types.
+ */
+#$d_getprotoprotos HAS_GETPROTO_PROTOS /**/
+
/* HAS_GETPWENT:
* This symbol, if defined, indicates that the getpwent routine is
* available for sequential access of the passwd database.
*/
#$d_getsent HAS_GETSERVENT /**/
+/* HAS_GETSERV_PROTOS:
+ * This symbol, if defined, indicates that <netdb.h> includes
+ * prototypes for getservent(), getservbyname(), and
+ * getservbyaddr(). Otherwise, it is up to the program to guess
+ * them. See netdbtype.U for probing for various Netdb_xxx_t types.
+ */
+#$d_getservprotos HAS_GETSERV_PROTOS /**/
+
+/* HAS_GETSPENT:
+ * This symbol, if defined, indicates that the getspent system call is
+ * available to retrieve SysV shadow password entries sequentially.
+ */
+#$d_getspent HAS_GETSPENT /**/
+
+/* HAS_GETSPNAM:
+ * This symbol, if defined, indicates that the getspnam system call is
+ * available to retrieve SysV shadow password entries by name.
+ */
+#$d_getspnam HAS_GETSPNAM /**/
+
/* HAS_GETSERVBYNAME:
* This symbol, if defined, indicates that the getservbyname()
* routine is available to look up services by their name.
#$d_getsbyname HAS_GETSERVBYNAME /**/
#$d_getsbyport HAS_GETSERVBYPORT /**/
+/* HAS_GNULIBC:
+ * This symbol, if defined, indicates to the C program that
+ * the GNU C library is being used.
+ */
+#$d_gnulibc HAS_GNULIBC /**/
+/* HAS_HASMNTOPT:
+ * This symbol, if defined, indicates that the hasmntopt routine is
+ * available to query the mount options of file systems.
+ */
+#$d_hasmntopt HAS_HASMNTOPT /**/
+
/* HAS_HTONL:
* This symbol, if defined, indicates that the htonl() routine (and
* friends htons() ntohl() ntohs()) are available to do network
#$d_htonl HAS_NTOHL /**/
#$d_htonl HAS_NTOHS /**/
+/* HAS_ISASCII:
+ * This manifest constant lets the C program know that isascii
+ * is available.
+ */
+#$d_isascii HAS_ISASCII /**/
+
+/* HAS_LCHOWN:
+ * This symbol, if defined, indicates that the lchown routine is
+ * available to operate on a symbolic link (instead of following the
+ * link).
+ */
+#$d_lchown HAS_LCHOWN /**/
+
+/* HAS_LDBL_DIG:
+ * This symbol, if defined, indicates that this system's <float.h>
+ * or <limits.h> defines the symbol LDBL_DIG, which is the number
+ * of significant digits in a long double precision number. Unlike
+ * for DBL_DIG, there's no good guess for LDBL_DIG if it is undefined.
+ */
+#$d_ldbl_dig HAS_LDBL_DIG /* */
+
/* HAS_LONG_DOUBLE:
* This symbol will be defined if the C compiler supports long
* doubles.
*/
#$d_memchr HAS_MEMCHR /**/
-/* HAS_MMAP:
- * This symbol, if defined, indicates that the mmap system call is
- * available to map a file into memory.
+/* HAS_MSG:
+ * This symbol, if defined, indicates that the entire msg*(2) library is
+ * supported (IPC mechanism based on message queues).
+ */
+#$d_msg HAS_MSG /**/
+
+/* HAS_OPEN3:
+ * This manifest constant lets the C program know that the three
+ * argument form of open(2) is available.
+ */
+#$d_open3 HAS_OPEN3 /**/
+
+/* OLD_PTHREAD_CREATE_JOINABLE:
+ * This symbol, if defined, indicates how to create pthread
+ * in joinable (aka undetached) state. NOTE: not defined
+ * if pthread.h already has defined PTHREAD_CREATE_JOINABLE
+ * (the new version of the constant).
+ * If defined, known values are PTHREAD_CREATE_UNDETACHED
+ * and __UNDETACHED.
+ */
+#$d_old_pthread_create_joinable OLD_PTHREAD_CREATE_JOINABLE $old_pthread_create_joinable /**/
+
+/* HAS_PTHREAD_YIELD:
+ * This symbol, if defined, indicates that the pthread_yield
+ * routine is available to yield the execution of the current
+ * thread. sched_yield is preferable to pthread_yield.
+ */
+/* SCHED_YIELD:
+ * This symbol defines the way to yield the execution of
+ * the current thread. Known ways are sched_yield,
+ * pthread_yield, and pthread_yield with NULL.
+ */
+/* HAS_SCHED_YIELD:
+ * This symbol, if defined, indicates that the sched_yield
+ * routine is available to yield the execution of the current
+ * thread. sched_yield is preferable to pthread_yield.
+ */
+#$d_pthread_yield HAS_PTHREAD_YIELD /**/
+#define SCHED_YIELD $sched_yield /**/
+#$d_sched_yield HAS_SCHED_YIELD /**/
+
+/* HAS_SAFE_BCOPY:
+ * This symbol, if defined, indicates that the bcopy routine is available
+ * to copy potentially overlapping memory blocks. Otherwise you should
+ * probably use memmove() or memcpy(). If neither is defined, roll your
+ * own version.
*/
-/* Mmap_t:
- * This symbol holds the return type of the mmap() system call
- * (and simultaneously the type of the first argument).
- * Usually set to 'void *' or 'cadd_t'.
+#$d_safebcpy HAS_SAFE_BCOPY /**/
+
+/* HAS_SAFE_MEMCPY:
+ * This symbol, if defined, indicates that the memcpy routine is available
+ * to copy potentially overlapping memory blocks. Otherwise you should
+ * probably use memmove() or memcpy(). If neither is defined, roll your
+ * own version.
*/
-#$d_mmap HAS_MMAP /**/
-#define Mmap_t $mmaptype /**/
+#$d_safemcpy HAS_SAFE_MEMCPY /**/
-/* HAS_MSG:
- * This symbol, if defined, indicates that the entire msg*(2) library is
- * supported (IPC mechanism based on message queues).
+/* HAS_SANE_MEMCMP:
+ * This symbol, if defined, indicates that the memcmp routine is available
+ * and can be used to compare relative magnitudes of chars with their high
+ * bits set. If it is not defined, roll your own version.
*/
-#$d_msg HAS_MSG /**/
+#$d_sanemcmp HAS_SANE_MEMCMP /**/
/* HAS_SEM:
* This symbol, if defined, indicates that the entire sem*(2) library is
*/
#$d_setsent HAS_SETSERVENT /**/
+/* HAS_SETSPENT:
+ * This symbol, if defined, indicates that the setspent system call is
+ * available to initialize the scan of SysV shadow password entries.
+ */
+#$d_setspent HAS_SETSPENT /**/
+
/* HAS_SETVBUF:
* This symbol, if defined, indicates that the setvbuf routine is
* available to change buffering on an open stdio stream.
*/
#$d_setvbuf HAS_SETVBUF /**/
+/* USE_SFIO:
+ * This symbol, if defined, indicates that sfio should
+ * be used.
+ */
+#$d_sfio USE_SFIO /**/
+
/* HAS_SHM:
* This symbol, if defined, indicates that the entire shm*(2) library is
* supported.
*/
#$d_shm HAS_SHM /**/
+/* HAS_SIGACTION:
+ * This symbol, if defined, indicates that Vr4's sigaction() routine
+ * is available.
+ */
+#$d_sigaction HAS_SIGACTION /**/
+
+/* HAS_SIGSETJMP:
+ * This variable indicates to the C program that the sigsetjmp()
+ * routine is available to save the calling process's registers
+ * and stack environment for later use by siglongjmp(), and
+ * to optionally save the process's signal mask. See
+ * Sigjmp_buf, Sigsetjmp, and Siglongjmp.
+ */
+/* Sigjmp_buf:
+ * This is the buffer type to be used with Sigsetjmp and Siglongjmp.
+ */
+/* Sigsetjmp:
+ * This macro is used in the same way as sigsetjmp(), but will invoke
+ * traditional setjmp() if sigsetjmp isn't available.
+ * See HAS_SIGSETJMP.
+ */
+/* Siglongjmp:
+ * This macro is used in the same way as siglongjmp(), but will invoke
+ * traditional longjmp() if siglongjmp isn't available.
+ * See HAS_SIGSETJMP.
+ */
+#$d_sigsetjmp HAS_SIGSETJMP /**/
+#ifdef HAS_SIGSETJMP
+#define Sigjmp_buf sigjmp_buf
+#define Sigsetjmp(buf,save_mask) sigsetjmp((buf),(save_mask))
+#define Siglongjmp(buf,retval) siglongjmp((buf),(retval))
+#else
+#define Sigjmp_buf jmp_buf
+#define Sigsetjmp(buf,save_mask) setjmp((buf))
+#define Siglongjmp(buf,retval) longjmp((buf),(retval))
+#endif
+
/* HAS_SOCKET:
* This symbol, if defined, indicates that the BSD socket interface is
* supported.
* Checking just with #ifdef might not be enough because this symbol
* has been known to be an enum.
*/
-/* HAS_SENDMSG:
- * This symbol, if defined, indicates that the sendmsg is supported
- * to send messages between sockets. You will also need struct
- * iovec from <sys/uio.h>, HAS_STRUCT_IOVEC and I_SYSUIO.
- */
-/* HAS_RECVMSG:
- * This symbol, if defined, indicates that the recvmsg is supported
- * to send messages between sockets. You will also need struct
- * iovec from <sys/uio.h>, HAS_STRUCT_IOVEC and I_SYSUIO.
- */
-/* HAS_STRUCT_MSGHDR:
- * This symbol, if defined, indicates that the struct msghdr
- * (BSD 4.3 or 4.4) is supported. You will also need struct
- * iovec from <sys/uio.h>, HAS_STRUCT_IOVEC and I_SYSUIO.
- */
-/* HAS_STRUCT_CMSGHDR:
- * This symbol, if defined, indicates that the struct cmsghdr
- * (BSD 4.4) is supported. You will also need struct
- * iovec from <sys/uio.h>, HAS_STRUCT_IOVEC and I_SYSUIO.
- */
#$d_socket HAS_SOCKET /**/
#$d_sockpair HAS_SOCKETPAIR /**/
#$d_msg_ctrunc HAS_MSG_CTRUNC /**/
#$d_msg_peek HAS_MSG_PEEK /**/
#$d_msg_proxy HAS_MSG_PROXY /**/
#$d_scm_rights HAS_SCM_RIGHTS /**/
-#$d_sendmsg HAS_SENDMSG /**/
-#$d_recvmsg HAS_RECVMSG /**/
-#$d_msghdr_s HAS_STRUCT_MSGHDR /**/
-#$d_cmsghdr_s HAS_STRUCT_CMSGHDR /**/
+
+/* HAS_SQRTL:
+ * This symbol, if defined, indicates that the sqrtl routine is
+ * available to do long double square roots.
+ */
+#$d_sqrtl HAS_SQRTL /**/
/* USE_STAT_BLOCKS:
* This symbol is defined if this system has a stat structure declaring
* st_blksize and st_blocks.
*/
+#ifndef USE_STAT_BLOCKS
#$d_statblks USE_STAT_BLOCKS /**/
+#endif
+
+/* HAS_STRUCT_STATFS_F_FLAGS:
+ * This symbol, if defined, indicates that the struct statfs
+ * does have the f_flags member containing the mount flags of
+ * the filesystem containing the file.
+ * This kind of struct statfs is coming from <sys/mount.h> (BSD 4.3),
+ * not from <sys/statfs.h> (SYSV). Older BSDs (like Ultrix) do not
+ * have statfs() and struct statfs, they have ustat() and getmnt()
+ * with struct ustat and struct fs_data.
+ */
+#$d_statfs_f_flags HAS_STRUCT_STATFS_F_FLAGS /**/
+
+/* HAS_STRUCT_STATFS:
+ * This symbol, if defined, indicates that the struct statfs
+ * to do statfs() is supported.
+ */
+#$d_statfs_s HAS_STRUCT_STATFS /**/
+
+/* HAS_FSTATVFS:
+ * This symbol, if defined, indicates that the fstatvfs routine is
+ * available to stat filesystems by file descriptors.
+ */
+#$d_fstatvfs HAS_FSTATVFS /**/
+
+/* USE_STDIO_PTR:
+ * This symbol is defined if the _ptr and _cnt fields (or similar)
+ * of the stdio FILE structure can be used to access the stdio buffer
+ * for a file handle. If this is defined, then the FILE_ptr(fp)
+ * and FILE_cnt(fp) macros will also be defined and should be used
+ * to access these fields.
+ */
+/* FILE_ptr:
+ * This macro is used to access the _ptr field (or equivalent) of the
+ * FILE structure pointed to by its argument. This macro will always be
+ * defined if USE_STDIO_PTR is defined.
+ */
+/* STDIO_PTR_LVALUE:
+ * This symbol is defined if the FILE_ptr macro can be used as an
+ * lvalue.
+ */
+/* FILE_cnt:
+ * This macro is used to access the _cnt field (or equivalent) of the
+ * FILE structure pointed to by its argument. This macro will always be
+ * defined if USE_STDIO_PTR is defined.
+ */
+/* STDIO_CNT_LVALUE:
+ * This symbol is defined if the FILE_cnt macro can be used as an
+ * lvalue.
+ */
+#$d_stdstdio USE_STDIO_PTR /**/
+#ifdef USE_STDIO_PTR
+#define FILE_ptr(fp) $stdio_ptr
+#$d_stdio_ptr_lval STDIO_PTR_LVALUE /**/
+#define FILE_cnt(fp) $stdio_cnt
+#$d_stdio_cnt_lval STDIO_CNT_LVALUE /**/
+#endif
+
+/* USE_STDIO_BASE:
+ * This symbol is defined if the _base field (or similar) of the
+ * stdio FILE structure can be used to access the stdio buffer for
+ * a file handle. If this is defined, then the FILE_base(fp) macro
+ * will also be defined and should be used to access this field.
+ * Also, the FILE_bufsiz(fp) macro will be defined and should be used
+ * to determine the number of bytes in the buffer. USE_STDIO_BASE
+ * will never be defined unless USE_STDIO_PTR is.
+ */
+/* FILE_base:
+ * This macro is used to access the _base field (or equivalent) of the
+ * FILE structure pointed to by its argument. This macro will always be
+ * defined if USE_STDIO_BASE is defined.
+ */
+/* FILE_bufsiz:
+ * This macro is used to determine the number of bytes in the I/O
+ * buffer pointed to by _base field (or equivalent) of the FILE
+ * structure pointed to its argument. This macro will always be defined
+ * if USE_STDIO_BASE is defined.
+ */
+#$d_stdiobase USE_STDIO_BASE /**/
+#ifdef USE_STDIO_BASE
+#define FILE_base(fp) $stdio_base
+#define FILE_bufsiz(fp) $stdio_bufsiz
+#endif
/* HAS_STRERROR:
* This symbol, if defined, indicates that the strerror routine is
#$d_syserrlst HAS_SYS_ERRLIST /**/
#define Strerror(e) $d_strerrm
+/* HAS_STRTOLD:
+ * This symbol, if defined, indicates that the strtold routine is
+ * available to convert strings to long doubles.
+ */
+#$d_strtold HAS_STRTOLD /**/
+
+/* HAS_STRTOLL:
+ * This symbol, if defined, indicates that the strtoll routine is
+ * available to convert strings to long longs.
+ */
+#$d_strtoll HAS_STRTOLL /**/
+
+/* HAS_STRTOULL:
+ * This symbol, if defined, indicates that the strtoull routine is
+ * available to convert strings to unsigned long longs.
+ */
+#$d_strtoull HAS_STRTOULL /**/
+
+/* HAS_STRTOUQ:
+ * This symbol, if defined, indicates that the strtouq routine is
+ * available to convert strings to unsigned long longs (quads).
+ */
+#$d_strtouq HAS_STRTOUQ /**/
+
+/* HAS_TELLDIR_PROTO:
+ * This symbol, if defined, indicates that the system provides
+ * a prototype for the telldir() function. Otherwise, it is up
+ * to the program to supply one. A good guess is
+ * extern long telldir _((DIR*));
+ */
+#$d_telldirproto HAS_TELLDIR_PROTO /**/
+
+/* Time_t:
+ * This symbol holds the type returned by time(). It can be long,
+ * or time_t on BSD sites (in which case <sys/types.h> should be
+ * included).
+ */
+#define Time_t $timetype /* Time type */
+
+/* HAS_TIMES:
+ * This symbol, if defined, indicates that the times() routine exists.
+ * Note that this became obsolete on some systems (SUNOS), which now
+ * use getrusage(). It may be necessary to include <sys/times.h>.
+ */
+#$d_times HAS_TIMES /**/
+
/* HAS_UNION_SEMUN:
* This symbol, if defined, indicates that the union semun is
* defined by including <sys/sem.h>. If not, the user code
#$d_semctl_semun USE_SEMCTL_SEMUN /**/
#$d_semctl_semid_ds USE_SEMCTL_SEMID_DS /**/
+/* HAS_USTAT:
+ * This symbol, if defined, indicates that the ustat system call is
+ * available to query file system statistics by dev_t.
+ */
+#$d_ustat HAS_USTAT /**/
+
/* HAS_VFORK:
* This symbol, if defined, indicates that vfork() exists.
*/
*/
#define Signal_t $signal_t /* Signal handler's return type */
+/* HAS_VPRINTF:
+ * This symbol, if defined, indicates that the vprintf routine is available
+ * to printf with a pointer to an argument list. If unavailable, you
+ * may need to write your own, probably in terms of _doprnt().
+ */
+/* USE_CHAR_VSPRINTF:
+ * This symbol is defined if this system has vsprintf() returning type
+ * (char*). The trend seems to be to declare it as "int vsprintf()". It
+ * is up to the package author to declare vsprintf correctly based on the
+ * symbol.
+ */
+#$d_vprintf HAS_VPRINTF /**/
+#$d_charvspr USE_CHAR_VSPRINTF /**/
+
+/* USE_DYNAMIC_LOADING:
+ * This symbol, if defined, indicates that dynamic loading of
+ * some sort is available.
+ */
+#$usedl USE_DYNAMIC_LOADING /**/
+
+/* DOUBLESIZE:
+ * This symbol contains the size of a double, so that the C preprocessor
+ * can make decisions based on it.
+ */
+#define DOUBLESIZE $doublesize /**/
+
+/* EBCDIC:
+ * This symbol, if defined, indicates that this system uses
+ * EBCDIC encoding.
+ */
+#$ebcdic EBCDIC /**/
+
+/* FFLUSH_NULL:
+ * This symbol, if defined, tells that fflush(NULL) does flush
+ * all pending stdio output.
+ */
+/* FFLUSH_ALL:
+ * This symbol, if defined, tells that to flush
+ * all pending stdio output one must loop through all
+ * the stdio file handles stored in an array and fflush them.
+ * Note that if fflushNULL is defined, fflushall will not
+ * even be probed for and will be left undefined.
+ */
+#$fflushNULL FFLUSH_NULL /**/
+#$fflushall FFLUSH_ALL /**/
+
+/* Fpos_t:
+ * This symbol holds the type used to declare file positions in libc.
+ * It can be fpos_t, long, uint, etc... It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
+ */
+#define Fpos_t $fpostype /* File position type */
+
+/* Gid_t_f:
+ * This symbol defines the format string used for printing a Gid_t.
+ */
+#define Gid_t_f $gidformat /**/
+
+/* Gid_t_size:
+ * This symbol holds the size of a Gid_t in bytes.
+ */
+#define Gid_t_size $gidsize /* GID size */
+
+/* Gid_t:
+ * This symbol holds the return type of getgid() and the type of
+ * argument to setrgid() and related functions. Typically,
+ * it is the type of group ids in the kernel. It can be int, ushort,
+ * uid_t, etc... It may be necessary to include <sys/types.h> to get
+ * any typedef'ed information.
+ */
+#define Gid_t $gidtype /* Type for getgid(), etc... */
+
/* Groups_t:
* This symbol holds the type used for the second argument to
* getgroups() and setgropus(). Usually, this is the same as
* typedef'ed information. This is only required if you have
* getgroups() or setgropus()..
*/
-#if defined(HAS_GETGROUPS) || defined(HAS_SETGROUPS)
-#define Groups_t $groupstype /* Type for 2nd arg to [sg]etgroups() */
-#endif
+#if defined(HAS_GETGROUPS) || defined(HAS_SETGROUPS)
+#define Groups_t $groupstype /* Type for 2nd arg to [sg]etgroups() */
+#endif
+
+/* DB_Prefix_t:
+ * This symbol contains the type of the prefix structure element
+ * in the <db.h> header file. In older versions of DB, it was
+ * int, while in newer ones it is u_int32_t.
+ */
+/* DB_Hash_t:
+ * This symbol contains the type of the prefix structure element
+ * in the <db.h> header file. In older versions of DB, it was
+ * int, while in newer ones it is size_t.
+ */
+#define DB_Hash_t $db_hashtype /**/
+#define DB_Prefix_t $db_prefixtype /**/
/* I_GRP:
* This symbol, if defined, indicates to the C program that it should
#$i_grp I_GRP /**/
#$d_grpasswd GRPASSWD /**/
+/* I_INTTYPES:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <inttypes.h>.
+ */
+#$i_inttypes I_INTTYPES /**/
+
+/* I_MACH_CTHREADS:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <mach/cthreads.h>.
+ */
+#$i_machcthr I_MACH_CTHREADS /**/
+
+/* I_MNTENT:
+ * This symbol, if defined, indicates that <mntent.h> exists and
+ * should be included.
+ */
+#$i_mntent I_MNTENT /**/
+
/* I_NETDB:
* This symbol, if defined, indicates that <netdb.h> exists and
* should be included.
*/
#$i_netdb I_NETDB /**/
+/* I_NETINET_TCP:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <netinet/tcp.h>.
+ */
+#$i_netinettcp I_NETINET_TCP /**/
+
+/* I_POLL:
+ * This symbol, if defined, indicates that <poll.h> exists and
+ * should be included.
+ */
+#$i_poll I_POLL /**/
+
+/* I_PTHREAD:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <pthread.h>.
+ */
+#$i_pthread I_PTHREAD /**/
+
/* I_PWD:
* This symbol, if defined, indicates to the C program that it should
* include <pwd.h>.
#$d_pwgecos PWGECOS /**/
#$d_pwpasswd PWPASSWD /**/
+/* I_SHADOW:
+ * This symbol, if defined, indicates that <shadow.h> exists and
+ * should be included.
+ */
+#$i_shadow I_SHADOW /**/
+
+/* I_SOCKS:
+ * This symbol, if defined, indicates that <socks.h> exists and
+ * should be included.
+ */
+#$i_socks I_SOCKS /**/
+
+/* I_SYS_MOUNT:
+ * This symbol, if defined, indicates that <sys/mount.h> exists and
+ * should be included.
+ */
+#$i_sysmount I_SYS_MOUNT /**/
+
+/* I_SYS_STATFS:
+ * This symbol, if defined, indicates that <sys/statfs.h> exists.
+ */
+#$i_sysstatfs I_SYS_STATFS /**/
+
+/* I_SYS_STATVFS:
+ * This symbol, if defined, indicates that <sys/statvfs.h> exists and
+ * should be included.
+ */
+#$i_sysstatvfs I_SYS_STATVFS /**/
+
/* I_SYSUIO:
* This symbol, if defined, indicates that <sys/uio.h> exists and
* should be included.
*/
-/* HAS_STRUCT_IOVEC:
- * This symbol, if defined, indicates that the struct iovec
- * to do scatter writes/gather reads is supported.
- */
#$i_sysuio I_SYSUIO /**/
-#$d_iovec_s HAS_STRUCT_IOVEC /**/
+
+/* I_SYS_VFS:
+ * This symbol, if defined, indicates that <sys/vfs.h> exists and
+ * should be included.
+ */
+#$i_sysvfs I_SYS_VFS /**/
+
+/* I_TIME:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <time.h>.
+ */
+/* I_SYS_TIME:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <sys/time.h>.
+ */
+/* I_SYS_TIME_KERNEL:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <sys/time.h> with KERNEL defined.
+ */
+#$i_time I_TIME /**/
+#$i_systime I_SYS_TIME /**/
+#$i_systimek I_SYS_TIME_KERNEL /**/
+
+/* I_USTAT:
+ * This symbol, if defined, indicates that <ustat.h> exists and
+ * should be included.
+ */
+#$i_ustat I_USTAT /**/
+
+/* PERL_INC_VERSION_LIST:
+ * This variable specifies the list of subdirectories in over
+ * which perl.c:incpush() and lib/lib.pm will automatically
+ * search when adding directories to @INC, in a format suitable
+ * for a C initialization string. See the inc_version_list entry
+ * in Porting/Glossary for more details.
+ */
+#define PERL_INC_VERSION_LIST $inc_version_list /**/
+
+/* HAS_OFF64_T:
+ * This symbol will be defined if the C compiler supports off64_t.
+ */
+/* HAS_FPOS64_T:
+ * This symbol will be defined if the C compiler supports fpos64_t.
+ */
+#$d_off64_t HAS_OFF64_T /**/
+#$d_fpos64_t HAS_FPOS64_T /**/
+
+/* PERL_PRIfldbl:
+ * This symbol, if defined, contains the string used by stdio to
+ * format long doubles (format 'f') for output.
+ */
+/* PERL_PRIgldbl:
+ * This symbol, if defined, contains the string used by stdio to
+ * format long doubles (format 'g') for output.
+ */
+#$d_PRIfldbl PERL_PRIfldbl $sPRIfldbl /**/
+#$d_PRIgldbl PERL_PRIgldbl $sPRIgldbl /**/
+
+/* Off_t:
+ * This symbol holds the type used to declare offsets in the kernel.
+ * It can be int, long, off_t, etc... It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
+ */
+/* LSEEKSIZE:
+ * This symbol holds the number of bytes used by the Off_t.
+ */
+/* Off_t_size:
+ * This symbol holds the number of bytes used by the Off_t.
+ */
+#define Off_t $lseektype /* <offset> type */
+#define LSEEKSIZE $lseeksize /* <offset> size */
+#define Off_t_size $lseeksize /* <offset> size */
/* Free_t:
* This variable contains the return type of free(). It is usually
*/
#$d_mymalloc MYMALLOC /**/
-/* SIG_NAME:
- * This symbol contains a list of signal names in order of
- * signal number. This is intended
- * to be used as a static array initialization, like this:
- * char *sig_name[] = { SIG_NAME };
- * The signals in the list are separated with commas, and each signal
- * is surrounded by double quotes. There is no leading SIG in the signal
- * name, i.e. SIGQUIT is known as "QUIT".
- * Gaps in the signal numbers (up to NSIG) are filled in with NUMnn,
- * etc., where nn is the actual signal number (e.g. NUM37).
- * The signal number for sig_name[i] is stored in sig_num[i].
- * The last element is 0 to terminate the list with a NULL. This
- * corresponds to the 0 at the end of the sig_num list.
- */
-/* SIG_NUM:
- * This symbol contains a list of signal numbers, in the same order as the
- * SIG_NAME list. It is suitable for static array initialization, as in:
- * int sig_num[] = { SIG_NUM };
- * The signals in the list are separated with commas, and the indices
- * within that list and the SIG_NAME list match, so it's easy to compute
- * the signal name from a number or vice versa at the price of a small
- * dynamic linear lookup.
- * Duplicates are allowed, but are moved to the end of the list.
- * The signal number corresponding to sig_name[i] is sig_number[i].
- * if (i < NSIG) then sig_number[i] == i.
- * The last element is 0, corresponding to the 0 at the end of
- * the sig_name list.
+/* Mode_t:
+ * This symbol holds the type used to declare file modes
+ * for systems calls. It is usually mode_t, but may be
+ * int or unsigned short. It may be necessary to include <sys/types.h>
+ * to get any typedef'ed information.
*/
-#define SIG_NAME $sig_name_init /**/
-#define SIG_NUM $sig_num_init /**/
+#define Mode_t $modetype /* file mode parameter for system calls */
-/* VOIDFLAGS:
- * This symbol indicates how much support of the void type is given by this
- * compiler. What various bits mean:
- *
- * 1 = supports declaration of void
- * 2 = supports arrays of pointers to functions returning void
- * 4 = supports comparisons between pointers to void functions and
- * addresses of void functions
- * 8 = suports declaration of generic void pointers
- *
- * The package designer should define VOIDUSED to indicate the requirements
- * of the package. This can be done either by #defining VOIDUSED before
- * including config.h, or by defining defvoidused in Myinit.U. If the
- * latter approach is taken, only those flags will be tested. If the
- * level of void support necessary is not present, defines void to int.
+/* VAL_O_NONBLOCK:
+ * This symbol is to be used during open() or fcntl(F_SETFL) to turn on
+ * non-blocking I/O for the file descriptor. Note that there is no way
+ * back, i.e. you cannot turn it blocking again this way. If you wish to
+ * alternatively switch between blocking and non-blocking, use the
+ * ioctl(FIOSNBIO) call instead, but that is not supported by all devices.
*/
-#ifndef VOIDUSED
-#define VOIDUSED $defvoidused
-#endif
-#define VOIDFLAGS $voidflags
-#if (VOIDFLAGS & VOIDUSED) != VOIDUSED
-#define void int /* is void to be avoided? */
-#define M_VOID /* Xenix strikes again */
-#endif
-
-/* HAS_ATOLF:
- * This symbol, if defined, indicates that the atolf routine is
- * available to convert strings into long doubles.
+/* VAL_EAGAIN:
+ * This symbol holds the errno error code set by read() when no data was
+ * present on the non-blocking file descriptor.
*/
-#$d_atolf HAS_ATOLF /**/
-
-/* HAS_ATOLL:
- * This symbol, if defined, indicates that the atoll routine is
- * available to convert strings into long longs.
+/* RD_NODATA:
+ * This symbol holds the return code from read() when no data is present
+ * on the non-blocking file descriptor. Be careful! If EOF_NONBLOCK is
+ * not defined, then you can't distinguish between no data and EOF by
+ * issuing a read(). You'll have to find another way to tell for sure!
*/
-#$d_atoll HAS_ATOLL /**/
-
-/* PERL_BINCOMPAT_5005:
- * This symbol, if defined, indicates that Perl 5.006 should be
- * binary-compatible with Perl 5.005. This is impossible for builds
- * that use features like threads and multiplicity it is always $undef
- * for those versions.
+/* EOF_NONBLOCK:
+ * This symbol, if defined, indicates to the C program that a read() on
+ * a non-blocking file descriptor will return 0 on EOF, and not the value
+ * held in RD_NODATA (-1 usually, in that case!).
*/
-#$d_bincompat5005 PERL_BINCOMPAT_5005 /**/
+#define VAL_O_NONBLOCK $o_nonblock
+#define VAL_EAGAIN $eagain
+#define RD_NODATA $rd_nodata
+#$d_eofnblk EOF_NONBLOCK
-/* DLSYM_NEEDS_UNDERSCORE:
- * This symbol, if defined, indicates that we need to prepend an
- * underscore to the symbol name before calling dlsym(). This only
- * makes sense if you *have* dlsym, which we will presume is the
- * case if you're using dl_dlopen.xs.
+/* Netdb_host_t:
+ * This symbol holds the type used for the 1st argument
+ * to gethostbyaddr().
*/
-#$d_dlsymun DLSYM_NEEDS_UNDERSCORE /**/
-
-/* HAS_ENDSPENT:
- * This symbol, if defined, indicates that the endspent system call is
- * available to finalize the scan of SysV shadow password entries.
+/* Netdb_hlen_t:
+ * This symbol holds the type used for the 2nd argument
+ * to gethostbyaddr().
*/
-#$d_endspent HAS_ENDSPENT /**/
-
-/* HAS_FSEEKO:
- * This symbol, if defined, indicates that the fseeko routine is
- * available to fseek beyond 32 bits (useful for ILP32 hosts).
+/* Netdb_name_t:
+ * This symbol holds the type used for the argument to
+ * gethostbyname().
*/
-#$d_fseeko HAS_FSEEKO /**/
+/* Netdb_net_t:
+ * This symbol holds the type used for the 1st argument to
+ * getnetbyaddr().
+ */
+#define Netdb_host_t $netdb_host_type /**/
+#define Netdb_hlen_t $netdb_hlen_type /**/
+#define Netdb_name_t $netdb_name_type /**/
+#define Netdb_net_t $netdb_net_type /**/
-/* HAS_FTELLO:
- * This symbol, if defined, indicates that the ftello routine is
- * available to ftell beyond 32 bits (useful for ILP32 hosts).
+/* IVTYPE:
+ * This symbol defines the C type used for Perl's IV.
*/
-#$d_ftello HAS_FTELLO /**/
-
-/* HAS_GETMNTENT:
- * This symbol, if defined, indicates that the getmntent routine is
- * available to iterate through mounted file systems.
+/* UVTYPE:
+ * This symbol defines the C type used for Perl's UV.
*/
-#$d_getmntent HAS_GETMNTENT /**/
-
-/* HAS_GETSPENT:
- * This symbol, if defined, indicates that the getspent system call is
- * available to retrieve SysV shadow password entries sequentially.
+/* I8TYPE:
+ * This symbol defines the C type used for Perl's I8.
*/
-#$d_getspent HAS_GETSPENT /**/
-
-/* HAS_GETSPNAM:
- * This symbol, if defined, indicates that the getspnam system call is
- * available to retrieve SysV shadow password entries by name.
+/* U8TYPE:
+ * This symbol defines the C type used for Perl's U8.
*/
-#$d_getspnam HAS_GETSPNAM /**/
-
-/* HAS_HASMNTOPT:
- * This symbol, if defined, indicates that the hasmntopt routine is
- * available to query the mount options of file systems.
+/* I16TYPE:
+ * This symbol defines the C type used for Perl's I16.
*/
-#$d_hasmntopt HAS_HASMNTOPT /**/
-
-/* HAS_LDBL_DIG:
- * This symbol, if defined, indicates that this system's <float.h>
- * or <limits.h> defines the symbol LDBL_DIG, which is the number
- * of significant digits in a long double precision number. Unlike
- * for DBL_DIG, there's no good guess for LDBL_DIG if it is undefined.
+/* U16TYPE:
+ * This symbol defines the C type used for Perl's U16.
*/
-#$d_ldbl_dig HAS_LDBL_DIG /* */
-
-/* HAS_MADVISE:
- * This symbol, if defined, indicates that the madvise system call is
- * available to map a file into memory.
+/* I32TYPE:
+ * This symbol defines the C type used for Perl's I32.
*/
-#$d_madvise HAS_MADVISE /**/
-
-/* HAS_MPROTECT:
- * This symbol, if defined, indicates that the mprotect system call is
- * available to modify the access protection of a memory mapped file.
+/* U32TYPE:
+ * This symbol defines the C type used for Perl's U32.
*/
-#$d_mprotect HAS_MPROTECT /**/
-
-/* HAS_READV:
- * This symbol, if defined, indicates that the readv routine is
- * available to do gather reads. You will also need <sys/uio.h>
- * and there I_SYSUIO.
+/* I64TYPE:
+ * This symbol defines the C type used for Perl's I64.
*/
-#$d_readv HAS_READV /**/
-
-/* HAS_SETSPENT:
- * This symbol, if defined, indicates that the setspent system call is
- * available to initialize the scan of SysV shadow password entries.
+/* U64TYPE:
+ * This symbol defines the C type used for Perl's U64.
*/
-#$d_setspent HAS_SETSPENT /**/
-
-/* USE_SFIO:
- * This symbol, if defined, indicates that sfio should
- * be used.
+/* NVTYPE:
+ * This symbol defines the C type used for Perl's NV.
*/
-#$d_sfio USE_SFIO /**/
-
-/* HAS_FSTATFS:
- * This symbol, if defined, indicates that the fstatfs routine is
- * available to stat filesystems of file descriptors.
+/* IVSIZE:
+ * This symbol contains the sizeof(IV).
*/
-/* HAS_STRUCT_STATFS_FLAGS:
- * This symbol, if defined, indicates that the struct statfs
- * does have the f_flags member containing the mount flags of
- * the filesystem holding the file.
- * This kind of struct statfs is coming from sys/mount.h (BSD),
- * not from sys/statfs.h (SYSV).
+/* UVSIZE:
+ * This symbol contains the sizeof(UV).
*/
-#$d_fstatfs HAS_FSTATFS /**/
-#$d_statfsflags HAS_STRUCT_STATFS_FLAGS /**/
-
-/* HAS_FSTATVFS:
- * This symbol, if defined, indicates that the fstatvfs routine is
- * available to stat filesystems of file descriptors.
+/* I8SIZE:
+ * This symbol contains the sizeof(I8).
*/
-#$d_fstatvfs HAS_FSTATVFS /**/
-
-/* HAS_TELLDIR_PROTO:
- * This symbol, if defined, indicates that the system provides
- * a prototype for the telldir() function. Otherwise, it is up
- * to the program to supply one. A good guess is
- * extern long telldir _((DIR*));
+/* U8SIZE:
+ * This symbol contains the sizeof(U8).
*/
-#$d_telldirproto HAS_TELLDIR_PROTO /**/
-
-/* HAS_WRITEV:
- * This symbol, if defined, indicates that the writev routine is
- * available to do scatter writes.
+/* I16SIZE:
+ * This symbol contains the sizeof(I16).
*/
-#$d_writev HAS_WRITEV /**/
-
-/* USE_DYNAMIC_LOADING:
- * This symbol, if defined, indicates that dynamic loading of
- * some sort is available.
+/* U16SIZE:
+ * This symbol contains the sizeof(U16).
*/
-#$usedl USE_DYNAMIC_LOADING /**/
-
-/* FFLUSH_NULL:
- * This symbol, if defined, tells that fflush(NULL) does flush
- * all pending stdio output.
+/* I32SIZE:
+ * This symbol contains the sizeof(I32).
*/
-/* FFLUSH_ALL:
- * This symbol, if defined, tells that to flush
- * all pending stdio output one must loop through all
- * the stdio file handles stored in an array and fflush them.
- * Note that if fflushNULL is defined, fflushall will not
- * even be probed for and will be left undefined.
+/* U32SIZE:
+ * This symbol contains the sizeof(U32).
*/
-#$fflushNULL FFLUSH_NULL /**/
-#$fflushall FFLUSH_ALL /**/
-
-/* DB_Prefix_t:
- * This symbol contains the type of the prefix structure element
- * in the <db.h> header file. In older versions of DB, it was
- * int, while in newer ones it is u_int32_t.
+/* I64SIZE:
+ * This symbol contains the sizeof(I64).
*/
-/* DB_Hash_t:
- * This symbol contains the type of the prefix structure element
- * in the <db.h> header file. In older versions of DB, it was
- * int, while in newer ones it is size_t.
+/* U64SIZE:
+ * This symbol contains the sizeof(U64).
*/
-#define DB_Hash_t $db_hashtype /**/
-#define DB_Prefix_t $db_prefixtype /**/
+#define IVTYPE $ivtype /**/
+#define UVTYPE $uvtype /**/
+#define I8TYPE $i8type /**/
+#define U8TYPE $u8type /**/
+#define I16TYPE $i16type /**/
+#define U16TYPE $u16type /**/
+#define I32TYPE $i32type /**/
+#define U32TYPE $u32type /**/
+#ifdef HAS_QUAD
+#define I64TYPE $i64type /**/
+#define U64TYPE $u64type /**/
+#endif
+#define NVTYPE $nvtype /**/
+#define IVSIZE $ivsize /**/
+#define UVSIZE $uvsize /**/
+#define I8SIZE $i8size /**/
+#define U8SIZE $u8size /**/
+#define I16SIZE $i16size /**/
+#define U16SIZE $u16size /**/
+#define I32SIZE $i32size /**/
+#define U32SIZE $u32size /**/
+#ifdef HAS_QUAD
+#define I64SIZE $i64size /**/
+#define U64SIZE $u64size /**/
+#endif
-/* I_INTTYPES:
- * This symbol, if defined, indicates to the C program that it should
- * include <inttypes.h>.
+/* IVdf:
+ * This symbol defines the format string used for printing a Perl IV
+ * as a signed decimal integer.
*/
-/* HAS_INT64_T:
- * This symbol will defined if the C compiler supports int64_t.
- * Usually the <inttypes.h> needs to be included, but sometimes
- * <sys/types.h> is enough.
+/* UVuf:
+ * This symbol defines the format string used for printing a Perl UV
+ * as an unsigned decimal integer.
*/
-#$i_inttypes I_INTTYPES /**/
-#$d_int64t HAS_INT64_T /**/
-
-/* I_MNTENT:
- * This symbol, if defined, indicates that <mntent.h> exists and
- * should be included.
+/* UVof:
+ * This symbol defines the format string used for printing a Perl UV
+ * as an unsigned octal integer.
*/
-#$i_mntent I_MNTENT /**/
-
-/* I_NETINET_TCP:
- * This symbol, if defined, indicates to the C program that it should
- * include <netinet/tcp.h>.
+/* UVxf:
+ * This symbol defines the format string used for printing a Perl UV
+ * as an unsigned hexadecimal integer.
*/
-#$i_netinettcp I_NETINET_TCP /**/
+#define IVdf $ivdformat /**/
+#define UVuf $uvuformat /**/
+#define UVof $uvoformat /**/
+#define UVxf $uvxformat /**/
-/* I_POLL:
- * This symbol, if defined, indicates that <poll.h> exists and
- * should be included.
+/* Pid_t:
+ * This symbol holds the type used to declare process ids in the kernel.
+ * It can be int, uint, pid_t, etc... It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
*/
-#$i_poll I_POLL /**/
+#define Pid_t $pidtype /* PID type */
-/* I_SHADOW:
- * This symbol, if defined, indicates that <shadow.h> exists and
- * should be included.
+/* PRIVLIB:
+ * This symbol contains the name of the private library for this package.
+ * The library is private in the sense that it needn't be in anyone's
+ * execution path, but it should be accessible by the world. The program
+ * should be prepared to do ~ expansion.
*/
-#$i_shadow I_SHADOW /**/
+/* PRIVLIB_EXP:
+ * This symbol contains the ~name expanded version of PRIVLIB, to be used
+ * in programs that are not prepared to deal with ~ expansion at run-time.
+ */
+#define PRIVLIB "$privlib" /**/
+#define PRIVLIB_EXP "$privlibexp" /**/
-/* I_SOCKS:
- * This symbol, if defined, indicates that <socks.h> exists and
- * should be included.
+/* PTRSIZE:
+ * This symbol contains the size of a pointer, so that the C preprocessor
+ * can make decisions based on it. It will be sizeof(void *) if
+ * the compiler supports (void *); otherwise it will be
+ * sizeof(char *).
*/
-#$i_socks I_SOCKS /**/
+#define PTRSIZE $ptrsize /**/
-/* I_SYS_MMAN:
- * This symbol, if defined, indicates that <sys/mman.h> exists and
- * should be included.
+/* Drand01:
+ * This macro is to be used to generate uniformly distributed
+ * random numbers over the range [0., 1.[. You may have to supply
+ * an 'extern double drand48();' in your program since SunOS 4.1.3
+ * doesn't provide you with anything relevant in it's headers.
+ * See HAS_DRAND48_PROTO.
+ */
+/* Rand_seed_t:
+ * This symbol defines the type of the argument of the
+ * random seed function.
+ */
+/* seedDrand01:
+ * This symbol defines the macro to be used in seeding the
+ * random number generator (see Drand01).
+ */
+/* RANDBITS:
+ * This symbol indicates how many bits are produced by the
+ * function used to generate normalized random numbers.
+ * Values include 15, 16, 31, and 48.
*/
-#$i_sysmman I_SYS_MMAN /**/
+#define Drand01() $drand01 /**/
+#define Rand_seed_t $randseedtype /**/
+#define seedDrand01(x) $seedfunc((Rand_seed_t)x) /**/
+#define RANDBITS $randbits /**/
-/* I_SYS_MOUNT:
- * This symbol, if defined, indicates that <sys/mount.h> exists and
- * should be included.
+/* SELECT_MIN_BITS:
+ * This symbol holds the minimum number of bits operated by select.
+ * That is, if you do select(n, ...), how many bits at least will be
+ * cleared in the masks if some activity is detected. Usually this
+ * is either n or 32*ceil(n/32), especially many little-endians do
+ * the latter. This is only useful if you have select(), naturally.
*/
-#$i_sysmount I_SYS_MOUNT /**/
+#define SELECT_MIN_BITS $selectminbits /**/
-/* I_SYS_STATVFS:
- * This symbol, if defined, indicates that <sys/statvfs.h> exists and
- * should be included.
+/* Select_fd_set_t:
+ * This symbol holds the type used for the 2nd, 3rd, and 4th
+ * arguments to select. Usually, this is 'fd_set *', if HAS_FD_SET
+ * is defined, and 'int *' otherwise. This is only useful if you
+ * have select(), of course.
*/
-#$i_sysstatvfs I_SYS_STATVFS /**/
+#define Select_fd_set_t $selecttype /**/
-/* HAS_OFF64_T:
- * This symbol will be defined if the C compiler supports off64_t.
+/* SIG_NAME:
+ * This symbol contains a list of signal names in order of
+ * signal number. This is intended
+ * to be used as a static array initialization, like this:
+ * char *sig_name[] = { SIG_NAME };
+ * The signals in the list are separated with commas, and each signal
+ * is surrounded by double quotes. There is no leading SIG in the signal
+ * name, i.e. SIGQUIT is known as "QUIT".
+ * Gaps in the signal numbers (up to NSIG) are filled in with NUMnn,
+ * etc., where nn is the actual signal number (e.g. NUM37).
+ * The signal number for sig_name[i] is stored in sig_num[i].
+ * The last element is 0 to terminate the list with a NULL. This
+ * corresponds to the 0 at the end of the sig_num list.
*/
-/* HAS_FPOS64_T:
- * This symbol will be defined if the C compiler supports fpos64_t.
+/* SIG_NUM:
+ * This symbol contains a list of signal numbers, in the same order as the
+ * SIG_NAME list. It is suitable for static array initialization, as in:
+ * int sig_num[] = { SIG_NUM };
+ * The signals in the list are separated with commas, and the indices
+ * within that list and the SIG_NAME list match, so it's easy to compute
+ * the signal name from a number or vice versa at the price of a small
+ * dynamic linear lookup.
+ * Duplicates are allowed, but are moved to the end of the list.
+ * The signal number corresponding to sig_name[i] is sig_number[i].
+ * if (i < NSIG) then sig_number[i] == i.
+ * The last element is 0, corresponding to the 0 at the end of
+ * the sig_name list.
*/
-#$d_off64_t HAS_OFF64_T /**/
-#$d_fpos64_t HAS_FPOS64_T /**/
+#define SIG_NAME $sig_name_init /**/
+#define SIG_NUM $sig_num_init /**/
-/* PERL_PRIfldbl:
- * This symbol, if defined, contains the string used by stdio to
- * format long doubles (format 'f') for output.
+/* SITEARCH:
+ * This symbol contains the name of the private library for this package.
+ * The library is private in the sense that it needn't be in anyone's
+ * execution path, but it should be accessible by the world. The program
+ * should be prepared to do ~ expansion.
+ * The standard distribution will put nothing in this directory.
+ * After perl has been installed, users may install their own local
+ * architecture-dependent modules in this directory with
+ * MakeMaker Makefile.PL
+ * or equivalent. See INSTALL for details.
*/
-/* PERL_PRIgldbl:
- * This symbol, if defined, contains the string used by stdio to
- * format long doubles (format 'g') for output.
+/* SITEARCH_EXP:
+ * This symbol contains the ~name expanded version of SITEARCH, to be used
+ * in programs that are not prepared to deal with ~ expansion at run-time.
*/
-#$d_PRIfldbl PERL_PRIfldbl $sPRIfldbl /**/
-#$d_PRIgldbl PERL_PRIgldbl $sPRIgldbl /**/
+#define SITEARCH "$sitearch" /**/
+#define SITEARCH_EXP "$sitearchexp" /**/
-/* PERL_PRId64:
- * This symbol, if defined, contains the string used by stdio to
- * format 64-bit decimal numbers (format 'd') for output.
- */
-/* PERL_PRIu64:
- * This symbol, if defined, contains the string used by stdio to
- * format 64-bit unsigned decimal numbers (format 'u') for output.
+/* SITELIB:
+ * This symbol contains the name of the private library for this package.
+ * The library is private in the sense that it needn't be in anyone's
+ * execution path, but it should be accessible by the world. The program
+ * should be prepared to do ~ expansion.
+ * The standard distribution will put nothing in this directory.
+ * After perl has been installed, users may install their own local
+ * architecture-independent modules in this directory with
+ * MakeMaker Makefile.PL
+ * or equivalent. See INSTALL for details.
*/
-/* PERL_PRIo64:
- * This symbol, if defined, contains the string used by stdio to
- * format 64-bit octal numbers (format 'o') for output.
+/* SITELIB_EXP:
+ * This symbol contains the ~name expanded version of SITELIB, to be used
+ * in programs that are not prepared to deal with ~ expansion at run-time.
*/
-/* PERL_PRIx64:
- * This symbol, if defined, contains the string used by stdio to
- * format 64-bit hexadecimal numbers (format 'x') for output.
+#define SITELIB "$sitelib" /**/
+#define SITELIB_EXP "$sitelibexp" /**/
+
+/* Size_t:
+ * This symbol holds the type used to declare length parameters
+ * for string functions. It is usually size_t, but may be
+ * unsigned long, int, etc. It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
*/
-#$d_PRId64 PERL_PRId64 $sPRId64 /**/
-#$d_PRIu64 PERL_PRIu64 $sPRIu64 /**/
-#$d_PRIo64 PERL_PRIo64 $sPRIo64 /**/
-#$d_PRIx64 PERL_PRIx64 $sPRIx64 /**/
+#define Size_t $sizetype /* length paramater for string functions */
-/* SELECT_MIN_BITS:
- * This symbol holds the minimum number of bits operated by select.
- * That is, if you do select(n, ...), how many bits at least will be
- * cleared in the masks if some activity is detected. Usually this
- * is either n or 32*ceil(n/32), especially many little-endians do
- * the latter. This is only useful if you have select(), naturally.
+/* SSize_t:
+ * This symbol holds the type used by functions that return
+ * a count of bytes or an error condition. It must be a signed type.
+ * It is usually ssize_t, but may be long or int, etc.
+ * It may be necessary to include <sys/types.h> or <unistd.h>
+ * to get any typedef'ed information.
+ * We will pick a type such that sizeof(SSize_t) == sizeof(Size_t).
*/
-#define SELECT_MIN_BITS $selectminbits /**/
+#define SSize_t $ssizetype /* signed count of bytes */
/* STARTPERL:
* This variable contains the string to put in front of a perl
#$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY /**/
#define STDIO_STREAM_ARRAY $stdio_stream_array
-/* HAS_STRTOULL:
- * This symbol, if defined, indicates that the strtoull routine is
- * available to convert strings into unsigned long longs.
+/* Uid_t_f:
+ * This symbol defines the format string used for printing a Uid_t.
*/
-#$d_strtoull HAS_STRTOULL /**/
+#define Uid_t_f $uidformat /**/
+
+/* Uid_t_size:
+ * This symbol holds the size of a Uid_t in bytes.
+ */
+#define Uid_t_size $uidsize /* UID size */
+
+/* Uid_t:
+ * This symbol holds the type used to declare user ids in the kernel.
+ * It can be int, ushort, uid_t, etc... It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
+ */
+#define Uid_t $uidtype /* UID type */
/* USE_64_BITS:
- * This symbol, if defined, indicates that 64-bit interfaces should
- * be used when available. If not defined, the native default interfaces
+ * This symbol, if defined, indicates that 64-bit integers should
+ * be used when available. If not defined, the native integers
* will be used (be they 32 or 64 bits).
*/
+#ifndef USE_64_BITS
#$use64bits USE_64_BITS /**/
+#endif
/* USE_LARGE_FILES:
* This symbol, if defined, indicates that large file support
* should be used when available. The USE_64_BITS symbol will
* also be turned on if necessary.
*/
+#ifndef USE_LARGE_FILES
#$uselargefiles USE_LARGE_FILES /**/
+#endif
/* USE_LONG_DOUBLE:
* This symbol, if defined, indicates that long doubles should
* be used when available.
*/
+#ifndef USE_LONG_DOUBLE
#$uselongdouble USE_LONG_DOUBLE /**/
+#endif
+
+/* USE_LONG_LONG:
+ * This symbol, if defined, indicates that long longs should
+ * be used when available.
+ */
+#ifndef USE_LONG_LONG
+#$uselonglong USE_LONG_LONG /**/
+#endif
+
+#ifndef USE_MORE_BITS
+#$usemorebits USE_MORE_BITS /**/
+#endif
/* MULTIPLICITY:
* This symbol, if defined, indicates that Perl should
* be built to use multiplicity.
*/
+#ifndef MULTIPLICTY
#$usemultiplicity MULTIPLICITY /**/
+#endif
/* USE_PERLIO:
* This symbol, if defined, indicates that the PerlIO abstraction should
* be used throughout. If not defined, stdio should be
* used in a fully backward compatible manner.
*/
+#ifndef USE_PERLIO
#$useperlio USE_PERLIO /**/
+#endif
/* USE_SOCKS:
* This symbol, if defined, indicates that Perl should
* be built to use socks.
*/
+#ifndef USE_SOCKS
#$usesocks USE_SOCKS /**/
+#endif
-/* HAS_DRAND48_PROTO:
- * This symbol, if defined, indicates that the system provides
- * a prototype for the drand48() function. Otherwise, it is up
- * to the program to supply one. A good guess is
- * extern double drand48 _((void));
- */
-#$d_drand48proto HAS_DRAND48_PROTO /**/
-
-/* HAS_GETHOST_PROTOS:
- * This symbol, if defined, indicates that <netdb.h> includes
- * prototypes for gethostent(), gethostbyname(), and
- * gethostbyaddr(). Otherwise, it is up to the program to guess
- * them. See netdbtype.U for probing for various Netdb_xxx_t types.
- */
-#$d_gethostprotos HAS_GETHOST_PROTOS /**/
-
-/* HAS_GETNET_PROTOS:
- * This symbol, if defined, indicates that <netdb.h> includes
- * prototypes for getnetent(), getnetbyname(), and
- * getnetbyaddr(). Otherwise, it is up to the program to guess
- * them. See netdbtype.U for probing for various Netdb_xxx_t types.
- */
-#$d_getnetprotos HAS_GETNET_PROTOS /**/
-
-/* HAS_GETPROTO_PROTOS:
- * This symbol, if defined, indicates that <netdb.h> includes
- * prototypes for getprotoent(), getprotobyname(), and
- * getprotobyaddr(). Otherwise, it is up to the program to guess
- * them. See netdbtype.U for probing for various Netdb_xxx_t types.
- */
-#$d_getprotoprotos HAS_GETPROTO_PROTOS /**/
-
-/* HAS_GETSERV_PROTOS:
- * This symbol, if defined, indicates that <netdb.h> includes
- * prototypes for getservent(), getservbyname(), and
- * getservbyaddr(). Otherwise, it is up to the program to guess
- * them. See netdbtype.U for probing for various Netdb_xxx_t types.
- */
-#$d_getservprotos HAS_GETSERV_PROTOS /**/
-
-/* Netdb_host_t:
- * This symbol holds the type used for the 1st argument
- * to gethostbyaddr().
- */
-/* Netdb_hlen_t:
- * This symbol holds the type used for the 2nd argument
- * to gethostbyaddr().
- */
-/* Netdb_name_t:
- * This symbol holds the type used for the argument to
- * gethostbyname().
- */
-/* Netdb_net_t:
- * This symbol holds the type used for the 1st argument to
- * getnetbyaddr().
- */
-#define Netdb_host_t $netdb_host_type /**/
-#define Netdb_hlen_t $netdb_hlen_type /**/
-#define Netdb_name_t $netdb_name_type /**/
-#define Netdb_net_t $netdb_net_type /**/
-
-/* Select_fd_set_t:
- * This symbol holds the type used for the 2nd, 3rd, and 4th
- * arguments to select. Usually, this is 'fd_set *', if HAS_FD_SET
- * is defined, and 'int *' otherwise. This is only useful if you
- * have select(), of course.
- */
-#define Select_fd_set_t $selecttype /**/
-
-/* ARCHNAME:
- * This symbol holds a string representing the architecture name.
- * It may be used to construct an architecture-dependant pathname
- * where library files may be held under a private library, for
- * instance.
- */
-#define ARCHNAME "$archname" /**/
-
-/* OLD_PTHREAD_CREATE_JOINABLE:
- * This symbol, if defined, indicates how to create pthread
- * in joinable (aka undetached) state. NOTE: not defined
- * if pthread.h already has defined PTHREAD_CREATE_JOINABLE
- * (the new version of the constant).
- * If defined, known values are PTHREAD_CREATE_UNDETACHED
- * and __UNDETACHED.
- */
-#$d_old_pthread_create_joinable OLD_PTHREAD_CREATE_JOINABLE $old_pthread_create_joinable /**/
-
-/* HAS_PTHREAD_YIELD:
- * This symbol, if defined, indicates that the pthread_yield
- * routine is available to yield the execution of the current
- * thread. sched_yield is preferable to pthread_yield.
- */
-/* SCHED_YIELD:
- * This symbol defines the way to yield the execution of
- * the current thread. Known ways are sched_yield,
- * pthread_yield, and pthread_yield with NULL.
- */
-/* HAS_SCHED_YIELD:
- * This symbol, if defined, indicates that the sched_yield
- * routine is available to yield the execution of the current
- * thread. sched_yield is preferable to pthread_yield.
- */
-#$d_pthread_yield HAS_PTHREAD_YIELD /**/
-#define SCHED_YIELD $sched_yield /**/
-#$d_sched_yield HAS_SCHED_YIELD /**/
-
-/* I_MACH_CTHREADS:
- * This symbol, if defined, indicates to the C program that it should
- * include <mach/cthreads.h>.
- */
-#$i_machcthr I_MACH_CTHREADS /**/
-
-/* I_PTHREAD:
- * This symbol, if defined, indicates to the C program that it should
- * include <pthread.h>.
+/* USE_ITHREADS:
+ * This symbol, if defined, indicates that Perl should be built to
+ * use the interpreter-based threading implementation.
*/
-#$i_pthread I_PTHREAD /**/
-
-/* USE_THREADS:
- * This symbol, if defined, indicates that Perl should
- * be built to use threads.
+/* USE_5005THREADS:
+ * This symbol, if defined, indicates that Perl should be built to
+ * use the 5.005-based threading implementation.
*/
/* OLD_PTHREADS_API:
* This symbol, if defined, indicates that Perl should
* be built to use the old draft POSIX threads API.
*/
-#$usethreads USE_THREADS /**/
+#$use5005threads USE_5005THREADS /**/
+#$useithreads USE_ITHREADS /**/
+#if defined(USE_5005THREADS) && !defined(USE_ITHREADS)
+#define USE_THREADS /* until src is revised*/
+#endif
#$d_oldpthreads OLD_PTHREADS_API /**/
-/* Time_t:
- * This symbol holds the type returned by time(). It can be long,
- * or time_t on BSD sites (in which case <sys/types.h> should be
- * included).
- */
-#define Time_t $timetype /* Time type */
-
-/* HAS_TIMES:
- * This symbol, if defined, indicates that the times() routine exists.
- * Note that this became obsolete on some systems (SUNOS), which now
- * use getrusage(). It may be necessary to include <sys/times.h>.
- */
-#$d_times HAS_TIMES /**/
-
-/* Fpos_t:
- * This symbol holds the type used to declare file positions in libc.
- * It can be fpos_t, long, uint, etc... It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
- */
-#define Fpos_t $fpostype /* File position type */
-
-/* Gid_t:
- * This symbol holds the return type of getgid() and the type of
- * argument to setrgid() and related functions. Typically,
- * it is the type of group ids in the kernel. It can be int, ushort,
- * uid_t, etc... It may be necessary to include <sys/types.h> to get
- * any typedef'ed information.
- */
-#define Gid_t $gidtype /* Type for getgid(), etc... */
-
-/* Off_t:
- * This symbol holds the type used to declare offsets in the kernel.
- * It can be int, long, off_t, etc... It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
- */
-/* LSEEKSIZE:
- * This symbol holds the number of bytes used by the Off_t.
- */
-#define Off_t $lseektype /* <offset> type */
-#define LSEEKSIZE $lseeksize /* <offset> size */
-
-/* Mode_t:
- * This symbol holds the type used to declare file modes
- * for systems calls. It is usually mode_t, but may be
- * int or unsigned short. It may be necessary to include <sys/types.h>
- * to get any typedef'ed information.
- */
-#define Mode_t $modetype /* file mode parameter for system calls */
-
-/* Pid_t:
- * This symbol holds the type used to declare process ids in the kernel.
- * It can be int, uint, pid_t, etc... It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
- */
-#define Pid_t $pidtype /* PID type */
-
-/* Size_t:
- * This symbol holds the type used to declare length parameters
- * for string functions. It is usually size_t, but may be
- * unsigned long, int, etc. It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
+/* PERL_VENDORLIB_EXP:
+ * This symbol contains the ~name expanded version of VENDORLIB, to be used
+ * in programs that are not prepared to deal with ~ expansion at run-time.
*/
-#define Size_t $sizetype /* length paramater for string functions */
+#$d_vendorlib PERL_VENDORLIB_EXP "$vendorlibexp" /**/
-/* Uid_t:
- * This symbol holds the type used to declare user ids in the kernel.
- * It can be int, ushort, uid_t, etc... It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
+/* VOIDFLAGS:
+ * This symbol indicates how much support of the void type is given by this
+ * compiler. What various bits mean:
+ *
+ * 1 = supports declaration of void
+ * 2 = supports arrays of pointers to functions returning void
+ * 4 = supports comparisons between pointers to void functions and
+ * addresses of void functions
+ * 8 = suports declaration of generic void pointers
+ *
+ * The package designer should define VOIDUSED to indicate the requirements
+ * of the package. This can be done either by #defining VOIDUSED before
+ * including config.h, or by defining defvoidused in Myinit.U. If the
+ * latter approach is taken, only those flags will be tested. If the
+ * level of void support necessary is not present, defines void to int.
*/
-#define Uid_t $uidtype /* UID type */
+#ifndef VOIDUSED
+#define VOIDUSED $defvoidused
+#endif
+#define VOIDFLAGS $voidflags
+#if (VOIDFLAGS & VOIDUSED) != VOIDUSED
+#define void int /* is void to be avoided? */
+#define M_VOID /* Xenix strikes again */
+#endif
#endif
!GROK!THIS!
$!
$! That's it. If you get into a bind trying to build perl on VMS then
$! definitely read through the README.VMS file.
-$! Beyond that send email to VMSPerl@cor.newman.upenn.edu
+$! Beyond that send email to vmsperl@perl.org
$!
$! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$!
$!
$! Adapted and converted from Larry Wall & Andy Dougherty's
$! "Configure generated by metaconfig 3.0 PL60." by Peter Prymmer
-$! (a Bourne sh[ell] script for configuring the installation of perl on VMS)
-$! in the perl5.002|3 epoch (spring/summer 1996)
+$! (a Bourne sh[ell] script for configuring the installation of perl
+$! on non-VMS systems) in the perl5.002|3 epoch (spring/summer 1996)
$! with much valuable help from Charles Bailey &
$! the whole VMSPerl crew.
$! Extended and messed about with by Dan Sugalski
$ macros = ""
$ use_vmsdebug_perl = "N"
$ use_debugging_perl = "Y"
-$ use_64bit = "N"
+$ use_64bit = "n"
$ C_Compiler_Replace = "CC="
$ Thread_Live_Dangerously = "MT="
$ use_two_pot_malloc = "N"
$ file_2_find = dirname + basename
$!
$ found = F$SEARCH(file_2_find)
+$ IF (found .EQS. "" .AND. dots .GT. 2)
+$ THEN
+$! 17-DEC-1999 Improved to turn "[.foo.bar]baz.c_buz" into
+$! "[.foo.bar]baz_c.buz" to cover unzipped archives and put
+$! "[.foo.bar]baz.c_buz,baz_c.buz" into missing list if neither is found.
+$ basename[f$locate(".",basename),1] := _
+$ dot_ele = F$ELEMENT(dots - 1,"_",basename)
+$ basename = -
+ f$extract(0,f$length(basename)-(f$length(dot_ele)+1),basename) -
+ + "." + dot_ele
+$ found = F$SEARCH(dirname + basename)
+$ file_2_find = file_2_find + "," + basename
+$ ENDIF
$ IF (found .EQS. "")
$ THEN
$ WRITE MISSING file_2_find
%Config-E-VMS, ERROR:
Err, you do not appear to be running VMS!
- This package is intended to Configure the building of Perl for VMS.
+ This procedure is intended to Configure the building of Perl for VMS.
$ READ SYS$COMMAND/PROMPT="Continue anyway? [n] " ans
$ IF ans
$TZSet:
$ echo ""
$ echo "Please tell me in hh:mm form what time offset from GMT/UTC in England"
-$ echo "you are. As an example Eastern (US) Standard Time is -5:00 offset, but"
+$ echo "you are. As an example Eastern (US) Standard Time is -5:00 offset, but"
$ echo "Eastern Daylight Time (summer) is -4:00 offset."
$ dflt = "0:00"
$ rp = "Enter the Time Zone offset: [''dflt'] "
$ IF (F$GETSYI("HW_MODEL") .LT. 1024)
$ THEN
$ archname = "VMS_VAX"
+$ otherarch = "an Alpha"
$ ELSE
$ archname = "VMS_AXP"
+$ otherarch = "a VAX"
$ ENDIF
$ rp = "What is your architecture name? [''archname'] "
$ GOSUB myread
$ echo4 "I'll go with ''archname' anyway..."
$ ENDIF
$ ENDIF
-$ IF (archname.EQS."VMS_AXP")
+$ dflt = "n"
+$ rp = "Will you be sharing your PERL_ROOT with ''otherarch'? [''dflt'] "
+$ GOSUB myread
+$ if ans.NES.""
$ THEN
-$ dflt = "n"
-$ rp = "Are you sharing your PERL_ROOT with a VAX? [''dflt'] "
-$ GOSUB myread
-$ if ans.NES.""
-$ THEN
-$ ans = F$EDIT(ans,"COLLAPSE, UPCASE")
-$ ENDIF
-$ IF (ans.NES."Y")
+$ ans = F$EXTRACT(0,1,F$EDIT(ans,"COLLAPSE, UPCASE"))
+$ ENDIF
+$ IF (ans.NES."Y")
+$ THEN
+$ sharedperl = "N"
+$ ELSE
+$ sharedperl = "Y"
+$ IF (archname.EQS."VMS_AXP")
$ THEN
-$ sharedperl = "N"
-$ ELSE
-$ sharedperl = "Y"
$ macros = macros + """AXE=1"","
$ ENDIF
-$ ELSE
-$ sharedperl = "N"
$ ENDIF
$!
$!: is AFS running? !sfn
$ ENDIF !%Config-I-VMS, skip "where install" questions
$!
$!: set the base revision
-$ baserev="5.0"
+$ baserev="5"
$!: get the patchlevel
$ echo ""
$ echo4 "Getting the current patchlevel..." !>&4
$ ELSE subversion = ""
$ ENDIF
$!
-$ version = F$EXTRACT(0,1,baserev) + "_" + patchlevel + subversion
+$ version = baserev + "_" + patchlevel + "_" + subversion
$!
$ IF (.NOT.vms_skip_install)
$ THEN
is most probably close to the reality but may not be valid from outside
your organization...
$ ENDIF
-$ dflt = "''cf_by@''myhostname'"+"''mydomain'"
+$ dflt = "''cf_by'@''myhostname'"+"''mydomain'"
$ rp = "What is your e-mail address? [''dflt'] "
$ GOSUB myread
$ IF ans .nes. ""
$!
$!
$! Ask if they want to build with VMS_DEBUG perl
+$ echo ""
$ echo "Perl can be built to run under the VMS debugger."
$ echo "You should only select this option if you are debugging"
$ echo "perl itself. This can be a useful feature if you are "
$ echo "embedding perl in a program."
-$ echo ""
-$ dflt = "N"
+$ dflt = "n"
$ rp = "Build a VMS-DEBUG version of Perl? [''dflt'] "
$ GOSUB myread
-$ if ans.eqs."" then ans = dflt
-$ if (f$extract(0, 1, "''ans'").eqs."Y").or.(f$extract(0, 1, "''ans'").eqs."y")
+$ IF ans.eqs."" then ans = dflt
+$ IF F$EXTRACT(0, 1, F$EDIT(ans,"COLLAPSE,UPCASE")) .eqs. "Y"
$ THEN
$ use_vmsdebug_perl = "Y"
$ macros = macros + """__DEBUG__=1"","
$ ENDIF
$!
$! Ask if they want to build with MULTIPLICITY
+$ echo ""
$ echo "The perl interpreter engine can be built in a way that makes it
-$ echo "possible for a program that embeds perl into it (and yep, you can
+$ echo "possible for a program that embeds perl into it (and yes, you can
$ echo "do that--it's pretty keen) to have multiple perl interpreters active
$ echo "at once. There is some performance overhead, however, so you
$ echo "probably don't want to choose this unless you're going to be doing
$ echo "funky perl embedding."
-$ echo ""
$ dflt = "n"
$ rp = "Build with MULTIPLICITY? [''dflt'] "
$ GOSUB myread
-$ if ans.eqs."" then ans = dflt
-$ if (f$extract(0, 1, "''ans'").eqs."Y").or.(f$extract(0, 1, "''ans'").eqs."y")
+$ if ans.eqs."" then ans = dflt
+$ IF F$EXTRACT(0, 1, F$EDIT(ans,"COLLAPSE,UPCASE")) .eqs. "Y"
$ THEN
$ use_multiplicity="Y"
$ ELSE
$! Ask if they want to build with 64-bit support
$ if (Archname.eqs."VMS_AXP").and.("''f$extract(1,3, f$getsyi(""version""))'".ges."7.1")
$ THEN
-$ echo "This version of perl has experimental support for building wtih
-$ echo "64 bit integers and 128 bit floating point variables. This gives
-$ echo "a much larger range for perl's mathematical operations. (Note that
-$ echo "does *not* enable 64-bit fileops at the moment, as Dec C doesn't
-$ echo "do that yet)"
$ echo ""
-$ dflt = use_64bit
-$ rp = "Build with 64 bits? [''dflt'] "
-$ GOSUB myread
-$ if ans.eqs."" then ans = dflt
-$ if (f$extract(0, 1, "''ans'").eqs."Y").or.(f$extract(0, 1, "''ans'").eqs."y")
-$ THEN
-$ use_64bit="Y"
-$ ELSE
-$ use_64bit="N"
-$ ENDIF
-$ ENDIF
-$!
-$! Ask if they want to build with 64-bit support
-$ if (Archname.eqs."VMS_AXP").and.("''f$extract(1,3, f$getsyi(""version""))'".ges."7.1")
-$ THEN
-$ echo "This version of perl has experimental support for building wtih
+$ echo "This version of perl has experimental support for building with
$ echo "64 bit integers and 128 bit floating point variables. This gives
$ echo "a much larger range for perl's mathematical operations. (Note that
$ echo "does *not* enable 64-bit fileops at the moment, as Dec C doesn't
$ echo "do that yet)"
-$ echo ""
$ dflt = use_64bit
$ rp = "Build with 64 bits? [''dflt'] "
$ GOSUB myread
-$ if ans.eqs."" then ans = dflt
+$ if ans.eqs."" then ans = dflt
$ if (f$extract(0, 1, "''ans'").eqs."Y").or.(f$extract(0, 1, "''ans'").eqs."y")
$ THEN
$ use_64bit="Y"
$ use_64bit="N"
$ ENDIF
$ ENDIF
+$!
$! Ask about threads, if appropriate
$ if (Using_Dec_C.eqs."Yes")
$ THEN
+$ echo ""
$ echo "This version of Perl can be built with threads. While really nifty,
$ echo "they are a beta feature, and there is a speed penalty for perl
$ echo "programs if you build with threads *even if you don't use them*
-$ echo ""
$ dflt = "n"
$ rp = "Build with threads? [''dflt'] "
$ GOSUB myread
$ echo "machine. Unfortunately this feature isn't safe on an
$ echo "unpatched 7.1 system. (Several OS patches were required when
$ echo "this procedure was written)
-$ echo ""
$ dflt = "n"
$ rp = "Enable multiple kernel threads and upcalls? [''dflt'] "
$ gosub myread
$ echo "logical name translation during parsing of file specifications;"
$ echo "these always use the normal sequence of access modes for logical"
$ echo "name translation."
-$ echo ""
$ dflt = "n"
$ rp = "Use secure logical name translation? [''dflt'] "
$ GOSUB myread
$ echo "file types of nothing, .pl, and .com, in that order (e.g. typing"
$ echo """$ perl foo"" would cause Perl to look for foo., then foo.pl, and"
$ echo "finally foo.com)."
-$ echo ""
$ dflt = "n"
$ rp = "Always use default file types? [''dflt'] "
$ GOSUB myread
$ if ans.eqs."" then ans="''dflt'"
-$ d_alwdeftype = f$extract(0, 1, f$edit(ans,"TRIM,COMPRESS,UPCASE"))
+$ d_alwdeftype = f$extract(0, 1, f$edit(ans,"COLLAPSE,UPCASE"))
$!
$! Ask if they want to use perl's memory allocator
$ echo ""
$ echo "normal memory usage. It's oftentimes better than the standard
$ echo "system memory allocator. It also has the advantage of providing
$ echo "memory allocation statistics, if you choose to enable them.
-$ echo ""
$ dflt = "n"
$ rp = "Build with perl's memory allocator? [''dflt'] "
$ GOSUB myread
$ if ans.eqs."" then ans="''dflt'"
-$ mymalloc = f$extract(0, 1, f$edit(ans,"TRIM,COMPRESS,UPCASE"))
+$ mymalloc = f$extract(0, 1, f$edit(ans,"COLLAPSE,UPCASE"))
$ if mymalloc.eqs."Y"
$ THEN
$ if use_debugging_perl.eqs."Y"
$ echo "Perl can keep statistics on memory usage if you choose to use
$ echo "them. This is useful for debugging, but does have some
$ echo "performance overhead.
-$ echo ""
$ dflt = "n"
$ rp = "Do you want the debugging memory allocator? [''dflt'] "
$ gosub myread
$ if ans.eqs."" then ans="''dflt'"
-$ use_debugmalloc = f$extract(0, 1, f$edit(ans, "TRIM,COMPRESS,UPCASE"))
+$ use_debugmalloc = f$extract(0, 1, f$edit(ans, "COLLAPSE,UPCASE"))
$ ENDIF
$ ! Check which memory allocator we want
$ echo ""
$ echo "memory for smaller allocations). They're all good, but if your
$ echo "usage tends towards larger chunks use TWO_POT, otherwise use
$ echo "PACK_MALLOC."
-$ echo ""
$ dflt = "DEFAULT"
$ rp = "Memory allocator (DEFAULT, TWO_POT, PACK_MALLOC) [''dflt'] "
$ GOSUB myread
$ echo "SDBM_File if you have the GDBM library built on your machine
$ echo "
$ echo "Which modules do you want to build into perl?"
-$! dflt = "Fcntl Errno IO Opcode Byteloader Devel::Peek Devel::DProf Data::Dumper attrs re VMS::Stdio VMS::DCLsym B SDBM_File"
-$ dflt = "Fcntl Errno IO Opcode Devel::Peek Devel::DProf Data::Dumper attrs re VMS::Stdio VMS::DCLsym B SDBM_File"
+$! dflt = "Fcntl Errno File::Glob IO Opcode Byteloader Devel::Peek Devel::DProf Data::Dumper attrs re VMS::Stdio VMS::DCLsym B SDBM_File"
+$ dflt = "Fcntl Errno File::Glob IO Opcode Devel::Peek Devel::DProf Data::Dumper attrs re VMS::Stdio VMS::DCLsym B SDBM_File"
$ if Using_Dec_C.eqs."Yes"
$ THEN
$ dflt = dflt + " POSIX"
$ @subconfigure
$ SET DEFAULT 'dflt
$!
-$! Warn of dangerous logical names
+$! Warn of dangerous symbols or logical names
$!
-$Bad_logical: SUBROUTINE
-$ IF f$trnlnm(p1) .nes. ""
+$Bad_environment: SUBROUTINE
+$ Bad_env = ""
+$ IF p2 .eqs. "SYMBOL"
+$ THEN
+$ IF f$type('p1) .nes. "" THEN Bad_env := SYMBOL
+$ ELSE
+$ IF f$trnlnm(p1) .nes. "" THEN Bad_env := LOGICAL
+$ ENDIF
+$ IF Bad_env .eqs. "SYMBOL" .or. Bad_env .eqs. "LOGICAL"
$ THEN
$ IF f$search("config.msg") .nes. ""
$ THEN
$ ELSE
$ OPEN/WRITE CONFIG config.msg
$ ENDIF
-$ WRITE CONFIG "Logical name ''p1' found in environment as " + f$trnlnm(p1)
-$ WRITE CONFIG " deassign before building ''package'"
+$ IF Bad_env .eqs. "SYMBOL"
+$ THEN
+$ WRITE CONFIG ""
+$ WRITE CONFIG "Symbol name ''p1' found in environment as " + &p1
+$ WRITE CONFIG " delete before building ''package' via:"
+$ WRITE CONFIG " $ DELETE/SYMBOL/GLOBAL ''p1'"
+$ IF f$locate("""",&p1) .ge. f$length(&p1)
+$ THEN
+$ WRITE CONFIG " after building, testing, and installing ''package'
+$ WRITE CONFIG " restore the symbol with:"
+$ WRITE CONFIG " $ ''p1' == """ + &p1 + """"
+$ ENDIF
+$ ENDIF
+$ IF Bad_env .eqs. "LOGICAL"
+$ THEN
+$ WRITE CONFIG ""
+$ WRITE CONFIG "Logical name ''p1' found in environment as " + f$trnlnm(p1)
+$ WRITE CONFIG " deassign before building ''package'"
+$ ENDIF
$ CLOSE CONFIG
+$ Bad_env = ""
$ ENDIF
$ EXIT
-$ ENDSUBROUTINE ! Bad_logical
+$ ENDSUBROUTINE ! Bad_environment
$ echo ""
-$ echo4 "%Config-I-VMS, Checking for dangerous pre extant logical names."
-$ CALL Bad_logical "TMP"
-$ CALL Bad_logical "LIB"
-$ CALL Bad_logical "T"
-$ CALL Bad_logical "FOO"
-$ CALL Bad_logical "EXT"
+$ echo4 "%Config-I-VMS, Checking for dangerous pre extant global symbols and logical names."
+$ CALL Bad_environment "TMP"
+$ CALL Bad_environment "LIB"
+$ CALL Bad_environment "T"
+$ CALL Bad_environment "FOO"
+$ CALL Bad_environment "EXT"
+$ CALL Bad_environment "TEST" "SYMBOL"
$ IF f$search("config.msg") .eqs. "" THEN echo "OK."
$!
$! %Config-I-VMS, write perl_setup.com here
struct cop {
BASEOP
char * cop_label; /* label for this construct */
+#ifdef USE_ITHREADS
+ char * cop_stashpv; /* package line was compiled in */
+ char * cop_file; /* file name the following line # is from */
+#else
HV * cop_stash; /* package line was compiled in */
GV * cop_filegv; /* file the following line # is from */
+#endif
U32 cop_seq; /* parse sequence number */
I32 cop_arybase; /* array base this line was compiled with */
line_t cop_line; /* line # of this command */
#define Nullcop Null(COP*)
+#ifdef USE_ITHREADS
+# define CopFILE(c) ((c)->cop_file)
+# define CopFILEGV(c) (CopFILE(c) \
+ ? gv_fetchfile(CopFILE(c)) : Nullgv)
+# define CopFILE_set(c,pv) ((c)->cop_file = savepv(pv)) /* XXX */
+# define CopFILESV(c) (CopFILE(c) \
+ ? GvSV(gv_fetchfile(CopFILE(c))) : Nullsv)
+# define CopFILEAV(c) (CopFILE(c) \
+ ? GvAV(gv_fetchfile(CopFILE(c))) : Nullav)
+# define CopSTASHPV(c) ((c)->cop_stashpv)
+# define CopSTASHPV_set(c,pv) ((c)->cop_stashpv = savepv(pv)) /* XXX */
+# define CopSTASH(c) (CopSTASHPV(c) \
+ ? gv_stashpv(CopSTASHPV(c),GV_ADD) : Nullhv)
+# define CopSTASH_set(c,hv) CopSTASHPV_set(c, HvNAME(hv))
+# define CopSTASH_eq(c,hv) (hv \
+ && (CopSTASHPV(c) == HvNAME(hv) \
+ || (CopSTASHPV(c) && HvNAME(hv) \
+ && strEQ(CopSTASHPV(c), HvNAME(hv)))))
+#else
+# define CopFILEGV(c) ((c)->cop_filegv)
+# define CopFILEGV_set(c,gv) ((c)->cop_filegv = gv)
+# define CopFILE_set(c,pv) ((c)->cop_filegv = gv_fetchfile(pv))
+# define CopFILESV(c) (CopFILEGV(c) ? GvSV(CopFILEGV(c)) : Nullsv)
+# define CopFILEAV(c) (CopFILEGV(c) ? GvAV(CopFILEGV(c)) : Nullav)
+# define CopFILE(c) (CopFILESV(c) ? SvPVX(CopFILESV(c)) : Nullch)
+# define CopSTASH(c) ((c)->cop_stash)
+# define CopSTASH_set(c,hv) ((c)->cop_stash = hv)
+# define CopSTASHPV(c) (CopSTASH(c) ? HvNAME(CopSTASH(c)) : Nullch)
+# define CopSTASHPV_set(c,pv) CopSTASH_set(c, gv_stashpv(pv,GV_ADD))
+# define CopSTASH_eq(c,hv) (CopSTASH(c) == hv)
+#endif /* USE_ITHREADS */
+
+#define CopSTASH_ne(c,hv) (!CopSTASH_eq(c,hv))
+#define CopLINE(c) ((c)->cop_line)
+#define CopLINE_inc(c) (++CopLINE(c))
+#define CopLINE_dec(c) (--CopLINE(c))
+#define CopLINE_set(c,l) (CopLINE(c) = (l))
+
/*
* Here we have some enormously heavy (or at least ponderous) wizardry.
*/
cx->blk_sub.dfoutgv = PL_defoutgv; \
(void)SvREFCNT_inc(cx->blk_sub.dfoutgv)
-#define POPSUB(cx) \
- { struct block_sub cxsub; \
- POPSUB1(cx); \
- POPSUB2(); }
-
-#define POPSUB1(cx) \
- cxsub = cx->blk_sub; /* because DESTROY may clobber *cx */
-
#ifdef USE_THREADS
-#define POPSAVEARRAY() NOOP
+# define POP_SAVEARRAY() NOOP
#else
-#define POPSAVEARRAY() \
+# define POP_SAVEARRAY() \
STMT_START { \
SvREFCNT_dec(GvAV(PL_defgv)); \
- GvAV(PL_defgv) = cxsub.savearray; \
+ GvAV(PL_defgv) = cx->blk_sub.savearray; \
} STMT_END
#endif /* USE_THREADS */
-#define POPSUB2() \
- if (cxsub.hasargs) { \
- POPSAVEARRAY(); \
+#ifdef USE_ITHREADS
+ /* junk in @_ spells trouble when cloning CVs, so don't leave any */
+# define CLEAR_ARGARRAY() av_clear(cx->blk_sub.argarray)
+#else
+# define CLEAR_ARGARRAY() NOOP
+#endif /* USE_ITHREADS */
+
+
+#define POPSUB(cx,sv) \
+ STMT_START { \
+ if (cx->blk_sub.hasargs) { \
+ POP_SAVEARRAY(); \
/* abandon @_ if it got reified */ \
- if (AvREAL(cxsub.argarray)) { \
- SSize_t fill = AvFILLp(cxsub.argarray); \
- SvREFCNT_dec(cxsub.argarray); \
- cxsub.argarray = newAV(); \
- av_extend(cxsub.argarray, fill); \
- AvFLAGS(cxsub.argarray) = AVf_REIFY; \
- PL_curpad[0] = (SV*)cxsub.argarray; \
+ if (AvREAL(cx->blk_sub.argarray)) { \
+ SSize_t fill = AvFILLp(cx->blk_sub.argarray); \
+ SvREFCNT_dec(cx->blk_sub.argarray); \
+ cx->blk_sub.argarray = newAV(); \
+ av_extend(cx->blk_sub.argarray, fill); \
+ AvFLAGS(cx->blk_sub.argarray) = AVf_REIFY; \
+ PL_curpad[0] = (SV*)cx->blk_sub.argarray; \
+ } \
+ else { \
+ CLEAR_ARGARRAY(); \
} \
} \
- if (cxsub.cv) { \
- if (!(CvDEPTH(cxsub.cv) = cxsub.olddepth)) \
- SvREFCNT_dec(cxsub.cv); \
- }
+ sv = (SV*)cx->blk_sub.cv; \
+ if (sv && (CvDEPTH((CV*)sv) = cx->blk_sub.olddepth)) \
+ sv = Nullsv; \
+ } STMT_END
+
+#define LEAVESUB(sv) \
+ STMT_START { \
+ if (sv) \
+ SvREFCNT_dec(sv); \
+ } STMT_END
#define POPFORMAT(cx) \
setdefout(cx->blk_sub.dfoutgv); \
#define PUSHEVAL(cx,n,fgv) \
cx->blk_eval.old_in_eval = PL_in_eval; \
- cx->blk_eval.old_op_type = PL_op->op_type; \
- cx->blk_eval.old_name = n; \
- cx->blk_eval.old_eval_root = PL_eval_root; \
+ cx->blk_eval.old_op_type = PL_op->op_type; \
+ cx->blk_eval.old_name = (n ? savepv(n) : Nullch); \
+ cx->blk_eval.old_eval_root = PL_eval_root; \
cx->blk_eval.cur_text = PL_linestr;
#define POPEVAL(cx) \
PL_in_eval = cx->blk_eval.old_in_eval; \
optype = cx->blk_eval.old_op_type; \
- PL_eval_root = cx->blk_eval.old_eval_root;
+ PL_eval_root = cx->blk_eval.old_eval_root; \
+ Safefree(cx->blk_eval.old_name);
/* loop context */
struct block_loop {
OP * redo_op;
OP * next_op;
OP * last_op;
+#ifdef USE_ITHREADS
+ void * iterdata;
+#else
SV ** itervar;
+#endif
SV * itersave;
SV * iterlval;
AV * iterary;
IV itermax;
};
-#define PUSHLOOP(cx, ivar, s) \
- cx->blk_loop.label = PL_curcop->cop_label; \
- cx->blk_loop.resetsp = s - PL_stack_base; \
+#ifdef USE_ITHREADS
+# define CxITERVAR(c) \
+ ((c)->blk_loop.iterdata \
+ ? (CxPADLOOP(cx) \
+ ? &PL_curpad[(PADOFFSET)(c)->blk_loop.iterdata] \
+ : &GvSV((GV*)(c)->blk_loop.iterdata)) \
+ : (SV**)NULL)
+# define CX_ITERDATA_SET(cx,idata) \
+ if (cx->blk_loop.iterdata = (idata)) \
+ cx->blk_loop.itersave = SvREFCNT_inc(*CxITERVAR(cx));
+#else
+# define CxITERVAR(c) ((c)->blk_loop.itervar)
+# define CX_ITERDATA_SET(cx,ivar) \
+ if (cx->blk_loop.itervar = (SV**)(ivar)) \
+ cx->blk_loop.itersave = SvREFCNT_inc(*CxITERVAR(cx));
+#endif
+
+#define PUSHLOOP(cx, dat, s) \
+ cx->blk_loop.label = PL_curcop->cop_label; \
+ cx->blk_loop.resetsp = s - PL_stack_base; \
cx->blk_loop.redo_op = cLOOP->op_redoop; \
cx->blk_loop.next_op = cLOOP->op_nextop; \
cx->blk_loop.last_op = cLOOP->op_lastop; \
- if (cx->blk_loop.itervar = (ivar)) \
- cx->blk_loop.itersave = SvREFCNT_inc(*cx->blk_loop.itervar);\
cx->blk_loop.iterlval = Nullsv; \
cx->blk_loop.iterary = Nullav; \
- cx->blk_loop.iterix = -1;
+ cx->blk_loop.iterix = -1; \
+ CX_ITERDATA_SET(cx,dat);
#define POPLOOP(cx) \
- { struct block_loop cxloop; \
- POPLOOP1(cx); \
- POPLOOP2(); }
-
-#define POPLOOP1(cx) \
- cxloop = cx->blk_loop; /* because DESTROY may clobber *cx */ \
- newsp = PL_stack_base + cxloop.resetsp;
-
-#define POPLOOP2() \
- SvREFCNT_dec(cxloop.iterlval); \
- if (cxloop.itervar) { \
- sv_2mortal(*cxloop.itervar); \
- *cxloop.itervar = cxloop.itersave; \
+ SvREFCNT_dec(cx->blk_loop.iterlval); \
+ if (CxITERVAR(cx)) { \
+ SV **s_v_p = CxITERVAR(cx); \
+ sv_2mortal(*s_v_p); \
+ *s_v_p = cx->blk_loop.itersave; \
} \
- if (cxloop.iterary && cxloop.iterary != PL_curstack) \
- SvREFCNT_dec(cxloop.iterary);
+ if (cx->blk_loop.iterary && cx->blk_loop.iterary != PL_curstack)\
+ SvREFCNT_dec(cx->blk_loop.iterary);
/* context common to subroutines, evals and loops */
struct block {
cx->blk_oldretsp = PL_retstack_ix, \
cx->blk_oldpm = PL_curpm, \
cx->blk_gimme = gimme; \
- DEBUG_l( PerlIO_printf(PerlIO_stderr(), "Entering block %ld, type %s\n", \
+ DEBUG_l( PerlIO_printf(Perl_debug_log, "Entering block %ld, type %s\n", \
(long)cxstack_ix, PL_block_type[CxTYPE(cx)]); )
/* Exit a block (RETURN and LAST). */
PL_retstack_ix = cx->blk_oldretsp, \
pm = cx->blk_oldpm, \
gimme = cx->blk_gimme; \
- DEBUG_l( PerlIO_printf(PerlIO_stderr(), "Leaving block %ld, type %s\n", \
+ DEBUG_l( PerlIO_printf(Perl_debug_log, "Leaving block %ld, type %s\n", \
(long)cxstack_ix+1,PL_block_type[CxTYPE(cx)]); )
/* Continue a block elsewhere (NEXT and REDO). */
#define CXt_LOOP 3
#define CXt_SUBST 4
#define CXt_BLOCK 5
+#define CXt_FORMAT 6
/* private flags for CXt_EVAL */
#define CXp_REAL 0x00000100 /* truly eval'', not a lookalike */
+#ifdef USE_ITHREADS
+/* private flags for CXt_LOOP */
+# define CXp_PADVAR 0x00000100 /* itervar lives on pad, iterdata
+ has pad offset; if not set,
+ iterdata holds GV* */
+# define CxPADLOOP(c) (((c)->cx_type & (CXt_LOOP|CXp_PADVAR)) \
+ == (CXt_LOOP|CXp_PADVAR))
+#endif
+
#define CxTYPE(c) ((c)->cx_type & CXTYPEMASK)
-#define CxREALEVAL(c) (((c)->cx_type & (CXt_EVAL|CXp_REAL)) == (CXt_EVAL|CXp_REAL))
+#define CxREALEVAL(c) (((c)->cx_type & (CXt_EVAL|CXp_REAL)) \
+ == (CXt_EVAL|CXp_REAL))
#define CXINC (cxstack_ix < cxstack_max ? ++cxstack_ix : (cxstack_ix = cxinc()))
#define G_NOARGS 8 /* Don't construct a @_ array. */
#define G_KEEPERR 16 /* Append errors to $@, don't overwrite it */
#define G_NODEBUG 32 /* Disable debugging at toplevel. */
-#define G_NOCATCH 64 /* Don't do CATCH_SET() */
/* flag bits for PL_in_eval */
#define EVAL_NULL 0 /* not in an eval */
I32 si_type; /* type of runlevel */
struct stackinfo * si_prev;
struct stackinfo * si_next;
- I32 * si_markbase; /* where markstack begins for us.
+ I32 si_markoff; /* offset where markstack begins for us.
* currently used only with DEBUGGING,
* but not #ifdef-ed for bincompat */
};
#define cxstack_max (PL_curstackinfo->si_cxmax)
#ifdef DEBUGGING
-# define SET_MARKBASE PL_curstackinfo->si_markbase = PL_markstack_ptr
+# define SET_MARK_OFFSET \
+ PL_curstackinfo->si_markoff = PL_markstack_ptr - PL_markstack
#else
-# define SET_MARKBASE NOOP
+# define SET_MARK_OFFSET NOOP
#endif
#define PUSHSTACKi(type) \
AvFILLp(next->si_stack) = 0; \
SWITCHSTACK(PL_curstack,next->si_stack); \
PL_curstackinfo = next; \
- SET_MARKBASE; \
+ SET_MARK_OFFSET; \
} STMT_END
#define PUSHSTACK PUSHSTACKi(PERLSI_UNKNOWN)
djSP; \
PERL_SI *prev = PL_curstackinfo->si_prev; \
if (!prev) { \
- PerlIO_printf(PerlIO_stderr(), "panic: POPSTACK\n"); \
+ PerlIO_printf(Perl_error_log, "panic: POPSTACK\n"); \
my_exit(1); \
} \
SWITCHSTACK(PL_curstack,prev->si_stack); \
*
*/
-/* This structure much match the beginning of XPVFM */
+/* This structure much match XPVCV in B/C.pm and the beginning of XPVFM
+ * in sv.h */
struct xpvcv {
char * xpv_pv; /* pointer to malloced string */
void (*xcv_xsub) (pTHXo_ CV*);
ANY xcv_xsubany;
GV * xcv_gv;
- GV * xcv_filegv;
- long xcv_depth; /* >= 2 indicates recursive call */
+ char * xcv_file;
+ long xcv_depth; /* >= 2 indicates recursive call */
AV * xcv_padlist;
CV * xcv_outside;
#ifdef USE_THREADS
#define CvXSUB(sv) ((XPVCV*)SvANY(sv))->xcv_xsub
#define CvXSUBANY(sv) ((XPVCV*)SvANY(sv))->xcv_xsubany
#define CvGV(sv) ((XPVCV*)SvANY(sv))->xcv_gv
-#define CvFILEGV(sv) ((XPVCV*)SvANY(sv))->xcv_filegv
+#define CvFILE(sv) ((XPVCV*)SvANY(sv))->xcv_file
+#define CvFILEGV(sv) (gv_fetchfile(CvFILE(sv))
#define CvDEPTH(sv) ((XPVCV*)SvANY(sv))->xcv_depth
#define CvPADLIST(sv) ((XPVCV*)SvANY(sv))->xcv_padlist
#define CvOUTSIDE(sv) ((XPVCV*)SvANY(sv))->xcv_outside
# build problems but that's not obvious to the novice.
# The Module used here must not depend on Config or any extensions.
-miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL)s$(LIB_EXT)
- $(LDLIBPTH) $(CC) $(LARGE) $(CLDFLAGS) -o miniperl miniperlmain$(OBJ_EXT) $(LLIBPERL)s $(libs)
- $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e 0 || $(MAKE) minitest
+miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL)s$(LIB_EXT) opmini$(OBJ_EXT)
+ $(LDLIBPTH) $(CC) $(LARGE) $(CLDFLAGS) -o miniperl miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) $(LLIBPERL)s $(libs)
+ $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
!NO!SUBS!
;;
# build problems but that's not obvious to the novice.
# The Module used here must not depend on Config or any extensions.
-miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL)$(LIB_EXT)
- $(LDLIBPTH) $(CC) $(LARGE) $(CLDFLAGS) -o miniperl miniperlmain$(OBJ_EXT) $(LLIBPERL) $(libs)
- $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e 0 || $(MAKE) minitest
+miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL)$(LIB_EXT) opmini$(OBJ_EXT)
+ $(LDLIBPTH) $(CC) $(LARGE) $(CLDFLAGS) -o miniperl miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) $(LLIBPERL) $(libs)
+ $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
!NO!SUBS!
;;
#
$spitshell >>Makefile <<'!NO!SUBS!'
+opmini$(OBJ_EXT) : op.c
+ $(CCCMD) $(PLDLFLAGS) -DPERL_EXTERNAL_GLOB -o opmini$(OBJ_EXT) op.c
+
perl: $& perlmain$(OBJ_EXT) $(LIBPERL)$(LIB_EXT) $(DYNALOADER) $(static_ext) ext.libs
$(SHRPENV) $(LDLIBPTH) $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o perl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
#ifdef DEBUGGING
dTHR;
register I32 i;
- GV* gv = PL_curcop->cop_filegv;
+ char* file = CopFILE(PL_curcop);
#ifdef USE_THREADS
- PerlIO_printf(Perl_debug_log, "0x%lx (%s:%ld)\t",
- (unsigned long) thr,
- SvTYPE(gv) == SVt_PVGV ? SvPVX(GvSV(gv)) : "<free>",
- (long)PL_curcop->cop_line);
+ PerlIO_printf(Perl_debug_log, "0x%"UVxf" (%s:%ld)\t",
+ PTR2UV(thr),
+ (file ? file : "<free>"),
+ (long)CopLINE(PL_curcop));
#else
- PerlIO_printf(Perl_debug_log, "(%s:%ld)\t",
- SvTYPE(gv) == SVt_PVGV ? SvPVX(GvSV(gv)) : "<free>",
- (long)PL_curcop->cop_line);
+ PerlIO_printf(Perl_debug_log, "(%s:%ld)\t", (file ? file : "<free>"),
+ (long)CopLINE(PL_curcop));
#endif /* USE_THREADS */
- for (i=0; i<PL_dlevel; i++)
- PerlIO_printf(Perl_debug_log, "%c%c ",PL_debname[i],PL_debdelim[i]);
(void) PerlIO_vprintf(Perl_debug_log, pat, *args);
#endif /* DEBUGGING */
}
-void
-Perl_deb_growlevel(pTHX)
-{
-#ifdef DEBUGGING
- PL_dlmax += 128;
- Renew(PL_debname, PL_dlmax, char);
- Renew(PL_debdelim, PL_dlmax, char);
-#endif /* DEBUGGING */
-}
-
I32
Perl_debstackptrs(pTHX)
{
#ifdef DEBUGGING
dTHR;
- PerlIO_printf(Perl_debug_log, "%8lx %8lx %8ld %8ld %8ld\n",
- (unsigned long)PL_curstack, (unsigned long)PL_stack_base,
- (long)*PL_markstack_ptr, (long)(PL_stack_sp-PL_stack_base),
- (long)(PL_stack_max-PL_stack_base));
- PerlIO_printf(Perl_debug_log, "%8lx %8lx %8ld %8ld %8ld\n",
- (unsigned long)PL_mainstack, (unsigned long)AvARRAY(PL_curstack),
- (long)PL_mainstack, (long)AvFILLp(PL_curstack), (long)AvMAX(PL_curstack));
+ PerlIO_printf(Perl_debug_log,
+ "%8"UVxf" %8"UVxf" %8"IVdf" %8"IVdf" %8"IVdf"\n",
+ PTR2UV(PL_curstack), PTR2UV(PL_stack_base),
+ (IV)*PL_markstack_ptr, (IV)(PL_stack_sp-PL_stack_base),
+ (IV)(PL_stack_max-PL_stack_base));
+ PerlIO_printf(Perl_debug_log,
+ "%8"UVxf" %8"UVxf" %8"UVuf" %8"UVuf" %8"UVuf"\n",
+ PTR2UV(PL_mainstack), PTR2UV(AvARRAY(PL_curstack)),
+ PTR2UV(PL_mainstack), PTR2UV(AvFILLp(PL_curstack)),
+ PTR2UV(AvMAX(PL_curstack)));
#endif /* DEBUGGING */
return 0;
}
dTHR;
I32 top = PL_stack_sp - PL_stack_base;
register I32 i = top - 30;
- I32 *markscan = PL_curstackinfo->si_markbase;
+ I32 *markscan = PL_markstack + PL_curstackinfo->si_markoff;
if (i < 0)
i = 0;
break;
#ifdef USE_THREADS
- PerlIO_printf(Perl_debug_log, i ? "0x%lx => ... " : "0x%lx => ",
- (unsigned long) thr);
+ PerlIO_printf(Perl_debug_log,
+ i ? "0x%"UVxf" => ... " : "0x%lx => ",
+ PTR2UV(thr));
#else
PerlIO_printf(Perl_debug_log, i ? " => ... " : " => ");
#endif /* USE_THREADS */
-e 's/thread/Thread/'\
-e 's/byteload/ByteLoader/'\
-e 's=devel/peek=Devel/Peek='\
- -e 's=devel/dprof=Devel/DProf='
+ -e 's=devel/dprof=Devel/DProf='\
+ -e 's=file/=='\
+ -e 's=File/=='\
+ -e 's=glob=='\
+ -e 's=Glob=='
}
static_ext=$(repair "$static_ext")
extensions=$(repair "$extensions")
sh -c 'if test ! -d /tmp; then mkdir /tmp; fi'
cp djgpp.c config.over ..
cd ..
-mv ext/B/defsu* ext/B/defsubsh.PL
echo Running sed...
sh djgpp/djgppsed.sh
SSTAT='s=\.\(stat\.\)=_\1=g'
STMP2='s=tmp2=tm2=g'
SPACKLIST='s=\.\(packlist\)=_\1=g'
-SDEFSUB='s=defsubs\.h=defsubsh=g'
-SPLPLI='s=PL/;=PL/i;=g'
sed -e $SCONFIG -e $SGREPTMP -e $SECHOTMP -e $SDDC -e $SOUT -e 's=\.\( \./\$file\)$=sh\1=g' Configure |tr -d '\r' >s; mv -f s Configure
sed -e $SEXISTS -e $SLIST -e $SCONFIG Makefile.SH |tr -d '\r' >s; mv -f s Makefile.SH
sed -e $SPACKLIST lib/ExtUtils/Packlist.pm >s; mv -f s lib/ExtUtils/Packlist.pm
sed -e $SPACKLIST lib/ExtUtils/inst >s; mv -f s lib/ExtUtils/inst
sed -e $SABC t/io/iprefix.t >s; mv -f s t/io/iprefix.t
-sed -e $SDEFSUB ext/B/Makefile.PL >s; mv -f s ext/B/Makefile.PL
-sed -e $SDEFSUB ext/B/B.xs >s; mv -f s ext/B/B.xs
-sed -e $SDEFSUB -e $SPLPLI ext/B/defsubsh.PL >s; mv -f s ext/B/defsubsh.PL
else
result = PerlIO_close(IoIFP(io));
if (result == EOF && fd > PL_maxsysfd)
- PerlIO_printf(PerlIO_stderr(),
+ PerlIO_printf(Perl_error_log,
"Warning: unable to close filehandle %s properly.\n",
GvENAME(gv));
IoOFP(io) = IoIFP(io) = Nullfp;
}
}
else {
- char *myname;
- char *type = name;
- char *otype = name;
+ char *type;
+ char *oname = name;
STRLEN tlen;
- STRLEN otlen = len;
+ STRLEN olen = len;
char mode[3]; /* stdio file mode ("r\0" or "r+\0") */
int dodup;
+ type = savepvn(name, len);
+ tlen = len;
+ SAVEFREEPV(type);
if (num_svs) {
- type = name;
- name = SvPV(svs, tlen) ;
- len = (I32)tlen;
+ STRLEN l;
+ name = SvPV(svs, l) ;
+ len = (I32)l;
+ name = savepvn(name, len);
+ SAVEFREEPV(name);
}
-
- tlen = otlen;
- myname = savepvn(name, len);
- SAVEFREEPV(myname);
- name = myname;
- if (!num_svs)
+ else {
while (tlen && isSPACE(type[tlen-1]))
type[--tlen] = '\0';
-
+ name = type;
+ len = tlen;
+ }
mode[0] = mode[1] = mode[2] = '\0';
IoTYPE(io) = *type;
if (*type == '+' && tlen > 1 && type[tlen-1] != '|') { /* scary */
if (*type == '|') {
if (num_svs && (tlen != 2 || type[1] != '-')) {
unknown_desr:
- Perl_croak(aTHX_ "Unknown open() mode '%.*s'", otlen, otype);
+ Perl_croak(aTHX_ "Unknown open() mode '%.*s'", olen, oname);
}
/*SUPPRESS 530*/
- for (type++; isSPACE(*type); type++) ;
- if (!num_svs)
+ for (type++, tlen--; isSPACE(*type); type++, tlen--) ;
+ if (!num_svs) {
name = type;
+ len = tlen;
+ }
if (*name == '\0') { /* command is missing 19990114 */
dTHR;
if (ckWARN(WARN_PIPE))
if (strNE(name,"-") || num_svs)
TAINT_ENV();
TAINT_PROPER("piped open");
- if (name[strlen(name)-1] == '|') {
+ if (name[len-1] == '|') {
dTHR;
- name[strlen(name)-1] = '\0' ;
+ name[--len] = '\0' ;
if (ckWARN(WARN_PIPE))
- Perl_warner(aTHX_ WARN_PIPE, "Can't do bidirectional pipe");
+ Perl_warner(aTHX_ WARN_PIPE, "Can't open bidirectional pipe");
}
fp = PerlProc_popen(name,"w");
writing = 1;
if (!(fp = PerlIO_fdopen(fd,mode))) {
if (dodup)
PerlLIO_close(fd);
- }
+ }
}
}
else {
}
#endif
IoIFP(io) = fp;
+ IoFLAGS(io) &= ~IOf_NOLINE;
if (writing) {
dTHR;
if (IoTYPE(io) == 's'
#endif
Uid_t fileuid;
Gid_t filegid;
+ IO *io = GvIOp(gv);
if (!PL_argvoutgv)
PL_argvoutgv = gv_fetchpv("ARGVOUT",TRUE,SVt_PVIO);
+ if (io && (IoFLAGS(io) & IOf_ARGV) && (IoFLAGS(io) & IOf_START)) {
+ IoFLAGS(io) &= ~IOf_START;
+ if (PL_inplace) {
+ if (!PL_argvout_stack)
+ PL_argvout_stack = newAV();
+ av_push(PL_argvout_stack, SvREFCNT_inc(PL_defoutgv));
+ }
+ }
if (PL_filemode & (S_ISUID|S_ISGID)) {
PerlIO_flush(IoIFP(GvIOn(PL_argvoutgv))); /* chmod must follow last write */
#ifdef HAS_FCHMOD
SETERRNO(0,0); /* in case sprintf set errno */
#ifdef VMS
if (!do_open(PL_argvoutgv,SvPVX(sv),SvCUR(sv),PL_inplace!=0,
- O_WRONLY|O_CREAT|O_TRUNC,0,Nullfp)) {
+ O_WRONLY|O_CREAT|O_TRUNC,0,Nullfp))
#else
if (!do_open(PL_argvoutgv,SvPVX(sv),SvCUR(sv),PL_inplace!=0,
- O_WRONLY|O_CREAT|OPEN_EXCL,0666,Nullfp)) {
+ O_WRONLY|O_CREAT|OPEN_EXCL,0666,Nullfp))
#endif
+ {
if (ckWARN_d(WARN_INPLACE))
Perl_warner(aTHX_ WARN_INPLACE, "Can't do inplace edit on %s: %s",
PL_oldname, Strerror(errno) );
if (!S_ISREG(PL_statbuf.st_mode))
Perl_warner(aTHX_ WARN_INPLACE,
"Can't do inplace edit: %s is not a regular file",
- PL_oldname );
+ PL_oldname);
else
- Perl_warner(aTHX_ WARN_INPLACE, "Can't open %s: %s\n",
+ Perl_warner(aTHX_ WARN_INPLACE, "Can't open %s: %s",
PL_oldname, Strerror(errno));
}
}
}
+ if (io && (IoFLAGS(io) & IOf_ARGV))
+ IoFLAGS(io) |= IOf_START;
if (PL_inplace) {
(void)do_close(PL_argvoutgv,FALSE);
+ if (io && (IoFLAGS(io) & IOf_ARGV)
+ && PL_argvout_stack && AvFILLp(PL_argvout_stack) >= 0)
+ {
+ GV *oldout = (GV*)av_pop(PL_argvout_stack);
+ setdefout(oldout);
+ SvREFCNT_dec(oldout);
+ return Nullfp;
+ }
setdefout(gv_fetchpv("STDOUT",TRUE,SVt_PVIO));
}
return Nullfp;
{
dTHR;
if (ckWARN(WARN_UNINITIALIZED))
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
}
return TRUE;
case SVt_IV:
if (SvIOK(sv)) {
if (SvGMAGICAL(sv))
mg_get(sv);
-#ifdef IV_IS_QUAD
- if (SvIsUV(sv))
- PerlIO_printf(fp, "%" PERL_PRIu64, (UV)SvUVX(sv));
- else
- PerlIO_printf(fp, "%" PERL_PRId64, (IV)SvIVX(sv));
-#else
if (SvIsUV(sv))
- PerlIO_printf(fp, "%lu", (unsigned long)SvUVX(sv));
+ PerlIO_printf(fp, "%"UVuf, (UV)SvUVX(sv));
else
- PerlIO_printf(fp, "%ld", (long)SvIVX(sv));
-#endif
+ PerlIO_printf(fp, "%"IVdf, (IV)SvIVX(sv));
return !PerlIO_error(fp);
}
/* FALL THROUGH */
if (PL_op->op_flags & OPf_REF) {
EXTEND(SP,1);
- tmpgv = cGVOP->op_gv;
+ tmpgv = cGVOP_gv;
do_fstat:
io = GvIO(tmpgv);
if (io && IoIFP(io)) {
STRLEN n_a;
if (PL_op->op_flags & OPf_REF) {
EXTEND(SP,1);
- if (cGVOP->op_gv == PL_defgv) {
+ if (cGVOP_gv == PL_defgv) {
if (PL_laststype != OP_LSTAT)
Perl_croak(aTHX_ "The stat preceding -l _ wasn't an lstat");
return PL_laststatval;
Perl_do_aexec5(pTHX_ SV *really, register SV **mark, register SV **sp,
int fd, int do_report)
{
+#ifdef MACOS_TRADITIONAL
+ Perl_croak(aTHX_ "exec? I'm not *that* kind of operating system");
+#else
register char **a;
char *tmps;
STRLEN n_a;
}
}
do_execfree();
+#endif
return FALSE;
}
}
}
-#if !defined(OS2) && !defined(WIN32) && !defined(DJGPP) && !defined(EPOC)
+#if !defined(OS2) && !defined(WIN32) && !defined(DJGPP) && !defined(EPOC) && !defined(MACOS_TRADITIONAL)
bool
Perl_do_exec(pTHX_ char *cmd)
bool
Perl_ingroup(pTHX_ Gid_t testgid, Uid_t effective)
{
+#ifdef MACOS_TRADITIONAL
+ /* This is simply not correct for AppleShare, but fix it yerself. */
+ return TRUE;
+#else
if (testgid == (effective ? PL_egid : PL_gid))
return TRUE;
#ifdef HAS_GETGROUPS
}
#endif
return FALSE;
+#endif
}
#if defined(HAS_MSG) || defined(HAS_SEM) || defined(HAS_SHM)
if (offset >= srclen)
retnum = 0;
else
- retnum = (UV) s[offset] << 8;
+ retnum = (UV) s[offset] << 8;
}
else if (size == 32) {
if (offset >= srclen)
((UV) s[offset + 1] << 16) +
( s[offset + 2] << 8);
}
-#ifdef HAS_QUAD
+#ifdef UV_IS_QUAD
else if (size == 64) {
dTHR;
if (ckWARN(WARN_PORTABLE))
((UV) s[offset + 3] << 32) +
((UV) s[offset + 4] << 24) +
((UV) s[offset + 5] << 16) +
- ( s[offset + 6] << 8);
+ ( s[offset + 6] << 8);
}
#endif
}
retnum = s[offset];
else if (size == 16)
retnum =
- ((UV) s[offset] << 8) +
+ ((UV) s[offset] << 8) +
s[offset + 1];
else if (size == 32)
retnum =
((UV) s[offset + 1] << 16) +
( s[offset + 2] << 8) +
s[offset + 3];
-#ifdef HAS_QUAD
+#ifdef UV_IS_QUAD
else if (size == 64) {
dTHR;
if (ckWARN(WARN_PORTABLE))
((UV) s[offset + 3] << 32) +
((UV) s[offset + 4] << 24) +
((UV) s[offset + 5] << 16) +
- ( s[offset + 6] << 8) +
+ ( s[offset + 6] << 8) +
s[offset + 7];
}
#endif
s[offset+2] = (lval >> 8) & 0xff;
s[offset+3] = lval & 0xff;
}
-#ifdef HAS_QUAD
+#ifdef UV_IS_QUAD
else if (size == 64) {
dTHR;
if (ckWARN(WARN_PORTABLE))
# ifdef USE_THREADS
# define OLD_PTHREADS_API
# endif
+# define PERL_FS_VER_FMT "%d_%d_%d"
#else /* DJGPP */
# ifdef WIN32
# define PERL_SYS_INIT(c,v) Perl_win32_init(c,v)
#define PERL_SYS_TERM() MALLOC_TERM
#define dXSUB_SYS
-#define TMPPATH "plXXXXXX"
/*
* 5.003_07 and earlier keyed on #ifdef MSDOS for determining if we were
Perl_dump_vindent(pTHX_ I32 level, PerlIO *file, const char* pat, va_list *args)
{
dTHR;
- PerlIO_printf(file, "%*s", level*PL_dumpindent, "");
+ PerlIO_printf(file, "%*s", (int)(level*PL_dumpindent), "");
PerlIO_vprintf(file, pat, *args);
}
Perl_sv_catpvf(aTHX_ t, "(%g)",SvNVX(sv));
RESTORE_NUMERIC_LOCAL();
}
- else if (SvIOKp(sv)) { /* XXXX: IV, UV? */
-#ifdef IV_IS_QUAD
+ else if (SvIOKp(sv)) {
if (SvIsUV(sv))
- Perl_sv_catpvf(aTHX_ t, "(%" PERL_PRIu64 ")",(UV)SvUVX(sv));
+ Perl_sv_catpvf(aTHX_ t, "(%"UVuf")", (UV)SvUVX(sv));
else
- Perl_sv_catpvf(aTHX_ t, "(%" PERL_PRId64 ")",(IV)SvIVX(sv));
-#else
- if (SvIsUV(sv))
- Perl_sv_catpvf(aTHX_ t, "(%lu)",(unsigned long)SvUVX(sv));
- else
- Perl_sv_catpvf(aTHX_ t, "(%ld)",(long)SvIVX(sv));
-#endif
+ Perl_sv_catpvf(aTHX_ t, "(%"IVdf")", (IV)SvIVX(sv));
}
else
sv_catpv(t, "()");
PerlIO_printf(file, "%-4d", o->op_seq);
else
PerlIO_printf(file, " ");
- PerlIO_printf(file, "%*sTYPE = %s ===> ", PL_dumpindent*level-4, "", PL_op_name[o->op_type]);
+ PerlIO_printf(file,
+ "%*sTYPE = %s ===> ",
+ (int)(PL_dumpindent*level-4), "", PL_op_name[o->op_type]);
if (o->op_next) {
if (o->op_seq)
PerlIO_printf(file, "%d\n", o->op_next->op_seq);
Perl_dump_indent(aTHX_ level, file, "TARG = %d\n", o->op_targ);
}
#ifdef DUMPADDR
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, "ADDR = 0x%" PERL_PRIx64 " => 0x%" PERL_PRIx64 "\n", (IV)o, (IV)o->op_next);
-#else
- Perl_dump_indent(aTHX_ level, file, "ADDR = 0x%lx => 0x%lx\n", (long)o, (long)o->op_next);
-#endif
+ Perl_dump_indent(aTHX_ level, file, "ADDR = 0x%"UVxf" => 0x%"UVxf"\n", (UV)o, (UV)o->op_next);
#endif
if (o->op_flags) {
SV *tmpsv = newSVpvn("", 0);
else {
if (o->op_private & HINT_STRICT_REFS)
sv_catpv(tmpsv, ",STRICT_REFS");
+ if (o->op_private & OPpOUR_INTRO)
+ sv_catpv(tmpsv, ",OUR_INTRO");
}
}
else if (o->op_type == OP_CONST) {
}
switch (o->op_type) {
+ case OP_AELEMFAST:
case OP_GVSV:
case OP_GV:
- if (cGVOPo->op_gv) {
+#ifdef USE_ITHREADS
+ Perl_dump_indent(aTHX_ level, file, "PADIX = %d\n", cPADOPo->op_padix);
+#else
+ if (cSVOPo->op_sv) {
SV *tmpsv = NEWSV(0,0);
ENTER;
SAVEFREESV(tmpsv);
- gv_fullname3(tmpsv, cGVOPo->op_gv, Nullch);
+ gv_fullname3(tmpsv, (GV*)cSVOPo->op_sv, Nullch);
Perl_dump_indent(aTHX_ level, file, "GV = %s\n", SvPV(tmpsv, n_a));
LEAVE;
}
else
Perl_dump_indent(aTHX_ level, file, "GV = NULL\n");
+#endif
break;
case OP_CONST:
+ Perl_dump_indent(aTHX_ level, file, "SV = %s\n", SvPEEK(cSVOPo_sv));
+ break;
case OP_METHOD_NAMED:
Perl_dump_indent(aTHX_ level, file, "SV = %s\n", SvPEEK(cSVOPo->op_sv));
break;
case OP_SETSTATE:
case OP_NEXTSTATE:
case OP_DBSTATE:
- if (cCOPo->cop_line)
- Perl_dump_indent(aTHX_ level, file, "LINE = %d\n",cCOPo->cop_line);
+ if (CopLINE(cCOPo))
+ Perl_dump_indent(aTHX_ level, file, "LINE = %d\n",CopLINE(cCOPo));
+ if (CopSTASHPV(cCOPo))
+ Perl_dump_indent(aTHX_ level, file, "PACKAGE = \"%s\"\n",
+ CopSTASHPV(cCOPo));
if (cCOPo->cop_label)
- Perl_dump_indent(aTHX_ level, file, "LABEL = \"%s\"\n",cCOPo->cop_label);
+ Perl_dump_indent(aTHX_ level, file, "LABEL = \"%s\"\n",
+ cCOPo->cop_label);
break;
case OP_ENTERLOOP:
Perl_dump_indent(aTHX_ level, file, "REDO ===> ");
case OP_SUBST:
do_pmop_dump(level, file, cPMOPo);
break;
+ case OP_LEAVE:
+ case OP_LEAVEEVAL:
+ case OP_LEAVESUB:
+ case OP_LEAVESUBLV:
+ case OP_LEAVEWRITE:
+ case OP_SCOPE:
+ if (o->op_private & OPpREFCOUNTED)
+ Perl_dump_indent(aTHX_ level, file, "REFCNT = %"UVuf"\n", (UV)o->op_targ);
+ break;
default:
break;
}
Perl_do_magic_dump(pTHX_ I32 level, PerlIO *file, MAGIC *mg, I32 nest, I32 maxnest, bool dumpops, STRLEN pvlim)
{
for (; mg; mg = mg->mg_moremagic) {
- Perl_dump_indent(aTHX_ level, file, " MAGIC = 0x%lx\n", (long)mg);
+ Perl_dump_indent(aTHX_ level, file,
+ " MAGIC = 0x%"UVxf"\n", PTR2UV(mg));
if (mg->mg_virtual) {
MGVTBL *v = mg->mg_virtual;
char *s = 0;
if (s)
Perl_dump_indent(aTHX_ level, file, " MG_VIRTUAL = &PL_vtbl_%s\n", s);
else
- Perl_dump_indent(aTHX_ level, file, " MG_VIRTUAL = 0x%lx\n", (long)v);
+ Perl_dump_indent(aTHX_ level, file, " MG_VIRTUAL = 0x%"UVxf"\n", PTR2UV(v));
}
else
Perl_dump_indent(aTHX_ level, file, " MG_VIRTUAL = 0\n");
Perl_dump_indent(aTHX_ level, file, " MINMATCH\n");
}
if (mg->mg_obj) {
- Perl_dump_indent(aTHX_ level, file, " MG_OBJ = 0x%lx\n", (long)mg->mg_obj);
+ Perl_dump_indent(aTHX_ level, file, " MG_OBJ = 0x%"UVxf"\n", PTR2UV(mg->mg_obj));
if (mg->mg_flags & MGf_REFCOUNTED)
do_sv_dump(level+2, file, mg->mg_obj, nest+1, maxnest, dumpops, pvlim); /* MG is already +1 */
}
if (mg->mg_len)
Perl_dump_indent(aTHX_ level, file, " MG_LEN = %d\n", mg->mg_len);
if (mg->mg_ptr) {
- Perl_dump_indent(aTHX_ level, file, " MG_PTR = 0x%lx", (long)mg->mg_ptr);
+ Perl_dump_indent(aTHX_ level, file, " MG_PTR = 0x%"UVxf, PTR2UV(mg->mg_ptr));
if (mg->mg_len >= 0) {
SV *sv = newSVpvn("", 0);
PerlIO_printf(file, " %s", pv_display(sv, mg->mg_ptr, mg->mg_len, 0, pvlim));
void
Perl_do_hv_dump(pTHX_ I32 level, PerlIO *file, char *name, HV *sv)
{
- Perl_dump_indent(aTHX_ level, file, "%s = 0x%lx", name, (long)sv);
+ Perl_dump_indent(aTHX_ level, file, "%s = 0x%"UVxf, name, PTR2UV(sv));
if (sv && HvNAME(sv))
PerlIO_printf(file, "\t\"%s\"\n", HvNAME(sv));
else
void
Perl_do_gv_dump(pTHX_ I32 level, PerlIO *file, char *name, GV *sv)
{
- Perl_dump_indent(aTHX_ level, file, "%s = 0x%lx", name, (long)sv);
+ Perl_dump_indent(aTHX_ level, file, "%s = 0x%"UVxf, name, PTR2UV(sv));
if (sv && GvNAME(sv))
PerlIO_printf(file, "\t\"%s\"\n", GvNAME(sv));
else
void
Perl_do_gvgv_dump(pTHX_ I32 level, PerlIO *file, char *name, GV *sv)
{
- Perl_dump_indent(aTHX_ level, file, "%s = 0x%lx", name, (long)sv);
+ Perl_dump_indent(aTHX_ level, file, "%s = 0x%"UVxf, name, PTR2UV(sv));
if (sv && GvNAME(sv)) {
PerlIO_printf(file, "\t\"");
if (GvSTASH(sv) && HvNAME(GvSTASH(sv)))
flags = SvFLAGS(sv);
type = SvTYPE(sv);
-#ifdef IV_IS_QUAD
Perl_sv_setpvf(aTHX_ d,
- "(0x%" PERL_PRIx64") at 0x%" PERL_PRIx64 "\n%*s REFCNT = %" PERL_PRId64 "\n%*s FLAGS = (",
+ "(0x%"UVxf") at 0x%"UVxf"\n%*s REFCNT = %"IVdf"\n%*s FLAGS = (",
PTR2UV(SvANY(sv)), PTR2UV(sv),
PL_dumpindent*level, "", (IV)SvREFCNT(sv),
PL_dumpindent*level, "");
-#else
- Perl_sv_setpvf(aTHX_ d,
- "(0x%lx) at 0x%lx\n%*s REFCNT = %ld\n%*s FLAGS = (",
- (unsigned long)SvANY(sv), (unsigned long)sv,
- PL_dumpindent*level, "", (long)SvREFCNT(sv),
- PL_dumpindent*level, "");
-#endif
if (flags & SVs_PADBUSY) sv_catpv(d, "PADBUSY,");
if (flags & SVs_PADTMP) sv_catpv(d, "PADTMP,");
PerlIO_printf(file, "PVIO%s\n", s);
break;
default:
- PerlIO_printf(file, "UNKNOWN(0x%x) %s\n", type, s);
+ PerlIO_printf(file, "UNKNOWN(0x%"UVxf") %s\n", (UV)type, s);
return;
}
if (type >= SVt_PVIV || type == SVt_IV) {
-#ifdef IV_IS_QUAD
- if (SvIsUV(sv))
- Perl_dump_indent(aTHX_ level, file, " UV = %" PERL_PRIu64, (UV)SvUVX(sv));
- else
- Perl_dump_indent(aTHX_ level, file, " IV = %" PERL_PRId64, (IV)SvIVX(sv));
-#else
if (SvIsUV(sv))
- Perl_dump_indent(aTHX_ level, file, " UV = %lu", (unsigned long)SvUVX(sv));
+ Perl_dump_indent(aTHX_ level, file, " UV = %"UVuf, (UV)SvUVX(sv));
else
- Perl_dump_indent(aTHX_ level, file, " IV = %ld", (long)SvIVX(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " IV = %"IVdf, (IV)SvIVX(sv));
if (SvOOK(sv))
PerlIO_printf(file, " (OFFSET)");
PerlIO_putc(file, '\n');
}
if (type >= SVt_PVNV || type == SVt_NV) {
RESTORE_NUMERIC_STANDARD();
+ /* %Vg doesn't work? --jhi */
#ifdef USE_LONG_DOUBLE
Perl_dump_indent(aTHX_ level, file, " NV = %.*" PERL_PRIgldbl "\n", LDBL_DIG, SvNVX(sv));
#else
RESTORE_NUMERIC_LOCAL();
}
if (SvROK(sv)) {
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " RV = 0x%" PERL_PRIx64 "\n", PTR2IV(SvRV(sv)));
-#else
- Perl_dump_indent(aTHX_ level, file, " RV = 0x%lx\n", (long)SvRV(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " RV = 0x%"UVxf"\n", PTR2UV(SvRV(sv)));
if (nest < maxnest)
do_sv_dump(level+1, file, SvRV(sv), nest+1, maxnest, dumpops, pvlim);
return;
return;
if (type <= SVt_PVLV) {
if (SvPVX(sv)) {
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file," PV = 0x%" PERL_PRIx64 " ", PTR2IV(SvPVX(sv)));
-#else
- Perl_dump_indent(aTHX_ level, file," PV = 0x%lx ", (long)SvPVX(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file," PV = 0x%"UVxf" ", PTR2UV(SvPVX(sv)));
if (SvOOK(sv))
PerlIO_printf(file, "( %s . ) ", pv_display(d, SvPVX(sv)-SvIVX(sv), SvIVX(sv), 0, pvlim));
PerlIO_printf(file, "%s\n", pv_display(d, SvPVX(sv), SvCUR(sv), SvLEN(sv), pvlim));
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " CUR = %" PERL_PRId64 "\n", (IV)SvCUR(sv));
- Perl_dump_indent(aTHX_ level, file, " LEN = %" PERL_PRId64 "\n", (IV)SvLEN(sv));
-#else
- Perl_dump_indent(aTHX_ level, file, " CUR = %ld\n", (long)SvCUR(sv));
- Perl_dump_indent(aTHX_ level, file, " LEN = %ld\n", (long)SvLEN(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " CUR = %"IVdf"\n", (IV)SvCUR(sv));
+ Perl_dump_indent(aTHX_ level, file, " LEN = %"IVdf"\n", (IV)SvLEN(sv));
}
else
Perl_dump_indent(aTHX_ level, file, " PV = 0\n");
switch (type) {
case SVt_PVLV:
Perl_dump_indent(aTHX_ level, file, " TYPE = %c\n", LvTYPE(sv));
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " TARGOFF = %" PERL_PRId64 "\n", (IV)LvTARGOFF(sv));
- Perl_dump_indent(aTHX_ level, file, " TARGLEN = %" PERL_PRId64 "\n", (IV)LvTARGLEN(sv));
- Perl_dump_indent(aTHX_ level, file, " TARG = 0x%" PERL_PRIx64 "\n", PTR2IV(LvTARG(sv)));
-#else
- Perl_dump_indent(aTHX_ level, file, " TARGOFF = %ld\n", (long)LvTARGOFF(sv));
- Perl_dump_indent(aTHX_ level, file, " TARGLEN = %ld\n", (long)LvTARGLEN(sv));
- Perl_dump_indent(aTHX_ level, file, " TARG = 0x%lx\n", (long)LvTARG(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " TARGOFF = %"IVdf"\n", (IV)LvTARGOFF(sv));
+ Perl_dump_indent(aTHX_ level, file, " TARGLEN = %"IVdf"\n", (IV)LvTARGLEN(sv));
+ Perl_dump_indent(aTHX_ level, file, " TARG = 0x%"UVxf"\n", PTR2UV(LvTARG(sv)));
/* XXX level+1 ??? */
do_sv_dump(level, file, LvTARG(sv), nest+1, maxnest, dumpops, pvlim);
break;
case SVt_PVAV:
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " ARRAY = 0x%" PERL_PRIx64 , PTR2IV(AvARRAY(sv)));
-#else
- Perl_dump_indent(aTHX_ level, file, " ARRAY = 0x%lx", (long)AvARRAY(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " ARRAY = 0x%"UVxf, PTR2UV(AvARRAY(sv)));
if (AvARRAY(sv) != AvALLOC(sv)) {
- PerlIO_printf(file, " (offset=%d)\n", (AvARRAY(sv) - AvALLOC(sv)));
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " ALLOC = 0x%" PERL_PRIx64 "\n", PTR2IV(AvALLOC(sv)));
-#else
- Perl_dump_indent(aTHX_ level, file, " ALLOC = 0x%lx\n", (long)AvALLOC(sv));
-#endif
+ PerlIO_printf(file, " (offset=%"IVdf")\n", (IV)(AvARRAY(sv) - AvALLOC(sv)));
+ Perl_dump_indent(aTHX_ level, file, " ALLOC = 0x%"UVxf"\n", PTR2UV(AvALLOC(sv)));
}
else
PerlIO_putc(file, '\n');
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " FILL = %" PERL_PRId64 "\n", (IV)AvFILLp(sv));
- Perl_dump_indent(aTHX_ level, file, " MAX = %" PERL_PRId64 "\n", (IV)AvMAX(sv));
- Perl_dump_indent(aTHX_ level, file, " ARYLEN = 0x%" PERL_PRIx64 "\n", PTR2IV(AvARYLEN(sv)));
-#else
- Perl_dump_indent(aTHX_ level, file, " FILL = %ld\n", (long)AvFILLp(sv));
- Perl_dump_indent(aTHX_ level, file, " MAX = %ld\n", (long)AvMAX(sv));
- Perl_dump_indent(aTHX_ level, file, " ARYLEN = 0x%lx\n", (long)AvARYLEN(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " FILL = %"IVdf"\n", (IV)AvFILLp(sv));
+ Perl_dump_indent(aTHX_ level, file, " MAX = %"IVdf"\n", (IV)AvMAX(sv));
+ Perl_dump_indent(aTHX_ level, file, " ARYLEN = 0x%"UVxf"\n", PTR2UV(AvARYLEN(sv)));
flags = AvFLAGS(sv);
sv_setpv(d, "");
if (flags & AVf_REAL) sv_catpv(d, ",REAL");
for (count = 0; count <= av_len((AV*)sv) && count < maxnest; count++) {
SV** elt = av_fetch((AV*)sv,count,0);
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level + 1, file, "Elt No. %" PERL_PRId64 "\n", (IV)count);
-#else
- Perl_dump_indent(aTHX_ level + 1, file, "Elt No. %ld\n", (long)count);
-#endif
+ Perl_dump_indent(aTHX_ level + 1, file, "Elt No. %"IVdf"\n", (IV)count);
if (elt)
do_sv_dump(level+1, file, *elt, nest+1, maxnest, dumpops, pvlim);
}
}
break;
case SVt_PVHV:
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " ARRAY = 0x%" PERL_PRIx64,PTR2IV(HvARRAY(sv)));
-#else
- Perl_dump_indent(aTHX_ level, file, " ARRAY = 0x%lx",(long)HvARRAY(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " ARRAY = 0x%"UVxf, PTR2UV(HvARRAY(sv)));
if (HvARRAY(sv) && HvKEYS(sv)) {
/* Show distribution of HEs in the ARRAY */
int freq[200];
Perl_dump_indent(aTHX_ level, file, " hash quality = %.1f%%", theoret/sum*100);
}
PerlIO_putc(file, '\n');
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " KEYS = %" PERL_PRId64 "\n", (IV)HvKEYS(sv));
- Perl_dump_indent(aTHX_ level, file, " FILL = %" PERL_PRId64 "\n", (IV)HvFILL(sv));
- Perl_dump_indent(aTHX_ level, file, " MAX = %" PERL_PRId64 "\n", (IV)HvMAX(sv));
- Perl_dump_indent(aTHX_ level, file, " RITER = %" PERL_PRId64 "\n", (IV)HvRITER(sv));
- Perl_dump_indent(aTHX_ level, file, " EITER = 0x%" PERL_PRIx64 "\n",PTR2IV(HvEITER(sv)));
-#else
- Perl_dump_indent(aTHX_ level, file, " KEYS = %ld\n", (long)HvKEYS(sv));
- Perl_dump_indent(aTHX_ level, file, " FILL = %ld\n", (long)HvFILL(sv));
- Perl_dump_indent(aTHX_ level, file, " MAX = %ld\n", (long)HvMAX(sv));
- Perl_dump_indent(aTHX_ level, file, " RITER = %ld\n", (long)HvRITER(sv));
- Perl_dump_indent(aTHX_ level, file, " EITER = 0x%lx\n",(long) HvEITER(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " KEYS = %"IVdf"\n", (IV)HvKEYS(sv));
+ Perl_dump_indent(aTHX_ level, file, " FILL = %"IVdf"\n", (IV)HvFILL(sv));
+ Perl_dump_indent(aTHX_ level, file, " MAX = %"IVdf"\n", (IV)HvMAX(sv));
+ Perl_dump_indent(aTHX_ level, file, " RITER = %"IVdf"\n", (IV)HvRITER(sv));
+ Perl_dump_indent(aTHX_ level, file, " EITER = 0x%"UVxf"\n", PTR2UV(HvEITER(sv)));
if (HvPMROOT(sv))
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " PMROOT = 0x%" PERL_PRIx64 "\n",PTR2IV(HvPMROOT(sv)));
-#else
- Perl_dump_indent(aTHX_ level, file, " PMROOT = 0x%lx\n",(long)HvPMROOT(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " PMROOT = 0x%"UVxf"\n", PTR2UV(HvPMROOT(sv)));
if (HvNAME(sv))
Perl_dump_indent(aTHX_ level, file, " NAME = \"%s\"\n", HvNAME(sv));
if (nest < maxnest && !HvEITER(sv)) { /* Try to preserve iterator */
key = hv_iterkey(he, &len);
elt = hv_iterval(hv, he);
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level+1, file, "Elt %s HASH = 0x%" PERL_PRIx64 "\n", pv_display(d, key, len, 0, pvlim), hash);
-#else
- Perl_dump_indent(aTHX_ level+1, file, "Elt %s HASH = 0x%lx\n", pv_display(d, key, len, 0, pvlim), hash);
-#endif
+ Perl_dump_indent(aTHX_ level+1, file, "Elt %s HASH = 0x%"UVxf"\n", pv_display(d, key, len, 0, pvlim), (UV)hash);
do_sv_dump(level+1, file, elt, nest+1, maxnest, dumpops, pvlim);
}
hv_iterinit(hv); /* Return to status quo */
case SVt_PVFM:
do_hv_dump(level, file, " COMP_STASH", CvSTASH(sv));
if (CvSTART(sv))
-#ifdef IV_IS_QAUD
- Perl_dump_indent(aTHX_ level, file, " START = 0x%" PERL_PRIx64 " ===> %d\n", (IV)CvSTART(sv), CvSTART(sv)->op_seq);
- Perl_dump_indent(aTHX_ level, file, " ROOT = 0x%" PERL_PRIx64 "\n", (IV)CvROOT(sv));
-#else
- Perl_dump_indent(aTHX_ level, file, " START = 0x%lx ===> %d\n", (long)CvSTART(sv), CvSTART(sv)->op_seq);
- Perl_dump_indent(aTHX_ level, file, " ROOT = 0x%lx\n", (long)CvROOT(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " START = 0x%"UVxf" ===> %"IVdf"\n", PTR2UV(CvSTART(sv)), (IV)CvSTART(sv)->op_seq);
+ Perl_dump_indent(aTHX_ level, file, " ROOT = 0x%"UVxf"\n", PTR2UV(CvROOT(sv)));
if (CvROOT(sv) && dumpops)
do_op_dump(level+1, file, CvROOT(sv));
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " XSUB = 0x%" PERL_PRIx64 "\n", PTR2IV(CvXSUB(sv)));
- Perl_dump_indent(aTHX_ level, file, " XSUBANY = %" PERL_PRId64 "\n", (IV)CvXSUBANY(sv).any_i32);
-#else
- Perl_dump_indent(aTHX_ level, file, " XSUB = 0x%lx\n", (long)CvXSUB(sv));
- Perl_dump_indent(aTHX_ level, file, " XSUBANY = %ld\n", (long)CvXSUBANY(sv).any_i32);
-#endif
+ Perl_dump_indent(aTHX_ level, file, " XSUB = 0x%"UVxf"\n", PTR2UV(CvXSUB(sv)));
+ Perl_dump_indent(aTHX_ level, file, " XSUBANY = %"IVdf"\n", (IV)CvXSUBANY(sv).any_i32);
do_gvgv_dump(level, file, " GVGV::GV", CvGV(sv));
- do_gv_dump(level, file, " FILEGV", CvFILEGV(sv));
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " DEPTH = %" PERL_PRId64 "\n", (IV)CvDEPTH(sv));
-#else
- Perl_dump_indent(aTHX_ level, file, " DEPTH = %ld\n", (long)CvDEPTH(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " FILE = \"%s\"\n", CvFILE(sv));
+ Perl_dump_indent(aTHX_ level, file, " DEPTH = %"IVdf"\n", (IV)CvDEPTH(sv));
#ifdef USE_THREADS
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " MUTEXP = 0x%" PERL_PRIx64 "\n", (IV)CvMUTEXP(sv));
- Perl_dump_indent(aTHX_ level, file, " OWNER = 0x%" PERL_PRIx64 "\n", (IV)CvOWNER(sv));
-#else
- Perl_dump_indent(aTHX_ level, file, " MUTEXP = 0x%lx\n", (long)CvMUTEXP(sv));
- Perl_dump_indent(aTHX_ level, file, " OWNER = 0x%lx\n", (long)CvOWNER(sv));
-#endif /* IV_IS_QUAD */
+ Perl_dump_indent(aTHX_ level, file, " MUTEXP = 0x%"UVxf"\n", PTR2UV(CvMUTEXP(sv)));
+ Perl_dump_indent(aTHX_ level, file, " OWNER = 0x%"UVxf"\n", PTR2UV(CvOWNER(sv)));
#endif /* USE_THREADS */
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " FLAGS = 0x%" PERL_PRIx64 "\n", (UV)CvFLAGS(sv));
-#else
- Perl_dump_indent(aTHX_ level, file, " FLAGS = 0x%lx\n", (unsigned long)CvFLAGS(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " FLAGS = 0x%"UVxf"\n", CvFLAGS(sv));
if (type == SVt_PVFM)
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " LINES = %" PERL_PRId64 "\n", (IV)FmLINES(sv));
-#else
- Perl_dump_indent(aTHX_ level, file, " LINES = %ld\n", (long)FmLINES(sv));
-#endif
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " PADLIST = 0x%" PERL_PRIx64 "\n", PTR2IV(CvPADLIST(sv)));
-#else
- Perl_dump_indent(aTHX_ level, file, " PADLIST = 0x%lx\n", (long)CvPADLIST(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " LINES = %"IVdf"\n", (IV)FmLINES(sv));
+ Perl_dump_indent(aTHX_ level, file, " PADLIST = 0x%"UVxf"\n", PTR2UV(CvPADLIST(sv)));
if (nest < maxnest && CvPADLIST(sv)) {
AV* padlist = CvPADLIST(sv);
AV* pad_name = (AV*)*av_fetch(padlist, 0, FALSE);
I32 ix;
for (ix = 1; ix <= AvFILL(pad_name); ix++) {
-#ifdef IV_IS_QUAD
if (SvPOK(pname[ix]))
- Perl_dump_indent(aTHX_ level, /* %5d below is enough whitespace. */
+ Perl_dump_indent(aTHX_ level,
+ /* %5d below is enough whitespace. */
file,
- "%5d. 0x%" PERL_PRIx64 " (%s\"%s\" %" PERL_PRId64 "-%" PERL_PRId64 ")\n",
- ix, ppad[ix],
+ "%5d. 0x%"UVxf" (%s\"%s\" %"IVdf"-%"IVdf")\n",
+ ix, PTR2UV(ppad[ix]),
SvFAKE(pname[ix]) ? "FAKE " : "",
SvPVX(pname[ix]),
(IV)SvNVX(pname[ix]),
(IV)SvIVX(pname[ix]));
-#else
- if (SvPOK(pname[ix]))
- Perl_dump_indent(aTHX_ level, /* %5d below is enough whitespace. */
- file,
- "%5d. 0x%lx (%s\"%s\" %ld-%ld)\n",
- ix, ppad[ix],
- SvFAKE(pname[ix]) ? "FAKE " : "",
- SvPVX(pname[ix]),
- (long)I_32(SvNVX(pname[ix])),
- (long)SvIVX(pname[ix]));
-#endif
}
}
{
CV *outside = CvOUTSIDE(sv);
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " OUTSIDE = 0x%" PERL_PRIx64 " (%s)\n",
- PTR2IV(outside),
- (!outside ? "null"
- : CvANON(outside) ? "ANON"
- : (outside == PL_main_cv) ? "MAIN"
- : CvUNIQUE(outside) ? "UNIQUE"
- : CvGV(outside) ? GvNAME(CvGV(outside)) : "UNDEFINED"));
-#else
- Perl_dump_indent(aTHX_ level, file, " OUTSIDE = 0x%lx (%s)\n",
- (long)outside,
+ Perl_dump_indent(aTHX_ level, file, " OUTSIDE = 0x%"UVxf" (%s)\n",
+ PTR2UV(outside),
(!outside ? "null"
: CvANON(outside) ? "ANON"
: (outside == PL_main_cv) ? "MAIN"
: CvUNIQUE(outside) ? "UNIQUE"
: CvGV(outside) ? GvNAME(CvGV(outside)) : "UNDEFINED"));
-#endif
}
if (nest < maxnest && (CvCLONE(sv) || CvCLONED(sv)))
do_sv_dump(level+1, file, (SV*)CvOUTSIDE(sv), nest+1, maxnest, dumpops, pvlim);
break;
case SVt_PVGV:
Perl_dump_indent(aTHX_ level, file, " NAME = \"%s\"\n", GvNAME(sv));
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " NAMELEN = %" PERL_PRId64 "\n", (IV)GvNAMELEN(sv));
-#else
- Perl_dump_indent(aTHX_ level, file, " NAMELEN = %ld\n", (long)GvNAMELEN(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " NAMELEN = %"IVdf"\n", (IV)GvNAMELEN(sv));
do_hv_dump (level, file, " GvSTASH", GvSTASH(sv));
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " GP = 0x%" PERL_PRIx64 "\n", PTR2IV(GvGP(sv)));
- Perl_dump_indent(aTHX_ level, file, " SV = 0x%" PERL_PRIx64 "\n", PTR2IV(GvSV(sv)));
- Perl_dump_indent(aTHX_ level, file, " REFCNT = %" PERL_PRId64 "\n", (IV)GvREFCNT(sv));
- Perl_dump_indent(aTHX_ level, file, " IO = 0x%" PERL_PRIx64 "\n", PTR2IV(GvIOp(sv)));
- Perl_dump_indent(aTHX_ level, file, " FORM = 0x%" PERL_PRIx64 " \n", PTR2IV(GvFORM(sv)));
- Perl_dump_indent(aTHX_ level, file, " AV = 0x%" PERL_PRIx64 "\n", PTR2IV(GvAV(sv)));
- Perl_dump_indent(aTHX_ level, file, " HV = 0x%" PERL_PRIx64 "\n", PTR2IV(GvHV(sv)));
- Perl_dump_indent(aTHX_ level, file, " CV = 0x%" PERL_PRIx64 "\n", PTR2IV(GvCV(sv)));
- Perl_dump_indent(aTHX_ level, file, " CVGEN = 0x%" PERL_PRIx64 "\n", (IV)GvCVGEN(sv));
- Perl_dump_indent(aTHX_ level, file, " LASTEXPR = %" PERL_PRId64 "\n", (IV)GvLASTEXPR(sv));
- Perl_dump_indent(aTHX_ level, file, " LINE = %" PERL_PRId64 "\n", (IV)GvLINE(sv));
-#else
- Perl_dump_indent(aTHX_ level, file, " GP = 0x%lx\n", (long)GvGP(sv));
- Perl_dump_indent(aTHX_ level, file, " SV = 0x%lx\n", (long)GvSV(sv));
- Perl_dump_indent(aTHX_ level, file, " REFCNT = %ld\n", (long)GvREFCNT(sv));
- Perl_dump_indent(aTHX_ level, file, " IO = 0x%lx\n", (long)GvIOp(sv));
- Perl_dump_indent(aTHX_ level, file, " FORM = 0x%lx\n", (long)GvFORM(sv));
- Perl_dump_indent(aTHX_ level, file, " AV = 0x%lx\n", (long)GvAV(sv));
- Perl_dump_indent(aTHX_ level, file, " HV = 0x%lx\n", (long)GvHV(sv));
- Perl_dump_indent(aTHX_ level, file, " CV = 0x%lx\n", (long)GvCV(sv));
- Perl_dump_indent(aTHX_ level, file, " CVGEN = 0x%lx\n", (long)GvCVGEN(sv));
- Perl_dump_indent(aTHX_ level, file, " LASTEXPR = %ld\n", (long)GvLASTEXPR(sv));
- Perl_dump_indent(aTHX_ level, file, " LINE = %ld\n", (long)GvLINE(sv));
-#endif
- Perl_dump_indent(aTHX_ level, file, " FLAGS = 0x%x\n", (int)GvFLAGS(sv));
- do_gv_dump (level, file, " FILEGV", GvFILEGV(sv));
+ Perl_dump_indent(aTHX_ level, file, " GP = 0x%"UVxf"\n", PTR2UV(GvGP(sv)));
+ if (!GvGP(sv))
+ break;
+ Perl_dump_indent(aTHX_ level, file, " SV = 0x%"UVxf"\n", PTR2UV(GvSV(sv)));
+ Perl_dump_indent(aTHX_ level, file, " REFCNT = %"IVdf"\n", (IV)GvREFCNT(sv));
+ Perl_dump_indent(aTHX_ level, file, " IO = 0x%"UVxf"\n", PTR2UV(GvIOp(sv)));
+ Perl_dump_indent(aTHX_ level, file, " FORM = 0x%"UVxf" \n", PTR2UV(GvFORM(sv)));
+ Perl_dump_indent(aTHX_ level, file, " AV = 0x%"UVxf"\n", PTR2UV(GvAV(sv)));
+ Perl_dump_indent(aTHX_ level, file, " HV = 0x%"UVxf"\n", PTR2UV(GvHV(sv)));
+ Perl_dump_indent(aTHX_ level, file, " CV = 0x%"UVxf"\n", PTR2UV(GvCV(sv)));
+ Perl_dump_indent(aTHX_ level, file, " CVGEN = 0x%"UVxf"\n", (UV)GvCVGEN(sv));
+ Perl_dump_indent(aTHX_ level, file, " GPFLAGS = 0x%"UVxf"\n", (UV)GvGPFLAGS(sv));
+ Perl_dump_indent(aTHX_ level, file, " LINE = %"IVdf"\n", (IV)GvLINE(sv));
+ Perl_dump_indent(aTHX_ level, file, " FILE = \"%s\"\n", GvFILE(sv));
+ Perl_dump_indent(aTHX_ level, file, " FLAGS = 0x%"UVxf"\n", (UV)GvFLAGS(sv));
do_gv_dump (level, file, " EGV", GvEGV(sv));
break;
case SVt_PVIO:
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " IFP = 0x%" PERL_PRIx64 "\n", PTR2IV(IoIFP(sv)));
- Perl_dump_indent(aTHX_ level, file, " OFP = 0x%" PERL_PRIx64 "\n", PTR2IV(IoOFP(sv)));
- Perl_dump_indent(aTHX_ level, file, " DIRP = 0x%" PERL_PRIx64 "\n", PTR2IV(IoDIRP(sv)));
- Perl_dump_indent(aTHX_ level, file, " LINES = %" PERL_PRId64 "\n", (IV)IoLINES(sv));
- Perl_dump_indent(aTHX_ level, file, " PAGE = %" PERL_PRId64 "\n", (IV)IoPAGE(sv));
- Perl_dump_indent(aTHX_ level, file, " PAGE_LEN = %" PERL_PRId64 "\n", (IV)IoPAGE_LEN(sv));
- Perl_dump_indent(aTHX_ level, file, " LINES_LEFT = %" PERL_PRId64 "\n", (IV)IoLINES_LEFT(sv));
-#else
- Perl_dump_indent(aTHX_ level, file, " IFP = 0x%lx\n", (long)IoIFP(sv));
- Perl_dump_indent(aTHX_ level, file, " OFP = 0x%lx\n", (long)IoOFP(sv));
- Perl_dump_indent(aTHX_ level, file, " DIRP = 0x%lx\n", (long)IoDIRP(sv));
- Perl_dump_indent(aTHX_ level, file, " LINES = %ld\n", (long)IoLINES(sv));
- Perl_dump_indent(aTHX_ level, file, " PAGE = %ld\n", (long)IoPAGE(sv));
- Perl_dump_indent(aTHX_ level, file, " PAGE_LEN = %ld\n", (long)IoPAGE_LEN(sv));
- Perl_dump_indent(aTHX_ level, file, " LINES_LEFT = %ld\n", (long)IoLINES_LEFT(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " IFP = 0x%"UVxf"\n", PTR2UV(IoIFP(sv)));
+ Perl_dump_indent(aTHX_ level, file, " OFP = 0x%"UVxf"\n", PTR2UV(IoOFP(sv)));
+ Perl_dump_indent(aTHX_ level, file, " DIRP = 0x%"UVxf"\n", PTR2UV(IoDIRP(sv)));
+ Perl_dump_indent(aTHX_ level, file, " LINES = %"IVdf"\n", (IV)IoLINES(sv));
+ Perl_dump_indent(aTHX_ level, file, " PAGE = %"IVdf"\n", (IV)IoPAGE(sv));
+ Perl_dump_indent(aTHX_ level, file, " PAGE_LEN = %"IVdf"\n", (IV)IoPAGE_LEN(sv));
+ Perl_dump_indent(aTHX_ level, file, " LINES_LEFT = %"IVdf"\n", (IV)IoLINES_LEFT(sv));
if (IoTOP_NAME(sv))
Perl_dump_indent(aTHX_ level, file, " TOP_NAME = \"%s\"\n", IoTOP_NAME(sv));
do_gv_dump (level, file, " TOP_GV", IoTOP_GV(sv));
if (IoBOTTOM_NAME(sv))
Perl_dump_indent(aTHX_ level, file, " BOTTOM_NAME = \"%s\"\n", IoBOTTOM_NAME(sv));
do_gv_dump (level, file, " BOTTOM_GV", IoBOTTOM_GV(sv));
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " SUBPROCESS = %" PERL_PRId64 "\n", (IV)IoSUBPROCESS(sv));
-#else
- Perl_dump_indent(aTHX_ level, file, " SUBPROCESS = %ld\n", (long)IoSUBPROCESS(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " SUBPROCESS = %"IVdf"\n", (IV)IoSUBPROCESS(sv));
if (isPRINT(IoTYPE(sv)))
Perl_dump_indent(aTHX_ level, file, " TYPE = '%c'\n", IoTYPE(sv));
else
Perl_dump_indent(aTHX_ level, file, " TYPE = '\\%o'\n", IoTYPE(sv));
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " FLAGS = 0x%" PERL_PRIx64 "\n", (IV)IoFLAGS(sv));
-#else
- Perl_dump_indent(aTHX_ level, file, " FLAGS = 0x%lx\n", (long)IoFLAGS(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " FLAGS = 0x%"UVxf"\n", (UV)IoFLAGS(sv));
break;
}
}
-begin 444 dna.small.gif
+begin 444 dna_small.gif
M1TE&.#=A)0`J`.<``+9%&Y<R0M<F'ID\,!<07%<G1:P<0Q`A2Q`P;"L9/L$:
M,"480N5"&RL7:4LD0T,G144[7BHL2B4?3\0I+"</)BQ.9KD0/S878\96$Z\@
M(:\1*RL:3L0W&QL?2#4?9>@_&A$_5<I"&C`A3*,3-A`//9X<)\@Q(L`@.#\E
# Move autogenerated less-informative files to the end:
# Hard to do embed.h and embedvar.h in one sweep:
-topfiles="`echo ' ' *.y *.c *.h ' ' | sed 's/ \(embed\(var\|\)\.h\|obj\(pp\|XSUB\)\.h\|globals\.c\) \(\(embedvar\|objpp\).h \|\)/ /g'`"
+topfiles="`echo ' ' *.y *.c *.h ' ' | sed 's/ / /g' | sed 's/ embedvar\.h\|embed\.h\|obj\(pp\|XSUB\)\.h\|\(globals\|perlapi\)\.c / /g'`"
subdirs="`find ./* -maxdepth 0 -type d`"
subdirfiles="`find $subdirs -name '*.[cy]' -print | sort`"
subdirfiles1="`find $subdirs -name '*.[hH]' -print | sort`"
}' TAGS.tmp > TAGS.tm1 && mv TAGS.tm1 TAGS.tmp
+# Now remove these Perl_, add empty- and perl_-flavors:
+perl -w014pe 'if (s/^(Perl_ # 1: First group
+ (\w+) \( # 2: Stripped name
+ \x7F # End of description
+ ) # End of description
+ (\d+,\d+\n) # 3: TAGS Trail
+ /$1$3$1$2\x01$3$1perl_$2\x01$3/mgx) { # Repeat, add empty and perl_ flavors
+ $chars = chomp;
+ s/^((\n.+,)\d+)/ $2 . (length($_) - length($1) - 1) /e;
+ $_ .= ("\f" x $chars);
+ }' TAGS.tmp > TAGS.tm1 && mv TAGS.tm1 TAGS.tmp
+
+# Now remove these S_, add empty-flavor:
+perl -w014pe 'if (s/^(S_ # 1: First group
+ (\w+) \( # 2: Stripped name
+ \x7F # End of description
+ ) # End of description
+ (\d+,\d+\n) # 3: TAGS Trail
+ /$1$3$1$2\x01$3/mgx) { # Repeat, add empty_ flavor
+ $chars = chomp;
+ s/^((\n.+,)\d+)/ $2 . (length($_) - length($1) - 1) /e;
+ $_ .= ("\f" x $chars);
+ }' TAGS.tmp > TAGS.tm1 && mv TAGS.tm1 TAGS.tmp
etags -o TAGS.tmp -a -D -l none -r '/#define.*\t\(Perl_.*\)/\1/' embed.h
-etags -o TAGS.tmp -a globals.c embedvar.h objXSUB.h objpp.h
+etags -o TAGS.tmp -a globals.c embedvar.h objXSUB.h perlapi.c
+# The above processes created a lot of descriptions with an
+# an explicitly specified tag. Such descriptions have higher
+# precedence than descriptions without an explicitely specified tag.
+# To restore the justice, make all the descriptions explicit.
perl -w014pe 'if (s/^( [^\n\x7F\x01]*\b # 1: TAG group
(\w+) # 2: word
[^\w\x7F\x01\n]* # Most anything
#if !defined(PERL_OBJECT)
#if !defined(PERL_IMPLICIT_CONTEXT)
+#if defined(PERL_IMPLICIT_SYS)
+#else
+#endif
+#if defined(USE_ITHREADS)
+# if defined(PERL_IMPLICIT_SYS)
+# endif
+#endif
+#if defined(MYMALLOC)
+#define malloced_size Perl_malloced_size
+#endif
#if defined(PERL_OBJECT)
+#ifndef __BORLANDC__
+#endif
+#endif
+#if defined(PERL_OBJECT)
+#else
#endif
#define amagic_call Perl_amagic_call
#define Gv_AMupdate Perl_Gv_AMupdate
#define append_elem Perl_append_elem
#define append_list Perl_append_list
#define apply Perl_apply
+#define avhv_delete_ent Perl_avhv_delete_ent
#define avhv_exists_ent Perl_avhv_exists_ent
#define avhv_fetch_ent Perl_avhv_fetch_ent
#define avhv_iternext Perl_avhv_iternext
#define avhv_iterval Perl_avhv_iterval
#define avhv_keys Perl_avhv_keys
#define av_clear Perl_av_clear
+#define av_delete Perl_av_delete
+#define av_exists Perl_av_exists
#define av_extend Perl_av_extend
#define av_fake Perl_av_fake
#define av_fetch Perl_av_fetch
#define cxinc Perl_cxinc
#define deb Perl_deb
#define vdeb Perl_vdeb
-#define deb_growlevel Perl_deb_growlevel
#define debprofdump Perl_debprofdump
#define debop Perl_debop
#define debstack Perl_debstack
#define magic_sizepack Perl_magic_sizepack
#define magic_wipepack Perl_magic_wipepack
#define magicname Perl_magicname
-#if defined(MYMALLOC)
-#define malloced_size Perl_malloced_size
-#endif
#define markstack_grow Perl_markstack_grow
#if defined(USE_LOCALE_COLLATE)
#define mem_collxfrm Perl_mem_collxfrm
#define newHVhv Perl_newHVhv
#define newIO Perl_newIO
#define newLISTOP Perl_newLISTOP
+#define newPADOP Perl_newPADOP
#define newPMOP Perl_newPMOP
#define newPVOP Perl_newPVOP
#define newRV Perl_newRV
#define pad_swipe Perl_pad_swipe
#define peep Perl_peep
#if defined(PERL_OBJECT)
-#else
+#endif
#if defined(USE_THREADS)
#define new_struct_thread Perl_new_struct_thread
#endif
-#endif
#define call_atexit Perl_call_atexit
#define call_argv Perl_call_argv
#define call_method Perl_call_method
#define save_clearsv Perl_save_clearsv
#define save_delete Perl_save_delete
#define save_destructor Perl_save_destructor
+#define save_destructor_x Perl_save_destructor_x
#define save_freesv Perl_save_freesv
#define save_freeop Perl_save_freeop
#define save_freepv Perl_save_freepv
#define save_hptr Perl_save_hptr
#define save_I16 Perl_save_I16
#define save_I32 Perl_save_I32
+#define save_I8 Perl_save_I8
#define save_int Perl_save_int
#define save_item Perl_save_item
#define save_iv Perl_save_iv
#define save_op Perl_save_op
#define save_scalar Perl_save_scalar
#define save_pptr Perl_save_pptr
+#define save_vptr Perl_save_vptr
#define save_re_context Perl_save_re_context
#define save_sptr Perl_save_sptr
#define save_svref Perl_save_svref
#define sv_2mortal Perl_sv_2mortal
#define sv_2nv Perl_sv_2nv
#define sv_2pv Perl_sv_2pv
+#define sv_2pvutf8 Perl_sv_2pvutf8
+#define sv_2pvbyte Perl_sv_2pvbyte
#define sv_2uv Perl_sv_2uv
#define sv_iv Perl_sv_iv
#define sv_uv Perl_sv_uv
#define sv_nv Perl_sv_nv
#define sv_pvn Perl_sv_pvn
+#define sv_pvutf8n Perl_sv_pvutf8n
+#define sv_pvbyten Perl_sv_pvbyten
#define sv_true Perl_sv_true
#define sv_add_arena Perl_sv_add_arena
#define sv_backoff Perl_sv_backoff
#define sv_pos_u2b Perl_sv_pos_u2b
#define sv_pos_b2u Perl_sv_pos_b2u
#define sv_pvn_force Perl_sv_pvn_force
+#define sv_pvutf8n_force Perl_sv_pvutf8n_force
+#define sv_pvbyten_force Perl_sv_pvbyten_force
#define sv_reftype Perl_sv_reftype
#define sv_replace Perl_sv_replace
#define sv_report_used Perl_sv_report_used
#define vivify_defelem Perl_vivify_defelem
#define vivify_ref Perl_vivify_ref
#define wait4pid Perl_wait4pid
+#define report_uninit Perl_report_uninit
#define warn Perl_warn
#define vwarn Perl_vwarn
#define warner Perl_warner
#define vdefault_protect Perl_vdefault_protect
#define reginitcolors Perl_reginitcolors
#define sv_2pv_nolen Perl_sv_2pv_nolen
+#define sv_2pvutf8_nolen Perl_sv_2pvutf8_nolen
+#define sv_2pvbyte_nolen Perl_sv_2pvbyte_nolen
#define sv_pv Perl_sv_pv
+#define sv_pvutf8 Perl_sv_pvutf8
+#define sv_pvbyte Perl_sv_pvbyte
#define sv_force_normal Perl_sv_force_normal
#define tmps_grow Perl_tmps_grow
#define sv_rvweaken Perl_sv_rvweaken
#define newMYSUB Perl_newMYSUB
#define my_attrs Perl_my_attrs
#define boot_core_xsutils Perl_boot_core_xsutils
+#if defined(USE_ITHREADS)
+#define cx_dup Perl_cx_dup
+#define si_dup Perl_si_dup
+#define ss_dup Perl_ss_dup
+#define any_dup Perl_any_dup
+#define he_dup Perl_he_dup
+#define re_dup Perl_re_dup
+#define fp_dup Perl_fp_dup
+#define dirp_dup Perl_dirp_dup
+#define gp_dup Perl_gp_dup
+#define mg_dup Perl_mg_dup
+#define sv_dup Perl_sv_dup
+#if defined(HAVE_INTERP_INTERN)
+#define sys_intern_dup Perl_sys_intern_dup
+#endif
+#define ptr_table_new Perl_ptr_table_new
+#define ptr_table_fetch Perl_ptr_table_fetch
+#define ptr_table_store Perl_ptr_table_store
+#define ptr_table_split Perl_ptr_table_split
+#endif
#if defined(PERL_OBJECT)
+#else
#endif
#if defined(PERL_IN_AV_C) || defined(PERL_DECL_PROT)
#define avhv_index_sv S_avhv_index_sv
#define simplify_sort S_simplify_sort
#define is_handle_constructor S_is_handle_constructor
#define gv_ename S_gv_ename
+#define cv_dump S_cv_dump
#define cv_clone2 S_cv_clone2
#define scalar_mod_type S_scalar_mod_type
#define my_kid S_my_kid
#define regwhite S_regwhite
#define nextchar S_nextchar
#define dumpuntil S_dumpuntil
+#define put_byte S_put_byte
#define scan_commit S_scan_commit
+#define cl_anything S_cl_anything
+#define cl_is_anything S_cl_is_anything
+#define cl_init S_cl_init
+#define cl_init_zero S_cl_init_zero
+#define cl_and S_cl_and
+#define cl_or S_cl_or
#define study_chunk S_study_chunk
#define add_data S_add_data
#define re_croak2 S_re_croak2
#define cache_re S_cache_re
#define reghop S_reghop
#define reghopmaybe S_reghopmaybe
+#define find_byclass S_find_byclass
#endif
#if defined(PERL_IN_RUN_C) || defined(PERL_DECL_PROT)
#define debprof S_debprof
# if defined(CRIPPLED_CC)
#define uni S_uni
# endif
-# if defined(WIN32)
-#define win32_textfilter S_win32_textfilter
+# if defined(PERL_CR_FILTER)
+#define cr_textfilter S_cr_textfilter
# endif
#endif
#if defined(PERL_IN_UNIVERSAL_C) || defined(PERL_DECL_PROT)
#define xstat S_xstat
# endif
#endif
+#if defined(PERL_OBJECT)
+#endif
#define ck_anoncode Perl_ck_anoncode
#define ck_bitop Perl_ck_bitop
#define ck_concat Perl_ck_concat
#else /* PERL_IMPLICIT_CONTEXT */
+#if defined(PERL_IMPLICIT_SYS)
+#else
+#endif
+#if defined(USE_ITHREADS)
+# if defined(PERL_IMPLICIT_SYS)
+# endif
+#endif
+#if defined(MYMALLOC)
+#define malloced_size Perl_malloced_size
+#endif
#if defined(PERL_OBJECT)
+#ifndef __BORLANDC__
+#endif
+#endif
+#if defined(PERL_OBJECT)
+#else
#endif
#define amagic_call(a,b,c,d) Perl_amagic_call(aTHX_ a,b,c,d)
#define Gv_AMupdate(a) Perl_Gv_AMupdate(aTHX_ a)
#define append_elem(a,b,c) Perl_append_elem(aTHX_ a,b,c)
#define append_list(a,b,c) Perl_append_list(aTHX_ a,b,c)
#define apply(a,b,c) Perl_apply(aTHX_ a,b,c)
+#define avhv_delete_ent(a,b,c,d) Perl_avhv_delete_ent(aTHX_ a,b,c,d)
#define avhv_exists_ent(a,b,c) Perl_avhv_exists_ent(aTHX_ a,b,c)
#define avhv_fetch_ent(a,b,c,d) Perl_avhv_fetch_ent(aTHX_ a,b,c,d)
#define avhv_iternext(a) Perl_avhv_iternext(aTHX_ a)
#define avhv_iterval(a,b) Perl_avhv_iterval(aTHX_ a,b)
#define avhv_keys(a) Perl_avhv_keys(aTHX_ a)
#define av_clear(a) Perl_av_clear(aTHX_ a)
+#define av_delete(a,b,c) Perl_av_delete(aTHX_ a,b,c)
+#define av_exists(a,b) Perl_av_exists(aTHX_ a,b)
#define av_extend(a,b) Perl_av_extend(aTHX_ a,b)
#define av_fake(a,b) Perl_av_fake(aTHX_ a,b)
#define av_fetch(a,b,c) Perl_av_fetch(aTHX_ a,b,c)
#define get_ppaddr() Perl_get_ppaddr(aTHX)
#define cxinc() Perl_cxinc(aTHX)
#define vdeb(a,b) Perl_vdeb(aTHX_ a,b)
-#define deb_growlevel() Perl_deb_growlevel(aTHX)
#define debprofdump() Perl_debprofdump(aTHX)
#define debop(a) Perl_debop(aTHX_ a)
#define debstack() Perl_debstack(aTHX)
#define magic_sizepack(a,b) Perl_magic_sizepack(aTHX_ a,b)
#define magic_wipepack(a,b) Perl_magic_wipepack(aTHX_ a,b)
#define magicname(a,b,c) Perl_magicname(aTHX_ a,b,c)
-#if defined(MYMALLOC)
-#define malloced_size Perl_malloced_size
-#endif
#define markstack_grow() Perl_markstack_grow(aTHX)
#if defined(USE_LOCALE_COLLATE)
#define mem_collxfrm(a,b,c) Perl_mem_collxfrm(aTHX_ a,b,c)
#define my(a) Perl_my(aTHX_ a)
#define my_atof(a) Perl_my_atof(aTHX_ a)
#if !defined(HAS_BCOPY) || !defined(HAS_SAFE_BCOPY)
-#define my_bcopy(a,b,c) Perl_my_bcopy(aTHX_ a,b,c)
+#define my_bcopy Perl_my_bcopy
#endif
#if !defined(HAS_BZERO) && !defined(HAS_MEMSET)
-#define my_bzero(a,b) Perl_my_bzero(aTHX_ a,b)
+#define my_bzero Perl_my_bzero
#endif
#define my_exit(a) Perl_my_exit(aTHX_ a)
#define my_failure_exit() Perl_my_failure_exit(aTHX)
#define my_fflush_all() Perl_my_fflush_all(aTHX)
#define my_lstat() Perl_my_lstat(aTHX)
#if !defined(HAS_MEMCMP) || !defined(HAS_SANE_MEMCMP)
-#define my_memcmp(a,b,c) Perl_my_memcmp(aTHX_ a,b,c)
+#define my_memcmp Perl_my_memcmp
#endif
#if !defined(HAS_MEMSET)
-#define my_memset(a,b,c) Perl_my_memset(aTHX_ a,b,c)
+#define my_memset Perl_my_memset
#endif
#if !defined(PERL_OBJECT)
#define my_pclose(a) Perl_my_pclose(aTHX_ a)
#define newHVhv(a) Perl_newHVhv(aTHX_ a)
#define newIO() Perl_newIO(aTHX)
#define newLISTOP(a,b,c,d) Perl_newLISTOP(aTHX_ a,b,c,d)
+#define newPADOP(a,b,c) Perl_newPADOP(aTHX_ a,b,c)
#define newPMOP(a,b) Perl_newPMOP(aTHX_ a,b)
#define newPVOP(a,b,c) Perl_newPVOP(aTHX_ a,b,c)
#define newRV(a) Perl_newRV(aTHX_ a)
#define pad_swipe(a) Perl_pad_swipe(aTHX_ a)
#define peep(a) Perl_peep(aTHX_ a)
#if defined(PERL_OBJECT)
-#else
+#endif
#if defined(USE_THREADS)
#define new_struct_thread(a) Perl_new_struct_thread(aTHX_ a)
#endif
-#endif
#define call_atexit(a,b) Perl_call_atexit(aTHX_ a,b)
#define call_argv(a,b,c) Perl_call_argv(aTHX_ a,b,c)
#define call_method(a,b) Perl_call_method(aTHX_ a,b)
#define save_clearsv(a) Perl_save_clearsv(aTHX_ a)
#define save_delete(a,b,c) Perl_save_delete(aTHX_ a,b,c)
#define save_destructor(a,b) Perl_save_destructor(aTHX_ a,b)
+#define save_destructor_x(a,b) Perl_save_destructor_x(aTHX_ a,b)
#define save_freesv(a) Perl_save_freesv(aTHX_ a)
#define save_freeop(a) Perl_save_freeop(aTHX_ a)
#define save_freepv(a) Perl_save_freepv(aTHX_ a)
#define save_hptr(a) Perl_save_hptr(aTHX_ a)
#define save_I16(a) Perl_save_I16(aTHX_ a)
#define save_I32(a) Perl_save_I32(aTHX_ a)
+#define save_I8(a) Perl_save_I8(aTHX_ a)
#define save_int(a) Perl_save_int(aTHX_ a)
#define save_item(a) Perl_save_item(aTHX_ a)
#define save_iv(a) Perl_save_iv(aTHX_ a)
#define save_op() Perl_save_op(aTHX)
#define save_scalar(a) Perl_save_scalar(aTHX_ a)
#define save_pptr(a) Perl_save_pptr(aTHX_ a)
+#define save_vptr(a) Perl_save_vptr(aTHX_ a)
#define save_re_context() Perl_save_re_context(aTHX)
#define save_sptr(a) Perl_save_sptr(aTHX_ a)
#define save_svref(a) Perl_save_svref(aTHX_ a)
#define sv_2mortal(a) Perl_sv_2mortal(aTHX_ a)
#define sv_2nv(a) Perl_sv_2nv(aTHX_ a)
#define sv_2pv(a,b) Perl_sv_2pv(aTHX_ a,b)
+#define sv_2pvutf8(a,b) Perl_sv_2pvutf8(aTHX_ a,b)
+#define sv_2pvbyte(a,b) Perl_sv_2pvbyte(aTHX_ a,b)
#define sv_2uv(a) Perl_sv_2uv(aTHX_ a)
#define sv_iv(a) Perl_sv_iv(aTHX_ a)
#define sv_uv(a) Perl_sv_uv(aTHX_ a)
#define sv_nv(a) Perl_sv_nv(aTHX_ a)
#define sv_pvn(a,b) Perl_sv_pvn(aTHX_ a,b)
+#define sv_pvutf8n(a,b) Perl_sv_pvutf8n(aTHX_ a,b)
+#define sv_pvbyten(a,b) Perl_sv_pvbyten(aTHX_ a,b)
#define sv_true(a) Perl_sv_true(aTHX_ a)
#define sv_add_arena(a,b,c) Perl_sv_add_arena(aTHX_ a,b,c)
#define sv_backoff(a) Perl_sv_backoff(aTHX_ a)
#define sv_pos_u2b(a,b,c) Perl_sv_pos_u2b(aTHX_ a,b,c)
#define sv_pos_b2u(a,b) Perl_sv_pos_b2u(aTHX_ a,b)
#define sv_pvn_force(a,b) Perl_sv_pvn_force(aTHX_ a,b)
+#define sv_pvutf8n_force(a,b) Perl_sv_pvutf8n_force(aTHX_ a,b)
+#define sv_pvbyten_force(a,b) Perl_sv_pvbyten_force(aTHX_ a,b)
#define sv_reftype(a,b) Perl_sv_reftype(aTHX_ a,b)
#define sv_replace(a,b) Perl_sv_replace(aTHX_ a,b)
#define sv_report_used() Perl_sv_report_used(aTHX)
#define vivify_defelem(a) Perl_vivify_defelem(aTHX_ a)
#define vivify_ref(a,b) Perl_vivify_ref(aTHX_ a,b)
#define wait4pid(a,b,c) Perl_wait4pid(aTHX_ a,b,c)
+#define report_uninit() Perl_report_uninit(aTHX)
#define vwarn(a,b) Perl_vwarn(aTHX_ a,b)
#define vwarner(a,b,c) Perl_vwarner(aTHX_ a,b,c)
#define watch(a) Perl_watch(aTHX_ a)
#define do_pmop_dump(a,b,c) Perl_do_pmop_dump(aTHX_ a,b,c)
#define do_sv_dump(a,b,c,d,e,f,g) Perl_do_sv_dump(aTHX_ a,b,c,d,e,f,g)
#define magic_dump(a) Perl_magic_dump(aTHX_ a)
-#define vdefault_protect(a,b,c) Perl_vdefault_protect(aTHX_ a,b,c)
+#define vdefault_protect(a,b,c,d) Perl_vdefault_protect(aTHX_ a,b,c,d)
#define reginitcolors() Perl_reginitcolors(aTHX)
#define sv_2pv_nolen(a) Perl_sv_2pv_nolen(aTHX_ a)
+#define sv_2pvutf8_nolen(a) Perl_sv_2pvutf8_nolen(aTHX_ a)
+#define sv_2pvbyte_nolen(a) Perl_sv_2pvbyte_nolen(aTHX_ a)
#define sv_pv(a) Perl_sv_pv(aTHX_ a)
+#define sv_pvutf8(a) Perl_sv_pvutf8(aTHX_ a)
+#define sv_pvbyte(a) Perl_sv_pvbyte(aTHX_ a)
#define sv_force_normal(a) Perl_sv_force_normal(aTHX_ a)
#define tmps_grow(a) Perl_tmps_grow(aTHX_ a)
#define sv_rvweaken(a) Perl_sv_rvweaken(aTHX_ a)
#define newMYSUB(a,b,c,d,e) Perl_newMYSUB(aTHX_ a,b,c,d,e)
#define my_attrs(a,b) Perl_my_attrs(aTHX_ a,b)
#define boot_core_xsutils() Perl_boot_core_xsutils(aTHX)
+#if defined(USE_ITHREADS)
+#define cx_dup(a,b,c) Perl_cx_dup(aTHX_ a,b,c)
+#define si_dup(a) Perl_si_dup(aTHX_ a)
+#define ss_dup(a) Perl_ss_dup(aTHX_ a)
+#define any_dup(a,b) Perl_any_dup(aTHX_ a,b)
+#define he_dup(a,b) Perl_he_dup(aTHX_ a,b)
+#define re_dup(a) Perl_re_dup(aTHX_ a)
+#define fp_dup(a,b) Perl_fp_dup(aTHX_ a,b)
+#define dirp_dup(a) Perl_dirp_dup(aTHX_ a)
+#define gp_dup(a) Perl_gp_dup(aTHX_ a)
+#define mg_dup(a) Perl_mg_dup(aTHX_ a)
+#define sv_dup(a) Perl_sv_dup(aTHX_ a)
+#if defined(HAVE_INTERP_INTERN)
+#define sys_intern_dup(a,b) Perl_sys_intern_dup(aTHX_ a,b)
+#endif
+#define ptr_table_new() Perl_ptr_table_new(aTHX)
+#define ptr_table_fetch(a,b) Perl_ptr_table_fetch(aTHX_ a,b)
+#define ptr_table_store(a,b,c) Perl_ptr_table_store(aTHX_ a,b,c)
+#define ptr_table_split(a) Perl_ptr_table_split(aTHX_ a)
+#endif
#if defined(PERL_OBJECT)
+#else
#endif
#if defined(PERL_IN_AV_C) || defined(PERL_DECL_PROT)
#define avhv_index_sv(a) S_avhv_index_sv(aTHX_ a)
#define simplify_sort(a) S_simplify_sort(aTHX_ a)
#define is_handle_constructor(a,b) S_is_handle_constructor(aTHX_ a,b)
#define gv_ename(a) S_gv_ename(aTHX_ a)
+#define cv_dump(a) S_cv_dump(aTHX_ a)
#define cv_clone2(a,b) S_cv_clone2(aTHX_ a,b)
#define scalar_mod_type(a,b) S_scalar_mod_type(aTHX_ a,b)
#define my_kid(a,b) S_my_kid(aTHX_ a,b)
#define regwhite(a,b) S_regwhite(aTHX_ a,b)
#define nextchar() S_nextchar(aTHX)
#define dumpuntil(a,b,c,d,e) S_dumpuntil(aTHX_ a,b,c,d,e)
+#define put_byte(a,b) S_put_byte(aTHX_ a,b)
#define scan_commit(a) S_scan_commit(aTHX_ a)
+#define cl_anything(a) S_cl_anything(aTHX_ a)
+#define cl_is_anything(a) S_cl_is_anything(aTHX_ a)
+#define cl_init(a) S_cl_init(aTHX_ a)
+#define cl_init_zero(a) S_cl_init_zero(aTHX_ a)
+#define cl_and(a,b) S_cl_and(aTHX_ a,b)
+#define cl_or(a,b) S_cl_or(aTHX_ a,b)
#define study_chunk(a,b,c,d,e) S_study_chunk(aTHX_ a,b,c,d,e)
#define add_data(a,b) S_add_data(aTHX_ a,b)
#define regpposixcc(a) S_regpposixcc(aTHX_ a)
#define cache_re(a) S_cache_re(aTHX_ a)
#define reghop(a,b) S_reghop(aTHX_ a,b)
#define reghopmaybe(a,b) S_reghopmaybe(aTHX_ a,b)
+#define find_byclass(a,b,c,d,e,f) S_find_byclass(aTHX_ a,b,c,d,e,f)
#endif
#if defined(PERL_IN_RUN_C) || defined(PERL_DECL_PROT)
#define debprof(a) S_debprof(aTHX_ a)
# if defined(CRIPPLED_CC)
#define uni(a,b) S_uni(aTHX_ a,b)
# endif
-# if defined(WIN32)
-#define win32_textfilter(a,b,c) S_win32_textfilter(aTHX_ a,b,c)
+# if defined(PERL_CR_FILTER)
+#define cr_textfilter(a,b,c) S_cr_textfilter(aTHX_ a,b,c)
# endif
#endif
#if defined(PERL_IN_UNIVERSAL_C) || defined(PERL_DECL_PROT)
#define xstat(a) S_xstat(aTHX_ a)
# endif
#endif
+#if defined(PERL_OBJECT)
+#endif
#define ck_anoncode(a) Perl_ck_anoncode(aTHX_ a)
#define ck_bitop(a) Perl_ck_bitop(aTHX_ a)
#define ck_concat(a) Perl_ck_concat(aTHX_ a)
#endif /* PERL_IMPLICIT_CONTEXT */
#else /* PERL_OBJECT */
+#if defined(PERL_IMPLICIT_SYS)
+#else
+#endif
+#if defined(USE_ITHREADS)
+# if defined(PERL_IMPLICIT_SYS)
+# endif
+#endif
+#if defined(MYMALLOC)
+#define malloc Perl_malloc
+#define calloc Perl_calloc
+#define realloc Perl_realloc
+#define mfree Perl_mfree
+#define malloced_size Perl_malloced_size
+#endif
#if defined(PERL_OBJECT)
+#ifndef __BORLANDC__
+#endif
+#endif
+#if defined(PERL_OBJECT)
+#else
#endif
#define Perl_amagic_call CPerlObj::Perl_amagic_call
#define amagic_call Perl_amagic_call
#define append_list Perl_append_list
#define Perl_apply CPerlObj::Perl_apply
#define apply Perl_apply
+#define Perl_avhv_delete_ent CPerlObj::Perl_avhv_delete_ent
+#define avhv_delete_ent Perl_avhv_delete_ent
#define Perl_avhv_exists_ent CPerlObj::Perl_avhv_exists_ent
#define avhv_exists_ent Perl_avhv_exists_ent
#define Perl_avhv_fetch_ent CPerlObj::Perl_avhv_fetch_ent
#define avhv_keys Perl_avhv_keys
#define Perl_av_clear CPerlObj::Perl_av_clear
#define av_clear Perl_av_clear
+#define Perl_av_delete CPerlObj::Perl_av_delete
+#define av_delete Perl_av_delete
+#define Perl_av_exists CPerlObj::Perl_av_exists
+#define av_exists Perl_av_exists
#define Perl_av_extend CPerlObj::Perl_av_extend
#define av_extend Perl_av_extend
#define Perl_av_fake CPerlObj::Perl_av_fake
#define deb Perl_deb
#define Perl_vdeb CPerlObj::Perl_vdeb
#define vdeb Perl_vdeb
-#define Perl_deb_growlevel CPerlObj::Perl_deb_growlevel
-#define deb_growlevel Perl_deb_growlevel
#define Perl_debprofdump CPerlObj::Perl_debprofdump
#define debprofdump Perl_debprofdump
#define Perl_debop CPerlObj::Perl_debop
#define magic_wipepack Perl_magic_wipepack
#define Perl_magicname CPerlObj::Perl_magicname
#define magicname Perl_magicname
-#if defined(MYMALLOC)
-#define Perl_malloced_size CPerlObj::Perl_malloced_size
-#define malloced_size Perl_malloced_size
-#endif
#define Perl_markstack_grow CPerlObj::Perl_markstack_grow
#define markstack_grow Perl_markstack_grow
#if defined(USE_LOCALE_COLLATE)
#define newIO Perl_newIO
#define Perl_newLISTOP CPerlObj::Perl_newLISTOP
#define newLISTOP Perl_newLISTOP
+#define Perl_newPADOP CPerlObj::Perl_newPADOP
+#define newPADOP Perl_newPADOP
#define Perl_newPMOP CPerlObj::Perl_newPMOP
#define newPMOP Perl_newPMOP
#define Perl_newPVOP CPerlObj::Perl_newPVOP
#define Perl_peep CPerlObj::Perl_peep
#define peep Perl_peep
#if defined(PERL_OBJECT)
-#define perl_construct CPerlObj::perl_construct
-#define perl_destruct CPerlObj::perl_destruct
-#define perl_free CPerlObj::perl_free
-#define perl_run CPerlObj::perl_run
-#define perl_parse CPerlObj::perl_parse
-#else
-#define perl_alloc CPerlObj::perl_alloc
-#define perl_construct CPerlObj::perl_construct
-#define perl_destruct CPerlObj::perl_destruct
-#define perl_free CPerlObj::perl_free
-#define perl_run CPerlObj::perl_run
-#define perl_parse CPerlObj::perl_parse
+#define Perl_construct CPerlObj::Perl_construct
+#define Perl_destruct CPerlObj::Perl_destruct
+#define Perl_free CPerlObj::Perl_free
+#define Perl_run CPerlObj::Perl_run
+#define Perl_parse CPerlObj::Perl_parse
+#endif
#if defined(USE_THREADS)
#define Perl_new_struct_thread CPerlObj::Perl_new_struct_thread
#define new_struct_thread Perl_new_struct_thread
#endif
-#endif
#define Perl_call_atexit CPerlObj::Perl_call_atexit
#define call_atexit Perl_call_atexit
#define Perl_call_argv CPerlObj::Perl_call_argv
#define save_delete Perl_save_delete
#define Perl_save_destructor CPerlObj::Perl_save_destructor
#define save_destructor Perl_save_destructor
+#define Perl_save_destructor_x CPerlObj::Perl_save_destructor_x
+#define save_destructor_x Perl_save_destructor_x
#define Perl_save_freesv CPerlObj::Perl_save_freesv
#define save_freesv Perl_save_freesv
#define Perl_save_freeop CPerlObj::Perl_save_freeop
#define save_I16 Perl_save_I16
#define Perl_save_I32 CPerlObj::Perl_save_I32
#define save_I32 Perl_save_I32
+#define Perl_save_I8 CPerlObj::Perl_save_I8
+#define save_I8 Perl_save_I8
#define Perl_save_int CPerlObj::Perl_save_int
#define save_int Perl_save_int
#define Perl_save_item CPerlObj::Perl_save_item
#define save_scalar Perl_save_scalar
#define Perl_save_pptr CPerlObj::Perl_save_pptr
#define save_pptr Perl_save_pptr
+#define Perl_save_vptr CPerlObj::Perl_save_vptr
+#define save_vptr Perl_save_vptr
#define Perl_save_re_context CPerlObj::Perl_save_re_context
#define save_re_context Perl_save_re_context
#define Perl_save_sptr CPerlObj::Perl_save_sptr
#define sv_2nv Perl_sv_2nv
#define Perl_sv_2pv CPerlObj::Perl_sv_2pv
#define sv_2pv Perl_sv_2pv
+#define Perl_sv_2pvutf8 CPerlObj::Perl_sv_2pvutf8
+#define sv_2pvutf8 Perl_sv_2pvutf8
+#define Perl_sv_2pvbyte CPerlObj::Perl_sv_2pvbyte
+#define sv_2pvbyte Perl_sv_2pvbyte
#define Perl_sv_2uv CPerlObj::Perl_sv_2uv
#define sv_2uv Perl_sv_2uv
#define Perl_sv_iv CPerlObj::Perl_sv_iv
#define sv_nv Perl_sv_nv
#define Perl_sv_pvn CPerlObj::Perl_sv_pvn
#define sv_pvn Perl_sv_pvn
+#define Perl_sv_pvutf8n CPerlObj::Perl_sv_pvutf8n
+#define sv_pvutf8n Perl_sv_pvutf8n
+#define Perl_sv_pvbyten CPerlObj::Perl_sv_pvbyten
+#define sv_pvbyten Perl_sv_pvbyten
#define Perl_sv_true CPerlObj::Perl_sv_true
#define sv_true Perl_sv_true
#define Perl_sv_add_arena CPerlObj::Perl_sv_add_arena
#define sv_pos_b2u Perl_sv_pos_b2u
#define Perl_sv_pvn_force CPerlObj::Perl_sv_pvn_force
#define sv_pvn_force Perl_sv_pvn_force
+#define Perl_sv_pvutf8n_force CPerlObj::Perl_sv_pvutf8n_force
+#define sv_pvutf8n_force Perl_sv_pvutf8n_force
+#define Perl_sv_pvbyten_force CPerlObj::Perl_sv_pvbyten_force
+#define sv_pvbyten_force Perl_sv_pvbyten_force
#define Perl_sv_reftype CPerlObj::Perl_sv_reftype
#define sv_reftype Perl_sv_reftype
#define Perl_sv_replace CPerlObj::Perl_sv_replace
#define vivify_ref Perl_vivify_ref
#define Perl_wait4pid CPerlObj::Perl_wait4pid
#define wait4pid Perl_wait4pid
+#define Perl_report_uninit CPerlObj::Perl_report_uninit
+#define report_uninit Perl_report_uninit
#define Perl_warn CPerlObj::Perl_warn
#define warn Perl_warn
#define Perl_vwarn CPerlObj::Perl_vwarn
#if defined(MYMALLOC)
#define Perl_dump_mstats CPerlObj::Perl_dump_mstats
#define dump_mstats Perl_dump_mstats
-#define Perl_malloc CPerlObj::Perl_malloc
-#define malloc Perl_malloc
-#define Perl_calloc CPerlObj::Perl_calloc
-#define calloc Perl_calloc
-#define Perl_realloc CPerlObj::Perl_realloc
-#define realloc Perl_realloc
-#define Perl_mfree CPerlObj::Perl_mfree
-#define mfree Perl_mfree
#endif
#define Perl_safesysmalloc CPerlObj::Perl_safesysmalloc
#define safesysmalloc Perl_safesysmalloc
#define reginitcolors Perl_reginitcolors
#define Perl_sv_2pv_nolen CPerlObj::Perl_sv_2pv_nolen
#define sv_2pv_nolen Perl_sv_2pv_nolen
+#define Perl_sv_2pvutf8_nolen CPerlObj::Perl_sv_2pvutf8_nolen
+#define sv_2pvutf8_nolen Perl_sv_2pvutf8_nolen
+#define Perl_sv_2pvbyte_nolen CPerlObj::Perl_sv_2pvbyte_nolen
+#define sv_2pvbyte_nolen Perl_sv_2pvbyte_nolen
#define Perl_sv_pv CPerlObj::Perl_sv_pv
#define sv_pv Perl_sv_pv
+#define Perl_sv_pvutf8 CPerlObj::Perl_sv_pvutf8
+#define sv_pvutf8 Perl_sv_pvutf8
+#define Perl_sv_pvbyte CPerlObj::Perl_sv_pvbyte
+#define sv_pvbyte Perl_sv_pvbyte
#define Perl_sv_force_normal CPerlObj::Perl_sv_force_normal
#define sv_force_normal Perl_sv_force_normal
#define Perl_tmps_grow CPerlObj::Perl_tmps_grow
#define my_attrs Perl_my_attrs
#define Perl_boot_core_xsutils CPerlObj::Perl_boot_core_xsutils
#define boot_core_xsutils Perl_boot_core_xsutils
+#if defined(USE_ITHREADS)
+#define Perl_cx_dup CPerlObj::Perl_cx_dup
+#define cx_dup Perl_cx_dup
+#define Perl_si_dup CPerlObj::Perl_si_dup
+#define si_dup Perl_si_dup
+#define Perl_ss_dup CPerlObj::Perl_ss_dup
+#define ss_dup Perl_ss_dup
+#define Perl_any_dup CPerlObj::Perl_any_dup
+#define any_dup Perl_any_dup
+#define Perl_he_dup CPerlObj::Perl_he_dup
+#define he_dup Perl_he_dup
+#define Perl_re_dup CPerlObj::Perl_re_dup
+#define re_dup Perl_re_dup
+#define Perl_fp_dup CPerlObj::Perl_fp_dup
+#define fp_dup Perl_fp_dup
+#define Perl_dirp_dup CPerlObj::Perl_dirp_dup
+#define dirp_dup Perl_dirp_dup
+#define Perl_gp_dup CPerlObj::Perl_gp_dup
+#define gp_dup Perl_gp_dup
+#define Perl_mg_dup CPerlObj::Perl_mg_dup
+#define mg_dup Perl_mg_dup
+#define Perl_sv_dup CPerlObj::Perl_sv_dup
+#define sv_dup Perl_sv_dup
+#if defined(HAVE_INTERP_INTERN)
+#define Perl_sys_intern_dup CPerlObj::Perl_sys_intern_dup
+#define sys_intern_dup Perl_sys_intern_dup
+#endif
+#define Perl_ptr_table_new CPerlObj::Perl_ptr_table_new
+#define ptr_table_new Perl_ptr_table_new
+#define Perl_ptr_table_fetch CPerlObj::Perl_ptr_table_fetch
+#define ptr_table_fetch Perl_ptr_table_fetch
+#define Perl_ptr_table_store CPerlObj::Perl_ptr_table_store
+#define ptr_table_store Perl_ptr_table_store
+#define Perl_ptr_table_split CPerlObj::Perl_ptr_table_split
+#define ptr_table_split Perl_ptr_table_split
+#endif
#if defined(PERL_OBJECT)
+#else
#endif
#if defined(PERL_IN_AV_C) || defined(PERL_DECL_PROT)
#define S_avhv_index_sv CPerlObj::S_avhv_index_sv
#define is_handle_constructor S_is_handle_constructor
#define S_gv_ename CPerlObj::S_gv_ename
#define gv_ename S_gv_ename
+#define S_cv_dump CPerlObj::S_cv_dump
+#define cv_dump S_cv_dump
#define S_cv_clone2 CPerlObj::S_cv_clone2
#define cv_clone2 S_cv_clone2
#define S_scalar_mod_type CPerlObj::S_scalar_mod_type
#define nextchar S_nextchar
#define S_dumpuntil CPerlObj::S_dumpuntil
#define dumpuntil S_dumpuntil
+#define S_put_byte CPerlObj::S_put_byte
+#define put_byte S_put_byte
#define S_scan_commit CPerlObj::S_scan_commit
#define scan_commit S_scan_commit
+#define S_cl_anything CPerlObj::S_cl_anything
+#define cl_anything S_cl_anything
+#define S_cl_is_anything CPerlObj::S_cl_is_anything
+#define cl_is_anything S_cl_is_anything
+#define S_cl_init CPerlObj::S_cl_init
+#define cl_init S_cl_init
+#define S_cl_init_zero CPerlObj::S_cl_init_zero
+#define cl_init_zero S_cl_init_zero
+#define S_cl_and CPerlObj::S_cl_and
+#define cl_and S_cl_and
+#define S_cl_or CPerlObj::S_cl_or
+#define cl_or S_cl_or
#define S_study_chunk CPerlObj::S_study_chunk
#define study_chunk S_study_chunk
#define S_add_data CPerlObj::S_add_data
#define reghop S_reghop
#define S_reghopmaybe CPerlObj::S_reghopmaybe
#define reghopmaybe S_reghopmaybe
+#define S_find_byclass CPerlObj::S_find_byclass
+#define find_byclass S_find_byclass
#endif
#if defined(PERL_IN_RUN_C) || defined(PERL_DECL_PROT)
#define S_debprof CPerlObj::S_debprof
#define S_uni CPerlObj::S_uni
#define uni S_uni
# endif
-# if defined(WIN32)
-#define S_win32_textfilter CPerlObj::S_win32_textfilter
-#define win32_textfilter S_win32_textfilter
+# if defined(PERL_CR_FILTER)
+#define S_cr_textfilter CPerlObj::S_cr_textfilter
+#define cr_textfilter S_cr_textfilter
# endif
#endif
#if defined(PERL_IN_UNIVERSAL_C) || defined(PERL_DECL_PROT)
#define xstat S_xstat
# endif
#endif
+#if defined(PERL_OBJECT)
+#endif
#define Perl_ck_anoncode CPerlObj::Perl_ck_anoncode
#define ck_anoncode Perl_ck_anoncode
#define Perl_ck_bitop CPerlObj::Perl_ck_bitop
The following are not like that, but since they had a "perl_"
prefix in previous versions, we provide compatibility macros.
*/
-# define perl_atexit call_atexit
-# define perl_call_argv call_argv
-# define perl_call_pv call_pv
-# define perl_call_method call_method
-# define perl_call_sv call_sv
-# define perl_eval_sv eval_sv
-# define perl_eval_pv eval_pv
-# define perl_require_pv require_pv
-# define perl_get_sv get_sv
-# define perl_get_av get_av
-# define perl_get_hv get_hv
-# define perl_get_cv get_cv
-# define perl_init_i18nl10n init_i18nl10n
-# define perl_init_i18nl14n init_i18nl14n
-# define perl_new_ctype new_ctype
-# define perl_new_collate new_collate
-# define perl_new_numeric new_numeric
+# define perl_atexit(a,b) call_atexit(a,b)
+# define perl_call_argv(a,b,c) call_argv(a,b,c)
+# define perl_call_pv(a,b) call_pv(a,b)
+# define perl_call_method(a,b) call_method(a,b)
+# define perl_call_sv(a,b) call_sv(a,b)
+# define perl_eval_sv(a,b) eval_sv(a,b)
+# define perl_eval_pv(a,b) eval_pv(a,b)
+# define perl_require_pv(a) require_pv(a)
+# define perl_get_sv(a,b) get_sv(a,b)
+# define perl_get_av(a,b) get_av(a,b)
+# define perl_get_hv(a,b) get_hv(a,b)
+# define perl_get_cv(a,b) get_cv(a,b)
+# define perl_init_i18nl10n(a) init_i18nl10n(a)
+# define perl_init_i18nl14n(a) init_i18nl14n(a)
+# define perl_new_ctype(a) new_ctype(a)
+# define perl_new_collate(a) new_collate(a)
+# define perl_new_numeric(a) new_numeric(a)
/* varargs functions can't be handled with CPP macros. :-(
This provides a set of compatibility functions that don't take
seek DATA, $END, 0; # so we may restart
while (<DATA>) {
chomp;
+ next if /^:/;
while (s|\\$||) {
$_ .= <DATA>;
chomp;
my $ret = "";
if (@_ == 1) {
my $arg = shift;
- $ret .= "$arg\n" if $arg =~ /^#\s*(if|ifdef|else|endif)\b/
- or $arg =~ /^\s*(public|protected|private):/;
+ $ret .= "$arg\n";
}
else {
my ($flags,$retval,$func,@args) = @_;
$func = "S_$func";
}
else {
- $retval = "VIRTUAL $retval";
+ $retval = "PERL_CALLCONV $retval";
if ($flags =~ /p/) {
$func = "Perl_$func";
}
my $ret = "";
if (@_ > 1) {
my ($flags,$retval,$func,@args) = @_;
- unless ($flags =~ /s/) {
+ unless ($flags =~ /[sx]/) {
$func = "Perl_$func" if $flags =~ /p/;
$ret = "$func\n";
}
my $ret = "";
if (@_ == 1) {
my $arg = shift;
- $ret .= "$arg\n" if $arg =~ /^#\s*(if|ifdef|else|endif)\b/;
+ $ret .= "$arg\n" if $arg =~ /^#\s*(if|ifn?def|else|endif)\b/;
}
else {
my ($flags,$retval,$func,@args) = @_;
my $ret = "";
if (@_ == 1) {
my $arg = shift;
- $ret .= "$arg\n" if $arg =~ /^#\s*(if|ifdef|else|endif)\b/;
+ $ret .= "$arg\n" if $arg =~ /^#\s*(if|ifn?def|else|endif)\b/;
}
else {
my ($flags,$retval,$func,@args) = @_;
my $ret = "";
if (@_ == 1) {
my $arg = shift;
- $ret .= "$arg\n" if $arg =~ /^#\s*(if|ifdef|else|endif)\b/;
+ $ret .= "$arg\n" if $arg =~ /^#\s*(if|ifn?def|else|endif)\b/;
}
else {
my ($flags,$retval,$func,@args) = @_;
if ($flags =~ /s/) {
- $ret .= hide("S_$func","CPerlObj::S_$func");
+ $ret .= hide("S_$func","CPerlObj::S_$func") if $flags !~ /j/;
$ret .= hide($func,"S_$func");
}
elsif ($flags =~ /p/) {
- $ret .= hide("Perl_$func","CPerlObj::Perl_$func");
+ $ret .= hide("Perl_$func","CPerlObj::Perl_$func") if $flags !~ /j/;
$ret .= hide($func,"Perl_$func");
}
else {
- $ret .= hide($func,"CPerlObj::$func");
+ $ret .= hide($func,"CPerlObj::$func") if $flags !~ /j/;
}
}
$ret;
The following are not like that, but since they had a "perl_"
prefix in previous versions, we provide compatibility macros.
*/
-# define perl_atexit call_atexit
-# define perl_call_argv call_argv
-# define perl_call_pv call_pv
-# define perl_call_method call_method
-# define perl_call_sv call_sv
-# define perl_eval_sv eval_sv
-# define perl_eval_pv eval_pv
-# define perl_require_pv require_pv
-# define perl_get_sv get_sv
-# define perl_get_av get_av
-# define perl_get_hv get_hv
-# define perl_get_cv get_cv
-# define perl_init_i18nl10n init_i18nl10n
-# define perl_init_i18nl14n init_i18nl14n
-# define perl_new_ctype new_ctype
-# define perl_new_collate new_collate
-# define perl_new_numeric new_numeric
+# define perl_atexit(a,b) call_atexit(a,b)
+# define perl_call_argv(a,b,c) call_argv(a,b,c)
+# define perl_call_pv(a,b) call_pv(a,b)
+# define perl_call_method(a,b) call_method(a,b)
+# define perl_call_sv(a,b) call_sv(a,b)
+# define perl_eval_sv(a,b) eval_sv(a,b)
+# define perl_eval_pv(a,b) eval_pv(a,b)
+# define perl_require_pv(a) require_pv(a)
+# define perl_get_sv(a,b) get_sv(a,b)
+# define perl_get_av(a,b) get_av(a,b)
+# define perl_get_hv(a,b) get_hv(a,b)
+# define perl_get_cv(a,b) get_cv(a,b)
+# define perl_init_i18nl10n(a) init_i18nl10n(a)
+# define perl_init_i18nl14n(a) init_i18nl14n(a)
+# define perl_new_ctype(a) new_ctype(a)
+# define perl_new_collate(a) new_collate(a)
+# define perl_new_numeric(a) new_numeric(a)
/* varargs functions can't be handled with CPP macros. :-(
This provides a set of compatibility functions that don't take
# endif /* USE_THREADS */
#else /* !MULTIPLICITY */
-/* cases 1, 4 and 6 above */
+
+# if defined(PERL_OBJECT)
+/* case 6 above */
+
+END
+
+for $sym (sort keys %thread) {
+ print EM multon($sym,'T','aTHXo->interp.');
+}
+
+
+for $sym (sort keys %intrp) {
+ print EM multon($sym,'I','aTHXo->interp.');
+}
+
+print EM <<'END';
+
+# else /* !PERL_OBJECT */
+
+/* cases 1 and 4 above */
END
print EM <<'END';
-# if defined(USE_THREADS)
+# if defined(USE_THREADS)
/* case 4 above */
END
print EM <<'END';
-# else /* !USE_THREADS */
-/* cases 1 and 6 above */
+# else /* !USE_THREADS */
+/* case 1 above */
END
print EM <<'END';
-# endif /* USE_THREADS */
+# endif /* USE_THREADS */
+# endif /* PERL_OBJECT */
#endif /* MULTIPLICITY */
#if defined(PERL_GLOBAL_STRUCT)
my $ret = "";
if (@_ == 1) {
my $arg = shift;
- $ret .= "$arg\n" if $arg =~ /^#\s*(if|ifdef|else|endif)\b/;
+ $ret .= "$arg\n" if $arg =~ /^#\s*(if|ifn?def|else|endif)\b/;
}
else {
my ($flags,$retval,$func,@args) = @_;
- unless ($flags =~ /s/) {
+ unless ($flags =~ /[js]/) {
if ($flags =~ /p/) {
$ret .= undefine("Perl_$func") . hide("Perl_$func","pPerl->Perl_$func");
$ret .= undefine($func) . hide($func,"Perl_$func");
#undef PERLVARI
#undef PERLVARIC
#define PERLVAR(v,t) t* Perl_##v##_ptr(pTHXo) \
- { return &(aTHXo->PL_##v); }
+ { return &(aTHXo->interp.v); }
#define PERLVARA(v,n,t) PL_##v##_t* Perl_##v##_ptr(pTHXo) \
- { return &(aTHXo->PL_##v); }
+ { return &(aTHXo->interp.v); }
#define PERLVARI(v,t,i) PERLVAR(v,t)
#define PERLVARIC(v,t,i) PERLVAR(v, const t)
EOT
# functions that take va_list* for implementing vararg functions
+# NOTE: makedef.pl must be updated if you add symbols to %vfuncs
my %vfuncs = qw(
Perl_croak Perl_vcroak
Perl_warn Perl_vwarn
my $ret = "";
if (@_ == 1) {
my $arg = shift;
- $ret .= "$arg\n" if $arg =~ /^#\s*(if|ifdef|else|endif)\b/;
+ $ret .= "$arg\n" if $arg =~ /^#\s*(if|ifn?def|else|endif)\b/;
}
else {
my ($flags,$retval,$func,@args) = @_;
return $ret if exists $skipapi_funcs{$func};
- unless ($flags =~ /s/) {
+ unless ($flags =~ /[js]/) {
$ret .= "\n";
my $addctx = 1 if $flags =~ /n/;
if ($flags =~ /p/) {
dTHXo;
va_list(arglist);
va_start(arglist, format);
- return (*pPerl->PL_StdIO->pVprintf)(pPerl->PL_StdIO, stream, format, arglist);
+ return (*PL_StdIO->pVprintf)(PL_StdIO, stream, format, arglist);
}
END_EXTERN_C
__END__
-# Lines are of the form:
-# flags|return_type|function_name|arg1|arg2|...|argN
-#
-# A line may be continued on another by ending it with a backslash.
-# Leading and trailing whitespace will be ignored in each component.
-#
-# flags are single letters with following meanings:
-# s static function, should have an S_ prefix in source
-# file
-# n has no implicit interpreter/thread context argument
-# p function has a Perl_ prefix
-# r function never returns
-# o has no compatibility macro (#define foo Perl_foo)
-#
-# Individual flags may be separated by whitespace.
-#
-# New global functions should be added at the end for binary compatibility
-# in some configurations.
-#
-# TODO: 1) Add a flag to mark the functions that are part of the public API.
-# 2) Add a field for documentation, so that L<perlguts/"API LISTING">
-# may be autogenerated.
-#
+: Lines are of the form:
+: flags|return_type|function_name|arg1|arg2|...|argN
+:
+: A line may be continued on another by ending it with a backslash.
+: Leading and trailing whitespace will be ignored in each component.
+:
+: flags are single letters with following meanings:
+: s static function, should have an S_ prefix in source
+: file
+: n has no implicit interpreter/thread context argument
+: p function has a Perl_ prefix
+: r function never returns
+: o has no compatibility macro (#define foo Perl_foo)
+: j not a member of CPerlObj
+: x not exported
+:
+: Individual flags may be separated by whitespace.
+:
+: New global functions should be added at the end for binary compatibility
+: in some configurations.
+:
+: TODO: 1) Add a flag to mark the functions that are part of the public API.
+: 2) Add a field for documentation, so that L<perlguts/"API LISTING">
+: may be autogenerated.
+
+START_EXTERN_C
+#if defined(PERL_IMPLICIT_SYS)
+jno |PerlInterpreter* |perl_alloc_using \
+ |struct IPerlMem* m|struct IPerlMem* ms \
+ |struct IPerlMem* mp|struct IPerlEnv* e \
+ |struct IPerlStdIO* io|struct IPerlLIO* lio \
+ |struct IPerlDir* d|struct IPerlSock* s \
+ |struct IPerlProc* p
+#else
+jno |PerlInterpreter* |perl_alloc
+#endif
+jno |void |perl_construct |PerlInterpreter* interp
+jno |void |perl_destruct |PerlInterpreter* interp
+jno |void |perl_free |PerlInterpreter* interp
+jno |int |perl_run |PerlInterpreter* interp
+jno |int |perl_parse |PerlInterpreter* interp|XSINIT_t xsinit \
+ |int argc|char** argv|char** env
+#if defined(USE_ITHREADS)
+jno |PerlInterpreter*|perl_clone|PerlInterpreter* interp, UV flags
+# if defined(PERL_IMPLICIT_SYS)
+jno |PerlInterpreter*|perl_clone_using|PerlInterpreter *interp|UV flags \
+ |struct IPerlMem* m|struct IPerlMem* ms \
+ |struct IPerlMem* mp|struct IPerlEnv* e \
+ |struct IPerlStdIO* io|struct IPerlLIO* lio \
+ |struct IPerlDir* d|struct IPerlSock* s \
+ |struct IPerlProc* p
+# endif
+#endif
+
+#if defined(MYMALLOC)
+jnop |Malloc_t|malloc |MEM_SIZE nbytes
+jnop |Malloc_t|calloc |MEM_SIZE elements|MEM_SIZE size
+jnop |Malloc_t|realloc |Malloc_t where|MEM_SIZE nbytes
+jnop |Free_t |mfree |Malloc_t where
+jnp |MEM_SIZE|malloced_size |void *p
+#endif
+
+END_EXTERN_C
+
+/* functions with flag 'n' should come before here */
#if defined(PERL_OBJECT)
+class CPerlObj {
public:
+ struct interpreter interp;
+ CPerlObj(IPerlMem*, IPerlMem*, IPerlMem*, IPerlEnv*, IPerlStdIO*,
+ IPerlLIO*, IPerlDir*, IPerlSock*, IPerlProc*);
+ void* operator new(size_t nSize, IPerlMem *pvtbl);
+#ifndef __BORLANDC__
+ static void operator delete(void* pPerl, IPerlMem *pvtbl);
+#endif
+ int do_aspawn (void *vreally, void **vmark, void **vsp);
+#endif
+#if defined(PERL_OBJECT)
+public:
+#else
+START_EXTERN_C
#endif
+# include "pp_proto.h"
p |SV* |amagic_call |SV* left|SV* right|int method|int dir
p |bool |Gv_AMupdate |HV* stash
p |OP* |append_elem |I32 optype|OP* head|OP* tail
p |OP* |append_list |I32 optype|LISTOP* first|LISTOP* last
p |I32 |apply |I32 type|SV** mark|SV** sp
+p |SV* |avhv_delete_ent|AV *ar|SV* keysv|I32 flags|U32 hash
p |bool |avhv_exists_ent|AV *ar|SV* keysv|U32 hash
p |SV** |avhv_fetch_ent |AV *ar|SV* keysv|I32 lval|U32 hash
p |HE* |avhv_iternext |AV *ar
p |SV* |avhv_iterval |AV *ar|HE* entry
p |HV* |avhv_keys |AV *ar
p |void |av_clear |AV* ar
+p |SV* |av_delete |AV* ar|I32 key|I32 flags
+p |bool |av_exists |AV* ar|I32 key
p |void |av_extend |AV* ar|I32 key
p |AV* |av_fake |I32 size|SV** svp
p |SV** |av_fetch |AV* ar|I32 key|I32 lval
pr |void |croak |const char* pat|...
pr |void |vcroak |const char* pat|va_list* args
#if defined(PERL_IMPLICIT_CONTEXT)
-npr |void |croak_nocontext|const char* pat|...
+nrp |void |croak_nocontext|const char* pat|...
np |OP* |die_nocontext |const char* pat|...
np |void |deb_nocontext |const char* pat|...
np |char* |form_nocontext |const char* pat|...
p |I32 |cxinc
p |void |deb |const char* pat|...
p |void |vdeb |const char* pat|va_list* args
-p |void |deb_growlevel
p |void |debprofdump
p |I32 |debop |OP* o
p |I32 |debstack
p |U32 |magic_sizepack |SV* sv|MAGIC* mg
p |int |magic_wipepack |SV* sv|MAGIC* mg
p |void |magicname |char* sym|char* name|I32 namlen
-#if defined(MYMALLOC)
-np |MEM_SIZE|malloced_size |void *p
-#endif
p |void |markstack_grow
#if defined(USE_LOCALE_COLLATE)
p |char* |mem_collxfrm |const char* s|STRLEN len|STRLEN* xlen
p |OP* |my |OP* o
p |NV |my_atof |const char *s
#if !defined(HAS_BCOPY) || !defined(HAS_SAFE_BCOPY)
-p |char* |my_bcopy |const char* from|char* to|I32 len
+np |char* |my_bcopy |const char* from|char* to|I32 len
#endif
#if !defined(HAS_BZERO) && !defined(HAS_MEMSET)
-p |char* |my_bzero |char* loc|I32 len
+np |char* |my_bzero |char* loc|I32 len
#endif
pr |void |my_exit |U32 status
pr |void |my_failure_exit
p |I32 |my_fflush_all
p |I32 |my_lstat
#if !defined(HAS_MEMCMP) || !defined(HAS_SANE_MEMCMP)
-p |I32 |my_memcmp |const char* s1|const char* s2|I32 len
+np |I32 |my_memcmp |const char* s1|const char* s2|I32 len
#endif
#if !defined(HAS_MEMSET)
-p |void* |my_memset |char* loc|I32 ch|I32 len
+np |void* |my_memset |char* loc|I32 ch|I32 len
#endif
#if !defined(PERL_OBJECT)
p |I32 |my_pclose |PerlIO* ptr
p |HV* |newHVhv |HV* hv
p |IO* |newIO
p |OP* |newLISTOP |I32 type|I32 flags|OP* first|OP* last
+p |OP* |newPADOP |I32 type|I32 flags|SV* sv
p |OP* |newPMOP |I32 type|I32 flags
p |OP* |newPVOP |I32 type|I32 flags|char* pv
p |SV* |newRV |SV* pref
p |void |pad_swipe |PADOFFSET po
p |void |peep |OP* o
#if defined(PERL_OBJECT)
-no |void |perl_construct
-no |void |perl_destruct
-no |void |perl_free
-no |int |perl_run
-no |int |perl_parse |XSINIT_t xsinit \
- |int argc|char** argv|char** env
-#else
-no |PerlInterpreter* |perl_alloc
-no |void |perl_construct |PerlInterpreter* sv_interp
-no |void |perl_destruct |PerlInterpreter* sv_interp
-no |void |perl_free |PerlInterpreter* sv_interp
-no |int |perl_run |PerlInterpreter* sv_interp
-no |int |perl_parse |PerlInterpreter* sv_interp|XSINIT_t xsinit \
+ox |void |Perl_construct
+ox |void |Perl_destruct
+ox |void |Perl_free
+ox |int |Perl_run
+ox |int |Perl_parse |XSINIT_t xsinit \
|int argc|char** argv|char** env
+#endif
#if defined(USE_THREADS)
p |struct perl_thread* |new_struct_thread|struct perl_thread *t
#endif
-#endif
p |void |call_atexit |ATEXIT_t fn|void *ptr
p |I32 |call_argv |const char* sub_name|I32 flags|char** argv
p |I32 |call_method |const char* methname|I32 flags
p |AV* |save_ary |GV* gv
p |void |save_clearsv |SV** svp
p |void |save_delete |HV* hv|char* key|I32 klen
-p |void |save_destructor|DESTRUCTORFUNC_t f|void* p
+p |void |save_destructor|DESTRUCTORFUNC_NOCONTEXT_t f|void* p
+p |void |save_destructor_x|DESTRUCTORFUNC_t f|void* p
p |void |save_freesv |SV* sv
p |void |save_freeop |OP* o
p |void |save_freepv |char* pv
p |void |save_hptr |HV** hptr
p |void |save_I16 |I16* intp
p |void |save_I32 |I32* intp
+p |void |save_I8 |I8* bytep
p |void |save_int |int* intp
p |void |save_item |SV* item
p |void |save_iv |IV* iv
p |void |save_op
p |SV* |save_scalar |GV* gv
p |void |save_pptr |char** pptr
+p |void |save_vptr |void* pptr
p |void |save_re_context
p |void |save_sptr |SV** sptr
p |SV* |save_svref |SV** sptr
p |SV* |sv_2mortal |SV* sv
p |NV |sv_2nv |SV* sv
p |char* |sv_2pv |SV* sv|STRLEN* lp
+p |char* |sv_2pvutf8 |SV* sv|STRLEN* lp
+p |char* |sv_2pvbyte |SV* sv|STRLEN* lp
p |UV |sv_2uv |SV* sv
p |IV |sv_iv |SV* sv
p |UV |sv_uv |SV* sv
p |NV |sv_nv |SV* sv
p |char* |sv_pvn |SV *sv|STRLEN *len
+p |char* |sv_pvutf8n |SV *sv|STRLEN *len
+p |char* |sv_pvbyten |SV *sv|STRLEN *len
p |I32 |sv_true |SV *sv
p |void |sv_add_arena |char* ptr|U32 size|U32 flags
p |int |sv_backoff |SV* sv
p |void |sv_pos_u2b |SV* sv|I32* offsetp|I32* lenp
p |void |sv_pos_b2u |SV* sv|I32* offsetp
p |char* |sv_pvn_force |SV* sv|STRLEN* lp
+p |char* |sv_pvutf8n_force|SV* sv|STRLEN* lp
+p |char* |sv_pvbyten_force|SV* sv|STRLEN* lp
p |char* |sv_reftype |SV* sv|int ob
p |void |sv_replace |SV* sv|SV* nsv
p |void |sv_report_used
|I32 minbits|I32 none
p |UV |swash_fetch |SV *sv|U8 *ptr
p |void |taint_env
-p |void |taint_proper |const char* f|char* s
+p |void |taint_proper |const char* f|const char* s
p |UV |to_utf8_lower |U8 *p
p |UV |to_utf8_upper |U8 *p
p |UV |to_utf8_title |U8 *p
p |void |vivify_defelem |SV* sv
p |void |vivify_ref |SV* sv|U32 to_what
p |I32 |wait4pid |Pid_t pid|int* statusp|int flags
+p |void |report_uninit
p |void |warn |const char* pat|...
p |void |vwarn |const char* pat|va_list* args
p |void |warner |U32 err|const char* pat|...
p |int |yywarn |char* s
#if defined(MYMALLOC)
p |void |dump_mstats |char* s
-pno |Malloc_t|malloc |MEM_SIZE nbytes
-pno |Malloc_t|calloc |MEM_SIZE elements|MEM_SIZE size
-pno |Malloc_t|realloc |Malloc_t where|MEM_SIZE nbytes
-pno |Free_t |mfree |Malloc_t where
#endif
-pn |Malloc_t|safesysmalloc |MEM_SIZE nbytes
-pn |Malloc_t|safesyscalloc |MEM_SIZE elements|MEM_SIZE size
-pn |Malloc_t|safesysrealloc|Malloc_t where|MEM_SIZE nbytes
-pn |Free_t |safesysfree |Malloc_t where
+np |Malloc_t|safesysmalloc |MEM_SIZE nbytes
+np |Malloc_t|safesyscalloc |MEM_SIZE elements|MEM_SIZE size
+np |Malloc_t|safesysrealloc|Malloc_t where|MEM_SIZE nbytes
+np |Free_t |safesysfree |Malloc_t where
#if defined(LEAKTEST)
-pn |Malloc_t|safexmalloc |I32 x|MEM_SIZE size
-pn |Malloc_t|safexcalloc |I32 x|MEM_SIZE elements|MEM_SIZE size
-pn |Malloc_t|safexrealloc |Malloc_t where|MEM_SIZE size
-pn |void |safexfree |Malloc_t where
+np |Malloc_t|safexmalloc |I32 x|MEM_SIZE size
+np |Malloc_t|safexcalloc |I32 x|MEM_SIZE elements|MEM_SIZE size
+np |Malloc_t|safexrealloc |Malloc_t where|MEM_SIZE size
+np |void |safexfree |Malloc_t where
#endif
#if defined(PERL_GLOBAL_STRUCT)
p |struct perl_vars *|GetVars
p |void |do_sv_dump |I32 level|PerlIO *file|SV *sv|I32 nest \
|I32 maxnest|bool dumpops|STRLEN pvlim
p |void |magic_dump |MAGIC *mg
-p |void* |default_protect|int *excpt|protect_body_t body|...
-p |void* |vdefault_protect|int *excpt|protect_body_t body|va_list *args
+p |void* |default_protect|volatile JMPENV *je|int *excpt \
+ |protect_body_t body|...
+p |void* |vdefault_protect|volatile JMPENV *je|int *excpt \
+ |protect_body_t body|va_list *args
p |void |reginitcolors
p |char* |sv_2pv_nolen |SV* sv
+p |char* |sv_2pvutf8_nolen|SV* sv
+p |char* |sv_2pvbyte_nolen|SV* sv
p |char* |sv_pv |SV *sv
+p |char* |sv_pvutf8 |SV *sv
+p |char* |sv_pvbyte |SV *sv
p |void |sv_force_normal|SV *sv
p |void |tmps_grow |I32 n
p |SV* |sv_rvweaken |SV *sv
p |void |newMYSUB |I32 floor|OP *o|OP *proto|OP *attrs|OP *block
p |OP * |my_attrs |OP *o|OP *attrs
p |void |boot_core_xsutils
+#if defined(USE_ITHREADS)
+p |PERL_CONTEXT*|cx_dup |PERL_CONTEXT* cx|I32 ix|I32 max
+p |PERL_SI*|si_dup |PERL_SI* si
+p |ANY* |ss_dup |PerlInterpreter* proto_perl
+p |void* |any_dup |void* v|PerlInterpreter* proto_perl
+p |HE* |he_dup |HE* e|bool shared
+p |REGEXP*|re_dup |REGEXP* r
+p |PerlIO*|fp_dup |PerlIO* fp|char type
+p |DIR* |dirp_dup |DIR* dp
+p |GP* |gp_dup |GP* gp
+p |MAGIC* |mg_dup |MAGIC* mg
+p |SV* |sv_dup |SV* sstr
+#if defined(HAVE_INTERP_INTERN)
+p |void |sys_intern_dup |struct interp_intern* src \
+ |struct interp_intern* dst
+#endif
+p |PTR_TBL_t*|ptr_table_new
+p |void* |ptr_table_fetch|PTR_TBL_t *tbl|void *sv
+p |void |ptr_table_store|PTR_TBL_t *tbl|void *oldsv|void *newsv
+p |void |ptr_table_split|PTR_TBL_t *tbl
+#endif
#if defined(PERL_OBJECT)
protected:
+#else
+END_EXTERN_C
#endif
+
#if defined(PERL_IN_AV_C) || defined(PERL_DECL_PROT)
s |I32 |avhv_index_sv |SV* sv
#endif
s |void |simplify_sort |OP *o
s |bool |is_handle_constructor |OP *o|I32 argnum
s |char* |gv_ename |GV *gv
+s |void |cv_dump |CV *cv
s |CV* |cv_clone2 |CV *proto|CV *outside
s |bool |scalar_mod_type|OP *o|I32 type
s |OP * |my_kid |OP *o|OP *attrs
s |char*|nextchar
s |regnode*|dumpuntil |regnode *start|regnode *node \
|regnode *last|SV* sv|I32 l
+s |void |put_byte |SV* sv|int c
s |void |scan_commit |struct scan_data_t *data
+s |void |cl_anything |struct regnode_charclass_class *cl
+s |int |cl_is_anything |struct regnode_charclass_class *cl
+s |void |cl_init |struct regnode_charclass_class *cl
+s |void |cl_init_zero |struct regnode_charclass_class *cl
+s |void |cl_and |struct regnode_charclass_class *cl \
+ |struct regnode_charclass_class *and_with
+s |void |cl_or |struct regnode_charclass_class *cl \
+ |struct regnode_charclass_class *or_with
s |I32 |study_chunk |regnode **scanp|I32 *deltap \
|regnode *last|struct scan_data_t *data \
|U32 flags
s |I32 |regrepeat |regnode *p|I32 max
s |I32 |regrepeat_hard |regnode *p|I32 max|I32 *lp
s |I32 |regtry |regexp *prog|char *startpos
-s |bool |reginclass |char *p|I32 c
+s |bool |reginclass |regnode *p|I32 c
s |bool |reginclassutf8 |regnode *f|U8* p
s |CHECKPOINT|regcppush |I32 parenfloor
s |char*|regcppop
s |void |cache_re |regexp *prog
s |U8* |reghop |U8 *pos|I32 off
s |U8* |reghopmaybe |U8 *pos|I32 off
+s |char* |find_byclass |regexp * prog|regnode *c|char *s|char *strend|char *startpos|I32 norun
#endif
#if defined(PERL_IN_RUN_C) || defined(PERL_DECL_PROT)
s |void |incline |char *s
s |int |intuit_method |char *s|GV *gv
s |int |intuit_more |char *s
-s |I32 |lop |I32 f|expectation x|char *s
+s |I32 |lop |I32 f|int x|char *s
s |void |missingterm |char *s
s |void |no_op |char *what|char *s
s |void |set_csh
s |I32 |sublex_push
s |I32 |sublex_start
s |char * |filter_gets |SV *sv|PerlIO *fp|STRLEN append
-s |SV* |new_constant |char *s|STRLEN len|char *key|SV *sv \
- |SV *pv|char *type
+s |SV* |new_constant |char *s|STRLEN len|const char *key|SV *sv \
+ |SV *pv|const char *type
s |int |ao |int toketype
s |void |depcom
s |char* |incl_perldb
# if defined(CRIPPLED_CC)
s |int |uni |I32 f|char *s
# endif
-# if defined(WIN32)
-s |I32 |win32_textfilter |int idx|SV *sv|int maxlen
+# if defined(PERL_CR_FILTER)
+s |I32 |cr_textfilter |int idx|SV *sv|int maxlen
# endif
#endif
s |void |xstat |int
# endif
#endif
+
+#if defined(PERL_OBJECT)
+};
+#endif
#define PL_Env (PERL_GET_INTERP->IEnv)
#define PL_LIO (PERL_GET_INTERP->ILIO)
#define PL_Mem (PERL_GET_INTERP->IMem)
+#define PL_MemParse (PERL_GET_INTERP->IMemParse)
+#define PL_MemShared (PERL_GET_INTERP->IMemShared)
#define PL_Proc (PERL_GET_INTERP->IProc)
#define PL_Sock (PERL_GET_INTERP->ISock)
#define PL_StdIO (PERL_GET_INTERP->IStdIO)
#define PL_amagic_generation (PERL_GET_INTERP->Iamagic_generation)
-#define PL_ampergv (PERL_GET_INTERP->Iampergv)
#define PL_an (PERL_GET_INTERP->Ian)
-#define PL_archpat_auto (PERL_GET_INTERP->Iarchpat_auto)
#define PL_argvgv (PERL_GET_INTERP->Iargvgv)
+#define PL_argvout_stack (PERL_GET_INTERP->Iargvout_stack)
#define PL_argvoutgv (PERL_GET_INTERP->Iargvoutgv)
#define PL_basetime (PERL_GET_INTERP->Ibasetime)
#define PL_beginav (PERL_GET_INTERP->Ibeginav)
#define PL_bitcount (PERL_GET_INTERP->Ibitcount)
#define PL_bufend (PERL_GET_INTERP->Ibufend)
#define PL_bufptr (PERL_GET_INTERP->Ibufptr)
-#define PL_cddir (PERL_GET_INTERP->Icddir)
#define PL_collation_ix (PERL_GET_INTERP->Icollation_ix)
#define PL_collation_name (PERL_GET_INTERP->Icollation_name)
#define PL_collation_standard (PERL_GET_INTERP->Icollation_standard)
#define PL_curstname (PERL_GET_INTERP->Icurstname)
#define PL_curthr (PERL_GET_INTERP->Icurthr)
#define PL_dbargs (PERL_GET_INTERP->Idbargs)
-#define PL_debdelim (PERL_GET_INTERP->Idebdelim)
-#define PL_debname (PERL_GET_INTERP->Idebname)
#define PL_debstash (PERL_GET_INTERP->Idebstash)
#define PL_debug (PERL_GET_INTERP->Idebug)
#define PL_defgv (PERL_GET_INTERP->Idefgv)
#define PL_diehook (PERL_GET_INTERP->Idiehook)
-#define PL_dlevel (PERL_GET_INTERP->Idlevel)
-#define PL_dlmax (PERL_GET_INTERP->Idlmax)
#define PL_doextract (PERL_GET_INTERP->Idoextract)
#define PL_doswitches (PERL_GET_INTERP->Idoswitches)
#define PL_dowarn (PERL_GET_INTERP->Idowarn)
#define PL_eval_root (PERL_GET_INTERP->Ieval_root)
#define PL_eval_start (PERL_GET_INTERP->Ieval_start)
#define PL_evalseq (PERL_GET_INTERP->Ievalseq)
+#define PL_exit_flags (PERL_GET_INTERP->Iexit_flags)
#define PL_exitlist (PERL_GET_INTERP->Iexitlist)
#define PL_exitlistlen (PERL_GET_INTERP->Iexitlistlen)
#define PL_expect (PERL_GET_INTERP->Iexpect)
#define PL_fdpid (PERL_GET_INTERP->Ifdpid)
#define PL_filemode (PERL_GET_INTERP->Ifilemode)
-#define PL_filter_debug (PERL_GET_INTERP->Ifilter_debug)
#define PL_forkprocess (PERL_GET_INTERP->Iforkprocess)
#define PL_formfeed (PERL_GET_INTERP->Iformfeed)
#define PL_generation (PERL_GET_INTERP->Igeneration)
#define PL_last_swash_tmps (PERL_GET_INTERP->Ilast_swash_tmps)
#define PL_last_uni (PERL_GET_INTERP->Ilast_uni)
#define PL_lastfd (PERL_GET_INTERP->Ilastfd)
-#define PL_lastsize (PERL_GET_INTERP->Ilastsize)
-#define PL_lastspbase (PERL_GET_INTERP->Ilastspbase)
#define PL_laststatval (PERL_GET_INTERP->Ilaststatval)
#define PL_laststype (PERL_GET_INTERP->Ilaststype)
-#define PL_leftgv (PERL_GET_INTERP->Ileftgv)
#define PL_lex_brackets (PERL_GET_INTERP->Ilex_brackets)
#define PL_lex_brackstack (PERL_GET_INTERP->Ilex_brackstack)
#define PL_lex_casemods (PERL_GET_INTERP->Ilex_casemods)
#define PL_lex_defer (PERL_GET_INTERP->Ilex_defer)
#define PL_lex_dojoin (PERL_GET_INTERP->Ilex_dojoin)
#define PL_lex_expect (PERL_GET_INTERP->Ilex_expect)
-#define PL_lex_fakebrack (PERL_GET_INTERP->Ilex_fakebrack)
#define PL_lex_formbrack (PERL_GET_INTERP->Ilex_formbrack)
#define PL_lex_inpat (PERL_GET_INTERP->Ilex_inpat)
#define PL_lex_inwhat (PERL_GET_INTERP->Ilex_inwhat)
#define PL_main_cv (PERL_GET_INTERP->Imain_cv)
#define PL_main_root (PERL_GET_INTERP->Imain_root)
#define PL_main_start (PERL_GET_INTERP->Imain_start)
-#define PL_malloc_mutex (PERL_GET_INTERP->Imalloc_mutex)
#define PL_max_intro_pending (PERL_GET_INTERP->Imax_intro_pending)
#define PL_maxo (PERL_GET_INTERP->Imaxo)
#define PL_maxsysfd (PERL_GET_INTERP->Imaxsysfd)
#define PL_multi_open (PERL_GET_INTERP->Imulti_open)
#define PL_multi_start (PERL_GET_INTERP->Imulti_start)
#define PL_multiline (PERL_GET_INTERP->Imultiline)
-#define PL_mystrk (PERL_GET_INTERP->Imystrk)
#define PL_nexttoke (PERL_GET_INTERP->Inexttoke)
#define PL_nexttype (PERL_GET_INTERP->Inexttype)
#define PL_nextval (PERL_GET_INTERP->Inextval)
#define PL_numeric_standard (PERL_GET_INTERP->Inumeric_standard)
#define PL_ofmt (PERL_GET_INTERP->Iofmt)
#define PL_oldbufptr (PERL_GET_INTERP->Ioldbufptr)
-#define PL_oldlastpm (PERL_GET_INTERP->Ioldlastpm)
#define PL_oldname (PERL_GET_INTERP->Ioldname)
#define PL_oldoldbufptr (PERL_GET_INTERP->Ioldoldbufptr)
#define PL_op_mask (PERL_GET_INTERP->Iop_mask)
#define PL_pad_reset_pending (PERL_GET_INTERP->Ipad_reset_pending)
#define PL_padix (PERL_GET_INTERP->Ipadix)
#define PL_padix_floor (PERL_GET_INTERP->Ipadix_floor)
-#define PL_parsehook (PERL_GET_INTERP->Iparsehook)
#define PL_patchlevel (PERL_GET_INTERP->Ipatchlevel)
#define PL_pending_ident (PERL_GET_INTERP->Ipending_ident)
#define PL_perl_destruct_level (PERL_GET_INTERP->Iperl_destruct_level)
#define PL_preambled (PERL_GET_INTERP->Ipreambled)
#define PL_preprocess (PERL_GET_INTERP->Ipreprocess)
#define PL_profiledata (PERL_GET_INTERP->Iprofiledata)
+#define PL_psig_name (PERL_GET_INTERP->Ipsig_name)
+#define PL_psig_ptr (PERL_GET_INTERP->Ipsig_ptr)
+#define PL_ptr_table (PERL_GET_INTERP->Iptr_table)
#define PL_replgv (PERL_GET_INTERP->Ireplgv)
-#define PL_rightgv (PERL_GET_INTERP->Irightgv)
#define PL_rsfp (PERL_GET_INTERP->Irsfp)
#define PL_rsfp_filters (PERL_GET_INTERP->Irsfp_filters)
#define PL_runops (PERL_GET_INTERP->Irunops)
#define PL_sawampersand (PERL_GET_INTERP->Isawampersand)
-#define PL_sawstudy (PERL_GET_INTERP->Isawstudy)
-#define PL_sawvec (PERL_GET_INTERP->Isawvec)
#define PL_sh_path (PERL_GET_INTERP->Ish_path)
-#define PL_siggv (PERL_GET_INTERP->Isiggv)
#define PL_sighandlerp (PERL_GET_INTERP->Isighandlerp)
#define PL_splitstr (PERL_GET_INTERP->Isplitstr)
#define PL_srand_called (PERL_GET_INTERP->Isrand_called)
#define PL_statusvalue (PERL_GET_INTERP->Istatusvalue)
#define PL_statusvalue_vms (PERL_GET_INTERP->Istatusvalue_vms)
+#define PL_stderrgv (PERL_GET_INTERP->Istderrgv)
#define PL_stdingv (PERL_GET_INTERP->Istdingv)
-#define PL_strchop (PERL_GET_INTERP->Istrchop)
+#define PL_stopav (PERL_GET_INTERP->Istopav)
#define PL_strtab (PERL_GET_INTERP->Istrtab)
#define PL_strtab_mutex (PERL_GET_INTERP->Istrtab_mutex)
#define PL_sub_generation (PERL_GET_INTERP->Isub_generation)
#define PL_svref_mutex (PERL_GET_INTERP->Isvref_mutex)
#define PL_sys_intern (PERL_GET_INTERP->Isys_intern)
#define PL_tainting (PERL_GET_INTERP->Itainting)
-#define PL_thisexpr (PERL_GET_INTERP->Ithisexpr)
#define PL_thr_key (PERL_GET_INTERP->Ithr_key)
#define PL_threadnum (PERL_GET_INTERP->Ithreadnum)
#define PL_threads_mutex (PERL_GET_INTERP->Ithreads_mutex)
#define PL_Env (vTHX->IEnv)
#define PL_LIO (vTHX->ILIO)
#define PL_Mem (vTHX->IMem)
+#define PL_MemParse (vTHX->IMemParse)
+#define PL_MemShared (vTHX->IMemShared)
#define PL_Proc (vTHX->IProc)
#define PL_Sock (vTHX->ISock)
#define PL_StdIO (vTHX->IStdIO)
#define PL_amagic_generation (vTHX->Iamagic_generation)
-#define PL_ampergv (vTHX->Iampergv)
#define PL_an (vTHX->Ian)
-#define PL_archpat_auto (vTHX->Iarchpat_auto)
#define PL_argvgv (vTHX->Iargvgv)
+#define PL_argvout_stack (vTHX->Iargvout_stack)
#define PL_argvoutgv (vTHX->Iargvoutgv)
#define PL_basetime (vTHX->Ibasetime)
#define PL_beginav (vTHX->Ibeginav)
#define PL_bitcount (vTHX->Ibitcount)
#define PL_bufend (vTHX->Ibufend)
#define PL_bufptr (vTHX->Ibufptr)
-#define PL_cddir (vTHX->Icddir)
#define PL_collation_ix (vTHX->Icollation_ix)
#define PL_collation_name (vTHX->Icollation_name)
#define PL_collation_standard (vTHX->Icollation_standard)
#define PL_curstname (vTHX->Icurstname)
#define PL_curthr (vTHX->Icurthr)
#define PL_dbargs (vTHX->Idbargs)
-#define PL_debdelim (vTHX->Idebdelim)
-#define PL_debname (vTHX->Idebname)
#define PL_debstash (vTHX->Idebstash)
#define PL_debug (vTHX->Idebug)
#define PL_defgv (vTHX->Idefgv)
#define PL_diehook (vTHX->Idiehook)
-#define PL_dlevel (vTHX->Idlevel)
-#define PL_dlmax (vTHX->Idlmax)
#define PL_doextract (vTHX->Idoextract)
#define PL_doswitches (vTHX->Idoswitches)
#define PL_dowarn (vTHX->Idowarn)
#define PL_eval_root (vTHX->Ieval_root)
#define PL_eval_start (vTHX->Ieval_start)
#define PL_evalseq (vTHX->Ievalseq)
+#define PL_exit_flags (vTHX->Iexit_flags)
#define PL_exitlist (vTHX->Iexitlist)
#define PL_exitlistlen (vTHX->Iexitlistlen)
#define PL_expect (vTHX->Iexpect)
#define PL_fdpid (vTHX->Ifdpid)
#define PL_filemode (vTHX->Ifilemode)
-#define PL_filter_debug (vTHX->Ifilter_debug)
#define PL_forkprocess (vTHX->Iforkprocess)
#define PL_formfeed (vTHX->Iformfeed)
#define PL_generation (vTHX->Igeneration)
#define PL_last_swash_tmps (vTHX->Ilast_swash_tmps)
#define PL_last_uni (vTHX->Ilast_uni)
#define PL_lastfd (vTHX->Ilastfd)
-#define PL_lastsize (vTHX->Ilastsize)
-#define PL_lastspbase (vTHX->Ilastspbase)
#define PL_laststatval (vTHX->Ilaststatval)
#define PL_laststype (vTHX->Ilaststype)
-#define PL_leftgv (vTHX->Ileftgv)
#define PL_lex_brackets (vTHX->Ilex_brackets)
#define PL_lex_brackstack (vTHX->Ilex_brackstack)
#define PL_lex_casemods (vTHX->Ilex_casemods)
#define PL_lex_defer (vTHX->Ilex_defer)
#define PL_lex_dojoin (vTHX->Ilex_dojoin)
#define PL_lex_expect (vTHX->Ilex_expect)
-#define PL_lex_fakebrack (vTHX->Ilex_fakebrack)
#define PL_lex_formbrack (vTHX->Ilex_formbrack)
#define PL_lex_inpat (vTHX->Ilex_inpat)
#define PL_lex_inwhat (vTHX->Ilex_inwhat)
#define PL_main_cv (vTHX->Imain_cv)
#define PL_main_root (vTHX->Imain_root)
#define PL_main_start (vTHX->Imain_start)
-#define PL_malloc_mutex (vTHX->Imalloc_mutex)
#define PL_max_intro_pending (vTHX->Imax_intro_pending)
#define PL_maxo (vTHX->Imaxo)
#define PL_maxsysfd (vTHX->Imaxsysfd)
#define PL_multi_open (vTHX->Imulti_open)
#define PL_multi_start (vTHX->Imulti_start)
#define PL_multiline (vTHX->Imultiline)
-#define PL_mystrk (vTHX->Imystrk)
#define PL_nexttoke (vTHX->Inexttoke)
#define PL_nexttype (vTHX->Inexttype)
#define PL_nextval (vTHX->Inextval)
#define PL_numeric_standard (vTHX->Inumeric_standard)
#define PL_ofmt (vTHX->Iofmt)
#define PL_oldbufptr (vTHX->Ioldbufptr)
-#define PL_oldlastpm (vTHX->Ioldlastpm)
#define PL_oldname (vTHX->Ioldname)
#define PL_oldoldbufptr (vTHX->Ioldoldbufptr)
#define PL_op_mask (vTHX->Iop_mask)
#define PL_pad_reset_pending (vTHX->Ipad_reset_pending)
#define PL_padix (vTHX->Ipadix)
#define PL_padix_floor (vTHX->Ipadix_floor)
-#define PL_parsehook (vTHX->Iparsehook)
#define PL_patchlevel (vTHX->Ipatchlevel)
#define PL_pending_ident (vTHX->Ipending_ident)
#define PL_perl_destruct_level (vTHX->Iperl_destruct_level)
#define PL_preambled (vTHX->Ipreambled)
#define PL_preprocess (vTHX->Ipreprocess)
#define PL_profiledata (vTHX->Iprofiledata)
+#define PL_psig_name (vTHX->Ipsig_name)
+#define PL_psig_ptr (vTHX->Ipsig_ptr)
+#define PL_ptr_table (vTHX->Iptr_table)
#define PL_replgv (vTHX->Ireplgv)
-#define PL_rightgv (vTHX->Irightgv)
#define PL_rsfp (vTHX->Irsfp)
#define PL_rsfp_filters (vTHX->Irsfp_filters)
#define PL_runops (vTHX->Irunops)
#define PL_sawampersand (vTHX->Isawampersand)
-#define PL_sawstudy (vTHX->Isawstudy)
-#define PL_sawvec (vTHX->Isawvec)
#define PL_sh_path (vTHX->Ish_path)
-#define PL_siggv (vTHX->Isiggv)
#define PL_sighandlerp (vTHX->Isighandlerp)
#define PL_splitstr (vTHX->Isplitstr)
#define PL_srand_called (vTHX->Isrand_called)
#define PL_statusvalue (vTHX->Istatusvalue)
#define PL_statusvalue_vms (vTHX->Istatusvalue_vms)
+#define PL_stderrgv (vTHX->Istderrgv)
#define PL_stdingv (vTHX->Istdingv)
-#define PL_strchop (vTHX->Istrchop)
+#define PL_stopav (vTHX->Istopav)
#define PL_strtab (vTHX->Istrtab)
#define PL_strtab_mutex (vTHX->Istrtab_mutex)
#define PL_sub_generation (vTHX->Isub_generation)
#define PL_svref_mutex (vTHX->Isvref_mutex)
#define PL_sys_intern (vTHX->Isys_intern)
#define PL_tainting (vTHX->Itainting)
-#define PL_thisexpr (vTHX->Ithisexpr)
#define PL_thr_key (vTHX->Ithr_key)
#define PL_threadnum (vTHX->Ithreadnum)
#define PL_threads_mutex (vTHX->Ithreads_mutex)
# endif /* USE_THREADS */
#else /* !MULTIPLICITY */
-/* cases 1, 4 and 6 above */
+
+# if defined(PERL_OBJECT)
+/* case 6 above */
+
+#define PL_Sv (aTHXo->interp.TSv)
+#define PL_Xpv (aTHXo->interp.TXpv)
+#define PL_av_fetch_sv (aTHXo->interp.Tav_fetch_sv)
+#define PL_bodytarget (aTHXo->interp.Tbodytarget)
+#define PL_bostr (aTHXo->interp.Tbostr)
+#define PL_chopset (aTHXo->interp.Tchopset)
+#define PL_colors (aTHXo->interp.Tcolors)
+#define PL_colorset (aTHXo->interp.Tcolorset)
+#define PL_curcop (aTHXo->interp.Tcurcop)
+#define PL_curpad (aTHXo->interp.Tcurpad)
+#define PL_curpm (aTHXo->interp.Tcurpm)
+#define PL_curstack (aTHXo->interp.Tcurstack)
+#define PL_curstackinfo (aTHXo->interp.Tcurstackinfo)
+#define PL_curstash (aTHXo->interp.Tcurstash)
+#define PL_defoutgv (aTHXo->interp.Tdefoutgv)
+#define PL_defstash (aTHXo->interp.Tdefstash)
+#define PL_delaymagic (aTHXo->interp.Tdelaymagic)
+#define PL_dirty (aTHXo->interp.Tdirty)
+#define PL_dumpindent (aTHXo->interp.Tdumpindent)
+#define PL_efloatbuf (aTHXo->interp.Tefloatbuf)
+#define PL_efloatsize (aTHXo->interp.Tefloatsize)
+#define PL_errors (aTHXo->interp.Terrors)
+#define PL_extralen (aTHXo->interp.Textralen)
+#define PL_firstgv (aTHXo->interp.Tfirstgv)
+#define PL_formtarget (aTHXo->interp.Tformtarget)
+#define PL_hv_fetch_ent_mh (aTHXo->interp.Thv_fetch_ent_mh)
+#define PL_hv_fetch_sv (aTHXo->interp.Thv_fetch_sv)
+#define PL_in_eval (aTHXo->interp.Tin_eval)
+#define PL_last_in_gv (aTHXo->interp.Tlast_in_gv)
+#define PL_lastgotoprobe (aTHXo->interp.Tlastgotoprobe)
+#define PL_lastscream (aTHXo->interp.Tlastscream)
+#define PL_localizing (aTHXo->interp.Tlocalizing)
+#define PL_mainstack (aTHXo->interp.Tmainstack)
+#define PL_markstack (aTHXo->interp.Tmarkstack)
+#define PL_markstack_max (aTHXo->interp.Tmarkstack_max)
+#define PL_markstack_ptr (aTHXo->interp.Tmarkstack_ptr)
+#define PL_maxscream (aTHXo->interp.Tmaxscream)
+#define PL_modcount (aTHXo->interp.Tmodcount)
+#define PL_na (aTHXo->interp.Tna)
+#define PL_nrs (aTHXo->interp.Tnrs)
+#define PL_ofs (aTHXo->interp.Tofs)
+#define PL_ofslen (aTHXo->interp.Tofslen)
+#define PL_op (aTHXo->interp.Top)
+#define PL_opsave (aTHXo->interp.Topsave)
+#define PL_protect (aTHXo->interp.Tprotect)
+#define PL_reg_call_cc (aTHXo->interp.Treg_call_cc)
+#define PL_reg_curpm (aTHXo->interp.Treg_curpm)
+#define PL_reg_eval_set (aTHXo->interp.Treg_eval_set)
+#define PL_reg_flags (aTHXo->interp.Treg_flags)
+#define PL_reg_ganch (aTHXo->interp.Treg_ganch)
+#define PL_reg_leftiter (aTHXo->interp.Treg_leftiter)
+#define PL_reg_magic (aTHXo->interp.Treg_magic)
+#define PL_reg_maxiter (aTHXo->interp.Treg_maxiter)
+#define PL_reg_oldcurpm (aTHXo->interp.Treg_oldcurpm)
+#define PL_reg_oldpos (aTHXo->interp.Treg_oldpos)
+#define PL_reg_oldsaved (aTHXo->interp.Treg_oldsaved)
+#define PL_reg_oldsavedlen (aTHXo->interp.Treg_oldsavedlen)
+#define PL_reg_poscache (aTHXo->interp.Treg_poscache)
+#define PL_reg_poscache_size (aTHXo->interp.Treg_poscache_size)
+#define PL_reg_re (aTHXo->interp.Treg_re)
+#define PL_reg_start_tmp (aTHXo->interp.Treg_start_tmp)
+#define PL_reg_start_tmpl (aTHXo->interp.Treg_start_tmpl)
+#define PL_reg_starttry (aTHXo->interp.Treg_starttry)
+#define PL_reg_sv (aTHXo->interp.Treg_sv)
+#define PL_reg_whilem_seen (aTHXo->interp.Treg_whilem_seen)
+#define PL_regbol (aTHXo->interp.Tregbol)
+#define PL_regcc (aTHXo->interp.Tregcc)
+#define PL_regcode (aTHXo->interp.Tregcode)
+#define PL_regcomp_parse (aTHXo->interp.Tregcomp_parse)
+#define PL_regcomp_rx (aTHXo->interp.Tregcomp_rx)
+#define PL_regcompp (aTHXo->interp.Tregcompp)
+#define PL_regdata (aTHXo->interp.Tregdata)
+#define PL_regdummy (aTHXo->interp.Tregdummy)
+#define PL_regendp (aTHXo->interp.Tregendp)
+#define PL_regeol (aTHXo->interp.Tregeol)
+#define PL_regexecp (aTHXo->interp.Tregexecp)
+#define PL_regflags (aTHXo->interp.Tregflags)
+#define PL_regfree (aTHXo->interp.Tregfree)
+#define PL_regindent (aTHXo->interp.Tregindent)
+#define PL_reginput (aTHXo->interp.Treginput)
+#define PL_regint_start (aTHXo->interp.Tregint_start)
+#define PL_regint_string (aTHXo->interp.Tregint_string)
+#define PL_reginterp_cnt (aTHXo->interp.Treginterp_cnt)
+#define PL_reglastparen (aTHXo->interp.Treglastparen)
+#define PL_regnarrate (aTHXo->interp.Tregnarrate)
+#define PL_regnaughty (aTHXo->interp.Tregnaughty)
+#define PL_regnpar (aTHXo->interp.Tregnpar)
+#define PL_regprecomp (aTHXo->interp.Tregprecomp)
+#define PL_regprev (aTHXo->interp.Tregprev)
+#define PL_regprogram (aTHXo->interp.Tregprogram)
+#define PL_regsawback (aTHXo->interp.Tregsawback)
+#define PL_regseen (aTHXo->interp.Tregseen)
+#define PL_regsize (aTHXo->interp.Tregsize)
+#define PL_regstartp (aTHXo->interp.Tregstartp)
+#define PL_regtill (aTHXo->interp.Tregtill)
+#define PL_regxend (aTHXo->interp.Tregxend)
+#define PL_restartop (aTHXo->interp.Trestartop)
+#define PL_retstack (aTHXo->interp.Tretstack)
+#define PL_retstack_ix (aTHXo->interp.Tretstack_ix)
+#define PL_retstack_max (aTHXo->interp.Tretstack_max)
+#define PL_rs (aTHXo->interp.Trs)
+#define PL_savestack (aTHXo->interp.Tsavestack)
+#define PL_savestack_ix (aTHXo->interp.Tsavestack_ix)
+#define PL_savestack_max (aTHXo->interp.Tsavestack_max)
+#define PL_scopestack (aTHXo->interp.Tscopestack)
+#define PL_scopestack_ix (aTHXo->interp.Tscopestack_ix)
+#define PL_scopestack_max (aTHXo->interp.Tscopestack_max)
+#define PL_screamfirst (aTHXo->interp.Tscreamfirst)
+#define PL_screamnext (aTHXo->interp.Tscreamnext)
+#define PL_secondgv (aTHXo->interp.Tsecondgv)
+#define PL_seen_evals (aTHXo->interp.Tseen_evals)
+#define PL_seen_zerolen (aTHXo->interp.Tseen_zerolen)
+#define PL_sortcop (aTHXo->interp.Tsortcop)
+#define PL_sortcxix (aTHXo->interp.Tsortcxix)
+#define PL_sortstash (aTHXo->interp.Tsortstash)
+#define PL_stack_base (aTHXo->interp.Tstack_base)
+#define PL_stack_max (aTHXo->interp.Tstack_max)
+#define PL_stack_sp (aTHXo->interp.Tstack_sp)
+#define PL_start_env (aTHXo->interp.Tstart_env)
+#define PL_statbuf (aTHXo->interp.Tstatbuf)
+#define PL_statcache (aTHXo->interp.Tstatcache)
+#define PL_statgv (aTHXo->interp.Tstatgv)
+#define PL_statname (aTHXo->interp.Tstatname)
+#define PL_tainted (aTHXo->interp.Ttainted)
+#define PL_timesbuf (aTHXo->interp.Ttimesbuf)
+#define PL_tmps_floor (aTHXo->interp.Ttmps_floor)
+#define PL_tmps_ix (aTHXo->interp.Ttmps_ix)
+#define PL_tmps_max (aTHXo->interp.Ttmps_max)
+#define PL_tmps_stack (aTHXo->interp.Ttmps_stack)
+#define PL_top_env (aTHXo->interp.Ttop_env)
+#define PL_toptarget (aTHXo->interp.Ttoptarget)
+#define PL_watchaddr (aTHXo->interp.Twatchaddr)
+#define PL_watchok (aTHXo->interp.Twatchok)
+#define PL_Argv (aTHXo->interp.IArgv)
+#define PL_Cmd (aTHXo->interp.ICmd)
+#define PL_DBcv (aTHXo->interp.IDBcv)
+#define PL_DBgv (aTHXo->interp.IDBgv)
+#define PL_DBline (aTHXo->interp.IDBline)
+#define PL_DBsignal (aTHXo->interp.IDBsignal)
+#define PL_DBsingle (aTHXo->interp.IDBsingle)
+#define PL_DBsub (aTHXo->interp.IDBsub)
+#define PL_DBtrace (aTHXo->interp.IDBtrace)
+#define PL_Dir (aTHXo->interp.IDir)
+#define PL_Env (aTHXo->interp.IEnv)
+#define PL_LIO (aTHXo->interp.ILIO)
+#define PL_Mem (aTHXo->interp.IMem)
+#define PL_MemParse (aTHXo->interp.IMemParse)
+#define PL_MemShared (aTHXo->interp.IMemShared)
+#define PL_Proc (aTHXo->interp.IProc)
+#define PL_Sock (aTHXo->interp.ISock)
+#define PL_StdIO (aTHXo->interp.IStdIO)
+#define PL_amagic_generation (aTHXo->interp.Iamagic_generation)
+#define PL_an (aTHXo->interp.Ian)
+#define PL_argvgv (aTHXo->interp.Iargvgv)
+#define PL_argvout_stack (aTHXo->interp.Iargvout_stack)
+#define PL_argvoutgv (aTHXo->interp.Iargvoutgv)
+#define PL_basetime (aTHXo->interp.Ibasetime)
+#define PL_beginav (aTHXo->interp.Ibeginav)
+#define PL_bitcount (aTHXo->interp.Ibitcount)
+#define PL_bufend (aTHXo->interp.Ibufend)
+#define PL_bufptr (aTHXo->interp.Ibufptr)
+#define PL_collation_ix (aTHXo->interp.Icollation_ix)
+#define PL_collation_name (aTHXo->interp.Icollation_name)
+#define PL_collation_standard (aTHXo->interp.Icollation_standard)
+#define PL_collxfrm_base (aTHXo->interp.Icollxfrm_base)
+#define PL_collxfrm_mult (aTHXo->interp.Icollxfrm_mult)
+#define PL_compcv (aTHXo->interp.Icompcv)
+#define PL_compiling (aTHXo->interp.Icompiling)
+#define PL_comppad (aTHXo->interp.Icomppad)
+#define PL_comppad_name (aTHXo->interp.Icomppad_name)
+#define PL_comppad_name_fill (aTHXo->interp.Icomppad_name_fill)
+#define PL_comppad_name_floor (aTHXo->interp.Icomppad_name_floor)
+#define PL_cop_seqmax (aTHXo->interp.Icop_seqmax)
+#define PL_copline (aTHXo->interp.Icopline)
+#define PL_cred_mutex (aTHXo->interp.Icred_mutex)
+#define PL_cryptseen (aTHXo->interp.Icryptseen)
+#define PL_cshlen (aTHXo->interp.Icshlen)
+#define PL_cshname (aTHXo->interp.Icshname)
+#define PL_curcopdb (aTHXo->interp.Icurcopdb)
+#define PL_curstname (aTHXo->interp.Icurstname)
+#define PL_curthr (aTHXo->interp.Icurthr)
+#define PL_dbargs (aTHXo->interp.Idbargs)
+#define PL_debstash (aTHXo->interp.Idebstash)
+#define PL_debug (aTHXo->interp.Idebug)
+#define PL_defgv (aTHXo->interp.Idefgv)
+#define PL_diehook (aTHXo->interp.Idiehook)
+#define PL_doextract (aTHXo->interp.Idoextract)
+#define PL_doswitches (aTHXo->interp.Idoswitches)
+#define PL_dowarn (aTHXo->interp.Idowarn)
+#define PL_e_script (aTHXo->interp.Ie_script)
+#define PL_egid (aTHXo->interp.Iegid)
+#define PL_endav (aTHXo->interp.Iendav)
+#define PL_envgv (aTHXo->interp.Ienvgv)
+#define PL_errgv (aTHXo->interp.Ierrgv)
+#define PL_error_count (aTHXo->interp.Ierror_count)
+#define PL_euid (aTHXo->interp.Ieuid)
+#define PL_eval_cond (aTHXo->interp.Ieval_cond)
+#define PL_eval_mutex (aTHXo->interp.Ieval_mutex)
+#define PL_eval_owner (aTHXo->interp.Ieval_owner)
+#define PL_eval_root (aTHXo->interp.Ieval_root)
+#define PL_eval_start (aTHXo->interp.Ieval_start)
+#define PL_evalseq (aTHXo->interp.Ievalseq)
+#define PL_exit_flags (aTHXo->interp.Iexit_flags)
+#define PL_exitlist (aTHXo->interp.Iexitlist)
+#define PL_exitlistlen (aTHXo->interp.Iexitlistlen)
+#define PL_expect (aTHXo->interp.Iexpect)
+#define PL_fdpid (aTHXo->interp.Ifdpid)
+#define PL_filemode (aTHXo->interp.Ifilemode)
+#define PL_forkprocess (aTHXo->interp.Iforkprocess)
+#define PL_formfeed (aTHXo->interp.Iformfeed)
+#define PL_generation (aTHXo->interp.Igeneration)
+#define PL_gensym (aTHXo->interp.Igensym)
+#define PL_gid (aTHXo->interp.Igid)
+#define PL_glob_index (aTHXo->interp.Iglob_index)
+#define PL_globalstash (aTHXo->interp.Iglobalstash)
+#define PL_he_root (aTHXo->interp.Ihe_root)
+#define PL_hintgv (aTHXo->interp.Ihintgv)
+#define PL_hints (aTHXo->interp.Ihints)
+#define PL_in_clean_all (aTHXo->interp.Iin_clean_all)
+#define PL_in_clean_objs (aTHXo->interp.Iin_clean_objs)
+#define PL_in_my (aTHXo->interp.Iin_my)
+#define PL_in_my_stash (aTHXo->interp.Iin_my_stash)
+#define PL_incgv (aTHXo->interp.Iincgv)
+#define PL_initav (aTHXo->interp.Iinitav)
+#define PL_inplace (aTHXo->interp.Iinplace)
+#define PL_last_lop (aTHXo->interp.Ilast_lop)
+#define PL_last_lop_op (aTHXo->interp.Ilast_lop_op)
+#define PL_last_swash_hv (aTHXo->interp.Ilast_swash_hv)
+#define PL_last_swash_key (aTHXo->interp.Ilast_swash_key)
+#define PL_last_swash_klen (aTHXo->interp.Ilast_swash_klen)
+#define PL_last_swash_slen (aTHXo->interp.Ilast_swash_slen)
+#define PL_last_swash_tmps (aTHXo->interp.Ilast_swash_tmps)
+#define PL_last_uni (aTHXo->interp.Ilast_uni)
+#define PL_lastfd (aTHXo->interp.Ilastfd)
+#define PL_laststatval (aTHXo->interp.Ilaststatval)
+#define PL_laststype (aTHXo->interp.Ilaststype)
+#define PL_lex_brackets (aTHXo->interp.Ilex_brackets)
+#define PL_lex_brackstack (aTHXo->interp.Ilex_brackstack)
+#define PL_lex_casemods (aTHXo->interp.Ilex_casemods)
+#define PL_lex_casestack (aTHXo->interp.Ilex_casestack)
+#define PL_lex_defer (aTHXo->interp.Ilex_defer)
+#define PL_lex_dojoin (aTHXo->interp.Ilex_dojoin)
+#define PL_lex_expect (aTHXo->interp.Ilex_expect)
+#define PL_lex_formbrack (aTHXo->interp.Ilex_formbrack)
+#define PL_lex_inpat (aTHXo->interp.Ilex_inpat)
+#define PL_lex_inwhat (aTHXo->interp.Ilex_inwhat)
+#define PL_lex_op (aTHXo->interp.Ilex_op)
+#define PL_lex_repl (aTHXo->interp.Ilex_repl)
+#define PL_lex_starts (aTHXo->interp.Ilex_starts)
+#define PL_lex_state (aTHXo->interp.Ilex_state)
+#define PL_lex_stuff (aTHXo->interp.Ilex_stuff)
+#define PL_lineary (aTHXo->interp.Ilineary)
+#define PL_linestart (aTHXo->interp.Ilinestart)
+#define PL_linestr (aTHXo->interp.Ilinestr)
+#define PL_localpatches (aTHXo->interp.Ilocalpatches)
+#define PL_main_cv (aTHXo->interp.Imain_cv)
+#define PL_main_root (aTHXo->interp.Imain_root)
+#define PL_main_start (aTHXo->interp.Imain_start)
+#define PL_max_intro_pending (aTHXo->interp.Imax_intro_pending)
+#define PL_maxo (aTHXo->interp.Imaxo)
+#define PL_maxsysfd (aTHXo->interp.Imaxsysfd)
+#define PL_mess_sv (aTHXo->interp.Imess_sv)
+#define PL_min_intro_pending (aTHXo->interp.Imin_intro_pending)
+#define PL_minus_F (aTHXo->interp.Iminus_F)
+#define PL_minus_a (aTHXo->interp.Iminus_a)
+#define PL_minus_c (aTHXo->interp.Iminus_c)
+#define PL_minus_l (aTHXo->interp.Iminus_l)
+#define PL_minus_n (aTHXo->interp.Iminus_n)
+#define PL_minus_p (aTHXo->interp.Iminus_p)
+#define PL_modglobal (aTHXo->interp.Imodglobal)
+#define PL_multi_close (aTHXo->interp.Imulti_close)
+#define PL_multi_end (aTHXo->interp.Imulti_end)
+#define PL_multi_open (aTHXo->interp.Imulti_open)
+#define PL_multi_start (aTHXo->interp.Imulti_start)
+#define PL_multiline (aTHXo->interp.Imultiline)
+#define PL_nexttoke (aTHXo->interp.Inexttoke)
+#define PL_nexttype (aTHXo->interp.Inexttype)
+#define PL_nextval (aTHXo->interp.Inextval)
+#define PL_nice_chunk (aTHXo->interp.Inice_chunk)
+#define PL_nice_chunk_size (aTHXo->interp.Inice_chunk_size)
+#define PL_nomemok (aTHXo->interp.Inomemok)
+#define PL_nthreads (aTHXo->interp.Inthreads)
+#define PL_nthreads_cond (aTHXo->interp.Inthreads_cond)
+#define PL_numeric_local (aTHXo->interp.Inumeric_local)
+#define PL_numeric_name (aTHXo->interp.Inumeric_name)
+#define PL_numeric_radix (aTHXo->interp.Inumeric_radix)
+#define PL_numeric_standard (aTHXo->interp.Inumeric_standard)
+#define PL_ofmt (aTHXo->interp.Iofmt)
+#define PL_oldbufptr (aTHXo->interp.Ioldbufptr)
+#define PL_oldname (aTHXo->interp.Ioldname)
+#define PL_oldoldbufptr (aTHXo->interp.Ioldoldbufptr)
+#define PL_op_mask (aTHXo->interp.Iop_mask)
+#define PL_op_seqmax (aTHXo->interp.Iop_seqmax)
+#define PL_origalen (aTHXo->interp.Iorigalen)
+#define PL_origargc (aTHXo->interp.Iorigargc)
+#define PL_origargv (aTHXo->interp.Iorigargv)
+#define PL_origenviron (aTHXo->interp.Iorigenviron)
+#define PL_origfilename (aTHXo->interp.Iorigfilename)
+#define PL_ors (aTHXo->interp.Iors)
+#define PL_orslen (aTHXo->interp.Iorslen)
+#define PL_osname (aTHXo->interp.Iosname)
+#define PL_pad_reset_pending (aTHXo->interp.Ipad_reset_pending)
+#define PL_padix (aTHXo->interp.Ipadix)
+#define PL_padix_floor (aTHXo->interp.Ipadix_floor)
+#define PL_patchlevel (aTHXo->interp.Ipatchlevel)
+#define PL_pending_ident (aTHXo->interp.Ipending_ident)
+#define PL_perl_destruct_level (aTHXo->interp.Iperl_destruct_level)
+#define PL_perldb (aTHXo->interp.Iperldb)
+#define PL_pidstatus (aTHXo->interp.Ipidstatus)
+#define PL_preambleav (aTHXo->interp.Ipreambleav)
+#define PL_preambled (aTHXo->interp.Ipreambled)
+#define PL_preprocess (aTHXo->interp.Ipreprocess)
+#define PL_profiledata (aTHXo->interp.Iprofiledata)
+#define PL_psig_name (aTHXo->interp.Ipsig_name)
+#define PL_psig_ptr (aTHXo->interp.Ipsig_ptr)
+#define PL_ptr_table (aTHXo->interp.Iptr_table)
+#define PL_replgv (aTHXo->interp.Ireplgv)
+#define PL_rsfp (aTHXo->interp.Irsfp)
+#define PL_rsfp_filters (aTHXo->interp.Irsfp_filters)
+#define PL_runops (aTHXo->interp.Irunops)
+#define PL_sawampersand (aTHXo->interp.Isawampersand)
+#define PL_sh_path (aTHXo->interp.Ish_path)
+#define PL_sighandlerp (aTHXo->interp.Isighandlerp)
+#define PL_splitstr (aTHXo->interp.Isplitstr)
+#define PL_srand_called (aTHXo->interp.Isrand_called)
+#define PL_statusvalue (aTHXo->interp.Istatusvalue)
+#define PL_statusvalue_vms (aTHXo->interp.Istatusvalue_vms)
+#define PL_stderrgv (aTHXo->interp.Istderrgv)
+#define PL_stdingv (aTHXo->interp.Istdingv)
+#define PL_stopav (aTHXo->interp.Istopav)
+#define PL_strtab (aTHXo->interp.Istrtab)
+#define PL_strtab_mutex (aTHXo->interp.Istrtab_mutex)
+#define PL_sub_generation (aTHXo->interp.Isub_generation)
+#define PL_sublex_info (aTHXo->interp.Isublex_info)
+#define PL_subline (aTHXo->interp.Isubline)
+#define PL_subname (aTHXo->interp.Isubname)
+#define PL_sv_arenaroot (aTHXo->interp.Isv_arenaroot)
+#define PL_sv_count (aTHXo->interp.Isv_count)
+#define PL_sv_mutex (aTHXo->interp.Isv_mutex)
+#define PL_sv_no (aTHXo->interp.Isv_no)
+#define PL_sv_objcount (aTHXo->interp.Isv_objcount)
+#define PL_sv_root (aTHXo->interp.Isv_root)
+#define PL_sv_undef (aTHXo->interp.Isv_undef)
+#define PL_sv_yes (aTHXo->interp.Isv_yes)
+#define PL_svref_mutex (aTHXo->interp.Isvref_mutex)
+#define PL_sys_intern (aTHXo->interp.Isys_intern)
+#define PL_tainting (aTHXo->interp.Itainting)
+#define PL_thr_key (aTHXo->interp.Ithr_key)
+#define PL_threadnum (aTHXo->interp.Ithreadnum)
+#define PL_threads_mutex (aTHXo->interp.Ithreads_mutex)
+#define PL_threadsv_names (aTHXo->interp.Ithreadsv_names)
+#define PL_thrsv (aTHXo->interp.Ithrsv)
+#define PL_tokenbuf (aTHXo->interp.Itokenbuf)
+#define PL_uid (aTHXo->interp.Iuid)
+#define PL_unsafe (aTHXo->interp.Iunsafe)
+#define PL_utf8_alnum (aTHXo->interp.Iutf8_alnum)
+#define PL_utf8_alnumc (aTHXo->interp.Iutf8_alnumc)
+#define PL_utf8_alpha (aTHXo->interp.Iutf8_alpha)
+#define PL_utf8_ascii (aTHXo->interp.Iutf8_ascii)
+#define PL_utf8_cntrl (aTHXo->interp.Iutf8_cntrl)
+#define PL_utf8_digit (aTHXo->interp.Iutf8_digit)
+#define PL_utf8_graph (aTHXo->interp.Iutf8_graph)
+#define PL_utf8_lower (aTHXo->interp.Iutf8_lower)
+#define PL_utf8_mark (aTHXo->interp.Iutf8_mark)
+#define PL_utf8_print (aTHXo->interp.Iutf8_print)
+#define PL_utf8_punct (aTHXo->interp.Iutf8_punct)
+#define PL_utf8_space (aTHXo->interp.Iutf8_space)
+#define PL_utf8_tolower (aTHXo->interp.Iutf8_tolower)
+#define PL_utf8_totitle (aTHXo->interp.Iutf8_totitle)
+#define PL_utf8_toupper (aTHXo->interp.Iutf8_toupper)
+#define PL_utf8_upper (aTHXo->interp.Iutf8_upper)
+#define PL_utf8_xdigit (aTHXo->interp.Iutf8_xdigit)
+#define PL_uudmap (aTHXo->interp.Iuudmap)
+#define PL_warnhook (aTHXo->interp.Iwarnhook)
+#define PL_xiv_arenaroot (aTHXo->interp.Ixiv_arenaroot)
+#define PL_xiv_root (aTHXo->interp.Ixiv_root)
+#define PL_xnv_root (aTHXo->interp.Ixnv_root)
+#define PL_xpv_root (aTHXo->interp.Ixpv_root)
+#define PL_xpvav_root (aTHXo->interp.Ixpvav_root)
+#define PL_xpvbm_root (aTHXo->interp.Ixpvbm_root)
+#define PL_xpvcv_root (aTHXo->interp.Ixpvcv_root)
+#define PL_xpvhv_root (aTHXo->interp.Ixpvhv_root)
+#define PL_xpviv_root (aTHXo->interp.Ixpviv_root)
+#define PL_xpvlv_root (aTHXo->interp.Ixpvlv_root)
+#define PL_xpvmg_root (aTHXo->interp.Ixpvmg_root)
+#define PL_xpvnv_root (aTHXo->interp.Ixpvnv_root)
+#define PL_xrv_root (aTHXo->interp.Ixrv_root)
+#define PL_yychar (aTHXo->interp.Iyychar)
+#define PL_yydebug (aTHXo->interp.Iyydebug)
+#define PL_yyerrflag (aTHXo->interp.Iyyerrflag)
+#define PL_yylval (aTHXo->interp.Iyylval)
+#define PL_yynerrs (aTHXo->interp.Iyynerrs)
+#define PL_yyval (aTHXo->interp.Iyyval)
+
+# else /* !PERL_OBJECT */
+
+/* cases 1 and 4 above */
#define PL_IArgv PL_Argv
#define PL_ICmd PL_Cmd
#define PL_IEnv PL_Env
#define PL_ILIO PL_LIO
#define PL_IMem PL_Mem
+#define PL_IMemParse PL_MemParse
+#define PL_IMemShared PL_MemShared
#define PL_IProc PL_Proc
#define PL_ISock PL_Sock
#define PL_IStdIO PL_StdIO
#define PL_Iamagic_generation PL_amagic_generation
-#define PL_Iampergv PL_ampergv
#define PL_Ian PL_an
-#define PL_Iarchpat_auto PL_archpat_auto
#define PL_Iargvgv PL_argvgv
+#define PL_Iargvout_stack PL_argvout_stack
#define PL_Iargvoutgv PL_argvoutgv
#define PL_Ibasetime PL_basetime
#define PL_Ibeginav PL_beginav
#define PL_Ibitcount PL_bitcount
#define PL_Ibufend PL_bufend
#define PL_Ibufptr PL_bufptr
-#define PL_Icddir PL_cddir
#define PL_Icollation_ix PL_collation_ix
#define PL_Icollation_name PL_collation_name
#define PL_Icollation_standard PL_collation_standard
#define PL_Icurstname PL_curstname
#define PL_Icurthr PL_curthr
#define PL_Idbargs PL_dbargs
-#define PL_Idebdelim PL_debdelim
-#define PL_Idebname PL_debname
#define PL_Idebstash PL_debstash
#define PL_Idebug PL_debug
#define PL_Idefgv PL_defgv
#define PL_Idiehook PL_diehook
-#define PL_Idlevel PL_dlevel
-#define PL_Idlmax PL_dlmax
#define PL_Idoextract PL_doextract
#define PL_Idoswitches PL_doswitches
#define PL_Idowarn PL_dowarn
#define PL_Ieval_root PL_eval_root
#define PL_Ieval_start PL_eval_start
#define PL_Ievalseq PL_evalseq
+#define PL_Iexit_flags PL_exit_flags
#define PL_Iexitlist PL_exitlist
#define PL_Iexitlistlen PL_exitlistlen
#define PL_Iexpect PL_expect
#define PL_Ifdpid PL_fdpid
#define PL_Ifilemode PL_filemode
-#define PL_Ifilter_debug PL_filter_debug
#define PL_Iforkprocess PL_forkprocess
#define PL_Iformfeed PL_formfeed
#define PL_Igeneration PL_generation
#define PL_Ilast_swash_tmps PL_last_swash_tmps
#define PL_Ilast_uni PL_last_uni
#define PL_Ilastfd PL_lastfd
-#define PL_Ilastsize PL_lastsize
-#define PL_Ilastspbase PL_lastspbase
#define PL_Ilaststatval PL_laststatval
#define PL_Ilaststype PL_laststype
-#define PL_Ileftgv PL_leftgv
#define PL_Ilex_brackets PL_lex_brackets
#define PL_Ilex_brackstack PL_lex_brackstack
#define PL_Ilex_casemods PL_lex_casemods
#define PL_Ilex_defer PL_lex_defer
#define PL_Ilex_dojoin PL_lex_dojoin
#define PL_Ilex_expect PL_lex_expect
-#define PL_Ilex_fakebrack PL_lex_fakebrack
#define PL_Ilex_formbrack PL_lex_formbrack
#define PL_Ilex_inpat PL_lex_inpat
#define PL_Ilex_inwhat PL_lex_inwhat
#define PL_Imain_cv PL_main_cv
#define PL_Imain_root PL_main_root
#define PL_Imain_start PL_main_start
-#define PL_Imalloc_mutex PL_malloc_mutex
#define PL_Imax_intro_pending PL_max_intro_pending
#define PL_Imaxo PL_maxo
#define PL_Imaxsysfd PL_maxsysfd
#define PL_Imulti_open PL_multi_open
#define PL_Imulti_start PL_multi_start
#define PL_Imultiline PL_multiline
-#define PL_Imystrk PL_mystrk
#define PL_Inexttoke PL_nexttoke
#define PL_Inexttype PL_nexttype
#define PL_Inextval PL_nextval
#define PL_Inumeric_standard PL_numeric_standard
#define PL_Iofmt PL_ofmt
#define PL_Ioldbufptr PL_oldbufptr
-#define PL_Ioldlastpm PL_oldlastpm
#define PL_Ioldname PL_oldname
#define PL_Ioldoldbufptr PL_oldoldbufptr
#define PL_Iop_mask PL_op_mask
#define PL_Ipad_reset_pending PL_pad_reset_pending
#define PL_Ipadix PL_padix
#define PL_Ipadix_floor PL_padix_floor
-#define PL_Iparsehook PL_parsehook
#define PL_Ipatchlevel PL_patchlevel
#define PL_Ipending_ident PL_pending_ident
#define PL_Iperl_destruct_level PL_perl_destruct_level
#define PL_Ipreambled PL_preambled
#define PL_Ipreprocess PL_preprocess
#define PL_Iprofiledata PL_profiledata
+#define PL_Ipsig_name PL_psig_name
+#define PL_Ipsig_ptr PL_psig_ptr
+#define PL_Iptr_table PL_ptr_table
#define PL_Ireplgv PL_replgv
-#define PL_Irightgv PL_rightgv
#define PL_Irsfp PL_rsfp
#define PL_Irsfp_filters PL_rsfp_filters
#define PL_Irunops PL_runops
#define PL_Isawampersand PL_sawampersand
-#define PL_Isawstudy PL_sawstudy
-#define PL_Isawvec PL_sawvec
#define PL_Ish_path PL_sh_path
-#define PL_Isiggv PL_siggv
#define PL_Isighandlerp PL_sighandlerp
#define PL_Isplitstr PL_splitstr
#define PL_Isrand_called PL_srand_called
#define PL_Istatusvalue PL_statusvalue
#define PL_Istatusvalue_vms PL_statusvalue_vms
+#define PL_Istderrgv PL_stderrgv
#define PL_Istdingv PL_stdingv
-#define PL_Istrchop PL_strchop
+#define PL_Istopav PL_stopav
#define PL_Istrtab PL_strtab
#define PL_Istrtab_mutex PL_strtab_mutex
#define PL_Isub_generation PL_sub_generation
#define PL_Isvref_mutex PL_svref_mutex
#define PL_Isys_intern PL_sys_intern
#define PL_Itainting PL_tainting
-#define PL_Ithisexpr PL_thisexpr
#define PL_Ithr_key PL_thr_key
#define PL_Ithreadnum PL_threadnum
#define PL_Ithreads_mutex PL_threads_mutex
#define PL_Iyynerrs PL_yynerrs
#define PL_Iyyval PL_yyval
-# if defined(USE_THREADS)
+# if defined(USE_THREADS)
/* case 4 above */
#define PL_Sv (aTHX->TSv)
#define PL_watchaddr (aTHX->Twatchaddr)
#define PL_watchok (aTHX->Twatchok)
-# else /* !USE_THREADS */
-/* cases 1 and 6 above */
+# else /* !USE_THREADS */
+/* case 1 above */
#define PL_TSv PL_Sv
#define PL_TXpv PL_Xpv
#define PL_Twatchaddr PL_watchaddr
#define PL_Twatchok PL_watchok
-# endif /* USE_THREADS */
+# endif /* USE_THREADS */
+# endif /* PERL_OBJECT */
#endif /* MULTIPLICITY */
#if defined(PERL_GLOBAL_STRUCT)
#define PL_curinterp (PL_Vars.Gcurinterp)
#define PL_do_undump (PL_Vars.Gdo_undump)
#define PL_hexdigit (PL_Vars.Ghexdigit)
+#define PL_malloc_mutex (PL_Vars.Gmalloc_mutex)
#define PL_patleave (PL_Vars.Gpatleave)
#else /* !PERL_GLOBAL_STRUCT */
#define PL_Gcurinterp PL_curinterp
#define PL_Gdo_undump PL_do_undump
#define PL_Ghexdigit PL_hexdigit
+#define PL_Gmalloc_mutex PL_malloc_mutex
#define PL_Gpatleave PL_patleave
#endif /* PERL_GLOBAL_STRUCT */
+++ /dev/null
-/* This file (config_H) is a sample config.h file. If you are unable
- to successfully run Configure, copy this file to config.h and
- edit it to suit your system.
-*/
-/*
- * This file was produced by running the config_h.SH script, which
- * gets its values from config.sh, which is generally produced by
- * running Configure.
- *
- * Feel free to modify any of this as the need arises. Note, however,
- * that running config_h.SH again will wipe out any changes you've made.
- * For a more permanent change edit config.sh and rerun config_h.SH.
- *
- * $Id: Config_h.U,v 3.0.1.5 1997/02/28 14:57:43 ram Exp $
- */
-
-/*
- * Package name : perl5
- * Source directory : .
- * Configuration time: Sat May 22 00:43:12 EET DST 1999
- * Configured by : jhi
- * Target system : osf1 alpha.hut.fi v4.0 878 alpha
- */
-
-#ifndef _config_h_
-#define _config_h_
-
-#define EPOC 1
-#define PERL_CORE 1
-
-/* LOC_SED:
- * This symbol holds the complete pathname to the sed program.
- */
-/* #define LOC_SED "/usr/bin/sed" /**/
-
-/* BIN:
- * This symbol holds the path of the bin directory where the package will
- * be installed. Program must be prepared to deal with ~name substitution.
- */
-/* BIN_EXP:
- * This symbol is the filename expanded version of the BIN symbol, for
- * programs that do not want to deal with that at run-time.
- */
-#define BIN "/perl" /**/
-#define BIN_EXP "/perl" /**/
-
-/* HAS_ALARM:
- * This symbol, if defined, indicates that the alarm routine is
- * available.
- */
-/* #define HAS_ALARM /**/
-
-/* HASATTRIBUTE:
- * This symbol indicates the C compiler can check for function attributes,
- * such as printf formats. This is normally only supported by GNU cc.
- */
-#ifdef __MARM__
-#define HASATTRIBUTE / **/
-#endif
-#ifndef HASATTRIBUTE
-#define __attribute__(_arg_)
-#endif
-
-/* HAS_BCMP:
- * This symbol is defined if the bcmp() routine is available to
- * compare blocks of memory.
- */
-#define HAS_BCMP /**/
-
-/* HAS_BCOPY:
- * This symbol is defined if the bcopy() routine is available to
- * copy blocks of memory.
- */
-#define HAS_BCOPY /**/
-
-/* HAS_BZERO:
- * This symbol is defined if the bzero() routine is available to
- * set a memory block to 0.
- */
-#define HAS_BZERO /**/
-
-/* HAS_CHOWN:
- * This symbol, if defined, indicates that the chown routine is
- * available.
- */
-/*#define HAS_CHOWN /**/
-
-/* HAS_CHROOT:
- * This symbol, if defined, indicates that the chroot routine is
- * available.
- */
-/*#define HAS_CHROOT /**/
-
-/* HAS_CHSIZE:
- * This symbol, if defined, indicates that the chsize routine is available
- * to truncate files. You might need a -lx to get this routine.
- */
-/*#define HAS_CHSIZE / **/
-
-/* HASCONST:
- * This symbol, if defined, indicates that this C compiler knows about
- * the const type. There is no need to actually test for that symbol
- * within your programs. The mere use of the "const" keyword will
- * trigger the necessary tests.
- */
-#define HASCONST /**/
-#ifndef HASCONST
-#define const
-#endif
-
-/* HAS_CRYPT:
- * This symbol, if defined, indicates that the crypt routine is available
- * to encrypt passwords and the like.
- */
-/*#define HAS_CRYPT /**/
-
-/* HAS_CUSERID:
- * This symbol, if defined, indicates that the cuserid routine is
- * available to get character login names.
- */
-/*#define HAS_CUSERID /**/
-
-/* HAS_DBL_DIG:
- * This symbol, if defined, indicates that this system's <float.h>
- * or <limits.h> defines the symbol DBL_DIG, which is the number
- * of significant digits in a double precision number. If this
- * symbol is not defined, a guess of 15 is usually pretty good.
- */
-/*#define HAS_DBL_DIG /* */
-
-/* HAS_DIFFTIME:
- * This symbol, if defined, indicates that the difftime routine is
- * available.
- */
-#define HAS_DIFFTIME /**/
-
-/* HAS_DLERROR:
- * This symbol, if defined, indicates that the dlerror routine is
- * available to return a string describing the last error that
- * occurred from a call to dlopen(), dlclose() or dlsym().
- */
-/*#define HAS_DLERROR /**/
-
-/* SETUID_SCRIPTS_ARE_SECURE_NOW:
- * This symbol, if defined, indicates that the bug that prevents
- * setuid scripts from being secure is not present in this kernel.
- */
-/* DOSUID:
- * This symbol, if defined, indicates that the C program should
- * check the script that it is executing for setuid/setgid bits, and
- * attempt to emulate setuid/setgid on systems that have disabled
- * setuid #! scripts because the kernel can't do it securely.
- * It is up to the package designer to make sure that this emulation
- * is done securely. Among other things, it should do an fstat on
- * the script it just opened to make sure it really is a setuid/setgid
- * script, it should make sure the arguments passed correspond exactly
- * to the argument on the #! line, and it should not trust any
- * subprocesses to which it must pass the filename rather than the
- * file descriptor of the script to be executed.
- */
-/*#define SETUID_SCRIPTS_ARE_SECURE_NOW / **/
-/*#define DOSUID / **/
-
-/* HAS_DUP2:
- * This symbol, if defined, indicates that the dup2 routine is
- * available to duplicate file descriptors.
- */
-/*#define HAS_DUP2 /**/
-
-/* HAS_FCHMOD:
- * This symbol, if defined, indicates that the fchmod routine is available
- * to change mode of opened files. If unavailable, use chmod().
- */
-/*#define HAS_FCHMOD /**/
-
-/* HAS_FCHOWN:
- * This symbol, if defined, indicates that the fchown routine is available
- * to change ownership of opened files. If unavailable, use chown().
- */
-/*#define HAS_FCHOWN /**/
-
-/* HAS_FCNTL:
- * This symbol, if defined, indicates to the C program that
- * the fcntl() function exists.
- */
-/*#define HAS_FCNTL /**/
-
-/* HAS_FGETPOS:
- * This symbol, if defined, indicates that the fgetpos routine is
- * available to get the file position indicator, similar to ftell().
- */
-#define HAS_FGETPOS /**/
-
-/* FLEXFILENAMES:
- * This symbol, if defined, indicates that the system supports filenames
- * longer than 14 characters.
- */
-#define FLEXFILENAMES /**/
-
-/* HAS_FLOCK:
- * This symbol, if defined, indicates that the flock routine is
- * available to do file locking.
- */
-/*#define HAS_FLOCK /**/
-
-/* HAS_FORK:
- * This symbol, if defined, indicates that the fork routine is
- * available.
- */
-/*#define HAS_FORK /**/
-
-/* HAS_FSETPOS:
- * This symbol, if defined, indicates that the fsetpos routine is
- * available to set the file position indicator, similar to fseek().
- */
-#define HAS_FSETPOS /**/
-
-/* HAS_GETTIMEOFDAY:
- * This symbol, if defined, indicates that the gettimeofday() system
- * call is available for a sub-second accuracy clock. Usually, the file
- * <sys/resource.h> needs to be included (see I_SYS_RESOURCE).
- * The type "Timeval" should be used to refer to "struct timeval".
- */
-#define HAS_GETTIMEOFDAY /**/
-#ifdef HAS_GETTIMEOFDAY
-#define Timeval struct timeval /* Structure used by gettimeofday() */
-#endif
-
-/* HAS_GETGROUPS:
- * This symbol, if defined, indicates that the getgroups() routine is
- * available to get the list of process groups. If unavailable, multiple
- * groups are probably not supported.
- */
-/*#define HAS_GETGROUPS /**/
-
-/* HAS_GETLOGIN:
- * This symbol, if defined, indicates that the getlogin routine is
- * available to get the login name.
- */
-/*#define HAS_GETLOGIN /**/
-
-/* HAS_GETPGID:
- * This symbol, if defined, indicates to the C program that
- * the getpgid(pid) function is available to get the
- * process group id.
- */
-/*#define HAS_GETPGID /**/
-
-/* HAS_GETPGRP:
- * This symbol, if defined, indicates that the getpgrp routine is
- * available to get the current process group.
- */
-/* USE_BSD_GETPGRP:
- * This symbol, if defined, indicates that getpgrp needs one
- * arguments whereas USG one needs none.
- */
-/*#define HAS_GETPGRP /**/
-/*#define USE_BSD_GETPGRP / **/
-
-/* HAS_GETPGRP2:
- * This symbol, if defined, indicates that the getpgrp2() (as in DG/UX)
- * routine is available to get the current process group.
- */
-/*#define HAS_GETPGRP2 / **/
-
-/* HAS_GETPPID:
- * This symbol, if defined, indicates that the getppid routine is
- * available to get the parent process ID.
- */
-/*#define HAS_GETPPID /**/
-
-/* HAS_GETPRIORITY:
- * This symbol, if defined, indicates that the getpriority routine is
- * available to get a process's priority.
- */
-/*#define HAS_GETPRIORITY /**/
-
-/* HAS_INET_ATON:
- * This symbol, if defined, indicates to the C program that the
- * inet_aton() function is available to parse IP address "dotted-quad"
- * strings.
- */
-/*#define HAS_INET_ATON /**/
-
-/* HAS_KILLPG:
- * This symbol, if defined, indicates that the killpg routine is available
- * to kill process groups. If unavailable, you probably should use kill
- * with a negative process number.
- */
-/*#define HAS_KILLPG /**/
-
-/* HAS_LINK:
- * This symbol, if defined, indicates that the link routine is
- * available to create hard links.
- */
-/*#define HAS_LINK /**/
-
-/* HAS_LOCALECONV:
- * This symbol, if defined, indicates that the localeconv routine is
- * available for numeric and monetary formatting conventions.
- */
-/*#define HAS_LOCALECONV /**/
-
-/* HAS_LOCKF:
- * This symbol, if defined, indicates that the lockf routine is
- * available to do file locking.
- */
-/*#define HAS_LOCKF /**/
-
-/* HAS_LSTAT:
- * This symbol, if defined, indicates that the lstat routine is
- * available to do file stats on symbolic links.
- */
-/*#define HAS_LSTAT /**/
-
-/* HAS_MBLEN:
- * This symbol, if defined, indicates that the mblen routine is available
- * to find the number of bytes in a multibye character.
- */
-/*#define HAS_MBLEN /**/
-
-/* HAS_MBSTOWCS:
- * This symbol, if defined, indicates that the mbstowcs routine is
- * available to covert a multibyte string into a wide character string.
- */
-/*#define HAS_MBSTOWCS /**/
-
-/* HAS_MBTOWC:
- * This symbol, if defined, indicates that the mbtowc routine is available
- * to covert a multibyte to a wide character.
- */
-/*#define HAS_MBTOWC /**/
-
-/* HAS_MEMCMP:
- * This symbol, if defined, indicates that the memcmp routine is available
- * to compare blocks of memory.
- */
-#define HAS_MEMCMP /**/
-
-/* HAS_MEMCPY:
- * This symbol, if defined, indicates that the memcpy routine is available
- * to copy blocks of memory.
- */
-#define HAS_MEMCPY /**/
-
-/* HAS_MEMMOVE:
- * This symbol, if defined, indicates that the memmove routine is available
- * to copy potentially overlapping blocks of memory. This should be used
- * only when HAS_SAFE_BCOPY is not defined. If neither is there, roll your
- * own version.
- */
-#define HAS_MEMMOVE /**/
-
-/* HAS_MEMSET:
- * This symbol, if defined, indicates that the memset routine is available
- * to set blocks of memory.
- */
-#define HAS_MEMSET /**/
-
-/* HAS_MKDIR:
- * This symbol, if defined, indicates that the mkdir routine is available
- * to create directories. Otherwise you should fork off a new process to
- * exec /bin/mkdir.
- */
-#define HAS_MKDIR /**/
-
-/* HAS_MKFIFO:
- * This symbol, if defined, indicates that the mkfifo routine is
- * available to create FIFOs. Otherwise, mknod should be able to
- * do it for you. However, if mkfifo is there, mknod might require
- * super-user privileges which mkfifo will not.
- */
-/*#define HAS_MKFIFO /**/
-
-/* HAS_MKTIME:
- * This symbol, if defined, indicates that the mktime routine is
- * available.
- */
-#define HAS_MKTIME /**/
-
-/* HAS_MSYNC:
- * This symbol, if defined, indicates that the msync system call is
- * available to synchronize a mapped file.
- */
-/*#define HAS_MSYNC /**/
-
-/* HAS_MUNMAP:
- * This symbol, if defined, indicates that the munmap system call is
- * available to unmap a region, usually mapped by mmap().
- */
-/*#define HAS_MUNMAP /**/
-
-/* HAS_NICE:
- * This symbol, if defined, indicates that the nice routine is
- * available.
- */
-/*#define HAS_NICE /**/
-
-/* HAS_PATHCONF:
- * This symbol, if defined, indicates that pathconf() is available
- * to determine file-system related limits and options associated
- * with a given filename.
- */
-/* HAS_FPATHCONF:
- * This symbol, if defined, indicates that pathconf() is available
- * to determine file-system related limits and options associated
- * with a given open file descriptor.
- */
-/*#define HAS_PATHCONF /**/
-/*#define HAS_FPATHCONF /**/
-
-/* HAS_PAUSE:
- * This symbol, if defined, indicates that the pause routine is
- * available to suspend a process until a signal is received.
- */
-/*#define HAS_PAUSE /**/
-
-/* HAS_PIPE:
- * This symbol, if defined, indicates that the pipe routine is
- * available to create an inter-process channel.
- */
-/*#define HAS_PIPE /**/
-
-/* HAS_POLL:
- * This symbol, if defined, indicates that the poll routine is
- * available to poll active file descriptors. You may safely
- * include <poll.h> when this symbol is defined.
- */
-/*#define HAS_POLL /**/
-
-/* HAS_READDIR:
- * This symbol, if defined, indicates that the readdir routine is
- * available to read directory entries. You may have to include
- * <dirent.h>. See I_DIRENT.
- */
-#define HAS_READDIR /**/
-
-/* HAS_SEEKDIR:
- * This symbol, if defined, indicates that the seekdir routine is
- * available. You may have to include <dirent.h>. See I_DIRENT.
- */
-#define HAS_SEEKDIR /**/
-
-/* HAS_TELLDIR:
- * This symbol, if defined, indicates that the telldir routine is
- * available. You may have to include <dirent.h>. See I_DIRENT.
- */
-#define HAS_TELLDIR /**/
-
-/* HAS_REWINDDIR:
- * This symbol, if defined, indicates that the rewinddir routine is
- * available. You may have to include <dirent.h>. See I_DIRENT.
- */
-#define HAS_REWINDDIR /**/
-
-/* HAS_READLINK:
- * This symbol, if defined, indicates that the readlink routine is
- * available to read the value of a symbolic link.
- */
-/*#define HAS_READLINK /**/
-
-/* HAS_RENAME:
- * This symbol, if defined, indicates that the rename routine is available
- * to rename files. Otherwise you should do the unlink(), link(), unlink()
- * trick.
- */
-#define HAS_RENAME /**/
-
-/* HAS_RMDIR:
- * This symbol, if defined, indicates that the rmdir routine is
- * available to remove directories. Otherwise you should fork off a
- * new process to exec /bin/rmdir.
- */
-#define HAS_RMDIR /**/
-
-/* HAS_SELECT:
- * This symbol, if defined, indicates that the select routine is
- * available to select active file descriptors. If the timeout field
- * is used, <sys/time.h> may need to be included.
- */
-/*#define HAS_SELECT /**/
-
-/* HAS_SETEGID:
- * This symbol, if defined, indicates that the setegid routine is available
- * to change the effective gid of the current program.
- */
-/*#define HAS_SETEGID /**/
-
-/* HAS_SETEUID:
- * This symbol, if defined, indicates that the seteuid routine is available
- * to change the effective uid of the current program.
- */
-/*#define HAS_SETEUID /**/
-
-/* HAS_SETLINEBUF:
- * This symbol, if defined, indicates that the setlinebuf routine is
- * available to change stderr or stdout from block-buffered or unbuffered
- * to a line-buffered mode.
- */
-/*#define HAS_SETLINEBUF /**/
-
-/* HAS_SETLOCALE:
- * This symbol, if defined, indicates that the setlocale routine is
- * available to handle locale-specific ctype implementations.
- */
-/*#define HAS_SETLOCALE /**/
-
-/* HAS_SETPGID:
- * This symbol, if defined, indicates that the setpgid(pid, gpid)
- * routine is available to set process group ID.
- */
-/*#define HAS_SETPGID /**/
-
-/* HAS_SETPGRP:
- * This symbol, if defined, indicates that the setpgrp routine is
- * available to set the current process group.
- */
-/* USE_BSD_SETPGRP:
- * This symbol, if defined, indicates that setpgrp needs two
- * arguments whereas USG one needs none. See also HAS_SETPGID
- * for a POSIX interface.
- */
-/*#define HAS_SETPGRP /**/
-/*#define USE_BSD_SETPGRP /**/
-
-/* HAS_SETPGRP2:
- * This symbol, if defined, indicates that the setpgrp2() (as in DG/UX)
- * routine is available to set the current process group.
- */
-/*#define HAS_SETPGRP2 / **/
-
-/* HAS_SETPRIORITY:
- * This symbol, if defined, indicates that the setpriority routine is
- * available to set a process's priority.
- */
-/*#define HAS_SETPRIORITY /**/
-
-/* HAS_SETREGID:
- * This symbol, if defined, indicates that the setregid routine is
- * available to change the real and effective gid of the current
- * process.
- */
-/* HAS_SETRESGID:
- * This symbol, if defined, indicates that the setresgid routine is
- * available to change the real, effective and saved gid of the current
- * process.
- */
-/*#define HAS_SETREGID /**/
-/*#define HAS_SETRESGID / **/
-
-/* HAS_SETREUID:
- * This symbol, if defined, indicates that the setreuid routine is
- * available to change the real and effective uid of the current
- * process.
- */
-/* HAS_SETRESUID:
- * This symbol, if defined, indicates that the setresuid routine is
- * available to change the real, effective and saved uid of the current
- * process.
- */
-/*#define HAS_SETREUID /**/
-/*#define HAS_SETRESUID / **/
-
-/* HAS_SETRGID:
- * This symbol, if defined, indicates that the setrgid routine is available
- * to change the real gid of the current program.
- */
-/*#define HAS_SETRGID /**/
-
-/* HAS_SETRUID:
- * This symbol, if defined, indicates that the setruid routine is available
- * to change the real uid of the current program.
- */
-/*#define HAS_SETRUID /**/
-
-/* HAS_SETSID:
- * This symbol, if defined, indicates that the setsid routine is
- * available to set the process group ID.
- */
-/*#define HAS_SETSID /**/
-
-/* Shmat_t:
- * This symbol holds the return type of the shmat() system call.
- * Usually set to 'void *' or 'char *'.
- */
-/* HAS_SHMAT_PROTOTYPE:
- * This symbol, if defined, indicates that the sys/shm.h includes
- * a prototype for shmat(). Otherwise, it is up to the program to
- * guess one. Shmat_t shmat _((int, Shmat_t, int)) is a good guess,
- * but not always right so it should be emitted by the program only
- * when HAS_SHMAT_PROTOTYPE is not defined to avoid conflicting defs.
- */
-/*#define Shmat_t void * /**/
-/*#define HAS_SHMAT_PROTOTYPE /**/
-
-/* HAS_STRCHR:
- * This symbol is defined to indicate that the strchr()/strrchr()
- * functions are available for string searching. If not, try the
- * index()/rindex() pair.
- */
-/* HAS_INDEX:
- * This symbol is defined to indicate that the index()/rindex()
- * functions are available for string searching.
- */
-#define HAS_STRCHR /**/
-/*#define HAS_INDEX / **/
-
-/* HAS_STRCOLL:
- * This symbol, if defined, indicates that the strcoll routine is
- * available to compare strings using collating information.
- */
-#define HAS_STRCOLL /**/
-
-/* USE_STRUCT_COPY:
- * This symbol, if defined, indicates that this C compiler knows how
- * to copy structures. If undefined, you'll need to use a block copy
- * routine of some sort instead.
- */
-#define USE_STRUCT_COPY /**/
-
-/* HAS_STRTOD:
- * This symbol, if defined, indicates that the strtod routine is
- * available to provide better numeric string conversion than atof().
- */
-#define HAS_STRTOD /**/
-
-/* HAS_STRTOL:
- * This symbol, if defined, indicates that the strtol routine is available
- * to provide better numeric string conversion than atoi() and friends.
- */
-#define HAS_STRTOL /**/
-
-/* HAS_STRTOUL:
- * This symbol, if defined, indicates that the strtoul routine is
- * available to provide conversion of strings to unsigned long.
- */
-#define HAS_STRTOUL /**/
-
-/* HAS_STRXFRM:
- * This symbol, if defined, indicates that the strxfrm() routine is
- * available to transform strings.
- */
-#define HAS_STRXFRM /**/
-
-/* HAS_SYMLINK:
- * This symbol, if defined, indicates that the symlink routine is available
- * to create symbolic links.
- */
-/*#define HAS_SYMLINK /**/
-
-/* HAS_SYSCALL:
- * This symbol, if defined, indicates that the syscall routine is
- * available to call arbitrary system calls. If undefined, that's tough.
- */
-/*#define HAS_SYSCALL /**/
-
-/* HAS_SYSCONF:
- * This symbol, if defined, indicates that sysconf() is available
- * to determine system related limits and options.
- */
-#define HAS_SYSCONF /**/
-
-/* HAS_SYSTEM:
- * This symbol, if defined, indicates that the system routine is
- * available to issue a shell command.
- */
-#define HAS_SYSTEM /**/
-
-/* HAS_TCGETPGRP:
- * This symbol, if defined, indicates that the tcgetpgrp routine is
- * available to get foreground process group ID.
- */
-/*#define HAS_TCGETPGRP /**/
-
-/* HAS_TCSETPGRP:
- * This symbol, if defined, indicates that the tcsetpgrp routine is
- * available to set foreground process group ID.
- */
-/*#define HAS_TCSETPGRP /**/
-
-/* HAS_TRUNCATE:
- * This symbol, if defined, indicates that the truncate routine is
- * available to truncate files.
- */
-/*#define HAS_TRUNCATE /**/
-
-/* HAS_TZNAME:
- * This symbol, if defined, indicates that the tzname[] array is
- * available to access timezone names.
- */
-/*#define HAS_TZNAME /**/
-
-/* HAS_UMASK:
- * This symbol, if defined, indicates that the umask routine is
- * available to set and get the value of the file creation mask.
- */
-/*#define HAS_UMASK /**/
-
-/* HASVOLATILE:
- * This symbol, if defined, indicates that this C compiler knows about
- * the volatile declaration.
- */
-#define HASVOLATILE /**/
-#ifndef HASVOLATILE
-#define volatile
-#endif
-
-/* HAS_WAIT4:
- * This symbol, if defined, indicates that wait4() exists.
- */
-/*#define HAS_WAIT4 /**/
-
-/* HAS_WAITPID:
- * This symbol, if defined, indicates that the waitpid routine is
- * available to wait for child process.
- */
-/*#define HAS_WAITPID /**/
-
-/* HAS_WCSTOMBS:
- * This symbol, if defined, indicates that the wcstombs routine is
- * available to convert wide character strings to multibyte strings.
- */
-/*#define HAS_WCSTOMBS /**/
-
-/* HAS_WCTOMB:
- * This symbol, if defined, indicates that the wctomb routine is available
- * to covert a wide character to a multibyte.
- */
-/*#define HAS_WCTOMB /**/
-
-/* I_ARPA_INET:
- * This symbol, if defined, indicates to the C program that it should
- * include <arpa/inet.h> to get inet_addr and friends declarations.
- */
-#define I_ARPA_INET /**/
-
-/* I_DBM:
- * This symbol, if defined, indicates that <dbm.h> exists and should
- * be included.
- */
-/* I_RPCSVC_DBM:
- * This symbol, if defined, indicates that <rpcsvc/dbm.h> exists and
- * should be included.
- */
-/*#define I_DBM /**/
-/*#define I_RPCSVC_DBM / **/
-
-/* I_DIRENT:
- * This symbol, if defined, indicates to the C program that it should
- * include <dirent.h>. Using this symbol also triggers the definition
- * of the Direntry_t define which ends up being 'struct dirent' or
- * 'struct direct' depending on the availability of <dirent.h>.
- */
-/* DIRNAMLEN:
- * This symbol, if defined, indicates to the C program that the length
- * of directory entry names is provided by a d_namlen field. Otherwise
- * you need to do strlen() on the d_name field.
- */
-/* Direntry_t:
- * This symbol is set to 'struct direct' or 'struct dirent' depending on
- * whether dirent is available or not. You should use this pseudo type to
- * portably declare your directory entries.
- */
-#define I_DIRENT /**/
-/*#define DIRNAMLEN /**/
-#define Direntry_t struct dirent
-
-/* I_DLFCN:
- * This symbol, if defined, indicates that <dlfcn.h> exists and should
- * be included.
- */
-/*#define I_DLFCN /**/
-
-/* I_FCNTL:
- * This manifest constant tells the C program to include <fcntl.h>.
- */
-#define I_FCNTL / **/
-
-/* I_FLOAT:
- * This symbol, if defined, indicates to the C program that it should
- * include <float.h> to get definition of symbols like DBL_MAX or
- * DBL_MIN, i.e. machine dependent floating point values.
- */
-/*#define I_FLOAT /**/
-
-/* I_LIMITS:
- * This symbol, if defined, indicates to the C program that it should
- * include <limits.h> to get definition of symbols like WORD_BIT or
- * LONG_MAX, i.e. machine dependant limitations.
- */
-#define I_LIMITS /**/
-
-/* I_LOCALE:
- * This symbol, if defined, indicates to the C program that it should
- * include <locale.h>.
- */
-/*#define I_LOCALE /**/
-
-/* I_MATH:
- * This symbol, if defined, indicates to the C program that it should
- * include <math.h>.
- */
-#define I_MATH /**/
-
-/* I_MEMORY:
- * This symbol, if defined, indicates to the C program that it should
- * include <memory.h>.
- */
-/*#define I_MEMORY / **/
-
-/* I_NDBM:
- * This symbol, if defined, indicates that <ndbm.h> exists and should
- * be included.
- */
-/*#define I_NDBM /**/
-
-/* I_NET_ERRNO:
- * This symbol, if defined, indicates that <net/errno.h> exists and
- * should be included.
- */
-/*#define I_NET_ERRNO / **/
-
-/* I_NETINET_IN:
- * This symbol, if defined, indicates to the C program that it should
- * include <netinet/in.h>. Otherwise, you may try <sys/in.h>.
- */
-#define I_NETINET_IN /**/
-
-/* I_SFIO:
- * This symbol, if defined, indicates to the C program that it should
- * include <sfio.h>.
- */
-/*#define I_SFIO / **/
-
-/* I_STDDEF:
- * This symbol, if defined, indicates that <stddef.h> exists and should
- * be included.
- */
-#define I_STDDEF /**/
-
-/* I_STDLIB:
- * This symbol, if defined, indicates that <stdlib.h> exists and should
- * be included.
- */
-#define I_STDLIB /**/
-
-/* I_STRING:
- * This symbol, if defined, indicates to the C program that it should
- * include <string.h> (USG systems) instead of <strings.h> (BSD systems).
- */
-#define I_STRING /**/
-
-/* I_SYS_DIR:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/dir.h>.
- */
-/*#define I_SYS_DIR /**/
-
-/* I_SYS_FILE:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/file.h> to get definition of R_OK and friends.
- */
-/*#define I_SYS_FILE /**/
-
-/* I_SYS_IOCTL:
- * This symbol, if defined, indicates that <sys/ioctl.h> exists and should
- * be included. Otherwise, include <sgtty.h> or <termio.h>.
- */
-#define I_SYS_IOCTL /**/
-
-/* I_SYS_NDIR:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/ndir.h>.
- */
-/*#define I_SYS_NDIR / **/
-
-/* I_SYS_PARAM:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/param.h>.
- */
-#define I_SYS_PARAM /**/
-
-/* I_SYS_RESOURCE:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/resource.h>.
- */
-#define I_SYS_RESOURCE /**/
-
-/* I_SYS_SELECT:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/select.h> in order to get definition of struct timeval.
- */
-/*#define I_SYS_SELECT /**/
-
-/* I_SYS_STAT:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/stat.h>.
- */
-#define I_SYS_STAT /**/
-
-/* I_SYS_TIMES:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/times.h>.
- */
-#define I_SYS_TIMES /**/
-
-/* I_SYS_TYPES:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/types.h>.
- */
-#define I_SYS_TYPES /**/
-
-/* I_SYS_UN:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/un.h> to get UNIX domain socket definitions.
- */
-/*#define I_SYS_UN /**/
-
-/* I_SYS_WAIT:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/wait.h>.
- */
-#define I_SYS_WAIT /**/
-
-/* I_TERMIO:
- * This symbol, if defined, indicates that the program should include
- * <termio.h> rather than <sgtty.h>. There are also differences in
- * the ioctl() calls that depend on the value of this symbol.
- */
-/* I_TERMIOS:
- * This symbol, if defined, indicates that the program should include
- * the POSIX termios.h rather than sgtty.h or termio.h.
- * There are also differences in the ioctl() calls that depend on the
- * value of this symbol.
- */
-/* I_SGTTY:
- * This symbol, if defined, indicates that the program should include
- * <sgtty.h> rather than <termio.h>. There are also differences in
- * the ioctl() calls that depend on the value of this symbol.
- */
-/*#define I_TERMIO / **/
-/*#define I_TERMIOS /**/
-/*#define I_SGTTY / **/
-
-/* I_UNISTD:
- * This symbol, if defined, indicates to the C program that it should
- * include <unistd.h>.
- */
-#define I_UNISTD /**/
-
-/* I_UTIME:
- * This symbol, if defined, indicates to the C program that it should
- * include <utime.h>.
- */
-/*#define I_UTIME /**/
-
-/* I_VALUES:
- * This symbol, if defined, indicates to the C program that it should
- * include <values.h> to get definition of symbols like MINFLOAT or
- * MAXLONG, i.e. machine dependant limitations. Probably, you
- * should use <limits.h> instead, if it is available.
- */
-/*#define I_VALUES /**/
-
-/* I_STDARG:
- * This symbol, if defined, indicates that <stdarg.h> exists and should
- * be included.
- */
-/* I_VARARGS:
- * This symbol, if defined, indicates to the C program that it should
- * include <varargs.h>.
- */
-#define I_STDARG /**/
-/*#define I_VARARGS / **/
-
-/* I_VFORK:
- * This symbol, if defined, indicates to the C program that it should
- * include vfork.h.
- */
-/*#define I_VFORK / **/
-
-/* CAN_PROTOTYPE:
- * If defined, this macro indicates that the C compiler can handle
- * function prototypes.
- */
-/* _:
- * This macro is used to declare function parameters for folks who want
- * to make declarations with prototypes using a different style than
- * the above macros. Use double parentheses. For example:
- *
- * int main _((int argc, char *argv[]));
- */
-#define CAN_PROTOTYPE /**/
-#ifdef CAN_PROTOTYPE
-#define _(args) args
-#else
-#define _(args) ()
-#endif
-
-/* SH_PATH:
- * This symbol contains the full pathname to the shell used on this
- * on this system to execute Bourne shell scripts. Usually, this will be
- * /bin/sh, though it's possible that some systems will have /bin/ksh,
- * /bin/pdksh, /bin/ash, /bin/bash, or even something such as
- * D:/bin/sh.exe.
- */
-#define SH_PATH "/bin/sh" /**/
-
-/* STDCHAR:
- * This symbol is defined to be the type of char used in stdio.h.
- * It has the values "unsigned char" or "char".
- */
-#define STDCHAR char /**/
-
-/* HAS_ACCESSX:
- * This symbol, if defined, indicates that the accessx routine is
- * available to do extended access checks.
- */
-/*#define HAS_ACCESSX / **/
-
-/* HAS_EACCESS:
- * This symbol, if defined, indicates that the eaccess routine is
- * available to do extended access checks.
- */
-/*#define HAS_EACCESS / **/
-
-/* I_SYS_ACCESS:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/access.h>.
- */
-/*#define I_SYS_ACCESS /**/
-
-/* I_SYS_SECURITY:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/security.h>.
- */
-/*#define I_SYS_SECURITY /**/
-
-/* CROSSCOMPILE:
- * This symbol, if defined, signifies that we our
- * build process is a cross-compilation.
- */
-#define CROSSCOMPILE / **/
-
-/* INTSIZE:
- * This symbol contains the value of sizeof(int) so that the C
- * preprocessor can make decisions based on it.
- */
-/* LONGSIZE:
- * This symbol contains the value of sizeof(long) so that the C
- * preprocessor can make decisions based on it.
- */
-/* SHORTSIZE:
- * This symbol contains the value of sizeof(short) so that the C
- * preprocessor can make decisions based on it.
- */
-#define INTSIZE 4 /**/
-#define LONGSIZE 4 /**/
-#define SHORTSIZE 2 /**/
-
-/* MULTIARCH:
- * This symbol, if defined, signifies that the build
- * process will produce some binary files that are going to be
- * used in a cross-platform environment. This is the case for
- * example with the NeXT "fat" binaries that contain executables
- * for several CPUs.
- */
-#define MULTIARCH / **/
-
-/* MEM_ALIGNBYTES:
- * This symbol contains the number of bytes required to align a
- * double. Usual values are 2, 4 and 8. The default is eight,
- * for safety.
- */
-#if defined(CROSSCOMPILE) || defined(MULTIARCH)
-# define MEM_ALIGNBYTES 8
-#else
-#define MEM_ALIGNBYTES 8
-#endif
-
-/* BYTEORDER:
- * This symbol holds the hexadecimal constant defined in byteorder,
- * i.e. 0x1234 or 0x4321, etc...
- * If the compiler supports cross-compiling or multiple-architecture
- * binaries (eg. on NeXT systems), use compiler-defined macros to
- * determine the byte order.
- * On NeXT 3.2 (and greater), you can build "Fat" Multiple Architecture
- * Binaries (MAB) on either big endian or little endian machines.
- * The endian-ness is available at compile-time. This only matters
- * for perl, where the config.h can be generated and installed on
- * one system, and used by a different architecture to build an
- * extension. Older versions of NeXT that might not have
- * defined either *_ENDIAN__ were all on Motorola 680x0 series,
- * so the default case (for NeXT) is big endian to catch them.
- * This might matter for NeXT 3.0.
- */
-#if defined(CROSSCOMPILE) || defined(MULTIARCH)
-# ifdef __LITTLE_ENDIAN__
-# if LONGSIZE == 4
-# define BYTEORDER 0x1234
-# else
-# if LONGSIZE == 8
-# define BYTEORDER 0x12345678
-# endif
-# endif
-# else
-# ifdef __BIG_ENDIAN__
-# if LONGSIZE == 4
-# define BYTEORDER 0x4321
-# else
-# if LONGSIZE == 8
-# define BYTEORDER 0x87654321
-# endif
-# endif
-# endif
-# endif
-# if !defined(BYTEORDER) && (defined(NeXT) || defined(__NeXT__))
-# define BYTEORDER 0x4321
-# endif
-#else
-#define BYTEORDER 0x12345678 /* large digits for MSB */
-#endif /* NeXT */
-
-/* CASTI32:
- * This symbol is defined if the C compiler can cast negative
- * or large floating point numbers to 32-bit ints.
- */
-/*#define CASTI32 / **/
-
-/* CASTNEGFLOAT:
- * This symbol is defined if the C compiler can cast negative
- * numbers to unsigned longs, ints and shorts.
- */
-/* CASTFLAGS:
- * This symbol contains flags that say what difficulties the compiler
- * has casting odd floating values to unsigned long:
- * 0 = ok
- * 1 = couldn't cast < 0
- * 2 = couldn't cast >= 0x80000000
- * 4 = couldn't cast in argument expression list
- */
-/*#define CASTNEGFLOAT /**/
-/*#define CASTFLAGS 0 /**/
-
-/* VOID_CLOSEDIR:
- * This symbol, if defined, indicates that the closedir() routine
- * does not return a value.
- */
-/*#define VOID_CLOSEDIR / **/
-
-/* HAS_FD_SET:
- * This symbol, when defined, indicates presence of the fd_set typedef
- * in <sys/types.h>
- */
-#define HAS_FD_SET /**/
-
-/* Gconvert:
- * This preprocessor macro is defined to convert a floating point
- * number to a string without a trailing decimal point. This
- * emulates the behavior of sprintf("%g"), but is sometimes much more
- * efficient. If gconvert() is not available, but gcvt() drops the
- * trailing decimal point, then gcvt() is used. If all else fails,
- * a macro using sprintf("%g") is used. Arguments for the Gconvert
- * macro are: value, number of digits, whether trailing zeros should
- * be retained, and the output buffer.
- * Possible values are:
- * d_Gconvert='gconvert((x),(n),(t),(b))'
- * d_Gconvert='gcvt((x),(n),(b))'
- * d_Gconvert='sprintf((b),"%.*g",(n),(x))'
- * The last two assume trailing zeros should not be kept.
- */
-#define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
-
-/* HAS_GNULIBC:
- * This symbol, if defined, indicates to the C program that
- * the GNU C library is being used.
- */
-/*#define HAS_GNULIBC / **/
-/* HAS_ISASCII:
- * This manifest constant lets the C program know that isascii
- * is available.
- */
-#define HAS_ISASCII /**/
-
-/* HAS_LCHOWN:
- * This symbol, if defined, indicates that the lchown routine is
- * available to operate on a symbolic link (instead of following the
- * link).
- */
-/*##define HAS_LCHOWN /**/
-
-/* HAS_OPEN3:
- * This manifest constant lets the C program know that the three
- * argument form of open(2) is available.
- */
-#define HAS_OPEN3 /**/
-
-/* HAS_SAFE_BCOPY:
- * This symbol, if defined, indicates that the bcopy routine is available
- * to copy potentially overlapping memory blocks. Otherwise you should
- * probably use memmove() or memcpy(). If neither is defined, roll your
- * own version.
- */
-/*##define HAS_SAFE_BCOPY /**/
-
-/* HAS_SAFE_MEMCPY:
- * This symbol, if defined, indicates that the memcpy routine is available
- * to copy potentially overlapping memory blocks. Otherwise you should
- * probably use memmove() or memcpy(). If neither is defined, roll your
- * own version.
- */
-/*#define HAS_SAFE_MEMCPY / **/
-
-/* HAS_SANE_MEMCMP:
- * This symbol, if defined, indicates that the memcmp routine is available
- * and can be used to compare relative magnitudes of chars with their high
- * bits set. If it is not defined, roll your own version.
- */
-#define HAS_SANE_MEMCMP /**/
-
-/* HAS_SIGACTION:
- * This symbol, if defined, indicates that Vr4's sigaction() routine
- * is available.
- */
-/*##define HAS_SIGACTION /**/
-
-/* HAS_SIGSETJMP:
- * This variable indicates to the C program that the sigsetjmp()
- * routine is available to save the calling process's registers
- * and stack environment for later use by siglongjmp(), and
- * to optionally save the process's signal mask. See
- * Sigjmp_buf, Sigsetjmp, and Siglongjmp.
- */
-/* Sigjmp_buf:
- * This is the buffer type to be used with Sigsetjmp and Siglongjmp.
- */
-/* Sigsetjmp:
- * This macro is used in the same way as sigsetjmp(), but will invoke
- * traditional setjmp() if sigsetjmp isn't available.
- * See HAS_SIGSETJMP.
- */
-/* Siglongjmp:
- * This macro is used in the same way as siglongjmp(), but will invoke
- * traditional longjmp() if siglongjmp isn't available.
- * See HAS_SIGSETJMP.
- */
-/*##define HAS_SIGSETJMP /**/
-#ifdef HAS_SIGSETJMP
-#define Sigjmp_buf sigjmp_buf
-#define Sigsetjmp(buf,save_mask) sigsetjmp((buf),(save_mask))
-#define Siglongjmp(buf,retval) siglongjmp((buf),(retval))
-#else
-#define Sigjmp_buf jmp_buf
-#define Sigsetjmp(buf,save_mask) setjmp((buf))
-#define Siglongjmp(buf,retval) longjmp((buf),(retval))
-#endif
-
-/* USE_STDIO_PTR:
- * This symbol is defined if the _ptr and _cnt fields (or similar)
- * of the stdio FILE structure can be used to access the stdio buffer
- * for a file handle. If this is defined, then the FILE_ptr(fp)
- * and FILE_cnt(fp) macros will also be defined and should be used
- * to access these fields.
- */
-/* FILE_ptr:
- * This macro is used to access the _ptr field (or equivalent) of the
- * FILE structure pointed to by its argument. This macro will always be
- * defined if USE_STDIO_PTR is defined.
- */
-/* STDIO_PTR_LVALUE:
- * This symbol is defined if the FILE_ptr macro can be used as an
- * lvalue.
- */
-/* FILE_cnt:
- * This macro is used to access the _cnt field (or equivalent) of the
- * FILE structure pointed to by its argument. This macro will always be
- * defined if USE_STDIO_PTR is defined.
- */
-/* STDIO_CNT_LVALUE:
- * This symbol is defined if the FILE_cnt macro can be used as an
- * lvalue.
- */
-/*##define USE_STDIO_PTR /**/
-#ifdef USE_STDIO_PTR
-#define FILE_ptr(fp) ((fp)->_ptr)
-#define STDIO_PTR_LVALUE /**/
-#define FILE_cnt(fp) ((fp)->_cnt)
-#define STDIO_CNT_LVALUE /**/
-#endif
-
-/* USE_STDIO_BASE:
- * This symbol is defined if the _base field (or similar) of the
- * stdio FILE structure can be used to access the stdio buffer for
- * a file handle. If this is defined, then the FILE_base(fp) macro
- * will also be defined and should be used to access this field.
- * Also, the FILE_bufsiz(fp) macro will be defined and should be used
- * to determine the number of bytes in the buffer. USE_STDIO_BASE
- * will never be defined unless USE_STDIO_PTR is.
- */
-/* FILE_base:
- * This macro is used to access the _base field (or equivalent) of the
- * FILE structure pointed to by its argument. This macro will always be
- * defined if USE_STDIO_BASE is defined.
- */
-/* FILE_bufsiz:
- * This macro is used to determine the number of bytes in the I/O
- * buffer pointed to by _base field (or equivalent) of the FILE
- * structure pointed to its argument. This macro will always be defined
- * if USE_STDIO_BASE is defined.
- */
-/*##define USE_STDIO_BASE /**/
-#ifdef USE_STDIO_BASE
-#define FILE_base(fp) ((fp)->_base)
-#define FILE_bufsiz(fp) ((fp)->_cnt + (fp)->_ptr - (fp)->_base)
-#endif
-
-/* HAS_VPRINTF:
- * This symbol, if defined, indicates that the vprintf routine is available
- * to printf with a pointer to an argument list. If unavailable, you
- * may need to write your own, probably in terms of _doprnt().
- */
-/* USE_CHAR_VSPRINTF:
- * This symbol is defined if this system has vsprintf() returning type
- * (char*). The trend seems to be to declare it as "int vsprintf()". It
- * is up to the package author to declare vsprintf correctly based on the
- * symbol.
- */
-#define HAS_VPRINTF /**/
-/*#define USE_CHAR_VSPRINTF / **/
-
-/* DOUBLESIZE:
- * This symbol contains the size of a double, so that the C preprocessor
- * can make decisions based on it.
- */
-#define DOUBLESIZE 8 /**/
-
-/* I_TIME:
- * This symbol, if defined, indicates to the C program that it should
- * include <time.h>.
- */
-/* I_SYS_TIME:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/time.h>.
- */
-/* I_SYS_TIME_KERNEL:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/time.h> with KERNEL defined.
- */
-#define I_TIME / **/
-#define I_SYS_TIME /**/
-/*#define I_SYS_TIME_KERNEL / **/
-
-/* VAL_O_NONBLOCK:
- * This symbol is to be used during open() or fcntl(F_SETFL) to turn on
- * non-blocking I/O for the file descriptor. Note that there is no way
- * back, i.e. you cannot turn it blocking again this way. If you wish to
- * alternatively switch between blocking and non-blocking, use the
- * ioctl(FIOSNBIO) call instead, but that is not supported by all devices.
- */
-/* VAL_EAGAIN:
- * This symbol holds the errno error code set by read() when no data was
- * present on the non-blocking file descriptor.
- */
-/* RD_NODATA:
- * This symbol holds the return code from read() when no data is present
- * on the non-blocking file descriptor. Be careful! If EOF_NONBLOCK is
- * not defined, then you can't distinguish between no data and EOF by
- * issuing a read(). You'll have to find another way to tell for sure!
- */
-/* EOF_NONBLOCK:
- * This symbol, if defined, indicates to the C program that a read() on
- * a non-blocking file descriptor will return 0 on EOF, and not the value
- * held in RD_NODATA (-1 usually, in that case!).
- */
-#define VAL_O_NONBLOCK O_NONBLOCK
-#define VAL_EAGAIN EAGAIN
-#define RD_NODATA -1
-#define EOF_NONBLOCK
-
-/* PTRSIZE:
- * This symbol contains the size of a pointer, so that the C preprocessor
- * can make decisions based on it. It will be sizeof(void *) if
- * the compiler supports (void *); otherwise it will be
- * sizeof(char *).
- */
-#define PTRSIZE 8 /**/
-
-/* Drand01:
- * This macro is to be used to generate uniformly distributed
- * random numbers over the range [0., 1.[. You may have to supply
- * an 'extern double drand48();' in your program since SunOS 4.1.3
- * doesn't provide you with anything relevant in it's headers.
- * See HAS_DRAND48_PROTO.
- */
-/* Rand_seed_t:
- * This symbol defines the type of the argument of the
- * random seed function.
- */
-/* seedDrand01:
- * This symbol defines the macro to be used in seeding the
- * random number generator (see Drand01).
- */
-/* RANDBITS:
- * This symbol indicates how many bits are produced by the
- * function used to generate normalized random numbers.
- * Values include 15, 16, 31, and 48.
- */
-#define Drand01() (rand()/(double)((unsigned)1<<RANDBITS))
-#define Rand_seed_t unsigned /**/
-#define seedDrand01(x) srand((Rand_seed_t)x) /**/
-#define RANDBITS 15 /**/
-
-/* SSize_t:
- * This symbol holds the type used by functions that return
- * a count of bytes or an error condition. It must be a signed type.
- * It is usually ssize_t, but may be long or int, etc.
- * It may be necessary to include <sys/types.h> or <unistd.h>
- * to get any typedef'ed information.
- * We will pick a type such that sizeof(SSize_t) == sizeof(Size_t).
- */
-#define SSize_t long /* signed count of bytes */
-
-/* EBCDIC:
- * This symbol, if defined, indicates that this system uses
- * EBCDIC encoding.
- */
-/*#define EBCDIC / **/
-
-/* OSNAME:
- * This symbol contains the name of the operating system, as determined
- * by Configure. You shouldn't rely on it too much; the specific
- * feature tests from Configure are generally more reliable.
- */
-#define OSNAME "epoc" /**/
-
-/* CAT2:
- * This macro catenates 2 tokens together.
- */
-/* STRINGIFY:
- * This macro surrounds its token with double quotes.
- */
-#if 42 == 1
-#define CAT2(a,b)a/**/b
-#define STRINGIFY(a)"a"
- /* If you can get stringification with catify, tell me how! */
-#endif
-#if 42 == 42
-#define CAT2(a,b)a ## b
-#define StGiFy(a)# a
-#define STRINGIFY(a)StGiFy(a)
-#endif
-#if 42 != 1 && 42 != 42
-#include "Bletch: How does this C preprocessor catenate tokens?"
-#endif
-
-/* CPPSTDIN:
- * This symbol contains the first part of the string which will invoke
- * the C preprocessor on the standard input and produce to standard
- * output. Typical value of "cc -E" or "/lib/cpp", but it can also
- * call a wrapper. See CPPRUN.
- */
-/* CPPMINUS:
- * This symbol contains the second part of the string which will invoke
- * the C preprocessor on the standard input and produce to standard
- * output. This symbol will have the value "-" if CPPSTDIN needs a minus
- * to specify standard input, otherwise the value is "".
- */
-/* CPPRUN:
- * This symbol contains the string which will invoke a C preprocessor on
- * the standard input and produce to standard output. It needs to end
- * with CPPLAST, after all other preprocessor flags have been specified.
- * The main difference with CPPSTDIN is that this program will never be a
- * pointer to a shell wrapper, i.e. it will be empty if no preprocessor is
- * available directly to the user. Note that it may well be different from
- * the preprocessor used to compile the C program.
- */
-#define CPPSTDIN "cppstdin"
-#define CPPMINUS ""
-#define CPPRUN "/usr/bin/cpp"
-
-/* HAS_ACCESS:
- * This manifest constant lets the C program know that the access()
- * system call is available to check for accessibility using real UID/GID.
- * (always present on UNIX.)
- */
-/*#define HAS_ACCESS /**/
-
-/* HAS_CSH:
- * This symbol, if defined, indicates that the C-shell exists.
- */
-/* CSH:
- * This symbol, if defined, contains the full pathname of csh.
- */
-/*#define HAS_CSH /**/
-#ifdef HAS_CSH
-#define CSH "/usr/bin/csh" /**/
-#endif
-
-/* HAS_ENDGRENT:
- * This symbol, if defined, indicates that the getgrent routine is
- * available for finalizing sequential access of the group database.
- */
-/*#define HAS_ENDGRENT /**/
-
-/* HAS_ENDHOSTENT:
- * This symbol, if defined, indicates that the endhostent() routine is
- * available to close whatever was being used for host queries.
- */
-/*#define HAS_ENDHOSTENT /**/
-
-/* HAS_ENDNETENT:
- * This symbol, if defined, indicates that the endnetent() routine is
- * available to close whatever was being used for network queries.
- */
-/*#define HAS_ENDNETENT /**/
-
-/* HAS_ENDPROTOENT:
- * This symbol, if defined, indicates that the endprotoent() routine is
- * available to close whatever was being used for protocol queries.
- */
-/*#define HAS_ENDPROTOENT /**/
-
-/* HAS_ENDPWENT:
- * This symbol, if defined, indicates that the getgrent routine is
- * available for finalizing sequential access of the passwd database.
- */
-/*#define HAS_ENDPWENT /**/
-
-/* HAS_ENDSERVENT:
- * This symbol, if defined, indicates that the endservent() routine is
- * available to close whatever was being used for service queries.
- */
-/*#define HAS_ENDSERVENT /**/
-
-/* HAS_GETGRENT:
- * This symbol, if defined, indicates that the getgrent routine is
- * available for sequential access of the group database.
- */
-/*#define HAS_GETGRENT /**/
-
-/* HAS_GETHOSTBYADDR:
- * This symbol, if defined, indicates that the gethostbyaddr() routine is
- * available to look up hosts by their IP addresses.
- */
-#define HAS_GETHOSTBYADDR /**/
-
-/* HAS_GETHOSTBYNAME:
- * This symbol, if defined, indicates that the gethostbyname() routine is
- * available to look up host names in some data base or other.
- */
-#define HAS_GETHOSTBYNAME /**/
-
-/* HAS_GETHOSTENT:
- * This symbol, if defined, indicates that the gethostent() routine is
- * available to look up host names in some data base or another.
- */
-/*#define HAS_GETHOSTENT /**/
-
-/* HAS_GETHOSTNAME:
- * This symbol, if defined, indicates that the C program may use the
- * gethostname() routine to derive the host name. See also HAS_UNAME
- * and PHOSTNAME.
- */
-/* HAS_UNAME:
- * This symbol, if defined, indicates that the C program may use the
- * uname() routine to derive the host name. See also HAS_GETHOSTNAME
- * and PHOSTNAME.
- */
-/* PHOSTNAME:
- * This symbol, if defined, indicates the command to feed to the
- * popen() routine to derive the host name. See also HAS_GETHOSTNAME
- * and HAS_UNAME. Note that the command uses a fully qualified path,
- * so that it is safe even if used by a process with super-user
- * privileges.
- */
-/*#define HAS_GETHOSTNAME /**/
-/*#define HAS_UNAME /**/
-#undef HAS_PHOSTNAME
-#ifdef HAS_PHOSTNAME
-#define PHOSTNAME "" /* How to get the host name */
-#endif
-
-/* HAS_GETNETBYADDR:
- * This symbol, if defined, indicates that the getnetbyaddr() routine is
- * available to look up networks by their IP addresses.
- */
-/*#define HAS_GETNETBYADDR /**/
-
-/* HAS_GETNETBYNAME:
- * This symbol, if defined, indicates that the getnetbyname() routine is
- * available to look up networks by their names.
- */
-/*#define HAS_GETNETBYNAME /**/
-
-/* HAS_GETNETENT:
- * This symbol, if defined, indicates that the getnetent() routine is
- * available to look up network names in some data base or another.
- */
-/*#define HAS_GETNETENT /**/
-
-/* HAS_GETPROTOENT:
- * This symbol, if defined, indicates that the getprotoent() routine is
- * available to look up protocols in some data base or another.
- */
-/*#define HAS_GETPROTOENT /**/
-
-/* HAS_GETPROTOBYNAME:
- * This symbol, if defined, indicates that the getprotobyname()
- * routine is available to look up protocols by their name.
- */
-/* HAS_GETPROTOBYNUMBER:
- * This symbol, if defined, indicates that the getprotobynumber()
- * routine is available to look up protocols by their number.
- */
-/*#define HAS_GETPROTOBYNAME /**/
-/*#define HAS_GETPROTOBYNUMBER /**/
-
-/* HAS_GETPWENT:
- * This symbol, if defined, indicates that the getpwent routine is
- * available for sequential access of the passwd database.
- * If this is not available, the older getpw() function may be available.
- */
-/*#define HAS_GETPWENT /**/
-
-/* HAS_GETSERVENT:
- * This symbol, if defined, indicates that the getservent() routine is
- * available to look up network services in some data base or another.
- */
-/*#define HAS_GETSERVENT /**/
-
-/* HAS_GETSERVBYNAME:
- * This symbol, if defined, indicates that the getservbyname()
- * routine is available to look up services by their name.
- */
-/* HAS_GETSERVBYPORT:
- * This symbol, if defined, indicates that the getservbyport()
- * routine is available to look up services by their port.
- */
-/*#define HAS_GETSERVBYNAME /**/
-/*#define HAS_GETSERVBYPORT /**/
-/*
-/* HAS_HTONL:
- * This symbol, if defined, indicates that the htonl() routine (and
- * friends htons() ntohl() ntohs()) are available to do network
- * order byte swapping.
- */
-/* HAS_HTONS:
- * This symbol, if defined, indicates that the htons() routine (and
- * friends htonl() ntohl() ntohs()) are available to do network
- * order byte swapping.
- */
-/* HAS_NTOHL:
- * This symbol, if defined, indicates that the ntohl() routine (and
- * friends htonl() htons() ntohs()) are available to do network
- * order byte swapping.
- */
-/* HAS_NTOHS:
- * This symbol, if defined, indicates that the ntohs() routine (and
- * friends htonl() htons() ntohl()) are available to do network
- * order byte swapping.
- */
-#define HAS_HTONL /**/
-#define HAS_HTONS /**/
-#define HAS_NTOHL /**/
-#define HAS_NTOHS /**/
-
-/* HAS_LONG_DOUBLE:
- * This symbol will be defined if the C compiler supports long
- * doubles.
- */
-/* LONG_DOUBLESIZE:
- * This symbol contains the size of a long double, so that the
- * C preprocessor can make decisions based on it. It is only
- * defined if the system supports long doubles.
- */
-/*#define HAS_LONG_DOUBLE /**/
-#ifdef HAS_LONG_DOUBLE
-#define LONG_DOUBLESIZE 8 /**/
-#endif
-
-/* HAS_LONG_LONG:
- * This symbol will be defined if the C compiler supports long long.
- */
-/* LONGLONGSIZE:
- * This symbol contains the size of a long long, so that the
- * C preprocessor can make decisions based on it. It is only
- * defined if the system supports long long.
- */
-/*#define HAS_LONG_LONG /**/
-#ifdef HAS_LONG_LONG
-#define LONGLONGSIZE 8 /**/
-#endif
-
-/* HAS_MEMCHR:
- * This symbol, if defined, indicates that the memchr routine is available
- * to locate characters within a C string.
- */
-#define HAS_MEMCHR /**/
-
-/* HAS_MMAP:
- * This symbol, if defined, indicates that the mmap system call is
- * available to map a file into memory.
- */
-/* Mmap_t:
- * This symbol holds the return type of the mmap() system call
- * (and simultaneously the type of the first argument).
- * Usually set to 'void *' or 'cadd_t'.
- */
-/*#define HAS_MMAP /**/
-#define Mmap_t void * /**/
-
-/* HAS_MSG:
- * This symbol, if defined, indicates that the entire msg*(2) library is
- * supported (IPC mechanism based on message queues).
- */
-/*#define HAS_MSG /**/
-
-/* HAS_SEM:
- * This symbol, if defined, indicates that the entire sem*(2) library is
- * supported.
- */
-/*#define HAS_SEM /**/
-
-/* HAS_SETGRENT:
- * This symbol, if defined, indicates that the setgrent routine is
- * available for initializing sequential access of the group database.
- */
-/*#define HAS_SETGRENT /**/
-
-/* HAS_SETGROUPS:
- * This symbol, if defined, indicates that the setgroups() routine is
- * available to set the list of process groups. If unavailable, multiple
- * groups are probably not supported.
- */
-/*#define HAS_SETGROUPS /**/
-
-/* HAS_SETHOSTENT:
- * This symbol, if defined, indicates that the sethostent() routine is
- * available.
- */
-/*#define HAS_SETHOSTENT /**/
-
-/* HAS_SETNETENT:
- * This symbol, if defined, indicates that the setnetent() routine is
- * available.
- */
-/*#define HAS_SETNETENT /**/
-
-/* HAS_SETPROTOENT:
- * This symbol, if defined, indicates that the setprotoent() routine is
- * available.
- */
-/*#define HAS_SETPROTOENT /**/
-
-/* HAS_SETPWENT:
- * This symbol, if defined, indicates that the setpwent routine is
- * available for initializing sequential access of the passwd database.
- */
-/*#define HAS_SETPWENT /**/
-
-/* HAS_SETSERVENT:
- * This symbol, if defined, indicates that the setservent() routine is
- * available.
- */
-/*#define HAS_SETSERVENT /**/
-
-/* HAS_SETVBUF:
- * This symbol, if defined, indicates that the setvbuf routine is
- * available to change buffering on an open stdio stream.
- * to a line-buffered mode.
- */
-/*#define HAS_SETVBUF /**/
-
-/* HAS_SHM:
- * This symbol, if defined, indicates that the entire shm*(2) library is
- * supported.
- */
-/*#define HAS_SHM /**/
-
-/* HAS_SOCKET:
- * This symbol, if defined, indicates that the BSD socket interface is
- * supported.
- */
-/* HAS_SOCKETPAIR:
- * This symbol, if defined, indicates that the BSD socketpair() call is
- * supported.
- */
-/* HAS_MSG_CTRUNC:
- * This symbol, if defined, indicates that the MSG_CTRUNC is supported.
- * Checking just with #ifdef might not be enough because this symbol
- * has been known to be an enum.
- */
-/* HAS_MSG_DONTROUTE:
- * This symbol, if defined, indicates that the MSG_DONTROUTE is supported.
- * Checking just with #ifdef might not be enough because this symbol
- * has been known to be an enum.
- */
-/* HAS_MSG_OOB:
- * This symbol, if defined, indicates that the MSG_OOB is supported.
- * Checking just with #ifdef might not be enough because this symbol
- * has been known to be an enum.
- */
-/* HAS_MSG_PEEK:
- * This symbol, if defined, indicates that the MSG_PEEK is supported.
- * Checking just with #ifdef might not be enough because this symbol
- * has been known to be an enum.
- */
-/* HAS_MSG_PROXY:
- * This symbol, if defined, indicates that the MSG_PROXY is supported.
- * Checking just with #ifdef might not be enough because this symbol
- * has been known to be an enum.
- */
-/* HAS_SCM_RIGHTS:
- * This symbol, if defined, indicates that the SCM_RIGHTS is supported.
- * Checking just with #ifdef might not be enough because this symbol
- * has been known to be an enum.
- */
-/* HAS_SENDMSG:
- * This symbol, if defined, indicates that the sendmsg is supported
- * to send messages between sockets. You will also need struct
- * iovec from <sys/uio.h>, HAS_STRUCT_IOVEC and I_SYSUIO.
- */
-/* HAS_RECVMSG:
- * This symbol, if defined, indicates that the recvmsg is supported
- * to send messages between sockets. You will also need struct
- * iovec from <sys/uio.h>, HAS_STRUCT_IOVEC and I_SYSUIO.
- */
-/* HAS_STRUCT_MSGHDR:
- * This symbol, if defined, indicates that the struct msghdr
- * (BSD 4.3 or 4.4) is supported. You will also need struct
- * iovec from <sys/uio.h>, HAS_STRUCT_IOVEC and I_SYSUIO.
- */
-/* HAS_STRUCT_CMSGHDR:
- * This symbol, if defined, indicates that the struct cmsghdr
- * (BSD 4.4) is supported. You will also need struct
- * iovec from <sys/uio.h>, HAS_STRUCT_IOVEC and I_SYSUIO.
- */
-#define HAS_SOCKET /**/
-/*#define HAS_SOCKETPAIR /**/
-/*#define HAS_MSG_CTRUNC /**/
-/*#define HAS_MSG_DONTROUTE /**/
-/*#define HAS_MSG_OOB /**/
-/*#define HAS_MSG_PEEK /**/
-/*#define HAS_MSG_PROXY / **/
-/*#define HAS_SCM_RIGHTS /**/
-/*##define HAS_SENDMSG /**/
-/*##define HAS_RECVMSG /**/
-/*##define HAS_STRUCT_MSGHDR /**/
-/*##define HAS_STRUCT_CMSGHDR /**/
-
-/* USE_STAT_BLOCKS:
- * This symbol is defined if this system has a stat structure declaring
- * st_blksize and st_blocks.
- */
-#define USE_STAT_BLOCKS /**/
-
-/* HAS_STRERROR:
- * This symbol, if defined, indicates that the strerror routine is
- * available to translate error numbers to strings. See the writeup
- * of Strerror() in this file before you try to define your own.
- */
-/* HAS_SYS_ERRLIST:
- * This symbol, if defined, indicates that the sys_errlist array is
- * available to translate error numbers to strings. The extern int
- * sys_nerr gives the size of that table.
- */
-/* Strerror:
- * This preprocessor symbol is defined as a macro if strerror() is
- * not available to translate error numbers to strings but sys_errlist[]
- * array is there.
- */
-#define HAS_STRERROR /**/
-/*##define HAS_SYS_ERRLIST /**/
-#define Strerror(e) strerror(e)
-
-/* HAS_UNION_SEMUN:
- * This symbol, if defined, indicates that the union semun is
- * defined by including <sys/sem.h>. If not, the user code
- * probably needs to define it as:
- * union semun {
- * int val;
- * struct semid_ds *buf;
- * unsigned short *array;
- * }
- */
-/* USE_SEMCTL_SEMUN:
- * This symbol, if defined, indicates that union semun is
- * used for semctl IPC_STAT.
- */
-/* USE_SEMCTL_SEMID_DS:
- * This symbol, if defined, indicates that struct semid_ds * is
- * used for semctl IPC_STAT.
- */
-/*#define HAS_UNION_SEMUN / **/
-#define USE_SEMCTL_SEMUN /**/
-#define USE_SEMCTL_SEMID_DS /**/
-
-/* HAS_VFORK:
- * This symbol, if defined, indicates that vfork() exists.
- */
-/*#define HAS_VFORK / **/
-
-/* Signal_t:
- * This symbol's value is either "void" or "int", corresponding to the
- * appropriate return type of a signal handler. Thus, you can declare
- * a signal handler using "Signal_t (*handler)()", and define the
- * handler using "Signal_t handler(sig)".
- */
-#define Signal_t void /* Signal handler's return type */
-
-/* Groups_t:
- * This symbol holds the type used for the second argument to
- * getgroups() and setgropus(). Usually, this is the same as
- * gidtype (gid_t) , but sometimes it isn't.
- * It can be int, ushort, uid_t, etc...
- * It may be necessary to include <sys/types.h> to get any
- * typedef'ed information. This is only required if you have
- * getgroups() or setgropus()..
- */
-#if defined(HAS_GETGROUPS) || defined(HAS_SETGROUPS)
-#define Groups_t gid_t /* Type for 2nd arg to [sg]etgroups() */
-#endif
-
-/* I_GRP:
- * This symbol, if defined, indicates to the C program that it should
- * include <grp.h>.
- */
-/* GRPASSWD:
- * This symbol, if defined, indicates to the C program that struct group
- * in <grp.h> contains gr_passwd.
- */
-/*##define I_GRP /**/
-/*##define GRPASSWD /**/
-
-/* I_NETDB:
- * This symbol, if defined, indicates that <netdb.h> exists and
- * should be included.
- */
-#define I_NETDB /**/
-
-/* I_PWD:
- * This symbol, if defined, indicates to the C program that it should
- * include <pwd.h>.
- */
-/* PWQUOTA:
- * This symbol, if defined, indicates to the C program that struct passwd
- * contains pw_quota.
- */
-/* PWAGE:
- * This symbol, if defined, indicates to the C program that struct passwd
- * contains pw_age.
- */
-/* PWCHANGE:
- * This symbol, if defined, indicates to the C program that struct passwd
- * contains pw_change.
- */
-/* PWCLASS:
- * This symbol, if defined, indicates to the C program that struct passwd
- * contains pw_class.
- */
-/* PWEXPIRE:
- * This symbol, if defined, indicates to the C program that struct passwd
- * contains pw_expire.
- */
-/* PWCOMMENT:
- * This symbol, if defined, indicates to the C program that struct passwd
- * contains pw_comment.
- */
-/* PWGECOS:
- * This symbol, if defined, indicates to the C program that struct passwd
- * contains pw_gecos.
- */
-/* PWPASSWD:
- * This symbol, if defined, indicates to the C program that struct passwd
- * contains pw_passwd.
- */
-/*#define I_PWD /**/
-/*#define PWQUOTA /**/
-/*#define PWAGE / **/
-/*#define PWCHANGE / **/
-/*#define PWCLASS / **/
-/*#define PWEXPIRE / **/
-/*#define PWCOMMENT /**/
-/*#define PWGECOS /**/
-/*#define PWPASSWD /**/
-
-/* I_SYSUIO:
- * This symbol, if defined, indicates that <sys/uio.h> exists and
- * should be included.
- */
-#/*define I_SYSUIO /**/
-
-/* Free_t:
- * This variable contains the return type of free(). It is usually
- * void, but occasionally int.
- */
-/* Malloc_t:
- * This symbol is the type of pointer returned by malloc and realloc.
- */
-#define Malloc_t void * /**/
-#define Free_t void /**/
-
-/* MYMALLOC:
- * This symbol, if defined, indicates that we're using our own malloc.
- */
-/*#define MYMALLOC / **/
-
-/* SIG_NAME:
- * This symbol contains a list of signal names in order of
- * signal number. This is intended
- * to be used as a static array initialization, like this:
- * char *sig_name[] = { SIG_NAME };
- * The signals in the list are separated with commas, and each signal
- * is surrounded by double quotes. There is no leading SIG in the signal
- * name, i.e. SIGQUIT is known as "QUIT".
- * Gaps in the signal numbers (up to NSIG) are filled in with NUMnn,
- * etc., where nn is the actual signal number (e.g. NUM37).
- * The signal number for sig_name[i] is stored in sig_num[i].
- * The last element is 0 to terminate the list with a NULL. This
- * corresponds to the 0 at the end of the sig_num list.
- */
-/* SIG_NUM:
- * This symbol contains a list of signal numbers, in the same order as the
- * SIG_NAME list. It is suitable for static array initialization, as in:
- * int sig_num[] = { SIG_NUM };
- * The signals in the list are separated with commas, and the indices
- * within that list and the SIG_NAME list match, so it's easy to compute
- * the signal name from a number or vice versa at the price of a small
- * dynamic linear lookup.
- * Duplicates are allowed, but are moved to the end of the list.
- * The signal number corresponding to sig_name[i] is sig_number[i].
- * if (i < NSIG) then sig_number[i] == i.
- * The last element is 0, corresponding to the 0 at the end of
- * the sig_name list.
- */
-#define SIG_NAME "ZERO", 0 /**/
-#define SIG_NUM 0, 0 /**/
-
-/* VOIDFLAGS:
- * This symbol indicates how much support of the void type is given by this
- * compiler. What various bits mean:
- *
- * 1 = supports declaration of void
- * 2 = supports arrays of pointers to functions returning void
- * 4 = supports comparisons between pointers to void functions and
- * addresses of void functions
- * 8 = suports declaration of generic void pointers
- *
- * The package designer should define VOIDUSED to indicate the requirements
- * of the package. This can be done either by #defining VOIDUSED before
- * including config.h, or by defining defvoidused in Myinit.U. If the
- * latter approach is taken, only those flags will be tested. If the
- * level of void support necessary is not present, defines void to int.
- */
-#ifndef VOIDUSED
-#define VOIDUSED 15
-#endif
-#define VOIDFLAGS 15
-#if (VOIDFLAGS & VOIDUSED) != VOIDUSED
-#define void int /* is void to be avoided? */
-#define M_VOID /* Xenix strikes again */
-#endif
-
-/* ARCHLIB:
- * This variable, if defined, holds the name of the directory in
- * which the user wants to put architecture-dependent public
- * library files for perl5. It is most often a local directory
- * such as /usr/local/lib. Programs using this variable must be
- * prepared to deal with filename expansion. If ARCHLIB is the
- * same as PRIVLIB, it is not defined, since presumably the
- * program already searches PRIVLIB.
- */
-/* ARCHLIB_EXP:
- * This symbol contains the ~name expanded version of ARCHLIB, to be used
- * in programs that are not prepared to deal with ~ expansion at run-time.
- */
-#define ARCHLIB "/perl/lib/5.00562/epoc" /**/
-#define ARCHLIB_EXP "/perl/lib/5.00562/epoc" /**/
-
-/* DLSYM_NEEDS_UNDERSCORE:
- * This symbol, if defined, indicates that we need to prepend an
- * underscore to the symbol name before calling dlsym(). This only
- * makes sense if you *have* dlsym, which we will presume is the
- * case if you're using dl_dlopen.xs.
- */
-/*#define DLSYM_NEEDS_UNDERSCORE / **/
-
-/* HAS_FSEEKO:
- * This symbol, if defined, indicates that the fseeko routine is
- * available to fseek beyond 32 bits (useful for ILP32 hosts).
- */
-/*#define HAS_FSEEKO / **/
-
-/* HAS_FTELLO:
- * This symbol, if defined, indicates that the ftello routine is
- * available to ftell from beyond 32 bits (useful for ILP32 hosts).
- */
-/*#define HAS_FTELLO / **/
-
-/* HAS_GETMNTENT:
- * This symbol, if defined, indicates that the getmntent routine is
- * available to iterate through mounted file systems.
- */
-/*#define HAS_GETMNTENT / **/
-
-/* HAS_HASMNTOPT:
- * This symbol, if defined, indicates that the hasmntopt routine is
- * available to query the mount options of file systems.
- */
-/*#define HAS_HASMNTOPT / **/
-
-/* HAS_MADVISE:
- * This symbol, if defined, indicates that the madvise system call is
- * available to map a file into memory.
- */
-/*#define HAS_MADVISE /**/
-
-/* HAS_MPROTECT:
- * This symbol, if defined, indicates that the mprotect system call is
- * available to modify the access protection of a memory mapped file.
- */
-/*#define HAS_MPROTECT /**/
-
-/* HAS_READV:
- * This symbol, if defined, indicates that the readv routine is
- * available to do gather reads. You will also need <sys/uio.h>
- * and there I_SYSUIO.
- */
-/*#define HAS_READV /**/
-
-/* USE_SFIO:
- * This symbol, if defined, indicates that sfio should
- * be used.
- */
-/*#define USE_SFIO / **/
-
-/* HAS_FSTATFS:
- * This symbol, if defined, indicates that the fstatfs routine is
- * available to stat filesystems of file descriptors.
- */
-/* HAS_STRUCT_STATFS_FLAGS:
- * This symbol, if defined, indicates that the struct statfs
- * does have the f_flags member containing the mount flags of
- * the filesystem holding the file.
- * This kind of struct statfs is coming from sys/mount.h (BSD),
- * not from sys/statfs.h (SYSV).
- */
-#define HAS_FSTATFS /**/
-#define HAS_STRUCT_STATFS_FLAGS /**/
-
-/* HAS_FSTATVFS:
- * This symbol, if defined, indicates that the fstatvfs routine is
- * available to stat filesystems of file descriptors.
- */
-/*#define HAS_FSTATVFS /**/
-
-/* HAS_TELLDIR_PROTO:
- * This symbol, if defined, indicates that the system provides
- * a prototype for the telldir() function. Otherwise, it is up
- * to the program to supply one. A good guess is
- * extern long telldir _((DIR*));
- */
-#define HAS_TELLDIR_PROTO /**/
-
-/* HAS_WRITEV:
- * This symbol, if defined, indicates that the writev routine is
- * available to do scatter writes.
- */
-/*#define HAS_WRITEV /**/
-
-/* USE_DYNAMIC_LOADING:
- * This symbol, if defined, indicates that dynamic loading of
- * some sort is available.
- */
-/*#define USE_DYNAMIC_LOADING /**/
-
-/* FFLUSH_NULL:
- * This symbol, if defined, tells that fflush(NULL) does flush
- * all pending stdio output.
- */
-/* FFLUSH_ALL:
- * This symbol, if defined, tells that to flush
- * all pending stdio output one must loop through all
- * the stdio file handles stored in an array and fflush them.
- * Note that if fflushNULL is defined, fflushall will not
- * even be probed for and will be left undefined.
- */
-/*#define FFLUSH_NULL /**/
-#define FFLUSH_ALL / **/
-
-/* DB_Prefix_t:
- * This symbol contains the type of the prefix structure element
- * in the <db.h> header file. In older versions of DB, it was
- * int, while in newer ones it is u_int32_t.
- */
-/* DB_Hash_t:
- * This symbol contains the type of the prefix structure element
- * in the <db.h> header file. In older versions of DB, it was
- * int, while in newer ones it is size_t.
- */
-/*#define DB_Hash_t u_int32_t /**/
-/*#define DB_Prefix_t size_t /**/
-
-/* I_INTTYPES:
- * This symbol, if defined, indicates to the C program that it should
- * include <inttypes.h>.
- */
-/* HAS_INT64_T:
- * This symbol will defined if the C compiler supports int64_t.
- * Usually the <inttypes.h> needs to be included, but sometimes
- * <sys/types.h> is enough.
- */
-/*#define I_INTTYPES / **/
-/*#define HAS_INT64_T / **/
-
-/* I_MNTENT:
- * This symbol, if defined, indicates that <mntent.h> exists and
- * should be included.
- */
-/*#define I_MNTENT / **/
-
-/* I_NETINET_TCP:
- * This symbol, if defined, indicates to the C program that it should
- * include <netinet/tcp.h>.
- */
-#define I_NETINET_TCP /**/
-
-/* I_POLL:
- * This symbol, if defined, indicates that <poll.h> exists and
- * should be included.
- */
-/*#define I_POLL /**/
-
-/* I_SYS_MMAN:
- * This symbol, if defined, indicates that <sys/mman.h> exists and
- * should be included.
- */
-/*#define I_SYS_MMAN /**/
-
-/* I_SYS_MOUNT:
- * This symbol, if defined, indicates that <sys/mount.h> exists and
- * should be included.
- */
-/*#define I_SYS_MOUNT /**/
-
-/* I_SYS_STATVFS:
- * This symbol, if defined, indicates that <sys/statvfs.h> exists and
- * should be included.
- */
-/*#define I_SYS_STATVFS /**/
-
-/* INSTALL_USR_BIN_PERL:
- * This symbol, if defined, indicates that Perl is to be installed
- * also as /usr/bin/perl.
- */
-/*#define INSTALL_USR_BIN_PERL /**/
-
-/* PRIVLIB:
- * This symbol contains the name of the private library for this package.
- * The library is private in the sense that it needn't be in anyone's
- * execution path, but it should be accessible by the world. The program
- * should be prepared to do ~ expansion.
- */
-/* PRIVLIB_EXP:
- * This symbol contains the ~name expanded version of PRIVLIB, to be used
- * in programs that are not prepared to deal with ~ expansion at run-time.
- */
-#define PRIVLIB "/perl/lib/5.00562" /**/
-#define PRIVLIB_EXP "/perl/lib/5.00562" /**/
-
-/* SELECT_MIN_BITS:
- * This symbol holds the minimum number of bits operated by select.
- * That is, if you do select(n, ...), how many bits at least will be
- * cleared in the masks if some activity is detected. Usually this
- * is either n or 32*ceil(n/32), especially many little-endians do
- * the latter. This is only useful if you have select(), naturally.
- */
-#define SELECT_MIN_BITS 32 /**/
-
-/* SITEARCH:
- * This symbol contains the name of the private library for this package.
- * The library is private in the sense that it needn't be in anyone's
- * execution path, but it should be accessible by the world. The program
- * should be prepared to do ~ expansion.
- * The standard distribution will put nothing in this directory.
- * Individual sites may place their own extensions and modules in
- * this directory.
- */
-/* SITEARCH_EXP:
- * This symbol contains the ~name expanded version of SITEARCH, to be used
- * in programs that are not prepared to deal with ~ expansion at run-time.
- */
-#define SITEARCH "/perl/lib/site_perl/5.00562/epoc" /**/
-#define SITEARCH_EXP "/perl/lib/site_perl/5.00562/epoc" /**/
-
-/* SITELIB:
- * This symbol contains the name of the private library for this package.
- * The library is private in the sense that it needn't be in anyone's
- * execution path, but it should be accessible by the world. The program
- * should be prepared to do ~ expansion.
- * The standard distribution will put nothing in this directory.
- * Individual sites may place their own extensions and modules in
- * this directory.
- */
-/* SITELIB_EXP:
- * This symbol contains the ~name expanded version of SITELIB, to be used
- * in programs that are not prepared to deal with ~ expansion at run-time.
- */
-#define SITELIB "/perl/lib/site_perl/5.00562" /**/
-#define SITELIB_EXP "/perl/lib/site_perl/5.00562" /**/
-
-/* STARTPERL:
- * This variable contains the string to put in front of a perl
- * script to make sure (one hopes) that it runs with perl and not
- * some shell.
- */
-#define STARTPERL "#!/opt/perl/bin/perl" /**/
-
-/* HAS_STDIO_STREAM_ARRAY:
- * This symbol, if defined, tells that there is an array
- * holding the stdio streams.
- */
-/* STDIO_STREAM_ARRAY:
- * This symbol tells the name of the array holding the stdio streams.
- * Usual values include _iob, __iob, and __sF.
- */
-/*#define HAS_STDIO_STREAM_ARRAY /**/
-/*#define STDIO_STREAM_ARRAY _iob
-
-/* USE_64_BITS:
- * This symbol, if defined, indicates that 64-bit interfaces should
- * be used when available. If not defined, the native default interfaces
- * will be used (be they 32 or 64 bits).
- */
-/*#define USE_64_BITS /**/
-
-/* MULTIPLICITY:
- * This symbol, if defined, indicates that Perl should
- * be built to use multiplicity.
- */
-/*#define MULTIPLICITY / **/
-
-/* USE_PERLIO:
- * This symbol, if defined, indicates that the PerlIO abstraction should
- * be used throughout. If not defined, stdio should be
- * used in a fully backward compatible manner.
- */
-/*#define USE_PERLIO / **/
-
-/* HAS_DRAND48_PROTO:
- * This symbol, if defined, indicates that the system provides
- * a prototype for the drand48() function. Otherwise, it is up
- * to the program to supply one. A good guess is
- * extern double drand48 _((void));
- */
-#define HAS_DRAND48_PROTO /**/
-
-/* HAS_GETHOST_PROTOS:
- * This symbol, if defined, indicates that <netdb.h> includes
- * prototypes for gethostent(), gethostbyname(), and
- * gethostbyaddr(). Otherwise, it is up to the program to guess
- * them. See netdbtype.U for probing for various Netdb_xxx_t types.
- */
-#define HAS_GETHOST_PROTOS /**/
-
-/* HAS_GETNET_PROTOS:
- * This symbol, if defined, indicates that <netdb.h> includes
- * prototypes for getnetent(), getnetbyname(), and
- * getnetbyaddr(). Otherwise, it is up to the program to guess
- * them. See netdbtype.U for probing for various Netdb_xxx_t types.
- */
-#define HAS_GETNET_PROTOS /**/
-
-/* HAS_GETPROTO_PROTOS:
- * This symbol, if defined, indicates that <netdb.h> includes
- * prototypes for getprotoent(), getprotobyname(), and
- * getprotobyaddr(). Otherwise, it is up to the program to guess
- * them. See netdbtype.U for probing for various Netdb_xxx_t types.
- */
-#define HAS_GETPROTO_PROTOS /**/
-
-/* HAS_GETSERV_PROTOS:
- * This symbol, if defined, indicates that <netdb.h> includes
- * prototypes for getservent(), getservbyname(), and
- * getservbyaddr(). Otherwise, it is up to the program to guess
- * them. See netdbtype.U for probing for various Netdb_xxx_t types.
- */
-#define HAS_GETSERV_PROTOS /**/
-
-/* Netdb_host_t:
- * This symbol holds the type used for the 1st argument
- * to gethostbyaddr().
- */
-/* Netdb_hlen_t:
- * This symbol holds the type used for the 2nd argument
- * to gethostbyaddr().
- */
-/* Netdb_name_t:
- * This symbol holds the type used for the argument to
- * gethostbyname().
- */
-/* Netdb_net_t:
- * This symbol holds the type used for the 1st argument to
- * getnetbyaddr().
- */
-#define Netdb_host_t const char * /**/
-#define Netdb_hlen_t int /**/
-#define Netdb_name_t const char * /**/
-#define Netdb_net_t int /**/
-
-/* Select_fd_set_t:
- * This symbol holds the type used for the 2nd, 3rd, and 4th
- * arguments to select. Usually, this is 'fd_set *', if HAS_FD_SET
- * is defined, and 'int *' otherwise. This is only useful if you
- * have select(), of course.
- */
-#define Select_fd_set_t fd_set * /**/
-
-/* ARCHNAME:
- * This symbol holds a string representing the architecture name.
- * It may be used to construct an architecture-dependant pathname
- * where library files may be held under a private library, for
- * instance.
- */
-#define ARCHNAME "epoc" /**/
-
-/* OLD_PTHREAD_CREATE_JOINABLE:
- * This symbol, if defined, indicates how to create pthread
- * in joinable (aka undetached) state. NOTE: not defined
- * if pthread.h already has defined PTHREAD_CREATE_JOINABLE
- * (the new version of the constant).
- * If defined, known values are PTHREAD_CREATE_UNDETACHED
- * and __UNDETACHED.
- */
-/*#define OLD_PTHREAD_CREATE_JOINABLE / **/
-
-/* HAS_PTHREAD_YIELD:
- * This symbol, if defined, indicates that the pthread_yield
- * routine is available to yield the execution of the current
- * thread. sched_yield is preferable to pthread_yield.
- */
-/* SCHED_YIELD:
- * This symbol defines the way to yield the execution of
- * the current thread. Known ways are sched_yield,
- * pthread_yield, and pthread_yield with NULL.
- */
-/* HAS_SCHED_YIELD:
- * This symbol, if defined, indicates that the sched_yield
- * routine is available to yield the execution of the current
- * thread. sched_yield is preferable to pthread_yield.
- */
-/*#define HAS_PTHREAD_YIELD / **/
-/*#define SCHED_YIELD sched_yield() /**/
-/*#define HAS_SCHED_YIELD /**/
-
-/* I_MACH_CTHREADS:
- * This symbol, if defined, indicates to the C program that it should
- * include <mach/cthreads.h>.
- */
-/*#define I_MACH_CTHREADS / **/
-
-/* USE_THREADS:
- * This symbol, if defined, indicates that Perl should
- * be built to use threads.
- */
-/* OLD_PTHREADS_API:
- * This symbol, if defined, indicates that Perl should
- * be built to use the old draft POSIX threads API.
- */
-/*#define USE_THREADS /**/
-/*#define OLD_PTHREADS_API / **/
-
-/* Time_t:
- * This symbol holds the type returned by time(). It can be long,
- * or time_t on BSD sites (in which case <sys/types.h> should be
- * included).
- */
-#define Time_t time_t /* Time type */
-
-/* HAS_TIMES:
- * This symbol, if defined, indicates that the times() routine exists.
- * Note that this became obsolete on some systems (SUNOS), which now
- * use getrusage(). It may be necessary to include <sys/times.h>.
- */
-/*#define HAS_TIMES /**/
-
-/* Fpos_t:
- * This symbol holds the type used to declare file positions in libc.
- * It can be fpos_t, long, uint, etc... It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
- */
-#define Fpos_t fpos_t /* File position type */
-
-/* Gid_t:
- * This symbol holds the return type of getgid() and the type of
- * argument to setrgid() and related functions. Typically,
- * it is the type of group ids in the kernel. It can be int, ushort,
- * uid_t, etc... It may be necessary to include <sys/types.h> to get
- * any typedef'ed information.
- */
-#define Gid_t gid_t /* Type for getgid(), etc... */
-
-/* Off_t:
- * This symbol holds the type used to declare offsets in the kernel.
- * It can be int, long, off_t, etc... It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
- */
-/* LSEEKSIZE:
- * This symbol holds the number of bytes used by the Off_t.
- */
-#define Off_t off_t /* <offset> type */
-#define LSEEKSIZE 8 /* <offset> size */
-
-/* Mode_t:
- * This symbol holds the type used to declare file modes
- * for systems calls. It is usually mode_t, but may be
- * int or unsigned short. It may be necessary to include <sys/types.h>
- * to get any typedef'ed information.
- */
-#define Mode_t mode_t /* file mode parameter for system calls */
-
-/* Pid_t:
- * This symbol holds the type used to declare process ids in the kernel.
- * It can be int, uint, pid_t, etc... It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
- */
-#define Pid_t pid_t /* PID type */
-
-/* Size_t:
- * This symbol holds the type used to declare length parameters
- * for string functions. It is usually size_t, but may be
- * unsigned long, int, etc. It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
- */
-#define Size_t size_t /* length paramater for string functions */
-
-/* Uid_t:
- * This symbol holds the type used to declare user ids in the kernel.
- * It can be int, ushort, uid_t, etc... It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
- */
-#define Uid_t uid_t /* UID type */
-
-/* PERL_PRIfldbl:
- * This symbol, if defined, contains the string used by stdio to
- * format long doubles (format 'f') for output.
- */
-/* PERL_PRIgldbl:
- * This symbol, if defined, contains the string used by stdio to
- * format long doubles (format 'g') for output.
- */
-#define PERL_PRIfldbl "f" /**/
-#define PERL_PRIgldbl "g" /**/
-
-#endif
-
--- /dev/null
+#!/bin/sh
+#
+# This file was produced by running the Configure script. It holds all the
+# definitions figured out by Configure. Should you modify one of these values,
+# do not forget to propagate your changes by running "Configure -der". You may
+# instead choose to run each of the .SH files by yourself, or "Configure -S".
+#
+
+# Package name : perl5
+# Source directory : .
+# Configuration time: Sun Oct 3 02:17:38 EET DST 1999
+# Configured by : jhi
+# Target system : osf1 alpha.hut.fi v4.0 878 alpha
+
+Author=''
+Date='$Date'
+Header=''
+Id='$Id'
+Locker=''
+Log='$Log'
+Mcc=''
+RCSfile='$RCSfile'
+Revision='$Revision'
+Source=''
+State=''
+_a='.a'
+_exe='.exe'
+_o='.o'
+afs='false'
+alignbytes='8'
+ansi2knr=''
+aphostname=''
+apirevision=''
+apisubversion=''
+apiversion=''
+ar='arm-pe-ar'
+archlib='/perl/lib/5.5.640/epoc'
+archlibexp='/perl/lib/5.5.640/epoc'
+archname64=''
+archname='epoc'
+archobjs='epoc.o epocish.o epoc_stubs.o'
+awk='awk'
+baserev='5.0'
+bash=''
+bin=''
+bincompat5005='false'
+binexp=''
+bison='bison'
+byacc=''
+byteorder='1234'
+c=''
+castflags='0'
+cat='cat'
+cc='arm-pe-gcc -B/usr/local/lib/gcc-lib/arm-pe/cygnus-2.7.2-960323/ -nostdinc -D__SYMBIAN32__ -D__PSISOFT32__ -D__GCC32__ -D__EPOC32__ -D__MARM__ -D__EXE__ -I/usr/local/epoc/include/ -I/usr/local/epoc/include/libc -DEPOC'
+cccdlflags=''
+ccdlflags=''
+ccflags='-Wno-ctor-dtor-privacy -mcpu-arm710 -mapcs-32 -mshort-load-bytes -msoft-float -fcheck-new -fvtable-thunks'
+ccsymbols=''
+cf_by='olaf'
+cf_email='o.flebbe@gmx.de'
+cf_time='Dec 1999'
+chgrp=''
+chmod=''
+chown=''
+clocktype=''
+comm=''
+compress=''
+contains='grep'
+cp='cp'
+cpio=''
+cpp='arm-pe-cpp'
+cpp_stuff='42'
+cppccsymbols='EPOC=1'
+cppflags=' -nostdinc -D__SYMBIAN32__ -D__PSISOFT32__ -D__GCC32__ -D__EPOC32__ -D__MARM__ -D__EXE__ -I/usr/local/epoc/include/ -I/usr/local/epoc/include/libc'
+cpplast='-'
+cppminus='-'
+cpprun='arm-pe-gcc -E -B/usr/local/lib/gcc-lib/arm-pe/cygnus-2.7.2-960323/'
+cppstdin='arm-pe-gcc -E -B/usr/local/lib/gcc-lib/arm-pe/cygnus-2.7.2-960323/'
+cppsymbols=''
+crosscompile='define'
+cryptlib=''
+csh='csh'
+d_Gconvert='sprintf((b),"%.*g",(n),(x))'
+d_PRIEldbl='undef'
+d_PRIFldbl='undef'
+d_PRIGldbl='undef'
+d_PRIX64='undef'
+d_PRId64='undef'
+d_PRIeldbl='undef'
+d_PRIfldbl='define'
+d_PRIgldbl='define'
+d_PRIi64='undef'
+d_PRIo64='undef'
+d_PRIu64='undef'
+d_PRIx64='undef'
+d_access='undef'
+d_accessx='undef'
+d_alarm='undef'
+d_archlib='define'
+d_atolf='undef'
+d_atoll='undef'
+d_attribut='undef'
+d_bcmp='define'
+d_bcopy='define'
+d_bincompat5005='undef'
+d_bsd='undef'
+d_bsdgetpgrp='undef'
+d_bsdsetpgrp='undef'
+d_bzero='define'
+d_casti32='undef'
+d_castneg='undef'
+d_charvspr='undef'
+d_chown='undef'
+d_chroot='undef'
+d_chsize='undef'
+d_closedir='undef'
+d_cmsghdr_s='undef'
+d_const='define'
+d_crypt='undef'
+d_csh='undef'
+d_cuserid='undef'
+d_dbl_dig='undef'
+d_difftime='define'
+d_dirnamlen='undef'
+d_dlerror='undef'
+d_dlopen='undef'
+d_dlsymun='undef'
+d_dosuid='undef'
+d_drand48proto='define'
+d_dup2='undef'
+d_eaccess='undef'
+d_endgrent='undef'
+d_endhent='undef'
+d_endnent='undef'
+d_endpent='undef'
+d_endpwent='undef'
+d_endsent='undef'
+d_endspent='undef'
+d_eofnblk='define'
+d_eunice='undef'
+d_fchmod='undef'
+d_fchown='undef'
+d_fcntl='undef'
+d_fd_macros='undef'
+d_fd_set='define'
+d_fds_bits='undef'
+d_fgetpos='define'
+d_flexfnam='define'
+d_flock='undef'
+d_fork='undef'
+d_fpathconf='undef'
+d_fpos64_t='undef'
+d_fseeko='undef'
+d_fsetpos='define'
+d_fstatfs='define'
+d_fstatvfs='undef'
+d_ftello='undef'
+d_ftime='undef'
+d_getgrent='undef'
+d_getgrps='undef'
+d_gethbyaddr='define'
+d_gethbyname='define'
+d_gethent='undef'
+d_gethname='undef'
+d_gethostprotos='define'
+d_getlogin='undef'
+d_getmntent='undef'
+d_getnbyaddr='undef'
+d_getnbyname='undef'
+d_getnent='undef'
+d_getnetprotos='define'
+d_getpbyname='define'
+d_getpbynumber='define'
+d_getpent='undef'
+d_getpgid='undef'
+d_getpgrp2='undef'
+d_getpgrp='undef'
+d_getppid='undef'
+d_getprior='undef'
+d_getprotoprotos='define'
+d_getpwent='undef'
+d_getsbyname='undef'
+d_getsbyport='undef'
+d_getsent='undef'
+d_getservprotos='define'
+d_getspent='undef'
+d_getspnam='undef'
+d_gettimeod='define'
+d_gnulibc='undef'
+d_grpasswd='undef'
+d_hasmntopt='undef'
+d_htonl='define'
+d_index='undef'
+d_inetaton='define'
+d_int64t='undef'
+d_iovec_s='undef'
+d_isascii='define'
+d_killpg='undef'
+d_lchown='undef'
+d_ldbl_dig='undef'
+d_link='undef'
+d_llseek='undef'
+d_locconv='undef'
+d_lockf='undef'
+d_longdbl='undef'
+d_longlong='define'
+d_lstat='undef'
+d_madvise='undef'
+d_mblen='undef'
+d_mbstowcs='undef'
+d_mbtowc='undef'
+d_memchr='define'
+d_memcmp='define'
+d_memcpy='define'
+d_memmove='define'
+d_memset='define'
+d_mkdir='define'
+d_mkfifo='undef'
+d_mktime='define'
+d_mmap='undef'
+d_mprotect='undef'
+d_msg='undef'
+d_msg_ctrunc='undef'
+d_msg_dontroute='undef'
+d_msg_oob='undef'
+d_msg_peek='undef'
+d_msg_proxy='undef'
+d_msgctl='undef'
+d_msgget='undef'
+d_msghdr_s='undef'
+d_msgrcv='undef'
+d_msgsnd='undef'
+d_msync='undef'
+d_munmap='undef'
+d_mymalloc='undef'
+d_nice='undef'
+d_off64_t='undef'
+d_old_pthread_create_joinable='undef'
+d_oldpthreads='undef'
+d_oldsock='undef'
+d_open3='define'
+d_pathconf='undef'
+d_pause='undef'
+d_phostname='undef'
+d_pipe='undef'
+d_poll='undef'
+d_portable='undef'
+d_pthread_yield='undef'
+d_pwage='undef'
+d_pwchange='undef'
+d_pwclass='undef'
+d_pwcomment='undef'
+d_pwexpire='undef'
+d_pwgecos='undef'
+d_pwpasswd='undef'
+d_pwquota='undef'
+d_readdir='define'
+d_readlink='undef'
+d_readv='undef'
+d_recvmsg='undef'
+d_rename='define'
+d_rewinddir='define'
+d_rmdir='define'
+d_safebcpy='undef'
+d_safemcpy='undef'
+d_sanemcmp='define'
+d_sched_yield='undef'
+d_scm_rights='undef'
+d_seekdir='define'
+d_select='undef'
+d_sem='undef'
+d_semctl='undef'
+d_semctl_semid_ds='define'
+d_semctl_semun='define'
+d_semget='undef'
+d_semop='undef'
+d_sendmsg='undef'
+d_setegid='undef'
+d_seteuid='undef'
+d_setgrent='undef'
+d_setgrps='undef'
+d_sethent='undef'
+d_setlinebuf='undef'
+d_setlocale='undef'
+d_setnent='undef'
+d_setpent='undef'
+d_setpgid='undef'
+d_setpgrp2='undef'
+d_setpgrp='undef'
+d_setprior='undef'
+d_setpwent='undef'
+d_setregid='undef'
+d_setresgid='undef'
+d_setresuid='undef'
+d_setreuid='undef'
+d_setrgid='undef'
+d_setruid='undef'
+d_setsent='undef'
+d_setsid='undef'
+d_setspent='undef'
+d_setvbuf='undef'
+d_sfio='undef'
+d_shm='undef'
+d_shmat='undef'
+d_shmatprototype='undef'
+d_shmctl='undef'
+d_shmdt='undef'
+d_shmget='undef'
+d_sigaction='undef'
+d_sigsetjmp='undef'
+d_socket='define'
+d_sockpair='undef'
+d_statblks='define'
+d_statfs='undef'
+d_statfsflags='define'
+d_statvfs='undef'
+d_stdio_cnt_lval='define'
+d_stdio_ptr_lval='define'
+d_stdio_stream_array='undef'
+d_stdiobase='undef'
+d_stdstdio='undef'
+d_strchr='define'
+d_strcoll='define'
+d_strctcpy='define'
+d_strerrm='strerror(e)'
+d_strerror='define'
+d_strtod='define'
+d_strtol='define'
+d_strtoul='define'
+d_strtoull='undef'
+d_strxfrm='define'
+d_suidsafe='undef'
+d_symlink='undef'
+d_syscall='undef'
+d_sysconf='define'
+d_sysernlst='undef'
+d_syserrlst='undef'
+d_system='define'
+d_tcgetpgrp='undef'
+d_tcsetpgrp='undef'
+d_telldir='define'
+d_telldirproto='define'
+d_time='undef'
+d_times='undef'
+d_truncate='undef'
+d_tzname='undef'
+d_umask='undef'
+d_uname='undef'
+d_union_semun='undef'
+d_vendorlib='undef'
+d_vfork='undef'
+d_void_closedir='undef'
+d_voidsig='undef'
+d_voidtty='undef'
+d_volatile='define'
+d_vprintf='define'
+d_wait4='undef'
+d_waitpid='undef'
+d_wcstombs='undef'
+d_wctomb='undef'
+d_writev='undef'
+d_xenix='undef'
+date='date'
+db_hashtype='undef'
+db_prefixtype='undef'
+defvoidused='15'
+direntrytype='struct dirent'
+dlext='none'
+dlsrc='dl_none.xs'
+doublesize='8'
+drand01='(rand()/(double)(1U<<RANDBITS))'
+dynamic_ext=''
+eagain='EAGAIN'
+ebcdic='undef'
+echo='echo'
+egrep='egrep'
+emacs=''
+eunicefix=':'
+exe_ext=''
+expr='expr'
+extensions='Data/Dumper File/Glob IO Socket'
+fflushNULL='undef'
+fflushall='define'
+find=''
+firstmakefile='makefile'
+flex=''
+fpostype='fpos_t'
+freetype='void'
+full_ar='/usr/local/bin/arm-pe-ar'
+full_csh=''
+full_sed='/usr/bin/sed'
+gccversion=''
+gidtype='gid_t'
+glibpth=''
+grep='grep'
+groupcat=''
+groupstype='gid_t'
+gzip='gzip'
+h_fcntl=''
+h_sysfile=''
+hint=''
+hostcat=''
+huge=''
+i_arpainet='define'
+i_bsdioctl='undef'
+i_db='undef'
+i_dbm='undef'
+i_dirent='define'
+i_dld='undef'
+i_dlfcn='undef'
+i_fcntl='define'
+i_float='undef'
+i_gdbm='undef'
+i_grp='undef'
+i_inttypes='undef'
+i_limits='define'
+i_locale='undef'
+i_machcthr='undef'
+i_malloc='undef'
+i_math='define'
+i_memory='undef'
+i_mntent='undef'
+i_ndbm='undef'
+i_netdb='define'
+i_neterrno='undef'
+i_netinettcp='define'
+i_niin='define'
+i_poll='undef'
+i_pthread='undef'
+i_pwd='undef'
+i_rpcsvcdbm='undef'
+i_sfio='undef'
+i_sgtty='undef'
+i_shadow='undef'
+i_socks='undef'
+i_stdarg='define'
+i_stddef='define'
+i_stdlib='define'
+i_string='define'
+i_sysaccess='undef'
+i_sysdir='undef'
+i_sysfile='undef'
+i_sysfilio='undef'
+i_sysin='undef'
+i_sysioctl='define'
+i_sysmman='undef'
+i_sysmount='undef'
+i_sysndir='undef'
+i_sysparam='define'
+i_sysresrc='define'
+i_syssecrt='undef'
+i_sysselct='undef'
+i_syssockio='undef'
+i_sysstat='define'
+i_sysstatvfs='undef'
+i_systime='define'
+i_systimek='undef'
+i_systimes='define'
+i_systypes='define'
+i_sysuio='undef'
+i_sysun='undef'
+i_syswait='define'
+i_termio='undef'
+i_termios='undef'
+i_time='define'
+i_unistd='define'
+i_utime='undef'
+i_values='undef'
+i_varargs='undef'
+i_varhdr='undef'
+i_vfork='undef'
+ignore_versioned_solibs=''
+incpath=''
+inews=''
+installarchlib='/home/olaf/E/lib'
+installbin='/home/olaf/E/bin'
+installman1dir=''
+installman3dir=''
+installprefix='/home/olaf/'
+installprefixexp=''
+installprivlib=''
+installscript=''
+installsitearch='/home/olaf/E/site/'
+installsitelib='/home/olaf/E/site/lib'
+installstyle=''
+installusrbinperl='undef'
+installvendorlib=''
+intsize='4'
+known_extensions='Data/Dumper File/Glob IO Socket'
+ksh=''
+large=''
+ld='echo'
+lddlflags=''
+ldflags=''
+ldlibpthname=''
+less=''
+lib_ext=''
+libc=''
+libperl='perl.a'
+libpth=''
+libs=''
+libswanted=''
+line=''
+lint=''
+lkflags=''
+ln='ln'
+lns='/bin/ln -s'
+locincpth=''
+loclibpth=''
+longdblsize='8'
+longlongsize='8'
+longsize='4'
+lp=''
+lpr=''
+ls='ls'
+lseeksize='8'
+lseektype='off_t'
+mail=''
+mailx=''
+make='make'
+make_set_make='#'
+mallocobj=''
+mallocsrc=''
+malloctype='void *'
+man1dir=''
+man1direxp=''
+man1ext=''
+man3dir=''
+man3direxp=''
+man3ext=''
+medium=''
+mips=''
+mips_type=''
+mkdir='mkdir'
+mmaptype=''
+models='none'
+modetype='mode_t'
+more='more'
+multiarch='define'
+mv=''
+myarchname='epoc'
+mydomain='.gmx.de'
+myhostname='dragon'
+myuname=''
+n='-n'
+netdb_hlen_type='int'
+netdb_host_type='const char *'
+netdb_name_type='const char *'
+netdb_net_type='int'
+nm='arm-pe-nm'
+nm_opt=''
+nm_so_opt=''
+nonxs_ext=''
+nroff='nroff'
+o_nonblock='O_NONBLOCK'
+obj_ext=''
+old_pthread_create_joinable=''
+optimize='-fomit-frame-pointer -DNDEBUG -O'
+orderlib=''
+osname='epoc'
+osvers=''
+package=''
+pager=''
+passcat=''
+patchlevel=''
+path_sep=''
+perl=''
+perladmin=''
+perlpath=''
+pg=''
+phostname=''
+pidtype='pid_t'
+plibpth=''
+pmake=''
+pr=''
+prefix=''
+prefixexp=''
+privlib='/perl/lib/5.5.640'
+privlibexp='/perl/lib/5.5.640'
+prototype='define'
+ptrsize='4'
+randbits='31'
+randfunc=''
+randseedtype='unsigned'
+ranlib='arm-pe-ranlib'
+rd_nodata='-1'
+rm='rm'
+rmail=''
+runnm='false'
+sPRIEldbl=''
+sPRIFldbl=''
+sPRIGldbl=''
+sPRIX64=''
+sPRId64=''
+sPRIeldbl=''
+sPRIfldbl='"f"'
+sPRIgldbl='"g"'
+sPRIi64=''
+sPRIo64=''
+sPRIu64=''
+sPRIx64=''
+sched_yield=''
+scriptdir=''
+scriptdirexp=''
+sed='sed'
+seedfunc='srand'
+selectminbits='32'
+selecttype=''
+sendmail=''
+sh='/bin/sh'
+shar=''
+sharpbang='#!'
+shmattype=''
+shortsize='2'
+shrpenv=''
+shsharp=''
+sig_count='ZERO '
+sig_name=''
+sig_name_init='"ZERO", 0'
+sig_num='0'
+sig_num_init='0, 0'
+signal_t='void'
+sitearch='/perl/lib/site_perl/5.5.640/epoc'
+sitearchexp='/perl/lib/site_perl/5.5.640/epoc'
+sitelib='/perl/lib/site_perl/5.5.640/'
+sitelibexp='/perl/lib/site_perl/5.5.640/'
+siteprefix=''
+siteprefixexp=''
+sizetype='size_t'
+sleep=''
+smail=''
+small=''
+so=''
+sockethdr=''
+socketlib=''
+sort='sort'
+spackage=''
+spitshell='cat'
+split=''
+src='.'
+ssizetype='long'
+startperl=''
+startsh='#!/bin/sh'
+static_ext='Data/Dumper File/Glob IO Socket'
+stdchar='char'
+stdio_base=''
+stdio_bufsiz=''
+stdio_cnt=''
+stdio_filbuf=''
+stdio_ptr=''
+stdio_stream_array=''
+strings=''
+submit=''
+subversion=''
+sysman=''
+tail=''
+tar=''
+tbl=''
+tee='tee'
+test='test'
+timeincl=''
+timetype='time_t'
+touch='touch'
+tr='tr'
+trnl='\n'
+troff=''
+uidsign='1'
+uidtype='uid_t'
+uname='uname'
+uniq='uniq'
+use64bits='undef'
+usedl='undef'
+uselargefiles='undef'
+uselongdouble='undef'
+usemorebits='undef'
+usemultiplicity='undef'
+usemymalloc='n'
+usenm=''
+useopcode=''
+useperlio='undef'
+useposix=''
+usesfio=''
+useshrplib=''
+usesocks='undef'
+usethreads='undef'
+usevendorprefix=''
+usevfork=''
+usrinc=''
+uuname=''
+vendorlib=''
+vendorlibexp=''
+vendorprefix=''
+vendorprefixexp=''
+version='5.5.640'
+vi=''
+voidflags='15'
+xlibpth=''
+zcat=''
+zip=''
+# Configure command line arguments.
+config_arg0=''
+config_args=''
+config_argc=11
+config_arg1=''
+config_arg2=''
+config_arg3=''
+config_arg4=''
+config_arg5=''
+config_arg6=''
+config_arg7=''
+config_arg8=''
+config_arg9=''
+config_arg10=''
+config_arg11=''
+PERL_REVISION=5
+PERL_VERSION=5
+PERL_SUBVERSION=640
+PERL_API_REVISION=5
+PERL_API_VERSION=5
+PERL_API_SUBVERSION=640
+CONFIGDOTSH=true
+# Variables propagated from previous config.sh file.
+pp_sys_cflags=''
+epocish_cflags='ccflags="$cflags -xc++"'
+ivtype='int'
+uvtype='unsigned int'
+i8type='char'
+u8type='unsigned char'
+i16type='short'
+u16type='unsigned short'
+i32type='int'
+u32type='unsigned int'
+i64type='long long'
+u64type='unsigned long long'
+d_quad='define'
+quadtype='long long'
+quadtype='unsigned long long'
+quadkind='QUAD_IS_LONG_LONG'
+nvtype='double'
+ivsize='4'
+uvsize='4'
+i8size='1'
+u8size='1'
+i16size='2'
+u16size='2'
+i32size='4'
+u32size='4'
+i64size='8'
+u64size='8'
+d_fs_data_s='undef'
+d_fseeko='undef'
+d_ldbl_dig='undef'
+d_sqrtl='undef'
+d_getmnt='undef'
+d_statfs_f_flags='undef'
+d_statfs_s='undef'
+d_ustat='undef'
+i_sysstatfs='undef'
+i_sysvfs='undef'
+i_ustat='undef'
+uselonglong='define'
+uidsize='2'
+gidsize='2'
+
--- /dev/null
+#!/usr/bin/perl
+
+use File::Find;
+use Cwd;
+
+$VERSION="5.005";
+$PATCH=63;
+$EPOC_VERSION=16;
+$CROSSCOMPILEPATH=cwd;
+$CROSSREPLACEPATH="H:\\devel\\perl5.005_63";
+
+
+sub filefound {
+ my $f = $File::Find::name;
+
+ return if ( $f =~ /unicode|CPAN|ExtUtils|IPC|User|DB.pm|\.a$|\.ld$|\.exists$/i);
+ my $back = $f;
+
+ $back =~ s|$CROSSCOMPILEPATH||;
+
+ $back =~ s|/|\\|g;
+
+ my $psiback = $back;
+
+ $psiback =~ s/\\lib\\/\\perl\\lib\\$VERSION$PATCH\\/i;
+
+ print OUT "\"$CROSSREPLACEPATH$back\"-\"!:$psiback\"\n" if ( -f $f );
+;
+}
+
+open OUT,">perl.pkg";
+
+print OUT "#{\"perl$VERSION\"},(0x100051d8),$PATCH,$EPOC_VERSION,0\n";
+
+print OUT "\"$CROSSREPLACEPATH\\perlmain.exe\"-\"!:\\perl.exe\"\n";
+
+find(\&filefound, cwd.'/lib');
+print OUT "@\"G:\\lib\\stdlib.sis\",(0x010002c3)\n"
+
+
#include <stdio.h>
#include <sys/unistd.h>
-char *environ = NULL;
void
Perl_epoc_init(int *argcp, char ***argvp) {
int i;
return (SItype) a;
}
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+int
+do_aspawn( pTHX_ SV *really,SV **mark,SV **sp) {
+ return do_spawn( really, mark, sp);
+}
+
+int
+do_spawn (pTHX_ SV *really,SV **mark,SV **sp)
+{
+ dTHR;
+ int rc;
+ char **a,*cmd,**ptr, *cmdline, **argv, *p2;
+ STRLEN n_a;
+ size_t len = 0;
+
+ if (sp<=mark)
+ return -1;
+
+ a=argv=ptr=(char**) malloc ((sp-mark+3)*sizeof (char*));
+
+ while (++mark <= sp) {
+ if (*mark)
+ *a = SvPVx(*mark, n_a);
+ else
+ *a = "";
+ len += strlen( *a) + 1;
+ a++;
+ }
+ *a = Nullch;
+
+ if (!(really && *(cmd = SvPV(really, n_a)))) {
+ cmd = argv[0];
+ argv++;
+ }
+
+ cmdline = (char * ) malloc( len + 1);
+ cmdline[ 0] = '\0';
+ while (*argv != NULL) {
+ strcat( cmdline, *argv++);
+ strcat( cmdline, " ");
+ }
+
+ for (p2=cmd; *p2 != '\0'; p2++) {
+ /* Change / to \ */
+ if ( *p2 == '/')
+ *p2 = '\\';
+ }
+ rc = epoc_spawn( cmd, cmdline);
+ free( ptr);
+ free( cmdline);
+
+ return rc;
+}
+
+
#endif
--- /dev/null
+/*
+ * Copyright (c) 1999 Olaf Flebbe o.flebbe@gmx.de
+ *
+ * You may distribute under the terms of either the GNU General Public
+ * License or the Artistic License, as specified in the README file.
+ *
+ */
+
+#include <string.h>
+
+char *environ = 0;
+
+int getgid() {return 0;}
+int getegid() {return 0;}
+int geteuid() {return 0;}
+int getuid() {return 0;}
+int setgid() {return -1;}
+int setuid() {return -1;}
+
+
+int Perl_my_popen( int a, int b) {
+ return NULL;
+}
+int Perl_my_pclose( int a) {
+ return NULL;
+}
+
+int kill() {return -1;}
+signal() { }
+
+int execv() { return -1;}
+int execvp() { return -1;}
+
+void Perl_do_exec() {}
+
+/*------------------------------------------------------------------*/
+/* Two dummy functions implement getproto* */
+/*------------------------------------------------------------------*/
+#include <sys/types.h>
+#include <netdb.h>
+#include <netinet/in.h>
+
+
+static struct protoent protos[2] = {
+ {"tcp", NULL, IPPROTO_TCP} ,
+ {"udp", NULL, IPPROTO_UDP}};
+
+struct protoent *getprotobyname (const char *st) {
+
+ if (!strcmp( st, "tcp")) {
+ return &protos[0];
+ }
+ if (!strcmp( st, "udp")) {
+ return &protos[1];
+ }
+ return NULL;
+}
+
+struct protoent *getprotobynumber ( int i) {
+ if (i == IPPROTO_TCP) {
+ return &protos[0];
+ }
+ if (i == IPPROTO_UDP) {
+ return &protos[1];
+ }
+ return NULL;
+}
+
+
--- /dev/null
+/*
+ * Copyright (c) 1999 Olaf Flebbe o.flebbe@gmx.de
+ *
+ * You may distribute under the terms of either the GNU General Public
+ * License or the Artistic License, as specified in the README file.
+ *
+ */
+
+/* This is indeed C++ Code !! */
+
+#include <e32std.h>
+
+extern "C" {
+
+epoc_spawn( char *cmd, char *cmdline) {
+ RProcess p;
+ TRequestStatus status;
+ TInt rc;
+
+ rc = p.Create( _L( cmd), _L( cmdline));
+ if (rc != KErrNone)
+ return -1;
+
+ p.Resume();
+
+ p.Logon( status);
+ User::WaitForRequest( status);
+ if (status!=KErrNone) {
+ return -1;
+ }
+ return 0;
+}
+
+}
/* #define ALTERNATE_SHEBANG "#!" / **/
-#ifndef SIGABRT
-# define SIGABRT SIGILL
-#endif
-#ifndef SIGILL
-# define SIGILL 6 /* blech */
-#endif
#define ABORT() abort();
/*
#define dXSUB_SYS
+/* getsockname returns the size of struct sockaddr_in *without* padding */
+#define BOGUS_GETNAME_RETURN 8
+
+/* Yes, size_t is size_t */
+#define Sock_size_t size_t
+
+/*
+ read() on a socket blocks until buf is filled completly,
+ recv() returns each massage
+*/
+#define PERL_SOCK_SYSREAD_IS_RECV
+
+/* No /dev/random available*/
+
+#define PERL_NO_DEV_RANDOM
--- /dev/null
+#!/usr/bin/perl -w
+
+$epoc="/usr/local/epoc";
+@objs=@ARGV;
+$basname=$objs[0];
+$basname =~ s/.o//;
+$baspe = $basname . "pe";
+
+
+system("arm-pe-ld -s -e _E32Startup --base-file $basname.bas " .
+ "-o $baspe.exe $epoc/lib/eexe.o @objs " .
+ "$epoc/lib/ecrt0.o $epoc/lib/estlib.lib $epoc/lib/euser.lib");
+
+system("arm-pe-dlltool --as=arm-pe-as --output-exp $basname.exp " .
+ "--base-file $basname.bas $epoc/lib/eexe.o @objs " .
+ "$epoc/lib/ecrt0.o $epoc/lib/estlib.lib $epoc/lib/euser.lib");
+
+system("arm-pe-ld -s -e _E32Startup -o $basname.exe $basname.exp " .
+ "-o $baspe.exe $epoc/lib/eexe.o @objs " .
+ "$epoc/lib/ecrt0.o $epoc/lib/estlib.lib $epoc/lib/euser.lib");
+
+system( "wine \"$epoc/bin/petran.exe $baspe.exe $basname.exe " .
+ "-nocall -heap 0x00000400 0x00400000 -stack 0x0000c000 " .
+ "-uid1 0x1000007a -uid2 0x100051d8 -uid3 0x00000000 \" ");
+
+++ /dev/null
-target perl.exe
-targettype exe
-uid 0x100051d8
-
-project perl5.005
-subproject perl5.005_60
-
-SOURCE av.c deb.c doio.c doop.c dump.c globals.c gv.c hv.c mg.c miniperlmain.c op.c perl.c perlio.c perly.c pp.c pp_ctl.c pp_hot.c pp_sys.c regcomp.c regexec.c run.c scope.c sv.c taint.c toke.c universal.c utf8.c util.c epoc.c epoc_stubs.c
-systeminclude \epoc32\include\libc \epoc32\include
-
-#if defined(MARM)
-LIBRARY ecrt0.o
-#else
-LIBRARY ecrt0.obj
-#endif
-
-epocstacksize 49152
-epocheapsize 1024 2097152
-
-LIBRARY estlib.lib euser.lib
+++ /dev/null
-#{"perl5.005"},(0x100051d8),60,10,0
-"\epoc32\release\marm\rel\perl.exe"-"!:\perl.exe"
-"\perl5.005\perl5.005_60\epoc\Config.pm"-"!:\perl\lib\5.00560\Config.pm"
-"\perl5.005\perl5.005_60\lib\AnyDBM_File.pm"-"!:\perl\lib\5.00560\AnyDBM_File.pm"
-"\perl5.005\perl5.005_60\lib\AutoLoader.pm"-"!:\perl\lib\5.00560\AutoLoader.pm"
-"\perl5.005\perl5.005_60\lib\AutoSplit.pm"-"!:\perl\lib\5.00560\AutoSplit.pm"
-"\perl5.005\perl5.005_60\lib\Benchmark.pm"-"!:\perl\lib\5.00560\Benchmark.pm"
-"\perl5.005\perl5.005_60\lib\Carp.pm"-"!:\perl\lib\5.00560\Carp.pm"
-"\perl5.005\perl5.005_60\lib\Carp\Heavy.pm"-"!:\perl\lib\5.00560\Carp\Heavy.pm"
-"\perl5.005\perl5.005_60\lib\Class\Struct.pm"-"!:\perl\lib\5.00560\Class\Struct.pm"
-"\perl5.005\perl5.005_60\lib\Cwd.pm"-"!:\perl\lib\5.00560\Cwd.pm"
-"\perl5.005\perl5.005_60\lib\Devel\SelfStubber.pm"-"!:\perl\lib\5.00560\Devel\SelfStubber.pm"
-"\perl5.005\perl5.005_60\lib\DirHandle.pm"-"!:\perl\lib\5.00560\DirHandle.pm"
-"\perl5.005\perl5.005_60\lib\Dumpvalue.pm"-"!:\perl\lib\5.00560\Dumpvalue.pm"
-"\perl5.005\perl5.005_60\lib\English.pm"-"!:\perl\lib\5.00560\English.pm"
-"\perl5.005\perl5.005_60\lib\Env.pm"-"!:\perl\lib\5.00560\Env.pm"
-"\perl5.005\perl5.005_60\lib\Exporter\Heavy.pm"-"!:\perl\lib\5.00560\Exporter\Heavy.pm"
-"\perl5.005\perl5.005_60\lib\Exporter.pm"-"!:\perl\lib\5.00560\Exporter.pm"
-"\perl5.005\perl5.005_60\lib\Fatal.pm"-"!:\perl\lib\5.00560\Fatal.pm"
-"\perl5.005\perl5.005_60\lib\File\Basename.pm"-"!:\perl\lib\5.00560\File\Basename.pm"
-"\perl5.005\perl5.005_60\lib\File\CheckTree.pm"-"!:\perl\lib\5.00560\File\CheckTree.pm"
-"\perl5.005\perl5.005_60\lib\File\Compare.pm"-"!:\perl\lib\5.00560\File\Compare.pm"
-"\perl5.005\perl5.005_60\lib\File\Copy.pm"-"!:\perl\lib\5.00560\File\Copy.pm"
-"\perl5.005\perl5.005_60\lib\File\DosGlob.pm"-"!:\perl\lib\5.00560\File\DosGlob.pm"
-"\perl5.005\perl5.005_60\lib\File\Find.pm"-"!:\perl\lib\5.00560\File\Find.pm"
-"\perl5.005\perl5.005_60\lib\File\Path.pm"-"!:\perl\lib\5.00560\File\Path.pm"
-"\perl5.005\perl5.005_60\lib\File\Spec.pm"-"!:\perl\lib\5.00560\File\Spec.pm"
-"\perl5.005\perl5.005_60\lib\File\Spec\Functions.pm"-"!:\perl\lib\5.00560\File\Spec\Functions.pm"
-"\perl5.005\perl5.005_60\lib\File\Spec\Mac.pm"-"!:\perl\lib\5.00560\File\Spec\Mac.pm"
-"\perl5.005\perl5.005_60\lib\File\Spec\OS2.pm"-"!:\perl\lib\5.00560\File\Spec\OS2.pm"
-"\perl5.005\perl5.005_60\lib\File\Spec\Unix.pm"-"!:\perl\lib\5.00560\File\Spec\Unix.pm"
-"\perl5.005\perl5.005_60\lib\File\Spec\VMS.pm"-"!:\perl\lib\5.00560\File\Spec\VMS.pm"
-"\perl5.005\perl5.005_60\lib\File\Spec\Win32.pm"-"!:\perl\lib\5.00560\File\Spec\Win32.pm"
-"\perl5.005\perl5.005_60\lib\File\stat.pm"-"!:\perl\lib\5.00560\File\stat.pm"
-"\perl5.005\perl5.005_60\lib\FileCache.pm"-"!:\perl\lib\5.00560\FileCache.pm"
-"\perl5.005\perl5.005_60\lib\FileHandle.pm"-"!:\perl\lib\5.00560\FileHandle.pm"
-"\perl5.005\perl5.005_60\lib\FindBin.pm"-"!:\perl\lib\5.00560\FindBin.pm"
-"\perl5.005\perl5.005_60\lib\Getopt\Long.pm"-"!:\perl\lib\5.00560\Getopt\Long.pm"
-"\perl5.005\perl5.005_60\lib\Getopt\Std.pm"-"!:\perl\lib\5.00560\Getopt\Std.pm"
-"\perl5.005\perl5.005_60\lib\I18N\Collate.pm"-"!:\perl\lib\5.00560\I18N\Collate.pm"
-"\perl5.005\perl5.005_60\lib\Math\BigFloat.pm"-"!:\perl\lib\5.00560\Math\BigFloat.pm"
-"\perl5.005\perl5.005_60\lib\Math\BigInt.pm"-"!:\perl\lib\5.00560\Math\BigInt.pm"
-"\perl5.005\perl5.005_60\lib\Math\Complex.pm"-"!:\perl\lib\5.00560\Math\Complex.pm"
-"\perl5.005\perl5.005_60\lib\Math\Trig.pm"-"!:\perl\lib\5.00560\Math\Trig.pm"
-"\perl5.005\perl5.005_60\lib\Pod\Checker.pm"-"!:\perl\lib\5.00560\Pod\Checker.pm"
-"\perl5.005\perl5.005_60\lib\Pod\Functions.pm"-"!:\perl\lib\5.00560\Pod\Functions.pm"
-"\perl5.005\perl5.005_60\lib\Pod\Html.pm"-"!:\perl\lib\5.00560\Pod\Html.pm"
-"\perl5.005\perl5.005_60\lib\Pod\InputObjects.pm"-"!:\perl\lib\5.00560\Pod\InputObjects.pm"
-"\perl5.005\perl5.005_60\lib\Pod\Parser.pm"-"!:\perl\lib\5.00560\Pod\Parser.pm"
-"\perl5.005\perl5.005_60\lib\Pod\PlainText.pm"-"!:\perl\lib\5.00560\Pod\PlainText.pm"
-"\perl5.005\perl5.005_60\lib\Pod\Select.pm"-"!:\perl\lib\5.00560\Pod\Select.pm"
-"\perl5.005\perl5.005_60\lib\Pod\Text.pm"-"!:\perl\lib\5.00560\Pod\Text.pm"
-"\perl5.005\perl5.005_60\lib\Pod\Text\Color.pm"-"!:\perl\lib\5.00560\Pod\Text\Color.pm"
-"\perl5.005\perl5.005_60\lib\Pod\Text\Termcap.pm"-"!:\perl\lib\5.00560\Pod\Text\Termcap.pm"
-"\perl5.005\perl5.005_60\lib\Pod\Usage.pm"-"!:\perl\lib\5.00560\Pod\Usage.pm"
-"\perl5.005\perl5.005_60\lib\Search\Dict.pm"-"!:\perl\lib\5.00560\Search\Dict.pm"
-"\perl5.005\perl5.005_60\lib\SelectSaver.pm"-"!:\perl\lib\5.00560\SelectSaver.pm"
-"\perl5.005\perl5.005_60\lib\SelfLoader.pm"-"!:\perl\lib\5.00560\SelfLoader.pm"
-"\perl5.005\perl5.005_60\lib\Shell.pm"-"!:\perl\lib\5.00560\Shell.pm"
-"\perl5.005\perl5.005_60\lib\Symbol.pm"-"!:\perl\lib\5.00560\Symbol.pm"
-"\perl5.005\perl5.005_60\lib\Sys\Hostname.pm"-"!:\perl\lib\5.00560\Sys\Hostname.pm"
-"\perl5.005\perl5.005_60\lib\Sys\Syslog.pm"-"!:\perl\lib\5.00560\Sys\Syslog.pm"
-"\perl5.005\perl5.005_60\lib\Term\Cap.pm"-"!:\perl\lib\5.00560\Term\Cap.pm"
-"\perl5.005\perl5.005_60\lib\Term\Complete.pm"-"!:\perl\lib\5.00560\Term\Complete.pm"
-"\perl5.005\perl5.005_60\lib\Term\ReadLine.pm"-"!:\perl\lib\5.00560\Term\ReadLine.pm"
-"\perl5.005\perl5.005_60\lib\Test.pm"-"!:\perl\lib\5.00560\Test.pm"
-"\perl5.005\perl5.005_60\lib\Test\Harness.pm"-"!:\perl\lib\5.00560\Test\Harness.pm"
-"\perl5.005\perl5.005_60\lib\Text\Abbrev.pm"-"!:\perl\lib\5.00560\Text\Abbrev.pm"
-"\perl5.005\perl5.005_60\lib\Text\ParseWords.pm"-"!:\perl\lib\5.00560\Text\ParseWords.pm"
-"\perl5.005\perl5.005_60\lib\Text\Soundex.pm"-"!:\perl\lib\5.00560\Text\Soundex.pm"
-"\perl5.005\perl5.005_60\lib\Text\Tabs.pm"-"!:\perl\lib\5.00560\Text\Tabs.pm"
-"\perl5.005\perl5.005_60\lib\Text\Wrap.pm"-"!:\perl\lib\5.00560\Text\Wrap.pm"
-"\perl5.005\perl5.005_60\lib\Tie\Array.pm"-"!:\perl\lib\5.00560\Tie\Array.pm"
-"\perl5.005\perl5.005_60\lib\Tie\Handle.pm"-"!:\perl\lib\5.00560\Tie\Handle.pm"
-"\perl5.005\perl5.005_60\lib\Tie\Hash.pm"-"!:\perl\lib\5.00560\Tie\Hash.pm"
-"\perl5.005\perl5.005_60\lib\Tie\RefHash.pm"-"!:\perl\lib\5.00560\Tie\RefHash.pm"
-"\perl5.005\perl5.005_60\lib\Tie\Scalar.pm"-"!:\perl\lib\5.00560\Tie\Scalar.pm"
-"\perl5.005\perl5.005_60\lib\Tie\SubstrHash.pm"-"!:\perl\lib\5.00560\Tie\SubstrHash.pm"
-"\perl5.005\perl5.005_60\lib\Time\Local.pm"-"!:\perl\lib\5.00560\Time\Local.pm"
-"\perl5.005\perl5.005_60\lib\Time\gmtime.pm"-"!:\perl\lib\5.00560\Time\gmtime.pm"
-"\perl5.005\perl5.005_60\lib\Time\localtime.pm"-"!:\perl\lib\5.00560\Time\localtime.pm"
-"\perl5.005\perl5.005_60\lib\Time\tm.pm"-"!:\perl\lib\5.00560\Time\tm.pm"
-"\perl5.005\perl5.005_60\lib\UNIVERSAL.pm"-"!:\perl\lib\5.00560\UNIVERSAL.pm"
-"\perl5.005\perl5.005_60\lib\abbrev.pl"-"!:\perl\lib\5.00560\abbrev.pl"
-"\perl5.005\perl5.005_60\lib\assert.pl"-"!:\perl\lib\5.00560\assert.pl"
-"\perl5.005\perl5.005_60\lib\autouse.pm"-"!:\perl\lib\5.00560\autouse.pm"
-"\perl5.005\perl5.005_60\lib\base.pm"-"!:\perl\lib\5.00560\base.pm"
-"\perl5.005\perl5.005_60\lib\bigfloat.pl"-"!:\perl\lib\5.00560\bigfloat.pl"
-"\perl5.005\perl5.005_60\lib\bigint.pl"-"!:\perl\lib\5.00560\bigint.pl"
-"\perl5.005\perl5.005_60\lib\bigrat.pl"-"!:\perl\lib\5.00560\bigrat.pl"
-"\perl5.005\perl5.005_60\lib\blib.pm"-"!:\perl\lib\5.00560\blib.pm"
-"\perl5.005\perl5.005_60\lib\cacheout.pl"-"!:\perl\lib\5.00560\cacheout.pl"
-"\perl5.005\perl5.005_60\lib\caller.pm"-"!:\perl\lib\5.00560\caller.pm"
-"\perl5.005\perl5.005_60\lib\chat2.pl"-"!:\perl\lib\5.00560\chat2.pl"
-"\perl5.005\perl5.005_60\lib\complete.pl"-"!:\perl\lib\5.00560\complete.pl"
-"\perl5.005\perl5.005_60\lib\constant.pm"-"!:\perl\lib\5.00560\constant.pm"
-"\perl5.005\perl5.005_60\lib\ctime.pl"-"!:\perl\lib\5.00560\ctime.pl"
-"\perl5.005\perl5.005_60\lib\diagnostics.pm"-"!:\perl\lib\5.00560\diagnostics.pm"
-"\perl5.005\perl5.005_60\lib\dotsh.pl"-"!:\perl\lib\5.00560\dotsh.pl"
-"\perl5.005\perl5.005_60\lib\dumpvar.pl"-"!:\perl\lib\5.00560\dumpvar.pl"
-"\perl5.005\perl5.005_60\lib\exceptions.pl"-"!:\perl\lib\5.00560\exceptions.pl"
-"\perl5.005\perl5.005_60\lib\fastcwd.pl"-"!:\perl\lib\5.00560\fastcwd.pl"
-"\perl5.005\perl5.005_60\lib\fields.pm"-"!:\perl\lib\5.00560\fields.pm"
-"\perl5.005\perl5.005_60\lib\filetest.pm"-"!:\perl\lib\5.00560\filetest.pm"
-"\perl5.005\perl5.005_60\lib\find.pl"-"!:\perl\lib\5.00560\find.pl"
-"\perl5.005\perl5.005_60\lib\finddepth.pl"-"!:\perl\lib\5.00560\finddepth.pl"
-"\perl5.005\perl5.005_60\lib\flush.pl"-"!:\perl\lib\5.00560\flush.pl"
-"\perl5.005\perl5.005_60\lib\ftp.pl"-"!:\perl\lib\5.00560\ftp.pl"
-"\perl5.005\perl5.005_60\lib\getcwd.pl"-"!:\perl\lib\5.00560\getcwd.pl"
-"\perl5.005\perl5.005_60\lib\getopt.pl"-"!:\perl\lib\5.00560\getopt.pl"
-"\perl5.005\perl5.005_60\lib\getopts.pl"-"!:\perl\lib\5.00560\getopts.pl"
-"\perl5.005\perl5.005_60\lib\hostname.pl"-"!:\perl\lib\5.00560\hostname.pl"
-"\perl5.005\perl5.005_60\lib\importenv.pl"-"!:\perl\lib\5.00560\importenv.pl"
-"\perl5.005\perl5.005_60\lib\integer.pm"-"!:\perl\lib\5.00560\integer.pm"
-"\perl5.005\perl5.005_60\lib\less.pm"-"!:\perl\lib\5.00560\less.pm"
-"\perl5.005\perl5.005_60\lib\lib.pm"-"!:\perl\lib\5.00560\lib.pm"
-"\perl5.005\perl5.005_60\lib\locale.pm"-"!:\perl\lib\5.00560\locale.pm"
-"\perl5.005\perl5.005_60\lib\look.pl"-"!:\perl\lib\5.00560\look.pl"
-"\perl5.005\perl5.005_60\lib\newgetopt.pl"-"!:\perl\lib\5.00560\newgetopt.pl"
-"\perl5.005\perl5.005_60\lib\open2.pl"-"!:\perl\lib\5.00560\open2.pl"
-"\perl5.005\perl5.005_60\lib\open3.pl"-"!:\perl\lib\5.00560\open3.pl"
-"\perl5.005\perl5.005_60\lib\overload.pm"-"!:\perl\lib\5.00560\overload.pm"
-"\perl5.005\perl5.005_60\lib\perl5db.pl"-"!:\perl\lib\5.00560\perl5db.pl"
-"\perl5.005\perl5.005_60\lib\pwd.pl"-"!:\perl\lib\5.00560\pwd.pl"
-"\perl5.005\perl5.005_60\lib\shellwords.pl"-"!:\perl\lib\5.00560\shellwords.pl"
-"\perl5.005\perl5.005_60\lib\sigtrap.pm"-"!:\perl\lib\5.00560\sigtrap.pm"
-"\perl5.005\perl5.005_60\lib\stat.pl"-"!:\perl\lib\5.00560\stat.pl"
-"\perl5.005\perl5.005_60\lib\strict.pm"-"!:\perl\lib\5.00560\strict.pm"
-"\perl5.005\perl5.005_60\lib\subs.pm"-"!:\perl\lib\5.00560\subs.pm"
-"\perl5.005\perl5.005_60\lib\syslog.pl"-"!:\perl\lib\5.00560\syslog.pl"
-"\perl5.005\perl5.005_60\lib\tainted.pl"-"!:\perl\lib\5.00560\tainted.pl"
-"\perl5.005\perl5.005_60\lib\termcap.pl"-"!:\perl\lib\5.00560\termcap.pl"
-"\perl5.005\perl5.005_60\lib\timelocal.pl"-"!:\perl\lib\5.00560\timelocal.pl"
-"\perl5.005\perl5.005_60\lib\utf8.pm"-"!:\perl\lib\5.00560\utf8.pm"
-"\perl5.005\perl5.005_60\lib\utf8_heavy.pl"-"!:\perl\lib\5.00560\utf8_heavy.pl"
-"\perl5.005\perl5.005_60\lib\validate.pl"-"!:\perl\lib\5.00560\validate.pl"
-"\perl5.005\perl5.005_60\lib\vars.pm"-"!:\perl\lib\5.00560\vars.pm"
-"\perl5.005\perl5.005_60\lib\warning.pm"-"!:\perl\lib\5.00560\warning.pm"
-@"\epoc32\release\marm\rel\stdlib.sis",(0x010002c3)
# License or the Artistic License, as specified in the README file.
#
package B;
-require DynaLoader;
+use XSLoader ();
require Exporter;
-@ISA = qw(Exporter DynaLoader);
+@ISA = qw(Exporter);
@EXPORT_OK = qw(minus_c ppname
class peekop cast_I32 cstring cchar hash threadsv_names
main_root main_start main_cv svref_2object opnumber amagic_generation
@B::LOGOP::ISA = 'B::UNOP';
@B::LISTOP::ISA = 'B::BINOP';
@B::SVOP::ISA = 'B::OP';
-@B::GVOP::ISA = 'B::OP';
+@B::PADOP::ISA = 'B::OP';
@B::PVOP::ISA = 'B::OP';
@B::CVOP::ISA = 'B::OP';
@B::LOOP::ISA = 'B::LISTOP';
}
}
-bootstrap B;
+XSLoader::load 'B';
1;
=item LINE
+=item FILE
+
=item FILEGV
=item GvREFCNT
=item GV
-=item FILEGV
+=item FILE
=item DEPTH
=head2 OP-RELATED CLASSES
B::OP, B::UNOP, B::BINOP, B::LOGOP, B::LISTOP, B::PMOP,
-B::SVOP, B::GVOP, B::PVOP, B::CVOP, B::LOOP, B::COP.
+B::SVOP, B::PADOP, B::PVOP, B::CVOP, B::LOOP, B::COP.
These classes correspond in
the obvious way to the underlying C structures of similar names. The
inheritance hierarchy mimics the underlying C "inheritance". Access
=item sv
+=item gv
+
=back
-=head2 B::GVOP METHOD
+=head2 B::PADOP METHOD
=over 4
-=item gv
+=item padix
=back
=item stash
-=item filegv
+=item file
=item cop_seq
OPc_LISTOP, /* 5 */
OPc_PMOP, /* 6 */
OPc_SVOP, /* 7 */
- OPc_GVOP, /* 8 */
+ OPc_PADOP, /* 8 */
OPc_PVOP, /* 9 */
OPc_CVOP, /* 10 */
OPc_LOOP, /* 11 */
"B::LISTOP",
"B::PMOP",
"B::SVOP",
- "B::GVOP",
+ "B::PADOP",
"B::PVOP",
"B::CVOP",
"B::LOOP",
case OA_SVOP:
return OPc_SVOP;
- case OA_GVOP:
- return OPc_GVOP;
+ case OA_PADOP:
+ return OPc_PADOP;
case OA_PVOP_OR_SVOP:
/*
* return OPc_UNOP so that walkoptree can find our children. If
* OPf_KIDS is not set then we check OPf_REF. Without OPf_REF set
* (no argument to the operator) it's an OP; with OPf_REF set it's
- * a GVOP (and op_gv is the GV for the filehandle argument).
+ * an SVOP (and op_sv is the GV for the filehandle argument).
*/
return ((o->op_flags & OPf_KIDS) ? OPc_UNOP :
- (o->op_flags & OPf_REF) ? OPc_GVOP : OPc_BASEOP);
+ (o->op_flags & OPf_REF) ? OPc_SVOP : OPc_BASEOP);
case OA_LOOPEXOP:
/*
typedef LISTOP *B__LISTOP;
typedef PMOP *B__PMOP;
typedef SVOP *B__SVOP;
-typedef GVOP *B__GVOP;
+typedef PADOP *B__PADOP;
typedef PVOP *B__PVOP;
typedef LOOP *B__LOOP;
typedef COP *B__COP;
char *s;
STRLEN len;
U32 hash = 0;
- char hexhash[19]; /* must fit "0xffffffff" plus trailing \0 */
+ char hexhash[19]; /* must fit "0xffffffffffffffff" plus trailing \0 */
s = SvPV(sv, len);
PERL_HASH(hash, s, len);
- sprintf(hexhash, "0x%x", hash);
+ sprintf(hexhash, "0x%"UVxf, (UV)hash);
ST(0) = sv_2mortal(newSVpv(hexhash, 0));
#define cast_I32(foo) (I32)foo
OP_desc(o)
B::OP o
-U16
+PADOFFSET
OP_targ(o)
B::OP o
if (rx)
sv_setpvn(ST(0), rx->precomp, rx->prelen);
-#define SVOP_sv(o) o->op_sv
+#define SVOP_sv(o) cSVOPx_sv(o)
+#define SVOP_gv(o) cGVOPx_gv(o)
MODULE = B PACKAGE = B::SVOP PREFIX = SVOP_
-
B::SV
SVOP_sv(o)
B::SVOP o
-#define GVOP_gv(o) o->op_gv
+B::GV
+SVOP_gv(o)
+ B::SVOP o
+
+#define PADOP_padix(o) o->op_padix
+#define PADOP_sv(o) (o->op_padix ? PL_curpad[o->op_padix] : Nullsv)
+#define PADOP_gv(o) ((o->op_padix \
+ && SvTYPE(PL_curpad[o->op_padix]) == SVt_PVGV) \
+ ? (GV*)PL_curpad[o->op_padix] : Nullgv)
-MODULE = B PACKAGE = B::GVOP PREFIX = GVOP_
+MODULE = B PACKAGE = B::PADOP PREFIX = PADOP_
+PADOFFSET
+PADOP_padix(o)
+ B::PADOP o
+
+B::SV
+PADOP_sv(o)
+ B::PADOP o
B::GV
-GVOP_gv(o)
- B::GVOP o
+PADOP_gv(o)
+ B::PADOP o
MODULE = B PACKAGE = B::PVOP PREFIX = PVOP_
B::LOOP o
#define COP_label(o) o->cop_label
-#define COP_stash(o) o->cop_stash
-#define COP_filegv(o) o->cop_filegv
+#define COP_stashpv(o) CopSTASHPV(o)
+#define COP_stash(o) CopSTASH(o)
+#define COP_file(o) CopFILE(o)
#define COP_cop_seq(o) o->cop_seq
#define COP_arybase(o) o->cop_arybase
-#define COP_line(o) o->cop_line
+#define COP_line(o) CopLINE(o)
#define COP_warnings(o) o->cop_warnings
MODULE = B PACKAGE = B::COP PREFIX = COP_
COP_label(o)
B::COP o
+char *
+COP_stashpv(o)
+ B::COP o
+
B::HV
COP_stash(o)
B::COP o
-B::GV
-COP_filegv(o)
+char *
+COP_file(o)
B::COP o
U32
GvLINE(gv)
B::GV gv
+char *
+GvFILE(gv)
+ B::GV gv
+
B::GV
GvFILEGV(gv)
B::GV gv
CvGV(cv)
B::CV cv
-B::GV
-CvFILEGV(cv)
+char *
+CvFILE(cv)
B::CV cv
long
@EXPORT_OK = qw(%insn_data @insn_name @optype @specialsv_name);
use vars qw(%insn_data @insn_name @optype @specialsv_name);
-@optype = qw(OP UNOP BINOP LOGOP LISTOP PMOP SVOP GVOP PVOP LOOP COP);
+@optype = qw(OP UNOP BINOP LOGOP LISTOP PMOP SVOP PADOP PVOP LOOP COP);
@specialsv_name = qw(Nullsv &PL_sv_undef &PL_sv_yes &PL_sv_no);
# XXX insn_data is initialised this way because with a large
$insn_data{xcv_start} = [45, \&PUT_opindex, "GET_opindex"];
$insn_data{xcv_root} = [46, \&PUT_opindex, "GET_opindex"];
$insn_data{xcv_gv} = [47, \&PUT_svindex, "GET_svindex"];
-$insn_data{xcv_filegv} = [48, \&PUT_svindex, "GET_svindex"];
+$insn_data{xcv_file} = [48, \&PUT_pvcontents, "GET_pvcontents"];
$insn_data{xcv_depth} = [49, \&PUT_I32, "GET_I32"];
$insn_data{xcv_padlist} = [50, \&PUT_svindex, "GET_svindex"];
$insn_data{xcv_outside} = [51, \&PUT_svindex, "GET_svindex"];
$insn_data{gp_av} = [72, \&PUT_svindex, "GET_svindex"];
$insn_data{gp_hv} = [73, \&PUT_svindex, "GET_svindex"];
$insn_data{gp_cv} = [74, \&PUT_svindex, "GET_svindex"];
-$insn_data{gp_filegv} = [75, \&PUT_svindex, "GET_svindex"];
+$insn_data{gp_file} = [75, \&PUT_pvcontents, "GET_pvcontents"];
$insn_data{gp_io} = [76, \&PUT_svindex, "GET_svindex"];
$insn_data{gp_form} = [77, \&PUT_svindex, "GET_svindex"];
$insn_data{gp_cvgen} = [78, \&PUT_U32, "GET_U32"];
$insn_data{op_pmflags} = [99, \&PUT_U16, "GET_U16"];
$insn_data{op_pmpermflags} = [100, \&PUT_U16, "GET_U16"];
$insn_data{op_sv} = [101, \&PUT_svindex, "GET_svindex"];
-$insn_data{op_gv} = [102, \&PUT_svindex, "GET_svindex"];
+$insn_data{op_padix} = [102, \&PUT_U32, "GET_U32"];
$insn_data{op_pv} = [103, \&PUT_pvcontents, "GET_pvcontents"];
$insn_data{op_pv_tr} = [104, \&PUT_op_tr_array, "GET_op_tr_array"];
$insn_data{op_redoop} = [105, \&PUT_opindex, "GET_opindex"];
$insn_data{op_nextop} = [106, \&PUT_opindex, "GET_opindex"];
$insn_data{op_lastop} = [107, \&PUT_opindex, "GET_opindex"];
$insn_data{cop_label} = [108, \&PUT_pvcontents, "GET_pvcontents"];
-$insn_data{cop_stash} = [109, \&PUT_svindex, "GET_svindex"];
-$insn_data{cop_filegv} = [110, \&PUT_svindex, "GET_svindex"];
+$insn_data{cop_stashpv} = [109, \&PUT_pvcontents, "GET_pvcontents"];
+$insn_data{cop_file} = [110, \&PUT_pvcontents, "GET_pvcontents"];
$insn_data{cop_seq} = [111, \&PUT_U32, "GET_U32"];
$insn_data{cop_arybase} = [112, \&PUT_I32, "GET_I32"];
$insn_data{cop_line} = [113, \&PUT_U16, "GET_U16"];
$sv->bytecode;
}
-sub B::GVOP::bytecode {
+sub B::PADOP::bytecode {
my $op = shift;
- my $gv = $op->gv;
- my $gvix = $gv->objix;
+ my $padix = $op->padix;
$op->B::OP::bytecode;
- print "op_gv $gvix\n";
- $gv->bytecode;
+ print "op_padix $padix\n";
}
sub B::PVOP::bytecode {
sub B::COP::bytecode {
my $op = shift;
- my $stash = $op->stash;
- my $stashix = $stash->objix;
- my $filegv = $op->filegv;
- my $filegvix = $filegv->objix;
+ my $stashpv = $op->stashpv;
+ my $file = $op->file;
my $line = $op->line;
my $warnings = $op->warnings;
my $warningsix = $warnings->objix;
if ($debug_bc) {
- printf "# line %s:%d\n", $filegv->SV->PV, $line;
+ printf "# line %s:%d\n", $file, $line;
}
$op->B::OP::bytecode;
- printf <<"EOT", pvstring($op->label), $op->cop_seq, $op->arybase;
+ printf <<"EOT", pvstring($op->label), pvstring($stashpv), $op->cop_seq, pvstring($file), $op->arybase;
newpv %s
cop_label
-cop_stash $stashix
+newpv %s
+cop_stashpv
cop_seq %d
-cop_filegv $filegvix
+newpv %s
+cop_file
cop_arybase %d
cop_line $line
cop_warnings $warningsix
EOT
- $filegv->bytecode;
- $stash->bytecode;
}
sub B::PMOP::bytecode {
my $egv = $gv->EGV;
my $egvix = $egv->objix;
ldsv($ix);
- printf <<"EOT", $gv->FLAGS, $gv->GvFLAGS, $gv->LINE;
+ printf <<"EOT", $gv->FLAGS, $gv->GvFLAGS, $gv->LINE, pvstring($gv->FILE);
sv_flags 0x%x
xgv_flags 0x%x
gp_line %d
+newpv %s
+gp_file
EOT
my $refcnt = $gv->REFCNT;
printf("sv_refcnt_add %d\n", $refcnt - 1) if $refcnt > 1;
} else {
if ($gvname !~ /^([^A-Za-z]|STDIN|STDOUT|STDERR|ARGV|SIG|ENV)$/) {
my $i;
- my @subfield_names = qw(SV AV HV CV FILEGV FORM IO);
+ my @subfield_names = qw(SV AV HV CV FORM IO);
my @subfields = map($gv->$_(), @subfield_names);
my @ixes = map($_->objix, @subfields);
# Reset sv register for $gv
my $ix = $cv->objix;
$cv->B::PVMG::bytecode;
my $i;
- my @subfield_names = qw(ROOT START STASH GV FILEGV PADLIST OUTSIDE);
+ my @subfield_names = qw(ROOT START STASH GV PADLIST OUTSIDE);
my @subfields = map($cv->$_(), @subfield_names);
my @ixes = map($_->objix, @subfields);
# Save OP tree from CvROOT (first element of @subfields)
printf "xcv_%s %d\n", lc($subfield_names[$i]), $ixes[$i];
}
printf "xcv_depth %d\nxcv_flags 0x%x\n", $cv->DEPTH, $cv->FLAGS;
+ printf "newpv %s\nxcv_file\n", pvstring($cv->FILE);
# Now save all the subfields (except for CvROOT which was handled
# above) and CvSTART (now the initial element of @subfields).
shift @subfields; # bye-bye CvSTART
$arg ||= shift @options;
open(OUT, ">$arg") or return "$arg: $!\n";
binmode OUT;
+ } elsif ($opt eq "a") {
+ $arg ||= shift @options;
+ open(OUT, ">>$arg") or return "$arg: $!\n";
+ binmode OUT;
} elsif ($opt eq "D") {
$arg ||= shift @options;
foreach $arg (split(//, $arg)) {
Output to filename instead of STDOUT.
+=item B<-afilename>
+
+Append output to filename.
+
=item B<-->
Force end of options.
# Code sections
my ($init, $decl, $symsect, $binopsect, $condopsect, $copsect,
- $gvopsect, $listopsect, $logopsect, $loopsect, $opsect, $pmopsect,
+ $padopsect, $listopsect, $logopsect, $loopsect, $opsect, $pmopsect,
$pvopsect, $svopsect, $unopsect, $svsect, $xpvsect, $xpvavsect,
$xpvhvsect, $xpvcvsect, $xpvivsect, $xpvnvsect, $xpvmgsect, $xpvlvsect,
$xrvsect, $xpvbmsect, $xpviosect );
my $sym = objsym($op);
return $sym if defined $sym;
my $svsym = $op->sv->save;
- $svopsect->add(sprintf("s\\_%x, s\\_%x, %s,$handle_VC_problem %u, %u, %u, 0x%x, 0x%x, %s",
+ $svopsect->add(sprintf("s\\_%x, s\\_%x, %s,$handle_VC_problem %u, %u, %u, 0x%x, 0x%x, Nullsv",
${$op->next}, ${$op->sibling}, $op->ppaddr,
$op->targ, $op->type, $op_seq, $op->flags,
- $op->private, "(SV*)$svsym"));
+ $op->private));
+ $init->add(sprintf("svop_list[%d].op_sv = %s;", $svopsect->index, "(SV*)$svsym"));
savesym($op, sprintf("(OP*)&svop_list[%d]", $svopsect->index));
}
-sub B::GVOP::save {
+sub B::PADOP::save {
my ($op, $level) = @_;
my $sym = objsym($op);
return $sym if defined $sym;
- my $gvsym = $op->gv->save;
- $gvopsect->add(sprintf("s\\_%x, s\\_%x, %s,$handle_VC_problem %u, %u, %u, 0x%x, 0x%x, Nullgv",
+ $padopsect->add(sprintf("s\\_%x, s\\_%x, %s,$handle_VC_problem %u, %u, %u, 0x%x, 0x%x, Nullgv",
${$op->next}, ${$op->sibling}, $op->ppaddr,
$op->targ, $op->type, $op_seq, $op->flags,
$op->private));
- $init->add(sprintf("gvop_list[%d].op_gv = %s;", $gvopsect->index, $gvsym));
- savesym($op, sprintf("(OP*)&gvop_list[%d]", $gvopsect->index));
+ $init->add(sprintf("padop_list[%d].op_padix = %ld;",
+ $padopsect->index, $op->padix));
+ savesym($op, sprintf("(OP*)&padop_list[%d]", $padopsect->index));
}
sub B::COP::save {
my ($op, $level) = @_;
my $sym = objsym($op);
return $sym if defined $sym;
- my $gvsym = $op->filegv->save;
- my $stashsym = $op->stash->save;
- warn sprintf("COP: line %d file %s\n", $op->line, $op->filegv->SV->PV)
+ warn sprintf("COP: line %d file %s\n", $op->line, $op->file)
if $debug_cops;
$copsect->add(sprintf("s\\_%x, s\\_%x, %s,$handle_VC_problem %u, %u, %u, 0x%x, 0x%x, %s, Nullhv, Nullgv, %u, %d, %u",
${$op->next}, ${$op->sibling}, $op->ppaddr,
$op->private, cstring($op->label), $op->cop_seq,
$op->arybase, $op->line));
my $copix = $copsect->index;
- $init->add(sprintf("cop_list[%d].cop_filegv = %s;", $copix, $gvsym),
- sprintf("cop_list[%d].cop_stash = %s;", $copix, $stashsym));
+ $init->add(sprintf("CopFILE_set(&cop_list[%d], %s);", $copix, cstring($op->file)),
+ sprintf("CopSTASHPV_set(&cop_list[%d], %s);", $copix, cstring($op->stashpv)));
savesym($op, "(OP*)&cop_list[$copix]");
}
}
# Reserve a place in svsect and xpvcvsect and record indices
my $gv = $cv->GV;
- my $cvstashname = $gv->STASH->NAME;
- my $cvname = $gv->NAME;
+ my ($cvname, $cvstashname);
+ if ($$gv){
+ $cvname = $gv->NAME;
+ $cvstashname = $gv->STASH->NAME;
+ }
my $root = $cv->ROOT;
my $cvxsub = $cv->XSUB;
#INIT is removed from the symbol table, so this call must come
my $stashname = $egv->STASH->NAME;
if ($cvname eq "bootstrap")
{
- my $file = $cv->FILEGV->SV->PV;
+ my $file = $gv->FILE;
$decl->add("/* bootstrap $file */");
warn "Bootstrap $stashname $file\n";
$xsub{$stashname}='Dynamic';
$cvstashname, $cvname); # debug
}
$pv = '' unless defined $pv; # Avoid use of undef warnings
- $symsect->add(sprintf("xpvcvix%d\t%s, %u, 0, %d, %s, 0, Nullhv, Nullhv, %s, s\\_%x, $xsub, $xsubany, Nullgv, Nullgv, %d, s\\_%x, (CV*)s\\_%x, 0x%x",
+ $symsect->add(sprintf("xpvcvix%d\t%s, %u, 0, %d, %s, 0, Nullhv, Nullhv, %s, s\\_%x, $xsub, $xsubany, Nullgv, \"\", %d, s\\_%x, (CV*)s\\_%x, 0x%x",
$xpvcv_ix, cstring($pv), length($pv), $cv->IVX,
$cv->NVX, $startfield, ${$cv->ROOT}, $cv->DEPTH,
$$padlist, ${$cv->OUTSIDE}, $cv->CvFLAGS));
warn sprintf("done saving GV 0x%x for CV 0x%x\n",
$$gv, $$cv) if $debug_cv;
}
- my $filegv = $cv->FILEGV;
- if ($$filegv) {
- $filegv->save;
- $init->add(sprintf("CvFILEGV(s\\_%x) = s\\_%x;", $$cv, $$filegv));
- warn sprintf("done saving FILEGV 0x%x for CV 0x%x\n",
- $$filegv, $$cv) if $debug_cv;
- }
+ $init->add(sprintf("CvFILE($sym) = %s;", cstring($cv->FILE)));
my $stash = $cv->STASH;
if ($$stash) {
$stash->save;
# warn "GV::save &$name\n"; # debug
}
}
- my $gvfilegv = $gv->FILEGV;
- if ($$gvfilegv) {
- $gvfilegv->save;
- $init->add(sprintf("GvFILEGV($sym) = (GV*)s\\_%x;",$$gvfilegv));
-# warn "GV::save GvFILEGV(*$name)\n"; # debug
- }
+ $init->add(sprintf("GvFILE($sym) = %s;", cstring($gv->FILE)));
+# warn "GV::save GvFILE(*$name)\n"; # debug
my $gvform = $gv->FORM;
if ($$gvform) {
$gvform->save;
my $init_name = shift;
my $section;
my @sections = ($opsect, $unopsect, $binopsect, $logopsect, $condopsect,
- $listopsect, $pmopsect, $svopsect, $gvopsect, $pvopsect,
+ $listopsect, $pmopsect, $svopsect, $padopsect, $pvopsect,
$loopsect, $copsect, $svsect, $xpvsect,
$xpvavsect, $xpvhvsect, $xpvcvsect, $xpvivsect, $xpvnvsect,
$xpvmgsect, $xpvlvsect, $xrvsect, $xpvbmsect, $xpviosect);
void (*xcv_xsub) (CV*);
void * xcv_xsubany;
GV * xcv_gv;
- GV * xcv_filegv;
- long xcv_depth; /* >= 2 indicates recursive call */
+ char * xcv_file;
+ long xcv_depth; /* >= 2 indicates recursive call */
AV * xcv_padlist;
CV * xcv_outside;
#ifdef USE_THREADS
#undef Perl_pp_mapstart
#define Perl_pp_mapstart Perl_pp_grepstart
#define XS_DynaLoader_boot_DynaLoader boot_DynaLoader
-EXTERN_C void boot_DynaLoader (CV* cv);
+EXTERN_C void boot_DynaLoader (pTHX_ CV* cv);
-static void xs_init (void);
-static void dl_init (void);
+static void xs_init (pTHX);
+static void dl_init (pTHX);
static PerlInterpreter *my_perl;
EOT
}
sub output_main {
print <<'EOT';
int
-#ifndef CAN_PROTOTYPE
-main(argc, argv, env)
-int argc;
-char **argv;
-char **env;
-#else /* def(CAN_PROTOTYPE) */
main(int argc, char **argv, char **env)
-#endif /* def(CAN_PROTOTYPE) */
{
int exitstatus;
int i;
char **fakeargv;
- PERL_SYS_INIT(&argc,&argv);
+ PERL_SYS_INIT3(&argc,&argv,&env);
- perl_init_i18nl10n(1);
-
if (!PL_do_undump) {
my_perl = perl_alloc();
if (!my_perl)
exit(1);
perl_construct( my_perl );
+ PL_perl_destruct_level = 0;
}
#ifdef CSH
exitstatus = perl_init();
if (exitstatus)
exit( exitstatus );
- dl_init();
+ dl_init(aTHX);
exitstatus = perl_run( my_perl );
perl_destruct( my_perl );
perl_free( my_perl );
+ PERL_SYS_TERM();
+
exit( exitstatus );
}
/* yanked from perl.c */
static void
-xs_init()
+xs_init(pTHX)
{
char *file = __FILE__;
dTARG;
print "\tPUSHMARK(sp);\n";
print qq/\tXPUSHp("DynaLoader",strlen("DynaLoader"));\n/;
print qq/\tPUTBACK;\n/;
- print "\tboot_DynaLoader(NULL);\n";
+ print "\tboot_DynaLoader(aTHX_ NULL);\n";
print qq/\tSPAGAIN;\n/;
print "#endif\n";
foreach my $stashname (keys %xsub){
print "\tPUSHMARK(sp);\n";
print qq/\tXPUSHp("$stashname",strlen("$stashname"));\n/;
print qq/\tPUTBACK;\n/;
- print "\tboot_$stashxsub(NULL);\n";
+ print "\tboot_$stashxsub(aTHX_ NULL);\n";
print qq/\tSPAGAIN;\n/;
}
}
print <<'EOT';
static void
-dl_init()
+dl_init(pTHX)
{
char *file = __FILE__;
dTARG;
warn "bootstrapping $stashname added to xs_init\n";
print qq/\tperl_call_method("bootstrap",G_DISCARD);\n/;
print "\n#else\n";
- print "\tboot_$stashxsub(NULL);\n";
+ print "\tboot_$stashxsub(aTHX_ NULL);\n";
print "#endif\n";
print qq/\tSPAGAIN;\n/;
}
{
no strict 'refs';
$unused_sub_packages{$package} = 1;
- if (@{$package.'::ISA'})
+ if (defined @{$package.'::ISA'})
{
foreach my $isa (@{$package.'::ISA'})
{
sub init_sections {
my @sections = (init => \$init, decl => \$decl, sym => \$symsect,
binop => \$binopsect, condop => \$condopsect,
- cop => \$copsect, gvop => \$gvopsect,
+ cop => \$copsect, padop => \$padopsect,
listop => \$listopsect, logop => \$logopsect,
loop => \$loopsect, op => \$opsect, pmop => \$pmopsect,
pvop => \$pvopsect, svop => \$svopsect, unop => \$unopsect,
sub error {
my $format = shift;
- my $file = $curcop->[0]->filegv->SV->PV;
+ my $file = $curcop->[0]->file;
my $line = $curcop->[0]->line;
$errors++;
if (@_) {
my $op = shift;
$curcop->load($op);
@stack = ();
- debug(sprintf("%s:%d\n", $op->filegv->SV->PV, $op->line)) if $debug_lineno;
+ debug(sprintf("%s:%d\n", $op->file, $op->line)) if $debug_lineno;
runtime("TAINT_NOT;") unless $omit_taint;
runtime("sp = PL_stack_base + cxstack[cxstack_ix].blk_oldsp;");
if ($freetmps_each_bblock || $freetmps_each_loop) {
perl_init();
ENTER;
SAVETMPS;
- SAVESPTR(PL_curpad);
- SAVESPTR(PL_op);
+ SAVEVPTR(PL_curpad);
+ SAVEVPTR(PL_op);
PL_curpad = AvARRAY($curpad_sym);
PL_op = $start;
pp_main(aTHX);
sub B::COP::debug {
my ($op) = @_;
$op->B::OP::debug();
- my ($filegv) = $op->filegv;
- printf <<'EOT', $op->label, ${$op->stash}, $$filegv, $op->seq, $op->arybase, $op->line, ${$op->warnings};
+ printf <<'EOT', $op->label, $op->stashpv, $op->file, $op->seq, $op->arybase, $op->line, ${$op->warnings};
cop_label %s
- cop_stash 0x%x
- cop_filegv 0x%x
+ cop_stashpv %s
+ cop_file %s
cop_seq %d
cop_arybase %d
cop_line %d
cop_warnings 0x%x
EOT
- $filegv->debug;
}
sub B::SVOP::debug {
printf "\top_pv\t\t0x%x\n", $op->pv;
}
-sub B::GVOP::debug {
+sub B::PADOP::debug {
my ($op) = @_;
$op->B::OP::debug();
- printf "\top_gv\t\t0x%x\n", ${$op->gv};
- $op->gv->debug;
+ printf "\top_padix\t\t%ld\n", $op->padix;
}
sub B::CVOP::debug {
my ($start) = $sv->START;
my ($root) = $sv->ROOT;
my ($padlist) = $sv->PADLIST;
+ my ($file) = $sv->FILE;
my ($gv) = $sv->GV;
- my ($filegv) = $sv->FILEGV;
- printf <<'EOT', $$stash, $$start, $$root, $$gv, $$filegv, $sv->DEPTH, $padlist, ${$sv->OUTSIDE};
+ printf <<'EOT', $$stash, $$start, $$root, $$gv, $file, $sv->DEPTH, $padlist, ${$sv->OUTSIDE};
STASH 0x%x
START 0x%x
ROOT 0x%x
GV 0x%x
- FILEGV 0x%x
+ FILE %s
DEPTH %d
PADLIST 0x%x
OUTSIDE 0x%x
$start->debug if $start;
$root->debug if $root;
$gv->debug if $gv;
- $filegv->debug if $filegv;
$padlist->debug if $padlist;
}
my ($av) = $gv->AV;
my ($cv) = $gv->CV;
$gv->B::SV::debug;
- printf <<'EOT', $gv->NAME, $gv->STASH->NAME, $gv->STASH, $$sv, $gv->GvREFCNT, $gv->FORM, $$av, ${$gv->HV}, ${$gv->EGV}, $$cv, $gv->CVGEN, $gv->LINE, $gv->FILEGV, $gv->GvFLAGS;
+ printf <<'EOT', $gv->NAME, $gv->STASH->NAME, $gv->STASH, $$sv, $gv->GvREFCNT, $gv->FORM, $$av, ${$gv->HV}, ${$gv->EGV}, $$cv, $gv->CVGEN, $gv->LINE, $gv->FILE, $gv->GvFLAGS;
NAME %s
STASH %s (0x%x)
SV 0x%x
CV 0x%x
CVGEN %d
LINE %d
- FILEGV 0x%x
+ FILE %s
GvFLAGS 0x%x
EOT
$sv->debug if $sv;
and $seq > $self->{'subs_todo'}[0][0]) {
push @text, $self->next_todo;
}
- my $stash = $op->stash->NAME;
+ my $stash = $op->stashpv;
if ($stash ne $self->{'curstash'}) {
push @text, "package $stash;\n";
$self->{'curstash'} = $stash;
}
if ($self->{'linenums'}) {
push @text, "\f#line " . $op->line .
- ' "' . substr($op->filegv->NAME, 2), qq'"\n';
+ ' "' . $op->file, qq'"\n';
}
return join("", @text);
}
# Genuine `-X' filetests are exempt from the LLAFR, but not
# l?stat(); for the sake of clarity, give'em all parens
return $self->maybe_parens_unop($name, $op->first, $cx);
- } elsif (class($op) eq "GVOP") {
+ } elsif (class($op) eq "SVOP") {
return $self->maybe_parens_func($name, $self->pp_gv($op, 1), $cx, 16);
} else { # I don't think baseop filetests ever survive ck_ftst, but...
return $name;
sub B::COP::lint {
my $op = shift;
if ($op->name eq "nextstate") {
- $file = $op->filegv->SV->PV;
+ $file = $op->file;
$line = $op->line;
$curstash = $op->stash->NAME;
}
}
}
-sub B::GVOP::lint {
+sub B::SVOP::lint {
my $op = shift;
if ($check{dollar_underscore} && $op->name eq "gvsv"
&& $op->gv->NAME eq "_")
}
if ($check{private_names}) {
my $opname = $op->name;
- my $gv = $op->gv;
- if (($opname eq "gv" || $opname eq "gvsv")
- && $gv->NAME =~ /^_./ && $gv->STASH->NAME ne $curstash)
- {
- warning('Illegal reference to private name %s', $gv->NAME);
+ if ($opname eq "gv" || $opname eq "gvsv") {
+ my $gv = $op->gv;
+ if ($gv->NAME =~ /^_./ && $gv->STASH->NAME ne $curstash) {
+ warning('Illegal reference to private name %s', $gv->NAME);
+ }
}
}
if ($check{undefined_subs}) {
BEGIN { %Seen = %INC }
-END {
+STOP {
my @arr=scan($main::{"main::"});
@arr=map{s/\:\:$//;$_;} @arr;
print "-umain,-u", join (",-u",@arr) ,"\n";
$op->sv->terse(0);
}
-sub B::GVOP::terse {
+sub B::PADOP::terse {
my ($op, $level) = @_;
- print indent($level), peekop($op), " ";
- $op->gv->terse(0);
+ print indent($level), peekop($op), " ", $op->padix, "\n";
}
sub B::PMOP::terse {
sub pp_nextstate {
my $op = shift;
- $file = $op->filegv->SV->PV;
+ $file = $op->file;
$line = $op->line;
$top = UNKNOWN;
}
my $cv = $gv->CV;
if ($$cv) {
#return if $done{$$cv}++;
- $file = $gv->FILEGV->SV->PV;
+ $file = $gv->FILE;
$line = $gv->LINE;
process([$gv->STASH->NAME, "&", $gv->NAME], "subdef");
push(@todo, $cv);
my $form = $gv->FORM;
if ($$form) {
return if $done{$$form}++;
- $file = $gv->FILEGV->SV->PV;
+ $file = $gv->FILE;
$line = $gv->LINE;
process([$gv->STASH->NAME, "", $gv->NAME], "formdef");
}
package MY;
sub post_constants {
- "\nLIBS = $Config{libs}\n"
+ "\nLIBS = $Config::Config{libs}\n"
}
sub postamble {
it should return a sub ref (usually a closure) to perform the
actual compilation. When O regains control, it ensures that the
"-c" option is forced (so that the program being compiled doesn't
- end up running) and registers an END block to call back the sub ref
+ end up running) and registers a STOP block to call back the sub ref
returned from the backend's compile(). Perl then continues by
parsing prog.pl (just as it would with "perl -c prog.pl") and after
- doing so, assuming there are no parse-time errors, the END block
+ doing so, assuming there are no parse-time errors, the STOP block
of O gets called and the actual backend compilation happens. Phew.
my $compilesub = &{"B::${backend}::compile"}(@options);
if (ref($compilesub) eq "CODE") {
minus_c;
- eval 'END { &$compilesub() }';
+ eval 'STOP { &$compilesub() }';
} else {
die $compilesub;
}
package, passing it OPTIONS. That function is expected to return
a sub reference which we'll call CALLBACK. Next, the "compile-only"
flag is switched on (equivalent to the command-line option C<-c>)
-and an END block is registered which calls CALLBACK. Thus the main
+and a STOP block is registered which calls CALLBACK. Thus the main
Perl program mentioned on the command-line is read in, parsed and
compiled into internal syntax tree form. Since the C<-c> flag is
set, the program does not start running (excepting BEGIN blocks of
# this file as a template for defsubs.h
# Extracting defsubs.h (with variable substitutions)
#!perl
-my ($out) = __FILE__ =~ /(^.*)\.PL/;
-if ($^O eq 'VMS') { ($out) = __FILE__ =~ /^(.+)_PL$/i; }
+my ($out) = __FILE__ =~ /(^.*)\.PL/i;
$out =~ s/_h$/.h/;
open(OUT,">$out") || die "Cannot open $file:$!";
-print "Extracting $out . . .\n";
+print "Extracting $out...\n";
foreach my $const (qw(AVf_REAL
HEf_SVKEY
SVf_IOK SVf_IVisUV SVf_NOK SVf_POK
readline 8 2 do_readline
rcatline 8 2
regcmaybe 8 1
+regcreset 8 1
regcomp 8 9 pregcomp
match 8 10
+qr 8 1
subst 8 10
substcont 8 7
trans 7 4 do_trans
method 8 5
entersub 10 7
leavesub 10 5
+leavesublv
caller 2 8
warn 9 3
die 9 3
prtf 4 4 do_sprintf
print 8 6
sysopen 8 2
+sysseek 8 2
sysread 8 4
syswrite 8 4 pp_send
send 8 4
egrent
getlogin
syscall
-
\ No newline at end of file
+lock 6 1
+threadsv 6 2 unused if not USE_THREADS
+setstate 1 1 currently unused anywhere
+method_named 10 2
B::LISTOP T_OP_OBJ
B::PMOP T_OP_OBJ
B::SVOP T_OP_OBJ
-B::GVOP T_OP_OBJ
+B::PADOP T_OP_OBJ
B::PVOP T_OP_OBJ
B::CVOP T_OP_OBJ
B::LOOP T_OP_OBJ
B::MAGIC T_MG_OBJ
SSize_t T_IV
STRLEN T_IV
+PADOFFSET T_UV
INPUT
T_OP_OBJ
package ByteLoader;
-require DynaLoader;
-
-@ISA = qw(DynaLoader);
+use XSLoader ();
$VERSION = 0.03;
-bootstrap ByteLoader $VERSION;
+XSLoader::load 'ByteLoader', $VERSION;
# Preloaded methods go here.
#include "XSUB.h"
#include "byterun.h"
-#ifdef NEED_FGETC_PROTOTYPE
-extern int fgetc();
-#endif
-#ifdef NEED_FREAD_PROTOTYPE
-extern int fread();
-#endif
+static int
+xgetc(PerlIO *io)
+{
+ dTHX;
+ return PerlIO_getc(io);
+}
+
+static int
+xfread(char *buf, size_t size, size_t n, PerlIO *io)
+{
+ dTHX;
+ int i = PerlIO_read(io, buf, n * size);
+ if (i > 0)
+ i /= size;
+ return i;
+}
static void
freadpv(U32 len, void *data, XPV *pv)
struct bytestream bs;
bs.data = PL_rsfp;
- bs.pfgetc = (int(*) (void*))fgetc;
- bs.pfread = (int(*) (char*,size_t,size_t,void*))fread;
+ bs.pfgetc = (int(*) (void*))xgetc;
+ bs.pfread = (int(*) (char*,size_t,size_t,void*))xfread;
bs.pfreadpv = freadpv;
byterun(aTHXo_ bs);
PL_comppad = (AV *)arg; \
pad = AvARRAY(arg); \
} STMT_END
+#define BSET_cop_file(cop, arg) CopFILE_set(cop,arg)
+#define BSET_cop_line(cop, arg) CopLINE_set(cop,arg)
+#define BSET_cop_stashpv(cop, arg) CopSTASHPV_set(cop,arg)
#define BSET_OBJ_STORE(obj, ix) \
(I32)ix > bytecode_obj_list_fill ? \
sizeof(LISTOP),
sizeof(PMOP),
sizeof(SVOP),
- sizeof(GVOP),
+ sizeof(PADOP),
sizeof(PVOP),
sizeof(LOOP),
sizeof(COP)
*(SV**)&CvGV(bytecode_sv) = arg;
break;
}
- case INSN_XCV_FILEGV: /* 48 */
+ case INSN_XCV_FILE: /* 48 */
{
- svindex arg;
- BGET_svindex(arg);
- *(SV**)&CvFILEGV(bytecode_sv) = arg;
+ pvcontents arg;
+ BGET_pvcontents(arg);
+ CvFILE(bytecode_sv) = arg;
break;
}
case INSN_XCV_DEPTH: /* 49 */
*(SV**)&GvCV(bytecode_sv) = arg;
break;
}
- case INSN_GP_FILEGV: /* 75 */
+ case INSN_GP_FILE: /* 75 */
{
- svindex arg;
- BGET_svindex(arg);
- *(SV**)&GvFILEGV(bytecode_sv) = arg;
+ pvcontents arg;
+ BGET_pvcontents(arg);
+ GvFILE(bytecode_sv) = arg;
break;
}
case INSN_GP_IO: /* 76 */
cSVOP->op_sv = arg;
break;
}
- case INSN_OP_GV: /* 102 */
+ case INSN_OP_PADIX: /* 102 */
{
- svindex arg;
- BGET_svindex(arg);
- *(SV**)&cGVOP->op_gv = arg;
+ PADOFFSET arg;
+ BGET_U32(arg);
+ cPADOP->op_padix = arg;
break;
}
case INSN_OP_PV: /* 103 */
cCOP->cop_label = arg;
break;
}
- case INSN_COP_STASH: /* 109 */
+ case INSN_COP_STASHPV: /* 109 */
{
- svindex arg;
- BGET_svindex(arg);
- *(SV**)&cCOP->cop_stash = arg;
+ pvcontents arg;
+ BGET_pvcontents(arg);
+ BSET_cop_stashpv(cCOP, arg);
break;
}
- case INSN_COP_FILEGV: /* 110 */
+ case INSN_COP_FILE: /* 110 */
{
- svindex arg;
- BGET_svindex(arg);
- *(SV**)&cCOP->cop_filegv = arg;
+ pvcontents arg;
+ BGET_pvcontents(arg);
+ BSET_cop_file(cCOP, arg);
break;
}
case INSN_COP_SEQ: /* 111 */
{
line_t arg;
BGET_U16(arg);
- cCOP->cop_line = arg;
+ BSET_cop_line(cCOP, arg);
break;
}
case INSN_COP_WARNINGS: /* 114 */
INSN_XCV_START, /* 45 */
INSN_XCV_ROOT, /* 46 */
INSN_XCV_GV, /* 47 */
- INSN_XCV_FILEGV, /* 48 */
+ INSN_XCV_FILE, /* 48 */
INSN_XCV_DEPTH, /* 49 */
INSN_XCV_PADLIST, /* 50 */
INSN_XCV_OUTSIDE, /* 51 */
INSN_GP_AV, /* 72 */
INSN_GP_HV, /* 73 */
INSN_GP_CV, /* 74 */
- INSN_GP_FILEGV, /* 75 */
+ INSN_GP_FILE, /* 75 */
INSN_GP_IO, /* 76 */
INSN_GP_FORM, /* 77 */
INSN_GP_CVGEN, /* 78 */
INSN_OP_PMFLAGS, /* 99 */
INSN_OP_PMPERMFLAGS, /* 100 */
INSN_OP_SV, /* 101 */
- INSN_OP_GV, /* 102 */
+ INSN_OP_PADIX, /* 102 */
INSN_OP_PV, /* 103 */
INSN_OP_PV_TR, /* 104 */
INSN_OP_REDOOP, /* 105 */
INSN_OP_NEXTOP, /* 106 */
INSN_OP_LASTOP, /* 107 */
INSN_COP_LABEL, /* 108 */
- INSN_COP_STASH, /* 109 */
- INSN_COP_FILEGV, /* 110 */
+ INSN_COP_STASHPV, /* 109 */
+ INSN_COP_FILE, /* 110 */
INSN_COP_SEQ, /* 111 */
INSN_COP_ARYBASE, /* 112 */
INSN_COP_LINE, /* 113 */
OPt_LISTOP, /* 4 */
OPt_PMOP, /* 5 */
OPt_SVOP, /* 6 */
- OPt_GVOP, /* 7 */
+ OPt_PADOP, /* 7 */
OPt_PVOP, /* 8 */
OPt_LOOP, /* 9 */
OPt_COP /* 10 */
require Tie::Hash;
require Exporter;
use AutoLoader;
-require DynaLoader;
-@ISA = qw(Tie::Hash Exporter DynaLoader);
+use XSLoader ();
+@ISA = qw(Tie::Hash Exporter);
@EXPORT = qw(
$DB_BTREE $DB_HASH $DB_RECNO
# };
#}
-bootstrap DB_File $VERSION;
+XSLoader::load 'DB_File', $VERSION;
# Preloaded methods go here. Autoload methods go after __END__, and are
# processed by the autosplit program.
--- /dev/null
+# osr5 needs to explicitly link against libc to pull in some static symbols
+$self->{LIBS} = ['-ldb -lc'] if $Config{'osvers'} =~ '3\.2v5\.0\..' ;
package Data::Dumper;
-$VERSION = $VERSION = '2.101';
+$VERSION = '2.101';
#$| = 1;
require 5.004_02;
require Exporter;
-require DynaLoader;
+use XSLoader ();
require overload;
use Carp;
-@ISA = qw(Exporter DynaLoader);
+@ISA = qw(Exporter);
@EXPORT = qw(Dumper);
@EXPORT_OK = qw(DumperX);
-bootstrap Data::Dumper;
+XSLoader::load 'Data::Dumper';
# module vars and their defaults
$Indent = 2 unless defined $Indent;
sub qquote {
local($_) = shift;
s/([\\\"\@\$])/\\$1/g;
- return qq("$_") unless /[^\040-\176]/; # fast exit
+ return qq("$_") unless
+ /[^ !"\#\$%&'()*+,\-.\/0-9:;<=>?\@A-Z[\\\]^_`a-z{|}~]/; # fast exit
my $high = shift || "";
s/([\a\b\t\n\f\r\e])/$esc{$1}/g;
- # no need for 3 digits in escape for these
- s/([\0-\037])(?!\d)/'\\'.sprintf('%o',ord($1))/eg;
-
- s/([\0-\037\177])/'\\'.sprintf('%03o',ord($1))/eg;
- if ($high eq "iso8859") {
- s/([\200-\240])/'\\'.sprintf('%o',ord($1))/eg;
- } elsif ($high eq "utf8") {
-# use utf8;
-# $str =~ s/([^\040-\176])/sprintf "\\x{%04x}", ord($1)/ge;
- } elsif ($high eq "8bit") {
- # leave it as it is
- } else {
- s/([\0-\037\177-\377])/'\\'.sprintf('%03o',ord($1))/eg;
+ if (ord('^')==94) { # ascii
+ # no need for 3 digits in escape for these
+ s/([\0-\037])(?!\d)/'\\'.sprintf('%o',ord($1))/eg;
+ s/([\0-\037\177])/'\\'.sprintf('%03o',ord($1))/eg;
+ # all but last branch below not supported --BEHAVIOR SUBJECT TO CHANGE--
+ if ($high eq "iso8859") {
+ s/([\200-\240])/'\\'.sprintf('%o',ord($1))/eg;
+ } elsif ($high eq "utf8") {
+# use utf8;
+# $str =~ s/([^\040-\176])/sprintf "\\x{%04x}", ord($1)/ge;
+ } elsif ($high eq "8bit") {
+ # leave it as it is
+ } else {
+ s/([\200-\377])/'\\'.sprintf('%03o',ord($1))/eg;
+ }
+ }
+ else { # ebcdic
+ s{([^ !"\#\$%&'()*+,\-.\/0-9:;<=>?\@A-Z[\\\]^_`a-z{|}~])(?!\d)}
+ {my $v = ord($1); '\\'.sprintf(($v <= 037 ? '%o' : '%03o'), $v)}eg;
+ s{([^ !"\#\$%&'()*+,\-.\/0-9:;<=>?\@A-Z[\\\]^_`a-z{|}~])}
+ {'\\'.sprintf('%03o',ord($1))}eg;
}
+
return qq("$_");
}
=head1 AUTHOR
-Gurusamy Sarathy gsar@umich.edu
+Gurusamy Sarathy gsar@activestate.com
Copyright (c) 1996-98 Gurusamy Sarathy. All rights reserved.
This program is free software; you can redistribute it and/or
}
if (isIDFIRST(*s)) {
while (*++s)
- if (!isALNUM(*s))
+ if (!isALNUM(*s)) {
if (*s == ':')
goto TOP;
else
return 1;
+ }
}
else
return 1;
ilen = inamelen;
sv_setiv(ixsv, ix);
- (void) sprintf(iname+ilen, "%ld", ix);
+ (void) sprintf(iname+ilen, "%"IVdf, (IV)ix);
ilen = strlen(iname);
iname[ilen++] = ']'; iname[ilen] = '\0';
if (indent >= 3) {
if (SvIOK(val)) {
STRLEN len;
i = SvIV(val);
- (void) sprintf(tmpbuf, "%d", i);
+ (void) sprintf(tmpbuf, "%"IVdf, (IV)i);
len = strlen(tmpbuf);
sv_catpvn(retval, tmpbuf, len);
}
SV **svp;
SV *val, *name, *pad, *xpad, *apad, *sep, *tmp, *varname;
SV *freezer, *toaster, *bless;
- I32 purity, deepcopy, quotekeys, maxdepth;
+ I32 purity, deepcopy, quotekeys, maxdepth = 0;
char tmpbuf[1024];
I32 gimme = GIMME;
STRLEN nchars = 0;
sv_setpvn(name, "$", 1);
sv_catsv(name, varname);
- (void) sprintf(tmpbuf, "%ld", i+1);
+ (void) sprintf(tmpbuf, "%"IVdf, (IV)(i+1));
nchars = strlen(tmpbuf);
sv_catpvn(name, tmpbuf, nchars);
}
C<PERL_DPROF_TICKS> sets number of ticks per second on some systems where
a replacement for times() is used. Defaults to the value of C<HZ> macro.
+C<PERL_DPROF_OUT_FILE_NAME> sets the name of the output file. If not set,
+defaults to tmon.out.
+
=head1 BUGS
Builtin functions cannot be measured by Devel::DProf.
# print "nonXS DBDB\n";
}
-require DynaLoader;
-@Devel::DProf::ISA = 'DynaLoader';
+use XSLoader ();
+
$Devel::DProf::VERSION = '19990108'; # this version not authorized by
# Dean Roehrich. See "Changes" file.
-bootstrap Devel::DProf $Devel::DProf::VERSION;
+XSLoader::load 'Devel::DProf', $Devel::DProf::VERSION;
1;
-/* XXX DProf could use some cleanups for PERL_IMPLICIT_CONTEXT */
-
-#define PERL_POLLUTE
-
+#define PERL_NO_GET_CONTEXT
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
/*#define DBG_TIMER 1 */
#ifdef DBG_SUB
-# define DBG_SUB_NOTIFY(A,B) warn( A, B )
+# define DBG_SUB_NOTIFY(A,B) warn(A, B)
#else
# define DBG_SUB_NOTIFY(A,B) /* nothing */
#endif
#ifdef DBG_TIMER
-# define DBG_TIMER_NOTIFY(A) warn( A )
+# define DBG_TIMER_NOTIFY(A) warn(A)
#else
# define DBG_TIMER_NOTIFY(A) /* nothing */
#endif
-static U32 dprof_ticks;
-
/* HZ == clock ticks per second */
#ifdef VMS
# define HZ ((I32)CLK_TCK)
# define DPROF_HZ HZ
# include <starlet.h> /* prototype for sys$gettim() */
- clock_t dprof_times(struct tms *bufptr) {
- clock_t retval;
- dTHX;
- /* Get wall time and convert to 10 ms intervals to
- * produce the return value dprof expects */
-# if defined(__DECC) && defined (__ALPHA)
-# include <ints.h>
- uint64 vmstime;
- _ckvmssts(sys$gettim(&vmstime));
- vmstime /= 100000;
- retval = vmstime & 0x7fffffff;
-# else
- /* (Older hw or ccs don't have an atomic 64-bit type, so we
- * juggle 32-bit ints (and a float) to produce a time_t result
- * with minimal loss of information.) */
- long int vmstime[2],remainder,divisor = 100000;
- _ckvmssts(sys$gettim((unsigned long int *)vmstime));
- vmstime[1] &= 0x7fff; /* prevent overflow in EDIV */
- _ckvmssts(lib$ediv(&divisor,vmstime,(long int *)&retval,&remainder));
-# endif
- /* Fill in the struct tms using the CRTL routine . . .*/
- times((tbuffer_t *)bufptr);
- return (clock_t) retval;
- }
-# define Times(ptr) (dprof_times(ptr))
+# define Times(ptr) (dprof_times(aTHX_ ptr))
#else
# ifndef HZ
# ifdef CLK_TCK
# endif
# endif
# ifdef OS2 /* times() has significant overhead */
-# define Times(ptr) (dprof_times(ptr))
+# define Times(ptr) (dprof_times(aTHX_ ptr))
# define INCL_DOSPROFILE
# define INCL_DOSERRORS
# include <os2.h>
# define toLongLong(arg) (*(long long*)&(arg))
-# define DPROF_HZ dprof_ticks
-
-static ULONG frequ;
-static long long start_cnt;
-clock_t
-dprof_times(struct tms *t)
-{
- ULONG rc;
- QWORD cnt;
-
- if (!frequ) {
- if (CheckOSError(DosTmrQueryFreq(&frequ)))
- croak("DosTmrQueryFreq: %s", SvPV(perl_get_sv("!",TRUE),na));
- else
- frequ = frequ/DPROF_HZ; /* count per tick */
- if (CheckOSError(DosTmrQueryTime(&cnt)))
- croak("DosTmrQueryTime: %s",
- SvPV(perl_get_sv("!",TRUE),na));
- start_cnt = toLongLong(cnt);
- }
-
- if (CheckOSError(DosTmrQueryTime(&cnt)))
- croak("DosTmrQueryTime: %s", SvPV(perl_get_sv("!",TRUE),na));
- t->tms_stime = 0;
- return (t->tms_utime = (toLongLong(cnt) - start_cnt)/frequ);
-}
+# define DPROF_HZ g_dprof_ticks
# else
# define Times(ptr) (times(ptr))
# define DPROF_HZ HZ
XS(XS_Devel__DProf_END); /* used by prof_mark() */
-static SV * Sub; /* pointer to $DB::sub */
-static PerlIO *fp; /* pointer to tmon.out file */
-
-/* Added -JH */
-static long TIMES_LOCATION=42;/* Where in the file to store the time totals */
-static int SAVE_STACK = 1<<14; /* How much data to buffer until */
- /* end of run */
-
-static int prof_pid; /* pid of profiled process */
-
/* Everything is built on times(2). See its manpage for a description
* of the timings.
*/
-static
-struct tms prof_start,
- prof_end;
-
-static
-clock_t rprof_start, /* elapsed real time, in ticks */
- rprof_end,
- wprof_u, wprof_s, wprof_r;
-
union prof_any {
clock_t tms_utime; /* cpu time spent in user space */
clock_t tms_stime; /* cpu time spent in system */
typedef union prof_any PROFANY;
-static PROFANY *profstack;
-static int profstack_max = 128;
-static int profstack_ix = 0;
+typedef struct {
+ U32 dprof_ticks;
+ char* out_file_name; /* output file (defaults to tmon.out) */
+ PerlIO* fp; /* pointer to tmon.out file */
+ long TIMES_LOCATION; /* Where in the file to store the time totals */
+ int SAVE_STACK; /* How much data to buffer until end of run */
+ int prof_pid; /* pid of profiled process */
+ struct tms prof_start;
+ struct tms prof_end;
+ clock_t rprof_start; /* elapsed real time ticks */
+ clock_t rprof_end;
+ clock_t wprof_u;
+ clock_t wprof_s;
+ clock_t wprof_r;
+ clock_t otms_utime;
+ clock_t otms_stime;
+ clock_t orealtime;
+ PROFANY* profstack;
+ int profstack_max;
+ int profstack_ix;
+ HV* cv_hash;
+ U32 total;
+ U32 lastid;
+ U32 default_perldb;
+ U32 depth;
+#ifdef OS2
+ ULONG frequ;
+ long long start_cnt;
+#endif
+#ifdef PERL_IMPLICIT_CONTEXT
+# define register
+ pTHX;
+# undef register
+#endif
+} prof_state_t;
+
+prof_state_t g_prof_state;
+
+#define g_dprof_ticks g_prof_state.dprof_ticks
+#define g_out_file_name g_prof_state.out_file_name
+#define g_fp g_prof_state.fp
+#define g_TIMES_LOCATION g_prof_state.TIMES_LOCATION
+#define g_SAVE_STACK g_prof_state.SAVE_STACK
+#define g_prof_pid g_prof_state.prof_pid
+#define g_prof_start g_prof_state.prof_start
+#define g_prof_end g_prof_state.prof_end
+#define g_rprof_start g_prof_state.rprof_start
+#define g_rprof_end g_prof_state.rprof_end
+#define g_wprof_u g_prof_state.wprof_u
+#define g_wprof_s g_prof_state.wprof_s
+#define g_wprof_r g_prof_state.wprof_r
+#define g_otms_utime g_prof_state.otms_utime
+#define g_otms_stime g_prof_state.otms_stime
+#define g_orealtime g_prof_state.orealtime
+#define g_profstack g_prof_state.profstack
+#define g_profstack_max g_prof_state.profstack_max
+#define g_profstack_ix g_prof_state.profstack_ix
+#define g_cv_hash g_prof_state.cv_hash
+#define g_total g_prof_state.total
+#define g_lastid g_prof_state.lastid
+#define g_default_perldb g_prof_state.default_perldb
+#define g_depth g_prof_state.depth
+#ifdef PERL_IMPLICIT_CONTEXT
+# define g_THX g_prof_state.aTHX
+#endif
+#ifdef OS2
+# define g_frequ g_prof_state.frequ
+# define g_start_cnt g_prof_state.start_cnt
+#endif
-static void
-prof_dump(opcode ptype, char *name)
+clock_t
+dprof_times(pTHX_ struct tms *t)
{
- if(ptype == OP_LEAVESUB){
- PerlIO_printf(fp,"- & %s\n", name );
- } else if(ptype == OP_ENTERSUB) {
- PerlIO_printf(fp,"+ & %s\n", name );
- } else if(ptype == OP_DIE) {
- PerlIO_printf(fp,"/ & %s\n", name );
- } else {
- PerlIO_printf(fp,"Profiler unknown prof code %d\n", ptype);
+#ifdef OS2
+ ULONG rc;
+ QWORD cnt;
+
+ if (!g_frequ) {
+ if (CheckOSError(DosTmrQueryFreq(&g_frequ)))
+ croak("DosTmrQueryFreq: %s", SvPV(perl_get_sv("!",TRUE),na));
+ else
+ g_frequ = g_frequ/DPROF_HZ; /* count per tick */
+ if (CheckOSError(DosTmrQueryTime(&cnt)))
+ croak("DosTmrQueryTime: %s",
+ SvPV(perl_get_sv("!",TRUE),na));
+ g_start_cnt = toLongLong(cnt);
}
- safefree(name);
-}
+
+ if (CheckOSError(DosTmrQueryTime(&cnt)))
+ croak("DosTmrQueryTime: %s", SvPV(perl_get_sv("!",TRUE),na));
+ t->tms_stime = 0;
+ return (t->tms_utime = (toLongLong(cnt) - g_start_cnt)/g_frequ);
+#else /* !OS2 */
+# ifdef VMS
+ clock_t retval;
+ /* Get wall time and convert to 10 ms intervals to
+ * produce the return value dprof expects */
+# if defined(__DECC) && defined (__ALPHA)
+# include <ints.h>
+ uint64 vmstime;
+ _ckvmssts(sys$gettim(&vmstime));
+ vmstime /= 100000;
+ retval = vmstime & 0x7fffffff;
+# else
+ /* (Older hw or ccs don't have an atomic 64-bit type, so we
+ * juggle 32-bit ints (and a float) to produce a time_t result
+ * with minimal loss of information.) */
+ long int vmstime[2],remainder,divisor = 100000;
+ _ckvmssts(sys$gettim((unsigned long int *)vmstime));
+ vmstime[1] &= 0x7fff; /* prevent overflow in EDIV */
+ _ckvmssts(lib$ediv(&divisor,vmstime,(long int *)&retval,&remainder));
+# endif
+ /* Fill in the struct tms using the CRTL routine . . .*/
+ times((tbuffer_t *)t);
+ return (clock_t) retval;
+# else /* !VMS && !OS2 */
+ return times(t);
+# endif
+#endif
+}
static void
-prof_dumpa(opcode ptype, U32 id)
+prof_dumpa(pTHX_ opcode ptype, U32 id)
{
- if(ptype == OP_LEAVESUB){
- PerlIO_printf(fp,"- %lx\n", id );
- } else if(ptype == OP_ENTERSUB) {
- PerlIO_printf(fp,"+ %lx\n", id );
- } else if(ptype == OP_GOTO) {
- PerlIO_printf(fp,"* %lx\n", id );
- } else if(ptype == OP_DIE) {
- PerlIO_printf(fp,"/ %lx\n", id );
- } else {
- PerlIO_printf(fp,"Profiler unknown prof code %d\n", ptype);
+ if (ptype == OP_LEAVESUB) {
+ PerlIO_printf(g_fp,"- %"UVxf"\n", (UV)id);
+ }
+ else if(ptype == OP_ENTERSUB) {
+ PerlIO_printf(g_fp,"+ %"UVxf"\n", (UV)id);
+ }
+ else if(ptype == OP_GOTO) {
+ PerlIO_printf(g_fp,"* %"UVxf"\n", (UV)id);
+ }
+ else if(ptype == OP_DIE) {
+ PerlIO_printf(g_fp,"/ %"UVxf"\n", (UV)id);
+ }
+ else {
+ PerlIO_printf(g_fp,"Profiler unknown prof code %d\n", ptype);
}
}
static void
-prof_dumps(U32 id, char *pname, char *gname)
+prof_dumps(pTHX_ U32 id, char *pname, char *gname)
{
- PerlIO_printf(fp,"& %lx %s %s\n", id, pname, gname);
+ PerlIO_printf(g_fp,"& %"UVxf" %s %s\n", (UV)id, pname, gname);
}
-static clock_t otms_utime, otms_stime, orealtime;
-
static void
-prof_dumpt(long tms_utime, long tms_stime, long realtime)
+prof_dumpt(pTHX_ long tms_utime, long tms_stime, long realtime)
{
- PerlIO_printf(fp,"@ %ld %ld %ld\n", tms_utime, tms_stime, realtime);
+ PerlIO_printf(g_fp,"@ %ld %ld %ld\n", tms_utime, tms_stime, realtime);
}
static void
-prof_dump_until(long ix)
+prof_dump_until(pTHX_ long ix)
{
long base = 0;
struct tms t1, t2;
realtime1 = Times(&t1);
- while( base < ix ){
- opcode ptype = profstack[base++].ptype;
+ while (base < ix) {
+ opcode ptype = g_profstack[base++].ptype;
if (ptype == OP_TIME) {
- long tms_utime = profstack[base++].tms_utime;
- long tms_stime = profstack[base++].tms_stime;
- long realtime = profstack[base++].realtime;
-
- prof_dumpt(tms_utime, tms_stime, realtime);
- } else if (ptype == OP_GV) {
- U32 id = profstack[base++].id;
- char *pname = profstack[base++].name;
- char *gname = profstack[base++].name;
-
- prof_dumps(id, pname, gname);
- } else {
-#ifdef PERLDBf_NONAME
- U32 id = profstack[base++].id;
- prof_dumpa(ptype, id);
-#else
- char *name = profstack[base++].name;
- prof_dump(ptype, name);
-#endif
+ long tms_utime = g_profstack[base++].tms_utime;
+ long tms_stime = g_profstack[base++].tms_stime;
+ long realtime = g_profstack[base++].realtime;
+
+ prof_dumpt(aTHX_ tms_utime, tms_stime, realtime);
+ }
+ else if (ptype == OP_GV) {
+ U32 id = g_profstack[base++].id;
+ char *pname = g_profstack[base++].name;
+ char *gname = g_profstack[base++].name;
+
+ prof_dumps(aTHX_ id, pname, gname);
+ }
+ else {
+ U32 id = g_profstack[base++].id;
+ prof_dumpa(aTHX_ ptype, id);
}
}
- PerlIO_flush(fp);
+ PerlIO_flush(g_fp);
realtime2 = Times(&t2);
if (realtime2 != realtime1 || t1.tms_utime != t2.tms_utime
|| t1.tms_stime != t2.tms_stime) {
- wprof_r += realtime2 - realtime1;
- wprof_u += t2.tms_utime - t1.tms_utime;
- wprof_s += t2.tms_stime - t1.tms_stime;
-
- PerlIO_printf(fp,"+ & Devel::DProf::write\n" );
- PerlIO_printf(fp,"@ %ld %ld %ld\n",
- t2.tms_utime - t1.tms_utime, t2.tms_stime - t1.tms_stime,
- realtime2 - realtime1);
- PerlIO_printf(fp,"- & Devel::DProf::write\n" );
- otms_utime = t2.tms_utime;
- otms_stime = t2.tms_stime;
- orealtime = realtime2;
- PerlIO_flush(fp);
+ g_wprof_r += realtime2 - realtime1;
+ g_wprof_u += t2.tms_utime - t1.tms_utime;
+ g_wprof_s += t2.tms_stime - t1.tms_stime;
+
+ PerlIO_printf(g_fp,"+ & Devel::DProf::write\n");
+ PerlIO_printf(g_fp,"@ %"IVdf" %"IVdf" %"IVdf"\n",
+ /* The (IV) casts are one possibility:
+ * the Painfully Correct Way would be to
+ * have Clock_t_f. */
+ (IV)(t2.tms_utime - t1.tms_utime),
+ (IV)(t2.tms_stime - t1.tms_stime),
+ (IV)(realtime2 - realtime1));
+ PerlIO_printf(g_fp,"- & Devel::DProf::write\n");
+ g_otms_utime = t2.tms_utime;
+ g_otms_stime = t2.tms_stime;
+ g_orealtime = realtime2;
+ PerlIO_flush(g_fp);
}
}
-static HV* cv_hash;
-static U32 total = 0;
-
static void
-prof_mark( opcode ptype )
+prof_mark(pTHX_ opcode ptype)
{
- struct tms t;
- clock_t realtime, rdelta, udelta, sdelta;
- char *name, *pv;
- char *hvname;
- STRLEN len;
- SV *sv;
- U32 id;
-
- if( SAVE_STACK ){
- if( profstack_ix + 5 > profstack_max ){
- profstack_max = profstack_max * 3 / 2;
- Renew( profstack, profstack_max, PROFANY );
- }
- }
+ struct tms t;
+ clock_t realtime, rdelta, udelta, sdelta;
+ char *name, *pv;
+ char *hvname;
+ STRLEN len;
+ SV *sv;
+ U32 id;
+ SV *Sub = GvSV(PL_DBsub); /* name of current sub */
+
+ if (g_SAVE_STACK) {
+ if (g_profstack_ix + 5 > g_profstack_max) {
+ g_profstack_max = g_profstack_max * 3 / 2;
+ Renew(g_profstack, g_profstack_max, PROFANY);
+ }
+ }
- realtime = Times(&t);
- rdelta = realtime - orealtime;
- udelta = t.tms_utime - otms_utime;
- sdelta = t.tms_stime - otms_stime;
- if (rdelta || udelta || sdelta) {
- if (SAVE_STACK) {
- profstack[profstack_ix++].ptype = OP_TIME;
- profstack[profstack_ix++].tms_utime = udelta;
- profstack[profstack_ix++].tms_stime = sdelta;
- profstack[profstack_ix++].realtime = rdelta;
- } else { /* Write it to disk now so's not to eat up core */
- if (prof_pid == (int)getpid()) {
- prof_dumpt(udelta, sdelta, rdelta);
- PerlIO_flush(fp);
- }
+ realtime = Times(&t);
+ rdelta = realtime - g_orealtime;
+ udelta = t.tms_utime - g_otms_utime;
+ sdelta = t.tms_stime - g_otms_stime;
+ if (rdelta || udelta || sdelta) {
+ if (g_SAVE_STACK) {
+ g_profstack[g_profstack_ix++].ptype = OP_TIME;
+ g_profstack[g_profstack_ix++].tms_utime = udelta;
+ g_profstack[g_profstack_ix++].tms_stime = sdelta;
+ g_profstack[g_profstack_ix++].realtime = rdelta;
+ }
+ else { /* Write it to disk now so's not to eat up core */
+ if (g_prof_pid == (int)getpid()) {
+ prof_dumpt(aTHX_ udelta, sdelta, rdelta);
+ PerlIO_flush(g_fp);
}
- orealtime = realtime;
- otms_stime = t.tms_stime;
- otms_utime = t.tms_utime;
}
+ g_orealtime = realtime;
+ g_otms_stime = t.tms_stime;
+ g_otms_utime = t.tms_utime;
+ }
-#ifdef PERLDBf_NONAME
- {
- dTHX;
- SV **svp;
- char *gname, *pname;
- static U32 lastid;
- CV *cv;
-
- cv = INT2PTR(CV*,SvIVX(Sub));
- svp = hv_fetch(cv_hash, (char*)&cv, sizeof(CV*), TRUE);
- if (!SvOK(*svp)) {
- GV *gv = CvGV(cv);
-
- sv_setiv(*svp, id = ++lastid);
- pname = ((GvSTASH(gv) && HvNAME(GvSTASH(gv)))
- ? HvNAME(GvSTASH(gv))
- : "(null)");
- gname = GvNAME(gv);
- if (CvXSUB(cv) == XS_Devel__DProf_END)
- return;
- if (SAVE_STACK) { /* Store it for later recording -JH */
- profstack[profstack_ix++].ptype = OP_GV;
- profstack[profstack_ix++].id = id;
- profstack[profstack_ix++].name = pname;
- profstack[profstack_ix++].name = gname;
- } else { /* Write it to disk now so's not to eat up core */
-
- /* Only record the parent's info */
- if (prof_pid == (int)getpid()) {
- prof_dumps(id, pname, gname);
- PerlIO_flush(fp);
- } else
- perldb = 0; /* Do not debug the kid. */
+ {
+ SV **svp;
+ char *gname, *pname;
+ CV *cv;
+
+ cv = INT2PTR(CV*,SvIVX(Sub));
+ svp = hv_fetch(g_cv_hash, (char*)&cv, sizeof(CV*), TRUE);
+ if (!SvOK(*svp)) {
+ GV *gv = CvGV(cv);
+
+ sv_setiv(*svp, id = ++g_lastid);
+ pname = ((GvSTASH(gv) && HvNAME(GvSTASH(gv)))
+ ? HvNAME(GvSTASH(gv))
+ : "(null)");
+ gname = GvNAME(gv);
+ if (CvXSUB(cv) == XS_Devel__DProf_END)
+ return;
+ if (g_SAVE_STACK) { /* Store it for later recording -JH */
+ g_profstack[g_profstack_ix++].ptype = OP_GV;
+ g_profstack[g_profstack_ix++].id = id;
+ g_profstack[g_profstack_ix++].name = pname;
+ g_profstack[g_profstack_ix++].name = gname;
+ }
+ else { /* Write it to disk now so's not to eat up core */
+ /* Only record the parent's info */
+ if (g_prof_pid == (int)getpid()) {
+ prof_dumps(aTHX_ id, pname, gname);
+ PerlIO_flush(g_fp);
}
- } else {
- id = SvIV(*svp);
+ else
+ PL_perldb = 0; /* Do not debug the kid. */
}
}
-#else
- pv = SvPV( Sub, len );
-
- if( SvROK(Sub) ){
- /* Attempt to make CODE refs slightly identifiable by
- * including their package name.
- */
- sv = (SV*)SvRV(Sub);
- if( sv && SvTYPE(sv) == SVt_PVCV ){
- if( CvSTASH(sv) ){
- hvname = HvNAME(CvSTASH(sv));
- }
- else if( CvXSUB(sv) == &XS_Devel__DProf_END ){
- /*warn( "prof_mark() found dprof::end");*/
- return; /* don't profile Devel::DProf::END */
- }
- else{
- croak( "DProf prof_mark() lost on CODE ref %s\n", pv );
- }
- len += strlen( hvname ) + 2; /* +2 for ::'s */
-
- }
- else{
- croak( "DProf prof_mark() lost on supposed CODE ref %s.\n", pv );
- }
- name = (char *)safemalloc( len * sizeof(char) + 1 );
- strcpy( name, hvname );
- strcat( name, "::" );
- strcat( name, pv );
- }
- else{
- if( *(pv+len-1) == 'D' ){
- /* It could be an &AUTOLOAD. */
-
- /* I measured a bunch of *.pl and *.pm (from Perl
- * distribution and other misc things) and found
- * 780 fully-qualified names. They averaged
- * about 19 chars each. Only 1 of those names
- * ended with 'D' and wasn't an &AUTOLOAD--it
- * was &overload::OVERLOAD.
- * --dmr 2/19/96
- */
-
- if( strcmp( pv+len-9, ":AUTOLOAD" ) == 0 ){
- /* The sub name is in $AUTOLOAD */
- sv = perl_get_sv( pv, 0 );
- if( sv == NULL ){
- croak("DProf prof_mark() lost on AUTOLOAD (%s).\n", pv );
- }
- pv = SvPV( sv, na );
- DBG_SUB_NOTIFY( " AUTOLOAD(%s)\n", pv );
- }
- }
- name = savepv( pv );
- }
-#endif /* PERLDBf_NONAME */
+ else {
+ id = SvIV(*svp);
+ }
+ }
- total++;
- if (SAVE_STACK) { /* Store it for later recording -JH */
- profstack[profstack_ix++].ptype = ptype;
-#ifdef PERLDBf_NONAME
- profstack[profstack_ix++].id = id;
-#else
- profstack[profstack_ix++].name = name;
-#endif
- /* Only record the parent's info */
- if (SAVE_STACK < profstack_ix) {
- if (prof_pid == (int)getpid())
- prof_dump_until(profstack_ix);
- else
- perldb = 0; /* Do not debug the kid. */
- profstack_ix = 0;
- }
- } else { /* Write it to disk now so's not to eat up core */
+ g_total++;
+ if (g_SAVE_STACK) { /* Store it for later recording -JH */
+ g_profstack[g_profstack_ix++].ptype = ptype;
+ g_profstack[g_profstack_ix++].id = id;
+
+ /* Only record the parent's info */
+ if (g_SAVE_STACK < g_profstack_ix) {
+ if (g_prof_pid == (int)getpid())
+ prof_dump_until(aTHX_ g_profstack_ix);
+ else
+ PL_perldb = 0; /* Do not debug the kid. */
+ g_profstack_ix = 0;
+ }
+ }
+ else { /* Write it to disk now so's not to eat up core */
- /* Only record the parent's info */
- if (prof_pid == (int)getpid()) {
-#ifdef PERLDBf_NONAME
- prof_dumpa(ptype, id);
-#else
- prof_dump(ptype, name);
-#endif
- PerlIO_flush(fp);
- } else
- perldb = 0; /* Do not debug the kid. */
- }
+ /* Only record the parent's info */
+ if (g_prof_pid == (int)getpid()) {
+ prof_dumpa(aTHX_ ptype, id);
+ PerlIO_flush(g_fp);
+ }
+ else
+ PL_perldb = 0; /* Do not debug the kid. */
+ }
}
-static U32 default_perldb;
-
#ifdef PL_NEEDED
# define defstash PL_defstash
#endif
/* Counts overhead of prof_mark and extra XS call. */
static void
-test_time(clock_t *r, clock_t *u, clock_t *s)
+test_time(pTHX_ clock_t *r, clock_t *u, clock_t *s)
{
dTHR;
- dTHX;
CV *cv = perl_get_cv("Devel::DProf::NONESUCH_noxs", FALSE);
int i, j, k = 0;
- HV *oldstash = curstash;
+ HV *oldstash = PL_curstash;
struct tms t1, t2;
clock_t realtime1, realtime2;
- U32 ototal = total;
- U32 ostack = SAVE_STACK;
- U32 operldb = perldb;
+ U32 ototal = g_total;
+ U32 ostack = g_SAVE_STACK;
+ U32 operldb = PL_perldb;
- SAVE_STACK = 1000000;
+ g_SAVE_STACK = 1000000;
realtime1 = Times(&t1);
while (k < 2) {
i = 0;
/* Disable debugging of perl_call_sv on second pass: */
- curstash = (k == 0 ? defstash : debstash);
- perldb = default_perldb;
+ PL_curstash = (k == 0 ? PL_defstash : PL_debstash);
+ PL_perldb = g_default_perldb;
while (++i <= 100) {
j = 0;
- profstack_ix = 0; /* Do not let the stack grow */
+ g_profstack_ix = 0; /* Do not let the stack grow */
while (++j <= 100) {
-/* prof_mark( OP_ENTERSUB ); */
+/* prof_mark(aTHX_ OP_ENTERSUB); */
- PUSHMARK( stack_sp );
- perl_call_sv( (SV*)cv, G_SCALAR );
- stack_sp--;
-/* prof_mark( OP_LEAVESUB ); */
+ PUSHMARK(PL_stack_sp);
+ perl_call_sv((SV*)cv, G_SCALAR);
+ PL_stack_sp--;
+/* prof_mark(aTHX_ OP_LEAVESUB); */
}
}
- curstash = oldstash;
+ PL_curstash = oldstash;
if (k == 0) { /* Put time with debugging */
realtime2 = Times(&t2);
*r = realtime2 - realtime1;
*u = t2.tms_utime - t1.tms_utime;
*s = t2.tms_stime - t1.tms_stime;
- } else { /* Subtract time without debug */
+ }
+ else { /* Subtract time without debug */
realtime1 = Times(&t1);
*r -= realtime1 - realtime2;
*u -= t1.tms_utime - t2.tms_utime;
}
k++;
}
- total = ototal;
- SAVE_STACK = ostack;
- perldb = operldb;
+ g_total = ototal;
+ g_SAVE_STACK = ostack;
+ PL_perldb = operldb;
}
static void
-prof_recordheader()
+prof_recordheader(pTHX)
{
- clock_t r, u, s;
-
- /* fp is opened in the BOOT section */
- PerlIO_printf(fp, "#fOrTyTwO\n" );
- PerlIO_printf(fp, "$hz=%d;\n", DPROF_HZ );
- PerlIO_printf(fp, "$XS_VERSION='DProf %s';\n", XS_VERSION );
- PerlIO_printf(fp, "# All values are given in HZ\n" );
- test_time(&r, &u, &s);
- PerlIO_printf(fp, "$over_utime=%ld; $over_stime=%ld; $over_rtime=%ld;\n",
- u, s, r);
- PerlIO_printf(fp, "$over_tests=10000;\n");
-
- TIMES_LOCATION = PerlIO_tell(fp);
-
- /* Pad with whitespace. */
- /* This should be enough even for very large numbers. */
- PerlIO_printf(fp, "%*s\n", 240 , "");
-
- PerlIO_printf(fp, "\n");
- PerlIO_printf(fp, "PART2\n" );
-
- PerlIO_flush(fp);
+ clock_t r, u, s;
+
+ /* g_fp is opened in the BOOT section */
+ PerlIO_printf(g_fp, "#fOrTyTwO\n");
+ PerlIO_printf(g_fp, "$hz=%"IVdf";\n", (IV)DPROF_HZ);
+ PerlIO_printf(g_fp, "$XS_VERSION='DProf %s';\n", XS_VERSION);
+ PerlIO_printf(g_fp, "# All values are given in HZ\n");
+ test_time(aTHX_ &r, &u, &s);
+ PerlIO_printf(g_fp,
+ "$over_utime=%"IVdf"; $over_stime=%"IVdf"; $over_rtime=%"IVdf";\n",
+ /* The (IV) casts are one possibility:
+ * the Painfully Correct Way would be to
+ * have Clock_t_f. */
+ (IV)u, (IV)s, (IV)r);
+ PerlIO_printf(g_fp, "$over_tests=10000;\n");
+
+ g_TIMES_LOCATION = PerlIO_tell(g_fp);
+
+ /* Pad with whitespace. */
+ /* This should be enough even for very large numbers. */
+ PerlIO_printf(g_fp, "%*s\n", 240 , "");
+
+ PerlIO_printf(g_fp, "\n");
+ PerlIO_printf(g_fp, "PART2\n");
+
+ PerlIO_flush(g_fp);
}
static void
-prof_record()
+prof_record(pTHX)
{
- /* fp is opened in the BOOT section */
+ /* g_fp is opened in the BOOT section */
+
+ /* Now that we know the runtimes, fill them in at the recorded
+ location -JH */
- /* Now that we know the runtimes, fill them in at the recorded
- location -JH */
+ clock_t r, u, s;
- clock_t r, u, s;
+ if (g_SAVE_STACK) {
+ prof_dump_until(aTHX_ g_profstack_ix);
+ }
+ PerlIO_seek(g_fp, g_TIMES_LOCATION, SEEK_SET);
+ /* Write into reserved 240 bytes: */
+ PerlIO_printf(g_fp,
+ "$rrun_utime=%"IVdf"; $rrun_stime=%"IVdf"; $rrun_rtime=%"IVdf";",
+ /* The (IV) casts are one possibility:
+ * the Painfully Correct Way would be to
+ * have Clock_t_f. */
+ (IV)(g_prof_end.tms_utime-g_prof_start.tms_utime-g_wprof_u),
+ (IV)(g_prof_end.tms_stime-g_prof_start.tms_stime-g_wprof_s),
+ (IV)(g_rprof_end-g_rprof_start-g_wprof_r));
+ PerlIO_printf(g_fp, "\n$total_marks=%"IVdf, (IV)g_total);
- if(SAVE_STACK){
- prof_dump_until(profstack_ix);
- }
- PerlIO_seek(fp, TIMES_LOCATION, SEEK_SET);
- /* Write into reserved 240 bytes: */
- PerlIO_printf(fp, "$rrun_utime=%ld; $rrun_stime=%ld; $rrun_rtime=%ld;",
- prof_end.tms_utime - prof_start.tms_utime - wprof_u,
- prof_end.tms_stime - prof_start.tms_stime - wprof_s,
- rprof_end - rprof_start - wprof_r );
- PerlIO_printf(fp, "\n$total_marks=%ld;", total);
-
- PerlIO_close( fp );
+ PerlIO_close(g_fp);
}
#define NONESUCH()
-static U32 depth = 0;
-
static void
check_depth(pTHX_ void *foo)
{
U32 need_depth = (U32)foo;
- if (need_depth != depth) {
- if (need_depth > depth) {
+ if (need_depth != g_depth) {
+ if (need_depth > g_depth) {
warn("garbled call depth when profiling");
- } else {
- I32 marks = depth - need_depth;
+ }
+ else {
+ I32 marks = g_depth - need_depth;
-/* warn("Check_depth: got %d, expected %d\n", depth, need_depth); */
+/* warn("Check_depth: got %d, expected %d\n", g_depth, need_depth); */
while (marks--) {
- prof_mark( OP_DIE );
+ prof_mark(aTHX_ OP_DIE);
}
- depth = need_depth;
+ g_depth = need_depth;
}
}
}
XS(XS_DB_sub)
{
- dXSARGS;
- dORIGMARK;
- HV *oldstash = curstash;
-
- SP -= items;
-
- DBG_SUB_NOTIFY( "XS DBsub(%s)\n", SvPV(Sub, na) );
-
-#ifndef PERLDBf_NONAME /* Was needed on older Perls */
- sv_setiv( DBsingle, 0 ); /* disable DB single-stepping */
-#endif
-
- SAVEDESTRUCTOR(check_depth, (void*)depth);
- depth++;
-
- prof_mark( OP_ENTERSUB );
- PUSHMARK( ORIGMARK );
+ dXSARGS;
+ dORIGMARK;
+ SV *Sub = GvSV(PL_DBsub); /* name of current sub */
+
+#ifdef PERL_IMPLICIT_CONTEXT
+ /* profile only the interpreter that loaded us */
+ if (g_THX != aTHX) {
+ PUSHMARK(ORIGMARK);
+ perl_call_sv(INT2PTR(SV*,SvIV(Sub)), GIMME | G_NODEBUG);
+ }
+ else
+#endif
+ {
+ HV *oldstash = PL_curstash;
-#ifdef G_NODEBUG
- perl_call_sv( INT2PTR(SV*,SvIV(Sub)), GIMME | G_NODEBUG);
-#else
- curstash = debstash; /* To disable debugging of perl_call_sv */
-#ifdef PERLDBf_NONAME
- perl_call_sv( (SV*)SvIV(Sub), GIMME );
-#else
- perl_call_sv( Sub, GIMME );
-#endif
- curstash = oldstash;
-#endif
+ DBG_SUB_NOTIFY("XS DBsub(%s)\n", SvPV(Sub, na));
- prof_mark( OP_LEAVESUB );
- depth--;
+ SAVEDESTRUCTOR_X(check_depth, (void*)g_depth);
+ g_depth++;
- SPAGAIN;
- PUTBACK;
- return;
+ prof_mark(aTHX_ OP_ENTERSUB);
+ PUSHMARK(ORIGMARK);
+ perl_call_sv(INT2PTR(SV*,SvIV(Sub)), GIMME | G_NODEBUG);
+ prof_mark(aTHX_ OP_LEAVESUB);
+ g_depth--;
+ }
+ return;
}
XS(XS_DB_goto)
{
- prof_mark( OP_GOTO );
+#ifdef PERL_IMPLICIT_CONTEXT
+ if (g_THX == aTHX)
+#endif
+ {
+ prof_mark(aTHX_ OP_GOTO);
return;
+ }
}
#endif /* for_real */
void
sub(...)
- PPCODE:
-
+ PPCODE:
+ {
dORIGMARK;
- HV *oldstash = curstash;
+ HV *oldstash = PL_curstash;
+ SV *Sub = GvSV(PL_DBsub); /* name of current sub */
/* SP -= items; added by xsubpp */
- DBG_SUB_NOTIFY( "XS DBsub(%s)\n", SvPV(Sub, na) );
+ DBG_SUB_NOTIFY("XS DBsub(%s)\n", SvPV(Sub, na));
- sv_setiv( DBsingle, 0 ); /* disable DB single-stepping */
+ sv_setiv(PL_DBsingle, 0); /* disable DB single-stepping */
- prof_mark( OP_ENTERSUB );
- PUSHMARK( ORIGMARK );
+ prof_mark(aTHX_ OP_ENTERSUB);
+ PUSHMARK(ORIGMARK);
- curstash = debstash; /* To disable debugging of perl_call_sv
-*/
- perl_call_sv( Sub, GIMME );
- curstash = oldstash;
+ PL_curstash = PL_debstash; /* To disable debugging of perl_call_sv */
+ perl_call_sv(Sub, GIMME);
+ PL_curstash = oldstash;
- prof_mark( OP_LEAVESUB );
+ prof_mark(aTHX_ OP_LEAVESUB);
SPAGAIN;
/* PUTBACK; added by xsubpp */
+ }
#endif /* testing */
void
END()
- PPCODE:
- if( DBsub ){
- /* maybe the process forked--we want only
- * the parent's profile.
- */
- if( prof_pid == (int)getpid() ){
- rprof_end = Times(&prof_end);
- DBG_TIMER_NOTIFY("Profiler timer is off.\n");
- prof_record();
- }
- }
+PPCODE:
+ {
+ if (PL_DBsub) {
+ /* maybe the process forked--we want only
+ * the parent's profile.
+ */
+ if (
+#ifdef PERL_IMPLICIT_CONTEXT
+ g_THX == aTHX &&
+#endif
+ g_prof_pid == (int)getpid())
+ {
+ g_rprof_end = Times(&g_prof_end);
+ DBG_TIMER_NOTIFY("Profiler timer is off.\n");
+ prof_record(aTHX);
+ }
+ }
+ }
void
NONESUCH()
BOOT:
+ {
+ g_TIMES_LOCATION = 42;
+ g_SAVE_STACK = 1<<14;
+ g_profstack_max = 128;
+#ifdef PERL_IMPLICIT_CONTEXT
+ g_THX = aTHX;
+#endif
+
/* Before we go anywhere make sure we were invoked
* properly, else we'll dump core.
*/
- if( ! DBsub )
- croak("DProf: run perl with -d to use DProf.\n");
+ if (!PL_DBsub)
+ croak("DProf: run perl with -d to use DProf.\n");
/* When we hook up the XS DB::sub we'll be redefining
* the DB::sub from the PM file. Turn off warnings
* while we do this.
*/
{
- I32 warn_tmp = dowarn;
- dowarn = 0;
- newXS("DB::sub", XS_DB_sub, file);
- newXS("DB::goto", XS_DB_goto, file);
- dowarn = warn_tmp;
+ I32 warn_tmp = PL_dowarn;
+ PL_dowarn = 0;
+ newXS("DB::sub", XS_DB_sub, file);
+ newXS("DB::goto", XS_DB_goto, file);
+ PL_dowarn = warn_tmp;
}
- Sub = GvSV(DBsub); /* name of current sub */
- sv_setiv( DBsingle, 0 ); /* disable DB single-stepping */
+ sv_setiv(PL_DBsingle, 0); /* disable DB single-stepping */
{
char *buffer = getenv("PERL_DPROF_BUFFER");
if (buffer) {
- SAVE_STACK = atoi(buffer);
+ g_SAVE_STACK = atoi(buffer);
}
buffer = getenv("PERL_DPROF_TICKS");
if (buffer) {
- dprof_ticks = atoi(buffer); /* Used under OS/2 only */
- } else {
- dprof_ticks = HZ;
+ g_dprof_ticks = atoi(buffer); /* Used under OS/2 only */
+ }
+ else {
+ g_dprof_ticks = HZ;
}
- }
- if( (fp = PerlIO_open( "tmon.out", "w" )) == NULL )
- croak("DProf: unable to write tmon.out, errno = %d\n", errno );
-#ifdef PERLDBf_NONAME
- default_perldb = PERLDBf_NONAME | PERLDBf_SUB; /* no name needed. */
-#ifdef PERLDBf_GOTO
- default_perldb = default_perldb | PERLDBf_GOTO;
-#endif
- cv_hash = newHV();
-#else
-# ifdef PERLDBf_SUB
- default_perldb = PERLDBf_SUB; /* debug subroutines only. */
-# endif
-#endif
- prof_pid = (int)getpid();
+ buffer = getenv("PERL_DPROF_OUT_FILE_NAME");
+ g_out_file_name = savepv(buffer ? buffer : "tmon.out");
+ }
- New( 0, profstack, profstack_max, PROFANY );
+ if ((g_fp = PerlIO_open(g_out_file_name, "w")) == NULL)
+ croak("DProf: unable to write '%s', errno = %d\n",
+ g_out_file_name, errno);
- prof_recordheader();
+ g_default_perldb = PERLDBf_NONAME | PERLDBf_SUB | PERLDBf_GOTO;
+ g_cv_hash = newHV();
+ g_prof_pid = (int)getpid();
+ New(0, g_profstack, g_profstack_max, PROFANY);
+ prof_recordheader(aTHX);
DBG_TIMER_NOTIFY("Profiler timer is on.\n");
- orealtime = rprof_start = Times(&prof_start);
- otms_utime = prof_start.tms_utime;
- otms_stime = prof_start.tms_stime;
- perldb = default_perldb;
+ g_orealtime = g_rprof_start = Times(&g_prof_start);
+ g_otms_utime = g_prof_start.tms_utime;
+ g_otms_stime = g_prof_start.tms_stime;
+ PL_perldb = g_default_perldb;
+ }
package Devel::Peek;
-$VERSION = $VERSION = 0.95;
+$VERSION = 0.95;
require Exporter;
-require DynaLoader;
+use XSLoader ();
-@ISA = qw(Exporter DynaLoader);
+@ISA = qw(Exporter);
@EXPORT = qw(Dump mstat DeadCode DumpArray DumpWithOP DumpProg);
@EXPORT_OK = qw(SvREFCNT SvREFCNT_inc SvREFCNT_dec);
%EXPORT_TAGS = ('ALL' => [@EXPORT, @EXPORT_OK]);
-bootstrap Devel::Peek;
+XSLoader::load 'Devel::Peek';
sub DumpWithOP ($;$) {
local($Devel::Peek::dump_ops)=1;
XSUB = 0x0
XSUBANY = 0
GVGV::GV = 0x1d44e8 "MY" :: "top_targets"
- FILEGV = 0x1fab74 "_<(eval 5)"
+ FILE = "(eval 5)"
DEPTH = 0
PADLIST = 0x1c9338
continue; /* file-level scope. */
}
if (!CvROOT(cv)) {
- /* PerlIO_printf(PerlIO_stderr(), " no root?!\n"); */
+ /* PerlIO_printf(Perl_debug_log, " no root?!\n"); */
continue; /* autoloading stub. */
}
- do_gvgv_dump(0, PerlIO_stderr(), "GVGV::GV", CvGV(sv));
+ do_gvgv_dump(0, Perl_debug_log, "GVGV::GV", CvGV(sv));
if (CvDEPTH(cv)) {
- PerlIO_printf(PerlIO_stderr(), " busy\n");
+ PerlIO_printf(Perl_debug_log, " busy\n");
continue;
}
svp = AvARRAY(padlist);
pad = AvARRAY((AV*)svp[i]);
argav = (AV*)pad[0];
if (!argav || (SV*)argav == &PL_sv_undef) {
- PerlIO_printf(PerlIO_stderr(), " closure-template\n");
+ PerlIO_printf(Perl_debug_log, " closure-template\n");
continue;
}
args = AvARRAY(argav);
if (AvREAL(argav)) {
for (j = 0; j < AvFILL(argav); j++) {
if (SvROK(args[j])) {
- PerlIO_printf(PerlIO_stderr(), " ref in args!\n");
+ PerlIO_printf(Perl_debug_log, " ref in args!\n");
levelref++;
}
/* else if (SvPOK(args[j]) && SvPVX(args[j])) { */
for (j = 1; j < AvFILL((AV*)svp[1]); j++) { /* Vars. */
if (SvROK(pad[j])) {
levelref++;
- do_sv_dump(0, PerlIO_stderr(), pad[j], 0, 4, 0, 0);
+ do_sv_dump(0, Perl_debug_log, pad[j], 0, 4, 0, 0);
dumpit = 1;
}
/* else if (SvPOK(pad[j]) && SvPVX(pad[j])) { */
else if (SvTYPE(pad[j]) >= SVt_PVAV) {
if (!SvPADMY(pad[j])) {
levelref++;
- do_sv_dump(0, PerlIO_stderr(), pad[j], 0, 4, 0, 0);
+ do_sv_dump(0, Perl_debug_log, pad[j], 0, 4, 0, 0);
dumpit = 1;
}
}
/* Dump(pad[j],4); */
}
}
- PerlIO_printf(PerlIO_stderr(), " level %i: refs: %i, strings: %i in %i,\targsarray: %i, argsstrings: %i\n",
+ PerlIO_printf(Perl_debug_log, " level %i: refs: %i, strings: %i in %i,\targsarray: %i, argsstrings: %i\n",
i, levelref, levelm, levels, levela, levelas);
totm += levelm;
tota += levela;
tots += levels;
totref += levelref;
if (dumpit)
- do_sv_dump(0, PerlIO_stderr(), (SV*)cv, 0, 2, 0, 0);
+ do_sv_dump(0, Perl_debug_log, (SV*)cv, 0, 2, 0, 0);
}
if (AvFILL(padlist) > 1) {
- PerlIO_printf(PerlIO_stderr(), " total: refs: %i, strings: %i in %i,\targsarrays: %i, argsstrings: %i\n",
+ PerlIO_printf(Perl_debug_log, " total: refs: %i, strings: %i in %i,\targsarrays: %i, argsstrings: %i\n",
totref, totm, tots, tota, totas);
}
tref += totref;
}
}
}
- PerlIO_printf(PerlIO_stderr(), "total: refs: %i, strings: %i in %i\targsarray: %i, argsstrings: %i\n", tref, tm, ts, ta, tas);
+ PerlIO_printf(Perl_debug_log, "total: refs: %i, strings: %i in %i\targsarray: %i, argsstrings: %i\n", tref, tm, ts, ta, tas);
return ret;
}
# define mstat(str) dump_mstats(str)
#else
# define mstat(str) \
- PerlIO_printf(PerlIO_stderr(), "%s: perl not compiled with DEBUGGING_MSTATS\n",str);
+ PerlIO_printf(Perl_debug_log, "%s: perl not compiled with DEBUGGING_MSTATS\n",str);
#endif
MODULE = Devel::Peek PACKAGE = Devel::Peek
SV *dumpop = perl_get_sv("Devel::Peek::dump_ops", FALSE);
I32 save_dumpindent = PL_dumpindent;
PL_dumpindent = 2;
- do_sv_dump(0, PerlIO_stderr(), sv, 0, lim, dumpop && SvTRUE(dumpop), pv_lim);
+ do_sv_dump(0, Perl_debug_log, sv, 0, lim, dumpop && SvTRUE(dumpop), pv_lim);
PL_dumpindent = save_dumpindent;
}
PL_dumpindent = 2;
for (i=1; i<items; i++) {
- PerlIO_printf(PerlIO_stderr(), "Elt No. %ld 0x%lx\n", i - 1, ST(i));
- do_sv_dump(0, PerlIO_stderr(), ST(i), 0, lim, dumpop && SvTRUE(dumpop), pv_lim);
+ PerlIO_printf(Perl_debug_log, "Elt No. %ld 0x%"UVxf"\n", i - 1, PTR2UV(ST(i)));
+ do_sv_dump(0, Perl_debug_log, ST(i), 0, lim, dumpop && SvTRUE(dumpop), pv_lim);
}
PL_dumpindent = save_dumpindent;
}
sub to_string {
my ($value) = @_;
- $value =~ s/\\/\\\\'/g;
+ $value =~ s/\\/\\\\/g;
$value =~ s/'/\\'/g;
return "'$value'";
}
#
# Tim.Bunce@ig.co.uk, August 1994
-$VERSION = $VERSION = "1.03"; # avoid typo warning
+$VERSION = "1.03"; # avoid typo warning
require AutoLoader;
*AUTOLOAD = \&AutoLoader::AUTOLOAD;
# See dl_expandspec() for more details. Should be harmless but
# inefficient to define on systems that don't need it.
$do_expand = $Is_VMS = $^O eq 'VMS';
+$Is_MacOS = $^O eq 'MacOS';
@dl_require_symbols = (); # names of symbols we need
@dl_resolve_using = (); # names of files to link with
# Add to @dl_library_path any extra directories we can gather
# from environment variables.
-push(@dl_library_path, split(/:/, $ENV{$Config::Config{ldlibpthname}}))
- if exists $Config::Config{ldlibpthname} &&
- $Config::Config{ldlibpthname} ne '' &&
- exists $ENV{$Config::Config{ldlibpthname}} ;;
+if ($Is_MacOS) {
+ push(@dl_library_path, split(/,/, $ENV{LD_LIBRARY_PATH}))
+ if exists $ENV{LD_LIBRARY_PATH};
+} else {
+ push(@dl_library_path, split(/:/, $ENV{$Config::Config{ldlibpthname}}))
+ if exists $Config::Config{ldlibpthname} &&
+ $Config::Config{ldlibpthname} ne '' &&
+ exists $ENV{$Config::Config{ldlibpthname}} ;;
+ push(@dl_library_path, split(/:/, $ENV{$Config::Config{ldlibpthname}}))
+ if exists $Config::Config{ldlibpthname} &&
+ $Config::Config{ldlibpthname} ne '' &&
+ exists $ENV{$Config::Config{ldlibpthname}} ;;
# E.g. HP-UX supports both its native SHLIB_PATH *and* LD_LIBRARY_PATH.
push(@dl_library_path, split(/:/, $ENV{LD_LIBRARY_PATH}))
if exists $ENV{LD_LIBRARY_PATH};
+}
# No prizes for guessing why we don't say 'bootstrap DynaLoader;' here.
boot_DynaLoader('DynaLoader') if defined(&boot_DynaLoader) &&
sub croak { require Carp; Carp::croak(@_) }
+sub bootstrap_inherit {
+ my $module = $_[0];
+ local *isa = *{"$module\::ISA"};
+ local @isa = (@isa, 'DynaLoader');
+ # Cannot goto due to delocalization. Will report errors on a wrong line?
+ bootstrap(@_);
+}
+
# The bootstrap function cannot be autoloaded (without complications)
# so we define it here:
# It may also edit @modparts if required.
$modfname = &mod2fname(\@modparts) if defined &mod2fname;
- my $modpname = join('/',@modparts);
+ my $modpname = join(($Is_MacOS ? ':' : '/'),@modparts);
print STDERR "DynaLoader::bootstrap for $module ",
- "(auto/$modpname/$modfname.$dl_dlext)\n" if $dl_debug;
+ ($Is_MacOS
+ ? "(auto/$modpname/$modfname.$dl_dlext)\n" :
+ "(:auto:$modpname:$modfname.$dl_dlext)\n")
+ if $dl_debug;
foreach (@INC) {
chop($_ = VMS::Filespec::unixpath($_)) if $Is_VMS;
- my $dir = "$_/auto/$modpname";
+ my $dir;
+ if ($Is_MacOS) {
+ chop $_ if /:$/;
+ $dir = "$_:auto:$modpname";
+ } else {
+ $dir = "$_/auto/$modpname";
+ }
next unless -d $dir; # skip over uninteresting directories
# check for common cases to avoid autoload of dl_findfile
- my $try = "$dir/$modfname.$dl_dlext";
+ my $try = $Is_MacOS ? "$dir:$modfname.$dl_dlext" : "$dir/$modfname.$dl_dlext";
last if $file = ($do_expand) ? dl_expandspec($try) : (-f $try && $try);
# no luck here, save dir for possible later dl_findfile search
last arg unless wantarray;
next;
}
+ elsif ($Is_MacOS) {
+ if (m/:/ && -f $_) {
+ push(@found,$_);
+ last arg unless wantarray;
+ }
+ }
elsif (m:/: && -f $_ && !$do_expand) {
push(@found,$_);
last arg unless wantarray;
# Using a -L prefix is the preferred option (faster and more robust)
if (m:^-L:) { s/^-L//; push(@dirs, $_); next; }
+ if ($Is_MacOS) {
+ # Otherwise we try to try to spot directories by a heuristic
+ # (this is a more complicated issue than it first appears)
+ if (m/:/ && -d $_) { push(@dirs, $_); next; }
+ # Only files should get this far...
+ my(@names, $name); # what filenames to look for
+ s/^-l//;
+ push(@names, $_);
+ foreach $dir (@dirs, @dl_library_path) {
+ next unless -d $dir;
+ $dir =~ s/^([^:]+)$/:$1/;
+ $dir =~ s/:$//;
+ foreach $name (@names) {
+ my($file) = "$dir:$name";
+ print STDERR " checking in $dir for $name\n" if $dl_debug;
+ if (-f $file) {
+ push(@found, $file);
+ next arg; # no need to look any further
+ }
+ }
+ }
+ next;
+ }
+
# Otherwise we try to try to spot directories by a heuristic
# (this is a more complicated issue than it first appears)
if (m:/: && -d $_) { push(@dirs, $_); next; }
SKIP => [qw(dynamic dynamic_lib dynamic_bs)],
XSPROTOARG => '-noprototypes', # XXX remove later?
VERSION_FROM => 'DynaLoader_pm.PL',
- PL_FILES => {'DynaLoader_pm.PL'=>'DynaLoader.pm'},
- PM => {'DynaLoader.pm' => '$(INST_LIBDIR)/DynaLoader.pm'},
+ PL_FILES => {'DynaLoader_pm.PL'=>'DynaLoader.pm',
+ 'XSLoader_pm.PL'=>'XSLoader.pm'},
+ PM => {'DynaLoader.pm' => '$(INST_LIBDIR)/DynaLoader.pm',
+ 'XSLoader.pm' => '$(INST_LIBDIR)/XSLoader.pm'},
clean => {FILES => 'DynaLoader.c DynaLoader.xs DynaLoader.pm'},
);
sub MY::postamble {
'
DynaLoader.xs: $(DLSRC)
+ $(RM_F) $@
$(CP) $? $@
# Perform very simple tests just to check for major gaffs.
--- /dev/null
+use Config;
+
+sub to_string {
+ my ($value) = @_;
+ $value =~ s/\\/\\\\/g;
+ $value =~ s/'/\\'/g;
+ return "'$value'";
+}
+
+unlink "XSLoader.pm" if -f "XSLoader.pm";
+open OUT, ">XSLoader.pm" or die $!;
+print OUT <<'EOT';
+# Generated from XSLoader.pm.PL (resolved %Config::Config value)
+
+package XSLoader;
+
+# And Gandalf said: 'Many folk like to know beforehand what is to
+# be set on the table; but those who have laboured to prepare the
+# feast like to keep their secret; for wonder makes the words of
+# praise louder.'
+
+# (Quote from Tolkien sugested by Anno Siegel.)
+#
+# See pod text at end of file for documentation.
+# See also ext/DynaLoader/README in source tree for other information.
+#
+# Tim.Bunce@ig.co.uk, August 1994
+
+$VERSION = "0.01"; # avoid typo warning
+
+# enable debug/trace messages from DynaLoader perl code
+# $dl_debug = $ENV{PERL_DL_DEBUG} || 0 unless defined $dl_debug;
+
+EOT
+
+print OUT ' my $dl_dlext = ', to_string($Config::Config{'dlext'}), ";\n" ;
+
+print OUT <<'EOT';
+
+# No prizes for guessing why we don't say 'bootstrap DynaLoader;' here.
+package DynaLoader;
+boot_DynaLoader('DynaLoader') if defined(&boot_DynaLoader) &&
+ !defined(&dl_load_file);
+package XSLoader;
+
+1; # End of main code
+
+# The bootstrap function cannot be autoloaded (without complications)
+# so we define it here:
+
+sub load {
+ package DynaLoader;
+
+ my($module) = $_[0];
+
+ # work with static linking too
+ my $b = "$module\::bootstrap";
+ goto &$b if defined &$b;
+
+ goto retry unless $module and defined &dl_load_file;
+
+ my @modparts = split(/::/,$module);
+ my $modfname = $modparts[-1];
+
+EOT
+
+print OUT <<'EOT' if defined &DynaLoader::mod2fname;
+ # Some systems have restrictions on files names for DLL's etc.
+ # mod2fname returns appropriate file base name (typically truncated)
+ # It may also edit @modparts if required.
+ $modfname = &mod2fname(\@modparts) if defined &mod2fname;
+
+EOT
+
+print OUT <<'EOT';
+ my $modpname = join('/',@modparts);
+ my $modlibname = (caller())[1];
+ my $c = @modparts;
+ $modlibname =~ s,[\\/][^\\/]+$,, while $c--; # Q&D basename
+ my $file = "$modlibname/auto/$modpname/$modfname.$dl_dlext";
+
+# print STDERR "XSLoader::load for $module ($file)\n" if $dl_debug;
+
+ my $bs = $file;
+ $bs =~ s/(\.\w+)?(;\d*)?$/\.bs/; # look for .bs 'beside' the library
+
+ goto retry if not -f $file or -s $bs;
+
+ my $bootname = "boot_$module";
+ $bootname =~ s/\W/_/g;
+ @dl_require_symbols = ($bootname);
+
+ # Many dynamic extension loading problems will appear to come from
+ # this section of code: XYZ failed at line 123 of DynaLoader.pm.
+ # Often these errors are actually occurring in the initialisation
+ # C code of the extension XS file. Perl reports the error as being
+ # in this perl code simply because this was the last perl code
+ # it executed.
+
+ my $libref = dl_load_file($file, 0) or do {
+ require Carp;
+ Carp::croak("Can't load '$file' for module $module: " . dl_error());
+ };
+ push(@dl_librefs,$libref); # record loaded object
+
+ my @unresolved = dl_undef_symbols();
+ if (@unresolved) {
+ require Carp;
+ Carp::carp("Undefined symbols present after loading $file: @unresolved\n");
+ }
+
+ my $boot_symbol_ref = dl_find_symbol($libref, $bootname) or do {
+ require Carp;
+ Carp::croak("Can't find '$bootname' symbol in $file\n");
+ };
+
+ my $xs = dl_install_xsub("${module}::bootstrap", $boot_symbol_ref, $file);
+
+ push(@dl_modules, $module); # record loaded module
+
+ # See comment block above
+ return &$xs(@_);
+
+ retry:
+ require DynaLoader;
+ goto &DynaLoader::bootstrap_inherit;
+}
+
+__END__
+
+=head1 NAME
+
+XSLoader - Dynamically load C libraries into Perl code
+
+=head1 SYNOPSIS
+
+ package YourPackage;
+ use XSLoader;
+
+ XSLoader::load 'YourPackage', @args;
+
+=head1 DESCRIPTION
+
+This module defines a standard I<simplified> interface to the dynamic
+linking mechanisms available on many platforms. Its primary purpose is
+to implement cheap automatic dynamic loading of Perl modules.
+
+For more complicated interface see L<DynaLoader>.
+
+=head1 AUTHOR
+
+Ilya Zakharevich: extraction from DynaLoader.
+
+=cut
+EOT
+
+close OUT or die $!;
+
#include <a.out.h>
#include <ldfcn.h>
+/* When using Perl extensions written in C++ the longer versions
+ * of load() and unload() from libC and libC_r need to be used,
+ * otherwise statics in the extensions won't get initialized right.
+ * -- Stephanie Beals <bealzy@us.ibm.com> */
+#ifdef USE_libC /* The define comes, when it comes, from hints/aix.pl. */
+# define LOAD loadAndInit
+# define UNLOAD terminateAndUnload
+# ifdef USE_load_h
+# include <load.h>
+# endif
+#else
+# define LOAD load
+# define UNLOAD unload
+#endif
+
/*
* AIX 4.3 does remove some useful definitions from ldfcn.h. Define
* these here to compensate for that lossage.
* load should be declared load(const char *...). Thus we
* cast the path to a normal char *. Ugly.
*/
- if ((mp->entry = (void *)load((char *)path,
+ if ((mp->entry = (void *)LOAD((char *)path,
#ifdef L_LIBPATH_EXEC
L_LIBPATH_EXEC |
#endif
if (--mp->refCnt > 0)
return 0;
- result = unload(mp->entry);
+ result = UNLOAD(mp->entry);
if (result == -1) {
errvalid++;
strerrorcpy(errbuf, errno);
}
/*
* Traverse the list of loaded modules. The entry point
- * returned by load() does actually point to the data
+ * returned by LOAD() does actually point to the data
* segment origin.
*/
lp = (struct ld_info *)buf;
/* dl_dlopen.xs
*
* Platform: SunOS/Solaris, possibly others which use dlopen.
- * Author: Paul Marquess (pmarquess@bfsec.bt.co.uk)
+ * Author: Paul Marquess (Paul.Marquess@btinternet.com)
* Created: 10th July 1994
*
* Modified:
char * filename
int flags
CODE:
- DLDEBUG(1,PerlIO_printf(PerlIO_stderr(), "dl_load_file(%s,%x):\n", filename,flags));
+ DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_load_file(%s,%x):\n", filename,flags));
if (flags & 0x01)
Perl_warn(aTHX_ "Can't make loaded symbols global on this platform while loading %s",filename);
RETVAL = dlopen(filename, 1) ;
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), " libref=%x\n", RETVAL));
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, " libref=%x\n", RETVAL));
ST(0) = sv_newmortal() ;
if (RETVAL == NULL)
SaveError(aTHX_ "%s",dlerror()) ;
void * libhandle
char * symbolname
CODE:
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "dl_find_symbol(handle=%x, symbol=%s)\n",
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, "dl_find_symbol(handle=%x, symbol=%s)\n",
libhandle, symbolname));
RETVAL = dlsym(libhandle, symbolname);
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), " symbolref = %x\n", RETVAL));
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, " symbolref = %x\n", RETVAL));
ST(0) = sv_newmortal() ;
if (RETVAL == NULL)
SaveError(aTHX_ "%s",dlerror()) ;
void * symref
char * filename
CODE:
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "dl_install_xsub(name=%s, symref=%x)\n",
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, "dl_install_xsub(name=%s, symref=%x)\n",
perl_name, symref));
ST(0) = sv_2mortal(newRV((SV*)newXS(perl_name,
(void(*)(pTHX_ CV *))symref,
strcpy(path, filename);
}
- DLDEBUG(1,PerlIO_printf(PerlIO_stderr(), "dl_load_file(%s,%x):\n", path, flags));
+ DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_load_file(%s,%x):\n", path, flags));
bogo = load_add_on(path);
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), " libref=%lx\n", (unsigned long) RETVAL));
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, " libref=%lx\n", (unsigned long) RETVAL));
ST(0) = sv_newmortal() ;
if (bogo < 0) {
SaveError(aTHX_ "%s", strerror(bogo));
- PerlIO_printf(PerlIO_stderr(), "load_add_on(%s) : %d (%s)\n", path, bogo, strerror(bogo));
+ PerlIO_printf(Perl_debug_log, "load_add_on(%s) : %d (%s)\n", path, bogo, strerror(bogo));
} else {
RETVAL = (void *) bogo;
sv_setiv( ST(0), PTR2IV(RETVAL) );
status_t retcode;
void *adr = 0;
#ifdef DLSYM_NEEDS_UNDERSCORE
- symbolname = form("_%s", symbolname);
+ symbolname = Perl_form_nocontext("_%s", symbolname);
#endif
RETVAL = NULL;
- DLDEBUG(2, PerlIO_printf(PerlIO_stderr(),
+ DLDEBUG(2, PerlIO_printf(Perl_debug_log,
"dl_find_symbol(handle=%lx, symbol=%s)\n",
(unsigned long) libhandle, symbolname));
retcode = get_image_symbol((image_id) libhandle, symbolname,
B_SYMBOL_TYPE_TEXT, (void **) &adr);
RETVAL = adr;
- DLDEBUG(2, PerlIO_printf(PerlIO_stderr(),
+ DLDEBUG(2, PerlIO_printf(Perl_debug_log,
" symbolref = %lx\n", (unsigned long) RETVAL));
ST(0) = sv_newmortal() ;
if (RETVAL == NULL) {
SaveError(aTHX_ "%s", strerror(retcode)) ;
- PerlIO_printf(PerlIO_stderr(), "retcode = %p (%s)\n", retcode, strerror(retcode));
+ PerlIO_printf(Perl_debug_log, "retcode = %p (%s)\n", retcode, strerror(retcode));
} else
sv_setiv( ST(0), PTR2IV(RETVAL));
void * symref
char * filename
CODE:
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "dl_install_xsub(name=%s, symref=%lx)\n",
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, "dl_install_xsub(name=%s, symref=%lx)\n",
perl_name, (unsigned long) symref));
ST(0) = sv_2mortal(newRV((SV*)newXS(perl_name,
(void(*)(pTHX_ CV *))symref,
+++ /dev/null
-/* dl_cygwin.xs
- *
- * Platform: Win32 (Windows NT/Windows 95)
- * Author: Wei-Yuen Tan (wyt@hip.com)
- * Created: A warm day in June, 1995
- *
- * Modified:
- * August 23rd 1995 - rewritten after losing everything when I
- * wiped off my NT partition (eek!)
- */
-/* Modified from the original dl_win32.xs to work with cygwin
- -John Cerney 3/26/97
-*/
-/* Porting notes:
-
-I merely took Paul's dl_dlopen.xs, took out extraneous stuff and
-replaced the appropriate SunOS calls with the corresponding Win32
-calls.
-
-*/
-
-#define WIN32_LEAN_AND_MEAN
-// Defines from windows needed for this function only. Can't include full
-// Cygwin windows headers because of problems with CONTEXT redefinition
-// Removed logic to tell not dynamically load static modules. It is assumed that all
-// modules are dynamically built. This should be similar to the behavoir on sunOS.
-// Leaving in the logic would have required changes to the standard perlmain.c code
-//
-#include <stdio.h>
-
-//#include <windows.h>
-#define LOAD_WITH_ALTERED_SEARCH_PATH (8)
-typedef void *HANDLE;
-typedef HANDLE HINSTANCE;
-#define STDCALL __attribute__ ((stdcall))
-typedef int STDCALL (*FARPROC)();
-#define MAX_PATH 260
-
-HINSTANCE
-STDCALL
-LoadLibraryExA(
- char* lpLibFileName,
- HANDLE hFile,
- unsigned int dwFlags
- );
-unsigned int
-STDCALL
-GetLastError(
- void
- );
-FARPROC
-STDCALL
-GetProcAddress(
- HINSTANCE hModule,
- char* lpProcName
- );
-
-#include <string.h>
-
-#include "EXTERN.h"
-#include "perl.h"
-#include "XSUB.h"
-
-#include "dlutils.c" /* SaveError() etc */
-
-static void
-dl_private_init(pTHX)
-{
- (void)dl_generic_private_init(aTHX);
-}
-
-
-MODULE = DynaLoader PACKAGE = DynaLoader
-
-BOOT:
- (void)dl_private_init(aTHX);
-
-void *
-dl_load_file(filename,flags=0)
- char * filename
- int flags
- PREINIT:
- CODE:
- {
- char win32_path[MAX_PATH];
- cygwin_conv_to_full_win32_path(filename, win32_path);
- filename = win32_path;
-
- DLDEBUG(1,PerlIO_printf(PerlIO_stderr(),"dl_load_file(%s):\n", filename));
-
- RETVAL = (void*) LoadLibraryExA(filename, NULL, LOAD_WITH_ALTERED_SEARCH_PATH ) ;
-
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr()," libref=%x\n", RETVAL));
- ST(0) = sv_newmortal() ;
- if (RETVAL == NULL){
- SaveError(aTHX_ "%d",GetLastError()) ;
- } else {
- sv_setiv( ST(0), PTR2IV(RETVAL) );
- }
- }
-
-
-
-void *
-dl_find_symbol(libhandle, symbolname)
- void * libhandle
- char * symbolname
- CODE:
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(),"dl_find_symbol(handle=%x, symbol=%s)\n",
- libhandle, symbolname));
- RETVAL = (void*) GetProcAddress((HINSTANCE) libhandle, symbolname);
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr()," symbolref = %x\n", RETVAL));
- ST(0) = sv_newmortal() ;
- if (RETVAL == NULL)
- SaveError(aTHX_ "%d",GetLastError()) ;
- else
- sv_setiv( ST(0), PTR2IV(RETVAL));
-
-
-void
-dl_undef_symbols()
- PPCODE:
-
-
-
-# These functions should not need changing on any platform:
-
-void
-dl_install_xsub(perl_name, symref, filename="$Package")
- char * perl_name
- void * symref
- char * filename
- CODE:
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(),"dl_install_xsub(name=%s, symref=%x)\n",
- perl_name, symref));
- ST(0) = sv_2mortal(newRV((SV*)newXS(perl_name,
- (void(*)(pTHX_ CV *))symref,
- filename)));
-
-
-char *
-dl_error()
- CODE:
- RETVAL = LastError ;
- OUTPUT:
- RETVAL
-
-# end.
{
int dlderr;
dl_generic_private_init(aTHX);
- dl_resolve_using = get_av("DynaLoader::dl_resolve_using", 0x4);
- dl_require_symbols = get_av("DynaLoader::dl_require_symbols", 0x4);
+ dl_resolve_using = get_av("DynaLoader::dl_resolve_using", GV_ADDMULTI);
+ dl_require_symbols = get_av("DynaLoader::dl_require_symbols", GV_ADDMULTI);
#ifdef __linux__
dlderr = dld_init("/proc/self/exe");
if (dlderr) {
if (dlderr) {
char *msg = dld_strerror(dlderr);
SaveError(aTHX_ "dld_init(%s) failed: %s", PL_origargv[0], msg);
- DLDEBUG(1,PerlIO_printf(PerlIO_stderr(), "%s", LastError));
+ DLDEBUG(1,PerlIO_printf(Perl_debug_log, "%s", LastError));
}
#ifdef __linux__
}
GV *gv;
CODE:
RETVAL = filename;
- DLDEBUG(1,PerlIO_printf(PerlIO_stderr(), "dl_load_file(%s,%x):\n", filename,flags));
+ DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_load_file(%s,%x):\n", filename,flags));
if (flags & 0x01)
Perl_croak(aTHX_ "Can't make loaded symbols global on this platform while loading %s",filename);
max = AvFILL(dl_require_symbols);
for (x = 0; x <= max; x++) {
char *sym = SvPVX(*av_fetch(dl_require_symbols, x, 0));
- DLDEBUG(1,PerlIO_printf(PerlIO_stderr(), "dld_create_ref(%s)\n", sym));
+ DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dld_create_ref(%s)\n", sym));
if (dlderr = dld_create_reference(sym)) {
SaveError(aTHX_ "dld_create_reference(%s): %s", sym,
dld_strerror(dlderr));
}
}
- DLDEBUG(1,PerlIO_printf(PerlIO_stderr(), "dld_link(%s)\n", filename));
+ DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dld_link(%s)\n", filename));
if (dlderr = dld_link(filename)) {
SaveError(aTHX_ "dld_link(%s): %s", filename, dld_strerror(dlderr));
goto haverror;
max = AvFILL(dl_resolve_using);
for (x = 0; x <= max; x++) {
char *sym = SvPVX(*av_fetch(dl_resolve_using, x, 0));
- DLDEBUG(1,PerlIO_printf(PerlIO_stderr(), "dld_link(%s)\n", sym));
+ DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dld_link(%s)\n", sym));
if (dlderr = dld_link(sym)) {
SaveError(aTHX_ "dld_link(%s): %s", sym, dld_strerror(dlderr));
goto haverror;
}
}
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "libref=%s\n", RETVAL));
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, "libref=%s\n", RETVAL));
haverror:
ST(0) = sv_newmortal() ;
if (dlderr == 0)
void * libhandle
char * symbolname
CODE:
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "dl_find_symbol(handle=%x, symbol=%s)\n",
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, "dl_find_symbol(handle=%x, symbol=%s)\n",
libhandle, symbolname));
RETVAL = (void *)dld_get_func(symbolname);
/* if RETVAL==NULL we should try looking for a non-function symbol */
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), " symbolref = %x\n", RETVAL));
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, " symbolref = %x\n", RETVAL));
ST(0) = sv_newmortal() ;
if (RETVAL == NULL)
SaveError(aTHX_ "dl_find_symbol: Unable to find '%s' symbol", symbolname) ;
void * symref
char * filename
CODE:
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "dl_install_xsub(name=%s, symref=%x)\n",
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, "dl_install_xsub(name=%s, symref=%x)\n",
perl_name, symref));
ST(0) = sv_2mortal(newRV((SV*)newXS(perl_name,
(void(*)(pTHX_ CV *))symref,
/* dl_dlopen.xs
*
* Platform: SunOS/Solaris, possibly others which use dlopen.
- * Author: Paul Marquess (pmarquess@bfsec.bt.co.uk)
+ * Author: Paul Marquess (Paul.Marquess@btinternet.com)
* Created: 10th July 1994
*
* Modified:
dl_load_file(filename, flags=0)
char * filename
int flags
- PREINIT:
+ PREINIT:
int mode = RTLD_LAZY;
- CODE:
+ CODE:
+{
+#if defined(DLOPEN_WONT_DO_RELATIVE_PATHS)
+ char pathbuf[PATH_MAX + 2];
+ if (*filename != '/' && strchr(filename, '/')) {
+ if (getcwd(pathbuf, PATH_MAX - strlen(filename))) {
+ strcat(pathbuf, "/");
+ strcat(pathbuf, filename);
+ filename = pathbuf;
+ }
+ }
+#endif
#ifdef RTLD_NOW
if (dl_nonlazy)
mode = RTLD_NOW;
#else
Perl_warn(aTHX_ "Can't make loaded symbols global on this platform while loading %s",filename);
#endif
- DLDEBUG(1,PerlIO_printf(PerlIO_stderr(), "dl_load_file(%s,%x):\n", filename,flags));
+ DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_load_file(%s,%x):\n", filename,flags));
RETVAL = dlopen(filename, mode) ;
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), " libref=%lx\n", (unsigned long) RETVAL));
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, " libref=%lx\n", (unsigned long) RETVAL));
ST(0) = sv_newmortal() ;
if (RETVAL == NULL)
SaveError(aTHX_ "%s",dlerror()) ;
else
sv_setiv( ST(0), PTR2IV(RETVAL));
-
+}
void *
dl_find_symbol(libhandle, symbolname)
char * symbolname
CODE:
#ifdef DLSYM_NEEDS_UNDERSCORE
- symbolname = form("_%s", symbolname);
+ symbolname = Perl_form_nocontext("_%s", symbolname);
#endif
- DLDEBUG(2, PerlIO_printf(PerlIO_stderr(),
+ DLDEBUG(2, PerlIO_printf(Perl_debug_log,
"dl_find_symbol(handle=%lx, symbol=%s)\n",
(unsigned long) libhandle, symbolname));
RETVAL = dlsym(libhandle, symbolname);
- DLDEBUG(2, PerlIO_printf(PerlIO_stderr(),
+ DLDEBUG(2, PerlIO_printf(Perl_debug_log,
" symbolref = %lx\n", (unsigned long) RETVAL));
ST(0) = sv_newmortal() ;
if (RETVAL == NULL)
void * symref
char * filename
CODE:
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "dl_install_xsub(name=%s, symref=%lx)\n",
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, "dl_install_xsub(name=%s, symref=%lx)\n",
perl_name, (unsigned long) symref));
ST(0) = sv_2mortal(newRV((SV*)newXS(perl_name,
(void(*)(pTHX_ CV *))symref,
dl_private_init(pTHX)
{
(void)dl_generic_private_init(aTHX);
- dl_resolve_using = get_av("DynaLoader::dl_resolve_using", 0x4);
+ dl_resolve_using = get_av("DynaLoader::dl_resolve_using", GV_ADDMULTI);
}
MODULE = DynaLoader PACKAGE = DynaLoader
shl_t obj = NULL;
int i, max, bind_type;
CODE:
- DLDEBUG(1,PerlIO_printf(PerlIO_stderr(), "dl_load_file(%s,%x):\n", filename,flags));
+ DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_load_file(%s,%x):\n", filename,flags));
if (flags & 0x01)
Perl_warn(aTHX_ "Can't make loaded symbols global on this platform while loading %s",filename);
if (dl_nonlazy) {
max = AvFILL(dl_resolve_using);
for (i = 0; i <= max; i++) {
char *sym = SvPVX(*av_fetch(dl_resolve_using, i, 0));
- DLDEBUG(1,PerlIO_printf(PerlIO_stderr(), "dl_load_file(%s) (dependent)\n", sym));
+ DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_load_file(%s) (dependent)\n", sym));
obj = shl_load(sym, bind_type, 0L);
if (obj == NULL) {
goto end;
}
}
- DLDEBUG(1,PerlIO_printf(PerlIO_stderr(), "dl_load_file(%s): ", filename));
+ DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_load_file(%s): ", filename));
obj = shl_load(filename, bind_type, 0L);
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), " libref=%x\n", obj));
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, " libref=%x\n", obj));
end:
ST(0) = sv_newmortal() ;
if (obj == NULL)
void *symaddr = NULL;
int status;
#ifdef __hp9000s300
- symbolname = form("_%s", symbolname);
+ symbolname = Perl_form_nocontext("_%s", symbolname);
#endif
- DLDEBUG(2, PerlIO_printf(PerlIO_stderr(),
+ DLDEBUG(2, PerlIO_printf(Perl_debug_log,
"dl_find_symbol(handle=%lx, symbol=%s)\n",
(unsigned long) libhandle, symbolname));
errno = 0;
status = shl_findsym(&obj, symbolname, TYPE_PROCEDURE, &symaddr);
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), " symbolref(PROCEDURE) = %x\n", symaddr));
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, " symbolref(PROCEDURE) = %x\n", symaddr));
if (status == -1 && errno == 0) { /* try TYPE_DATA instead */
status = shl_findsym(&obj, symbolname, TYPE_DATA, &symaddr);
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), " symbolref(DATA) = %x\n", symaddr));
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, " symbolref(DATA) = %x\n", symaddr));
}
if (status == -1) {
void * symref
char * filename
CODE:
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "dl_install_xsub(name=%s, symref=%x)\n",
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, "dl_install_xsub(name=%s, symref=%x)\n",
perl_name, symref));
ST(0) = sv_2mortal(newRV((SV*)newXS(perl_name,
(void(*)(pTHX_ CV *))symref,
dl_private_init(pTHX)
{
(void)dl_generic_private_init(aTHX);
- dl_resolve_using = get_av("DynaLoader::dl_resolve_using", 0x4);
+ dl_resolve_using = get_av("DynaLoader::dl_resolve_using", GV_ADDMULTI);
}
MODULE = DynaLoader PACKAGE = DynaLoader
p_mpe_dld obj = NULL;
int i;
CODE:
- DLDEBUG(1,PerlIO_printf(PerlIO_stderr(), "dl_load_file(%s,%x):\n", filename,
+ DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_load_file(%s,%x):\n", filename,
flags));
if (flags & 0x01)
Perl_warn(aTHX_ "Can't make loaded symbols global on this platform while loading %s
else
sprintf(obj->filename," %s ",filename);
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr()," libref=%x\n", obj));
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log," libref=%x\n", obj));
ST(0) = sv_newmortal() ;
if (obj == NULL)
char symname[PATH_MAX + 3];
void * symaddr = NULL;
int status;
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(),"dl_find_symbol(handle=%x, symbol=%s)\n",
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log,"dl_find_symbol(handle=%x, symbol=%s)\n",
libhandle, symbolname));
ST(0) = sv_newmortal() ;
errno = 0;
HPGETPROCPLABEL(8, symname, &symaddr, &status, obj->filename, 1,
0, &datalen, 1, 0, 0);
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr()," symbolref(PROCEDURE) = %x, status=%x\n", symaddr, status));
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log," symbolref(PROCEDURE) = %x, status=%x\n", symaddr, status));
if (status != 0) {
SaveError(aTHX_"%s",(errno) ? Strerror(errno) : "Symbol not found") ;
void * symref
char * filename
CODE:
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(),"dl_install_xsub(name=%s, symref=%x)\n",
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log,"dl_install_xsub(name=%s, symref=%x)\n",
perl_name, symref));
ST(0) = sv_2mortal(newRV((SV*)newXS(perl_name,
(void(*)(pTHX_ CV *))symref,
index = number;
if (index > NUM_OFI_ERRORS - 1)
index = NUM_OFI_ERRORS - 1;
- error = form(OFIErrorStrings[index], path, number);
+ error = Perl_form_nocontext(OFIErrorStrings[index], path, number);
break;
default:
- error = form("%s(%d): Totally unknown error type %d\n",
+ error = Perl_form_nocontext("%s(%d): Totally unknown error type %d\n",
path, number, type);
break;
}
NXStream *nxerr = OpenError();
unsigned long symref = 0;
- if (!rld_lookup(nxerr, form("_%s", symbol), &symref))
+ if (!rld_lookup(nxerr, Perl_form_nocontext("_%s", symbol), &symref))
TransferError(nxerr);
CloseError(nxerr);
return (void*) symref;
dl_private_init(pTHX)
{
(void)dl_generic_private_init(aTHX);
- dl_resolve_using = get_av("DynaLoader::dl_resolve_using", 0x4);
+ dl_resolve_using = get_av("DynaLoader::dl_resolve_using", GV_ADDMULTI);
}
MODULE = DynaLoader PACKAGE = DynaLoader
PREINIT:
int mode = 1;
CODE:
- DLDEBUG(1,PerlIO_printf(PerlIO_stderr(), "dl_load_file(%s,%x):\n", filename,flags));
+ DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_load_file(%s,%x):\n", filename,flags));
if (flags & 0x01)
Perl_warn(aTHX_ "Can't make loaded symbols global on this platform while loading %s",filename);
RETVAL = dlopen(filename, mode) ;
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), " libref=%x\n", RETVAL));
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, " libref=%x\n", RETVAL));
ST(0) = sv_newmortal() ;
if (RETVAL == NULL)
SaveError(aTHX_ "%s",dlerror()) ;
char * symbolname
CODE:
#if NS_TARGET_MAJOR >= 4
- symbolname = form("_%s", symbolname);
+ symbolname = Perl_form_nocontext("_%s", symbolname);
#endif
- DLDEBUG(2, PerlIO_printf(PerlIO_stderr(),
+ DLDEBUG(2, PerlIO_printf(Perl_debug_log,
"dl_find_symbol(handle=%lx, symbol=%s)\n",
(unsigned long) libhandle, symbolname));
RETVAL = dlsym(libhandle, symbolname);
- DLDEBUG(2, PerlIO_printf(PerlIO_stderr(),
+ DLDEBUG(2, PerlIO_printf(Perl_debug_log,
" symbolref = %lx\n", (unsigned long) RETVAL));
ST(0) = sv_newmortal() ;
if (RETVAL == NULL)
void * symref
char * filename
CODE:
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "dl_install_xsub(name=%s, symref=%x)\n",
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, "dl_install_xsub(name=%s, symref=%x)\n",
perl_name, symref));
ST(0) = sv_2mortal(newRV((SV*)newXS(perl_name,
(void(*)(pTHX_ CV *))symref,
index = number;
if (index > NUM_OFI_ERRORS - 1)
index = NUM_OFI_ERRORS - 1;
- error = form(OFIErrorStrings[index], path, number);
+ error = Perl_form_nocontext(OFIErrorStrings[index], path, number);
break;
default:
- error = form("%s(%d): Totally unknown error type %d\n",
+ error = Perl_form_nocontext("%s(%d): Totally unknown error type %d\n",
path, number, type);
break;
}
dl_private_init(pTHX)
{
(void)dl_generic_private_init(aTHX);
- dl_resolve_using = get_av("DynaLoader::dl_resolve_using", 0x4);
+ dl_resolve_using = get_av("DynaLoader::dl_resolve_using", GV_ADDMULTI);
}
MODULE = DynaLoader PACKAGE = DynaLoader
PREINIT:
int mode = 1;
CODE:
- DLDEBUG(1,PerlIO_printf(PerlIO_stderr(), "dl_load_file(%s,%x):\n", filename,flags));
+ DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_load_file(%s,%x):\n", filename,flags));
if (flags & 0x01)
Perl_warn(aTHX_ "Can't make loaded symbols global on this platform while loading %s",filename);
RETVAL = dlopen(filename, mode) ;
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), " libref=%x\n", RETVAL));
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, " libref=%x\n", RETVAL));
ST(0) = sv_newmortal() ;
if (RETVAL == NULL)
SaveError(aTHX_ "%s",dlerror()) ;
void * libhandle
char * symbolname
CODE:
- symbolname = form("_%s", symbolname);
- DLDEBUG(2, PerlIO_printf(PerlIO_stderr(),
+ symbolname = Perl_form_nocontext("_%s", symbolname);
+ DLDEBUG(2, PerlIO_printf(Perl_debug_log,
"dl_find_symbol(handle=%lx, symbol=%s)\n",
(unsigned long) libhandle, symbolname));
RETVAL = dlsym(libhandle, symbolname);
- DLDEBUG(2, PerlIO_printf(PerlIO_stderr(),
+ DLDEBUG(2, PerlIO_printf(Perl_debug_log,
" symbolref = %lx\n", (unsigned long) RETVAL));
ST(0) = sv_newmortal() ;
if (RETVAL == NULL)
void * symref
char * filename
CODE:
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "dl_install_xsub(name=%s, symref=%x)\n",
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, "dl_install_xsub(name=%s, symref=%x)\n",
perl_name, symref));
ST(0) = sv_2mortal(newRV((SV*)newXS(perl_name,
(void(*)(pTHX_ CV *))symref,
CODE:
if (flags & 0x01)
Perl_warn(aTHX_ "Can't make loaded symbols global on this platform while loading %s",filename);
- DLDEBUG(1,PerlIO_printf(PerlIO_stderr(), "dl_load_file(%s,%x):\n", filename,flags));
+ DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_load_file(%s,%x):\n", filename,flags));
RETVAL = dlopen(filename) ;
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), " libref=%lx\n", (unsigned long) RETVAL));
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, " libref=%lx\n", (unsigned long) RETVAL));
ST(0) = sv_newmortal() ;
if (RETVAL == NULL)
SaveError(aTHX_ "%s",dlerror()) ;
void * libhandle
char * symbolname
CODE:
- DLDEBUG(2, PerlIO_printf(PerlIO_stderr(),
+ DLDEBUG(2, PerlIO_printf(Perl_debug_log,
"dl_find_symbol(handle=%lx, symbol=%s)\n",
(unsigned long) libhandle, symbolname));
RETVAL = dlsym(libhandle, symbolname);
- DLDEBUG(2, PerlIO_printf(PerlIO_stderr(),
+ DLDEBUG(2, PerlIO_printf(Perl_debug_log,
" symbolref = %lx\n", (unsigned long) RETVAL));
ST(0) = sv_newmortal() ;
if (RETVAL == NULL)
void * symref
char * filename
CODE:
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "dl_install_xsub(name=%s, symref=%lx)\n",
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, "dl_install_xsub(name=%s, symref=%lx)\n",
perl_name, (unsigned long) symref));
ST(0) = sv_2mortal(newRV((SV*)newXS(perl_name,
(void(*)(pTHX_ CV *))symref,
myvec[0] = args = usig[0] > 10 ? 9 : usig[0] - 1;
while (--args) myvec[args] = usig[args];
_ckvmssts(sys$putmsg(myvec,copy_errmsg,0,0));
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "findsym_handler: received\n\t%s\n",LastError));
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, "findsym_handler: received\n\t%s\n",LastError));
return SS$_CONTINUE;
}
dlfab.fab$b_fns = strlen(vmsspec);
dlfab.fab$l_dna = 0;
dlfab.fab$b_dns = 0;
- DLDEBUG(1,PerlIO_printf(PerlIO_stderr(), "dl_expand_filespec(%s):\n",vmsspec));
+ DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_expand_filespec(%s):\n",vmsspec));
/* On the first pass, just parse the specification string */
dlnam.nam$b_nop = NAM$M_SYNCHK;
sts = sys$parse(&dlfab);
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "\tSYNCHK sys$parse = %d\n",sts));
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, "\tSYNCHK sys$parse = %d\n",sts));
if (!(sts & 1)) {
dl_set_error(dlfab.fab$l_sts,dlfab.fab$l_stv);
ST(0) = &PL_sv_undef;
dlnam.nam$b_type + dlnam.nam$b_ver);
deflen += dlnam.nam$b_type + dlnam.nam$b_ver;
memcpy(vmsspec,dlnam.nam$l_name,dlnam.nam$b_name);
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "\tsplit filespec: name = %.*s, default = %.*s\n",
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, "\tsplit filespec: name = %.*s, default = %.*s\n",
dlnam.nam$b_name,vmsspec,deflen,defspec));
/* . . . and go back to expand it */
dlnam.nam$b_nop = 0;
dlfab.fab$b_dns = deflen;
dlfab.fab$b_fns = dlnam.nam$b_name;
sts = sys$parse(&dlfab);
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "\tname/default sys$parse = %d\n",sts));
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, "\tname/default sys$parse = %d\n",sts));
if (!(sts & 1)) {
dl_set_error(dlfab.fab$l_sts,dlfab.fab$l_stv);
ST(0) = &PL_sv_undef;
else {
/* Now find the actual file */
sts = sys$search(&dlfab);
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "\tsys$search = %d\n",sts));
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, "\tsys$search = %d\n",sts));
if (!(sts & 1)) {
dl_set_error(dlfab.fab$l_sts,dlfab.fab$l_stv);
ST(0) = &PL_sv_undef;
}
else {
ST(0) = sv_2mortal(newSVpvn(dlnam.nam$l_rsa,dlnam.nam$b_rsl));
- DLDEBUG(1,PerlIO_printf(PerlIO_stderr(), "\tresult = \\%.*s\\\n",
+ DLDEBUG(1,PerlIO_printf(Perl_debug_log, "\tresult = \\%.*s\\\n",
dlnam.nam$b_rsl,dlnam.nam$l_rsa));
}
}
void (*entry)();
CODE:
- DLDEBUG(1,PerlIO_printf(PerlIO_stderr(), "dl_load_file(%s,%x):\n", filespec,flags));
+ DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_load_file(%s,%x):\n", filespec,flags));
specdsc.dsc$a_pointer = tovmsspec(filespec,vmsspec);
specdsc.dsc$w_length = strlen(specdsc.dsc$a_pointer);
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "\tVMS-ified filespec is %s\n",
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, "\tVMS-ified filespec is %s\n",
specdsc.dsc$a_pointer));
New(1399,dlptr,1,struct libref);
dlptr->name.dsc$b_dtype = dlptr->defspec.dsc$b_dtype = DSC$K_DTYPE_T;
dlptr->name.dsc$b_class = dlptr->defspec.dsc$b_class = DSC$K_CLASS_S;
sts = sys$filescan(&specdsc,namlst,0);
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "\tsys$filescan: returns %d, name is %.*s\n",
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, "\tsys$filescan: returns %d, name is %.*s\n",
sts,namlst[0].len,namlst[0].string));
if (!(sts & 1)) {
failed = 1;
memcpy(dlptr->defspec.dsc$a_pointer + deflen,
namlst[0].string + namlst[0].len,
dlptr->defspec.dsc$w_length - deflen);
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "\tlibref = name: %s, defspec: %.*s\n",
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, "\tlibref = name: %s, defspec: %.*s\n",
dlptr->name.dsc$a_pointer,
dlptr->defspec.dsc$w_length,
dlptr->defspec.dsc$a_pointer));
if (!(reqSVhndl = av_fetch(dl_require_symbols,0,FALSE)) || !(reqSV = *reqSVhndl)) {
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "\t@dl_require_symbols empty, returning untested libref\n"));
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, "\t@dl_require_symbols empty, returning untested libref\n"));
}
else {
symdsc.dsc$w_length = SvCUR(reqSV);
symdsc.dsc$a_pointer = SvPVX(reqSV);
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "\t$dl_require_symbols[0] = %.*s\n",
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, "\t$dl_require_symbols[0] = %.*s\n",
symdsc.dsc$w_length, symdsc.dsc$a_pointer));
sts = my_find_image_symbol(&(dlptr->name),&symdsc,
&entry,&(dlptr->defspec));
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "\tlib$find_image_symbol returns %d\n",sts));
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, "\tlib$find_image_symbol returns %d\n",sts));
if (!(sts&1)) {
failed = 1;
dl_set_error(sts,0);
void (*entry)();
vmssts sts;
- DLDEBUG(1,PerlIO_printf(PerlIO_stderr(), "dl_find_dymbol(%.*s,%.*s):\n",
+ DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_find_dymbol(%.*s,%.*s):\n",
thislib.name.dsc$w_length, thislib.name.dsc$a_pointer,
symdsc.dsc$w_length,symdsc.dsc$a_pointer));
sts = my_find_image_symbol(&(thislib.name),&symdsc,
&entry,&(thislib.defspec));
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "\tlib$find_image_symbol returns %d\n",sts));
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "\tentry point is %d\n",
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, "\tlib$find_image_symbol returns %d\n",sts));
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, "\tentry point is %d\n",
(unsigned long int) entry));
if (!(sts & 1)) {
/* error message already saved by findsym_handler */
void * symref
char * filename
CODE:
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "dl_install_xsub(name=%s, symref=%x)\n",
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, "dl_install_xsub(name=%s, symref=%x)\n",
perl_name, symref));
ST(0) = sv_2mortal(newRV((SV*)newXS(perl_name,
(void(*)(pTHX_ CV *))symref,
{
char *perl_dl_nonlazy;
#ifdef DEBUGGING
- dl_debug = SvIV(get_sv("DynaLoader::dl_debug", 0x04) );
+ SV *sv = get_sv("DynaLoader::dl_debug", 0);
+ dl_debug = sv ? SvIV(sv) : 0;
#endif
if ( (perl_dl_nonlazy = getenv("PERL_DL_NONLAZY")) != NULL )
dl_nonlazy = atoi(perl_dl_nonlazy);
if (dl_nonlazy)
- DLDEBUG(1,PerlIO_printf(PerlIO_stderr(), "DynaLoader bind mode is 'non-lazy'\n"));
+ DLDEBUG(1,PerlIO_printf(Perl_debug_log, "DynaLoader bind mode is 'non-lazy'\n"));
#ifdef DL_LOADONCEONLY
if (!dl_loaded_files)
dl_loaded_files = newHV(); /* provide cache for dl_*.xs if needed */
/* Copy message into LastError (including terminating null char) */
strncpy(LastError, message, len) ;
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "DynaLoader: stored error msg '%s'\n",LastError));
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log, "DynaLoader: stored error msg '%s'\n",LastError));
}
--- /dev/null
+# See dl_aix.xs for details.
+use Config;
+if ($Config{libs} =~ /-lC/ && -f '/lib/libC.a') {
+ $self->{CCFLAGS} = $Config{ccflags} . ' -DUSE_libC';
+ if (-f '/usr/ibmcxx/include/load.h') {
+ $self->{CCFLAGS} .= ' -I/usr/ibmcxx/include -DUSE_load_h';
+ } elsif (-f '/usr/lpp/xlC/include/load.h') {
+ $self->{CCFLAGS} .= ' -I/usr/lpp/xlC/include -DUSE_load_h';
+ }
+}
--- /dev/null
+# XXX Configure test needed?
+# Some OpenBSDs seem to have a dlopen() that won't accept relative paths
+$self->{CCFLAGS} = $Config{ccflags} . ' -DDLOPEN_WONT_DO_RELATIVE_PATHS';
sub process_file {
my($file) = @_;
- return unless defined $file;
+ return unless defined $file and -f $file;
local *FH;
if (($^O eq 'VMS') && ($Config{vms_cc_type} ne 'gnuc')) {
use Config;
use strict;
-\$Config{'myarchname'} eq "$Config{'myarchname'}" or
- die "Errno architecture ($Config{'myarchname'}) does not match executable architecture (\$Config{'myarchname'})";
+"\$Config{'archname'}-\$Config{'osvers'}" eq
+"$Config{'archname'}-$Config{'osvers'}" or
+ die "Errno architecture ($Config{'archname'}-$Config{'osvers'}) does not match executable architecture (\$Config{'archname'}-\$Config{'osvers'})";
\$VERSION = "$VERSION";
\@ISA = qw(Exporter);
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $AUTOLOAD);
require Exporter;
-require DynaLoader;
-@ISA = qw(Exporter DynaLoader);
+use XSLoader ();
+@ISA = qw(Exporter);
$VERSION = "1.03";
# Items to export into callers namespace by default
# (move infrequently used names to @EXPORT_OK below)
O_TEXT
O_TRUNC
O_WRONLY
+ O_ALIAS
+ O_RSRC
SEEK_SET
SEEK_CUR
SEEK_END
goto &$AUTOLOAD;
}
-bootstrap Fcntl $VERSION;
+XSLoader::load 'Fcntl', $VERSION;
1;
#else
goto not_there;
#endif
+ if (strEQ(name, "O_ALIAS"))
+#ifdef O_ALIAS
+ return O_ALIAS;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "O_RSRC"))
+#ifdef O_RSRC
+ return O_RSRC;
+#else
+ goto not_there;
+#endif
} else
goto not_there;
break;
--- /dev/null
+Revision history for Perl extension File::Glob
+
+0.00 Tue Dec 17 10:51:33 1996
+ - original version; created by h2xs 1.16
+
+0.90 Tue Dec 17 13:58:32 MST 1996
+ - implemented first pass access to glob(3),
+ but it's clumsy and it looks like it leaks
+ memory.
+
+0.91 Thu Sep 4 08:43:55 CDT 1997
+ - included CORE/config.h portability macros
+ - s/glob/bsd_glob/ to avoid calling and including the
+ system's glob stuff
+ - added GLOB_DEBUG for (surprise!) glob debugging
+ - tainted all filenames returned from &Glob::BSD::glob
+
+0.92 Tue Sep 30 08:31:57 CDT 1997
+ - only use lstat if HAS_LSTAT is defined
+ - renamed the glob flags to GLOB_*
+ - added GLOB_CSH convenience macro for csh(1) globbing
+ These changes thanks to Hans Mulder <hansm@icgned.nl>
+ - fixed an incompatibility with csh(1) globbing where a
+ pattern like {A*,b,c} wouldn't expand properly
+ - various compatibility changes
+ - fixed and added tests
+
+0.93 Wed Jul 1 10:39:47 CDT 1998
+ - renamed module to File::BSDGlob
+ - enabled 'globally' import directive to override the core
+ glob
+ - added Sarathy's tests for File::DosGlob
+0.99 Tue Oct 12 06:42:02 PDT 1999
+ - renamed module to File::Glob for incorporation into the
+ Perl source distribution
+ - ansified prototypes
+ - s/struct stat/Stat_t/
+ - split on spaces to make <*.c *.h> work (for compatibility)
+0.991 Tue Oct 26 09:48:00 BST 1999
+ - Add case-insensitive matching (GLOB_NOCASE)
+ - Make glob_csh case insensitive by default on Win32, VMS,
+ OS/2, DOS, RISC OS, and Mac OS
+ - Add support for :case and :nocase tags
+ - Hack to make patterns like C:* work on DOSISH systems
+ - Add support for either \ or / as separators on DOSISH systems
+ - Limit effect of \ as a quoting operator on DOSISH systems to
+ when it precedes one of []{}-~\ (to minimise backslashitis).
--- /dev/null
+package File::Glob;
+
+use strict;
+use Carp;
+use vars qw($VERSION @ISA @EXPORT_OK @EXPORT_FAIL
+ %EXPORT_TAGS $AUTOLOAD $DEFAULT_FLAGS);
+
+require Exporter;
+use XSLoader ();
+require AutoLoader;
+
+@ISA = qw(Exporter AutoLoader);
+
+@EXPORT_OK = qw(
+ csh_glob
+ glob
+ GLOB_ABEND
+ GLOB_ALTDIRFUNC
+ GLOB_BRACE
+ GLOB_CSH
+ GLOB_ERR
+ GLOB_ERROR
+ GLOB_MARK
+ GLOB_NOCASE
+ GLOB_NOCHECK
+ GLOB_NOMAGIC
+ GLOB_NOSORT
+ GLOB_NOSPACE
+ GLOB_QUOTE
+ GLOB_TILDE
+);
+
+%EXPORT_TAGS = (
+ 'glob' => [ qw(
+ GLOB_ABEND
+ GLOB_ALTDIRFUNC
+ GLOB_BRACE
+ GLOB_CSH
+ GLOB_ERR
+ GLOB_ERROR
+ GLOB_MARK
+ GLOB_NOCASE
+ GLOB_NOCHECK
+ GLOB_NOMAGIC
+ GLOB_NOSORT
+ GLOB_NOSPACE
+ GLOB_QUOTE
+ GLOB_TILDE
+ glob
+ ) ],
+);
+
+$VERSION = '0.991';
+
+sub import {
+ my $i = 1;
+ while ($i < @_) {
+ if ($_[$i] =~ /^:(case|nocase|globally)$/) {
+ splice(@_, $i, 1);
+ $DEFAULT_FLAGS &= ~GLOB_NOCASE() if $1 eq 'case';
+ $DEFAULT_FLAGS |= GLOB_NOCASE() if $1 eq 'nocase';
+ if ($1 eq 'globally') {
+ local $^W;
+ *CORE::GLOBAL::glob = \&File::Glob::csh_glob;
+ }
+ next;
+ }
+ ++$i;
+ }
+ goto &Exporter::import;
+}
+
+sub AUTOLOAD {
+ # This AUTOLOAD is used to 'autoload' constants from the constant()
+ # XS function. If a constant is not found then control is passed
+ # to the AUTOLOAD in AutoLoader.
+
+ my $constname;
+ ($constname = $AUTOLOAD) =~ s/.*:://;
+ my $val = constant($constname, @_ ? $_[0] : 0);
+ if ($! != 0) {
+ if ($! =~ /Invalid/) {
+ $AutoLoader::AUTOLOAD = $AUTOLOAD;
+ goto &AutoLoader::AUTOLOAD;
+ }
+ else {
+ croak "Your vendor has not defined File::Glob macro $constname";
+ }
+ }
+ eval "sub $AUTOLOAD { $val }";
+ goto &$AUTOLOAD;
+}
+
+XSLoader::load 'File::Glob', $VERSION;
+
+# Preloaded methods go here.
+
+sub GLOB_ERROR {
+ return constant('GLOB_ERROR', 0);
+}
+
+sub GLOB_CSH () { GLOB_BRACE() | GLOB_NOMAGIC() | GLOB_QUOTE() | GLOB_TILDE() }
+
+$DEFAULT_FLAGS = GLOB_CSH();
+if ($^O =~ /^(?:MSWin32|VMS|os2|dos|riscos|MacOS)$/) {
+ $DEFAULT_FLAGS |= GLOB_NOCASE();
+}
+
+# Autoload methods go after =cut, and are processed by the autosplit program.
+
+sub glob {
+ return doglob(@_);
+}
+
+## borrowed heavily from gsar's File::DosGlob
+my %iter;
+my %entries;
+
+sub csh_glob {
+ my $pat = shift;
+ my $cxix = shift;
+ my @pat;
+
+ # glob without args defaults to $_
+ $pat = $_ unless defined $pat;
+
+ # extract patterns
+ if ($pat =~ /\s/) {
+ # XXX this is needed for compatibility with the csh
+ # implementation in Perl. Need to support a flag
+ # to disable this behavior.
+ require Text::ParseWords;
+ @pat = Text::ParseWords::parse_line('\s+',0,$pat);
+ }
+
+ # assume global context if not provided one
+ $cxix = '_G_' unless defined $cxix;
+ $iter{$cxix} = 0 unless exists $iter{$cxix};
+
+ # if we're just beginning, do it all first
+ if ($iter{$cxix} == 0) {
+ if (@pat) {
+ $entries{$cxix} = [ map { doglob($_, $DEFAULT_FLAGS) } @pat ];
+ }
+ else {
+ $entries{$cxix} = [ doglob($pat, $DEFAULT_FLAGS) ];
+ }
+ }
+
+ # chuck it all out, quick or slow
+ if (wantarray) {
+ delete $iter{$cxix};
+ return @{delete $entries{$cxix}};
+ }
+ else {
+ if ($iter{$cxix} = scalar @{$entries{$cxix}}) {
+ return shift @{$entries{$cxix}};
+ }
+ else {
+ # return undef for EOL
+ delete $iter{$cxix};
+ delete $entries{$cxix};
+ return undef;
+ }
+ }
+}
+
+1;
+__END__
+
+=head1 NAME
+
+File::Glob - Perl extension for BSD glob routine
+
+=head1 SYNOPSIS
+
+ use File::Glob ':glob';
+ @list = glob('*.[ch]');
+ $homedir = glob('~gnat', GLOB_TILDE | GLOB_ERR);
+ if (GLOB_ERROR) {
+ # an error occurred reading $homedir
+ }
+
+ ## override the core glob (even with -T)
+ use File::Glob ':globally';
+ my @sources = <*.{c,h,y}>
+
+ ## override the core glob, forcing case sensitivity
+ use File::Glob qw(:globally :case);
+ my @sources = <*.{c,h,y}>
+
+ ## override the core glob forcing case insensitivity
+ use File::Glob qw(:globally :nocase);
+ my @sources = <*.{c,h,y}>
+
+=head1 DESCRIPTION
+
+File::Glob implements the FreeBSD glob(3) routine, which is a superset
+of the POSIX glob() (described in IEEE Std 1003.2 "POSIX.2"). The
+glob() routine takes a mandatory C<pattern> argument, and an optional
+C<flags> argument, and returns a list of filenames matching the
+pattern, with interpretation of the pattern modified by the C<flags>
+variable. The POSIX defined flags are:
+
+=over 4
+
+=item C<GLOB_ERR>
+
+Force glob() to return an error when it encounters a directory it
+cannot open or read. Ordinarily glob() continues to find matches.
+
+=item C<GLOB_MARK>
+
+Each pathname that is a directory that matches the pattern has a slash
+appended.
+
+=item C<GLOB_NOCASE>
+
+By default, file names are assumed to be case sensitive; this flag
+makes glob() treat case differences as not significant.
+
+=item C<GLOB_NOCHECK>
+
+If the pattern does not match any pathname, then glob() returns a list
+consisting of only the pattern. If C<GLOB_QUOTE> is set, its effect
+is present in the pattern returned.
+
+=item C<GLOB_NOSORT>
+
+By default, the pathnames are sorted in ascending ASCII order; this
+flag prevents that sorting (speeding up glob()).
+
+=back
+
+The FreeBSD extensions to the POSIX standard are the following flags:
+
+=over 4
+
+=item C<GLOB_BRACE>
+
+Pre-process the string to expand C<{pat,pat,...} strings like csh(1).
+The pattern '{}' is left unexpanded for historical reasons (and csh(1)
+does the same thing to ease typing of find(1) patterns).
+
+=item C<GLOB_NOMAGIC>
+
+Same as C<GLOB_NOCHECK> but it only returns the pattern if it does not
+contain any of the special characters "*", "?" or "[". C<NOMAGIC> is
+provided to simplify implementing the historic csh(1) globbing
+behaviour and should probably not be used anywhere else.
+
+=item C<GLOB_QUOTE>
+
+Use the backslash ('\') character for quoting: every occurrence of a
+backslash followed by a character in the pattern is replaced by that
+character, avoiding any special interpretation of the character.
+(But see below for exceptions on DOSISH systems).
+
+=item C<GLOB_TILDE>
+
+Expand patterns that start with '~' to user name home directories.
+
+=item C<GLOB_CSH>
+
+For convenience, C<GLOB_CSH> is a synonym for
+C<GLOB_BRACE | GLOB_NOMAGIC | GLOB_QUOTE | GLOB_TILDE>.
+
+=back
+
+The POSIX provided C<GLOB_APPEND>, C<GLOB_DOOFFS>, and the FreeBSD
+extensions C<GLOB_ALTDIRFUNC>, and C<GLOB_MAGCHAR> flags have not been
+implemented in the Perl version because they involve more complex
+interaction with the underlying C structures.
+
+=head1 DIAGNOSTICS
+
+glob() returns a list of matching paths, possibly zero length. If an
+error occurred, &File::Glob::GLOB_ERROR will be non-zero and C<$!> will be
+set. &File::Glob::GLOB_ERROR is guaranteed to be zero if no error occurred,
+or one of the following values otherwise:
+
+=over 4
+
+=item C<GLOB_NOSPACE>
+
+An attempt to allocate memory failed.
+
+=item C<GLOB_ABEND>
+
+The glob was stopped because an error was encountered.
+
+=back
+
+In the case where glob() has found some matching paths, but is
+interrupted by an error, glob() will return a list of filenames B<and>
+set &File::Glob::ERROR.
+
+Note that glob() deviates from POSIX and FreeBSD glob(3) behaviour by
+not considering C<ENOENT> and C<ENOTDIR> as errors - glob() will
+continue processing despite those errors, unless the C<GLOB_ERR> flag is
+set.
+
+Be aware that all filenames returned from File::Glob are tainted.
+
+=head1 NOTES
+
+=over 4
+
+=item *
+
+If you want to use multiple patterns, e.g. C<glob "a* b*">, you should
+probably throw them in a set as in C<glob "{a*,b*}>. This is because
+the argument to glob isn't subjected to parsing by the C shell. Remember
+that you can use a backslash to escape things.
+
+=item *
+
+On DOSISH systems, backslash is a valid directory separator character.
+In this case, use of backslash as a quoting character (via GLOB_QUOTE)
+interferes with the use of backslash as a directory separator. The
+best (simplest, most portable) solution is to use forward slashes for
+directory separators, and backslashes for quoting. However, this does
+not match "normal practice" on these systems. As a concession to user
+expectation, therefore, backslashes (under GLOB_QUOTE) only quote the
+glob metacharacters '[', ']', '{', '}', '-', '~', and backslash itself.
+All other backslashes are passed through unchanged.
+
+=item *
+
+Win32 users should use the real slash. If you really want to use
+backslashes, consider using Sarathy's File::DosGlob, which comes with
+the standard Perl distribution.
+
+=head1 AUTHOR
+
+The Perl interface was written by Nathan Torkington E<lt>gnat@frii.comE<gt>,
+and is released under the artistic license. Further modifications were
+made by Greg Bacon E<lt>gbacon@cs.uah.eduE<gt> and Gurusamy Sarathy
+E<lt>gsar@activestate.comE<gt>. The C glob code has the
+following copyright:
+
+ Copyright (c) 1989, 1993 The Regents of the University of California.
+ All rights reserved.
+
+ This code is derived from software contributed to Berkeley by
+ Guido van Rossum.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the University nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+=cut
--- /dev/null
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+#include "bsd_glob.h"
+
+static int GLOB_ERROR = 0;
+
+static int
+not_here(char *s)
+{
+ croak("%s not implemented on this architecture", s);
+ return -1;
+}
+
+
+static double
+constant(char *name, int arg)
+{
+ errno = 0;
+ if (strlen(name) <= 5)
+ goto not_there;
+ switch (*(name+5)) {
+ case 'A':
+ if (strEQ(name, "GLOB_ABEND"))
+#ifdef GLOB_ABEND
+ return GLOB_ABEND;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "GLOB_ALTDIRFUNC"))
+#ifdef GLOB_ALTDIRFUNC
+ return GLOB_ALTDIRFUNC;
+#else
+ goto not_there;
+#endif
+ break;
+ case 'B':
+ if (strEQ(name, "GLOB_BRACE"))
+#ifdef GLOB_BRACE
+ return GLOB_BRACE;
+#else
+ goto not_there;
+#endif
+ break;
+ case 'C':
+ break;
+ case 'D':
+ break;
+ case 'E':
+ if (strEQ(name, "GLOB_ERR"))
+#ifdef GLOB_ERR
+ return GLOB_ERR;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "GLOB_ERROR"))
+ return GLOB_ERROR;
+ break;
+ case 'F':
+ break;
+ case 'G':
+ break;
+ case 'H':
+ break;
+ case 'I':
+ break;
+ case 'J':
+ break;
+ case 'K':
+ break;
+ case 'L':
+ break;
+ case 'M':
+ if (strEQ(name, "GLOB_MARK"))
+#ifdef GLOB_MARK
+ return GLOB_MARK;
+#else
+ goto not_there;
+#endif
+ break;
+ case 'N':
+ if (strEQ(name, "GLOB_NOCASE"))
+#ifdef GLOB_NOCASE
+ return GLOB_NOCASE;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "GLOB_NOCHECK"))
+#ifdef GLOB_NOCHECK
+ return GLOB_NOCHECK;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "GLOB_NOMAGIC"))
+#ifdef GLOB_NOMAGIC
+ return GLOB_NOMAGIC;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "GLOB_NOSORT"))
+#ifdef GLOB_NOSORT
+ return GLOB_NOSORT;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "GLOB_NOSPACE"))
+#ifdef GLOB_NOSPACE
+ return GLOB_NOSPACE;
+#else
+ goto not_there;
+#endif
+ break;
+ case 'O':
+ break;
+ case 'P':
+ break;
+ case 'Q':
+ if (strEQ(name, "GLOB_QUOTE"))
+#ifdef GLOB_QUOTE
+ return GLOB_QUOTE;
+#else
+ goto not_there;
+#endif
+ break;
+ case 'R':
+ break;
+ case 'S':
+ break;
+ case 'T':
+ if (strEQ(name, "GLOB_TILDE"))
+#ifdef GLOB_TILDE
+ return GLOB_TILDE;
+#else
+ goto not_there;
+#endif
+ break;
+ case 'U':
+ break;
+ case 'V':
+ break;
+ case 'W':
+ break;
+ case 'X':
+ break;
+ case 'Y':
+ break;
+ case 'Z':
+ break;
+ }
+ errno = EINVAL;
+ return 0;
+
+not_there:
+ errno = ENOENT;
+ return 0;
+}
+
+#ifdef WIN32
+#define errfunc NULL
+#else
+int
+errfunc(const char *foo, int bar) {
+ return !(bar == ENOENT || bar == ENOTDIR);
+}
+#endif
+
+MODULE = File::Glob PACKAGE = File::Glob
+
+void
+doglob(pattern,...)
+ char *pattern
+PROTOTYPE:
+PREINIT:
+ glob_t pglob;
+ int i;
+ int retval;
+ int flags = 0;
+ SV *tmp;
+PPCODE:
+ {
+ /* allow for optional flags argument */
+ if (items > 1) {
+ flags = (int) SvIV(ST(1));
+ }
+
+ /* call glob */
+ retval = bsd_glob(pattern, flags, errfunc, &pglob);
+ GLOB_ERROR = retval;
+
+ /* return any matches found */
+ EXTEND(sp, pglob.gl_pathc);
+ for (i = 0; i < pglob.gl_pathc; i++) {
+ /* printf("# bsd_glob: %s\n", pglob.gl_pathv[i]); */
+ tmp = sv_2mortal(newSVpvn(pglob.gl_pathv[i],
+ strlen(pglob.gl_pathv[i])));
+ TAINT;
+ SvTAINT(tmp);
+ PUSHs(tmp);
+ }
+
+ bsd_globfree(&pglob);
+ }
+
+double
+constant(name,arg)
+ char *name
+ int arg
+PROTOTYPE:
--- /dev/null
+use ExtUtils::MakeMaker;
+WriteMakefile(
+ NAME => 'File::Glob',
+ VERSION_FROM => 'Glob.pm',
+ MAN3PODS => {}, # Pods will be built by installman.
+ OBJECT => 'bsd_glob$(OBJ_EXT) Glob$(OBJ_EXT)',
+
+## uncomment for glob debugging (will cause make test to fail)
+# DEFINE => '-DGLOB_DEBUG',
+# OPTIMIZE => '-g',
+);
--- /dev/null
+Some issues left to take care of:
+
+ o sane ~ handling on non-Unix platforms
+
+ Currently on non-Unix, when the glob code encounters a tilde glob
+ (.e.g ~user/foo or ~/.cshrc), it simply returns that pattern
+ without doing any expansion (meaning perl will weed it out since a
+ file of that name isn't likely to exist).
+
+ Please, if you have strong feelings about how tilde expansion
+ should be done on your favorite non-Unix platform(s), submit a
+ patch.
+
+ o path separator handling
+
+ Guido's code contains the assumption that the path separator is one
+ character (byte, probably) in length. Win32 doesn't object to the
+ true slash as a separator. I imagine MacPerl could change the SEP
+ cpp #define to ":". I have no idea what it is for VMS. Again, if
+ you have ideas and especially patches, please feel free to share
+ them.
--- /dev/null
+/*
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Guido van Rossum.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)glob.c 8.3 (Berkeley) 10/13/93";
+#endif /* LIBC_SCCS and not lint */
+
+/*
+ * glob(3) -- a superset of the one defined in POSIX 1003.2.
+ *
+ * The [!...] convention to negate a range is supported (SysV, Posix, ksh).
+ *
+ * Optional extra services, controlled by flags not defined by POSIX:
+ *
+ * GLOB_QUOTE:
+ * Escaping convention: \ inhibits any special meaning the following
+ * character might have (except \ at end of string is retained).
+ * GLOB_MAGCHAR:
+ * Set in gl_flags if pattern contained a globbing character.
+ * GLOB_NOMAGIC:
+ * Same as GLOB_NOCHECK, but it will only append pattern if it did
+ * not contain any magic characters. [Used in csh style globbing]
+ * GLOB_ALTDIRFUNC:
+ * Use alternately specified directory access functions.
+ * GLOB_TILDE:
+ * expand ~user/foo to the /home/dir/of/user/foo
+ * GLOB_BRACE:
+ * expand {1,2}{a,b} to 1a 1b 2a 2b
+ * gl_matchc:
+ * Number of matches in the current invocation of glob.
+ */
+
+#include <EXTERN.h>
+#include <perl.h>
+#include <XSUB.h>
+
+#include "bsd_glob.h"
+#ifdef I_PWD
+# include <pwd.h>
+#else
+#ifdef HAS_PASSWD
+ struct passwd *getpwnam(char *);
+ struct passwd *getpwuid(Uid_t);
+#endif
+#endif
+
+#ifndef MAXPATHLEN
+# ifdef PATH_MAX
+# define MAXPATHLEN PATH_MAX
+# else
+# define MAXPATHLEN 1024
+# endif
+#endif
+
+#define BG_DOLLAR '$'
+#define BG_DOT '.'
+#define BG_EOS '\0'
+#define BG_LBRACKET '['
+#define BG_NOT '!'
+#define BG_QUESTION '?'
+#define BG_QUOTE '\\'
+#define BG_RANGE '-'
+#define BG_RBRACKET ']'
+#define BG_SEP '/'
+#ifdef DOSISH
+#define BG_SEP2 '\\'
+#endif
+#define BG_STAR '*'
+#define BG_TILDE '~'
+#define BG_UNDERSCORE '_'
+#define BG_LBRACE '{'
+#define BG_RBRACE '}'
+#define BG_SLASH '/'
+#define BG_COMMA ','
+
+#ifndef GLOB_DEBUG
+
+#define M_QUOTE 0x8000
+#define M_PROTECT 0x4000
+#define M_MASK 0xffff
+#define M_ASCII 0x00ff
+
+typedef U16 Char;
+
+#else
+
+#define M_QUOTE 0x80
+#define M_PROTECT 0x40
+#define M_MASK 0xff
+#define M_ASCII 0x7f
+
+typedef U8 Char;
+
+#endif /* !GLOB_DEBUG */
+
+
+#define CHAR(c) ((Char)((c)&M_ASCII))
+#define META(c) ((Char)((c)|M_QUOTE))
+#define M_ALL META('*')
+#define M_END META(']')
+#define M_NOT META('!')
+#define M_ONE META('?')
+#define M_RNG META('-')
+#define M_SET META('[')
+#define ismeta(c) (((c)&M_QUOTE) != 0)
+
+
+static int compare(const void *, const void *);
+static int ci_compare(const void *, const void *);
+static void g_Ctoc(const Char *, char *);
+static int g_lstat(Char *, Stat_t *, glob_t *);
+static DIR *g_opendir(Char *, glob_t *);
+static Char *g_strchr(Char *, int);
+#ifdef notdef
+static Char *g_strcat(Char *, const Char *);
+#endif
+static int g_stat(Char *, Stat_t *, glob_t *);
+static int glob0(const Char *, glob_t *);
+static int glob1(Char *, glob_t *);
+static int glob2(Char *, Char *, Char *, glob_t *);
+static int glob3(Char *, Char *, Char *, Char *, glob_t *);
+static int globextend(const Char *, glob_t *);
+static const Char * globtilde(const Char *, Char *, glob_t *);
+static int globexp1(const Char *, glob_t *);
+static int globexp2(const Char *, const Char *, glob_t *, int *);
+static int match(Char *, Char *, Char *, int);
+#ifdef GLOB_DEBUG
+static void qprintf(const char *, Char *);
+#endif /* GLOB_DEBUG */
+
+#ifdef PERL_IMPLICIT_CONTEXT
+static Direntry_t * my_readdir(DIR*);
+
+static Direntry_t *
+my_readdir(DIR *d)
+{
+ return PerlDir_read(d);
+}
+#else
+#define my_readdir readdir
+#endif
+
+int
+bsd_glob(const char *pattern, int flags,
+ int (*errfunc)(const char *, int), glob_t *pglob)
+{
+ const U8 *patnext;
+ int c;
+ Char *bufnext, *bufend, patbuf[MAXPATHLEN+1];
+
+ patnext = (U8 *) pattern;
+ if (!(flags & GLOB_APPEND)) {
+ pglob->gl_pathc = 0;
+ pglob->gl_pathv = NULL;
+ if (!(flags & GLOB_DOOFFS))
+ pglob->gl_offs = 0;
+ }
+ pglob->gl_flags = flags & ~GLOB_MAGCHAR;
+ pglob->gl_errfunc = errfunc;
+ pglob->gl_matchc = 0;
+
+ bufnext = patbuf;
+ bufend = bufnext + MAXPATHLEN;
+#ifdef DOSISH
+ /* Nasty hack to treat patterns like "C:*" correctly. In this
+ * case, the * should match any file in the current directory
+ * on the C: drive. However, the glob code does not treat the
+ * colon specially, so it looks for files beginning "C:" in
+ * the current directory. To fix this, change the pattern to
+ * add an explicit "./" at the start (just after the drive
+ * letter and colon - ie change to "C:./*").
+ */
+ if (isalpha(pattern[0]) && pattern[1] == ':' &&
+ pattern[2] != BG_SEP && pattern[2] != BG_SEP2 &&
+ bufend - bufnext > 4) {
+ *bufnext++ = pattern[0];
+ *bufnext++ = ':';
+ *bufnext++ = '.';
+ *bufnext++ = BG_SEP;
+ patnext += 2;
+ }
+#endif
+ if (flags & GLOB_QUOTE) {
+ /* Protect the quoted characters. */
+ while (bufnext < bufend && (c = *patnext++) != BG_EOS)
+ if (c == BG_QUOTE) {
+#ifdef DOSISH
+ /* To avoid backslashitis on Win32,
+ * we only treat \ as a quoting character
+ * if it precedes one of the
+ * metacharacters []-{}~\
+ */
+ if ((c = *patnext++) != '[' && c != ']' &&
+ c != '-' && c != '{' && c != '}' &&
+ c != '~' && c != '\\') {
+#else
+ if ((c = *patnext++) == BG_EOS) {
+#endif
+ c = BG_QUOTE;
+ --patnext;
+ }
+ *bufnext++ = c | M_PROTECT;
+ }
+ else
+ *bufnext++ = c;
+ }
+ else
+ while (bufnext < bufend && (c = *patnext++) != BG_EOS)
+ *bufnext++ = c;
+ *bufnext = BG_EOS;
+
+ if (flags & GLOB_BRACE)
+ return globexp1(patbuf, pglob);
+ else
+ return glob0(patbuf, pglob);
+}
+
+/*
+ * Expand recursively a glob {} pattern. When there is no more expansion
+ * invoke the standard globbing routine to glob the rest of the magic
+ * characters
+ */
+static int globexp1(const Char *pattern, glob_t *pglob)
+{
+ const Char* ptr = pattern;
+ int rv;
+
+ /* Protect a single {}, for find(1), like csh */
+ if (pattern[0] == BG_LBRACE && pattern[1] == BG_RBRACE && pattern[2] == BG_EOS)
+ return glob0(pattern, pglob);
+
+ while ((ptr = (const Char *) g_strchr((Char *) ptr, BG_LBRACE)) != NULL)
+ if (!globexp2(ptr, pattern, pglob, &rv))
+ return rv;
+
+ return glob0(pattern, pglob);
+}
+
+
+/*
+ * Recursive brace globbing helper. Tries to expand a single brace.
+ * If it succeeds then it invokes globexp1 with the new pattern.
+ * If it fails then it tries to glob the rest of the pattern and returns.
+ */
+static int globexp2(const Char *ptr, const Char *pattern,
+ glob_t *pglob, int *rv)
+{
+ int i;
+ Char *lm, *ls;
+ const Char *pe, *pm, *pl;
+ Char patbuf[MAXPATHLEN + 1];
+
+ /* copy part up to the brace */
+ for (lm = patbuf, pm = pattern; pm != ptr; *lm++ = *pm++)
+ continue;
+ ls = lm;
+
+ /* Find the balanced brace */
+ for (i = 0, pe = ++ptr; *pe; pe++)
+ if (*pe == BG_LBRACKET) {
+ /* Ignore everything between [] */
+ for (pm = pe++; *pe != BG_RBRACKET && *pe != BG_EOS; pe++)
+ continue;
+ if (*pe == BG_EOS) {
+ /*
+ * We could not find a matching BG_RBRACKET.
+ * Ignore and just look for BG_RBRACE
+ */
+ pe = pm;
+ }
+ }
+ else if (*pe == BG_LBRACE)
+ i++;
+ else if (*pe == BG_RBRACE) {
+ if (i == 0)
+ break;
+ i--;
+ }
+
+ /* Non matching braces; just glob the pattern */
+ if (i != 0 || *pe == BG_EOS) {
+ *rv = glob0(patbuf, pglob);
+ return 0;
+ }
+
+ for (i = 0, pl = pm = ptr; pm <= pe; pm++)
+ switch (*pm) {
+ case BG_LBRACKET:
+ /* Ignore everything between [] */
+ for (pl = pm++; *pm != BG_RBRACKET && *pm != BG_EOS; pm++)
+ continue;
+ if (*pm == BG_EOS) {
+ /*
+ * We could not find a matching BG_RBRACKET.
+ * Ignore and just look for BG_RBRACE
+ */
+ pm = pl;
+ }
+ break;
+
+ case BG_LBRACE:
+ i++;
+ break;
+
+ case BG_RBRACE:
+ if (i) {
+ i--;
+ break;
+ }
+ /* FALLTHROUGH */
+ case BG_COMMA:
+ if (i && *pm == BG_COMMA)
+ break;
+ else {
+ /* Append the current string */
+ for (lm = ls; (pl < pm); *lm++ = *pl++)
+ continue;
+ /*
+ * Append the rest of the pattern after the
+ * closing brace
+ */
+ for (pl = pe + 1; (*lm++ = *pl++) != BG_EOS;)
+ continue;
+
+ /* Expand the current pattern */
+#ifdef GLOB_DEBUG
+ qprintf("globexp2:", patbuf);
+#endif /* GLOB_DEBUG */
+ *rv = globexp1(patbuf, pglob);
+
+ /* move after the comma, to the next string */
+ pl = pm + 1;
+ }
+ break;
+
+ default:
+ break;
+ }
+ *rv = 0;
+ return 0;
+}
+
+
+
+/*
+ * expand tilde from the passwd file.
+ */
+static const Char *
+globtilde(const Char *pattern, Char *patbuf, glob_t *pglob)
+{
+ struct passwd *pwd;
+ char *h;
+ const Char *p;
+ Char *b;
+
+ if (*pattern != BG_TILDE || !(pglob->gl_flags & GLOB_TILDE))
+ return pattern;
+
+ /* Copy up to the end of the string or / */
+ for (p = pattern + 1, h = (char *) patbuf; *p && *p != BG_SLASH;
+ *h++ = *p++)
+ continue;
+
+ *h = BG_EOS;
+
+ if (((char *) patbuf)[0] == BG_EOS) {
+ /*
+ * handle a plain ~ or ~/ by expanding $HOME
+ * first and then trying the password file
+ */
+ if ((h = getenv("HOME")) == NULL) {
+#ifdef HAS_PASSWD
+ if ((pwd = getpwuid(getuid())) == NULL)
+ return pattern;
+ else
+ h = pwd->pw_dir;
+#else
+ return pattern;
+#endif
+ }
+ }
+ else {
+ /*
+ * Expand a ~user
+ */
+#ifdef HAS_PASSWD
+ if ((pwd = getpwnam((char*) patbuf)) == NULL)
+ return pattern;
+ else
+ h = pwd->pw_dir;
+#else
+ return pattern;
+#endif
+ }
+
+ /* Copy the home directory */
+ for (b = patbuf; *h; *b++ = *h++)
+ continue;
+
+ /* Append the rest of the pattern */
+ while ((*b++ = *p++) != BG_EOS)
+ continue;
+
+ return patbuf;
+}
+
+
+/*
+ * The main glob() routine: compiles the pattern (optionally processing
+ * quotes), calls glob1() to do the real pattern matching, and finally
+ * sorts the list (unless unsorted operation is requested). Returns 0
+ * if things went well, nonzero if errors occurred. It is not an error
+ * to find no matches.
+ */
+static int
+glob0(const Char *pattern, glob_t *pglob)
+{
+ const Char *qpat, *qpatnext;
+ int c, err, oldflags, oldpathc;
+ Char *bufnext, patbuf[MAXPATHLEN+1];
+
+ qpat = globtilde(pattern, patbuf, pglob);
+ qpatnext = qpat;
+ oldflags = pglob->gl_flags;
+ oldpathc = pglob->gl_pathc;
+ bufnext = patbuf;
+
+ /* We don't need to check for buffer overflow any more. */
+ while ((c = *qpatnext++) != BG_EOS) {
+ switch (c) {
+ case BG_LBRACKET:
+ c = *qpatnext;
+ if (c == BG_NOT)
+ ++qpatnext;
+ if (*qpatnext == BG_EOS ||
+ g_strchr((Char *) qpatnext+1, BG_RBRACKET) == NULL) {
+ *bufnext++ = BG_LBRACKET;
+ if (c == BG_NOT)
+ --qpatnext;
+ break;
+ }
+ *bufnext++ = M_SET;
+ if (c == BG_NOT)
+ *bufnext++ = M_NOT;
+ c = *qpatnext++;
+ do {
+ *bufnext++ = CHAR(c);
+ if (*qpatnext == BG_RANGE &&
+ (c = qpatnext[1]) != BG_RBRACKET) {
+ *bufnext++ = M_RNG;
+ *bufnext++ = CHAR(c);
+ qpatnext += 2;
+ }
+ } while ((c = *qpatnext++) != BG_RBRACKET);
+ pglob->gl_flags |= GLOB_MAGCHAR;
+ *bufnext++ = M_END;
+ break;
+ case BG_QUESTION:
+ pglob->gl_flags |= GLOB_MAGCHAR;
+ *bufnext++ = M_ONE;
+ break;
+ case BG_STAR:
+ pglob->gl_flags |= GLOB_MAGCHAR;
+ /* collapse adjacent stars to one,
+ * to avoid exponential behavior
+ */
+ if (bufnext == patbuf || bufnext[-1] != M_ALL)
+ *bufnext++ = M_ALL;
+ break;
+ default:
+ *bufnext++ = CHAR(c);
+ break;
+ }
+ }
+ *bufnext = BG_EOS;
+#ifdef GLOB_DEBUG
+ qprintf("glob0:", patbuf);
+#endif /* GLOB_DEBUG */
+
+ if ((err = glob1(patbuf, pglob)) != 0) {
+ pglob->gl_flags = oldflags;
+ return(err);
+ }
+
+ /*
+ * If there was no match we are going to append the pattern
+ * if GLOB_NOCHECK was specified or if GLOB_NOMAGIC was specified
+ * and the pattern did not contain any magic characters
+ * GLOB_NOMAGIC is there just for compatibility with csh.
+ */
+ if (pglob->gl_pathc == oldpathc &&
+ ((pglob->gl_flags & GLOB_NOCHECK) ||
+ ((pglob->gl_flags & GLOB_NOMAGIC) &&
+ !(pglob->gl_flags & GLOB_MAGCHAR))))
+ {
+#ifdef GLOB_DEBUG
+ printf("calling globextend from glob0\n");
+#endif /* GLOB_DEBUG */
+ pglob->gl_flags = oldflags;
+ return(globextend(qpat, pglob));
+ }
+ else if (!(pglob->gl_flags & GLOB_NOSORT))
+ qsort(pglob->gl_pathv + pglob->gl_offs + oldpathc,
+ pglob->gl_pathc - oldpathc, sizeof(char *),
+ (pglob->gl_flags & GLOB_NOCASE) ? ci_compare : compare);
+ pglob->gl_flags = oldflags;
+ return(0);
+}
+
+static int
+ci_compare(const void *p, const void *q)
+{
+ const char *pp = *(const char **)p;
+ const char *qq = *(const char **)q;
+ while (*pp && *qq) {
+ if (tolower(*pp) != tolower(*qq))
+ break;
+ ++pp;
+ ++qq;
+ }
+ return (tolower(*pp) - tolower(*qq));
+}
+
+static int
+compare(const void *p, const void *q)
+{
+ return(strcmp(*(char **)p, *(char **)q));
+}
+
+static int
+glob1(Char *pattern, glob_t *pglob)
+{
+ Char pathbuf[MAXPATHLEN+1];
+
+ /* A null pathname is invalid -- POSIX 1003.1 sect. 2.4. */
+ if (*pattern == BG_EOS)
+ return(0);
+ return(glob2(pathbuf, pathbuf, pattern, pglob));
+}
+
+/*
+ * The functions glob2 and glob3 are mutually recursive; there is one level
+ * of recursion for each segment in the pattern that contains one or more
+ * meta characters.
+ */
+static int
+glob2(Char *pathbuf, Char *pathend, Char *pattern, glob_t *pglob)
+{
+ Stat_t sb;
+ Char *p, *q;
+ int anymeta;
+
+ /*
+ * Loop over pattern segments until end of pattern or until
+ * segment with meta character found.
+ */
+ for (anymeta = 0;;) {
+ if (*pattern == BG_EOS) { /* End of pattern? */
+ *pathend = BG_EOS;
+
+ if (g_lstat(pathbuf, &sb, pglob))
+ return(0);
+
+ if (((pglob->gl_flags & GLOB_MARK) &&
+ pathend[-1] != BG_SEP
+#ifdef DOSISH
+ && pathend[-1] != BG_SEP2
+#endif
+ ) && (S_ISDIR(sb.st_mode)
+ || (S_ISLNK(sb.st_mode) &&
+ (g_stat(pathbuf, &sb, pglob) == 0) &&
+ S_ISDIR(sb.st_mode)))) {
+ *pathend++ = BG_SEP;
+ *pathend = BG_EOS;
+ }
+ ++pglob->gl_matchc;
+#ifdef GLOB_DEBUG
+ printf("calling globextend from glob2\n");
+#endif /* GLOB_DEBUG */
+ return(globextend(pathbuf, pglob));
+ }
+
+ /* Find end of next segment, copy tentatively to pathend. */
+ q = pathend;
+ p = pattern;
+ while (*p != BG_EOS && *p != BG_SEP
+#ifdef DOSISH
+ && *p != BG_SEP2
+#endif
+ ) {
+ if (ismeta(*p))
+ anymeta = 1;
+ *q++ = *p++;
+ }
+
+ if (!anymeta) { /* No expansion, do next segment. */
+ pathend = q;
+ pattern = p;
+ while (*pattern == BG_SEP
+#ifdef DOSISH
+ || *pattern == BG_SEP2
+#endif
+ )
+ *pathend++ = *pattern++;
+ } else /* Need expansion, recurse. */
+ return(glob3(pathbuf, pathend, pattern, p, pglob));
+ }
+ /* NOTREACHED */
+}
+
+static int
+glob3(Char *pathbuf, Char *pathend, Char *pattern,
+ Char *restpattern, glob_t *pglob)
+{
+ register Direntry_t *dp;
+ DIR *dirp;
+ int err;
+ int nocase;
+ char buf[MAXPATHLEN];
+
+ /*
+ * The readdirfunc declaration can't be prototyped, because it is
+ * assigned, below, to two functions which are prototyped in glob.h
+ * and dirent.h as taking pointers to differently typed opaque
+ * structures.
+ */
+ Direntry_t *(*readdirfunc)();
+
+ *pathend = BG_EOS;
+ errno = 0;
+
+ if ((dirp = g_opendir(pathbuf, pglob)) == NULL) {
+ /* TODO: don't call for ENOENT or ENOTDIR? */
+ if (pglob->gl_errfunc) {
+ g_Ctoc(pathbuf, buf);
+ if (pglob->gl_errfunc(buf, errno) ||
+ (pglob->gl_flags & GLOB_ERR))
+ return (GLOB_ABEND);
+ }
+ return(0);
+ }
+
+ err = 0;
+ nocase = ((pglob->gl_flags & GLOB_NOCASE) != 0);
+
+ /* Search directory for matching names. */
+ if (pglob->gl_flags & GLOB_ALTDIRFUNC)
+ readdirfunc = pglob->gl_readdir;
+ else
+ readdirfunc = my_readdir;
+ while ((dp = (*readdirfunc)(dirp))) {
+ register U8 *sc;
+ register Char *dc;
+
+ /* Initial BG_DOT must be matched literally. */
+ if (dp->d_name[0] == BG_DOT && *pattern != BG_DOT)
+ continue;
+ for (sc = (U8 *) dp->d_name, dc = pathend;
+ (*dc++ = *sc++) != BG_EOS;)
+ continue;
+ if (!match(pathend, pattern, restpattern, nocase)) {
+ *pathend = BG_EOS;
+ continue;
+ }
+ err = glob2(pathbuf, --dc, restpattern, pglob);
+ if (err)
+ break;
+ }
+
+ if (pglob->gl_flags & GLOB_ALTDIRFUNC)
+ (*pglob->gl_closedir)(dirp);
+ else
+ PerlDir_close(dirp);
+ return(err);
+}
+
+
+/*
+ * Extend the gl_pathv member of a glob_t structure to accomodate a new item,
+ * add the new item, and update gl_pathc.
+ *
+ * This assumes the BSD realloc, which only copies the block when its size
+ * crosses a power-of-two boundary; for v7 realloc, this would cause quadratic
+ * behavior.
+ *
+ * Return 0 if new item added, error code if memory couldn't be allocated.
+ *
+ * Invariant of the glob_t structure:
+ * Either gl_pathc is zero and gl_pathv is NULL; or gl_pathc > 0 and
+ * gl_pathv points to (gl_offs + gl_pathc + 1) items.
+ */
+static int
+globextend(const Char *path, glob_t *pglob)
+{
+ register char **pathv;
+ register int i;
+ char *copy;
+ const Char *p;
+
+#ifdef GLOB_DEBUG
+ printf("Adding ");
+ for (p = path; *p; p++)
+ (void)printf("%c", CHAR(*p));
+ printf("\n");
+#endif /* GLOB_DEBUG */
+
+ if (pglob->gl_pathv)
+ pathv = Renew(pglob->gl_pathv,
+ (2 + pglob->gl_pathc + pglob->gl_offs),char*);
+ else
+ New(0,pathv,(2 + pglob->gl_pathc + pglob->gl_offs),char*);
+ if (pathv == NULL)
+ return(GLOB_NOSPACE);
+
+ if (pglob->gl_pathv == NULL && pglob->gl_offs > 0) {
+ /* first time around -- clear initial gl_offs items */
+ pathv += pglob->gl_offs;
+ for (i = pglob->gl_offs; --i >= 0; )
+ *--pathv = NULL;
+ }
+ pglob->gl_pathv = pathv;
+
+ for (p = path; *p++;)
+ continue;
+ New(0, copy, p-path, char);
+ if (copy != NULL) {
+ g_Ctoc(path, copy);
+ pathv[pglob->gl_offs + pglob->gl_pathc++] = copy;
+ }
+ pathv[pglob->gl_offs + pglob->gl_pathc] = NULL;
+ return(copy == NULL ? GLOB_NOSPACE : 0);
+}
+
+
+/*
+ * pattern matching function for filenames. Each occurrence of the *
+ * pattern causes a recursion level.
+ */
+static int
+match(register Char *name, register Char *pat, register Char *patend, int nocase)
+{
+ int ok, negate_range;
+ Char c, k;
+
+ while (pat < patend) {
+ c = *pat++;
+ switch (c & M_MASK) {
+ case M_ALL:
+ if (pat == patend)
+ return(1);
+ do
+ if (match(name, pat, patend, nocase))
+ return(1);
+ while (*name++ != BG_EOS);
+ return(0);
+ case M_ONE:
+ if (*name++ == BG_EOS)
+ return(0);
+ break;
+ case M_SET:
+ ok = 0;
+ if ((k = *name++) == BG_EOS)
+ return(0);
+ if ((negate_range = ((*pat & M_MASK) == M_NOT)) != BG_EOS)
+ ++pat;
+ while (((c = *pat++) & M_MASK) != M_END)
+ if ((*pat & M_MASK) == M_RNG) {
+ if (nocase) {
+ if (tolower(c) <= tolower(k) && tolower(k) <= tolower(pat[1]))
+ ok = 1;
+ } else {
+ if (c <= k && k <= pat[1])
+ ok = 1;
+ }
+ pat += 2;
+ } else if (nocase ? (tolower(c) == tolower(k)) : (c == k))
+ ok = 1;
+ if (ok == negate_range)
+ return(0);
+ break;
+ default:
+ k = *name++;
+ if (nocase ? (tolower(k) != tolower(c)) : (k != c))
+ return(0);
+ break;
+ }
+ }
+ return(*name == BG_EOS);
+}
+
+/* Free allocated data belonging to a glob_t structure. */
+void
+bsd_globfree(glob_t *pglob)
+{
+ register int i;
+ register char **pp;
+
+ if (pglob->gl_pathv != NULL) {
+ pp = pglob->gl_pathv + pglob->gl_offs;
+ for (i = pglob->gl_pathc; i--; ++pp)
+ if (*pp)
+ Safefree(*pp);
+ Safefree(pglob->gl_pathv);
+ }
+}
+
+static DIR *
+g_opendir(register Char *str, glob_t *pglob)
+{
+ char buf[MAXPATHLEN];
+
+ if (!*str)
+ strcpy(buf, ".");
+ else
+ g_Ctoc(str, buf);
+
+ if (pglob->gl_flags & GLOB_ALTDIRFUNC)
+ return((*pglob->gl_opendir)(buf));
+ else
+ return(PerlDir_open(buf));
+}
+
+static int
+g_lstat(register Char *fn, Stat_t *sb, glob_t *pglob)
+{
+ char buf[MAXPATHLEN];
+
+ g_Ctoc(fn, buf);
+ if (pglob->gl_flags & GLOB_ALTDIRFUNC)
+ return((*pglob->gl_lstat)(buf, sb));
+#ifdef HAS_LSTAT
+ return(PerlLIO_lstat(buf, sb));
+#else
+ return(PerlLIO_stat(buf, sb));
+#endif /* HAS_LSTAT */
+}
+
+static int
+g_stat(register Char *fn, Stat_t *sb, glob_t *pglob)
+{
+ char buf[MAXPATHLEN];
+
+ g_Ctoc(fn, buf);
+ if (pglob->gl_flags & GLOB_ALTDIRFUNC)
+ return((*pglob->gl_stat)(buf, sb));
+ return(PerlLIO_stat(buf, sb));
+}
+
+static Char *
+g_strchr(Char *str, int ch)
+{
+ do {
+ if (*str == ch)
+ return (str);
+ } while (*str++);
+ return (NULL);
+}
+
+#ifdef notdef
+static Char *
+g_strcat(Char *dst, const Char *src)
+{
+ Char *sdst = dst;
+
+ while (*dst++)
+ continue;
+ --dst;
+ while((*dst++ = *src++) != BG_EOS)
+ continue;
+
+ return (sdst);
+}
+#endif
+
+static void
+g_Ctoc(register const Char *str, char *buf)
+{
+ register char *dc;
+
+ for (dc = buf; (*dc++ = *str++) != BG_EOS;)
+ continue;
+}
+
+#ifdef GLOB_DEBUG
+static void
+qprintf(const char *str, register Char *s)
+{
+ register Char *p;
+
+ (void)printf("%s:\n", str);
+ for (p = s; *p; p++)
+ (void)printf("%c", CHAR(*p));
+ (void)printf("\n");
+ for (p = s; *p; p++)
+ (void)printf("%c", *p & M_PROTECT ? '"' : ' ');
+ (void)printf("\n");
+ for (p = s; *p; p++)
+ (void)printf("%c", ismeta(*p) ? '_' : ' ');
+ (void)printf("\n");
+}
+#endif /* GLOB_DEBUG */
--- /dev/null
+/*
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Guido van Rossum.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)glob.h 8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _BSD_GLOB_H_
+#define _BSD_GLOB_H_
+
+/* #include <sys/cdefs.h> */
+
+typedef struct {
+ int gl_pathc; /* Count of total paths so far. */
+ int gl_matchc; /* Count of paths matching pattern. */
+ int gl_offs; /* Reserved at beginning of gl_pathv. */
+ int gl_flags; /* Copy of flags parameter to glob. */
+ char **gl_pathv; /* List of paths matching pattern. */
+ /* Copy of errfunc parameter to glob. */
+ int (*gl_errfunc)(const char *, int);
+
+ /*
+ * Alternate filesystem access methods for glob; replacement
+ * versions of closedir(3), readdir(3), opendir(3), stat(2)
+ * and lstat(2).
+ */
+ void (*gl_closedir)(void *);
+ Direntry_t *(*gl_readdir)(void *);
+ void *(*gl_opendir)(const char *);
+ int (*gl_lstat)(const char *, Stat_t *);
+ int (*gl_stat)(const char *, Stat_t *);
+} glob_t;
+
+#define GLOB_APPEND 0x0001 /* Append to output from previous call. */
+#define GLOB_DOOFFS 0x0002 /* Use gl_offs. */
+#define GLOB_ERR 0x0004 /* Return on error. */
+#define GLOB_MARK 0x0008 /* Append / to matching directories. */
+#define GLOB_NOCHECK 0x0010 /* Return pattern itself if nothing matches. */
+#define GLOB_NOSORT 0x0020 /* Don't sort. */
+
+#define GLOB_ALTDIRFUNC 0x0040 /* Use alternately specified directory funcs. */
+#define GLOB_BRACE 0x0080 /* Expand braces ala csh. */
+#define GLOB_MAGCHAR 0x0100 /* Pattern had globbing characters. */
+#define GLOB_NOMAGIC 0x0200 /* GLOB_NOCHECK without magic chars (csh). */
+#define GLOB_QUOTE 0x0400 /* Quote special chars with \. */
+#define GLOB_TILDE 0x0800 /* Expand tilde names from the passwd file. */
+#define GLOB_NOCASE 0x1000 /* Treat filenames without regard for case. */
+
+#define GLOB_NOSPACE (-1) /* Malloc call failed. */
+#define GLOB_ABEND (-2) /* Unignored error. */
+
+int bsd_glob(const char *, int, int (*)(const char *, int), glob_t *);
+void bsd_globfree(glob_t *);
+
+#endif /* !_BSD_GLOB_H_ */
require Tie::Hash;
require Exporter;
use AutoLoader;
-require DynaLoader;
-@ISA = qw(Tie::Hash Exporter DynaLoader);
+use XSLoader ();
+@ISA = qw(Tie::Hash Exporter);
@EXPORT = qw(
GDBM_CACHESIZE
GDBM_FAST
goto &$AUTOLOAD;
}
-bootstrap GDBM_File $VERSION;
+XSLoader::load 'GDBM_File', $VERSION;
# Preloaded methods go here. Autoload methods go after __END__, and are
# processed by the autosplit program.
package IO;
-require DynaLoader;
-require Exporter;
+use XSLoader ();
use Carp;
-use vars qw(@ISA $VERSION @EXPORT);
-
-@ISA = qw(DynaLoader);
$VERSION = "1.20";
-bootstrap IO $VERSION;
+XSLoader::load 'IO', $VERSION;
sub import {
shift;
int type
int size
CODE:
-/* Should check HAS_SETVBUF once Configure tests for that */
-#if defined(PERLIO_IS_STDIO) && defined(_IOFBF)
+#if defined(PERLIO_IS_STDIO) && defined(_IOFBF) && defined(HAS_SETVBUF)
if (!handle) /* Try input stream. */
handle = IoIFP(sv_2io(ST(0)));
if (handle)
sub exists
{
my $vec = shift;
- $vec->[$vec->_fileno(shift) + FIRST_FD];
+ my $fno = $vec->_fileno(shift);
+ return undef unless defined $fno;
+ $vec->[$fno + FIRST_FD];
}
# legacy
require IO::Socket::INET;
-require IO::Socket::UNIX;
+require IO::Socket::UNIX if ($^O ne 'epoc');
@ISA = qw(IO::Handle);
}
$peer = accept($new,$sock) || undef;
};
+ croak "$@" if $@ and $sock;
return wantarray ? defined $peer ? ($new, $peer)
: ()
--- /dev/null
+# SysV IPC is an optional Cygwin package
+$self->{LIBS} = ['-lcygipc']
use vars qw($VERSION @ISA);
require Tie::Hash;
-require DynaLoader;
+use DynaLoader ();
-@ISA = qw(Tie::Hash DynaLoader);
+@ISA = qw(Tie::Hash);
$VERSION = "1.03";
-bootstrap NDBM_File $VERSION;
+XSLoader::load 'NDBM_File', $VERSION;
1;
--- /dev/null
+# uses GDBM ndbm compatibility feature
+$self->{LIBS} = ['-lgdbm'];
--- /dev/null
+# SCO ODT 3.2v4.2 has a -ldbm library that is missing dbmclose.
+# This system should have a complete library installed as -ldbm.nfs which
+# should be used instead (Probably need the networking product add-on)
+$self->{LIBS} = ['-lndbm',-e "/usr/lib/libdbm.nfs.a"?'-ldbm.nfs':'-ldbm'];
use vars qw($VERSION @ISA);
require Tie::Hash;
-require DynaLoader;
+use DynaLoader ();
-@ISA = qw(Tie::Hash DynaLoader);
+@ISA = qw(Tie::Hash);
$VERSION = "1.02";
-bootstrap ODBM_File $VERSION;
+XSLoader::load 'ODBM_File', $VERSION;
1;
--- /dev/null
+# uses GDBM dbm compatibility feature
+$self->{LIBS} = ['-lgdbm'];
-# Some versions of SCO contain a broken -ldbm library that is missing
-# dbmclose. Some of those might have a fixed library installed as
-# -ldbm.nfs.
-$self->{LIBS} = ['-ldbm.nfs', '-ldbm'];
+# SCO ODT 3.2v4.2 has a -ldbm library that is missing dbmclose.
+# This system should have a complete library installed as -ldbm.nfs which
+# should be used instead (Probably need the networking product add-on)
+$self->{LIBS} = ['-lndbm',-e "/usr/lib/libdbm.nfs.a"?'-ldbm.nfs':'-ldbm'];
use strict;
use Carp;
use Exporter ();
-use DynaLoader ();
-@ISA = qw(Exporter DynaLoader);
+use XSLoader ();
+@ISA = qw(Exporter);
BEGIN {
@EXPORT_OK = qw(
sub opdump (;$);
use subs @EXPORT_OK;
-bootstrap Opcode $XS_VERSION;
+XSLoader::load 'Opcode', $XS_VERSION;
_init_optags();
opmask_addlocal(pTHX_ SV *opset, char *op_mask_buf) /* Localise PL_op_mask then opmask_add() */
{
char *orig_op_mask = PL_op_mask;
- SAVEPPTR(PL_op_mask);
+ SAVEVPTR(PL_op_mask);
#if !defined(PERL_OBJECT)
/* XXX casting to an ordinary function ptr from a member function ptr
* is disallowed by Borland
save_hptr(&PL_defstash); /* save current default stack */
/* the assignment to global defstash changes our sense of 'main' */
PL_defstash = gv_stashpv(Package, GV_ADDWARN); /* should exist already */
+ save_hptr(&PL_curstash);
+ PL_curstash = PL_defstash;
/* defstash must itself contain a main:: so we'll add that now */
/* take care with the ref counts (was cause of long standing bug) */
use ExtUtils::MakeMaker;
WriteMakefile(
NAME => 'POSIX',
- ($^O eq 'MSWin32' ? () : ($^O =~ /cygwin/ ? () :
- (LIBS => ["-lm -lposix -lcposix"])
- )),
+ ($^O eq 'MSWin32' ? () : (LIBS => ["-lm -lposix -lcposix"])),
MAN3PODS => {}, # Pods will be built by installman.
XSPROTOARG => '-noprototypes', # XXX remove later?
VERSION_FROM => 'POSIX.pm',
use Symbol;
require Exporter;
-require DynaLoader;
-@ISA = qw(Exporter DynaLoader);
+use XSLoader ();
+@ISA = qw(Exporter);
-$VERSION = $VERSION = "1.03" ;
+$VERSION = "1.03" ;
%EXPORT_TAGS = (
}
-bootstrap POSIX $VERSION;
+XSLoader::load 'POSIX', $VERSION;
my $EINVAL = constant("EINVAL", 0);
my $EAGAIN = constant("EAGAIN", 0);
#define PERLIO_NOT_STDIO 1
#include "perl.h"
#include "XSUB.h"
-#if defined(PERL_OBJECT) || defined(PERL_CAPI)
+#if defined(PERL_OBJECT) || defined(PERL_CAPI) || defined(PERL_IMPLICIT_SYS)
# undef signal
# undef open
# undef setmode
#else
#if defined (CYGWIN)
# define tzname _tzname
-# undef MB_CUR_MAX /* XXX: bug in b20.1 */
#endif
#if defined (WIN32)
# undef mkfifo
#endif
#ifdef HAS_TZNAME
-# ifndef WIN32
+# if !defined(WIN32) && !defined(CYGWIN)
extern char *tzname[];
# endif
#else
# This code is really grody because we're trying to make the signal
# interface look beautiful, which is hard.
- if (!PL_siggv)
- gv_fetchpv("SIG", TRUE, SVt_PVHV);
-
{
+ GV *siggv = gv_fetchpv("SIG", TRUE, SVt_PVHV);
struct sigaction act;
struct sigaction oact;
POSIX__SigSet sigset;
SV** svp;
- SV** sigsvp = hv_fetch(GvHVn(PL_siggv),
+ SV** sigsvp = hv_fetch(GvHVn(siggv),
PL_sig_name[sig],
strlen(PL_sig_name[sig]),
TRUE);
** If there is a better way to make it portable, go ahead by
** all means.
*/
- if ( ( len > 0 && len < sizeof(tmpbuf) )
- || ( len == 0 && strlen(fmt) == 0 ) ) {
+ if ((len > 0 && len < sizeof(tmpbuf)) || (len == 0 && *fmt == '\0'))
ST(0) = sv_2mortal(newSVpv(tmpbuf, len));
- } else {
+ else {
/* Possibly buf overflowed - try again with a bigger buf */
- int bufsize = strlen(fmt) + sizeof(tmpbuf);
+ int fmtlen = strlen(fmt);
+ int bufsize = fmtlen + sizeof(tmpbuf);
char* buf;
int buflen;
New(0, buf, bufsize, char);
- while( buf ) {
+ while (buf) {
buflen = strftime(buf, bufsize, fmt, &mytm);
- if ( buflen > 0 && buflen < bufsize ) break;
+ if (buflen > 0 && buflen < bufsize)
+ break;
+ /* heuristic to prevent out-of-memory errors */
+ if (bufsize > 100*fmtlen) {
+ Safefree(buf);
+ buf = NULL;
+ break;
+ }
bufsize *= 2;
Renew(buf, bufsize, char);
}
- if ( buf ) {
+ if (buf) {
ST(0) = sv_2mortal(newSVpvn(buf, buflen));
Safefree(buf);
- } else {
- ST(0) = sv_2mortal(newSVpvn(tmpbuf, len));
}
+ else
+ ST(0) = sv_2mortal(newSVpvn(tmpbuf, len));
}
}
);
sub MY::postamble {
- if ($^O ne 'VMS') {
+ if ($^O =~ /MSWin32/ && Win32::IsWin95()) {
+ # XXX: dmake-specific, like rest of Win95 port
+ return
+ '
+$(MYEXTLIB): sdbm/Makefile
+@[
+ cd sdbm
+ $(MAKE) all
+ cd ..
+]
+';
+ }
+ elsif ($^O ne 'VMS') {
'
$(MYEXTLIB): sdbm/Makefile
cd sdbm && $(MAKE) all
';
- } else {
- '
+ }
+ else {
+ '
$(MYEXTLIB) : [.sdbm]descrip.mms
set def [.sdbm]
$(MMS) all
use vars qw($VERSION @ISA);
require Tie::Hash;
-require DynaLoader;
+use XSLoader ();
-@ISA = qw(Tie::Hash DynaLoader);
+@ISA = qw(Tie::Hash);
$VERSION = "1.02" ;
-bootstrap SDBM_File $VERSION;
+XSLoader::load 'SDBM_File', $VERSION;
1;
#include "config.h"
#ifdef CYGWIN
-# define EXT extern
# define EXTCONST extern const
#else
# include "EXTERN.h"
use Carp;
require Exporter;
-require DynaLoader;
-@ISA = qw(Exporter DynaLoader);
+use XSLoader ();
+@ISA = qw(Exporter);
@EXPORT = qw(
inet_aton inet_ntoa pack_sockaddr_in unpack_sockaddr_in
pack_sockaddr_un unpack_sockaddr_un
goto &$AUTOLOAD;
}
-bootstrap Socket $VERSION;
+XSLoader::load 'Socket', $VERSION;
1;
package Thread;
require Exporter;
-require DynaLoader;
+use XSLoader ();
use vars qw($VERSION @ISA @EXPORT);
$VERSION = "1.0";
-@ISA = qw(Exporter DynaLoader);
+@ISA = qw(Exporter);
@EXPORT_OK = qw(yield cond_signal cond_broadcast cond_wait async);
=head1 NAME
You may also C<lock> a sub, using C<lock &sub>. Any calls to that sub from
another thread will block until the lock is released. This behaviour is not
-equvalent to C<use attrs qw(locked)> in the sub. C<use attrs qw(locked)>
-serializes access to a subroutine, but allows different threads
+equivalent to declaring the sub with the C<locked> attribute. The C<locked>
+attribute serializes access to a subroutine, but allows different threads
non-simultaneous access. C<lock &sub>, on the other hand, will not allow
I<any> other thread access for the duration of the lock.
=head1 SEE ALSO
-L<attrs>, L<Thread::Queue>, L<Thread::Semaphore>, L<Thread::Specific>.
+L<attributes>, L<Thread::Queue>, L<Thread::Semaphore>, L<Thread::Specific>.
=cut
return eval { shift->join; };
}
-bootstrap Thread;
+XSLoader::load 'Thread';
1;
remove_thread(pTHX_ struct perl_thread *t)
{
#ifdef USE_THREADS
- DEBUG_S(WITH_THR(PerlIO_printf(PerlIO_stderr(),
+ DEBUG_S(WITH_THR(PerlIO_printf(Perl_debug_log,
"%p: remove_thread %p\n", thr, t)));
MUTEX_LOCK(&PL_threads_mutex);
MUTEX_DESTROY(&t->mutex);
PL_nthreads--;
t->prev->next = t->next;
t->next->prev = t->prev;
+ SvREFCNT_dec(t->oursv);
COND_BROADCAST(&PL_nthreads_cond);
MUTEX_UNLOCK(&PL_threads_mutex);
#endif
AV *av;
int i;
- DEBUG_S(PerlIO_printf(PerlIO_stderr(), "new thread %p starting at %s\n",
+ DEBUG_S(PerlIO_printf(Perl_debug_log, "new thread %p starting at %s\n",
thr, SvPEEK(TOPs)));
thr = (Thread) arg;
savemark = TOPMARK;
myop.op_flags |= OPf_WANT_LIST;
PL_op = pp_entersub(ARGS);
DEBUG_S(if (!PL_op)
- PerlIO_printf(PerlIO_stderr(), "thread starts at Nullop\n"));
+ PerlIO_printf(Perl_debug_log, "thread starts at Nullop\n"));
/*
* When this thread is next scheduled, we start in the right
* place. When the thread runs off the end of the sub, perl.c
PERL_SET_INTERP(thr->interp);
#endif
- DEBUG_S(PerlIO_printf(PerlIO_stderr(), "new thread %p waiting to start\n",
+ DEBUG_S(PerlIO_printf(Perl_debug_log, "new thread %p waiting to start\n",
thr));
/* Don't call *anything* requiring dTHR until after SET_THR() */
SET_THR(thr);
/* Only now can we use SvPEEK (which calls sv_newmortal which does dTHR) */
- DEBUG_S(PerlIO_printf(PerlIO_stderr(), "new thread %p starting at %s\n",
+ DEBUG_S(PerlIO_printf(Perl_debug_log, "new thread %p starting at %s\n",
thr, SvPEEK(TOPs)));
av = newAV();
MUTEX_UNLOCK(&thr->mutex);
av_store(av, 0, &PL_sv_no);
av_store(av, 1, newSVsv(thr->errsv));
- DEBUG_S(PerlIO_printf(PerlIO_stderr(), "%p died: %s\n",
+ DEBUG_S(PerlIO_printf(Perl_debug_log, "%p died: %s\n",
thr, SvPV(thr->errsv, PL_na)));
- } else {
+ }
+ else {
DEBUG_S(STMT_START {
for (i = 1; i <= retval; i++) {
- PerlIO_printf(PerlIO_stderr(), "%p return[%d] = %s\n",
+ PerlIO_printf(Perl_debug_log, "%p return[%d] = %s\n",
thr, i, SvPEEK(SP[i - 1]));
}
} STMT_END);
SvREFCNT_dec(thr->threadsv);
SvREFCNT_dec(thr->specific);
SvREFCNT_dec(thr->errsv);
- SvREFCNT_dec(thr->errhv);
/*Safefree(cxstack);*/
while (PL_curstackinfo->si_next)
Safefree(PL_reg_poscache);
MUTEX_LOCK(&thr->mutex);
- DEBUG_S(PerlIO_printf(PerlIO_stderr(),
+ DEBUG_S(PerlIO_printf(Perl_debug_log,
"%p: threadstart finishing: state is %u\n",
thr, ThrSTATE(thr)));
switch (ThrSTATE(thr)) {
case THRf_R_JOINABLE:
ThrSETSTATE(thr, THRf_ZOMBIE);
MUTEX_UNLOCK(&thr->mutex);
- DEBUG_S(PerlIO_printf(PerlIO_stderr(),
+ DEBUG_S(PerlIO_printf(Perl_debug_log,
"%p: R_JOINABLE thread finished\n", thr));
break;
case THRf_R_JOINED:
ThrSETSTATE(thr, THRf_DEAD);
MUTEX_UNLOCK(&thr->mutex);
remove_thread(aTHX_ thr);
- DEBUG_S(PerlIO_printf(PerlIO_stderr(),
+ DEBUG_S(PerlIO_printf(Perl_debug_log,
"%p: R_JOINED thread finished\n", thr));
break;
case THRf_R_DETACHED:
ThrSETSTATE(thr, THRf_DEAD);
MUTEX_UNLOCK(&thr->mutex);
SvREFCNT_dec(av);
- DEBUG_S(PerlIO_printf(PerlIO_stderr(),
+ DEBUG_S(PerlIO_printf(Perl_debug_log,
"%p: DETACHED thread finished\n", thr));
remove_thread(aTHX_ thr); /* This might trigger main thread to finish */
break;
* are the only ones who know about it */
SET_THR(thr);
SPAGAIN;
- DEBUG_S(PerlIO_printf(PerlIO_stderr(),
+ DEBUG_S(PerlIO_printf(Perl_debug_log,
"%p: newthread (%p), tid is %u, preparing stack\n",
savethread, thr, thr->tid));
/* The following pushes the arg list and startsv onto the *new* stack */
if (err) {
MUTEX_UNLOCK(&thr->mutex);
- DEBUG_S(PerlIO_printf(PerlIO_stderr(),
+ DEBUG_S(PerlIO_printf(Perl_debug_log,
"%p: create of %p failed %d\n",
savethread, thr, err));
/* Thread creation failed--clean up */
SvREFCNT_dec(thr->cvcache);
remove_thread(aTHX_ thr);
- MUTEX_DESTROY(&thr->mutex);
for (i = 0; i <= AvFILL(initargs); i++)
SvREFCNT_dec(*av_fetch(initargs, i, FALSE));
SvREFCNT_dec(startsv);
* so don't be surprised if this isn't robust while debugging
* with -DL.
*/
- DEBUG_S(PerlIO_printf(PerlIO_stderr(),
+ DEBUG_S(PerlIO_printf(Perl_debug_log,
"handle_thread_signal: got signal %d\n", sig););
write(sig_pipe[1], &c, 1);
}
#ifdef USE_THREADS
if (t == thr)
croak("Attempt to join self");
- DEBUG_S(PerlIO_printf(PerlIO_stderr(), "%p: joining %p (state %u)\n",
+ DEBUG_S(PerlIO_printf(Perl_debug_log, "%p: joining %p (state %u)\n",
thr, t, ThrSTATE(t)););
MUTEX_LOCK(&t->mutex);
switch (ThrSTATE(t)) {
}
JOIN(t, &av);
+ sv_2mortal((SV*)av);
+
if (SvTRUE(*av_fetch(av, 0, FALSE))) {
/* Could easily speed up the following if necessary */
for (i = 1; i <= AvFILL(av); i++)
- XPUSHs(sv_2mortal(*av_fetch(av, i, FALSE)));
- } else {
+ XPUSHs(*av_fetch(av, i, FALSE));
+ }
+ else {
STRLEN n_a;
char *mess = SvPV(*av_fetch(av, 1, FALSE), n_a);
- DEBUG_S(PerlIO_printf(PerlIO_stderr(),
+ DEBUG_S(PerlIO_printf(Perl_debug_log,
"%p: join propagating die message: %s\n",
thr, mess));
croak(mess);
Thread t
CODE:
#ifdef USE_THREADS
- DEBUG_S(PerlIO_printf(PerlIO_stderr(), "%p: detaching %p (state %u)\n",
+ DEBUG_S(PerlIO_printf(Perl_debug_log, "%p: detaching %p (state %u)\n",
thr, t, ThrSTATE(t)););
MUTEX_LOCK(&t->mutex);
switch (ThrSTATE(t)) {
sv = SvRV(sv);
mg = condpair_magic(sv);
- DEBUG_S(PerlIO_printf(PerlIO_stderr(), "%p: cond_wait %p\n", thr, sv));
+ DEBUG_S(PerlIO_printf(Perl_debug_log, "%p: cond_wait %p\n", thr, sv));
MUTEX_LOCK(MgMUTEXP(mg));
if (MgOWNER(mg) != thr) {
MUTEX_UNLOCK(MgMUTEXP(mg));
sv = SvRV(sv);
mg = condpair_magic(sv);
- DEBUG_S(PerlIO_printf(PerlIO_stderr(), "%p: cond_signal %p\n",thr,sv));
+ DEBUG_S(PerlIO_printf(Perl_debug_log, "%p: cond_signal %p\n",thr,sv));
MUTEX_LOCK(MgMUTEXP(mg));
if (MgOWNER(mg) != thr) {
MUTEX_UNLOCK(MgMUTEXP(mg));
sv = SvRV(sv);
mg = condpair_magic(sv);
- DEBUG_S(PerlIO_printf(PerlIO_stderr(), "%p: cond_broadcast %p\n",
+ DEBUG_S(PerlIO_printf(Perl_debug_log, "%p: cond_broadcast %p\n",
thr, sv));
MUTEX_LOCK(MgMUTEXP(mg));
if (MgOWNER(mg) != thr) {
ST(0) = sv_newmortal();
if (ret)
sv_setsv(ST(0), c ? PL_psig_ptr[c] : &PL_sv_no);
- DEBUG_S(PerlIO_printf(PerlIO_stderr(),
+ DEBUG_S(PerlIO_printf(Perl_debug_log,
"await_signal returning %s\n", SvPEEK(ST(0))););
MODULE = Thread PACKAGE = Thread::Specific
return bless [@_], $class;
}
-sub dequeue {
- use attrs qw(locked method);
+sub dequeue : locked, method {
my $q = shift;
cond_wait $q until @$q;
return shift @$q;
}
-sub dequeue_nb {
- use attrs qw(locked method);
+sub dequeue_nb : locked, method {
my $q = shift;
if (@$q) {
return shift @$q;
}
}
-sub enqueue {
- use attrs qw(locked method);
+sub enqueue : locked, method {
my $q = shift;
push(@$q, @_) and cond_broadcast $q;
}
-sub pending {
- use attrs qw(locked method);
+sub pending : locked, method {
my $q = shift;
return scalar(@$q);
}
bless \$val, $class;
}
-sub down {
- use attrs qw(locked method);
+sub down : locked, method {
my $s = shift;
my $inc = @_ ? shift : 1;
cond_wait $s until $$s >= $inc;
$$s -= $inc;
}
-sub up {
- use attrs qw(locked method);
+sub up : locked, method {
my $s = shift;
my $inc = @_ ? shift : 1;
($$s += $inc) > 0 and cond_broadcast $s;
=cut
-sub import {
- use attrs qw(locked method);
+sub import : locked, method {
require fields;
fields::->import(@_);
}
-sub key_create {
- use attrs qw(locked method);
+sub key_create : locked, method {
return ++$FIELDS{__MAX__};
}
$level = 0;
-sub single_file {
- use attrs 'locked';
+sub single_file : locked {
my $arg = shift;
$level++;
print "Level $level for $arg\n";
$global = undef;
-sub single_file {
- use attrs 'locked';
+sub single_file : locked {
my $who = shift;
my $i;
|| mg->mg_private != ${ntype}_MAGIC_SIGNATURE)
croak(\"XSUB ${func_name}: $var is a forged ${ntype} object\");
$var = ($type) SvPVX(mg->mg_obj);
- DEBUG_S(PerlIO_printf(PerlIO_stderr(),
+ DEBUG_S(PerlIO_printf(Perl_debug_log,
\"XSUB ${func_name}: %p\\n\", $var);)
} STMT_END
T_IVREF
package attrs;
-require DynaLoader;
-use vars '@ISA';
-@ISA = 'DynaLoader';
+use XSLoader ();
-use vars qw($VERSION);
$VERSION = "1.0";
=head1 NAME
-attrs - set/get attributes of a subroutine
+attrs - set/get attributes of a subroutine (deprecated)
=head1 SYNOPSIS
=head1 DESCRIPTION
-This module lets you set and get attributes for subroutines.
+NOTE: Use of this pragma is deprecated. Use the syntax
+
+ sub foo : locked, method { }
+
+to declare attributes instead. See also L<attributes>.
+
+This pragma lets you set and get attributes for subroutines.
Setting attributes takes place at compile time; trying to set
invalid attribute names causes a compile-time error. Calling
-C<attr::get> on a subroutine reference or name returns its list
-of attribute names. Notice that C<attr::get> is not exported.
+C<attrs::get> on a subroutine reference or name returns its list
+of attribute names. Notice that C<attrs::get> is not exported.
Valid attributes are as follows.
=over
explicitly taken with the C<lock> operator immediately after the
subroutine is entered.
-=item lvalue
-
-Setting this attribute enables the subroutine to be used in
-lvalue context. See L<perlsub/"Lvalue subroutines">.
-
=back
=cut
-bootstrap attrs $VERSION;
+XSLoader::load 'attrs', $VERSION;
1;
return CVf_METHOD;
else if (strnEQ(attr, "locked", 6))
return CVf_LOCKED;
- else if (strnEQ(attr, "lvalue", 6))
- return CVf_LVALUE;
else
return 0;
}
PPCODE:
if (!PL_compcv || !(cv = CvOUTSIDE(PL_compcv)))
croak("can't set attributes outside a subroutine scope");
+ if (ckWARN(WARN_DEPRECATED))
+ Perl_warner(aTHX_ WARN_DEPRECATED,
+ "pragma \"attrs\" is deprecated, "
+ "use \"sub NAME : ATTRS\" instead");
for (i = 1; i < items; i++) {
STRLEN n_a;
char *attr = SvPV(ST(i), n_a);
foreach my $s (@_){
if ($s eq 'debug' or $s eq 'debugcolor') {
setcolor() if $s eq 'debugcolor';
- require DynaLoader;
- @ISA = ('DynaLoader');
- bootstrap re;
+ require XSLoader;
+ XSLoader::load('re');
install() if $on;
uninstall() unless $on;
next;
# and run 'make regen_headers' to effect changes.
#
+perl_alloc_using
+perl_alloc
+perl_construct
+perl_destruct
+perl_free
+perl_run
+perl_parse
+perl_clone
+perl_clone_using
+Perl_malloc
+Perl_calloc
+Perl_realloc
+Perl_mfree
+Perl_malloced_size
Perl_amagic_call
Perl_Gv_AMupdate
Perl_append_elem
Perl_append_list
Perl_apply
+Perl_avhv_delete_ent
Perl_avhv_exists_ent
Perl_avhv_fetch_ent
Perl_avhv_iternext
Perl_avhv_iterval
Perl_avhv_keys
Perl_av_clear
+Perl_av_delete
+Perl_av_exists
Perl_av_extend
Perl_av_fake
Perl_av_fetch
Perl_cxinc
Perl_deb
Perl_vdeb
-Perl_deb_growlevel
Perl_debprofdump
Perl_debop
Perl_debstack
Perl_magic_sizepack
Perl_magic_wipepack
Perl_magicname
-Perl_malloced_size
Perl_markstack_grow
Perl_mem_collxfrm
Perl_mess
Perl_newHVhv
Perl_newIO
Perl_newLISTOP
+Perl_newPADOP
Perl_newPMOP
Perl_newPVOP
Perl_newRV
Perl_pad_reset
Perl_pad_swipe
Perl_peep
-perl_construct
-perl_destruct
-perl_free
-perl_run
-perl_parse
-perl_alloc
-perl_construct
-perl_destruct
-perl_free
-perl_run
-perl_parse
Perl_new_struct_thread
Perl_call_atexit
Perl_call_argv
Perl_save_clearsv
Perl_save_delete
Perl_save_destructor
+Perl_save_destructor_x
Perl_save_freesv
Perl_save_freeop
Perl_save_freepv
Perl_save_hptr
Perl_save_I16
Perl_save_I32
+Perl_save_I8
Perl_save_int
Perl_save_item
Perl_save_iv
Perl_save_op
Perl_save_scalar
Perl_save_pptr
+Perl_save_vptr
Perl_save_re_context
Perl_save_sptr
Perl_save_svref
Perl_sv_2mortal
Perl_sv_2nv
Perl_sv_2pv
+Perl_sv_2pvutf8
+Perl_sv_2pvbyte
Perl_sv_2uv
Perl_sv_iv
Perl_sv_uv
Perl_sv_nv
Perl_sv_pvn
+Perl_sv_pvutf8n
+Perl_sv_pvbyten
Perl_sv_true
Perl_sv_add_arena
Perl_sv_backoff
Perl_sv_pos_u2b
Perl_sv_pos_b2u
Perl_sv_pvn_force
+Perl_sv_pvutf8n_force
+Perl_sv_pvbyten_force
Perl_sv_reftype
Perl_sv_replace
Perl_sv_report_used
Perl_vivify_defelem
Perl_vivify_ref
Perl_wait4pid
+Perl_report_uninit
Perl_warn
Perl_vwarn
Perl_warner
Perl_yyparse
Perl_yywarn
Perl_dump_mstats
-Perl_malloc
-Perl_calloc
-Perl_realloc
-Perl_mfree
Perl_safesysmalloc
Perl_safesyscalloc
Perl_safesysrealloc
Perl_vdefault_protect
Perl_reginitcolors
Perl_sv_2pv_nolen
+Perl_sv_2pvutf8_nolen
+Perl_sv_2pvbyte_nolen
Perl_sv_pv
+Perl_sv_pvutf8
+Perl_sv_pvbyte
Perl_sv_force_normal
Perl_tmps_grow
Perl_sv_rvweaken
Perl_newMYSUB
Perl_my_attrs
Perl_boot_core_xsutils
+Perl_cx_dup
+Perl_si_dup
+Perl_ss_dup
+Perl_any_dup
+Perl_he_dup
+Perl_re_dup
+Perl_fp_dup
+Perl_dirp_dup
+Perl_gp_dup
+Perl_mg_dup
+Perl_sv_dup
+Perl_sys_intern_dup
+Perl_ptr_table_new
+Perl_ptr_table_fetch
+Perl_ptr_table_store
+Perl_ptr_table_split
#undef PERLVARA
#define PERLVARA(x, n, y)
#undef PERLVARI
-#define PERLVARI(x, y, z) PL_##x = z;
+#define PERLVARI(x, y, z) interp.x = z;
#undef PERLVARIC
-#define PERLVARIC(x, y, z) PL_##x = z;
+#define PERLVARIC(x, y, z) interp.x = z;
-CPerlObj::CPerlObj(IPerlMem* ipM, IPerlEnv* ipE, IPerlStdIO* ipStd,
+CPerlObj::CPerlObj(IPerlMem* ipM, IPerlMem* ipMS, IPerlMem* ipMP,
+ IPerlEnv* ipE, IPerlStdIO* ipStd,
IPerlLIO* ipLIO, IPerlDir* ipD, IPerlSock* ipS,
IPerlProc* ipP)
{
#include "thrdvar.h"
#include "intrpvar.h"
-#include "perlvars.h"
PL_Mem = ipM;
+ PL_MemShared = ipMS;
+ PL_MemParse = ipMP;
PL_Env = ipE;
PL_StdIO = ipStd;
PL_LIO = ipLIO;
{
if(pvtbl)
return pvtbl->pMalloc(pvtbl, nSize);
-
+#ifndef __MINGW32__
+ /* operator new is supposed to throw std::bad_alloc */
return NULL;
+#endif
}
+#ifndef __BORLANDC__
void
CPerlObj::operator delete(void *pPerl, IPerlMem *pvtbl)
{
if(pvtbl)
pvtbl->pFree(pvtbl, pPerl);
}
-
-void
-CPerlObj::Init(void)
-{
-}
+#endif
#ifdef WIN32 /* XXX why are these needed? */
bool
ppaddr
sig_name
sig_num
-psig_name
-psig_ptr
regkind
simple
utf8skip
STRLEN tmplen;
GV *gv;
+ if (!PL_defstash)
+ return Nullgv;
+
tmplen = strlen(name) + 2;
if (tmplen < sizeof smallbuf)
tmpbuf = smallbuf;
tmpbuf[1] = '<';
strcpy(tmpbuf + 2, name);
gv = *(GV**)hv_fetch(PL_defstash, tmpbuf, tmplen, TRUE);
- if (!isGV(gv))
+ if (!isGV(gv)) {
gv_init(gv, PL_defstash, tmpbuf, tmplen, FALSE);
+ sv_setpv(GvSV(gv), name);
+ if (PERLDB_LINE)
+ hv_magic(GvHVn(gv_AVadd(gv)), gv, 'L');
+ }
if (tmpbuf != smallbuf)
Safefree(tmpbuf);
- sv_setpv(GvSV(gv), name);
- if (*name == '/' && (instr(name, "/lib/") || instr(name, ".pm")))
- GvMULTI_on(gv);
- if (PERLDB_LINE)
- hv_magic(GvHVn(gv_AVadd(gv)), gv, 'L');
return gv;
}
Newz(602, gp, 1, GP);
GvGP(gv) = gp_ref(gp);
GvSV(gv) = NEWSV(72,0);
- GvLINE(gv) = PL_curcop->cop_line;
- GvFILEGV(gv) = PL_curcop->cop_filegv;
+ GvLINE(gv) = CopLINE(PL_curcop);
+ GvFILE(gv) = CopFILE(PL_curcop) ? CopFILE(PL_curcop) : "";
GvCVGEN(gv) = 0;
GvEGV(gv) = gv;
sv_magic((SV*)gv, (SV*)gv, '*', name, len);
PL_sub_generation++;
CvGV(GvCV(gv)) = (GV*)SvREFCNT_inc(gv);
- CvFILEGV(GvCV(gv)) = PL_curcop->cop_filegv;
+ CvFILE(GvCV(gv)) = CopFILE(PL_curcop);
CvSTASH(GvCV(gv)) = PL_curstash;
#ifdef USE_THREADS
CvOWNER(GvCV(gv)) = 0;
if ((nsplit - origname) == 5 && strnEQ(origname, "SUPER", 5)) {
/* ->SUPER::method should really be looked up in original stash */
SV *tmpstr = sv_2mortal(Perl_newSVpvf(aTHX_ "%s::SUPER",
- HvNAME(PL_curcop->cop_stash)));
+ CopSTASHPV(PL_curcop)));
stash = gv_stashpvn(SvPVX(tmpstr), SvCUR(tmpstr), TRUE);
DEBUG_o( Perl_deb(aTHX_ "Treating %s as %s::%s\n",
origname, HvNAME(stash), name) );
name++;
for (namend = name; *namend; namend++) {
- if ((*namend == '\'' && namend[1]) ||
- (*namend == ':' && namend[1] == ':'))
+ if ((*namend == ':' && namend[1] == ':')
+ || (*namend == '\'' && namend[1]))
{
if (!stash)
stash = PL_defstash;
else if ((COP*)PL_curcop == &PL_compiling) {
stash = PL_curstash;
if (add && (PL_hints & HINT_STRICT_VARS) &&
- !(add & GV_ADDOUR) &&
sv_type != SVt_PVCV &&
sv_type != SVt_PVGV &&
sv_type != SVt_PVFM &&
}
}
else
- stash = PL_curcop->cop_stash;
+ stash = CopSTASH(PL_curcop);
}
else
stash = PL_defstash;
if (strEQ(name, "SIG")) {
HV *hv;
I32 i;
- PL_siggv = gv;
- GvMULTI_on(PL_siggv);
- hv = GvHVn(PL_siggv);
- hv_magic(hv, PL_siggv, 'S');
- for(i=1;PL_sig_name[i];i++) {
+ if (!PL_psig_ptr) {
+ int sig_num[] = { SIG_NUM };
+ New(73, PL_psig_ptr, sizeof(sig_num)/sizeof(*sig_num), SV*);
+ New(73, PL_psig_name, sizeof(sig_num)/sizeof(*sig_num), SV*);
+ }
+ GvMULTI_on(gv);
+ hv = GvHVn(gv);
+ hv_magic(hv, gv, 'S');
+ for (i = 1; PL_sig_name[i]; i++) {
SV ** init;
- init=hv_fetch(hv,PL_sig_name[i],strlen(PL_sig_name[i]),1);
- if(init)
- sv_setsv(*init,&PL_sv_undef);
+ init = hv_fetch(hv, PL_sig_name[i], strlen(PL_sig_name[i]), 1);
+ if (init)
+ sv_setsv(*init, &PL_sv_undef);
PL_psig_ptr[i] = 0;
PL_psig_name[i] = 0;
}
case '&':
if (len > 1)
break;
- PL_ampergv = gv;
PL_sawampersand = TRUE;
goto ro_magicalize;
case '`':
if (len > 1)
break;
- PL_leftgv = gv;
PL_sawampersand = TRUE;
goto ro_magicalize;
case '\'':
if (len > 1)
break;
- PL_rightgv = gv;
PL_sawampersand = TRUE;
goto ro_magicalize;
if (len == 1) {
SV *sv = GvSV(gv);
(void)SvUPGRADE(sv, SVt_PVNV);
- sv_setpv(sv, PL_patchlevel);
- (void)sv_2nv(sv);
+ SvNVX(sv) = SvNVX(PL_patchlevel);
+ SvNOK_on(sv);
+ (void)SvPV_nolen(sv);
SvREADONLY_on(sv);
}
break;
register I32 i;
register GV *gv;
HV *hv;
- GV *filegv;
if (!HvARRAY(stash))
return;
gv_check(hv); /* nested package */
}
else if (isALPHA(*HeKEY(entry))) {
+ char *file;
gv = (GV*)HeVAL(entry);
if (SvTYPE(gv) != SVt_PVGV || GvMULTI(gv))
continue;
- PL_curcop->cop_line = GvLINE(gv);
- filegv = GvFILEGV(gv);
- PL_curcop->cop_filegv = filegv;
- if (filegv && GvMULTI(filegv)) /* Filename began with slash */
+ file = GvFILE(gv);
+ /* performance hack: if filename is absolute and it's a standard
+ * module, don't bother warning */
+ if (file
+ && PERL_FILE_IS_ABSOLUTE(file)
+ && (instr(file, "/lib/") || instr(file, ".pm")))
+ {
continue;
+ }
+ CopLINE_set(PL_curcop, GvLINE(gv));
+#ifdef USE_ITHREADS
+ CopFILE(PL_curcop) = file; /* set for warning */
+#else
+ CopFILEGV(PL_curcop) = gv_fetchfile(file);
+#endif
Perl_warner(aTHX_ WARN_ONCE,
"Name \"%s::%s\" used only once: possible typo",
HvNAME(stash), GvNAME(gv));
GP*
Perl_gp_ref(pTHX_ GP *gp)
{
+ if (!gp)
+ return (GP*)NULL;
gp->gp_refcnt++;
if (gp->gp_cv) {
if (gp->gp_cvgen) {
GV * gp_egv; /* effective gv, if *glob */
CV * gp_cv; /* subroutine value */
U32 gp_cvgen; /* generational validity of cached gv_cv */
- I32 gp_lastexpr; /* used by nothing_in_common() */
+ U32 gp_flags; /* XXX unused */
line_t gp_line; /* line first declared at (for -w) */
- GV * gp_filegv; /* file first declared in (for -w) */
+ char * gp_file; /* file first declared in (for -w) */
};
#if defined(CRIPPLED_CC) && (defined(iAPX286) || defined(M_I286) || defined(I80286))
#define GvCVGEN(gv) (GvGP(gv)->gp_cvgen)
#define GvCVu(gv) (GvGP(gv)->gp_cvgen ? Nullcv : GvGP(gv)->gp_cv)
-#define GvLASTEXPR(gv) (GvGP(gv)->gp_lastexpr)
+#define GvGPFLAGS(gv) (GvGP(gv)->gp_flags)
#define GvLINE(gv) (GvGP(gv)->gp_line)
-#define GvFILEGV(gv) (GvGP(gv)->gp_filegv)
+#define GvFILE(gv) (GvGP(gv)->gp_file)
+#define GvFILEGV(gv) (gv_fetchfile(GvFILE(gv)))
#define GvEGV(gv) (GvGP(gv)->gp_egv)
#define GvENAME(gv) GvNAME(GvEGV(gv) ? GvEGV(gv) : gv)
#define GVf_INTRO 0x01
#define GVf_MULTI 0x02
#define GVf_ASSUMECV 0x04
+#define GVf_IN_PAD 0x08
#define GVf_IMPORTED 0xF0
#define GVf_IMPORTED_SV 0x10
#define GVf_IMPORTED_AV 0x20
#define GvIMPORTED_CV_on(gv) (GvFLAGS(gv) |= GVf_IMPORTED_CV)
#define GvIMPORTED_CV_off(gv) (GvFLAGS(gv) &= ~GVf_IMPORTED_CV)
+#define GvIN_PAD(gv) (GvFLAGS(gv) & GVf_IN_PAD)
+#define GvIN_PAD_on(gv) (GvFLAGS(gv) |= GVf_IN_PAD)
+#define GvIN_PAD_off(gv) (GvFLAGS(gv) &= ~GVf_IN_PAD)
+
#define Nullgv Null(GV*)
#define DM_UID 0x003
#define GV_ADDWARN 0x04 /* add, but warn if symbol wasn't already there */
#define GV_ADDINEVAL 0x08 /* add, as though we're doing so within an eval */
#define GV_NOINIT 0x10 /* add, but don't init symbol, if type != PVGV */
-#define GV_ADDOUR 0x20 /* add "our" variable */
For dealing with issues that may arise from various 32/64-bit
systems, we will ask Configure to check out
+
SHORTSIZE == sizeof(short)
INTSIZE == sizeof(int)
LONGSIZE == sizeof(long)
PTRSIZE == sizeof(void *)
DOUBLESIZE == sizeof(double)
LONG_DOUBLESIZE == sizeof(long double) (if HAS_LONG_DOUBLE).
- Most of these are currently unused, but they are mentioned here so
- metaconfig will include the appropriate tests in Configure and
- we can then start to consider how best to deal with long long
- variables.
- Andy Dougherty April 1998
+
*/
+typedef I8TYPE I8;
+typedef U8TYPE U8;
+typedef I16TYPE I16;
+typedef U16TYPE U16;
+typedef I32TYPE I32;
+typedef U32TYPE U32;
+#ifdef PERL_CORE
+# ifdef HAS_QUAD
+# if QUADKIND == QUAD_IS_INT64_T
+# include <sys/types.h>
+# ifdef I_INTTYPES /* e.g. Linux has int64_t without <inttypes.h> */
+# include <inttypes.h>
+# endif
+# endif
+typedef I64TYPE I64;
+typedef U64TYPE U64;
+# endif
+#endif /* PERL_CORE */
+
+/* Mention I8SIZE, U8SIZE, I16SIZE, U16SIZE, I32SIZE, U32SIZE,
+ I64SIZE, and U64SIZE here so that metaconfig pulls them in. */
+
#if defined(UINT8_MAX) && defined(INT16_MAX) && defined(INT32_MAX)
-typedef int8_t I8;
-typedef uint8_t U8;
/* I8_MAX and I8_MIN constants are not defined, as I8 is an ambiguous type.
Please search CHAR_MAX in perl.h for further details. */
#define U8_MAX UINT8_MAX
#define U8_MIN UINT8_MIN
-typedef int16_t I16;
-typedef uint16_t U16;
#define I16_MAX INT16_MAX
#define I16_MIN INT16_MIN
#define U16_MAX UINT16_MAX
#define U16_MIN UINT16_MIN
-typedef int32_t I32;
-typedef uint32_t U32;
#define I32_MAX INT32_MAX
#define I32_MIN INT32_MIN
#define U32_MAX UINT32_MAX
#else
-typedef char I8;
-typedef unsigned char U8;
/* I8_MAX and I8_MIN constants are not defined, as I8 is an ambiguous type.
Please search CHAR_MAX in perl.h for further details. */
#define U8_MAX PERL_UCHAR_MAX
#define U8_MIN PERL_UCHAR_MIN
-/* Beware. SHORTSIZE > 2 in Cray C90ties. */
-typedef short I16;
-typedef unsigned short U16;
#define I16_MAX PERL_SHORT_MAX
#define I16_MIN PERL_SHORT_MIN
#define U16_MAX PERL_USHORT_MAX
#define U16_MIN PERL_USHORT_MIN
#if LONGSIZE > 4
- typedef int I32;
- typedef unsigned int U32;
# define I32_MAX PERL_INT_MAX
# define I32_MIN PERL_INT_MIN
# define U32_MAX PERL_UINT_MAX
# define U32_MIN PERL_UINT_MIN
#else
- typedef long I32;
- typedef unsigned long U32;
# define I32_MAX PERL_LONG_MAX
# define I32_MIN PERL_LONG_MIN
# define U32_MAX PERL_ULONG_MAX
Please send any problems or suggested changes to perlbug@perl.com.
-Hint file naming convention: Each hint file name should have only
+=head1 Hint file naming convention.
+
+Each hint file name should have only
one '.'. (This is for portability to non-unix file systems.) Names
should also fit in <= 14 characters, for portability to older SVR3
systems. File names are of the form $osname_$osvers.sh, with all '.'
A glossary of config.sh variables is in the file Porting/Glossary.
+=head1 Setting variables
+
+=head2 Optimizer
+
+If you want to set a variable, try to allow for Configure command-line
+overrides. For example, suppose you think the default optimizer
+setting to be -O2 for a particular platform. You should allow for
+command line overrides with something like
+
+ case "$optimize" in
+ '') optimize='-O2' ;;
+ esac
+
+or, if your system has a decent test(1) command,
+
+ test -z "$optimize" && optimize='-O2'
+
+This allows the user to select a different optimization level, e.g.
+-O6 or -g.
+
+=head2 Compiler and Linker flags
+
+If you want to set $ccflags or $ldflags, you should append to the existing
+value to allow Configure command-line settings, e.g. use
+
+ ccflags="$ccflags -DANOTHER_OPTION_I_NEED"
+
+so that the user can do something like
+
+ sh Configure -Dccflags='FIX_NEGATIVE_ZERO'
+
+and have the FIX_NEGATIVE_ZERO value preserved by the hints file.
+
+=head2 Libraries
+
+Configure will attempt to use the libraries listed in the variable
+$libswanted. If necessary, you should remove broken libraries from
+that list, or add additional libraries to that list. You should
+*not* simply set $libs -- that ignores the possibilities of local
+variations. For example, a setting of libs='-lgdbm -lm -lc' would
+fail if another user were to try to compile Perl on a system without
+GDBM but with Berkeley DB. See hints/dec_osf.sh and hints/solaris_2.sh
+for examples.
+
+=head2 Other
+
+In general, try to avoid hard-wiring something that Configure will
+figure out anyway. Also try to allow for Configure command-line
+overrides.
+
=head1 Hint file tricks
=head2 Printing critical messages
Have the appropriate amount of fun :-)
- Andy Dougherty doughera@lafcol.lafayette.edu
+ Andy Dougherty doughera@lafayette.edu
# AIX 3.x.x hints thanks to Wayne Scott <wscott@ichips.intel.com>
# AIX 4.1 hints thanks to Christopher Chan-Nui <channui@austin.ibm.com>.
# AIX 4.1 pthreading by Christopher Chan-Nui <channui@austin.ibm.com> and
-# Jarkko Hietaniemi <jhi@iki.fi>.
+# Jarkko Hietaniemi <jhi@iki.fi>.
# Merged on Mon Feb 6 10:22:35 EST 1995 by
# Andy Dougherty <doughera@lafcol.lafayette.edu>
# pages state:
# setrgid: The EPERM error code is always returned.
# setruid: The EPERM error code is always returned. Processes cannot
-# reset only their real user IDs.
+# reset only their real user IDs.
d_setrgid='undef'
d_setruid='undef'
esac
so="a"
-dlext="o"
+# AIX itself uses .o (libc.o) but we prefer compatibility
+# with the rest of the world and with rest of the scripting
+# languages (Tcl, Python) and related systems (SWIG).
+# Stephanie Beals <bealzy@us.ibm.com>
+dlext="so"
# Trying to set this breaks the POSIX.c compilation
'') archname="$osname" ;;
esac
+cc=${cc:-cc}
+
case "$osvers" in
3*) d_fchmod=undef
ccflags="$ccflags -D_ALL_SOURCE"
# The first 3 options would not be needed if dynamic libs. could be linked
# with the compiler instead of ld.
# -bI:$(PERL_INC)/perl.exp Read the exported symbols from the perl binary
-# -bE:$(BASEEXT).exp Export these symbols. This file contains only one
-# symbol: boot_$(EXP) can it be auto-generated?
+# -bE:$(BASEEXT).exp Export these symbols. This file contains only one
+# symbol: boot_$(EXP) can it be auto-generated?
case "$osvers" in
3*)
- lddlflags="$lddlflags -H512 -T512 -bhalt:4 -bM:SRE -bI:$(PERL_INC)/perl.exp -bE:$(BASEEXT).exp -e _nostart -lc"
+ lddlflags="$lddlflags -H512 -T512 -bhalt:4 -bM:SRE -bI:\$(PERL_INC)/perl.exp -bE:\$(BASEEXT).exp -e _nostart -lc"
;;
*)
- lddlflags="$lddlflags -bhalt:4 -bM:SRE -bI:$(PERL_INC)/perl.exp -bE:$(BASEEXT).exp -b noentry -lc"
+ lddlflags="$lddlflags -bhalt:4 -bM:SRE -bI:\$(PERL_INC)/perl.exp -bE:\$(BASEEXT).exp -b noentry -lc"
;;
esac
cat > UU/usethreads.cbu <<'EOCBU'
case "$usethreads" in
$define|true|[yY]*)
- ccflags="$ccflags -DNEED_PTHREAD_INIT"
- case "$cc" in
- gcc) ;;
- cc_r) ;;
- cc|xlc_r)
+ ccflags="$ccflags -DNEED_PTHREAD_INIT"
+ case "$cc" in
+ gcc) ;;
+ cc_r) ;;
+ cc|xl[cC]_r)
echo >&4 "Switching cc to cc_r because of POSIX threads."
# xlc_r has been known to produce buggy code in AIX 4.3.2.
- # (e.g. pragma/overload core dumps)
+ # (e.g. pragma/overload core dumps) Let's suspect xlC_r, too.
# --jhi@iki.fi
cc=cc_r
if test ! -e /bin/cc_r; then
- cat >&4 <<EOM
+ cat >&4 <<EOM
For pthreads you should use the AIX C compiler cc_r.
-But I cannot find it in /bin.
+But I cannot find it as /bin/cc_r.
Cannot continue, aborting.
EOM
fi
- ;;
- '')
+ ;;
+ '')
cc=cc_r
- ;;
- *)
- cat >&4 <<EOM
+ ;;
+ *)
+ cat >&4 <<EOM
For pthreads you should use the AIX C compiler cc_r.
(now your compiler was set to '$cc')
Cannot continue, aborting.
EOM
- exit 1
+ exit 1
;;
- esac
-
- # Add the POSIX threads library and the re-entrant libc to lddflags.
- set `echo X "$lddlflags"| sed -e 's/ -lc$/ -lpthreads -lc_r/'`
- shift
- lddlflags="$*"
-
- # Add the POSIX threads library and the re-entrant libc to libswanted.
- # Make sure the c_r library is before the c library or
- # make will fail.
- set `echo X "$libswanted "| sed -e 's/ c / pthreads c_r /'`
- shift
- libswanted="$*"
+ esac
+
+ # c_rify libswanted.
+ set `echo X "$libswanted "| sed -e 's/ \([cC]\) / \1_r /g'`
+ shift
+ libswanted="$*"
+ # c_rify lddlflags.
+ set `echo X "$lddlflags "| sed -e 's/ \(-l[cC]\) / \1_r /g'`
+ shift
+ lddlflags="$*"
+
+ # Insert pthreads to libswanted, before any libc or libC.
+ set `echo X "$libswanted "| sed -e 's/ \([cC]\) / pthreads \1 /'`
+ shift
+ libswanted="$*"
+ # Insert pthreads to lddlflags, before any libc or libC.
+ set `echo X "$lddlflags " | sed -e 's/ \(-l[cC]\) / -lpthreads \1 /'`
+ shift
+ lddlflags="$*"
+
+ ;;
+esac
+EOCBU
+
+# This script UU/uselfs.cbu will get 'called-back' by Configure
+# after it has prompted the user for whether to use large files.
+cat > UU/uselfs.cbu <<'EOCBU'
+case "$uselargefiles" in
+$define|true|[yY]*)
+ lfcflags="`getconf XBS5_ILP32_OFFBIG_CFLAGS 2>/dev/null`"
+ lfldflags="`getconf XBS5_ILP32_OFFBIG_LDFLAGS 2>/dev/null`"
+ # _Somehow_ in AIX 4.3.1.0 the above getconf call manages to
+ # insert(?) *something* to $ldflags so that later (in Configure) evaluating
+ # $ldflags causes a newline after the '-b64' (the result of the getconf).
+ # (nothing strange shows up in $ldflags even in hexdump;
+ # so it may be something in the shell, instead?)
+ # Try it out: just uncomment the below line and rerun Configure:
+# echo >&4 "AIX 4.3.1.0 $lfldflags mystery" ; exit 1
+ # Just don't ask me how AIX does it, I spent hours wondering.
+ # Therefore the line re-evaluating lfldflags: it seems to fix
+ # the whatever it was that AIX managed to break. --jhi
+ lfldflags="`echo $lfldflags`"
+ lflibs="`getconf XBS5_ILP32_OFFBIG_LIBS 2>/dev/null|sed -e 's@^-l@@' -e 's@ -l@ @g`"
+ case "$lfcflags$lfldflags$lflibs" in
+ '');;
+ *) ccflags="$ccflags $lfcflags"
+ ldflags="$ldflags $ldldflags"
+ libswanted="$libswanted $lflibs"
+ ;;
+ esac
+ lfcflags=''
+ lfldflags=''
+ lflibs=''
;;
esac
EOCBU
exit 1
;;
esac
- ccflags="$ccflags -DUSE_LONG_LONG"
- ccflags="$ccflags `getconf XBS5_ILP32_OFFBIG_CFLAGS 2>/dev/null`"
-
- ldflags="$ldflags `getconf XBS5_ILP32_OFFBIG_LDFLAGS 2>/dev/null`"
- # _Somehow_ in AIX 4.3.1.0 the above getconf call manages to
- # insert(?) *something* to $ldflags so that later (in Configure) evaluating
- # $ldflags causes a newline after the '-b64' (the result of the getconf).
- # (nothing strange shows up in $ldflags even in hexdump;
- # so it may be something in the shell, instead?)
- # Try it out: just uncomment the below line and rerun Configure:
-# echo >& "AIX $ldflags mystery" ; exit 1
- # Just don't ask me how AIX does it.
- # Therefore the line re-evaluating ldflags: it seems to bypass
- # the whatever it was AIX managed to break. --jhi
- ldflags="`echo $ldflags`"
-
- libswanted="$libswanted `getconf XBS5_ILP32_OFFBIG_LIBS 2>/dev/null|sed -e 's@^-l@@' -e 's@ -l@ @g'`"
+ case "$ccflags" in
+ *-DUSE_LONG_LONG*) ;;
+ *) ccflags="$ccflags -DUSE_LONG_LONG" ;;
+ esac
# When a 64-bit cc becomes available $archname64
# may need setting so that $archname gets it attached.
;;
case "$uselongdouble" in
$define|true|[yY]*)
ccflags="$ccflags -qlongdouble"
+ # The explicit cc128, xlc128, xlC128 are not needed,
+ # the -qlongdouble should do the trick. --jhi
;;
esac
EOCBU
+# If the C++ libraries, libC and libC_r, are available we will prefer them
+# over the vanilla libc, because the libC contain loadAndInit() and
+# terminateAndUnload() which work correctly with C++ statics while libc
+# load() and unload() do not. See ext/DynaLoader/dl_aix.xs.
+# The C-to-C_r switch is done by usethreads.cbu, if needed.
+if test -f /lib/libC.a -a X"`$cc -v 2>&1 | grep gcc`" = X; then
+ # Cify libswanted.
+ set `echo X "$libswanted "| sed -e 's/ c / C c /'`
+ shift
+ libswanted="$*"
+ # Cify lddlflags.
+ set `echo X "$lddlflags "| sed -e 's/ -lc / -lC -lc /'`
+ shift
+ lddlflags="$*"
+fi
+
# EOF
glibpth="$libpth"
xlibpth="$libpth"
+# This should remove unwanted libraries instead of limiting the set
+# to just these few. E.g. what about Berkeley DB?
libswanted='gdbm m dld'
so=' '
# compiler & linker flags
+# Respect command-line values.
-ccflags='-DAMIGAOS -mstackextend'
-ldflags=''
-optimize='-O2 -fomit-frame-pointer'
+ccflags="$ccflags -DAMIGAOS -mstackextend"
+case "$optimize" in
+'') optimize='-O2 -fomit-frame-pointer';;
+esac
dlext='o'
+# Are these two different from the defaults?
cccdlflags='none'
ccdlflags='none'
lddlflags='-oformat a.out-amiga -r'
# cygwin.sh - hints for building perl using the Cygwin environment for Win32
#
-_exe='.exe'
+# not otherwise settable
exe_ext='.exe'
-# work around case-insensitive file names
firstmakefile='GNUmakefile'
-sharpbang='#!'
-startsh='#!/bin/sh'
+case "$ldlibpthname" in
+'') ldlibpthname=PATH ;;
+esac
-archname='cygwin'
-cc='gcc'
-libpth='/usr/i586-cygwin32/lib /usr/lib /usr/local/lib'
+# mandatory (overrides incorrect defaults)
+test -z "$cc" && cc='gcc'
+if test -z "$plibpth"
+then
+ plibpth=`gcc -print-file-name=libc.a`
+ plibpth=`dirname $plibpth`
+ plibpth=`cd $plibpth && pwd`
+fi
so='dll'
-libs='-lcygwin -lm -lkernel32'
-#optimize='-g'
-ccflags='-DCYGWIN -I/usr/include -I/usr/local/include'
-ldflags='-L/usr/i586-cygwin32/lib -L/usr/lib -L/usr/local/lib'
-usemymalloc='n'
-dlsrc='dl_cygwin.xs'
-cccdlflags=' '
+# - eliminate -lc, implied by gcc
+libswanted=`echo " $libswanted " | sed -e 's/ c / /g'`
+libswanted="$libswanted cygipc cygwin kernel32"
+ccflags="$ccflags -DCYGWIN"
+# - otherwise i686-cygwin
+archname='cygwin'
+
+# dynamic loading
ld='ld2'
-lddlflags='-L/usr/local/lib'
-useshrplib='true'
-libperl='libperl.a'
-dlext='dll'
-dynamic_ext=' '
+# - otherwise -fpic
+cccdlflags=' '
-man1dir=/usr/local/man/man1
-man3dir=/usr/local/man/man3
+# optional(ish)
+# - perl malloc needs to be unpolluted
+bincompat5005='undef'
-case "$ldlibpthname" in
-'') ldlibpthname=PATH ;;
-esac
+# strip exe's and dll's
+#ldflags="$ldflags -s"
+#ccdlflags="$ccdlflags -s"
+#lddlflags="$lddlflags -s"
# and it is called GEM. Many of the options we are going to use depend
# on the compiler style.
+cc=${cc:-cc}
+
# do NOT, I repeat, *NOT* take away the leading tabs
# Configure Black Magic (TM)
# reset
_DEC_cc_style=
-case "$cc" in
+case "`$cc -v 2>&1 | grep cc`" in
*gcc*) ;; # pass
*) # compile something small: taint.c is fine for this.
# the main point is the '-v' flag of 'cc'.
esac
# be nauseatingly ANSI
-case "$cc" in
+case "`$cc -v 2>&1 | grep gcc`" in
*gcc*) ccflags="$ccflags -ansi"
;;
*) ccflags="$ccflags -std"
# we want optimisation
case "$optimize" in
-'') case "$cc" in
+'') case "`$cc -v 2>&1 | grep gcc`" in
*gcc*)
optimize='-O3' ;;
*) case "$_DEC_cc_style" in
pp_sys_cflags='ccflags="$ccflags -DNO_EFF_ONLY_OK"'
+# The off_t is already 8 bytes, so we do have largefileness.
+
# This script UU/usethreads.cbu will get 'called-back' by Configure
# after it has prompted the user for whether to use threads.
cat > UU/usethreads.cbu <<'EOCBU'
case "$usethreads" in
$define|true|[yY]*)
- # Threads interfaces changed with V4.0.
- case "`uname -r`" in
- *[123].*)
- libswanted="$libswanted pthreads mach exc c_r"
- ccflags="-threads $ccflags"
- ;;
- *)
- libswanted="$libswanted pthread exc"
- ccflags="-pthread $ccflags"
+ # Threads interfaces changed with V4.0.
+ case "`$cc -v 2>&1 | grep gcc`" in
+ *gcc*)ccflags="-D_REENTRANT $ccflags" ;;
+ *) case "`uname -r`" in
+ *[123].*) ccflags="-threads $ccflags" ;;
+ *) ccflags="-pthread $ccflags" ;;
+ esac
;;
- esac
+ esac
+ case "`uname -r`" in
+ *[123].*) libswanted="$libswanted pthreads mach exc c_r" ;;
+ *) libswanted="$libswanted pthread exc" ;;
+ esac
usemymalloc='n'
;;
# * Set -Olimit to 3200 because perl_yylex.c got too big
# for the optimizer.
#
-
-
# for performance, apparently this makes a huge difference (~krader)
d_vfork='define'
-optimize='-Wc,-O3 -W0,-xstring'
+case "$optimize" in
+'') optimize='-Wc,-O3 -W0,-xstring' ;;
+esac
# We override d_socket because it's very hard for Configure to get it right
# in Dynix/Ptx, for several reasons.
d_sockpair='define'
;;
4.2*) # on ptx/TCP 4.2, we can use BSD sockets, but they're not the default.
- cppflags='-Wc,+bsd-socket'
- ccflags='-Wc,+bsd-socket'
- ldflags='-Wc,+bsd-socket'
+ cppflags="$cppflags -Wc,+bsd-socket"
+ ccflags="$ccflags -Wc,+bsd-socket"
+ ldflags="$ldflags -Wc,+bsd-socket"
d_socket='define'
d_oldsock='undef'
d_sockpair='define'
# of libswanted excludes some libraries found there. You may want to
# prevent "ucb" from being removed from libswanted and see if perl will
# build on your system.
-ldflags='-non_shared -systype svr4 -L/svr4/usr/lib -L/svr4/usr/lib/cmplrs/cc -L/usr/ccs/lib -L/svr4/usr/ucblib'
-ccflags='-systype svr4 -D__STDC__=0 -I/svr4/usr/include -I/svr4/usr/ucbinclude'
-cppflags='-D__STDC__=0 -I/svr4/usr/include -I/svr4/usr/ucbinclude'
+ldflags="$ldflags -non_shared -systype svr4 -L/svr4/usr/lib -L/svr4/usr/lib/cmplrs/cc -L/usr/ccs/lib -L/svr4/usr/ucblib"
+ccflags="$ccflags -systype svr4 -D__STDC__=0 -I/svr4/usr/include -I/svr4/usr/ucbinclude"
+cppflags="$ccflags -D__STDC__=0 -I/svr4/usr/include -I/svr4/usr/ucbinclude"
# Don't use problematic libraries:
# Kevin O'Gorman ( kevin@kosman.UUCP, kevin%kosman.uucp@nrc.com )
#
# Use Configure -Dcc=gcc to use gcc.
+
+# Why can't we just use PATH? It contains /usr/ccs/bin.
case "$cc" in
'') cc='/bin/cc'
test -f $cc || cc='/usr/ccs/bin/cc'
;;
esac
-ldflags='-L/usr/ccs/lib -L/usr/ucblib'
+
+ldflags="$ldflags -L/usr/ccs/lib -L/usr/ucblib"
test -d /usr/local/man || mansrc='none'
-ccflags='-I/usr/include -I/usr/ucbinclude'
+# Do we really need to tell cc to look in /usr/include?
+ccflags="$ccflags -I/usr/include -I/usr/ucbinclude"
libswanted=`echo " $libswanted " | sed -e 's/ malloc / /' `
d_index='undef'
d_suidsafe=define
*gcc*) ccflags="$ccflags -DUINT32_MAX_BROKEN" ;;
esac
+cat > UU/cc.cbu <<'EOSH'
+# XXX This script UU/cc.cbu will get 'called-back' by Configure after it
+# XXX has prompted the user for the C compiler to use.
+# Get gcc to share its secrets.
+echo 'main() { return 0; }' > try.c
+ # Indent to avoid propagation to config.sh
+ verbose=`${cc:-cc} -v -o try try.c 2>&1`
+if echo "$verbose" | grep '^Reading specs from' >/dev/null 2>&1; then
+ # Using gcc.
+ : nothing to see here, move on.
+else
+ # Using cc.
+ ar=${ar:-ar}
+ case "`$ar -V 2>&1`" in
+ *GNU*)
+ if test -x /usr/bin/ar; then
+ cat <<END >&2
+
+NOTE: You are using HP cc(1) but GNU ar(1). This might lead into trouble
+later on, I'm switching to HP ar to play safe.
+
+END
+ ar=/usr/bin/ar
+ fi
+ ;;
+ esac
+fi
+
+EOSH
+
# Date: Fri, 6 Sep 96 23:15:31 CDT
# From: "Daniel S. Lewart" <d-lewart@uiuc.edu>
# I looked through the gcc.info and found this:
esac
EOCBU
+# This script UU/uselfs.cbu will get 'called-back' by Configure
+# after it has prompted the user for whether to use 64 bits.
+cat > UU/uselfs.cbu <<'EOCBU'
+case "$uselargefiles" in
+$define|true|[yY]*)
+ lfcflags="`getconf _CS_XBS5_ILP32_OFFBIG_CFLAGS 2>/dev/null`"
+ lfldflags="`getconf _CS_XBS5_ILP32_OFFBIG_LDFLAGS 2>/dev/null`"
+ lflibs="`getconf _CS_XBS5_ILP32_OFFBIG_LIBS 2>/dev/null|sed -e 's@^-l@@' -e 's@ -l@ @g`"
+ case "$lfcflags$lfldflags$lflibs" in
+ '');;
+ *) # This sucks. To get the HP-UX strict ANSI mode (-Aa) to
+ # approve of large file offsets, we must turn on the 64-bitness
+ # (+DD64), too. A callback file (a hack) calling another, yuck.
+ case "$use64bits" in
+ $undef|false|[nN]*|'')
+ use64bits="$define"
+ if $test -f use64bits.cbu; then
+ echo "(Large files in HP-UX require also 64-bitness, picking up 64-bit hints...)"
+ . ./use64bits.cbu
+ fi
+ ;;
+ esac
+ ccflags="$ccflags $lfcflags"
+ ldflags="$ldflags $ldldflags"
+ libswanted="$libswanted $lflibs"
+ ;;
+ esac
+ lfcflags=''
+ lfldflags=''
+ lflibs=''
+ ;;
+esac
+EOCBU
+
# This script UU/use64bits.cbu will get 'called-back' by Configure
# after it has prompted the user for whether to use 64 bits.
cat > UU/use64bits.cbu <<'EOCBU'
-case "$use64bits" in
+case "$ccflags" in
+*+DD64*) # Been here, done this (via uselfs.cbu, most likely.)
+ ;;
+*) case "$use64bits" in
$define|true|[yY]*)
if [ "$xxOsRevMajor" -lt 11 ]; then
cat <<EOM >&4
EOM
exit 1
fi
- ccflags="$ccflags +DD64 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
+ ccflags="$ccflags +DD64"
ldflags="$ldflags +DD64"
ld=/usr/bin/ld
set `echo " $libswanted " | sed -e 's@ dl @ @'`
libswanted="$*"
glibpth="/lib/pa20_64"
+ esac
+ ;;
esac
EOCBU
+
+
+
ldflags="$ldflags -mabi=64 -L/usr/lib64"
lddlflags="$lddlflags -mabi=64"
;;
+ *) ccflags="$ccflags -DIRIX32_SEMUN_BROKEN_BY_GCC"
+ ;;
esac
;;
*)
esac
EOCBU
+# The -n32 makes off_t to be 8 bytes, so we should have largefileness.
+
# This script UU/use64bits.cbu will get 'called-back' by Configure
# after it has prompted the user for whether to use 64 bits.
cat > UU/use64bits.cbu <<'EOCBU'
exit 1
;;
esac
- case "$ccflags" in
+ case "$cc $ccflags" in
*-n32*)
- ccflags="$ccflags -DUSE_LONG_LONG"
+ case "$ccflags" in
+ *-DUSE_LONG_LONG) ;;
+ *) ccflags="$ccflags -DUSE_LONG_LONG" ;;
+ esac
archname64="-n32"
;;
esac
#'osfmach3ppc') ccdlflags='-Wl,-E' ;;
#esac
+case "`uname -r`" in
+sparc-linux)
+ case "$cccdlflags" in
+ *-fpic*) cccdlflags="`echo $cccdlflags|sed 's/-fpic/-fPIC/'`" ;;
+ *) cccdlflags="$cccdlflags -fPIC" ;;
+ esac
+ ;;
+esac
+
# This script UU/usethreads.cbu will get 'called-back' by Configure
# after it has prompted the user for whether to use threads.
cat > UU/usethreads.cbu <<'EOCBU'
cc='gcc'
so='none'
usemymalloc='n'
+
+# When LynxOS runs a script with "#!" it sets argv[0] to the script name
+toke_cflags='ccflags="$ccflags -DARG_ZERO_IS_SCRIPT"'
# The weird include path is really to work around some bugs in
# broken system header files.
-ccflags="-D__MINT__ -Uatarist -DDEBUGGING -I$here/../mint"
+ccflags="$ccflags -D__MINT__ -Uatarist -DDEBUGGING -I$here/../mint"
# libs
#
# Some good answers to the questions in Configure:
+# Does Configure really get all these wrong?
usenm='true'
d_suidsafe='true'
clocktype='long'
# Revised again for 5.004_69 by Mark Bixby, markb@cccd.edu.
#
osname='mpeix'
-osvers='5.5'
+osvers='5.5' # Isn't there a way to determine this dynamically?
#
# Force Configure to use our wrapper mpeix/nm script
#
#
# Various directory locations.
#
-prefix='/PERL/PUB'
+# Which ones of these does Configure get wrong?
+test -z "$prefix" && prefix='/PERL/PUB'
archname='PA-RISC1.1'
bin="$prefix"
installman1dir="$prefix/man/man1"
#
# Compiling.
#
-cc='gcc'
+test -z "$cc" && cc='gcc'
cccdlflags='none'
-ccflags='-DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE -D_POSIX_JOB_CONTROL -DIS_SOCKET_CLIB_ITSELF'
-locincpth='/usr/local/include /usr/contrib/include /BIND/PUB/include'
-optimize='-O2'
+ccflags="$ccflags -DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE -D_POSIX_JOB_CONTROL -DIS_SOCKET_CLIB_ITSELF"
+locincpth="$locincpth /usr/local/include /usr/contrib/include /BIND/PUB/include"
+test -z "$optimize" && optimize="-O2"
ranlib='/bin/true'
# Special compiling options for certain source files.
+# But what if you want -g?
regcomp_cflags='optimize=-O'
toke_cflags='ccflags="$ccflags -DARG_ZERO_IS_SCRIPT"'
#
# Linking.
#
lddlflags='-b'
-libs='-lbind -lsyslog -lcurses -lsvipc -lsocket -lm -lc'
-loclibpth='/usr/local/lib /usr/contrib/lib /BIND/PUB/lib /SYSLOG/PUB'
+# What if you want additional libs (e.g. gdbm)?
+# This should remove the unwanted libraries from $libswanted and
+# add on whatever ones are needed instead.
+libs="$libs -lbind -lsyslog -lcurses -lsvipc -lsocket -lm -lc"
+loclibpth="$loclibpth /usr/local/lib /usr/contrib/lib /BIND/PUB/lib /SYSLOG/PUB"
#
# External functions and data items.
#
+# Does Configure *really* get *all* of these wrong?
+#
d_crypt='define'
d_difftime='define'
d_dlerror='undef'
# use the following two lines if you have perl5.003_22 or better and
# do not encounter intermittent core dumps.
-ccflags='-DUSE_NEXT_CTYPE'
+ccflags="$ccflags -DUSE_NEXT_CTYPE"
usemymalloc='n'
######################################################################
echo It will not be found there. Try moving it to >&4
echo /NextDeveloper/Headers/bsd/gdbm.h. >&4
-ccflags='-DUSE_NEXT_CTYPE -DNEXT30_NO_ATTRIBUTE'
+ccflags="$ccflags -DUSE_NEXT_CTYPE -DNEXT30_NO_ATTRIBUTE"
POSIX_cflags='ccflags="-posix $ccflags"'
useposix='undef'
-ldflags='-u libsys_s'
-libswanted='dbm gdbm db'
+ldflags="$ldflags -u libsys_s"
+libswanted="$libswanted dbm gdbm db"
#
lddlflags='-r'
# Give cccdlflags an empty value since Configure will detect we are
libswanted=' '
libc='/NextLibrary/Frameworks/System.framework/System'
-ldflags='-dynamic -prebind'
-lddlflags='-dynamic -bundle -undefined suppress'
-ccflags='-dynamic -fno-common -DUSE_NEXT_CTYPE -DUSE_PERL_SBRK'
+ldflags="$ldflags -dynamic -prebind"
+lddlflags="$lddlflags -dynamic -bundle -undefined suppress"
+ccflags="$ccflags -dynamic -fno-common -DUSE_NEXT_CTYPE -DUSE_PERL_SBRK"
cccdlflags='none'
ld='cc'
#optimize='-g -O'
set `emxrev -f emxlibcm`
emxcrtrev=$5
+# indented to not put it into config.sh
+ _defemxcrtrev=-D_EMX_CRT_REV_=$emxcrtrev
so='dll'
aout_ldflags="$aout_ldflags"
aout_d_fork='define'
-aout_ccflags='-DPERL_CORE -DDOSISH -DPERL_IS_AOUT -DOS2=2 -DEMBED -I.'
-aout_cppflags='-DPERL_CORE -DDOSISH -DPERL_IS_AOUT -DOS2=2 -DEMBED -I.'
+aout_ccflags="-DDOSISH -DPERL_IS_AOUT -DOS2=2 -DEMBED -I. $_defemxcrtrev"
+aout_cppflags="-DDOSISH -DPERL_IS_AOUT -DOS2=2 -DEMBED -I. $_defemxcrtrev"
aout_use_clib='c'
aout_usedl='undef'
aout_archobjs="os2.o dl_os2.o"
# Recursive regmatch may eat 2.5M of stack alone.
ldflags='-Zexe -Zomf -Zmt -Zcrtdll -Zstack 32000'
if [ $emxcrtrev -ge 50 ]; then
- ccflags='-Zomf -Zmt -DDOSISH -DOS2=2 -DEMBED -I.'
+ ccflags="-Zomf -Zmt -DDOSISH -DOS2=2 -DEMBED -I. $_defemxcrtrev"
else
- ccflags='-Zomf -Zmt -DDOSISH -DOS2=2 -DEMBED -I. -DEMX_BAD_SBRK'
+ ccflags="-Zomf -Zmt -DDOSISH -DOS2=2 -DEMBED -I. -DEMX_BAD_SBRK $_defemxcrtrev"
fi
use_clib='c_import'
usedl='define'
esac
EOCBU
+# This script UU/uselfs.cbu will get 'called-back' by Configure
+# after it has prompted the user for whether to use large files.
+cat > UU/uselfs.cbu <<'EOCBU'
+case "$uselargefiles" in
+$define|true|[yY]*)
+ lfcflags="`getconf LFS_CFLAGS 2>/dev/null`"
+ lfldflags="`getconf LFS_LDFLAGS 2>/dev/null`"
+ lflibs="`getconf LFS_LIBS 2>/dev/null|sed -e 's@^-l@@' -e 's@ -l@ @g`"
+ case "$lfcflags$lfldflags$lflibs" in
+ '');;
+ *) uselonglong="$define"
+ echo "(Large files in Solaris require also long longs, using long longs...)"
+ ccflags="$ccflags -DUSE_LONG_LONG $lfcflags"
+ ldflags="$ldflags $ldldflags"
+ libswanted="$libswanted $lflibs"
+ ;;
+ esac
+ lfcflags=''
+ lfldflags=''
+ lflibs=''
+ ;;
+esac
+EOCBU
+
# This script UU/use64bits.cbu will get 'called-back' by Configure
# after it has prompted the user for whether to use 64 bits.
cat > UU/use64bits.cbu <<'EOCBU'
exit 1
;;
esac
- ccflags="$ccflags `getconf LFS_CFLAGS`"
- ldflags="$ldflags `getconf LFS_LDFLAGS`"
- libswanted="$libswanted `getconf LFS_LIBS`"
- ccflags="$ccflags -DUSE_LONG_LONG"
+ case "$ccflags" in
+ *-DUSE_LONG_LONG*) ;;
+ *) ccflags="$ccflags -DUSE_LONG_LONG" ;;
+ esac
# When a 64-bit cc becomes available $archname64
# may need setting so that $archname gets it attached.
;;
-# svr5 hints, System V Release 5.x
-# Last modified 1999/09/21 by Boyd Gerber, gerberb@zenez.com
-
+# svr5 hints, System V Release 5.x (UnixWare 7)
+# mods after mail fm Andy Dougherty
+# Reworked by hops@sco.com Sept/Oct 1999 for UW7.1 platform support
+# Boyd Gerber, gerberb@zenez.com 1999/09/21 for threads support.
+# Originally taken from svr4 hints.sh 21-Sep-98 hops@sco.com
+# which was version of 1996/10/25 by Tye McQueen, tye@metronet.com
+
+# Use Configure -Dusethreads to enable threads.
# Use Configure -Dcc=gcc to use gcc.
case "$cc" in
-'') cc='/bin/cc'
- test -f $cc || cc='/usr/ccs/bin/cc'
- ;;
- *)
- case "$gccversion" in
- *2.95*)
- ccflags='-fno-strict-aliasing'
- ;;
- *);;
+*gcc*)
+ # "$gccversion" not set yet
+ vers=`gcc -v 2>&1 | sed -n -e 's@.*version \([^ ][^ ]*\) .*@\1@p'`
+ case $vers in
+ *2.95*)
+ ccflags='-fno-strict-aliasing'
+ # More optimisation provided in gcc-2.95 causes miniperl to segv.
+ # -fno-strict-aliasing is supposed to correct this but
+ # if it doesn't and you get segv when the build runs miniperl then
+ # disable optimisation as below
+ # optimize=' '
+ ;;
esac
- ;;
+ ;;
esac
-# want_ucb=''
-# want_dbm='yes'
-want_gdbm='yes'
-
-# We include support for using libraries in /usr/ucblib, but the setting
-# of libswanted excludes some libraries found there. If you run into
-# problems, you may have to remove "ucb" from libswanted. Just delete
-# the comment '#' from the sed command below.
-# ldflags='-L/usr/ccs/lib -L/usr/ucblib'
-# ccflags='-I/usr/include -I/usr/ucbinclude'
-# Don't use problematic libraries:
-libswanted=`echo " $libswanted " | sed -e 's/ malloc / /'` # -e 's/ ucb / /'`
-# libmalloc.a - Probably using Perl's malloc() anyway.
-# libucb.a - Remove it if you have problems ld'ing. We include it because
-# it is needed for ODBM_File and NDBM_File extensions.
+# Hardwire the processor to 586 for consistancy with autoconf
+# archname='i586-svr5'
+# -- seems this is generally disliked by perl porters so leave it to float
+
+# Our default setup excludes anything from /usr/ucblib (and consequently dbm)
+# as later modules assume symbols found are available in shared libs
+# On svr5 these are static archives which causes problems for
+# dynamic modules loaded later (and ucblib is a bad dream anyway)
+#
+# However there is a dbm library built from the ucb sources outside ucblib
+# at http://www.sco.com/skunkware (installing into /usr/local) so if we
+# detect this we'll use it. You can change the default
+# (to allow ucblib and its dbm or disallowing non ucb dbm) by
+# changing 'want_*' config values below to '' to disable or otherwise to enable
+
+# Leave leading tabs so Configure doesn't propagate variables to config.sh
+
+ want_ucb='' # don't use anything from /usr/ucblib - icky
+ want_dbm='yes' # use dbm if can find library in /usr/local/lib
+ want_gdbm='yes' # use gdbm if can find library in /usr/local/lib
+ want_udk70='' # link with old static libc pieces
+ # link with udk70 if building on 7.1 abd want resulting binary
+ # to run on uw7.0* - it will link in referenced static symbols
+ # of libc that are (now) in the shared libc.so on 7.1 but were
+ # not there in 7.0.
+ # There are still scenarios where this is still insufficient so
+ # overall it is preferable to get ptf7051e
+ # ftp://ftp.sco.com/SLS/ptf7051e.Z
+ # installed on any/all 7.0 systems and leave the above unset.
if [ "$want_ucb" ] ; then
- ldflags= '-L/usr/ccs/lib -L/usr/ucblib'
- ccflags='-I/usr/include -I/usr/ucbinclude'
- if [ -r /usr/ucblib/libucb.a ]; then # If using BSD-compat. library:
- d_Gconvert='gcvt((x),(n),(b))' # Try gcvt() before gconvert().
- # Use the "native" counterparts, not the BSD emulation stuff:
- d_bcmp='undef' d_bcopy='undef' d_bzero='undef' d_safebcpy='undef'
- d_index='undef' d_killpg='undef' d_getprior='undef' d_setprior='undef'
- d_setlinebuf='undef'
- # d_setregid='undef' d_setreuid='undef' # ???
- fi
+ ldflags= '-L/usr/ucblib'
+ ccflags='-I/usr/ucbinclude'
+ # /usr/ccs/include and /usr/ccs/lib are used implicitly by cc as reqd
else
-# libswanted=`echo " $libswanted " | sed -e 's/ ucb / /' -e 's/ dbm / /'`
libswanted=`echo " $libswanted " | sed -e 's/ ucb / /'`
glibpth=`echo " $glibpth " | sed -e 's/ \/usr\/ucblib / /'`
- # a non ucb native version of libdbm for /usr/local is available from
- # http://www.sco.com/skunkware
- # if its installed (and not overidden) we'll use it.
+ # If see libdbm in /usr/local and not overidden assume its the
+ # non ucblib rebuild from skunkware and use it
if [ ! -f /usr/local/lib/libdbm.so -o ! "$want_dbm" ] ; then
+ i_dbm='undef'
libswanted=`echo " $libswanted " | sed -e 's/ dbm / /'`
fi
fi
-if [ "$want_gdbm" -a -f /usr/local/lib/libgdbm.so ] ; then
- i_gdbm='define'
-else
- i_gdbm='undef'
+if [ ! "$want_gdbm" ] ; then
+ i_gdbm='undef'
libswanted=`echo " $libswanted " | sed -e 's/ gdbm / /'`
fi
+
# Don't use problematic libraries:
# libmalloc.a - Probably using Perl's malloc() anyway.
-# libc: on UW7 don't want -lc explicitly - cc gives warnings/errors
+# libc: on UW7 don't want -lc explicitly as native cc gives warnings/errors
libswanted=`echo " $libswanted " | sed -e 's/ malloc / /' -e 's/ c / /'`
# remove /shlib and /lib from library search path as both symlink to /usr/lib
# where runtime shared libc is
glibpth=`echo " $glibpth " | sed -e 's/ \/shlib / /' -e 's/ \/lib / /`
-# UnixWare has /usr/lib/libc.so.1, /usr/lib/libc.so.1.1, and
-# /usr/ccs/lib/libc.so. Configure chooses libc.so.1.1 while it
-# appears that /usr/ccs/lib/libc.so contains more symbols:
-#
-# Try the following if you want to use nm-extraction. We'll just
-# skip the nm-extraction phase, since searching for all the different
-# library versions will be hard to keep up-to-date.
-#
-# if [ "" = "$libc" -a -f /usr/ccs/lib/libc.so -a \
-# -f /usr/lib/libc.so.1 -a -f /usr/lib/libc.so.1.1 ]; then
-# if nm -h /usr/ccs/lib/libc.so | egrep '\<_?select$' >/dev/null; then
-# if nm -h /usr/lib/libc.so.1 | egrep '\<_?select$'` >/dev/null ||
-# nm -h /usr/lib/libc.so.1.1 | egrep '\<_?select$'` >/dev/null; then
-# :
-# else
-# libc=/usr/ccs/lib/libc.so
-# fi
-# fi
-# fi
-#
-# Don't bother with nm. Just compile & link a small C program.
-case "$usenm" in
-'') usenm=false;;
-esac
+# Don't use BSD emulation pieces (/usr/ucblib) regardless
+# these would probably be autonondetected anyway but ...
+d_Gconvert='gcvt((x),(n),(b))' # Try gcvt() before gconvert().
+d_bcopy='undef' d_bcmp='undef' d_bzero='undef' d_safebcpy='undef'
+d_index='undef' d_killpg='undef' d_getprior='undef' d_setprior='undef'
+d_setlinebuf='undef'
+d_setregid='undef' d_setreuid='undef' # -- in /usr/lib/libc.so.1
+
# Broken C-Shell tests (Thanks to Tye McQueen):
# The OS-specific checks may be obsoleted by the this generic test.
d_csh='undef'
fi
-# Unixware-specific problems. The undocumented -X argument to uname
-# is probably a reasonable way of detecting UnixWare.
+# Unixware-specific problems. UW7 give correctname with uname -s
# UnixWare has a broken csh. (This might already be detected above).
# Configure can't detect memcpy or memset on Unixware 2 or 7
#
# Leave leading tabs on the next two lines so Configure doesn't
# propagate these variables to config.sh
uw_ver=`uname -v`
- uw_isuw=`uname -X 2>&1 | grep Release`
+ uw_isuw=`uname -s 2>&1`
-if [ "$uw_isuw" = "Release = 5" ]; then
+if [ "$uw_isuw" = "UnixWare" ]; then
case $uw_ver in
+ 7.1*)
+ d_csh='undef'
+ d_memcpy='define'
+ d_memset='define'
+ stdio_cnt='((fp)->__cnt)'
+ d_stdio_cnt_lval='define'
+ stdio_ptr='((fp)->__ptr)'
+ d_stdio_ptr_lval='define'
+
+ d_bcopy='define' # In /usr/lib/libc.so.1
+ d_setregid='define' # "
+ d_setreuid='define' # "
+
+ if [ -f /usr/ccs/lib/libcudk70.a -a "$want_udk70" ] ; then
+ libswanted=" $libswanted cudk70"
+ fi
+ ;;
7*)
d_csh='undef'
d_memcpy='define'
;;
esac
fi
+# End of Unixware-specific tests.
###############################################################
-# Dynamic loading section:
+# Dynamic loading section: Is default so it should just happen.
+# set below to explicitly force.
+# usedl='define'
+# dlext='so'
+# dlsrc='dl_dlopen.xs'
#
# ccdlflags : must tell the linker to export all global symbols
# cccdlflags: must tell the compiler to generate relocatable code
# lddlflags : must tell the linker to output a shared library
-#
-# /usr/local/lib is added for convenience, since additional libraries
-# are usually put there
-#
+
# use shared perl lib
useshrplib='true'
case "$cc" in
*gcc*)
- ccdlflags='-Xlinker -Bexport -L/usr/local/lib'
+ ccdlflags='-Xlinker -Bexport '
cccdlflags='-fpic'
- lddlflags='-G -L/usr/local/lib'
+ lddlflags='-G '
;;
+
*)
- ccdlflags='-Wl,-Bexport -L/usr/local/lib'
- cccdlflags='-KPIC'
- lddlflags='-G -Wl,-Bexport -L/usr/local/lib'
+ ccdlflags='-Wl,-Bexport'
+ cccdlflags='-Kpic'
+ lddlflags='-G -Wl,-Bexport'
;;
esac
-###############################################################
-# Use dynamic loading
-usedl='define'
-dlext='so'
-dlsrc='dl_dlopen.xs'
-
-# Configure may fail to find lstat() since it's a static/inline function
-# in <sys/stat.h> on Unisys U6000 SVR4, UnixWare 2.x, and possibly other
-# SVR4 derivatives. (Though UnixWare has it in /usr/ccs/lib/libc.so.)
-d_lstat=define
-
-
-# DDE SMES Supermax Enterprise Server
-case "`uname -sm`" in
-"UNIX_SV SMES")
- # the *grent functions are in libgen.
- libswanted="$libswanted gen"
- # csh is broken (also) in SMES
- # This may already be detected by the generic test above.
- d_csh='undef'
- case "$cc" in
- *gcc*) ;;
- *) # for cc we need -K PIC (not -K pic)
- cccdlflags="$cccdlflags -K PIC"
- ;;
- esac
- ;;
-esac
-
+############################################################################
+# Thread support
+# use Configure -Dusethreads to enable
# This script UU/usethreads.cbu will get 'called-back' by Configure
# after it has prompted the user for whether to use threads.
cat > UU/usethreads.cbu <<'EOCBU'
case "$usethreads" in
$define|true|[yY]*)
ccflags="$ccflags"
- set `echo X "$libswanted "| sed -e 's/ c / pthread c /'`
shift
libswanted="$*"
case "$cc" in
*gcc*)
ccflags="-D_REENTRANT $ccflags -fpic -pthread"
cccdlflags='-fpic'
- lddlflags='-pthread -G -L/usr/local/lib '
+ lddlflags='-pthread -G '
;;
*)
ccflags="-D_REENTRANT $ccflags -KPIC -Kthread"
- ccdlflags='-Kthread -Wl,-Bexport -L/usr/local/lib'
+ ccdlflags='-Kthread -Wl,-Bexport'
cccdlflags='-KPIC -Kthread'
- lddlflags='-G -Kthread -Wl,-Bexport -L/usr/local/lib'
- ldflags='-Kthread -L/usr/local/lib -L/usr/gnu/lib'
+ lddlflags='-G -Kthread -Wl,-Bexport '
+ ldflags='-Kthread'
;;
esac
esac
EOCBU
-# End of Unixware-specific tests.
-# Configure may fail to find lstat() since it's a static/inline function
-# in <sys/stat.h> on Unisys U6000 SVR4, UnixWare 2.x, and possibly other
-# SVR4 derivatives. (Though UnixWare has it in /usr/ccs/lib/libc.so.)
-d_lstat=define
-d_suidsafe='define' # "./Configure -d" can't figure this out easilly
+d_suidsafe='define' # "./Configure -d" can't figure this out easily
+
+################## final caveat msgs to builder ###############
+cat <<'EOM' >&4
+
+If you wish to use dynamic linking, you must use
+ LD_LIBRARY_PATH=`pwd`; export LD_LIBRARY_PATH
+or
+ setenv LD_LIBRARY_PATH `pwd`
+before running make.
+
+If you are using shared libraries from /usr/local/lib
+for libdbm or libgdbm you may need to set
+ LD_RUN_PATH=/usr/local/lib; export LD_RUN_PATH
+in order for Configure to compile the simple test program
+EOM
#define PERL_IN_HV_C
#include "perl.h"
-#if defined(STRANGE_MALLOC) || defined(MYMALLOC)
-# define ARRAY_ALLOC_BYTES(size) ( (size)*sizeof(HE*) )
-#else
-# define MALLOC_OVERHEAD 16
-# define ARRAY_ALLOC_BYTES(size) ( ((size) < 64) \
- ? (size)*sizeof(HE*) \
- : (size)*sizeof(HE*)*2 - MALLOC_OVERHEAD )
-#endif
-
STATIC HE*
S_new_he(pTHX)
{
unsharepvn(HEK_KEY(hek),HEK_LEN(hek),HEK_HASH(hek));
}
+#if defined(USE_ITHREADS)
+HE *
+Perl_he_dup(pTHX_ HE *e, bool shared)
+{
+ HE *ret;
+
+ if (!e)
+ return Nullhe;
+ /* look for it in the table first */
+ ret = (HE*)ptr_table_fetch(PL_ptr_table, e);
+ if (ret)
+ return ret;
+
+ /* create anew and remember what it is */
+ ret = new_he();
+ ptr_table_store(PL_ptr_table, e, ret);
+
+ HeNEXT(ret) = he_dup(HeNEXT(e),shared);
+ if (HeKLEN(e) == HEf_SVKEY)
+ HeKEY_sv(ret) = SvREFCNT_inc(sv_dup(HeKEY_sv(e)));
+ else if (shared)
+ HeKEY_hek(ret) = share_hek(HeKEY(e), HeKLEN(e), HeHASH(e));
+ else
+ HeKEY_hek(ret) = save_hek(HeKEY(e), HeKLEN(e), HeHASH(e));
+ HeVAL(ret) = SvREFCNT_inc(sv_dup(HeVAL(e)));
+ return ret;
+}
+#endif /* USE_ITHREADS */
+
/* (klen == HEf_SVKEY) is special for MAGICAL hv entries, meaning key slot
* contains an SV* */
|| (HvNAME(hv) && strEQ(HvNAME(hv),ENV_HV_NAME))
#endif
)
- Newz(503,xhv->xhv_array, ARRAY_ALLOC_BYTES(xhv->xhv_max + 1), char);
+ Newz(503, xhv->xhv_array,
+ PERL_HV_ARRAY_ALLOC_BYTES(xhv->xhv_max + 1), char);
else
return 0;
}
|| (HvNAME(hv) && strEQ(HvNAME(hv),ENV_HV_NAME))
#endif
)
- Newz(503,xhv->xhv_array, ARRAY_ALLOC_BYTES(xhv->xhv_max + 1), char);
+ Newz(503, xhv->xhv_array,
+ PERL_HV_ARRAY_ALLOC_BYTES(xhv->xhv_max + 1), char);
else
return 0;
}
PERL_HASH(hash, key, klen);
if (!xhv->xhv_array)
- Newz(505, xhv->xhv_array, ARRAY_ALLOC_BYTES(xhv->xhv_max + 1), char);
+ Newz(505, xhv->xhv_array,
+ PERL_HV_ARRAY_ALLOC_BYTES(xhv->xhv_max + 1), char);
oentry = &((HE**)xhv->xhv_array)[hash & (I32) xhv->xhv_max];
i = 1;
PERL_HASH(hash, key, klen);
if (!xhv->xhv_array)
- Newz(505, xhv->xhv_array, ARRAY_ALLOC_BYTES(xhv->xhv_max + 1), char);
+ Newz(505, xhv->xhv_array,
+ PERL_HV_ARRAY_ALLOC_BYTES(xhv->xhv_max + 1), char);
oentry = &((HE**)xhv->xhv_array)[hash & (I32) xhv->xhv_max];
i = 1;
xhv->xhv_fill--;
if (flags & G_DISCARD)
sv = Nullsv;
- else
- sv = sv_mortalcopy(HeVAL(entry));
+ else {
+ sv = sv_2mortal(HeVAL(entry));
+ HeVAL(entry) = &PL_sv_undef;
+ }
if (entry == xhv->xhv_eiter)
HvLAZYDEL_on(hv);
else
xhv->xhv_fill--;
if (flags & G_DISCARD)
sv = Nullsv;
- else
- sv = sv_mortalcopy(HeVAL(entry));
+ else {
+ sv = sv_2mortal(HeVAL(entry));
+ HeVAL(entry) = &PL_sv_undef;
+ }
if (entry == xhv->xhv_eiter)
HvLAZYDEL_on(hv);
else
PL_nomemok = TRUE;
#if defined(STRANGE_MALLOC) || defined(MYMALLOC)
- Renew(a, ARRAY_ALLOC_BYTES(newsize), char);
+ Renew(a, PERL_HV_ARRAY_ALLOC_BYTES(newsize), char);
if (!a) {
PL_nomemok = FALSE;
return;
}
#else
#define MALLOC_OVERHEAD 16
- New(2, a, ARRAY_ALLOC_BYTES(newsize), char);
+ New(2, a, PERL_HV_ARRAY_ALLOC_BYTES(newsize), char);
if (!a) {
PL_nomemok = FALSE;
return;
}
Copy(xhv->xhv_array, a, oldsize * sizeof(HE*), char);
if (oldsize >= 64) {
- offer_nice_chunk(xhv->xhv_array, ARRAY_ALLOC_BYTES(oldsize));
+ offer_nice_chunk(xhv->xhv_array, PERL_HV_ARRAY_ALLOC_BYTES(oldsize));
}
else
Safefree(xhv->xhv_array);
if (a) {
PL_nomemok = TRUE;
#if defined(STRANGE_MALLOC) || defined(MYMALLOC)
- Renew(a, ARRAY_ALLOC_BYTES(newsize), char);
+ Renew(a, PERL_HV_ARRAY_ALLOC_BYTES(newsize), char);
if (!a) {
PL_nomemok = FALSE;
return;
}
#else
- New(2, a, ARRAY_ALLOC_BYTES(newsize), char);
+ New(2, a, PERL_HV_ARRAY_ALLOC_BYTES(newsize), char);
if (!a) {
PL_nomemok = FALSE;
return;
}
Copy(xhv->xhv_array, a, oldsize * sizeof(HE*), char);
if (oldsize >= 64) {
- offer_nice_chunk(xhv->xhv_array, ARRAY_ALLOC_BYTES(oldsize));
+ offer_nice_chunk(xhv->xhv_array, PERL_HV_ARRAY_ALLOC_BYTES(oldsize));
}
else
Safefree(xhv->xhv_array);
Zero(&a[oldsize * sizeof(HE*)], (newsize-oldsize) * sizeof(HE*), char); /* zero 2nd half*/
}
else {
- Newz(0, a, ARRAY_ALLOC_BYTES(newsize), char);
+ Newz(0, a, PERL_HV_ARRAY_ALLOC_BYTES(newsize), char);
}
xhv->xhv_max = --newsize;
xhv->xhv_array = a;
#endif
if (!xhv->xhv_array)
- Newz(506,xhv->xhv_array, ARRAY_ALLOC_BYTES(xhv->xhv_max + 1), char);
+ Newz(506, xhv->xhv_array,
+ PERL_HV_ARRAY_ALLOC_BYTES(xhv->xhv_max + 1), char);
if (entry)
entry = HeNEXT(entry);
while (!entry) {
#define HEK_HASH(hek) (hek)->hek_hash
#define HEK_LEN(hek) (hek)->hek_len
#define HEK_KEY(hek) (hek)->hek_key
+
+#if defined(STRANGE_MALLOC) || defined(MYMALLOC)
+# define PERL_HV_ARRAY_ALLOC_BYTES(size) ((size) * sizeof(HE*))
+#else
+# define MALLOC_OVERHEAD 16
+# define PERL_HV_ARRAY_ALLOC_BYTES(size) \
+ (((size) < 64) \
+ ? (size) * sizeof(HE*) \
+ : (size) * sizeof(HE*) * 2 - MALLOC_OVERHEAD)
+#endif
use Cwd;
use Pod::Html;
-umask 022;
-
=head1 NAME
installhtml - converts a collection of POD pages to HTML format.
use vars qw($packlist);
require Cwd;
-umask 022;
$ENV{SHELL} = 'sh' if $^O eq 'os2';
-$ver = $];
-$release = substr($ver,0,3); # Not used presently.
-$patchlevel = substr($ver,3,2);
+$ver = $Config{version};
+$release = substr($],0,3); # Not used presently.
+$patchlevel = substr($],3,2);
die "Patchlevel of perl ($patchlevel)",
"and patchlevel of config.sh ($Config{'PERL_VERSION'}) don't match\n"
if $patchlevel != $Config{'PERL_VERSION'};
runpod2man('utils', $man1dir, $man1ext, 'dprofpp');
runpod2man('x2p', $man1dir, $man1ext, 's2p');
runpod2man('x2p', $man1dir, $man1ext, 'a2p.pod');
+runpod2man('x2p', $man1dir, $man1ext, 'find2perl');
runpod2man('pod', $man1dir, $man1ext, 'pod2man');
runpod2man('pod', $man1dir, $man1ext, 'pod2html');
+runpod2man('pod', $man1dir, $man1ext, 'pod2text');
runpod2man('pod', $man1dir, $man1ext, 'pod2usage');
runpod2man('pod', $man1dir, $man1ext, 'podchecker');
runpod2man('pod', $man1dir, $man1ext, 'podselect');
# of the pod. This might be useful for pod2man someday.
if ($script) {
@modpods = ($script);
- } else {
+ }
+ else {
@modpods = ();
find(\&lsmodpods, '.');
}
# Convert name from File/Basename.pm to File::Basename.3 format,
# if necessary.
$manpage =~ s#\.p(m|od)$##;
- if ($^O eq 'os2' || $^O eq 'amigaos' || $^O eq 'uwin' || $^O =~ /cygwin/) {
+ if ($^O eq 'os2' || $^O eq 'amigaos' || $^O eq 'uwin' || $^O eq 'cygwin') {
$manpage =~ s#/#.#g;
- } else {
+ }
+ else {
$manpage =~ s#/#::#g;
}
$tmp = "${mandir}/${manpage}.tmp";
$manpage = "${mandir}/${manpage}.${manext}";
if (&cmd("$pod2man $mod > $tmp") == 0 && !$notify && -s $tmp) {
- rename($tmp, $manpage) && next;
+ if (rename($tmp, $manpage)) {
+ $packlist->{$manpage} = { type => 'file' };
+ next;
+ }
}
unless ($notify) {
- unlink($tmp);
+ unlink($tmp);
}
}
chdir "$builddir" || die "Unable to cd back to $builddir directory!\n$!\n";
my $cnt = 0;
foreach $name (@names) {
-next unless -e $name;
-chmod 0777, $name if $^O eq 'os2';
-print STDERR " unlink $name\n";
-( CORE::unlink($name) and ++$cnt
- or warn "Couldn't unlink $name: $!\n" ) unless $notify;
+ next unless -e $name;
+ chmod 0777, $name if $^O eq 'os2';
+ print STDERR " unlink $name\n";
+ ( CORE::unlink($name) and ++$cnt
+ or warn "Couldn't unlink $name: $!\n" ) unless $notify;
}
return $cnt;
}
? die "AFS" # okay inside eval {}
: warn "Couldn't link $from to $to: $!\n"
unless $notify;
- $packlist->{$to} = { type => 'file' };
};
if ($@) {
File::Copy::copy($from, $to)
? $success++
: warn "Couldn't copy $from to $to: $!\n"
unless $notify;
- $packlist->{$to} = { type => 'file' };
}
$success;
}
sub rename {
local($from,$to) = @_;
if (-f $to and not unlink($to)) {
-my($i);
-for ($i = 1; $i < 50; $i++) {
- last if CORE::rename($to, "$to.$i");
-}
-warn("Cannot rename to `$to.$i': $!"), return 0
- if $i >= 50; # Give up!
+ my($i);
+ for ($i = 1; $i < 50; $i++) {
+ last if CORE::rename($to, "$to.$i");
+ }
+ warn("Cannot rename to `$to.$i': $!"), return 0
+ if $i >= 50; # Give up!
}
link($from,$to) || return 0;
unlink($from);
- $packlist->{$to} = { type => 'file' };
}
sub chmod {
$Is_VMS = $^O eq 'VMS';
$Is_W32 = $^O eq 'MSWin32';
$Is_OS2 = $^O eq 'os2';
- $Is_Cygwin = $^O =~ /cygwin/i;
+ $Is_Cygwin = $^O eq 'cygwin';
if ($Is_VMS) { eval 'use VMS::Filespec;' }
}
# Allow ``make install PERLNAME=something_besides_perl'':
my $perl = defined($ENV{PERLNAME}) ? $ENV{PERLNAME} : 'perl';
-# This is the base used for versioned names, like "perl5.005".
+# This is the base used for versioned names, like "perl5.6.0".
# It's separate because a common use of $PERLNAME is to install
# perl as "perl5", if that's used as base for versioned files you
-# get "perl55.005".
+# get "perl55.6.0".
my $perl_verbase = defined($ENV{PERLNAME_VERBASE})
? $ENV{PERLNAME_VERBASE}
: $perl;
shift;
}
-umask 022 unless $Is_VMS;
-
my @scripts = qw(utils/c2ph utils/h2ph utils/h2xs utils/perlbug utils/perldoc
utils/pl2pm utils/splain utils/perlcc utils/dprofpp
x2p/s2p x2p/find2perl
}
}, 'ext');
-my $ver = $];
-my $release = substr($ver,0,3); # Not used presently.
-my $patchlevel = substr($ver,3,2);
+my $ver = $Config{version};
+my $release = substr($],0,3); # Not used presently.
+my $patchlevel = substr($],3,2);
die "Patchlevel of perl ($patchlevel)",
"and patchlevel of config.sh ($Config{'PERL_VERSION'}) don't match\n"
if $patchlevel != $Config{'PERL_VERSION'};
# Shared library and dynamic loading suffixes.
my $so = $Config{so};
my $dlext = $Config{dlext};
+my $dlsrc = $Config{dlsrc};
my $d_dosuid = $Config{d_dosuid};
my $binexp = $Config{binexp};
$perldll = 'perl56.' . $dlext if $Config{'ccflags'} =~ /PERL_OBJECT/i;
}
--f $perldll || die "No perl DLL built\n";
-
+ if ($dlsrc ne "dl_none.xs") {
+ -f $perldll || die "No perl DLL built\n";
+ }
# Install the DLL
-safe_unlink("$installbin/$perldll");
-copy("$perldll", "$installbin/$perldll");
-chmod(0755, "$installbin/$perldll");
-}
+ safe_unlink("$installbin/$perldll");
+ copy("$perldll", "$installbin/$perldll");
+ chmod(0755, "$installbin/$perldll");
+
+} # if ($Is_W32 or $Is_Cygwin)
# This will be used to store the packlist
my $packlist = ExtUtils::Packlist->new("$installarchlib/.packlist");
if (chdir "lib") {
$do_installarchlib = ! samepath($installarchlib, '.');
$do_installprivlib = ! samepath($installprivlib, '.');
- $do_installprivlib = 0 if $versiononly && !($installprivlib =~ m/\Q$]/);
+ $do_installprivlib = 0 if $versiononly && !($installprivlib =~ m/\Q$ver/);
if ($do_installarchlib || $do_installprivlib) {
find(\&installlib, '.');
mkpath("$installarchlib/CORE", 1, 0777);
my @corefiles;
if ($Is_VMS) { # We did core file selection during build
- my $coredir = "lib/$Config{'arch'}/$]";
+ my $coredir = "lib/$Config{'arch'}/$ver";
$coredir =~ tr/./_/;
@corefiles = <$coredir/*.*>;
}
}
}
-# Install pod pages. Where? I guess in $installprivlib/pod.
+# Install pod pages. Where? I guess in $installprivlib/pod
+# ($installprivlib/pods for cygwin).
-unless ( $versiononly && !($installprivlib =~ m/\Q$]/)) {
- mkpath("${installprivlib}/pod", 1, 0777);
+my $pod = $Is_Cygwin ? 'pods' : 'pod';
+unless ( $versiononly && !($installprivlib =~ m/\Q$ver/)) {
+ mkpath("${installprivlib}/$pod", 1, 0777);
# If Perl 5.003's perldiag.pod is there, rename it.
- if (open POD, "${installprivlib}/pod/perldiag.pod") {
+ if (open POD, "${installprivlib}/$pod/perldiag.pod") {
read POD, $_, 4000;
close POD;
# Some of Perl 5.003's diagnostic messages ended with periods.
if (/^=.*\.$/m) {
- my ($from, $to) = ("${installprivlib}/pod/perldiag.pod",
- "${installprivlib}/pod/perldiag-5.003.pod");
+ my ($from, $to) = ("${installprivlib}/$pod/perldiag.pod",
+ "${installprivlib}/$pod/perldiag-5.003.pod");
print " rename $from $to";
rename($from, $to)
or warn "Couldn't rename $from to $to: $!\n"
}
}
- foreach my $file (@pods) {
- # $file is a name like pod/perl.pod
- copy_if_diff($file, "${installprivlib}/${file}");
+ for (@pods) {
+ # $_ is a name like pod/perl.pod
+ (my $base = $_) =~ s#.*/##;
+ copy_if_diff($_, "${installprivlib}/$pod/${base}");
}
}
# installed perl.
if (!$versiononly) {
- my ($path, @path);
+ my ($path, @path);
my $dirsep = ($Is_OS2 || $Is_W32) ? ';' : ':' ;
($path = $ENV{"PATH"}) =~ s:\\:/:g ;
@path = split(/$dirsep/, $path);
? $success++
: ($from =~ m#^/afs/# || $to =~ m#^/afs/#)
? die "AFS" # okay inside eval {}
- : warn "Couldn't link $from to $to: $!\n"
+ : die "Couldn't link $from to $to: $!\n"
unless $nonono;
$packlist->{$to} = { from => $from, type => 'link' };
};
if ($@) {
+ warn $@;
+ print " cp $from $to\n";
print " creating new version of $to\n" if $Is_VMS and -e $to;
File::Copy::copy($from, $to)
? $success++
my $name = $_;
- if ($name eq 'CVS' && -d $name) {
+ # Ignore RCS and CVS directories.
+ if (($name eq 'CVS' or $name eq 'RCS') and -d $name) {
$File::Find::prune = 1;
return;
}
- # ignore patch backups and the .exists files.
- return if $name =~ m{\.orig$|~$|^\.exists};
+ # ignore patch backups, RCS files, emacs backup & temp files and the
+ # .exists files.
+ return if $name =~ m{\.orig$|~$|^#.+#$|,v$|^\.exists};
$name = "$dir/$name" if $dir ne '';
PERLVAR(Iorigargc, int)
PERLVAR(Iorigargv, char **)
PERLVAR(Ienvgv, GV *)
-PERLVAR(Isiggv, GV *)
PERLVAR(Iincgv, GV *)
PERLVAR(Ihintgv, GV *)
PERLVAR(Iorigfilename, char *)
PERLVAR(Idiehook, SV *)
PERLVAR(Iwarnhook, SV *)
-PERLVAR(Iparsehook, SV *)
-PERLVAR(Icddir, char *) /* switches */
+
+/* switches */
PERLVAR(Iminus_c, bool)
-PERLVARA(Ipatchlevel,10,char)
+PERLVAR(Ipatchlevel, SV *)
PERLVAR(Ilocalpatches, char **)
PERLVARI(Isplitstr, char *, " ")
PERLVAR(Ipreprocess, bool)
PERLVAR(Idowarn, bool)
PERLVAR(Idoextract, bool)
PERLVAR(Isawampersand, bool) /* must save all match strings */
-PERLVAR(Isawstudy, bool) /* do fbm_instr on all strings */
-PERLVAR(Isawvec, bool)
PERLVAR(Iunsafe, bool)
PERLVAR(Iinplace, char *)
PERLVAR(Ie_script, SV *)
PERLVAR(Iperldb, U32)
-/* This value may be raised by extensions for testing purposes */
+/* This value may be set when embedding for full cleanup */
/* 0=none, 1=full, 2=full with checks */
PERLVARI(Iperl_destruct_level, int, 0)
/* top fd to pass to subprocesses */
PERLVAR(Imultiline, int) /* $*--do strings hold >1 line? */
PERLVAR(Istatusvalue, I32) /* $? */
+PERLVAR(Iexit_flags, U8) /* was exit() unexpected, etc. */
#ifdef VMS
PERLVAR(Istatusvalue_vms,U32)
#endif
/* shortcuts to various I/O objects */
PERLVAR(Istdingv, GV *)
+PERLVAR(Istderrgv, GV *)
PERLVAR(Idefgv, GV *)
PERLVAR(Iargvgv, GV *)
PERLVAR(Iargvoutgv, GV *)
+PERLVAR(Iargvout_stack, AV *)
/* shortcuts to regexp stuff */
-/* XXX these three aren't used anywhere */
-PERLVAR(Ileftgv, GV *)
-PERLVAR(Iampergv, GV *)
-PERLVAR(Irightgv, GV *)
-
/* this one needs to be moved to thrdvar.h and accessed via
* find_threadsv() when USE_THREADS */
PERLVAR(Ireplgv, GV *)
PERLVAR(Icurstname, SV *) /* name of current package */
PERLVAR(Ibeginav, AV *) /* names of BEGIN subroutines */
PERLVAR(Iendav, AV *) /* names of END subroutines */
+PERLVAR(Istopav, AV *) /* names of STOP subroutines */
PERLVAR(Iinitav, AV *) /* names of INIT subroutines */
PERLVAR(Istrtab, HV *) /* shared string table */
PERLVARI(Isub_generation,U32,1) /* incr to invalidate method cache */
PERLVAR(Isv_arenaroot, SV*) /* list of areas for garbage collection */
/* funky return mechanisms */
-PERLVAR(Ilastspbase, I32)
-PERLVAR(Ilastsize, I32)
PERLVAR(Iforkprocess, int) /* so do_open |- can return proc# */
/* subprocess state */
PERLVAR(Itainting, bool) /* doing taint checks */
PERLVARI(Iop_mask, char *, NULL) /* masked operations for safe evals */
-/* trace state */
-PERLVAR(Idlevel, I32)
-PERLVARI(Idlmax, I32, 128)
-PERLVAR(Idebname, char *)
-PERLVAR(Idebdelim, char *)
-
/* current interpreter roots */
PERLVAR(Imain_cv, CV *)
PERLVAR(Imain_root, OP *)
PERLVARI(Icopline, line_t, NOLINE)
/* statics moved here for shared library purposes */
-PERLVAR(Istrchop, SV) /* return value from chop */
PERLVAR(Ifilemode, int) /* so nextargv() can preserve mode */
PERLVAR(Ilastfd, int) /* what to preserve mode on */
PERLVAR(Ioldname, char *) /* what to preserve mode on */
PERLVAR(IArgv, char **) /* stuff to free from do_aexec, vfork safe */
PERLVAR(ICmd, char *) /* stuff to free from do_aexec, vfork safe */
-PERLVAR(Imystrk, SV *) /* temp key string for do_each() */
-PERLVAR(Ioldlastpm, PMOP *) /* for saving regexp context in debugger */
PERLVAR(Igensym, I32) /* next symbol for getsym() to define */
PERLVAR(Ipreambled, bool)
PERLVAR(Ipreambleav, AV *)
/* more statics moved here */
PERLVARI(Igeneration, int, 100) /* from op.c */
PERLVAR(IDBcv, CV *) /* from perl.c */
-PERLVAR(Iarchpat_auto, char*) /* from perl.c */
PERLVARI(Iin_clean_objs,bool, FALSE) /* from sv.c */
PERLVARI(Iin_clean_all, bool, FALSE) /* from sv.c */
PERLVAR(Ilex_state, U32) /* next token is determined */
PERLVAR(Ilex_defer, U32) /* state after determined token */
-PERLVAR(Ilex_expect, expectation) /* expect after determined token */
+PERLVAR(Ilex_expect, int) /* expect after determined token */
PERLVAR(Ilex_brackets, I32) /* bracket count */
PERLVAR(Ilex_formbrack, I32) /* bracket count at outer format level */
-PERLVAR(Ilex_fakebrack, I32) /* outer bracket is mere delimiter */
PERLVAR(Ilex_casemods, I32) /* casemod count */
PERLVAR(Ilex_dojoin, I32) /* doing an array interpolation */
PERLVAR(Ilex_starts, I32) /* how many interps done on level */
PERLVAR(Ioldbufptr, char *)
PERLVAR(Ioldoldbufptr, char *)
PERLVAR(Ibufend, char *)
-PERLVARI(Iexpect,expectation, XSTATE) /* how to interpret ambiguous tokens */
+PERLVARI(Iexpect,int, XSTATE) /* how to interpret ambiguous tokens */
PERLVAR(Imulti_start, I32) /* 1st line of multi-line string */
PERLVAR(Imulti_end, I32) /* last line of multi-line string */
PERLVAR(Ipadix_floor, I32) /* how low may inner block reset padix */
PERLVAR(Ipad_reset_pending, I32) /* reset pad on next attempted alloc */
-PERLVAR(Ithisexpr, I32) /* name id for nothing_in_common() */
PERLVAR(Ilast_uni, char *) /* position of last named-unary op */
PERLVAR(Ilast_lop, char *) /* position of last list operator */
PERLVAR(Ilast_lop_op, OPCODE) /* last list operator */
PERLVAR(Iin_my, I32) /* we're compiling a "my" (or "our") declaration */
PERLVAR(Iin_my_stash, HV *) /* declared class of this "my" declaration */
#ifdef FCRYPT
-PERLVAR(Icryptseen, I32) /* has fast crypt() been initialized? */
+PERLVAR(Icryptseen, bool) /* has fast crypt() been initialized? */
#endif
-PERLVAR(Ihints, U32) /* pragma-tic compile-time flags */
+PERLVAR(Ihints, U32) /* pragma-tic compile-time flags */
PERLVAR(Idebug, VOL U32) /* flags given to -D switch */
PERLVAR(Isrand_called, bool)
PERLVARA(Iuudmap,256, char)
PERLVAR(Ibitcount, char *)
-PERLVAR(Ifilter_debug, int)
#ifdef USE_THREADS
PERLVAR(Ithr_key, perl_key) /* For per-thread struct perl_thread* */
PERLVAR(Isv_mutex, perl_mutex) /* Mutex for allocating SVs in sv.c */
-PERLVAR(Imalloc_mutex, perl_mutex) /* Mutex for malloc */
PERLVAR(Ieval_mutex, perl_mutex) /* Mutex for doeval */
PERLVAR(Ieval_cond, perl_cond) /* Condition variable for doeval */
PERLVAR(Ieval_owner, struct perl_thread *)
#endif /* USE_THREADS */
+PERLVAR(Ipsig_ptr, SV**)
+PERLVAR(Ipsig_name, SV**)
+
#if defined(PERL_IMPLICIT_SYS)
-PERLVARI(IMem, struct IPerlMem*, NULL)
-PERLVARI(IEnv, struct IPerlEnv*, NULL)
-PERLVARI(IStdIO, struct IPerlStdIO*, NULL)
-PERLVARI(ILIO, struct IPerlLIO*, NULL)
-PERLVARI(IDir, struct IPerlDir*, NULL)
-PERLVARI(ISock, struct IPerlSock*, NULL)
-PERLVARI(IProc, struct IPerlProc*, NULL)
+PERLVAR(IMem, struct IPerlMem*)
+PERLVAR(IMemShared, struct IPerlMem*)
+PERLVAR(IMemParse, struct IPerlMem*)
+PERLVAR(IEnv, struct IPerlEnv*)
+PERLVAR(IStdIO, struct IPerlStdIO*)
+PERLVAR(ILIO, struct IPerlLIO*)
+PERLVAR(IDir, struct IPerlDir*)
+PERLVAR(ISock, struct IPerlSock*)
+PERLVAR(IProc, struct IPerlProc*)
+#endif
+
+#if defined(USE_ITHREADS)
+PERLVAR(Iptr_table, PTR_TBL_t*)
#endif
extern void PerlIO_init (void);
#endif
+#ifndef Sighandler_t
+typedef Signal_t (*Sighandler_t) (int);
+#endif
+
#if defined(PERL_IMPLICIT_SYS)
#ifndef PerlIO
/* IPerlStdIO */
struct IPerlStdIO;
+struct IPerlStdIOInfo;
typedef PerlIO* (*LPStdin)(struct IPerlStdIO*);
typedef PerlIO* (*LPStdout)(struct IPerlStdIO*);
typedef PerlIO* (*LPStderr)(struct IPerlStdIO*);
const Fpos_t*);
typedef void (*LPInit)(struct IPerlStdIO*);
typedef void (*LPInitOSExtras)(struct IPerlStdIO*);
+typedef PerlIO* (*LPFdupopen)(struct IPerlStdIO*, PerlIO*);
struct IPerlStdIO
{
LPSetpos pSetpos;
LPInit pInit;
LPInitOSExtras pInitOSExtras;
+ LPFdupopen pFdupopen;
};
struct IPerlStdIOInfo
#undef init_os_extras
#define init_os_extras() \
(*PL_StdIO->pInitOSExtras)(PL_StdIO)
+#define PerlIO_fdupopen(f) \
+ (*PL_StdIO->pFdupopen)(PL_StdIO, (f))
#else /* PERL_IMPLICIT_SYS */
#include "perlsdio.h"
#include "perl.h"
+#define PerlIO_fdupopen(f) (f)
#endif /* PERL_IMPLICIT_SYS */
#ifndef PerlIO_stdoutf
extern int PerlIO_stdoutf (const char *,...)
- __attribute__((format (printf, 1, 2)));
+ __attribute__((__format__ (__printf__, 1, 2)));
#endif
#ifndef PerlIO_puts
extern int PerlIO_puts (PerlIO *,const char *);
#endif
#ifndef PerlIO_printf
extern int PerlIO_printf (PerlIO *, const char *,...)
- __attribute__((format (printf, 2, 3)));
+ __attribute__((__format__ (__printf__, 2, 3)));
#endif
#ifndef PerlIO_sprintf
extern int PerlIO_sprintf (char *, int, const char *,...)
- __attribute__((format (printf, 3, 4)));
+ __attribute__((__format__ (__printf__, 3, 4)));
#endif
#ifndef PerlIO_vprintf
extern int PerlIO_vprintf (PerlIO *, const char *, va_list);
#ifndef PerlIO_setpos
extern int PerlIO_setpos (PerlIO *,const Fpos_t *);
#endif
+#ifndef PerlIO_fdupopen
+extern PerlIO * PerlIO_fdupopen (PerlIO *);
+#endif
/*
/* IPerlDir */
struct IPerlDir;
+struct IPerlDirInfo;
typedef int (*LPMakedir)(struct IPerlDir*, const char*, int);
typedef int (*LPChdir)(struct IPerlDir*, const char*);
typedef int (*LPRmdir)(struct IPerlDir*, const char*);
typedef void (*LPDirRewind)(struct IPerlDir*, DIR*);
typedef void (*LPDirSeek)(struct IPerlDir*, DIR*, long);
typedef long (*LPDirTell)(struct IPerlDir*, DIR*);
+#ifdef WIN32
+typedef char* (*LPDirMapPathA)(struct IPerlDir*, const char*);
+typedef WCHAR* (*LPDirMapPathW)(struct IPerlDir*, const WCHAR*);
+#endif
struct IPerlDir
{
LPDirRewind pRewind;
LPDirSeek pSeek;
LPDirTell pTell;
+#ifdef WIN32
+ LPDirMapPathA pMapPathA;
+ LPDirMapPathW pMapPathW;
+#endif
};
struct IPerlDirInfo
(*PL_Dir->pSeek)(PL_Dir, (dir), (loc))
#define PerlDir_tell(dir) \
(*PL_Dir->pTell)(PL_Dir, (dir))
+#ifdef WIN32
+#define PerlDir_mapA(dir) \
+ (*PL_Dir->pMapPathA)(PL_Dir, (dir))
+#define PerlDir_mapW(dir) \
+ (*PL_Dir->pMapPathW)(PL_Dir, (dir))
+#endif
#else /* PERL_IMPLICIT_SYS */
#define PerlDir_rewind(dir) rewinddir((dir))
#define PerlDir_seek(dir, loc) seekdir((dir), (loc))
#define PerlDir_tell(dir) telldir((dir))
+#ifdef WIN32
+#define PerlDir_mapA(dir) dir
+#define PerlDir_mapW(dir) dir
+#endif
#endif /* PERL_IMPLICIT_SYS */
/* IPerlEnv */
struct IPerlEnv;
+struct IPerlEnvInfo;
typedef char* (*LPEnvGetenv)(struct IPerlEnv*, const char*);
typedef int (*LPEnvPutenv)(struct IPerlEnv*, const char*);
typedef char* (*LPEnvGetenv_len)(struct IPerlEnv*,
#define PerlEnv_putenv(str) putenv((str))
#define PerlEnv_getenv(str) getenv((str))
#define PerlEnv_getenv_len(str,l) getenv_len((str), (l))
-#define PerlEnv_clear() clearenv()
+#define PerlEnv_clearenv() clearenv()
#define PerlEnv_get_childenv() get_childenv()
#define PerlEnv_free_childenv(e) free_childenv((e))
#define PerlEnv_get_childdir() get_childdir()
/* IPerlLIO */
struct IPerlLIO;
+struct IPerlLIOInfo;
typedef int (*LPLIOAccess)(struct IPerlLIO*, const char*, int);
typedef int (*LPLIOChmod)(struct IPerlLIO*, const char*, int);
typedef int (*LPLIOChown)(struct IPerlLIO*, const char*, uid_t,
typedef int (*LPLIOIOCtl)(struct IPerlLIO*, int, unsigned int,
char*);
typedef int (*LPLIOIsatty)(struct IPerlLIO*, int);
+typedef int (*LPLIOLink)(struct IPerlLIO*, const char*,
+ const char *);
typedef long (*LPLIOLseek)(struct IPerlLIO*, int, long, int);
typedef int (*LPLIOLstat)(struct IPerlLIO*, const char*,
struct stat*);
LPLIOFileStat pFileStat;
LPLIOIOCtl pIOCtl;
LPLIOIsatty pIsatty;
+ LPLIOLink pLink;
LPLIOLseek pLseek;
LPLIOLstat pLstat;
LPLIOMktemp pMktemp;
(*PL_LIO->pIOCtl)(PL_LIO, (fd), (u), (buf))
#define PerlLIO_isatty(fd) \
(*PL_LIO->pIsatty)(PL_LIO, (fd))
+#define PerlLIO_link(oldname, newname) \
+ (*PL_LIO->pLink)(PL_LIO, (oldname), (newname))
#define PerlLIO_lseek(fd, offset, mode) \
(*PL_LIO->pLseek)(PL_LIO, (fd), (offset), (mode))
#define PerlLIO_lstat(name, buf) \
#define PerlLIO_fstat(fd, buf) Fstat((fd), (buf))
#define PerlLIO_ioctl(fd, u, buf) ioctl((fd), (u), (buf))
#define PerlLIO_isatty(fd) isatty((fd))
+#define PerlLIO_link(oldname, newname) link((oldname), (newname))
#define PerlLIO_lseek(fd, offset, mode) lseek((fd), (offset), (mode))
#define PerlLIO_stat(name, buf) Stat((name), (buf))
#ifdef HAS_LSTAT
/* IPerlMem */
struct IPerlMem;
+struct IPerlMemInfo;
typedef void* (*LPMemMalloc)(struct IPerlMem*, size_t);
typedef void* (*LPMemRealloc)(struct IPerlMem*, void*, size_t);
typedef void (*LPMemFree)(struct IPerlMem*, void*);
+typedef void* (*LPMemCalloc)(struct IPerlMem*, size_t, size_t);
+typedef void (*LPMemGetLock)(struct IPerlMem*);
+typedef void (*LPMemFreeLock)(struct IPerlMem*);
+typedef int (*LPMemIsLocked)(struct IPerlMem*);
struct IPerlMem
{
LPMemMalloc pMalloc;
LPMemRealloc pRealloc;
LPMemFree pFree;
+ LPMemCalloc pCalloc;
+ LPMemGetLock pGetLock;
+ LPMemFreeLock pFreeLock;
+ LPMemIsLocked pIsLocked;
};
struct IPerlMemInfo
struct IPerlMem perlMemList;
};
+/* Interpreter specific memory macros */
#define PerlMem_malloc(size) \
(*PL_Mem->pMalloc)(PL_Mem, (size))
#define PerlMem_realloc(buf, size) \
(*PL_Mem->pRealloc)(PL_Mem, (buf), (size))
#define PerlMem_free(buf) \
(*PL_Mem->pFree)(PL_Mem, (buf))
+#define PerlMem_calloc(num, size) \
+ (*PL_Mem->pCalloc)(PL_Mem, (num), (size))
+#define PerlMem_get_lock() \
+ (*PL_Mem->pGetLock)(PL_Mem)
+#define PerlMem_free_lock() \
+ (*PL_Mem->pFreeLock)(PL_Mem)
+#define PerlMem_is_locked() \
+ (*PL_Mem->pIsLocked)(PL_Mem)
+
+/* Shared memory macros */
+#define PerlMemShared_malloc(size) \
+ (*PL_MemShared->pMalloc)(PL_Mem, (size))
+#define PerlMemShared_realloc(buf, size) \
+ (*PL_MemShared->pRealloc)(PL_Mem, (buf), (size))
+#define PerlMemShared_free(buf) \
+ (*PL_MemShared->pFree)(PL_Mem, (buf))
+#define PerlMemShared_calloc(num, size) \
+ (*PL_MemShared->pCalloc)(PL_Mem, (num), (size))
+#define PerlMemShared_get_lock() \
+ (*PL_MemShared->pGetLock)(PL_Mem)
+#define PerlMemShared_free_lock() \
+ (*PL_MemShared->pFreeLock)(PL_Mem)
+#define PerlMemShared_is_locked() \
+ (*PL_MemShared->pIsLocked)(PL_Mem)
+
+
+/* Parse tree memory macros */
+#define PerlMemParse_malloc(size) \
+ (*PL_MemParse->pMalloc)(PL_Mem, (size))
+#define PerlMemParse_realloc(buf, size) \
+ (*PL_MemParse->pRealloc)(PL_Mem, (buf), (size))
+#define PerlMemParse_free(buf) \
+ (*PL_MemParse->pFree)(PL_Mem, (buf))
+#define PerlMemParse_calloc(num, size) \
+ (*PL_MemParse->pCalloc)(PL_Mem, (num), (size))
+#define PerlMemParse_get_lock() \
+ (*PL_MemParse->pGetLock)(PL_Mem)
+#define PerlMemParse_free_lock() \
+ (*PL_MemParse->pFreeLock)(PL_Mem)
+#define PerlMemParse_is_locked() \
+ (*PL_MemParse->pIsLocked)(PL_Mem)
+
#else /* PERL_IMPLICIT_SYS */
+/* Interpreter specific memory macros */
#define PerlMem_malloc(size) malloc((size))
#define PerlMem_realloc(buf, size) realloc((buf), (size))
#define PerlMem_free(buf) free((buf))
+#define PerlMem_calloc(num, size) calloc((num), (size))
+#define PerlMem_get_lock()
+#define PerlMem_free_lock()
+#define PerlMem_is_locked() 0
+
+/* Shared memory macros */
+#define PerlMemShared_malloc(size) malloc((size))
+#define PerlMemShared_realloc(buf, size) realloc((buf), (size))
+#define PerlMemShared_free(buf) free((buf))
+#define PerlMemShared_calloc(num, size) calloc((num), (size))
+#define PerlMemShared_get_lock()
+#define PerlMemShared_free_lock()
+#define PerlMemShared_is_locked() 0
+
+/* Parse tree memory macros */
+#define PerlMemParse_malloc(size) malloc((size))
+#define PerlMemParse_realloc(buf, size) realloc((buf), (size))
+#define PerlMemParse_free(buf) free((buf))
+#define PerlMemParse_calloc(num, size) calloc((num), (size))
+#define PerlMemParse_get_lock()
+#define PerlMemParse_free_lock()
+#define PerlMemParse_is_locked() 0
#endif /* PERL_IMPLICIT_SYS */
#if defined(PERL_IMPLICIT_SYS)
-#ifndef Sighandler_t
-typedef Signal_t (*Sighandler_t) (int);
-#endif
#ifndef jmp_buf
#include <setjmp.h>
#endif
/* IPerlProc */
struct IPerlProc;
+struct IPerlProcInfo;
typedef void (*LPProcAbort)(struct IPerlProc*);
typedef char* (*LPProcCrypt)(struct IPerlProc*, const char*,
const char*);
typedef int (*LPProcWait)(struct IPerlProc*, int*);
typedef int (*LPProcWaitpid)(struct IPerlProc*, int, int*, int);
typedef Sighandler_t (*LPProcSignal)(struct IPerlProc*, int, Sighandler_t);
-typedef void* (*LPProcDynaLoader)(struct IPerlProc*, const char*);
+typedef int (*LPProcFork)(struct IPerlProc*);
+typedef int (*LPProcGetpid)(struct IPerlProc*);
#ifdef WIN32
+typedef void* (*LPProcDynaLoader)(struct IPerlProc*, const char*);
typedef void (*LPProcGetOSError)(struct IPerlProc*,
SV* sv, DWORD dwErr);
typedef void (*LPProcFreeBuf)(struct IPerlProc*, char*);
LPProcWait pWait;
LPProcWaitpid pWaitpid;
LPProcSignal pSignal;
+ LPProcFork pFork;
+ LPProcGetpid pGetpid;
#ifdef WIN32
LPProcDynaLoader pDynaLoader;
LPProcGetOSError pGetOSError;
(*PL_Proc->pWaitpid)(PL_Proc, (p), (s), (f))
#define PerlProc_signal(n, h) \
(*PL_Proc->pSignal)(PL_Proc, (n), (h))
+#define PerlProc_fork() \
+ (*PL_Proc->pFork)(PL_Proc)
+#define PerlProc_getpid() \
+ (*PL_Proc->pGetpid)(PL_Proc)
#define PerlProc_setjmp(b, n) Sigsetjmp((b), (n))
#define PerlProc_longjmp(b, n) Siglongjmp((b), (n))
#define PerlProc_setjmp(b, n) Sigsetjmp((b), (n))
#define PerlProc_longjmp(b, n) Siglongjmp((b), (n))
#define PerlProc_signal(n, h) signal((n), (h))
+#define PerlProc_fork() fork()
+#define PerlProc_getpid() getpid()
#ifdef WIN32
#define PerlProc_DynaLoad(f) \
/* PerlSock */
struct IPerlSock;
+struct IPerlSockInfo;
typedef u_long (*LPHtonl)(struct IPerlSock*, u_long);
typedef u_short (*LPHtons)(struct IPerlSock*, u_short);
typedef u_long (*LPNtohl)(struct IPerlSock*, u_long);
#endif /* PERL_IMPLICIT_SYS */
-/* Mention
-
- HAS_READV
- HAS_RECVMSG
- HAS_SENDMSG
- HAS_WRITEV
- HAS_STRUCT_MSGHDR
- HAS_STRUCT_CMSGHDR
-
- here so that Configure picks them up. Perl core does not
- use them but somebody might want to extend Socket:: or IO::
- someday.
-
- Jarkko Hietaniemi November 1998
-
- */
-
#endif /* __Inc__IPerl___ */
#define KEY_LE 15
#define KEY_LT 16
#define KEY_NE 17
-#define KEY_abs 18
-#define KEY_accept 19
-#define KEY_alarm 20
-#define KEY_and 21
-#define KEY_atan2 22
-#define KEY_bind 23
-#define KEY_binmode 24
-#define KEY_bless 25
-#define KEY_caller 26
-#define KEY_chdir 27
-#define KEY_chmod 28
-#define KEY_chomp 29
-#define KEY_chop 30
-#define KEY_chown 31
-#define KEY_chr 32
-#define KEY_chroot 33
-#define KEY_close 34
-#define KEY_closedir 35
-#define KEY_cmp 36
-#define KEY_connect 37
-#define KEY_continue 38
-#define KEY_cos 39
-#define KEY_crypt 40
-#define KEY_dbmclose 41
-#define KEY_dbmopen 42
-#define KEY_defined 43
-#define KEY_delete 44
-#define KEY_die 45
-#define KEY_do 46
-#define KEY_dump 47
-#define KEY_each 48
-#define KEY_else 49
-#define KEY_elsif 50
-#define KEY_endgrent 51
-#define KEY_endhostent 52
-#define KEY_endnetent 53
-#define KEY_endprotoent 54
-#define KEY_endpwent 55
-#define KEY_endservent 56
-#define KEY_eof 57
-#define KEY_eq 58
-#define KEY_eval 59
-#define KEY_exec 60
-#define KEY_exists 61
-#define KEY_exit 62
-#define KEY_exp 63
-#define KEY_fcntl 64
-#define KEY_fileno 65
-#define KEY_flock 66
-#define KEY_for 67
-#define KEY_foreach 68
-#define KEY_fork 69
-#define KEY_format 70
-#define KEY_formline 71
-#define KEY_ge 72
-#define KEY_getc 73
-#define KEY_getgrent 74
-#define KEY_getgrgid 75
-#define KEY_getgrnam 76
-#define KEY_gethostbyaddr 77
-#define KEY_gethostbyname 78
-#define KEY_gethostent 79
-#define KEY_getlogin 80
-#define KEY_getnetbyaddr 81
-#define KEY_getnetbyname 82
-#define KEY_getnetent 83
-#define KEY_getpeername 84
-#define KEY_getpgrp 85
-#define KEY_getppid 86
-#define KEY_getpriority 87
-#define KEY_getprotobyname 88
-#define KEY_getprotobynumber 89
-#define KEY_getprotoent 90
-#define KEY_getpwent 91
-#define KEY_getpwnam 92
-#define KEY_getpwuid 93
-#define KEY_getservbyname 94
-#define KEY_getservbyport 95
-#define KEY_getservent 96
-#define KEY_getsockname 97
-#define KEY_getsockopt 98
-#define KEY_glob 99
-#define KEY_gmtime 100
-#define KEY_goto 101
-#define KEY_grep 102
-#define KEY_gt 103
-#define KEY_hex 104
-#define KEY_if 105
-#define KEY_index 106
-#define KEY_int 107
-#define KEY_ioctl 108
-#define KEY_join 109
-#define KEY_keys 110
-#define KEY_kill 111
-#define KEY_last 112
-#define KEY_lc 113
-#define KEY_lcfirst 114
-#define KEY_le 115
-#define KEY_length 116
-#define KEY_link 117
-#define KEY_listen 118
-#define KEY_local 119
-#define KEY_localtime 120
-#define KEY_lock 121
-#define KEY_log 122
-#define KEY_lstat 123
-#define KEY_lt 124
-#define KEY_m 125
-#define KEY_map 126
-#define KEY_mkdir 127
-#define KEY_msgctl 128
-#define KEY_msgget 129
-#define KEY_msgrcv 130
-#define KEY_msgsnd 131
-#define KEY_my 132
-#define KEY_ne 133
-#define KEY_next 134
-#define KEY_no 135
-#define KEY_not 136
-#define KEY_oct 137
-#define KEY_open 138
-#define KEY_opendir 139
-#define KEY_or 140
-#define KEY_ord 141
-#define KEY_our 142
-#define KEY_pack 143
-#define KEY_package 144
-#define KEY_pipe 145
-#define KEY_pop 146
-#define KEY_pos 147
-#define KEY_print 148
-#define KEY_printf 149
-#define KEY_prototype 150
-#define KEY_push 151
-#define KEY_q 152
-#define KEY_qq 153
-#define KEY_qr 154
-#define KEY_quotemeta 155
-#define KEY_qw 156
-#define KEY_qx 157
-#define KEY_rand 158
-#define KEY_read 159
-#define KEY_readdir 160
-#define KEY_readline 161
-#define KEY_readlink 162
-#define KEY_readpipe 163
-#define KEY_recv 164
-#define KEY_redo 165
-#define KEY_ref 166
-#define KEY_rename 167
-#define KEY_require 168
-#define KEY_reset 169
-#define KEY_return 170
-#define KEY_reverse 171
-#define KEY_rewinddir 172
-#define KEY_rindex 173
-#define KEY_rmdir 174
-#define KEY_s 175
-#define KEY_scalar 176
-#define KEY_seek 177
-#define KEY_seekdir 178
-#define KEY_select 179
-#define KEY_semctl 180
-#define KEY_semget 181
-#define KEY_semop 182
-#define KEY_send 183
-#define KEY_setgrent 184
-#define KEY_sethostent 185
-#define KEY_setnetent 186
-#define KEY_setpgrp 187
-#define KEY_setpriority 188
-#define KEY_setprotoent 189
-#define KEY_setpwent 190
-#define KEY_setservent 191
-#define KEY_setsockopt 192
-#define KEY_shift 193
-#define KEY_shmctl 194
-#define KEY_shmget 195
-#define KEY_shmread 196
-#define KEY_shmwrite 197
-#define KEY_shutdown 198
-#define KEY_sin 199
-#define KEY_sleep 200
-#define KEY_socket 201
-#define KEY_socketpair 202
-#define KEY_sort 203
-#define KEY_splice 204
-#define KEY_split 205
-#define KEY_sprintf 206
-#define KEY_sqrt 207
-#define KEY_srand 208
-#define KEY_stat 209
-#define KEY_study 210
-#define KEY_sub 211
-#define KEY_substr 212
-#define KEY_symlink 213
-#define KEY_syscall 214
-#define KEY_sysopen 215
-#define KEY_sysread 216
-#define KEY_sysseek 217
-#define KEY_system 218
-#define KEY_syswrite 219
-#define KEY_tell 220
-#define KEY_telldir 221
-#define KEY_tie 222
-#define KEY_tied 223
-#define KEY_time 224
-#define KEY_times 225
-#define KEY_tr 226
-#define KEY_truncate 227
-#define KEY_uc 228
-#define KEY_ucfirst 229
-#define KEY_umask 230
-#define KEY_undef 231
-#define KEY_unless 232
-#define KEY_unlink 233
-#define KEY_unpack 234
-#define KEY_unshift 235
-#define KEY_untie 236
-#define KEY_until 237
-#define KEY_use 238
-#define KEY_utime 239
-#define KEY_values 240
-#define KEY_vec 241
-#define KEY_wait 242
-#define KEY_waitpid 243
-#define KEY_wantarray 244
-#define KEY_warn 245
-#define KEY_while 246
-#define KEY_write 247
-#define KEY_x 248
-#define KEY_xor 249
-#define KEY_y 250
+#define KEY_STOP 18
+#define KEY_abs 19
+#define KEY_accept 20
+#define KEY_alarm 21
+#define KEY_and 22
+#define KEY_atan2 23
+#define KEY_bind 24
+#define KEY_binmode 25
+#define KEY_bless 26
+#define KEY_caller 27
+#define KEY_chdir 28
+#define KEY_chmod 29
+#define KEY_chomp 30
+#define KEY_chop 31
+#define KEY_chown 32
+#define KEY_chr 33
+#define KEY_chroot 34
+#define KEY_close 35
+#define KEY_closedir 36
+#define KEY_cmp 37
+#define KEY_connect 38
+#define KEY_continue 39
+#define KEY_cos 40
+#define KEY_crypt 41
+#define KEY_dbmclose 42
+#define KEY_dbmopen 43
+#define KEY_defined 44
+#define KEY_delete 45
+#define KEY_die 46
+#define KEY_do 47
+#define KEY_dump 48
+#define KEY_each 49
+#define KEY_else 50
+#define KEY_elsif 51
+#define KEY_endgrent 52
+#define KEY_endhostent 53
+#define KEY_endnetent 54
+#define KEY_endprotoent 55
+#define KEY_endpwent 56
+#define KEY_endservent 57
+#define KEY_eof 58
+#define KEY_eq 59
+#define KEY_eval 60
+#define KEY_exec 61
+#define KEY_exists 62
+#define KEY_exit 63
+#define KEY_exp 64
+#define KEY_fcntl 65
+#define KEY_fileno 66
+#define KEY_flock 67
+#define KEY_for 68
+#define KEY_foreach 69
+#define KEY_fork 70
+#define KEY_format 71
+#define KEY_formline 72
+#define KEY_ge 73
+#define KEY_getc 74
+#define KEY_getgrent 75
+#define KEY_getgrgid 76
+#define KEY_getgrnam 77
+#define KEY_gethostbyaddr 78
+#define KEY_gethostbyname 79
+#define KEY_gethostent 80
+#define KEY_getlogin 81
+#define KEY_getnetbyaddr 82
+#define KEY_getnetbyname 83
+#define KEY_getnetent 84
+#define KEY_getpeername 85
+#define KEY_getpgrp 86
+#define KEY_getppid 87
+#define KEY_getpriority 88
+#define KEY_getprotobyname 89
+#define KEY_getprotobynumber 90
+#define KEY_getprotoent 91
+#define KEY_getpwent 92
+#define KEY_getpwnam 93
+#define KEY_getpwuid 94
+#define KEY_getservbyname 95
+#define KEY_getservbyport 96
+#define KEY_getservent 97
+#define KEY_getsockname 98
+#define KEY_getsockopt 99
+#define KEY_glob 100
+#define KEY_gmtime 101
+#define KEY_goto 102
+#define KEY_grep 103
+#define KEY_gt 104
+#define KEY_hex 105
+#define KEY_if 106
+#define KEY_index 107
+#define KEY_int 108
+#define KEY_ioctl 109
+#define KEY_join 110
+#define KEY_keys 111
+#define KEY_kill 112
+#define KEY_last 113
+#define KEY_lc 114
+#define KEY_lcfirst 115
+#define KEY_le 116
+#define KEY_length 117
+#define KEY_link 118
+#define KEY_listen 119
+#define KEY_local 120
+#define KEY_localtime 121
+#define KEY_lock 122
+#define KEY_log 123
+#define KEY_lstat 124
+#define KEY_lt 125
+#define KEY_m 126
+#define KEY_map 127
+#define KEY_mkdir 128
+#define KEY_msgctl 129
+#define KEY_msgget 130
+#define KEY_msgrcv 131
+#define KEY_msgsnd 132
+#define KEY_my 133
+#define KEY_ne 134
+#define KEY_next 135
+#define KEY_no 136
+#define KEY_not 137
+#define KEY_oct 138
+#define KEY_open 139
+#define KEY_opendir 140
+#define KEY_or 141
+#define KEY_ord 142
+#define KEY_our 143
+#define KEY_pack 144
+#define KEY_package 145
+#define KEY_pipe 146
+#define KEY_pop 147
+#define KEY_pos 148
+#define KEY_print 149
+#define KEY_printf 150
+#define KEY_prototype 151
+#define KEY_push 152
+#define KEY_q 153
+#define KEY_qq 154
+#define KEY_qr 155
+#define KEY_quotemeta 156
+#define KEY_qw 157
+#define KEY_qx 158
+#define KEY_rand 159
+#define KEY_read 160
+#define KEY_readdir 161
+#define KEY_readline 162
+#define KEY_readlink 163
+#define KEY_readpipe 164
+#define KEY_recv 165
+#define KEY_redo 166
+#define KEY_ref 167
+#define KEY_rename 168
+#define KEY_require 169
+#define KEY_reset 170
+#define KEY_return 171
+#define KEY_reverse 172
+#define KEY_rewinddir 173
+#define KEY_rindex 174
+#define KEY_rmdir 175
+#define KEY_s 176
+#define KEY_scalar 177
+#define KEY_seek 178
+#define KEY_seekdir 179
+#define KEY_select 180
+#define KEY_semctl 181
+#define KEY_semget 182
+#define KEY_semop 183
+#define KEY_send 184
+#define KEY_setgrent 185
+#define KEY_sethostent 186
+#define KEY_setnetent 187
+#define KEY_setpgrp 188
+#define KEY_setpriority 189
+#define KEY_setprotoent 190
+#define KEY_setpwent 191
+#define KEY_setservent 192
+#define KEY_setsockopt 193
+#define KEY_shift 194
+#define KEY_shmctl 195
+#define KEY_shmget 196
+#define KEY_shmread 197
+#define KEY_shmwrite 198
+#define KEY_shutdown 199
+#define KEY_sin 200
+#define KEY_sleep 201
+#define KEY_socket 202
+#define KEY_socketpair 203
+#define KEY_sort 204
+#define KEY_splice 205
+#define KEY_split 206
+#define KEY_sprintf 207
+#define KEY_sqrt 208
+#define KEY_srand 209
+#define KEY_stat 210
+#define KEY_study 211
+#define KEY_sub 212
+#define KEY_substr 213
+#define KEY_symlink 214
+#define KEY_syscall 215
+#define KEY_sysopen 216
+#define KEY_sysread 217
+#define KEY_sysseek 218
+#define KEY_system 219
+#define KEY_syswrite 220
+#define KEY_tell 221
+#define KEY_telldir 222
+#define KEY_tie 223
+#define KEY_tied 224
+#define KEY_time 225
+#define KEY_times 226
+#define KEY_tr 227
+#define KEY_truncate 228
+#define KEY_uc 229
+#define KEY_ucfirst 230
+#define KEY_umask 231
+#define KEY_undef 232
+#define KEY_unless 233
+#define KEY_unlink 234
+#define KEY_unpack 235
+#define KEY_unshift 236
+#define KEY_untie 237
+#define KEY_until 238
+#define KEY_use 239
+#define KEY_utime 240
+#define KEY_values 241
+#define KEY_vec 242
+#define KEY_wait 243
+#define KEY_waitpid 244
+#define KEY_wantarray 245
+#define KEY_warn 246
+#define KEY_while 247
+#define KEY_write 248
+#define KEY_x 249
+#define KEY_xor 250
+#define KEY_y 251
LE
LT
NE
+STOP
abs
accept
alarm
@EXPORT_OK = @EXPORT_OK = qw(AUTOLOAD);
$is_dosish = $^O eq 'dos' || $^O eq 'os2' || $^O eq 'MSWin32';
$is_vms = $^O eq 'VMS';
- $VERSION = $VERSION = '5.57';
+ $VERSION = '5.57';
}
AUTOLOAD {
=head1 NAME
-Benchmark - benchmark running times of code
-
-timethis - run a chunk of code several times
-
-timethese - run several chunks of code several times
-
-timeit - run a chunk of code and see how long it goes
+Benchmark - benchmark running times of Perl code
=head1 SYNOPSIS
'Name2' => sub { ...code2... },
});
+ # cmpthese can be used both ways as well
+ cmpthese($count, {
+ 'Name1' => '...code1...',
+ 'Name2' => '...code2...',
+ });
+
+ cmpthese($count, {
+ 'Name1' => sub { ...code1... },
+ 'Name2' => sub { ...code2... },
+ });
+
+ # ...or in two stages
+ $results = timethese($count,
+ {
+ 'Name1' => sub { ...code1... },
+ 'Name2' => sub { ...code2... },
+ },
+ 'none'
+ );
+ cmpthese( $results ) ;
+
$t = timeit($count, '...other code...')
print "$count loops of other code took:",timestr($t),"\n";
+ $t = countit($time, '...other code...')
+ $count = $t->iters ;
+ print "$count loops of other code took:",timestr($t),"\n";
+
=head1 DESCRIPTION
The Benchmark module encapsulates a number of routines to help you
figure out how long it takes to execute some code.
+timethis - run a chunk of code several times
+
+timethese - run several chunks of code several times
+
+cmpthese - print results of timethese as a comparison chart
+
+timeit - run a chunk of code and see how long it goes
+
+countit - see how many times a chunk of code runs in a given time
+
+
=head2 Methods
=over 10
$t = timeit(10, ' 5 ** $Global ');
debug Benchmark 0;
+=item iters
+
+Returns the number of iterations.
+
=back
=head2 Standard Exports
The COUNT can be zero or negative, see timethis().
+Returns a hash of Benchmark objects, keyed by name.
+
=item timediff ( T1, T2 )
Returns the difference between two Benchmark times as a Benchmark
object suitable for passing to timestr().
-=item timesum ( T1, T2 )
-
-Returns the sum of two Benchmark times as a Benchmark object suitable
-for passing to timestr().
-
=item timestr ( TIMEDIFF, [ STYLE, [ FORMAT ] ] )
Returns a string that formats the times in the TIMEDIFF object in
the requested STYLE. TIMEDIFF is expected to be a Benchmark object
similar to that returned by timediff().
-STYLE can be any of 'all', 'noc', 'nop' or 'auto'. 'all' shows each
-of the 5 times available ('wallclock' time, user time, system time,
+STYLE can be any of 'all', 'none', 'noc', 'nop' or 'auto'. 'all' shows
+each of the 5 times available ('wallclock' time, user time, system time,
user time of children, and system time of children). 'noc' shows all
except the two children times. 'nop' shows only wallclock and the
two children times. 'auto' (the default) will act as 'all' unless
the children times are both zero, in which case it acts as 'noc'.
+'none' prevents output.
FORMAT is the L<printf(3)>-style format specifier (without the
leading '%') to use to print the times. It defaults to '5.2f'.
Clear all cached times.
+=item cmpthese ( COUT, CODEHASHREF, [ STYLE ] )
+
+=item cmpthese ( RESULTSHASHREF )
+
+Optionally calls timethese(), then outputs comparison chart. This
+chart is sorted from slowest to fastest, and shows the percent
+speed difference between each pair of tests. Can also be passed
+the data structure that timethese() returns:
+
+ $results = timethese( .... );
+ cmpthese( $results );
+
+Returns the data structure returned by timethese() (or passed in).
+
+=item countit(TIME, CODE)
+
+Arguments: TIME is the minimum length of time to run CODE for, and CODE is
+the code to run. CODE may be either a code reference or a string to
+be eval'd; either way it will be run in the caller's package.
+
+TIME is I<not> negative. countit() will run the loop many times to
+calculate the speed of CODE before running it for TIME. The actual
+time run for will usually be greater than TIME due to system clock
+resolution, so it's best to look at the number of iterations divided
+by the times that you are concerned with, not just the iterations.
+
+Returns: a Benchmark object.
+
=item disablecache ( )
Disable caching of timings for the null loop. This will force Benchmark
rounds of the null loop will be calculated only once for each
different COUNT used.
+=item timesum ( T1, T2 )
+
+Returns the sum of two Benchmark times as a Benchmark object suitable
+for passing to timestr().
+
=back
=head1 NOTES
The data is stored as a list of values from the time and times
functions:
- ($real, $user, $system, $children_user, $children_system)
+ ($real, $user, $system, $children_user, $children_system, $iters)
in seconds for the whole loop (not divided by the number of rounds).
number of rounds but empty loop body) is subtracted
from the time of the real loop.
-The null loop times are cached, the key being the
+The null loop times can be cached, the key being the
number of rounds. The caching can be controlled using
calls like these:
disablecache();
enablecache();
+Caching is off by default, as it can (usually slightly) decrease
+accuracy and does not usually noticably affect runtimes.
+
+=head1 EXAMPLES
+
+For example,
+
+ use Benchmark;$x=3;cmpthese(-5,{a=>sub{$x*$x},b=>sub{$x**2}})
+
+outputs something like this:
+
+ Benchmark: running a, b, each for at least 5 CPU seconds...
+ a: 10 wallclock secs ( 5.14 usr + 0.13 sys = 5.27 CPU) @ 3835055.60/s (n=20210743)
+ b: 5 wallclock secs ( 5.41 usr + 0.00 sys = 5.41 CPU) @ 1574944.92/s (n=8520452)
+ Rate b a
+ b 1574945/s -- -59%
+ a 3835056/s 144% --
+
+while
+
+ use Benchmark;
+ $x=3;
+ $r=timethese(-5,{a=>sub{$x*$x},b=>sub{$x**2}},'none');
+ cmpthese($r);
+
+outputs something like this:
+
+ Rate b a
+ b 1559428/s -- -62%
+ a 4152037/s 166% --
+
+
=head1 INHERITANCE
Benchmark inherits from no other class, except of course
=head1 CAVEATS
Comparing eval'd strings with code references will give you
-inaccurate results: a code reference will show a slower
+inaccurate results: a code reference will show a slightly slower
execution time than the equivalent eval'd string.
The real time timing is done using time(2) and
more than the system time of the loop with the actual
code and therefore the difference might end up being E<lt> 0.
+=head1 SEE ALSO
+
+L<Devel::DProf> - a Perl code profiler
+
=head1 AUTHORS
Jarkko Hietaniemi <F<jhi@iki.fi>>, Tim Bunce <F<Tim.Bunce@ig.co.uk>>
April 04-07th, 1997: by Jarkko Hietaniemi, added the run-for-some-time
functionality.
+September, 1999; by Barrie Slaymaker: math fixes and accuracy and
+efficiency tweaks. Added cmpthese(). A result is now returned from
+timethese(). Exposed countit() (was runfor()).
+
=cut
# evaluate something in a clean lexical environment
use Carp;
use Exporter;
@ISA=(Exporter);
-@EXPORT=qw(timeit timethis timethese timediff timesum timestr);
-@EXPORT_OK=qw(clearcache clearallcache disablecache enablecache);
+@EXPORT=qw(timeit timethis timethese timediff timestr);
+@EXPORT_OK=qw(timesum cmpthese countit
+ clearcache clearallcache disablecache enablecache);
+
+$VERSION = 1.00;
&init;
sub cpu_c { my($r,$pu,$ps,$cu,$cs) = @{$_[0]}; $cu+$cs ; }
sub cpu_a { my($r,$pu,$ps,$cu,$cs) = @{$_[0]}; $pu+$ps+$cu+$cs ; }
sub real { my($r,$pu,$ps,$cu,$cs) = @{$_[0]}; $r ; }
+sub iters { $_[0]->[5] ; }
sub timediff {
my($a, $b) = @_;
croak "runloop unable to compile '$c': $@\ncode: $subcode\n" if $@;
print STDERR "runloop $n '$subcode'\n" if $debug;
- # Wait for the user timer to tick. This makes the error range more like -0.01, +0. If
- # we don't wait, then it's more like -0.01, +0.01. This may not seem important, but it
- # significantly reduces the chances of getting too low initial $n in the initial, 'find
- # the minimum' loop in &runfor. This, in turn, can reduce the number of calls to
+ # Wait for the user timer to tick. This makes the error range more like
+ # -0.01, +0. If we don't wait, then it's more like -0.01, +0.01. This
+ # may not seem important, but it significantly reduces the chances of
+ # getting a too low initial $n in the initial, 'find the minimum' loop
+ # in &countit. This, in turn, can reduce the number of calls to
# &runloop a lot, and thus reduce additive errors.
my $tbase = Benchmark->new(0)->[1];
- do {
- $t0 = Benchmark->new(0);
- } while ( $t0->[1] == $tbase ) ;
+ while ( ( $t0 = Benchmark->new(0) )->[1] == $tbase ) {} ;
&$subref;
$t1 = Benchmark->new($n);
$td = &timediff($t1, $t0);
my($wn, $wc, $wd);
printf STDERR "timeit $n $code\n" if $debug;
- my $cache_key = $n . ( ref( $code ) ? 'c' : 's' ) ;
+ my $cache_key = $n . ( ref( $code ) ? 'c' : 's' );
if ($cache && exists $cache{$cache_key} ) {
$wn = $cache{$cache_key};
} else {
$wn = &runloop($n, ref( $code ) ? sub { undef } : '' );
+ # Can't let our baseline have any iterations, or they get subtracted
+ # out of the result.
+ $wn->[5] = 0;
$cache{$cache_key} = $wn;
}
$wc = &runloop($n, $code);
$wd = timediff($wc, $wn);
-
timedebug("timeit: ",$wc);
timedebug(" - ",$wn);
timedebug(" = ",$wd);
my $default_for = 3;
my $min_for = 0.1;
-sub runfor {
- my ($code, $tmax) = @_;
+
+sub countit {
+ my ( $tmax, $code ) = @_;
if ( not defined $tmax or $tmax == 0 ) {
$tmax = $default_for;
$tmax = -$tmax;
}
- die "runfor(..., $tmax): timelimit cannot be less than $min_for.\n"
+ die "countit($tmax, ...): timelimit cannot be less than $min_for.\n"
if $tmax < $min_for;
- my ($n, $td, $tc, $ntot, $rtot, $utot, $stot, $cutot, $cstot );
+ my ($n, $tc);
# First find the minimum $n that gives a significant timing.
-
- my $nmin;
+ for ($n = 1; ; $n *= 2 ) {
+ my $td = timeit($n, $code);
+ $tc = $td->[1] + $td->[2];
+ last if $tc > 0.1;
+ }
- for ($n = 1, $tc = 0; ; $n *= 2 ) {
- $td = timeit($n, $code);
+ my $nmin = $n;
+
+ # Get $n high enough that we can guess the final $n with some accuracy.
+ my $tpra = 0.1 * $tmax; # Target/time practice.
+ while ( $tc < $tpra ) {
+ # The 5% fudge is to keep us from iterating again all
+ # that often (this speeds overall responsiveness when $tmax is big
+ # and we guess a little low). This does not noticably affect
+ # accuracy since we're not couting these times.
+ $n = int( $tpra * 1.05 * $n / $tc ); # Linear approximation.
+ my $td = timeit($n, $code);
$tc = $td->[1] + $td->[2];
- last if $tc > 0.1 ;
}
- $nmin = $n;
-
- my $ttot = 0;
- my $tpra = 0.05 * $tmax; # Target/time practice.
- # Double $n until we have think we have practiced enough.
- for ( ; $ttot < $tpra; $n *= 2 ) {
- $td = timeit($n, $code);
- $ntot += $n;
- $rtot += $td->[0];
- $utot += $td->[1];
- $stot += $td->[2];
- $ttot = $utot + $stot;
+ # Now, do the 'for real' timing(s), repeating until we exceed
+ # the max.
+ my $ntot = 0;
+ my $rtot = 0;
+ my $utot = 0.0;
+ my $stot = 0.0;
+ my $cutot = 0.0;
+ my $cstot = 0.0;
+ my $ttot = 0.0;
+
+ # The 5% fudge is because $n is often a few % low even for routines
+ # with stable times and avoiding extra timeit()s is nice for
+ # accuracy's sake.
+ $n = int( $n * ( 1.05 * $tmax / $tc ) );
+
+ while () {
+ my $td = timeit($n, $code);
+ $ntot += $n;
+ $rtot += $td->[0];
+ $utot += $td->[1];
+ $stot += $td->[2];
$cutot += $td->[3];
$cstot += $td->[4];
- }
-
- my $r;
+ $ttot = $utot + $stot;
+ last if $ttot >= $tmax;
- # Then iterate towards the $tmax.
- while ( $ttot < $tmax ) {
- $r = $tmax / $ttot - 1; # Linear approximation.
+ my $r = $tmax / $ttot - 1; # Linear approximation.
$n = int( $r * $ntot );
$n = $nmin if $n < $nmin;
- $td = timeit($n, $code);
- $ntot += $n;
- $rtot += $td->[0];
- $utot += $td->[1];
- $stot += $td->[2];
- $ttot = $utot + $stot;
- $cutot += $td->[3];
- $cstot += $td->[4];
}
return bless [ $rtot, $utot, $stot, $cutot, $cstot, $ntot ];
$title = "timethis $n" unless defined $title;
} else {
$fort = n_to_for( $n );
- $t = runfor($code, $fort);
+ $t = countit( $fort, $code );
$title = "timethis for $fort" unless defined $title;
$forn = $t->[-1];
}
local $| = 1;
$style = "" unless defined $style;
- printf("%10s: ", $title);
- print timestr($t, $style, $defaultfmt),"\n";
+ printf("%10s: ", $title) unless $style eq 'none';
+ print timestr($t, $style, $defaultfmt),"\n" unless $style eq 'none';
$n = $forn if defined $forn;
unless ref $alt eq HASH;
my @names = sort keys %$alt;
$style = "" unless defined $style;
- print "Benchmark: ";
+ print "Benchmark: " unless $style eq 'none';
if ( $n > 0 ) {
croak "non-integer loopcount $n, stopped" if int($n)<$n;
- print "timing $n iterations of";
+ print "timing $n iterations of" unless $style eq 'none';
} else {
- print "running";
+ print "running" unless $style eq 'none';
}
- print " ", join(', ',@names);
+ print " ", join(', ',@names) unless $style eq 'none';
unless ( $n > 0 ) {
my $for = n_to_for( $n );
- print ", each for at least $for CPU seconds";
+ print ", each for at least $for CPU seconds" unless $style eq 'none';
}
- print "...\n";
+ print "...\n" unless $style eq 'none';
# we could save the results in an array and produce a summary here
# sum, min, max, avg etc etc
+ my %results;
foreach my $name (@names) {
- timethis ($n, $alt -> {$name}, $name, $style);
+ $results{$name} = timethis ($n, $alt -> {$name}, $name, $style);
}
+
+ return \%results;
}
+sub cmpthese{
+ my $results = ref $_[0] ? $_[0] : timethese( @_ );
+
+ return $results
+ if defined $_[2] && $_[2] eq 'none';
+
+ # Flatten in to an array of arrays with the name as the first field
+ my @vals = map{ [ $_, @{$results->{$_}} ] } keys %$results;
+
+ for (@vals) {
+ # The epsilon fudge here is to prevent div by 0. Since clock
+ # resolutions are much larger, it's below the noise floor.
+ my $rate = $_->[6] / ( $_->[2] + $_->[3] + 0.000000000000001 );
+ $_->[7] = $rate;
+ }
+
+ # Sort by rate
+ @vals = sort { $a->[7] <=> $b->[7] } @vals;
+
+ # If more than half of the rates are greater than one...
+ my $display_as_rate = $vals[$#vals>>1]->[7] > 1;
+
+ my @rows;
+ my @col_widths;
+
+ my @top_row = (
+ '',
+ $display_as_rate ? 'Rate' : 's/iter',
+ map { $_->[0] } @vals
+ );
+
+ push @rows, \@top_row;
+ @col_widths = map { length( $_ ) } @top_row;
+
+ # Build the data rows
+ # We leave the last column in even though it never has any data. Perhaps
+ # it should go away. Also, perhaps a style for a single column of
+ # percentages might be nice.
+ for my $row_val ( @vals ) {
+ my @row;
+
+ # Column 0 = test name
+ push @row, $row_val->[0];
+ $col_widths[0] = length( $row_val->[0] )
+ if length( $row_val->[0] ) > $col_widths[0];
+
+ # Column 1 = performance
+ my $row_rate = $row_val->[7];
+
+ # We assume that we'll never get a 0 rate.
+ my $a = $display_as_rate ? $row_rate : 1 / $row_rate;
+
+ # Only give a few decimal places before switching to sci. notation,
+ # since the results aren't usually that accurate anyway.
+ my $format =
+ $a >= 100 ?
+ "%0.0f" :
+ $a >= 10 ?
+ "%0.1f" :
+ $a >= 1 ?
+ "%0.2f" :
+ $a >= 0.1 ?
+ "%0.3f" :
+ "%0.2e";
+
+ $format .= "/s"
+ if $display_as_rate;
+ # Using $b here due to optimizing bug in _58 through _61
+ my $b = sprintf( $format, $a );
+ push @row, $b;
+ $col_widths[1] = length( $b )
+ if length( $b ) > $col_widths[1];
+
+ # Columns 2..N = performance ratios
+ my $skip_rest = 0;
+ for ( my $col_num = 0 ; $col_num < @vals ; ++$col_num ) {
+ my $col_val = $vals[$col_num];
+ my $out;
+ if ( $skip_rest ) {
+ $out = '';
+ }
+ elsif ( $col_val->[0] eq $row_val->[0] ) {
+ $out = "--";
+ # $skip_rest = 1;
+ }
+ else {
+ my $col_rate = $col_val->[7];
+ $out = sprintf( "%.0f%%", 100*$row_rate/$col_rate - 100 );
+ }
+ push @row, $out;
+ $col_widths[$col_num+2] = length( $out )
+ if length( $out ) > $col_widths[$col_num+2];
+
+ # A little wierdness to set the first column width properly
+ $col_widths[$col_num+2] = length( $col_val->[0] )
+ if length( $col_val->[0] ) > $col_widths[$col_num+2];
+ }
+ push @rows, \@row;
+ }
+
+ # Equalize column widths in the chart as much as possible without
+ # exceeding 80 characters. This does not use or affect cols 0 or 1.
+ my @sorted_width_refs =
+ sort { $$a <=> $$b } map { \$_ } @col_widths[2..$#col_widths];
+ my $max_width = ${$sorted_width_refs[-1]};
+
+ my $total = @col_widths - 1 ;
+ for ( @col_widths ) { $total += $_ }
+
+ STRETCHER:
+ while ( $total < 80 ) {
+ my $min_width = ${$sorted_width_refs[0]};
+ last
+ if $min_width == $max_width;
+ for ( @sorted_width_refs ) {
+ last
+ if $$_ > $min_width;
+ ++$$_;
+ ++$total;
+ last STRETCHER
+ if $total >= 80;
+ }
+ }
+
+ # Dump the output
+ my $format = join( ' ', map { "%${_}s" } @col_widths ) . "\n";
+ substr( $format, 1, 0 ) = '-';
+ for ( @rows ) {
+ printf $format, @$_;
+ }
+
+ return $results;
+}
+
+
1;
$perl ||= $candidate if MM->maybe_command($candidate);
unless ($perl) {
my ($component,$perl_name);
- DIST_PERLNAME: foreach $perl_name ($^X, 'perl', 'perl5', "perl$]") {
+ DIST_PERLNAME:
+ foreach $perl_name ($^X, 'perl', 'perl5', "perl$Config::Config{version}") {
PATH_COMPONENT: foreach $component (MM->path(),
$Config::Config{'binexp'}) {
next unless defined($component) && $component;
} else {
$fastread = 1;
$CPAN::Config->{urllist} ||= [];
- *prompt = sub {
+ # prototype should match that of &MakeMaker::prompt
+ *prompt = sub ($;$) {
my($q,$a) = @_;
my($ret) = defined $a ? $a : "";
printf qq{%s [%s]\n\n}, $q, $ret;
*abs_path = \&_qnx_abs_path;
*fast_abs_path = \&_qnx_abs_path;
}
- elsif ($^O =~ /cygwin/) {
+ elsif ($^O eq 'cygwin') {
*getcwd = \&cwd;
*fastgetcwd = \&cwd;
*fastcwd = \&cwd;
=head1 AUTHOR
-Gurusamy Sarathy gsar@umich.edu
+Gurusamy Sarathy gsar@activestate.com
This code heavily adapted from an early version of perl5db.pl attributable
to Larry Wall and the Perl Porters.
$ExportLevel = 0;
$Verbose ||= 0;
+$VERSION = '5.562';
sub export_to_level {
require Exporter::Heavy;
modules and how the C<use> statement operates is important to
understanding the Exporter.
+=head2 How to Export
+
+The arrays C<@EXPORT> and C<@EXPORT_OK> in a module hold lists of
+symbols that are going to be exported into the users name space by
+default, or which they can request to be exported, respectively. The
+symbols can represent functions, scalars, arrays, hashes, or typeglobs.
+The symbols must be given by full name with the exception that the
+ampersand in front of a function is optional, e.g.
+
+ @EXPORT = qw(afunc $scalar @array); # afunc is a function
+ @EXPORT_OK = qw(&bfunc %hash *typeglob); # explicit prefix on &bfunc
+
=head2 Selecting What To Export
Do B<not> export method names!
where you can't directly call Export's import method. The export_to_level
method looks like:
-MyPackage->export_to_level($where_to_export, @what_to_export);
+MyPackage->export_to_level($where_to_export, $package, @what_to_export);
where $where_to_export is an integer telling how far up the calling stack
to export your symbols, and @what_to_export is an array telling what
-symbols *to* export (usually this is @_).
+symbols *to* export (usually this is @_). The $package argument is
+currently unused.
For example, suppose that you have a module, A, which already has an
import function:
my $version = ${"${pkg}::VERSION"};
if (!$version or $version < $wanted) {
$version ||= "(undef)";
- my $file = $INC{"$pkg.pm"};
+ # %INC contains slashes, but $pkg contains double-colons.
+ my $file = (map {s,::,/,g; $INC{$_}} "$pkg.pm")[0];
$file &&= " ($file)";
require Carp;
Carp::croak("$pkg $wanted required--this is only version $version$file")
This will generate code with an B<xs_init> function that glues the perl B<Socket::bootstrap> function
-to the C B<boot_Socket> function and writes it to a file named "xsinit.c".
+to the C B<boot_Socket> function and writes it to a file named F<xsinit.c>.
Note that B<DynaLoader> is a special case where it must call B<boot_DynaLoader> directly.
When looking for B<DBD::Oracle> relative to a search path,
we should find B<auto/DBD/Oracle/Oracle.a>
-Keep in mind, you can always supply B</my/own/path/ModuleName.a>
+Keep in mind that you can always supply B</my/own/path/ModuleName.a>
as an additional linker argument.
B<--> E<lt>list of linker argsE<gt>
C<ldopts($std,[@modules],[@link_args],$path)>
-Where,
+Where:
B<$std> is boolean, equivalent to the B<-std> option.
}
$packlist->read($pack{"read"}) if (-f $pack{"read"});
my $cwd = cwd();
- my $umask = umask 0 unless $Is_VMS;
my($source);
MOD_INSTALL: foreach $source (sort keys %hash) {
print "Writing $pack{'write'}\n";
$packlist->write($pack{'write'});
}
- umask $umask unless $Is_VMS;
}
sub directory_not_empty ($) {
forceunlink($_) unless $nonono;
}
print "unlink $fil\n" if $verbose;
- close P;
forceunlink($fil) unless $nonono;
}
close(FROMTO);
}
- my $umask = umask 0022 unless $Is_VMS;
mkpath($autodir,0,0755);
foreach (keys %$fromto) {
next if -f $fromto->{$_} && -M $fromto->{$_} < -M $_;
next unless /\.pm$/;
autosplit($fromto->{$_},$autodir);
}
- umask $umask unless $Is_VMS;
}
package ExtUtils::Install::Warn;
target files to the file named by C<$hashref-E<gt>{write}>. If there is
another file named by C<$hashref-E<gt>{read}>, the contents of this file will
be merged into the written file. The read and the written file may be
-identical, but on AFS it is quite likely, people are installing to a
+identical, but on AFS it is quite likely that people are installing to a
different directory than the one where the files later appear.
install_default() takes one or less arguments. If no arguments are
perl -MExtUtils::Install -e install_default Tk/Canvas
-Assuming this command is executed in a directory with populated F<blib>
+Assuming this command is executed in a directory with a populated F<blib>
directory, it will proceed as if the F<blib> was build by MakeMaker on
this machine. This is useful for binary distributions.
# Read the core packlist
$self->{Perl}{packlist} =
ExtUtils::Packlist->new("$Config{installarchlib}/.packlist");
-$self->{Perl}{version} = $];
+$self->{Perl}{version} = $Config{version};
# Read the module packlists
my $sub = sub
=head2 EXTRALIBS
List of libraries that need to be linked with when linking a perl
-binary which includes this extension Only those libraries that
+binary which includes this extension. Only those libraries that
actually exist are included. These are written to a file and used
when linking perl.
=head1 PORTABILITY
This module deals with a lot of system dependencies and has quite a
-few architecture specific B<if>s in the code.
+few architecture specific C<if>s in the code.
=head2 VMS implementation
The libraries specified may be a mixture of static libraries and
import libraries (to link with DLLs). Since both kinds are used
-pretty transparently on the win32 platform, we do not attempt to
+pretty transparently on the Win32 platform, we do not attempt to
distinguish between them.
=item *
if ($Is_PERL_OBJECT) {
$self->{CCFLAGS} =~ s/-DPERL_OBJECT(\b|$)/-DPERL_CAPI/g;
- if ($Is_Win32 && $Config{'cc'} =~ /^cl/i) {
- # Turn off C++ mode of the MSC compiler
- $self->{CCFLAGS} =~ s/-TP(\s|$)//;
- $self->{OPTIMIZE} =~ s/-TP(\s|$)//;
+ if ($Is_Win32) {
+ if ($Config{'cc'} =~ /^cl/i) {
+ # Turn off C++ mode of the MSC compiler
+ $self->{CCFLAGS} =~ s/-TP(\s|$)//g;
+ $self->{OPTIMIZE} =~ s/-TP(\s|$)//g;
+ }
+ elsif ($Config{'cc'} =~ /^bcc32/i) {
+ # Turn off C++ mode of the Borland compiler
+ $self->{CCFLAGS} =~ s/-P(\s|$)//g;
+ $self->{OPTIMIZE} =~ s/-P(\s|$)//g;
+ }
+ elsif ($Config{'cc'} =~ /^gcc/i) {
+ # Turn off C++ mode of the GCC compiler
+ $self->{CCFLAGS} =~ s/-xc\+\+(\s|$)//g;
+ $self->{OPTIMIZE} =~ s/-xc\+\+(\s|$)//g;
+ }
}
}
');
# clean subdirectories first
for $dir (@{$self->{DIR}}) {
- push @m, "\t-cd $dir && \$(TEST_F) $self->{MAKEFILE} && \$(MAKE) clean\n";
+ if ($Is_Win32 && Win32::IsWin95()) {
+ push @m, <<EOT;
+ cd $dir
+ \$(TEST_F) $self->{MAKEFILE}
+ \$(MAKE) clean
+ cd ..
+EOT
+ }
+ else {
+ push @m, <<EOT;
+ -cd $dir && \$(TEST_F) $self->{MAKEFILE} && \$(MAKE) clean
+EOT
+ }
}
my(@otherfiles) = values %{$self->{XS}}; # .c files from *.xs files
push @defpath, $component if defined $component;
}
$self->{PERL} ||=
- $self->find_perl(5.0, [ $self->canonpath($^X), 'miniperl','perl','perl5',"perl$]" ],
+ $self->find_perl(5.0, [ $self->canonpath($^X), 'miniperl',
+ 'perl','perl5',"perl$Config{version}" ],
\@defpath, $Verbose );
# don't check if perl is executable, maybe they have decided to
# supply switches with perl
}.$self->catdir('$(PERL_ARCHLIB)','auto','$(FULLEXT)').q{
doc_perl_install ::
+ -}.$self->{NOECHO}.q{$(MKPATH) $(INSTALLARCHLIB)
-}.$self->{NOECHO}.q{$(DOC_INSTALL) \
"Module" "$(NAME)" \
"installed into" "$(INSTALLPRIVLIB)" \
>> }.$self->catfile('$(INSTALLARCHLIB)','perllocal.pod').q{
doc_site_install ::
+ -}.$self->{NOECHO}.q{$(MKPATH) $(INSTALLARCHLIB)
-}.$self->{NOECHO}.q{$(DOC_INSTALL) \
"Module" "$(NAME)" \
"installed into" "$(INSTALLSITELIB)" \
push @m, q{
doc_inst_perl:
}.$self->{NOECHO}.q{echo Appending installation info to $(INSTALLARCHLIB)/perllocal.pod
+ -}.$self->{NOECHO}.q{$(MKPATH) $(INSTALLARCHLIB)
-}.$self->{NOECHO}.q{$(DOC_INSTALL) \
"Perl binary" "$(MAP_TARGET)" \
MAP_STATIC "$(MAP_STATIC)" \
realclean purge :: clean
');
# realclean subdirectories first (already cleaned)
- my $sub = "\t-cd %s && \$(TEST_F) %s && \$(MAKE) %s realclean\n";
+ my $sub = ($Is_Win32 && Win32::IsWin95()) ?
+ "\tcd %s\n\t\$(TEST_F) %s\n\t\$(MAKE) %s realclean\n\tcd ..\n" :
+ "\t-cd %s && \$(TEST_F) %s && \$(MAKE) %s realclean\n";
foreach(@{$self->{DIR}}){
push(@m, sprintf($sub,$_,"$self->{MAKEFILE}.old","-f $self->{MAKEFILE}.old"));
push(@m, sprintf($sub,$_,"$self->{MAKEFILE}",''));
sub subdir_x {
my($self, $subdir) = @_;
my(@m);
- qq{
+ if ($Is_Win32 && Win32::IsWin95()) {
+ # XXX: dmake-specific, like rest of Win95 port
+ return <<EOT;
+subdirs ::
+@[
+ cd $subdir
+ \$(MAKE) all \$(PASTHRU)
+ cd ..
+]
+EOT
+ }
+ else {
+ return <<EOT;
subdirs ::
$self->{NOECHO}cd $subdir && \$(MAKE) all \$(PASTHRU)
-};
+EOT
+ }
}
=item subdirs (o)
XSUBPPDIR = $xsdir
XSUBPP = \$(XSUBPPDIR)/$xsubpp
XSPROTOARG = $self->{XSPROTOARG}
-XSUBPPDEPS = @tmdeps
+XSUBPPDEPS = @tmdeps \$(XSUBPP)
XSUBPPARGS = @tmargs
};
};
'.$self->{NOECHO}.'$(NOOP)
';
- push @m, qq{
-config :: Version_check
- $self->{NOECHO}\$(NOOP)
-
-} unless $self->{PARENT} or ($self->{PERL_SRC} && $self->{INSTALLDIRS} eq "perl") or $self->{NO_VC};
-
push @m, $self->dir_target(qw[$(INST_AUTODIR) $(INST_LIBDIR) $(INST_ARCHAUTODIR)]);
if (%{$self->{HTMLLIBPODS}}) {
$(NOECHO) $(NOOP)
';
- push @m, q{
-config :: Version_check
- $(NOECHO) $(NOOP)
-
-} unless $self->{PARENT} or ($self->{PERL_SRC} && $self->{INSTALLDIRS} eq "perl") or $self->{NO_VC};
-
-
push @m, $self->dir_target(qw[$(INST_AUTODIR) $(INST_LIBDIR) $(INST_ARCHAUTODIR)]);
if (%{$self->{MAN1PODS}}) {
push @m, q[
$PERLMAKE = 1 if $Config{'make'} =~ /^pmake/i;
$OBJ = 1 if $Config{'ccflags'} =~ /PERL_OBJECT/i;
+# a few workarounds for command.com (very basic)
+{
+ package ExtUtils::MM_Win95;
+
+ # the $^O test may be overkill, but we want to be sure Win32::IsWin95()
+ # exists before we try it
+
+ unshift @MM::ISA, 'ExtUtils::MM_Win95'
+ if ($^O =~ /Win32/ && Win32::IsWin95());
+
+ sub xs_c {
+ my($self) = shift;
+ return '' unless $self->needs_linking();
+ '
+.xs.c:
+ $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) \\
+ $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.c
+ '
+ }
+
+ sub xs_cpp {
+ my($self) = shift;
+ return '' unless $self->needs_linking();
+ '
+.xs.cpp:
+ $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) \\
+ $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.cpp
+ ';
+ }
+
+ # many makes are too dumb to use xs_c then c_o
+ sub xs_o {
+ my($self) = shift;
+ return '' unless $self->needs_linking();
+ '
+.xs$(OBJ_EXT):
+ $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) \\
+ $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.c
+ $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.c
+ ';
+ }
+} # end of command.com workarounds
+
sub dlsyms {
my($self,%attribs) = @_;
my($inst_dynamic_dep) = $attribs{INST_DYNAMIC_DEP} || "";
my($ldfrom) = '$(LDFROM)';
my(@m);
+
+# one thing for GCC/Mingw32:
+# we try to overcome non-relocateable-DLL problems by generating
+# a (hopefully unique) image-base from the dll's name
+# -- BKS, 10-19-1999
+ if ($GCC) {
+ my $dllname = $self->{BASEEXT} . "." . $self->{DLEXT};
+ $dllname =~ /(....)(.{0,4})/;
+ my $baseaddr = unpack("n", $1 ^ $2);
+ $otherldflags .= sprintf("-Wl,--image-base,0x%x0000 ", $baseaddr);
+ }
+
push(@m,'
# This section creates the dynamically loadable $(INST_DYNAMIC)
# from $(OBJECT) and possibly $(MYEXTLIB).
'.$self->{NOECHO}.'$(NOOP)
';
- push @m, qq{
-config :: Version_check
- $self->{NOECHO}\$(NOOP)
-
-} unless $self->{PARENT} or ($self->{PERL_SRC} && $self->{INSTALLDIRS} eq "perl") or $self->{NO_VC};
-
push @m, $self->dir_target(qw[$(INST_AUTODIR) $(INST_LIBDIR) $(INST_ARCHAUTODIR)]);
if (%{$self->{HTMLLIBPODS}}) {
package ExtUtils::MakeMaker;
-$VERSION = "5.4302";
+$VERSION = "5.44";
$Version_OK = "5.17"; # Makefiles older than $Version_OK will die
# (Will be checked from MakeMaker version 4.13 onwards)
($Revision = substr(q$Revision: 1.222 $, 10)) =~ s/\s+$//;
use vars qw(
@ISA @EXPORT @EXPORT_OK $AUTOLOAD
- $ISA_TTY $Is_Mac $Is_OS2 $Is_VMS $Revision $Setup_done
+ $ISA_TTY $Is_Mac $Is_OS2 $Is_VMS $Revision
$VERSION $Verbose $Version_OK %Config %Keep_after_flush
%MM_Sections %Prepend_dot_dot %Recognized_Att_Keys
@Get_from_Config @MM_Sections @Overridable @Parent
$Is_OS2 = $^O eq 'os2';
$Is_Mac = $^O eq 'MacOS';
$Is_Win32 = $^O eq 'MSWin32';
-$Is_Cygwin= $^O =~ /cygwin/i;
+$Is_Cygwin= $^O eq 'cygwin';
require ExtUtils::MM_Unix;
require ExtUtils::MM_Cygwin;
}
-# The SelfLoader would bring a lot of overhead for MakeMaker, because
-# we know for sure we will use most of the autoloaded functions once
-# we have to use one of them. So we write our own loader
-
-sub AUTOLOAD {
- my $code;
- if (defined fileno(DATA)) {
- my $fh = select DATA;
- my $o = $/; # For future reads from the file.
- $/ = "\n__END__\n";
- $code = <DATA>;
- $/ = $o;
- select $fh;
- close DATA;
- eval $code;
- if ($@) {
- $@ =~ s/ at .*\n//;
- Carp::croak $@;
- }
- } else {
- warn "AUTOLOAD called unexpectedly for $AUTOLOAD";
- }
- defined(&$AUTOLOAD) or die "Myloader inconsistency error";
- goto &$AUTOLOAD;
-}
+full_setup();
-# The only subroutine we do not SelfLoad is Version_Check because it's
-# called so often. Loading this minimum still requires 1.2 secs on my
-# Indy :-(
+# The use of the Version_check target has been dropped between perl
+# 5.5.63 and 5.5.64. We must keep the subroutine for a while so that
+# old Makefiles can satisfy the Version_check target.
sub Version_check {
my($checkversion) = @_;
warn @_;
}
-sub ExtUtils::MakeMaker::eval_in_subdirs ;
-sub ExtUtils::MakeMaker::eval_in_x ;
-sub ExtUtils::MakeMaker::full_setup ;
-sub ExtUtils::MakeMaker::writeMakefile ;
-sub ExtUtils::MakeMaker::new ;
-sub ExtUtils::MakeMaker::check_manifest ;
-sub ExtUtils::MakeMaker::parse_args ;
-sub ExtUtils::MakeMaker::check_hints ;
-sub ExtUtils::MakeMaker::mv_all_methods ;
-sub ExtUtils::MakeMaker::skipcheck ;
-sub ExtUtils::MakeMaker::flush ;
-sub ExtUtils::MakeMaker::mkbootstrap ;
-sub ExtUtils::MakeMaker::mksymlists ;
-sub ExtUtils::MakeMaker::neatvalue ;
-sub ExtUtils::MakeMaker::selfdocument ;
-sub ExtUtils::MakeMaker::WriteMakefile ;
-sub ExtUtils::MakeMaker::prompt ($;$) ;
-
-1;
-
-__DATA__
-
-package ExtUtils::MakeMaker;
-
sub WriteMakefile {
Carp::croak "WriteMakefile: Need even number of args" if @_ % 2;
local $SIG{__WARN__} = \&warnhandler;
- unless ($Setup_done++){
- full_setup();
- undef &ExtUtils::MakeMaker::full_setup; #safe memory
- }
my %att = @_;
MM->new(\%att)->flush;
}
my($prereq);
foreach $prereq (sort keys %{$self->{PREREQ_PM}}) {
- my $eval = "use $prereq $self->{PREREQ_PM}->{$prereq}";
+ my $eval = "require $prereq";
eval $eval;
- if ($@){
+
+ if ($@) {
+ warn "Warning: prerequisite $prereq failed to load: $@";
+ }
+ elsif ($prereq->VERSION < $self->{PREREQ_PM}->{$prereq} ){
warn "Warning: prerequisite $prereq $self->{PREREQ_PM}->{$prereq} not found";
# Why is/was this 'delete' here? We need PREREQ_PM later to make PPDs.
# } else {
internal variables and get different results. It is worth to mention,
that make(1) also lets you configure most of the variables that are
used in the Makefile. But in the majority of situations this will not
-be necessary, and should only be done, if the author of a package
+be necessary, and should only be done if the author of a package
recommends it (or you know what you're doing).
=head2 Using Attributes and Parameters
=item NEEDS_LINKING
-MakeMaker will figure out, if an extension contains linkable code
+MakeMaker will figure out if an extension contains linkable code
anywhere down the directory tree, and will set this variable
-accordingly, but you can speed it up a very little bit, if you define
+accordingly, but you can speed it up a very little bit if you define
this boolean variable yourself.
=item NOECHO
=item NO_VC
-In general any generated Makefile checks for the current version of
+In general, any generated Makefile checks for the current version of
MakeMaker and the version the Makefile was built under. If NO_VC is
set, the version check is neglected. Do not write this into your
Makefile.PL, use it interactively instead.
=item PERL_ARCHLIB
-Same as above for architecture dependent files
+Same as above for architecture dependent files.
=item PERL_LIB
=item POLLUTE
Release 5.005 grandfathered old global symbol names by providing preprocessor
-macros for extension source compatibility. As of release 5.006, these
+macros for extension source compatibility. As of release 5.6, these
preprocessor definitions are not available by default. The POLLUTE flag
specifies that the old names should still be defined:
perl Makefile.PL POLLUTE=1
Please inform the module author if this is necessary to successfully install
-a module under 5.006 or later.
+a module under 5.6 or later.
=item PPM_INSTALL_EXEC
=item SKIP
Arryref. E.g. [qw(name1 name2)] skip (do not write) sections of the
-Makefile. Caution! Do not use the SKIP attribute for the neglectible
-speedup. It may seriously damage the resulting Makefile. Only use it,
+Makefile. Caution! Do not use the SKIP attribute for the negligible
+speedup. It may seriously damage the resulting Makefile. Only use it
if you really need it.
=item TYPEMAPS
{LINKTYPE => ''}
with Pre-5.0 MakeMakers. Since version 5.00 of MakeMaker such a line
-can be deleted safely. MakeMaker recognizes, when there's nothing to
+can be deleted safely. MakeMaker recognizes when there's nothing to
be linked.
=item macro
=item make distclean
does a realclean first and then the distcheck. Note that this is not
-needed to build a new distribution as long as you are sure, that the
+needed to build a new distribution as long as you are sure that the
MANIFEST file is ok.
=item make manifest
require File::Basename;
my(%dirs,$file);
$target = VMS::Filespec::unixify($target) if $Is_VMS;
- umask 0 unless $Is_VMS;
File::Path::mkpath([ $target ],1,$Is_VMS ? undef : 0755);
foreach $file (keys %$read){
$file = VMS::Filespec::unixify($file) if $Is_VMS;
Mkbootstrap typically gets called from an extension Makefile.
-There is no C<*.bs> file supplied with the extension. Instead a
-C<*_BS> file which has code for the special cases, like posix for
+There is no C<*.bs> file supplied with the extension. Instead, there may
+be a C<*_BS> file which has code for the special cases, like posix for
berkeley db on the NeXT.
This file will get parsed, and produce a maybe empty
}
my $distname = $data->{DISTNAME} || $data->{NAME};
$distname = "Distribution $distname";
- my $comment = "Perl (v$]$threaded) module $data->{NAME}";
+ my $comment = "Perl (v$Config::Config{version}$threaded) module $data->{NAME}";
if ($data->{INSTALLDIRS} and $data->{INSTALLDIRS} eq 'perl') {
$distname = 'perl5-porters@perl.org';
$comment = "Core $comment";
T_OPAQUE
sv_setpvn($arg, (char *)&$var, sizeof($var));
T_OPAQUEPTR
- sv_setpvn($arg, (char *)$var, sizeof(*$var)), XFree((char *)$var);
+ sv_setpvn($arg, (char *)$var, sizeof(*$var));
T_PACKED
XS_pack_$ntype($arg, $var);
T_PACKEDARRAY
=head1 SYNOPSIS
-B<xsubpp> [B<-v>] [B<-C++>] [B<-except>] [B<-s pattern>] [B<-prototypes>] [B<-noversioncheck>] [B<-nolinenumbers>] [B<-typemap typemap>] ... file.xs
+B<xsubpp> [B<-v>] [B<-C++>] [B<-except>] [B<-s pattern>] [B<-prototypes>] [B<-noversioncheck>] [B<-nolinenumbers>] [B<-nooptimize>] [B<-typemap typemap>] ... file.xs
=head1 DESCRIPTION
+This compiler is typically run by the makefiles created by L<ExtUtils::MakeMaker>.
+
I<xsubpp> will compile XS code into C code by embedding the constructs
necessary to let C functions manipulate Perl values and creates the glue
necessary to let Perl access those functions. The compiler uses typemaps to
=head1 OPTIONS
+Note that the C<XSOPT> MakeMaker option may be used to add these options to
+any makefiles generated by MakeMaker.
+
=over 5
=item B<-C++>
Adds ``extern "C"'' to the C code.
-
=item B<-except>
Adds exception handling stubs to the C code.
Prevents the inclusion of `#line' directives in the output.
+=item B<-nooptimize>
+
+Disables certain optimizations. The only optimization that is currently
+affected is the use of I<target>s by the output C code (see L<perlguts>).
+This may significantly slow down the generated code, but this is the way
+B<xsubpp> of 5.005 and earlier operated.
+
=back
=head1 ENVIRONMENT
$FH = 'File0000' ;
-$usage = "Usage: xsubpp [-v] [-C++] [-except] [-prototypes] [-noversioncheck] [-nolinenumbers] [-s pattern] [-typemap typemap]... file.xs\n";
+$usage = "Usage: xsubpp [-v] [-C++] [-except] [-prototypes] [-noversioncheck] [-nolinenumbers] [-nooptimize] [-s pattern] [-typemap typemap]... file.xs\n";
$proto_re = "[" . quotemeta('\$%&*@;') . "]" ;
# mjn
$WantVersionChk = 1 ;
$ProtoUsed = 0 ;
$WantLineNumbers = 1 ;
+$WantOptimize = 1 ;
SWITCH: while (@ARGV and $ARGV[0] =~ /^-./) {
$flag = shift @ARGV;
$flag =~ s/^-// ;
push(@tm,shift), next SWITCH if $flag eq 'typemap';
$WantLineNumbers = 0, next SWITCH if $flag eq 'nolinenumbers';
$WantLineNumbers = 1, next SWITCH if $flag eq 'linenumbers';
- (print "xsubpp version $XSUBPP_version\n"), exit
+ $WantOptimize = 0, next SWITCH if $flag eq 'nooptimize';
+ $WantOptimize = 1, next SWITCH if $flag eq 'optimize';
+ (print "xsubpp version $XSUBPP_version\n"), exit
if $flag eq 'v';
die $usage;
}
$input_expr{$key} =~ s/\n+$//;
}
+$bal = qr[(?:(?>[^()]+)|\((?p{ $bal })\))*]; # ()-balanced
+$cast = qr[(?:\(\s*SV\s*\*\s*\)\s*)?]; # Optional (SV*) cast
+$size = qr[,\s* (?p{ $bal }) ]x; # Third arg (to setpvn)
+
+foreach $key (keys %output_expr) {
+ use re 'eval';
+
+ my ($t, $with_size, $arg, $sarg) =
+ ($output_expr{$key} =~
+ m[^ \s+ sv_set ( [iunp] ) v (n)? # Type, is_setpvn
+ \s* \( \s* $cast \$arg \s* ,
+ \s* ( (?p{ $bal }) ) # Set from
+ ( (?p{ $size }) )? # Possible sizeof set-from
+ \) \s* ; \s* $
+ ]x);
+ $targetable{$key} = [$t, $with_size, $arg, $sarg] if $t;
+}
+
$END = "!End!\n\n"; # "impossible" keyword (multiple newline)
# Match an XS keyword
$thisdone |= $var_name eq "THIS";
$retvaldone |= $var_name eq "RETVAL";
$var_types{$var_name} = $var_type;
- print "\t" . &map_type($var_type);
+ # XXXX This check is a safeguard against the unfinished conversion of
+ # generate_init(). When generate_init() is fixed,
+ # one can use 2-args map_type() unconditionally.
+ if ($var_type =~ / \( \s* \* \s* \) /x) {
+ # Function pointers are not yet supported with &output_init!
+ print "\t" . &map_type($var_type, $var_name);
+ $name_printed = 1;
+ } else {
+ print "\t" . &map_type($var_type);
+ $name_printed = 0;
+ }
$var_num = $args_match{$var_name};
$proto_arg[$var_num] = ProtoString($var_type)
$func_args =~ s/\b($var_name)\b/&$1/;
}
if ($var_init =~ /^[=;]\s*NO_INIT\s*;?\s*$/) {
+ if ($name_printed) {
+ print ";\n";
+ } else {
print "\t$var_name;\n";
+ }
} elsif ($var_init =~ /\S/) {
- &output_init($var_type, $var_num, $var_name, $var_init);
+ &output_init($var_type, $var_num, $var_name, $var_init, $name_printed);
} elsif ($var_num) {
# generate initialization code
- &generate_init($var_type, $var_num, $var_name);
+ &generate_init($var_type, $var_num, $var_name, $name_printed);
} else {
print ";\n";
}
$_ = '' ;
} else {
if ($ret_type ne "void") {
- print "\t" . &map_type($ret_type) . "\tRETVAL;\n"
+ print "\t" . &map_type($ret_type, 'RETVAL') . ";\n"
if !$retvaldone;
$args_match{"RETVAL"} = 0;
$var_types{"RETVAL"} = $ret_type;
+ print "\tdXSTARG;\n"
+ if $WantOptimize and $targetable{$type_kind{$ret_type}};
}
print $deferred;
if ($gotRETVAL && $RETVAL_code) {
print "\t$RETVAL_code\n";
} elsif ($gotRETVAL || $wantRETVAL) {
- # RETVAL almost never needs SvSETMAGIC()
- &generate_output($ret_type, 0, 'RETVAL', 0);
+ my $t = $WantOptimize && $targetable{$type_kind{$ret_type}};
+ my $var = 'RETVAL';
+ my $type = $ret_type;
+
+ # 0: type, 1: with_size, 2: how, 3: how_size
+ if ($t and not $t->[1] and $t->[0] eq 'p') {
+ # PUSHp corresponds to setpvn. Treate setpv directly
+ my $what = eval qq("$t->[2]");
+ warn $@ if $@;
+
+ print "\tsv_setpv(TARG, $what); XSprePUSH; PUSHTARG;\n";
+ }
+ elsif ($t) {
+ my $what = eval qq("$t->[2]");
+ warn $@ if $@;
+
+ my $size = $t->[3];
+ $size = '' unless defined $size;
+ $size = eval qq("$size");
+ warn $@ if $@;
+ print "\tXSprePUSH; PUSH$t->[0]($what$size);\n";
+ }
+ else {
+ # RETVAL almost never needs SvSETMAGIC()
+ &generate_output($ret_type, 0, 'RETVAL', 0);
+ }
}
# do cleanup
&Exit;
sub output_init {
- local($type, $num, $var, $init) = @_;
+ local($type, $num, $var, $init, $name_printed) = @_;
local($arg) = "ST(" . ($num - 1) . ")";
if( $init =~ /^=/ ) {
- eval qq/print "\\t$var $init\\n"/;
+ if ($name_printed) {
+ eval qq/print " $init\\n"/;
+ } else {
+ eval qq/print "\\t$var $init\\n"/;
+ }
warn $@ if $@;
} else {
if( $init =~ s/^\+// && $num ) {
- &generate_init($type, $num, $var);
+ &generate_init($type, $num, $var, $name_printed);
+ } elsif ($name_printed) {
+ print ";\n";
+ $init =~ s/^;//;
} else {
eval qq/print "\\t$var;\\n"/;
warn $@ if $@;
if (defined($defaults{$var})) {
$expr =~ s/(\t+)/$1 /g;
$expr =~ s/ /\t/g;
- eval qq/print "\\t$var;\\n"/;
- warn $@ if $@;
+ if ($name_printed) {
+ print ";\n";
+ } else {
+ eval qq/print "\\t$var;\\n"/;
+ warn $@ if $@;
+ }
$deferred .= eval qq/"\\n\\tif (items < $num)\\n\\t $var = $defaults{$var};\\n\\telse {\\n$expr;\\n\\t}\\n"/;
warn $@ if $@;
} elsif ($ScopeThisXSUB or $expr !~ /^\t\$var =/) {
- eval qq/print "\\t$var;\\n"/;
- warn $@ if $@;
+ if ($name_printed) {
+ print ";\n";
+ } else {
+ eval qq/print "\\t$var;\\n"/;
+ warn $@ if $@;
+ }
$deferred .= eval qq/"\\n$expr;\\n"/;
warn $@ if $@;
} else {
+ die "panic: do not know how to handle this branch for function pointers"
+ if $name_printed;
eval qq/print "$expr;\\n"/;
warn $@ if $@;
}
$type = TidyType($type) ;
if ($type =~ /^array\(([^,]*),(.*)\)/) {
- print "\tsv_setpvn($arg, (char *)$var, $2 * sizeof($1)), XFree((char *)$var);\n";
+ print "\tsv_setpvn($arg, (char *)$var, $2 * sizeof($1));\n";
print "\tSvSETMAGIC($arg);\n" if $do_setmagic;
} else {
blurt("Error: '$type' not in typemap"), return
}
sub map_type {
- my($type) = @_;
+ my($type, $varname) = @_;
$type =~ tr/:/_/;
$type =~ s/^array\(([^,]*),(.*)\).*/$1 */s;
+ if ($varname) {
+ if ($varname && $type =~ / \( \s* \* (?= \s* \) ) /xg) {
+ (substr $type, pos $type, 0) = " $varname ";
+ } else {
+ $type .= "\t$varname";
+ }
+ }
$type;
}
use strict;
use Carp;
use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION $Too_Big
- © &syscopy &cp &mv);
+ © &syscopy &cp &mv $Syscopy_is_copy);
# Note that this module implements only *part* of the API defined by
# the File/Copy.pm module of the File-Tools-2.0 package. However, that
# package has not yet been updated to work with Perl 5.004, and so it
# would be a Bad Thing for the CPAN module to grab it and replace this
# module. Therefore, we set this module's version higher than 2.0.
-$VERSION = '2.02';
+$VERSION = '2.03';
require Exporter;
@ISA = qw(Exporter);
$to = _catname($from, $to);
}
- if (defined &syscopy && \&syscopy != \©
+ if (defined &syscopy && !$Syscopy_is_copy
&& !$to_a_handle
&& !($from_a_handle && $^O eq 'os2' ) # OS/2 cannot handle handles
&& !($from_a_handle && $^O eq 'mpeix') # and neither can MPE/iX.
&& !($from_a_handle && $^O eq 'MSWin32')
- )
+ )
{
return syscopy($from, $to);
}
open(FROM, "< $from\0") or goto fail_open1;
binmode FROM or die "($!,$^E)";
$closefrom = 1;
- }
-
+ }
+
if ($to_a_handle) {
*TO = *$to{FILEHANDLE};
- } else {
+ } else {
$to = "./$to" if $to =~ /^\s/;
open(TO,"> $to\0") or goto fail_open2;
binmode TO or die "($!,$^E)";
$closeto = 1;
- }
+ }
if (@_) {
$size = shift(@_) + 0;
# Use this idiom to avoid uninitialized value warning.
return 1;
-
+
# All of these contortions try to preserve error messages...
fail_inner:
if ($closeto) {
(($tosz2,$tomt2) = (stat($to))[7,9]) && # $to's there
($tosz1 != $tosz2 or $tomt1 != $tomt2) && # and changed
$tosz2 == $fromsz; # it's all there
-
+
($tosz1,$tomt1) = (stat($to))[7,9]; # just in case rename did something
return 1 if ($copied = copy($from,$to)) && unlink($from);
-
+
($tosz2,$tomt2) = ((stat($to))[7,9],0,0) if defined $tomt1;
unlink($to) if !defined($tomt1) or $tomt1 != $tomt2 or $tosz1 != $tosz2;
($!,$^E) = ($sts,$ossts);
return Win32::CopyFile(@_, 1);
};
} else {
+ $Syscopy_is_copy = 1;
*syscopy = \©
}
}
=head1 AUTHOR
-Gurusamy Sarathy <gsar@umich.edu>
+Gurusamy Sarathy <gsar@activestate.com>
=head1 HISTORY
package File::Find;
-require 5.000;
+require 5.005;
require Exporter;
require Cwd;
=head1 SYNOPSIS
use File::Find;
- find(\&wanted, '/foo','/bar');
+ find(\&wanted, '/foo', '/bar');
sub wanted { ... }
use File::Find;
- finddepth(\&wanted, '/foo','/bar');
+ finddepth(\&wanted, '/foo', '/bar');
sub wanted { ... }
+
+ use File::Find;
+ find({ wanted => \&process, follow => 1 }, '.');
=head1 DESCRIPTION
The first argument to find() is either a hash reference describing the
-operations to be performed for each file, a code reference, or a string
-that contains a subroutine name. If it is a hash reference, then the
-value for the key C<wanted> should be a code reference. This code
-reference is called I<the wanted() function> below.
+operations to be performed for each file, or a code reference.
-Currently the only other supported key for the above hash is
-C<bydepth>, in presense of which the walk over directories is
-performed depth-first. Entry point finddepth() is a shortcut for
-specifying C<{ bydepth => 1}> in the first argument of find().
+Here are the possible keys for the hash:
+
+=over 3
+
+=item C<wanted>
+
+The value should be a code reference. This code reference is called
+I<the wanted() function> below.
+
+=item C<bydepth>
+
+Reports the name of a directory only AFTER all its entries
+have been reported. Entry point finddepth() is a shortcut for
+specifying C<{ bydepth => 1 }> in the first argument of find().
+
+=item C<follow>
+
+Causes symbolic links to be followed. Since directory trees with symbolic
+links (followed) may contain files more than once and may even have
+cycles, a hash has to be built up with an entry for each file.
+This might be expensive both in space and time for a large
+directory tree. See I<follow_fast> and I<follow_skip> below.
+If either I<follow> or I<follow_fast> is in effect:
+
+=over 6
+
+=item
+
+It is guarantueed that an I<lstat> has been called before the user's
+I<wanted()> function is called. This enables fast file checks involving S< _>.
+
+=item
+
+There is a variable C<$File::Find::fullname> which holds the absolute
+pathname of the file with all symbolic links resolved
+
+=back
+
+=item C<follow_fast>
+
+This is similar to I<follow> except that it may report some files
+more than once. It does detect cycles however.
+Since only symbolic links have to be hashed, this is
+much cheaper both in space and time.
+If processing a file more than once (by the user's I<wanted()> function)
+is worse than just taking time, the option I<follow> should be used.
+
+=item C<follow_skip>
+
+C<follow_skip==1>, which is the default, causes all files which are
+neither directories nor symbolic links to be ignored if they are about
+to be processed a second time. If a directory or a symbolic link
+are about to be processed a second time, File::Find dies.
+C<follow_skip==0> causes File::Find to die if any file is about to be
+processed a second time.
+C<follow_skip==2> causes File::Find to ignore any duplicate files and
+dirctories but to proceed normally otherwise.
-The wanted() function does whatever verifications you want.
-$File::Find::dir contains the current directory name, and $_ the
-current filename within that directory. $File::Find::name contains
-C<"$File::Find::dir/$_">. You are chdir()'d to $File::Find::dir when
-the function is called. The function may set $File::Find::prune to
-prune the tree.
-File::Find assumes that you don't alter the $_ variable. If you do then
-make sure you return it to its original value before exiting your function.
+=item C<no_chdir>
+
+Does not C<chdir()> to each directory as it recurses. The wanted()
+function will need to be aware of this, of course. In this case,
+C<$_> will be the same as C<$File::Find::name>.
+
+=item C<untaint>
+
+If find is used in taint-mode (-T command line switch or if EUID != UID
+or if EGID != GID) then internally directory names have to be untainted
+before they can be cd'ed to. Therefore they are checked against a regular
+expression I<untaint_pattern>. Note, that all names passed to the
+user's I<wanted()> function are still tainted.
+
+=item C<untaint_pattern>
+
+See above. This should be set using the C<qr> quoting operator.
+The default is set to C<qr|^([-+@\w./]+)$|>.
+Note that the paranthesis which are vital.
+
+=item C<untaint_skip>
+
+If set, directories (subtrees) which fail the I<untaint_pattern>
+are skipped. The default is to 'die' in such a case.
+
+=back
+
+The wanted() function does whatever verifications you want.
+C<$File::Find::dir> contains the current directory name, and C<$_> the
+current filename within that directory. C<$File::Find::name> contains
+the complete pathname to the file. You are chdir()'d to C<$File::Find::dir> when
+the function is called, unless C<no_chdir> was specified.
+When <follow> or <follow_fast> are in effect there is also a
+C<$File::Find::fullname>.
+The function may set C<$File::Find::prune> to prune the tree
+unless C<bydepth> was specified.
+Unless C<follow> or C<follow_fast> is specified, for compatibility
+reasons (find.pl, find2perl) there are in addition the following globals
+available: C<$File::Find::topdir>, C<$File::Find::topdev>, C<$File::Find::topino>,
+C<$File::Find::topmode> and C<$File::Find::topnlink>.
This library is useful for the C<find2perl> tool, which when fed,
find2perl / -name .nfs\* -mtime +7 \
- -exec rm -f {} \; -o -fstype nfs -prune
+ -exec rm -f {} \; -o -fstype nfs -prune
produces something like:
sub wanted {
/^\.nfs.*$/ &&
- (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
+ (($dev, $ino, $mode, $nlink, $uid, $gid) = lstat($_)) &&
int(-M _) > 7 &&
unlink($_)
||
- ($nlink || (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_))) &&
+ ($nlink || (($dev, $ino, $mode, $nlink, $uid, $gid) = lstat($_))) &&
$dev < 0 &&
($File::Find::prune = 1);
}
-Set the variable $File::Find::dont_use_nlink if you're using AFS,
+Set the variable C<$File::Find::dont_use_nlink> if you're using AFS,
since AFS cheats.
-C<finddepth> is just like C<find>, except that it does a depth-first
-search.
Here's another interesting wanted function. It will find all symlinks
that don't resolve:
sub wanted {
- -l && !-e && print "bogus link: $File::Find::name\n";
+ -l && !-e && print "bogus link: $File::Find::name\n";
}
-=head1 BUGS
+See also the script C<pfind> on CPAN for a nice application of this
+module.
+
+=head1 CAVEAT
+
+Be aware that the option to follow symblic links can be dangerous.
+Depending on the structure of the directory tree (including symbolic
+links to directories) you might traverse a given (physical) directory
+more than once (only if C<follow_fast> is in effect).
+Furthermore, deleting or changing files in a symbolically linked directory
+might cause very unpleasant surprises, since you delete or change files
+in an unknown directory.
-There is no way to make find or finddepth follow symlinks.
=cut
@EXPORT = qw(find finddepth);
-sub find_opt {
- my $wanted = shift;
- my $bydepth = $wanted->{bydepth};
- my $cwd = $bydepth ? Cwd::fastcwd() : Cwd::cwd();
- # Localize these rather than lexicalizing them for backwards
- # compatibility.
- local($topdir,$topdev,$topino,$topmode,$topnlink);
- foreach $topdir (@_) {
- (($topdev,$topino,$topmode,$topnlink) =
- ($Is_VMS ? stat($topdir) : lstat($topdir)))
- || (warn("Can't stat $topdir: $!\n"), next);
- if (-d _) {
- if (chdir($topdir)) {
- $prune = 0;
- unless ($bydepth) {
- ($dir,$_) = ($topdir,'.');
- $name = $topdir;
- $wanted->{wanted}->();
- }
- next if $prune;
- my $fixtopdir = $topdir;
- $fixtopdir =~ s,/$,, ;
- $fixtopdir =~ s/\.dir$// if $Is_VMS;
- &finddir($wanted,$fixtopdir,$topnlink, $bydepth);
- if ($bydepth) {
- ($dir,$_) = ($fixtopdir,'.');
- $name = $fixtopdir;
- $wanted->{wanted}->();
- }
+use strict;
+my $Is_VMS;
+
+require File::Basename;
+
+my %SLnkSeen;
+my ($wanted_callback, $avoid_nlink, $bydepth, $no_chdir, $follow,
+ $follow_skip, $full_check, $untaint, $untaint_skip, $untaint_pat);
+
+sub contract_name {
+ my ($cdir,$fn) = @_;
+
+ return substr($cdir,0,rindex($cdir,'/')) if $fn eq '.';
+
+ $cdir = substr($cdir,0,rindex($cdir,'/')+1);
+
+ $fn =~ s|^\./||;
+
+ my $abs_name= $cdir . $fn;
+
+ if (substr($fn,0,3) eq '../') {
+ do 1 while ($abs_name=~ s|/(?>[^/]+)/\.\./|/|);
+ }
+
+ return $abs_name;
+}
+
+
+sub PathCombine($$) {
+ my ($Base,$Name) = @_;
+ my $AbsName;
+
+ if (substr($Name,0,1) eq '/') {
+ $AbsName= $Name;
+ }
+ else {
+ $AbsName= contract_name($Base,$Name);
+ }
+
+ # (simple) check for recursion
+ my $newlen= length($AbsName);
+ if ($newlen <= length($Base)) {
+ if (($newlen == length($Base) || substr($Base,$newlen,1) eq '/')
+ && $AbsName eq substr($Base,0,$newlen))
+ {
+ return undef;
+ }
+ }
+ return $AbsName;
+}
+
+sub Follow_SymLink($) {
+ my ($AbsName) = @_;
+
+ my ($NewName,$DEV, $INO);
+ ($DEV, $INO)= lstat $AbsName;
+
+ while (-l _) {
+ if ($SLnkSeen{$DEV, $INO}++) {
+ if ($follow_skip < 2) {
+ die "$AbsName is encountered a second time";
}
else {
- warn "Can't cd to $topdir: $!\n";
+ return undef;
}
}
- else {
- require File::Basename;
- unless (($_,$dir) = File::Basename::fileparse($topdir)) {
- ($dir,$_) = ('.', $topdir);
+ $NewName= PathCombine($AbsName, readlink($AbsName));
+ unless(defined $NewName) {
+ if ($follow_skip < 2) {
+ die "$AbsName is a recursive symbolic link";
+ }
+ else {
+ return undef;
}
- if (chdir($dir)) {
- $name = $topdir;
- $wanted->{wanted}->();
+ }
+ else {
+ $AbsName= $NewName;
+ }
+ ($DEV, $INO) = lstat($AbsName);
+ return undef unless defined $DEV; # dangling symbolic link
+ }
+
+ if ($full_check && $SLnkSeen{$DEV, $INO}++) {
+ if ($follow_skip < 1) {
+ die "$AbsName encountered a second time";
+ }
+ else {
+ return undef;
+ }
+ }
+
+ return $AbsName;
+}
+
+use vars qw/ $dir $name $fullname $prune /;
+sub _find_dir_symlnk($$$);
+sub _find_dir($$$);
+
+sub _find_opt {
+ my $wanted = shift;
+ die "invalid top directory" unless defined $_[0];
+
+ my $cwd = $wanted->{bydepth} ? Cwd::fastcwd() : Cwd::cwd();
+ my $cwd_untainted = $cwd;
+ $wanted_callback = $wanted->{wanted};
+ $bydepth = $wanted->{bydepth};
+ $no_chdir = $wanted->{no_chdir};
+ $full_check = $wanted->{follow};
+ $follow = $full_check || $wanted->{follow_fast};
+ $follow_skip = $wanted->{follow_skip};
+ $untaint = $wanted->{untaint};
+ $untaint_pat = $wanted->{untaint_pattern};
+ $untaint_skip = $wanted->{untaint_skip};
+
+ # for compatability reasons (find.pl, find2perl)
+ our ($topdir, $topdev, $topino, $topmode, $topnlink);
+
+ # a symbolic link to a directory doesn't increase the link count
+ $avoid_nlink = $follow || $File::Find::dont_use_nlink;
+
+ if ( $untaint ) {
+ $cwd_untainted= $1 if $cwd_untainted =~ m|$untaint_pat|;
+ die "insecure cwd in find(depth)" unless defined($cwd_untainted);
+ }
+
+ my ($abs_dir, $Is_Dir);
+
+ Proc_Top_Item:
+ foreach my $TOP (@_) {
+ my $top_item = $TOP;
+ $top_item =~ s|/$|| unless $top_item eq '/';
+ $Is_Dir= 0;
+
+ if ($follow) {
+ if (substr($top_item,0,1) eq '/') {
+ $abs_dir = $top_item;
+ }
+ elsif ($top_item eq '.') {
+ $abs_dir = $cwd;
}
+ else { # care about any ../
+ $abs_dir = contract_name("$cwd/",$top_item);
+ }
+ $abs_dir= Follow_SymLink($abs_dir);
+ unless (defined $abs_dir) {
+ warn "$top_item is a dangling symbolic link\n";
+ next Proc_Top_Item;
+ }
+ if (-d _) {
+ _find_dir_symlnk($wanted, $abs_dir, $top_item);
+ $Is_Dir= 1;
+ }
+ }
+ else { # no follow
+ $topdir = $top_item;
+ ($topdev,$topino,$topmode,$topnlink) = lstat $top_item;
+ unless (defined $topnlink) {
+ warn "Can't stat $top_item: $!\n";
+ next Proc_Top_Item;
+ }
+ if (-d _) {
+ $top_item =~ s/\.dir$// if $Is_VMS;
+ _find_dir($wanted, $top_item, $topnlink);
+ $Is_Dir= 1;
+ }
else {
- warn "Can't cd to $dir: $!\n";
+ $abs_dir= $top_item;
+ }
+ }
+
+ unless ($Is_Dir) {
+ unless (($_,$dir) = File::Basename::fileparse($abs_dir)) {
+ ($dir,$_) = ('.', $top_item);
+ }
+
+ $abs_dir = $dir;
+ if ($untaint) {
+ my $abs_dir_save = $abs_dir;
+ $abs_dir = $1 if $abs_dir =~ m|$untaint_pat|;
+ unless (defined $abs_dir) {
+ if ($untaint_skip == 0) {
+ die "directory $abs_dir_save is still tainted";
+ }
+ else {
+ next Proc_Top_Item;
+ }
+ }
+ }
+
+ unless ($no_chdir or chdir $abs_dir) {
+ warn "Couldn't chdir $abs_dir: $!\n";
+ next Proc_Top_Item;
+ }
+
+ $name = $abs_dir;
+
+ &$wanted_callback;
+
+ }
+
+ $no_chdir or chdir $cwd_untainted;
+ }
+}
+
+# API:
+# $wanted
+# $p_dir : "parent directory"
+# $nlink : what came back from the stat
+# preconditions:
+# chdir (if not no_chdir) to dir
+
+sub _find_dir($$$) {
+ my ($wanted, $p_dir, $nlink) = @_;
+ my ($CdLvl,$Level) = (0,0);
+ my @Stack;
+ my @filenames;
+ my ($subcount,$sub_nlink);
+ my $SE= [];
+ my $dir_name= $p_dir;
+ my $dir_pref= ( $p_dir eq '/' ? '/' : "$p_dir/" );
+ my $dir_rel= '.'; # directory name relative to current directory
+
+ local ($dir, $name, $prune, *DIR);
+
+ unless ($no_chdir or $p_dir eq '.') {
+ my $udir = $p_dir;
+ if ($untaint) {
+ $udir = $1 if $p_dir =~ m|$untaint_pat|;
+ unless (defined $udir) {
+ if ($untaint_skip == 0) {
+ die "directory $p_dir is still tainted";
+ }
+ else {
+ return;
+ }
}
}
+ unless (chdir $udir) {
+ warn "Can't cd to $udir: $!\n";
+ return;
+ }
+ }
+
+ while (defined $SE) {
+ unless ($bydepth) {
+ $dir= $p_dir;
+ $name= $dir_name;
+ $_= ($no_chdir ? $dir_name : $dir_rel );
+ # prune may happen here
+ $prune= 0;
+ &$wanted_callback;
+ next if $prune;
+ }
+
+ # change to that directory
+ unless ($no_chdir or $dir_rel eq '.') {
+ my $udir= $dir_rel;
+ if ($untaint) {
+ $udir = $1 if $dir_rel =~ m|$untaint_pat|;
+ unless (defined $udir) {
+ if ($untaint_skip == 0) {
+ die "directory ("
+ . ($p_dir ne '/' ? $p_dir : '')
+ . "/) $dir_rel is still tainted";
+ }
+ }
+ }
+ unless (chdir $udir) {
+ warn "Can't cd to ("
+ . ($p_dir ne '/' ? $p_dir : '')
+ . "/) $udir : $!\n";
+ next;
+ }
+ $CdLvl++;
+ }
+
+ $dir= $dir_name;
+
+ # Get the list of files in the current directory.
+ unless (opendir DIR, ($no_chdir ? $dir_name : '.')) {
+ warn "Can't opendir($dir_name): $!\n";
+ next;
+ }
+ @filenames = readdir DIR;
+ closedir(DIR);
+
+ if ($nlink == 2 && !$avoid_nlink) {
+ # This dir has no subdirectories.
+ for my $FN (@filenames) {
+ next if $FN =~ /^\.{1,2}$/;
+
+ $name = $dir_pref . $FN;
+ $_ = ($no_chdir ? $name : $FN);
+ &$wanted_callback;
+ }
+
+ }
+ else {
+ # This dir has subdirectories.
+ $subcount = $nlink - 2;
+
+ for my $FN (@filenames) {
+ next if $FN =~ /^\.{1,2}$/;
+ if ($subcount > 0 || $avoid_nlink) {
+ # Seen all the subdirs?
+ # check for directoriness.
+ # stat is faster for a file in the current directory
+ $sub_nlink = (lstat ($no_chdir ? $dir_pref . $FN : $FN))[3];
+
+ if (-d _) {
+ --$subcount;
+ $FN =~ s/\.dir$// if $Is_VMS;
+ push @Stack,[$CdLvl,$dir_name,$FN,$sub_nlink];
+ }
+ else {
+ $name = $dir_pref . $FN;
+ $_= ($no_chdir ? $name : $FN);
+ &$wanted_callback;
+ }
+ }
+ else {
+ $name = $dir_pref . $FN;
+ $_= ($no_chdir ? $name : $FN);
+ &$wanted_callback;
+ }
+ }
+ }
+ if ($bydepth) {
+ $name = $dir_name;
+ $dir = $p_dir;
+ $_ = ($no_chdir ? $dir_name : $dir_rel );
+ &$wanted_callback;
+ }
}
continue {
- chdir $cwd;
+ if ( defined ($SE = pop @Stack) ) {
+ ($Level, $p_dir, $dir_rel, $nlink) = @$SE;
+ if ($CdLvl > $Level && !$no_chdir) {
+ die "Can't cd to $dir_name" . '../' x ($CdLvl-$Level)
+ unless chdir '../' x ($CdLvl-$Level);
+ $CdLvl = $Level;
+ }
+ $dir_name = ($p_dir eq '/' ? "/$dir_rel" : "$p_dir/$dir_rel");
+ $dir_pref = "$dir_name/";
+ }
}
}
-sub finddir {
- my($wanted, $nlink, $bydepth);
- local($dir, $name);
- ($wanted, $dir, $nlink, $bydepth) = @_;
-
- my($dev, $ino, $mode, $subcount);
-
- # Get the list of files in the current directory.
- opendir(DIR,'.') || (warn("Can't open $dir: $!\n"), $bydepth || return);
- my(@filenames) = readdir(DIR);
- closedir(DIR);
-
- if ($nlink == 2 && !$dont_use_nlink) { # This dir has no subdirectories.
- for (@filenames) {
- next if $_ eq '.';
- next if $_ eq '..';
- $name = "$dir/$_";
- $nlink = 0;
- $wanted->{wanted}->();
- }
- }
- else { # This dir has subdirectories.
- $subcount = $nlink - 2;
- for (@filenames) {
- next if $_ eq '.';
- next if $_ eq '..';
- $nlink = 0;
- $prune = 0 unless $bydepth;
- $name = "$dir/$_";
- $wanted->{wanted}->() unless $bydepth;
- if ($subcount > 0 || $dont_use_nlink) { # Seen all the subdirs?
-
- # Get link count and check for directoriness.
-
- $_ = "" if (!defined($_));
- ($dev,$ino,$mode,$nlink) = ($Is_VMS ? stat($_) : lstat($_));
- # unless ($nlink || $dont_use_nlink);
-
- if (-d _) {
-
- # It really is a directory, so do it recursively.
-
- --$subcount;
- next if $prune;
- if (chdir $_) {
- $name =~ s/\.dir$// if $Is_VMS;
- &finddir($wanted,$name,$nlink, $bydepth);
- chdir '..';
+
+# API:
+# $wanted
+# $dir_loc : absolute location of a dir
+# $p_dir : "parent directory"
+# preconditions:
+# chdir (if not no_chdir) to dir
+
+sub _find_dir_symlnk($$$) {
+ my ($wanted, $dir_loc, $p_dir) = @_;
+ my @Stack;
+ my @filenames;
+ my $new_loc;
+ my $SE = [];
+ my $dir_name = $p_dir;
+ my $dir_pref = ( $p_dir eq '/' ? '/' : "$p_dir/" );
+ my $loc_pref = ( $dir_loc eq '/' ? '/' : "$dir_loc/" );
+ my $dir_rel = '.'; # directory name relative to current directory
+
+ local ($dir, $name, $fullname, $prune, *DIR);
+
+ unless ($no_chdir or $p_dir eq '.') {
+ my $udir = $dir_loc;
+ if ($untaint) {
+ $udir = $1 if $dir_loc =~ m|$untaint_pat|;
+ unless (defined $udir) {
+ if ($untaint_skip == 0) {
+ die "directory $dir_loc is still tainted";
+ }
+ else {
+ return;
+ }
+ }
+ }
+ unless (chdir $udir) {
+ warn "Can't cd to $udir: $!\n";
+ return;
+ }
+ }
+
+ while (defined $SE) {
+
+ unless ($bydepth) {
+ $dir= $p_dir;
+ $name= $dir_name;
+ $_= ($no_chdir ? $dir_name : $dir_rel );
+ $fullname= $dir_loc;
+ # prune may happen here
+ $prune= 0;
+ &$wanted_callback;
+ next if $prune;
+ }
+
+ # change to that directory
+ unless ($no_chdir or $dir_rel eq '.') {
+ my $udir = $dir_loc;
+ if ($untaint) {
+ $udir = $1 if $dir_loc =~ m|$untaint_pat|;
+ unless (defined $udir ) {
+ if ($untaint_skip == 0) {
+ die "directory $dir_loc is still tainted";
}
else {
- warn "Can't cd to $_: $!\n";
+ next;
}
}
}
- $wanted->{wanted}->() if $bydepth;
+ unless (chdir $udir) {
+ warn "Can't cd to $udir: $!\n";
+ next;
+ }
+ }
+
+ $dir = $dir_name;
+
+ # Get the list of files in the current directory.
+ unless (opendir DIR, ($no_chdir ? $dir_loc : '.')) {
+ warn "Can't opendir($dir_loc): $!\n";
+ next;
+ }
+ @filenames = readdir DIR;
+ closedir(DIR);
+
+ for my $FN (@filenames) {
+ next if $FN =~ /^\.{1,2}$/;
+
+ # follow symbolic links / do an lstat
+ $new_loc = Follow_SymLink($loc_pref.$FN);
+
+ # ignore if invalid symlink
+ next unless defined $new_loc;
+
+ if (-d _) {
+ push @Stack,[$new_loc,$dir_name,$FN];
+ }
+ else {
+ $fullname = $new_loc;
+ $name = $dir_pref . $FN;
+ $_ = ($no_chdir ? $name : $FN);
+ &$wanted_callback;
+ }
+ }
+
+ if ($bydepth) {
+ $fullname = $dir_loc;
+ $name = $dir_name;
+ $_ = ($no_chdir ? $dir_name : $dir_rel);
+ &$wanted_callback;
+ }
+ }
+ continue {
+ if (defined($SE = pop @Stack)) {
+ ($dir_loc, $p_dir, $dir_rel) = @$SE;
+ $dir_name = ($p_dir eq '/' ? "/$dir_rel" : "$p_dir/$dir_rel");
+ $dir_pref = "$dir_name/";
+ $loc_pref = "$dir_loc/";
}
}
}
+
sub wrap_wanted {
- my $wanted = shift;
- ref($wanted) eq 'HASH' ? $wanted : { wanted => $wanted };
+ my $wanted = shift;
+ if ( ref($wanted) eq 'HASH' ) {
+ if ( $wanted->{follow} || $wanted->{follow_fast}) {
+ $wanted->{follow_skip} = 1 unless defined $wanted->{follow_skip};
+ }
+ if ( $wanted->{untaint} ) {
+ $wanted->{untaint_pattern} = qr|^([-+@\w./]+)$|
+ unless defined $wanted->{untaint_pattern};
+ $wanted->{untaint_skip} = 0 unless defined $wanted->{untaint_skip};
+ }
+ return $wanted;
+ }
+ else {
+ return { wanted => $wanted };
+ }
}
sub find {
- my $wanted = shift;
- find_opt(wrap_wanted($wanted), @_);
+ my $wanted = shift;
+ _find_opt(wrap_wanted($wanted), @_);
+ %SLnkSeen= (); # free memory
}
sub finddepth {
- my $wanted = wrap_wanted(shift);
- $wanted->{bydepth} = 1;
- find_opt($wanted, @_);
+ my $wanted = wrap_wanted(shift);
+ $wanted->{bydepth} = 1;
+ _find_opt($wanted, @_);
+ %SLnkSeen= (); # free memory
}
# These are hard-coded for now, but may move to hint files.
if ($^O eq 'VMS') {
- $Is_VMS = 1;
- $dont_use_nlink = 1;
+ $Is_VMS = 1;
+ $File::Find::dont_use_nlink = 1;
}
-$dont_use_nlink = 1
+$File::Find::dont_use_nlink = 1
if $^O eq 'os2' || $^O eq 'dos' || $^O eq 'amigaos' || $^O eq 'MSWin32';
# Set dont_use_nlink in your hint file if your system's stat doesn't
# report the number of links in a directory as an indication
# of the number of files.
# See, e.g. hints/machten.sh for MachTen 2.2.
-unless ($dont_use_nlink) {
- require Config;
- $dont_use_nlink = 1 if ($Config::Config{'dont_use_nlink'});
+unless ($File::Find::dont_use_nlink) {
+ require Config;
+ $File::Find::dont_use_nlink = 1 if ($Config::Config{'dont_use_nlink'});
}
1;
-
=head1 NAME
-File::Path - create or remove a series of directories
+File::Path - create or remove directory trees
=head1 SYNOPSIS
-C<use File::Path>
+ use File::Path;
-C<mkpath(['/foo/bar/baz', 'blurfl/quux'], 1, 0711);>
-
-C<rmtree(['foo/bar/baz', 'blurfl/quux'], 1, 1);>
+ mkpath(['/foo/bar/baz', 'blurfl/quux'], 1, 0711);
+ rmtree(['foo/bar/baz', 'blurfl/quux'], 1, 1);
=head1 DESCRIPTION
my $parent = File::Basename::dirname($path);
# Allow for creation of new logical filesystems under VMS
if (not $Is_VMS or $parent !~ m:/[^/]+/000000/?:) {
- push(@created,mkpath($parent, $verbose, $mode)) unless (-d $parent);
+ unless (-d $parent or $path eq $parent) {
+ push(@created,mkpath($parent, $verbose, $mode));
+ }
}
print "mkdir $path\n" if $verbose;
unless (mkdir($path,$mode)) {
- my $e = $!;
- # allow for another process to have created it meanwhile
- croak "mkdir $path: $e" unless -d $path;
+ my $e = $!;
+ # allow for another process to have created it meanwhile
+ croak "mkdir $path: $e" unless -d $path;
}
push(@created, $path);
}
<F<A.Koenig@franz.ww.TU-Berlin.DE>>, Tim Bunce <F<Tim.Bunce@ig.co.uk>>. VMS
support by Charles Bailey <F<bailey@newman.upenn.edu>>. OS/2 support by
Ilya Zakharevich <F<ilya@math.ohio-state.edu>>. Mac support by Paul Schinder
-<F<schinder@pobox.com>>.
+<F<schinder@pobox.com>>. abs2rel() and rel2abs() written by
+Shigio Yamaguchi <F<shigio@tamacom.com>>, modified by Barrie Slaymaker
+<F<barries@slaysys.com>>. splitpath(), splitdir(), catpath() and catdir()
+by Barrie Slaymaker.
sub canonpath {
my ($self,$path,$reduce_ricochet) = @_;
- $path =~ s|/+|/|g unless($^O =~ /cygwin/); # xx////xx -> xx/xx
+ $path =~ s|/+|/|g unless($^O eq 'cygwin'); # xx////xx -> xx/xx
$path =~ s|(/\.)+/|/|g; # xx/././xx -> xx/xx
$path =~ s|^(\./)+|| unless $path eq "./"; # ./xx -> xx
$path =~ s|^/(\.\./)+|/|; # /../../xx -> xx
%EXPORT_TAGS = (ALL => [qw($Bin $Script $RealBin $RealScript $Dir $RealDir)]);
@ISA = qw(Exporter);
-$VERSION = $VERSION = "1.42";
+$VERSION = "1.42";
BEGIN
{
@ISA = qw(Exporter);
@EXPORT = qw(getopt getopts);
-$VERSION = $VERSION = '1.01';
+$VERSION = '1.01';
# Process single-character switches with switch clustering. Pass one argument
# which is a string containing all switches that take an argument. For each
if ($x eq "NaN" || $y eq "NaN") {
undef;
} else {
+ local($xm,$xe,$ym,$ye) = split('E', $x."E$y");
+ if ($xm eq '+0' || $ym eq '+0') {
+ return $xm <=> $ym;
+ }
ord($y) <=> ord($x)
- ||
- ( local($xm,$xe,$ym,$ye) = split('E', $x."E$y"),
- (($xe <=> $ye) * (substr($x,$[,1).'1')
- || Math::BigInt::cmp($xm,$ym))
- );
+ || ($xe <=> $ye) * (substr($x,$[,1).'1')
+ || Math::BigInt::cmp($xm,$ym);
}
}
=head1 AUTHORS
-Raphael Manfredi <F<Raphael_Manfredi@grenoble.hp.com>> and
+Raphael Manfredi <F<Raphael_Manfredi@pobox.com>> and
Jarkko Hietaniemi <F<jhi@iki.fi>>.
Extensive patches by Daniel S. Lewart <F<d-lewart@uiuc.edu>>.
=head1 AUTHORS
Jarkko Hietaniemi <F<jhi@iki.fi>> and
-Raphael Manfredi <F<Raphael_Manfredi@grenoble.hp.com>>.
+Raphael Manfredi <F<Raphael_Manfredi@pobox.com>>.
=cut
#
# Authors of the original pingecho():
# karrer@bernina.ethz.ch (Andreas Karrer)
-# pmarquess@bfsec.bt.co.uk (Paul Marquess)
+# Paul.Marquess@btinternet.com (Paul Marquess)
#
# Copyright (c) 1996 Russell Mosemann. All rights reserved. This
# program is free software; you may redistribute it and/or modify it
#############################################################################
# Pod/Checker.pm -- check pod documents for syntax errors
#
-# Based on Tom Christiansen's Pod::Text::pod2text() function
-# (with modifications).
-#
-# Copyright (C) 1994-1999 Tom Christiansen. All rights reserved.
+# Copyright (C) 1994-1999 by Bradford Appleton. All rights reserved.
# This file is part of "PodParser". PodParser is free software;
# you can redistribute it and/or modify it under the same terms
# as Perl itself.
package Pod::Checker;
use vars qw($VERSION);
-$VERSION = 1.081; ## Current version of this package
+$VERSION = 1.090; ## Current version of this package
require 5.004; ## requires this Perl version or later
=head1 NAME
use Pod::Checker;
- $syntax_okay = podchecker($filepath, $outputpath);
+ $syntax_okay = podchecker($filepath, $outputpath, %options);
=head1 OPTIONS/ARGUMENTS
If unspecified, the input-file it defaults to C<\*STDIN>, and
the output-file defaults to C<\*STDERR>.
+=head2 Options
+
+=over 4
+
+=item B<-warnings> =E<gt> I<val>
+
+Turn warnings on/off. See L<"Warnings">.
+
+=back
=head1 DESCRIPTION
It is hoped that curious/ambitious user will help flesh out and add the
additional features they wish to see in B<Pod::Checker> and B<podchecker>.
+The following additional checks are preformed:
+
+=over 4
+
+=item *
+
+Check for proper balancing of C<=begin> and C<=end>.
+
+=item *
+
+Check for proper nesting and balancing of C<=over>, C<=item> and C<=back>.
+
+=item *
+
+Check for same nested interior-sequences (e.g. C<LE<lt>...LE<lt>...E<gt>...E<gt>>).
+
+=item *
+
+Check for malformed entities.
+
+=item *
+
+Check for correct syntax of hyperlinks C<LE<lt>E<gt>>. See L<perlpod> for
+details.
+
+=item *
+
+Check for unresolved document-internal links.
+
+=back
+
+=head2 Warnings
+
+The following warnings are printed. These may not necessarily cause trouble,
+but indicate mediocre style.
+
+=over 4
+
+=item *
+
+Spurious characters after C<=back> and C<=end>.
+
+=item *
+
+Unescaped C<E<lt>> and C<E<gt>> in the text.
+
+=item *
+
+Missing arguments for C<=begin> and C<=over>.
+
+=item *
+
+Empty C<=over> / C<=back> list.
+
+=item *
+
+Hyperlinks: leading/trailing whitespace, brackets C<()> in the page name.
+
+=back
+
+=head1 DIAGNOSTICS
+
+I<[T.B.D.]>
+
+=head1 RETURN VALUE
+
+B<podchecker> returns the number of POD syntax errors found or -1 if
+there were no POD commands at all found in the file.
+
=head1 EXAMPLES
I<[T.B.D.]>
=head1 AUTHOR
-Brad Appleton E<lt>bradapp@enteract.comE<gt> (initial version)
+Brad Appleton E<lt>bradapp@enteract.comE<gt> (initial version),
+Marek Rouchal E<lt>marek@saftsack.fs.uni-bayreuth.deE<gt>
Based on code for B<Pod::Text::pod2text()> written by
Tom Christiansen E<lt>tchrist@mox.perl.comE<gt>
## Function definitions begin here
##---------------------------------
-sub podchecker( $ ; $ ) {
- my ($infile, $outfile) = @_;
+sub podchecker( $ ; $ % ) {
+ my ($infile, $outfile, %options) = @_;
local $_;
## Set defaults
$outfile ||= \*STDERR;
## Now create a pod checker
- my $checker = new Pod::Checker();
+ my $checker = new Pod::Checker(%options);
## Now check the pod document for errors
$checker->parse_from_file($infile, $outfile);
sub initialize {
my $self = shift;
- $self->num_errors(0);
+ ## Initialize number of errors, and setup an error function to
+ ## increment this number and then print to the designated output.
+ $self->{_NUM_ERRORS} = 0;
+ $self->errorsub('poderror');
+ $self->{_commands} = 0; # total number of POD commands encountered
+ $self->{_list_stack} = []; # stack for nested lists
+ $self->{_have_begin} = ''; # stores =begin
+ $self->{_links} = []; # stack for internal hyperlinks
+ $self->{_nodes} = []; # stack for =head/=item nodes
+ $self->{-warnings} = 1 unless(defined $self->{-warnings});
+}
+
+## Invoked as $self->poderror( @args ), or $self->poderror( {%opts}, @args )
+sub poderror {
+ my $self = shift;
+ my %opts = (ref $_[0]) ? %{shift()} : ();
+
+ ## Retrieve options
+ chomp( my $msg = ($opts{-msg} || "")."@_" );
+ my $line = (exists $opts{-line}) ? " at line $opts{-line}" : "";
+ my $file = (exists $opts{-file}) ? " in file $opts{-file}" : "";
+ my $severity = (exists $opts{-severity}) ? "*** $opts{-severity}: " : "";
+
+ ## Increment error count and print message "
+ ++($self->{_NUM_ERRORS})
+ if(!%opts || ($opts{-severity} && $opts{-severity} eq 'ERROR'));
+ my $out_fh = $self->output_handle();
+ print $out_fh ($severity, $msg, $line, $file, "\n");
}
sub num_errors {
return (@_ > 1) ? ($_[0]->{_NUM_ERRORS} = $_[1]) : $_[0]->{_NUM_ERRORS};
}
+## overrides for Pod::Parser
+
sub end_pod {
- ## Print the number of errors found
+ ## Do some final checks and
+ ## print the number of errors found
my $self = shift;
my $infile = $self->input_file();
my $out_fh = $self->output_handle();
+ if(@{$self->{_list_stack}}) {
+ # _TODO_ display, but don't count them for now
+ my $list;
+ while($list = shift(@{$self->{_list_stack}})) {
+ $self->poderror({ -line => 'EOF', -file => $infile,
+ -severity => 'ERROR', -msg => "=over on line " .
+ $list->start() . " without closing =back" }); #"
+ }
+ }
+
+ # check validity of document internal hyperlinks
+ # first build the node names from the paragraph text
+ my %nodes;
+ foreach($self->node()) {
+ #print "Have node: +$_+\n";
+ $nodes{$_} = 1;
+ if(/^(\S+)\s+/) {
+ # we have more than one word. Use the first as a node, too.
+ # This is used heavily in perlfunc.pod
+ $nodes{$1} ||= 2; # derived node
+ }
+ }
+ foreach($self->hyperlink()) {
+ #print "Seek node: +$_+\n";
+ my $line = '';
+ s/^(\d+):// && ($line = $1);
+ if($_ && !$nodes{$_}) {
+ $self->poderror({ -line => $line, -file => $infile,
+ -severity => 'ERROR',
+ -msg => "unresolved internal link `$_'"});
+ }
+ }
+
+ ## Print the number of errors found
my $num_errors = $self->num_errors();
if ($num_errors > 0) {
printf $out_fh ("$infile has $num_errors pod syntax %s.\n",
($num_errors == 1) ? "error" : "errors");
}
+ elsif($self->{_commands} == 0) {
+ print $out_fh "$infile does not contain any pod commands.\n";
+ $self->num_errors(-1);
+ }
else {
print $out_fh "$infile pod syntax OK.\n";
}
}
sub command {
- my ($self, $command, $paragraph, $line_num, $pod_para) = @_;
+ my ($self, $cmd, $paragraph, $line_num, $pod_para) = @_;
my ($file, $line) = $pod_para->file_line;
- my $out_fh = $self->output_handle();
## Check the command syntax
- if (! $VALID_COMMANDS{$command}) {
- ++($self->{_NUM_ERRORS});
- _invalid_cmd($out_fh, $command, $paragraph, $file, $line);
+ my $arg; # this will hold the command argument
+ if (! $VALID_COMMANDS{$cmd}) {
+ $self->poderror({ -line => $line, -file => $file, -severity => 'ERROR',
+ -msg => "Unknown command \"$cmd\"" });
}
else {
- ## check syntax of particular command
+ $self->{_commands}++; # found a valid command
+ ## check syntax of particular command
+ if($cmd eq 'over') {
+ # start a new list
+ unshift(@{$self->{_list_stack}},
+ Pod::List->new(
+ -indent => $paragraph,
+ -start => $line,
+ -file => $file));
+ }
+ elsif($cmd eq 'item') {
+ unless(@{$self->{_list_stack}}) {
+ $self->poderror({ -line => $line, -file => $file,
+ -severity => 'ERROR',
+ -msg => "=item without previous =over" });
+ }
+ else {
+ # check for argument
+ $arg = $self->_interpolate_and_check($paragraph, $line, $file);
+ unless($arg && $arg =~ /(\S+)/) {
+ $self->poderror({ -line => $line, -file => $file,
+ -severity => 'WARNING',
+ -msg => "No argument for =item" });
+ }
+ # add this item
+ $self->{_list_stack}[0]->item($arg || '');
+ # remember this node
+ $self->node($arg) if($arg);
+ }
+ }
+ elsif($cmd eq 'back') {
+ # check if we have an open list
+ unless(@{$self->{_list_stack}}) {
+ $self->poderror({ -line => $line, -file => $file,
+ -severity => 'ERROR',
+ -msg => "=back without previous =over" });
+ }
+ else {
+ # check for spurious characters
+ $arg = $self->_interpolate_and_check($paragraph, $line,$file);
+ if($arg && $arg =~ /\S/) {
+ $self->poderror({ -line => $line, -file => $file,
+ -severity => 'WARNING',
+ -msg => "Spurious character(s) after =back" });
+ }
+ # close list
+ my $list = shift @{$self->{_list_stack}};
+ # check for empty lists
+ if(!$list->item() && $self->{-warnings}) {
+ $self->poderror({ -line => $line, -file => $file,
+ -severity => 'WARNING',
+ -msg => "No items in =over (at line " .
+ $list->start() . ") / =back list"}); #"
+ }
+ }
+ }
+ elsif($cmd =~ /^head/) {
+ # check if there is an open list
+ if(@{$self->{_list_stack}}) {
+ my $list;
+ while($list = shift(@{$self->{_list_stack}})) {
+ $self->poderror({ -line => $line, -file => $file,
+ -severity => 'ERROR',
+ -msg => "unclosed =over (line ". $list->start() .
+ ") at $cmd" });
+ }
+ }
+ # remember this node
+ $arg = $self->_interpolate_and_check($paragraph, $line,$file);
+ $self->node($arg) if($arg);
+ }
+ elsif($cmd eq 'begin') {
+ if($self->{_have_begin}) {
+ # already have a begin
+ $self->poderror({ -line => $line, -file => $file,
+ -severity => 'ERROR',
+ -msg => "Nested =begin's (first at line " .
+ $self->{_have_begin} . ")"});
+ }
+ else {
+ # check for argument
+ $arg = $self->_interpolate_and_check($paragraph, $line,$file);
+ unless($arg && $arg =~ /(\S+)/) {
+ $self->poderror({ -line => $line, -file => $file,
+ -severity => 'WARNING',
+ -msg => "No argument for =begin"});
+ }
+ # remember the =begin
+ $self->{_have_begin} = "$line:$1";
+ }
+ }
+ elsif($cmd eq 'end') {
+ if($self->{_have_begin}) {
+ # close the existing =begin
+ $self->{_have_begin} = '';
+ # check for spurious characters
+ $arg = $self->_interpolate_and_check($paragraph, $line,$file);
+ if($arg && $arg =~ /\S/) {
+ $self->poderror({ -line => $line, -file => $file,
+ -severity => 'WARNING',
+ -msg => "Spurious character(s) after =end" });
+ }
+ }
+ else {
+ # don't have a matching =begin
+ $self->poderror({ -line => $line, -file => $file,
+ -severity => 'WARNING',
+ -msg => "=end without =begin" });
+ }
+ }
}
## Check the interior sequences in the command-text
- my $expansion = $self->interpolate($paragraph, $line_num);
+ $self->_interpolate_and_check($paragraph, $line,$file)
+ unless(defined $arg);
+}
+
+sub _interpolate_and_check {
+ my ($self, $paragraph, $line, $file) = @_;
+ ## Check the interior sequences in the command-text
+ # and return the text
+ $self->_check_ptree(
+ $self->parse_text($paragraph,$line), $line, $file, '');
+}
+
+sub _check_ptree {
+ my ($self,$ptree,$line,$file,$nestlist) = @_;
+ local($_);
+ my $text = '';
+ # process each node in the parse tree
+ foreach(@$ptree) {
+ # regular text chunk
+ unless(ref) {
+ my $count;
+ # count the unescaped angle brackets
+ my $i = $_;
+ if($count = $i =~ s/[<>]/$self->expand_unescaped_bracket($&)/ge) {
+ $self->poderror({ -line => $line, -file => $file,
+ -severity => 'WARNING',
+ -msg => "$count unescaped <>" });
+ }
+ $text .= $i;
+ next;
+ }
+ # have an interior sequence
+ my $cmd = $_->cmd_name();
+ my $contents = $_->parse_tree();
+ ($file,$line) = $_->file_line();
+ # check for valid tag
+ if (! $VALID_SEQUENCES{$cmd}) {
+ $self->poderror({ -line => $line, -file => $file,
+ -severity => 'ERROR',
+ -msg => qq(Unknown interior-sequence "$cmd")});
+ # expand it anyway
+ $text .= $self->_check_ptree($contents, $line, $file, "$nestlist$cmd");
+ next;
+ }
+ if($nestlist =~ /$cmd/) {
+ $self->poderror({ -line => $line, -file => $file,
+ -severity => 'ERROR',
+ -msg => "nested commands $cmd<...$cmd<...>...>"});
+ # _TODO_ should we add the contents anyway?
+ # expand it anyway, see below
+ }
+ if($cmd eq 'E') {
+ # preserve entities
+ if(@$contents > 1 || ref $$contents[0] || $$contents[0] !~ /^\w+$/) {
+ $self->poderror({ -line => $line, -file => $file,
+ -severity => 'ERROR',
+ -msg => "garbled entity " . $_->raw_text()});
+ next;
+ }
+ $text .= $self->expand_entity($$contents[0]);
+ }
+ elsif($cmd eq 'L') {
+ # try to parse the hyperlink
+ my $link = Pod::Hyperlink->new($contents->raw_text());
+ unless(defined $link) {
+ $self->poderror({ -line => $line, -file => $file,
+ -severity => 'ERROR',
+ -msg => "malformed link L<>: $@"});
+ next;
+ }
+ $link->line($line); # remember line
+ if($self->{-warnings}) {
+ foreach my $w ($link->warning()) {
+ $self->poderror({ -line => $line, -file => $file,
+ -severity => 'WARNING',
+ -msg => $w });
+ }
+ }
+ # check the link text
+ $text .= $self->_check_ptree($self->parse_text($link->text(),
+ $line), $line, $file, "$nestlist$cmd");
+ my $node = '';
+ $node = $self->_check_ptree($self->parse_text($link->node(),
+ $line), $line, $file, "$nestlist$cmd")
+ if($link->node());
+ # store internal link
+ # _TODO_ what if there is a link to the page itself by the name,
+ # e.g. Tk::Pod : L<Tk::Pod/"DESCRIPTION">
+ $self->hyperlink("$line:$node") if($node && !$link->page());
+ }
+ elsif($cmd =~ /[BCFIS]/) {
+ # add the guts
+ $text .= $self->_check_ptree($contents, $line, $file, "$nestlist$cmd");
+ }
+ else {
+ # check, but add nothing to $text (X<>, Z<>)
+ $self->_check_ptree($contents, $line, $file, "$nestlist$cmd");
+ }
+ }
+ $text;
+}
+
+# default method - just return it
+sub expand_unescaped_bracket {
+ my ($self,$bracket) = @_;
+ $bracket;
+}
+
+# keep the entities
+sub expand_entity {
+ my ($self,$entity) = @_;
+ "E<$entity>";
}
+# _TODO_ overloadable methods for BC..Z<...> expansion
+
sub verbatim {
## Nothing to check
## my ($self, $paragraph, $line_num, $pod_para) = @_;
sub textblock {
my ($self, $paragraph, $line_num, $pod_para) = @_;
- my $out_fh = $self->output_handle();
- ## Check the interior sequences in the text (set $SIG{__WARN__} to
- ## send parse_text warnings about untermnated sequences to $out_fh)
- local $SIG{__WARN__} = sub {
- ++($self->{_NUM_ERRORS});
- print $out_fh @_
- };
- my $expansion = $self->interpolate($paragraph, $line_num);
-}
-
-sub interior_sequence {
- my ($self, $seq_cmd, $seq_arg, $pod_seq) = @_;
- my ($file, $line) = $pod_seq->file_line;
- my $out_fh = $self->output_handle();
- ## Check the sequence syntax
- if (! $VALID_SEQUENCES{$seq_cmd}) {
- ++($self->{_NUM_ERRORS});
- _invalid_seq($out_fh, $seq_cmd, $seq_arg, $file, $line);
+ my ($file, $line) = $pod_para->file_line;
+ $self->_interpolate_and_check($paragraph, $line,$file);
+}
+
+# set/return nodes of the current POD
+sub node {
+ my ($self,$text) = @_;
+ if(defined $text) {
+ $text =~ s/[\s\n]+$//; # strip trailing whitespace
+ # add node
+ push(@{$self->{_nodes}}, $text);
+ return $text;
+ }
+ @{$self->{_nodes}};
+}
+
+# set/return hyperlinks of the current POD
+sub hyperlink {
+ my $self = shift;
+ if($_[0]) {
+ push(@{$self->{_links}}, $_[0]);
+ return $_[0];
+ }
+ @{$self->{_links}};
+}
+
+#-----------------------------------------------------------------------------
+# Pod::List
+#
+# class to hold POD list info (=over, =item, =back)
+#-----------------------------------------------------------------------------
+
+package Pod::List;
+
+use Carp;
+
+sub new {
+ my $this = shift;
+ my $class = ref($this) || $this;
+ my %params = @_;
+ my $self = {%params};
+ bless $self, $class;
+ $self->initialize();
+ return $self;
+}
+
+sub initialize {
+ my $self = shift;
+ $self->{-file} ||= 'unknown';
+ $self->{-start} ||= 'unknown';
+ $self->{-indent} ||= 4; # perlpod: "should be the default"
+ $self->{_items} = [];
+}
+
+# The POD file name the list appears in
+sub file {
+ return (@_ > 1) ? ($_[0]->{-file} = $_[1]) : $_[0]->{-file};
+}
+
+# The line in the file the node appears
+sub start {
+ return (@_ > 1) ? ($_[0]->{-start} = $_[1]) : $_[0]->{-start};
+}
+
+# indent level
+sub indent {
+ return (@_ > 1) ? ($_[0]->{-indent} = $_[1]) : $_[0]->{-indent};
+}
+
+# The individual =items of this list
+sub item {
+ my ($self,$item) = @_;
+ if(defined $item) {
+ push(@{$self->{_items}}, $item);
+ return $item;
}
else {
- ## check syntax of the particular sequence
+ return @{$self->{_items}};
}
}
-sub _invalid_cmd {
- my ($fh, $cmd, $text, $file, $line) = @_;
- print $fh "*** ERROR: Unknown command \"$cmd\""
- . " at line $line of file $file\n";
+#-----------------------------------------------------------------------------
+# Pod::Hyperlink
+#
+# class to hold hyperlinks (L<>)
+#-----------------------------------------------------------------------------
+
+package Pod::Hyperlink;
+
+=head1 NAME
+
+Pod::Hyperlink - class for manipulation of POD hyperlinks
+
+=head1 SYNOPSIS
+
+ my $link = Pod::Hyperlink->new('alternative text|page/"section in page"');
+
+=head1 DESCRIPTION
+
+The B<Pod::Hyperlink> class is mainly designed to parse the contents of the
+C<LE<lt>...E<gt>> sequence, providing a simple interface for accessing the
+different parts of a POD hyperlink.
+
+=head1 METHODS
+
+=over 4
+
+=item new()
+
+The B<new()> method can either be passed a set of key/value pairs or a single
+scalar value, namely the contents of a C<LE<lt>...E<gt>> sequence. An object
+of the class C<Pod::Hyperlink> is returned. The value C<undef> indicates a
+failure, the error message is stored in C<$@>.
+
+=item parse()
+
+This method can be used to (re)parse a (new) hyperlink. The result is stored
+in the current object.
+
+=item markup($on,$off,$pageon,$pageoff)
+
+The result of this method is a string the represents the textual value of the
+link, but with included arbitrary markers that highlight the active portion
+of the link. This will mainly be used by POD translators and saves the
+effort of determining which words have to be highlighted. Examples: Depending
+on the type of link, the following text will be returned, the C<*> represent
+the places where the section/item specific on/off markers will be placed
+(link to a specific node) and C<+> for the pageon/pageoff markers (link to the
+top of the page).
+
+ the +perl+ manpage
+ the *$|* entry in the +perlvar+ manpage
+ the section on *OPTIONS* in the +perldoc+ manpage
+ the section on *DESCRIPTION* elsewhere in this document
+
+This method is read-only.
+
+=item text()
+
+This method returns the textual representation of the hyperlink as above,
+but without markers (read only).
+
+=item warning()
+
+After parsing, this method returns any warnings ecountered during the
+parsing process.
+
+=item page()
+
+This method sets or returns the POD page this link points to.
+
+=item node()
+
+As above, but the destination node text of the link.
+
+=item type()
+
+The node type, either C<section> or C<item>.
+
+=item alttext()
+
+Sets or returns an alternative text specified in the link.
+
+=item line(), file()
+
+Just simple slots for storing information about the line and the file
+the link was incountered in. Has to be filled in manually.
+
+=back
+
+=head1 AUTHOR
+
+Marek Rouchal E<lt>marek@saftsack.fs.uni-bayreuth.deE<gt>, borrowing
+a lot of things from L<pod2man> and L<pod2roff>.
+
+=cut
+
+use Carp;
+
+sub new {
+ my $this = shift;
+ my $class = ref($this) || $this;
+ my $self = +{};
+ bless $self, $class;
+ $self->initialize();
+ if(defined $_[0]) {
+ if(ref($_[0])) {
+ # called with a list of parameters
+ %$self = %{$_[0]};
+ }
+ else {
+ # called with L<> contents
+ return undef unless($self->parse($_[0]));
+ }
+ }
+ return $self;
+}
+
+sub initialize {
+ my $self = shift;
+ $self->{-line} ||= 'undef';
+ $self->{-file} ||= 'undef';
+ $self->{-page} ||= '';
+ $self->{-node} ||= '';
+ $self->{-alttext} ||= '';
+ $self->{-type} ||= 'undef';
+ $self->{_warnings} = [];
+ $self->_construct_text();
+}
+
+sub parse {
+ my $self = shift;
+ local($_) = $_[0];
+ # syntax check the link and extract destination
+ my ($alttext,$page,$section,$item) = ('','','','');
+
+ # strip leading/trailing whitespace
+ if(s/^[\s\n]+//) {
+ $self->warning("ignoring leading whitespace in link");
+ }
+ if(s/[\s\n]+$//) {
+ $self->warning("ignoring trailing whitespace in link");
+ }
+
+ # collapse newlines with whitespace
+ s/\s*\n\s*/ /g;
+
+ # extract alternative text
+ if(s!^([^|/"\n]*)[|]!!) {
+ $alttext = $1;
+ }
+ # extract page
+ if(s!^([^|/"\s]*)(?=/|$)!!) {
+ $page = $1;
+ }
+ # extract section
+ if(s!^/?"([^"\n]+)"$!!) { # e.g. L</"blah blah">
+ $section = $1;
+ }
+ # extact item
+ if(s!^/(.*)$!!) {
+ $item = $1;
+ }
+ # last chance here
+ if(s!^([^|"\s\n/][^"\n/]*)$!!) { # e.g. L<lah di dah>
+ $section = $1;
+ }
+ # now there should be nothing left
+ if(length) {
+ _invalid_link("garbled entry (spurious characters `$_')");
+ return undef;
+ }
+ elsif(!(length($page) || length($section) || length($item))) {
+ _invalid_link("empty link");
+ return undef;
+ }
+ elsif($alttext =~ /[<>]/) {
+ _invalid_link("alternative text contains < or >");
+ return undef;
+ }
+ else { # no errors so far
+ if($page =~ /[(]\d\w*[)]$/) {
+ $self->warning("brackets in `$page'");
+ $page = $`; # strip that extension
+ }
+ if($page =~ /^(\s*)(\S+)(\s*)/ && (length($1) || length($3))) {
+ $self->warning("whitespace in `$page'");
+ $page = $2; # strip that extension
+ }
+ }
+ $self->page($page);
+ $self->node($section || $item); # _TODO_ do not distinguish for now
+ $self->alttext($alttext);
+ $self->type($item ? 'item' : 'section');
+ 1;
+}
+
+sub _construct_text {
+ my $self = shift;
+ my $alttext = $self->alttext();
+ my $type = $self->type();
+ my $section = $self->node();
+ my $page = $self->page();
+ $self->{_text} =
+ $alttext ? $alttext : (
+ !$section ? '' :
+ $type eq 'item' ? 'the ' . $section . ' entry' :
+ 'the section on ' . $section ) .
+ ($page ? ($section ? ' in ':''). 'the ' . $page . ' manpage' :
+ 'elsewhere in this document');
+ # for being marked up later
+ $self->{_markup} =
+ $alttext ? '<SECTON>' . $alttext . '<SECTOFF>' : (
+ !$section ? '' :
+ $type eq 'item' ? 'the <SECTON>' . $section . '<SECTOFF> entry' :
+ 'the section on <SECTON>' . $section . '<SECTOFF>' ) .
+ ($page ? ($section ? ' in ':'') . 'the <PAGEON>' .
+ $page . '<PAGEOFF> manpage' :
+ ' elsewhere in this document');
+}
+
+# include markup
+sub markup {
+ my ($self,$on,$off,$pageon,$pageoff) = @_;
+ $on ||= '';
+ $off ||= '';
+ $pageon ||= '';
+ $pageoff ||= '';
+ $_[0]->_construct_text;
+ my $str = $self->{_markup};
+ $str =~ s/<SECTON>/$on/;
+ $str =~ s/<SECTOFF>/$off/;
+ $str =~ s/<PAGEON>/$pageon/;
+ $str =~ s/<PAGEOFF>/$pageoff/;
+ return $str;
+}
+
+# The complete link's text
+sub text {
+ $_[0]->_construct_text();
+ $_[0]->{_text};
+}
+
+# The POD page the link appears on
+sub warning {
+ my $self = shift;
+ if(@_) {
+ push(@{$self->{_warnings}}, @_);
+ return @_;
+ }
+ return @{$self->{_warnings}};
+}
+
+# The POD file name the link appears in
+sub file {
+ return (@_ > 1) ? ($_[0]->{-file} = $_[1]) : $_[0]->{-file};
+}
+
+# The line in the file the link appears
+sub line {
+ return (@_ > 1) ? ($_[0]->{-line} = $_[1]) : $_[0]->{-line};
+}
+
+# The POD page the link appears on
+sub page {
+ return (@_ > 1) ? ($_[0]->{-page} = $_[1]) : $_[0]->{-page};
+}
+
+# The link destination
+sub node {
+ return (@_ > 1) ? ($_[0]->{-node} = $_[1]) : $_[0]->{-node};
+}
+
+# Potential alternative text
+sub alttext {
+ return (@_ > 1) ? ($_[0]->{-alttext} = $_[1]) : $_[0]->{-alttext};
+}
+
+# The type
+sub type {
+ return (@_ > 1) ? ($_[0]->{-type} = $_[1]) : $_[0]->{-type};
}
-sub _invalid_seq {
- my ($fh, $cmd, $text, $file, $line) = @_;
- print $fh "*** ERROR: Unknown interior-sequence \"$cmd\""
- . " at line $line of file $file\n";
+sub _invalid_link {
+ my ($msg) = @_;
+ # this sets @_
+ #eval { die "$msg\n" };
+ #chomp $@;
+ $@ = $msg; # this seems to work, too!
+ undef;
}
+1;
if (m,^(.*?)/"?(.*?)"?$,) { # yes
($page, $section) = ($1, $2);
} else { # no
- ($page, $section) = ($str, "");
+ ($page, $section) = ($_, "");
}
# check if we know that this is a section in this page
# Pod/InputObjects.pm -- package which defines objects for input streams
# and paragraphs and commands when parsing POD docs.
#
-# Copyright (C) 1996-1999 Tom Christiansen. All rights reserved.
+# Copyright (C) 1996-1999 by Bradford Appleton. All rights reserved.
# This file is part of "PodParser". PodParser is free software;
# you can redistribute it and/or modify it under the same terms
# as Perl itself.
package Pod::InputObjects;
use vars qw($VERSION);
-$VERSION = 1.081; ## Current version of this package
+$VERSION = 1.090; ## Current version of this package
require 5.004; ## requires this Perl version or later
#############################################################################
-file => $filename,
-line => $line_number);
+ my $pod_seq4 = new Pod::InteriorSequence(-name => $cmd, $ptree);
+ my $pod_seq5 = new Pod::InteriorSequence($cmd, $ptree);
+
This is a class method that constructs a C<Pod::InteriorSequence> object
and returns a reference to the new interior sequence object. It should
be given two keyword arguments. The C<-ldelim> keyword indicates the
The C<-name> keyword indicates the name of the corresponding interior
sequence command, such as C<I> or C<B> or C<C>. The C<-file> and
C<-line> keywords indicate the filename and line number corresponding
-to the beginning of the interior sequence.
+to the beginning of the interior sequence. If the C<$ptree> argument is
+given, it must be the last argument, and it must be either string, or
+else an array-ref suitable for passing to B<Pod::ParseTree::new> (or
+it may be a reference to an Pod::ParseTree object).
=cut
my $this = shift;
my $class = ref($this) || $this;
+ ## See if first argument has no keyword
+ if (((@_ <= 2) or (@_ % 2)) and $_[0] !~ /^-\w/) {
+ ## Yup - need an implicit '-name' before first parameter
+ unshift @_, '-name';
+ }
+
+ ## See if odd number of args
+ if ((@_ % 2) != 0) {
+ ## Yup - need an implicit '-ptree' before the last parameter
+ splice @_, $#_, 0, '-ptree';
+ }
+
## Any remaining arguments are treated as initial values for the
## hash that is used to represent this object. Note that we default
## certain values by specifying them *before* the arguments passed.
-line => 0,
-ldelim => '<',
-rdelim => '>',
- -ptree => new Pod::ParseTree(),
@_
};
+ ## Initialize contents if they havent been already
+ my $ptree = $self->{'-ptree'} || new Pod::ParseTree();
+ if ( ref $ptree =~ /^(ARRAY)?$/ ) {
+ ## We have an array-ref, or a normal scalar. Pass it as an
+ ## an argument to the ptree-constructor
+ $ptree = new Pod::ParseTree($1 ? [$ptree] : $ptree);
+ }
+ $self->{'-ptree'} = $ptree;
+
## Bless ourselves into the desired class and perform any initialization
bless $self, $class;
return $self;
my ($self, @children) = @_;
## Make sure any sequences know who their parent is
for (@children) {
- next unless ref;
+ next unless (ref || ref eq 'SCALAR');
if ($_->isa('Pod::InteriorSequence') or $_->can('nested')) {
$_->nested($self);
}
$self->{'-parent_sequence'} = undef;
my $ptree = $self->{'-ptree'};
for (@$ptree) {
- next unless (length and ref and $_->isa('Pod::InteriorSequence'));
- $_->_unset_child2parent_links();
+ next unless (length and ref and ref ne 'SCALAR');
+ $_->_unset_child2parent_links() if $_->isa('Pod::InteriorSequence');
}
}
This is a class method that constructs a C<Pod::Parse_tree> object and
returns a reference to the new parse-tree. If a single-argument is given,
-it mist be a reference to an array, and is used to initialize the root
+it must be a reference to an array, and is used to initialize the root
(top) of the parse tree.
=cut
my $self = shift;
local *ptree = $self;
for (@ptree) {
- next unless (length and ref and $_->isa('Pod::InteriorSequence'));
- $_->_unset_child2parent_links();
+ next unless (length and ref and ref ne 'SCALAR');
+ $_->_unset_child2parent_links() if $_->isa('Pod::InteriorSequence');
}
}
--- /dev/null
+# Pod::Man -- Convert POD data to formatted *roff input.
+# $Id: Man.pm,v 0.8 1999/10/07 09:39:37 eagle Exp $
+#
+# Copyright 1999 by Russ Allbery <rra@stanford.edu>
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the same terms as Perl itself.
+#
+# This module is intended to be a replacement for pod2man, and attempts to
+# match its output except for some specific circumstances where other
+# decisions seemed to produce better output. It uses Pod::Parser and is
+# designed to be very easy to subclass.
+
+############################################################################
+# Modules and declarations
+############################################################################
+
+package Pod::Man;
+
+require 5.004;
+
+use Carp qw(carp croak);
+use Pod::Parser ();
+
+use strict;
+use subs qw(makespace);
+use vars qw(@ISA %ESCAPES $PREAMBLE $VERSION);
+
+@ISA = qw(Pod::Parser);
+
+($VERSION = (split (' ', q$Revision: 0.8 $ ))[1]) =~ s/\.(\d)$/.0$1/;
+
+
+############################################################################
+# Preamble and *roff output tables
+############################################################################
+
+# The following is the static preamble which starts all *roff output we
+# generate. It's completely static except for the font to use as a
+# fixed-width font, which is designed by @CFONT@. $PREAMBLE should
+# therefore be run through s/\@CFONT\@/<font>/g before output.
+$PREAMBLE = <<'----END OF PREAMBLE----';
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Ip \" List item
+.br
+.ie \\n(.$>=3 .ne \\$3
+.el .ne 3
+.IP "\\$1" \\$2
+..
+.de Vb \" Begin verbatim text
+.ft @CFONT@
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. | will give a
+.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used
+.\" to do unbreakable dashes and therefore won't be available. \*(C` and
+.\" \*(C' expand to `' in nroff, nothing in troff, for use with C<>
+.tr \(*W-|\(bv\*(Tr
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` `
+. ds C' '
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr
+.\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and
+.\" index entries marked with X<> in POD. Of course, you'll have to process
+.\" the output yourself in some meaningful fashion.
+.if \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+. .
+. nr % 0
+. rr F
+.\}
+.\"
+.\" For nroff, turn off justification. Always turn off hyphenation; it
+.\" makes way too many mistakes in technical documents.
+.hy 0
+.if n .na
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+.bd B 3
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+----END OF PREAMBLE----
+
+# This table is taken nearly verbatim from Tom Christiansen's pod2man. It
+# assumes that the standard preamble has already been printed, since that's
+# what defines all of the accent marks. Note that some of these are quoted
+# with double quotes since they contain embedded single quotes, so use \\
+# uniformly for backslash for readability.
+%ESCAPES = (
+ 'amp' => '&', # ampersand
+ 'lt' => '<', # left chevron, less-than
+ 'gt' => '>', # right chevron, greater-than
+ 'quot' => '"', # double quote
+
+ 'Aacute' => "A\\*'", # capital A, acute accent
+ 'aacute' => "a\\*'", # small a, acute accent
+ 'Acirc' => 'A\\*^', # capital A, circumflex accent
+ 'acirc' => 'a\\*^', # small a, circumflex accent
+ 'AElig' => '\*(AE', # capital AE diphthong (ligature)
+ 'aelig' => '\*(ae', # small ae diphthong (ligature)
+ 'Agrave' => "A\\*`", # capital A, grave accent
+ 'agrave' => "A\\*`", # small a, grave accent
+ 'Aring' => 'A\\*o', # capital A, ring
+ 'aring' => 'a\\*o', # small a, ring
+ 'Atilde' => 'A\\*~', # capital A, tilde
+ 'atilde' => 'a\\*~', # small a, tilde
+ 'Auml' => 'A\\*:', # capital A, dieresis or umlaut mark
+ 'auml' => 'a\\*:', # small a, dieresis or umlaut mark
+ 'Ccedil' => 'C\\*,', # capital C, cedilla
+ 'ccedil' => 'c\\*,', # small c, cedilla
+ 'Eacute' => "E\\*'", # capital E, acute accent
+ 'eacute' => "e\\*'", # small e, acute accent
+ 'Ecirc' => 'E\\*^', # capital E, circumflex accent
+ 'ecirc' => 'e\\*^', # small e, circumflex accent
+ 'Egrave' => 'E\\*`', # capital E, grave accent
+ 'egrave' => 'e\\*`', # small e, grave accent
+ 'ETH' => '\\*(D-', # capital Eth, Icelandic
+ 'eth' => '\\*(d-', # small eth, Icelandic
+ 'Euml' => 'E\\*:', # capital E, dieresis or umlaut mark
+ 'euml' => 'e\\*:', # small e, dieresis or umlaut mark
+ 'Iacute' => "I\\*'", # capital I, acute accent
+ 'iacute' => "i\\*'", # small i, acute accent
+ 'Icirc' => 'I\\*^', # capital I, circumflex accent
+ 'icirc' => 'i\\*^', # small i, circumflex accent
+ 'Igrave' => 'I\\*`', # capital I, grave accent
+ 'igrave' => 'i\\*`', # small i, grave accent
+ 'Iuml' => 'I\\*:', # capital I, dieresis or umlaut mark
+ 'iuml' => 'i\\*:', # small i, dieresis or umlaut mark
+ 'Ntilde' => 'N\*~', # capital N, tilde
+ 'ntilde' => 'n\*~', # small n, tilde
+ 'Oacute' => "O\\*'", # capital O, acute accent
+ 'oacute' => "o\\*'", # small o, acute accent
+ 'Ocirc' => 'O\\*^', # capital O, circumflex accent
+ 'ocirc' => 'o\\*^', # small o, circumflex accent
+ 'Ograve' => 'O\\*`', # capital O, grave accent
+ 'ograve' => 'o\\*`', # small o, grave accent
+ 'Oslash' => 'O\\*/', # capital O, slash
+ 'oslash' => 'o\\*/', # small o, slash
+ 'Otilde' => 'O\\*~', # capital O, tilde
+ 'otilde' => 'o\\*~', # small o, tilde
+ 'Ouml' => 'O\\*:', # capital O, dieresis or umlaut mark
+ 'ouml' => 'o\\*:', # small o, dieresis or umlaut mark
+ 'szlig' => '\*8', # small sharp s, German (sz ligature)
+ 'THORN' => '\\*(Th', # capital THORN, Icelandic
+ 'thorn' => '\\*(th', # small thorn, Icelandic
+ 'Uacute' => "U\\*'", # capital U, acute accent
+ 'uacute' => "u\\*'", # small u, acute accent
+ 'Ucirc' => 'U\\*^', # capital U, circumflex accent
+ 'ucirc' => 'u\\*^', # small u, circumflex accent
+ 'Ugrave' => 'U\\*`', # capital U, grave accent
+ 'ugrave' => 'u\\*`', # small u, grave accent
+ 'Uuml' => 'U\\*:', # capital U, dieresis or umlaut mark
+ 'uuml' => 'u\\*:', # small u, dieresis or umlaut mark
+ 'Yacute' => "Y\\*'", # capital Y, acute accent
+ 'yacute' => "y\\*'", # small y, acute accent
+ 'yuml' => 'y\\*:', # small y, dieresis or umlaut mark
+);
+
+
+############################################################################
+# Static helper functions
+############################################################################
+
+# Protect leading quotes and periods against interpretation as commands.
+sub protect { local $_ = shift; s/^([.\'])/\\&$1/mg; $_ }
+
+# Given a command and a single argument that may or may not contain double
+# quotes, handle double-quote formatting for it. If there are no double
+# quotes, just return the command followed by the argument in double quotes.
+# If there are double quotes, use an if statement to test for nroff, and for
+# nroff output the command followed by the argument in double quotes with
+# embedded double quotes doubled. For other formatters, remap paired double
+# quotes to `` and ''.
+sub switchquotes {
+ my $command = shift;
+ local $_ = shift;
+ my $extra = shift;
+ s/\\\*\([LR]\"/\"/g;
+ if (/\"/) {
+ s/\"/\"\"/g;
+ my $troff = $_;
+ $troff =~ s/\"\"([^\"]*)\"\"/\`\`$1\'\'/g;
+ s/\"/\"\"/g if $extra;
+ $troff =~ s/\"/\"\"/g if $extra;
+ $_ = qq("$_") . ($extra ? " $extra" : '');
+ $troff = qq("$troff") . ($extra ? " $extra" : '');
+ return ".if n $command $_\n.el $command $troff\n";
+ } else {
+ $_ = qq("$_") . ($extra ? " $extra" : '');
+ return "$command $_\n";
+ }
+}
+
+# Translate a font string into an escape.
+sub toescape { (length ($_[0]) > 1 ? '\f(' : '\f') . $_[0] }
+
+
+############################################################################
+# Initialization
+############################################################################
+
+# Initialize the object. Here, we also process any additional options
+# passed to the constructor or set up defaults if none were given. center
+# is the centered title, release is the version number, and date is the date
+# for the documentation. Note that we can't know what file name we're
+# processing due to the architecture of Pod::Parser, so that *has* to either
+# be passed to the constructor or set separately with Pod::Man::name().
+sub initialize {
+ my $self = shift;
+
+ # Figure out the fixed-width font. If user-supplied, make sure that
+ # they are the right length.
+ for (qw/fixed fixedbold fixeditalic fixedbolditalic/) {
+ if (defined $$self{$_}) {
+ if (length ($$self{$_}) < 1 || length ($$self{$_}) > 2) {
+ croak "roff font should be 1 or 2 chars, not `$$self{$_}'";
+ }
+ } else {
+ $$self{$_} = '';
+ }
+ }
+
+ # Set the default fonts. We can't be sure what fixed bold-italic is
+ # going to be called, so default to just bold.
+ $$self{fixed} ||= 'CW';
+ $$self{fixedbold} ||= 'CB';
+ $$self{fixeditalic} ||= 'CI';
+ $$self{fixedbolditalic} ||= 'CB';
+
+ # Set up a table of font escapes. First number is fixed-width, second
+ # is bold, third is italic.
+ $$self{FONTS} = { '000' => '\fR', '001' => '\fI',
+ '010' => '\fB', '011' => '\f(BI',
+ '100' => toescape ($$self{fixed}),
+ '101' => toescape ($$self{fixeditalic}),
+ '110' => toescape ($$self{fixedbold}),
+ '111' => toescape ($$self{fixedbolditalic})};
+
+ # Extra stuff for page titles.
+ $$self{center} = 'User Contributed Perl Documentation'
+ unless defined $$self{center};
+ $$self{indent} = 4 unless defined $$self{indent};
+
+ # We used to try first to get the version number from a local binary,
+ # but we shouldn't need that any more. Get the version from the running
+ # Perl.
+ if (!defined $$self{release}) {
+ my ($rev, $ver, $sver) = ($] =~ /^(\d+)\.(\d{3})(\d{0,3})$/);
+ $sver ||= 0; $sver *= 10 ** (3-length($sver));
+ $rev += 0; $ver += 0; $sver += 0;
+ $$self{release} = "perl v$rev.$ver.$sver";
+ }
+
+ # Double quotes in things that will be quoted.
+ for (qw/center date release/) { $$self{$_} =~ s/\"/\"\"/g }
+
+ $$self{INDENT} = 0; # Current indentation level.
+ $$self{INDENTS} = []; # Stack of indentations.
+ $$self{INDEX} = []; # Index keys waiting to be printed.
+
+ $self->SUPER::initialize;
+}
+
+# For each document we process, output the preamble first. Note that the
+# fixed width font is a global default; once we interpolate it into the
+# PREAMBLE, it ain't ever changing. Maybe fix this later.
+sub begin_pod {
+ my $self = shift;
+
+ # Try to figure out the name and section from the file name.
+ my $section = $$self{section} || 1;
+ my $name = $$self{name};
+ if (!defined $name) {
+ $name = $self->input_file;
+ $section = 3 if (!$$self{section} && $name =~ /\.pm$/i);
+ $name =~ s/\.p(od|[lm])$//i;
+ if ($section =~ /^1/) {
+ require File::Basename;
+ $name = uc File::Basename::basename ($name);
+ } else {
+ # Lose everything up to the first of
+ # */lib/*perl* standard or site_perl module
+ # */*perl*/lib from -D prefix=/opt/perl
+ # */*perl*/ random module hierarchy
+ # which works. Should be fixed to use File::Spec.
+ for ($name) {
+ s%//+%/%g;
+ if ( s%^.*?/lib/[^/]*perl[^/]*/%%i
+ or s%^.*?/[^/]*perl[^/]*/(?:lib/)?%%i) {
+ s%^site(_perl)?/%%; # site and site_perl
+ s%^(.*-$^O|$^O-.*)/%%o; # arch
+ s%^\d+\.\d+%%; # version
+ }
+ s%/%::%g;
+ }
+ }
+ }
+
+ # Modification date header. Try to use the modification time of our
+ # input.
+ if (!defined $$self{date}) {
+ my $time = (stat $self->input_file)[9] || time;
+ my ($day, $month, $year) = (localtime $time)[3,4,5];
+ $month++;
+ $year += 1900;
+ $$self{date} = join ('-', $year, $month, $day);
+ }
+
+ # Now, print out the preamble and the title.
+ $PREAMBLE =~ s/\@CFONT\@/$$self{fixed}/;
+ chomp $PREAMBLE;
+ print { $self->output_handle } <<"----END OF HEADER----";
+.\\" Automatically generated by Pod::Man version $VERSION
+.\\" @{[ scalar localtime ]}
+.\\"
+.\\" Standard preamble:
+.\\" ======================================================================
+$PREAMBLE
+.\\" ======================================================================
+.\\"
+.IX Title "$name $section"
+.TH $name $section "$$self{release}" "$$self{date}" "$$self{center}"
+.UC
+----END OF HEADER----
+#"# for cperl-mode
+
+ # Initialize a few per-file variables.
+ $$self{INDENT} = 0;
+ $$self{NEEDSPACE} = 0;
+}
+
+
+############################################################################
+# Core overrides
+############################################################################
+
+# Called for each command paragraph. Gets the command, the associated
+# paragraph, the line number, and a Pod::Paragraph object. Just dispatches
+# the command to a method named the same as the command. =cut is handled
+# internally by Pod::Parser.
+sub command {
+ my $self = shift;
+ my $command = shift;
+ return if $command eq 'pod';
+ return if ($$self{EXCLUDE} && $command ne 'end');
+ $command = 'cmd_' . $command;
+ $self->$command (@_);
+}
+
+# Called for a verbatim paragraph. Gets the paragraph, the line number, and
+# a Pod::Paragraph object. Rofficate backslashes, untabify, put a
+# zero-width character at the beginning of each line to protect against
+# commands, and wrap in .Vb/.Ve.
+sub verbatim {
+ my $self = shift;
+ return if $$self{EXCLUDE};
+ local $_ = shift;
+ return if /^\s+$/;
+ s/\s+$/\n/;
+ my $lines = tr/\n/\n/;
+ 1 while s/^(.*?)(\t+)/$1 . ' ' x (length ($2) * 8 - length ($1) % 8)/me;
+ s/\\/\\e/g;
+ s/^(\s*\S)/'\&' . $1/gme;
+ $self->makespace if $$self{NEEDSPACE};
+ $self->output (".Vb $lines\n$_.Ve\n");
+ $$self{NEEDSPACE} = 0;
+}
+
+# Called for a regular text block. Gets the paragraph, the line number, and
+# a Pod::Paragraph object. Perform interpolation and output the results.
+sub textblock {
+ my $self = shift;
+ return if $$self{EXCLUDE};
+ $self->output ($_[0]), return if $$self{VERBATIM};
+
+ # Perform a little magic to collapse multiple L<> references. We'll
+ # just rewrite the whole thing into actual text at this part, bypassing
+ # the whole internal sequence parsing thing.
+ s{
+ (L< # A link of the form L</something>.
+ /
+ (
+ [:\w]+ # The item has to be a simple word...
+ (\(\))? # ...or simple function.
+ )
+ >
+ (
+ ,?\s+(and\s+)? # Allow lots of them, conjuncted.
+ L<
+ /
+ ( [:\w]+ ( \(\) )? )
+ >
+ )+
+ )
+ } {
+ local $_ = $1;
+ s{ L< / ([^>]+ ) } {$1}g;
+ my @items = split /(?:,?\s+(?:and\s+)?)/;
+ my $string = "the ";
+ my $i;
+ for ($i = 0; $i < @items; $i++) {
+ $string .= $items[$i];
+ $string .= ", " if @items > 2 && $i != $#items;
+ $string .= " and " if ($i == $#items - 1);
+ }
+ $string .= " entries elsewhere in this document";
+ $string;
+ }gex;
+
+ # Parse the tree and output it. collapse knows about references to
+ # scalars as well as scalars and does the right thing with them.
+ local $_ = $self->parse (@_);
+ s/\n\s*$/\n/;
+ $self->makespace if $$self{NEEDSPACE};
+ $self->output (protect $self->mapfonts ($_));
+ $self->outindex;
+ $$self{NEEDSPACE} = 1;
+}
+
+# Called for an interior sequence. Takes a Pod::InteriorSequence object and
+# returns a reference to a scalar. This scalar is the final formatted text.
+# It's returned as a reference so that other interior sequences above us
+# know that the text has already been processed.
+sub sequence {
+ my ($self, $seq) = @_;
+ my $command = $seq->cmd_name;
+
+ # Zero-width characters.
+ if ($command eq 'Z') {
+ my $v = '\&'; return bless \ $v, 'Pod::Man::String';
+ }
+
+ # C<>, L<>, X<>, and E<> don't apply guesswork to their contents.
+ local $_ = $self->collapse ($seq->parse_tree, $command =~ /^[CELX]$/);
+
+ # Handle E<> escapes.
+ if ($command eq 'E') {
+ if (/^\d+$/) {
+ return bless \ chr ($_), 'Pod::Man::String';
+ } elsif (exists $ESCAPES{$_}) {
+ return bless \ "$ESCAPES{$_}", 'Pod::Man::String';
+ } else {
+ carp "Unknown escape E<$1>";
+ return bless \ "E<$_>", 'Pod::Man::String';
+ }
+ }
+
+ # For all the other sequences, empty content produces no output.
+ return '' if $_ eq '';
+
+ # Handle formatting sequences.
+ if ($command eq 'B') {
+ return bless \ ('\f(BS' . $_ . '\f(BE'), 'Pod::Man::String';
+ } elsif ($command eq 'F') {
+ return bless \ ('\f(IS' . $_ . '\f(IE'), 'Pod::Man::String';
+ } elsif ($command eq 'I') {
+ return bless \ ('\f(IS' . $_ . '\f(IE'), 'Pod::Man::String';
+ } elsif ($command eq 'C') {
+ s/-/\\-/g;
+ s/__/_\\|_/g;
+ return bless \ ('\f(FS\*(C`' . $_ . "\\*(C'\\f(FE"),
+ 'Pod::Man::String';
+ }
+
+ # Handle links.
+ if ($command eq 'L') {
+ # XXX bug in lvalue subroutines prevents this from working
+ #return bless \ ($self->buildlink ($_)), 'Pod::Man::String';
+ my $v = $self->buildlink($_);
+ return bless \$v, 'Pod::Man::String';
+ }
+
+ # Whitespace protection replaces whitespace with "\ ".
+ if ($command eq 'S') {
+ s/\s+/\\ /g;
+ return bless \ "$_", 'Pod::Man::String';
+ }
+
+ # Add an index entry to the list of ones waiting to be output.
+ if ($command eq 'X') { push (@{ $$self{INDEX} }, $_); return '' }
+
+ # Anything else is unknown.
+ carp "Unknown sequence $command<$_>";
+}
+
+
+############################################################################
+# Command paragraphs
+############################################################################
+
+# All command paragraphs take the paragraph and the line number.
+
+# First level heading. We can't output .IX in the NAME section due to a bug
+# in some versions of catman, so don't output a .IX for that section. .SH
+# already uses small caps, so remove any E<> sequences that would cause
+# them.
+sub cmd_head1 {
+ my $self = shift;
+ local $_ = $self->parse (@_);
+ s/\s+$//;
+ s/\\s-?\d//g;
+ $self->output (switchquotes ('.SH', $self->mapfonts ($_)));
+ $self->outindex (($_ eq 'NAME') ? () : ('Header', $_));
+ $$self{NEEDSPACE} = 0;
+}
+
+# Second level heading.
+sub cmd_head2 {
+ my $self = shift;
+ local $_ = $self->parse (@_);
+ s/\s+$//;
+ $self->output (switchquotes ('.Sh', $self->mapfonts ($_)));
+ $self->outindex ('Subsection', $_);
+ $$self{NEEDSPACE} = 0;
+}
+
+# Start a list. For indents after the first, wrap the outside indent in .RS
+# so that hanging paragraph tags will be correct.
+sub cmd_over {
+ my $self = shift;
+ local $_ = shift;
+ unless (/^[-+]?\d+\s+$/) { $_ = $$self{indent} }
+ if (@{ $$self{INDENTS} } > 0) {
+ $self->output (".RS $$self{INDENT}\n");
+ }
+ push (@{ $$self{INDENTS} }, $$self{INDENT});
+ $$self{INDENT} = ($_ + 0);
+}
+
+# End a list. If we've closed an embedded indent, we've mangled the hanging
+# paragraph indent, so temporarily replace it with .RS and set WEIRDINDENT.
+# We'll close that .RS at the next =back or =item.
+sub cmd_back {
+ my $self = shift;
+ $$self{INDENT} = pop @{ $$self{INDENTS} };
+ unless (defined $$self{INDENT}) {
+ carp "Unmatched =back";
+ $$self{INDENT} = 0;
+ }
+ if ($$self{WEIRDINDENT}) {
+ $self->output (".RE\n");
+ $$self{WEIRDINDENT} = 0;
+ }
+ if (@{ $$self{INDENTS} } > 0) {
+ $self->output (".RE\n");
+ $self->output (".RS $$self{INDENT}\n");
+ $$self{WEIRDINDENT} = 1;
+ }
+ $$self{NEEDSPACE} = 1;
+}
+
+# An individual list item. Emit an index entry for anything that's
+# interesting, but don't emit index entries for things like bullets and
+# numbers. rofficate bullets too while we're at it (so for nice output, use
+# * for your lists rather than o or . or - or some other thing).
+sub cmd_item {
+ my $self = shift;
+ local $_ = $self->parse (@_);
+ s/\s+$//;
+ my $index;
+ if (/\w/ && !/^\w[.\)]\s*$/) {
+ $index = $_;
+ $index =~ s/^\s*[-*+o.]?\s*//;
+ }
+ s/^\*(\s|\Z)/\\\(bu$1/;
+ if ($$self{WEIRDINDENT}) {
+ $self->output (".RE\n");
+ $$self{WEIRDINDENT} = 0;
+ }
+ $_ = $self->mapfonts ($_);
+ $self->output (switchquotes ('.Ip', $_, $$self{INDENT}));
+ $self->outindex ($index ? ('Item', $index) : ());
+ $$self{NEEDSPACE} = 0;
+}
+
+# Begin a block for a particular translator. Setting VERBATIM triggers
+# special handling in textblock().
+sub cmd_begin {
+ my $self = shift;
+ local $_ = shift;
+ my ($kind) = /^(\S+)/ or return;
+ if ($kind eq 'man' || $kind eq 'roff') {
+ $$self{VERBATIM} = 1;
+ } else {
+ $$self{EXCLUDE} = 1;
+ }
+}
+
+# End a block for a particular translator. We assume that all =begin/=end
+# pairs are properly closed.
+sub cmd_end {
+ my $self = shift;
+ $$self{EXCLUDE} = 0;
+ $$self{VERBATIM} = 0;
+}
+
+# One paragraph for a particular translator. Ignore it unless it's intended
+# for man or roff, in which case we output it verbatim.
+sub cmd_for {
+ my $self = shift;
+ local $_ = shift;
+ my $line = shift;
+ return unless s/^(?:man|roff)\b[ \t]*\n?//;
+ $self->output ($_);
+}
+
+
+############################################################################
+# Link handling
+############################################################################
+
+# Handle links. We can't actually make real hyperlinks, so this is all to
+# figure out what text and formatting we print out.
+sub buildlink {
+ my $self = shift;
+ local $_ = shift;
+
+ # Smash whitespace in case we were split across multiple lines.
+ s/\s+/ /g;
+
+ # If we were given any explicit text, just output it.
+ if (m{ ^ ([^|]+) \| }x) { return $1 }
+
+ # Okay, leading and trailing whitespace isn't important.
+ s/^\s+//;
+ s/\s+$//;
+
+ # Default to using the whole content of the link entry as a section
+ # name. Note that L<manpage/> forces a manpage interpretation, as does
+ # something looking like L<manpage(section)>. Do the same thing to
+ # L<manpage(section)> as we would to manpage(section) without the L<>;
+ # see guesswork(). If we've added italics, don't add the "manpage"
+ # text; markup is sufficient.
+ my ($manpage, $section) = ('', $_);
+ if (/^"\s*(.*?)\s*"$/) {
+ $section = '"' . $1 . '"';
+ } elsif (m{ ^ [-:.\w]+ (?: \( \S+ \) )? $ }x) {
+ ($manpage, $section) = ($_, '');
+ $manpage =~ s/^([^\(]+)\(/'\f(IS' . $1 . '\f(IE\|('/e;
+ } elsif (m%/%) {
+ ($manpage, $section) = split (/\s*\/\s*/, $_, 2);
+ if ($manpage =~ /^[-:.\w]+(?:\(\S+\))?$/) {
+ $manpage =~ s/^([^\(]+)\(/'\f(IS' . $1 . '\f(IE\|'/e;
+ }
+ $section =~ s/^\"\s*//;
+ $section =~ s/\s*\"$//;
+ }
+ if ($manpage && $manpage !~ /\\f\(IS/) {
+ $manpage = "the $manpage manpage";
+ }
+
+ # Now build the actual output text.
+ my $text = '';
+ if (!length ($section) && !length ($manpage)) {
+ carp "Invalid link $_";
+ } elsif (!length ($section)) {
+ $text = $manpage;
+ } elsif ($section =~ /^[:\w]+(?:\(\))?/) {
+ $text .= 'the ' . $section . ' entry';
+ $text .= (length $manpage) ? " in $manpage"
+ : " elsewhere in this document";
+ } else {
+ if ($section !~ /^".*"$/) { $section = '"' . $section . '"' }
+ $text .= 'the section on ' . $section;
+ $text .= " in $manpage" if length $manpage;
+ }
+ $text;
+}
+
+
+############################################################################
+# Escaping and fontification
+############################################################################
+
+# At this point, we'll have embedded font codes of the form \f(<font>[SE]
+# where <font> is one of B, I, or F. Turn those into the right font start
+# or end codes. B<someI<thing> else> should map to \fBsome\f(BIthing\fB
+# else\fR. The old pod2man didn't get this right; the second \fB was \fR,
+# so nested sequences didn't work right. We take care of this by using
+# variables as a combined pointer to our current font sequence, and set each
+# to the number of current nestings of start tags for that font. Use them
+# as a vector to look up what font sequence to use.
+sub mapfonts {
+ my $self = shift;
+ local $_ = shift;
+
+ my ($fixed, $bold, $italic) = (0, 0, 0);
+ my %magic = (F => \$fixed, B => \$bold, I => \$italic);
+ s { \\f\((.)(.) } {
+ ${ $magic{$1} } += ($2 eq 'S') ? 1 : -1;
+ $$self{FONTS}{($fixed && 1) . ($bold && 1) . ($italic && 1)};
+ }gxe;
+ $_;
+}
+
+
+############################################################################
+# *roff-specific parsing
+############################################################################
+
+# Called instead of parse_text, calls parse_text with the right flags.
+sub parse {
+ my $self = shift;
+ $self->parse_text ({ -expand_seq => 'sequence',
+ -expand_ptree => 'collapse' }, @_);
+}
+
+# Takes a parse tree and a flag saying whether or not to treat it as literal
+# text (not call guesswork on it), and returns the concatenation of all of
+# the text strings in that parse tree. If the literal flag isn't true,
+# guesswork() will be called on all plain scalars in the parse tree.
+# Assumes that everything in the parse tree is either a scalar or a
+# reference to a scalar.
+sub collapse {
+ my ($self, $ptree, $literal) = @_;
+ if ($literal) {
+ return join ('', map {
+ if (ref $_) {
+ $$_;
+ } else {
+ s/\\/\\e/g;
+ $_;
+ }
+ } $ptree->children);
+ } else {
+ return join ('', map {
+ ref ($_) ? $$_ : $self->guesswork ($_)
+ } $ptree->children);
+ }
+}
+
+# Takes a text block to perform guesswork on; this is guaranteed not to
+# contain any interior sequences. Returns the text block with remapping
+# done.
+sub guesswork {
+ my $self = shift;
+ local $_ = shift;
+
+ # rofficate backslashes.
+ s/\\/\\e/g;
+
+ # Ensure double underbars have a tiny space between them.
+ s/__/_\\|_/g;
+
+ # Make all caps a little smaller. Be careful here, since we don't want
+ # to make @ARGV into small caps, nor do we want to fix the MIME in
+ # MIME-Version, since it looks weird with the full-height V.
+ s{
+ ( ^ | [\s\(\"\'\`\[\{<>] )
+ ( [A-Z] [A-Z] [/A-Z+:\d_\$&-]* )
+ (?: (?= [\s>\}\]\)\'\".?!,;:] | -- ) | $ )
+ } { $1 . '\s-1' . $2 . '\s0' . $3 }egx;
+
+ # Turn PI into a pretty pi.
+ s{ (?: \\s-1 | \b ) PI (?: \\s0 | \b ) } {\\*\(PI}gx;
+
+ # Italize functions in the form func().
+ s{
+ \b
+ (
+ [:\w]+ (?:\\s-1)? \(\)
+ )
+ } { '\f(IS' . $1 . '\f(IE' }egx;
+
+ # func(n) is a reference to a manual page. Make it \fIfunc\fR\|(n).
+ s{
+ \b
+ (\w[-:.\w]+ (?:\\s-1)?)
+ (
+ \( [^\)] \)
+ )
+ } { '\f(IS' . $1 . '\f(IE\|' . $2 }egx;
+
+ # Convert simple Perl variable references to a fixed-width font.
+ s{
+ ( \s+ )
+ ( [\$\@%] [\w:]+ )
+ (?! \( )
+ } { $1 . '\f(FS' . $2 . '\f(FE'}egx;
+
+ # Translate -- into a real em dash if it's used like one and fix up
+ # dashes, but keep hyphens hyphens.
+ s{ (\G|^|.) (-+) (\b|.) } {
+ my ($pre, $dash, $post) = ($1, $2, $3);
+ if (length ($dash) == 1) {
+ ($pre =~ /[a-zA-Z]/) ? "$pre-$post" : "$pre\\-$post";
+ } elsif (length ($dash) == 2
+ && ((!$pre && !$post)
+ || ($pre =~ /\w/ && !$post)
+ || ($pre eq ' ' && $post eq ' ')
+ || ($pre eq '=' && $post ne '=')
+ || ($pre ne '=' && $post eq '='))) {
+ "$pre\\*(--$post";
+ } else {
+ $pre . ('\-' x length $dash) . $post;
+ }
+ }egxs;
+
+ # Fix up double quotes.
+ s{ \" ([^\"]+) \" } { '\*(L"' . $1 . '\*(R"' }egx;
+
+ # Make C++ into \*(C+, which is a squinched version.
+ s{ \b C\+\+ } {\\*\(C+}gx;
+
+ # All done.
+ $_;
+}
+
+
+############################################################################
+# Output formatting
+############################################################################
+
+# Make vertical whitespace.
+sub makespace {
+ my $self = shift;
+ $self->output ($$self{INDENT} > 0 ? ".Sp\n" : ".PP\n");
+}
+
+# Output any pending index entries, and optionally an index entry given as
+# an argument. Support multiple index entries in X<> separated by slashes,
+# and strip special escapes from index entries.
+sub outindex {
+ my ($self, $section, $index) = @_;
+ my @entries = map { split m%\s*/\s*% } @{ $$self{INDEX} };
+ return unless ($section || @entries);
+ $$self{INDEX} = [];
+ my $output;
+ if (@entries) {
+ my $output = '.IX Xref "'
+ . join (' ', map { s/\"/\"\"/; $_ } @entries)
+ . '"' . "\n";
+ }
+ if ($section) {
+ $index =~ s/\"/\"\"/;
+ $index =~ s/\\-/-/g;
+ $index =~ s/\\(?:s-?\d|.\(..|.)//g;
+ $output .= ".IX $section " . '"' . $index . '"' . "\n";
+ }
+ $self->output ($output);
+}
+
+# Output text to the output device.
+sub output { print { $_[0]->output_handle } $_[1] }
+
+__END__
+
+.\" These are some extra bits of roff that I don't want to lose track of
+.\" but that have been removed from the preamble to make it a bit shorter
+.\" since they're not currently being used. They're accents and special
+.\" characters we don't currently have escapes for.
+.if n \{\
+. ds ? ?
+. ds ! !
+. ds q
+.\}
+.if t \{\
+. ds ? \s-2c\h'-\w'c'u*7/10'\u\h'\*(#H'\zi\d\s+2\h'\w'c'u*8/10'
+. ds ! \s-2\(or\s+2\h'-\w'\(or'u'\v'-.8m'.\v'.8m'
+. ds q o\h'-\w'o'u*8/10'\s-4\v'.4m'\z\(*i\v'-.4m'\s+4\h'\w'o'u*8/10'
+.\}
+.ds v \\k:\h'-(\\n(.wu*9/10-\*(#H)'\v'-\*(#V'\*(#[\s-4v\s0\v'\*(#V'\h'|\\n:u'\*(#]
+.ds _ \\k:\h'-(\\n(.wu*9/10-\*(#H+(\*(#F*2/3))'\v'-.4m'\z\(hy\v'.4m'\h'|\\n:u'
+.ds . \\k:\h'-(\\n(.wu*8/10)'\v'\*(#V*4/10'\z.\v'-\*(#V*4/10'\h'|\\n:u'
+.ds 3 \*(#[\v'.2m'\s-2\&3\s0\v'-.2m'\*(#]
+.ds oe o\h'-(\w'o'u*4/10)'e
+.ds Oe O\h'-(\w'O'u*4/10)'E
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds v \h'-1'\o'\(aa\(ga'
+. ds _ \h'-1'^
+. ds . \h'-1'.
+. ds 3 3
+. ds oe oe
+. ds Oe OE
+.\}
+
+############################################################################
+# Documentation
+############################################################################
+
+=head1 NAME
+
+Pod::Man - Convert POD data to formatted *roff input
+
+=head1 SYNOPSIS
+
+ use Pod::Man;
+ my $parser = Pod::Man->new (release => $VERSION, section => 8);
+
+ # Read POD from STDIN and write to STDOUT.
+ $parser->parse_from_filehandle;
+
+ # Read POD from file.pod and write to file.1.
+ $parser->parse_from_file ('file.pod', 'file.1');
+
+=head1 DESCRIPTION
+
+Pod::Man is a module to convert documentation in the POD format (the
+preferred language for documenting Perl) into *roff input using the man
+macro set. The resulting *roff code is suitable for display on a terminal
+using nroff(1), normally via man(1), or printing using troff(1). It is
+conventionally invoked using the driver script B<pod2man>, but it can also
+be used directly.
+
+As a derived class from Pod::Parser, Pod::Man supports the same methods and
+interfaces. See L<Pod::Parser> for all the details; briefly, one creates a
+new parser with C<Pod::Man-E<gt>new()> and then calls either
+parse_from_filehandle() or parse_from_file().
+
+new() can take options, in the form of key/value pairs that control the
+behavior of the parser. See below for details.
+
+If no options are given, Pod::Man uses the name of the input file with any
+trailing C<.pod>, C<.pm>, or C<.pl> stripped as the man page title, to
+section 1 unless the file ended in C<.pm> in which case it defaults to
+section 3, to a centered title of "User Contributed Perl Documentation", to
+a centered footer of the Perl version it is run with, and to a left-hand
+footer of the modification date of its input (or the current date if given
+STDIN for input).
+
+Pod::Man assumes that your *roff formatters have a fixed-width font named
+CW. If yours is called something else (like CR), use the C<fixed> option to
+specify it. This generally only matters for troff output for printing.
+Similarly, you can set the fonts used for bold, italic, and bold italic
+fixed-width output.
+
+Besides the obvious pod conversions, Pod::Man also takes care of formatting
+func(), func(n), and simple variable references like $foo or @bar so you
+don't have to use code escapes for them; complex expressions like
+C<$fred{'stuff'}> will still need to be escaped, though. It also translates
+dashes that aren't used as hyphens into en dashes, makes long dashes--like
+this--into proper em dashes, fixes "paired quotes," makes C++ and PI look
+right, puts a little space between double underbars, makes ALLCAPS a teeny
+bit smaller in troff(1), and escapes stuff that *roff treats as special so
+that you don't have to.
+
+The recognized options to new() are as follows. All options take a single
+argument.
+
+=over 4
+
+=item center
+
+Sets the centered page header to use instead of "User Contributed Perl
+Documentation".
+
+=item date
+
+Sets the left-hand footer. By default, the modification date of the input
+file will be used, or the current date if stat() can't find that file (the
+case if the input is from STDIN), and the date will be formatted as
+YYYY-MM-DD.
+
+=item fixed
+
+The fixed-width font to use for vertabim text and code. Defaults to CW.
+Some systems may want CR instead. Only matters for troff(1) output.
+
+=item fixedbold
+
+Bold version of the fixed-width font. Defaults to CB. Only matters for
+troff(1) output.
+
+=item fixeditalic
+
+Italic version of the fixed-width font (actually, something of a misnomer,
+since most fixed-width fonts only have an oblique version, not an italic
+version). Defaults to CI. Only matters for troff(1) output.
+
+=item fixedbolditalic
+
+Bold italic (probably actually oblique) version of the fixed-width font.
+Pod::Man doesn't assume you have this, and defaults to CB. Some systems
+(such as Solaris) have this font available as CX. Only matters for troff(1)
+output.
+
+=item release
+
+Set the centered footer. By default, this is the version of Perl you run
+Pod::Man under. Note that some system an macro sets assume that the
+centered footer will be a modification date and will prepend something like
+"Last modified: "; if this is the case, you may want to set C<release> to
+the last modified date and C<date> to the version number.
+
+=item section
+
+Set the section for the C<.TH> macro. The standard section numbering
+convention is to use 1 for user commands, 2 for system calls, 3 for
+functions, 4 for devices, 5 for file formats, 6 for games, 7 for
+miscellaneous information, and 8 for administrator commands. There is a lot
+of variation here, however; some systems (like Solaris) use 4 for file
+formats, 5 for miscellaneous information, and 7 for devices. Still others
+use 1m instead of 8, or some mix of both. About the only section numbers
+that are reliably consistent are 1, 2, and 3.
+
+By default, section 1 will be used unless the file ends in .pm in which case
+section 3 will be selected.
+
+=back
+
+The standard Pod::Parser method parse_from_filehandle() takes up to two
+arguments, the first being the file handle to read POD from and the second
+being the file handle to write the formatted output to. The first defaults
+to STDIN if not given, and the second defaults to STDOUT. The method
+parse_from_file() is almost identical, except that its two arguments are the
+input and output disk files instead. See L<Pod::Parser> for the specific
+details.
+
+=head1 DIAGNOSTICS
+
+=over 4
+
+=item roff font should be 1 or 2 chars, not `%s'
+
+(F) You specified a *roff font (using C<fixed>, C<fixedbold>, etc.) that
+wasn't either one or two characters. Pod::Man doesn't support *roff fonts
+longer than two characters, although some *roff extensions do (the canonical
+versions of nroff(1) and troff(1) don't either).
+
+=item Invalid link %s
+
+(W) The POD source contained a C<LE<lt>E<gt>> sequence that Pod::Man was
+unable to parse. You should never see this error message; it probably
+indicates a bug in Pod::Man.
+
+=item Unknown escape EE<lt>%sE<gt>
+
+(W) The POD source contained an C<EE<lt>E<gt>> escape that Pod::Man didn't
+know about. C<EE<lt>%sE<gt>> was printed verbatim in the output.
+
+=item Unknown sequence %s
+
+(W) The POD source contained a non-standard interior sequence (something of
+the form C<XE<lt>E<gt>>) that Pod::Man didn't know about. It was ignored.
+
+=item Unmatched =back
+
+(W) Pod::Man encountered a C<=back> command that didn't correspond to an
+C<=over> command.
+
+=back
+
+=head1 BUGS
+
+The lint-like features and strict POD format checking done by B<pod2man> are
+not yet implemented and should be, along with the corresponding C<lax>
+option.
+
+The NAME section should be recognized specially and index entries emitted
+for everything in that section. This would have to be deferred until the
+next section, since extraneous things in NAME tends to confuse various man
+page processors.
+
+The handling of hyphens, en dashes, and em dashes is somewhat fragile, and
+one may get the wrong one under some circumstances. This should only matter
+for troff(1) output.
+
+When and whether to use small caps is somewhat tricky, and Pod::Man doesn't
+necessarily get it right.
+
+Pod::Man doesn't handle font names longer than two characters. Neither do
+most troff(1) implementations, but GNU troff does as an extension. It would
+be nice to support as an option for those who want to use it.
+
+The preamble added to each output file is rather verbose, and most of it is
+only necessary in the presence of EE<lt>E<gt> escapes for non-ASCII
+characters. It would ideally be nice if all of those definitions were only
+output if needed, perhaps on the fly as the characters are used.
+
+Some of the automagic applied to file names assumes Unix directory
+separators.
+
+Pod::Man is excessively slow.
+
+=head1 NOTES
+
+The intention is for this module and its driver script to eventually replace
+B<pod2man> in Perl core.
+
+=head1 SEE ALSO
+
+L<Pod::Parser|Pod::Parser>, perlpod(1), pod2man(1), nroff(1), troff(1),
+man(1), man(7)
+
+Ossanna, Joseph F., and Brian W. Kernighan. "Troff User's Manual,"
+Computing Science Technical Report No. 54, AT&T Bell Laboratories. This is
+the best documentation of standard nroff(1) and troff(1). At the time of
+this writing, it's available at http://www.cs.bell-labs.com/cm/cs/cstr.html.
+
+The man page documenting the man macro set may be man(5) instead of man(7)
+on your system. Also, please see pod2man(1) for extensive documentation on
+writing manual pages if you've not done it before and aren't familiar with
+the conventions.
+
+=head1 AUTHOR
+
+Russ Allbery E<lt>rra@stanford.eduE<gt>, based I<very> heavily on the
+original B<pod2man> by Tom Christiansen E<lt>tchrist@mox.perl.comE<gt>.
+
+=cut
#############################################################################
# Pod/Parser.pm -- package which defines a base class for parsing POD docs.
#
-# Based on Tom Christiansen's Pod::Text module
-# (with extensive modifications).
-#
-# Copyright (C) 1996-1999 Tom Christiansen. All rights reserved.
+# Copyright (C) 1996-1999 by Bradford Appleton. All rights reserved.
# This file is part of "PodParser". PodParser is free software;
# you can redistribute it and/or modify it under the same terms
# as Perl itself.
package Pod::Parser;
use vars qw($VERSION);
-$VERSION = 1.081; ## Current version of this package
+$VERSION = 1.091; ## Current version of this package
require 5.004; ## requires this Perl version or later
#############################################################################
=head1 REQUIRES
-perl5.004, Pod::InputObjects, Exporter, FileHandle, Carp
+perl5.004, Pod::InputObjects, Exporter, Carp
=head1 EXPORTS
do most of the input parsing for you and leave you free to worry about
how to intepret the commands and translate the result.
+Note that all we have described here in this quick overview overview is
+the simplest most striaghtforward use of B<Pod::Parser> to do stream-based
+parsing. It is also possible to use the B<Pod::Parser::parse_text> function
+to do more sophisticated tree-based parsing. See L<"TREE-BASED PARSING">.
+
+=head1 PARSING OPTIONS
+
+A I<parse-option> is simply a named option of B<Pod::Parser> with a
+value that corresponds to a certain specified behavior. These various
+behaviors of B<Pod::Parser> may be enabled/disabled by setting or
+or unsetting one or more I<parse-options> using the B<parseopts()> method.
+The set of currently accepted parse-options is as follows:
+
+=over 3
+
+=item B<-want_nonPODs> (default: unset)
+
+Normally (by default) B<Pod::Parser> will only provide access to
+the POD sections of the input. Input paragraphs that are not part
+of the POD-format documentation are not made available to the caller
+(not even using B<preprocess_paragraph()>). Setting this option to a
+non-empty, non-zero value will allow B<preprocess_paragraph()> to see
+non-POD sections of the input as well as POD sections. The B<cutting()>
+method can be used to determine if the corresponding paragraph is a POD
+paragraph, or some other input paragraph.
+
+=item B<-process_cut_cmd> (default: unset)
+
+Normally (by default) B<Pod::Parser> handles the C<=cut> POD directive
+by itself and does not pass it on to the caller for processing. Setting
+this option to non-empty, non-zero value will cause B<Pod::Parser> to
+pass the C<=cut> directive to the caller just like any other POD command
+(and hence it may be processed by the B<command()> method).
+
+B<Pod::Parser> will still interpret the C<=cut> directive to mean that
+"cutting mode" has been (re)entered, but the caller will get a chance
+to capture the actual C<=cut> paragraph itself for whatever purpose
+it desires.
+
+=back
+
+Please see L<"parseopts()"> for a complete description of the interface
+for the setting and unsetting of parse-options.
+
=cut
#############################################################################
#use diagnostics;
use Pod::InputObjects;
use Carp;
-use FileHandle;
use Exporter;
@ISA = qw(Exporter);
## These "variables" are used as local "glob aliases" for performance
-use vars qw(%myData @input_stack);
+use vars qw(%myData %myOpts @input_stack);
#############################################################################
place If the empty string is returned or an undefined value is
returned, then the given C<$text> is ignored (not processed).
-This method is invoked after gathering up all thelines in a paragraph
+This method is invoked after gathering up all the lines in a paragraph
+and after determining the cutting state of the paragraph,
but before trying to further parse or interpret them. After
B<preprocess_paragraph()> returns, the current cutting state (which
is returned by C<$self-E<gt>cutting()>) is examined. If it evaluates
-to false then input text (including the given C<$text>) is cut (not
+to true then input text (including the given C<$text>) is cut (not
processed) until the next POD directive is encountered.
Please note that the B<preprocess_line()> method is invoked I<before>
the B<preprocess_paragraph()> method. After all (possibly preprocessed)
-lines in a paragraph have been assembled together and it has been
+lines in a paragraph have been assembled together and either it has been
determined that the paragraph is part of the POD documentation from one
-of the selected sections, then B<preprocess_paragraph()> is invoked.
+of the selected sections or the C<-want_nonPODs> option is true,
+then B<preprocess_paragraph()> is invoked.
The base class implementation of this method returns the given text.
=head1 METHODS FOR PARSING AND PROCESSING
B<Pod::Parser> provides several methods to process input text. These
-methods typically won't need to be overridden, but subclasses may want
-to invoke them to exploit their functionality.
+methods typically won't need to be overridden (and in some cases they
+can't be overridden), but subclasses may want to invoke them to exploit
+their functionality.
=cut
[I<NOTE>: If the B<interior_sequence()> method is specified, then it is
invoked according to the interface specified in L<"interior_sequence()">].
+=item B<-expand_text> =E<gt> I<code-ref>|I<method-name>
+
+Normally, the parse-tree returned by B<parse_text()> will contain a
+text-string for each contiguous sequence of characters outside of an
+interior-sequence. Specifying B<-expand_text> tells B<parse_text()> to
+"preprocess" every such text-string it sees by invoking the referenced
+function (or named method of the parser object) and using the return value
+as the preprocessed (or "expanded") result. [Note that if the result is
+an interior-sequence, then it will I<not> be expanded as specified by the
+B<-expand_seq> option; Any such recursive expansion needs to be handled by
+the specified callback routine.]
+
+If a subroutine reference was given, it is invoked as:
+
+ &$code_ref( $parser, $text, $ptree_node )
+
+and if a method-name was given, it is invoked as:
+
+ $parser->method_name( $text, $ptree_node )
+
+where C<$parser> is a reference to the parser object, C<$text> is the
+text-string encountered, and C<$ptree_node> is a reference to the current
+node in the parse-tree (usually an interior-sequence object or else the
+top-level node of the parse-tree).
+
=item B<-expand_ptree> =E<gt> I<code-ref>|I<method-name>
Rather than returning a C<Pod::ParseTree>, pass the parse-tree as an
## This global regex is used to see if the text before a '>' inside
## an interior sequence looks like '-' or '=', but not '--', '==',
-## '$-', or '$='
+## '!=', '$-', '$=' or <<op>>=
use vars qw( $ARROW_RE );
-$ARROW_RE = join('', qw{ (?: [^-+*/=!&|%^x.<>$]= | [^$-]- )$ });
-#$ARROW_RE = qr/(?:[^=]+=|[^-]+-)$/; ## 5.005+ only!
+$ARROW_RE = join('', qw{ (?: [^-+*/=!&|%^x.<>$]= | [^-$]- )$ });
+#$ARROW_RE = qr/(?:[^-+*/=!&|%^x.<>$]+=|[^-$]+-)$/; ## 5.005+ only!
sub parse_text {
my $self = shift;
## Get options and set any defaults
my %opts = (ref $_[0]) ? %{ shift() } : ();
my $expand_seq = $opts{'-expand_seq'} || undef;
+ my $expand_text = $opts{'-expand_text'} || undef;
my $expand_ptree = $opts{'-expand_ptree'} || undef;
my $text = shift;
## Convert method calls into closures, for our convenience
my $xseq_sub = $expand_seq;
+ my $xtext_sub = $expand_text;
my $xptree_sub = $expand_ptree;
if (defined $expand_seq and $expand_seq eq 'interior_sequence') {
## If 'interior_sequence' is the method to use, we have to pass
};
}
ref $xseq_sub or $xseq_sub = sub { shift()->$expand_seq(@_) };
+ ref $xtext_sub or $xtext_sub = sub { shift()->$expand_text(@_) };
ref $xptree_sub or $xptree_sub = sub { shift()->$expand_ptree(@_) };
## Keep track of the "current" interior sequence, and maintain a stack
## Remember the current cmd-name
$cmd = (@seq_stack > 1) ? $seq_stack[-1]->name : '';
}
- else {
- ## In the middle of a sequence, append this text to it
- $seq->append($_) if length;
+ elsif (length) {
+ ## In the middle of a sequence, append this text to it, and
+ ## dont forget to "expand" it if that's what the caller wanted
+ $seq->append($expand_text ? &$xtext_sub($self,$_,$seq) : $_);
}
## Remember the "current" sequence and the previously seen token
($seq, $prev) = ( $seq_stack[-1], $_ );
}
## Handle unterminated sequences
+ my $errorsub = (@seq_stack > 1) ? $self->errorsub() : undef;
while (@seq_stack > 1) {
($cmd, $file, $line) = ($seq->name, $seq->file_line);
pop @seq_stack;
- warn "** Unterminated $cmd<...> at $file line $line\n";
+ my $errmsg = "** Unterminated $cmd<...> at $file line $line\n";
+ (ref $errorsub) and &{$errorsub}($errmsg)
+ or (defined $errorsub) and $self->$errorsub($errmsg)
+ or warn($errmsg);
$seq_stack[-1]->append($expand_seq ? &$xseq_sub($self,$seq) : $seq);
$seq = $seq_stack[-1];
}
with its corresponding line number, and invokes the appropriate method
(one of B<command()>, B<verbatim()>, or B<textblock()>).
-This method does I<not> usually need to be overridden by subclasses.
+For performance reasons, this method is invoked directly without any
+dynamic lookup; Hence subclasses may I<not> override it!
=end __PRIVATE__
sub parse_paragraph {
my ($self, $text, $line_num) = @_;
- local *myData = $self; ## an alias to avoid deref-ing overhead
+ local *myData = $self; ## alias to avoid deref-ing overhead
+ local *myOpts = ($myData{_PARSEOPTS} ||= {}); ## get parse-options
local $_;
- ## This is the end of a non-empty paragraph
+ ## See if we want to preprocess nonPOD paragraphs as well as POD ones.
+ my $wantNonPods = $myOpts{'-want_nonPODs'};
+
+ ## Update cutting status
+ $myData{_CUTTING} = 0 if $text =~ /^={1,2}\S/;
+
+ ## Perform any desired preprocessing if we wanted it this early
+ $wantNonPods and $text = $self->preprocess_paragraph($text, $line_num);
+
## Ignore up until next POD directive if we are cutting
- if ($myData{_CUTTING}) {
- return unless ($text =~ /^={1,2}\S/);
- $myData{_CUTTING} = 0;
- }
+ return if $myData{_CUTTING};
## Now we know this is block of text in a POD section!
$self->is_selected($text) or return ($myData{_CUTTING} = 1);
}
- ## Perform any desired preprocessing and re-check the "cutting" state
- $text = $self->preprocess_paragraph($text, $line_num);
- return 1 unless ((defined $text) and (length $text));
- return 1 if ($myData{_CUTTING});
+ ## If we havent already, perform any desired preprocessing and
+ ## then re-check the "cutting" state
+ unless ($wantNonPods) {
+ $text = $self->preprocess_paragraph($text, $line_num);
+ return 1 unless ((defined $text) and (length $text));
+ return 1 if ($myData{_CUTTING});
+ }
## Look for one of the three types of paragraphs
my ($pfx, $cmd, $arg, $sep) = ('', '', '', '');
## except return to "cutting" mode.
if ($cmd eq 'cut') {
$myData{_CUTTING} = 1;
- return;
+ return unless $myOpts{'-process_cut_cmd'};
}
}
## Save the attributes indicating how the command was specified.
my $self = shift;
my %opts = (ref $_[0] eq 'HASH') ? %{ shift() } : ();
my ($infile, $outfile) = @_;
- my ($in_fh, $out_fh) = (undef, undef);
+ my ($in_fh, $out_fh);
my ($close_input, $close_output) = (0, 0);
local *myData = $self;
local $_;
else {
## We have a filename, open it for reading
$myData{_INFILE} = $infile;
- $in_fh = FileHandle->new("< $infile") or
+ open($in_fh, "< $infile") or
croak "Can't open $infile for reading: $!\n";
$close_input = 1;
}
else {
## We have a filename, open it for writing
$myData{_OUTFILE} = $outfile;
- $out_fh = FileHandle->new("> $outfile") or
+ open($out_fh, "> $outfile") or
croak "Can't open $outfile for writing: $!\n";
$close_output = 1;
}
##---------------------------------------------------------------------------
+=head1 B<errorsub()>
+
+ $parser->errorsub("method_name");
+ $parser->errorsub(\&warn_user);
+ $parser->errorsub(sub { print STDERR, @_ });
+
+Specifies the method or subroutine to use when printing error messages
+about POD syntax. The supplied method/subroutine I<must> return TRUE upon
+successful printing of the message. If C<undef> is given, then the B<warn>
+builtin is used to issue error messages (this is the default behavior).
+
+ my $errorsub = $parser->errorsub()
+ my $errmsg = "This is an error message!\n"
+ (ref $errorsub) and &{$errorsub}($errmsg)
+ or (defined $errorsub) and $parser->$errorsub($errmsg)
+ or warn($errmsg);
+
+Returns a method name, or else a reference to the user-supplied subroutine
+used to print error messages. Returns C<undef> if the B<warn> builtin
+is used to issue error messages (this is the default behavior).
+
+=cut
+
+sub errorsub {
+ return (@_ > 1) ? ($_[0]->{_ERRORSUB} = $_[1]) : $_[0]->{_ERRORSUB};
+}
+
+##---------------------------------------------------------------------------
+
=head1 B<cutting()>
$boolean = $parser->cutting();
##---------------------------------------------------------------------------
+##---------------------------------------------------------------------------
+
+=head1 B<parseopts()>
+
+When invoked with no additional arguments, B<parseopts> returns a hashtable
+of all the current parsing options.
+
+ ## See if we are parsing non-POD sections as well as POD ones
+ my %opts = $parser->parseopts();
+ $opts{'-want_nonPODs}' and print "-want_nonPODs\n";
+
+When invoked using a single string, B<parseopts> treats the string as the
+name of a parse-option and returns its corresponding value if it exists
+(returns C<undef> if it doesn't).
+
+ ## Did we ask to see '=cut' paragraphs?
+ my $want_cut = $parser->parseopts('-process_cut_cmd');
+ $want_cut and print "-process_cut_cmd\n";
+
+When invoked with multiple arguments, B<parseopts> treats them as
+key/value pairs and the specified parse-option names are set to the
+given values. Any unspecified parse-options are unaffected.
+
+ ## Set them back to the default
+ $parser->parseopts(-process_cut_cmd => 0);
+
+When passed a single hash-ref, B<parseopts> uses that hash to completely
+reset the existing parse-options, all previous parse-option values
+are lost.
+
+ ## Reset all options to default
+ $parser->parseopts( { } );
+
+See L<"PARSING OPTIONS"> for more for the name and meaning of each
+parse-option currently recognized.
+
+=cut
+
+sub parseopts {
+ local *myData = shift;
+ local *myOpts = ($myData{_PARSEOPTS} ||= {});
+ return %myOpts if (@_ == 0);
+ if (@_ == 1) {
+ local $_ = shift;
+ return ref($_) ? $myData{_PARSEOPTS} = $_ : $myOpts{$_};
+ }
+ my @newOpts = (%myOpts, @_);
+ $myData{_PARSEOPTS} = { @newOpts };
+}
+
+##---------------------------------------------------------------------------
+
=head1 B<output_file()>
$fname = $parser->output_file();
#############################################################################
+=head1 TREE-BASED PARSING
+
+If straightforward stream-based parsing wont meet your needs (as is
+likely the case for tasks such as translating PODs into structured
+markup languages like HTML and XML) then you may need to take the
+tree-based approach. Rather than doing everything in one pass and
+calling the B<interpolate()> method to expand sequences into text, it
+may be desirable to instead create a parse-tree using the B<parse_text()>
+method to return a tree-like structure which may contain an ordered list
+list of children (each of which may be a text-string, or a similar
+tree-like structure).
+
+Pay special attention to L<"METHODS FOR PARSING AND PROCESSING"> and
+to the objects described in L<Pod::InputObjects>. The former describes
+the gory details and parameters for how to customize and extend the
+parsing behavior of B<Pod::Parser>. B<Pod::InputObjects> provides
+several objects that may all be used interchangeably as parse-trees. The
+most obvious one is the B<Pod::ParseTree> object. It defines the basic
+interface and functionality that all things trying to be a POD parse-tree
+should do. A B<Pod::ParseTree> is defined such that each "node" may be a
+text-string, or a reference to another parse-tree. Each B<Pod::Paragraph>
+object and each B<Pod::InteriorSequence> object also supports the basic
+parse-tree interface.
+
+The B<parse_text()> method takes a given paragraph of text, and
+returns a parse-tree that contains one or more children, each of which
+may be a text-string, or an InteriorSequence object. There are also
+callback-options that may be passed to B<parse_text()> to customize
+the way it expands or transforms interior-sequences, as well as the
+returned result. These callbacks can be used to create a parse-tree
+with custom-made objects (which may or may not support the parse-tree
+interface, depending on how you choose to do it).
+
+If you wish to turn an entire POD document into a parse-tree, that process
+is fairly straightforward. The B<parse_text()> method is the key to doing
+this successfully. Every paragraph-callback (i.e. the polymorphic methods
+for B<command()>, B<verbatim()>, and B<textblock()> paragraphs) takes
+a B<Pod::Paragraph> object as an argument. Each paragraph object has a
+B<parse_tree()> method that can be used to get or set a corresponding
+parse-tree. So for each of those paragraph-callback methods, simply call
+B<parse_text()> with the options you desire, and then use the returned
+parse-tree to assign to the given paragraph object.
+
+That gives you a parse-tree for each paragraph - so now all you need is
+an ordered list of paragraphs. You can maintain that yourself as a data
+element in the object/hash. The most straightforward way would be simply
+to use an array-ref, with the desired set of custom "options" for each
+invocation of B<parse_text>. Let's assume the desired option-set is
+given by the hash C<%options>. Then we might do something like the
+following:
+
+ package MyPodParserTree;
+
+ @ISA = qw( Pod::Parser );
+
+ ...
+
+ sub begin_pod {
+ my $self = shift;
+ $self->{'-paragraphs'} = []; ## initialize paragraph list
+ }
+
+ sub command {
+ my ($parser, $command, $paragraph, $line_num, $pod_para) = @_;
+ my $ptree = $parser->parse_text({%options}, $paragraph, ...);
+ $pod_para->parse_tree( $ptree );
+ push @{ $self->{'-paragraphs'} }, $pod_para;
+ }
+
+ sub verbatim {
+ my ($parser, $paragraph, $line_num, $pod_para) = @_;
+ push @{ $self->{'-paragraphs'} }, $pod_para;
+ }
+
+ sub textblock {
+ my ($parser, $paragraph, $line_num, $pod_para) = @_;
+ my $ptree = $parser->parse_text({%options}, $paragraph, ...);
+ $pod_para->parse_tree( $ptree );
+ push @{ $self->{'-paragraphs'} }, $pod_para;
+ }
+
+ ...
+
+ package main;
+ ...
+ my $parser = new MyPodParserTree(...);
+ $parser->parse_from_file(...);
+ my $paragraphs_ref = $parser->{'-paragraphs'};
+
+Of course, in this module-author's humble opinion, I'd be more inclined to
+use the existing B<Pod::ParseTree> object than a simple array. That way
+everything in it, paragraphs and sequences, all respond to the same core
+interface for all parse-tree nodes. The result would look something like:
+
+ package MyPodParserTree2;
+
+ ...
+
+ sub begin_pod {
+ my $self = shift;
+ $self->{'-ptree'} = new Pod::ParseTree; ## initialize parse-tree
+ }
+
+ sub parse_tree {
+ ## convenience method to get/set the parse-tree for the entire POD
+ (@_ > 1) and $_[0]->{'-ptree'} = $_[1];
+ return $_[0]->{'-ptree'};
+ }
+
+ sub command {
+ my ($parser, $command, $paragraph, $line_num, $pod_para) = @_;
+ my $ptree = $parser->parse_text({<<options>>}, $paragraph, ...);
+ $pod_para->parse_tree( $ptree );
+ $parser->parse_tree()->append( $pod_para );
+ }
+
+ sub verbatim {
+ my ($parser, $paragraph, $line_num, $pod_para) = @_;
+ $parser->parse_tree()->append( $pod_para );
+ }
+
+ sub textblock {
+ my ($parser, $paragraph, $line_num, $pod_para) = @_;
+ my $ptree = $parser->parse_text({<<options>>}, $paragraph, ...);
+ $pod_para->parse_tree( $ptree );
+ $parser->parse_tree()->append( $pod_para );
+ }
+
+ ...
+
+ package main;
+ ...
+ my $parser = new MyPodParserTree2(...);
+ $parser->parse_from_file(...);
+ my $ptree = $parser->parse_tree;
+ ...
+
+Now you have the entire POD document as one great big parse-tree. You
+can even use the B<-expand_seq> option to B<parse_text> to insert
+whole different kinds of objects. Just don't expect B<Pod::Parser>
+to know what to do with them after that. That will need to be in your
+code. Or, alternatively, you can insert any object you like so long as
+it conforms to the B<Pod::ParseTree> interface.
+
+One could use this to create subclasses of B<Pod::Paragraphs> and
+B<Pod::InteriorSequences> for specific commands (or to create your own
+custom node-types in the parse-tree) and add some kind of B<emit()>
+method to each custom node/subclass object in the tree. Then all you'd
+need to do is recursively walk the tree in the desired order, processing
+the children (most likely from left to right) by formatting them if
+they are text-strings, or by calling their B<emit()> method if they
+are objects/references.
+
=head1 SEE ALSO
L<Pod::InputObjects>, L<Pod::Select>
+++ /dev/null
-#############################################################################
-# Pod/PlainText.pm -- convert POD data to formatted ASCII text
-#
-# Derived from Tom Christiansen's Pod::PlainText module
-# (with extensive modifications).
-#
-# Copyright (C) 1994-1999 Tom Christiansen. All rights reserved.
-# This file is part of "PodParser". PodParser is free software;
-# you can redistribute it and/or modify it under the same terms
-# as Perl itself.
-#############################################################################
-
-package Pod::PlainText;
-
-use vars qw($VERSION);
-$VERSION = 1.081; ## Current version of this package
-require 5.004; ## requires this Perl version or later
-
-=head1 NAME
-
-pod2plaintext - function to convert POD data to formatted ASCII text
-
-Pod::PlainText - a class for converting POD data to formatted ASCII text
-
-=head1 SYNOPSIS
-
- use Pod::PlainText;
- pod2plaintext("perlfunc.pod");
-
-or
-
- use Pod::PlainText;
- package MyParser;
- @ISA = qw(Pod::PlainText);
-
- sub new {
- ## constructor code ...
- }
-
- ## implementation of appropriate subclass methods ...
-
- package main;
- $parser = new MyParser;
- @ARGV = ('-') unless (@ARGV > 0);
- for (@ARGV) {
- $parser->parse_from_file($_);
- }
-
-=head1 REQUIRES
-
-perl5.004, Pod::Select, Term::Cap, Exporter, Carp
-
-=head1 EXPORTS
-
-pod2plaintext()
-
-=head1 DESCRIPTION
-
-Pod::PlainText is a module that can convert documentation in the POD
-format (such as can be found throughout the Perl distribution) into
-formatted ASCII. Termcap is optionally supported for
-boldface/underline, and can be enabled via C<$Pod::PlainText::termcap=1>.
-If termcap has not been enabled, then backspaces will be used to
-simulate bold and underlined text.
-
-A separate F<pod2plaintext> program is included that is primarily a wrapper
-for C<Pod::PlainText::pod2plaintext()>.
-
-The single function C<pod2plaintext()> can take one or two arguments. The first
-should be the name of a file to read the pod from, or "<&STDIN" to read from
-STDIN. A second argument, if provided, should be a filehandle glob where
-output should be sent.
-
-=head1 SEE ALSO
-
-L<Pod::Parser>.
-
-=head1 AUTHOR
-
-Tom Christiansen E<lt>tchrist@mox.perl.comE<gt>
-
-Modified to derive from B<Pod::Parser> by
-Brad Appleton E<lt>bradapp@enteract.comE<gt>
-
-=cut
-
-#############################################################################
-
-use strict;
-#use diagnostics;
-use Carp;
-use Exporter;
-use Pod::Select;
-use Term::Cap;
-use vars qw(@ISA @EXPORT %HTML_Escapes);
-
-@ISA = qw(Exporter Pod::Select);
-@EXPORT = qw(&pod2plaintext);
-
-%HTML_Escapes = (
- 'amp' => '&', # ampersand
- 'lt' => '<', # left chevron, less-than
- 'gt' => '>', # right chevron, greater-than
- 'quot' => '"', # double quote
-
- "Aacute" => "\xC1", # capital A, acute accent
- "aacute" => "\xE1", # small a, acute accent
- "Acirc" => "\xC2", # capital A, circumflex accent
- "acirc" => "\xE2", # small a, circumflex accent
- "AElig" => "\xC6", # capital AE diphthong (ligature)
- "aelig" => "\xE6", # small ae diphthong (ligature)
- "Agrave" => "\xC0", # capital A, grave accent
- "agrave" => "\xE0", # small a, grave accent
- "Aring" => "\xC5", # capital A, ring
- "aring" => "\xE5", # small a, ring
- "Atilde" => "\xC3", # capital A, tilde
- "atilde" => "\xE3", # small a, tilde
- "Auml" => "\xC4", # capital A, dieresis or umlaut mark
- "auml" => "\xE4", # small a, dieresis or umlaut mark
- "Ccedil" => "\xC7", # capital C, cedilla
- "ccedil" => "\xE7", # small c, cedilla
- "Eacute" => "\xC9", # capital E, acute accent
- "eacute" => "\xE9", # small e, acute accent
- "Ecirc" => "\xCA", # capital E, circumflex accent
- "ecirc" => "\xEA", # small e, circumflex accent
- "Egrave" => "\xC8", # capital E, grave accent
- "egrave" => "\xE8", # small e, grave accent
- "ETH" => "\xD0", # capital Eth, Icelandic
- "eth" => "\xF0", # small eth, Icelandic
- "Euml" => "\xCB", # capital E, dieresis or umlaut mark
- "euml" => "\xEB", # small e, dieresis or umlaut mark
- "Iacute" => "\xCD", # capital I, acute accent
- "iacute" => "\xED", # small i, acute accent
- "Icirc" => "\xCE", # capital I, circumflex accent
- "icirc" => "\xEE", # small i, circumflex accent
- "Igrave" => "\xCD", # capital I, grave accent
- "igrave" => "\xED", # small i, grave accent
- "Iuml" => "\xCF", # capital I, dieresis or umlaut mark
- "iuml" => "\xEF", # small i, dieresis or umlaut mark
- "Ntilde" => "\xD1", # capital N, tilde
- "ntilde" => "\xF1", # small n, tilde
- "Oacute" => "\xD3", # capital O, acute accent
- "oacute" => "\xF3", # small o, acute accent
- "Ocirc" => "\xD4", # capital O, circumflex accent
- "ocirc" => "\xF4", # small o, circumflex accent
- "Ograve" => "\xD2", # capital O, grave accent
- "ograve" => "\xF2", # small o, grave accent
- "Oslash" => "\xD8", # capital O, slash
- "oslash" => "\xF8", # small o, slash
- "Otilde" => "\xD5", # capital O, tilde
- "otilde" => "\xF5", # small o, tilde
- "Ouml" => "\xD6", # capital O, dieresis or umlaut mark
- "ouml" => "\xF6", # small o, dieresis or umlaut mark
- "szlig" => "\xDF", # small sharp s, German (sz ligature)
- "THORN" => "\xDE", # capital THORN, Icelandic
- "thorn" => "\xFE", # small thorn, Icelandic
- "Uacute" => "\xDA", # capital U, acute accent
- "uacute" => "\xFA", # small u, acute accent
- "Ucirc" => "\xDB", # capital U, circumflex accent
- "ucirc" => "\xFB", # small u, circumflex accent
- "Ugrave" => "\xD9", # capital U, grave accent
- "ugrave" => "\xF9", # small u, grave accent
- "Uuml" => "\xDC", # capital U, dieresis or umlaut mark
- "uuml" => "\xFC", # small u, dieresis or umlaut mark
- "Yacute" => "\xDD", # capital Y, acute accent
- "yacute" => "\xFD", # small y, acute accent
- "yuml" => "\xFF", # small y, dieresis or umlaut mark
-
- "lchevron" => "\xAB", # left chevron (double less than)
- "rchevron" => "\xBB", # right chevron (double greater than)
-);
-
-##---------------------------------
-## Function definitions begin here
-##---------------------------------
-
- ## Try to find #columns for the tty
-my %NotUnix = map {($_ => 1)} qw(MacOS MSWin32 VMS MVS);
-sub get_screen {
- ((defined $ENV{TERMCAP}) && ($ENV{TERMCAP} =~ /co#(\d+)/)[0])
- or ((defined $ENV{COLUMNS}) && $ENV{COLUMNS})
- or (!$NotUnix{$^O} && (`stty -a 2>/dev/null` =~ /(\d+) columns/)[0])
- or 72;
-
-}
-
-sub pod2plaintext {
- my ($infile, $outfile) = @_;
- local $_;
- my $text_parser = new Pod::PlainText;
- $text_parser->parse_from_file($infile, $outfile);
-}
-
-##-------------------------------
-## Method definitions begin here
-##-------------------------------
-
-sub new {
- my $this = shift;
- my $class = ref($this) || $this;
- my %params = @_;
- my $self = {%params};
- bless $self, $class;
- $self->initialize();
- return $self;
-}
-
-sub initialize {
- my $self = shift;
- $self->SUPER::initialize();
- return;
-}
-
-sub makespace {
- my $self = shift;
- my $out_fh = $self->output_handle();
- if ($self->{NEEDSPACE}) {
- print $out_fh "\n";
- $self->{NEEDSPACE} = 0;
- }
-}
-
-sub bold {
- my $self = shift;
- my $line = shift;
- my $map = $self->{FONTMAP};
- return $line if $self->{USE_FORMAT};
- if ($self->{TERMCAP}) {
- $line = "$map->{BOLD}$line$map->{NORM}";
- }
- else {
- $line =~ s/(.)/$1\b$1/g;
- }
-# $line = "$map->{BOLD}$line$map->{NORM}" if $self->{ANSIFY};
- return $line;
-}
-
-sub italic {
- my $self = shift;
- my $line = shift;
- my $map = $self->{FONTMAP};
- return $line if $self->{USE_FORMAT};
- if ($self->{TERMCAP}) {
- $line = "$map->{UNDL}$line$map->{NORM}";
- }
- else {
- $line =~ s/(.)/$1\b_/g;
- }
-# $line = "$map->{UNDL}$line$map->{NORM}" if $self->{ANSIFY};
- return $line;
-}
-
-# Fill a paragraph including underlined and overstricken chars.
-# It's not perfect for words longer than the margin, and it's probably
-# slow, but it works.
-sub fill {
- my $self = shift;
- local $_ = shift;
- my $par = "";
- my $indent_space = " " x $self->{INDENT};
- my $marg = $self->{SCREEN} - $self->{INDENT};
- my $line = $indent_space;
- my $line_length;
- foreach (split) {
- my $word_length = length;
- $word_length -= 2 while /\010/g; # Subtract backspaces
-
- if ($line_length + $word_length > $marg) {
- $par .= $line . "\n";
- $line= $indent_space . $_;
- $line_length = $word_length;
- }
- else {
- if ($line_length) {
- $line_length++;
- $line .= " ";
- }
- $line_length += $word_length;
- $line .= $_;
- }
- }
- $par .= "$line\n" if length $line;
- $par .= "\n";
- return $par;
-}
-
-## Handle a pending "item" paragraph. The paragraph (if given) is the
-## corresponding item text. (the item tag should be in $self->{ITEM}).
-sub item {
- my $self = shift;
- my $cmd = shift;
- local $_ = shift;
- my $line = shift;
- $cmd = '' unless (defined $cmd);
- $_ = '' unless (defined $_);
- my $out_fh = $self->output_handle();
- return unless (defined $self->{ITEM});
- my $paratag = $self->{ITEM};
- my $prev_indent = $self->{INDENTS}->[-1] || $self->{DEF_INDENT};
- ## reset state
- undef $self->{ITEM};
- #$self->rm_callbacks('*');
-
- my $over = $self->{INDENT};
- $over -= $prev_indent if ($prev_indent < $over);
- if (length $cmd) { # tricked - this is another command
- $self->output($paratag, INDENT => $prev_indent);
- $self->command($cmd, $_);
- }
- elsif (/^\s+/o) { # verbatim
- $self->output($paratag, INDENT => $prev_indent);
- s/\s+\Z//;
- $self->verbatim($_);
- }
- else { # plain textblock
- $_ = $self->interpolate($_, $line);
- s/\s+\Z//;
- if ((length $_) && (length($paratag) <= $over)) {
- $self->IP_output($paratag, $_);
- }
- else {
- $self->output($paratag, INDENT => $prev_indent);
- $self->output($_, REFORMAT => 1);
- }
- }
-}
-
-sub remap_whitespace {
- my $self = shift;
- local($_) = shift;
- tr/\000-\177/\200-\377/;
- return $_;
-}
-
-sub unmap_whitespace {
- my $self = shift;
- local($_) = shift;
- tr/\200-\377/\000-\177/;
- return $_;
-}
-
-sub IP_output {
- my $self = shift;
- my $tag = shift;
- local($_) = @_;
- my $out_fh = $self->output_handle();
- my $tag_indent = $self->{INDENTS}->[-1] || $self->{DEF_INDENT};
- my $tag_cols = $self->{SCREEN} - $tag_indent;
- my $cols = $self->{SCREEN} - $self->{INDENT};
- $tag =~ s/\s*$//;
- s/\s+/ /g;
- s/^ //;
- my $fmt_name = '_Pod_Text_IP_output_format_';
- my $str = "format $fmt_name = \n"
- . (" " x ($tag_indent))
- . '@' . ('<' x ($self->{INDENT} - $tag_indent - 1))
- . "^" . ("<" x ($cols - 1)) . "\n"
- . '$tag, $_'
- . "\n~~"
- . (" " x ($self->{INDENT} - 2))
- . "^" . ("<" x ($cols - 5)) . "\n"
- . '$_' . "\n\n.\n1";
- #warn $str; warn "tag is $tag, _ is $_";
- {
- ## reset format (turn off warning about redefining a format)
- local($^W) = 0;
- eval $str;
- croak if ($@);
- }
- select((select($out_fh), $~ = $fmt_name)[0]);
- local($:) = ($self->curr_headings(1) eq 'SYNOPSIS') ? "\n " : $: ;
- write $out_fh;
-}
-
-sub output {
- my $self = shift;
- local $_ = shift;
- $_ = '' unless (defined $_);
- return unless (length $_);
- my $out_fh = $self->output_handle();
- my %options;
- if (@_ > 1) {
- ## usage was $self->output($text, NAME=>VALUE, ...);
- %options = @_;
- }
- elsif (@_ == 1) {
- if (ref $_[0]) {
- ## usage was $self->output($text, { NAME=>VALUE, ... } );
- %options = %{$_[0]};
- }
- else {
- ## usage was $self->output($text, $number);
- $options{"REFORMAT"} = shift;
- }
- }
- $options{"INDENT"} = $self->{INDENT} unless (defined $options{"INDENT"});
- if ((defined $options{"REFORMAT"}) && $options{"REFORMAT"}) {
- my $cols = $self->{SCREEN} - $options{"INDENT"};
- s/\s+/ /g;
- s/^ //;
- my $fmt_name = '_Pod_Text_output_format_';
- my $str = "format $fmt_name = \n~~"
- . (" " x ($options{"INDENT"} - 2))
- . "^" . ("<" x ($cols - 5)) . "\n"
- . '$_' . "\n\n.\n1";
- {
- ## reset format (turn off warning about redefining a format)
- local($^W) = 0;
- eval $str;
- croak if ($@);
- }
- select((select($out_fh), $~ = $fmt_name)[0]);
- local($:) = ($self->curr_headings(1) eq 'SYNOPSIS') ? "\n " : $: ;
- write $out_fh;
- }
- else {
- s/^/' ' x $options{"INDENT"}/gem;
- s/^\s+\n$/\n/gm;
- print $out_fh $_;
- }
-}
-
-sub internal_lrefs {
- my $self = shift;
- local $_ = shift;
- s{L</([^>]+)>}{$1}g;
- my(@items) = split( /(?:,?\s+(?:and\s+)?)/ );
- my $retstr = "the ";
- my $i;
- for ($i = 0; $i <= $#items; $i++) {
- $retstr .= "C<$items[$i]>";
- $retstr .= ", " if @items > 2 && $i != $#items;
- $retstr .= " and " if $i+2 == @items;
- }
-
- $retstr .= " entr" . ( @items > 1 ? "ies" : "y" )
- . " elsewhere in this document ";
-
- return $retstr;
-}
-
-sub begin_pod {
- my $self = shift;
-
- $self->{BEGUN} = [];
- $self->{TERMCAP} = 0;
- #$self->{USE_FORMAT} = 1;
-
- $self->{FONTMAP} = {
- UNDL => "\x1b[4m",
- INV => "\x1b[7m",
- BOLD => "\x1b[1m",
- NORM => "\x1b[0m",
- };
- if ($self->{TERMCAP} and (! defined $self->{SETUPTERMCAP})) {
- $self->{SETUPTERMCAP} = 1;
- my ($term) = Tgetent Term::Cap { TERM => undef, OSPEED => 9600 };
- $self->{FONTMAP}->{UNDL} = $term->{'_us'};
- $self->{FONTMAP}->{INV} = $term->{'_mr'};
- $self->{FONTMAP}->{BOLD} = $term->{'_md'};
- $self->{FONTMAP}->{NORM} = $term->{'_me'};
- }
-
- $self->{SCREEN} = &get_screen;
- $self->{FANCY} = 0;
- $self->{DEF_INDENT} = 4;
- $self->{INDENTS} = [];
- $self->{INDENT} = $self->{DEF_INDENT};
- $self->{NEEDSPACE} = 0;
-}
-
-sub end_pod {
- my $self = shift;
- $self->item('', '', '', 0) if (defined $self->{ITEM});
-}
-
-sub begun_excluded {
- my $self = shift;
- my @begun = @{ $self->{BEGUN} };
- return (@begun > 0) ? ($begun[-1] ne 'text') : 0;
-}
-
-sub command {
- my $self = shift;
- my $cmd = shift;
- local $_ = shift;
- my $line = shift;
- $cmd = '' unless (defined $cmd);
- $_ = '' unless (defined $_);
- my $out_fh = $self->output_handle();
-
- return if (($cmd ne 'end') and $self->begun_excluded());
- return $self->item($cmd, $_, $line) if (defined $self->{ITEM});
- $_ = $self->interpolate($_, $line);
- s/\s+\Z/\n/;
-
- return if ($cmd eq 'pod');
- if ($cmd eq 'head1') {
- $self->makespace();
- print $out_fh $_;
- # print $out_fh uc($_);
- }
- elsif ($cmd eq 'head2') {
- $self->makespace();
- # s/(\w+)/\u\L$1/g;
- #print ' ' x $self->{DEF_INDENT}, $_;
- # print "\xA7";
- s/(\w)/\xA7 $1/ if $self->{FANCY};
- print $out_fh ' ' x ($self->{DEF_INDENT}/2), $_, "\n";
- }
- elsif ($cmd eq 'over') {
- /^[-+]?\d+$/ or $_ = $self->{DEF_INDENT};
- push(@{$self->{INDENTS}}, $self->{INDENT});
- $self->{INDENT} += ($_ + 0);
- }
- elsif ($cmd eq 'back') {
- $self->{INDENT} = pop(@{$self->{INDENTS}});
- unless (defined $self->{INDENT}) {
- carp "Unmatched =back\n";
- $self->{INDENT} = $self->{DEF_INDENT};
- }
- }
- elsif ($cmd eq 'begin') {
- my ($kind) = /^(\S*)/;
- push( @{ $self->{BEGUN} }, $kind );
- }
- elsif ($cmd eq 'end') {
- pop( @{ $self->{BEGUN} } );
- }
- elsif ($cmd eq 'for') {
- $self->textblock($1) if /^text\b\s*(.*)$/s;
- }
- elsif ($cmd eq 'item') {
- $self->makespace();
- # s/\A(\s*)\*/$1\xb7/ if $self->{FANCY};
- # s/^(\s*\*\s+)/$1 /;
- $self->{ITEM} = $_;
- #$self->add_callbacks('*', SUB => \&item);
- }
- else {
- carp "Unrecognized directive: $cmd\n";
- }
-}
-
-sub verbatim {
- my $self = shift;
- local $_ = shift;
- my $line = shift;
- return if $self->begun_excluded();
- return $self->item('', $_, $line) if (defined $self->{ITEM});
- $self->output($_);
- #$self->{NEEDSPACE} = 1;
-}
-
-sub textblock {
- my $self = shift;
- my $text = shift;
- my $line = shift;
- return if $self->begun_excluded();
- return $self->item('', $text, $line) if (defined $self->{ITEM});
- local($_) = $self->interpolate($text, $line);
- s/\s*\Z/\n/;
- $self->makespace();
- $self->output($_, REFORMAT => 1);
-}
-
-sub interior_sequence {
- my $self = shift;
- my $cmd = shift;
- my $arg = shift;
- local($_) = $arg;
- if ($cmd eq 'C') {
- my ($pre, $post) = ("`", "'");
- ($pre, $post) = ($HTML_Escapes{"lchevron"}, $HTML_Escapes{"rchevron"})
- if ((defined $self->{FANCY}) && $self->{FANCY});
- $_ = $pre . $_ . $post;
- }
- elsif ($cmd eq 'E') {
- if (defined $HTML_Escapes{$_}) {
- $_ = $HTML_Escapes{$_};
- }
- else {
- carp "Unknown escape: E<$_>";
- $_ = "E<$_>";
- }
- # }
- # elsif ($cmd eq 'B') {
- # $_ = $self->bold($_);
- }
- elsif ($cmd eq 'I') {
- # $_ = $self->italic($_);
- $_ = "*" . $_ . "*";
- }
- elsif (($cmd eq 'X') || ($cmd eq 'Z')) {
- $_ = '';
- }
- elsif ($cmd eq 'S') {
- # Escape whitespace until we are ready to print
- #$_ = $self->remap_whitespace($_);
- }
- elsif ($cmd eq 'L') {
- s/\s+/ /g;
- my ($text, $manpage, $sec, $ref) = ('', $_, '', '');
- if (/\A(.*?)\|(.*)\Z/) {
- $text = $1;
- $manpage = $_ = $2;
- }
- if (/^\s*"\s*(.*)\s*"\s*$/o) {
- ($manpage, $sec) = ('', "\"$1\"");
- }
- elsif (m|\s*/\s*|s) {
- ($manpage, $sec) = split(/\s*\/\s*/, $_, 2);
- }
- if (! length $sec) {
- $ref .= "the $manpage manpage" if (length $manpage);
- }
- elsif ($sec =~ /^\s*"\s*(.*)\s*"\s*$/o) {
- $ref .= "the section on \"$1\"";
- $ref .= " in the $manpage manpage" if (length $manpage);
- }
- else {
- $ref .= "the \"$sec\" entry";
- $ref .= (length $manpage) ? " in the $manpage manpage"
- : " in this manpage"
- }
- $_ = $text || $ref;
- #if ( m{^ ([a-zA-Z][^\s\/]+) (\([^\)]+\))? $}x ) {
- # ## LREF: a manpage(3f)
- # $_ = "the $1$2 manpage";
- #}
- #elsif ( m{^ ([^/]+) / ([:\w]+(\(\))?) $}x ) {
- # ## LREF: an =item on another manpage
- # $_ = "the \"$2\" entry in the $1 manpage";
- #}
- #elsif ( m{^ / ([:\w]+(\(\))?) $}x ) {
- # ## LREF: an =item on this manpage
- # $_ = $self->internal_lrefs($1);
- #}
- #elsif ( m{^ (?: ([a-zA-Z]\S+?) / )? "?(.*?)"? $}x ) {
- # ## LREF: a =head2 (head1?), maybe on a manpage, maybe right here
- # ## the "func" can disambiguate
- # $_ = ((defined $1) && $1)
- # ? "the section on \"$2\" in the $1 manpage"
- # : "the section on \"$2\"";
- #}
- }
- return $_;
-}
-
-1;
#############################################################################
# Pod/Select.pm -- function to select portions of POD docs
#
-# Based on Tom Christiansen's pod2text() function
-# (with extensive modifications).
-#
-# Copyright (C) 1996-1999 Tom Christiansen. All rights reserved.
+# Copyright (C) 1996-1999 by Bradford Appleton. All rights reserved.
# This file is part of "PodParser". PodParser is free software;
# you can redistribute it and/or modify it under the same terms
# as Perl itself.
package Pod::Select;
use vars qw($VERSION);
-$VERSION = 1.081; ## Current version of this package
+$VERSION = 1.090; ## Current version of this package
require 5.004; ## requires this Perl version or later
#############################################################################
=head1 REQUIRES
-perl5.004, Pod::Parser, Exporter, FileHandle, Carp
+perl5.004, Pod::Parser, Exporter, Carp
=head1 EXPORTS
# Pod::Text -- Convert POD data to formatted ASCII text.
-# $Id: Text.pm,v 0.2 1999/06/13 02:44:01 eagle Exp $
+# $Id: Text.pm,v 2.3 1999/10/07 09:41:57 eagle Exp $
#
# Copyright 1999 by Russ Allbery <rra@stanford.edu>
#
# This program is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#
-# This module may potentially be a replacement for Pod::Text, although it
-# does not (at the current time) attempt to match the output of Pod::Text
-# and makes several different formatting choices (mostly in the direction of
-# less markup). It uses Pod::Parser and is designed to be very easy to
-# subclass.
+# This module is intended to be a replacement for Pod::Text, and attempts to
+# match its output except for some specific circumstances where other
+# decisions seemed to produce better output. It uses Pod::Parser and is
+# designed to be very easy to subclass.
############################################################################
# Modules and declarations
require 5.004;
-use Carp qw(carp);
-use Pod::Parser ();
+use Carp qw(carp croak);
+use Exporter ();
+use Pod::Select ();
use strict;
-use vars qw(@ISA %ESCAPES $VERSION);
+use vars qw(@ISA @EXPORT %ESCAPES $VERSION);
-@ISA = qw(Pod::Parser);
+# We inherit from Pod::Select instead of Pod::Parser so that we can be used
+# by Pod::Usage.
+@ISA = qw(Pod::Select Exporter);
-$VERSION = '0.01';
+# We have to export pod2text for backward compatibility.
+@EXPORT = qw(pod2text);
+
+($VERSION = (split (' ', q$Revision: 2.3 $ ))[1]) =~ s/\.(\d)$/.0$1/;
############################################################################
############################################################################
# This table is taken near verbatim from Pod::PlainText in Pod::Parser,
-# which got it near verbatim from Pod::Text. It is therefore credited to
-# Tom Christiansen, and I'm glad I didn't have to write it. :)
+# which got it near verbatim from the original Pod::Text. It is therefore
+# credited to Tom Christiansen, and I'm glad I didn't have to write it. :)
%ESCAPES = (
'amp' => '&', # ampersand
'lt' => '<', # left chevron, less-than
$$self{sentence} = 0 unless defined $$self{sentence};
$$self{width} = 76 unless defined $$self{width};
- $$self{BEGUN} = []; # Stack of =begin blocks.
$$self{INDENTS} = []; # Stack of indentations.
$$self{MARGIN} = $$self{indent}; # Current left margin in spaces.
# Called for a regular text block. Gets the paragraph, the line number, and
# a Pod::Paragraph object. Perform interpolation and output the results.
sub textblock {
- my ($self, $text, $line) = @_;
+ my $self = shift;
return if $$self{EXCLUDE};
- local $_ = $text;
+ $self->output ($_[0]), return if $$self{VERBATIM};
+ local $_ = shift;
+ my $line = shift;
# Perform a little magic to collapse multiple L<> references. This is
- # here mostly for backwards-compatibility with Pod::Text. We'll just
- # rewrite the whole thing into actual text at this part, bypassing the
- # whole internal sequence parsing thing.
+ # here mostly for backwards-compatibility. We'll just rewrite the whole
+ # thing into actual text at this part, bypassing the whole internal
+ # sequence parsing thing.
s{
(
L< # A link of the form L</something>.
# Expand escapes into the actual character now, carping if invalid.
if ($command eq 'E') {
- return $ESCAPES{$_} if defined $ESCAPES{$_};
- carp "Unknown escape: E<$_>";
- return "E<$_>";
+ if (/^\d+$/) {
+ return chr;
+ } else {
+ return $ESCAPES{$_} if defined $ESCAPES{$_};
+ carp "Unknown escape: E<$_>";
+ return "E<$_>";
+ }
}
# For all the other sequences, empty content produces no output.
- return unless $_;
+ return if $_ eq '';
# For S<>, compress all internal whitespace and then map spaces to \01.
# When we output the text, we'll map this back.
my $self = shift;
local $_ = shift;
s/\s+$//;
+ $_ = $self->interpolate ($_, shift);
if ($$self{alt}) {
$self->output ("\n==== $_ ====\n\n");
} else {
my $self = shift;
local $_ = shift;
s/\s+$//;
+ $_ = $self->interpolate ($_, shift);
if ($$self{alt}) {
$self->output ("\n== $_ ==\n\n");
} else {
$$self{ITEM} = $self->interpolate ($_);
}
-# Begin a block for a particular translator. To allow for weird nested
-# =begin blocks, keep track of how many blocks we were excluded from and
-# only unwind one level with each =end.
+# Begin a block for a particular translator. Setting VERBATIM triggers
+# special handling in textblock().
sub cmd_begin {
my $self = shift;
local $_ = shift;
my ($kind) = /^(\S+)/ or return;
- push (@{ $$self{BEGUN} }, $kind);
- $$self{EXCLUDE}++ unless $kind eq 'text';
+ if ($kind eq 'text') {
+ $$self{VERBATIM} = 1;
+ } else {
+ $$self{EXCLUDE} = 1;
+ }
}
# End a block for a particular translator. We assume that all =begin/=end
-# pairs are properly nested and just pop the previous one.
+# pairs are properly closed.
sub cmd_end {
my $self = shift;
- my $kind = pop @{ $$self{BEGUN} };
- $$self{EXCLUDE}-- if $$self{EXCLUDE};
+ $$self{EXCLUDE} = 0;
+ $$self{VERBATIM} = 0;
}
# One paragraph for a particular translator. Ignore it unless it's intended
-# for text, in which case we treat it as either a normal text block or a
-# verbatim text block, depending on whether it's indented.
+# for text, in which case we treat it as a verbatim text block.
sub cmd_for {
my $self = shift;
local $_ = shift;
my $line = shift;
- return unless s/^text\b[ \t]*//;
- if (/^\n\s+/) {
- $self->verbatim ($_, $line);
- } else {
- $self->textblock ($_, $line);
- }
+ return unless s/^text\b[ \t]*\n?//;
+ $self->verbatim ($_, $line);
}
# The simple formatting ones. These are here mostly so that subclasses can
# override them and do more complicated things.
-sub seq_b { my $self = shift; return $$self{alt} ? "``$_[0]''" : $_[0] }
-sub seq_c { my $self = shift; return $$self{alt} ? "``$_[0]''" : "`$_[0]'" }
-sub seq_f { my $self = shift; return $$self{alt} ? "\"$_[0]\"" : $_[0] }
+sub seq_b { return $_[0]{alt} ? "``$_[1]''" : $_[1] }
+sub seq_c { return $_[0]{alt} ? "``$_[1]''" : "`$_[1]'" }
+sub seq_f { return $_[0]{alt} ? "\"$_[1]\"" : $_[1] }
sub seq_i { return '*' . $_[1] . '*' }
# The complicated one. Handle links. Since this is plain text, we can't
# Okay, leading and trailing whitespace isn't important; get rid of it.
s/^\s+//;
s/\s+$//;
- chomp;
# Default to using the whole content of the link entry as a section
# name. Note that L<manpage/> forces a manpage interpretation, as does
my $space = ' ' x $indent;
$space =~ s/^ /:/ if $$self{alt};
if (!$_ || /^\s+$/ || ($$self{MARGIN} - $indent < length ($tag) + 1)) {
- $self->output ($space . $tag . "\n");
+ my $margin = $$self{MARGIN};
+ $$self{MARGIN} = $indent;
+ my $output = $self->reformat ($tag);
+ $output =~ s/\n*$/\n/;
+ $self->output ($output);
+ $$self{MARGIN} = $margin;
$self->output ($self->reformat ($_)) if /\S/;
} else {
$_ = $self->reformat ($_);
############################################################################
+# Backwards compatibility
+############################################################################
+
+# The old Pod::Text module did everything in a pod2text() function. This
+# tries to provide the same interface for legacy applications.
+sub pod2text {
+ my @args;
+
+ # This is really ugly; I hate doing option parsing in the middle of a
+ # module. But the old Pod::Text module supported passing flags to its
+ # entry function, so handle -a and -<number>.
+ while ($_[0] =~ /^-/) {
+ my $flag = shift;
+ if ($flag eq '-a') { push (@args, alt => 1) }
+ elsif ($flag =~ /^-(\d+)$/) { push (@args, width => $1) }
+ else {
+ unshift (@_, $flag);
+ last;
+ }
+ }
+
+ # Now that we know what arguments we're using, create the parser.
+ my $parser = Pod::Text->new (@args);
+
+ # If two arguments were given, the second argument is going to be a file
+ # handle. That means we want to call parse_from_filehandle(), which
+ # means we need to turn the first argument into a file handle. Magic
+ # open will handle the <&STDIN case automagically.
+ if (defined $_[1]) {
+ local *IN;
+ unless (open (IN, $_[0])) {
+ croak ("Can't open $_[0] for reading: $!\n");
+ return;
+ }
+ $_[0] = \*IN;
+ return $parser->parse_from_filehandle (@_);
+ } else {
+ return $parser->parse_from_file (@_);
+ }
+}
+
+
+############################################################################
# Module return value and documentation
############################################################################
=head1 DESCRIPTION
-Pod::Text is a module that can convert documentation in the POD format
-(such as can be found throughout the Perl distribution) into formatted
-ASCII. It uses no special formatting controls or codes whatsoever, and its
-output is therefore suitable for nearly any device.
+Pod::Text is a module that can convert documentation in the POD format (the
+preferred language for documenting Perl) into formatted ASCII. It uses no
+special formatting controls or codes whatsoever, and its output is therefore
+suitable for nearly any device.
-As a derived class from Pod::Parser, Pod::Text supports the same
-methods and interfaces. See L<Pod::Parser> for all the details; briefly,
-one creates a new parser with C<Pod::Text-E<gt>new()> and then calls
-either C<parse_from_filehandle()> or C<parse_from_file()>.
+As a derived class from Pod::Parser, Pod::Text supports the same methods and
+interfaces. See L<Pod::Parser> for all the details; briefly, one creates a
+new parser with C<Pod::Text-E<gt>new()> and then calls either
+parse_from_filehandle() or parse_from_file().
-C<new()> can take options, in the form of key/value pairs, that control the
+new() can take options, in the form of key/value pairs, that control the
behavior of the parser. The currently recognized options are:
=over 4
=item sentence
-If set to a true value, Pod::Text will assume that each sentence ends
-in two spaces, and will try to preserve that spacing. If set to false, all
+If set to a true value, Pod::Text will assume that each sentence ends in two
+spaces, and will try to preserve that spacing. If set to false, all
consecutive whitespace in non-verbatim paragraphs is compressed into a
single space. Defaults to true.
=back
-The standard Pod::Parser method C<parse_from_filehandle()> takes up to two
+The standard Pod::Parser method parse_from_filehandle() takes up to two
arguments, the first being the file handle to read POD from and the second
being the file handle to write the formatted output to. The first defaults
to STDIN if not given, and the second defaults to STDOUT. The method
-C<parse_from_file()> is almost identical, except that its two arguments are
-the input and output disk files instead. See L<Pod::Parser> for the
-specific details.
+parse_from_file() is almost identical, except that its two arguments are the
+input and output disk files instead. See L<Pod::Parser> for the specific
+details.
=head1 DIAGNOSTICS
=over 4
+=item Bizarre space in item
+
+(W) Something has gone wrong in internal C<=item> processing. This message
+indicates a bug in Pod::Text; you should never see it.
+
+=item Can't open %s for reading: %s
+
+(F) Pod::Text was invoked via the compatibility mode pod2text() interface
+and the input file it was given could not be opened.
+
=item Unknown escape: %s
-The POD source contained an C<EE<lt>E<gt>> escape that Pod::Text
-didn't know about.
+(W) The POD source contained an C<EE<lt>E<gt>> escape that Pod::Text didn't
+know about.
=item Unknown sequence: %s
-The POD source contained a non-standard internal sequence (something of the
-form C<XE<lt>E<gt>>) that Pod::Text didn't know about.
+(W) The POD source contained a non-standard internal sequence (something of
+the form C<XE<lt>E<gt>>) that Pod::Text didn't know about.
=item Unmatched =back
-Pod::Text encountered a C<=back> command that didn't correspond to an
+(W) Pod::Text encountered a C<=back> command that didn't correspond to an
C<=over> command.
=back
+=head1 RESTRICTIONS
+
+Embedded Ctrl-As (octal 001) in the input will be mapped to spaces on
+output, due to an internal implementation detail.
+
=head1 NOTES
-I'm hoping this module will eventually replace Pod::Text in Perl core once
-Pod::Parser has been added to Perl core. Accordingly, don't be surprised if
-the name of this module changes to Pod::Text down the road.
+This is a replacement for an earlier Pod::Text module written by Tom
+Christiansen. It has a revamped interface, since it now uses Pod::Parser,
+but an interface roughly compatible with the old Pod::Text::pod2text()
+function is still available. Please change to the new calling convention,
+though.
The original Pod::Text contained code to do formatting via termcap
sequences, although it wasn't turned on by default and it was problematic to
-get it to work at all. This module doesn't even try to do that, but a
-subclass of it does. Look for Pod::Text::Termcap.
+get it to work at all. This rewrite doesn't even try to do that, but a
+subclass of it does. Look for L<Pod::Text::Termcap|Pod::Text::Termcap>.
=head1 SEE ALSO
-L<Pod::Parser|Pod::Parser>, L<Pod::Text::Termcap|Pod::Text::Termcap>
+L<Pod::Parser|Pod::Parser>, L<Pod::Text::Termcap|Pod::Text::Termcap>,
+pod2text(1)
=head1 AUTHOR
# Pod::Text::Color -- Convert POD data to formatted color ASCII text
-# $Id: Color.pm,v 0.1 1999/06/13 02:41:06 eagle Exp $
+# $Id: Color.pm,v 0.5 1999/09/20 10:15:16 eagle Exp $
#
# Copyright 1999 by Russ Allbery <rra@stanford.edu>
#
@ISA = qw(Pod::Text);
# Use the CVS revision of this file as its version number.
-($VERSION = (split (' ', q$Revision: 0.1 $ ))[1]) =~ s/\.(\d)$/.0$1/;
+($VERSION = (split (' ', q$Revision: 0.5 $ ))[1]) =~ s/\.(\d)$/.0$1/;
############################################################################
=head1 DESCRIPTION
-Pod::Text::Color is a simple subclass of Pod::Text that highlights
-output text using ANSI color escape sequences. Apart from the color, it in
-all ways functions like Pod::Text. See L<Pod::Text> for details
-and available options.
+Pod::Text::Color is a simple subclass of Pod::Text that highlights output
+text using ANSI color escape sequences. Apart from the color, it in all
+ways functions like Pod::Text. See L<Pod::Text> for details and available
+options.
+
+Term::ANSIColor is used to get colors and therefore must be installed to use
+this module.
+
+=head1 BUGS
+
+This is just a basic proof of concept. It should be seriously expanded to
+support configurable coloration via options passed to the constructor, and
+B<pod2text> should be taught about those.
=head1 SEE ALSO
# Pod::Text::Termcap -- Convert POD data to ASCII text with format escapes.
-# $Id: Termcap.pm,v 0.1 1999/06/13 02:41:06 eagle Exp $
+# $Id: Termcap.pm,v 0.4 1999/09/20 10:17:45 eagle Exp $
#
# Copyright 1999 by Russ Allbery <rra@stanford.edu>
#
# This program is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#
-# This is a simple subclass of Pod::Text that overrides a few key
-# methods to output the right termcap escape sequences for formatted text
-# on the current terminal type.
+# This is a simple subclass of Pod::Text that overrides a few key methods to
+# output the right termcap escape sequences for formatted text on the
+# current terminal type.
############################################################################
# Modules and declarations
use Pod::Text ();
use POSIX ();
use Term::Cap;
+
use strict;
use vars qw(@ISA $VERSION);
@ISA = qw(Pod::Text);
# Use the CVS revision of this file as its version number.
-($VERSION = (split (' ', q$Revision: 0.1 $ ))[1]) =~ s/\.(\d)$/.0$1/;
+($VERSION = (split (' ', q$Revision: 0.4 $ ))[1]) =~ s/\.(\d)$/.0$1/;
############################################################################
=head1 DESCRIPTION
-Pod::Text::Termcap is a simple subclass of Pod::Text that highlights
-output text using the correct termcap escape sequences for the current
-terminal. Apart from the format codes, it in all ways functions like
-Pod::Text. See L<Pod::Text> for details and available options.
+Pod::Text::Termcap is a simple subclass of Pod::Text that highlights output
+text using the correct termcap escape sequences for the current terminal.
+Apart from the format codes, it in all ways functions like Pod::Text. See
+L<Pod::Text> for details and available options.
=head1 SEE ALSO
#############################################################################
# Pod/Usage.pm -- print usage messages for the running script.
#
-# Based on Tom Christiansen's Pod::Text::pod2text() function
-# (with modifications).
-#
-# Copyright (C) 1994-1999 Tom Christiansen. All rights reserved.
+# Copyright (C) 1996-1999 by Bradford Appleton. All rights reserved.
# This file is part of "PodParser". PodParser is free software;
# you can redistribute it and/or modify it under the same terms
# as Perl itself.
package Pod::Usage;
use vars qw($VERSION);
-$VERSION = 1.081; ## Current version of this package
+$VERSION = 1.090; ## Current version of this package
require 5.004; ## requires this Perl version or later
=head1 NAME
#use diagnostics;
use Carp;
use Exporter;
-use Pod::PlainText;
use File::Spec;
use vars qw(@ISA @EXPORT);
-@ISA = qw(Pod::PlainText);
@EXPORT = qw(&pod2usage);
+BEGIN {
+ if ( $] >= 5.005_58 ) {
+ require Pod::Text;
+ @ISA = qw( Pod::Text );
+ }
+ else {
+ require Pod::PlainText;
+ @ISA = qw( Pod::PlainText );
+ }
+}
+
##---------------------------------------------------------------------------
chomp($host = `hostname 2> NUL`) unless defined $host;
return $host;
}
+ elsif ($^O eq 'epoc') {
+ $host = 'localhost';
+ return $host;
+ }
else { # Unix
# method 2 - syscall is preferred since it avoids tainting problems
@EXPORT = qw(expand unexpand $tabstop);
use vars qw($VERSION $tabstop $debug);
-$VERSION = 96.121201;
+$VERSION = 98.112801;
use strict;
sub expand
{
- my @l = @_;
+ my (@l) = @_;
for $_ (@l) {
1 while s/(^|\n)([^\t\n]*)(\t+)/
$1. $2 . (" " x
sub unexpand
{
- my @l = @_;
+ my (@l) = @_;
my @e;
my $x;
my $line;
package Tie::Array;
use vars qw($VERSION);
use strict;
-$VERSION = '1.00';
+use Carp;
+$VERSION = '1.01';
# Pod documentation after __END__ below.
return @result;
}
+sub EXISTS {
+ my $pkg = ref $_[0];
+ croak "$pkg dosn't define an EXISTS method";
+}
+
+sub DELETE {
+ my $pkg = ref $_[0];
+ croak "$pkg dosn't define a DELETE method";
+}
+
package Tie::StdArray;
use vars qw(@ISA);
@ISA = 'Tie::Array';
sub PUSH { my $o = shift; push(@$o,@_) }
sub SHIFT { shift(@{$_[0]}) }
sub UNSHIFT { my $o = shift; unshift(@$o,@_) }
+sub EXISTS { exists $_[0]->[$_[1]] }
+sub DELETE { delete $_[0]->[$_[1]] }
sub SPLICE
{
sub STORE { ... } # mandatory if elements writeable
sub STORESIZE { ... } # mandatory if elements can be added/deleted
+ sub EXISTS { ... } # mandatory if exists() expected to work
+ sub DELETE { ... } # mandatory if delete() expected to work
# optional methods - for efficiency
sub CLEAR { ... }
This module provides methods for array-tying classes. See
L<perltie> for a list of the functions required in order to tie an array
-to a package. The basic B<Tie::Array> package provides stub C<DELETE>
-and C<EXTEND> methods, and implementations of C<PUSH>, C<POP>, C<SHIFT>,
-C<UNSHIFT>, C<SPLICE> and C<CLEAR> in terms of basic C<FETCH>, C<STORE>,
+to a package. The basic B<Tie::Array> package provides stub C<DESTROY>,
+and C<EXTEND> methods that do nothing, stub C<DELETE> and C<EXISTS>
+methods that croak() if the delete() or exists() builtins are ever called
+on the tied array, and implementations of C<PUSH>, C<POP>, C<SHIFT>,
+C<UNSHIFT>, C<SPLICE> and C<CLEAR> in terms of basic C<FETCH>, C<STORE>,
C<FETCHSIZE>, C<STORESIZE>.
The B<Tie::StdArray> package provides efficient methods required for tied arrays
Informative call that array is likely to grow to have I<count> entries.
Can be used to optimize allocation. This method need do nothing.
+=item EXISTS this, key
+
+Verify that the element at index I<key> exists in the tied array I<this>.
+
+The B<Tie::Array> implementation is a stub that simply croaks.
+
+=item DELETE this, key
+
+Delete the element at index I<key> from the tied array I<this>.
+
+The B<Tie::Array> implementation is a stub that simply croaks.
+
=item CLEAR this
Clear (remove, delete, ...) all values from the tied array associated with
Verify that I<key> exists with the tied hash I<this>.
+The B<Tie::Hash> implementation is a stub that simply croaks.
+
=item DELETE this, key
Delete the key I<key> from the tied hash I<this>.
require Exporter;
use Carp;
-@ISA = qw(Exporter);
-@EXPORT = qw(timegm timelocal);
+@ISA = qw( Exporter );
+@EXPORT = qw( timegm timelocal );
+@EXPORT_OK = qw( timegm_nocheck timelocal_nocheck );
# Set up constants
$SEC = 1;
$breakpoint = ($thisYear + 50) % 100;
$nextCentury += 100 if $breakpoint < 50;
+my %options;
+
sub timegm {
my (@date) = @_;
if ($date[5] > 999) {
+ ($date[3]-1) * $DAY;
}
+sub timegm_nocheck {
+ local $options{no_range_check} = 1;
+ &timegm;
+}
+
sub timelocal {
my $t = &timegm;
my $tt = $t;
if ($t < $DAY and ($lt[5] >= 70 or $gt[5] >= 70 )) {
# Wrap error, too early a date
# Try a safer date
- $tt = $DAY;
+ $tt += $DAY;
@lt = localtime($tt);
@gt = gmtime($tt);
}
my $tzsec = ($gt[1] - $lt[1]) * $MIN + ($gt[2] - $lt[2]) * $HR;
- my($lday,$gday) = ($lt[7],$gt[7]);
if($lt[5] > $gt[5]) {
$tzsec -= $DAY;
}
$time;
}
+sub timelocal_nocheck {
+ local $options{no_range_check} = 1;
+ &timelocal;
+}
+
sub cheat {
$year = $_[5];
$month = $_[4];
- croak "Month '$month' out of range 0..11" if $month > 11 || $month < 0;
- croak "Day '$_[3]' out of range 1..31" if $_[3] > 31 || $_[3] < 1;
- croak "Hour '$_[2]' out of range 0..23" if $_[2] > 23 || $_[2] < 0;
- croak "Minute '$_[1]' out of range 0..59" if $_[1] > 59 || $_[1] < 0;
- croak "Second '$_[0]' out of range 0..59" if $_[0] > 59 || $_[0] < 0;
+ unless ($options{no_range_check}) {
+ croak "Month '$month' out of range 0..11" if $month > 11 || $month < 0;
+ croak "Day '$_[3]' out of range 1..31" if $_[3] > 31 || $_[3] < 1;
+ croak "Hour '$_[2]' out of range 0..23" if $_[2] > 23 || $_[2] < 0;
+ croak "Minute '$_[1]' out of range 0..59" if $_[1] > 59 || $_[1] < 0;
+ croak "Second '$_[0]' out of range 0..59" if $_[0] > 59 || $_[0] < 0;
+ }
$guess = $^T;
@g = gmtime($guess);
$lastguess = "";
the range 1..31, the month should be in the range 0..11.
This is consistent with the values returned from localtime() and gmtime().
+The timelocal() and timegm() functions perform range checking on the
+input $sec, $min, $hours, $mday, and $mon values by default. If you'd
+rather they didn't, you can explicitly import the timelocal_nocheck()
+and timegm_nocheck() functions.
+
+ use Time::Local 'timelocal_nocheck';
+
+ {
+ # The 365th day of 1999
+ print scalar localtime timelocal_nocheck 0,0,0,365,0,99;
+
+ # The twenty thousandth day since 1970
+ print scalar localtime timelocal_nocheck 0,0,0,20000,0,70;
+
+ # And even the 10,000,000th second since 1999!
+ print scalar localtime timelocal_nocheck 10000000,0,0,1,0,99;
+ }
+
+Your mileage may vary when trying these with minutes and hours,
+and it doesn't work at all for months.
+
Strictly speaking, the year should also be specified in a form consistent
with localtime(), i.e. the offset from 1900.
In order to make the interpretation of the year easier for humans,
package attributes;
-$VERSION = 0.01;
+$VERSION = 0.02;
-#@EXPORT_OK = qw(get reftype);
-#@EXPORT = ();
+@EXPORT_OK = qw(get reftype);
+@EXPORT = ();
+%EXPORT_TAGS = (ALL => [@EXPORT, @EXPORT_OK]);
use strict;
BEGIN { bootstrap }
sub import {
- @_ > 2 && ref $_[2] or
- croak 'Usage: use '.__PACKAGE__.' $home_stash, $ref, @attrlist';
+ @_ > 2 && ref $_[2] or do {
+ require Exporter;
+ goto &Exporter::import;
+ };
my (undef,$home_stash,$svref,@attrs) = @_;
my $svtype = uc reftype($svref);
;
}
-#sub export {
-# require Exporter;
-# goto &Exporter::import;
-#}
-#
-#sub require_version { goto &UNIVERSAL::VERSION }
+sub require_version { goto &UNIVERSAL::VERSION }
1;
__END__
use attributes (); # optional, to get subroutine declarations
my @attrlist = attributes::get(\&foo);
+ use attributes 'get'; # import the attributes::get subroutine
+ my @attrlist = get \&foo;
+
=head1 DESCRIPTION
Subroutine declarations and definitions may optionally have attribute lists
associated with them. (Variable C<my> declarations also may, but see the
warning below.) Perl handles these declarations by passing some information
about the call site and the thing being declared along with the attribute
-list to this module. In particular, first example above is equivalent to
+list to this module. In particular, the first example above is equivalent to
the following:
use attributes __PACKAGE__, \&foo, 'method';
to raise a fatal exception. If it can find an appropriate package name
for a class method lookup, it will include the results from a
C<FETCH_I<type>_ATTRIBUTES> call in its return list, as described in
-L"Package-specific Attribute Handling"> below.
+L<"Package-specific Attribute Handling"> below.
Otherwise, only L<built-in attributes|"Built-in Attributes"> will be returned.
=item reftype
variable. It returns the built-in type of the referenced variable,
ignoring any package into which it might have been blessed.
This can be useful for determining the I<type> value which forms part of
-the method names described in L"Package-specific Attribute Handling"> below.
+the method names described in L<"Package-specific Attribute Handling"> below.
=back
-Note that these routines are I<not> exported. This is primarily because
-the C<use> mechanism which would normally import them is already in use
-by Perl itself to implement the C<sub : attributes> syntax.
+Note that these routines are I<not> exported by default.
=head2 Package-specific Attribute Handling
Y2::north # "Y2::north" not a simple identifier
foo + bar # "+" neither a comma nor whitespace
+=head1 EXPORTS
+
+=head2 Default exports
+
+None.
+
+=head2 Available exports
+
+The routines C<get> and C<reftype> are exportable.
+
+=head2 Export tags defined
+
+The C<:ALL> tag will get all of the above exports.
+
=head1 EXAMPLES
Here are some samples of syntactically valid declarations, with annotation
sub main'fneg { #(fnum_str) return fnum_str
local($_) = &'fnorm($_[$[]);
vec($_,0,8) ^= ord('+') ^ ord('-') unless $_ eq '+0E+0'; # flip sign
- s/^H/N/;
+ if ( ord("\t") == 9 ) { # ascii
+ s/^H/N/;
+ }
+ else { # ebcdic character set
+ s/\373/N/;
+ }
$_;
}
--- /dev/null
+package byte;
+
+sub import {
+ $^H |= 0x00000010;
+}
+
+sub unimport {
+ $^H &= ~0x00000010;
+}
+
+sub AUTOLOAD {
+ require "byte_heavy.pl";
+ goto &$AUTOLOAD;
+}
+
+sub length ($);
+
+1;
+__END__
+
+=head1 NAME
+
+byte - Perl pragma to turn force treating strings as bytes not UNICODE
+
+=head1 SYNOPSIS
+
+ use byte;
+ no byte;
+
+=head1 DESCRIPTION
+
+
+=cut
--- /dev/null
+package byte;
+
+sub length ($)
+{
+ return CORE::length($_[0]);
+}
+
+1;
package constant;
-$VERSION = '1.00';
+use strict;
+use vars qw( $VERSION %declared );
+$VERSION = '1.01';
+
+#=======================================================================
+
+require 5.005_62;
+
+# Some names are evil choices.
+my %keywords = map +($_, 1), qw{ BEGIN INIT STOP END DESTROY AUTOLOAD };
+
+my %forced_into_main = map +($_, 1),
+ qw{ STDIN STDOUT STDERR ARGV ARGVOUT ENV INC SIG };
+
+my %forbidden = (%keywords, %forced_into_main);
+
+#=======================================================================
+# import() - import symbols into user's namespace
+#
+# What we actually do is define a function in the caller's namespace
+# which returns the value. The function we create will normally
+# be inlined as a constant, thereby avoiding further sub calling
+# overhead.
+#=======================================================================
+sub import {
+ my $class = shift;
+ return unless @_; # Ignore 'use constant;'
+ my $name = shift;
+ unless (defined $name) {
+ require Carp;
+ Carp::croak("Can't use undef as constant name");
+ }
+ my $pkg = caller;
+
+ # Normal constant name
+ if ($name =~ /^(?:[A-Z]\w|_[A-Z])\w*\z/ and !$forbidden{$name}) {
+ # Everything is okay
+
+ # Name forced into main, but we're not in main. Fatal.
+ } elsif ($forced_into_main{$name} and $pkg ne 'main') {
+ require Carp;
+ Carp::croak("Constant name '$name' is forced into main::");
+
+ # Starts with double underscore. Fatal.
+ } elsif ($name =~ /^__/) {
+ require Carp;
+ Carp::croak("Constant name '$name' begins with '__'");
+
+ # Maybe the name is tolerable
+ } elsif ($name =~ /^[A-Za-z_]\w*\z/) {
+ # Then we'll warn only if you've asked for warnings
+ if ($^W) {
+ require Carp;
+ if ($keywords{$name}) {
+ Carp::carp("Constant name '$name' is a Perl keyword");
+ } elsif ($forced_into_main{$name}) {
+ Carp::carp("Constant name '$name' is " .
+ "forced into package main::");
+ } elsif (1 == length $name) {
+ Carp::carp("Constant name '$name' is too short");
+ } elsif ($name =~ /^_?[a-z\d]/) {
+ Carp::carp("Constant name '$name' should " .
+ "have an initial capital letter");
+ } else {
+ # Catch-all - what did I miss? If you get this error,
+ # please let me know what your constant's name was.
+ # Write to <rootbeer@redcat.com>. Thanks!
+ Carp::carp("Constant name '$name' has unknown problems");
+ }
+ }
+
+ # Looks like a boolean
+ # use constant FRED == fred;
+ } elsif ($name =~ /^[01]?\z/) {
+ require Carp;
+ if (@_) {
+ Carp::croak("Constant name '$name' is invalid");
+ } else {
+ Carp::croak("Constant name looks like boolean value");
+ }
+
+ } else {
+ # Must have bad characters
+ require Carp;
+ Carp::croak("Constant name '$name' has invalid characters");
+ }
+
+ {
+ no strict 'refs';
+ my $full_name = "${pkg}::$name";
+ $declared{$full_name}++;
+ if (@_ == 1) {
+ my $scalar = $_[0];
+ *$full_name = sub () { $scalar };
+ } elsif (@_) {
+ my @list = @_;
+ *$full_name = sub () { @list };
+ } else {
+ *$full_name = sub () { };
+ }
+ }
+
+}
+
+1;
+
+__END__
=head1 NAME
print "This line does nothing" unless DEBUGGING;
- # references can be declared constant
+ # references can be constants
use constant CHASH => { foo => 42 };
use constant CARRAY => [ 1,2,3,4 ];
use constant CPSEUDOHASH => [ { foo => 1}, 42 ];
print CARRAY->[$i];
print CPSEUDOHASH->{foo};
print CCODE->("me");
- print CHASH->[10]; # compile-time error
+ print CHASH->[10]; # compile-time error
=head1 DESCRIPTION
The use of all caps for constant names is merely a convention,
although it is recommended in order to make constants stand out
and to help avoid collisions with other barewords, keywords, and
-subroutine names. Constant names must begin with a letter.
+subroutine names. Constant names must begin with a letter or
+underscore. Names beginning with a double underscore are reserved. Some
+poor choices for names will generate warnings, if warnings are enabled at
+compile time.
Constant symbols are package scoped (rather than block scoped, as
C<use strict> is). That is, you can refer to a constant from package
print E2BIG, "\n"; # something like "Arg list too long"
print 0+E2BIG, "\n"; # "7"
-Errors in dereferencing constant references are trapped at compile-time.
+Dereferencing constant references incorrectly (such as using an array
+subscript on a constant hash reference, or vice versa) will be trapped at
+compile time.
+
+In the rare case in which you need to discover at run time whether a
+particular constant has been declared via this module, you may use
+this function to examine the hash C<%constant::declared>. If the given
+constant name does not include a package name, the current package is
+used.
+
+ sub declared ($) {
+ use constant 1.01; # don't omit this!
+ my $name = shift;
+ $name =~ s/^::/main::/;
+ my $pkg = caller;
+ my $full_name = $name =~ /::/ ? $name : "${pkg}::$name";
+ $constant::declared{$full_name};
+ }
=head1 TECHNICAL NOTE
and some symbols may be redefined without generating a warning.
It is not possible to have a subroutine or keyword with the same
-name as a constant. This is probably a Good Thing.
+name as a constant in the same package. This is probably a Good Thing.
+
+A constant with a name in the list C<STDIN STDOUT STDERR ARGV ARGVOUT
+ENV INC SIG> is not allowed anywhere but in package C<main::>, for
+technical reasons.
+
+Even though a reference may be declared as a constant, the reference may
+point to data which may be changed, as this code shows.
+
+ use constant CARRAY => [ 1,2,3,4 ];
+ print CARRAY->[1];
+ CARRAY->[1] = " be changed";
+ print CARRAY->[1];
Unlike constants in some languages, these cannot be overridden
on the command line or via environment variables.
be interpreted as a string. Use C<$hash{CONSTANT()}> or
C<$hash{+CONSTANT}> to prevent the bareword quoting mechanism from
kicking in. Similarly, since the C<=E<gt>> operator quotes a bareword
-immediately to its left you have to say C<CONSTANT() =E<gt> 'value'>
-instead of C<CONSTANT =E<gt> 'value'>.
+immediately to its left, you have to say C<CONSTANT() =E<gt> 'value'>
+(or simply use a comma in place of the big arrow) instead of
+C<CONSTANT =E<gt> 'value'>.
=head1 AUTHOR
-Tom Phoenix, E<lt>F<rootbeer@teleport.com>E<gt>, with help from
+Tom Phoenix, E<lt>F<rootbeer@redcat.com>E<gt>, with help from
many other folks.
=head1 COPYRIGHT
-Copyright (C) 1997, Tom Phoenix
+Copyright (C) 1997, 1999 Tom Phoenix
This module is free software; you can redistribute it or modify it
under the same terms as Perl itself.
=cut
-
-use strict;
-use Carp;
-use vars qw($VERSION);
-
-#=======================================================================
-
-# Some of this stuff didn't work in version 5.003, alas.
-require 5.003_96;
-
-#=======================================================================
-# import() - import symbols into user's namespace
-#
-# What we actually do is define a function in the caller's namespace
-# which returns the value. The function we create will normally
-# be inlined as a constant, thereby avoiding further sub calling
-# overhead.
-#=======================================================================
-sub import {
- my $class = shift;
- my $name = shift or return; # Ignore 'use constant;'
- croak qq{Can't define "$name" as constant} .
- qq{ (name contains invalid characters or is empty)}
- unless $name =~ /^[^\W_0-9]\w*$/;
-
- my $pkg = caller;
- {
- no strict 'refs';
- if (@_ == 1) {
- my $scalar = $_[0];
- *{"${pkg}::$name"} = sub () { $scalar };
- } elsif (@_) {
- my @list = @_;
- *{"${pkg}::$name"} = sub () { @list };
- } else {
- *{"${pkg}::$name"} = sub () { };
- }
- }
-
-}
-
-1;
=cut
-require 5.001;
+require 5.005_64;
use Carp;
+$VERSION = v1.0;
+
use Config;
($privlib, $archlib) = @Config{qw(privlibexp archlibexp)};
if ($^O eq 'VMS') {
$privlib = VMS::Filespec::unixify($privlib);
$archlib = VMS::Filespec::unixify($archlib);
}
-@trypod = ("$archlib/pod/perldiag.pod",
- "$privlib/pod/perldiag-$].pod",
- "$privlib/pod/perldiag.pod");
+@trypod = (
+ "$archlib/pod/perldiag.pod",
+ "$privlib/pod/perldiag-$Config{version}.pod",
+ "$privlib/pod/perldiag.pod",
+ "$archlib/pods/perldiag.pod",
+ "$privlib/pods/perldiag-$Config{version}.pod",
+ "$privlib/pods/perldiag.pod",
+ );
# handy for development testing of new warnings etc
unshift @trypod, "./pod/perldiag.pod" if -e "pod/perldiag.pod";
($PODFILE) = ((grep { -e } @trypod), $trypod[$#trypod])[0];
# strip formatting directives in =item line
($header = $1) =~ s/[A-Z]<(.*?)>/$1/g;
- if ($header =~ /%[sd]/) {
+ if ($header =~ /%[csd]/) {
$rhs = $lhs = $header;
#if ($lhs =~ s/(.*?)%d(?!%d)(.*)/\Q$1\E\\d+\Q$2\E\$/g) {
if ($lhs =~ s/(.*?)%d(?!%d)(.*)/\Q$1\E\\d+\Q$2\E/g) {
$lhs =~ s/\377//g;
$lhs =~ s/\.\*\?$/.*/; # Allow %s at the end to eat it all
}
+ $lhs =~ s/\\%c/./g;
$transmo .= " s{^$lhs}\n {\Q$rhs\E}s\n\t&& return 1;\n";
} else {
$transmo .= " m{^\Q$header\E} && return 1;\n";
}
exit;
} else {
- $old_w = 0; $oldwarn = ''; $olddie = '';
+ #$old_w = 0;
+ $oldwarn = ''; $olddie = '';
}
sub import {
use Config;
my $archname = $Config{'archname'};
+my $ver = $Config{'version'};
@ORIG_INC = @INC; # take a handy copy of 'original' value
sub import {
shift;
+
+ my %names;
foreach (reverse @_) {
- ## Ignore this if not defined.
- next unless defined($_);
if ($_ eq '') {
require Carp;
Carp::carp("Empty compile time value given to use lib");
- # at foo.pl line ...
}
if (-e && ! -d _) {
require Carp;
# looks like $_ has an archlib directory below it.
if (-d "$_/$archname") {
unshift(@INC, "$_/$archname") if -d "$_/$archname/auto";
- unshift(@INC, "$_/$archname/$]") if -d "$_/$archname/$]/auto";
+ unshift(@INC, "$_/$archname/$ver") if -d "$_/$archname/$ver/auto";
}
}
+
+ # remove trailing duplicates
+ @INC = grep { ++$names{$_} == 1 } @INC;
+ return;
}
sub unimport {
shift;
- my $mode = shift if $_[0] =~ m/^:[A-Z]+/;
my %names;
- foreach(@_) {
+ foreach (@_) {
++$names{$_};
++$names{"$_/$archname"} if -d "$_/$archname/auto";
}
- if ($mode and $mode eq ':ALL') {
- # Remove ALL instances of each named directory.
- @INC = grep { !exists $names{$_} } @INC;
- } else {
- # Remove INITIAL instance(s) of each named directory.
- @INC = grep { --$names{$_} < 0 } @INC;
- }
+ # Remove ALL instances of each named directory.
+ @INC = grep { !exists $names{$_} } @INC;
+ return;
}
1;
that later C<use> or C<require> statements will find modules which are
not located on perl's default search path.
-=head2 ADDING DIRECTORIES TO @INC
+=head2 Adding directories to @INC
The parameters to C<use lib> are added to the start of the perl search
path. Saying
If so the $dir/$archname directory is assumed to be a corresponding
architecture specific directory and is added to @INC in front of $dir.
-If LIST includes both $dir and $dir/$archname then $dir/$archname will
-be added to @INC twice (if $dir/$archname/auto exists).
+To avoid memory leaks, all trailing duplicate entries in @INC are
+removed.
-=head2 DELETING DIRECTORIES FROM @INC
+=head2 Deleting directories from @INC
You should normally only add directories to @INC. If you need to
delete directories from @INC take care to only delete those which you
in your script. Other modules may have added directories which they
need for correct operation.
-By default the C<no lib> statement deletes the I<first> instance of
-each named directory from @INC. To delete multiple instances of the
-same name from @INC you can specify the name multiple times.
-
-To delete I<all> instances of I<all> the specified names from @INC you can
-specify ':ALL' as the first parameter of C<no lib>. For example:
-
- no lib qw(:ALL .);
+The C<no lib> statement deletes all instances of each named directory
+from @INC.
For each directory in LIST (called $dir here) the lib module also
checks to see if a directory called $dir/$archname/auto exists.
If so the $dir/$archname directory is assumed to be a corresponding
architecture specific directory and is also deleted from @INC.
-If LIST includes both $dir and $dir/$archname then $dir/$archname will
-be deleted from @INC twice (if $dir/$archname/auto exists).
-
-=head2 RESTORING ORIGINAL @INC
+=head2 Restoring original @INC
When the lib module is first loaded it records the current value of @INC
in an array C<@lib::ORIG_INC>. To restore @INC to that value you
Tim Bunce, 2nd June 1995.
=cut
-
# Debugger for Perl 5.00x; perl5db.pl patch level:
-$VERSION = 1.0403;
+$VERSION = 1.04041;
$header = "perl5db.pl version $VERSION";
# Enhanced by ilya@math.ohio-state.edu (Ilya Zakharevich)
# LineInfo - file or pipe to print line number info to. If it is a
# pipe, a short "emacs like" message is used.
#
+# RemotePort - host:port to connect to on remote host for remote debugging.
+#
# Example $rcfile: (delete leading hashes!)
#
# &parse_options("NonStop=1 LineInfo=db.out");
TTY noTTY ReadLine NonStop LineInfo maxTraceLen
recallCommand ShellBang pager tkRunning ornaments
signalLevel warnLevel dieLevel inhibit_exit
- ImmediateStop bareStringify);
+ ImmediateStop bareStringify
+ RemotePort);
%optionVars = (
hashDepth => \$dumpvar::hashDepth,
inhibit_exit => \$inhibit_exit,
maxTraceLen => \$maxtrace,
ImmediateStop => \$ImmediateStop,
+ RemotePort => \$remoteport,
);
%optionAction = (
dieLevel => \&dieLevel,
tkRunning => \&tkRunning,
ornaments => \&ornaments,
+ RemotePort => \&RemotePort,
);
%optionRequire = (
#require Term::ReadLine;
- if ($^O =~ /cygwin/) {
+ if ($^O eq 'cygwin') {
# /dev/tty is binary. use stdin for textmode
undef $console;
} elsif (-e "/dev/tty") {
$console = $tty if defined $tty;
- if (defined $console) {
- open(IN,"+<$console") || open(IN,"<$console") || open(IN,"<&STDIN");
- open(OUT,"+>$console") || open(OUT,">$console") || open(OUT,">&STDERR")
- || open(OUT,">&STDOUT"); # so we don't dongle stdout
- } else {
- open(IN,"<&STDIN");
- open(OUT,">&STDERR") || open(OUT,">&STDOUT"); # so we don't dongle stdout
- $console = 'STDIN/OUT';
+ if (defined $remoteport) {
+ require IO::Socket;
+ $OUT = new IO::Socket::INET( Timeout => '10',
+ PeerAddr => $remoteport,
+ Proto => 'tcp',
+ );
+ if (!$OUT) { die "Could not create socket to connect to remote host."; }
+ $IN = $OUT;
}
- # so open("|more") can read from STDOUT and so we don't dingle stdin
- $IN = \*IN;
+ else {
+ if (defined $console) {
+ open(IN,"+<$console") || open(IN,"<$console") || open(IN,"<&STDIN");
+ open(OUT,"+>$console") || open(OUT,">$console") || open(OUT,">&STDERR")
+ || open(OUT,">&STDOUT"); # so we don't dongle stdout
+ } else {
+ open(IN,"<&STDIN");
+ open(OUT,">&STDERR") || open(OUT,">&STDOUT"); # so we don't dongle stdout
+ $console = 'STDIN/OUT';
+ }
+ # so open("|more") can read from STDOUT and so we don't dingle stdin
+ $IN = \*IN;
- $OUT = \*OUT;
+ $OUT = \*OUT;
+ }
select($OUT);
$| = 1; # for DB::OUT
select(STDOUT);
B<h q>, B<h R> or B<h O> to get additional info.
EOP
$package = 'main';
- $usercontext = '($@, $!, $,, $/, $\, $^W) = @saved;' .
+ $usercontext = '($@, $!, $^E, $,, $/, $\, $^W) = @saved;' .
"package $package;"; # this won't let them modify, alas
} else {
$sub =~ s/\'/::/;
for ($i = 1; $i <= $max; $i++) {
if (defined $dbline{$i}) {
- print "$file:\n" unless $was++;
+ print $OUT "$file:\n" unless $was++;
print $OUT " $i:\t", $dbline[$i];
($stop,$action) = split(/\0/, $dbline{$i});
print $OUT " break if (", $stop, ")\n"
}
local $frame = 0;
local $doret = -2;
- $term->readline(@_);
+ if (ref $OUT and UNIVERSAL::isa($OUT, 'IO::Socket::INET')) {
+ print $OUT @_;
+ my $stuff;
+ $IN->recv( $stuff, 2048 );
+ $stuff;
+ }
+ else {
+ $term->readline(@_);
+ }
}
sub dump_option {
$rl;
}
+sub RemotePort {
+ if ($term) {
+ &warn("Too late to set RemotePort, enabled on next 'R'!\n") if @_;
+ }
+ $remoteport = shift if @_;
+ $remoteport;
+}
+
sub tkRunning {
if ($ {$term->Features}{tkRunning}) {
return $term->tkRunning(@_);
I<signalLevel> I<warnLevel> I<dieLevel>: level of verbosity;
I<inhibit_exit> Allows stepping off the end of the script.
I<ImmediateStop> Debugger should stop as early as possible.
+ I<RemotePort>: Remote hostname:port for remote debugging
The following options affect what happens with B<V>, B<X>, and B<x> commands:
I<arrayDepth>, I<hashDepth>: print only first N elements ('' for all);
I<compactDump>, I<veryCompact>: change style of array and hash dump;
I<ornaments> affects screen appearance of the command line.
During startup options are initialized from \$ENV{PERLDB_OPTS}.
You can put additional initialization options I<TTY>, I<noTTY>,
- I<ReadLine>, and I<NonStop> there (or use `B<R>' after you set them).
+ I<ReadLine>, I<NonStop>, and I<RemotePort> there (or use
+ `B<R>' after you set them).
B<<> I<expr> Define Perl command to run before each prompt.
B<<<> I<expr> Add to the list of Perl commands to run before each prompt.
B<>> I<expr> Define Perl command to run after each prompt.
The local() generated a compile-time error because you just touched a global
name without fully qualifying it.
+Because of their special use by sort(), the variables $a and $b are
+exempted from this check.
+
=item C<strict subs>
This disables the poetry optimization, generating a compile-time error if
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
+return <<'END';
0041 00C0 00C1 00C2 00C3 00C4 00C5
0043 00C7
0045 00C8 00C9 00CA 00CB
006F 00BA 00F2 00F3 00F4 00F5 00F6 00F8
0075 00F9 00FA 00FB 00FC
0079 00FD 00FF
+END
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
+return <<'END';
0041 00C0 00C1 00C2 00C3 00C4 00C5 0100 0102 0104 01CD 0200 0202 0226 1E00 1EA0 1EA2 FF21
0042 0181 0182 1E02 1E04 1E06 212C FF22
0043 00C7 0106 0108 010A 010C 0187 2102 212D FF23
3163 FFDC
3164 FFA0
FB49 FB2C FB2D
+END
--- /dev/null
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
+return <<'END';
+31A0 31BF
+END
--- /dev/null
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
+return <<'END';
+2800 28FF
+END
--- /dev/null
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
+return <<'END';
+2E80 2EFF
+END
--- /dev/null
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
+return <<'END';
+3400 4DB5
+END
--- /dev/null
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
+return <<'END';
+13A0 13FF
+END
--- /dev/null
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
+return <<'END';
+2FF0 2FFF
+END
--- /dev/null
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
+return <<'END';
+2F00 2FDF
+END
--- /dev/null
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
+return <<'END';
+1780 17FF
+END
--- /dev/null
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
+return <<'END';
+1800 18AF
+END
--- /dev/null
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
+return <<'END';
+1000 109F
+END
--- /dev/null
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
+return <<'END';
+1680 169F
+END
--- /dev/null
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
+return <<'END';
+16A0 16FF
+END
--- /dev/null
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
+return <<'END';
+0D80 0DFF
+END
--- /dev/null
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
+return <<'END';
+0700 074F
+END
--- /dev/null
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
+return <<'END';
+0780 07BF
+END
--- /dev/null
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
+return <<'END';
+1400 167F
+END
--- /dev/null
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
+return <<'END';
+A490 A4CF
+END
--- /dev/null
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
+return <<'END';
+A000 A48F
+END
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
return <<'END';
END
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
return <<'END';
END
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
return <<'END';
END
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
return <<'END';
END
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
return <<'END';
END
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
return <<'END';
END
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
return <<'END';
END
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
return <<'END';
END
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
return <<'END';
END
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
return <<'END';
END
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
return <<'END';
END
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by mktables.PL from e.g. Unicode.300.
+# Any changes made here will be lost!
return <<'END';
END
--- /dev/null
+<html>
+
+<head>
+<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
+<title>Unicode 3.0 NamesList File Structure</title>
+</head>
+
+<body>
+
+<h3>Unicode NamesList File Format</h3>
+
+<p>Last updated: 1999-07-06</p>
+
+<h3>1.0 Introduction</h3>
+
+<p>The Unicode name list file NamesList.txt (also NamesList.lst) is a plain text file used
+to drive the layout of the character code charts in the Unicode Standard. The information
+in this file is a combination of several fields from the UnicodeData.txt and Blocks.txt files,
+together with additional annotations for many characters. This document describes the
+syntax rules for the file format, but also gives brief information on how each construct
+is rendered when laid out for the book. Some of the syntax elements were used in
+preparation of the drafts of the book and may not be present in the final, released form
+of the NamesList.txt file.</p>
+
+<p>The same input file can be used to do the draft preparation for ISO/IEC 10646 (referred
+below as ISO-style). This necessitates the presence of some information in the name list
+file that is not needed (and in fact removed during parsing) for the Unicode book.</p>
+
+<p>With access to the layout program (unibook.exe) it is a simple matter of creating
+name lists for the purpose of formatting working drafts containing proposed characters.</p>
+
+<h3>1.1 NamesList File Overview</h3>
+
+<p>The *.lst files are plain text files which in their most simple form look like this</p>
+
+<p>@@<tab>0020<tab>BASIC LATIN<tab>007F<br>
+; this is a file comment (ignored)<br>
+0020<tab>SPACE<br>
+0021<tab>EXCLAMATION MARK<br>
+0022<tab>QUOTATION MARK<br>
+. . . <br>
+007F<tab>DELETE</p>
+
+<p>The semicolon (as first character), @ and <tab> characters are used by the file
+syntax and must be provided as shown. Hexadecimal digits must be in UPPER CASE). A double
+@@ introduces a block header, with the title, and start and ending code of the block
+provided as shown.</p>
+
+<p>For an ISO-style, minimal name list, only the NAME_LINE and BLOCKHEADER and their
+constituent syntax elements are needed.</p>
+
+<p>The full syntax with all the options is provided in the following sections.</p>
+
+<h3>1.2 NamesList File Structure</h3>
+
+<p>This section gives defines the overall file structure</p>
+
+<pre><strong>NAMELIST: TITLE_PAGE* BLOCK*
+</strong>
+<strong>TITLE_PAGE: TITLE
+ | TITLE_PAGE SUBTITLE
+ | TITLE_PAGE SUBHEADER
+ | TITLE_PAGE IGNORED_LINE
+ | TITLE_PAGE EMPTY_LINE
+ | TITLE_PAGE COMMENTLINE
+ | TITLE_PAGE NOTICE
+ | TITLE_PAGE PAGEBREAK
+</strong>
+<strong>BLOCK: BLOCKHEADER
+ | BLOCK CHAR_ENTRY
+ | BLOCK SUBHEADER
+ | BLOCK NOTICE
+ | BLOCK EMPTY_LINE
+ | BLOCK IGNORED_LINE
+ | BLOCK PAGEBREAK
+
+CHAR_ENTRY: NAME_LINE | RESERVED_LINE
+ | CHAR_ENTRY ALIAS_LINE
+ | CHAR_ENTRY COMMENT_LINE
+ | CHAR_ENTRY CROSS_REF
+ | CHAR_ENTRY DECOMPOSITION
+ | CHAR_ENTRY COMPAT_MAPPING
+ | CHAR_ENTRY IGNORED_LINE
+ | CHAR_ENTRY EMPTY_LINE
+ | CHAR_ENTRY NOTICE
+</strong></pre>
+
+<p>In other words:<br>
+<br>
+Neither TITLE nor SUBTITLE may occur after the first BLOCKHEADER. </p>
+
+<p>Only TITLE, SUBTITLE, SUBHEADER, PAGEBREAK, COMMENT_LINE, and IGNORED_LINE may
+occur before the first BLOCKHEADER.</p>
+
+<p>Directly following either a NAME_LINE or a RESERVED_LINE an uninterrupted sequence of
+the following lines may occur (in any order and repeated as often as needed): ALIAS_LINE,
+CROSS_REF, DECOMPOSITION, COMPAT_MAPPING, NOTICE, EMPTY_LINE and IGNORED_LINE.</p>
+
+<p>Except for EMPTY_LINE, NOTICE and IGNORED_LINE, none of these lines may occur in any other
+place. </p>
+
+<p>Note: A NOTICE displays differently depending on whether it follows a header or title
+or is part of a CHAR_ENTRY.</p>
+
+<h3>1.3 NamesList File Elements</h3>
+
+<p>This section provides the details of the syntax for the individual elements.</p>
+
+<pre><small><strong>ELEMENT SYNTAX</strong> // How rendered</small></pre>
+
+<pre><small><strong>NAME_LINE: CHAR <tab> LINE
+</strong> // the CHAR and the corresponding image are echoed,
+ // followed by the name as given in LINE
+
+<strong> CHAR TAB NAME COMMENT LF
+</strong> // Names may have a comment, which is stripped off
+ // unless the file is parsed for an ISO style list
+
+<strong>RESERVED_LINE: CHAR TAB <reserved>
+</strong> // the CHAR is echoed followed by an icon for the
+ // reserved character and a fixed string e.g. <reserved>
+
+<strong>COMMMENT_LINE: <tab> "*" SP EXPAND_LINE
+</strong> // * is replaced by BULLET, output line as comment
+ <strong><tab> EXPAND_LINE</strong>
+ // output line as comment
+
+<strong>ALIAS_LINE: <tab> "=" SP LINE
+</strong> // replace = by itself, output line as alias
+
+<strong>CROSS_REF: <tab> "X" SP EXPAND_LINE
+</strong> // X is replaced by a right arrow
+<strong> <tab> "X" SP "(" STRING SP "-" SP CHAR ")"
+</strong> // X is replaced by a right arrow
+ // the "(", "-", ")" are removed, the
+ // order of CHAR and STRING is reversed
+ // i.e. both inputs result in the same output
+
+<strong>IGNORED_LINE: <tab> ";" EXPAND_LINE
+EMPTY_LINE: LF
+</strong> // empty lines and file comments are ignored
+
+<strong>DECOMPOSITION: <tab> ":" EXPAND_LINE
+</strong> // replace ':' by EQUIV, expand line into
+ // decomposition
+
+<strong>COMPAT_MAPPING: <tab> "#" SP EXPAND_LINE
+</strong> // replace '#' by APPROX, output line as mapping
+
+<strong>NOTICE: "@+" <tab> LINE
+</strong> // skip '@+', output text as notice
+<strong> "@+" TAB * SP LINE
+</strong> // skip '@', output text as notice
+ // "*" expands to a bullet character
+ // Notices following a character code apply to the
+ // character and are indented. Notices not following
+ // a character code apply to the page/block/column
+ // and are italicized, but not indented
+
+<strong>SUBTITLE: "@@@+" <tab> LINE
+</strong> // skip "@@@+", output text as subtitle
+
+<strong>SUBHEADER: "@" <tab> LINE
+</strong> // skip '@', output line as text as column header
+
+<strong>BLOCKHEADER: "@@" <tab> BLOCKSTART <tab> BLOCKNAME <tab> BLOCKEND
+</strong> // skip "@@", cause a page break and optional
+ // blank page, then output one or more charts
+ // followed by the list of character names.
+ // use BLOCKSTART and BLOCKEND to define the
+ // what characters belong to a block
+ // use blockname in page and table headers
+ <strong> "@@" <tab> BLOCKSTART <tab> BLOCKNAME COMMENT <tab> BLOCKEND
+ </strong>// if a comment is present it replaces the blockname
+ // when an ISO-style namelist is laid out
+
+<strong>BLOCKSTART: CHAR</strong> // first character position in block
+<strong>BLOCKEND: CHAR</strong> // last character position in block
+<strong>PAGE_BREAK: "@@"</strong> // insert a (column) break
+
+<strong>TITLE: "@@@" <tab> LINE</strong>
+ // skip "@@@", output line as text
+ // Title is used in page headers
+
+<strong>EXPAND_LINE: {CHAR | STRING}+ LF </strong>
+ // all instances of CHAR *) are replaced by
+ // CHAR NBSP x NBSP where x is the single Unicode
+ // character corresponding to char
+ // If character is combining, it is replaced with
+ // CHAR NBSP <circ> x NBSP where <circ> is the
+ // dotted circle</small>
+</pre>
+
+<h3><strong>1.4 NamesList File Primitives</strong></h3>
+
+<p>The following are the primitives and terminals for the NamesList syntax.</p>
+
+<pre><small><strong>LINE: STRING LF
+COMMENT: "(" NAME ")"
+ "(" NAME ")" "*"
+</strong>
+<strong>NAME</strong>: <sequence of ASCII characters, except "(" or ")" >
+<strong>STRING</strong>: <sequence of Latin-1 characters>
+<strong>CHAR</strong>: <strong>X X X X</strong>
+ <strong>| X X X X X X X X X</strong></small>
+<small><strong>X: "0"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9"|"A"|"B"|"C"|"D"|"E"|"F"
+<tab>:</strong> <sequence of one or more ASCII tab characters 0x09>
+<strong>SP</strong>: <ASCII 0x20>
+<strong>LF</strong>: <any sequence of ASCII 0x0A and 0x0D>
+</small></pre>
+
+<p><strong>Notes:</strong>
+
+<ul>
+ <li>Special lookahead logic prevents a mention of a 4 digit standard, such as ISO 9999 from
+ being misinterpreted as ISO CHAR.</li>
+ <li>Use of Latin-1 is supported in unibook.exe, but not portably, unless the file is encoded as
+ UTF-16LE.</li>
+ <li>The final LF in the file must be present</li>
+ <li>A CHAR inside ' or " is expanded, but only its glyph image is printed, the
+ code value is not echoed</li>
+ <li>Straight quotes in an EXPAND_LINE are replaced by curly quotes using English rules.
+ Apostrophes are supported, but nested quotes are not.</li>
+</ul>
+</body>
+</html>
--------------------------------------------------------------------------
NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE
-The files have been copied 1999-Sep-14 from
+The files have been copied from
ftp://ftp.unicode.org/Public/3.0-Update/
-and renamed to better fit 8.3 filename limitations.
-
-For example, the UnicodeCharacterDatabase.html referred above is
-now called Unicode.html.
-
+and most of them have been renamed to better fit 8.3 filename limitations.
+
+long name at unicode.org short name latest '#'
+------------------------ ---------- ----------
+ArabicShaping-#.txt ArabShap.txt 2
+Blocks-#.txt Blocks.txt 3
+CompositionExclusions-#.txt CompExcl.txt 1
+EastAsianWidth-#.txt EAWidth.txt 3
+Index-#.txt Index.txt 3.0.0
+Jamo-#.txt Jamo.txt 2
+LineBreak-#.txt LineBrk.txt 5
+NamesList-#.txt Names.txt 3.0.0
+NamesList-#.html NamesList.html 1
+PropList-#.txt Props.txt 3.0.0
+SpecialCasing-#.txt SpecCase.txt 2
+UnicodeData-#.txt Unicode.300 3.0.0
+UnicodeData-#.html Unicode3.html 3.0.0
+UnicodeCharacterDatabase-#.html UCD300.html 3.0.0
+
+The *.pl files are generated from these files by the 'mktables.PL' script.
+
+While the files have been renamed the links in the html files haven't.
+
+--
jhi@iki.fi
-
-
--- /dev/null
+<html>
+
+
+
+<head>
+
+<meta NAME="GENERATOR" CONTENT="Microsoft FrontPage 4.0">
+
+<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
+
+<link REL="stylesheet" HREF="http://www.unicode.org/unicode.css" TYPE="text/css">
+
+<title>UnicodeData File Format</title>
+
+</head>
+
+
+
+<body>
+
+
+
+<h1>UnicodeData File Format<br>
+Version 3.0.0</h1>
+
+
+
+<table BORDER="1" CELLSPACING="2" CELLPADDING="0" HEIGHT="87" WIDTH="100%">
+
+ <tr>
+
+ <td VALIGN="TOP" width="144">Revision</td>
+
+ <td VALIGN="TOP">3.0.0</td>
+
+ </tr>
+
+ <tr>
+
+ <td VALIGN="TOP" width="144">Authors</td>
+
+ <td VALIGN="TOP">Mark Davis and Ken Whistler</td>
+
+ </tr>
+
+ <tr>
+
+ <td VALIGN="TOP" width="144">Date</td>
+
+ <td VALIGN="TOP">1999-09-12</td>
+
+ </tr>
+
+ <tr>
+
+ <td VALIGN="TOP" width="144">This Version</td>
+
+ <td VALIGN="TOP"><a href="ftp://ftp.unicode.org/Public/3.0-Update/UnicodeData-3.0.0.html">ftp://ftp.unicode.org/Public/3.0-Update/UnicodeData-3.0.0.html</a></td>
+
+ </tr>
+
+ <tr>
+
+ <td VALIGN="TOP" width="144">Previous Version</td>
+
+ <td VALIGN="TOP">n/a</td>
+
+ </tr>
+
+ <tr>
+
+ <td VALIGN="TOP" width="144">Latest Version</td>
+
+ <td VALIGN="TOP"><a href="ftp://ftp.unicode.org/Public/3.0-Update/UnicodeData-3.0.0.html">ftp://ftp.unicode.org/Public/3.0-Update/UnicodeData-3.0.0.html</a></td>
+
+ </tr>
+
+</table>
+
+
+
+<p align="center">Copyright © 1995-1999 Unicode, Inc. All Rights reserved.<br>
+
+<i>For more information, including Disclamer and Limitations, see <a HREF="UnicodeCharacterDatabase-3.0.0.html">UnicodeCharacterDatabase-3.0.0.html</a> </i></p>
+
+
+
+<p>This document describes the format of the UnicodeData.txt file, which is one of the
+
+files in the Unicode Character Database. The document is divided into the following
+
+sections:
+
+
+
+<ul>
+
+ <li><a HREF="#Field Formats">Field Formats</a> <ul>
+
+ <li><a HREF="#General Category">General Category</a> </li>
+
+ <li><a HREF="#Bidirectional Category">Bidirectional Category</a> </li>
+
+ <li><a HREF="#Character Decomposition">Character Decomposition Mapping</a> </li>
+
+ <li><a HREF="#Canonical Combining Classes">Canonical Combining Classes</a> </li>
+
+ <li><a HREF="#Decompositions and Normalization">Decompositions and Normalization</a> </li>
+
+ <li><a HREF="#Case Mappings">Case Mappings</a> </li>
+
+ </ul>
+
+ </li>
+
+ <li><a HREF="#Property Invariants">Property Invariants</a> </li>
+
+ <li><a HREF="#Modification History">Modification History</a> </li>
+
+</ul>
+
+
+
+<p><b>Warning: </b>the information in this file does not completely describe the use and
+
+interpretation of Unicode character properties and behavior. It must be used in
+
+conjunction with the data in the other files in the Unicode Character Database, and relies
+
+on the notation and definitions supplied in <i><a href="http://www.unicode.org/unicode/standard/versions/Unicode3.0.html"> The Unicode
+Standard</a></i>. All chapter references
+
+are to Version 3.0 of the standard.</p>
+
+
+
+<h2><a NAME="Field Formats"></a>Field Formats</h2>
+
+
+
+<p>The file consists of lines containing fields terminated by semicolons. Each line
+
+represents the data for one encoded character in the Unicode Standard. Every encoded
+
+character has a data entry, with the exception of certain special ranges, as detailed
+
+below.
+
+
+
+<ul>
+
+ <li>There are six special ranges of characters that are represented only by their start and
+
+ end characters, since the properties in the file are uniform, except for code values
+
+ (which are all sequential and assigned). </li>
+
+ <li>The names of CJK ideograph characters and the names and decompositions of Hangul
+
+ syllable characters are algorithmically derivable. (See the Unicode Standard and <a
+
+ HREF="http://www.unicode.org/unicode/reports/tr15/">Unicode Technical Report #15</a> for
+
+ more information). </li>
+
+ <li>Surrogate code values and private use characters have no names. </li>
+
+ <li>The Private Use character outside of the BMP (U+F0000..U+FFFFD, U+100000..U+10FFFD) are
+
+ not listed. These correspond to surrogate pairs where the first surrogate is in the High
+
+ Surrogate Private Use section. </li>
+
+</ul>
+
+
+
+<p>The exact ranges represented by start and end characters are:
+
+
+
+<ul>
+
+ <li>CJK Ideographs Extension A (U+3400 - U+4DB5) </li>
+
+ <li>CJK Ideographs (U+4E00 - U+9FA5) </li>
+
+ <li>Hangul Syllables (U+AC00 - U+D7A3) </li>
+
+ <li>Non-Private Use High Surrogates (U+D800 - U+DB7F) </li>
+
+ <li>Private Use High Surrogates (U+DB80 - U+DBFF) </li>
+
+ <li>Low Surrogates (U+DC00 - U+DFFF) </li>
+
+ <li>The Private Use Area (U+E000 - U+F8FF) </li>
+
+</ul>
+
+
+
+<p>The following table describes the format and meaning of each field in a data entry in
+
+the UnicodeData file. Fields which contain normative information are so indicated.</p>
+
+
+
+<table BORDER="1" CELLSPACING="2" CELLPADDING="2">
+
+ <tr>
+
+ <th VALIGN="top" ALIGN="LEFT"><p ALIGN="LEFT">Field</th>
+
+ <th VALIGN="top" ALIGN="LEFT"><p ALIGN="LEFT">Name</th>
+
+ <th VALIGN="top" ALIGN="LEFT"><p ALIGN="LEFT">Status</th>
+
+ <th VALIGN="top" ALIGN="LEFT"><p ALIGN="LEFT">Explanation</th>
+
+ </tr>
+
+ <tr>
+
+ <th VALIGN="top">0</th>
+
+ <td VALIGN="top">Code value</td>
+
+ <td VALIGN="top">normative</td>
+
+ <td VALIGN="top">Code value in 4-digit hexadecimal format.</td>
+
+ </tr>
+
+ <tr>
+
+ <th VALIGN="top">1</th>
+
+ <td VALIGN="top">Character name</td>
+
+ <td VALIGN="top">normative</td>
+
+ <td VALIGN="top">These names match exactly the names published in Chapter 14 of the
+
+ Unicode Standard, Version 3.0.</td>
+
+ </tr>
+
+ <tr>
+
+ <th VALIGN="top">2</th>
+
+ <td VALIGN="top"><a HREF="#General Category">General Category</a> </td>
+
+ <td VALIGN="top">normative / informative<br>
+
+ (see below)</td>
+
+ <td VALIGN="top">This is a useful breakdown into various "character types" which
+
+ can be used as a default categorization in implementations. See below for a brief
+
+ explanation.</td>
+
+ </tr>
+
+ <tr>
+
+ <th VALIGN="top">3</th>
+
+ <td VALIGN="top"><a HREF="#Canonical Combining Classes">Canonical Combining Classes</a> </td>
+
+ <td VALIGN="top">normative</td>
+
+ <td VALIGN="top">The classes used for the Canonical Ordering Algorithm in the Unicode
+
+ Standard. These classes are also printed in Chapter 4 of the Unicode Standard.</td>
+
+ </tr>
+
+ <tr>
+
+ <th VALIGN="top">4</th>
+
+ <td VALIGN="top"><a HREF="#Bidirectional Category">Bidirectional Category</a> </td>
+
+ <td VALIGN="top">normative</td>
+
+ <td VALIGN="top">See the list below for an explanation of the abbreviations used in this
+
+ field. These are the categories required by the Bidirectional Behavior Algorithm in the
+
+ Unicode Standard. These categories are summarized in Chapter 3 of the Unicode Standard.</td>
+
+ </tr>
+
+ <tr>
+
+ <th VALIGN="top">5</th>
+
+ <td VALIGN="top"><a HREF="#Character Decomposition">Character Decomposition
+ Mapping</a></td>
+
+ <td VALIGN="top">normative</td>
+
+ <td VALIGN="top">In the Unicode Standard, not all of the mappings are full (maximal)
+
+ decompositions. Recursive application of look-up for decompositions will, in all cases,
+
+ lead to a maximal decomposition. The decomposition mappings match exactly the
+
+ decomposition mappings published with the character names in the Unicode Standard.</td>
+
+ </tr>
+
+ <tr>
+
+ <th VALIGN="top">6</th>
+
+ <td VALIGN="top">Decimal digit value</td>
+
+ <td VALIGN="top">normative</td>
+
+ <td VALIGN="top">This is a numeric field. If the character has the decimal digit property,
+
+ as specified in Chapter 4 of the Unicode Standard, the value of that digit is represented
+
+ with an integer value in this field</td>
+
+ </tr>
+
+ <tr>
+
+ <th VALIGN="top">7</th>
+
+ <td VALIGN="top">Digit value</td>
+
+ <td VALIGN="top">normative</td>
+
+ <td VALIGN="top">This is a numeric field. If the character represents a digit, not
+
+ necessarily a decimal digit, the value is here. This covers digits which do not form
+
+ decimal radix forms, such as the compatibility superscript digits</td>
+
+ </tr>
+
+ <tr>
+
+ <th VALIGN="top">8</th>
+
+ <td VALIGN="top">Numeric value</td>
+
+ <td VALIGN="top">normative</td>
+
+ <td VALIGN="top">This is a numeric field. If the character has the numeric property, as
+
+ specified in Chapter 4 of the Unicode Standard, the value of that character is represented
+
+ with an integer or rational number in this field. This includes fractions as, e.g.,
+
+ "1/5" for U+2155 VULGAR FRACTION ONE FIFTH Also included are numerical values
+
+ for compatibility characters such as circled numbers.</td>
+
+ </tr>
+
+ <tr>
+
+ <th VALIGN="top">8</th>
+
+ <td VALIGN="top">Mirrored</td>
+
+ <td VALIGN="top">normative</td>
+
+ <td VALIGN="top">If the character has been identified as a "mirrored" character
+
+ in bidirectional text, this field has the value "Y"; otherwise "N".
+
+ The list of mirrored characters is also printed in Chapter 4 of the Unicode Standard.</td>
+
+ </tr>
+
+ <tr>
+
+ <th VALIGN="top">10</th>
+
+ <td VALIGN="top">Unicode 1.0 Name</td>
+
+ <td VALIGN="top">informative</td>
+
+ <td VALIGN="top">This is the old name as published in Unicode 1.0. This name is only
+
+ provided when it is significantly different from the Unicode 3.0 name for the character.</td>
+
+ </tr>
+
+ <tr>
+
+ <th VALIGN="top">11</th>
+
+ <td VALIGN="top">10646 comment field</td>
+
+ <td VALIGN="top">informative</td>
+
+ <td VALIGN="top">This is the ISO 10646 comment field. It is in parantheses in the 10646
+
+ names list.</td>
+
+ </tr>
+
+ <tr>
+
+ <th VALIGN="top">12</th>
+
+ <td VALIGN="top"><a HREF="#Case Mappings">Uppercase Mapping</a></td>
+
+ <td VALIGN="top">informative</td>
+
+ <td VALIGN="top">Upper case equivalent mapping. If a character is part of an alphabet with
+
+ case distinctions, and has an upper case equivalent, then the upper case equivalent is in
+
+ this field. See the explanation below on case distinctions. These mappings are always
+
+ one-to-one, not one-to-many or many-to-one. This field is informative.</td>
+
+ </tr>
+
+ <tr>
+
+ <th VALIGN="top">13</th>
+
+ <td VALIGN="top"><a HREF="#Case Mappings">Lowercase Mapping</a></td>
+
+ <td VALIGN="top">informative</td>
+
+ <td VALIGN="top">Similar to Uppercase mapping</td>
+
+ </tr>
+
+ <tr>
+
+ <th VALIGN="top">14</th>
+
+ <td VALIGN="top"><a HREF="#Case Mappings">Titlecase Mapping</a></td>
+
+ <td VALIGN="top">informative</td>
+
+ <td VALIGN="top">Similar to Uppercase mapping</td>
+
+ </tr>
+
+</table>
+
+
+
+<h3><a NAME="General Category"></a>General Category</h3>
+
+
+
+<p>The values in this field are abbreviations for the following. Some of the values are
+
+normative, and some are informative. For more information, see the Unicode Standard.</p>
+
+
+
+<p><b>Note:</b> the standard does not assign information to control characters (except for
+
+certain cases in the Bidirectional Algorithm). Implementations will generally also assign
+
+categories to certain control characters, notably CR and LF, according to platform
+
+conventions.</p>
+
+
+
+<h4>Normative Categories</h4>
+
+
+
+<table BORDER="0" CELLSPACING="2" CELLPADDING="0">
+
+ <tr>
+
+ <th><p ALIGN="LEFT">Abbr.</th>
+
+ <th><p ALIGN="LEFT">Description</th>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER">Lu</td>
+
+ <td>Letter, Uppercase</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER">Ll</td>
+
+ <td>Letter, Lowercase</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER">Lt</td>
+
+ <td>Letter, Titlecase</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER">Mn</td>
+
+ <td>Mark, Non-Spacing</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER">Mc</td>
+
+ <td>Mark, Spacing Combining</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER">Me</td>
+
+ <td>Mark, Enclosing</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER">Nd</td>
+
+ <td>Number, Decimal Digit</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER">Nl</td>
+
+ <td>Number, Letter</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER">No</td>
+
+ <td>Number, Other</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER">Zs</td>
+
+ <td>Separator, Space</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER">Zl</td>
+
+ <td>Separator, Line</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER">Zp</td>
+
+ <td>Separator, Paragraph</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER">Cc</td>
+
+ <td>Other, Control</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER">Cf</td>
+
+ <td>Other, Format</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER">Cs</td>
+
+ <td>Other, Surrogate</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER">Co</td>
+
+ <td>Other, Private Use</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER">Cn</td>
+
+ <td>Other, Not Assigned (no characters in the file have this property)</td>
+
+ </tr>
+
+</table>
+
+
+
+<h4>Informative Categories</h4>
+
+
+
+<table BORDER="0" CELLSPACING="2" CELLPADDING="0">
+
+ <tr>
+
+ <th><p ALIGN="LEFT">Abbr.</th>
+
+ <th><p ALIGN="LEFT">Description</th>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER">Lm</td>
+
+ <td>Letter, Modifier</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER">Lo</td>
+
+ <td>Letter, Other</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER">Pc</td>
+
+ <td>Punctuation, Connector</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER">Pd</td>
+
+ <td>Punctuation, Dash</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER">Ps</td>
+
+ <td>Punctuation, Open</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER">Pe</td>
+
+ <td>Punctuation, Close</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER">Pi</td>
+
+ <td>Punctuation, Initial quote (may behave like Ps or Pe depending on usage)</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER">Pf</td>
+
+ <td>Punctuation, Final quote (may behave like Ps or Pe depending on usage)</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER">Po</td>
+
+ <td>Punctuation, Other</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER">Sm</td>
+
+ <td>Symbol, Math</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER">Sc</td>
+
+ <td>Symbol, Currency</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER">Sk</td>
+
+ <td>Symbol, Modifier</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER">So</td>
+
+ <td>Symbol, Other</td>
+
+ </tr>
+
+</table>
+
+
+
+<h3><a NAME="Bidirectional Category"></a>Bidirectional Category</h3>
+
+
+
+<p>Please refer to Chapter 3 for an explanation of the algorithm for Bidirectional
+
+Behavior and an explanation of the significance of these categories. An up-to-date version
+
+can be found on <a HREF="http://www.unicode.org/unicode/reports/tr9/">Unicode Technical
+
+Report #9: The Bidirectional Algorithm</a>. These values are normative.</p>
+
+
+
+<table BORDER="0" CELLPADDING="2">
+
+ <tr>
+
+ <th VALIGN="TOP" ALIGN="LEFT"><p ALIGN="LEFT">Type</th>
+
+ <th VALIGN="TOP" ALIGN="LEFT"><p ALIGN="LEFT">Description</th>
+
+ </tr>
+
+ <tr>
+
+ <td VALIGN="TOP"><b>L</b></td>
+
+ <td VALIGN="TOP">Left-to-Right</td>
+
+ </tr>
+
+ <tr>
+
+ <td VALIGN="TOP"><b>LRE</b></td>
+
+ <td VALIGN="TOP">Left-to-Right Embedding</td>
+
+ </tr>
+
+ <tr>
+
+ <td VALIGN="TOP"><b>LRO</b></td>
+
+ <td VALIGN="TOP">Left-to-Right Override</td>
+
+ </tr>
+
+ <tr>
+
+ <td VALIGN="TOP"><b>R</b></td>
+
+ <td VALIGN="TOP">Right-to-Left</td>
+
+ </tr>
+
+ <tr>
+
+ <td VALIGN="TOP"><b>AL</b></td>
+
+ <td VALIGN="TOP">Right-to-Left Arabic</td>
+
+ </tr>
+
+ <tr>
+
+ <td VALIGN="TOP"><b>RLE</b></td>
+
+ <td VALIGN="TOP">Right-to-Left Embedding</td>
+
+ </tr>
+
+ <tr>
+
+ <td VALIGN="TOP"><b>RLO</b></td>
+
+ <td VALIGN="TOP">Right-to-Left Override</td>
+
+ </tr>
+
+ <tr>
+
+ <td VALIGN="TOP"><b>PDF</b></td>
+
+ <td VALIGN="TOP">Pop Directional Format</td>
+
+ </tr>
+
+ <tr>
+
+ <td VALIGN="TOP"><b>EN</b></td>
+
+ <td VALIGN="TOP">European Number</td>
+
+ </tr>
+
+ <tr>
+
+ <td VALIGN="TOP"><b>ES</b></td>
+
+ <td VALIGN="TOP">European Number Separator</td>
+
+ </tr>
+
+ <tr>
+
+ <td VALIGN="TOP"><b>ET</b></td>
+
+ <td VALIGN="TOP">European Number Terminator</td>
+
+ </tr>
+
+ <tr>
+
+ <td VALIGN="TOP"><b>AN</b></td>
+
+ <td VALIGN="TOP">Arabic Number</td>
+
+ </tr>
+
+ <tr>
+
+ <td VALIGN="TOP"><b>CS</b></td>
+
+ <td VALIGN="TOP">Common Number Separator</td>
+
+ </tr>
+
+ <tr>
+
+ <td VALIGN="TOP"><b>NSM</b></td>
+
+ <td VALIGN="TOP">Non-Spacing Mark</td>
+
+ </tr>
+
+ <tr>
+
+ <td VALIGN="TOP"><b>BN</b></td>
+
+ <td VALIGN="TOP">Boundary Neutral</td>
+
+ </tr>
+
+ <tr>
+
+ <td VALIGN="TOP"><b>B</b></td>
+
+ <td VALIGN="TOP">Paragraph Separator</td>
+
+ </tr>
+
+ <tr>
+
+ <td VALIGN="TOP"><b>S</b></td>
+
+ <td VALIGN="TOP">Segment Separator</td>
+
+ </tr>
+
+ <tr>
+
+ <td VALIGN="TOP"><b>WS</b></td>
+
+ <td VALIGN="TOP">Whitespace</td>
+
+ </tr>
+
+ <tr>
+
+ <td VALIGN="TOP"><b>ON</b></td>
+
+ <td VALIGN="TOP">Other Neutrals</td>
+
+ </tr>
+
+</table>
+
+
+
+<h3><a NAME="Character Decomposition"></a>Character Decomposition Mapping</h3>
+
+
+
+<p>The decomposition is a normative property of a character. The tags supplied with
+
+certain decomposition mappings generally indicate formatting information. Where no such
+
+tag is given, the mapping is designated as canonical. Conversely, the presence of a
+
+formatting tag also indicates that the mapping is a compatibility mapping and not a
+
+canonical mapping. In the absence of other formatting information in a compatibility
+
+mapping, the tag is used to distinguish it from canonical mappings.</p>
+
+
+
+<p>In some instances a canonical mapping or a compatibility mapping may consist of a
+
+single character. For a canonical mapping, this indicates that the character is a
+
+canonical equivalent of another single character. For a compatibility mapping, this
+
+indicates that the character is a compatibility equivalent of another single character.
+
+The compatibility formatting tags used are:</p>
+
+
+
+<table BORDER="0" CELLSPACING="2" CELLPADDING="0">
+
+ <tr>
+
+ <th>Tag</th>
+
+ <th><p ALIGN="LEFT">Description</th>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER"><font> </td>
+
+ <td>A font variant (e.g. a blackletter form).</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER"><noBreak> </td>
+
+ <td>A no-break version of a space or hyphen.</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER"><initial> </td>
+
+ <td>An initial presentation form (Arabic).</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER"><medial> </td>
+
+ <td>A medial presentation form (Arabic).</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER"><final> </td>
+
+ <td>A final presentation form (Arabic).</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER"><isolated> </td>
+
+ <td>An isolated presentation form (Arabic).</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER"><circle> </td>
+
+ <td>An encircled form.</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER"><super> </td>
+
+ <td>A superscript form.</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER"><sub> </td>
+
+ <td>A subscript form.</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER"><vertical> </td>
+
+ <td>A vertical layout presentation form.</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER"><wide> </td>
+
+ <td>A wide (or zenkaku) compatibility character.</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER"><narrow> </td>
+
+ <td>A narrow (or hankaku) compatibility character.</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER"><small> </td>
+
+ <td>A small variant form (CNS compatibility).</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER"><square> </td>
+
+ <td>A CJK squared font variant.</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER"><fraction> </td>
+
+ <td>A vulgar fraction form.</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="CENTER"><compat> </td>
+
+ <td>Otherwise unspecified compatibility character.</td>
+
+ </tr>
+
+</table>
+
+
+
+<p><b>Reminder: </b>There is a difference between decomposition and decomposition mapping.
+
+The decomposition mappings are defined in the UnicodeData, while the decomposition (also
+
+termed "full decomposition") is defined in Chapter 3 to use those mappings
+<i>
+
+recursively.</i>
+
+
+
+<ul>
+
+ <li>The canonical decomposition is formed by recursively applying the canonical mappings,
+
+ then applying the canonical reordering algorithm. </li>
+
+ <li>The compatibility decomposition is formed by recursively applying the canonical <em>and</em>
+
+ compatibility mappings, then applying the canonical reordering algorithm. </li>
+
+</ul>
+
+
+
+<h3><a NAME="Canonical Combining Classes"></a>Canonical Combining Classes</h3>
+
+
+
+<table BORDER="0" CELLSPACING="2" CELLPADDING="0">
+
+ <tr>
+
+ <th><p ALIGN="LEFT">Value</th>
+
+ <th><p ALIGN="LEFT">Description</th>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="RIGHT">0:</td>
+
+ <td>Spacing, split, enclosing, reordrant, and Tibetan subjoined</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="RIGHT">1:</td>
+
+ <td>Overlays and interior</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="RIGHT">7:</td>
+
+ <td>Nuktas</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="RIGHT">8:</td>
+
+ <td>Hiragana/Katakana voicing marks</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="RIGHT">9:</td>
+
+ <td>Viramas</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="RIGHT">10:</td>
+
+ <td>Start of fixed position classes</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="RIGHT">199:</td>
+
+ <td>End of fixed position classes</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="RIGHT">200:</td>
+
+ <td>Below left attached</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="RIGHT">202:</td>
+
+ <td>Below attached</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="RIGHT">204:</td>
+
+ <td>Below right attached</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="RIGHT">208:</td>
+
+ <td>Left attached (reordrant around single base character)</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="RIGHT">210:</td>
+
+ <td>Right attached</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="RIGHT">212:</td>
+
+ <td>Above left attached</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="RIGHT">214:</td>
+
+ <td>Above attached</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="RIGHT">216:</td>
+
+ <td>Above right attached</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="RIGHT">218:</td>
+
+ <td>Below left</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="RIGHT">220:</td>
+
+ <td>Below</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="RIGHT">222:</td>
+
+ <td>Below right</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="RIGHT">224:</td>
+
+ <td>Left (reordrant around single base character)</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="RIGHT">226:</td>
+
+ <td>Right</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="RIGHT">228:</td>
+
+ <td>Above left</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="RIGHT">230:</td>
+
+ <td>Above</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="RIGHT">232:</td>
+
+ <td>Above right</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="RIGHT">233:</td>
+
+ <td>Double below</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="RIGHT">234:</td>
+
+ <td>Double above</td>
+
+ </tr>
+
+ <tr>
+
+ <td ALIGN="RIGHT">240:</td>
+
+ <td>Below (iota subscript)</td>
+
+ </tr>
+
+</table>
+
+
+
+<p><strong>Note: </strong>some of the combining classes in this list do not currently have
+
+members but are specified here for completeness.</p>
+
+
+
+<h3><a NAME="Decompositions and Normalization"></a>Decompositions and Normalization</h3>
+
+
+
+<p>Decomposition is specified in Chapter 3. <a href="http://www.unicode.org/unicode/reports/tr15/"><i>Unicode Technical Report #15:
+
+Normalization Forms</i></a> specifies the interaction between decomposition and normalization. The
+
+most up-to-date version is found on <a HREF="http://www.unicode.org/unicode/reports/tr15/">http://www.unicode.org/unicode/reports/tr15/</a>.
+
+That report specifies how the decompositions defined in UnicodeData.txt are used to derive
+
+normalized forms of Unicode text.</p>
+
+
+
+<p>Note that as of the 2.1.9 update of the Unicode Character Database, the decompositions
+
+in the UnicodeData.txt file can be used to recursively derive the full decomposition in
+
+canonical order, without the need to separately apply canonical reordering. However,
+
+canonical reordering of combining character sequences must still be applied in
+
+decomposition when normalizing source text which contains any combining marks.</p>
+
+
+
+<h3><a NAME="Case Mappings"></a>Case Mappings</h3>
+
+
+
+<p>The case mapping is an informative, default mapping. Case itself, on the other hand,
+
+has normative status. Thus, for example, 0041 LATIN CAPITAL LETTER A is normatively
+
+uppercase, but its lowercase mapping the 0061 LATIN SMALL LETTER A is informative. The
+
+reason for this is that case can be considered to be an inherent property of a particular
+
+character (and is usually, but not always, derivable from the presence of the terms
+
+"CAPITAL" or "SMALL" in the character name), but case mappings between
+
+characters are occasionally influenced by local conventions. For example, certain
+
+languages, such as Turkish, German, French, or Greek may have small deviations from the
+
+default mappings listed in UnicodeData.</p>
+
+
+
+<p>In addition to uppercase and lowercase, because of the inclusion of certain composite
+
+characters for compatibility, such as 01F1 LATIN CAPITAL LETTER DZ, there is a third case,
+
+called <i>titlecase</i>, which is used where the first letter of a word is to be
+
+capitalized (e.g. UPPERCASE, Titlecase, lowercase). An example of such a titlecase letter
+
+is 01F2 LATIN CAPITAL LETTER D WITH SMALL LETTER Z.</p>
+
+
+
+<p>The uppercase, titlecase and lowercase fields are only included for characters that
+
+have a single corresponding character of that type. Composite characters (such as
+
+"339D SQUARE CM") that do not have a single corresponding character of that type
+
+can be cased by decomposition.</p>
+
+
+
+<p>For compatibility with existing parsers, UnicodeData only contains case mappings for
+
+characters where they are one-to-one mappings; it also omits information about
+
+context-sensitive case mappings. Information about these special cases can be found in a
+
+separate data file, SpecialCasing.txt,
+
+which has been added starting with the 2.1.8 update to the Unicode data files.
+
+SpecialCasing.txt contains additional informative case mappings that are either not
+
+one-to-one or which are context-sensitive.</p>
+
+
+
+<h2><a NAME="Property Invariants"></a>Property Invariants</h2>
+
+
+
+<p>Values in UnicodeData.txt are subject to correction as errors are found; however, some
+
+characteristics of the categories themselves can be considered invariants. Applications
+
+may wish to take these invariants into account when choosing how to implement character
+
+properties. The following is a partial list of known invariants for the Unicode Character
+
+Database.</p>
+
+
+
+<h4>Database Fields</h4>
+
+
+
+<ul>
+
+ <li>The number of fields in UnicodeData.txt is fixed. </li>
+
+ <li>The order of the fields is also fixed. <ul>
+
+ <li>Any additional information about character properties to be added in the future will
+
+ appear in separate data tables, rather than being added on to the existing table or by
+
+ subdivision or reinterpretation of existing fields. </li>
+
+ </ul>
+
+ </li>
+
+</ul>
+
+
+
+<h4>General Category</h4>
+
+
+
+<ul>
+
+ <li>There will never be more than 32 General Category values. <ul>
+
+ <li>It is very unlikely that the Unicode Technical Committee will subdivide the General
+
+ Category partition any further, since that can cause implementations to misbehave. Because
+
+ the General Category is limited to 32 values, 5 bits can be used to represent the
+
+ information, and a 32-bit integer can be used as a bitmask to represent arbitrary sets of
+
+ categories. </li>
+
+ </ul>
+
+ </li>
+
+</ul>
+
+
+
+<h4>Combining Classes</h4>
+
+
+
+<ul>
+
+ <li>Combining classes are limited to the values 0 to 255. <ul>
+
+ <li>In practice, there are far fewer than 256 values used. Implementations may take
+
+ advantage of this fact for compression, since only the ordering of the non-zero values
+
+ matters for the Canonical Reordering Algorithm. It is possible for up to 256 values to be
+
+ used in the future; however, UTC decisions in the future may restrict the number of values
+
+ to 128, since this has implementation advantages. [Signed bytes can be used without
+
+ widening to ints in Java, for example.] </li>
+
+ </ul>
+
+ </li>
+
+ <li>All characters other than those of General Category M* have the combining class 0. <ul>
+
+ <li>Currently, all characters other than those of General Category Mn have the value 0.
+
+ However, some characters of General Category Me or Mc may be given non-zero values in the
+
+ future. </li>
+
+ <li>The precise values above the value 0 are not invariant--only the relative ordering is
+
+ considered normative. For example, it is not guaranteed in future versions that the class
+
+ of U+05B4 will be precisely 14. </li>
+
+ </ul>
+
+ </li>
+
+</ul>
+
+
+
+<h4>Case</h4>
+
+
+
+<ul>
+
+ <li>Characters of type Lu, Lt, or Ll are called <i>cased</i>. All characters with an Upper,
+
+ Lower, or Titlecase mapping are cased characters. <ul>
+
+ <li>However, characters with the General Categories of Lu, Ll, or Lt may not always have
+
+ case mappings, and case mappings may vary by locale. (See
+
+ ftp://ftp.unicode.org/Public/UNIDATA/SpecialCasing.txt). </li>
+
+ </ul>
+
+ </li>
+
+</ul>
+
+
+
+<h4>Canonical Decomposition</h4>
+
+
+
+<ul>
+
+ <li>Canonical mappings are always in canonical order. </li>
+
+ <li>Canonical mappings have only the first of a pair possibly further decomposing. </li>
+
+ <li>Canonical decompositions are "transparent" to other character data: <ul>
+
+ <li><tt>BIDI(a) = BIDI(principal(canonicalDecomposition(a))</tt> </li>
+
+ <li><tt>Category(a) = Category(principal(canonicalDecomposition(a))</tt> </li>
+
+ <li><tt>CombiningClass(a) = CombiningClass(principal(canonicalDecomposition(a))</tt><br>
+
+ where principal(a) is the first character not of type Mn, or the first character if all
+
+ characters are of type Mn. </li>
+
+ </ul>
+
+ </li>
+
+ <li>However, because there are sometimes missing case pairs, and because of some legacy
+
+ characters, it is only generally true that: <ul>
+
+ <li><tt>upper(canonicalDecomposition(a)) = canonicalDecomposition(upper(a))</tt> </li>
+
+ <li><tt>lower(canonicalDecomposition(a)) = canonicalDecomposition(lower(a))</tt> </li>
+
+ <li><tt>title(canonicalDecomposition(a)) = canonicalDecomposition(title(a))</tt> </li>
+
+ </ul>
+
+ </li>
+
+</ul>
+
+
+
+<h2><a NAME="Modification History"></a>Modification History</h2>
+
+
+
+<p>This section provides a summary of the changes between update versions of the Unicode
+
+Standard.</p>
+
+
+
+<h3><a href="http://www.unicode.org/unicode/standard/versions/enumeratedversions.html#Unicode 3.0.0"> Unicode 3.0.0</a></h3>
+
+
+
+<p>Modifications made for Version 3.0.0 of UnicodeData.txt include many new characters and
+
+a number of property changes. These are summarized in Appendex D of <em>The Unicode
+
+Standard, Version 3.0.</em></p>
+
+
+
+<h3><a HREF="http://www.unicode.org/unicode/standard/versions/enumeratedversions.html#Unicode 2.1.9">Unicode 2.1.9</a> </h3>
+
+
+
+<p>Modifications made for Version 2.1.9 of UnicodeData.txt include:
+
+
+
+<ul>
+
+ <li>Corrected combining class for U+05AE HEBREW ACCENT ZINOR. </li>
+
+ <li>Corrected combining class for U+20E1 COMBINING LEFT RIGHT ARROW ABOVE </li>
+
+ <li>Corrected combining class for U+0F35 and U+0F37 to 220. </li>
+
+ <li>Corrected combining class for U+0F71 to 129. </li>
+
+ <li>Added a decomposition for U+0F0C TIBETAN MARK DELIMITER TSHEG BSTAR. </li>
+
+ <li>Added decompositions for several Greek symbol letters: U+03D0..U+03D2, U+03D5,
+
+ U+03D6, U+03F0..U+03F2. </li>
+
+ <li>Removed decompositions from the conjoining jamo block: U+1100..U+11F8. </li>
+
+ <li>Changes to decomposition mappings for some Tibetan vowels for consistency in
+
+ normalization. (U+0F71, U+0F73, U+0F77, U+0F79, U+0F81) </li>
+
+ <li>Updated the decomposition mappings for several Vietnamese characters with two diacritics
+
+ (U+1EAC, U+1EAD, U+1EB6, U+1EB7, U+1EC6, U+1EC7, U+1ED8, U+1ED9), so that the recursive
+
+ decomposition can be generated directly in canonically reordered form (not a normative
+
+ change). </li>
+
+ <li>Updated the decomposition mappings for several Arabic compatibility characters involving
+
+ shadda (U+FC5E..U+FC62, U+FCF2..U+FCF4), and two Latin characters (U+1E1C, U+1E1D), so
+
+ that the decompositions are generated directly in canonically reordered form (not a
+
+ normative change). </li>
+
+ <li>Changed BIDI category for: U+00A0 NO-BREAK SPACE, U+2007 FIGURE SPACE, U+2028 LINE
+
+ SEPARATOR. </li>
+
+ <li>Changed BIDI category for extenders of General Category Lm: U+3005, U+3021..U+3035,
+
+ U+FF9E, U+FF9F. </li>
+
+ <li>Changed General Category and BIDI category for the Greek numeral signs: U+0374, U+0375. </li>
+
+ <li>Corrected General Category for U+FFE8 HALFWIDTH FORMS LIGHT VERTICAL. </li>
+
+ <li>Added Unicode 1.0 names for many Tibetan characters (informative). </li>
+
+</ul>
+
+
+
+<h3><a HREF="http://www.unicode.org/unicode/standard/versions/enumeratedversions.html#Unicode 2.1.8">Unicode 2.1.8</a> </h3>
+
+
+
+<p>Modifications made for Version 2.1.8 of UnicodeData.txt include:
+
+
+
+<ul>
+
+ <li>Added combining class 240 for U+0345 COMBINING GREEK YPOGEGRAMMENI so that
+
+ decompositions involving iota subscript are derivable directly in canonically reordered
+
+ form; this also has a bearing on simplification of casing of polytonic Greek. </li>
+
+ <li>Changes in decompositions related to Greek tonos. These result from the clarification
+
+ that monotonic Greek "tonos" should be equated with U+0301 COMBINING ACUTE,
+
+ rather than with U+030D COMBINING VERTICAL LINE ABOVE. (All Greek characters in the Greek
+
+ block involving "tonos"; some Greek characters in the polytonic Greek in the
+
+ 1FXX block.) </li>
+
+ <li>Changed decompositions involving dialytika tonos. (U+0390, U+03B0) </li>
+
+ <li>Changed ternary decompositions to binary. (U+0CCB, U+FB2C, U+FB2D) These changes
+
+ simplify normalization. </li>
+
+ <li>Removed canonical decomposition for Latin Candrabindu. (U+0310) </li>
+
+ <li>Corrected error in canonical decomposition for U+1FF4. </li>
+
+ <li>Added compatibility decompositions to clarify collation tables. (U+2100, U+2101, U+2105,
+
+ U+2106, U+1E9A) </li>
+
+ <li>A series of general category changes to assist the convergence of of Unicode definition
+
+ of identifier with ISO TR 10176: <ul>
+
+ <li>So > Lo: U+0950, U+0AD0, U+0F00, U+0F88..U+0F8B </li>
+
+ <li>Po > Lo: U+0E2F, U+0EAF, U+3006 </li>
+
+ <li>Lm > Sk: U+309B, U+309C </li>
+
+ <li>Po > Pc: U+30FB, U+FF65 </li>
+
+ <li>Ps/Pe > Mn: U+0F3E, U+0F3F </li>
+
+ </ul>
+
+ </li>
+
+ <li>A series of bidi property changes for consistency. <ul>
+
+ <li>L > ET: U+09F2, U+09F3 </li>
+
+ <li>ON > L: U+3007 </li>
+
+ <li>L > ON: U+0F3A..U+0F3D, U+037E, U+0387 </li>
+
+ </ul>
+
+ </li>
+
+ <li>Add case mapping: U+01A6 <-> U+0280 </li>
+
+ <li>Updated symmetric swapping value for guillemets: U+00AB, U+00BB, U+2039, U+203A. </li>
+
+ <li>Changes to combining class values. Most Indic fixed position class non-spacing marks
+
+ were changed to combining class 0. This fixes some inconsistencies in how canonical
+
+ reordering would apply to Indic scripts, including Tibetan. Indic interacting top/bottom
+
+ fixed position classes were merged into single (non-zero) classes as part of this change.
+
+ Tibetan subjoined consonants are changed from combining class 6 to combining class 0. Thai
+
+ pinthu (U+0E3A) moved to combining class 9. Moved two Devanagari stress marks into generic
+
+ above and below combining classes (U+0951, U+0952). </li>
+
+ <li>Corrected placement of semicolon near symmetric swapping field. (U+FA0E, etc., scattered
+
+ positions to U+FA29) </li>
+
+</ul>
+
+
+
+<h3>Version 2.1.7</h3>
+
+
+
+<p><i>This version was for internal change tracking only, and never publicly released.</i></p>
+
+
+
+<h3>Version 2.1.6</h3>
+
+
+
+<p><i>This version was for internal change tracking only, and never publicly released.</i></p>
+
+
+
+<h3><a HREF="http://www.unicode.org/unicode/standard/versions/enumeratedversions.html#Unicode 2.1.5">Unicode 2.1.5</a> </h3>
+
+
+
+<p>Modifications made for Version 2.1.5 of UnicodeData.txt include:
+
+
+
+<ul>
+
+ <li>Changed decomposition for U+FF9E and U+FF9F so that correct collation weighting will
+
+ automatically result from the canonical equivalences. </li>
+
+ <li>Removed canonical decompositions for U+04D4, U+04D5, U+04D8, U+04D9, U+04E0, U+04E1,
+
+ U+04E8, U+04E9 (the implication being that no canonical equivalence is claimed between
+
+ these 8 characters and similar Latin letters), and updated 4 canonical decompositions for
+
+ U+04DB, U+04DC, U+04EA, U+04EB to reflect the implied difference in the base character. </li>
+
+ <li>Added Pi, and Pf categories and assigned the relevant quotation marks to those
+
+ categories, based on the Unicode Technical Corrigendum on Quotation Characters. </li>
+
+ <li>Updating of many bidi properties, following the advice of the ad hoc committee on bidi,
+
+ and to make the bidi properties of compatibility characters more consistent. </li>
+
+ <li>Changed category of several Tibetan characters: U+0F3E, U+0F3F, U+0F88..U+0F8B to make
+
+ them non-combining, reflecting the combined opinion of Tibetan experts. </li>
+
+ <li>Added case mapping for U+03F2. </li>
+
+ <li>Corrected case mapping for U+0275. </li>
+
+ <li>Added titlecase mappings for U+03D0, U+03D1, U+03D5, U+03D6, U+03F0.. U+03F2. </li>
+
+ <li>Corrected compatibility label for U+2121. </li>
+
+ <li>Add specific entries for all the CJK compatibility ideographs, U+F900..U+FA2D, so the
+
+ canonical decomposition for each (the URO character it is equivalent to) can be carried in
+
+ the database. </li>
+
+</ul>
+
+
+
+<h3>Version 2.1.4</h3>
+
+
+
+<p><i>This version was for internal change tracking only, and never publicly released.</i></p>
+
+
+
+<h3>Version 2.1.3</h3>
+
+
+
+<p><i>This version was for internal change tracking only, and never publicly released.</i></p>
+
+
+
+<h3><a HREF="http://www.unicode.org/unicode/standard/versions/enumeratedversions.html#Unicode 2.1.2">Unicode 2.1.2</a> </h3>
+
+
+
+<p>Modifications made in updating UnicodeData.txt to Version 2.1.2 for the Unicode
+
+Standard, Version 2.1 (from Version 2.0) include:
+
+
+
+<ul>
+
+ <li>Added two characters (U+20AC and U+FFFC). </li>
+
+ <li>Amended bidi properties for U+0026, U+002E, U+0040, U+2007. </li>
+
+ <li>Corrected case mappings for U+018E, U+019F, U+01DD, U+0258, U+0275, U+03C2, U+1E9B. </li>
+
+ <li>Changed combining order class for U+0F71. </li>
+
+ <li>Corrected canonical decompositions for U+0F73, U+1FBE. </li>
+
+ <li>Changed decomposition for U+FB1F from compatibility to canonical. </li>
+
+ <li>Added compatibility decompositions for U+FBE8, U+FBE9, U+FBF9..U+FBFB. </li>
+
+ <li>Corrected compatibility decompositions for U+2469, U+246A, U+3358. </li>
+
+</ul>
+
+
+
+<h3>Version 2.1.1</h3>
+
+
+
+<p><i>This version was for internal change tracking only, and never publicly released.</i></p>
+
+
+
+<h3><a HREF="http://www.unicode.org/unicode/standard/versions/enumeratedversions.html#Unicode 2.0.0">Unicode 2.0.0</a> </h3>
+
+
+
+<p>The modifications made in updating UnicodeData.txt for the Unicode
+
+Standard, Version 2.0 include:
+
+
+
+<ul>
+
+ <li>Fixed decompositions with TONOS to use correct NSM: 030D. </li>
+
+ <li>Removed old Hangul Syllables; mapping to new characters are in a separate table. </li>
+
+ <li>Marked compatibility decompositions with additional tags. </li>
+
+ <li>Changed old tag names for clarity. </li>
+
+ <li>Revision of decompositions to use first-level decomposition, instead of maximal
+
+ decomposition. </li>
+
+ <li>Correction of all known errors in decompositions from earlier versions. </li>
+
+ <li>Added control code names (as old Unicode names). </li>
+
+ <li>Added Hangul Jamo decompositions. </li>
+
+ <li>Added Number category to match properties list in book. </li>
+
+ <li>Fixed categories of Koranic Arabic marks. </li>
+
+ <li>Fixed categories of precomposed characters to match decomposition where possible. </li>
+
+ <li>Added Hebrew cantillation marks and the Tibetan script. </li>
+
+ <li>Added place holders for ranges such as CJK Ideographic Area and the Private Use Area. </li>
+
+ <li>Added categories Me, Sk, Pc, Nl, Cs, Cf, and rectified a number of mistakes in the
+
+ database. </li>
+
+</ul>
+
+</body>
+
+</html>
+
#!../../miniperl
-$UnicodeData = "UnicodeData-Latest.txt";
+$UnicodeData = "Unicode.300";
# Note: we try to keep filenames unique within first 8 chars. Using
# subdirectories for the following helps.
else {
open(OUT, ">$table.pl") or die "Can't create $table.pl: $!\n";
}
+ print OUT <<EOH;
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by $0 from e.g. $UnicodeData.
+# Any changes made here will be lost!
+EOH
print OUT <<"END";
return <<'END';
END
print "Block\n";
open(UD, 'Blocks.txt') or die "Can't open blocks.txt: $!\n";
open(OUT, ">Block.pl") or die "Can't create $table.pl: $!\n";
+print OUT <<EOH;
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by $0 from e.g. $UnicodeData.
+# Any changes made here will be lost!
+EOH
print OUT <<"END";
return <<'END';
END
print OUT "$code $last $name\n";
$name =~ s/\s+//g;
open(BLOCK, ">In/$name.pl");
+ print BLOCK <<EOH;
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by $0 from e.g. $UnicodeData.
+# Any changes made here will be lost!
+EOH
print BLOCK <<"END2";
return <<'END';
$code $last
$split = '($code, $name, $link, $linkgroup) = split(/; */);';
}
elsif ($table =~ /^Jamo/) {
- open(UD, "Jamo-2.txt") or warn "Can't open $table: $!";
+ open(UD, "Jamo.txt") or warn "Can't open $table: $!";
$split = '($code, $short, $name) = split(/; */); $code =~ s/^U\+//;';
}
@unicode = sort keys %unicode;
print "EqUnicode\n";
-if (open(EQ_UNICODE, ">Eq/Unicode")) {
+if (open(OUT, ">Eq/Unicode.pl")) {
+ print OUT <<EOH;
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by $0 from e.g. $UnicodeData.
+# Any changes made here will be lost!
+return <<'END';
+EOH
foreach my $c (@unicode) {
- print EQ_UNICODE "$c @{$unicode{$c}}\n";
+ print OUT "$c @{$unicode{$c}}\n";
}
- close EQ_UNICODE;
+ print OUT "END\n";
+ close OUT;
} else {
- die "$0: failed to open Eq/Unicode for writing: $!\n";
+ die "$0: failed to open Eq/Unicode.pl for writing: $!\n";
}
print "EqLatin1\n";
-if (open(EQ_LATIN1, ">Eq/Latin1")) {
+if (open(OUT, ">Eq/Latin1.pl")) {
+ print OUT <<EOH;
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by $0 from e.g. $UnicodeData.
+# Any changes made here will be lost!
+return <<'END';
+EOH
foreach my $c (@unicode) {
last if hex($c) > 255;
my @c = grep { hex($_) < 256 } @{$unicode{$c}};
next unless @c;
- print EQ_LATIN1 "$c @c\n";
+ print OUT "$c @c\n";
}
- close EQ_LATIN1;
+ print OUT "END\n";
+ close OUT;
} else {
- die "$0: failed to open Eq/Latin1 for writing: $!\n";
+ die "$0: failed to open Eq/Latin1.pl for writing: $!\n";
}
# eof
=head1 NAME
-vars - Perl pragma to predeclare global variable names
+vars - Perl pragma to predeclare global variable names (obsolete)
=head1 SYNOPSIS
=head1 DESCRIPTION
+NOTE: The functionality provided by this pragma has been superseded
+by C<our> declarations, available in Perl v5.6.0 or later. See
+L<perlfunc/our>.
+
This will predeclare all the variables whose names are
in the list, allowing you to use them under "use strict", and
disabling any typo warnings.
+++ /dev/null
-
-# This file was created by warning.pl
-# Any changes made here will be lost.
-#
-
-package warning;
-
-=head1 NAME
-
-warning - Perl pragma to control optional warnings
-
-=head1 SYNOPSIS
-
- use warning;
- no warning;
-
- use warning "all";
- no warning "all";
-
-=head1 DESCRIPTION
-
-If no import list is supplied, all possible warnings are either enabled
-or disabled.
-
-See L<perlmod/Pragmatic Modules> and L<perllexwarn>.
-
-
-=cut
-
-use Carp ;
-
-%Bits = (
- 'all' => "\x55\x55\x55\x55\x55\x55\x55\x55\x55", # [0..35]
- 'ambiguous' => "\x00\x00\x00\x00\x01\x00\x00\x00\x00", # [16]
- 'closed' => "\x04\x00\x00\x00\x00\x00\x00\x00\x00", # [1]
- 'closure' => "\x00\x00\x00\x00\x00\x00\x10\x00\x00", # [26]
- 'debugging' => "\x00\x00\x00\x01\x00\x00\x00\x00\x00", # [12]
- 'deprecated' => "\x00\x00\x00\x00\x04\x00\x00\x00\x00", # [17]
- 'exec' => "\x10\x00\x00\x00\x00\x00\x00\x00\x00", # [2]
- 'inplace' => "\x00\x00\x00\x04\x00\x00\x00\x00\x00", # [13]
- 'internal' => "\x00\x00\x00\x10\x00\x00\x00\x00\x00", # [14]
- 'io' => "\x55\x05\x00\x00\x00\x00\x00\x00\x00", # [0..5]
- 'misc' => "\x00\x10\x00\x00\x00\x00\x00\x00\x00", # [6]
- 'newline' => "\x40\x00\x00\x00\x00\x00\x00\x00\x00", # [3]
- 'numeric' => "\x00\x40\x00\x00\x00\x00\x00\x00\x00", # [7]
- 'octal' => "\x00\x00\x00\x00\x10\x00\x00\x00\x00", # [18]
- 'once' => "\x00\x00\x01\x00\x00\x00\x00\x00\x00", # [8]
- 'parenthesis' => "\x00\x00\x00\x00\x40\x00\x00\x00\x00", # [19]
- 'pipe' => "\x00\x01\x00\x00\x00\x00\x00\x00\x00", # [4]
- 'precedence' => "\x00\x00\x00\x00\x00\x01\x00\x00\x00", # [20]
- 'printf' => "\x00\x00\x00\x00\x00\x04\x00\x00\x00", # [21]
- 'recursion' => "\x00\x00\x04\x00\x00\x00\x00\x00\x00", # [9]
- 'redefine' => "\x00\x00\x10\x00\x00\x00\x00\x00\x00", # [10]
- 'reserved' => "\x00\x00\x00\x00\x00\x10\x00\x00\x00", # [22]
- 'semicolon' => "\x00\x00\x00\x00\x00\x40\x00\x00\x00", # [23]
- 'severe' => "\x00\x00\x40\x15\x00\x00\x00\x00\x00", # [11..14]
- 'signal' => "\x00\x00\x00\x00\x00\x00\x40\x00\x00", # [27]
- 'substr' => "\x00\x00\x00\x00\x00\x00\x00\x01\x00", # [28]
- 'syntax' => "\x00\x00\x00\x40\x55\x55\x00\x00\x00", # [15..23]
- 'taint' => "\x00\x00\x00\x00\x00\x00\x00\x04\x00", # [29]
- 'uninitialized' => "\x00\x00\x00\x00\x00\x00\x01\x00\x00", # [24]
- 'unopened' => "\x00\x04\x00\x00\x00\x00\x00\x00\x00", # [5]
- 'unsafe' => "\x00\x00\x00\x00\x00\x00\x54\x55\x00", # [25..31]
- 'untie' => "\x00\x00\x00\x00\x00\x00\x00\x10\x00", # [30]
- 'utf8' => "\x00\x00\x00\x00\x00\x00\x00\x40\x00", # [31]
- 'void' => "\x00\x00\x00\x00\x00\x00\x00\x00\x01", # [32]
- );
-
-%DeadBits = (
- 'all' => "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", # [0..35]
- 'ambiguous' => "\x00\x00\x00\x00\x02\x00\x00\x00\x00", # [16]
- 'closed' => "\x08\x00\x00\x00\x00\x00\x00\x00\x00", # [1]
- 'closure' => "\x00\x00\x00\x00\x00\x00\x20\x00\x00", # [26]
- 'debugging' => "\x00\x00\x00\x02\x00\x00\x00\x00\x00", # [12]
- 'deprecated' => "\x00\x00\x00\x00\x08\x00\x00\x00\x00", # [17]
- 'exec' => "\x20\x00\x00\x00\x00\x00\x00\x00\x00", # [2]
- 'inplace' => "\x00\x00\x00\x08\x00\x00\x00\x00\x00", # [13]
- 'internal' => "\x00\x00\x00\x20\x00\x00\x00\x00\x00", # [14]
- 'io' => "\xaa\x0a\x00\x00\x00\x00\x00\x00\x00", # [0..5]
- 'misc' => "\x00\x20\x00\x00\x00\x00\x00\x00\x00", # [6]
- 'newline' => "\x80\x00\x00\x00\x00\x00\x00\x00\x00", # [3]
- 'numeric' => "\x00\x80\x00\x00\x00\x00\x00\x00\x00", # [7]
- 'octal' => "\x00\x00\x00\x00\x20\x00\x00\x00\x00", # [18]
- 'once' => "\x00\x00\x02\x00\x00\x00\x00\x00\x00", # [8]
- 'parenthesis' => "\x00\x00\x00\x00\x80\x00\x00\x00\x00", # [19]
- 'pipe' => "\x00\x02\x00\x00\x00\x00\x00\x00\x00", # [4]
- 'precedence' => "\x00\x00\x00\x00\x00\x02\x00\x00\x00", # [20]
- 'printf' => "\x00\x00\x00\x00\x00\x08\x00\x00\x00", # [21]
- 'recursion' => "\x00\x00\x08\x00\x00\x00\x00\x00\x00", # [9]
- 'redefine' => "\x00\x00\x20\x00\x00\x00\x00\x00\x00", # [10]
- 'reserved' => "\x00\x00\x00\x00\x00\x20\x00\x00\x00", # [22]
- 'semicolon' => "\x00\x00\x00\x00\x00\x80\x00\x00\x00", # [23]
- 'severe' => "\x00\x00\x80\x2a\x00\x00\x00\x00\x00", # [11..14]
- 'signal' => "\x00\x00\x00\x00\x00\x00\x80\x00\x00", # [27]
- 'substr' => "\x00\x00\x00\x00\x00\x00\x00\x02\x00", # [28]
- 'syntax' => "\x00\x00\x00\x80\xaa\xaa\x00\x00\x00", # [15..23]
- 'taint' => "\x00\x00\x00\x00\x00\x00\x00\x08\x00", # [29]
- 'uninitialized' => "\x00\x00\x00\x00\x00\x00\x02\x00\x00", # [24]
- 'unopened' => "\x00\x08\x00\x00\x00\x00\x00\x00\x00", # [5]
- 'unsafe' => "\x00\x00\x00\x00\x00\x00\xa8\xaa\x00", # [25..31]
- 'untie' => "\x00\x00\x00\x00\x00\x00\x00\x20\x00", # [30]
- 'utf8' => "\x00\x00\x00\x00\x00\x00\x00\x80\x00", # [31]
- 'void' => "\x00\x00\x00\x00\x00\x00\x00\x00\x02", # [32]
- );
-
-
-sub bits {
- my $mask ;
- my $catmask ;
- my $fatal = 0 ;
- foreach my $word (@_) {
- if ($word eq 'FATAL')
- { $fatal = 1 }
- elsif ($catmask = $Bits{$word}) {
- $mask |= $catmask ;
- $mask |= $DeadBits{$word} if $fatal ;
- }
- else
- { croak "unknown warning category '$word'" }
- }
-
- return $mask ;
-}
-
-sub import {
- shift;
- $^B |= bits(@_ ? @_ : 'all') ;
-}
-
-sub unimport {
- shift;
- $^B &= ~ bits(@_ ? @_ : 'all') ;
-}
-
-
-sub make_fatal
-{
- my $self = shift ;
- my $bitmask = $self->bits(@_) ;
- $SIG{__WARN__} =
- sub
- {
- die @_ if $^B & $bitmask ;
- warn @_
- } ;
-}
-
-sub bitmask
-{
- return $^B ;
-}
-
-sub enabled
-{
- my $string = shift ;
-
- return 1
- if $bits{$string} && $^B & $bits{$string} ;
-
- return 0 ;
-}
-
-1;
Perl_safesysmalloc => "Perl_safemalloc",
Perl_safesysrealloc => "Perl_saferealloc",
Perl_set_numeric_local => "perl_set_numeric_local",
- Perl_set_numeric_standard => "perl_set_numeric_standard");
+ Perl_set_numeric_standard => "perl_set_numeric_standard",
+ Perl_malloc => "malloc",
+ Perl_mfree => "free",
+ Perl_realloc => "realloc",
+ Perl_calloc => "calloc",);
my $bincompat5005 = join("|", keys %bincompat5005);
-while (@ARGV)
- {
- my $flag = shift;
- $define{$1} = 1 if ($flag =~ /^-D(\w+)$/);
- $define{$1} = $2 if ($flag =~ /^-D(\w+)=(.+)$/);
- $CCTYPE = $1 if ($flag =~ /^CCTYPE=(\w+)$/);
- $PLATFORM = $1 if ($flag =~ /^PLATFORM=(\w+)$/);
- }
+while (@ARGV) {
+ my $flag = shift;
+ $define{$1} = 1 if ($flag =~ /^-D(\w+)$/);
+ $define{$1} = $2 if ($flag =~ /^-D(\w+)=(.+)$/);
+ $CCTYPE = $1 if ($flag =~ /^CCTYPE=(\w+)$/);
+ $PLATFORM = $1 if ($flag =~ /^PLATFORM=(\w+)$/);
+}
my @PLATFORM = qw(aix win32 os2);
my %PLATFORM;
if ($PLATFORM eq 'aix') {
# Nothing for now.
-} elsif ($PLATFORM eq 'win32') {
+}
+elsif ($PLATFORM eq 'win32') {
$CCTYPE = "MSVC" unless defined $CCTYPE;
foreach ($thrdvar_h, $intrpvar_h, $perlvars_h, $global_sym, $pp_sym, $globvar_sym) {
s!^!..\\!;
unless ($PLATFORM eq 'win32') {
open(CFG,$config_sh) || die "Cannot open $config_sh: $!\n";
- while (<CFG>)
- {
+ while (<CFG>) {
if (/^(?:ccflags|optimize)='(.+)'$/) {
$_ = $1;
$define{$1} = 1 while /-D(\w+)/g;
}
open(CFG,$config_h) || die "Cannot open $config_h: $!\n";
-while (<CFG>)
- {
- $define{$1} = 1 if /^\s*#\s*define\s+(MYMALLOC)\b/;
- $define{$1} = 1 if /^\s*#\s*define\s+(USE_THREADS)\b/;
- $define{$1} = 1 if /^\s*#\s*define\s+(USE_PERLIO)\b/;
- $define{$1} = 1 if /^\s*#\s*define\s+(MULTIPLICITY)\b/;
- $define{$1} = 1 if /^\s*#\s*define\s+(PERL_BINCOMPAT_5005)\b/;
- }
+while (<CFG>) {
+ $define{$1} = 1 if /^\s*#\s*define\s+(MYMALLOC)\b/;
+ $define{$1} = 1 if /^\s*#\s*define\s+(USE_5005THREADS)\b/;
+ $define{$1} = 1 if /^\s*#\s*define\s+(USE_ITHREADS)\b/;
+ $define{$1} = 1 if /^\s*#\s*define\s+(USE_PERLIO)\b/;
+ $define{$1} = 1 if /^\s*#\s*define\s+(MULTIPLICITY)\b/;
+ $define{$1} = 1 if /^\s*#\s*define\s+(PERL_BINCOMPAT_5005)\b/;
+}
close(CFG);
if ($PLATFORM eq 'win32') {
print "EXPORTS\n";
# output_symbol("perl_alloc");
output_symbol("perl_get_host_info");
- output_symbol("perl_alloc_using");
+ output_symbol("perl_alloc_override");
# output_symbol("perl_construct");
# output_symbol("perl_destruct");
# output_symbol("perl_free");
# exit(0);
}
else {
- if ($CCTYPE ne 'GCC') {
- print "LIBRARY Perl\n";
- print "DESCRIPTION 'Perl interpreter, export autogenerated'\n";
- }
- else {
- $define{'PERL_GLOBAL_STRUCT'} = 1;
- $define{'MULTIPLICITY'} = 1;
- }
+ print "LIBRARY Perl\n";
+ print "DESCRIPTION 'Perl interpreter, export autogenerated'\n";
print "EXPORTS\n";
}
-} elsif ($PLATFORM eq 'os2') {
+}
+elsif ($PLATFORM eq 'os2') {
($v = $]) =~ s/(\d\.\d\d\d)(\d\d)$/$1_$2/;
$v .= '-thread' if $ARCHNAME =~ /-thread/;
#$sum = 0;
DATA LOADONCALL NONSHARED MULTIPLE
EXPORTS
---EOP---
-} elsif ($PLATFORM eq 'aix') {
+}
+elsif ($PLATFORM eq 'aix') {
print "#!\n";
}
}
if ($PLATFORM eq 'win32') {
-skip_symbols [qw(
-PL_statusvalue_vms
-PL_archpat_auto
-PL_cryptseen
-PL_DBcv
-PL_generation
-PL_lastgotoprobe
-PL_linestart
-PL_modcount
-PL_pending_ident
-PL_sortcxix
-PL_sublex_info
-PL_timesbuf
-main
-Perl_ErrorNo
-Perl_GetVars
-Perl_do_exec3
-Perl_do_ipcctl
-Perl_do_ipcget
-Perl_do_msgrcv
-Perl_do_msgsnd
-Perl_do_semop
-Perl_do_shmio
-Perl_dump_fds
-Perl_init_thread_intern
-Perl_my_bzero
-Perl_my_htonl
-Perl_my_ntohl
-Perl_my_swap
-Perl_my_chsize
-Perl_same_dirent
-Perl_setenv_getix
-Perl_unlnk
-Perl_watch
-Perl_safexcalloc
-Perl_safexmalloc
-Perl_safexfree
-Perl_safexrealloc
-Perl_my_memcmp
-Perl_my_memset
-PL_cshlen
-PL_cshname
-PL_opsave
-)];
-} elsif ($PLATFORM eq 'aix') {
+ skip_symbols [qw(
+ PL_statusvalue_vms
+ PL_archpat_auto
+ PL_cryptseen
+ PL_DBcv
+ PL_generation
+ PL_lastgotoprobe
+ PL_linestart
+ PL_modcount
+ PL_pending_ident
+ PL_sortcxix
+ PL_sublex_info
+ PL_timesbuf
+ main
+ Perl_ErrorNo
+ Perl_GetVars
+ Perl_do_exec3
+ Perl_do_ipcctl
+ Perl_do_ipcget
+ Perl_do_msgrcv
+ Perl_do_msgsnd
+ Perl_do_semop
+ Perl_do_shmio
+ Perl_dump_fds
+ Perl_init_thread_intern
+ Perl_my_bzero
+ Perl_my_htonl
+ Perl_my_ntohl
+ Perl_my_swap
+ Perl_my_chsize
+ Perl_same_dirent
+ Perl_setenv_getix
+ Perl_unlnk
+ Perl_watch
+ Perl_safexcalloc
+ Perl_safexmalloc
+ Perl_safexfree
+ Perl_safexrealloc
+ Perl_my_memcmp
+ Perl_my_memset
+ PL_cshlen
+ PL_cshname
+ PL_opsave
+ Perl_do_exec
+ Perl_getenv_len
+ Perl_my_pclose
+ Perl_my_popen
+ )];
+}
+elsif ($PLATFORM eq 'aix') {
skip_symbols([qw(
-Perl_dump_fds
-Perl_ErrorNo
-Perl_GetVars
-Perl_my_bcopy
-Perl_my_bzero
-Perl_my_chsize
-Perl_my_htonl
-Perl_my_memcmp
-Perl_my_memset
-Perl_my_ntohl
-Perl_my_swap
-Perl_safexcalloc
-Perl_safexfree
-Perl_safexmalloc
-Perl_safexrealloc
-Perl_same_dirent
-Perl_unlnk
-PL_cryptseen
-PL_opsave
-PL_statusvalue_vms
-PL_sys_intern
-)]);
-}
-
-if ($PLATFORM eq 'os2') {
+ Perl_dump_fds
+ Perl_ErrorNo
+ Perl_GetVars
+ Perl_my_bcopy
+ Perl_my_bzero
+ Perl_my_chsize
+ Perl_my_htonl
+ Perl_my_memcmp
+ Perl_my_memset
+ Perl_my_ntohl
+ Perl_my_swap
+ Perl_safexcalloc
+ Perl_safexfree
+ Perl_safexmalloc
+ Perl_safexrealloc
+ Perl_same_dirent
+ Perl_unlnk
+ PL_cryptseen
+ PL_opsave
+ PL_statusvalue_vms
+ PL_sys_intern
+ )]);
+}
+elsif ($PLATFORM eq 'os2') {
emit_symbols([qw(
-ctermid
-get_sysinfo
-Perl_OS2_init
-OS2_Perl_data
-dlopen
-dlsym
-dlerror
-my_tmpfile
-my_tmpnam
-my_flock
-malloc_mutex
-threads_mutex
-nthreads
-nthreads_cond
-os2_cond_wait
-pthread_join
-pthread_create
-pthread_detach
-XS_Cwd_change_drive
-XS_Cwd_current_drive
-XS_Cwd_extLibpath
-XS_Cwd_extLibpath_set
-XS_Cwd_sys_abspath
-XS_Cwd_sys_chdir
-XS_Cwd_sys_cwd
-XS_Cwd_sys_is_absolute
-XS_Cwd_sys_is_relative
-XS_Cwd_sys_is_rooted
-XS_DynaLoader_mod2fname
-XS_File__Copy_syscopy
-Perl_Register_MQ
-Perl_Deregister_MQ
-Perl_Serve_Messages
-Perl_Process_Messages
-init_PMWIN_entries
-PMWIN_entries
-Perl_hab_GET
-)]);
+ ctermid
+ get_sysinfo
+ Perl_OS2_init
+ OS2_Perl_data
+ dlopen
+ dlsym
+ dlerror
+ my_tmpfile
+ my_tmpnam
+ my_flock
+ malloc_mutex
+ threads_mutex
+ nthreads
+ nthreads_cond
+ os2_cond_wait
+ os2_stat
+ pthread_join
+ pthread_create
+ pthread_detach
+ XS_Cwd_change_drive
+ XS_Cwd_current_drive
+ XS_Cwd_extLibpath
+ XS_Cwd_extLibpath_set
+ XS_Cwd_sys_abspath
+ XS_Cwd_sys_chdir
+ XS_Cwd_sys_cwd
+ XS_Cwd_sys_is_absolute
+ XS_Cwd_sys_is_relative
+ XS_Cwd_sys_is_rooted
+ XS_DynaLoader_mod2fname
+ XS_File__Copy_syscopy
+ Perl_Register_MQ
+ Perl_Deregister_MQ
+ Perl_Serve_Messages
+ Perl_Process_Messages
+ init_PMWIN_entries
+ PMWIN_entries
+ Perl_hab_GET
+ )]);
}
-if ($define{'PERL_OBJECT'}) {
- skip_symbols [qw(
- Perl_getenv_len
- Perl_my_popen
- Perl_my_pclose
- )];
+unless ($define{'DEBUGGING'}) {
+ skip_symbols [qw(
+ Perl_deb
+ Perl_deb_growlevel
+ Perl_debop
+ Perl_debprofdump
+ Perl_debstack
+ Perl_debstackptrs
+ Perl_runops_debug
+ Perl_sv_peek
+ PL_block_type
+ PL_watchaddr
+ PL_watchok
+ )];
+}
+
+if ($define{'PERL_IMPLICIT_SYS'}) {
+ skip_symbols [qw(
+ Perl_getenv_len
+ Perl_my_popen
+ Perl_my_pclose
+ )];
}
else {
- skip_symbols [qw(
- PL_Dir
- PL_Env
- PL_LIO
- PL_Mem
- PL_Proc
- PL_Sock
- PL_StdIO
- )];
-}
-
-if ($define{'MYMALLOC'})
- {
- emit_symbols [qw(
- Perl_dump_mstats
- Perl_malloc
- Perl_mfree
- Perl_realloc
- Perl_calloc)];
- }
-else
- {
- skip_symbols [qw(
- Perl_dump_mstats
- Perl_malloc
- Perl_mfree
- Perl_realloc
- Perl_calloc
- Perl_malloced_size)];
- }
-
-unless ($define{'USE_THREADS'})
- {
- skip_symbols [qw(
-PL_thr_key
-PL_sv_mutex
-PL_strtab_mutex
-PL_svref_mutex
-PL_malloc_mutex
-PL_cred_mutex
-PL_eval_mutex
-PL_eval_cond
-PL_eval_owner
-PL_threads_mutex
-PL_nthreads
-PL_nthreads_cond
-PL_threadnum
-PL_threadsv_names
-PL_thrsv
-PL_vtbl_mutex
-Perl_getTHR
-Perl_setTHR
-Perl_condpair_magic
-Perl_new_struct_thread
-Perl_per_thread_magicals
-Perl_thread_create
-Perl_find_threadsv
-Perl_unlock_condpair
-Perl_magic_mutexfree
-)];
- }
-unless ($define{'USE_THREADS'} or $define{'PERL_IMPLICIT_CONTEXT'}
- or $define{'PERL_OBJECT'})
-{
- skip_symbols [qw(
- Perl_croak_nocontext
- Perl_die_nocontext
- Perl_deb_nocontext
- Perl_form_nocontext
- Perl_warn_nocontext
- Perl_warner_nocontext
- Perl_newSVpvf_nocontext
- Perl_sv_catpvf_nocontext
- Perl_sv_setpvf_nocontext
- Perl_sv_catpvf_mg_nocontext
- Perl_sv_setpvf_mg_nocontext
- )];
- }
-
-unless ($define{'FAKE_THREADS'})
- {
- skip_symbols [qw(PL_curthr)];
- }
-
-sub readvar
-{
- my $file = shift;
- my $proc = shift || sub { "PL_$_[2]" };
- open(VARS,$file) || die "Cannot open $file: $!\n";
- my @syms;
- while (<VARS>)
- {
- # All symbols have a Perl_ prefix because that's what embed.h
- # sticks in front of them.
- push(@syms, &$proc($1,$2,$3)) if (/\bPERLVAR(A?I?C?)\(([IGT])(\w+)/);
- }
- close(VARS);
- return \@syms;
-}
-
-if ($define{'USE_THREADS'} || $define{'MULTIPLICITY'})
- {
- my $thrd = readvar($thrdvar_h);
- skip_symbols $thrd;
- }
-
-if ($define{'MULTIPLICITY'})
- {
- my $interp = readvar($intrpvar_h);
- skip_symbols $interp;
- }
-
-if ($define{'PERL_GLOBAL_STRUCT'})
- {
- my $global = readvar($perlvars_h);
- skip_symbols $global;
- emit_symbols [qw(Perl_GetVars)];
- emit_symbols [qw(PL_Vars PL_VarsPtr)] unless $CCTYPE eq 'GCC';
- }
-
-unless ($define{'DEBUGGING'})
- {
- skip_symbols [qw(
- Perl_deb
- Perl_deb_growlevel
- Perl_debop
- Perl_debprofdump
- Perl_debstack
- Perl_debstackptrs
- Perl_runops_debug
- Perl_sv_peek
- PL_block_type
- PL_watchaddr
- PL_watchok)];
- }
-
-if ($PLATFORM eq 'win32' && $define{'HAVE_DES_FCRYPT'})
- {
- emit_symbols [qw(win32_crypt)];
- }
+ skip_symbols [qw(
+ PL_Mem
+ PL_MemShared
+ PL_MemParse
+ PL_Env
+ PL_StdIO
+ PL_LIO
+ PL_Dir
+ PL_Sock
+ PL_Proc
+ )];
+}
+
+if ($define{'MYMALLOC'}) {
+ emit_symbols [qw(
+ Perl_dump_mstats
+ Perl_malloc
+ Perl_mfree
+ Perl_realloc
+ Perl_calloc
+ )];
+ if ($define{'USE_5005THREADS'} || $define{'USE_ITHREADS'}) {
+ emit_symbols [qw(
+ PL_malloc_mutex
+ )];
+ }
+}
+else {
+ skip_symbols [qw(
+ PL_malloc_mutex
+ Perl_dump_mstats
+ Perl_malloc
+ Perl_mfree
+ Perl_realloc
+ Perl_calloc
+ Perl_malloced_size
+ )];
+}
+
+unless ($define{'USE_5005THREADS'}) {
+ skip_symbols [qw(
+ PL_thr_key
+ PL_sv_mutex
+ PL_strtab_mutex
+ PL_svref_mutex
+ PL_cred_mutex
+ PL_eval_mutex
+ PL_eval_cond
+ PL_eval_owner
+ PL_threads_mutex
+ PL_nthreads
+ PL_nthreads_cond
+ PL_threadnum
+ PL_threadsv_names
+ PL_thrsv
+ PL_vtbl_mutex
+ Perl_getTHR
+ Perl_setTHR
+ Perl_condpair_magic
+ Perl_new_struct_thread
+ Perl_per_thread_magicals
+ Perl_thread_create
+ Perl_find_threadsv
+ Perl_unlock_condpair
+ Perl_magic_mutexfree
+ )];
+}
+
+unless ($define{'USE_ITHREADS'}) {
+ skip_symbols [qw(
+ PL_ptr_table
+ Perl_dirp_dup
+ Perl_cx_dup
+ Perl_si_dup
+ Perl_any_dup
+ Perl_ss_dup
+ Perl_fp_dup
+ Perl_gp_dup
+ Perl_he_dup
+ Perl_mg_dup
+ Perl_re_dup
+ Perl_sv_dup
+ Perl_sys_intern_dup
+ Perl_ptr_table_fetch
+ Perl_ptr_table_new
+ Perl_ptr_table_split
+ Perl_ptr_table_store
+ perl_clone
+ perl_clone_using
+ )];
+}
+
+unless ($define{'PERL_IMPLICIT_CONTEXT'}) {
+ skip_symbols [qw(
+ Perl_croak_nocontext
+ Perl_die_nocontext
+ Perl_deb_nocontext
+ Perl_form_nocontext
+ Perl_mess_nocontext
+ Perl_warn_nocontext
+ Perl_warner_nocontext
+ Perl_newSVpvf_nocontext
+ Perl_sv_catpvf_nocontext
+ Perl_sv_setpvf_nocontext
+ Perl_sv_catpvf_mg_nocontext
+ Perl_sv_setpvf_mg_nocontext
+ )];
+}
+
+unless ($define{'PERL_IMPLICIT_SYS'}) {
+ skip_symbols [qw(
+ perl_alloc_using
+ perl_clone_using
+ )];
+}
+
+unless ($define{'FAKE_THREADS'}) {
+ skip_symbols [qw(PL_curthr)];
+}
+
+sub readvar {
+ my $file = shift;
+ my $proc = shift || sub { "PL_$_[2]" };
+ open(VARS,$file) || die "Cannot open $file: $!\n";
+ my @syms;
+ while (<VARS>) {
+ # All symbols have a Perl_ prefix because that's what embed.h
+ # sticks in front of them.
+ push(@syms, &$proc($1,$2,$3)) if (/\bPERLVAR(A?I?C?)\(([IGT])(\w+)/);
+ }
+ close(VARS);
+ return \@syms;
+}
+
+if ($define{'USE_5005THREADS'} || $define{'MULTIPLICITY'}) {
+ my $thrd = readvar($thrdvar_h);
+ skip_symbols $thrd;
+}
+
+if ($define{'MULTIPLICITY'}) {
+ my $interp = readvar($intrpvar_h);
+ skip_symbols $interp;
+}
+
+if ($define{'PERL_GLOBAL_STRUCT'}) {
+ my $global = readvar($perlvars_h);
+ skip_symbols $global;
+ emit_symbol('Perl_GetVars');
+ emit_symbols [qw(PL_Vars PL_VarsPtr)] unless $CCTYPE eq 'GCC';
+}
# functions from *.sym files
my @syms = ($global_sym, $pp_sym, $globvar_sym);
-if ($define{'USE_PERLIO'})
- {
+if ($define{'USE_PERLIO'}) {
push @syms, $perlio_sym;
- }
-
-for my $syms (@syms)
- {
- open (GLOBAL, "<$syms") || die "failed to open $syms: $!\n";
- while (<GLOBAL>)
- {
- next if (!/^[A-Za-z]/);
- # Functions have a Perl_ prefix
- # Variables have a PL_ prefix
- chomp($_);
- my $symbol = ($syms =~ /var\.sym$/i ? "PL_" : "");
- $symbol .= $_;
- emit_symbol($symbol) unless exists $skip{$symbol};
- }
- close(GLOBAL);
- }
+}
+
+for my $syms (@syms) {
+ open (GLOBAL, "<$syms") || die "failed to open $syms: $!\n";
+ while (<GLOBAL>) {
+ next if (!/^[A-Za-z]/);
+ # Functions have a Perl_ prefix
+ # Variables have a PL_ prefix
+ chomp($_);
+ my $symbol = ($syms =~ /var\.sym$/i ? "PL_" : "");
+ $symbol .= $_;
+ emit_symbol($symbol) unless exists $skip{$symbol};
+ }
+ close(GLOBAL);
+}
# variables
my $glob = readvar($intrpvar_h);
emit_symbols $glob;
}
-
- unless ($define{'MULTIPLICITY'} || $define{'USE_THREADS'}) {
+ unless ($define{'MULTIPLICITY'} || $define{'USE_5005THREADS'}) {
my $glob = readvar($thrdvar_h);
emit_symbols $glob;
}
if ($PLATFORM eq 'win32') {
foreach my $symbol (qw(
-boot_DynaLoader
-Perl_getTHR
-Perl_init_os_extras
-Perl_setTHR
-Perl_thread_create
-Perl_win32_init
-RunPerl
-GetPerlInterpreter
-SetPerlInterpreter
-win32_errno
-win32_environ
-win32_stdin
-win32_stdout
-win32_stderr
-win32_ferror
-win32_feof
-win32_strerror
-win32_fprintf
-win32_printf
-win32_vfprintf
-win32_vprintf
-win32_fread
-win32_fwrite
-win32_fopen
-win32_fdopen
-win32_freopen
-win32_fclose
-win32_fputs
-win32_fputc
-win32_ungetc
-win32_getc
-win32_fileno
-win32_clearerr
-win32_fflush
-win32_ftell
-win32_fseek
-win32_fgetpos
-win32_fsetpos
-win32_rewind
-win32_tmpfile
-win32_abort
-win32_fstat
-win32_stat
-win32_pipe
-win32_popen
-win32_pclose
-win32_rename
-win32_setmode
-win32_lseek
-win32_tell
-win32_dup
-win32_dup2
-win32_open
-win32_close
-win32_eof
-win32_read
-win32_write
-win32_spawnvp
-win32_mkdir
-win32_rmdir
-win32_chdir
-win32_flock
-win32_execv
-win32_execvp
-win32_htons
-win32_ntohs
-win32_htonl
-win32_ntohl
-win32_inet_addr
-win32_inet_ntoa
-win32_socket
-win32_bind
-win32_listen
-win32_accept
-win32_connect
-win32_send
-win32_sendto
-win32_recv
-win32_recvfrom
-win32_shutdown
-win32_closesocket
-win32_ioctlsocket
-win32_setsockopt
-win32_getsockopt
-win32_getpeername
-win32_getsockname
-win32_gethostname
-win32_gethostbyname
-win32_gethostbyaddr
-win32_getprotobyname
-win32_getprotobynumber
-win32_getservbyname
-win32_getservbyport
-win32_select
-win32_endhostent
-win32_endnetent
-win32_endprotoent
-win32_endservent
-win32_getnetent
-win32_getnetbyname
-win32_getnetbyaddr
-win32_getprotoent
-win32_getservent
-win32_sethostent
-win32_setnetent
-win32_setprotoent
-win32_setservent
-win32_getenv
-win32_putenv
-win32_perror
-win32_setbuf
-win32_setvbuf
-win32_flushall
-win32_fcloseall
-win32_fgets
-win32_gets
-win32_fgetc
-win32_putc
-win32_puts
-win32_getchar
-win32_putchar
-win32_malloc
-win32_calloc
-win32_realloc
-win32_free
-win32_sleep
-win32_times
-win32_alarm
-win32_open_osfhandle
-win32_get_osfhandle
-win32_ioctl
-win32_utime
-win32_uname
-win32_wait
-win32_waitpid
-win32_kill
-win32_str_os_error
-win32_opendir
-win32_readdir
-win32_telldir
-win32_seekdir
-win32_rewinddir
-win32_closedir
-win32_longpath
-win32_os_id
- )) {
+ boot_DynaLoader
+ Perl_getTHR
+ Perl_init_os_extras
+ Perl_setTHR
+ Perl_thread_create
+ Perl_win32_init
+ RunPerl
+ GetPerlInterpreter
+ SetPerlInterpreter
+ win32_errno
+ win32_environ
+ win32_stdin
+ win32_stdout
+ win32_stderr
+ win32_ferror
+ win32_feof
+ win32_strerror
+ win32_fprintf
+ win32_printf
+ win32_vfprintf
+ win32_vprintf
+ win32_fread
+ win32_fwrite
+ win32_fopen
+ win32_fdopen
+ win32_freopen
+ win32_fclose
+ win32_fputs
+ win32_fputc
+ win32_ungetc
+ win32_getc
+ win32_fileno
+ win32_clearerr
+ win32_fflush
+ win32_ftell
+ win32_fseek
+ win32_fgetpos
+ win32_fsetpos
+ win32_rewind
+ win32_tmpfile
+ win32_abort
+ win32_fstat
+ win32_stat
+ win32_pipe
+ win32_popen
+ win32_pclose
+ win32_rename
+ win32_setmode
+ win32_lseek
+ win32_tell
+ win32_dup
+ win32_dup2
+ win32_open
+ win32_close
+ win32_eof
+ win32_read
+ win32_write
+ win32_spawnvp
+ win32_mkdir
+ win32_rmdir
+ win32_chdir
+ win32_flock
+ win32_execv
+ win32_execvp
+ win32_htons
+ win32_ntohs
+ win32_htonl
+ win32_ntohl
+ win32_inet_addr
+ win32_inet_ntoa
+ win32_socket
+ win32_bind
+ win32_listen
+ win32_accept
+ win32_connect
+ win32_send
+ win32_sendto
+ win32_recv
+ win32_recvfrom
+ win32_shutdown
+ win32_closesocket
+ win32_ioctlsocket
+ win32_setsockopt
+ win32_getsockopt
+ win32_getpeername
+ win32_getsockname
+ win32_gethostname
+ win32_gethostbyname
+ win32_gethostbyaddr
+ win32_getprotobyname
+ win32_getprotobynumber
+ win32_getservbyname
+ win32_getservbyport
+ win32_select
+ win32_endhostent
+ win32_endnetent
+ win32_endprotoent
+ win32_endservent
+ win32_getnetent
+ win32_getnetbyname
+ win32_getnetbyaddr
+ win32_getprotoent
+ win32_getservent
+ win32_sethostent
+ win32_setnetent
+ win32_setprotoent
+ win32_setservent
+ win32_getenv
+ win32_putenv
+ win32_perror
+ win32_setbuf
+ win32_setvbuf
+ win32_flushall
+ win32_fcloseall
+ win32_fgets
+ win32_gets
+ win32_fgetc
+ win32_putc
+ win32_puts
+ win32_getchar
+ win32_putchar
+ win32_malloc
+ win32_calloc
+ win32_realloc
+ win32_free
+ win32_sleep
+ win32_times
+ win32_access
+ win32_alarm
+ win32_chmod
+ win32_open_osfhandle
+ win32_get_osfhandle
+ win32_ioctl
+ win32_link
+ win32_unlink
+ win32_utime
+ win32_uname
+ win32_wait
+ win32_waitpid
+ win32_kill
+ win32_str_os_error
+ win32_opendir
+ win32_readdir
+ win32_telldir
+ win32_seekdir
+ win32_rewinddir
+ win32_closedir
+ win32_longpath
+ win32_os_id
+ win32_getpid
+ win32_crypt
+ win32_dynaload
+ ))
+ {
try_symbol($symbol);
}
}
elsif ($PLATFORM eq 'os2') {
- open MAP, 'miniperl.map' or die 'Cannot read miniperl.map';
- /^\s*[\da-f:]+\s+(\w+)/i and $mapped{$1}++ foreach <MAP>;
- close MAP or die 'Cannot close miniperl.map';
-
- @missing = grep { !exists $mapped{$_} } keys %export;
- delete $export{$_} foreach @missing;
+ open MAP, 'miniperl.map' or die 'Cannot read miniperl.map';
+ /^\s*[\da-f:]+\s+(\w+)/i and $mapped{$1}++ foreach <MAP>;
+ close MAP or die 'Cannot close miniperl.map';
+
+ @missing = grep { !exists $mapped{$_} and !exists $bincompat5005{$_} }
+ keys %export;
+ delete $export{$_} foreach @missing;
}
# Now all symbols should be defined because
# next we are going to output them.
-foreach my $symbol (sort keys %export)
- {
- output_symbol($symbol);
- }
+foreach my $symbol (sort keys %export) {
+ output_symbol($symbol);
+}
sub emit_symbol {
- my $symbol = shift;
- chomp($symbol);
- $export{$symbol} = 1;
+ my $symbol = shift;
+ chomp($symbol);
+ $export{$symbol} = 1;
}
sub output_symbol {
# print "\t$symbol\n";
# print "\t_$symbol = $symbol\n";
# }
- } elsif ($PLATFORM eq 'os2') {
+ }
+ elsif ($PLATFORM eq 'os2') {
print qq( "$symbol"\n);
- } elsif ($PLATFORM eq 'aix') {
+ }
+ elsif ($PLATFORM eq 'aix') {
print "$symbol\n";
}
}
__DATA__
# extra globals not included above.
perl_alloc
+perl_alloc_using
+perl_clone
+perl_clone_using
perl_construct
perl_destruct
perl_free
-e 's|\\$||' \
-e p \
-e '}' ) >UU/$file.c
+ if [ "$osname" = os390 -a "$file" = perly.c ]; then
+ $echo '#endif' >>UU/$file.c
+ fi
$cppstdin $finc -I. $cppflags $cppminus <UU/$file.c |
$sed \
-e '/^#.*<stdin>/d' \
do_croak:
MALLOC_UNLOCK;
croak("Out of memory during request for %i bytes", size);
+ /* NOTREACHED */
+ return Nullch;
}
#else /* !(defined(PERL_EMERGENCY_SBRK) && defined(PERL_CORE)) */
static void
botch(char *diag, char *s)
{
+ dTHXo;
PerlIO_printf(PerlIO_stderr(), "assertion botched (%s?): %s\n", diag, s);
PerlProc_abort();
}
}
DEBUG_m(PerlIO_printf(Perl_debug_log,
- "0x%lx: (%05lu) malloc %ld bytes\n",
- (unsigned long)(p+1), (unsigned long)(PL_an++),
+ "0x%"UVxf": (%05lu) malloc %ld bytes\n",
+ PTR2UV(p+1), (unsigned long)(PL_an++),
(long)size));
/* remove from linked list */
#if defined(RCHECK)
- if ((PTR2UV(p)) & (MEM_ALIGNBYTES - 1))
- PerlIO_printf(PerlIO_stderr(), "Corrupt malloc ptr 0x%lx at 0x%lx\n",
- (unsigned long)*((int*)p),(unsigned long)p);
+ if ((PTR2UV(p)) & (MEM_ALIGNBYTES - 1)) {
+ dTHXo;
+ PerlIO_printf(PerlIO_stderr(),
+ "Corrupt malloc ptr 0x%lx at 0x%"UVxf"\n",
+ (unsigned long)*((int*)p),PTR2UV(p));
+ }
#endif
nextf[bucket] = p->ov_next;
#endif
DEBUG_m(PerlIO_printf(Perl_debug_log,
- "0x%lx: (%05lu) free\n",
- (unsigned long)cp, (unsigned long)(PL_an++)));
+ "0x%"UVxf": (%05lu) free\n",
+ PTR2UV(cp), (unsigned long)(PL_an++)));
if (cp == NULL)
return;
{
static int bad_free_warn = -1;
if (bad_free_warn == -1) {
+ dTHXo;
char *pbf = PerlEnv_getenv("PERL_BADFREE");
bad_free_warn = (pbf) ? atoi(pbf) : 1;
}
{
static int bad_free_warn = -1;
if (bad_free_warn == -1) {
+ dTHXo;
char *pbf = PerlEnv_getenv("PERL_BADFREE");
bad_free_warn = (pbf) ? atoi(pbf) : 1;
}
if (!bad_free_warn)
- return;
+ return Nullch;
#ifdef RCHECK
warn("%srealloc() %signored",
(ovp->ov_rmagic == RMAGIC - 1 ? "" : "Bad "),
#else
warn("%s", "Bad realloc() ignored");
#endif
- return; /* sanity */
+ return Nullch; /* sanity */
}
onb = BUCKET_SIZE_REAL(bucket);
#endif
res = cp;
DEBUG_m(PerlIO_printf(Perl_debug_log,
- "0x%lx: (%05lu) realloc %ld bytes inplace\n",
- (unsigned long)res,(unsigned long)(PL_an++),
+ "0x%"UVxf": (%05lu) realloc %ld bytes inplace\n",
+ PTR2UV(res),(unsigned long)(PL_an++),
(long)size));
} else if (incr == 1 && (cp - M_OVERHEAD == last_op)
&& (onb > (1 << LOG_OF_MIN_ARENA))) {
} else {
hard_way:
DEBUG_m(PerlIO_printf(Perl_debug_log,
- "0x%lx: (%05lu) realloc %ld bytes the hard way\n",
- (unsigned long)cp,(unsigned long)(PL_an++),
+ "0x%"UVxf": (%05lu) realloc %ld bytes the hard way\n",
+ PTR2UV(cp),(unsigned long)(PL_an++),
(long)size));
if ((res = (char*)Perl_malloc(nbytes)) == NULL)
return (NULL);
}
MALLOC_UNLOCK;
if (s)
- PerlIO_printf(PerlIO_stderr(),
+ PerlIO_printf(Perl_error_log,
"Memory allocation statistics %s (buckets %ld(%ld)..%ld(%ld)\n",
s,
(long)BUCKET_SIZE_REAL(MIN_BUCKET),
(long)BUCKET_SIZE(MIN_BUCKET),
(long)BUCKET_SIZE_REAL(topbucket), (long)BUCKET_SIZE(topbucket));
- PerlIO_printf(PerlIO_stderr(), "%8d free:", totfree);
+ PerlIO_printf(Perl_error_log, "%8d free:", totfree);
for (i = MIN_EVEN_REPORT; i <= topbucket; i += BUCKETS_PER_POW2) {
- PerlIO_printf(PerlIO_stderr(),
+ PerlIO_printf(Perl_error_log,
((i < 8*BUCKETS_PER_POW2 || i == 10*BUCKETS_PER_POW2)
? " %5d"
: ((i < 12*BUCKETS_PER_POW2) ? " %3d" : " %d")),
nfree[i]);
}
#ifdef BUCKETS_ROOT2
- PerlIO_printf(PerlIO_stderr(), "\n\t ");
+ PerlIO_printf(Perl_error_log, "\n\t ");
for (i = MIN_BUCKET + 1; i <= topbucket_odd; i += BUCKETS_PER_POW2) {
- PerlIO_printf(PerlIO_stderr(),
+ PerlIO_printf(Perl_error_log,
((i < 8*BUCKETS_PER_POW2 || i == 10*BUCKETS_PER_POW2)
? " %5d"
: ((i < 12*BUCKETS_PER_POW2) ? " %3d" : " %d")),
nfree[i]);
}
#endif
- PerlIO_printf(PerlIO_stderr(), "\n%8d used:", total - totfree);
+ PerlIO_printf(Perl_error_log, "\n%8d used:", total - totfree);
for (i = MIN_EVEN_REPORT; i <= topbucket; i += BUCKETS_PER_POW2) {
- PerlIO_printf(PerlIO_stderr(),
+ PerlIO_printf(Perl_error_log,
((i < 8*BUCKETS_PER_POW2 || i == 10*BUCKETS_PER_POW2)
? " %5d"
: ((i < 12*BUCKETS_PER_POW2) ? " %3d" : " %d")),
nmalloc[i] - nfree[i]);
}
#ifdef BUCKETS_ROOT2
- PerlIO_printf(PerlIO_stderr(), "\n\t ");
+ PerlIO_printf(Perl_error_log, "\n\t ");
for (i = MIN_BUCKET + 1; i <= topbucket_odd; i += BUCKETS_PER_POW2) {
- PerlIO_printf(PerlIO_stderr(),
+ PerlIO_printf(Perl_error_log,
((i < 8*BUCKETS_PER_POW2 || i == 10*BUCKETS_PER_POW2)
? " %5d"
: ((i < 12*BUCKETS_PER_POW2) ? " %3d" : " %d")),
nmalloc[i] - nfree[i]);
}
#endif
- PerlIO_printf(PerlIO_stderr(), "\nTotal sbrk(): %d/%d:%d. Odd ends: pad+heads+chain+tail: %d+%d+%d+%d.\n",
+ PerlIO_printf(Perl_error_log, "\nTotal sbrk(): %d/%d:%d. Odd ends: pad+heads+chain+tail: %d+%d+%d+%d.\n",
goodsbrk + sbrk_slack, sbrks, sbrk_good, sbrk_slack,
start_slack, total_chain, sbrked_remains);
#endif /* DEBUGGING_MSTATS */
}
}
- DEBUG_m(PerlIO_printf(Perl_debug_log, "sbrk malloc size %ld (reqsize %ld), left size %ld, give addr 0x%lx\n",
- size, reqsize, Perl_sbrk_oldsize, got));
+ DEBUG_m(PerlIO_printf(Perl_debug_log, "sbrk malloc size %ld (reqsize %ld), left size %ld, give addr 0x%"UVxf"\n",
+ size, reqsize, Perl_sbrk_oldsize, PTR2UV(got)));
return (void *)got;
}
MGS* mgs;
assert(SvMAGICAL(sv));
- SAVEDESTRUCTOR(restore_magic, (void*)mgs_ix);
+ SAVEDESTRUCTOR_X(restore_magic, (void*)mgs_ix);
mgs = SSPTR(mgs_ix, MGS*);
mgs->mgs_sv = sv;
for (mg = SvMAGIC(sv); mg; mg = mg->mg_moremagic) {
MGVTBL* vtbl = mg->mg_virtual;
if (vtbl) {
- if ((vtbl->svt_get != NULL) && !(mg->mg_flags & MGf_GSKIP))
+ if (vtbl->svt_get && !(mg->mg_flags & MGf_GSKIP))
SvGMAGICAL_on(sv);
if (vtbl->svt_set)
SvSMAGICAL_on(sv);
- if (!(SvFLAGS(sv) & (SVs_GMG|SVs_SMG)) || (vtbl->svt_clear != NULL))
+ if (!(SvFLAGS(sv) & (SVs_GMG|SVs_SMG)) || vtbl->svt_clear)
SvRMAGICAL_on(sv);
}
}
mgp = &SvMAGIC(sv);
while ((mg = *mgp) != 0) {
MGVTBL* vtbl = mg->mg_virtual;
- if (!(mg->mg_flags & MGf_GSKIP) && vtbl && (vtbl->svt_get != NULL)) {
+ if (!(mg->mg_flags & MGf_GSKIP) && vtbl && vtbl->svt_get) {
CALL_FPTR(vtbl->svt_get)(aTHX_ sv, mg);
/* Ignore this magic if it's been deleted */
if ((mg == (mgp_valid ? *mgp : SvMAGIC(sv))) &&
mg->mg_flags &= ~MGf_GSKIP; /* setting requires another read */
(SSPTR(mgs_ix, MGS*))->mgs_flags = 0;
}
- if (vtbl && (vtbl->svt_set != NULL))
+ if (vtbl && vtbl->svt_set)
CALL_FPTR(vtbl->svt_set)(aTHX_ sv, mg);
}
for (mg = SvMAGIC(sv); mg; mg = mg->mg_moremagic) {
MGVTBL* vtbl = mg->mg_virtual;
- if (vtbl && (vtbl->svt_len != NULL)) {
+ if (vtbl && vtbl->svt_len) {
I32 mgs_ix;
mgs_ix = SSNEW(sizeof(MGS));
for (mg = SvMAGIC(sv); mg; mg = mg->mg_moremagic) {
MGVTBL* vtbl = mg->mg_virtual;
- if (vtbl && (vtbl->svt_len != NULL)) {
+ if (vtbl && vtbl->svt_len) {
I32 mgs_ix;
mgs_ix = SSNEW(sizeof(MGS));
MGVTBL* vtbl = mg->mg_virtual;
/* omit GSKIP -- never set here */
- if (vtbl && (vtbl->svt_clear != NULL))
+ if (vtbl && vtbl->svt_clear)
CALL_FPTR(vtbl->svt_clear)(aTHX_ sv, mg);
}
for (mg = SvMAGIC(sv); mg; mg = moremagic) {
MGVTBL* vtbl = mg->mg_virtual;
moremagic = mg->mg_moremagic;
- if (vtbl && (vtbl->svt_free != NULL))
+ if (vtbl && vtbl->svt_free)
CALL_FPTR(vtbl->svt_free)(aTHX_ sv, mg);
if (mg->mg_ptr && mg->mg_type != 'g')
if (mg->mg_len >= 0)
case '\004': /* ^D */
sv_setiv(sv, (IV)(PL_debug & 32767));
+#if defined(YYDEBUG) && defined(DEBUGGING)
+ PL_yydebug = (PL_debug & 1);
+#endif
break;
case '\005': /* ^E */
+#ifdef MACOS_TRADITIONAL
+ {
+ char msg[256];
+
+ sv_setnv(sv,(double)gLastMacOSErr);
+ sv_setpv(sv, gLastMacOSErr ? GetSysErrText(gLastMacOSErr, msg) : "");
+ }
+#else
#ifdef VMS
{
# include <descrip.h>
#endif
#endif
#endif
+#endif
SvNOK_on(sv); /* what a wonderful hack! */
break;
case '\006': /* ^F */
int saveerrno = errno;
sv_setnv(sv, (NV)errno);
#ifdef OS2
- if (errno == errno_isOS2) sv_setpv(sv, os2error(Perl_rc));
+ if (errno == errno_isOS2 || errno == errno_isOS2_set)
+ sv_setpv(sv, os2error(Perl_rc));
else
#endif
sv_setpv(sv, errno ? Strerror(errno) : "");
break;
case '(':
sv_setiv(sv, (IV)PL_gid);
- Perl_sv_setpvf(aTHX_ sv, "%Vd", (IV)PL_gid);
+#ifdef HAS_GETGROUPS
+ Perl_sv_setpvf(aTHX_ sv, "%"Gid_t_f, PL_gid);
+#endif
goto add_groups;
case ')':
sv_setiv(sv, (IV)PL_egid);
- Perl_sv_setpvf(aTHX_ sv, "%Vd", (IV)PL_egid);
+#ifdef HAS_GETGROUPS
+ Perl_sv_setpvf(aTHX_ sv, "%"Gid_t_f, PL_egid);
+#endif
add_groups:
#ifdef HAS_GETGROUPS
{
Groups_t gary[NGROUPS];
i = getgroups(NGROUPS,gary);
while (--i >= 0)
- Perl_sv_catpvf(aTHX_ sv, " %Vd", (IV)gary[i]);
+ Perl_sv_catpvf(aTHX_ sv, " %"Gid_t_f, gary[i]);
}
#endif
SvIOK_on(sv); /* what a wonderful hack! */
break;
case '*':
break;
+#ifndef MACOS_TRADITIONAL
case '0':
break;
+#endif
#ifdef USE_THREADS
case '@':
sv_setsv(sv, thr->errsv);
#if defined(VMS)
Perl_die(aTHX_ "Can't make list assignment to %%ENV on this system");
#else
-# ifdef WIN32
+# ifdef PERL_IMPLICIT_SYS
+ PerlEnv_clearenv();
+# else
+# ifdef WIN32
char *envv = GetEnvironmentStrings();
char *cur = envv;
STRLEN len;
cur += len+1;
}
FreeEnvironmentStrings(envv);
-# else
-# ifdef CYGWIN
+# else
+# ifdef CYGWIN
I32 i;
for (i = 0; environ[i]; i++)
- Safefree(environ[i]);
-# else
-# ifndef PERL_USE_SAFE_PUTENV
+ safesysfree(environ[i]);
+# else
+# ifndef PERL_USE_SAFE_PUTENV
I32 i;
if (environ == PL_origenviron)
else
for (i = 0; environ[i]; i++)
safesysfree(environ[i]);
-# endif /* PERL_USE_SAFE_PUTENV */
-# endif /* CYGWIN */
+# endif /* PERL_USE_SAFE_PUTENV */
+# endif /* CYGWIN */
environ[0] = Nullch;
-# endif /* WIN32 */
+# endif /* WIN32 */
+# endif /* PERL_IMPLICIT_SYS */
#endif /* VMS */
return 0;
}
svp = &PL_diehook;
else if (strEQ(s,"__WARN__"))
svp = &PL_warnhook;
- else if (strEQ(s,"__PARSE__"))
- svp = &PL_parsehook;
else
Perl_croak(aTHX_ "No such hook: %s", s);
i = 0;
Perl_magic_nextpack(pTHX_ SV *sv, MAGIC *mg, SV *key)
{
dSP;
- char *meth = SvOK(key) ? "NEXTKEY" : "FIRSTKEY";
+ const char *meth = SvOK(key) ? "NEXTKEY" : "FIRSTKEY";
ENTER;
SAVETMPS;
i = SvTRUE(sv);
svp = av_fetch(GvAV(gv),
atoi(MgPV(mg,n_a)), FALSE);
- if (svp && SvIOKp(*svp) && (o = (OP*)SvSTASH(*svp)))
+ if (svp && SvIOKp(*svp) && (o = INT2PTR(OP*,SvIVX(*svp))))
o->op_private = i;
else if (ckWARN_d(WARN_INTERNAL))
Perl_warner(aTHX_ WARN_INTERNAL, "Can't break at that line\n");
DEBUG_x(dump_all());
break;
case '\005': /* ^E */
-#ifdef VMS
- set_vaxc_errno(SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv));
+#ifdef MACOS_TRADITIONAL
+ gLastMacOSErr = SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv);
#else
-# ifdef WIN32
- SetLastError( SvIV(sv) );
+# ifdef VMS
+ set_vaxc_errno(SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv));
# else
-# ifndef OS2
+# ifdef WIN32
+ SetLastError( SvIV(sv) );
+# else
+# ifndef OS2
/* will anyone ever use this? */
SETERRNO(SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv), 4);
+# endif
# endif
# endif
#endif
PL_dowarn |= G_WARN_ONCE ;
}
}
- }
+ }
break;
case '.':
if (PL_localizing) {
if (PL_localizing == 1)
- save_sptr((SV**)&PL_last_in_gv);
+ SAVESPTR(PL_last_in_gv);
}
else if (SvOK(sv) && GvIO(PL_last_in_gv))
IoLINES(GvIOp(PL_last_in_gv)) = (long)SvIV(sv);
case '\\':
if (PL_ors)
Safefree(PL_ors);
- if (SvOK(sv) || SvGMAGICAL(sv))
- PL_ors = savepv(SvPV(sv,PL_orslen));
+ if (SvOK(sv) || SvGMAGICAL(sv)) {
+ s = SvPV(sv,PL_orslen);
+ PL_ors = savepvn(s,PL_orslen);
+ }
else {
PL_ors = Nullch;
PL_orslen = 0;
case ':':
PL_chopset = SvPV_force(sv,len);
break;
+#ifndef MACOS_TRADITIONAL
case '0':
if (!PL_origalen) {
s = PL_origargv[0];
PL_origargv[i] = Nullch;
}
break;
+#endif
#ifdef USE_THREADS
case '@':
sv_setsv(thr->errsv, sv);
Perl_magic_mutexfree(pTHX_ SV *sv, MAGIC *mg)
{
dTHR;
- DEBUG_S(PerlIO_printf(PerlIO_stderr(), "0x%lx: magic_mutexfree 0x%lx\n",
- (unsigned long)thr, (unsigned long)sv);)
+ DEBUG_S(PerlIO_printf(Perl_debug_log,
+ "0x%"UVxf": magic_mutexfree 0x%"UVxf"\n",
+ PTR2UV(thr), PTR2UV(sv));)
if (MgOWNER(mg))
Perl_croak(aTHX_ "panic: magic_mutexfree");
MUTEX_DESTROY(MgMUTEXP(mg));
if (flags & 1) {
PL_savestack_ix += 5; /* Protect save in progress. */
o_save_i = PL_savestack_ix;
- SAVEDESTRUCTOR(unwind_handler_stack, (void*)&flags);
+ SAVEDESTRUCTOR_X(unwind_handler_stack, (void*)&flags);
}
if (flags & 4)
PL_markstack_ptr++; /* Protect mark. */
#ifdef PERL_OBJECT
-#define NO_XSLOCKS
#include "XSUB.h"
#endif
if (PL_savestack_ix == mgs->mgs_ss_ix)
{
I32 popval = SSPOPINT;
- assert(popval == SAVEt_DESTRUCTOR);
+ assert(popval == SAVEt_DESTRUCTOR_X);
PL_savestack_ix -= 2;
popval = SSPOPINT;
assert(popval == SAVEt_ALLOC);
#undef PERLVARIC
#endif
- PERL_SYS_INIT(&argc,&argv);
+ PERL_SYS_INIT3(&argc,&argv,&env);
if (!PL_do_undump) {
my_perl = perl_alloc();
#ifndef SIGILL
# define SIGILL 6 /* blech */
#endif
-#define ABORT() kill(getpid(),SIGABRT);
+#define ABORT() kill(PerlProc_getpid(),SIGABRT);
/*
* fwrite1() should be a routine with the same calling sequence as fwrite(),
uname='$myuname'
config_args='$config_args'
hint=$hint, useposix=$useposix, d_sigaction=$d_sigaction
- usethreads=$usethreads useperlio=$useperlio d_sfio=$d_sfio
- use64bits=$use64bits usemultiplicity=$usemultiplicity
+ usethreads=$usethreads use5005threads=$use5005threads useithreads=$useithreads
+ usesocks=$usesocks useperlio=$useperlio d_sfio=$d_sfio
+ use64bits=$use64bits uselargefiles=$uselargefiles usemultiplicity=$usemultiplicity
Compiler:
cc='$cc', optimize='$optimize', gccversion=$gccversion
cppflags='$cppflags'
#define PL_LIO (*Perl_ILIO_ptr(aTHXo))
#undef PL_Mem
#define PL_Mem (*Perl_IMem_ptr(aTHXo))
+#undef PL_MemParse
+#define PL_MemParse (*Perl_IMemParse_ptr(aTHXo))
+#undef PL_MemShared
+#define PL_MemShared (*Perl_IMemShared_ptr(aTHXo))
#undef PL_Proc
#define PL_Proc (*Perl_IProc_ptr(aTHXo))
#undef PL_Sock
#define PL_StdIO (*Perl_IStdIO_ptr(aTHXo))
#undef PL_amagic_generation
#define PL_amagic_generation (*Perl_Iamagic_generation_ptr(aTHXo))
-#undef PL_ampergv
-#define PL_ampergv (*Perl_Iampergv_ptr(aTHXo))
#undef PL_an
#define PL_an (*Perl_Ian_ptr(aTHXo))
-#undef PL_archpat_auto
-#define PL_archpat_auto (*Perl_Iarchpat_auto_ptr(aTHXo))
#undef PL_argvgv
#define PL_argvgv (*Perl_Iargvgv_ptr(aTHXo))
+#undef PL_argvout_stack
+#define PL_argvout_stack (*Perl_Iargvout_stack_ptr(aTHXo))
#undef PL_argvoutgv
#define PL_argvoutgv (*Perl_Iargvoutgv_ptr(aTHXo))
#undef PL_basetime
#define PL_bufend (*Perl_Ibufend_ptr(aTHXo))
#undef PL_bufptr
#define PL_bufptr (*Perl_Ibufptr_ptr(aTHXo))
-#undef PL_cddir
-#define PL_cddir (*Perl_Icddir_ptr(aTHXo))
#undef PL_collation_ix
#define PL_collation_ix (*Perl_Icollation_ix_ptr(aTHXo))
#undef PL_collation_name
#define PL_curthr (*Perl_Icurthr_ptr(aTHXo))
#undef PL_dbargs
#define PL_dbargs (*Perl_Idbargs_ptr(aTHXo))
-#undef PL_debdelim
-#define PL_debdelim (*Perl_Idebdelim_ptr(aTHXo))
-#undef PL_debname
-#define PL_debname (*Perl_Idebname_ptr(aTHXo))
#undef PL_debstash
#define PL_debstash (*Perl_Idebstash_ptr(aTHXo))
#undef PL_debug
#define PL_defgv (*Perl_Idefgv_ptr(aTHXo))
#undef PL_diehook
#define PL_diehook (*Perl_Idiehook_ptr(aTHXo))
-#undef PL_dlevel
-#define PL_dlevel (*Perl_Idlevel_ptr(aTHXo))
-#undef PL_dlmax
-#define PL_dlmax (*Perl_Idlmax_ptr(aTHXo))
#undef PL_doextract
#define PL_doextract (*Perl_Idoextract_ptr(aTHXo))
#undef PL_doswitches
#define PL_eval_start (*Perl_Ieval_start_ptr(aTHXo))
#undef PL_evalseq
#define PL_evalseq (*Perl_Ievalseq_ptr(aTHXo))
+#undef PL_exit_flags
+#define PL_exit_flags (*Perl_Iexit_flags_ptr(aTHXo))
#undef PL_exitlist
#define PL_exitlist (*Perl_Iexitlist_ptr(aTHXo))
#undef PL_exitlistlen
#define PL_fdpid (*Perl_Ifdpid_ptr(aTHXo))
#undef PL_filemode
#define PL_filemode (*Perl_Ifilemode_ptr(aTHXo))
-#undef PL_filter_debug
-#define PL_filter_debug (*Perl_Ifilter_debug_ptr(aTHXo))
#undef PL_forkprocess
#define PL_forkprocess (*Perl_Iforkprocess_ptr(aTHXo))
#undef PL_formfeed
#define PL_last_uni (*Perl_Ilast_uni_ptr(aTHXo))
#undef PL_lastfd
#define PL_lastfd (*Perl_Ilastfd_ptr(aTHXo))
-#undef PL_lastsize
-#define PL_lastsize (*Perl_Ilastsize_ptr(aTHXo))
-#undef PL_lastspbase
-#define PL_lastspbase (*Perl_Ilastspbase_ptr(aTHXo))
#undef PL_laststatval
#define PL_laststatval (*Perl_Ilaststatval_ptr(aTHXo))
#undef PL_laststype
#define PL_laststype (*Perl_Ilaststype_ptr(aTHXo))
-#undef PL_leftgv
-#define PL_leftgv (*Perl_Ileftgv_ptr(aTHXo))
#undef PL_lex_brackets
#define PL_lex_brackets (*Perl_Ilex_brackets_ptr(aTHXo))
#undef PL_lex_brackstack
#define PL_lex_dojoin (*Perl_Ilex_dojoin_ptr(aTHXo))
#undef PL_lex_expect
#define PL_lex_expect (*Perl_Ilex_expect_ptr(aTHXo))
-#undef PL_lex_fakebrack
-#define PL_lex_fakebrack (*Perl_Ilex_fakebrack_ptr(aTHXo))
#undef PL_lex_formbrack
#define PL_lex_formbrack (*Perl_Ilex_formbrack_ptr(aTHXo))
#undef PL_lex_inpat
#define PL_main_root (*Perl_Imain_root_ptr(aTHXo))
#undef PL_main_start
#define PL_main_start (*Perl_Imain_start_ptr(aTHXo))
-#undef PL_malloc_mutex
-#define PL_malloc_mutex (*Perl_Imalloc_mutex_ptr(aTHXo))
#undef PL_max_intro_pending
#define PL_max_intro_pending (*Perl_Imax_intro_pending_ptr(aTHXo))
#undef PL_maxo
#define PL_multi_start (*Perl_Imulti_start_ptr(aTHXo))
#undef PL_multiline
#define PL_multiline (*Perl_Imultiline_ptr(aTHXo))
-#undef PL_mystrk
-#define PL_mystrk (*Perl_Imystrk_ptr(aTHXo))
#undef PL_nexttoke
#define PL_nexttoke (*Perl_Inexttoke_ptr(aTHXo))
#undef PL_nexttype
#define PL_ofmt (*Perl_Iofmt_ptr(aTHXo))
#undef PL_oldbufptr
#define PL_oldbufptr (*Perl_Ioldbufptr_ptr(aTHXo))
-#undef PL_oldlastpm
-#define PL_oldlastpm (*Perl_Ioldlastpm_ptr(aTHXo))
#undef PL_oldname
#define PL_oldname (*Perl_Ioldname_ptr(aTHXo))
#undef PL_oldoldbufptr
#define PL_padix (*Perl_Ipadix_ptr(aTHXo))
#undef PL_padix_floor
#define PL_padix_floor (*Perl_Ipadix_floor_ptr(aTHXo))
-#undef PL_parsehook
-#define PL_parsehook (*Perl_Iparsehook_ptr(aTHXo))
#undef PL_patchlevel
#define PL_patchlevel (*Perl_Ipatchlevel_ptr(aTHXo))
#undef PL_pending_ident
#define PL_preprocess (*Perl_Ipreprocess_ptr(aTHXo))
#undef PL_profiledata
#define PL_profiledata (*Perl_Iprofiledata_ptr(aTHXo))
+#undef PL_psig_name
+#define PL_psig_name (*Perl_Ipsig_name_ptr(aTHXo))
+#undef PL_psig_ptr
+#define PL_psig_ptr (*Perl_Ipsig_ptr_ptr(aTHXo))
+#undef PL_ptr_table
+#define PL_ptr_table (*Perl_Iptr_table_ptr(aTHXo))
#undef PL_replgv
#define PL_replgv (*Perl_Ireplgv_ptr(aTHXo))
-#undef PL_rightgv
-#define PL_rightgv (*Perl_Irightgv_ptr(aTHXo))
#undef PL_rsfp
#define PL_rsfp (*Perl_Irsfp_ptr(aTHXo))
#undef PL_rsfp_filters
#define PL_runops (*Perl_Irunops_ptr(aTHXo))
#undef PL_sawampersand
#define PL_sawampersand (*Perl_Isawampersand_ptr(aTHXo))
-#undef PL_sawstudy
-#define PL_sawstudy (*Perl_Isawstudy_ptr(aTHXo))
-#undef PL_sawvec
-#define PL_sawvec (*Perl_Isawvec_ptr(aTHXo))
#undef PL_sh_path
#define PL_sh_path (*Perl_Ish_path_ptr(aTHXo))
-#undef PL_siggv
-#define PL_siggv (*Perl_Isiggv_ptr(aTHXo))
#undef PL_sighandlerp
#define PL_sighandlerp (*Perl_Isighandlerp_ptr(aTHXo))
#undef PL_splitstr
#define PL_statusvalue (*Perl_Istatusvalue_ptr(aTHXo))
#undef PL_statusvalue_vms
#define PL_statusvalue_vms (*Perl_Istatusvalue_vms_ptr(aTHXo))
+#undef PL_stderrgv
+#define PL_stderrgv (*Perl_Istderrgv_ptr(aTHXo))
#undef PL_stdingv
#define PL_stdingv (*Perl_Istdingv_ptr(aTHXo))
-#undef PL_strchop
-#define PL_strchop (*Perl_Istrchop_ptr(aTHXo))
+#undef PL_stopav
+#define PL_stopav (*Perl_Istopav_ptr(aTHXo))
#undef PL_strtab
#define PL_strtab (*Perl_Istrtab_ptr(aTHXo))
#undef PL_strtab_mutex
#define PL_sys_intern (*Perl_Isys_intern_ptr(aTHXo))
#undef PL_tainting
#define PL_tainting (*Perl_Itainting_ptr(aTHXo))
-#undef PL_thisexpr
-#define PL_thisexpr (*Perl_Ithisexpr_ptr(aTHXo))
#undef PL_thr_key
#define PL_thr_key (*Perl_Ithr_key_ptr(aTHXo))
#undef PL_threadnum
#define PL_do_undump (*Perl_Gdo_undump_ptr(NULL))
#undef PL_hexdigit
#define PL_hexdigit (*Perl_Ghexdigit_ptr(NULL))
+#undef PL_malloc_mutex
+#define PL_malloc_mutex (*Perl_Gmalloc_mutex_ptr(NULL))
#undef PL_patleave
#define PL_patleave (*Perl_Gpatleave_ptr(NULL))
/* XXX soon to be eliminated, only a few things in PERLCORE need these now */
+#if defined(PERL_IMPLICIT_SYS)
+#else
+#endif
+#if defined(USE_ITHREADS)
+# if defined(PERL_IMPLICIT_SYS)
+# endif
+#endif
+#if defined(MYMALLOC)
+#endif
+#if defined(PERL_OBJECT)
+#ifndef __BORLANDC__
+#endif
+#endif
#if defined(PERL_OBJECT)
+#else
#endif
#undef Perl_amagic_call
#define Perl_amagic_call pPerl->Perl_amagic_call
#define Perl_apply pPerl->Perl_apply
#undef apply
#define apply Perl_apply
+#undef Perl_avhv_delete_ent
+#define Perl_avhv_delete_ent pPerl->Perl_avhv_delete_ent
+#undef avhv_delete_ent
+#define avhv_delete_ent Perl_avhv_delete_ent
#undef Perl_avhv_exists_ent
#define Perl_avhv_exists_ent pPerl->Perl_avhv_exists_ent
#undef avhv_exists_ent
#define Perl_av_clear pPerl->Perl_av_clear
#undef av_clear
#define av_clear Perl_av_clear
+#undef Perl_av_delete
+#define Perl_av_delete pPerl->Perl_av_delete
+#undef av_delete
+#define av_delete Perl_av_delete
+#undef Perl_av_exists
+#define Perl_av_exists pPerl->Perl_av_exists
+#undef av_exists
+#define av_exists Perl_av_exists
#undef Perl_av_extend
#define Perl_av_extend pPerl->Perl_av_extend
#undef av_extend
#define Perl_vdeb pPerl->Perl_vdeb
#undef vdeb
#define vdeb Perl_vdeb
-#undef Perl_deb_growlevel
-#define Perl_deb_growlevel pPerl->Perl_deb_growlevel
-#undef deb_growlevel
-#define deb_growlevel Perl_deb_growlevel
#undef Perl_debprofdump
#define Perl_debprofdump pPerl->Perl_debprofdump
#undef debprofdump
#define Perl_magicname pPerl->Perl_magicname
#undef magicname
#define magicname Perl_magicname
-#if defined(MYMALLOC)
-#undef Perl_malloced_size
-#define Perl_malloced_size pPerl->Perl_malloced_size
-#undef malloced_size
-#define malloced_size Perl_malloced_size
-#endif
#undef Perl_markstack_grow
#define Perl_markstack_grow pPerl->Perl_markstack_grow
#undef markstack_grow
#define Perl_newLISTOP pPerl->Perl_newLISTOP
#undef newLISTOP
#define newLISTOP Perl_newLISTOP
+#undef Perl_newPADOP
+#define Perl_newPADOP pPerl->Perl_newPADOP
+#undef newPADOP
+#define newPADOP Perl_newPADOP
#undef Perl_newPMOP
#define Perl_newPMOP pPerl->Perl_newPMOP
#undef newPMOP
#undef peep
#define peep Perl_peep
#if defined(PERL_OBJECT)
-#undef perl_construct
-#define perl_construct pPerl->perl_construct
-#undef perl_destruct
-#define perl_destruct pPerl->perl_destruct
-#undef perl_free
-#define perl_free pPerl->perl_free
-#undef perl_run
-#define perl_run pPerl->perl_run
-#undef perl_parse
-#define perl_parse pPerl->perl_parse
-#else
-#undef perl_alloc
-#define perl_alloc pPerl->perl_alloc
-#undef perl_construct
-#define perl_construct pPerl->perl_construct
-#undef perl_destruct
-#define perl_destruct pPerl->perl_destruct
-#undef perl_free
-#define perl_free pPerl->perl_free
-#undef perl_run
-#define perl_run pPerl->perl_run
-#undef perl_parse
-#define perl_parse pPerl->perl_parse
+#undef Perl_construct
+#define Perl_construct pPerl->Perl_construct
+#undef Perl_destruct
+#define Perl_destruct pPerl->Perl_destruct
+#undef Perl_free
+#define Perl_free pPerl->Perl_free
+#undef Perl_run
+#define Perl_run pPerl->Perl_run
+#undef Perl_parse
+#define Perl_parse pPerl->Perl_parse
+#endif
#if defined(USE_THREADS)
#undef Perl_new_struct_thread
#define Perl_new_struct_thread pPerl->Perl_new_struct_thread
#undef new_struct_thread
#define new_struct_thread Perl_new_struct_thread
#endif
-#endif
#undef Perl_call_atexit
#define Perl_call_atexit pPerl->Perl_call_atexit
#undef call_atexit
#define Perl_save_destructor pPerl->Perl_save_destructor
#undef save_destructor
#define save_destructor Perl_save_destructor
+#undef Perl_save_destructor_x
+#define Perl_save_destructor_x pPerl->Perl_save_destructor_x
+#undef save_destructor_x
+#define save_destructor_x Perl_save_destructor_x
#undef Perl_save_freesv
#define Perl_save_freesv pPerl->Perl_save_freesv
#undef save_freesv
#define Perl_save_I32 pPerl->Perl_save_I32
#undef save_I32
#define save_I32 Perl_save_I32
+#undef Perl_save_I8
+#define Perl_save_I8 pPerl->Perl_save_I8
+#undef save_I8
+#define save_I8 Perl_save_I8
#undef Perl_save_int
#define Perl_save_int pPerl->Perl_save_int
#undef save_int
#define Perl_save_pptr pPerl->Perl_save_pptr
#undef save_pptr
#define save_pptr Perl_save_pptr
+#undef Perl_save_vptr
+#define Perl_save_vptr pPerl->Perl_save_vptr
+#undef save_vptr
+#define save_vptr Perl_save_vptr
#undef Perl_save_re_context
#define Perl_save_re_context pPerl->Perl_save_re_context
#undef save_re_context
#define Perl_sv_2pv pPerl->Perl_sv_2pv
#undef sv_2pv
#define sv_2pv Perl_sv_2pv
+#undef Perl_sv_2pvutf8
+#define Perl_sv_2pvutf8 pPerl->Perl_sv_2pvutf8
+#undef sv_2pvutf8
+#define sv_2pvutf8 Perl_sv_2pvutf8
+#undef Perl_sv_2pvbyte
+#define Perl_sv_2pvbyte pPerl->Perl_sv_2pvbyte
+#undef sv_2pvbyte
+#define sv_2pvbyte Perl_sv_2pvbyte
#undef Perl_sv_2uv
#define Perl_sv_2uv pPerl->Perl_sv_2uv
#undef sv_2uv
#define Perl_sv_pvn pPerl->Perl_sv_pvn
#undef sv_pvn
#define sv_pvn Perl_sv_pvn
+#undef Perl_sv_pvutf8n
+#define Perl_sv_pvutf8n pPerl->Perl_sv_pvutf8n
+#undef sv_pvutf8n
+#define sv_pvutf8n Perl_sv_pvutf8n
+#undef Perl_sv_pvbyten
+#define Perl_sv_pvbyten pPerl->Perl_sv_pvbyten
+#undef sv_pvbyten
+#define sv_pvbyten Perl_sv_pvbyten
#undef Perl_sv_true
#define Perl_sv_true pPerl->Perl_sv_true
#undef sv_true
#define Perl_sv_pvn_force pPerl->Perl_sv_pvn_force
#undef sv_pvn_force
#define sv_pvn_force Perl_sv_pvn_force
+#undef Perl_sv_pvutf8n_force
+#define Perl_sv_pvutf8n_force pPerl->Perl_sv_pvutf8n_force
+#undef sv_pvutf8n_force
+#define sv_pvutf8n_force Perl_sv_pvutf8n_force
+#undef Perl_sv_pvbyten_force
+#define Perl_sv_pvbyten_force pPerl->Perl_sv_pvbyten_force
+#undef sv_pvbyten_force
+#define sv_pvbyten_force Perl_sv_pvbyten_force
#undef Perl_sv_reftype
#define Perl_sv_reftype pPerl->Perl_sv_reftype
#undef sv_reftype
#define Perl_wait4pid pPerl->Perl_wait4pid
#undef wait4pid
#define wait4pid Perl_wait4pid
+#undef Perl_report_uninit
+#define Perl_report_uninit pPerl->Perl_report_uninit
+#undef report_uninit
+#define report_uninit Perl_report_uninit
#undef Perl_warn
#define Perl_warn pPerl->Perl_warn
#undef warn
#define Perl_dump_mstats pPerl->Perl_dump_mstats
#undef dump_mstats
#define dump_mstats Perl_dump_mstats
-#undef Perl_malloc
-#define Perl_malloc pPerl->Perl_malloc
-#undef malloc
-#define malloc Perl_malloc
-#undef Perl_calloc
-#define Perl_calloc pPerl->Perl_calloc
-#undef calloc
-#define calloc Perl_calloc
-#undef Perl_realloc
-#define Perl_realloc pPerl->Perl_realloc
-#undef realloc
-#define realloc Perl_realloc
-#undef Perl_mfree
-#define Perl_mfree pPerl->Perl_mfree
-#undef mfree
-#define mfree Perl_mfree
#endif
#undef Perl_safesysmalloc
#define Perl_safesysmalloc pPerl->Perl_safesysmalloc
#define Perl_sv_2pv_nolen pPerl->Perl_sv_2pv_nolen
#undef sv_2pv_nolen
#define sv_2pv_nolen Perl_sv_2pv_nolen
+#undef Perl_sv_2pvutf8_nolen
+#define Perl_sv_2pvutf8_nolen pPerl->Perl_sv_2pvutf8_nolen
+#undef sv_2pvutf8_nolen
+#define sv_2pvutf8_nolen Perl_sv_2pvutf8_nolen
+#undef Perl_sv_2pvbyte_nolen
+#define Perl_sv_2pvbyte_nolen pPerl->Perl_sv_2pvbyte_nolen
+#undef sv_2pvbyte_nolen
+#define sv_2pvbyte_nolen Perl_sv_2pvbyte_nolen
#undef Perl_sv_pv
#define Perl_sv_pv pPerl->Perl_sv_pv
#undef sv_pv
#define sv_pv Perl_sv_pv
+#undef Perl_sv_pvutf8
+#define Perl_sv_pvutf8 pPerl->Perl_sv_pvutf8
+#undef sv_pvutf8
+#define sv_pvutf8 Perl_sv_pvutf8
+#undef Perl_sv_pvbyte
+#define Perl_sv_pvbyte pPerl->Perl_sv_pvbyte
+#undef sv_pvbyte
+#define sv_pvbyte Perl_sv_pvbyte
#undef Perl_sv_force_normal
#define Perl_sv_force_normal pPerl->Perl_sv_force_normal
#undef sv_force_normal
#define Perl_boot_core_xsutils pPerl->Perl_boot_core_xsutils
#undef boot_core_xsutils
#define boot_core_xsutils Perl_boot_core_xsutils
+#if defined(USE_ITHREADS)
+#undef Perl_cx_dup
+#define Perl_cx_dup pPerl->Perl_cx_dup
+#undef cx_dup
+#define cx_dup Perl_cx_dup
+#undef Perl_si_dup
+#define Perl_si_dup pPerl->Perl_si_dup
+#undef si_dup
+#define si_dup Perl_si_dup
+#undef Perl_ss_dup
+#define Perl_ss_dup pPerl->Perl_ss_dup
+#undef ss_dup
+#define ss_dup Perl_ss_dup
+#undef Perl_any_dup
+#define Perl_any_dup pPerl->Perl_any_dup
+#undef any_dup
+#define any_dup Perl_any_dup
+#undef Perl_he_dup
+#define Perl_he_dup pPerl->Perl_he_dup
+#undef he_dup
+#define he_dup Perl_he_dup
+#undef Perl_re_dup
+#define Perl_re_dup pPerl->Perl_re_dup
+#undef re_dup
+#define re_dup Perl_re_dup
+#undef Perl_fp_dup
+#define Perl_fp_dup pPerl->Perl_fp_dup
+#undef fp_dup
+#define fp_dup Perl_fp_dup
+#undef Perl_dirp_dup
+#define Perl_dirp_dup pPerl->Perl_dirp_dup
+#undef dirp_dup
+#define dirp_dup Perl_dirp_dup
+#undef Perl_gp_dup
+#define Perl_gp_dup pPerl->Perl_gp_dup
+#undef gp_dup
+#define gp_dup Perl_gp_dup
+#undef Perl_mg_dup
+#define Perl_mg_dup pPerl->Perl_mg_dup
+#undef mg_dup
+#define mg_dup Perl_mg_dup
+#undef Perl_sv_dup
+#define Perl_sv_dup pPerl->Perl_sv_dup
+#undef sv_dup
+#define sv_dup Perl_sv_dup
+#if defined(HAVE_INTERP_INTERN)
+#undef Perl_sys_intern_dup
+#define Perl_sys_intern_dup pPerl->Perl_sys_intern_dup
+#undef sys_intern_dup
+#define sys_intern_dup Perl_sys_intern_dup
+#endif
+#undef Perl_ptr_table_new
+#define Perl_ptr_table_new pPerl->Perl_ptr_table_new
+#undef ptr_table_new
+#define ptr_table_new Perl_ptr_table_new
+#undef Perl_ptr_table_fetch
+#define Perl_ptr_table_fetch pPerl->Perl_ptr_table_fetch
+#undef ptr_table_fetch
+#define ptr_table_fetch Perl_ptr_table_fetch
+#undef Perl_ptr_table_store
+#define Perl_ptr_table_store pPerl->Perl_ptr_table_store
+#undef ptr_table_store
+#define ptr_table_store Perl_ptr_table_store
+#undef Perl_ptr_table_split
+#define Perl_ptr_table_split pPerl->Perl_ptr_table_split
+#undef ptr_table_split
+#define ptr_table_split Perl_ptr_table_split
+#endif
#if defined(PERL_OBJECT)
+#else
#endif
#if defined(PERL_IN_AV_C) || defined(PERL_DECL_PROT)
#endif
#if defined(PERL_IN_TOKE_C) || defined(PERL_DECL_PROT)
# if defined(CRIPPLED_CC)
# endif
-# if defined(WIN32)
+# if defined(PERL_CR_FILTER)
# endif
#endif
#if defined(PERL_IN_UNIVERSAL_C) || defined(PERL_DECL_PROT)
# if defined(LEAKTEST)
# endif
#endif
+#if defined(PERL_OBJECT)
+#endif
#undef Perl_ck_anoncode
#define Perl_ck_anoncode pPerl->Perl_ck_anoncode
#undef ck_anoncode
#include "keywords.h"
/* #define PL_OP_SLAB_ALLOC */
-
+
+/* XXXXXX testing */
+#ifdef USE_ITHREADS
+# define OP_REFCNT_LOCK NOOP
+# define OP_REFCNT_UNLOCK NOOP
+# define OpREFCNT_set(o,n) ((o)->op_targ = (n))
+# define OpREFCNT_dec(o) (--(o)->op_targ)
+#else
+# define OP_REFCNT_LOCK NOOP
+# define OP_REFCNT_UNLOCK NOOP
+# define OpREFCNT_set(o,n) NOOP
+# define OpREFCNT_dec(o) 0
+#endif
+
#ifdef PL_OP_SLAB_ALLOC
#define SLAB_SIZE 8192
static char *PL_OpPtr = NULL;
{
qerror(Perl_mess(aTHX_
"Bareword \"%s\" not allowed while \"strict subs\" in use",
- SvPV_nolen(cSVOPo->op_sv)));
+ SvPV_nolen(cSVOPo_sv)));
}
/* "register" allocation */
&& (SvIVX(sv) == PAD_MAX || SvIVX(sv) == 0)
&& strEQ(name, SvPVX(sv)))
{
- Perl_warner(aTHX_ WARN_UNSAFE,
+ if (PL_in_my != KEY_our
+ || GvSTASH(sv) == (PL_curstash ? PL_curstash : PL_defstash))
+ {
+ Perl_warner(aTHX_ WARN_UNSAFE,
"\"%s\" variable %s masks earlier declaration in same %s",
(PL_in_my == KEY_our ? "our" : "my"),
name,
(SvIVX(sv) == PAD_MAX ? "scope" : "statement"));
+ }
break;
}
}
SvSTASH(sv) = (HV*)SvREFCNT_inc(PL_in_my_stash);
PL_sv_objcount++;
}
- if (PL_in_my == KEY_our)
+ if (PL_in_my == KEY_our) {
+ (void)SvUPGRADE(sv, SVt_PVGV);
+ GvSTASH(sv) = (HV*)SvREFCNT_inc(PL_curstash ? PL_curstash : PL_defstash);
SvFLAGS(sv) |= SVpad_OUR;
+ }
av_store(PL_comppad_name, off, sv);
SvNVX(sv) = (NV)PAD_MAX;
SvIVX(sv) = 0; /* Not yet introduced--see newSTATEOP */
SvNVX(namesv) = (NV)PL_curcop->cop_seq;
SvIVX(namesv) = PAD_MAX; /* A ref, intro immediately */
SvFAKE_on(namesv); /* A ref, not a real var */
- if (SvFLAGS(sv) & SVpad_OUR)/* An "our" variable */
+ if (SvFLAGS(sv) & SVpad_OUR) { /* An "our" variable */
SvFLAGS(namesv) |= SVpad_OUR;
+ (void)SvUPGRADE(namesv, SVt_PVGV);
+ GvSTASH(namesv) = (HV*)SvREFCNT_inc((SV*)GvSTASH(sv));
+ }
if (SvOBJECT(sv)) { /* A typed var */
SvOBJECT_on(namesv);
(void)SvUPGRADE(namesv, SVt_PVMG);
return 0;
}
break;
+ case CXt_FORMAT:
case CXt_SUB:
if (!saweval)
return 0;
(sv = names[PL_padix]) && sv != &PL_sv_undef)
continue;
sv = *av_fetch(PL_comppad, PL_padix, TRUE);
- if (!(SvFLAGS(sv) & (SVs_PADTMP|SVs_PADMY)))
+ if (!(SvFLAGS(sv) & (SVs_PADTMP|SVs_PADMY)) && !IS_PADGV(sv))
break;
}
retval = PL_padix;
SvFLAGS(sv) |= tmptype;
PL_curpad = AvARRAY(PL_comppad);
#ifdef USE_THREADS
- DEBUG_X(PerlIO_printf(Perl_debug_log, "0x%lx Pad 0x%lx alloc %ld for %s\n",
- (unsigned long) thr, (unsigned long) PL_curpad,
+ DEBUG_X(PerlIO_printf(Perl_debug_log,
+ "0x%"UVxf" Pad 0x%"UVxf" alloc %ld for %s\n",
+ PTR2UV(thr), PTR2UV(PL_curpad),
(long) retval, PL_op_name[optype]));
#else
- DEBUG_X(PerlIO_printf(Perl_debug_log, "Pad 0x%lx alloc %ld for %s\n",
- (unsigned long) PL_curpad,
+ DEBUG_X(PerlIO_printf(Perl_debug_log,
+ "Pad 0x%"UVxf" alloc %ld for %s\n",
+ PTR2UV(PL_curpad),
(long) retval, PL_op_name[optype]));
#endif /* USE_THREADS */
return (PADOFFSET)retval;
{
dTHR;
#ifdef USE_THREADS
- DEBUG_X(PerlIO_printf(Perl_debug_log, "0x%lx Pad 0x%lx sv %d\n",
- (unsigned long) thr, (unsigned long) PL_curpad, po));
+ DEBUG_X(PerlIO_printf(Perl_debug_log,
+ "0x%"UVxf" Pad 0x%"UVxf" sv %"IVdf"\n",
+ PTR2UV(thr), PTR2UV(PL_curpad), (IV)po));
#else
if (!po)
Perl_croak(aTHX_ "panic: pad_sv po");
- DEBUG_X(PerlIO_printf(Perl_debug_log, "Pad 0x%lx sv %d\n",
- (unsigned long) PL_curpad, po));
+ DEBUG_X(PerlIO_printf(Perl_debug_log, "Pad 0x%"UVxf" sv %"IVdf"\n",
+ PTR2UV(PL_curpad), (IV)po));
#endif /* USE_THREADS */
return PL_curpad[po]; /* eventually we'll turn this into a macro */
}
if (!po)
Perl_croak(aTHX_ "panic: pad_free po");
#ifdef USE_THREADS
- DEBUG_X(PerlIO_printf(Perl_debug_log, "0x%lx Pad 0x%lx free %d\n",
- (unsigned long) thr, (unsigned long) PL_curpad, po));
+ DEBUG_X(PerlIO_printf(Perl_debug_log,
+ "0x%"UVxf" Pad 0x%"UVxf" free %"IVdf"\n",
+ PTR2UV(thr), PTR2UV(PL_curpad), (IV)po));
#else
- DEBUG_X(PerlIO_printf(Perl_debug_log, "Pad 0x%lx free %d\n",
- (unsigned long) PL_curpad, po));
+ DEBUG_X(PerlIO_printf(Perl_debug_log, "Pad 0x%"UVxf" free %"IVdf"\n",
+ PTR2UV(PL_curpad), (IV)po));
#endif /* USE_THREADS */
- if (PL_curpad[po] && PL_curpad[po] != &PL_sv_undef)
+ if (PL_curpad[po] && PL_curpad[po] != &PL_sv_undef) {
SvPADTMP_off(PL_curpad[po]);
+#ifdef USE_ITHREADS
+ SvREADONLY_off(PL_curpad[po]); /* could be a freed constant */
+#endif
+ }
if ((I32)po < PL_padix)
PL_padix = po - 1;
}
if (!po)
Perl_croak(aTHX_ "panic: pad_swipe po");
#ifdef USE_THREADS
- DEBUG_X(PerlIO_printf(Perl_debug_log, "0x%lx Pad 0x%lx swipe %d\n",
- (unsigned long) thr, (unsigned long) PL_curpad, po));
+ DEBUG_X(PerlIO_printf(Perl_debug_log,
+ "0x%"UVxf" Pad 0x%"UVxf" swipe %"IVdf"\n",
+ PTR2UV(thr), PTR2UV(PL_curpad), (IV)po));
#else
- DEBUG_X(PerlIO_printf(Perl_debug_log, "Pad 0x%lx swipe %d\n",
- (unsigned long) PL_curpad, po));
+ DEBUG_X(PerlIO_printf(Perl_debug_log, "Pad 0x%"UVxf" swipe %"IVdf"\n",
+ PTR2UV(PL_curpad), (IV)po));
#endif /* USE_THREADS */
SvPADTMP_off(PL_curpad[po]);
PL_curpad[po] = NEWSV(1107,0);
if (AvARRAY(PL_comppad) != PL_curpad)
Perl_croak(aTHX_ "panic: pad_reset curpad");
#ifdef USE_THREADS
- DEBUG_X(PerlIO_printf(Perl_debug_log, "0x%lx Pad 0x%lx reset\n",
- (unsigned long) thr, (unsigned long) PL_curpad));
+ DEBUG_X(PerlIO_printf(Perl_debug_log,
+ "0x%"UVxf" Pad 0x%"UVxf" reset\n",
+ PTR2UV(thr), PTR2UV(PL_curpad)));
#else
- DEBUG_X(PerlIO_printf(Perl_debug_log, "Pad 0x%lx reset\n",
- (unsigned long) PL_curpad));
+ DEBUG_X(PerlIO_printf(Perl_debug_log, "Pad 0x%"UVxf" reset\n",
+ PTR2UV(PL_curpad)));
#endif /* USE_THREADS */
if (!PL_tainting) { /* Can't mix tainted and non-tainted temporaries. */
for (po = AvMAX(PL_comppad); po > PL_padix_floor; po--) {
default:
sv_magic(sv, 0, 0, name, 1);
}
- DEBUG_S(PerlIO_printf(PerlIO_stderr(),
+ DEBUG_S(PerlIO_printf(Perl_error_log,
"find_threadsv: new SV %p for $%s%c\n",
sv, (*name < 32) ? "^" : "",
(*name < 32) ? toCTRL(*name) : *name));
if (!o || o->op_seq == (U16)-1)
return;
+ if (o->op_private & OPpREFCOUNTED) {
+ switch (o->op_type) {
+ case OP_LEAVESUB:
+ case OP_LEAVESUBLV:
+ case OP_LEAVEEVAL:
+ case OP_LEAVE:
+ case OP_SCOPE:
+ case OP_LEAVEWRITE:
+ OP_REFCNT_LOCK;
+ if (OpREFCNT_dec(o)) {
+ OP_REFCNT_UNLOCK;
+ return;
+ }
+ OP_REFCNT_UNLOCK;
+ break;
+ default:
+ break;
+ }
+ }
+
if (o->op_flags & OPf_KIDS) {
for (kid = cUNOPo->op_first; kid; kid = nextkid) {
nextkid = kid->op_sibling; /* Get before next freeing kid */
case OP_GVSV:
case OP_GV:
case OP_AELEMFAST:
- SvREFCNT_dec(cGVOPo->op_gv);
- cGVOPo->op_gv = Nullgv;
+#ifdef USE_ITHREADS
+ if (cPADOPo->op_padix > 0) {
+ if (PL_curpad) {
+ GV *gv = cGVOPo_gv;
+ pad_swipe(cPADOPo->op_padix);
+ /* No GvIN_PAD_off(gv) here, because other references may still
+ * exist on the pad */
+ SvREFCNT_dec(gv);
+ }
+ cPADOPo->op_padix = 0;
+ }
+#else
+ SvREFCNT_dec(cSVOPo->op_sv);
+ cSVOPo->op_sv = Nullsv;
+#endif
break;
case OP_CONST:
SvREFCNT_dec(cSVOPo->op_sv);
break;
case OP_SUBST:
op_free(cPMOPo->op_pmreplroot);
- cPMOPo->op_pmreplroot = Nullop;
- /* FALL THROUGH */
+ goto clear_pmop;
case OP_PUSHRE:
+#ifdef USE_ITHREADS
+ if ((PADOFFSET)cPMOPo->op_pmreplroot) {
+ if (PL_curpad) {
+ GV *gv = (GV*)PL_curpad[(PADOFFSET)cPMOPo->op_pmreplroot];
+ pad_swipe((PADOFFSET)cPMOPo->op_pmreplroot);
+ /* No GvIN_PAD_off(gv) here, because other references may still
+ * exist on the pad */
+ SvREFCNT_dec(gv);
+ }
+ }
+#else
+ SvREFCNT_dec((SV*)cPMOPo->op_pmreplroot);
+#endif
+ /* FALL THROUGH */
case OP_MATCH:
case OP_QR:
+clear_pmop:
+ cPMOPo->op_pmreplroot = Nullop;
ReREFCNT_dec(cPMOPo->op_pmregexp);
cPMOPo->op_pmregexp = (REGEXP*)NULL;
break;
}
- if (o->op_targ > 0)
+ if (o->op_targ > 0) {
pad_free(o->op_targ);
+ o->op_targ = 0;
+ }
}
STATIC void
S_cop_free(pTHX_ COP* cop)
{
Safefree(cop->cop_label);
- SvREFCNT_dec(cop->cop_filegv);
+#ifdef USE_ITHREADS
+ Safefree(CopFILE(cop)); /* XXXXX share in a pvtable? */
+ Safefree(CopSTASHPV(cop)); /* XXXXX share in a pvtable? */
+#else
+ /* NOTE: COP.cop_stash is not refcounted */
+ SvREFCNT_dec(CopFILEGV(cop));
+#endif
if (! specialWARN(cop->cop_warnings))
SvREFCNT_dec(cop->cop_warnings);
}
if (o->op_type == OP_SASSIGN && cBINOPo->op_first->op_type == OP_CONST) {
dTHR;
if (ckWARN(WARN_SYNTAX)) {
- line_t oldline = PL_curcop->cop_line;
+ line_t oldline = CopLINE(PL_curcop);
if (PL_copline != NOLINE)
- PL_curcop->cop_line = PL_copline;
+ CopLINE_set(PL_curcop, PL_copline);
Perl_warner(aTHX_ WARN_SYNTAX, "Found = in conditional, should be ==");
- PL_curcop->cop_line = oldline;
+ CopLINE_set(PL_curcop, oldline);
}
}
return scalar(o);
/* assumes no premature commitment */
if (!o || (o->op_flags & OPf_WANT) || PL_error_count
|| o->op_type == OP_RETURN)
+ {
return o;
+ }
- if ((o->op_private & OPpTARGET_MY)
- && (PL_opargs[o->op_type] & OA_TARGLEX)) /* OPp share the meaning */
- return scalar(o); /* As if inside SASSIGN */
-
o->op_flags = (o->op_flags & ~OPf_WANT) | OPf_WANT_SCALAR;
switch (o->op_type) {
want = o->op_flags & OPf_WANT;
if ((want && want != OPf_WANT_SCALAR) || PL_error_count
|| o->op_type == OP_RETURN)
+ {
return o;
+ }
if ((o->op_private & OPpTARGET_MY)
- && (PL_opargs[o->op_type] & OA_TARGLEX)) /* OPp share the meaning */
+ && (PL_opargs[o->op_type] & OA_TARGLEX))/* OPp share the meaning */
+ {
return scalar(o); /* As if inside SASSIGN */
+ }
o->op_flags = (o->op_flags & ~OPf_WANT) | OPf_WANT_VOID;
case OP_RV2SV:
case OP_RV2AV:
case OP_RV2HV:
- if (!(o->op_private & OPpLVAL_INTRO) &&
+ if (!(o->op_private & (OPpLVAL_INTRO|OPpOUR_INTRO)) &&
(!o->op_sibling || o->op_sibling->op_type != OP_READLINE))
useless = "a variable";
break;
case OP_CONST:
- sv = cSVOPo->op_sv;
+ sv = cSVOPo_sv;
if (cSVOPo->op_private & OPpCONST_STRICT)
no_bareword_allowed(o);
else {
/* assumes no premature commitment */
if (!o || (o->op_flags & OPf_WANT) || PL_error_count
|| o->op_type == OP_RETURN)
+ {
return o;
+ }
if ((o->op_private & OPpTARGET_MY)
- && (PL_opargs[o->op_type] & OA_TARGLEX)) /* OPp share the meaning */
+ && (PL_opargs[o->op_type] & OA_TARGLEX))/* OPp share the meaning */
+ {
return o; /* As if inside SASSIGN */
+ }
o->op_flags = (o->op_flags & ~OPf_WANT) | OPf_WANT_LIST;
return o;
if ((o->op_private & OPpTARGET_MY)
- && (PL_opargs[o->op_type] & OA_TARGLEX)) /* OPp share the meaning */
+ && (PL_opargs[o->op_type] & OA_TARGLEX))/* OPp share the meaning */
+ {
return o;
+ }
switch (o->op_type) {
case OP_UNDEF:
if (!(o->op_private & (OPpCONST_ARYBASE)))
goto nomod;
if (PL_eval_start && PL_eval_start->op_type == OP_CONST) {
- PL_compiling.cop_arybase = (I32)SvIV(((SVOP*)PL_eval_start)->op_sv);
+ PL_compiling.cop_arybase = (I32)SvIV(cSVOPx(PL_eval_start)->op_sv);
PL_eval_start = 0;
}
else if (!type) {
}
else { /* lvalue subroutine call */
o->op_private |= OPpLVAL_INTRO;
- if (type == OP_GREPSTART || type == OP_ENTERSUB) {
+ if (type == OP_GREPSTART || type == OP_ENTERSUB || type == OP_REFGEN) {
/* Backward compatibility mode: */
o->op_private |= OPpENTERSUB_INARGS;
break;
break;
}
- cv = GvCV(kGVOP->op_gv);
+ cv = GvCV(kGVOP_gv);
if (!cv)
goto restore_2cv;
if (CvLVALUE(cv))
} else if (type == OP_RV2SV || /* "our" declaration */
type == OP_RV2AV ||
type == OP_RV2HV) { /* XXX does this let anything illegal in? */
+ o->op_private |= OPpOUR_INTRO;
return o;
} else if (type != OP_PADSV &&
type != OP_PADAV &&
char *desc = PL_op_desc[(right->op_type == OP_SUBST ||
right->op_type == OP_TRANS)
? right->op_type : OP_MATCH];
- char *sample = ((left->op_type == OP_RV2AV ||
- left->op_type == OP_PADAV)
- ? "@array" : "%hash");
+ const char *sample = ((left->op_type == OP_RV2AV ||
+ left->op_type == OP_PADAV)
+ ? "@array" : "%hash");
Perl_warner(aTHX_ WARN_UNSAFE,
"Applying %s to %s will act on scalar(%s)",
desc, sample, sample);
o->op_type = OP_SCOPE;
o->op_ppaddr = PL_ppaddr[OP_SCOPE];
kid = ((LISTOP*)o)->op_first;
- if (kid->op_type == OP_NEXTSTATE || kid->op_type == OP_DBSTATE){
- kid->op_type = OP_SETSTATE;
- kid->op_ppaddr = PL_ppaddr[OP_SETSTATE];
- }
+ if (kid->op_type == OP_NEXTSTATE || kid->op_type == OP_DBSTATE)
+ null(kid);
}
else
o = newLISTOP(OP_SCOPE, 0, o, Nullop);
PL_pad_reset_pending = FALSE;
SAVEHINTS();
PL_hints &= ~HINT_BLOCK_SCOPE;
- SAVEPPTR(PL_compiling.cop_warnings);
+ SAVESPTR(PL_compiling.cop_warnings);
if (! specialWARN(PL_compiling.cop_warnings)) {
PL_compiling.cop_warnings = newSVsv(PL_compiling.cop_warnings) ;
SAVEFREESV(PL_compiling.cop_warnings) ;
((PL_in_eval & EVAL_KEEPERR)
? OPf_SPECIAL : 0), o);
PL_eval_start = linklist(PL_eval_root);
+ PL_eval_root->op_private |= OPpREFCOUNTED;
+ OpREFCNT_set(PL_eval_root, 1);
PL_eval_root->op_next = 0;
peep(PL_eval_start);
}
PL_main_root = scope(sawparens(scalarvoid(o)));
PL_curcop = &PL_compiling;
PL_main_start = LINKLIST(PL_main_root);
+ PL_main_root->op_private |= OPpREFCOUNTED;
+ OpREFCNT_set(PL_main_root, 1);
PL_main_root->op_next = 0;
peep(PL_main_start);
PL_compcv = 0;
if (cv) {
dSP;
PUSHMARK(SP);
- XPUSHs((SV*)PL_compiling.cop_filegv);
+ XPUSHs((SV*)CopFILEGV(&PL_compiling));
PUTBACK;
call_sv((SV*)cv, G_DISCARD);
}
return o;
if (!(PL_hints & HINT_INTEGER)) {
- if (type == OP_DIVIDE || !(o->op_flags & OPf_KIDS))
+ if (type == OP_MODULO
+ || type == OP_DIVIDE
+ || !(o->op_flags & OPf_KIDS))
+ {
return o;
+ }
for (curop = ((UNOP*)o)->op_first; curop; curop = curop->op_sibling) {
if (curop->op_type == OP_CONST) {
PL_op = curop = LINKLIST(o);
o->op_next = 0;
+ peep(curop);
pp_pushmark();
CALLRUNOPS(aTHX);
PL_op = curop;
OP *curop;
if (pm->op_pmflags & PMf_EVAL) {
curop = 0;
- if (PL_curcop->cop_line < PL_multi_end)
- PL_curcop->cop_line = PL_multi_end;
+ if (CopLINE(PL_curcop) < PL_multi_end)
+ CopLINE_set(PL_curcop, PL_multi_end);
}
#ifdef USE_THREADS
else if (repl->op_type == OP_THREADSV
}
#else
if (curop->op_type == OP_GV) {
- GV *gv = ((GVOP*)curop)->op_gv;
+ GV *gv = cGVOPx_gv(curop);
repl_has_vars = 1;
if (strchr("&`'123456789+", *GvENAME(gv)))
break;
}
OP *
+Perl_newPADOP(pTHX_ I32 type, I32 flags, SV *sv)
+{
+ PADOP *padop;
+ NewOp(1101, padop, 1, PADOP);
+ padop->op_type = type;
+ padop->op_ppaddr = PL_ppaddr[type];
+ padop->op_padix = pad_alloc(type, SVs_PADTMP);
+ SvREFCNT_dec(PL_curpad[padop->op_padix]);
+ PL_curpad[padop->op_padix] = sv;
+ SvPADTMP_on(sv);
+ padop->op_next = (OP*)padop;
+ padop->op_flags = flags;
+ if (PL_opargs[type] & OA_RETSCALAR)
+ scalar((OP*)padop);
+ if (PL_opargs[type] & OA_TARGET)
+ padop->op_targ = pad_alloc(type, SVs_PADTMP);
+ return CHECKOP(type, padop);
+}
+
+OP *
Perl_newGVOP(pTHX_ I32 type, I32 flags, GV *gv)
{
dTHR;
- GVOP *gvop;
- NewOp(1101, gvop, 1, GVOP);
- gvop->op_type = type;
- gvop->op_ppaddr = PL_ppaddr[type];
- gvop->op_gv = (GV*)SvREFCNT_inc(gv);
- gvop->op_next = (OP*)gvop;
- gvop->op_flags = flags;
- if (PL_opargs[type] & OA_RETSCALAR)
- scalar((OP*)gvop);
- if (PL_opargs[type] & OA_TARGET)
- gvop->op_targ = pad_alloc(type, SVs_PADTMP);
- return CHECKOP(type, gvop);
+#ifdef USE_ITHREADS
+ GvIN_PAD_on(gv);
+ return newPADOP(type, flags, SvREFCNT_inc(gv));
+#else
+ return newSVOP(type, flags, SvREFCNT_inc(gv));
+#endif
}
OP *
newSTATEOP(0, Nullch, veop)),
newSTATEOP(0, Nullch, imop) ));
+ PL_hints |= HINT_BLOCK_SCOPE;
PL_copline = NOLINE;
PL_expect = XSTATE;
}
for (curop = LINKLIST(o); curop != o; curop = LINKLIST(curop)) {
if (PL_opargs[curop->op_type] & OA_DANGEROUS) {
if (curop->op_type == OP_GV) {
- GV *gv = ((GVOP*)curop)->op_gv;
+ GV *gv = cGVOPx_gv(curop);
if (gv == PL_defgv || SvCUR(gv) == PL_generation)
break;
SvCUR(gv) = PL_generation;
{
tmpop = ((UNOP*)left)->op_first;
if (tmpop->op_type == OP_GV && !pm->op_pmreplroot) {
- pm->op_pmreplroot = (OP*)((GVOP*)tmpop)->op_gv;
+#ifdef USE_ITHREADS
+ pm->op_pmreplroot = (OP*)cPADOPx(tmpop)->op_padix;
+ cPADOPx(tmpop)->op_padix = 0; /* steal it */
+#else
+ pm->op_pmreplroot = (OP*)cSVOPx(tmpop)->op_sv;
+ cSVOPx(tmpop)->op_sv = Nullsv; /* steal it */
+#endif
pm->op_pmflags |= PMf_ONCE;
tmpop = cUNOPo->op_first; /* to list (nulled) */
tmpop = ((UNOP*)tmpop)->op_first; /* to pushmark */
register COP *cop;
NewOp(1101, cop, 1, COP);
- if (PERLDB_LINE && PL_curcop->cop_line && PL_curstash != PL_debstash) {
+ if (PERLDB_LINE && CopLINE(PL_curcop) && PL_curstash != PL_debstash) {
cop->op_type = OP_DBSTATE;
cop->op_ppaddr = PL_ppaddr[ OP_DBSTATE ];
}
if (PL_copline == NOLINE)
- cop->cop_line = PL_curcop->cop_line;
+ CopLINE_set(cop, CopLINE(PL_curcop));
else {
- cop->cop_line = PL_copline;
+ CopLINE_set(cop, PL_copline);
PL_copline = NOLINE;
}
- cop->cop_filegv = (GV*)SvREFCNT_inc(PL_curcop->cop_filegv);
- cop->cop_stash = PL_curstash;
+#ifdef USE_ITHREADS
+ CopFILE_set(cop, CopFILE(PL_curcop)); /* XXXXX share in a pvtable? */
+#else
+ CopFILEGV_set(cop, (GV*)SvREFCNT_inc(CopFILEGV(PL_curcop)));
+#endif
+ CopSTASH_set(cop, PL_curstash);
if (PERLDB_LINE && PL_curstash != PL_debstash) {
- SV **svp = av_fetch(GvAV(PL_curcop->cop_filegv),(I32)cop->cop_line, FALSE);
+ SV **svp = av_fetch(CopFILEAV(PL_curcop), (I32)CopLINE(cop), FALSE);
if (svp && *svp != &PL_sv_undef && !SvIOK(*svp)) {
(void)SvIOK_on(*svp);
- SvIVX(*svp) = 1;
- SvSTASH(*svp) = (HV*)cop;
+ SvIVX(*svp) = PTR2IV(cop);
}
}
if (k2 && k2->op_type == OP_READLINE
&& (k2->op_flags & OPf_STACKED)
&& ((k1->op_flags & OPf_WANT) == OPf_WANT_SCALAR))
+ {
warnop = k2->op_type;
+ }
break;
case OP_SASSIGN:
if (k1->op_type == OP_READDIR
|| k1->op_type == OP_GLOB
+ || (k1->op_type == OP_NULL && k1->op_targ == OP_GLOB)
|| k1->op_type == OP_EACH)
- warnop = k1->op_type;
+ {
+ warnop = ((k1->op_type == OP_NULL)
+ ? k1->op_targ : k1->op_type);
+ }
break;
}
if (warnop) {
- line_t oldline = PL_curcop->cop_line;
- PL_curcop->cop_line = PL_copline;
+ line_t oldline = CopLINE(PL_curcop);
+ CopLINE_set(PL_curcop, PL_copline);
Perl_warner(aTHX_ WARN_UNSAFE,
"Value of %s%s can be \"0\"; test with defined()",
PL_op_desc[warnop],
((warnop == OP_READLINE || warnop == OP_GLOB)
? " construct" : "() operator"));
- PL_curcop->cop_line = oldline;
+ CopLINE_set(PL_curcop, oldline);
}
}
case OP_SASSIGN:
if (k1->op_type == OP_READDIR
|| k1->op_type == OP_GLOB
+ || (k1->op_type == OP_NULL && k1->op_targ == OP_NULL)
|| k1->op_type == OP_EACH)
expr = newUNOP(OP_DEFINED, 0, expr);
break;
case OP_SASSIGN:
if (k1->op_type == OP_READDIR
|| k1->op_type == OP_GLOB
+ || (k1->op_type == OP_NULL && k1->op_targ == OP_GLOB)
|| k1->op_type == OP_EACH)
expr = newUNOP(OP_DEFINED, 0, expr);
break;
}
else if (sv->op_type == OP_PADSV) { /* private variable */
padoff = sv->op_targ;
+ sv->op_targ = 0;
op_free(sv);
sv = Nullop;
}
else if (sv->op_type == OP_THREADSV) { /* per-thread variable */
padoff = sv->op_targ;
+ sv->op_targ = 0;
iterflags |= OPf_SPECIAL;
op_free(sv);
sv = Nullop;
#endif /* USE_THREADS */
ENTER;
- SAVESPTR(PL_curpad);
+ SAVEVPTR(PL_curpad);
PL_curpad = 0;
if (!CvCLONED(cv))
}
}
-#ifdef DEBUG_CLOSURES
STATIC void
-cv_dump(CV *cv)
+S_cv_dump(pTHX_ CV *cv)
{
+#ifdef DEBUGGING
CV *outside = CvOUTSIDE(cv);
AV* padlist = CvPADLIST(cv);
AV* pad_name;
SV** ppad;
I32 ix;
- PerlIO_printf(Perl_debug_log, "\tCV=0x%lx (%s), OUTSIDE=0x%lx (%s)\n",
- cv,
+ PerlIO_printf(Perl_debug_log,
+ "\tCV=0x%"UVxf" (%s), OUTSIDE=0x%"UVxf" (%s)\n",
+ PTR2UV(cv),
(CvANON(cv) ? "ANON"
: (cv == PL_main_cv) ? "MAIN"
: CvUNIQUE(cv) ? "UNIQUE"
: CvGV(cv) ? GvNAME(CvGV(cv)) : "UNDEFINED"),
- outside,
+ PTR2UV(outside),
(!outside ? "null"
: CvANON(outside) ? "ANON"
: (outside == PL_main_cv) ? "MAIN"
for (ix = 1; ix <= AvFILLp(pad_name); ix++) {
if (SvPOK(pname[ix]))
- PerlIO_printf(Perl_debug_log, "\t%4d. 0x%lx (%s\"%s\" %ld-%ld)\n",
- ix, ppad[ix],
+ PerlIO_printf(Perl_debug_log,
+ "\t%4d. 0x%"UVxf" (%s\"%s\" %"IVdf"-%"IVdf")\n",
+ ix, PTR2UV(ppad[ix]),
SvFAKE(pname[ix]) ? "FAKE " : "",
SvPVX(pname[ix]),
- (long)I_32(SvNVX(pname[ix])),
- (long)SvIVX(pname[ix]));
+ (IV)I_32(SvNVX(pname[ix])),
+ SvIVX(pname[ix]));
}
+#endif /* DEBUGGING */
}
-#endif /* DEBUG_CLOSURES */
STATIC CV *
S_cv_clone2(pTHX_ CV *proto, CV *outside)
assert(!CvUNIQUE(proto));
ENTER;
- SAVESPTR(PL_curpad);
+ SAVEVPTR(PL_curpad);
SAVESPTR(PL_comppad);
SAVESPTR(PL_comppad_name);
SAVESPTR(PL_compcv);
MUTEX_INIT(CvMUTEXP(cv));
CvOWNER(cv) = 0;
#endif /* USE_THREADS */
- CvFILEGV(cv) = CvFILEGV(proto);
+ CvFILE(cv) = CvFILE(proto);
CvGV(cv) = (GV*)SvREFCNT_inc(CvGV(proto));
CvSTASH(cv) = CvSTASH(proto);
CvROOT(cv) = CvROOT(proto);
PL_curpad[ix] = sv;
}
}
+ else if (IS_PADGV(ppad[ix]) || IS_PADCONST(ppad[ix])) {
+ PL_curpad[ix] = SvREFCNT_inc(ppad[ix]);
+ }
else {
SV* sv = NEWSV(0,0);
SvPADTMP_on(sv);
Perl_cv_clone(pTHX_ CV *proto)
{
CV *cv;
- MUTEX_LOCK(&PL_cred_mutex); /* XXX create separate mutex */
+ LOCK_CRED_MUTEX; /* XXX create separate mutex */
cv = cv_clone2(proto, CvOUTSIDE(proto));
- MUTEX_UNLOCK(&PL_cred_mutex); /* XXX create separate mutex */
+ UNLOCK_CRED_MUTEX; /* XXX create separate mutex */
return cv;
}
break;
if (sv)
return Nullsv;
- if (type == OP_CONST)
+ if (type == OP_CONST && cSVOPo->op_sv)
sv = cSVOPo->op_sv;
- else if (type == OP_PADSV && cv) {
+ else if ((type == OP_PADSV || type == OP_CONST) && cv) {
AV* padav = (AV*)(AvARRAY(CvPADLIST(cv))[1]);
sv = padav ? AvARRAY(padav)[o->op_targ] : Nullsv;
if (!sv || (!SvREADONLY(sv) && SvREFCNT(sv) > 1))
&& HvNAME(GvSTASH(CvGV(cv)))
&& strEQ(HvNAME(GvSTASH(CvGV(cv))),
"autouse"))) {
- line_t oldline = PL_curcop->cop_line;
- PL_curcop->cop_line = PL_copline;
+ line_t oldline = CopLINE(PL_curcop);
+ CopLINE_set(PL_curcop, PL_copline);
Perl_warner(aTHX_ WARN_REDEFINE,
const_sv ? "Constant subroutine %s redefined"
: "Subroutine %s redefined", name);
- PL_curcop->cop_line = oldline;
+ CopLINE_set(PL_curcop, oldline);
}
SvREFCNT_dec(cv);
cv = Nullcv;
}
}
CvGV(cv) = (GV*)SvREFCNT_inc(gv);
- CvFILEGV(cv) = PL_curcop->cop_filegv;
+ CvFILE(cv) = CopFILE(PL_curcop);
CvSTASH(cv) = PL_curstash;
#ifdef USE_THREADS
CvOWNER(cv) = 0;
if (AvFILLp(PL_comppad_name) < AvFILLp(PL_comppad))
av_store(PL_comppad_name, AvFILLp(PL_comppad), Nullsv);
+ if (CvLVALUE(cv)) {
+ CvROOT(cv) = newUNOP(OP_LEAVESUBLV, 0, scalarseq(block));
+ }
+ else {
+ CvROOT(cv) = newUNOP(OP_LEAVESUB, 0, scalarseq(block));
+ }
+ CvROOT(cv)->op_private |= OPpREFCOUNTED;
+ OpREFCNT_set(CvROOT(cv), 1);
+ CvSTART(cv) = LINKLIST(CvROOT(cv));
+ CvROOT(cv)->op_next = 0;
+ peep(CvSTART(cv));
+
+ /* now that optimizer has done its work, adjust pad values */
if (CvCLONE(cv)) {
SV **namep = AvARRAY(PL_comppad_name);
for (ix = AvFILLp(PL_comppad); ix > 0; ix--) {
SV *namesv;
- if (SvIMMORTAL(PL_curpad[ix]))
+ if (SvIMMORTAL(PL_curpad[ix]) || IS_PADGV(PL_curpad[ix]) || IS_PADCONST(PL_curpad[ix]))
continue;
/*
* The only things that a clonable function needs in its
AvFLAGS(av) = AVf_REIFY;
for (ix = AvFILLp(PL_comppad); ix > 0; ix--) {
- if (SvIMMORTAL(PL_curpad[ix]))
+ if (SvIMMORTAL(PL_curpad[ix]) || IS_PADGV(PL_curpad[ix]) || IS_PADCONST(PL_curpad[ix]))
continue;
if (!SvPADMY(PL_curpad[ix]))
SvPADTMP_on(PL_curpad[ix]);
}
}
- if(CvLVALUE(cv)) {
- CvROOT(cv) = newUNOP(OP_LEAVESUBLV, 0, scalarseq(block));
- }
- else {
- CvROOT(cv) = newUNOP(OP_LEAVESUB, 0, scalarseq(block));
- }
- CvSTART(cv) = LINKLIST(CvROOT(cv));
- CvROOT(cv)->op_next = 0;
- peep(CvSTART(cv));
-
if (name) {
char *s;
CV *cv;
HV *hv;
- Perl_sv_setpvf(aTHX_ sv, "%_:%ld-%ld",
- GvSV(PL_curcop->cop_filegv),
- (long)PL_subline, (long)PL_curcop->cop_line);
+ Perl_sv_setpvf(aTHX_ sv, "%s:%ld-%ld",
+ CopFILE(PL_curcop),
+ (long)PL_subline, (long)CopLINE(PL_curcop));
gv_efullname3(tmpstr, gv, Nullch);
hv_store(GvHV(PL_DBsub), SvPVX(tmpstr), SvCUR(tmpstr), sv, 0);
hv = GvHVn(db_postponed);
s++;
else
s = name;
+
+ if (*s != 'B' && *s != 'E' && *s != 'S' && *s != 'I')
+ goto done;
+
if (strEQ(s, "BEGIN")) {
I32 oldscope = PL_scopestack_ix;
ENTER;
- SAVESPTR(PL_compiling.cop_filegv);
- SAVEI16(PL_compiling.cop_line);
+ SAVECOPFILE(&PL_compiling);
+ SAVECOPLINE(&PL_compiling);
save_svref(&PL_rs);
sv_setsv(PL_rs, PL_nrs);
if (!PL_beginav)
PL_beginav = newAV();
DEBUG_x( dump_sub(gv) );
- av_push(PL_beginav, (SV *)cv);
+ av_push(PL_beginav, SvREFCNT_inc(cv));
GvCV(gv) = 0;
call_list(oldscope, PL_beginav);
else if (strEQ(s, "END") && !PL_error_count) {
if (!PL_endav)
PL_endav = newAV();
+ DEBUG_x( dump_sub(gv) );
av_unshift(PL_endav, 1);
- av_store(PL_endav, 0, (SV *)cv);
+ av_store(PL_endav, 0, SvREFCNT_inc(cv));
+ GvCV(gv) = 0;
+ }
+ else if (strEQ(s, "STOP") && !PL_error_count) {
+ if (!PL_stopav)
+ PL_stopav = newAV();
+ DEBUG_x( dump_sub(gv) );
+ av_unshift(PL_stopav, 1);
+ av_store(PL_stopav, 0, SvREFCNT_inc(cv));
GvCV(gv) = 0;
}
else if (strEQ(s, "INIT") && !PL_error_count) {
if (!PL_initav)
PL_initav = newAV();
+ DEBUG_x( dump_sub(gv) );
av_push(PL_initav, SvREFCNT_inc(cv));
GvCV(gv) = 0;
}
Perl_newCONSTSUB(pTHX_ HV *stash, char *name, SV *sv)
{
dTHR;
- U32 oldhints = PL_hints;
- HV *old_cop_stash = PL_curcop->cop_stash;
- HV *old_curstash = PL_curstash;
- line_t oldline = PL_curcop->cop_line;
- PL_curcop->cop_line = PL_copline;
+ ENTER;
+ SAVECOPLINE(PL_curcop);
+ SAVEHINTS();
+
+ CopLINE_set(PL_curcop, PL_copline);
PL_hints &= ~HINT_BLOCK_SCOPE;
- if(stash)
- PL_curstash = PL_curcop->cop_stash = stash;
+
+ if (stash) {
+ SAVESPTR(PL_curstash);
+ SAVECOPSTASH(PL_curcop);
+ PL_curstash = stash;
+#ifdef USE_ITHREADS
+ CopSTASHPV(PL_curcop) = stash ? HvNAME(stash) : Nullch;
+#else
+ CopSTASH(PL_curcop) = stash;
+#endif
+ }
newATTRSUB(
start_subparse(FALSE, 0),
newSTATEOP(0, Nullch, newSVOP(OP_CONST, 0, sv))
);
- PL_hints = oldhints;
- PL_curcop->cop_stash = old_cop_stash;
- PL_curstash = old_curstash;
- PL_curcop->cop_line = oldline;
+ LEAVE;
}
CV *
if (ckWARN(WARN_REDEFINE) && !(CvGV(cv) && GvSTASH(CvGV(cv))
&& HvNAME(GvSTASH(CvGV(cv)))
&& strEQ(HvNAME(GvSTASH(CvGV(cv))), "autouse"))) {
- line_t oldline = PL_curcop->cop_line;
+ line_t oldline = CopLINE(PL_curcop);
if (PL_copline != NOLINE)
- PL_curcop->cop_line = PL_copline;
+ CopLINE_set(PL_curcop, PL_copline);
Perl_warner(aTHX_ WARN_REDEFINE, "Subroutine %s redefined",name);
- PL_curcop->cop_line = oldline;
+ CopLINE_set(PL_curcop, oldline);
}
SvREFCNT_dec(cv);
cv = 0;
MUTEX_INIT(CvMUTEXP(cv));
CvOWNER(cv) = 0;
#endif /* USE_THREADS */
- CvFILEGV(cv) = gv_fetchfile(filename);
+ (void)gv_fetchfile(filename);
+ CvFILE(cv) = filename; /* NOTE: not copied, as it is expected to be
+ an external constant string */
CvXSUB(cv) = subaddr;
if (name) {
s++;
else
s = name;
+
+ if (*s != 'B' && *s != 'E' && *s != 'S' && *s != 'I')
+ goto done;
+
if (strEQ(s, "BEGIN")) {
if (!PL_beginav)
PL_beginav = newAV();
- av_push(PL_beginav, (SV *)cv);
+ av_push(PL_beginav, SvREFCNT_inc(cv));
GvCV(gv) = 0;
}
else if (strEQ(s, "END")) {
if (!PL_endav)
PL_endav = newAV();
av_unshift(PL_endav, 1);
- av_store(PL_endav, 0, (SV *)cv);
+ av_store(PL_endav, 0, SvREFCNT_inc(cv));
+ GvCV(gv) = 0;
+ }
+ else if (strEQ(s, "STOP")) {
+ if (!PL_stopav)
+ PL_stopav = newAV();
+ av_unshift(PL_stopav, 1);
+ av_store(PL_stopav, 0, SvREFCNT_inc(cv));
GvCV(gv) = 0;
}
else if (strEQ(s, "INIT")) {
if (!PL_initav)
PL_initav = newAV();
- av_push(PL_initav, (SV *)cv);
+ av_push(PL_initav, SvREFCNT_inc(cv));
GvCV(gv) = 0;
}
}
else
CvANON_on(cv);
+done:
return cv;
}
GvMULTI_on(gv);
if (cv = GvFORM(gv)) {
if (ckWARN(WARN_REDEFINE)) {
- line_t oldline = PL_curcop->cop_line;
+ line_t oldline = CopLINE(PL_curcop);
- PL_curcop->cop_line = PL_copline;
+ CopLINE_set(PL_curcop, PL_copline);
Perl_warner(aTHX_ WARN_REDEFINE, "Format %s redefined",name);
- PL_curcop->cop_line = oldline;
+ CopLINE_set(PL_curcop, oldline);
}
SvREFCNT_dec(cv);
}
cv = PL_compcv;
GvFORM(gv) = cv;
CvGV(cv) = (GV*)SvREFCNT_inc(gv);
- CvFILEGV(cv) = PL_curcop->cop_filegv;
+ CvFILE(cv) = CopFILE(PL_curcop);
for (ix = AvFILLp(PL_comppad); ix > 0; ix--) {
if (!SvPADMY(PL_curpad[ix]) && !SvIMMORTAL(PL_curpad[ix]))
}
CvROOT(cv) = newUNOP(OP_LEAVEWRITE, 0, scalarseq(block));
+ CvROOT(cv)->op_private |= OPpREFCOUNTED;
+ OpREFCNT_set(CvROOT(cv), 1);
CvSTART(cv) = LINKLIST(CvROOT(cv));
CvROOT(cv)->op_next = 0;
peep(CvSTART(cv));
o->op_private = 0;
if (o->op_flags & OPf_KIDS) {
OP *kid = cUNOPo->op_first;
- if (kid->op_type == OP_HSLICE)
+ switch (kid->op_type) {
+ case OP_ASLICE:
+ o->op_flags |= OPf_SPECIAL;
+ /* FALL THROUGH */
+ case OP_HSLICE:
o->op_private |= OPpSLICE;
- else if (kid->op_type != OP_HELEM)
- Perl_croak(aTHX_ "%s argument is not a HASH element or slice",
+ break;
+ case OP_AELEM:
+ o->op_flags |= OPf_SPECIAL;
+ /* FALL THROUGH */
+ case OP_HELEM:
+ break;
+ default:
+ Perl_croak(aTHX_ "%s argument is not a HASH or ARRAY element or slice",
PL_op_desc[o->op_type]);
+ }
null(kid);
}
return o;
o = ck_fun(o);
if (o->op_flags & OPf_KIDS) {
OP *kid = cUNOPo->op_first;
- if (kid->op_type != OP_HELEM)
- Perl_croak(aTHX_ "%s argument is not a HASH element", PL_op_desc[o->op_type]);
+ if (kid->op_type == OP_AELEM)
+ o->op_flags |= OPf_SPECIAL;
+ else if (kid->op_type != OP_HELEM)
+ Perl_croak(aTHX_ "%s argument is not a HASH or ARRAY element",
+ PL_op_desc[o->op_type]);
null(kid);
}
return o;
if (gv) {
kid->op_type = OP_GV;
SvREFCNT_dec(kid->op_sv);
+#ifdef USE_ITHREADS
+ /* XXX hack: dependence on sizeof(PADOP) <= sizeof(SVOP) */
+ kPADOP->op_padix = pad_alloc(OP_GV, SVs_PADTMP);
+ GvIN_PAD_on(gv);
+ PL_curpad[kPADOP->op_padix] = SvREFCNT_inc(gv);
+#else
kid->op_sv = SvREFCNT_inc(gv);
+#endif
kid->op_ppaddr = PL_ppaddr[OP_GV];
}
}
dTHR;
I32 type = o->op_type;
- if (o->op_flags & OPf_REF)
- return o;
-
- if (o->op_flags & OPf_KIDS && cUNOPo->op_first->op_type != OP_STUB) {
+ if (o->op_flags & OPf_REF) {
+ /* nothing */
+ }
+ else if (o->op_flags & OPf_KIDS && cUNOPo->op_first->op_type != OP_STUB) {
SVOP *kid = (SVOP*)cUNOPo->op_first;
if (kid->op_type == OP_CONST && (kid->op_private & OPpCONST_BARE)) {
OP *newop = newGVOP(type, OPf_REF,
gv_fetchpv(SvPVx(kid->op_sv, n_a), TRUE, SVt_PVIO));
op_free(o);
- return newop;
+ o = newop;
}
}
else {
op_free(o);
if (type == OP_FTTTY)
- return newGVOP(type, OPf_REF, gv_fetchpv("main::STDIN", TRUE,
+ o = newGVOP(type, OPf_REF, gv_fetchpv("main::STDIN", TRUE,
SVt_PVIO));
else
- return newUNOP(type, 0, newDEFSVOP());
+ o = newUNOP(type, 0, newDEFSVOP());
+ }
+#ifdef USE_LOCALE
+ if (type == OP_FTTEXT || type == OP_FTBINARY) {
+ o->op_private = 0;
+ if (PL_hints & HINT_LOCALE)
+ o->op_private |= OPpLOCALE;
}
+#endif
return o;
}
char *name = SvPVx(((SVOP*)kid)->op_sv, n_a);
OP *newop = newAVREF(newGVOP(OP_GV, 0,
gv_fetchpv(name, TRUE, SVt_PVAV) ));
-#ifdef IV_IS_QUAD
if (ckWARN(WARN_SYNTAX))
Perl_warner(aTHX_ WARN_SYNTAX,
- "Array @%s missing the @ in argument %" PERL_PRId64 " of %s()",
+ "Array @%s missing the @ in argument %"IVdf" of %s()",
name, (IV)numargs, PL_op_desc[type]);
-#else
- if (ckWARN(WARN_SYNTAX))
- Perl_warner(aTHX_ WARN_SYNTAX,
- "Array @%s missing the @ in argument %ld of %s()",
- name, (long)numargs, PL_op_desc[type]);
-#endif
op_free(kid);
kid = newop;
kid->op_sibling = sibl;
char *name = SvPVx(((SVOP*)kid)->op_sv, n_a);
OP *newop = newHVREF(newGVOP(OP_GV, 0,
gv_fetchpv(name, TRUE, SVt_PVHV) ));
-#ifdef IV_IS_QUAD
if (ckWARN(WARN_SYNTAX))
Perl_warner(aTHX_ WARN_SYNTAX,
- "Hash %%%s missing the %% in argument %" PERL_PRId64 " of %s()",
+ "Hash %%%s missing the %% in argument %"IVdf" of %s()",
name, (IV)numargs, PL_op_desc[type]);
-#else
- if (ckWARN(WARN_SYNTAX))
- Perl_warner(aTHX_ WARN_SYNTAX,
- "Hash %%%s missing the %% in argument %ld of %s()",
- name, (long)numargs, PL_op_desc[type]);
-#endif
op_free(kid);
kid = newop;
kid->op_sibling = sibl;
else {
I32 flags = OPf_SPECIAL;
I32 priv = 0;
+ PADOFFSET targ = 0;
+
/* is this op a FH constructor? */
if (is_handle_constructor(o,numargs)) {
- flags = 0;
- /* Set a flag to tell rv2gv to vivify
+ char *name = Nullch;
+ STRLEN len;
+
+ flags = 0;
+ /* Set a flag to tell rv2gv to vivify
* need to "prove" flag does not mean something
* else already - NI-S 1999/05/07
- */
- priv = OPpDEREF;
-#if 0
- /* Helps with open($array[$n],...)
- but is too simplistic - need to do selectively
- */
- mod(kid,type);
-#endif
+ */
+ priv = OPpDEREF;
+ if (kid->op_type == OP_PADSV) {
+ SV **namep = av_fetch(PL_comppad_name,
+ kid->op_targ, 4);
+ if (namep && *namep)
+ name = SvPV(*namep, len);
+ }
+ else if (kid->op_type == OP_RV2SV
+ && kUNOP->op_first->op_type == OP_GV)
+ {
+ GV *gv = cGVOPx_gv(kUNOP->op_first);
+ name = GvNAME(gv);
+ len = GvNAMELEN(gv);
+ }
+ if (name) {
+ SV *namesv;
+ targ = pad_alloc(OP_RV2GV, SVs_PADTMP);
+ namesv = PL_curpad[targ];
+ SvUPGRADE(namesv, SVt_PV);
+ if (*name != '$')
+ sv_setpvn(namesv, "$", 1);
+ sv_catpvn(namesv, name, len);
+ }
}
kid->op_sibling = 0;
kid = newUNOP(OP_RV2GV, flags, scalar(kid));
- if (priv) {
- kid->op_private |= priv;
- }
+ kid->op_targ = targ;
+ kid->op_private |= priv;
}
kid->op_sibling = sibl;
*tokid = kid;
if (!((gv = gv_fetchpv("glob", FALSE, SVt_PVCV)) && GvIMPORTED_CV(gv)))
gv = gv_fetchpv("CORE::GLOBAL::glob", FALSE, SVt_PVCV);
+#if !defined(PERL_EXTERNAL_GLOB)
+ /* XXX this can be tightened up and made more failsafe. */
+ if (!gv) {
+ OP *modname = newSVOP(OP_CONST, 0, newSVpvn("File::Glob", 10));
+ modname->op_private |= OPpCONST_BARE;
+ ENTER;
+ utilize(1, start_subparse(FALSE, 0), Nullop, modname,
+ newSVOP(OP_CONST, 0, newSVpvn(":globally", 9)));
+ gv = gv_fetchpv("CORE::GLOBAL::glob", FALSE, SVt_PVCV);
+ LEAVE;
+ }
+#endif /* PERL_EXTERNAL_GLOB */
+
if (gv && GvIMPORTED_CV(gv)) {
append_elem(OP_GLOB, o,
newSVOP(OP_CONST, 0, newSViv(PL_glob_index++)));
if (kkid && kkid->op_type == OP_PADSV
&& !(kkid->op_private & OPpLVAL_INTRO))
{
- /* Concat has problems if target is equal to right arg. */
- if (kid->op_type == OP_CONCAT) {
- if (kLISTOP->op_first->op_sibling->op_type == OP_PADSV
- && kLISTOP->op_first->op_sibling->op_targ == kkid->op_targ)
- return o;
- }
- else if (kid->op_type == OP_JOIN) {
- /* do_join has problems if the arguments coincide with target.
- In fact the second argument *can* safely coincide,
- but ignore=pessimize this rare occasion. */
- OP *arg = kLISTOP->op_first->op_sibling; /* Skip PUSHMARK */
-
- while (arg) {
- if (arg->op_type == OP_PADSV
- && arg->op_targ == kkid->op_targ)
- return o;
- arg = arg->op_sibling;
- }
- }
- else if (kid->op_type == OP_QUOTEMETA) {
- /* quotemeta has problems if the argument coincides with target. */
- if (kLISTOP->op_first->op_type == OP_PADSV
- && kLISTOP->op_first->op_targ == kkid->op_targ)
- return o;
- }
kid->op_targ = kkid->op_targ;
+ kkid->op_targ = 0;
/* Now we do not need PADSV and SASSIGN. */
kid->op_sibling = o->op_sibling; /* NULL */
cLISTOPo->op_first = NULL;
register OP *kid = cLISTOPo->op_first->op_sibling; /* get past pushmark */
OP *k;
int reversed;
+ GV *gv;
if (!(o->op_flags & OPf_STACKED))
return;
GvMULTI_on(gv_fetchpv("a", TRUE, SVt_PV));
if (kUNOP->op_first->op_type != OP_GV)
return;
kid = kUNOP->op_first; /* get past rv2sv */
- if (GvSTASH(kGVOP->op_gv) != PL_curstash)
+ gv = kGVOP_gv;
+ if (GvSTASH(gv) != PL_curstash)
return;
- if (strEQ(GvNAME(kGVOP->op_gv), "a"))
+ if (strEQ(GvNAME(gv), "a"))
reversed = 0;
- else if(strEQ(GvNAME(kGVOP->op_gv), "b"))
+ else if(strEQ(GvNAME(gv), "b"))
reversed = 1;
else
return;
if (kUNOP->op_first->op_type != OP_GV)
return;
kid = kUNOP->op_first; /* get past rv2sv */
- if (GvSTASH(kGVOP->op_gv) != PL_curstash
+ gv = kGVOP_gv;
+ if (GvSTASH(gv) != PL_curstash
|| ( reversed
- ? strNE(GvNAME(kGVOP->op_gv), "a")
- : strNE(GvNAME(kGVOP->op_gv), "b")))
+ ? strNE(GvNAME(gv), "a")
+ : strNE(GvNAME(gv), "b")))
return;
o->op_flags &= ~(OPf_STACKED | OPf_SPECIAL);
if (reversed)
null(cvop); /* disable rv2cv */
tmpop = (SVOP*)((UNOP*)cvop)->op_first;
if (tmpop->op_type == OP_GV && !(o->op_private & OPpENTERSUB_AMPER)) {
- cv = GvCVu(tmpop->op_sv);
+ GV *gv = cGVOPx_gv(tmpop);
+ cv = GvCVu(gv);
if (!cv)
tmpop->op_private |= OPpEARLY_CV;
else if (SvPOK(cv)) {
- namegv = CvANON(cv) ? (GV*)tmpop->op_sv : CvGV(cv);
+ namegv = CvANON(cv) ? gv : CvGV(cv);
proto = SvPV((SV*)cv, n_a);
}
}
(gvop = ((UNOP*)gvop)->op_first) &&
gvop->op_type == OP_GV)
{
- GV *gv = (GV*)((SVOP*)gvop)->op_sv;
+ GV *gv = cGVOPx_gv(gvop);
OP *sibling = o2->op_sibling;
SV *n = newSVpvn("",0);
op_free(o2);
return;
ENTER;
SAVEOP();
- SAVESPTR(PL_curcop);
+ SAVEVPTR(PL_curcop);
for (; o; o = o->op_next) {
if (o->op_seq)
break;
case OP_CONST:
if (cSVOPo->op_private & OPpCONST_STRICT)
no_bareword_allowed(o);
+#ifdef USE_ITHREADS
+ /* Relocate sv to the pad for thread safety.
+ * Despite being a "constant", the SV is written to,
+ * for reference counts, sv_upgrade() etc. */
+ if (cSVOP->op_sv) {
+ PADOFFSET ix = pad_alloc(OP_CONST, SVs_PADTMP);
+ SvREFCNT_dec(PL_curpad[ix]);
+ SvPADTMP_on(cSVOPo->op_sv);
+ PL_curpad[ix] = cSVOPo->op_sv;
+ cSVOPo->op_sv = Nullsv;
+ o->op_targ = ix;
+ }
+#endif
/* FALL THROUGH */
case OP_UC:
case OP_UCFIRST:
case OP_LC:
case OP_LCFIRST:
- if ( o->op_next && o->op_next->op_type == OP_STRINGIFY
- && !(o->op_next->op_private & OPpTARGET_MY) )
- null(o->op_next);
- o->op_seq = PL_op_seqmax++;
- break;
case OP_CONCAT:
case OP_JOIN:
case OP_QUOTEMETA:
if (o->op_next && o->op_next->op_type == OP_STRINGIFY) {
if (o->op_next->op_private & OPpTARGET_MY) {
- if ((o->op_flags & OPf_STACKED) /* chained concats */
- || (o->op_type == OP_CONCAT
- /* Concat has problems if target is equal to right arg. */
- && (((LISTOP*)o)->op_first->op_sibling->op_type
- == OP_PADSV)
- && (((LISTOP*)o)->op_first->op_sibling->op_targ
- == o->op_next->op_targ))) {
+ if (o->op_flags & OPf_STACKED) /* chained concats */
goto ignore_optimization;
- }
else {
o->op_targ = o->op_next->op_targ;
+ o->op_next->op_targ = 0;
o->op_private |= OPpTARGET_MY;
}
}
<= 255 &&
i >= 0)
{
+ GV *gv;
null(o->op_next);
null(pop->op_next);
null(pop);
o->op_type = OP_AELEMFAST;
o->op_ppaddr = PL_ppaddr[OP_AELEMFAST];
o->op_private = (U8)i;
- GvAVn(((GVOP*)o)->op_gv);
+ gv = cGVOPo_gv;
+ GvAVn(gv);
}
}
else if ((o->op_private & OPpEARLY_CV) && ckWARN(WARN_UNSAFE)) {
- GV *gv = cGVOPo->op_gv;
+ GV *gv = cGVOPo_gv;
if (SvTYPE(gv) == SVt_PVGV && GvCV(gv) && SvPVX(GvCV(gv))) {
/* XXX could check prototype here instead of just carping */
SV *sv = sv_newmortal();
o->op_next->op_sibling->op_type != OP_EXIT &&
o->op_next->op_sibling->op_type != OP_WARN &&
o->op_next->op_sibling->op_type != OP_DIE) {
- line_t oldline = PL_curcop->cop_line;
+ line_t oldline = CopLINE(PL_curcop);
- PL_curcop->cop_line = ((COP*)o->op_next)->cop_line;
+ CopLINE_set(PL_curcop, CopLINE((COP*)o->op_next));
Perl_warner(aTHX_ WARN_SYNTAX, "Statement unlikely to be reached");
Perl_warner(aTHX_ WARN_SYNTAX, "(Maybe you meant system() when you said exec()?)\n");
- PL_curcop->cop_line = oldline;
+ CopLINE_set(PL_curcop, oldline);
}
}
break;
fields = (GV**)hv_fetch(SvSTASH(lexname), "FIELDS", 6, FALSE);
if (!fields || !GvHV(*fields))
break;
- svp = &((SVOP*)((BINOP*)o)->op_last)->op_sv;
+ svp = cSVOPx_svp(((BINOP*)o)->op_last);
key = SvPV(*svp, keylen);
indsvp = hv_fetch(GvHV(*fields), key, keylen, FALSE);
if (!indsvp) {
- Perl_croak(aTHX_ "No such field \"%s\" in variable %s of type %s",
+ Perl_croak(aTHX_ "No such pseudo-hash field \"%s\" in variable %s of type %s",
key, SvPV(lexname, n_a), HvNAME(SvSTASH(lexname)));
}
ind = SvIV(*indsvp);
case OP_RV2AV:
case OP_RV2HV:
if (!(o->op_flags & OPf_WANT)
- || o->op_flags & OPf_WANT == OPf_WANT_LIST)
+ || (o->op_flags & OPf_WANT) == OPf_WANT_LIST)
+ {
last_composite = o;
+ }
o->op_seq = PL_op_seqmax++;
break;
case OP_RETURN:
- if (o->op_next->op_type != OP_LEAVESUBLV) {
+ if (o->op_next && o->op_next->op_type != OP_LEAVESUBLV) {
o->op_seq = PL_op_seqmax++;
break;
}
/* Private for lvalues */
#define OPpLVAL_INTRO 128 /* Lvalue must be localized or lvalue sub */
+/* Private for OP_LEAVE, OP_LEAVESUB, OP_LEAVESUBLV and OP_LEAVEWRITE */
+#define OPpREFCOUNTED 64 /* op_targ carries a refcount */
+
/* Private for OP_AASSIGN */
#define OPpASSIGN_COMMON 64 /* Left & right have syms in common. */
#define OPpEARLY_CV 32 /* foo() called before sub foo was parsed */
/* OP_?ELEM only */
#define OPpLVAL_DEFER 16 /* Defer creation of array/hash elem */
- /* for OP_RV2?V, lower bits carry hints */
+ /* OP_RV2?V only */
+#define OPpOUR_INTRO 16 /* Defer creation of array/hash elem */
+ /* for OP_RV2?V, lower bits carry hints (currently only HINT_STRICT_REFS) */
/* Private for OPs with TARGLEX */
/* (lower bits may carry MAXARG) */
/* Private for OP_DELETE */
#define OPpSLICE 64 /* Operating on a list of keys */
-/* Private for OP_SORT, OP_PRTF, OP_SPRINTF, string cmp'n, and case changers */
+/* Private for OP_SORT, OP_PRTF, OP_SPRINTF, OP_FTTEXT, OP_FTBINARY, */
+/* string comparisons, and case changers. */
#define OPpLOCALE 64 /* Use locale */
/* Private for OP_SORT */
SV * op_sv;
};
-struct gvop {
+struct padop {
BASEOP
- GV * op_gv;
+ PADOFFSET op_padix;
};
struct pvop {
OP * op_lastop;
};
-#define cUNOP ((UNOP*)PL_op)
-#define cBINOP ((BINOP*)PL_op)
-#define cLISTOP ((LISTOP*)PL_op)
-#define cLOGOP ((LOGOP*)PL_op)
-#define cPMOP ((PMOP*)PL_op)
-#define cSVOP ((SVOP*)PL_op)
-#define cGVOP ((GVOP*)PL_op)
-#define cPVOP ((PVOP*)PL_op)
-#define cCOP ((COP*)PL_op)
-#define cLOOP ((LOOP*)PL_op)
-
-#define cUNOPo ((UNOP*)o)
-#define cBINOPo ((BINOP*)o)
-#define cLISTOPo ((LISTOP*)o)
-#define cLOGOPo ((LOGOP*)o)
-#define cPMOPo ((PMOP*)o)
-#define cSVOPo ((SVOP*)o)
-#define cGVOPo ((GVOP*)o)
-#define cPVOPo ((PVOP*)o)
-#define cCVOPo ((CVOP*)o)
-#define cCOPo ((COP*)o)
-#define cLOOPo ((LOOP*)o)
-
-#define kUNOP ((UNOP*)kid)
-#define kBINOP ((BINOP*)kid)
-#define kLISTOP ((LISTOP*)kid)
-#define kLOGOP ((LOGOP*)kid)
-#define kPMOP ((PMOP*)kid)
-#define kSVOP ((SVOP*)kid)
-#define kGVOP ((GVOP*)kid)
-#define kPVOP ((PVOP*)kid)
-#define kCOP ((COP*)kid)
-#define kLOOP ((LOOP*)kid)
+#define cUNOPx(o) ((UNOP*)o)
+#define cBINOPx(o) ((BINOP*)o)
+#define cLISTOPx(o) ((LISTOP*)o)
+#define cLOGOPx(o) ((LOGOP*)o)
+#define cPMOPx(o) ((PMOP*)o)
+#define cSVOPx(o) ((SVOP*)o)
+#define cPADOPx(o) ((PADOP*)o)
+#define cPVOPx(o) ((PVOP*)o)
+#define cCOPx(o) ((COP*)o)
+#define cLOOPx(o) ((LOOP*)o)
+
+#define cUNOP cUNOPx(PL_op)
+#define cBINOP cBINOPx(PL_op)
+#define cLISTOP cLISTOPx(PL_op)
+#define cLOGOP cLOGOPx(PL_op)
+#define cPMOP cPMOPx(PL_op)
+#define cSVOP cSVOPx(PL_op)
+#define cPADOP cPADOPx(PL_op)
+#define cPVOP cPVOPx(PL_op)
+#define cCOP cCOPx(PL_op)
+#define cLOOP cLOOPx(PL_op)
+
+#define cUNOPo cUNOPx(o)
+#define cBINOPo cBINOPx(o)
+#define cLISTOPo cLISTOPx(o)
+#define cLOGOPo cLOGOPx(o)
+#define cPMOPo cPMOPx(o)
+#define cSVOPo cSVOPx(o)
+#define cPADOPo cPADOPx(o)
+#define cPVOPo cPVOPx(o)
+#define cCOPo cCOPx(o)
+#define cLOOPo cLOOPx(o)
+
+#define kUNOP cUNOPx(kid)
+#define kBINOP cBINOPx(kid)
+#define kLISTOP cLISTOPx(kid)
+#define kLOGOP cLOGOPx(kid)
+#define kPMOP cPMOPx(kid)
+#define kSVOP cSVOPx(kid)
+#define kPADOP cPADOPx(kid)
+#define kPVOP cPVOPx(kid)
+#define kCOP cCOPx(kid)
+#define kLOOP cLOOPx(kid)
+
+
+#ifdef USE_ITHREADS
+# define cGVOPx_gv(o) ((GV*)PL_curpad[cPADOPx(o)->op_padix])
+# define IS_PADGV(v) (v && SvTYPE(v) == SVt_PVGV && GvIN_PAD(v))
+# define IS_PADCONST(v) (v && SvREADONLY(v))
+# define cSVOPx_sv(v) (cSVOPx(v)->op_sv \
+ ? cSVOPx(v)->op_sv : PL_curpad[(v)->op_targ])
+# define cSVOPx_svp(v) (cSVOPx(v)->op_sv \
+ ? &cSVOPx(v)->op_sv : &PL_curpad[(v)->op_targ])
+#else
+# define cGVOPx_gv(o) ((GV*)cSVOPx(o)->op_sv)
+# define IS_PADGV(v) FALSE
+# define IS_PADCONST(v) FALSE
+# define cSVOPx_sv(v) (cSVOPx(v)->op_sv)
+# define cSVOPx_svp(v) (&cSVOPx(v)->op_sv)
+#endif
+
+#define cGVOP_gv cGVOPx_gv(PL_op)
+#define cGVOPo_gv cGVOPx_gv(o)
+#define kGVOP_gv cGVOPx_gv(kid)
+#define cSVOP_sv cSVOPx_sv(PL_op)
+#define cSVOPo_sv cSVOPx_sv(o)
+#define kSVOP_sv cSVOPx_sv(kid)
#define Nullop Null(OP*)
#define OA_LISTOP (4 << OCSHIFT)
#define OA_PMOP (5 << OCSHIFT)
#define OA_SVOP (6 << OCSHIFT)
-#define OA_GVOP (7 << OCSHIFT)
+#define OA_PADOP (7 << OCSHIFT)
#define OA_PVOP_OR_SVOP (8 << OCSHIFT)
#define OA_LOOP (9 << OCSHIFT)
#define OA_COP (10 << OCSHIFT)
"private value",
"push regexp",
"ref-to-glob cast",
- "scalar deref",
+ "scalar dereference",
"array length",
- "subroutine deref",
+ "subroutine dereference",
"anonymous subroutine",
"subroutine prototype",
"reference constructor",
EXT OP * (CPERLscope(*PL_ppaddr)[])(pTHX);
#else
EXT OP * (CPERLscope(*PL_ppaddr)[])(pTHX) = {
- Perl_pp_null,
- Perl_pp_stub,
- Perl_pp_scalar,
- Perl_pp_pushmark,
- Perl_pp_wantarray,
- Perl_pp_const,
- Perl_pp_gvsv,
- Perl_pp_gv,
- Perl_pp_gelem,
- Perl_pp_padsv,
- Perl_pp_padav,
- Perl_pp_padhv,
- Perl_pp_padany,
- Perl_pp_pushre,
- Perl_pp_rv2gv,
- Perl_pp_rv2sv,
- Perl_pp_av2arylen,
- Perl_pp_rv2cv,
- Perl_pp_anoncode,
- Perl_pp_prototype,
- Perl_pp_refgen,
- Perl_pp_srefgen,
- Perl_pp_ref,
- Perl_pp_bless,
- Perl_pp_backtick,
- Perl_pp_glob,
- Perl_pp_readline,
- Perl_pp_rcatline,
- Perl_pp_regcmaybe,
- Perl_pp_regcreset,
- Perl_pp_regcomp,
- Perl_pp_match,
- Perl_pp_qr,
- Perl_pp_subst,
- Perl_pp_substcont,
- Perl_pp_trans,
- Perl_pp_sassign,
- Perl_pp_aassign,
- Perl_pp_chop,
- Perl_pp_schop,
- Perl_pp_chomp,
- Perl_pp_schomp,
- Perl_pp_defined,
- Perl_pp_undef,
- Perl_pp_study,
- Perl_pp_pos,
- Perl_pp_preinc,
- Perl_pp_i_preinc,
- Perl_pp_predec,
- Perl_pp_i_predec,
- Perl_pp_postinc,
- Perl_pp_i_postinc,
- Perl_pp_postdec,
- Perl_pp_i_postdec,
- Perl_pp_pow,
- Perl_pp_multiply,
- Perl_pp_i_multiply,
- Perl_pp_divide,
- Perl_pp_i_divide,
- Perl_pp_modulo,
- Perl_pp_i_modulo,
- Perl_pp_repeat,
- Perl_pp_add,
- Perl_pp_i_add,
- Perl_pp_subtract,
- Perl_pp_i_subtract,
- Perl_pp_concat,
- Perl_pp_stringify,
- Perl_pp_left_shift,
- Perl_pp_right_shift,
- Perl_pp_lt,
- Perl_pp_i_lt,
- Perl_pp_gt,
- Perl_pp_i_gt,
- Perl_pp_le,
- Perl_pp_i_le,
- Perl_pp_ge,
- Perl_pp_i_ge,
- Perl_pp_eq,
- Perl_pp_i_eq,
- Perl_pp_ne,
- Perl_pp_i_ne,
- Perl_pp_ncmp,
- Perl_pp_i_ncmp,
- Perl_pp_slt,
- Perl_pp_sgt,
- Perl_pp_sle,
- Perl_pp_sge,
- Perl_pp_seq,
- Perl_pp_sne,
- Perl_pp_scmp,
- Perl_pp_bit_and,
- Perl_pp_bit_xor,
- Perl_pp_bit_or,
- Perl_pp_negate,
- Perl_pp_i_negate,
- Perl_pp_not,
- Perl_pp_complement,
- Perl_pp_atan2,
- Perl_pp_sin,
- Perl_pp_cos,
- Perl_pp_rand,
- Perl_pp_srand,
- Perl_pp_exp,
- Perl_pp_log,
- Perl_pp_sqrt,
- Perl_pp_int,
- Perl_pp_hex,
- Perl_pp_oct,
- Perl_pp_abs,
- Perl_pp_length,
- Perl_pp_substr,
- Perl_pp_vec,
- Perl_pp_index,
- Perl_pp_rindex,
- Perl_pp_sprintf,
- Perl_pp_formline,
- Perl_pp_ord,
- Perl_pp_chr,
- Perl_pp_crypt,
- Perl_pp_ucfirst,
- Perl_pp_lcfirst,
- Perl_pp_uc,
- Perl_pp_lc,
- Perl_pp_quotemeta,
- Perl_pp_rv2av,
- Perl_pp_aelemfast,
- Perl_pp_aelem,
- Perl_pp_aslice,
- Perl_pp_each,
- Perl_pp_values,
- Perl_pp_keys,
- Perl_pp_delete,
- Perl_pp_exists,
- Perl_pp_rv2hv,
- Perl_pp_helem,
- Perl_pp_hslice,
- Perl_pp_unpack,
- Perl_pp_pack,
- Perl_pp_split,
- Perl_pp_join,
- Perl_pp_list,
- Perl_pp_lslice,
- Perl_pp_anonlist,
- Perl_pp_anonhash,
- Perl_pp_splice,
- Perl_pp_push,
- Perl_pp_pop,
- Perl_pp_shift,
- Perl_pp_unshift,
- Perl_pp_sort,
- Perl_pp_reverse,
- Perl_pp_grepstart,
- Perl_pp_grepwhile,
- Perl_pp_mapstart,
- Perl_pp_mapwhile,
- Perl_pp_range,
- Perl_pp_flip,
- Perl_pp_flop,
- Perl_pp_and,
- Perl_pp_or,
- Perl_pp_xor,
- Perl_pp_cond_expr,
- Perl_pp_andassign,
- Perl_pp_orassign,
- Perl_pp_method,
- Perl_pp_entersub,
- Perl_pp_leavesub,
- Perl_pp_leavesublv,
- Perl_pp_caller,
- Perl_pp_warn,
- Perl_pp_die,
- Perl_pp_reset,
- Perl_pp_lineseq,
- Perl_pp_nextstate,
- Perl_pp_dbstate,
- Perl_pp_unstack,
- Perl_pp_enter,
- Perl_pp_leave,
- Perl_pp_scope,
- Perl_pp_enteriter,
- Perl_pp_iter,
- Perl_pp_enterloop,
- Perl_pp_leaveloop,
- Perl_pp_return,
- Perl_pp_last,
- Perl_pp_next,
- Perl_pp_redo,
- Perl_pp_dump,
- Perl_pp_goto,
- Perl_pp_exit,
- Perl_pp_open,
- Perl_pp_close,
- Perl_pp_pipe_op,
- Perl_pp_fileno,
- Perl_pp_umask,
- Perl_pp_binmode,
- Perl_pp_tie,
- Perl_pp_untie,
- Perl_pp_tied,
- Perl_pp_dbmopen,
- Perl_pp_dbmclose,
- Perl_pp_sselect,
- Perl_pp_select,
- Perl_pp_getc,
- Perl_pp_read,
- Perl_pp_enterwrite,
- Perl_pp_leavewrite,
- Perl_pp_prtf,
- Perl_pp_print,
- Perl_pp_sysopen,
- Perl_pp_sysseek,
- Perl_pp_sysread,
- Perl_pp_syswrite,
- Perl_pp_send,
- Perl_pp_recv,
- Perl_pp_eof,
- Perl_pp_tell,
- Perl_pp_seek,
- Perl_pp_truncate,
- Perl_pp_fcntl,
- Perl_pp_ioctl,
- Perl_pp_flock,
- Perl_pp_socket,
- Perl_pp_sockpair,
- Perl_pp_bind,
- Perl_pp_connect,
- Perl_pp_listen,
- Perl_pp_accept,
- Perl_pp_shutdown,
- Perl_pp_gsockopt,
- Perl_pp_ssockopt,
- Perl_pp_getsockname,
- Perl_pp_getpeername,
- Perl_pp_lstat,
- Perl_pp_stat,
- Perl_pp_ftrread,
- Perl_pp_ftrwrite,
- Perl_pp_ftrexec,
- Perl_pp_fteread,
- Perl_pp_ftewrite,
- Perl_pp_fteexec,
- Perl_pp_ftis,
- Perl_pp_fteowned,
- Perl_pp_ftrowned,
- Perl_pp_ftzero,
- Perl_pp_ftsize,
- Perl_pp_ftmtime,
- Perl_pp_ftatime,
- Perl_pp_ftctime,
- Perl_pp_ftsock,
- Perl_pp_ftchr,
- Perl_pp_ftblk,
- Perl_pp_ftfile,
- Perl_pp_ftdir,
- Perl_pp_ftpipe,
- Perl_pp_ftlink,
- Perl_pp_ftsuid,
- Perl_pp_ftsgid,
- Perl_pp_ftsvtx,
- Perl_pp_fttty,
- Perl_pp_fttext,
- Perl_pp_ftbinary,
- Perl_pp_chdir,
- Perl_pp_chown,
- Perl_pp_chroot,
- Perl_pp_unlink,
- Perl_pp_chmod,
- Perl_pp_utime,
- Perl_pp_rename,
- Perl_pp_link,
- Perl_pp_symlink,
- Perl_pp_readlink,
- Perl_pp_mkdir,
- Perl_pp_rmdir,
- Perl_pp_open_dir,
- Perl_pp_readdir,
- Perl_pp_telldir,
- Perl_pp_seekdir,
- Perl_pp_rewinddir,
- Perl_pp_closedir,
- Perl_pp_fork,
- Perl_pp_wait,
- Perl_pp_waitpid,
- Perl_pp_system,
- Perl_pp_exec,
- Perl_pp_kill,
- Perl_pp_getppid,
- Perl_pp_getpgrp,
- Perl_pp_setpgrp,
- Perl_pp_getpriority,
- Perl_pp_setpriority,
- Perl_pp_time,
- Perl_pp_tms,
- Perl_pp_localtime,
- Perl_pp_gmtime,
- Perl_pp_alarm,
- Perl_pp_sleep,
- Perl_pp_shmget,
- Perl_pp_shmctl,
- Perl_pp_shmread,
- Perl_pp_shmwrite,
- Perl_pp_msgget,
- Perl_pp_msgctl,
- Perl_pp_msgsnd,
- Perl_pp_msgrcv,
- Perl_pp_semget,
- Perl_pp_semctl,
- Perl_pp_semop,
- Perl_pp_require,
- Perl_pp_dofile,
- Perl_pp_entereval,
- Perl_pp_leaveeval,
- Perl_pp_entertry,
- Perl_pp_leavetry,
- Perl_pp_ghbyname,
- Perl_pp_ghbyaddr,
- Perl_pp_ghostent,
- Perl_pp_gnbyname,
- Perl_pp_gnbyaddr,
- Perl_pp_gnetent,
- Perl_pp_gpbyname,
- Perl_pp_gpbynumber,
- Perl_pp_gprotoent,
- Perl_pp_gsbyname,
- Perl_pp_gsbyport,
- Perl_pp_gservent,
- Perl_pp_shostent,
- Perl_pp_snetent,
- Perl_pp_sprotoent,
- Perl_pp_sservent,
- Perl_pp_ehostent,
- Perl_pp_enetent,
- Perl_pp_eprotoent,
- Perl_pp_eservent,
- Perl_pp_gpwnam,
- Perl_pp_gpwuid,
- Perl_pp_gpwent,
- Perl_pp_spwent,
- Perl_pp_epwent,
- Perl_pp_ggrnam,
- Perl_pp_ggrgid,
- Perl_pp_ggrent,
- Perl_pp_sgrent,
- Perl_pp_egrent,
- Perl_pp_getlogin,
- Perl_pp_syscall,
- Perl_pp_lock,
- Perl_pp_threadsv,
- Perl_pp_setstate,
- Perl_pp_method_named,
+ MEMBER_TO_FPTR(Perl_pp_null),
+ MEMBER_TO_FPTR(Perl_pp_stub),
+ MEMBER_TO_FPTR(Perl_pp_scalar),
+ MEMBER_TO_FPTR(Perl_pp_pushmark),
+ MEMBER_TO_FPTR(Perl_pp_wantarray),
+ MEMBER_TO_FPTR(Perl_pp_const),
+ MEMBER_TO_FPTR(Perl_pp_gvsv),
+ MEMBER_TO_FPTR(Perl_pp_gv),
+ MEMBER_TO_FPTR(Perl_pp_gelem),
+ MEMBER_TO_FPTR(Perl_pp_padsv),
+ MEMBER_TO_FPTR(Perl_pp_padav),
+ MEMBER_TO_FPTR(Perl_pp_padhv),
+ MEMBER_TO_FPTR(Perl_pp_padany),
+ MEMBER_TO_FPTR(Perl_pp_pushre),
+ MEMBER_TO_FPTR(Perl_pp_rv2gv),
+ MEMBER_TO_FPTR(Perl_pp_rv2sv),
+ MEMBER_TO_FPTR(Perl_pp_av2arylen),
+ MEMBER_TO_FPTR(Perl_pp_rv2cv),
+ MEMBER_TO_FPTR(Perl_pp_anoncode),
+ MEMBER_TO_FPTR(Perl_pp_prototype),
+ MEMBER_TO_FPTR(Perl_pp_refgen),
+ MEMBER_TO_FPTR(Perl_pp_srefgen),
+ MEMBER_TO_FPTR(Perl_pp_ref),
+ MEMBER_TO_FPTR(Perl_pp_bless),
+ MEMBER_TO_FPTR(Perl_pp_backtick),
+ MEMBER_TO_FPTR(Perl_pp_glob),
+ MEMBER_TO_FPTR(Perl_pp_readline),
+ MEMBER_TO_FPTR(Perl_pp_rcatline),
+ MEMBER_TO_FPTR(Perl_pp_regcmaybe),
+ MEMBER_TO_FPTR(Perl_pp_regcreset),
+ MEMBER_TO_FPTR(Perl_pp_regcomp),
+ MEMBER_TO_FPTR(Perl_pp_match),
+ MEMBER_TO_FPTR(Perl_pp_qr),
+ MEMBER_TO_FPTR(Perl_pp_subst),
+ MEMBER_TO_FPTR(Perl_pp_substcont),
+ MEMBER_TO_FPTR(Perl_pp_trans),
+ MEMBER_TO_FPTR(Perl_pp_sassign),
+ MEMBER_TO_FPTR(Perl_pp_aassign),
+ MEMBER_TO_FPTR(Perl_pp_chop),
+ MEMBER_TO_FPTR(Perl_pp_schop),
+ MEMBER_TO_FPTR(Perl_pp_chomp),
+ MEMBER_TO_FPTR(Perl_pp_schomp),
+ MEMBER_TO_FPTR(Perl_pp_defined),
+ MEMBER_TO_FPTR(Perl_pp_undef),
+ MEMBER_TO_FPTR(Perl_pp_study),
+ MEMBER_TO_FPTR(Perl_pp_pos),
+ MEMBER_TO_FPTR(Perl_pp_preinc),
+ MEMBER_TO_FPTR(Perl_pp_i_preinc),
+ MEMBER_TO_FPTR(Perl_pp_predec),
+ MEMBER_TO_FPTR(Perl_pp_i_predec),
+ MEMBER_TO_FPTR(Perl_pp_postinc),
+ MEMBER_TO_FPTR(Perl_pp_i_postinc),
+ MEMBER_TO_FPTR(Perl_pp_postdec),
+ MEMBER_TO_FPTR(Perl_pp_i_postdec),
+ MEMBER_TO_FPTR(Perl_pp_pow),
+ MEMBER_TO_FPTR(Perl_pp_multiply),
+ MEMBER_TO_FPTR(Perl_pp_i_multiply),
+ MEMBER_TO_FPTR(Perl_pp_divide),
+ MEMBER_TO_FPTR(Perl_pp_i_divide),
+ MEMBER_TO_FPTR(Perl_pp_modulo),
+ MEMBER_TO_FPTR(Perl_pp_i_modulo),
+ MEMBER_TO_FPTR(Perl_pp_repeat),
+ MEMBER_TO_FPTR(Perl_pp_add),
+ MEMBER_TO_FPTR(Perl_pp_i_add),
+ MEMBER_TO_FPTR(Perl_pp_subtract),
+ MEMBER_TO_FPTR(Perl_pp_i_subtract),
+ MEMBER_TO_FPTR(Perl_pp_concat),
+ MEMBER_TO_FPTR(Perl_pp_stringify),
+ MEMBER_TO_FPTR(Perl_pp_left_shift),
+ MEMBER_TO_FPTR(Perl_pp_right_shift),
+ MEMBER_TO_FPTR(Perl_pp_lt),
+ MEMBER_TO_FPTR(Perl_pp_i_lt),
+ MEMBER_TO_FPTR(Perl_pp_gt),
+ MEMBER_TO_FPTR(Perl_pp_i_gt),
+ MEMBER_TO_FPTR(Perl_pp_le),
+ MEMBER_TO_FPTR(Perl_pp_i_le),
+ MEMBER_TO_FPTR(Perl_pp_ge),
+ MEMBER_TO_FPTR(Perl_pp_i_ge),
+ MEMBER_TO_FPTR(Perl_pp_eq),
+ MEMBER_TO_FPTR(Perl_pp_i_eq),
+ MEMBER_TO_FPTR(Perl_pp_ne),
+ MEMBER_TO_FPTR(Perl_pp_i_ne),
+ MEMBER_TO_FPTR(Perl_pp_ncmp),
+ MEMBER_TO_FPTR(Perl_pp_i_ncmp),
+ MEMBER_TO_FPTR(Perl_pp_slt),
+ MEMBER_TO_FPTR(Perl_pp_sgt),
+ MEMBER_TO_FPTR(Perl_pp_sle),
+ MEMBER_TO_FPTR(Perl_pp_sge),
+ MEMBER_TO_FPTR(Perl_pp_seq),
+ MEMBER_TO_FPTR(Perl_pp_sne),
+ MEMBER_TO_FPTR(Perl_pp_scmp),
+ MEMBER_TO_FPTR(Perl_pp_bit_and),
+ MEMBER_TO_FPTR(Perl_pp_bit_xor),
+ MEMBER_TO_FPTR(Perl_pp_bit_or),
+ MEMBER_TO_FPTR(Perl_pp_negate),
+ MEMBER_TO_FPTR(Perl_pp_i_negate),
+ MEMBER_TO_FPTR(Perl_pp_not),
+ MEMBER_TO_FPTR(Perl_pp_complement),
+ MEMBER_TO_FPTR(Perl_pp_atan2),
+ MEMBER_TO_FPTR(Perl_pp_sin),
+ MEMBER_TO_FPTR(Perl_pp_cos),
+ MEMBER_TO_FPTR(Perl_pp_rand),
+ MEMBER_TO_FPTR(Perl_pp_srand),
+ MEMBER_TO_FPTR(Perl_pp_exp),
+ MEMBER_TO_FPTR(Perl_pp_log),
+ MEMBER_TO_FPTR(Perl_pp_sqrt),
+ MEMBER_TO_FPTR(Perl_pp_int),
+ MEMBER_TO_FPTR(Perl_pp_hex),
+ MEMBER_TO_FPTR(Perl_pp_oct),
+ MEMBER_TO_FPTR(Perl_pp_abs),
+ MEMBER_TO_FPTR(Perl_pp_length),
+ MEMBER_TO_FPTR(Perl_pp_substr),
+ MEMBER_TO_FPTR(Perl_pp_vec),
+ MEMBER_TO_FPTR(Perl_pp_index),
+ MEMBER_TO_FPTR(Perl_pp_rindex),
+ MEMBER_TO_FPTR(Perl_pp_sprintf),
+ MEMBER_TO_FPTR(Perl_pp_formline),
+ MEMBER_TO_FPTR(Perl_pp_ord),
+ MEMBER_TO_FPTR(Perl_pp_chr),
+ MEMBER_TO_FPTR(Perl_pp_crypt),
+ MEMBER_TO_FPTR(Perl_pp_ucfirst),
+ MEMBER_TO_FPTR(Perl_pp_lcfirst),
+ MEMBER_TO_FPTR(Perl_pp_uc),
+ MEMBER_TO_FPTR(Perl_pp_lc),
+ MEMBER_TO_FPTR(Perl_pp_quotemeta),
+ MEMBER_TO_FPTR(Perl_pp_rv2av),
+ MEMBER_TO_FPTR(Perl_pp_aelemfast),
+ MEMBER_TO_FPTR(Perl_pp_aelem),
+ MEMBER_TO_FPTR(Perl_pp_aslice),
+ MEMBER_TO_FPTR(Perl_pp_each),
+ MEMBER_TO_FPTR(Perl_pp_values),
+ MEMBER_TO_FPTR(Perl_pp_keys),
+ MEMBER_TO_FPTR(Perl_pp_delete),
+ MEMBER_TO_FPTR(Perl_pp_exists),
+ MEMBER_TO_FPTR(Perl_pp_rv2hv),
+ MEMBER_TO_FPTR(Perl_pp_helem),
+ MEMBER_TO_FPTR(Perl_pp_hslice),
+ MEMBER_TO_FPTR(Perl_pp_unpack),
+ MEMBER_TO_FPTR(Perl_pp_pack),
+ MEMBER_TO_FPTR(Perl_pp_split),
+ MEMBER_TO_FPTR(Perl_pp_join),
+ MEMBER_TO_FPTR(Perl_pp_list),
+ MEMBER_TO_FPTR(Perl_pp_lslice),
+ MEMBER_TO_FPTR(Perl_pp_anonlist),
+ MEMBER_TO_FPTR(Perl_pp_anonhash),
+ MEMBER_TO_FPTR(Perl_pp_splice),
+ MEMBER_TO_FPTR(Perl_pp_push),
+ MEMBER_TO_FPTR(Perl_pp_pop),
+ MEMBER_TO_FPTR(Perl_pp_shift),
+ MEMBER_TO_FPTR(Perl_pp_unshift),
+ MEMBER_TO_FPTR(Perl_pp_sort),
+ MEMBER_TO_FPTR(Perl_pp_reverse),
+ MEMBER_TO_FPTR(Perl_pp_grepstart),
+ MEMBER_TO_FPTR(Perl_pp_grepwhile),
+ MEMBER_TO_FPTR(Perl_pp_mapstart),
+ MEMBER_TO_FPTR(Perl_pp_mapwhile),
+ MEMBER_TO_FPTR(Perl_pp_range),
+ MEMBER_TO_FPTR(Perl_pp_flip),
+ MEMBER_TO_FPTR(Perl_pp_flop),
+ MEMBER_TO_FPTR(Perl_pp_and),
+ MEMBER_TO_FPTR(Perl_pp_or),
+ MEMBER_TO_FPTR(Perl_pp_xor),
+ MEMBER_TO_FPTR(Perl_pp_cond_expr),
+ MEMBER_TO_FPTR(Perl_pp_andassign),
+ MEMBER_TO_FPTR(Perl_pp_orassign),
+ MEMBER_TO_FPTR(Perl_pp_method),
+ MEMBER_TO_FPTR(Perl_pp_entersub),
+ MEMBER_TO_FPTR(Perl_pp_leavesub),
+ MEMBER_TO_FPTR(Perl_pp_leavesublv),
+ MEMBER_TO_FPTR(Perl_pp_caller),
+ MEMBER_TO_FPTR(Perl_pp_warn),
+ MEMBER_TO_FPTR(Perl_pp_die),
+ MEMBER_TO_FPTR(Perl_pp_reset),
+ MEMBER_TO_FPTR(Perl_pp_lineseq),
+ MEMBER_TO_FPTR(Perl_pp_nextstate),
+ MEMBER_TO_FPTR(Perl_pp_dbstate),
+ MEMBER_TO_FPTR(Perl_pp_unstack),
+ MEMBER_TO_FPTR(Perl_pp_enter),
+ MEMBER_TO_FPTR(Perl_pp_leave),
+ MEMBER_TO_FPTR(Perl_pp_scope),
+ MEMBER_TO_FPTR(Perl_pp_enteriter),
+ MEMBER_TO_FPTR(Perl_pp_iter),
+ MEMBER_TO_FPTR(Perl_pp_enterloop),
+ MEMBER_TO_FPTR(Perl_pp_leaveloop),
+ MEMBER_TO_FPTR(Perl_pp_return),
+ MEMBER_TO_FPTR(Perl_pp_last),
+ MEMBER_TO_FPTR(Perl_pp_next),
+ MEMBER_TO_FPTR(Perl_pp_redo),
+ MEMBER_TO_FPTR(Perl_pp_dump),
+ MEMBER_TO_FPTR(Perl_pp_goto),
+ MEMBER_TO_FPTR(Perl_pp_exit),
+ MEMBER_TO_FPTR(Perl_pp_open),
+ MEMBER_TO_FPTR(Perl_pp_close),
+ MEMBER_TO_FPTR(Perl_pp_pipe_op),
+ MEMBER_TO_FPTR(Perl_pp_fileno),
+ MEMBER_TO_FPTR(Perl_pp_umask),
+ MEMBER_TO_FPTR(Perl_pp_binmode),
+ MEMBER_TO_FPTR(Perl_pp_tie),
+ MEMBER_TO_FPTR(Perl_pp_untie),
+ MEMBER_TO_FPTR(Perl_pp_tied),
+ MEMBER_TO_FPTR(Perl_pp_dbmopen),
+ MEMBER_TO_FPTR(Perl_pp_dbmclose),
+ MEMBER_TO_FPTR(Perl_pp_sselect),
+ MEMBER_TO_FPTR(Perl_pp_select),
+ MEMBER_TO_FPTR(Perl_pp_getc),
+ MEMBER_TO_FPTR(Perl_pp_read),
+ MEMBER_TO_FPTR(Perl_pp_enterwrite),
+ MEMBER_TO_FPTR(Perl_pp_leavewrite),
+ MEMBER_TO_FPTR(Perl_pp_prtf),
+ MEMBER_TO_FPTR(Perl_pp_print),
+ MEMBER_TO_FPTR(Perl_pp_sysopen),
+ MEMBER_TO_FPTR(Perl_pp_sysseek),
+ MEMBER_TO_FPTR(Perl_pp_sysread),
+ MEMBER_TO_FPTR(Perl_pp_syswrite),
+ MEMBER_TO_FPTR(Perl_pp_send),
+ MEMBER_TO_FPTR(Perl_pp_recv),
+ MEMBER_TO_FPTR(Perl_pp_eof),
+ MEMBER_TO_FPTR(Perl_pp_tell),
+ MEMBER_TO_FPTR(Perl_pp_seek),
+ MEMBER_TO_FPTR(Perl_pp_truncate),
+ MEMBER_TO_FPTR(Perl_pp_fcntl),
+ MEMBER_TO_FPTR(Perl_pp_ioctl),
+ MEMBER_TO_FPTR(Perl_pp_flock),
+ MEMBER_TO_FPTR(Perl_pp_socket),
+ MEMBER_TO_FPTR(Perl_pp_sockpair),
+ MEMBER_TO_FPTR(Perl_pp_bind),
+ MEMBER_TO_FPTR(Perl_pp_connect),
+ MEMBER_TO_FPTR(Perl_pp_listen),
+ MEMBER_TO_FPTR(Perl_pp_accept),
+ MEMBER_TO_FPTR(Perl_pp_shutdown),
+ MEMBER_TO_FPTR(Perl_pp_gsockopt),
+ MEMBER_TO_FPTR(Perl_pp_ssockopt),
+ MEMBER_TO_FPTR(Perl_pp_getsockname),
+ MEMBER_TO_FPTR(Perl_pp_getpeername),
+ MEMBER_TO_FPTR(Perl_pp_lstat),
+ MEMBER_TO_FPTR(Perl_pp_stat),
+ MEMBER_TO_FPTR(Perl_pp_ftrread),
+ MEMBER_TO_FPTR(Perl_pp_ftrwrite),
+ MEMBER_TO_FPTR(Perl_pp_ftrexec),
+ MEMBER_TO_FPTR(Perl_pp_fteread),
+ MEMBER_TO_FPTR(Perl_pp_ftewrite),
+ MEMBER_TO_FPTR(Perl_pp_fteexec),
+ MEMBER_TO_FPTR(Perl_pp_ftis),
+ MEMBER_TO_FPTR(Perl_pp_fteowned),
+ MEMBER_TO_FPTR(Perl_pp_ftrowned),
+ MEMBER_TO_FPTR(Perl_pp_ftzero),
+ MEMBER_TO_FPTR(Perl_pp_ftsize),
+ MEMBER_TO_FPTR(Perl_pp_ftmtime),
+ MEMBER_TO_FPTR(Perl_pp_ftatime),
+ MEMBER_TO_FPTR(Perl_pp_ftctime),
+ MEMBER_TO_FPTR(Perl_pp_ftsock),
+ MEMBER_TO_FPTR(Perl_pp_ftchr),
+ MEMBER_TO_FPTR(Perl_pp_ftblk),
+ MEMBER_TO_FPTR(Perl_pp_ftfile),
+ MEMBER_TO_FPTR(Perl_pp_ftdir),
+ MEMBER_TO_FPTR(Perl_pp_ftpipe),
+ MEMBER_TO_FPTR(Perl_pp_ftlink),
+ MEMBER_TO_FPTR(Perl_pp_ftsuid),
+ MEMBER_TO_FPTR(Perl_pp_ftsgid),
+ MEMBER_TO_FPTR(Perl_pp_ftsvtx),
+ MEMBER_TO_FPTR(Perl_pp_fttty),
+ MEMBER_TO_FPTR(Perl_pp_fttext),
+ MEMBER_TO_FPTR(Perl_pp_ftbinary),
+ MEMBER_TO_FPTR(Perl_pp_chdir),
+ MEMBER_TO_FPTR(Perl_pp_chown),
+ MEMBER_TO_FPTR(Perl_pp_chroot),
+ MEMBER_TO_FPTR(Perl_pp_unlink),
+ MEMBER_TO_FPTR(Perl_pp_chmod),
+ MEMBER_TO_FPTR(Perl_pp_utime),
+ MEMBER_TO_FPTR(Perl_pp_rename),
+ MEMBER_TO_FPTR(Perl_pp_link),
+ MEMBER_TO_FPTR(Perl_pp_symlink),
+ MEMBER_TO_FPTR(Perl_pp_readlink),
+ MEMBER_TO_FPTR(Perl_pp_mkdir),
+ MEMBER_TO_FPTR(Perl_pp_rmdir),
+ MEMBER_TO_FPTR(Perl_pp_open_dir),
+ MEMBER_TO_FPTR(Perl_pp_readdir),
+ MEMBER_TO_FPTR(Perl_pp_telldir),
+ MEMBER_TO_FPTR(Perl_pp_seekdir),
+ MEMBER_TO_FPTR(Perl_pp_rewinddir),
+ MEMBER_TO_FPTR(Perl_pp_closedir),
+ MEMBER_TO_FPTR(Perl_pp_fork),
+ MEMBER_TO_FPTR(Perl_pp_wait),
+ MEMBER_TO_FPTR(Perl_pp_waitpid),
+ MEMBER_TO_FPTR(Perl_pp_system),
+ MEMBER_TO_FPTR(Perl_pp_exec),
+ MEMBER_TO_FPTR(Perl_pp_kill),
+ MEMBER_TO_FPTR(Perl_pp_getppid),
+ MEMBER_TO_FPTR(Perl_pp_getpgrp),
+ MEMBER_TO_FPTR(Perl_pp_setpgrp),
+ MEMBER_TO_FPTR(Perl_pp_getpriority),
+ MEMBER_TO_FPTR(Perl_pp_setpriority),
+ MEMBER_TO_FPTR(Perl_pp_time),
+ MEMBER_TO_FPTR(Perl_pp_tms),
+ MEMBER_TO_FPTR(Perl_pp_localtime),
+ MEMBER_TO_FPTR(Perl_pp_gmtime),
+ MEMBER_TO_FPTR(Perl_pp_alarm),
+ MEMBER_TO_FPTR(Perl_pp_sleep),
+ MEMBER_TO_FPTR(Perl_pp_shmget),
+ MEMBER_TO_FPTR(Perl_pp_shmctl),
+ MEMBER_TO_FPTR(Perl_pp_shmread),
+ MEMBER_TO_FPTR(Perl_pp_shmwrite),
+ MEMBER_TO_FPTR(Perl_pp_msgget),
+ MEMBER_TO_FPTR(Perl_pp_msgctl),
+ MEMBER_TO_FPTR(Perl_pp_msgsnd),
+ MEMBER_TO_FPTR(Perl_pp_msgrcv),
+ MEMBER_TO_FPTR(Perl_pp_semget),
+ MEMBER_TO_FPTR(Perl_pp_semctl),
+ MEMBER_TO_FPTR(Perl_pp_semop),
+ MEMBER_TO_FPTR(Perl_pp_require),
+ MEMBER_TO_FPTR(Perl_pp_dofile),
+ MEMBER_TO_FPTR(Perl_pp_entereval),
+ MEMBER_TO_FPTR(Perl_pp_leaveeval),
+ MEMBER_TO_FPTR(Perl_pp_entertry),
+ MEMBER_TO_FPTR(Perl_pp_leavetry),
+ MEMBER_TO_FPTR(Perl_pp_ghbyname),
+ MEMBER_TO_FPTR(Perl_pp_ghbyaddr),
+ MEMBER_TO_FPTR(Perl_pp_ghostent),
+ MEMBER_TO_FPTR(Perl_pp_gnbyname),
+ MEMBER_TO_FPTR(Perl_pp_gnbyaddr),
+ MEMBER_TO_FPTR(Perl_pp_gnetent),
+ MEMBER_TO_FPTR(Perl_pp_gpbyname),
+ MEMBER_TO_FPTR(Perl_pp_gpbynumber),
+ MEMBER_TO_FPTR(Perl_pp_gprotoent),
+ MEMBER_TO_FPTR(Perl_pp_gsbyname),
+ MEMBER_TO_FPTR(Perl_pp_gsbyport),
+ MEMBER_TO_FPTR(Perl_pp_gservent),
+ MEMBER_TO_FPTR(Perl_pp_shostent),
+ MEMBER_TO_FPTR(Perl_pp_snetent),
+ MEMBER_TO_FPTR(Perl_pp_sprotoent),
+ MEMBER_TO_FPTR(Perl_pp_sservent),
+ MEMBER_TO_FPTR(Perl_pp_ehostent),
+ MEMBER_TO_FPTR(Perl_pp_enetent),
+ MEMBER_TO_FPTR(Perl_pp_eprotoent),
+ MEMBER_TO_FPTR(Perl_pp_eservent),
+ MEMBER_TO_FPTR(Perl_pp_gpwnam),
+ MEMBER_TO_FPTR(Perl_pp_gpwuid),
+ MEMBER_TO_FPTR(Perl_pp_gpwent),
+ MEMBER_TO_FPTR(Perl_pp_spwent),
+ MEMBER_TO_FPTR(Perl_pp_epwent),
+ MEMBER_TO_FPTR(Perl_pp_ggrnam),
+ MEMBER_TO_FPTR(Perl_pp_ggrgid),
+ MEMBER_TO_FPTR(Perl_pp_ggrent),
+ MEMBER_TO_FPTR(Perl_pp_sgrent),
+ MEMBER_TO_FPTR(Perl_pp_egrent),
+ MEMBER_TO_FPTR(Perl_pp_getlogin),
+ MEMBER_TO_FPTR(Perl_pp_syscall),
+ MEMBER_TO_FPTR(Perl_pp_lock),
+ MEMBER_TO_FPTR(Perl_pp_threadsv),
+ MEMBER_TO_FPTR(Perl_pp_setstate),
+ MEMBER_TO_FPTR(Perl_pp_method_named),
};
#endif
EXT OP * (CPERLscope(*PL_check)[]) (pTHX_ OP *op);
#else
EXT OP * (CPERLscope(*PL_check)[]) (pTHX_ OP *op) = {
- Perl_ck_null, /* null */
- Perl_ck_null, /* stub */
- Perl_ck_fun, /* scalar */
- Perl_ck_null, /* pushmark */
- Perl_ck_null, /* wantarray */
- Perl_ck_svconst,/* const */
- Perl_ck_null, /* gvsv */
- Perl_ck_null, /* gv */
- Perl_ck_null, /* gelem */
- Perl_ck_null, /* padsv */
- Perl_ck_null, /* padav */
- Perl_ck_null, /* padhv */
- Perl_ck_null, /* padany */
- Perl_ck_null, /* pushre */
- Perl_ck_rvconst,/* rv2gv */
- Perl_ck_rvconst,/* rv2sv */
- Perl_ck_null, /* av2arylen */
- Perl_ck_rvconst,/* rv2cv */
- Perl_ck_anoncode,/* anoncode */
- Perl_ck_null, /* prototype */
- Perl_ck_spair, /* refgen */
- Perl_ck_null, /* srefgen */
- Perl_ck_fun, /* ref */
- Perl_ck_fun, /* bless */
- Perl_ck_null, /* backtick */
- Perl_ck_glob, /* glob */
- Perl_ck_null, /* readline */
- Perl_ck_null, /* rcatline */
- Perl_ck_fun, /* regcmaybe */
- Perl_ck_fun, /* regcreset */
- Perl_ck_null, /* regcomp */
- Perl_ck_match, /* match */
- Perl_ck_match, /* qr */
- Perl_ck_null, /* subst */
- Perl_ck_null, /* substcont */
- Perl_ck_null, /* trans */
- Perl_ck_sassign,/* sassign */
- Perl_ck_null, /* aassign */
- Perl_ck_spair, /* chop */
- Perl_ck_null, /* schop */
- Perl_ck_spair, /* chomp */
- Perl_ck_null, /* schomp */
- Perl_ck_defined,/* defined */
- Perl_ck_lfun, /* undef */
- Perl_ck_fun, /* study */
- Perl_ck_lfun, /* pos */
- Perl_ck_lfun, /* preinc */
- Perl_ck_lfun, /* i_preinc */
- Perl_ck_lfun, /* predec */
- Perl_ck_lfun, /* i_predec */
- Perl_ck_lfun, /* postinc */
- Perl_ck_lfun, /* i_postinc */
- Perl_ck_lfun, /* postdec */
- Perl_ck_lfun, /* i_postdec */
- Perl_ck_null, /* pow */
- Perl_ck_null, /* multiply */
- Perl_ck_null, /* i_multiply */
- Perl_ck_null, /* divide */
- Perl_ck_null, /* i_divide */
- Perl_ck_null, /* modulo */
- Perl_ck_null, /* i_modulo */
- Perl_ck_repeat, /* repeat */
- Perl_ck_null, /* add */
- Perl_ck_null, /* i_add */
- Perl_ck_null, /* subtract */
- Perl_ck_null, /* i_subtract */
- Perl_ck_concat, /* concat */
- Perl_ck_fun, /* stringify */
- Perl_ck_bitop, /* left_shift */
- Perl_ck_bitop, /* right_shift */
- Perl_ck_null, /* lt */
- Perl_ck_null, /* i_lt */
- Perl_ck_null, /* gt */
- Perl_ck_null, /* i_gt */
- Perl_ck_null, /* le */
- Perl_ck_null, /* i_le */
- Perl_ck_null, /* ge */
- Perl_ck_null, /* i_ge */
- Perl_ck_null, /* eq */
- Perl_ck_null, /* i_eq */
- Perl_ck_null, /* ne */
- Perl_ck_null, /* i_ne */
- Perl_ck_null, /* ncmp */
- Perl_ck_null, /* i_ncmp */
- Perl_ck_scmp, /* slt */
- Perl_ck_scmp, /* sgt */
- Perl_ck_scmp, /* sle */
- Perl_ck_scmp, /* sge */
- Perl_ck_null, /* seq */
- Perl_ck_null, /* sne */
- Perl_ck_scmp, /* scmp */
- Perl_ck_bitop, /* bit_and */
- Perl_ck_bitop, /* bit_xor */
- Perl_ck_bitop, /* bit_or */
- Perl_ck_null, /* negate */
- Perl_ck_null, /* i_negate */
- Perl_ck_null, /* not */
- Perl_ck_bitop, /* complement */
- Perl_ck_fun, /* atan2 */
- Perl_ck_fun, /* sin */
- Perl_ck_fun, /* cos */
- Perl_ck_fun, /* rand */
- Perl_ck_fun, /* srand */
- Perl_ck_fun, /* exp */
- Perl_ck_fun, /* log */
- Perl_ck_fun, /* sqrt */
- Perl_ck_fun, /* int */
- Perl_ck_fun, /* hex */
- Perl_ck_fun, /* oct */
- Perl_ck_fun, /* abs */
- Perl_ck_lengthconst,/* length */
- Perl_ck_fun, /* substr */
- Perl_ck_fun, /* vec */
- Perl_ck_index, /* index */
- Perl_ck_index, /* rindex */
- Perl_ck_fun_locale,/* sprintf */
- Perl_ck_fun, /* formline */
- Perl_ck_fun, /* ord */
- Perl_ck_fun, /* chr */
- Perl_ck_fun, /* crypt */
- Perl_ck_fun_locale,/* ucfirst */
- Perl_ck_fun_locale,/* lcfirst */
- Perl_ck_fun_locale,/* uc */
- Perl_ck_fun_locale,/* lc */
- Perl_ck_fun, /* quotemeta */
- Perl_ck_rvconst,/* rv2av */
- Perl_ck_null, /* aelemfast */
- Perl_ck_null, /* aelem */
- Perl_ck_null, /* aslice */
- Perl_ck_fun, /* each */
- Perl_ck_fun, /* values */
- Perl_ck_fun, /* keys */
- Perl_ck_delete, /* delete */
- Perl_ck_exists, /* exists */
- Perl_ck_rvconst,/* rv2hv */
- Perl_ck_null, /* helem */
- Perl_ck_null, /* hslice */
- Perl_ck_fun, /* unpack */
- Perl_ck_fun, /* pack */
- Perl_ck_split, /* split */
- Perl_ck_join, /* join */
- Perl_ck_null, /* list */
- Perl_ck_null, /* lslice */
- Perl_ck_fun, /* anonlist */
- Perl_ck_fun, /* anonhash */
- Perl_ck_fun, /* splice */
- Perl_ck_fun, /* push */
- Perl_ck_shift, /* pop */
- Perl_ck_shift, /* shift */
- Perl_ck_fun, /* unshift */
- Perl_ck_sort, /* sort */
- Perl_ck_fun, /* reverse */
- Perl_ck_grep, /* grepstart */
- Perl_ck_null, /* grepwhile */
- Perl_ck_grep, /* mapstart */
- Perl_ck_null, /* mapwhile */
- Perl_ck_null, /* range */
- Perl_ck_null, /* flip */
- Perl_ck_null, /* flop */
- Perl_ck_null, /* and */
- Perl_ck_null, /* or */
- Perl_ck_null, /* xor */
- Perl_ck_null, /* cond_expr */
- Perl_ck_null, /* andassign */
- Perl_ck_null, /* orassign */
- Perl_ck_method, /* method */
- Perl_ck_subr, /* entersub */
- Perl_ck_null, /* leavesub */
- Perl_ck_null, /* leavesublv */
- Perl_ck_fun, /* caller */
- Perl_ck_fun, /* warn */
- Perl_ck_fun, /* die */
- Perl_ck_fun, /* reset */
- Perl_ck_null, /* lineseq */
- Perl_ck_null, /* nextstate */
- Perl_ck_null, /* dbstate */
- Perl_ck_null, /* unstack */
- Perl_ck_null, /* enter */
- Perl_ck_null, /* leave */
- Perl_ck_null, /* scope */
- Perl_ck_null, /* enteriter */
- Perl_ck_null, /* iter */
- Perl_ck_null, /* enterloop */
- Perl_ck_null, /* leaveloop */
- Perl_ck_null, /* return */
- Perl_ck_null, /* last */
- Perl_ck_null, /* next */
- Perl_ck_null, /* redo */
- Perl_ck_null, /* dump */
- Perl_ck_null, /* goto */
- Perl_ck_fun, /* exit */
- Perl_ck_fun, /* open */
- Perl_ck_fun, /* close */
- Perl_ck_fun, /* pipe_op */
- Perl_ck_fun, /* fileno */
- Perl_ck_fun, /* umask */
- Perl_ck_fun, /* binmode */
- Perl_ck_fun, /* tie */
- Perl_ck_fun, /* untie */
- Perl_ck_fun, /* tied */
- Perl_ck_fun, /* dbmopen */
- Perl_ck_fun, /* dbmclose */
- Perl_ck_select, /* sselect */
- Perl_ck_select, /* select */
- Perl_ck_eof, /* getc */
- Perl_ck_fun, /* read */
- Perl_ck_fun, /* enterwrite */
- Perl_ck_null, /* leavewrite */
- Perl_ck_listiob,/* prtf */
- Perl_ck_listiob,/* print */
- Perl_ck_fun, /* sysopen */
- Perl_ck_fun, /* sysseek */
- Perl_ck_fun, /* sysread */
- Perl_ck_fun, /* syswrite */
- Perl_ck_fun, /* send */
- Perl_ck_fun, /* recv */
- Perl_ck_eof, /* eof */
- Perl_ck_fun, /* tell */
- Perl_ck_fun, /* seek */
- Perl_ck_trunc, /* truncate */
- Perl_ck_fun, /* fcntl */
- Perl_ck_fun, /* ioctl */
- Perl_ck_fun, /* flock */
- Perl_ck_fun, /* socket */
- Perl_ck_fun, /* sockpair */
- Perl_ck_fun, /* bind */
- Perl_ck_fun, /* connect */
- Perl_ck_fun, /* listen */
- Perl_ck_fun, /* accept */
- Perl_ck_fun, /* shutdown */
- Perl_ck_fun, /* gsockopt */
- Perl_ck_fun, /* ssockopt */
- Perl_ck_fun, /* getsockname */
- Perl_ck_fun, /* getpeername */
- Perl_ck_ftst, /* lstat */
- Perl_ck_ftst, /* stat */
- Perl_ck_ftst, /* ftrread */
- Perl_ck_ftst, /* ftrwrite */
- Perl_ck_ftst, /* ftrexec */
- Perl_ck_ftst, /* fteread */
- Perl_ck_ftst, /* ftewrite */
- Perl_ck_ftst, /* fteexec */
- Perl_ck_ftst, /* ftis */
- Perl_ck_ftst, /* fteowned */
- Perl_ck_ftst, /* ftrowned */
- Perl_ck_ftst, /* ftzero */
- Perl_ck_ftst, /* ftsize */
- Perl_ck_ftst, /* ftmtime */
- Perl_ck_ftst, /* ftatime */
- Perl_ck_ftst, /* ftctime */
- Perl_ck_ftst, /* ftsock */
- Perl_ck_ftst, /* ftchr */
- Perl_ck_ftst, /* ftblk */
- Perl_ck_ftst, /* ftfile */
- Perl_ck_ftst, /* ftdir */
- Perl_ck_ftst, /* ftpipe */
- Perl_ck_ftst, /* ftlink */
- Perl_ck_ftst, /* ftsuid */
- Perl_ck_ftst, /* ftsgid */
- Perl_ck_ftst, /* ftsvtx */
- Perl_ck_ftst, /* fttty */
- Perl_ck_ftst, /* fttext */
- Perl_ck_ftst, /* ftbinary */
- Perl_ck_fun, /* chdir */
- Perl_ck_fun, /* chown */
- Perl_ck_fun, /* chroot */
- Perl_ck_fun, /* unlink */
- Perl_ck_fun, /* chmod */
- Perl_ck_fun, /* utime */
- Perl_ck_fun, /* rename */
- Perl_ck_fun, /* link */
- Perl_ck_fun, /* symlink */
- Perl_ck_fun, /* readlink */
- Perl_ck_fun, /* mkdir */
- Perl_ck_fun, /* rmdir */
- Perl_ck_fun, /* open_dir */
- Perl_ck_fun, /* readdir */
- Perl_ck_fun, /* telldir */
- Perl_ck_fun, /* seekdir */
- Perl_ck_fun, /* rewinddir */
- Perl_ck_fun, /* closedir */
- Perl_ck_null, /* fork */
- Perl_ck_null, /* wait */
- Perl_ck_fun, /* waitpid */
- Perl_ck_exec, /* system */
- Perl_ck_exec, /* exec */
- Perl_ck_fun, /* kill */
- Perl_ck_null, /* getppid */
- Perl_ck_fun, /* getpgrp */
- Perl_ck_fun, /* setpgrp */
- Perl_ck_fun, /* getpriority */
- Perl_ck_fun, /* setpriority */
- Perl_ck_null, /* time */
- Perl_ck_null, /* tms */
- Perl_ck_fun, /* localtime */
- Perl_ck_fun, /* gmtime */
- Perl_ck_fun, /* alarm */
- Perl_ck_fun, /* sleep */
- Perl_ck_fun, /* shmget */
- Perl_ck_fun, /* shmctl */
- Perl_ck_fun, /* shmread */
- Perl_ck_fun, /* shmwrite */
- Perl_ck_fun, /* msgget */
- Perl_ck_fun, /* msgctl */
- Perl_ck_fun, /* msgsnd */
- Perl_ck_fun, /* msgrcv */
- Perl_ck_fun, /* semget */
- Perl_ck_fun, /* semctl */
- Perl_ck_fun, /* semop */
- Perl_ck_require,/* require */
- Perl_ck_fun, /* dofile */
- Perl_ck_eval, /* entereval */
- Perl_ck_null, /* leaveeval */
- Perl_ck_null, /* entertry */
- Perl_ck_null, /* leavetry */
- Perl_ck_fun, /* ghbyname */
- Perl_ck_fun, /* ghbyaddr */
- Perl_ck_null, /* ghostent */
- Perl_ck_fun, /* gnbyname */
- Perl_ck_fun, /* gnbyaddr */
- Perl_ck_null, /* gnetent */
- Perl_ck_fun, /* gpbyname */
- Perl_ck_fun, /* gpbynumber */
- Perl_ck_null, /* gprotoent */
- Perl_ck_fun, /* gsbyname */
- Perl_ck_fun, /* gsbyport */
- Perl_ck_null, /* gservent */
- Perl_ck_fun, /* shostent */
- Perl_ck_fun, /* snetent */
- Perl_ck_fun, /* sprotoent */
- Perl_ck_fun, /* sservent */
- Perl_ck_null, /* ehostent */
- Perl_ck_null, /* enetent */
- Perl_ck_null, /* eprotoent */
- Perl_ck_null, /* eservent */
- Perl_ck_fun, /* gpwnam */
- Perl_ck_fun, /* gpwuid */
- Perl_ck_null, /* gpwent */
- Perl_ck_null, /* spwent */
- Perl_ck_null, /* epwent */
- Perl_ck_fun, /* ggrnam */
- Perl_ck_fun, /* ggrgid */
- Perl_ck_null, /* ggrent */
- Perl_ck_null, /* sgrent */
- Perl_ck_null, /* egrent */
- Perl_ck_null, /* getlogin */
- Perl_ck_fun, /* syscall */
- Perl_ck_rfun, /* lock */
- Perl_ck_null, /* threadsv */
- Perl_ck_null, /* setstate */
- Perl_ck_null, /* method_named */
+ MEMBER_TO_FPTR(Perl_ck_null), /* null */
+ MEMBER_TO_FPTR(Perl_ck_null), /* stub */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* scalar */
+ MEMBER_TO_FPTR(Perl_ck_null), /* pushmark */
+ MEMBER_TO_FPTR(Perl_ck_null), /* wantarray */
+ MEMBER_TO_FPTR(Perl_ck_svconst), /* const */
+ MEMBER_TO_FPTR(Perl_ck_null), /* gvsv */
+ MEMBER_TO_FPTR(Perl_ck_null), /* gv */
+ MEMBER_TO_FPTR(Perl_ck_null), /* gelem */
+ MEMBER_TO_FPTR(Perl_ck_null), /* padsv */
+ MEMBER_TO_FPTR(Perl_ck_null), /* padav */
+ MEMBER_TO_FPTR(Perl_ck_null), /* padhv */
+ MEMBER_TO_FPTR(Perl_ck_null), /* padany */
+ MEMBER_TO_FPTR(Perl_ck_null), /* pushre */
+ MEMBER_TO_FPTR(Perl_ck_rvconst), /* rv2gv */
+ MEMBER_TO_FPTR(Perl_ck_rvconst), /* rv2sv */
+ MEMBER_TO_FPTR(Perl_ck_null), /* av2arylen */
+ MEMBER_TO_FPTR(Perl_ck_rvconst), /* rv2cv */
+ MEMBER_TO_FPTR(Perl_ck_anoncode), /* anoncode */
+ MEMBER_TO_FPTR(Perl_ck_null), /* prototype */
+ MEMBER_TO_FPTR(Perl_ck_spair), /* refgen */
+ MEMBER_TO_FPTR(Perl_ck_null), /* srefgen */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* ref */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* bless */
+ MEMBER_TO_FPTR(Perl_ck_null), /* backtick */
+ MEMBER_TO_FPTR(Perl_ck_glob), /* glob */
+ MEMBER_TO_FPTR(Perl_ck_null), /* readline */
+ MEMBER_TO_FPTR(Perl_ck_null), /* rcatline */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* regcmaybe */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* regcreset */
+ MEMBER_TO_FPTR(Perl_ck_null), /* regcomp */
+ MEMBER_TO_FPTR(Perl_ck_match), /* match */
+ MEMBER_TO_FPTR(Perl_ck_match), /* qr */
+ MEMBER_TO_FPTR(Perl_ck_null), /* subst */
+ MEMBER_TO_FPTR(Perl_ck_null), /* substcont */
+ MEMBER_TO_FPTR(Perl_ck_null), /* trans */
+ MEMBER_TO_FPTR(Perl_ck_sassign), /* sassign */
+ MEMBER_TO_FPTR(Perl_ck_null), /* aassign */
+ MEMBER_TO_FPTR(Perl_ck_spair), /* chop */
+ MEMBER_TO_FPTR(Perl_ck_null), /* schop */
+ MEMBER_TO_FPTR(Perl_ck_spair), /* chomp */
+ MEMBER_TO_FPTR(Perl_ck_null), /* schomp */
+ MEMBER_TO_FPTR(Perl_ck_defined), /* defined */
+ MEMBER_TO_FPTR(Perl_ck_lfun), /* undef */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* study */
+ MEMBER_TO_FPTR(Perl_ck_lfun), /* pos */
+ MEMBER_TO_FPTR(Perl_ck_lfun), /* preinc */
+ MEMBER_TO_FPTR(Perl_ck_lfun), /* i_preinc */
+ MEMBER_TO_FPTR(Perl_ck_lfun), /* predec */
+ MEMBER_TO_FPTR(Perl_ck_lfun), /* i_predec */
+ MEMBER_TO_FPTR(Perl_ck_lfun), /* postinc */
+ MEMBER_TO_FPTR(Perl_ck_lfun), /* i_postinc */
+ MEMBER_TO_FPTR(Perl_ck_lfun), /* postdec */
+ MEMBER_TO_FPTR(Perl_ck_lfun), /* i_postdec */
+ MEMBER_TO_FPTR(Perl_ck_null), /* pow */
+ MEMBER_TO_FPTR(Perl_ck_null), /* multiply */
+ MEMBER_TO_FPTR(Perl_ck_null), /* i_multiply */
+ MEMBER_TO_FPTR(Perl_ck_null), /* divide */
+ MEMBER_TO_FPTR(Perl_ck_null), /* i_divide */
+ MEMBER_TO_FPTR(Perl_ck_null), /* modulo */
+ MEMBER_TO_FPTR(Perl_ck_null), /* i_modulo */
+ MEMBER_TO_FPTR(Perl_ck_repeat), /* repeat */
+ MEMBER_TO_FPTR(Perl_ck_null), /* add */
+ MEMBER_TO_FPTR(Perl_ck_null), /* i_add */
+ MEMBER_TO_FPTR(Perl_ck_null), /* subtract */
+ MEMBER_TO_FPTR(Perl_ck_null), /* i_subtract */
+ MEMBER_TO_FPTR(Perl_ck_concat), /* concat */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* stringify */
+ MEMBER_TO_FPTR(Perl_ck_bitop), /* left_shift */
+ MEMBER_TO_FPTR(Perl_ck_bitop), /* right_shift */
+ MEMBER_TO_FPTR(Perl_ck_null), /* lt */
+ MEMBER_TO_FPTR(Perl_ck_null), /* i_lt */
+ MEMBER_TO_FPTR(Perl_ck_null), /* gt */
+ MEMBER_TO_FPTR(Perl_ck_null), /* i_gt */
+ MEMBER_TO_FPTR(Perl_ck_null), /* le */
+ MEMBER_TO_FPTR(Perl_ck_null), /* i_le */
+ MEMBER_TO_FPTR(Perl_ck_null), /* ge */
+ MEMBER_TO_FPTR(Perl_ck_null), /* i_ge */
+ MEMBER_TO_FPTR(Perl_ck_null), /* eq */
+ MEMBER_TO_FPTR(Perl_ck_null), /* i_eq */
+ MEMBER_TO_FPTR(Perl_ck_null), /* ne */
+ MEMBER_TO_FPTR(Perl_ck_null), /* i_ne */
+ MEMBER_TO_FPTR(Perl_ck_null), /* ncmp */
+ MEMBER_TO_FPTR(Perl_ck_null), /* i_ncmp */
+ MEMBER_TO_FPTR(Perl_ck_scmp), /* slt */
+ MEMBER_TO_FPTR(Perl_ck_scmp), /* sgt */
+ MEMBER_TO_FPTR(Perl_ck_scmp), /* sle */
+ MEMBER_TO_FPTR(Perl_ck_scmp), /* sge */
+ MEMBER_TO_FPTR(Perl_ck_null), /* seq */
+ MEMBER_TO_FPTR(Perl_ck_null), /* sne */
+ MEMBER_TO_FPTR(Perl_ck_scmp), /* scmp */
+ MEMBER_TO_FPTR(Perl_ck_bitop), /* bit_and */
+ MEMBER_TO_FPTR(Perl_ck_bitop), /* bit_xor */
+ MEMBER_TO_FPTR(Perl_ck_bitop), /* bit_or */
+ MEMBER_TO_FPTR(Perl_ck_null), /* negate */
+ MEMBER_TO_FPTR(Perl_ck_null), /* i_negate */
+ MEMBER_TO_FPTR(Perl_ck_null), /* not */
+ MEMBER_TO_FPTR(Perl_ck_bitop), /* complement */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* atan2 */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* sin */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* cos */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* rand */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* srand */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* exp */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* log */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* sqrt */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* int */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* hex */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* oct */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* abs */
+ MEMBER_TO_FPTR(Perl_ck_lengthconst), /* length */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* substr */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* vec */
+ MEMBER_TO_FPTR(Perl_ck_index), /* index */
+ MEMBER_TO_FPTR(Perl_ck_index), /* rindex */
+ MEMBER_TO_FPTR(Perl_ck_fun_locale), /* sprintf */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* formline */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* ord */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* chr */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* crypt */
+ MEMBER_TO_FPTR(Perl_ck_fun_locale), /* ucfirst */
+ MEMBER_TO_FPTR(Perl_ck_fun_locale), /* lcfirst */
+ MEMBER_TO_FPTR(Perl_ck_fun_locale), /* uc */
+ MEMBER_TO_FPTR(Perl_ck_fun_locale), /* lc */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* quotemeta */
+ MEMBER_TO_FPTR(Perl_ck_rvconst), /* rv2av */
+ MEMBER_TO_FPTR(Perl_ck_null), /* aelemfast */
+ MEMBER_TO_FPTR(Perl_ck_null), /* aelem */
+ MEMBER_TO_FPTR(Perl_ck_null), /* aslice */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* each */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* values */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* keys */
+ MEMBER_TO_FPTR(Perl_ck_delete), /* delete */
+ MEMBER_TO_FPTR(Perl_ck_exists), /* exists */
+ MEMBER_TO_FPTR(Perl_ck_rvconst), /* rv2hv */
+ MEMBER_TO_FPTR(Perl_ck_null), /* helem */
+ MEMBER_TO_FPTR(Perl_ck_null), /* hslice */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* unpack */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* pack */
+ MEMBER_TO_FPTR(Perl_ck_split), /* split */
+ MEMBER_TO_FPTR(Perl_ck_join), /* join */
+ MEMBER_TO_FPTR(Perl_ck_null), /* list */
+ MEMBER_TO_FPTR(Perl_ck_null), /* lslice */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* anonlist */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* anonhash */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* splice */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* push */
+ MEMBER_TO_FPTR(Perl_ck_shift), /* pop */
+ MEMBER_TO_FPTR(Perl_ck_shift), /* shift */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* unshift */
+ MEMBER_TO_FPTR(Perl_ck_sort), /* sort */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* reverse */
+ MEMBER_TO_FPTR(Perl_ck_grep), /* grepstart */
+ MEMBER_TO_FPTR(Perl_ck_null), /* grepwhile */
+ MEMBER_TO_FPTR(Perl_ck_grep), /* mapstart */
+ MEMBER_TO_FPTR(Perl_ck_null), /* mapwhile */
+ MEMBER_TO_FPTR(Perl_ck_null), /* range */
+ MEMBER_TO_FPTR(Perl_ck_null), /* flip */
+ MEMBER_TO_FPTR(Perl_ck_null), /* flop */
+ MEMBER_TO_FPTR(Perl_ck_null), /* and */
+ MEMBER_TO_FPTR(Perl_ck_null), /* or */
+ MEMBER_TO_FPTR(Perl_ck_null), /* xor */
+ MEMBER_TO_FPTR(Perl_ck_null), /* cond_expr */
+ MEMBER_TO_FPTR(Perl_ck_null), /* andassign */
+ MEMBER_TO_FPTR(Perl_ck_null), /* orassign */
+ MEMBER_TO_FPTR(Perl_ck_method), /* method */
+ MEMBER_TO_FPTR(Perl_ck_subr), /* entersub */
+ MEMBER_TO_FPTR(Perl_ck_null), /* leavesub */
+ MEMBER_TO_FPTR(Perl_ck_null), /* leavesublv */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* caller */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* warn */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* die */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* reset */
+ MEMBER_TO_FPTR(Perl_ck_null), /* lineseq */
+ MEMBER_TO_FPTR(Perl_ck_null), /* nextstate */
+ MEMBER_TO_FPTR(Perl_ck_null), /* dbstate */
+ MEMBER_TO_FPTR(Perl_ck_null), /* unstack */
+ MEMBER_TO_FPTR(Perl_ck_null), /* enter */
+ MEMBER_TO_FPTR(Perl_ck_null), /* leave */
+ MEMBER_TO_FPTR(Perl_ck_null), /* scope */
+ MEMBER_TO_FPTR(Perl_ck_null), /* enteriter */
+ MEMBER_TO_FPTR(Perl_ck_null), /* iter */
+ MEMBER_TO_FPTR(Perl_ck_null), /* enterloop */
+ MEMBER_TO_FPTR(Perl_ck_null), /* leaveloop */
+ MEMBER_TO_FPTR(Perl_ck_null), /* return */
+ MEMBER_TO_FPTR(Perl_ck_null), /* last */
+ MEMBER_TO_FPTR(Perl_ck_null), /* next */
+ MEMBER_TO_FPTR(Perl_ck_null), /* redo */
+ MEMBER_TO_FPTR(Perl_ck_null), /* dump */
+ MEMBER_TO_FPTR(Perl_ck_null), /* goto */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* exit */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* open */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* close */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* pipe_op */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* fileno */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* umask */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* binmode */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* tie */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* untie */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* tied */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* dbmopen */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* dbmclose */
+ MEMBER_TO_FPTR(Perl_ck_select), /* sselect */
+ MEMBER_TO_FPTR(Perl_ck_select), /* select */
+ MEMBER_TO_FPTR(Perl_ck_eof), /* getc */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* read */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* enterwrite */
+ MEMBER_TO_FPTR(Perl_ck_null), /* leavewrite */
+ MEMBER_TO_FPTR(Perl_ck_listiob), /* prtf */
+ MEMBER_TO_FPTR(Perl_ck_listiob), /* print */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* sysopen */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* sysseek */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* sysread */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* syswrite */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* send */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* recv */
+ MEMBER_TO_FPTR(Perl_ck_eof), /* eof */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* tell */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* seek */
+ MEMBER_TO_FPTR(Perl_ck_trunc), /* truncate */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* fcntl */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* ioctl */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* flock */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* socket */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* sockpair */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* bind */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* connect */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* listen */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* accept */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* shutdown */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* gsockopt */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* ssockopt */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* getsockname */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* getpeername */
+ MEMBER_TO_FPTR(Perl_ck_ftst), /* lstat */
+ MEMBER_TO_FPTR(Perl_ck_ftst), /* stat */
+ MEMBER_TO_FPTR(Perl_ck_ftst), /* ftrread */
+ MEMBER_TO_FPTR(Perl_ck_ftst), /* ftrwrite */
+ MEMBER_TO_FPTR(Perl_ck_ftst), /* ftrexec */
+ MEMBER_TO_FPTR(Perl_ck_ftst), /* fteread */
+ MEMBER_TO_FPTR(Perl_ck_ftst), /* ftewrite */
+ MEMBER_TO_FPTR(Perl_ck_ftst), /* fteexec */
+ MEMBER_TO_FPTR(Perl_ck_ftst), /* ftis */
+ MEMBER_TO_FPTR(Perl_ck_ftst), /* fteowned */
+ MEMBER_TO_FPTR(Perl_ck_ftst), /* ftrowned */
+ MEMBER_TO_FPTR(Perl_ck_ftst), /* ftzero */
+ MEMBER_TO_FPTR(Perl_ck_ftst), /* ftsize */
+ MEMBER_TO_FPTR(Perl_ck_ftst), /* ftmtime */
+ MEMBER_TO_FPTR(Perl_ck_ftst), /* ftatime */
+ MEMBER_TO_FPTR(Perl_ck_ftst), /* ftctime */
+ MEMBER_TO_FPTR(Perl_ck_ftst), /* ftsock */
+ MEMBER_TO_FPTR(Perl_ck_ftst), /* ftchr */
+ MEMBER_TO_FPTR(Perl_ck_ftst), /* ftblk */
+ MEMBER_TO_FPTR(Perl_ck_ftst), /* ftfile */
+ MEMBER_TO_FPTR(Perl_ck_ftst), /* ftdir */
+ MEMBER_TO_FPTR(Perl_ck_ftst), /* ftpipe */
+ MEMBER_TO_FPTR(Perl_ck_ftst), /* ftlink */
+ MEMBER_TO_FPTR(Perl_ck_ftst), /* ftsuid */
+ MEMBER_TO_FPTR(Perl_ck_ftst), /* ftsgid */
+ MEMBER_TO_FPTR(Perl_ck_ftst), /* ftsvtx */
+ MEMBER_TO_FPTR(Perl_ck_ftst), /* fttty */
+ MEMBER_TO_FPTR(Perl_ck_ftst), /* fttext */
+ MEMBER_TO_FPTR(Perl_ck_ftst), /* ftbinary */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* chdir */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* chown */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* chroot */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* unlink */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* chmod */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* utime */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* rename */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* link */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* symlink */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* readlink */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* mkdir */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* rmdir */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* open_dir */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* readdir */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* telldir */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* seekdir */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* rewinddir */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* closedir */
+ MEMBER_TO_FPTR(Perl_ck_null), /* fork */
+ MEMBER_TO_FPTR(Perl_ck_null), /* wait */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* waitpid */
+ MEMBER_TO_FPTR(Perl_ck_exec), /* system */
+ MEMBER_TO_FPTR(Perl_ck_exec), /* exec */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* kill */
+ MEMBER_TO_FPTR(Perl_ck_null), /* getppid */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* getpgrp */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* setpgrp */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* getpriority */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* setpriority */
+ MEMBER_TO_FPTR(Perl_ck_null), /* time */
+ MEMBER_TO_FPTR(Perl_ck_null), /* tms */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* localtime */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* gmtime */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* alarm */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* sleep */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* shmget */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* shmctl */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* shmread */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* shmwrite */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* msgget */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* msgctl */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* msgsnd */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* msgrcv */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* semget */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* semctl */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* semop */
+ MEMBER_TO_FPTR(Perl_ck_require), /* require */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* dofile */
+ MEMBER_TO_FPTR(Perl_ck_eval), /* entereval */
+ MEMBER_TO_FPTR(Perl_ck_null), /* leaveeval */
+ MEMBER_TO_FPTR(Perl_ck_null), /* entertry */
+ MEMBER_TO_FPTR(Perl_ck_null), /* leavetry */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* ghbyname */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* ghbyaddr */
+ MEMBER_TO_FPTR(Perl_ck_null), /* ghostent */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* gnbyname */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* gnbyaddr */
+ MEMBER_TO_FPTR(Perl_ck_null), /* gnetent */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* gpbyname */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* gpbynumber */
+ MEMBER_TO_FPTR(Perl_ck_null), /* gprotoent */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* gsbyname */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* gsbyport */
+ MEMBER_TO_FPTR(Perl_ck_null), /* gservent */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* shostent */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* snetent */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* sprotoent */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* sservent */
+ MEMBER_TO_FPTR(Perl_ck_null), /* ehostent */
+ MEMBER_TO_FPTR(Perl_ck_null), /* enetent */
+ MEMBER_TO_FPTR(Perl_ck_null), /* eprotoent */
+ MEMBER_TO_FPTR(Perl_ck_null), /* eservent */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* gpwnam */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* gpwuid */
+ MEMBER_TO_FPTR(Perl_ck_null), /* gpwent */
+ MEMBER_TO_FPTR(Perl_ck_null), /* spwent */
+ MEMBER_TO_FPTR(Perl_ck_null), /* epwent */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* ggrnam */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* ggrgid */
+ MEMBER_TO_FPTR(Perl_ck_null), /* ggrent */
+ MEMBER_TO_FPTR(Perl_ck_null), /* sgrent */
+ MEMBER_TO_FPTR(Perl_ck_null), /* egrent */
+ MEMBER_TO_FPTR(Perl_ck_null), /* getlogin */
+ MEMBER_TO_FPTR(Perl_ck_fun), /* syscall */
+ MEMBER_TO_FPTR(Perl_ck_rfun), /* lock */
+ MEMBER_TO_FPTR(Perl_ck_null), /* threadsv */
+ MEMBER_TO_FPTR(Perl_ck_null), /* setstate */
+ MEMBER_TO_FPTR(Perl_ck_null), /* method_named */
};
#endif
0x00000004, /* pushmark */
0x00000014, /* wantarray */
0x00000c04, /* const */
- 0x00000e44, /* gvsv */
- 0x00000e44, /* gv */
+ 0x00000c44, /* gvsv */
+ 0x00000c44, /* gv */
0x00022440, /* gelem */
0x00000044, /* padsv */
0x00000040, /* padav */
0x00003014, /* trans */
0x00000004, /* sassign */
0x00044408, /* aassign */
- 0x0000570d, /* chop */
- 0x0001378c, /* schop */
+ 0x0000560d, /* chop */
+ 0x0001368c, /* schop */
0x0000570d, /* chomp */
0x0001378c, /* schomp */
0x00013694, /* defined */
0x00002254, /* i_preinc */
0x00002264, /* predec */
0x00002254, /* i_predec */
- 0x0000236c, /* postinc */
+ 0x0000226c, /* postinc */
0x0000235c, /* i_postinc */
- 0x0000236c, /* postdec */
+ 0x0000226c, /* postdec */
0x0000235c, /* i_postdec */
0x0002250e, /* pow */
0x0002252e, /* multiply */
0x00022416, /* seq */
0x00022416, /* sne */
0x0002241e, /* scmp */
- 0x0002250e, /* bit_and */
- 0x0002250e, /* bit_xor */
- 0x0002250e, /* bit_or */
- 0x0000232e, /* negate */
+ 0x0002240e, /* bit_and */
+ 0x0002240e, /* bit_xor */
+ 0x0002240e, /* bit_or */
+ 0x0000222e, /* negate */
0x0000231e, /* i_negate */
0x00002216, /* not */
- 0x0000230e, /* complement */
+ 0x0000220e, /* complement */
0x0002290e, /* atan2 */
0x0001378e, /* sin */
0x0001378e, /* cos */
0x0022281c, /* vec */
0x0122291c, /* index */
0x0122291c, /* rindex */
- 0x0004290f, /* sprintf */
+ 0x0004280f, /* sprintf */
0x00042805, /* formline */
0x0001379e, /* ord */
0x0001378e, /* chr */
0x0001368e, /* lcfirst */
0x0001368e, /* uc */
0x0001368e, /* lc */
- 0x0001378e, /* quotemeta */
+ 0x0001368e, /* quotemeta */
0x00000248, /* rv2av */
- 0x00026e04, /* aelemfast */
+ 0x00026c04, /* aelemfast */
0x00026404, /* aelem */
0x00046801, /* aslice */
0x00009600, /* each */
0x00022800, /* unpack */
0x0004280d, /* pack */
0x00222808, /* split */
- 0x0004290d, /* join */
+ 0x0004280d, /* join */
0x00004801, /* list */
0x00448400, /* lslice */
0x00004805, /* anonlist */
END
for (@ops) {
- print "\tPerl_pp_$_,\n";
+ print "\tMEMBER_TO_FPTR(Perl_pp_$_),\n";
}
print <<END;
END
for (@ops) {
- print "\t", &tab(3, "Perl_$check{$_},"), "/* $_ */\n";
+ print "\t", &tab(3, "MEMBER_TO_FPTR(Perl_$check{$_}),"), "\t/* $_ */\n";
}
print <<END;
'|', 3, # logop
'@', 4, # listop
'/', 5, # pmop
- '$', 6, # svop
- '*', 7, # gvop
+ '$', 6, # svop_or_padop
+ '#', 7, # padop
'"', 8, # pvop_or_svop
'{', 9, # loop
';', 10, # cop
# lt and friends do SETs (including ncmp, but not scmp)
+# Additional mode of failure: the opcode can modify TARG before it "used"
+# all the arguments (or may call an external function which does the same).
+# If the target coincides with one of the arguments ==> kaboom.
+
# pp.c pos substr each not OK (RETPUSHUNDEF)
# substr vec also not OK due to LV to target (are they???)
# ref not OK (RETPUSHNO)
# trans not OK (dTARG; TARG = sv_newmortal();)
# ucfirst etc not OK: TMP arg processed inplace
+# quotemeta not OK (unsafe when TARG == arg)
# each repeat not OK too due to array context
# pack split - unknown whether they are safe
+# sprintf: is calling do_sprintf(TARG,...) which can act on TARG
+# before other args are processed.
+
+# Suspicious wrt "additional mode of failure" (and only it):
+# schop, chop, postinc/dec, bit_and etc, negate, complement.
+
+# Also suspicious: 4-arg substr, sprintf, uc/lc (POK_only), reverse, pack.
+
+# substr/vec: doing TAINT_off()???
# pp_hot.c
# readline - unknown whether it is safe
# match subst not OK (dTARG)
# grepwhile not OK (not always setting)
+# join not OK (unsafe when TARG == arg)
+
+# Suspicious wrt "additional mode of failure": concat (dealt with
+# in ck_sassign()), join (same).
# pp_ctl.c
# mapwhile flip caller not OK (not always setting)
# sselect shm* sem* msg* syscall - unknown whether they are safe
# gmtime not OK (list context)
+# Suspicious wrt "additional mode of failure": warn, die, select.
+
__END__
# New ops always go at the very end
const constant item ck_svconst s$
-gvsv scalar variable ck_null ds*
-gv glob value ck_null ds*
+gvsv scalar variable ck_null ds$
+gv glob value ck_null ds$
gelem glob elem ck_null d2 S S
padsv private variable ck_null ds0
padav private array ck_null d0
# References and stuff.
rv2gv ref-to-glob cast ck_rvconst ds1
-rv2sv scalar deref ck_rvconst ds1
+rv2sv scalar dereference ck_rvconst ds1
av2arylen array length ck_null is1
-rv2cv subroutine deref ck_rvconst d1
+rv2cv subroutine dereference ck_rvconst d1
anoncode anonymous subroutine ck_anoncode $
prototype subroutine prototype ck_null s% S
refgen reference constructor ck_spair m1 L
sassign scalar assignment ck_sassign s0
aassign list assignment ck_null t2 L L
-chop chop ck_spair mTs% L
-schop scalar chop ck_null sTu% S?
+chop chop ck_spair mts% L
+schop scalar chop ck_null stu% S?
chomp chomp ck_spair mTs% L
schomp scalar chomp ck_null sTu% S?
defined defined operator ck_defined isu% S?
i_preinc integer preincrement (++) ck_lfun dis1 S
predec predecrement (--) ck_lfun dIs1 S
i_predec integer predecrement (--) ck_lfun dis1 S
-postinc postincrement (++) ck_lfun dIsT1 S
+postinc postincrement (++) ck_lfun dIst1 S
i_postinc integer postincrement (++) ck_lfun disT1 S
-postdec postdecrement (--) ck_lfun dIsT1 S
+postdec postdecrement (--) ck_lfun dIst1 S
i_postdec integer postdecrement (--) ck_lfun disT1 S
# Ordinary operators.
sne string ne ck_null ifs2 S S
scmp string comparison (cmp) ck_scmp ifst2 S S
-bit_and bitwise and (&) ck_bitop fsT2 S S
-bit_xor bitwise xor (^) ck_bitop fsT2 S S
-bit_or bitwise or (|) ck_bitop fsT2 S S
+bit_and bitwise and (&) ck_bitop fst2 S S
+bit_xor bitwise xor (^) ck_bitop fst2 S S
+bit_or bitwise or (|) ck_bitop fst2 S S
-negate negation (-) ck_null IfsT1 S
+negate negation (-) ck_null Ifst1 S
i_negate integer negation (-) ck_null ifsT1 S
not not ck_null ifs1 S
-complement 1's complement (~) ck_bitop fsT1 S
+complement 1's complement (~) ck_bitop fst1 S
# High falutin' math.
index index ck_index isT@ S S S?
rindex rindex ck_index isT@ S S S?
-sprintf sprintf ck_fun_locale mfsT@ S L
+sprintf sprintf ck_fun_locale mfst@ S L
formline formline ck_fun ms@ S L
ord ord ck_fun ifsTu% S?
chr chr ck_fun fsTu% S?
lcfirst lcfirst ck_fun_locale fstu% S?
uc uc ck_fun_locale fstu% S?
lc lc ck_fun_locale fstu% S?
-quotemeta quotemeta ck_fun fsTu% S?
+quotemeta quotemeta ck_fun fstu% S?
# Arrays.
rv2av array dereference ck_rvconst dt1
-aelemfast constant array element ck_null s* A S
+aelemfast constant array element ck_null s$ A S
aelem array element ck_null s2 A S
aslice array slice ck_null m@ A L
unpack unpack ck_fun @ S S
pack pack ck_fun mst@ S L
split split ck_split t@ S S S
-join join ck_join msT@ S L
+join join ck_join mst@ S L
# List operators.
# Time calls.
+# NOTE: MacOS patches the 'i' of time() away later when the interpreter
+# is created because in MacOS time() is already returning times > 2**31-1,
+# that is, non-integers.
+
time time ck_null isT0
tms times ck_null 0
localtime localtime ck_fun t% S?
If the only shell-metachars of a command are ' 2>&1' at the
end of a command, it is executed without calling the external shell.
+
+after 5.005_57:
+ Make UDP sockets return correct caller address (OS2 API bug);
+ Enable TCPIPV4 defines (works with Warp 3 IAK too?!);
+ Force Unix-domain sockets to start with "/socket", convert
+ '/' to '\' in the calls;
+ Make C<system 1, $cmd> to treat $cmd as in C<system $cmd>;
+ Autopatch Configure;
+ Find name and location of g[nu]patch.exe;
+ Autocopy perl????.dll to t/ when testing;
+
+after 5.005_62:
+ Extract a lightweight DLL access module OS2::DLL from OS2::REXX
+ which would not load REXX runtime system;
+ Allow compile with os2.h which loads os2tk.h instead of os2emx.h;
+ Put the version of EMX CRTL into -D define;
+ Use _setsyserror() to store last error of OS/2 API for $^E;
+ New macro PERL_SYS_INIT3(argvp, argcp, envp);
+ Make Dynaloader return info on the failing module after failed dl_open();
+ OS2::REXX test were done for interactive testing (were writing
+ "ok" to stderr);
+ system() and friends return -1 on failure (was 0xFF00);
+ Put the full name of executable into $^X
+ (alas, uppercased - but with /);
+ t/io/fs.t was failing on HPFS386;
+ Remove extra ';' from defines for MQ operations.
OPTIMIZE = $optimize
AOUT_OPTIMIZE = \$(OPTIMIZE)
-AOUT_CCCMD = \$(CC) $aout_ccflags \$(AOUT_OPTIMIZE)
+AOUT_CCCMD = \$(CC) -DPERL_CORE $aout_ccflags \$(AOUT_OPTIMIZE)
AOUT_AR = $aout_ar
AOUT_OBJ_EXT = $aout_obj_ext
AOUT_LIB_EXT = $aout_lib_ext
# We link miniperl statically, since .DLL depends on $(DYNALOADER)
-miniperl.map miniperl: $(obj) perl$(OBJ_EXT) miniperlmain$(OBJ_EXT)
- $(CC) $(LARGE) $(CLDFLAGS) -o miniperl miniperlmain$(OBJ_EXT) perl$(OBJ_EXT) $(obj) $(libs) -Zmap -Zlinker /map
- @./miniperl -w -Ilib -MExporter -e 0 || $(MAKE) minitest
+opmini$(OBJ_EXT) : op.c
+ $(CCCMD) $(PLDLFLAGS) -DPERL_EXTERNAL_GLOB -o opmini$(OBJ_EXT) op.c
+
+miniperl.map miniperl: $(obj) perl$(OBJ_EXT) miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT)
+ $(CC) $(LARGE) $(CLDFLAGS) -o miniperl miniperlmain$(OBJ_EXT) perl$(OBJ_EXT) `echo $(obj)|sed -e 's/\bop\./opmini./g'` $(libs) -Zmap -Zlinker /map/PM:VIO
+ @./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
depend: os2ish.h dlfcn.h os2thread.h os2.c
.c$(AOUT_OBJ_EXT):
$(AOUT_CCCMD) $(PLDLFLAGS) -c $*.c
+opmini$(AOUT_OBJ_EXT): op.c
+ $(AOUT_CCCMD) $(PLDLFLAGS) -DPERL_EXTERNAL_GLOB -o opmini$(AOUT_OBJ_EXT) -c op.c
+
perlmain(AOUT_OBJ_EXT): perlmain.c
$(AOUT_CCCMD_DLL) $(PLDLFLAGS) -c perlmain.c
sh writemain $(DYNALOADER) $(aout_static_lib) > tmp
sh mv-if-diff tmp aout_perlmain.c
-miniperl_: $& miniperlmain$(AOUT_OBJ_EXT) $(AOUT_LIBPERL)
- $(CC) $(LARGE) $(AOUT_CLDFLAGS) $(CCDLFLAGS) -o miniperl_ miniperlmain$(AOUT_OBJ_EXT) $(AOUT_LIBPERL) $(libs)
+miniperl_: $& miniperlmain$(AOUT_OBJ_EXT) $(AOUT_LIBPERL) opmini$(AOUT_OBJ_EXT)
+ $(CC) $(LARGE) $(AOUT_CLDFLAGS) $(CCDLFLAGS) -o miniperl_ miniperlmain$(AOUT_OBJ_EXT) opmini$(AOUT_OBJ_EXT) $(AOUT_LIBPERL) $(libs)
perl_: $& aout_perlmain$(AOUT_OBJ_EXT) $(AOUT_LIBPERL) $(AOUT_DYNALOADER) $(aout_static_ext) ext.libs
$(CC) $(LARGE) $(AOUT_CLDFLAGS) $(CCDLFLAGS) -o perl_ aout_perlmain$(AOUT_OBJ_EXT) $(AOUT_DYNALOADER) $(aout_static_ext) $(AOUT_LIBPERL) `cat ext.libs` $(libs)
After fixpak17 a lot of other places have mismatched lengths
returned in the REXXPool interface.
Also drop does not work on stems any more.
+0.22:
+ A subsystem module OS2::DLL extracted which does not link
+ with REXX runtime library.
--- /dev/null
+0.01:
+ Split out of OS2::REXX
--- /dev/null
+package OS2::DLL;
+
+use Carp;
+use DynaLoader;
+
+@ISA = qw(DynaLoader);
+
+sub AUTOLOAD {
+ $AUTOLOAD =~ /^OS2::DLL::.+::(.+)$/
+ or confess("Undefined subroutine &$AUTOLOAD called");
+ return undef if $1 eq "DESTROY";
+ $_[0]->find($1)
+ or confess("Can't find entry '$1' to DLL '$_[0]->{File}': $^E");
+ goto &$AUTOLOAD;
+}
+
+@libs = split(/;/, $ENV{'PERL5REXX'} || $ENV{'PERLREXX'} || $ENV{'LIBPATH'} || $ENV{'PATH'});
+%dlls = ();
+
+# Preloaded methods go here. Autoload methods go after __END__, and are
+# processed by the autosplit program.
+
+# Cannot autoload, the autoloader is used for the REXX functions.
+
+sub load
+{
+ confess 'Usage: load OS2::DLL <file> [<dirs>]' unless $#_ >= 1;
+ my ($class, $file, @where) = (@_, @libs);
+ return $dlls{$file} if $dlls{$file};
+ my $handle;
+ foreach (@where) {
+ $handle = DynaLoader::dl_load_file("$_/$file.dll");
+ last if $handle;
+ }
+ $handle = DynaLoader::dl_load_file($file) unless $handle;
+ return undef unless $handle;
+ my $packs = $INC{'OS2/REXX.pm'} ? 'OS2::DLL OS2::REXX' : 'OS2::DLL';
+ eval <<EOE or die "eval package $@";
+package OS2::DLL::$file; \@ISA = qw($packs);
+sub AUTOLOAD {
+ \$OS2::DLL::AUTOLOAD = \$AUTOLOAD;
+ goto &OS2::DLL::AUTOLOAD;
+}
+1;
+EOE
+ return $dlls{$file} =
+ bless {Handle => $handle, File => $file, Queue => 'SESSION' },
+ "OS2::DLL::$file";
+}
+
+sub find
+{
+ my $self = shift;
+ my $file = $self->{File};
+ my $handle = $self->{Handle};
+ my $prefix = exists($self->{Prefix}) ? $self->{Prefix} : "";
+ my $queue = $self->{Queue};
+ foreach (@_) {
+ my $name = "OS2::DLL::${file}::$_";
+ next if defined(&$name);
+ my $addr = DynaLoader::dl_find_symbol($handle, uc $prefix.$_)
+ || DynaLoader::dl_find_symbol($handle, $prefix.$_)
+ or return 0;
+ eval <<EOE or die "eval sub";
+package OS2::DLL::$file;
+sub $_ {
+ shift;
+ OS2::DLL::_call('$_', $addr, '$queue', \@_);
+}
+1;
+EOE
+ }
+ return 1;
+}
+
+bootstrap OS2::DLL;
+
+1;
+__END__
+
+=head1 NAME
+
+OS2::DLL - access to DLLs with REXX calling convention.
+
+=head2 NOTE
+
+When you use this module, the REXX variable pool is not available.
+
+See documentation of L<OS2::REXX> module if you need the variable pool.
+
+=head1 SYNOPSIS
+
+ use OS2::DLL;
+ $emx_dll = OS2::DLL->load('emx');
+ $emx_version = $emx_dll->emx_revision();
+
+=head1 DESCRIPTION
+
+=head2 Load REXX DLL
+
+ $dll = load OS2::DLL NAME [, WHERE];
+
+NAME is DLL name, without path and extension.
+
+Directories are searched WHERE first (list of dirs), then environment
+paths PERL5REXX, PERLREXX, PATH or, as last resort, OS/2-ish search
+is performed in default DLL path (without adding paths and extensions).
+
+The DLL is not unloaded when the variable dies.
+
+Returns DLL object reference, or undef on failure.
+
+=head2 Check for functions (optional):
+
+ BOOL = $dll->find(NAME [, NAME [, ...]]);
+
+Returns true if all functions are available.
+
+=head2 Call external REXX function:
+
+ $dll->function(arguments);
+
+Returns the return string if the return code is 0, else undef.
+Dies with error message if the function is not available.
+
+=head1 ENVIRONMENT
+
+If C<PERL_REXX_DEBUG> is set, emits debugging output. Looks for DLLs
+in C<PERL5REXX>, C<PERLREXX>, C<PATH>.
+
+=head1 AUTHOR
+
+Extracted by Ilya Zakharevich ilya@math.ohio-state.edu from L<OS2::REXX>
+written by Andreas Kaiser ak@ananke.s.bawue.de.
+
+=cut
--- /dev/null
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+#define INCL_BASE
+#define INCL_REXXSAA
+#include <os2emx.h>
+
+static RXSTRING * strs;
+static int nstrs;
+static char * trace;
+
+static void
+needstrs(int n)
+{
+ if (n > nstrs) {
+ if (strs)
+ free(strs);
+ nstrs = 2 * n;
+ strs = malloc(nstrs * sizeof(RXSTRING));
+ }
+}
+
+MODULE = OS2::DLL PACKAGE = OS2::DLL
+
+BOOT:
+ needstrs(8);
+ trace = getenv("PERL_REXX_DEBUG");
+
+SV *
+_call(name, address, queue="SESSION", ...)
+ char * name
+ void * address
+ char * queue
+ CODE:
+ {
+ ULONG rc;
+ int argc, i;
+ RXSTRING result;
+ UCHAR resbuf[256];
+ RexxFunctionHandler *fcn = address;
+ argc = items-3;
+ needstrs(argc);
+ if (trace)
+ fprintf(stderr, "REXXCALL::_call name: '%s' args:", name);
+ for (i = 0; i < argc; ++i) {
+ STRLEN len;
+ char *ptr = SvPV(ST(3+i), len);
+ MAKERXSTRING(strs[i], ptr, len);
+ if (trace)
+ fprintf(stderr, " '%.*s'", len, ptr);
+ }
+ if (!*queue)
+ queue = "SESSION";
+ if (trace)
+ fprintf(stderr, "\n");
+ MAKERXSTRING(result, resbuf, sizeof resbuf);
+ rc = fcn(name, argc, strs, queue, &result);
+ if (trace)
+ fprintf(stderr, " rc=%X, result='%.*s'\n", rc,
+ result.strlength, result.strptr);
+ ST(0) = sv_newmortal();
+ if (rc == 0) {
+ if (result.strptr)
+ sv_setpvn(ST(0), result.strptr, result.strlength);
+ else
+ sv_setpvn(ST(0), "", 0);
+ }
+ if (result.strptr && result.strptr != resbuf)
+ DosFreeMem(result.strptr);
+ }
+
--- /dev/null
+Changes
+MANIFEST
+Makefile.PL
+DLL.pm
+DLL.xs
--- /dev/null
+use ExtUtils::MakeMaker;
+
+WriteMakefile(
+ NAME => 'OS2::DLL',
+ VERSION => '0.01',
+ MAN3PODS => ' ', # Pods will be built by installman.
+ XSPROTOARG => '-noprototypes',
+ PERL_MALLOC_OK => 1,
+);
WriteMakefile(
NAME => 'OS2::REXX',
- VERSION => '0.21',
+ VERSION => '0.22',
MAN3PODS => ' ', # Pods will be built by installman.
XSPROTOARG => '-noprototypes',
PERL_MALLOC_OK => 1,
use Carp;
require Exporter;
require DynaLoader;
+require OS2::DLL;
+
@ISA = qw(Exporter DynaLoader);
# Items to export into callers namespace by default
# (move infrequently used names to @EXPORT_OK below)
# Other items we are prepared to export if requested
@EXPORT_OK = qw(drop);
-sub AUTOLOAD {
- $AUTOLOAD =~ /^OS2::REXX::.+::(.+)$/
- or confess("Undefined subroutine &$AUTOLOAD called");
- return undef if $1 eq "DESTROY";
- $_[0]->find($1)
- or confess("Can't find entry '$1' to DLL '$_[0]->{File}'");
- goto &$AUTOLOAD;
-}
+# We cannot just put OS2::DLL in @ISA, since some scripts would use
+# function interface, not method interface...
-@libs = split(/;/, $ENV{'PERL5REXX'} || $ENV{'PERLREXX'} || $ENV{'LIBPATH'} || $ENV{'PATH'});
-%dlls = ();
+*_call = \&OS2::DLL::_call;
+*load = \&OS2::DLL::load;
+*find = \&OS2::DLL::find;
bootstrap OS2::REXX;
# Preloaded methods go here. Autoload methods go after __END__, and are
# processed by the autosplit program.
-# Cannot autoload, the autoloader is used for the REXX functions.
-
-sub load
-{
- confess 'Usage: load OS2::REXX <file> [<dirs>]' unless $#_ >= 1;
- my ($class, $file, @where) = (@_, @libs);
- return $dlls{$file} if $dlls{$file};
- my $handle;
- foreach (@where) {
- $handle = DynaLoader::dl_load_file("$_/$file.dll");
- last if $handle;
- }
- $handle = DynaLoader::dl_load_file($file) unless $handle;
- return undef unless $handle;
- eval "package OS2::REXX::$file; \@ISA = ('OS2::REXX');"
- . "sub AUTOLOAD {"
- . " \$OS2::REXX::AUTOLOAD = \$AUTOLOAD;"
- . " goto &OS2::REXX::AUTOLOAD;"
- . "} 1;" or die "eval package $@";
- return $dlls{$file} = bless {Handle => $handle, File => $file, Queue => 'SESSION' }, "OS2::REXX::$file";
-}
-
-sub find
-{
- my $self = shift;
- my $file = $self->{File};
- my $handle = $self->{Handle};
- my $prefix = exists($self->{Prefix}) ? $self->{Prefix} : "";
- my $queue = $self->{Queue};
- foreach (@_) {
- my $name = "OS2::REXX::${file}::$_";
- next if defined(&$name);
- my $addr = DynaLoader::dl_find_symbol($handle, uc $prefix.$_)
- || DynaLoader::dl_find_symbol($handle, $prefix.$_)
- or return 0;
- eval "package OS2::REXX::$file; sub $_".
- "{ shift; OS2::REXX::_call('$_', $addr, '$queue', \@_); }".
- "1;"
- or die "eval sub";
- }
- return 1;
-}
-
sub prefix
{
my $self = shift;
See C<t/rx*.t> for examples.
+=head1 ENVIRONMENT
+
+If C<PERL_REXX_DEBUG> is set, prints trace info on calls to REXX runtime
+environment.
+
=head1 AUTHOR
Andreas Kaiser ak@ananke.s.bawue.de, with additions by Ilya Zakharevich
ilya@math.ohio-state.edu.
+=head1 SEE ALSO
+
+L<OS2::DLL>.
+
=cut
char * name
int arg
-SV *
-_call(name, address, queue="SESSION", ...)
- char * name
- void * address
- char * queue
- CODE:
- {
- ULONG rc;
- int argc, i;
- RXSTRING result;
- UCHAR resbuf[256];
- RexxFunctionHandler *fcn = address;
- argc = items-3;
- needstrs(argc);
- if (trace)
- fprintf(stderr, "REXXCALL::_call name: '%s' args:", name);
- for (i = 0; i < argc; ++i) {
- STRLEN len;
- char *ptr = SvPV(ST(3+i), len);
- MAKERXSTRING(strs[i], ptr, len);
- if (trace)
- fprintf(stderr, " '%.*s'", len, ptr);
- }
- if (!*queue)
- queue = "SESSION";
- if (trace)
- fprintf(stderr, "\n");
- MAKERXSTRING(result, resbuf, sizeof resbuf);
- rc = fcn(name, argc, strs, queue, &result);
- if (trace)
- fprintf(stderr, " rc=%X, result='%.*s'\n", rc,
- result.strlength, result.strptr);
- ST(0) = sv_newmortal();
- if (rc == 0) {
- if (result.strptr)
- sv_setpvn(ST(0), result.strptr, result.strlength);
- else
- sv_setpvn(ST(0), "", 0);
- }
- if (result.strptr && result.strptr != resbuf)
- DosFreeMem(result.strptr);
- }
-
int
_set(name,value,...)
char * name
$found = "$dir/YDBAUTIL.DLL";
last;
}
-$found or die "1..0\n#Cannot find YDBAUTIL.DLL\n";
+$found or print "1..0 # skipped: cannot find YDBAUTIL.DLL\n" and exit;
print "1..5\n";
--- /dev/null
+BEGIN {
+ chdir 't' if -d 't/lib';
+ @INC = '../lib' if -d 'lib';
+ require Config; import Config;
+ if (-d 'lib' and $Config{'extensions'} !~ /\bOS2(::|\/)REXX\b/) {
+ print "1..0\n";
+ exit 0;
+ }
+}
+
+print "1..5\n";
+
+require OS2::DLL;
+print "ok 1\n";
+$emx_dll = OS2::DLL->load('emx');
+print "ok 2\n";
+$emx_version = $emx_dll->emx_revision();
+print "ok 3\n";
+$emx_version >= 40 or print "not "; # We cannot work with old EMXs
+print "ok 4\n";
+
+$reason = '';
+$emx_version >= 99 and $reason = ' # skipped: version of EMX 100 or more'; # Be safe
+print "ok 5$reason\n";
#
# DLL
#
-$ydba = load OS2::REXX "ydbautil" or die "1..0\n# load\n";
+$ydba = load OS2::REXX "ydbautil"
+ or print "1..0 # skipped: cannot find YDBAUTIL.DLL\n" and exit;
print "1..5\n", "ok 1\n";
#
#
# DLL
#
-load OS2::REXX "ydbautil" or die "1..0\n# load\n";
+load OS2::REXX "ydbautil"
+ or print "1..0 # skipped: cannot find YDBAUTIL.DLL\n" and exit;
print "1..19\n";
}
use OS2::REXX;
-$rx = load OS2::REXX "ydbautil" or die "1..0\n# load\n"; # from RXU17.ZIP
+$rx = load OS2::REXX "ydbautil" # from RXU17.ZIP
+ or print "1..0 # skipped: cannot find YDBAUTIL.DLL\n" and exit;
+
print "1..7\n", "ok 1\n";
$rx->prefix("Rx"); # implicit function prefix
print "# found at `$found'\n";
last;
}
-$found or die "1..0\n#Cannot find $name.DLL\n";
+$found or print "1..0 # skipped: cannot find $name.DLL\n" and exit;
print "1..10\n";
+++ /dev/null
-diff -cr ..\perl5os2.patch\perl5.001m.andy/ext/POSIX/POSIX.xs ./ext/POSIX/POSIX.xs
-*** ../perl5os2.patch/perl5.001m.andy/ext/POSIX/POSIX.xs Tue May 23 11:54:26 1995
---- ./ext/POSIX/POSIX.xs Thu Sep 28 00:00:16 1995
-***************
-*** 81,86 ****
---- 81,90 ----
- /* Possibly needed prototypes */
- char *cuserid (char *);
-
-+ #ifndef HAS_MKFIFO
-+ #define mkfifo(a,b) not_here("mkfifo")
-+ #endif
-+
- #ifndef HAS_CUSERID
- #define cuserid(a) (char *) not_here("cuserid")
- #endif
#include <os2.h>
static ULONG retcode;
+static char fail[300];
void *
dlopen(char *path, int mode)
{
HMODULE handle;
char tmp[260], *beg, *dot;
- char fail[300];
ULONG rc;
+ fail[0] = 0;
if ((rc = DosLoadModule(fail, sizeof fail, path, &handle)) == 0)
return (void *)handle;
ULONG rc, type;
PFN addr;
+ fail[0] = 0;
rc = DosQueryProcAddr((HMODULE)handle, 0, symbol, &addr);
if (rc == 0) {
rc = DosQueryProcType((HMODULE)handle, 0, symbol, &type);
char *
dlerror(void)
{
- static char buf[300];
+ static char buf[700];
ULONG len;
if (retcode == 0)
return NULL;
- if (DosGetMessage(NULL, 0, buf, sizeof buf - 1, retcode, "OSO001.MSG", &len))
- sprintf(buf, "OS/2 system error code %d", retcode);
- else
+ if (DosGetMessage(NULL, 0, buf, sizeof buf - 1, retcode,
+ "OSO001.MSG", &len)) {
+ if (fail[0])
+ sprintf(buf,
+"OS/2 system error code %d, possible problematic module: '%s'",
+ retcode, fail);
+ else
+ sprintf(buf, "OS/2 system error code %d", retcode);
+ } else {
buf[len] = '\0';
+ if (len && buf[len - 1] == '\n')
+ buf[--len] = 0;
+ if (len && buf[len - 1] == '\r')
+ buf[--len] = 0;
+ if (len && buf[len - 1] == '.')
+ buf[--len] = 0;
+ if (fail[0] && len < 300)
+ sprintf(buf + len, ", possible problematic module: '%s'",
+ fail);
+ }
retcode = 0;
return buf;
}
#define INCL_DOSFILEMGR
#define INCL_DOSMEMMGR
#define INCL_DOSERRORS
+/* These 3 are needed for compile if os2.h includes os2tk.h, not os2emx.h */
+#define INCL_DOSPROCESS
+#define SPU_DISABLESUPPRESSION 0
+#define SPU_ENABLESUPPRESSION 1
#include <os2.h>
#include <sys/uflags.h>
PL_Argv[0], Strerror(errno));
if (rc < 0 && (execf != EXECF_SPAWN_NOWAIT)
&& ((trueflag & 0xFF) == P_WAIT))
- rc = 255 << 8; /* Emulate the fork(). */
+ rc = -1;
finish:
if (new_stderr != -1) { /* How can we use error codes? */
Perl_warner(aTHX_ WARN_EXEC, "Can't %s \"%s\": %s",
(execf == EXECF_SPAWN ? "spawn" : "exec"),
shell, Strerror(errno));
- if (rc < 0) rc = 255 << 8; /* Emulate the fork(). */
+ if (rc < 0)
+ rc = -1;
}
if (news)
Safefree(news);
return NULL;
if (DosGetMessage(NULL, 0, buf, sizeof buf - 1, rc, "OSO001.MSG", &len))
sprintf(buf, "OS/2 system error code %d=0x%x", rc, rc);
- else
+ else {
buf[len] = '\0';
- if (len > 0 && buf[len - 1] == '\n')
- buf[len - 1] = '\0';
- if (len > 1 && buf[len - 2] == '\r')
- buf[len - 2] = '\0';
- if (len > 2 && buf[len - 3] == '.')
- buf[len - 3] = '\0';
+ if (len && buf[len - 1] == '\n')
+ buf[--len] = 0;
+ if (len && buf[len - 1] == '\r')
+ buf[--len] = 0;
+ if (len && buf[len - 1] == '.')
+ buf[--len] = 0;
+ }
return buf;
}
char *
+os2_execname(void)
+{
+ char buf[300], *p;
+
+ if (_execname(buf, sizeof buf) != 0)
+ return PL_origargv[0];
+ p = buf;
+ while (*p) {
+ if (*p == '\\')
+ *p = '/';
+ p++;
+ }
+ p = savepv(buf);
+ SAVEFREEPV(p);
+ return p;
+}
+
+char *
perllib_mangle(char *s, unsigned int l)
{
static char *newp, *oldp;
settmppath();
OS2_Perl_data.xs_init = &Xs_OS2_init;
_uflags (_UF_SBRK_MODEL, _UF_SBRK_ARBITRARY);
- if (environ == NULL) {
+ if (environ == NULL && env) {
environ = env;
}
if ( (shell = getenv("PERL_SH_DRIVE")) ) {
#ifndef SIGILL
# define SIGILL 6 /* blech */
#endif
-#define ABORT() kill(getpid(),SIGABRT);
+#define ABORT() kill(PerlProc_getpid(),SIGABRT);
#define BIT_BUCKET "/dev/nul" /* Will this work? */
/* XXX This code hideously puts env inside: */
-#ifdef __EMX__
+#ifdef PERL_CORE
+# define PERL_SYS_INIT3(argcp, argvp, envp) STMT_START { \
+ _response(argcp, argvp); \
+ _wildcard(argcp, argvp); \
+ Perl_OS2_init(*envp); } STMT_END
# define PERL_SYS_INIT(argcp, argvp) STMT_START { \
_response(argcp, argvp); \
_wildcard(argcp, argvp); \
- Perl_OS2_init(env); } STMT_END
-#else /* Compiling embedded Perl with non-EMX compiler */
+ Perl_OS2_init(NULL); } STMT_END
+#else /* Compiling embedded Perl or Perl extension */
+# define PERL_SYS_INIT3(argcp, argvp, envp) STMT_START { \
+ Perl_OS2_init(*envp); } STMT_END
# define PERL_SYS_INIT(argcp, argvp) STMT_START { \
- Perl_OS2_init(env); } STMT_END
+ Perl_OS2_init(NULL); } STMT_END
+#endif
+
+#ifndef __EMX__
# define PERL_CALLCONV _System
#endif
+
#define PERL_SYS_TERM() MALLOC_TERM
/* #define PERL_SYS_TERM() STMT_START { \
# define PerlIO FILE
#endif
-#define TMPPATH tmppath
#define TMPPATH1 "plXXXXXX"
extern char *tmppath;
PerlIO *my_syspopen(char *cmd, char *mode);
#define Perl_rc (OS2_Perl_data.rc)
#define Perl_severity (OS2_Perl_data.severity)
#define errno_isOS2 12345678
+#define errno_isOS2_set 12345679
#define OS2_Perl_flags (OS2_Perl_data.flags)
#define Perl_HAB_set_f 1
#define Perl_HAB_set (OS2_Perl_flags & Perl_HAB_set_f)
int Perl_Serve_Messages(int force);
/* Cannot prototype with I32 at this point. */
int Perl_Process_Messages(int force, long *cntp);
+char *os2_execname(void);
struct _QMSG;
struct PMWIN_entries_t {
extern struct PMWIN_entries_t PMWIN_entries;
void init_PMWIN_entries(void);
-#define perl_hmq_GET(serve) Perl_Register_MQ(serve);
-#define perl_hmq_UNSET(serve) Perl_Deregister_MQ(serve);
+#define perl_hmq_GET(serve) Perl_Register_MQ(serve)
+#define perl_hmq_UNSET(serve) Perl_Deregister_MQ(serve)
#define OS2_XS_init() (*OS2_Perl_data.xs_init)()
+
+#if _EMX_CRT_REV_ >= 60
+# define os2_setsyserrno(rc) (Perl_rc = rc, errno = errno_isOS2_set, \
+ _setsyserrno(rc))
+#else
+# define os2_setsyserrno(rc) (Perl_rc = rc, errno = errno_isOS2)
+#endif
+
/* The expressions below return true on error. */
/* INCL_DOSERRORS needed. rc should be declared outside. */
#define CheckOSError(expr) (!(rc = (expr)) ? 0 : (FillOSError(rc), 1))
/* INCL_WINERRORS needed. */
#define SaveWinError(expr) ((expr) ? : (FillWinError, 0))
#define CheckWinError(expr) ((expr) ? 0: (FillWinError, 1))
-#define FillOSError(rc) (Perl_rc = rc, \
- errno = errno_isOS2, \
+#define FillOSError(rc) (os2_setsyserrno(rc), \
Perl_severity = SEVERITY_ERROR)
-#define FillWinError (Perl_rc = WinGetLastError(Perl_hab), \
- errno = errno_isOS2, \
- Perl_severity = ERRORIDSEV(Perl_rc), \
- Perl_rc = ERRORIDERROR(Perl_rc))
+#define FillWinError (Perl_severity = ERRORIDSEV(Perl_rc), \
+ Perl_rc = ERRORIDERROR(Perl_rc)), \
+ os2_setsyserrno(Perl_rc)
#define STATIC_FILE_LENGTH 127
#define QSS_FILE 8 /* Buggy until fixpack18 */
#define QSS_SHARED 16
-#ifdef _OS2EMX_H
+#ifdef _OS2_H
APIRET APIENTRY Dos32QuerySysState(ULONG func,ULONG arg1,ULONG pid,
ULONG _res_,PVOID buf,ULONG bufsz);
PQTOPLEVEL get_sysinfo(ULONG pid, ULONG flags);
-#endif /* _OS2EMX_H */
+#endif /* _OS2_H */
#define PERL_REVISION 5 /* age */
#define PERL_VERSION 5 /* epoch */
-#define PERL_SUBVERSION 61 /* generation */
+#define PERL_SUBVERSION 640 /* generation */
+
+/* The following numbers describe the earliest compatible version of
+ Perl ("compatibility" here being defined as sufficient binary/API
+ compatibility to run XS code built with the older version).
+ Normally this should not change across maintenance releases.
+
+ This is used by Configure et al to figure out
+ PERL_INC_VERSION_LIST, which lists version libraries
+ to include in @INC. See INSTALL for how this works.
+*/
+#define PERL_API_REVISION 5 /* Adjust manually as needed. */
+#define PERL_API_VERSION 5 /* Adjust manually as needed. */
+#define PERL_API_SUBVERSION 640 /* Adjust manually as needed. */
+/*
+ XXX Note: The selection of non-default Configure options, such
+ as -Duselonglong may invalidate these settings. Currently, Configure
+ does not adequately test for this. A.D. Jan 13, 2000
+*/
#define __PATCHLEVEL_H_INCLUDED__
#endif
#endif
#ifdef PERL_OBJECT
-CPerlObj* perl_alloc(IPerlMem* ipM, IPerlEnv* ipE, IPerlStdIO* ipStd,
- IPerlLIO* ipLIO, IPerlDir* ipD, IPerlSock* ipS, IPerlProc* ipP)
+#define perl_construct Perl_construct
+#define perl_parse Perl_parse
+#define perl_run Perl_run
+#define perl_destruct Perl_destruct
+#define perl_free Perl_free
+#endif
+
+#ifdef PERL_IMPLICIT_SYS
+PerlInterpreter *
+perl_alloc_using(struct IPerlMem* ipM, struct IPerlMem* ipMS,
+ struct IPerlMem* ipMP, struct IPerlEnv* ipE,
+ struct IPerlStdIO* ipStd, struct IPerlLIO* ipLIO,
+ struct IPerlDir* ipD, struct IPerlSock* ipS,
+ struct IPerlProc* ipP)
{
- CPerlObj* pPerl = new(ipM) CPerlObj(ipM, ipE, ipStd, ipLIO, ipD, ipS, ipP);
- if(pPerl != NULL)
- pPerl->Init();
+ PerlInterpreter *my_perl;
+#ifdef PERL_OBJECT
+ my_perl = (PerlInterpreter*)new(ipM) CPerlObj(ipM, ipMS, ipMP, ipE, ipStd,
+ ipLIO, ipD, ipS, ipP);
+ PERL_SET_INTERP(my_perl);
+#else
+ /* New() needs interpreter, so call malloc() instead */
+ my_perl = (PerlInterpreter*)(*ipM->pMalloc)(ipM, sizeof(PerlInterpreter));
+ PERL_SET_INTERP(my_perl);
+ Zero(my_perl, 1, PerlInterpreter);
+ PL_Mem = ipM;
+ PL_MemShared = ipMS;
+ PL_MemParse = ipMP;
+ PL_Env = ipE;
+ PL_StdIO = ipStd;
+ PL_LIO = ipLIO;
+ PL_Dir = ipD;
+ PL_Sock = ipS;
+ PL_Proc = ipP;
+#endif
- return pPerl;
+ return my_perl;
}
#else
PerlInterpreter *
/* New() needs interpreter, so call malloc() instead */
my_perl = (PerlInterpreter*)PerlMem_malloc(sizeof(PerlInterpreter));
PERL_SET_INTERP(my_perl);
+ Zero(my_perl, 1, PerlInterpreter);
return my_perl;
}
-#endif /* PERL_OBJECT */
+#endif /* PERL_IMPLICIT_SYS */
void
perl_construct(pTHXx)
#ifdef USE_THREADS
int i;
#ifndef FAKE_THREADS
- struct perl_thread *thr;
+ struct perl_thread *thr = NULL;
#endif /* FAKE_THREADS */
#endif /* USE_THREADS */
#ifdef MULTIPLICITY
- Zero(my_perl, 1, PerlInterpreter);
-#endif
-
-#ifdef MULTIPLICITY
init_interp();
PL_perl_destruct_level = 1;
#else
/* Init the real globals (and main thread)? */
if (!PL_linestr) {
-#ifdef USE_THREADS
-
INIT_THREADS;
+#ifdef USE_THREADS
#ifdef ALLOC_THREAD_KEY
ALLOC_THREAD_KEY;
#else
init_i18nl10n(1);
SET_NUMERIC_STANDARD();
+
+ {
+ U8 *s;
+ PL_patchlevel = NEWSV(0,4);
+ SvUPGRADE(PL_patchlevel, SVt_PVNV);
+ if (PERL_REVISION > 127 || PERL_VERSION > 127 || PERL_SUBVERSION > 127)
+ SvGROW(PL_patchlevel,24);
+ s = (U8*)SvPVX(PL_patchlevel);
+ s = uv_to_utf8(s, (UV)PERL_REVISION);
+ s = uv_to_utf8(s, (UV)PERL_VERSION);
+ s = uv_to_utf8(s, (UV)PERL_SUBVERSION);
+ *s = '\0';
+ SvCUR_set(PL_patchlevel, s - (U8*)SvPVX(PL_patchlevel));
+ SvPOK_on(PL_patchlevel);
+ SvNVX(PL_patchlevel) = (NV)PERL_REVISION
+ + ((NV)PERL_VERSION / (NV)1000)
#if defined(PERL_SUBVERSION) && PERL_SUBVERSION > 0
- sprintf(PL_patchlevel, "%7.5f", (double) PERL_REVISION
- + ((double) PERL_VERSION / (double) 1000)
- + ((double) PERL_SUBVERSION / (double) 100000));
-#else
- sprintf(PL_patchlevel, "%5.3f", (double) PERL_REVISION +
- ((double) PERL_VERSION / (double) 1000));
+ + ((NV)PERL_SUBVERSION / (NV)1000000)
#endif
+ ;
+ SvNOK_on(PL_patchlevel); /* dual valued */
+ SvUTF8_on(PL_patchlevel);
+ SvREADONLY_on(PL_patchlevel);
+ }
#if defined(LOCAL_PATCH_COUNT)
PL_localpatches = local_patches; /* For possible -v */
PL_fdpid = newAV(); /* for remembering popen pids by fd */
PL_modglobal = newHV(); /* pointers to per-interpreter module globals */
- DEBUG( {
- New(51,PL_debname,128,char);
- New(52,PL_debdelim,128,char);
- } )
-
ENTER;
}
dTHX;
#endif /* USE_THREADS */
+ /* wait for all pseudo-forked children to finish */
+ PERL_WAIT_FOR_CHILDREN;
+
#ifdef USE_THREADS
#ifndef FAKE_THREADS
/* Pass 1 on any remaining threads: detach joinables, join zombies */
retry_cleanup:
MUTEX_LOCK(&PL_threads_mutex);
- DEBUG_S(PerlIO_printf(PerlIO_stderr(),
+ DEBUG_S(PerlIO_printf(Perl_debug_log,
"perl_destruct: waiting for %d threads...\n",
PL_nthreads - 1));
for (t = thr->next; t != thr; t = t->next) {
switch (ThrSTATE(t)) {
AV *av;
case THRf_ZOMBIE:
- DEBUG_S(PerlIO_printf(PerlIO_stderr(),
+ DEBUG_S(PerlIO_printf(Perl_debug_log,
"perl_destruct: joining zombie %p\n", t));
ThrSETSTATE(t, THRf_DEAD);
MUTEX_UNLOCK(&t->mutex);
MUTEX_UNLOCK(&PL_threads_mutex);
JOIN(t, &av);
SvREFCNT_dec((SV*)av);
- DEBUG_S(PerlIO_printf(PerlIO_stderr(),
+ DEBUG_S(PerlIO_printf(Perl_debug_log,
"perl_destruct: joined zombie %p OK\n", t));
goto retry_cleanup;
case THRf_R_JOINABLE:
- DEBUG_S(PerlIO_printf(PerlIO_stderr(),
+ DEBUG_S(PerlIO_printf(Perl_debug_log,
"perl_destruct: detaching thread %p\n", t));
ThrSETSTATE(t, THRf_R_DETACHED);
/*
MUTEX_UNLOCK(&t->mutex);
goto retry_cleanup;
default:
- DEBUG_S(PerlIO_printf(PerlIO_stderr(),
+ DEBUG_S(PerlIO_printf(Perl_debug_log,
"perl_destruct: ignoring %p (state %u)\n",
t, ThrSTATE(t)));
MUTEX_UNLOCK(&t->mutex);
/* Pass 2 on remaining threads: wait for the thread count to drop to one */
while (PL_nthreads > 1)
{
- DEBUG_S(PerlIO_printf(PerlIO_stderr(),
+ DEBUG_S(PerlIO_printf(Perl_debug_log,
"perl_destruct: final wait for %d threads\n",
PL_nthreads - 1));
COND_WAIT(&PL_nthreads_cond, &PL_threads_mutex);
}
/* At this point, we're the last thread */
MUTEX_UNLOCK(&PL_threads_mutex);
- DEBUG_S(PerlIO_printf(PerlIO_stderr(), "perl_destruct: armageddon has arrived\n"));
+ DEBUG_S(PerlIO_printf(Perl_debug_log, "perl_destruct: armageddon has arrived\n"));
MUTEX_DESTROY(&PL_threads_mutex);
COND_DESTROY(&PL_nthreads_cond);
#endif /* !defined(FAKE_THREADS) */
PL_warnhook = Nullsv;
SvREFCNT_dec(PL_diehook);
PL_diehook = Nullsv;
- SvREFCNT_dec(PL_parsehook);
- PL_parsehook = Nullsv;
/* call exit list functions */
while (PL_exitlistlen-- > 0)
PL_dowarn = G_WARN_OFF;
PL_doextract = FALSE;
PL_sawampersand = FALSE; /* must save all match strings */
- PL_sawstudy = FALSE; /* do fbm_instr on all strings */
- PL_sawvec = FALSE;
PL_unsafe = FALSE;
Safefree(PL_inplace);
PL_inplace = Nullch;
+ SvREFCNT_dec(PL_patchlevel);
if (PL_e_script) {
SvREFCNT_dec(PL_e_script);
/* startup and shutdown function lists */
SvREFCNT_dec(PL_beginav);
SvREFCNT_dec(PL_endav);
+ SvREFCNT_dec(PL_stopav);
SvREFCNT_dec(PL_initav);
PL_beginav = Nullav;
PL_endav = Nullav;
+ PL_stopav = Nullav;
PL_initav = Nullav;
/* shortcuts just get cleared */
PL_envgv = Nullgv;
- PL_siggv = Nullgv;
PL_incgv = Nullgv;
PL_hintgv = Nullgv;
PL_errgv = Nullgv;
PL_argvgv = Nullgv;
PL_argvoutgv = Nullgv;
PL_stdingv = Nullgv;
+ PL_stderrgv = Nullgv;
PL_last_in_gv = Nullgv;
PL_replgv = Nullgv;
+ PL_debstash = Nullhv;
/* reset so print() ends up where we expect */
setdefout(Nullgv);
+ SvREFCNT_dec(PL_argvout_stack);
+ PL_argvout_stack = Nullav;
+
+ SvREFCNT_dec(PL_fdpid);
+ PL_fdpid = Nullav;
+ SvREFCNT_dec(PL_modglobal);
+ PL_modglobal = Nullhv;
+ SvREFCNT_dec(PL_preambleav);
+ PL_preambleav = Nullav;
+ SvREFCNT_dec(PL_subname);
+ PL_subname = Nullsv;
+ SvREFCNT_dec(PL_linestr);
+ PL_linestr = Nullsv;
+ SvREFCNT_dec(PL_pidstatus);
+ PL_pidstatus = Nullhv;
+ SvREFCNT_dec(PL_toptarget);
+ PL_toptarget = Nullsv;
+ SvREFCNT_dec(PL_bodytarget);
+ PL_bodytarget = Nullsv;
+ PL_formtarget = Nullsv;
+
+ /* clear utf8 character classes */
+ SvREFCNT_dec(PL_utf8_alnum);
+ SvREFCNT_dec(PL_utf8_alnumc);
+ SvREFCNT_dec(PL_utf8_ascii);
+ SvREFCNT_dec(PL_utf8_alpha);
+ SvREFCNT_dec(PL_utf8_space);
+ SvREFCNT_dec(PL_utf8_cntrl);
+ SvREFCNT_dec(PL_utf8_graph);
+ SvREFCNT_dec(PL_utf8_digit);
+ SvREFCNT_dec(PL_utf8_upper);
+ SvREFCNT_dec(PL_utf8_lower);
+ SvREFCNT_dec(PL_utf8_print);
+ SvREFCNT_dec(PL_utf8_punct);
+ SvREFCNT_dec(PL_utf8_xdigit);
+ SvREFCNT_dec(PL_utf8_mark);
+ SvREFCNT_dec(PL_utf8_toupper);
+ SvREFCNT_dec(PL_utf8_tolower);
+ PL_utf8_alnum = Nullsv;
+ PL_utf8_alnumc = Nullsv;
+ PL_utf8_ascii = Nullsv;
+ PL_utf8_alpha = Nullsv;
+ PL_utf8_space = Nullsv;
+ PL_utf8_cntrl = Nullsv;
+ PL_utf8_graph = Nullsv;
+ PL_utf8_digit = Nullsv;
+ PL_utf8_upper = Nullsv;
+ PL_utf8_lower = Nullsv;
+ PL_utf8_print = Nullsv;
+ PL_utf8_punct = Nullsv;
+ PL_utf8_xdigit = Nullsv;
+ PL_utf8_mark = Nullsv;
+ PL_utf8_toupper = Nullsv;
+ PL_utf8_totitle = Nullsv;
+ PL_utf8_tolower = Nullsv;
+
+ if (!specialWARN(PL_compiling.cop_warnings))
+ SvREFCNT_dec(PL_compiling.cop_warnings);
+ PL_compiling.cop_warnings = Nullsv;
+
/* Prepare to destruct main symbol table. */
hv = PL_defstash;
PL_defstash = 0;
SvREFCNT_dec(hv);
+ SvREFCNT_dec(PL_curstname);
+ PL_curstname = Nullsv;
/* clear queued errors */
SvREFCNT_dec(PL_errors);
sv_free_arenas();
/* No SVs have survived, need to clean out */
- PL_linestr = NULL;
- PL_pidstatus = Nullhv;
Safefree(PL_origfilename);
- Safefree(PL_archpat_auto);
Safefree(PL_reg_start_tmp);
if (PL_reg_curpm)
Safefree(PL_reg_curpm);
dTHR;
I32 oldscope;
int ret;
+ dJMPENV;
#ifdef USE_THREADS
dTHX;
#endif
oldscope = PL_scopestack_ix;
PL_dowarn = G_WARN_OFF;
- CALLPROTECT(aTHX_ &ret, MEMBER_TO_FPTR(S_parse_body), env, xsinit);
+ CALLPROTECT(aTHX_ pcur_env, &ret, MEMBER_TO_FPTR(S_parse_body),
+ env, xsinit);
switch (ret) {
case 0:
+ if (PL_stopav)
+ call_list(oldscope, PL_stopav);
return 0;
case 1:
STATUS_ALL_FAILURE;
LEAVE;
FREETMPS;
PL_curstash = PL_defstash;
- if (PL_endav)
- call_list(oldscope, PL_endav);
+ if (PL_stopav)
+ call_list(oldscope, PL_stopav);
return STATUS_NATIVE_EXPORT;
case 3:
- PerlIO_printf(PerlIO_stderr(), "panic: top_env\n");
+ PerlIO_printf(Perl_error_log, "panic: top_env\n");
return 1;
}
return 0;
AV* comppadlist;
register SV *sv;
register char *s;
+ char *cddir = Nullch;
XSINIT_t xsinit = va_arg(args, XSINIT_t);
if (!*++s && (s=argv[1]) != Nullch) {
argc--,argv++;
}
- while (s && isSPACE(*s))
- ++s;
if (s && *s) {
- char *e, *p;
- for (e = s; *e && !isSPACE(*e); e++) ;
- p = savepvn(s, e-s);
+ char *p;
+ STRLEN len = strlen(s);
+ p = savepvn(s, len);
incpush(p, TRUE);
- sv_catpv(sv,"-I");
- sv_catpv(sv,p);
- sv_catpv(sv," ");
+ sv_catpvn(sv, "-I", 2);
+ sv_catpvn(sv, p, len);
+ sv_catpvn(sv, " ", 1);
Safefree(p);
- } /* XXX else croak? */
+ }
+ else
+ Perl_croak(aTHX_ "No directory specified for -I");
break;
case 'P':
forbid_setid("-P");
#else
sv_catpv(PL_Sv,"print \"\\nCharacteristics of this binary (from libperl): \\n\",");
#endif
-#if defined(DEBUGGING) || defined(MULTIPLICITY)
sv_catpv(PL_Sv,"\" Compile-time options:");
# ifdef DEBUGGING
sv_catpv(PL_Sv," DEBUGGING");
# ifdef MULTIPLICITY
sv_catpv(PL_Sv," MULTIPLICITY");
# endif
+# ifdef USE_THREADS
+ sv_catpv(PL_Sv," USE_THREADS");
+# endif
+# ifdef USE_ITHREADS
+ sv_catpv(PL_Sv," USE_ITHREADS");
+# endif
+# ifdef USE_64_BITS
+ sv_catpv(PL_Sv," USE_64_BITS");
+# endif
+# ifdef USE_LONG_DOUBLE
+ sv_catpv(PL_Sv," USE_LONG_DOUBLE");
+# endif
+# ifdef USE_LARGE_FILES
+ sv_catpv(PL_Sv," USE_LARGE_FILES");
+# endif
+# ifdef USE_SOCKS
+ sv_catpv(PL_Sv," USE_SOCKS");
+# endif
+# ifdef PERL_OBJECT
+ sv_catpv(PL_Sv," PERL_OBJECT");
+# endif
+# ifdef PERL_IMPLICIT_CONTEXT
+ sv_catpv(PL_Sv," PERL_IMPLICIT_CONTEXT");
+# endif
+# ifdef PERL_IMPLICIT_SYS
+ sv_catpv(PL_Sv," PERL_IMPLICIT_SYS");
+# endif
sv_catpv(PL_Sv,"\\n\",");
-#endif
+
#if defined(LOCAL_PATCH_COUNT)
if (LOCAL_PATCH_COUNT > 0) {
int i;
PL_doextract = TRUE;
s++;
if (*s)
- PL_cddir = savepv(s);
+ cddir = s;
break;
case 0:
break;
#ifndef SECURE_INTERNAL_GETENV
!PL_tainting &&
#endif
- (s = PerlEnv_getenv("PERL5OPT"))) {
+ (s = PerlEnv_getenv("PERL5OPT")))
+ {
while (isSPACE(*s))
s++;
if (*s == '-' && *(s+1) == 'T')
validate_suid(validarg, scriptname,fdscript);
- if (PL_doextract)
+#if defined(SIGCHLD) || defined(SIGCLD)
+ {
+#ifndef SIGCHLD
+# define SIGCHLD SIGCLD
+#endif
+ Sighandler_t sigstate = rsignal_state(SIGCHLD);
+ if (sigstate == SIG_IGN) {
+ if (ckWARN(WARN_SIGNAL))
+ Perl_warner(aTHX_ WARN_SIGNAL,
+ "Can't ignore signal CHLD, forcing to default");
+ (void)rsignal(SIGCHLD, (Sighandler_t)SIG_DFL);
+ }
+ }
+#endif
+
+ if (PL_doextract) {
find_beginning();
+ if (cddir && PerlDir_chdir(cddir) < 0)
+ Perl_croak(aTHX_ "Can't chdir to %s",cddir);
+
+ }
PL_main_cv = PL_compcv = (CV*)NEWSV(1104,0);
sv_upgrade((SV *)PL_compcv, SVt_PVCV);
PL_origfilename);
}
}
- PL_curcop->cop_line = 0;
+ CopLINE_set(PL_curcop, 0);
PL_curstash = PL_defstash;
PL_preprocess = FALSE;
if (PL_e_script) {
if (PL_do_undump)
my_unexec();
- if (isWARN_ONCE)
+ if (isWARN_ONCE) {
+ SAVECOPFILE(PL_curcop);
+ SAVECOPLINE(PL_curcop);
gv_check(PL_defstash);
+ }
LEAVE;
FREETMPS;
dTHR;
I32 oldscope;
int ret;
+ dJMPENV;
#ifdef USE_THREADS
dTHX;
#endif
oldscope = PL_scopestack_ix;
redo_body:
- CALLPROTECT(aTHX_ &ret, MEMBER_TO_FPTR(S_run_body), oldscope);
+ CALLPROTECT(aTHX_ pcur_env, &ret, MEMBER_TO_FPTR(S_run_body), oldscope);
switch (ret) {
case 1:
cxstack_ix = -1; /* start context stack again */
LEAVE;
FREETMPS;
PL_curstash = PL_defstash;
- if (PL_endav)
+ if (PL_endav && !PL_minus_c)
call_list(oldscope, PL_endav);
#ifdef MYMALLOC
if (PerlEnv_getenv("PERL_DEBUG_MSTATS"))
POPSTACK_TO(PL_mainstack);
goto redo_body;
}
- PerlIO_printf(PerlIO_stderr(), "panic: restartop\n");
+ PerlIO_printf(Perl_error_log, "panic: restartop\n");
FREETMPS;
return 1;
}
if (!PL_restartop) {
DEBUG_x(dump_all());
DEBUG(PerlIO_printf(Perl_debug_log, "\nEXECUTING...\n\n"));
- DEBUG_S(PerlIO_printf(Perl_debug_log, "main thread is 0x%lx\n",
- (unsigned long) thr));
+ DEBUG_S(PerlIO_printf(Perl_debug_log, "main thread is 0x%"UVxf"\n",
+ PTR2UV(thr)));
if (PL_minus_c) {
- PerlIO_printf(PerlIO_stderr(), "%s syntax OK\n", PL_origfilename);
+ PerlIO_printf(Perl_error_log, "%s syntax OK\n", PL_origfilename);
my_exit(0);
}
if (PERLDB_SINGLE && PL_DBsingle)
bool oldcatch = CATCH_GET;
int ret;
OP* oldop = PL_op;
+ dJMPENV;
if (flags & G_DISCARD) {
ENTER;
PL_op->op_private |= OPpENTERSUB_DB;
if (!(flags & G_EVAL)) {
- /* G_NOCATCH is a hack for perl_vdie using this path to call
- a __DIE__ handler */
- if (!(flags & G_NOCATCH)) {
- CATCH_SET(TRUE);
- }
+ CATCH_SET(TRUE);
call_xbody((OP*)&myop, FALSE);
retval = PL_stack_sp - (PL_stack_base + oldmark);
- if (!(flags & G_NOCATCH)) {
- CATCH_SET(FALSE);
- }
+ CATCH_SET(oldcatch);
}
else {
cLOGOP->op_other = PL_op;
PL_markstack_ptr++;
redo_body:
- CALLPROTECT(aTHX_ &ret, MEMBER_TO_FPTR(S_call_body), (OP*)&myop, FALSE);
+ CALLPROTECT(aTHX_ pcur_env, &ret, MEMBER_TO_FPTR(S_call_body),
+ (OP*)&myop, FALSE);
switch (ret) {
case 0:
retval = PL_stack_sp - (PL_stack_base + oldmark);
/* my_exit() was called */
PL_curstash = PL_defstash;
FREETMPS;
- if (PL_statusvalue)
+ if (PL_statusvalue && !(PL_exit_flags & PERL_EXIT_EXPECTED))
Perl_croak(aTHX_ "Callback called exit");
my_exit_jump();
/* NOTREACHED */
I32 oldscope;
int ret;
OP* oldop = PL_op;
+ dJMPENV;
if (flags & G_DISCARD) {
ENTER;
myop.op_flags |= OPf_SPECIAL;
redo_body:
- CALLPROTECT(aTHX_ &ret, MEMBER_TO_FPTR(S_call_body), (OP*)&myop, TRUE);
+ CALLPROTECT(aTHX_ pcur_env, &ret, MEMBER_TO_FPTR(S_call_body),
+ (OP*)&myop, TRUE);
switch (ret) {
case 0:
retval = PL_stack_sp - (PL_stack_base + oldmark);
/* my_exit() was called */
PL_curstash = PL_defstash;
FREETMPS;
- if (PL_statusvalue)
+ if (PL_statusvalue && !(PL_exit_flags & PERL_EXIT_EXPECTED))
Perl_croak(aTHX_ "Callback called exit");
my_exit_jump();
/* NOTREACHED */
case '0':
{
dTHR;
- rschar = scan_oct(s, 4, &numlen);
+ rschar = (U32)scan_oct(s, 4, &numlen);
SvREFCNT_dec(PL_nrs);
if (rschar & ~((U8)~0))
PL_nrs = &PL_sv_undef;
++s;
if (*s) {
char *e, *p;
- for (e = s; *e && !isSPACE(*e); e++) ;
- p = savepvn(s, e-s);
- incpush(p, TRUE);
- Safefree(p);
- s = e;
+ p = s;
+ /* ignore trailing spaces (possibly followed by other switches) */
+ do {
+ for (e = p; *e && !isSPACE(*e); e++) ;
+ p = e;
+ while (isSPACE(*p))
+ p++;
+ } while (*p && *p != '-');
+ e = savepvn(s, e-s);
+ incpush(e, TRUE);
+ Safefree(e);
+ s = p;
+ if (*s == '-')
+ s++;
}
else
- Perl_croak(aTHX_ "No space allowed after -I");
+ Perl_croak(aTHX_ "No directory specified for -I");
return s;
case 'l':
PL_minus_l = TRUE;
if (isDIGIT(*s)) {
PL_ors = savepv("\n");
PL_orslen = 1;
- *PL_ors = scan_oct(s, 3 + (*s == '0'), &numlen);
+ *PL_ors = (char)scan_oct(s, 3 + (*s == '0'), &numlen);
s += numlen;
}
else {
sv_catpv(sv, "})");
}
s += strlen(s);
- if (PL_preambleav == NULL)
+ if (!PL_preambleav)
PL_preambleav = newAV();
av_push(PL_preambleav, sv);
}
s++;
return s;
case 'v':
-#if defined(PERL_SUBVERSION) && PERL_SUBVERSION > 0
- printf("\nThis is perl, version %d.%03d_%02d built for %s",
- PERL_REVISION, PERL_VERSION, PERL_SUBVERSION, ARCHNAME);
-#else
- printf("\nThis is perl, version %s built for %s",
- PL_patchlevel, ARCHNAME);
-#endif
+ printf("\nThis is perl, v%"UVuf".%"UVuf".%"UVuf" built for %s",
+ (UV)PERL_REVISION, (UV)PERL_VERSION, (UV)PERL_SUBVERSION, ARCHNAME);
#if defined(LOCAL_PATCH_COUNT)
if (LOCAL_PATCH_COUNT > 0)
printf("\n(with %d registered patch%s, see perl -V for more detail)",
- LOCAL_PATCH_COUNT, (LOCAL_PATCH_COUNT!=1) ? "es" : "");
+ (int)LOCAL_PATCH_COUNT, (LOCAL_PATCH_COUNT!=1) ? "es" : "");
#endif
printf("\n\nCopyright 1987-1999, Larry Wall\n");
PL_curcop = &PL_compiling;\
PL_curcopdb = NULL; \
PL_dbargs = 0; \
- PL_dlmax = 128; \
PL_dumpindent = 4; \
PL_laststatval = -1; \
PL_laststype = OP_STAT; \
PL_tmps_floor = -1; \
PL_tmps_ix = -1; \
PL_op_mask = NULL; \
- PL_dlmax = 128; \
PL_laststatval = -1; \
PL_laststype = OP_STAT; \
PL_mess_sv = Nullsv; \
sv_grow(ERRSV, 240); /* Preallocate - for immediate signals. */
sv_setpvn(ERRSV, "", 0);
PL_curstash = PL_defstash;
- PL_compiling.cop_stash = PL_defstash;
+ CopSTASH_set(&PL_compiling, PL_defstash);
PL_debstash = GvHV(gv_fetchpv("DB::", GV_ADDMULTI, SVt_PVHV));
PL_globalstash = GvHV(gv_fetchpv("CORE::GLOBAL::", GV_ADDMULTI, SVt_PVHV));
/* We must init $/ before switches are processed. */
}
}
- PL_curcop->cop_filegv = gv_fetchfile(PL_origfilename);
+ CopFILE_set(PL_curcop, PL_origfilename);
if (strEQ(PL_origfilename,"-"))
scriptname = "";
if (*fdscript >= 0) {
Perl_sv_catpvf(aTHX_ cpp, "%s/", BIN_EXP);
sv_catpv(cpp, cpp_cfg);
- sv_catpv(sv,"-I");
+ sv_catpvn(sv, "-I", 2);
sv_catpv(sv,PRIVLIB_EXP);
#ifdef MSDOS
#ifdef DOSUID
#ifndef IAMSUID /* in case script is not readable before setuid */
if (PL_euid &&
- PerlLIO_stat(SvPVX(GvSV(PL_curcop->cop_filegv)),&PL_statbuf) >= 0 &&
+ PerlLIO_stat(CopFILE(PL_curcop),&PL_statbuf) >= 0 &&
PL_statbuf.st_mode & (S_ISUID|S_ISGID))
{
/* try again */
- PerlProc_execv(Perl_form(aTHX_ "%s/sperl%s", BIN_EXP, PL_patchlevel), PL_origargv);
+ PerlProc_execv(Perl_form(aTHX_ "%s/sperl"PERL_FS_VER_FMT, BIN_EXP,
+ (int)PERL_REVISION, (int)PERL_VERSION,
+ (int)PERL_SUBVERSION), PL_origargv);
Perl_croak(aTHX_ "Can't do setuid\n");
}
#endif
#endif
Perl_croak(aTHX_ "Can't open perl script \"%s\": %s\n",
- SvPVX(GvSV(PL_curcop->cop_filegv)), Strerror(errno));
+ CopFILE(PL_curcop), Strerror(errno));
}
}
STATIC int
S_fd_on_nosuid_fs(pTHX_ int fd)
{
- int on_nosuid = 0;
- int check_okay = 0;
+ int check_okay = 0; /* able to do all the required sys/libcalls */
+ int on_nosuid = 0; /* the fd is on a nosuid fs */
/*
- * Preferred order: fstatvfs(), fstatfs(), getmntent().
+ * Preferred order: fstatvfs(), fstatfs(), ustat()+getmnt(), getmntent().
* fstatvfs() is UNIX98.
- * fstatfs() is BSD.
- * getmntent() is O(number-of-mounted-filesystems) and can hang.
+ * fstatfs() is 4.3 BSD.
+ * ustat()+getmnt() is pre-4.3 BSD.
+ * getmntent() is O(number-of-mounted-filesystems) and can hang on
+ * an irrelevant filesystem while trying to reach the right one.
*/
# ifdef HAS_FSTATVFS
check_okay = fstatvfs(fd, &stfs) == 0;
on_nosuid = check_okay && (stfs.f_flag & ST_NOSUID);
# else
-# if defined(HAS_FSTATFS) && defined(HAS_STRUCT_STATFS_FLAGS)
+# ifdef PERL_MOUNT_NOSUID
+# if defined(HAS_FSTATFS) && \
+ defined(HAS_STRUCT_STATFS) && \
+ defined(HAS_STRUCT_STATFS_F_FLAGS)
struct statfs stfs;
check_okay = fstatfs(fd, &stfs) == 0;
-# undef PERL_MOUNT_NOSUID
-# if !defined(PERL_MOUNT_NOSUID) && defined(MNT_NOSUID)
-# define PERL_MOUNT_NOSUID MNT_NOSUID
-# endif
-# if !defined(PERL_MOUNT_NOSUID) && defined(MS_NOSUID)
-# define PERL_MOUNT_NOSUID MS_NOSUID
-# endif
-# if !defined(PERL_MOUNT_NOSUID) && defined(M_NOSUID)
-# define PERL_MOUNT_NOSUID M_NOSUID
-# endif
-# ifdef PERL_MOUNT_NOSUID
on_nosuid = check_okay && (stfs.f_flags & PERL_MOUNT_NOSUID);
-# endif
+# else
+# if defined(HAS_FSTAT) && \
+ defined(HAS_USTAT) && \
+ defined(HAS_GETMNT) && \
+ defined(HAS_STRUCT_FS_DATA) && \
+ defined(NOSTAT_ONE)
+ struct stat fdst;
+ if (fstat(fd, &fdst) == 0) {
+ struct ustat us;
+ if (ustat(fdst.st_dev, &us) == 0) {
+ struct fs_data fsd;
+ /* NOSTAT_ONE here because we're not examining fields which
+ * vary between that case and STAT_ONE. */
+ if (getmnt((int*)0, &fsd, (int)0, NOSTAT_ONE, us.f_fname) == 0) {
+ size_t cmplen = sizeof(us.f_fname);
+ if (sizeof(fsd.fd_req.path) < cmplen)
+ cmplen = sizeof(fsd.fd_req.path);
+ if (strnEQ(fsd.fd_req.path, us.f_fname, cmplen) &&
+ fdst.st_dev == fsd.fd_req.dev) {
+ check_okay = 1;
+ on_nosuid = fsd.fd_req.flags & PERL_MOUNT_NOSUID;
+ }
+ }
+ }
+ }
+ }
+# endif /* fstat+ustat+getmnt */
+# endif /* fstatfs */
# else
-# if defined(HAS_GETMNTENT) && defined(HAS_HASMNTOPT) && defined(MNTOPT_NOSUID)
+# if defined(HAS_GETMNTENT) && \
+ defined(HAS_HASMNTOPT) && \
+ defined(MNTOPT_NOSUID)
FILE *mtab = fopen("/etc/mtab", "r");
struct mntent *entry;
struct stat stb, fsb;
}
if (mtab)
fclose(mtab);
-# endif /* mntent */
-# endif /* statfs */
+# endif /* getmntent+hasmntopt */
+# endif /* PERL_MOUNT_NOSUID: fstatfs or fstat+ustat+statfs */
# endif /* statvfs */
+
if (!check_okay)
- Perl_croak(aTHX_ "Can't check filesystem of script \"%s\"", PL_origfilename);
+ Perl_croak(aTHX_ "Can't check filesystem of script \"%s\" for nosuid", PL_origfilename);
return on_nosuid;
}
#endif /* IAMSUID */
* But I don't think it's too important. The manual lies when
* it says access() is useful in setuid programs.
*/
- if (PerlLIO_access(SvPVX(GvSV(PL_curcop->cop_filegv)),1)) /*double check*/
+ if (PerlLIO_access(CopFILE(PL_curcop),1)) /*double check*/
Perl_croak(aTHX_ "Permission denied");
#else
/* If we can swap euid and uid, then we can determine access rights
#endif
|| PerlProc_getuid() != PL_euid || PerlProc_geteuid() != PL_uid)
Perl_croak(aTHX_ "Can't swap uid and euid"); /* really paranoid */
- if (PerlLIO_stat(SvPVX(GvSV(PL_curcop->cop_filegv)),&tmpstatbuf) < 0)
+ if (PerlLIO_stat(CopFILE(PL_curcop),&tmpstatbuf) < 0)
Perl_croak(aTHX_ "Permission denied"); /* testing full pathname here */
#if defined(IAMSUID) && !defined(NO_NOSUID_CHECK)
if (fd_on_nosuid_fs(PerlIO_fileno(PL_rsfp)))
(void)PerlIO_close(PL_rsfp);
if (PL_rsfp = PerlProc_popen("/bin/mail root","w")) { /* heh, heh */
PerlIO_printf(PL_rsfp,
-"User %ld tried to run dev %ld ino %ld in place of dev %ld ino %ld!\n\
-(Filename of set-id script was %s, uid %ld gid %ld.)\n\nSincerely,\nperl\n",
- (long)PL_uid,(long)tmpstatbuf.st_dev, (long)tmpstatbuf.st_ino,
+"User %"Uid_t_f" tried to run dev %ld ino %ld in place of dev %ld ino %ld!\n\
+(Filename of set-id script was %s, uid %"Uid_t_f" gid %"Gid_t_f".)\n\nSincerely,\nperl\n",
+ PL_uid,(long)tmpstatbuf.st_dev, (long)tmpstatbuf.st_ino,
(long)PL_statbuf.st_dev, (long)PL_statbuf.st_ino,
- SvPVX(GvSV(PL_curcop->cop_filegv)),
- (long)PL_statbuf.st_uid, (long)PL_statbuf.st_gid);
+ CopFILE(PL_curcop),
+ PL_statbuf.st_uid, PL_statbuf.st_gid);
(void)PerlProc_pclose(PL_rsfp);
}
Perl_croak(aTHX_ "Permission denied\n");
if (PL_statbuf.st_mode & S_IWOTH)
Perl_croak(aTHX_ "Setuid/gid script is writable by world");
PL_doswitches = FALSE; /* -s is insecure in suid */
- PL_curcop->cop_line++;
+ CopLINE_inc(PL_curcop);
if (sv_gets(PL_linestr, PL_rsfp, 0) == Nullch ||
strnNE(SvPV(PL_linestr,n_a),"#!",2) ) /* required even on Sys V */
Perl_croak(aTHX_ "No #! line");
(void)PerlIO_close(PL_rsfp);
#ifndef IAMSUID
/* try again */
- PerlProc_execv(Perl_form(aTHX_ "%s/sperl%s", BIN_EXP, PL_patchlevel), PL_origargv);
+ PerlProc_execv(Perl_form(aTHX_ "%s/sperl"PERL_FS_VER_FMT, BIN_EXP,
+ (int)PERL_REVISION, (int)PERL_VERSION,
+ (int)PERL_SUBVERSION), PL_origargv);
#endif
Perl_croak(aTHX_ "Can't do setuid\n");
}
#if defined(HAS_FCNTL) && defined(F_SETFD)
fcntl(PerlIO_fileno(PL_rsfp),F_SETFD,0); /* ensure no close-on-exec */
#endif
- PerlProc_execv(Perl_form(aTHX_ "%s/perl%s", BIN_EXP, PL_patchlevel), PL_origargv);/* try again */
+ PerlProc_execv(Perl_form(aTHX_ "%s/perl"PERL_FS_VER_FMT, BIN_EXP,
+ (int)PERL_REVISION, (int)PERL_VERSION,
+ (int)PERL_SUBVERSION), PL_origargv);/* try again */
Perl_croak(aTHX_ "Can't do setuid\n");
#endif /* IAMSUID */
#else /* !DOSUID */
/*SUPPRESS 530*/
while (s = moreswitches(s)) ;
}
- if (PL_cddir && PerlDir_chdir(PL_cddir) < 0)
- Perl_croak(aTHX_ "Can't chdir to %s",PL_cddir);
}
}
}
PL_markstack_ptr = PL_markstack;
PL_markstack_max = PL_markstack + REASONABLE(32);
- SET_MARKBASE;
+ SET_MARK_OFFSET;
New(54,PL_scopestack,REASONABLE(32),I32);
PL_scopestack_ix = 0;
Safefree(PL_scopestack);
Safefree(PL_savestack);
Safefree(PL_retstack);
- DEBUG( {
- Safefree(PL_debname);
- Safefree(PL_debdelim);
- } )
}
#ifndef PERL_OBJECT
GvMULTI_on(tmpgv);
GvIOp(tmpgv) = (IO*)SvREFCNT_inc(io);
- othergv = gv_fetchpv("STDERR",TRUE, SVt_PVIO);
- GvMULTI_on(othergv);
- io = GvIOp(othergv);
+ PL_stderrgv = gv_fetchpv("STDERR",TRUE, SVt_PVIO);
+ GvMULTI_on(PL_stderrgv);
+ io = GvIOp(PL_stderrgv);
IoOFP(io) = IoIFP(io) = PerlIO_stderr();
tmpgv = gv_fetchpv("stderr",TRUE, SVt_PV);
GvMULTI_on(tmpgv);
for (; argc > 0 && **argv == '-'; argc--,argv++) {
if (!argv[0][1])
break;
- if (argv[0][1] == '-') {
+ if (argv[0][1] == '-' && !argv[0][2]) {
argc--,argv++;
break;
}
magicname("0", "0", 1);
}
if (tmpgv = gv_fetchpv("\030",TRUE, SVt_PV))
+#ifdef OS2
+ sv_setpv(GvSV(tmpgv), os2_execname());
+#else
sv_setpv(GvSV(tmpgv),PL_origargv[0]);
+#endif
if (PL_argvgv = gv_fetchpv("ARGV",TRUE, SVt_PVAV)) {
GvMULTI_on(PL_argvgv);
(void)gv_AVadd(PL_argvgv);
}
TAINT_NOT;
if (tmpgv = gv_fetchpv("$",TRUE, SVt_PV))
- sv_setiv(GvSV(tmpgv), (IV)getpid());
+ sv_setiv(GvSV(tmpgv), (IV)PerlProc_getpid());
}
STATIC void
if (addsubdirs) {
subdir = sv_newmortal();
- if (!PL_archpat_auto) {
- STRLEN len = (sizeof(ARCHNAME) + strlen(PL_patchlevel)
- + sizeof("//auto"));
- New(55, PL_archpat_auto, len, char);
- sprintf(PL_archpat_auto, "/%s/%s/auto", ARCHNAME, PL_patchlevel);
-#ifdef VMS
- for (len = sizeof(ARCHNAME) + 2;
- PL_archpat_auto[len] != '\0' && PL_archpat_auto[len] != '/'; len++)
- if (PL_archpat_auto[len] == '.') PL_archpat_auto[len] = '_';
-#endif
- }
}
/* Break at all separators */
sv_usepvn(libdir,unix,len);
}
else
- PerlIO_printf(PerlIO_stderr(),
+ PerlIO_printf(Perl_error_log,
"Failed to unixify @INC element \"%s\"\n",
SvPV(libdir,len));
#endif
/* .../archname/version if -d .../archname/version/auto */
- sv_setsv(subdir, libdir);
- sv_catpv(subdir, PL_archpat_auto);
+ Perl_sv_setpvf(aTHX_ subdir, "%_/%s/"PERL_FS_VER_FMT"/auto", libdir,
+ ARCHNAME, (int)PERL_REVISION,
+ (int)PERL_VERSION, (int)PERL_SUBVERSION);
if (PerlLIO_stat(SvPVX(subdir), &tmpstatbuf) >= 0 &&
S_ISDIR(tmpstatbuf.st_mode))
av_push(GvAVn(PL_incgv),
newSVpvn(SvPVX(subdir), SvCUR(subdir) - sizeof "auto"));
/* .../archname if -d .../archname/auto */
- sv_insert(subdir, SvCUR(libdir) + sizeof(ARCHNAME),
- strlen(PL_patchlevel) + 1, "", 0);
+ Perl_sv_setpvf(aTHX_ subdir, "%_/%s/auto", libdir, ARCHNAME);
if (PerlLIO_stat(SvPVX(subdir), &tmpstatbuf) >= 0 &&
S_ISDIR(tmpstatbuf.st_mode))
av_push(GvAVn(PL_incgv),
thr->threadsv = newAV();
/* thr->threadsvp is set when find_threadsv is called */
thr->specific = newAV();
- thr->errhv = newHV();
thr->flags = THRf_R_JOINABLE;
MUTEX_INIT(&thr->mutex);
/* Handcraft thrsv similarly to mess_sv */
Perl_call_list(pTHX_ I32 oldscope, AV *paramList)
{
dTHR;
- SV *atsv = ERRSV;
- line_t oldline = PL_curcop->cop_line;
+ SV *atsv;
+ line_t oldline = CopLINE(PL_curcop);
CV *cv;
STRLEN len;
int ret;
+ dJMPENV;
while (AvFILL(paramList) >= 0) {
cv = (CV*)av_shift(paramList);
SAVEFREESV(cv);
- CALLPROTECT(aTHX_ &ret, MEMBER_TO_FPTR(S_call_list_body), cv);
+ CALLPROTECT(aTHX_ pcur_env, &ret, MEMBER_TO_FPTR(S_call_list_body), cv);
switch (ret) {
case 0:
+ atsv = ERRSV;
(void)SvPV(atsv, len);
if (len) {
+ STRLEN n_a;
PL_curcop = &PL_compiling;
- PL_curcop->cop_line = oldline;
+ CopLINE_set(PL_curcop, oldline);
if (paramList == PL_beginav)
sv_catpv(atsv, "BEGIN failed--compilation aborted");
else
- sv_catpv(atsv, "END failed--cleanup aborted");
+ Perl_sv_catpvf(aTHX_ atsv,
+ "%s failed--call queue aborted",
+ paramList == PL_stopav ? "STOP"
+ : paramList == PL_initav ? "INIT"
+ : "END");
while (PL_scopestack_ix > oldscope)
LEAVE;
- Perl_croak(aTHX_ "%s", SvPVX(atsv));
+ Perl_croak(aTHX_ "%s", SvPVx(atsv, n_a));
}
break;
case 1:
LEAVE;
FREETMPS;
PL_curstash = PL_defstash;
- if (PL_endav)
- call_list(oldscope, PL_endav);
PL_curcop = &PL_compiling;
- PL_curcop->cop_line = oldline;
- if (PL_statusvalue) {
+ CopLINE_set(PL_curcop, oldline);
+ if (PL_statusvalue && !(PL_exit_flags & PERL_EXIT_EXPECTED)) {
if (paramList == PL_beginav)
Perl_croak(aTHX_ "BEGIN failed--compilation aborted");
else
- Perl_croak(aTHX_ "END failed--cleanup aborted");
+ Perl_croak(aTHX_ "%s failed--call queue aborted",
+ paramList == PL_stopav ? "STOP"
+ : paramList == PL_initav ? "INIT"
+ : "END");
}
my_exit_jump();
/* NOTREACHED */
case 3:
if (PL_restartop) {
PL_curcop = &PL_compiling;
- PL_curcop->cop_line = oldline;
+ CopLINE_set(PL_curcop, oldline);
JMPENV_JUMP(3);
}
- PerlIO_printf(PerlIO_stderr(), "panic: restartop\n");
+ PerlIO_printf(Perl_error_log, "panic: restartop\n");
FREETMPS;
break;
}
}
#ifdef PERL_OBJECT
-#define NO_XSLOCKS
#include "XSUB.h"
#endif
sv_chop(PL_e_script, nl);
return 1;
}
-
-
#define VOIDUSED 1
#include "config.h"
+#if defined(USE_ITHREADS) && defined(USE_5005THREADS)
+# include "error: USE_ITHREADS and USE_5005THREADS are incompatible"
+#endif
+
+/* XXX This next guard can disappear if the sources are revised
+ to use USE_5005THREADS throughout. -- A.D 1/6/2000
+*/
+#if defined(USE_ITHREADS) && defined(USE_THREADS)
+# include "error: USE_ITHREADS and USE_THREADS are incompatible"
+#endif
+
/* See L<perlguts/"The Perl API"> for detailed notes on
* PERL_IMPLICIT_CONTEXT and PERL_IMPLICIT_SYS */
# ifndef PERL_IMPLICIT_CONTEXT
# define PERL_IMPLICIT_CONTEXT
# endif
-# ifndef PERL_IMPLICIT_SYS
-/*# define PERL_IMPLICIT_SYS*/ /* XXX not done yet */
-# endif
#endif
#if defined(MULTIPLICITY)
# ifndef PERL_IMPLICIT_CONTEXT
# define PERL_IMPLICIT_CONTEXT
# endif
-# ifndef PERL_IMPLICIT_SYS
-/*# define PERL_IMPLICIT_SYS*/ /* XXX not done yet */
-# endif
#endif
#ifdef PERL_CAPI
# undef PERL_OBJECT
+# ifndef MULTIPLICITY
+# define MULTIPLICITY
+# endif
# ifndef PERL_IMPLICIT_CONTEXT
# define PERL_IMPLICIT_CONTEXT
# endif
# endif
#endif
+#if defined(USE_ITHREADS) && !defined(MULTIPLICITY) && !defined(PERL_OBJECT)
+# include "error: USE_ITHREADS must be built with MULTIPLICITY"
+#endif
+
#ifdef PERL_OBJECT
/* PERL_OBJECT explained - DickH and DougL @ ActiveState.com
| Perl Host |
+-----------+
^
- |
- v
+ |
+ v
+-----------+ +-----------+
| Perl Core |<->| Extension |
+-----------+ +-----------+ ...
#define STATIC
#define CPERLscope(x) CPerlObj::x
-#define CALL_FPTR(fptr) (this->*fptr)
+#define CALL_FPTR(fptr) (aTHXo->*fptr)
#define pTHXo CPerlObj *pPerl
#define pTHXo_ pTHXo,
/* HP-UX 10.X CMA (Common Multithreaded Architecure) insists that
pthread.h must be included before all other header files.
*/
-#if defined(USE_THREADS) && defined(PTHREAD_H_FIRST) && defined(I_PTHREAD)
+#if (defined(USE_THREADS) || defined(USE_ITHREADS)) \
+ && defined(PTHREAD_H_FIRST) && defined(I_PTHREAD)
# include <pthread.h>
#endif
# include <stdlib.h>
#endif
-#if !defined(PERL_FOR_X2P) && !defined(PERL_OBJECT)
+#if !defined(PERL_FOR_X2P) && !defined(WIN32)
# include "embed.h"
#endif
#ifdef USE_THREADS
# define ERRSV (thr->errsv)
-# define ERRHV (thr->errhv)
# define DEFSV THREADSV(0)
# define SAVE_DEFSV save_threadsv(0)
#else
# define ERRSV GvSV(PL_errgv)
-# define ERRHV GvHV(PL_errgv)
# define DEFSV GvSV(PL_defgv)
# define SAVE_DEFSV SAVESPTR(GvSV(PL_defgv))
#endif /* USE_THREADS */
+#define ERRHV GvHV(PL_errgv) /* XXX unused, here for compatibility */
+
#ifndef errno
extern int errno; /* ANSI allows errno to be an lvalue expr.
* For example in multithreaded environments
#undef UV
#endif
-#ifdef I_INTTYPES
-#include <inttypes.h>
-#endif
-
/*
The IV type is supposed to be long enough to hold any integral
value or a pointer.
--Andy Dougherty August 1996
*/
-/* We should be able to get Quad_t in most systems:
- all of int64_t, long long, long, int, will work.
-
- Beware of LP32 systems (ILP32, ILP32LL64). Such systems have been
- used to sizeof(long) == sizeof(foo*). This is a bad assumption
- because then IV/UV have been 32 bits, too. Which, in turn means
- that even if the system has quads (e.g. long long), IV cannot be a
- quad. Introducing a 64-bit IV (because of long long existing)
- will introduce binary incompatibility.
-
- Summary: a long long system needs to add -DUSE_LONG_LONG to $ccflags
- to get quads -- and if its pointers are still 32 bits, this will break
- binary compatibility. Casting an IV (a long long) to a pointer will
- truncate half of the IV away. Most systems can just use
- Configure -Duse64bits to get the -DUSE_LONG_LONG added either by
- their hints files, or directly by Configure if they are using gcc.
-
- --jhi September 1999 */
-
-#if INTSIZE == 4 && LONGSIZE == 4 && PTRSIZE == 4
-# define PERL_ILP32
-# if defined(HAS_LONG_LONG) && LONGLONGSIZE == 8
-# define PERL_ILP32LL64
-# endif
-#endif
-
-#if LONGSIZE == 8 && PTRSIZE == 8
-# define PERL_LP64
-# if INTSIZE == 8
-# define PERL_ILP64
-# endif
-#endif
-
-#ifndef Quad_t
-# if LONGSIZE == 8
-# define Quad_t long
-# define Uquad_t unsigned long
-# define PERL_QUAD_IS_LONG
-# endif
-#endif
-
-#ifndef Quad_t
-# if INTSIZE == 8
-# define Quad_t int
-# define Uquad_t unsigned int
-# define PERL_QUAD_IS_INT
-# endif
-#endif
-
-#ifndef Quad_t
-# ifdef USE_LONG_LONG /* See above note about LP32. --jhi */
-# if defined(HAS_LONG_LONG) && LONGLONGSIZE == 8
-# define Quad_t long long
-# define Uquad_t unsigned long long
-# define PERL_QUAD_IS_LONG_LONG
-# endif
-# endif
-#endif
-
-#ifndef Quad_t
-# ifdef HAS_INT64_T
-# define Quad_t int64_t
-# define Uquad_t uint64_t
-# define PERL_QUAD_IS_INT64_T
-# endif
-#endif
-
-#ifdef Quad_t
-# define HAS_QUAD
-# ifndef Uquad_t
- /* Note that if your Quad_t is a typedef (not a #define) you *MUST*
- * have defined by now Uquad_t yourself because 'unsigned type'
- * is illegal. */
-# define Uquad_t unsigned Quad_t
-# endif
-#endif
+typedef IVTYPE IV;
+typedef UVTYPE UV;
#if defined(USE_64_BITS) && defined(HAS_QUAD)
-# ifdef PERL_QUAD_IS_LONG /* LP64 */
- typedef long IV;
- typedef unsigned long UV;
-# else
-# ifdef PERL_QUAD_IS_INT /* ILP64 */
- typedef int IV;
- typedef unsigned int UV;
-# else
-# ifdef PERL_QUAD_IS_LONG_LONG /* LL64 */
- typedef long long IV;
- typedef unsigned long long UV;
-# else
-# ifdef PERL_QUAD_IS_INT64_T /* C9X */
- typedef int64_t IV;
- typedef uint64_t UV;
-# endif
-# endif
-# endif
-# endif
-# if defined(PERL_QUAD_IS_INT64_T) && defined(INT64_MAX)
+# if QUADKIND == QUAD_IS_INT64_T && defined(INT64_MAX)
# define IV_MAX INT64_MAX
# define IV_MIN INT64_MIN
# define UV_MAX UINT64_MAX
# define UV_MAX PERL_UQUAD_MAX
# define UV_MIN PERL_UQUAD_MIN
# endif
-# define IVSIZE 8
-# define UVSIZE 8
# define IV_IS_QUAD
# define UV_IS_QUAD
#else
- typedef long IV;
- typedef unsigned long UV;
-# if defined(INT32_MAX) && LONGSIZE == 4
+# if defined(INT32_MAX) && IVSIZE == 4
# define IV_MAX INT32_MAX
# define IV_MIN INT32_MIN
# ifndef UINT32_MAX_BROKEN /* e.g. HP-UX with gcc messes this up */
# define UV_MAX PERL_ULONG_MAX
# define UV_MIN PERL_ULONG_MIN
# endif
-# if LONGSIZE == 8
+# if IVSIZE == 8
# define IV_IS_QUAD
# define UV_IS_QUAD
+# ifndef HAS_QUAD
+# define HAS_QUAD
+# endif
# else
# undef IV_IS_QUAD
# undef UV_IS_QUAD
+# undef HAS_QUAD
# endif
-# define UVSIZE LONGSIZE
-# define IVSIZE LONGSIZE
#endif
+
#define IV_DIG (BIT_DIGITS(IVSIZE * 8))
#define UV_DIG (BIT_DIGITS(UVSIZE * 8))
#define PTR2NV(p) NUM2PTR(NV,p)
#ifdef USE_LONG_DOUBLE
-# if defined(HAS_LONG_DOUBLE) && (LONG_DOUBLESIZE > DOUBLESIZE)
-# define LDoub_t long double
-# else
+# if !(defined(HAS_LONG_DOUBLE) && (LONG_DOUBLESIZE > DOUBLESIZE))
# undef USE_LONG_DOUBLE /* Ouch! */
# endif
#endif
default value for printing floating point numbers in Gconvert.
(see config.h)
*/
-#ifdef I_LIMITS
-#include <limits.h>
-#endif
-#ifdef I_FLOAT
-#include <float.h>
-#endif
-#ifndef HAS_LDBL_DIG
-#if LONG_DOUBLESIZE == 10
-#define LDBL_DIG 18 /* assume IEEE */
-#else
-#if LONG_DOUBLESIZE == 16
-#define LDBL_DIG 33 /* assume IEEE */
-#else
-#if LONG_DOUBLESIZE == DOUBLESIZE
-#define LDBL_DIG DBL_DIG /* bummer */
-#endif
-#endif
-#endif
-#endif
+# ifdef I_LIMITS
+# include <limits.h>
+# endif
+# ifdef I_FLOAT
+# include <float.h>
+# endif
+# ifndef HAS_LDBL_DIG
+# if LONG_DOUBLESIZE == 10
+# define LDBL_DIG 18 /* assume IEEE */
+# else
+# if LONG_DOUBLESIZE == 12
+# define LDBL_DIG 18 /* gcc? */
+# else
+# if LONG_DOUBLESIZE == 16
+# define LDBL_DIG 33 /* assume IEEE */
+# else
+# if LONG_DOUBLESIZE == DOUBLESIZE
+# define LDBL_DIG DBL_DIG /* bummer */
+# endif
+# endif
+# endif
+# endif
+# endif
#endif
+typedef NVTYPE NV;
+
#ifdef USE_LONG_DOUBLE
-# define HAS_LDOUB
- typedef LDoub_t NV;
-# define NVSIZE LONG_DOUBLESIZE
# define NV_DIG LDBL_DIG
-# define Perl_modf modfl
-# define Perl_frexp frexpl
-# define Perl_cos cosl
-# define Perl_sin sinl
-# define Perl_sqrt sqrtl
-# define Perl_exp expl
-# define Perl_log logl
-# define Perl_atan2 atan2l
-# define Perl_pow powl
-# define Perl_floor floorl
-# define Perl_fmod fmodl
+# ifdef HAS_SQRTL
+# define Perl_modf modfl
+# define Perl_frexp frexpl
+# define Perl_cos cosl
+# define Perl_sin sinl
+# define Perl_sqrt sqrtl
+# define Perl_exp expl
+# define Perl_log logl
+# define Perl_atan2 atan2l
+# define Perl_pow powl
+# define Perl_floor floorl
+# define Perl_fmod fmodl
+# endif
#else
- typedef double NV;
-# define NVSIZE DOUBLESIZE
# define NV_DIG DBL_DIG
# define Perl_modf modf
# define Perl_frexp frexp
# define Perl_fmod fmod
#endif
-#if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_ATOLF)
-# define Perl_atof atolf
-#else
-# define Perl_atof atof
+#if !defined(Perl_atof) && defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
+# if !defined(Perl_atof) && defined(HAS_STRTOLD)
+# define Perl_atof(s) strtold(s, (char**)NULL)
+# endif
+# if !defined(Perl_atof) && defined(HAS_ATOLF)
+# define Perl_atof atolf
+# endif
+#endif
+#if !defined(Perl_atof)
+# define Perl_atof atof /* we assume atof being available anywhere */
#endif
/* Previously these definitions used hardcoded figures.
# endif
#endif
-#ifdef HAS_QUAD
+#ifdef UV_IS_QUAD
# ifdef UQUAD_MAX
# define PERL_UQUAD_MAX ((UV)UQUAD_MAX)
typedef struct logop LOGOP;
typedef struct pmop PMOP;
typedef struct svop SVOP;
-typedef struct gvop GVOP;
+typedef struct padop PADOP;
typedef struct pvop PVOP;
typedef struct loop LOOP;
-typedef struct Outrec Outrec;
typedef struct interpreter PerlInterpreter;
-#ifndef __BORLANDC__
-typedef struct ff FF; /* XXX not defined anywhere, should go? */
-#endif
typedef struct sv SV;
typedef struct av AV;
typedef struct hv HV;
typedef struct xpvio XPVIO;
typedef struct mgvtbl MGVTBL;
typedef union any ANY;
+typedef struct ptr_tbl_ent PTR_TBL_ENT_t;
+typedef struct ptr_tbl PTR_TBL_t;
#include "handy.h"
-#if defined(USE_LARGE_FILES)
-# define USE_64_BIT_RAWIO /* Explicit */
-# define USE_64_BIT_STDIO
+#ifndef NO_LARGE_FILES
+# define USE_LARGE_FILES /* If available. */
#endif
-#if LSEEKSIZE == 8 && !defined(USE_64_BIT_RAWIO)
-# define USE_64_BIT_RAWIO /* Implicit */
+#if defined(USE_LARGE_FILES) && !defined(NO_64_BIT_RAWIO)
+# define USE_64_BIT_RAWIO /* explicit */
+# if LSEEKSIZE == 8 && !defined(USE_64_BIT_RAWIO)
+# define USE_64_BIT_RAWIO /* implicit */
+# endif
#endif
-/* Do we need FSEEKSIZE? */
+/* Notice the use of HAS_FSEEKO: now we are obligated to always use
+ * fseeko/ftello if possible. Don't go #defining ftell to ftello yourself,
+ * however, because operating systems like to do that themself. */
+#ifndef FSEEKSIZE
+# ifdef HAS_FSEEKO
+# define FSEEKSIZE LSEEKSIZE
+# else
+# define FSEEKSIZE LONGSIZE
+# endif
+#endif
-/* I couldn't find any -Ddefine or -flags in IRIX 6.5 that would
- * have done the necessary symbol renaming using cpp. --jhi */
-#ifdef __sgi
-#define USE_FOPEN64
-#define USE_FSEEK64
-#define USE_FTELL64
-#define USE_FSETPOS64
-#define USE_FGETPOS64
-#define USE_TMPFILE64
-#define USE_FREOPEN64
+#if defined(USE_LARGE_FILES) && !defined(NO_64_BIT_STDIO)
+# define USE_64_BIT_STDIO /* explicit */
+# if FSEEKSIZE == 8 && !defined(USE_64_BIT_STDIO)
+# define USE_64_BIT_STDIO /* implicit */
+# endif
#endif
#ifdef USE_64_BIT_RAWIO
# endif
# if defined(USE_LSEEK64)
# define lseek lseek64
-# endif
-# if defined(USE_LLSEEK)
-# define lseek llseek
+# else
+# if defined(USE_LLSEEK)
+# define lseek llseek
+# endif
# endif
# if defined(USE_STAT64)
# define stat stat64
# define fopen fopen64
# endif
# if defined(USE_FSEEK64)
-# define fseek fseek64
+# define fseek fseek64 /* don't do fseeko here, see perlio.c */
# endif
# if defined(USE_FTELL64)
-# define ftell ftell64
+# define ftell ftell64 /* don't do ftello here, see perlio.c */
# endif
# if defined(USE_FSETPOS64)
# define fsetpos fsetpos64
# if defined(EPOC)
# include "epocish.h"
# else
-# include "unixish.h"
+# if defined(MACOS_TRADITIONAL)
+# include "macos/macish.h"
+# else
+# include "unixish.h"
+# endif
# endif
# endif
# endif
# endif
#endif
+#ifndef PERL_SYS_INIT3
+# define PERL_SYS_INIT3(argvp,argcp,envp) PERL_SYS_INIT(argvp,argcp)
+#endif
+
#ifndef MAXPATHLEN
# ifdef PATH_MAX
# ifdef _POSIX_PATH_MAX
* May make sense to have threads after "*ish.h" anyway
*/
-#ifdef USE_THREADS
+#if defined(USE_THREADS) || defined(USE_ITHREADS)
+# if defined(USE_THREADS)
/* pending resolution of licensing issues, we avoid the erstwhile
* atomic.h everywhere */
# define EMULATE_ATOMIC_REFCOUNTS
-
+# endif
# ifdef FAKE_THREADS
# include "fakethr.h"
# else
# endif /* OS2 */
# endif /* WIN32 */
# endif /* FAKE_THREADS */
-#endif /* USE_THREADS */
+#endif /* USE_THREADS || USE_ITHREADS */
#ifdef WIN32
-#include "win32.h"
+# include "win32.h"
#endif
#ifdef VMS
# define STATUS_ALL_FAILURE (PL_statusvalue = 1)
#endif
+/* flags in PL_exit_flags for nature of exit() */
+#define PERL_EXIT_EXPECTED 0x01
+
#ifndef MEMBER_TO_FPTR
-#define MEMBER_TO_FPTR(name) name
+# define MEMBER_TO_FPTR(name) name
+#endif
+
+/* format to use for version numbers in file/directory names */
+/* XXX move to Configure? */
+#ifndef PERL_FS_VER_FMT
+# define PERL_FS_VER_FMT "%d.%d.%d"
#endif
/* This defines a way to flush all output buffers. This may be a
* performance issue, so we allow people to disable it.
- * XXX the default needs a Configure test, as it may not work everywhere.
*/
#ifndef PERL_FLUSHALL_FOR_CHILD
# if defined(FFLUSH_NULL) || defined(USE_SFIO)
# endif
#endif
+#ifndef PERL_WAIT_FOR_CHILDREN
+# define PERL_WAIT_FOR_CHILDREN NOOP
+#endif
+
/* the traditional thread-unsafe notion of "current interpreter".
* XXX todo: a thread-safe version that fetches it from TLS (akin to THR)
* needs to be defined elsewhere (conditional on pthread_getspecific()
I32 any_i32;
IV any_iv;
long any_long;
- void (*any_dptr) (pTHXo_ void*);
+ void (*any_dptr) (void*);
+ void (*any_dxptr) (pTHXo_ void*);
};
#endif
typedef struct magic_state MGS; /* struct magic_state defined in mg.c */
struct scan_data_t; /* Used in S_* functions in regcomp.c */
+struct regnode_charclass_class; /* Used in S_* functions in regcomp.c */
typedef I32 CHECKPOINT;
+struct ptr_tbl_ent {
+ struct ptr_tbl_ent* next;
+ void* oldval;
+ void* newval;
+};
+
+struct ptr_tbl {
+ struct ptr_tbl_ent** tbl_ary;
+ UV tbl_max;
+ UV tbl_items;
+};
+
#if defined(iAPX286) || defined(M_I286) || defined(I80286)
# define I286
#endif
#define NV_WITHIN_IV(nv) (I_V(nv) >= IV_MIN && I_V(nv) <= IV_MAX)
#define NV_WITHIN_UV(nv) ((nv)>=0.0 && U_V(nv) >= UV_MIN && U_V(nv) <= UV_MAX)
-/* Believe. */
-#define IV_FITS_IN_NV
-/* Doubt. */
-#if defined(USE_LONG_DOUBLE) && \
- defined(LDBL_MANT_DIG) && IV_DIG >= LDBL_MANT_DIG
-# undef IV_FITS_IN_NV
-#else
-# if defined(DBL_MANT_DIG) && IV_DIG >= DBL_MANT_DIG
-# undef IV_FITS_IN_NV
-# else
-# if IV_DIG >= NV_DIG
-# undef IV_FITS_IN_NV
-# else
-# if IVSIZE >= NVSIZE
-# undef IV_FITS_IN_NV
-# endif
-# endif
-# endif
-#endif
-
/* Used with UV/IV arguments: */
/* XXXX: need to speed it up */
#define CLUMP_2UV(iv) ((iv) < 0 ? 0 : (UV)(iv))
#define CLUMP_2IV(uv) ((uv) > (UV)IV_MAX ? IV_MAX : (IV)(uv))
-struct Outrec {
- I32 o_lines;
- char *o_str;
- U32 o_len;
-};
-
#ifndef MAXSYSFD
# define MAXSYSFD 2
#endif
-#ifndef TMPPATH
-# define TMPPATH "/tmp/perl-eXXXXXX"
-#endif
-
#ifndef __cplusplus
Uid_t getuid (void);
Uid_t geteuid (void);
#endif
#ifndef Perl_debug_log
-#define Perl_debug_log PerlIO_stderr()
+# define Perl_debug_log PerlIO_stderr()
+#endif
+
+#ifndef Perl_error_log
+# define Perl_error_log (PL_stderrgv \
+ && IoOFP(GvIOp(PL_stderrgv)) \
+ ? IoOFP(GvIOp(PL_stderrgv)) \
+ : PerlIO_stderr())
#endif
#ifdef DEBUGGING
# if defined(NeXT) || defined(__NeXT__) /* or whatever catches all NeXTs */
char *crypt (); /* Maybe more hosts will need the unprototyped version */
# else
-# if !defined(WIN32) || !defined(HAVE_DES_FCRYPT)
+# if !defined(WIN32)
char *crypt (const char*, const char*);
-# endif /* !WIN32 && !HAVE_CRYPT_SOURCE */
+# endif /* !WIN32 */
# endif /* !NeXT && !__NeXT__ */
# ifndef DONT_DECLARE_STD
# ifndef getenv
# endif
#endif
-typedef Signal_t (*Sighandler_t) (int);
+/* Sighandler_t defined in iperlsys.h */
#ifdef HAS_SIGACTION
typedef struct sigaction Sigsave_t;
/* handy constants */
EXTCONST char PL_warn_uninit[]
- INIT("Use of uninitialized value");
+ INIT("Use of uninitialized value%s%s");
EXTCONST char PL_warn_nosemi[]
INIT("Semicolon seems to be missing");
EXTCONST char PL_warn_reserved[]
#ifdef DOINIT
EXT char *PL_sig_name[] = { SIG_NAME };
EXT int PL_sig_num[] = { SIG_NUM };
-EXT SV * PL_psig_ptr[sizeof(PL_sig_num)/sizeof(*PL_sig_num)];
-EXT SV * PL_psig_name[sizeof(PL_sig_num)/sizeof(*PL_sig_num)];
#else
EXT char *PL_sig_name[];
EXT int PL_sig_num[];
-EXT SV * PL_psig_ptr[];
-EXT SV * PL_psig_name[];
#endif
/* fast case folding tables */
#define HINT_STRICT_REFS 0x00000002
/* #define HINT_notused4 0x00000004 */
#define HINT_UTF8 0x00000008
-/* #define HINT_notused10 0x00000010 */
+#define HINT_BYTE 0x00000010
/* Note: 20,40,80 used for NATIVE_HINTS */
#define HINT_BLOCK_SCOPE 0x00000100
int Perl_yylex(pTHX_ YYSTYPE *lvalp, int *lcharp);
#endif
+typedef void (*DESTRUCTORFUNC_NOCONTEXT_t) (void*);
typedef void (*DESTRUCTORFUNC_t) (pTHXo_ void*);
typedef void (*SVFUNC_t) (pTHXo_ SV*);
typedef I32 (*SVCOMPARE_t) (pTHXo_ SV*, SV*);
void *ptr;
} PerlExitListEntry;
-#ifdef PERL_OBJECT
-#undef perl_alloc
-#define perl_alloc Perl_alloc
-CPerlObj* Perl_alloc (IPerlMem*, IPerlEnv*, IPerlStdIO*, IPerlLIO*, IPerlDir*, IPerlSock*, IPerlProc*);
-
-#undef EXT
-#define EXT
-#undef EXTCONST
-#define EXTCONST
-#undef INIT
-#define INIT(x)
-
-class CPerlObj {
-public:
- CPerlObj(IPerlMem*, IPerlEnv*, IPerlStdIO*, IPerlLIO*, IPerlDir*, IPerlSock*, IPerlProc*);
- void Init(void);
- void* operator new(size_t nSize, IPerlMem *pvtbl);
- static void operator delete(void* pPerl, IPerlMem *pvtbl);
-#endif /* PERL_OBJECT */
-
#ifdef PERL_GLOBAL_STRUCT
struct perl_vars {
-#include "perlvars.h"
+# include "perlvars.h"
};
-#ifdef PERL_CORE
+# ifdef PERL_CORE
EXT struct perl_vars PL_Vars;
EXT struct perl_vars *PL_VarsPtr INIT(&PL_Vars);
-#else /* PERL_CORE */
-#if !defined(__GNUC__) || !defined(WIN32)
+# else /* PERL_CORE */
+# if !defined(__GNUC__) || !defined(WIN32)
EXT
-#endif /* WIN32 */
+# endif /* WIN32 */
struct perl_vars *PL_VarsPtr;
-#define PL_Vars (*((PL_VarsPtr) ? PL_VarsPtr : (PL_VarsPtr = Perl_GetVars())))
-#endif /* PERL_CORE */
+# define PL_Vars (*((PL_VarsPtr) \
+ ? PL_VarsPtr : (PL_VarsPtr = Perl_GetVars(aTHX))))
+# endif /* PERL_CORE */
#endif /* PERL_GLOBAL_STRUCT */
-#ifdef MULTIPLICITY
+#if defined(MULTIPLICITY) || defined(PERL_OBJECT)
/* If we have multiple interpreters define a struct
holding variables which must be per-interpreter
If we don't have threads anything that would have
*/
struct interpreter {
-#ifndef USE_THREADS
-# include "thrdvar.h"
-#endif
-#include "intrpvar.h"
+# ifndef USE_THREADS
+# include "thrdvar.h"
+# endif
+# include "intrpvar.h"
+/*
+ * The following is a buffer where new variables must
+ * be defined to maintain binary compatibility with PERL_OBJECT
+ */
+PERLVARA(object_compatibility,30, char)
};
#else
struct interpreter {
char broiled;
};
-#endif
+#endif /* MULTIPLICITY || PERL_OBJECT */
#ifdef USE_THREADS
/* If we have threads define a struct with all the variables
# define PERL_CALLCONV
#endif
-#ifdef PERL_OBJECT
-# define VIRTUAL virtual PERL_CALLCONV
-#else
-# define VIRTUAL PERL_CALLCONV
-/*START_EXTERN_C*/
-#endif
-
#ifndef NEXT30_NO_ATTRIBUTE
# ifndef HASATTRIBUTE /* disable GNU-cc attribute checking? */
# ifdef __attribute__ /* Avoid possible redefinition errors */
#endif
#ifdef PERL_OBJECT
-#define PERL_DECL_PROT
-#define perl_alloc Perl_alloc
+# define PERL_DECL_PROT
#endif
-#include "proto.h"
-
#undef PERL_CKDEF
#undef PERL_PPDEF
#define PERL_CKDEF(s) OP *s (pTHX_ OP *o);
#define PERL_PPDEF(s) OP *s (pTHX);
-#ifdef PERL_OBJECT
-public:
-#endif
-#include "pp_proto.h"
+#include "proto.h"
#ifdef PERL_OBJECT
-VIRTUAL int CPerlObj::do_aspawn (void *vreally, void **vmark, void **vsp);
-#undef PERL_DECL_PROT
-#else
-/*END_EXTERN_C*/
+# undef PERL_DECL_PROT
#endif
#ifndef PERL_OBJECT
#define PERLVARI(var,type,init) EXT type PL_##var INIT(init);
#define PERLVARIC(var,type,init) EXTCONST type PL_##var INIT(init);
-#ifndef MULTIPLICITY
-
+#if !defined(MULTIPLICITY) && !defined(PERL_OBJECT)
+START_EXTERN_C
# include "intrpvar.h"
# ifndef USE_THREADS
# include "thrdvar.h"
# endif
-
+END_EXTERN_C
#endif
#ifdef PERL_OBJECT
-/*
- * The following is a buffer where new variables must
- * be defined to maintain binary compatibility with PERL_OBJECT
- * for 5.005
- */
-PERLVARA(object_compatibility,30, char)
-};
-
-
# include "embed.h"
-# if defined(WIN32) && !defined(WIN32IO_IS_STDIO)
-# define errno CPerlObj::ErrorNo()
-# endif
# ifdef DOINIT
# include "INTERN.h"
/* this has structure inits, so it cannot be included before here */
# include "opcode.h"
+#else
+# if defined(WIN32)
+# include "embed.h"
+# endif
#endif /* PERL_OBJECT */
#ifndef PERL_GLOBAL_STRUCT
#ifdef DOINIT
-EXT MGVTBL PL_vtbl_sv = {Perl_magic_get,
- Perl_magic_set,
- Perl_magic_len,
+EXT MGVTBL PL_vtbl_sv = {MEMBER_TO_FPTR(Perl_magic_get),
+ MEMBER_TO_FPTR(Perl_magic_set),
+ MEMBER_TO_FPTR(Perl_magic_len),
0, 0};
-EXT MGVTBL PL_vtbl_env = {0, Perl_magic_set_all_env,
- 0, Perl_magic_clear_all_env,
+EXT MGVTBL PL_vtbl_env = {0, MEMBER_TO_FPTR(Perl_magic_set_all_env),
+ 0, MEMBER_TO_FPTR(Perl_magic_clear_all_env),
0};
-EXT MGVTBL PL_vtbl_envelem = {0, Perl_magic_setenv,
- 0, Perl_magic_clearenv,
+EXT MGVTBL PL_vtbl_envelem = {0, MEMBER_TO_FPTR(Perl_magic_setenv),
+ 0, MEMBER_TO_FPTR(Perl_magic_clearenv),
0};
EXT MGVTBL PL_vtbl_sig = {0, 0, 0, 0, 0};
-EXT MGVTBL PL_vtbl_sigelem = {Perl_magic_getsig,
- Perl_magic_setsig,
- 0, Perl_magic_clearsig,
+EXT MGVTBL PL_vtbl_sigelem = {MEMBER_TO_FPTR(Perl_magic_getsig),
+ MEMBER_TO_FPTR(Perl_magic_setsig),
+ 0, MEMBER_TO_FPTR(Perl_magic_clearsig),
0};
-EXT MGVTBL PL_vtbl_pack = {0, 0, Perl_magic_sizepack, Perl_magic_wipepack,
+EXT MGVTBL PL_vtbl_pack = {0, 0, MEMBER_TO_FPTR(Perl_magic_sizepack), MEMBER_TO_FPTR(Perl_magic_wipepack),
0};
-EXT MGVTBL PL_vtbl_packelem = {Perl_magic_getpack,
- Perl_magic_setpack,
- 0, Perl_magic_clearpack,
+EXT MGVTBL PL_vtbl_packelem = {MEMBER_TO_FPTR(Perl_magic_getpack),
+ MEMBER_TO_FPTR(Perl_magic_setpack),
+ 0, MEMBER_TO_FPTR(Perl_magic_clearpack),
0};
-EXT MGVTBL PL_vtbl_dbline = {0, Perl_magic_setdbline,
+EXT MGVTBL PL_vtbl_dbline = {0, MEMBER_TO_FPTR(Perl_magic_setdbline),
0, 0, 0};
-EXT MGVTBL PL_vtbl_isa = {0, Perl_magic_setisa,
- 0, Perl_magic_setisa,
+EXT MGVTBL PL_vtbl_isa = {0, MEMBER_TO_FPTR(Perl_magic_setisa),
+ 0, MEMBER_TO_FPTR(Perl_magic_setisa),
0};
-EXT MGVTBL PL_vtbl_isaelem = {0, Perl_magic_setisa,
+EXT MGVTBL PL_vtbl_isaelem = {0, MEMBER_TO_FPTR(Perl_magic_setisa),
0, 0, 0};
-EXT MGVTBL PL_vtbl_arylen = {Perl_magic_getarylen,
- Perl_magic_setarylen,
+EXT MGVTBL PL_vtbl_arylen = {MEMBER_TO_FPTR(Perl_magic_getarylen),
+ MEMBER_TO_FPTR(Perl_magic_setarylen),
0, 0, 0};
-EXT MGVTBL PL_vtbl_glob = {Perl_magic_getglob,
- Perl_magic_setglob,
+EXT MGVTBL PL_vtbl_glob = {MEMBER_TO_FPTR(Perl_magic_getglob),
+ MEMBER_TO_FPTR(Perl_magic_setglob),
0, 0, 0};
-EXT MGVTBL PL_vtbl_mglob = {0, Perl_magic_setmglob,
+EXT MGVTBL PL_vtbl_mglob = {0, MEMBER_TO_FPTR(Perl_magic_setmglob),
0, 0, 0};
-EXT MGVTBL PL_vtbl_nkeys = {Perl_magic_getnkeys,
- Perl_magic_setnkeys,
+EXT MGVTBL PL_vtbl_nkeys = {MEMBER_TO_FPTR(Perl_magic_getnkeys),
+ MEMBER_TO_FPTR(Perl_magic_setnkeys),
0, 0, 0};
-EXT MGVTBL PL_vtbl_taint = {Perl_magic_gettaint,Perl_magic_settaint,
+EXT MGVTBL PL_vtbl_taint = {MEMBER_TO_FPTR(Perl_magic_gettaint),MEMBER_TO_FPTR(Perl_magic_settaint),
0, 0, 0};
-EXT MGVTBL PL_vtbl_substr = {Perl_magic_getsubstr, Perl_magic_setsubstr,
+EXT MGVTBL PL_vtbl_substr = {MEMBER_TO_FPTR(Perl_magic_getsubstr), MEMBER_TO_FPTR(Perl_magic_setsubstr),
0, 0, 0};
-EXT MGVTBL PL_vtbl_vec = {Perl_magic_getvec,
- Perl_magic_setvec,
+EXT MGVTBL PL_vtbl_vec = {MEMBER_TO_FPTR(Perl_magic_getvec),
+ MEMBER_TO_FPTR(Perl_magic_setvec),
0, 0, 0};
-EXT MGVTBL PL_vtbl_pos = {Perl_magic_getpos,
- Perl_magic_setpos,
+EXT MGVTBL PL_vtbl_pos = {MEMBER_TO_FPTR(Perl_magic_getpos),
+ MEMBER_TO_FPTR(Perl_magic_setpos),
0, 0, 0};
-EXT MGVTBL PL_vtbl_bm = {0, Perl_magic_setbm,
+EXT MGVTBL PL_vtbl_bm = {0, MEMBER_TO_FPTR(Perl_magic_setbm),
0, 0, 0};
-EXT MGVTBL PL_vtbl_fm = {0, Perl_magic_setfm,
+EXT MGVTBL PL_vtbl_fm = {0, MEMBER_TO_FPTR(Perl_magic_setfm),
0, 0, 0};
-EXT MGVTBL PL_vtbl_uvar = {Perl_magic_getuvar,
- Perl_magic_setuvar,
+EXT MGVTBL PL_vtbl_uvar = {MEMBER_TO_FPTR(Perl_magic_getuvar),
+ MEMBER_TO_FPTR(Perl_magic_setuvar),
0, 0, 0};
#ifdef USE_THREADS
-EXT MGVTBL PL_vtbl_mutex = {0, 0, 0, 0, Perl_magic_mutexfree};
+EXT MGVTBL PL_vtbl_mutex = {0, 0, 0, 0, MEMBER_TO_FPTR(Perl_magic_mutexfree)};
#endif /* USE_THREADS */
-EXT MGVTBL PL_vtbl_defelem = {Perl_magic_getdefelem,Perl_magic_setdefelem,
+EXT MGVTBL PL_vtbl_defelem = {MEMBER_TO_FPTR(Perl_magic_getdefelem),MEMBER_TO_FPTR(Perl_magic_setdefelem),
0, 0, 0};
-EXT MGVTBL PL_vtbl_regexp = {0,0,0,0, Perl_magic_freeregexp};
-EXT MGVTBL PL_vtbl_regdata = {0, 0, Perl_magic_regdata_cnt, 0, 0};
-EXT MGVTBL PL_vtbl_regdatum = {Perl_magic_regdatum_get, 0, 0, 0, 0};
+EXT MGVTBL PL_vtbl_regexp = {0,0,0,0, MEMBER_TO_FPTR(Perl_magic_freeregexp)};
+EXT MGVTBL PL_vtbl_regdata = {0, 0, MEMBER_TO_FPTR(Perl_magic_regdata_cnt), 0, 0};
+EXT MGVTBL PL_vtbl_regdatum = {MEMBER_TO_FPTR(Perl_magic_regdatum_get), 0, 0, 0, 0};
#ifdef USE_LOCALE_COLLATE
EXT MGVTBL PL_vtbl_collxfrm = {0,
- Perl_magic_setcollxfrm,
+ MEMBER_TO_FPTR(Perl_magic_setcollxfrm),
0, 0, 0};
#endif
-EXT MGVTBL PL_vtbl_amagic = {0, Perl_magic_setamagic,
- 0, 0, Perl_magic_setamagic};
-EXT MGVTBL PL_vtbl_amagicelem = {0, Perl_magic_setamagic,
- 0, 0, Perl_magic_setamagic};
+EXT MGVTBL PL_vtbl_amagic = {0, MEMBER_TO_FPTR(Perl_magic_setamagic),
+ 0, 0, MEMBER_TO_FPTR(Perl_magic_setamagic)};
+EXT MGVTBL PL_vtbl_amagicelem = {0, MEMBER_TO_FPTR(Perl_magic_setamagic),
+ 0, 0, MEMBER_TO_FPTR(Perl_magic_setamagic)};
EXT MGVTBL PL_vtbl_backref = {0, 0,
- 0, 0, Perl_magic_killbackrefs};
+ 0, 0, MEMBER_TO_FPTR(Perl_magic_killbackrefs)};
#else /* !DOINIT */
#endif /* !USE_LOCALE_NUMERIC */
-#if defined(USE_LONG_LONG) && defined(HAS_LONG_LONG) && defined(HAS_ATOLL)
-#define Atol atoll
-#else
-#define Atol atol
+#if !defined(Atol) && defined(USE_LONG_LONG) && defined(HAS_LONG_LONG)
+# if !defined(Atol) && defined(HAS_STRTOLL)
+# define Atol(s) strtoll(s, (char**)NULL, 10)
+# endif
+# if !defined(Atol) && defined(HAS_ATOLL)
+# define Atol atoll
+# endif
+#endif
+/* is there atoq() anywhere? */
+#if !defined(Atol)
+# define Atol atol /* we assume atol being available anywhere */
#endif
-#if defined(USE_LONG_LONG) && defined(HAS_LONG_LONG) && defined(HAS_STRTOULL)
-#define Strtoul strtoull
-#else
-#define Strtoul strtoul
+#if !defined(Strtoul) && defined(USE_LONG_LONG) && defined(HAS_LONG_LONG) \
+ && defined(HAS_STRTOULL)
+# define Strtoul strtoull
+#endif
+/* is there atouq() anywhere? */
+#if !defined(Strtoul) && defined(USE_64_BITS) && defined(HAS_STRTOUQ)
+# define Strtoul strtouq
+#endif
+#if !defined(Strtoul)
+# define Strtoul strtoul /* we assume strtoul being available anywhere */
#endif
#if !defined(PERLIO_IS_STDIO) && defined(HASATTRIBUTE)
* Now we have __attribute__ out of the way
* Remap printf
*/
+#undef printf
#define printf PerlIO_stdoutf
#endif
#endif
/*
+ * Some operating systems are stingy with stack allocation,
+ * so perl may have to guard against stack overflow.
+ */
+#ifndef PERL_STACK_OVERFLOW_CHECK
+#define PERL_STACK_OVERFLOW_CHECK() NOOP
+#endif
+
+/*
+ * Some nonpreemptive operating systems find it convenient to
+ * check for asynchronous conditions after each op execution.
+ * Keep this check simple, or it may slow down execution
+ * massively.
+ */
+#ifndef PERL_ASYNC_CHECK
+#define PERL_ASYNC_CHECK() NOOP
+#endif
+
+/*
+ * On some operating systems, a memory allocation may succeed,
+ * but put the process too close to the system's comfort limit.
+ * In this case, PERL_ALLOC_CHECK frees the pointer and sets
+ * it to NULL.
+ */
+#ifndef PERL_ALLOC_CHECK
+#define PERL_ALLOC_CHECK(p) NOOP
+#endif
+
+/*
* nice_chunk and nice_chunk size need to be set
* and queried under the protection of sv_mutex
*/
# include <sys/sem.h>
# ifndef HAS_UNION_SEMUN /* Provide the union semun. */
union semun {
- int val;
- struct semid_ds *buf;
- unsigned short *array;
+ int val;
+ struct semid_ds *buf;
+ unsigned short *array;
};
# endif
# ifdef USE_SEMCTL_SEMUN
+# ifdef IRIX32_SEMUN_BROKEN_BY_GCC
+ union gccbug_semun {
+ int val;
+ struct semid_ds *buf;
+ unsigned short *array;
+ char __dummy[5];
+ };
+# define semun gccbug_semun
+# endif
# define Semctl(id, num, cmd, semun) semctl(id, num, cmd, semun)
# else
# ifdef USE_SEMCTL_SEMID_DS
# endif
#endif
-/* Mention
-
- INSTALL_USR_BIN_PERL
-
- I_SYS_MMAN
- HAS_MMAP
- HAS_MUNMAP
- HAS_MPROTECT
- HAS_MSYNC
- HAS_MADVISE
- Mmap_t
-
- here so that Configure picks them up. */
-
#ifdef IAMSUID
#ifdef I_SYS_STATVFS
#ifdef I_MNTENT
# include <mntent.h> /* for getmntent() */
#endif
+#ifdef I_SYS_STATFS
+# include <sys/statfs.h> /* for some statfs() */
+#endif
+#ifdef I_SYS_VFS
+# ifdef __sgi
+# define sv IRIX_sv /* kludge: IRIX has an sv of its own */
+# endif
+# include <sys/vfs.h> /* for some statfs() */
+# ifdef __sgi
+# undef IRIX_sv
+# endif
+#endif
+#ifdef I_USTAT
+# include <ustat.h> /* for ustat() */
+#endif
+
+#if !defined(PERL_MOUNT_NOSUID) && defined(MOUNT_NOSUID)
+# define PERL_MOUNT_NOSUID MOUNT_NOSUID
+#endif
+#if !defined(PERL_MOUNT_NOSUID) && defined(MNT_NOSUID)
+# define PERL_MOUNT_NOSUID MNT_NOSUID
+#endif
+#if !defined(PERL_MOUNT_NOSUID) && defined(MS_NOSUID)
+# define PERL_MOUNT_NOSUID MS_NOSUID
+#endif
+#if !defined(PERL_MOUNT_NOSUID) && defined(M_NOSUID)
+# define PERL_MOUNT_NOSUID M_NOSUID
+#endif
#endif /* IAMSUID */
*
*/
-#if !defined(PERL_IMPLICIT_SYS)
#define VOIDUSED 1
#include "config.h"
#define PERL_IN_PERLIO_C
#include "perl.h"
+#if !defined(PERL_IMPLICIT_SYS)
+
#ifdef PERLIO_IS_STDIO
void
{
if (strlen(s) >= (STRLEN)n)
{
- PerlIO_puts(PerlIO_stderr(),"panic: sprintf overflow - memory corrupted!\n");
- {
- dTHX;
- my_exit(1);
- }
+ dTHX;
+ PerlIO_puts(Perl_error_log,"panic: sprintf overflow - memory corrupted!\n");
+ my_exit(1);
}
}
return val;
#ifdef HAS_SETLINEBUF
#define PerlIO_setlinebuf(f) setlinebuf(f);
#else
-# ifdef CYGWIN
-# define PerlIO_setlinebuf(f)
-# else
-# define PerlIO_setlinebuf(f) setvbuf(f, Nullch, _IOLBF, 0);
-# endif
+#define PerlIO_setlinebuf(f) setvbuf(f, Nullch, _IOLBF, 0);
#endif
/* Now our interface to Configure's FILE_xxx macros */
/* XXX does anyone even use this? */
PERLVARI(Gdo_undump, bool, FALSE) /* -u or dump seen? */
+
+#if defined(MYMALLOC) && (defined(USE_THREADS) || defined(USE_ITHREADS))
+PERLVAR(Gmalloc_mutex, perl_mutex) /* Mutex for malloc */
+#endif
struct ysv *ysave;
New(73, ysave, 1, struct ysv);
- SAVEDESTRUCTOR(yydestruct, ysave);
+ SAVEDESTRUCTOR_X(yydestruct, ysave);
ysave->oldyydebug = yydebug;
ysave->oldyynerrs = yynerrs;
ysave->oldyyerrflag = yyerrflag;
break;
case 22:
#line 203 "perly.y"
-{ yyval.opval = scope(yyvsp[0].opval); }
+{ (yyvsp[0].opval)->op_flags |= OPf_PARENS; yyval.opval = scope(yyvsp[0].opval); }
break;
case 23:
#line 205 "perly.y"
#line 338 "perly.y"
{ STRLEN n_a; char *name = SvPV(((SVOP*)yyvsp[0].opval)->op_sv,n_a);
if (strEQ(name, "BEGIN") || strEQ(name, "END")
- || strEQ(name, "INIT"))
+ || strEQ(name, "STOP") || strEQ(name, "INIT"))
CvSPECIAL_on(PL_compcv);
yyval.opval = yyvsp[0].opval; }
break;
}
#ifdef PERL_OBJECT
-#define NO_XSLOCKS
#include "XSUB.h"
#endif
else : /* NULL */
{ $$ = Nullop; }
| ELSE mblock
- { $$ = scope($2); }
+ { ($2)->op_flags |= OPf_PARENS; $$ = scope($2); }
| ELSIF '(' mexpr ')' mblock else
{ PL_copline = $1;
$$ = newCONDOP(0, $3, scope($5), $6);
subname : WORD { STRLEN n_a; char *name = SvPV(((SVOP*)$1)->op_sv,n_a);
if (strEQ(name, "BEGIN") || strEQ(name, "END")
- || strEQ(name, "INIT"))
+ || strEQ(name, "STOP") || strEQ(name, "INIT"))
CvSPECIAL_on(PL_compcv);
$$ = $1; }
;
+ struct ysv *ysave;
+ New(73, ysave, 1, struct ysv);
-+ SAVEDESTRUCTOR(yydestruct, ysave);
++ SAVEDESTRUCTOR_X(yydestruct, ysave);
+ ysave->oldyydebug = yydebug;
+ ysave->oldyynerrs = yynerrs;
+ ysave->oldyyerrflag = yyerrflag;
yyaccept:
! return (0);
}
---- 2524,2570 ----
+--- 2524,2569 ----
#endif
if (yyssp >= yyss + yystacksize - 1)
{
! }
!
! #ifdef PERL_OBJECT
-! #define NO_XSLOCKS
! #include "XSUB.h"
! #endif
!
#ifndef SIGILL
# define SIGILL 6 /* blech */
#endif
-#define ABORT() kill(getpid(),SIGABRT);
+#define ABORT() kill(PerlProc_getpid(),SIGABRT);
#define BIT_BUCKET "/dev/null"
#define PERL_SYS_INIT(c,v) MALLOC_INIT
perlmod.pod \
perlmodlib.pod \
perlmodinstall.pod \
+ perlfork.pod \
perlform.pod \
perllocale.pod \
perlref.pod \
perlcall.pod \
perlcompile.pod \
perltodo.pod \
+ perlhack.pod \
perlhist.pod \
perlfaq.pod \
perlfaq1.pod \
perlmod.man \
perlmodlib.man \
perlmodinstall.man \
+ perlfork.man \
perlform.man \
perllocale.man \
perlref.man \
perlcall.man \
perlcompile.man \
perltodo.man \
+ perlhack.man \
perlhist.man \
perlfaq.man \
perlfaq1.man \
perlmod.html \
perlmodlib.html \
perlmodinstall.html \
+ perlfork.html \
perlform.html \
perllocale.html \
perlref.html \
perlcall.html \
perlcompile.html \
perltodo.html \
+ perlhack.html \
perlhist.html \
perlfaq.html \
perlfaq1.html \
perlmod.tex \
perlmodlib.tex \
perlmodinstall.tex \
+ perlfork.tex \
perlform.tex \
perllocale.tex \
perlref.tex \
perlcall.tex \
perlcompile.tex \
perltodo.tex \
+ perlhack.tex \
perlhist.tex \
perlfaq.tex \
perlfaq1.tex \
=item Win32::CopyFile(FROM, TO, OVERWRITE)
-The Win32::CopyFile() function copies an existing file to a new file. All
-file information like creation time and file attributes will be copied to
-the new file. However it will B<not> copy the security information. If the
-destination file already exists it will only be overwritten when the
-OVERWRITE parameter is true. But even this will not overwrite a read-only
-file; you have to unlink() it first yourself.
+[CORE] The Win32::CopyFile() function copies an existing file to a new
+file. All file information like creation time and file attributes will
+be copied to the new file. However it will B<not> copy the security
+information. If the destination file already exists it will only be
+overwritten when the OVERWRITE parameter is true. But even this will
+not overwrite a read-only file; you have to unlink() it first
+yourself.
=item Win32::DomainName()
=item Win32::LookupAccountSID(SYSTEM, SID, ACCOUNT, DOMAIN, SIDTYPE)
-[EXT] ]Looks up SID on SYSTEM and returns the account name, domain name,
+[EXT] Looks up SID on SYSTEM and returns the account name, domain name,
and the SID type.
=item Win32::MsgBox(MESSAGE [, FLAGS [, TITLE]])
perl perlfaq perlfaq1 perlfaq2 perlfaq3 perlfaq4 perlfaq5
perlfaq6 perlfaq7 perlfaq8 perlfaq9 perldelta perldata
perlsyn perlop perlre perlrun perlfunc perlvar perlsub
- perlmod perlmodlib perlmodinstall perlform perllocale
+ perlmod perlmodlib perlmodinstall perlfork perlform perllocale
perlref perlreftut perldsc
perllol perltoot perltootc perlobj perltie perlbot perlipc
perldbmfilter perldebug
perltie Perl objects hidden behind simple variables
perlbot Perl OO tricks and examples
perlipc Perl interprocess communication
+ perlfork Perl fork() information
perlthrtut Perl threads tutorial
perldbmfilter Perl DBM Filters
perlcall Perl calling conventions from C
perltodo Perl things to do
+ perlhack Perl hackers guide
perlhist Perl history records
(If you're intending to read these straight through for the first time,
s2p sed to perl translator
http://www.perl.com/ the Perl Home Page
- http://www.perl.com/CPAN the Comphrehensive Perl Archive
+ http://www.perl.com/CPAN the Comprehensive Perl Archive
=head1 DIAGNOSTICS
=head1 HISTORY
-Written by Gurusamy Sarathy <F<gsar@umich.edu>>, with many contributions
+Written by Gurusamy Sarathy <F<gsar@activestate.com>>, with many contributions
from The Perl Porters.
Send omissions or corrections to <F<perlbug@perl.com>>.
=head1 AUTHOR
-Paul Marquess <F<pmarquess@bfsec.bt.co.uk>>
+Paul Marquess
Special thanks to the following people who assisted in the creation of
the document.
that function produces a new list which is a copy of the values,
so changing them doesn't change the original.
-As a special rule, if a list slice would produce a list consisting
-entirely of undefined values, the null list is produced instead.
+A slice of an empty list is still an empty list. Thus:
+
+ @a = ()[1,0]; # @a has no elements
+ @b = (@a)[0,1]; # @b has no elements
+ @b = (1,undef)[1,0,1]; # @b has three elements
+
This makes it easy to write loops that terminate when a null list
is returned:
=head1 NAME
-perldelta - what's new for perl v5.6 (as of v5.005_61)
+perldelta - what's new for perl v5.6 (as of v5.005_64)
=head1 DESCRIPTION
=head2 Perl Source Incompatibilities
-TODO
+Beware that any new warnings that have been added or old ones
+that have been enhanced are B<not> considered incompatible changes.
+
+Since all new warnings must be explicitly requested via the C<-w>
+switch or the C<warnings> pragma, it is ultimately the programmer's
+responsibility to ensure that warnings are enabled judiciously.
+
+=over 4
+
+=item STOP is a new keyword
+
+In addition to C<BEGIN>, C<INIT>, C<END>, C<DESTROY> and C<AUTOLOAD>,
+subroutines named C<STOP> are now special. These are queued up during
+compilation and behave similar to END blocks, except they are called at
+the end of compilation rather than at the end of execution. They cannot
+be called directly.
+
+=item Treatment of list slices of undef has changed
+
+When taking a slice of a literal list (as opposed to a slice of
+an array or hash), Perl used to return an empty list if the
+result happened to be composed of all undef values.
+
+The new behavior is to produce an empty list if (and only if)
+the original list was empty. Consider the following example:
+
+ @a = (1,undef,undef,2)[2,1,2];
+
+The old behavior would have resulted in @a having no elements.
+The new behavior ensures it has three undefined elements.
+
+Note in particular that the behavior of slices of the following
+cases remains unchanged:
+
+ @a = ()[1,2];
+ @a = (getpwent)[7,0];
+ @a = (anything_returning_empty_list())[2,1,2];
+ @a = @b[2,1,2];
+ @a = @c{'a','b','c'};
+
+See L<perldata>.
+
+=item Possibly changed pseudo-random number generator
+
+In 5.005_0x and earlier, perl's rand() function used the C library
+rand(3) function. As of 5.005_52, Configure tests for drand48(),
+random(), and rand() (in that order) and picks the first one it finds.
+Perl programs that depend on reproducing a specific set of pseudo-random
+numbers will now likely produce different output. You can use
+C<sh Configure -Drandfunc=rand> to obtain the old behavior.
+
+=item Hashing function for hash keys has changed
+
+Perl hashes are not order preserving. The apparently random order
+encountered when iterating on the contents of a hash is determined
+by the hashing algorithm used. To improve the distribution of lower
+bits in the hashed value, the algorithm has changed slightly as of
+5.005_52. When iterating over hashes, this may yield a random order
+that is B<different> from that of previous versions.
+
+=item C<undef> fails on read only values
+
+Using the C<undef> operator on a readonly value (such as $1) has
+the same effect as assigning C<undef> to the readonly value--it
+throws an exception.
+
+=item Close-on-exec bit may be set on pipe() handles
+
+On systems that support a close-on-exec flag on filehandles, the
+flag will be set for any handles created by pipe(), if that is
+warranted by the value of $^F that may be in effect. Earlier
+versions neglected to set the flag for handles created with
+pipe(). See L<perlfunc/pipe> and L<perlvar/$^F>.
+
+=item Writing C<"$$1"> to mean C<"${$}1"> is unsupported
+
+Perl 5.004 deprecated the interpretation of C<$$1> and
+similar within interpolated strings to mean C<$$ . "1">,
+but still allowed it.
+
+In Perl 5.6 and later, C<"$$1"> always means C<"${$1}">.
+
+=item delete(), values() and C<\(%h)> operate on aliases to values, not copies
+
+delete(), each(), values() and hashes in a list context return the actual
+values in the hash, instead of copies (as they used to in earlier
+versions). Typical idioms for using these constructs copy the
+returned values, but this can make a significant difference when
+creating references to the returned values.
+
+Keys in the hash are still returned as copies when iterating on
+a hash.
+
+=item vec(EXPR,OFFSET,BITS) enforces powers-of-two BITS
+
+vec() generates a run-time error if the BITS argument is not
+a valid power-of-two integer.
+
+=item Text of some diagnostic output has changed
+
+Most references to internal Perl operations in diagnostics
+have been changed to be more descriptive. This may be an
+issue for programs that may incorrectly rely on the exact
+text of diagnostics for proper functioning.
+
+=item C<%@> has been removed
+
+The undocumented special variable C<%@> that used to accumulate
+"background" errors (such as those that happen in DESTROY())
+has been removed, because it could potentially result in memory
+leaks.
+
+=item Parenthesized not() behaves like a list operator
+
+The C<not> operator now falls under the "if it looks like a function,
+it behaves like a function" rule.
+
+As a result, the parenthesized form can be used with C<grep> and C<map>.
+The following construct used to be a syntax error before, but it works
+as expected now:
+
+ grep not($_), @things;
+
+On the other hand, using C<not> with a literal list slice may not
+work. The following previously allowed construct:
+
+ print not (1,2,3)[0];
+
+needs to be written with additional parentheses now:
+
+ print not((1,2,3)[0]);
+
+The behavior remains unaffected when C<not> is not followed by parentheses.
+
+=back
=head2 C Source Incompatibilities
=item C<PERL_IMPLICIT_CONTEXT>
+PERL_IMPLICIT_CONTEXT is automatically enabled whenever Perl is built
+with one of -Dusethreads, -Dusemultiplicity, or both. It is not
+intended to be enabled by users at this time.
+
This new build option provides a set of macros for all API functions
such that an implicit interpreter/thread context argument is passed to
every API function. As a result of this, something like C<sv_setsv(foo,bar)>
Perl, whose interfaces continue to match those of prior versions
(but subject to the other options described here).
-PERL_IMPLICIT_CONTEXT is automatically enabled whenever Perl is built
-with one of -Dusethreads, -Dusemultiplicity, or both.
-
See L<perlguts/"The Perl API"> for detailed information on the
ramifications of building Perl using this option.
Note that these functions do B<not> constitute Perl's memory allocation API.
See L<perlguts/"Memory Allocation"> for further information about that.
-=item C<PL_na> and C<dTHR> Issues
-
-The C<PL_na> global is now thread local, so a C<dTHR> declaration is needed
-in the scope in which the global appears. XSUBs should handle this automatically,
-but if you have used C<PL_na> in support functions, you either need to
-change the C<PL_na> to a local variable (which is recommended), or put in
-a C<dTHR>.
-
=back
=head2 Compatible C Source API Changes
included (as required before), so there is no source incompatibility
from the change.
+=item Support for C++ exceptions
+
+change#3386, also needs perlguts documentation
+[TODO - Chip Salzenberg <chip@perlsupport.com>]
+
=back
=head2 Binary Incompatibilities
The usethreads or usemultiplicity builds are B<not> binary compatible
with the corresponding builds in 5.005.
+=head1 Installation and Configuration Improvements
+
+=head2 New Configure flags
+
+The following new flags may be enabled on the Configure command line
+by running Configure with C<-Dflag>.
+
+ usemultiplicity
+
+ uselongdouble
+ usemorebits
+ uselargefiles
+
+=head2 -Dusethreads and -Duse64bits now more daring
+
+The Configure options enabling the use of threads and the use of
+64-bitness are now more daring in the sense that they no more have
+an explicit list of operating systems of known threads/64-bit
+capabilities. In other words: if your operating system has the
+necessary APIs, you should be able just to go ahead and use them.
+See also L<"64-bit support">.
+
+=head2 Long Doubles
+
+Some platforms have "long doubles", floating point numbers of even
+larger range than ordinary "doubles". To enable using long doubles for
+Perl's scalars, use -Duselongdouble.
+
+=head2 -Dusemorebits
+
+You can enable both -Duse64bits and -Dlongdouble by -Dusemorebits.
+See also L<"64-bit support">.
+
+=head2 -Duselargefiles
+
+Some platforms support large files, files larger than two gigabytes.
+See L<"Large file support"> for more information.
+
+=head2 installusrbinperl
+
+You can use "Configure -Uinstallusrbinperl" which causes installperl
+to skip installing perl also as /usr/bin/perl. This is useful if you
+prefer not to modify /usr/bin for some reason or another but harmful
+because many scripts assume to find Perl in /usr/bin/perl.
+
+=head2 SOCKS support
+
+You can use "Configure -Dusesocks" which causes Perl to probe
+for the SOCKS (v5, not v4) proxy protocol library,
+http://www.socks.nec.com/
+
+=head2 C<-A> flag
+
+You can "post-edit" the Configure variables using the Configure C<-A>
+flag. The editing happens immediately after the platform specific
+hints files have been processed but before the actual configuration
+process starts. Run C<Configure -h> to find out the full C<-A> syntax.
+
+=head2 Enhanced Installation Directories
+
+The installation structure has been enriched to improve the support for
+maintaining multiple versions of perl, to provide locations for
+vendor-supplied modules and scripts, and to ease maintenance of
+locally-added modules and scripts. See the section on Installation
+Directories in the INSTALL file for complete details. For most users
+building and installing from source, the defaults should be fine.
+
=head1 Core Changes
=head2 Unicode and UTF-8 support
Perl can optionally use UTF-8 as its internal representation for character
-strings. The C<use utf8> pragma enables this support in the current lexical
+strings. The C<utf8> pragma enables this support in the current lexical
scope. See L<utf8> for more information.
+=head2 Interpreter threads
+
+WARNING: This is an experimental feature in a pre-alpha state. Use
+at your own risk.
+
+Perl 5.005_63 introduces the beginnings of support for running multiple
+interpreters concurrently in different threads. In conjunction with
+the perl_clone() API call, which can be used to selectively duplicate
+the state of any given interpreter, it is possible to compile a
+piece of code once in an interpreter, clone that interpreter
+one or more times, and run all the resulting interpreters in distinct
+threads.
+
+On Windows, this feature is used to emulate fork() at the interpreter
+level. See L<perlfork>.
+
+This feature is still in evolution. It is eventually meant to be used
+to selectively clone a subroutine and data reachable from that
+subroutine in a separate interpreter and run the cloned subroutine
+in a separate thread. Since there is no shared data between the
+interpreters, little or no locking will be needed (unless parts of
+the symbol table are explicitly shared). This is obviously intended
+to be an easy-to-use replacement for the existing threads support.
+
+Support for cloning interpreters must currently be manually enabled
+by defining the cpp macro USE_ITHREADS on non-Windows platforms.
+(See win32/Makefile for how to enable it on Windows.) The resulting
+perl executable will be functionally identical to one that was built
+without USE_ITHREADS, but the perl_clone() API call will only be
+available in the former.
+
+USE_ITHREADS enables Perl source code changes that provide a clear
+separation between the op tree and the data it operates with. The
+former is considered immutable, and can therefore be shared between
+an interpreter and all of its clones, while the latter is considered
+local to each interpreter, and is therefore copied for each clone.
+
+Note that building Perl with the -Dusemultiplicity Configure option
+is adequate if you wish to run multiple B<independent> interpreters
+concurrently in different threads. USE_ITHREADS only needs to be
+enabled if you wish to obtain access to perl_clone() and cloned
+interpreters.
+
+[XXX TODO - the Compiler backends may be broken when USE_ITHREADS is
+enabled.]
+
=head2 Lexically scoped warning categories
You can now control the granularity of warnings emitted by perl at a finer
level using the C<use warnings> pragma. See L<warnings> and L<perllexwarn>
for details.
+=head2 Lvalue subroutines
+
+WARNING: This is an experimental feature.
+
+change#4081
+[TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>,
+Tuomas Lukka <lukka@fas.harvard.edu>)]
+
+=head2 "our" declarations
+
+An "our" declaration introduces a value that can be best understood
+as a lexically scoped symbolic alias to a global variable in the
+current package. This is mostly useful as an alternative to the
+C<vars> pragma, but also provides the opportunity to introduce
+typing and other attributes for such variables. See L<perlfunc/our>.
+
+=head2 Weak references
+
+WARNING: This is an experimental feature.
+
+change#3385, also need perlguts documentation
+
+[TODO - Tuomas Lukka <lukka@fas.harvard.edu>]
+
+=head2 File globbing implemented internally
+
+WARNING: This is currently an experimental feature. Interfaces and
+implementation are likely to change.
+
+Perl now uses the File::Glob implementation of the glob() operator
+automatically. This avoids using an external csh process and the
+problems associated with it.
+
=head2 Binary numbers supported
Binary numbers are now supported as literals, in s?printf formats, and
$answer = 0b101010;
printf "The answer is: %b\n", oct("0b101010");
+=head2 Some arrows may be omitted in calls through references
+
+Perl now allows the arrow to be omitted in many constructs
+involving subroutine calls through references. For example,
+C<$foo[10]->('foo')> may now be written C<$foo[10]('foo')>.
+This is rather similar to how the arrow may be omitted from
+C<$foo[10]->{'foo'}>. Note however, that the arrow is still
+required for C<foo(10)->('bar')>.
+
+=head2 exists() and delete() are supported on array elements
+
+The exists() and delete() builtins now work on simple arrays as well.
+The behavior is similar to that on hash elements.
+
+exists() can be used to check whether an array element has been
+initialized without autovivifying it. If the array is tied, the
+EXISTS() method in the corresponding tied package will be invoked.
+
+delete() may be used to remove an element from the array and return
+it. The array element at that position returns to its unintialized
+state, so that testing for the same element with exists() will return
+false. If the element happens to be the one at the end, the size of
+the array also shrinks by one. If the array is tied, the DELETE() method
+in the corresponding tied package will be invoked.
+
+See L<perlfunc/exists> and L<perlfunc/delete> for examples.
+
=head2 syswrite() ease-of-use
-The length argument of C<syswrite()> is now optional.
+The length argument of C<syswrite()> has become optional.
+
+=head2 Filehandles can be autovivified
+
+Similar to how constructs such as C<$x->[0]> autovivify a reference,
+open() now autovivifies a filehandle if the first argument is an
+uninitialized variable. This allows the constructs C<open(my $fh, ...)> and
+C<open(local $fh,...)> to be used to create filehandles that will
+conveniently be closed automatically when the scope ends, provided there
+are no other references to them. This largely eliminates the need for
+typeglobs when opening filehandles that must be passed around, as in the
+following example:
+
+ sub myopen {
+ open my $fh, "@_"
+ or die "Can't open '@_': $!";
+ return $fh;
+ }
+
+ {
+ my $f = myopen("</etc/motd");
+ print <$f>;
+ # $f implicitly closed here
+ }
+
+[TODO - this idiom needs more pod penetration]
=head2 64-bit support
=over 4
-=item constants (decimal, hexadecimal, octal, binary) in the code
+=item *
+
+constants (decimal, hexadecimal, octal, binary) in the code
+
+=item *
+
+arguments to oct() and hex()
+
+=item *
+
+arguments to print(), printf() and sprintf() (flag prefixes ll, L, q)
+
+=item *
+
+printed as such
-=item arguments to oct() and hex()
+=item *
+
+pack() and unpack() "q" and "Q" formats
-=item arguments to print(), printf() and sprintf() (flag prefixes ll, L, q)
+=item *
-=item printed as such
+in basic arithmetics: + - * / %
-=item pack() and unpack() "q" and "Q" formats
+=item *
-=item in basic arithmetics: + - * / %
+vec() (but see the below note about bit arithmetics)
-=item vec() (but see the below note about bit arithmetics)
-
=back
Note that unless you have the case (a) you will have to configure
included with the standard Perl distribution) may also be of use, it
offers the getrlimit/setrlimit interface that can be used to adjust
process resource usage limits, including the maximum filesize limit.
-
+
=head2 Long doubles
In some systems you may be able to use long doubles to enhance the
You can Configure -Dusemorebits to turn on both the 64-bit support
and the long double support.
+=head2 Enhanced support for sort() subroutines
+
+Perl subroutines with a prototype of C<($$)> and XSUBs in general can
+now be used as sort subroutines. In either case, the two elements to
+be compared are passed as normal parameters in @_. See L<perlfunc/sort>.
+
+For unprototyped sort subroutines, the historical behavior of passing
+the elements to be compared as the global variables $a and $b remains
+unchanged.
+
=head2 Better syntax checks on parenthesized unary operators
Expressions such as:
=head2 pack() and unpack() support counted strings
-The template character '#' can be used to specify a counted string
+The template character '/' can be used to specify a counted string
type to be packed or unpacked. See L<perlfunc/"pack">.
+=head2 Comments in pack() templates
+
+The '#' character in a template introduces a comment up to
+end of the line. This facilitates documentation of pack()
+templates.
+
=head2 $^X variables may now have names longer than one character
Formerly, $^X was synonymous with ${"\cX"}, but $^XY was a syntax
F<AutoSplit.pm> and F<SelfLoader.pm> have been updated to keep the attributes
with the stubs they provide. See L<attributes>.
+=head2 Regular expression improvements
+
+change#2827,2373,2372,2365,1813,1800,4112,4158,4215,4301
+[TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
+
+=head2 Overloading improvements
+
+change#2150
+[TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
+
+=head2 open() with more than two arguments
+
+[TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
+
+=head2 Support for interpolating named characters
+
+change#4052
+[TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
+
+=head2 Experimental support for user-hooks in @INC
+
+[TODO - Ken Fox <kfox@ford.com>]
+
+=head2 C<require> and C<do> may be overridden
+
+C<require> and C<do 'file'> operations may be overridden locally
+by importing subroutines of the same name into the current package
+(or globally by importing them into the CORE::GLOBAL:: namespace).
+Overriding C<require> will also affect C<use>, provided the override
+is visible at compile-time.
+See L<perlsub/"Overriding Built-in Functions">.
+
+=head2 New variable $^C reflects C<-c> switch
+
+C<$^C> has a boolean value that reflects whether perl is being run
+in compile-only mode (i.e. via the C<-c> switch). Since
+BEGIN blocks are executed under such conditions, this variable
+enables perl code to determine whether actions that make sense
+only during normal running are warranted. See L<perlvar>.
+
+=head2 Optional Y2K warnings
+
+If Perl is built with the cpp macro C<PERL_Y2KWARN> defined,
+it emits optional warnings when concatenating the number 19
+with another number.
+
+This behavior must be specifically enabled when running Configure.
+See L<INSTALL> and L<README.Y2K>.
+
=head1 Significant bug fixes
=head2 E<lt>HANDLEE<gt> on empty files
the replacement expression in C<eval 's/.../.../e'>. This has
been fixed.
+=head2 All compilation errors are true errors
+
+Some "errors" encountered at compile time were by neccessity
+generated as warnings followed by eventual termination of the
+program. This enabled more such errors to be reported in a
+single run, rather than causing a hard stop at the first error
+that was encountered.
+
+The mechanism for reporting such errors has been reimplemented
+to queue compile-time errors and report them at the end of the
+compilation as true errors rather than as warnings. This fixes
+cases where error messages leaked through in the form of warnings
+when code was compiled at run time using C<eval STRING>, and
+also allows such errors to be reliably trapped using __DIE__ hooks.
+
=head2 Automatic flushing of output buffers
fork(), exec(), system(), qx//, and pipe open()s now flush buffers
were opened only for writing will now produce warnings (just as
writing to read-only filehandles does).
-=head2 Buffered data discarded from input filehandle when dup'ed.
+=head2 Where possible, buffered data discarded from duped input filehandle
+
+C<open(NEW, "E<lt>&OLD")> now attempts to discard any data that
+was previously read and buffered in C<OLD> before duping the handle.
+On platforms where doing this is allowed, the next read operation
+on C<NEW> will return the same data as the corresponding operation
+on C<OLD>. Formerly, it would have returned the data from the start
+of the following disk block instead.
+
+=head2 eof() has the same old magic as <>
+
+C<eof()> would return true if no attempt to read from C<E<lt>E<gt>> had
+yet been made. C<eof()> has been changed to have a little magic of its
+own, it now opens the C<E<lt>E<gt>> files.
+
+=head2 system(), backticks and pipe open now reflect exec() failure
+
+On Unix and similar platforms, system(), qx() and open(FOO, "cmd |")
+etc., are implemented via fork() and exec(). When the underlying
+exec() fails, earlier versions did not report the error properly,
+since the exec() happened to be in a different process.
+
+The child process now communicates with the parent about the
+error in launching the external command, which allows these
+constructs to return with their usual error value and set $!.
+
+=head2 Implicitly closed filehandles are safer
+
+Sometimes implicitly closed filehandles (as when they are localized,
+and Perl automatically closes them on exiting the scope) could
+inadvertently set $? or $!. This has been corrected.
+
+=head2 C<(\$)> prototype and C<$foo{a}>
+
+An scalar reference prototype now correctly allows a hash or
+array element in that slot.
+
+=head2 Pseudo-hashes work better
+
+Dereferencing some types of reference values in a pseudo-hash,
+such as C<$ph->{foo}[1]>, was accidentally disallowed. This has
+been corrected.
+
+When applied to a pseudo-hash element, exists() now reports whether
+the specified value exists, not merely if the key is valid.
+
+delete() now works on pseudo-hashes. When given a pseudo-hash element
+or slice it deletes the values corresponding to the keys (but not the keys
+themselves). See L<perlref/"Pseudo-hashes: Using an array as a hash">.
+
+=head2 C<goto &sub> and AUTOLOAD
+
+The C<goto &sub> construct works correctly when C<&sub> happens
+to be autoloaded.
+
+=head2 C<-bareword> allowed under C<use integer>
+
+The autoquoting of barewords preceded by C<-> did not work
+in prior versions when the C<integer> pragma was enabled.
+This has been fixed.
+
+=head2 Boolean assignment operators are legal lvalues
+
+Constructs such as C<($a ||= 2) += 1> are now allowed.
+
+=head2 C<sort $coderef @foo> allowed
+
+sort() did not accept a subroutine reference as the comparison
+function in earlier versions. This is now permitted.
+
+=head2 Failures in DESTROY()
+
+When code in a destructor threw an exception, it went unnoticed
+in earlier versions of Perl, unless someone happened to be
+looking in $@ just after the point the destructor happened to
+run. Such failures are now visible as warnings when warnings are
+enabled.
+
+=head2 Locale bugs fixed
+
+printf() and sprintf() previously reset the numeric locale
+back to the default "C" locale. This has been fixed.
+
+Numbers formatted according to the local numeric locale
+(such as using a decimal comma instead of a decimal dot) caused
+"isn't numeric" warnings, even while the operations accessing
+those numbers produced correct results. The warnings are gone.
+
+=head2 Memory leaks
+
+The C<eval 'return sub {...}'> construct could sometimes leak
+memory. This has been fixed.
+
+Operations that aren't filehandle constructors used to leak memory
+when used on invalid filehandles. This has been fixed.
+
+Constructs that modified C<@_> could fail to deallocate values
+in C<@_> and thus leak memory. This has been corrected.
+
+=head2 Spurious subroutine stubs after failed subroutine calls
+
+Perl could sometimes create empty subroutine stubs when a
+subroutine was not found in the package. Such cases stopped
+later method lookups from progressing into base packages.
+This has been corrected.
+
+=head2 Consistent numeric conversions
+
+change#3378,3318
+[TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
+
+=head2 Taint failures under C<-U>
+
+When running in unsafe mode, taint violations could sometimes
+cause silent failures. This has been fixed.
+
+=head2 END blocks and the C<-c> switch
+
+Prior versions used to run BEGIN B<and> END blocks when Perl was
+run in compile-only mode. Since this is typically not the expected
+behavior, END blocks are not executed anymore when the C<-c> switch
+is used.
+
+See L<STOP blocks> for how to run things when the compile phase ends.
+
+=head2 Potential to leak DATA filehandles
-C<open(NEW, "E<lt>&OLD")> now discards any data that was previously
-read and buffered in C<OLD>. The next read operation on C<NEW> will
-return the same data as the corresponding operation on C<OLD>.
-Formerly, it would have returned the data from the start of the
-following disk block instead.
+Using the C<__DATA__> token creates an implicit filehandle to
+the file that contains the token. It is the program's
+responsibility to close it when it is done reading from it.
-=head1 Supported Platforms
+This caveat is now better explained in the documentation.
+See L<perldata>.
+
+=head2 Diagnostics follow STDERR
+
+Diagnostic output now goes to whichever file the C<STDERR> handle
+is pointing at, instead of always going to the underlying C runtime
+library's C<stderr>.
+
+=head2 Other fixes for better diagnostics
+
+Line numbers are no longer suppressed (under most likely circumstances)
+during the global destruction phase.
+
+Diagnostics emitted from code running in threads other than the main
+thread are now accompanied by the thread ID.
+
+Embedded null characters in diagnostics now actually show up. They
+used to truncate the message in prior versions.
+
+$foo::a and $foo::b are now exempt from "possible typo" warnings only
+if sort() is encountered in package foo.
+
+Unrecognized alphabetic escapes encountered when parsing quote
+constructs now generate a warning, since they may take on new
+semantics in later versions of Perl.
+
+=head1 Performance enhancements
+
+=head2 Simple sort() using { $a <=> $b } and the like are optimized
+
+Many common sort() operations using a simple inlined block are now
+optimized for faster performance.
+
+=head2 Optimized assignments to lexical variables
+
+Certain operations in the RHS of assignment statements have been
+optimized to directly set the lexical variable on the LHS,
+eliminating redundant copying overheads.
+
+=head2 Method lookups optimized
+
+[TODO - Chip Salzenberg <chip@perlsupport.com>]
+
+=head2 Faster mechanism to invoke XSUBs
+
+change#4044,4125
+[TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
+
+=head2 Perl_malloc() improvements
+
+change#4237
+[TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
+
+=head2 Faster subroutine calls
+
+Minor changes in how subroutine calls are handled internally
+provide marginal improvements in performance.
+
+=head1 Platform specific changes
+
+=head2 Additional supported platforms
=over 4
=back
+=head2 DOS
+
+=over 4
+
+=item *
+
+Perl now works with djgpp 2.02 (and 2.03 alpha).
+
+=item *
+
+Environment variable names are not converted to uppercase any more.
+
+=item *
+
+Wrong exit code from backticks now fixed.
+
+=item *
+
+This port is still using its own builtin globbing.
+
+=back
+
+=head2 OS/2
+
+[TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
+
+=head2 VMS
+
+[TODO - Charles Bailey <bailey@newman.upenn.edu>]
+
+=head2 Win32
+
+Site library searches failed to look for ".../site/5.XXX/lib"
+if ".../site/5.XXXYY/lib" wasn't found. This has been corrected.
+
+When given a pathname that consists only of a drivename, such
+as C<A:>, opendir() and stat() now use the current working
+directory for the drive rather than the drive root.
+
+The builtin XSUB functions in the Win32:: namespace are
+documented. See L<Win32>.
+
+$^X now contains the full path name of the running executable.
+
+A Win32::GetLongPathName() function is provided to complement
+Win32::GetFullPathName() and Win32::GetShortPathName(). See L<Win32>.
+
+POSIX::uname() is supported.
+
+system(1,...) now returns true process IDs rather than process
+handles. kill() accepts any real process id, rather than strictly
+return values from system(1,...).
+
+The C<Shell> module is supported.
+
+Rudimentary support for building under command.com in Windows 95
+has been added.
+
+Scripts are read in binary mode by default to allow ByteLoader (and
+the filter mechanism in general) to work properly. For compatibility,
+the DATA filehandle will be set to text mode if a carriage return is
+detected at the end of the line containing the __END__ or __DATA__
+token; if not, the DATA filehandle will be left open in binary mode.
+Earlier versions always opened the DATA filehandle in text mode.
+
+[TODO - GSAR]
+
=head1 New tests
=over 4
provides a way to fetch subroutine and variable attributes.
See L<attributes>.
-=item ByteLoader
-
-The ByteLoader is a dedication extension to generate and run
-Perl bytecode. See L<ByteLoader>.
-
=item B
The Perl Compiler suite has been extensively reworked for this
release.
-=item Devel::DProf
+[TODO - Vishal Bhatia <vishal@gol.com>,
+Nick Ing-Simmons <nick@ni-s.u-net.com>]
-Devel::DProf, a Perl source code profiler has been added.
+=item ByteLoader
-=item Dumpvalue
+The ByteLoader is a dedicated extension to generate and run
+Perl bytecode. See L<ByteLoader>.
-Added Dumpvalue module provides screen dumps of Perl data.
+=item constant
+
+References can now be used.
+
+The new version also allows a leading underscore in constant names, but
+disallows a double leading underscore (as in "__LINE__"). Some other names
+are disallowed or warned against, including BEGIN, END, etc. Some names
+which were forced into main:: used to fail silently in some cases; now they're
+fatal (outside of main::) and an optional warning (inside of main::).
+The ability to detect whether a constant had been set with a given name has
+been added.
+
+See L<constant>.
+
+=item charnames
+
+change#4052
+[TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
+
+=item Data::Dumper
+
+A C<Maxdepth> setting can be specified to avoid venturing
+too deeply into deep data structures. See L<Data::Dumper>.
+
+Dumping C<qr//> objects works correctly.
+
+=item DB
+
+C<DB> is an experimental module that exposes a clean abstraction
+to Perl's debugging API.
+
+=item DB_File
+
+DB_File can now be built with Berkeley DB versions 1, 2 or 3.
+See C<ext/DB_File/Changes>.
+
+=item Devel::DProf
+
+Devel::DProf, a Perl source code profiler has been added. See
+L<Devel::DProf> and L<dprofpp>.
+
+=item Dumpvalue
+
+The Dumpvalue module provides screen dumps of Perl data.
=item Benchmark
+Overall, Benchmark results exhibit lower average error and better timing
+accuracy.
+
You can now run tests for I<n> seconds instead of guessing the right
number of tests to run: e.g. timethese(-5, ...) will run each
code for at least 5 CPU seconds. Zero as the "number of repetitions"
means "for at least 3 CPU seconds". The output format has also
changed. For example:
-use Benchmark;$x=3;timethese(-5,{a=>sub{$x*$x},b=>sub{$x**2}})
+ use Benchmark;$x=3;timethese(-5,{a=>sub{$x*$x},b=>sub{$x**2}})
will now output something like this:
-Benchmark: running a, b, each for at least 5 CPU seconds...
- a: 5 wallclock secs ( 5.77 usr + 0.00 sys = 5.77 CPU) @ 200551.91/s (n=1156516)
- b: 4 wallclock secs ( 5.00 usr + 0.02 sys = 5.02 CPU) @ 159605.18/s (n=800686)
+ Benchmark: running a, b, each for at least 5 CPU seconds...
+ a: 5 wallclock secs ( 5.77 usr + 0.00 sys = 5.77 CPU) @ 200551.91/s (n=1156516)
+ b: 4 wallclock secs ( 5.00 usr + 0.02 sys = 5.02 CPU) @ 159605.18/s (n=800686)
New features: "each for at least N CPU seconds...", "wallclock secs",
and the "@ operations/CPU second (n=operations)".
+timethese() now returns a reference to a hash of Benchmark objects containing
+the test results, keyed on the names of the tests.
+
+timethis() now returns the iterations field in the Benchmark result object
+instead of 0.
+
+timethese(), timethis(), and the new cmpthese() (see below) can also take
+a format specifier of 'none' to suppress output.
+
+A new function countit() is just like timeit() except that it takes a
+TIME instead of a COUNT.
+
+A new function cmpthese() prints a chart comparing the results of each test
+returned from a timethese() call. For each possible pair of tests, the
+percentage speed difference (iters/sec or seconds/iter) is shown.
+
+For other details, see L<Benchmark>.
+
=item Devel::Peek
The Devel::Peek module provides access to the internal representation
of Perl variables and data. It is a data debugging tool for the XS programmer.
+=item ExtUtils::MakeMaker
+
+change#4135, also needs docs in module pod
+[TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
+
=item Fcntl
More Fcntl constants added: F_SETLK64, F_SETLKW64, O_LARGEFILE for
locking behaviour flags F_FLOCK, F_POSIX, Linux F_SHLCK, and
O_ACCMODE: the mask of O_RDONLY, O_WRONLY, and O_RDWR.
+=item File::Compare
+
+A compare_text() function has been added, which allows custom
+comparison functions. See L<File::Compare>.
+
+=item File::Find
+
+File::Find now works correctly when the wanted() function is either
+autoloaded or is a symbolic reference.
+
+A bug that caused File::Find to lose track of the working directory
+when pruning top-level directories has been fixed.
+
+File::Find now also supports several other options to control its
+behavior. It can follow symbolic links if the C<follow> option is
+specified. Enabling the C<no_chdir> option will make File::Find skip
+changing the current directory when walking directories. The C<untaint>
+flag can be useful when running with taint checks enabled.
+
+See L<File::Find>.
+
+=item File::Glob
+
+This extension implements BSD-style file globbing. By default,
+it will also be used for the internal implementation of the glob()
+operator. See L<File::Glob>.
+
=item File::Spec
New methods have been added to the File::Spec module: devnull() returns
$fullname = File::Spec->catfile($dir1, $dir2, $file);
+=item Getopt::Long
+
+Getopt::Long licensing has changed to allow the Perl Artistic License
+as well as the GPL. It used to be GPL only, which got in the way of
+non-GPL applications that wanted to use Getopt::Long.
+
+Getopt::Long encourages the use of Pod::Usage to produce help
+messages. For example:
+
+ use Getopt::Long;
+ use Pod::Usage;
+ my $man = 0;
+ my $help = 0;
+ GetOptions('help|?' => \$help, man => \$man) or pod2usage(2);
+ pod2usage(1) if $help;
+ pod2usage(-exitstatus => 0, -verbose => 2) if $man;
+
+ __END__
+
+ =head1 NAME
+
+ sample - Using GetOpt::Long and Pod::Usage
+
+ =head1 SYNOPSIS
+
+ sample [options] [file ...]
+
+ Options:
+ -help brief help message
+ -man full documentation
+
+ =head1 OPTIONS
+
+ =over 8
+
+ =item B<-help>
+
+ Print a brief help message and exits.
+
+ =item B<-man>
+
+ Prints the manual page and exits.
+
+ =back
+
+ =head1 DESCRIPTION
+
+ B<This program> will read the given input file(s) and do someting
+ useful with the contents thereof.
+
+ =cut
+
+See L<Pod::Usage> for details.
+
+A bug that prevented the non-option call-back E<lt>E<gt> from being
+specified as the first argument has been fixed.
+
+To specify the characters E<lt> and E<gt> as option starters, use
+E<gt>E<lt>. Note, however, that changing option starters is strongly
+deprecated.
+
+=item IO
+
+write() and syswrite() will now accept a single-argument
+form of the call, for consistency with Perl's syswrite().
+
+You can now create a TCP-based IO::Socket::INET without forcing
+a connect attempt. This allows you to configure its options
+(like making it non-blocking) and then call connect() manually.
+
+A bug that prevented the IO::Socket::protocol() accessor
+from ever returning the correct value has been corrected.
+
+=item JPL
+
+Java Perl Lingo is now distributed with Perl. See jpl/README
+for more information.
+
+=item lib
+
+C<use lib> now weeds out any trailing duplicate entries.
+C<no lib> removes all named entries.
+
=item Math::BigInt
-The logical operations C<E<lt>E<lt>>, C<E<gt>E<gt>>, C<&>, C<|>,
+The bitwise operations C<E<lt>E<lt>>, C<E<gt>E<gt>>, C<&>, C<|>,
and C<~> are now supported on bigints.
=item Math::Complex
A little bit of radial trigonometry (cylindrical and spherical),
radial coordinate conversions, and the great circle distance were added.
+=item Pod::Parser
+
+[TODO - Brad Appleton <bradapp@enteract.com>]
+
+=item Pod::Text and Pod::Man
+
+[TODO - Russ Allbery <rra@stanford.edu>]
+
=item SDBM_File
An EXISTS method has been added to this module (and sdbm_exists() has
on an SDBM_File tied hash and get the correct result, rather than a
runtime error.
+A bug that may have caused data loss when more than one disk block
+happens to be read from the database in a single FETCH() has been
+fixed.
+
=item Time::Local
The timelocal() and timegm() functions used to silently return bogus
-results when the date exceeded the machine's integer range. They
-now consistently croak() if the date falls in an unsupported range--
-but on the other hand they now accept "out-of-limits" day-of-month
-to make "Julian date" conversions easier.
+results when the date fell outside the machine's integer range. They
+now consistently croak() if the date falls in an unsupported range.
=item Win32
The new Win32::GetFullPathName(FILENAME) returns the full absolute
pathname for FILENAME in scalar context. In list context it returns
a two-element list containing the fully qualified directory name and
-the filename.
+the filename. See L<Win32>.
=item DBM Filters
=head2 Pragmata
-C<use attrs> is now obsolescent, and is only provided for
+C<use attrs> is now obsolete, and is only provided for
backward-compatibility. It's been replaced by the C<sub : attributes>
syntax. See L<perlsub/"Subroutine Attributes"> and L<attributes>.
attribute.
Lexical warnings pragma, C<use warnings;>, to control optional warnings.
+See L<perllexwarn>.
-C<use filetest> to control the behaviour of filetests (C<-r> C<-w> ...).
-Currently only one subpragma implemented, "use filetest 'access';",
-that enables the use of access(2) or equivalent to check
-permissions instead of using stat(2) as usual. This matters
-in filesystems where there are ACLs (access control lists): the
-stat(2) might lie, but access(2) knows better.
+C<use filetest> to control the behaviour of filetests (C<-r> C<-w>
+...). Currently only one subpragma implemented, "use filetest
+'access';", that uses access(2) or equivalent to check permissions
+instead of using stat(2) as usual. This matters in filesystems
+where there are ACLs (access control lists): the stat(2) might lie,
+but access(2) knows better.
=head1 Utility Changes
-Todo.
+=head2 h2ph
+
+[TODO - Kurt Starsinic <kstar@chapin.edu>]
+
+=head2 perlcc
+
+C<perlcc> now supports the C and Bytecode backends. By default,
+it generates output from the simple C backend rather than the
+optimized C backend.
+
+Support for non-Unix platforms has been improved.
+
+=head2 h2xs
+
+change#4232
+[TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
=head1 Documentation Changes
=over 4
+=item perlcompile.pod
+
+An introduction to using the Perl Compiler suite.
+
+=item perlfilter.pod
+
+An introduction to writing Perl source filters.
+
+=item perlhack.pod
+
+Some guidelines for hacking the Perl source code.
+
=item perlopentut.pod
A tutorial on using open() effectively.
=back
-=head1 New Diagnostics
+=head1 New or Changed Diagnostics
+
+=over 4
=item "my sub" not yet implemented
(F) Lexically scoped subroutines are not yet implemented. Don't try that
yet.
+=item '!' allowed only after types %s
+
+(F) The '!' is allowed in pack() and unpack() only after certain types.
+See L<perlfunc/pack>.
+
+=item / cannot take a count
+
+(F) You had an unpack template indicating a counted-length string,
+but you have also specified an explicit size for the string.
+See L<perlfunc/pack>.
+
+=item / must be followed by a, A or Z
+
+(F) You had an unpack template indicating a counted-length string,
+which must be followed by one of the letters a, A or Z
+to indicate what sort of string is to be unpacked.
+See L<perlfunc/pack>.
+
+=item / must be followed by a*, A* or Z*
+
+(F) You had a pack template indicating a counted-length string,
+Currently the only things that can have their length counted are a*, A* or Z*.
+See L<perlfunc/pack>.
+
+=item / must follow a numeric type
+
+(F) You had an unpack template that contained a '#',
+but this did not follow some numeric unpack specification.
+See L<perlfunc/pack>.
+
+=item /%s/: Unrecognized escape \\%c passed through
+
+(W) You used a backslash-character combination which is not recognized
+by Perl. This combination appears in an interpolated variable or a
+C<'>-delimited regular expression. The character was understood literally.
+
+=item /%s/: Unrecognized escape \\%c in character class passed through
+
+(W) You used a backslash-character combination which is not recognized
+by Perl inside character classes. The character was understood literally.
+
+=item /%s/ should probably be written as "%s"
+
+(W) You have used a pattern where Perl expected to find a string,
+as in the first argument to C<join>. Perl will treat the true
+or false result of matching the pattern against $_ as the string,
+which is probably not what you had in mind.
+
+=item %s() called too early to check prototype
+
+(W) You've called a function that has a prototype before the parser saw a
+definition or declaration for it, and Perl could not check that the call
+conforms to the prototype. You need to either add an early prototype
+declaration for the subroutine in question, or move the subroutine
+definition ahead of the call to get proper prototype checking. Alternatively,
+if you are certain that you're calling the function correctly, you may put
+an ampersand before the name to avoid the warning. See L<perlsub>.
+
=item %s package attribute may clash with future reserved word: %s
(W) A lowercase attribute name was used that had a package-specific handler.
doesn't yet. Perhaps you should use a mixed-case attribute name, instead.
See L<attributes>.
-=item /%s/: Unrecognized escape \\%c passed through
+=item (in cleanup) %s
-(W) You used a backslash-character combination which is not recognized
-by Perl. This combination appears in an interpolated variable or a
-C<'>-delimited regular expression.
+(W) This prefix usually indicates that a DESTROY() method raised
+the indicated exception. Since destructors are usually called by
+the system at arbitrary points during execution, and often a vast
+number of times, the warning is issued only once for any number
+of failures that would otherwise result in the same message being
+repeated.
+
+Failure of user callbacks dispatched using the C<G_KEEPERR> flag
+could also result in this warning. See L<perlcall/G_KEEPERR>.
+
+=item <> should be quotes
+
+(F) You wrote C<require E<lt>fileE<gt>> when you should have written
+C<require 'file'>.
+
+=item Attempt to join self
+
+(F) You tried to join a thread from within itself, which is an
+impossible task. You may be joining the wrong thread, or you may
+need to move the join() to some other thread.
+
+=item Bad evalled substitution pattern
+
+(F) You've used the /e switch to evaluate the replacement for a
+substitution, but perl found a syntax error in the code to evaluate,
+most likely an unexpected right brace '}'.
+
+=item Bad realloc() ignored
+
+(S) An internal routine called realloc() on something that had never been
+malloc()ed in the first place. Mandatory, but can be disabled by
+setting environment variable C<PERL_BADFREE> to 1.
+
+=item Binary number > 0b11111111111111111111111111111111 non-portable
+
+(W) The binary number you specified is larger than 2**32-1
+(4294967295) and therefore non-portable between systems. See
+L<perlport> for more on portability concerns.
+
+=item Bit vector size > 32 non-portable
+
+(W) Using bit vector sizes larger than 32 is non-portable.
+
+=item Buffer overflow in prime_env_iter: %s
+
+(W) A warning peculiar to VMS. While Perl was preparing to iterate over
+%ENV, it encountered a logical name or symbol definition which was too long,
+so it was truncated to the string shown.
+
+=item Can't check filesystem of script "%s"
+
+(P) For some reason you can't check the filesystem of the script for nosuid.
+
+=item Can't ignore signal CHLD, forcing to default
+
+(W) Perl has detected that it is being run with the SIGCHLD signal
+(sometimes known as SIGCLD) disabled. Since disabling this signal
+will interfere with proper determination of exit status of child
+processes, Perl has reset the signal to its default value.
+This situation typically indicates that the parent program under
+which Perl may be running (e.g. cron) is being very careless.
+
+=item Can't modify non-lvalue subroutine call
+
+(F) Subroutines meant to be used in lvalue context should be declared as
+such, see L<perlsub/"Lvalue subroutines">.
+
+=item Can't read CRTL environ
+
+(S) A warning peculiar to VMS. Perl tried to read an element of %ENV
+from the CRTL's internal environment array and discovered the array was
+missing. You need to figure out where your CRTL misplaced its environ
+or define F<PERL_ENV_TABLES> (see L<perlvms>) so that environ is not searched.
+
+=item Can't remove %s: %s, skipping file
+
+(S) You requested an inplace edit without creating a backup file. Perl
+was unable to remove the original file to replace it with the modified
+file. The file was left unmodified.
+
+=item Can't return %s from lvalue subroutine
+
+(F) Perl detected an attempt to return illegal lvalues (such
+as temporary or readonly values) from a subroutine used as an lvalue.
+This is not allowed.
+
+=item Can't weaken a nonreference
+
+(F) You attempted to weaken something that was not a reference. Only
+references can be weakened.
+
+=item Character class [:%s:] unknown
+
+(F) The class in the character class [: :] syntax is unknown.
+See L<perlre>.
+
+=item Character class syntax [%s] belongs inside character classes
+
+(W) The character class constructs [: :], [= =], and [. .] go
+I<inside> character classes, the [] are part of the construct,
+for example: /[012[:alpha:]345]/. Note that [= =] and [. .]
+are not currently implemented; they are simply placeholders for
+future extensions.
+
+=item Constant is not %s reference
+
+(F) A constant value (perhaps declared using the C<use constant> pragma)
+is being dereferenced, but it amounts to the wrong type of reference. The
+message indicates the type of reference that was expected. This usually
+indicates a syntax error in dereferencing the constant value.
+See L<perlsub/"Constant Functions"> and L<constant>.
+
+=item constant(%s): %%^H is not localized
+
+(F) When setting compile-time-lexicalized hash %^H one should set the
+corresponding bit of $^H as well.
+
+=item constant(%s): %s
+
+(F) Compile-time-substitutions (such as overloaded constants and
+character names) were not correctly set up.
+
+=item defined(@array) is deprecated
+
+(D) defined() is not usually useful on arrays because it checks for an
+undefined I<scalar> value. If you want to see if the array is empty,
+just use C<if (@array) { # not empty }> for example.
+
+=item defined(%hash) is deprecated
+
+(D) defined() is not usually useful on hashes because it checks for an
+undefined I<scalar> value. If you want to see if the hash is empty,
+just use C<if (%hash) { # not empty }> for example.
+
+=item Did not produce a valid header
+
+See Server error.
+
+=item Document contains no data
+
+See Server error.
+
+=item entering effective %s failed
+
+(F) While under the C<use filetest> pragma, switching the real and
+effective uids or gids failed.
+
+=item false [] range "%s" in regexp
+
+(W) A character class range must start and end at a literal character, not
+another character class like C<\d> or C<[:alpha:]>. The "-" in your false
+range is interpreted as a literal "-". Consider quoting the "-", "\-".
+See L<perlre>.
=item Filehandle %s opened only for output
(W) You tried to read from a filehandle opened only for writing. If you
-intended it to be a read-write filehandle, you needed to open it with
+intended it to be a read/write filehandle, you needed to open it with
"+E<lt>" or "+E<gt>" or "+E<gt>E<gt>" instead of with "E<lt>" or nothing. If
you intended only to read from the file, use "E<lt>". See
L<perlfunc/open>.
+=item Hexadecimal number > 0xffffffff non-portable
+
+(W) The hexadecimal number you specified is larger than 2**32-1
+(4294967295) and therefore non-portable between systems. See
+L<perlport> for more on portability concerns.
+
+=item Ill-formed CRTL environ value "%s"
+
+(W) A warning peculiar to VMS. Perl tried to read the CRTL's internal
+environ array, and encountered an element without the C<=> delimiter
+used to spearate keys from values. The element is ignored.
+
+=item Ill-formed message in prime_env_iter: |%s|
+
+(W) A warning peculiar to VMS. Perl tried to read a logical name
+or CLI symbol definition when preparing to iterate over %ENV, and
+didn't see the expected delimiter between key and value, so the
+line was ignored.
+
+=item Illegal binary digit %s
+
+(F) You used a digit other than 0 or 1 in a binary number.
+
+=item Illegal binary digit %s ignored
+
+(W) You may have tried to use a digit other than 0 or 1 in a binary number.
+Interpretation of the binary number stopped before the offending digit.
+
+=item Illegal number of bits in vec
+
+(F) The number of bits in vec() (the third argument) must be a power of
+two from 1 to 32 (or 64, if your platform supports that).
+
+=item Integer overflow in %s number
+
+(W) The hexadecimal, octal or binary number you have specified either
+as a literal or as an argument to hex() or oct() is too big for your
+architecture, and has been converted to a floating point number. On a
+32-bit architecture the largest hexadecimal, octal or binary number
+representable without overflow is 0xFFFFFFFF, 037777777777, or
+0b11111111111111111111111111111111 respectively. Note that Perl
+transparently promotes all numbers to a floating point representation
+internally--subject to loss of precision errors in subsequent
+operations.
+
=item Invalid %s attribute: %s
The indicated attribute for a subroutine or variable was not recognized
The indicated attributes for a subroutine or variable were not recognized
by Perl or by a user-supplied handler. See L<attributes>.
+=item invalid [] range "%s" in regexp
+
+The offending range is now explicitly displayed.
+
=item Invalid separator character %s in attribute list
(F) Something other than a comma or whitespace was seen between the
had a parenthesised parameter list, perhaps that list was terminated
too soon. See L<attributes>.
+=item Invalid separator character %s in subroutine attribute list
+
+(F) Something other than a comma or whitespace was seen between the
+elements of a subroutine attribute list. If the previous attribute
+had a parenthesised parameter list, perhaps that list was terminated
+too soon.
+
+=item leaving effective %s failed
+
+(F) While under the C<use filetest> pragma, switching the real and
+effective uids or gids failed.
+
+=item Lvalue subs returning %s not implemented yet
+
+(F) Due to limitations in the current implementation, array and hash
+values cannot be returned in subroutines used in lvalue context.
+See L<perlsub/"Lvalue subroutines">.
+
+=item Method %s not permitted
+
+See Server error.
+
+=item Missing %sbrace%s on \N{}
+
+(F) Wrong syntax of character name literal C<\N{charname}> within
+double-quotish context.
+
=item Missing command in piped open
(W) You used the C<open(FH, "| command")> or C<open(FH, "command |")>
(F) The reserved syntax for lexically scoped subroutines requires that they
have a name with which they can be found.
+=item no UTC offset information; assuming local time is UTC
+
+(S) A warning peculiar to VMS. Perl was unable to find the local
+timezone offset, so it's assuming that local system time is equivalent
+to UTC. If it's not, define the logical name F<SYS$TIMEZONE_DIFFERENTIAL>
+to translate to the number of seconds which need to be added to UTC to
+get local time.
+
+=item Octal number > 037777777777 non-portable
+
+(W) The octal number you specified is larger than 2**32-1 (4294967295)
+and therefore non-portable between systems. See L<perlport> for more
+on portability concerns.
+
+See also L<perlport> for writing portable code.
+
+=item panic: del_backref
+
+(P) Failed an internal consistency check while trying to reset a weak
+reference.
+
+=item panic: kid popen errno read
+
+(F) forked child returned an incomprehensible message about its errno.
+
+=item panic: magic_killbackrefs
+
+(P) Failed an internal consistency check while trying to reset all weak
+references to an object.
+
+=item Possible Y2K bug: %s
+
+(W) You are concatenating the number 19 with another number, which
+could be a potential Year 2000 problem.
+
+=item Premature end of script headers
+
+See Server error.
+
+=item Repeat count in pack overflows
+
+(F) You can't specify a repeat count so large that it overflows
+your signed integers. See L<perlfunc/pack>.
+
+=item Repeat count in unpack overflows
+
+(F) You can't specify a repeat count so large that it overflows
+your signed integers. See L<perlfunc/unpack>.
+
+=item realloc() of freed memory ignored
+
+(S) An internal routine called realloc() on something that had already
+been freed.
+
+=item Reference is already weak
+
+(W) You have attempted to weaken a reference that is already weak.
+Doing so has no effect.
+
+=item setpgrp can't take arguments
+
+(F) Your system has the setpgrp() from BSD 4.2, which takes no arguments,
+unlike POSIX setpgid(), which takes a process ID and process group ID.
+
+=item Strange *+?{} on zero-length expression
+
+(W) You applied a regular expression quantifier in a place where it
+makes no sense, such as on a zero-width assertion.
+Try putting the quantifier inside the assertion instead. For example,
+the way to match "abc" provided that it is followed by three
+repetitions of "xyz" is C</abc(?=(?:xyz){3})/>, not C</abc(?=xyz){3}/>.
+
+=item switching effective %s is not implemented
+
+(F) While under the C<use filetest> pragma, we cannot switch the
+real and effective uids or gids.
+
+=item This Perl can't reset CRTL environ elements (%s)
+
+=item This Perl can't set CRTL environ elements (%s=%s)
+
+(W) Warnings peculiar to VMS. You tried to change or delete an element
+of the CRTL's internal environ array, but your copy of Perl wasn't
+built with a CRTL that contained the setenv() function. You'll need to
+rebuild Perl with a CRTL that does, or redefine F<PERL_ENV_TABLES> (see
+L<perlvms>) so that the environ array isn't the target of the change to
+%ENV which produced the warning.
+
+=item Unknown open() mode '%s'
+
+(F) The second argument of 3-argument open() is not among the list
+of valid modes: C<L<lt>>, C<L<gt>>, C<E<gt>E<gt>>, C<+L<lt>>,
+C<+L<gt>>, C<+E<gt>E<gt>>, C<-|>, C<|->.
+
+=item Unknown process %x sent message to prime_env_iter: %s
+
+(P) An error peculiar to VMS. Perl was reading values for %ENV before
+iterating over it, and someone else stuck a message in the stream of
+data Perl expected. Someone's very confused, or perhaps trying to
+subvert Perl's population of %ENV for nefarious purposes.
+
=item Unrecognized escape \\%c passed through
(W) You used a backslash-character combination which is not recognized
-by Perl.
+by Perl. The character was understood literally.
=item Unterminated attribute parameter in attribute list
block. Perhaps you terminated the parameter list of the previous attribute
too soon. See L<attributes>.
-=item defined(@array) is deprecated
-
-(D) defined() is not usually useful on arrays because it checks for an
-undefined I<scalar> value. If you want to see if the array is empty,
-just use C<if (@array) { # not empty }> for example.
-
-=item defined(%hash) is deprecated
-
-(D) defined() is not usually useful on hashes because it checks for an
-undefined I<scalar> value. If you want to see if the hash is empty,
-just use C<if (%hash) { # not empty }> for example.
-
-=item Invalid separator character %s in subroutine attribute list
-
-(F) Something other than a comma or whitespace was seen between the
-elements of a subroutine attribute list. If the previous attribute
-had a parenthesised parameter list, perhaps that list was terminated
-too soon.
-
-=item Possible Y2K bug: %s
-
-(W) You are concatenating the number 19 with another number, which
-could be a potential Year 2000 problem.
-
=item Unterminated attribute parameter in subroutine attribute list
(F) The lexer saw an opening (left) parenthesis character while parsing a
block. Perhaps you terminated the parameter list of the previous attribute
too soon.
-=item /%s/ should probably be written as "%s"
+=item Value of CLI symbol "%s" too long
-(W) You have used a pattern where Perl expected to find a string,
-like in the first argument to C<join>. Perl will treat the true
-or false result of matching the pattern against $_ as the string,
-which is probably not what you had in mind.
+(W) A warning peculiar to VMS. Perl tried to read the value of an %ENV
+element from a CLI symbol table, and found a resultant string longer
+than 1024 characters. The return value has been truncated to 1024
+characters.
+
+=item Version number must be a constant number
+
+(P) The attempt to translate a C<use Module n.n LIST> statement into
+its equivalent C<BEGIN> block found an internal inconsistency with
+the version number.
+
+=back
=head1 Obsolete Diagnostics
-Todo.
+=over 4
-=head1 Configuration Changes
+=item Character class syntax [: :] is reserved for future extensions
-=head2 installusrbinperl
+(W) Within regular expression character classes ([]) the syntax beginning
+with "[:" and ending with ":]" is reserved for future extensions.
+If you need to represent those character sequences inside a regular
+expression character class, just quote the square brackets with the
+backslash: "\[:" and ":\]".
-You can use "Configure -Uinstallusrbinperl" which causes installperl
-to skip installing perl also as /usr/bin/perl. This is useful if you
-prefer not to modify /usr/bin for some reason or another but harmful
-because many scripts assume to find Perl in /usr/bin/perl.
+=item Ill-formed logical name |%s| in prime_env_iter
-=head2 SOCKS support
+(W) A warning peculiar to VMS. A logical name was encountered when preparing
+to iterate over %ENV which violates the syntactic rules governing logical
+names. Because it cannot be translated normally, it is skipped, and will not
+appear in %ENV. This may be a benign occurrence, as some software packages
+might directly modify logical name tables and introduce nonstandard names,
+or it may indicate that a logical name table has been corrupted.
-You can use "Configure -Dusesocks" which causes Perl to probe
-for the SOCKS proxy protocol library, http://www.socks.nec.com/
+=item regexp too big
-=head2 -A flag
+(F) The current implementation of regular expressions uses shorts as
+address offsets within a string. Unfortunately this means that if
+the regular expression compiles to longer than 32767, it'll blow up.
+Usually when you want a regular expression this big, there is a better
+way to do it with multiple statements. See L<perlre>.
-You can "post-edit" the Configure variables using the Configure -A
-flag. The editing happens immediately after the platform specific
-hints files have been processed but before the actual configuration
-process starts. Run Configure -h to find out the full -A syntax.
+=item Use of "$$<digit>" to mean "${$}<digit>" is deprecated
+
+(D) Perl versions before 5.004 misinterpreted any type marker followed
+by "$" and a digit. For example, "$$0" was incorrectly taken to mean
+"${$}0" instead of "${$0}". This bug is (mostly) fixed in Perl 5.004.
+
+However, the developers of Perl 5.004 could not fix this bug completely,
+because at least two widely-used modules depend on the old meaning of
+"$$0" in a string. So Perl 5.004 still interprets "$$<digit>" in the
+old (broken) way inside strings; but it generates this message as a
+warning. And in Perl 5.005, this special treatment will cease.
+
+=back
=head1 BUGS
-If you find what you think is a bug, you might check the headers of
+If you find what you think is a bug, you might check the
articles recently posted to the comp.lang.perl.misc newsgroup.
There may also be information at http://www.perl.com/perl/, the Perl
Home Page.
=head1 HISTORY
-Written by Gurusamy Sarathy <F<gsar@umich.edu>>, with many contributions
-from The Perl Porters.
+Written by Gurusamy Sarathy <F<gsar@activestate.com>>, with many
+contributions from The Perl Porters.
Send omissions or corrections to <F<perlbug@perl.com>>.
=item / must be followed by a*, A* or Z*
-(F) You had an pack template indicating a counted-length string,
+(F) You had a pack template indicating a counted-length string,
Currently the only things that can have their length counted are a*, A* or Z*.
See L<perlfunc/pack>.
(W) You used a backslash-character combination which is not recognized
by Perl. This combination appears in an interpolated variable or a
-C<'>-delimited regular expression.
+C<'>-delimited regular expression. The character was understood literally.
+
+=item /%s/: Unrecognized escape \\%c in character class passed through
+
+(W) You used a backslash-character combination which is not recognized
+by Perl inside character classes. The character was understood literally.
=item /%s/ should probably be written as "%s"
(W) You have used a pattern where Perl expected to find a string,
-like in the first argument to C<join>. Perl will treat the true
+as in the first argument to C<join>. Perl will treat the true
or false result of matching the pattern against $_ as the string,
which is probably not what you had in mind.
if you are certain that you're calling the function correctly, you may put
an ampersand before the name to avoid the warning. See L<perlsub>.
-=item %s argument is not a HASH element
+=item %s argument is not a HASH or ARRAY element
-(F) The argument to exists() must be a hash element, such as
+(F) The argument to exists() must be a hash or array element, such as:
$foo{$bar}
- $ref->[12]->{"susie"}
+ $ref->[12]->["susie"]
-=item %s argument is not a HASH element or slice
+=item %s argument is not a HASH or ARRAY element or slice
-(F) The argument to delete() must be either a hash element, such as
+(F) The argument to delete() must be either a hash or array element, such as:
$foo{$bar}
- $ref->[12]->{"susie"}
+ $ref->[12]->["susie"]
-or a hash slice, such as
+or a hash or array slice, such as:
- @foo{$bar, $baz, $xyzzy}
+ @foo[$bar, $baz, $xyzzy]
@{$ref->[12]}{"susie", "queue"}
=item %s did not return a true value
(F) You wrote C<require E<lt>fileE<gt>> when you should have written
C<require 'file'>.
-=item accept() on closed fd
+=item accept() on closed socket
(W) You tried to do an accept on a closed socket. Did you forget to check
the return value of your socket() call? See L<perlfunc/accept>.
(4294967295) and therefore non-portable between systems. See
L<perlport> for more on portability concerns.
-=item bind() on closed fd
+=item bind() on closed socket
(W) You tried to do a bind on a closed socket. Did you forget to check
the return value of your socket() call? See L<perlfunc/bind>.
(F) A subroutine invoked from an external package via perl_call_sv()
exited by calling exit.
-=item Can't "goto" outside a block
+=item Can't "goto" out of a pseudo block
(F) A "goto" statement was executed to jump out of what might look
like a block, except that it isn't a proper block. This usually
(F) A "goto" statement was executed to jump into the middle of a
foreach loop. You can't get there from here. See L<perlfunc/goto>.
-=item Can't "last" outside a block
+=item Can't "last" outside a loop block
(F) A "last" statement was executed to break out of the current block,
except that there's this itty bitty problem called there isn't a
current block. Note that an "if" or "else" block doesn't count as a
-"loopish" block, as doesn't a block given to sort(). You can usually double
-the curlies to get the same effect though, because the inner curlies
-will be considered a block that loops once. See L<perlfunc/last>.
+"loopish" block, as doesn't a block given to sort(), map() or grep().
+You can usually double the curlies to get the same effect though,
+because the inner curlies will be considered a block that loops once.
+See L<perlfunc/last>.
-=item Can't "next" outside a block
+=item Can't "next" outside a loop block
(F) A "next" statement was executed to reiterate the current block, but
there isn't a current block. Note that an "if" or "else" block doesn't
-count as a "loopish" block, as doesn't a block given to sort(). You can
-usually double the curlies to get the same effect though, because the inner
-curlies will be considered a block that loops once. See L<perlfunc/next>.
+count as a "loopish" block, as doesn't a block given to sort(), map()
+or grep(). You can usually double the curlies to get the same effect
+though, because the inner curlies will be considered a block that
+loops once. See L<perlfunc/next>.
=item Can't read CRTL environ
missing. You need to figure out where your CRTL misplaced its environ
or define F<PERL_ENV_TABLES> (see L<perlvms>) so that environ is not searched.
-=item Can't "redo" outside a block
+=item Can't "redo" outside a loop block
(F) A "redo" statement was executed to restart the current block, but
there isn't a current block. Note that an "if" or "else" block doesn't
-count as a "loopish" block, as doesn't a block given to sort(). You can
-usually double the curlies to get the same effect though, because the inner
-curlies will be considered a block that loops once. See L<perlfunc/redo>.
+count as a "loopish" block, as doesn't a block given to sort(), map()
+or grep(). You can usually double the curlies to get the same effect
+though, because the inner curlies will be considered a block that
+loops once. See L<perlfunc/redo>.
=item Can't bless non-reference value
(F) You called C<perl -x/foo/bar>, but C</foo/bar> is not a directory
that you can chdir to, possibly because it doesn't exist.
-=item Can't check filesystem of script "%s"
+=item Can't check filesystem of script "%s" for nosuid
(P) For some reason you can't check the filesystem of the script for nosuid.
(F) The "goto subroutine" call can't be used to jump out of an eval "string".
(You can use it to jump out of an eval {BLOCK}, but you probably don't want to.)
+=item Can't ignore signal CHLD, forcing to default
+
+(W) Perl has detected that it is being run with the SIGCHLD signal
+(sometimes known as SIGCLD) disabled. Since disabling this signal
+will interfere with proper determination of exit status of child
+processes, Perl has reset the signal to its default value.
+This situation typically indicates that the parent program under
+which Perl may be running (e.g. cron) is being very careless.
+
=item Can't localize through a reference
(F) You said something like C<local $$ref>, which Perl can't currently
=item Can't modify non-lvalue subroutine call
-(F) Subroutines used in lvalue context should be marked as such, see
-L<perlsub/"Lvalue subroutines">.
+(F) Subroutines meant to be used in lvalue context should be declared as
+such, see L<perlsub/"Lvalue subroutines">.
=item Can't modify nonexistent substring
reference of the type needed. You can use the ref() function to
test the type of the reference, if need be.
-=item Can't use \1 to mean $1 in expression
+=item Can't use \%c to mean $%c in expression
(W) In an ordinary expression, backslash is a unary operator that creates
a reference to its argument. The use of backslash to indicate a backreference
Trying to do this in ordinary Perl code produces a value that prints
out looking like SCALAR(0xdecaf). Use the $1 form instead.
-=item Can't use bareword ("%s") as %s ref while \"strict refs\" in use
+=item Can't use bareword ("%s") as %s ref while "strict refs" in use
(F) Only hard references are allowed by "strict refs". Symbolic references
are disallowed. See L<perlref>.
=item Character class [:%s:] unknown
(F) The class in the character class [: :] syntax is unknown.
+See L<perlre>.
=item Character class syntax [%s] belongs inside character classes
(W) The character class constructs [: :], [= =], and [. .] go
I<inside> character classes, the [] are part of the construct,
-for example: /[012[:alpha:]345]/. Note that the last two constructs
-are not currently implemented, they are placeholders for future extensions.
+for example: /[012[:alpha:]345]/. Note that [= =] and [. .]
+are not currently implemented; they are simply placeholders for
+future extensions.
=item Character class syntax [. .] is reserved for future extensions
expression so that it is simpler or backtracks less. (See L<perlbook>
for information on I<Mastering Regular Expressions>.)
-=item connect() on closed fd
+=item connect() on closed socket
(W) You tried to do a connect on a closed socket. Did you forget to check
the return value of your socket() call? See L<perlfunc/connect>.
named "elseif" for the class returned by the following block. This is
unlikely to be what you want.
-=item END failed--cleanup aborted
+=item %s failed--call queue aborted
-(F) An untrapped exception was raised while executing an END subroutine.
-The interpreter is immediately exited.
+(F) An untrapped exception was raised while executing a STOP, INIT, or
+END subroutine. Processing of the remainder of the queue of such
+routines has been prematurely ended.
=item entering effective %s failed
usually not what you want. Consider providing a default target
package, e.g. bless($ref, $p || 'MyPackage');
+=item false [] range "%s" in regexp
+
+(W) A character class range must start and end at a literal character, not
+another character class like C<\d> or C<[:alpha:]>. The "-" in your false
+range is interpreted as a literal "-". Consider quoting the "-", "\-".
+See L<perlre>.
+
=item Fatal VMS error at %s, line %d
(P) An error peculiar to VMS. Something untoward happened in a VMS system
=item Filehandle %s opened only for output
(W) You tried to read from a filehandle opened only for writing. If you
-intended it to be a read-write filehandle, you needed to open it with
+intended it to be a read/write filehandle, you needed to open it with
"+E<lt>" or "+E<gt>" or "+E<gt>E<gt>" instead of with "E<lt>" or nothing. If
you intended only to read from the file, use "E<lt>". See
L<perlfunc/open>.
because if it did, it'd feel morally obligated to return every hostname
on the Internet.
-=item get{sock,peer}name() on closed fd
+=item get%sname() on closed socket
(W) You tried to get a socket or peer socket name on a closed socket.
Did you forget to check the return value of your socket() call?
=item Illegal binary digit %s
-(F) You used a digit other than 0 and 1 in a binary number.
+(F) You used a digit other than 0 or 1 in a binary number.
=item Illegal octal digit %s
=item Integer overflow in %s number
(W) The hexadecimal, octal or binary number you have specified either
-as a literal in your code or as a scalar is too big for your
+as a literal or as an argument to hex() or oct() is too big for your
architecture, and has been converted to a floating point number. On a
32-bit architecture the largest hexadecimal, octal or binary number
representable without overflow is 0xFFFFFFFF, 037777777777, or
The indicated attributes for a subroutine or variable were not recognized
by Perl or by a user-supplied handler. See L<attributes>.
-=item invalid [] range in regexp
+=item invalid [] range "%s" in regexp
(F) The range specified in a character class had a minimum character
-greater than the maximum character, or the range didn't start/end with
-a literal character. See L<perlre>.
+greater than the maximum character. See L<perlre>.
=item Invalid conversion in %s: "%s"
(F) While under the C<use filetest> pragma, switching the real and
effective uids or gids failed.
-=item listen() on closed fd
+=item listen() on closed socket
(W) You tried to do a listen on a closed socket. Did you forget to check
the return value of your socket() call? See L<perlfunc/listen>.
(F) A setuid script can't be specified by the user.
+=item No %s specified for -%c
+
+(F) The indicated command line switch needs a mandatory argument, but
+you haven't specified one.
+
=item No comma allowed after %s
(F) A list operator that has a filehandle or "indirect object" is not
(F) Configure didn't find anything resembling the setreuid() call for
your system.
-=item No space allowed after B<-I>
+=item No space allowed after -%c
-(F) The argument to B<-I> must follow the B<-I> immediately with no
-intervening space.
+(F) The argument to the indicated command line switch must follow immediately
+after the switch, without intervening spaces.
-=item No such array field
+=item No such pseudo-hash field "%s"
(F) You tried to access an array as a hash, but the field name used is
not defined. The hash at index 0 should map all valid field names to
array indices for that to work.
-=item No such field "%s" in variable %s of type %s
+=item No such pseudo-hash field "%s" in variable %s of type %s
(F) You tried to access a field of a typed variable where the type
does not know about the field name. The field names are looked up in
For example, if you say "*foo *foo" it will be interpreted as
if you said "*foo * 'foo'".
+=item Out of memory!
+
+(X) The malloc() function returned 0, indicating there was insufficient
+remaining memory (or virtual memory) to satisfy the request. Perl
+has no option but to exit immediately.
+
=item Out of memory for yacc stack
(F) The yacc parser wanted to grow its stack so it could continue parsing,
(P) The lexer got into a bad state while processing a case modifier.
+=item panic: %s
+
+(P) An internal error.
+
=item Parentheses missing around "%s" list
(W) You said something like
=item POSIX getpgrp can't take an argument
-(F) Your C compiler uses POSIX getpgrp(), which takes no argument, unlike
+(F) Your system has POSIX getpgrp(), which takes no argument, unlike
the BSD version, which takes a pid.
=item Possible Y2K bug: %s
See Server error.
-=item print on closed filehandle %s
+=item print() on closed filehandle %s
(W) The filehandle you're printing on got itself closed sometime before now.
Check your logic flow.
-=item printf on closed filehandle %s
+=item printf() on closed filehandle %s
(W) The filehandle you're writing to got itself closed sometime before now.
Check your logic flow.
One possible workaround is to force Perl to use magical string
increment by prepending "0" to your numbers.
-=item Read on closed filehandle %s
+=item readline() on closed filehandle %s
(W) The filehandle you're reading from got itself closed sometime before now.
Check your logic flow.
(W) A nearby syntax error was probably caused by a missing semicolon,
or possibly some other missing operator, such as a comma.
-=item Send on closed socket
+=item send() on closed socket
-(W) The filehandle you're sending to got itself closed sometime before now.
+(W) The socket you're sending to got itself closed sometime before now.
Check your logic flow.
=item Sequence (? incomplete
the seteuid() system call (or equivalent), or at least Configure didn't
think so.
+=item setpgrp can't take arguments
+
+(F) Your system has the setpgrp() from BSD 4.2, which takes no arguments,
+unlike POSIX setpgid(), which takes a process ID and process group ID.
+
=item setrgid() not implemented
(F) You tried to assign to C<$(>, and your operating system doesn't support
(F) You don't have System V shared memory IPC on your system.
-=item shutdown() on closed fd
+=item shutdown() on closed socket
(W) You tried to do a shutdown on a closed socket. Seems a bit superfluous.
machine. In some machines the functionality can exist but be
unconfigured. Consult your system support.
-=item Syswrite on closed filehandle
+=item syswrite() on closed filehandle
(W) The filehandle you're writing to got itself closed sometime before now.
Check your logic flow.
if the last stat that wrote to the stat buffer already went past
the symlink to get to the real file. Use an actual filename instead.
-=item This Perl can't reset CRTL eviron elements (%s)
+=item This Perl can't reset CRTL environ elements (%s)
=item This Perl can't set CRTL environ elements (%s=%s)
=item Unknown open() mode '%s'
-(F) The second argument of 3-arguments open is not one from the list
-of C<L<lt>>, C<L<gt>>, C<E<gt>E<gt>>, C<+L<lt>>, C<+L<gt>>,
-C<+E<gt>E<gt>>, C<-|>, C<|-> of possible open() modes.
+(F) The second argument of 3-argument open() is not among the list
+of valid modes: C<L<lt>>, C<L<gt>>, C<E<gt>E<gt>>, C<+L<lt>>,
+C<+L<gt>>, C<+E<gt>E<gt>>, C<-|>, C<|->.
=item Unknown process %x sent message to prime_env_iter: %s
because there's a better way to do it, and also because the old way has
bad side effects.
-=item Use of uninitialized value
+=item Use of uninitialized value%s
(W) An undefined value was used as if it were already defined. It was
interpreted as a "" or a 0, but maybe it was a mistake. To suppress this
So put in parentheses to say what you really mean.
-=item Write on closed filehandle %s
+=item write() on closed filehandle %s
(W) The filehandle you're writing to got itself closed sometime before now.
Check your logic flow.
will try to call the subroutine when the assignment is executed, which is
probably not what you want. (If it IS what you want, put an & in front.)
-=item [gs]etsockopt() on closed fd
+=item %cetsockopt() on closed fd
(W) You tried to get or set a socket option on a closed socket.
Did you forget to check the return value of your socket() call?
-See L<perlfunc/getsockopt>.
+See L<perlfunc/getsockopt> and L<perlfunc/setsockopt>.
=item \1 better written as $1
=head1 NAME
-perlfaq2 - Obtaining and Learning about Perl ($Revision: 1.31 $, $Date: 1999/04/14 03:46:19 $)
+perlfaq2 - Obtaining and Learning about Perl ($Revision: 1.32 $, $Date: 1999/10/14 18:46:09 $)
=head1 DESCRIPTION
Most of the major modules (Tk, CGI, libwww-perl) have their own
mailing lists. Consult the documentation that came with the module for
-subscription information. The Perl Institute attempts to maintain a
+subscription information. Perl Mongers attempts to maintain a
list of mailing lists at:
- http://www.perl.org/maillist.html
+ http://www.perl.org/support/online_support.html#mail
=head2 Archives of comp.lang.perl.misc
Read the perlbug(1) man page (perl5.004 or later) for more information.
-=head2 What is perl.com?
+=head2 What is perl.com? Perl Mongers? pm.org? perl.org?
The perl.com domain is owned by Tom Christiansen, who created it as a
public service long before perl.org came about. Despite the name, it's a
http://conference.perl.com/
http://reference.perl.com/
+Perl Mongers is an advocacy organization for the Perl language. For
+details, see the Perl Mongers web site at http://www.perlmongers.org/.
+
+Perl Mongers uses the pm.org domain for services related to Perl user
+groups. See the Perl user group web site at http://www.pm.org/ for more
+information about joining, starting, or requesting services for a Perl
+user group.
+
+Perl Mongers also maintains the perl.org domain to provide general
+support services to the Perl community, including the hosting of mailing
+lists, web sites, and other services. The web site
+http://www.perl.org/ is a general advocacy site for the Perl language,
+and there are many other sub-domains for special topics, such as
+
+ http://history.perl.org/
+ http://bugs.perl.org/
+ http://www.news.perl.org/
+
=head1 AUTHOR AND COPYRIGHT
Copyright (c) 1997-1999 Tom Christiansen and Nathan Torkington.
will modify the Registry to associate the C<.pl> extension with the
perl interpreter. If you install another port, perhaps even building
your own Win95/NT Perl from the standard sources by using a Windows port
-of gcc (e.g., with cygwin32 or mingw32), then you'll have to modify
+of gcc (e.g., with cygwin or mingw32), then you'll have to modify
the Registry yourself. In addition to associating C<.pl> with the
interpreter, NT people can use: C<SET PATHEXT=%PATHEXT%;.PL> to let them
run the program C<install-linux.pl> merely by typing C<install-linux>.
}
}
- sub is_numeric { defined &getnum }
+ sub is_numeric { defined getnum($_[0]) }
Or you could check out
http://www.perl.com/CPAN/modules/by-module/String/String-Scanf-1.1.tar.gz
=head2 How do I timeout a slow event?
Use the alarm() function, probably in conjunction with a signal
-handler, as documented L<perlipc/"Signals"> and chapter 6 of the
+handler, as documented in L<perlipc/"Signals"> and chapter 6 of the
Camel. You may instead use the more flexible Sys::AlarmCall module
available from CPAN.
=head2 How do I remove HTML from a string?
The most correct way (albeit not the fastest) is to use HTML::Parser
-from CPAN (part of the HTML-Tree package on CPAN).
+from CPAN (part of the HTML-Tree package on CPAN). Another correct
+way is to use HTML::FormatText which not only removes HTML but also
+attempts to do a little simple formatting of the resulting plain text.
Many folks attempt a simple-minded regular expression approach, like
C<s/E<lt>.*?E<gt>//g>, but that fails in many cases because the tags
--- /dev/null
+=head1 NAME
+
+perlfilter - Source Filters
+
+
+=head1 DESCRIPTION
+
+This article is about a little-known feature of Perl called
+I<source filters>. Source filters alter the program text of a module
+before Perl sees it, much as a C preprocessor alters the source text of
+a C program before the compiler sees it. This article tells you more
+about what source filters are, how they work, and how to write your
+own.
+
+The original purpose of source filters was to let you encrypt your
+program source to prevent casual piracy. This isn't all they can do, as
+you'll soon learn. But first, the basics.
+
+=head1 CONCEPTS
+
+Before the Perl interpreter can execute a Perl script, it must first
+read it from a file into memory for parsing and compilation. (Even
+scripts specified on the command line with the C<-e> option are stored in
+a temporary file for the parser to process.) If that script itself
+includes other scripts with a C<use> or C<require> statement, then each
+of those scripts will have to be read from their respective files as
+well.
+
+Now think of each logical connection between the Perl parser and an
+individual file as a I<source stream>. A source stream is created when
+the Perl parser opens a file, it continues to exist as the source code
+is read into memory, and it is destroyed when Perl is finished parsing
+the file. If the parser encounters a C<require> or C<use> statement in
+a source stream, a new and distinct stream is created just for that
+file.
+
+The diagram below represents a single source stream, with the flow of
+source from a Perl script file on the left into the Perl parser on the
+right. This is how Perl normally operates.
+
+ file -------> parser
+
+There are two important points to remember:
+
+=over 5
+
+=item 1.
+
+Although there can be any number of source streams in existence at any
+given time, only one will be active.
+
+=item 2.
+
+Every source stream is associated with only one file.
+
+=back
+
+A source filter is a special kind of Perl module that intercepts and
+modifies a source stream before it reaches the parser. A source filter
+changes our diagram like this:
+
+ file ----> filter ----> parser
+
+If that doesn't make much sense, consider the analogy of a command
+pipeline. Say you have a shell script stored in the compressed file
+I<trial.gz>. The simple pipeline command below runs the script without
+needing to create a temporary file to hold the uncompressed file.
+
+ gunzip -c trial.gz | sh
+
+In this case, the data flow from the pipeline can be represented as follows:
+
+ trial.gz ----> gunzip ----> sh
+
+With source filters, you can store the text of your script compressed and use a source filter to uncompress it for Perl's parser:
+
+ compressed gunzip
+ Perl program ---> source filter ---> parser
+
+=head1 USING FILTERS
+
+So how do you use a source filter in a Perl script? Above, I said that
+a source filter is just a special kind of module. Like all Perl
+modules, a source filter is invoked with a use statement.
+
+Say you want to pass your Perl source through the C preprocessor before
+execution. You could use the existing C<-P> command line option to do
+this, but as it happens, the source filters distribution comes with a C
+preprocessor filter module called Filter::cpp. Let's use that instead.
+
+Below is an example program, C<cpp_test>, which makes use of this filter.
+Line numbers have been added to allow specific lines to be referenced
+easily.
+
+ 1: use Filter::cpp ;
+ 2: #define TRUE 1
+ 3: $a = TRUE ;
+ 4: print "a = $a\n" ;
+
+When you execute this script, Perl creates a source stream for the
+file. Before the parser processes any of the lines from the file, the
+source stream looks like this:
+
+ cpp_test ---------> parser
+
+Line 1, C<use Filter::cpp>, includes and installs the C<cpp> filter
+module. All source filters work this way. The use statement is compiled
+and executed at compile time, before any more of the file is read, and
+it attaches the cpp filter to the source stream behind the scenes. Now
+the data flow looks like this:
+
+ cpp_test ----> cpp filter ----> parser
+
+As the parser reads the second and subsequent lines from the source
+stream, it feeds those lines through the C<cpp> source filter before
+processing them. The C<cpp> filter simply passes each line through the
+real C preprocessor. The output from the C preprocessor is then
+inserted back into the source stream by the filter.
+
+ .-> cpp --.
+ | |
+ | |
+ | <-'
+ cpp_test ----> cpp filter ----> parser
+
+The parser then sees the following code:
+
+ use Filter::cpp ;
+ $a = 1 ;
+ print "a = $a\n" ;
+
+Let's consider what happens when the filtered code includes another
+module with use:
+
+ 1: use Filter::cpp ;
+ 2: #define TRUE 1
+ 3: use Fred ;
+ 4: $a = TRUE ;
+ 5: print "a = $a\n" ;
+
+The C<cpp> filter does not apply to the text of the Fred module, only
+to the text of the file that used it (C<cpp_test>). Although the use
+statement on line 3 will pass through the cpp filter, the module that
+gets included (C<Fred>) will not. The source streams look like this
+after line 3 has been parsed and before line 4 is parsed:
+
+ cpp_test ---> cpp filter ---> parser (INACTIVE)
+
+ Fred.pm ----> parser
+
+As you can see, a new stream has been created for reading the source
+from C<Fred.pm>. This stream will remain active until all of C<Fred.pm>
+has been parsed. The source stream for C<cpp_test> will still exist,
+but is inactive. Once the parser has finished reading Fred.pm, the
+source stream associated with it will be destroyed. The source stream
+for C<cpp_test> then becomes active again and the parser reads line 4
+and subsequent lines from C<cpp_test>.
+
+You can use more than one source filter on a single file. Similarly,
+you can reuse the same filter in as many files as you like.
+
+For example, if you have a uuencoded and compressed source file, it is
+possible to stack a uudecode filter and an uncompression filter like
+this:
+
+ use Filter::uudecode ; use Filter::uncompress ;
+ M'XL(".H<US4''V9I;F%L')Q;>7/;1I;_>_I3=&E=%:F*I"T?22Q/
+ M6]9*<IQCO*XFT"0[PL%%'Y+IG?WN^ZYN-$'J.[.JE$,20/?K=_[>
+ ...
+
+Once the first line has been processed, the flow will look like this:
+
+ file ---> uudecode ---> uncompress ---> parser
+ filter filter
+
+Data flows through filters in the same order they appear in the source
+file. The uudecode filter appeared before the uncompress filter, so the
+source file will be uudecoded before it's uncompressed.
+
+=head1 WRITING A SOURCE FILTER
+
+There are three ways to write your own source filter. You can write it
+in C, use an external program as a filter, or write the filter in Perl.
+I won't cover the first two in any great detail, so I'll get them out
+of the way first. Writing the filter in Perl is most convenient, so
+I'll devote the most space to it.
+
+=head1 WRITING A SOURCE FILTER IN C
+
+The first of the three available techniques is to write the filter
+completely in C. The external module you create interfaces directly
+with the source filter hooks provided by Perl.
+
+The advantage of this technique is that you have complete control over
+the implementation of your filter. The big disadvantage is the
+increased complexity required to write the filter - not only do you
+need to understand the source filter hooks, but you also need a
+reasonable knowledge of Perl guts. One of the few times it is worth
+going to this trouble is when writing a source scrambler. The
+C<decrypt> filter (which unscrambles the source before Perl parses it)
+included with the source filter distribution is an example of a C
+source filter (see Decryption Filters, below).
+
+
+=over 5
+
+=item B<Decryption Filters>
+
+All decryption filters work on the principle of "security through
+obscurity." Regardless of how well you write a decryption filter and
+how strong your encryption algorithm, anyone determined enough can
+retrieve the original source code. The reason is quite simple - once
+the decryption filter has decrypted the source back to its original
+form, fragments of it will be stored in the computer's memory as Perl
+parses it. The source might only be in memory for a short period of
+time, but anyone possessing a debugger, skill, and lots of patience can
+eventually reconstruct your program.
+
+That said, there are a number of steps that can be taken to make life
+difficult for the potential cracker. The most important: Write your
+decryption filter in C and statically link the decryption module into
+the Perl binary. For further tips to make life difficult for the
+potential cracker, see the file I<decrypt.pm> in the source filters
+module.
+
+=back
+
+=head1 CREATING A SOURCE FILTER AS A SEPARATE EXECUTABLE
+
+An alternative to writing the filter in C is to create a separate
+executable in the language of your choice. The separate executable
+reads from standard input, does whatever processing is necessary, and
+writes the filtered data to standard output. C<Filter:cpp> is an
+example of a source filter implemented as a separate executable - the
+executable is the C preprocessor bundled with your C compiler.
+
+The source filter distribution includes two modules that simplify this
+task: C<Filter::exec> and C<Filter::sh>. Both allow you to run any
+external executable. Both use a coprocess to control the flow of data
+into and out of the external executable. (For details on coprocesses,
+see Stephens, W.R. "Advanced Programming in the UNIX Environment."
+Addison-Wesley, ISBN 0-210-56317-7, pages 441-445.) The difference
+between them is that C<Filter::exec> spawns the external command
+directly, while C<Filter::sh> spawns a shell to execute the external
+command. (Unix uses the Bourne shell; NT uses the cmd shell.) Spawning
+a shell allows you to make use of the shell metacharacters and
+redirection facilities.
+
+Here is an example script that uses C<Filter::sh>:
+
+ use Filter::sh 'tr XYZ PQR' ;
+ $a = 1 ;
+ print "XYZ a = $a\n" ;
+
+The output you'll get when the script is executed:
+
+ PQR a = 1
+
+Writing a source filter as a separate executable works fine, but a
+small performance penalty is incurred. For example, if you execute the
+small example above, a separate subprocess will be created to run the
+Unix C<tr> command. Each use of the filter requires its own subprocess.
+If creating subprocesses is expensive on your system, you might want to
+consider one of the other options for creating source filters.
+
+=head1 WRITING A SOURCE FILTER IN PERL
+
+The easiest and most portable option available for creating your own
+source filter is to write it completely in Perl. To distinguish this
+from the previous two techniques, I'll call it a Perl source filter.
+
+To help understand how to write a Perl source filter we need an example
+to study. Here is a complete source filter that performs rot13
+decoding. (Rot13 is a very simple encryption scheme used in Usenet
+postings to hide the contents of offensive posts. It moves every letter
+forward thirteen places, so that A becomes N, B becomes O, and Z
+becomes M.)
+
+
+ package Rot13 ;
+
+ use Filter::Util::Call ;
+
+ sub import {
+ my ($type) = @_ ;
+ my ($ref) = [] ;
+ filter_add(bless $ref) ;
+ }
+
+ sub filter {
+ my ($self) = @_ ;
+ my ($status) ;
+
+ tr/n-za-mN-ZA-M/a-zA-Z/
+ if ($status = filter_read()) > 0 ;
+ $status ;
+ }
+
+ 1;
+
+All Perl source filters are implemented as Perl classes and have the
+same basic structure as the example above.
+
+First, we include the C<Filter::Util::Call> module, which exports a
+number of functions into your filter's namespace. The filter shown
+above uses two of these functions, C<filter_add()> and
+C<filter_read()>.
+
+Next, we create the filter object and associate it with the source
+stream by defining the C<import> function. If you know Perl well
+enough, you know that C<import> is called automatically every time a
+module is included with a use statement. This makes C<import> the ideal
+place to both create and install a filter object.
+
+In the example filter, the object (C<$ref>) is blessed just like any
+other Perl object. Our example uses an anonymous array, but this isn't
+a requirement. Because this example doesn't need to store any context
+information, we could have used a scalar or hash reference just as
+well. The next section demonstrates context data.
+
+The association between the filter object and the source stream is made
+with the C<filter_add()> function. This takes a filter object as a
+parameter (C<$ref> in this case) and installs it in the source stream.
+
+Finally, there is the code that actually does the filtering. For this
+type of Perl source filter, all the filtering is done in a method
+called C<filter()>. (It is also possible to write a Perl source filter
+using a closure. See the C<Filter::Util::Call> manual page for more
+details.) It's called every time the Perl parser needs another line of
+source to process. The C<filter()> method, in turn, reads lines from
+the source stream using the C<filter_read()> function.
+
+If a line was available from the source stream, C<filter_read()>
+returns a status value greater than zero and appends the line to C<$_>.
+A status value of zero indicates end-of-file, less than zero means an
+error. The filter function itself is expected to return its status in
+the same way, and put the filtered line it wants written to the source
+stream in C<$_>. The use of C<$_> accounts for the brevity of most Perl
+source filters.
+
+In order to make use of the rot13 filter we need some way of encoding
+the source file in rot13 format. The script below, C<mkrot13>, does
+just that.
+
+ die "usage mkrot13 filename\n" unless @ARGV ;
+ my $in = $ARGV[0] ;
+ my $out = "$in.tmp" ;
+ open(IN, "<$in") or die "Cannot open file $in: $!\n";
+ open(OUT, ">$out") or die "Cannot open file $out: $!\n";
+
+ print OUT "use Rot13;\n" ;
+ while (<IN>) {
+ tr/a-zA-Z/n-za-mN-ZA-M/ ;
+ print OUT ;
+ }
+
+ close IN;
+ close OUT;
+ unlink $in;
+ rename $out, $in;
+
+If we encrypt this with C<mkrot13>:
+
+ print " hello fred \n" ;
+
+the result will be this:
+
+ use Rot13;
+ cevag "uryyb serq\a" ;
+
+Running it produces this output:
+
+ hello fred
+
+=head1 USING CONTEXT: THE DEBUG FILTER
+
+The rot13 example was a trivial example. Here's another demonstration
+that shows off a few more features.
+
+Say you wanted to include a lot of debugging code in your Perl script
+during development, but you didn't want it available in the released
+product. Source filters offer a solution. In order to keep the example
+simple, let's say you wanted the debugging output to be controlled by
+an environment variable, C<DEBUG>. Debugging code is enabled if the
+variable exists, otherwise it is disabled.
+
+Two special marker lines will bracket debugging code, like this:
+
+ ## DEBUG_BEGIN
+ if ($year > 1999) {
+ warn "Debug: millennium bug in year $year\n" ;
+ }
+ ## DEBUG_END
+
+When the C<DEBUG> environment variable exists, the filter ensures that
+Perl parses only the code between the C<DEBUG_BEGIN> and C<DEBUG_END>
+markers. That means that when C<DEBUG> does exist, the code above
+should be passed through the filter unchanged. The marker lines can
+also be passed through as-is, because the Perl parser will see them as
+comment lines. When C<DEBUG> isn't set, we need a way to disable the
+debug code. A simple way to achieve that is to convert the lines
+between the two markers into comments:
+
+ ## DEBUG_BEGIN
+ #if ($year > 1999) {
+ # warn "Debug: millennium bug in year $year\n" ;
+ #}
+ ## DEBUG_END
+
+Here is the complete Debug filter:
+
+ package Debug;
+
+ use strict;
+ use Filter::Util::Call ;
+
+ use constant TRUE => 1 ;
+ use constant FALSE => 0 ;
+
+ sub import {
+ my ($type) = @_ ;
+ my (%context) = (
+ Enabled => defined $ENV{DEBUG},
+ InTraceBlock => FALSE,
+ Filename => (caller)[1],
+ LineNo => 0,
+ LastBegin => 0,
+ ) ;
+ filter_add(bless \%context) ;
+ }
+
+ sub Die {
+ my ($self) = shift ;
+ my ($message) = shift ;
+ my ($line_no) = shift || $self->{LastBegin} ;
+ die "$message at $self->{Filename} line $line_no.\n"
+ }
+
+ sub filter {
+ my ($self) = @_ ;
+ my ($status) ;
+ $status = filter_read() ;
+ ++ $self->{LineNo} ;
+
+ # deal with EOF/error first
+ if ($status <= 0) {
+ $self->Die("DEBUG_BEGIN has no DEBUG_END")
+ if $self->{InTraceBlock} ;
+ return $status ;
+ }
+
+ if ($self->{InTraceBlock}) {
+ if (/^\s*##\s*DEBUG_BEGIN/ ) {
+ $self->Die("Nested DEBUG_BEGIN", $self->{LineNo})
+ } elsif (/^\s*##\s*DEBUG_END/) {
+ $self->{InTraceBlock} = FALSE ;
+ }
+
+ # comment out the debug lines when the filter is disabled
+ s/^/#/ if ! $self->{Enabled} ;
+ } elsif ( /^\s*##\s*DEBUG_BEGIN/ ) {
+ $self->{InTraceBlock} = TRUE ;
+ $self->{LastBegin} = $self->{LineNo} ;
+ } elsif ( /^\s*##\s*DEBUG_END/ ) {
+ $self->Die("DEBUG_END has no DEBUG_BEGIN", $self->{LineNo});
+ }
+ return $status ;
+ }
+
+ 1 ;
+
+The big difference between this filter and the previous example is the
+use of context data in the filter object. The filter object is based on
+a hash reference, and is used to keep various pieces of context
+information between calls to the filter function. All but two of the
+hash fields are used for error reporting. The first of those two,
+Enabled, is used by the filter to determine whether the debugging code
+should be given to the Perl parser. The second, InTraceBlock, is true
+when the filter has encountered a C<DEBUG_BEGIN> line, but has not yet
+encountered the following C<DEBUG_END> line.
+
+If you ignore all the error checking that most of the code does, the
+essence of the filter is as follows:
+
+ sub filter {
+ my ($self) = @_ ;
+ my ($status) ;
+ $status = filter_read() ;
+
+ # deal with EOF/error first
+ return $status if $status <= 0 ;
+ if ($self->{InTraceBlock}) {
+ if (/^\s*##\s*DEBUG_END/) {
+ $self->{InTraceBlock} = FALSE
+ }
+
+ # comment out debug lines when the filter is disabled
+ s/^/#/ if ! $self->{Enabled} ;
+ } elsif ( /^\s*##\s*DEBUG_BEGIN/ ) {
+ $self->{InTraceBlock} = TRUE ;
+ }
+ return $status ;
+ }
+
+Be warned: just as the C-preprocessor doesn't know C, the Debug filter
+doesn't know Perl. It can be fooled quite easily:
+
+ print <<EOM;
+ ##DEBUG_BEGIN
+ EOM
+
+Such things aside, you can see that a lot can be achieved with a modest
+amount of code.
+
+=head1 CONCLUSION
+
+You now have better understanding of what a source filter is, and you
+might even have a possible use for them. If you feel like playing with
+source filters but need a bit of inspiration, here are some extra
+features you could add to the Debug filter.
+
+First, an easy one. Rather than having debugging code that is
+all-or-nothing, it would be much more useful to be able to control
+which specific blocks of debugging code get included. Try extending the
+syntax for debug blocks to allow each to be identified. The contents of
+the C<DEBUG> environment variable can then be used to control which
+blocks get included.
+
+Once you can identify individual blocks, try allowing them to be
+nested. That isn't difficult either.
+
+Here is a interesting idea that doesn't involve the Debug filter.
+Currently Perl subroutines have fairly limited support for formal
+parameter lists. You can specify the number of parameters and their
+type, but you still have to manually take them out of the C<@_> array
+yourself. Write a source filter that allows you to have a named
+parameter list. Such a filter would turn this:
+
+ sub MySub ($first, $second, @rest) { ... }
+
+into this:
+
+ sub MySub($$@) {
+ my ($first) = shift ;
+ my ($second) = shift ;
+ my (@rest) = @_ ;
+ ...
+ }
+
+Finally, if you feel like a real challenge, have a go at writing a
+full-blown Perl macro preprocessor as a source filter. Borrow the
+useful features from the C preprocessor and any other macro processors
+you know. The tricky bit will be choosing how much knowledge of Perl's
+syntax you want your filter to have.
+
+=head1 REQUIREMENTS
+
+The Source Filters distribution is available on CPAN, in
+
+ CPAN/modules/by-module/Filter
+
+=head1 AUTHOR
+
+Paul Marquess E<lt>Paul.Marquess@btinternet.comE<gt>
+
+=head1 Copyrights
+
+This article originally appeared in The Perl Journal #11, and is
+copyright 1998 The Perl Journal. It appears courtesy of Jon Orwant and
+The Perl Journal. This document may be distributed under the same terms
+as Perl itself.
--- /dev/null
+=head1 NAME
+
+perlfork - Perl's fork() emulation
+
+=head1 SYNOPSIS
+
+Perl provides a fork() keyword that corresponds to the Unix system call
+of the same name. On most Unix-like platforms where the fork() system
+call is available, Perl's fork() simply calls it.
+
+On some platforms such as Windows where the fork() system call is not
+available, Perl can be built to emulate fork() at the interpreter level.
+While the emulation is designed to be as compatible as possible with the
+real fork() at the the level of the Perl program, there are certain
+important differences that stem from the fact that all the pseudo child
+"processes" created this way live in the same real process as far as the
+operating system is concerned.
+
+This document provides a general overview of the capabilities and
+limitations of the fork() emulation. Note that the issues discussed here
+are not applicable to platforms where a real fork() is available and Perl
+has been configured to use it.
+
+=head1 DESCRIPTION
+
+The fork() emulation is implemented at the level of the Perl interpreter.
+What this means in general is that running fork() will actually clone the
+running interpreter and all its state, and run the cloned interpreter in
+a separate thread, beginning execution in the new thread just after the
+point where the fork() was called in the parent. We will refer to the
+thread that implements this child "process" as the pseudo-process.
+
+To the Perl program that called fork(), all this is designed to be
+transparent. The parent returns from the fork() with a pseudo-process
+ID that can be subsequently used in any process manipulation functions;
+the child returns from the fork() with a value of C<0> to signify that
+it is the child pseudo-process.
+
+=head2 Behavior of other Perl features in forked pseudo-processes
+
+Most Perl features behave in a natural way within pseudo-processes.
+
+=over 8
+
+=item $$ or $PROCESS_ID
+
+This special variable is correctly set to the pseudo-process ID.
+It can be used to identify pseudo-processes within a particular
+session. Note that this value is subject to recycling if any
+pseudo-processes are launched after others have been wait()-ed on.
+
+=item %ENV
+
+Each pseudo-process maintains its own virtual enviroment. Modifications
+to %ENV affect the virtual environment, and are only visible within that
+pseudo-process, and in any processes (or pseudo-processes) launched from
+it.
+
+=item chdir() and all other builtins that accept filenames
+
+Each pseudo-process maintains its own virtual idea of the current directory.
+Modifications to the current directory using chdir() are only visible within
+that pseudo-process, and in any processes (or pseudo-processes) launched from
+it. All file and directory accesses from the pseudo-process will correctly
+map the virtual working directory to the real working directory appropriately.
+
+=item wait() and waitpid()
+
+wait() and waitpid() can be passed a pseudo-process ID returned by fork().
+These calls will properly wait for the termination of the pseudo-process
+and return its status.
+
+=item kill()
+
+kill() can be used to terminate a pseudo-process by passing it the ID returned
+by fork(). This should not be used except under dire circumstances, because
+the operating system may not guarantee integrity of the process resources
+when a running thread is terminated. Note that using kill() on a
+pseudo-process() may typically cause memory leaks, because the thread that
+implements the pseudo-process does not get a chance to clean up its resources.
+
+=item exec()
+
+Calling exec() within a pseudo-process actually spawns the requested
+executable in a separate process and waits for it to complete before
+exiting with the same exit status as that process. This means that the
+process ID reported within the running executable will be different from
+what the earlier Perl fork() might have returned. Similarly, any process
+manipulation functions applied to the ID returned by fork() will affect the
+waiting pseudo-process that called exec(), not the real process it is
+waiting for after the exec().
+
+=item exit()
+
+exit() always exits just the executing pseudo-process, after automatically
+wait()-ing for any outstanding child pseudo-processes. Note that this means
+that the process as a whole will not exit unless all running pseudo-processes
+have exited.
+
+=item Open handles to files, directories and network sockets
+
+All open handles are dup()-ed in pseudo-processes, so that closing
+any handles in one process does not affect the others. See below for
+some limitations.
+
+=back
+
+=head2 Resource limits
+
+In the eyes of the operating system, pseudo-processes created via the fork()
+emulation are simply threads in the same process. This means that any
+process-level limits imposed by the operating system apply to all
+pseudo-processes taken together. This includes any limits imposed by the
+operating system on the number of open file, directory and socket handles,
+limits on disk space usage, limits on memory size, limits on CPU utilization
+etc.
+
+=head2 Killing the parent process
+
+If the parent process is killed (either using Perl's kill() builtin, or
+using some external means) all the pseudo-processes are killed as well,
+and the whole process exits.
+
+=head2 Lifetime of the parent process and pseudo-processes
+
+During the normal course of events, the parent process and every
+pseudo-process started by it will wait for their respective pseudo-children
+to complete before they exit. This means that the parent and every
+pseudo-child created by it that is also a pseudo-parent will only exit
+after their pseudo-children have exited.
+
+A way to mark a pseudo-processes as running detached from their parent (so
+that the parent would not have to wait() for them if it doesn't want to)
+will be provided in future.
+
+=head2 CAVEATS AND LIMITATIONS
+
+=over 8
+
+=item BEGIN blocks
+
+The fork() emulation will not work entirely correctly when called from
+within a BEGIN block. The forked copy will run the contents of the
+BEGIN block, but will not continue parsing the source stream after the
+BEGIN block. For example, consider the following code:
+
+ BEGIN {
+ fork and exit; # fork child and exit the parent
+ print "inner\n";
+ }
+ print "outer\n";
+
+This will print:
+
+ inner
+
+rather than the expected:
+
+ inner
+ outer
+
+This limitation arises from fundamental technical difficulties in
+cloning and restarting the stacks used by the Perl parser in the
+middle of a parse.
+
+=item Open filehandles
+
+Any filehandles open at the time of the fork() will be dup()-ed. Thus,
+the files can be closed independently in the parent and child, but beware
+that the dup()-ed handles will still share the same seek pointer. Changing
+the seek position in the parent will change it in the child and vice-versa.
+One can avoid this by opening files that need distinct seek pointers
+separately in the child.
+
+=item Global state maintained by XSUBs
+
+External subroutines (XSUBs) that maintain their own global state may
+not work correctly. Such XSUBs will either need to maintain locks to
+protect simultaneous access to global data from different pseudo-processes,
+or maintain all their state on the Perl symbol table, which is copied
+naturally when fork() is called. A callback mechanism that provides
+extensions an opportunity to clone their state will be provided in the
+near future.
+
+=item Interpreter embedded in larger application
+
+The fork() emulation may not behave as expected when it is executed in an
+application which embeds a Perl interpreter and calls Perl APIs that can
+evaluate bits of Perl code. This stems from the fact that the emulation
+only has knowledge about the Perl interpreter's own data structures and
+knows nothing about the containing application's state. For example, any
+state carried on the application's own call stack is out of reach.
+
+=item Thread-safety of extensions
+
+Since the fork() emulation runs code in multiple threads, extensions
+calling into non-thread-safe libraries may not work reliably when
+calling fork(). As Perl's threading support gradually becomes more
+widely adopted even on platforms with a native fork(), such extensions
+are expected to be fixed for thread-safety.
+
+=back
+
+=head1 BUGS
+
+=over 8
+
+=item *
+
+Having pseudo-process IDs be negative integers breaks down for the integer
+C<-1> because the wait() and waitpid() functions treat this number as
+being special. The tacit assumption in the current implementation is that
+the system never allocates a thread ID of C<1> for user threads. A better
+representation for pseudo-process IDs will be implemented in future.
+
+=item *
+
+This document may be incomplete in some respects.
+
+=head1 AUTHOR
+
+Support for concurrent interpreters and the fork() emulation was implemented
+by ActiveState, with funding from Microsoft Corporation.
+
+This document is authored and maintained by Gurusamy Sarathy
+E<lt>gsar@activestate.comE<gt>.
+
+=head1 SEE ALSO
+
+L<perlfunc/"fork">, L<perlipc>
+
+=cut
($package, $filename, $line, $subroutine, $hasargs,
$wantarray, $evaltext, $is_require, $hints) = caller($i);
-Here $subroutine may be C<"(eval)"> if the frame is not a subroutine
+Here $subroutine may be C<(eval)> if the frame is not a subroutine
call, but an C<eval>. In such a case additional elements $evaltext and
C<$is_require> are set: C<$is_require> is true if the frame is created by a
C<require> or C<use> statement, $evaltext contains the text of the
C<eval EXPR> statement. In particular, for a C<eval BLOCK> statement,
-$filename is C<"(eval)">, but $evaltext is undefined. (Note also that
+$filename is C<(eval)>, but $evaltext is undefined. (Note also that
each C<use> statement creates a C<require> frame inside an C<eval EXPR>)
frame. C<$hints> contains pragmatic hints that the caller was
compiled with. It currently only reflects the hint corresponding to
This function works like the system call by the same name: it makes the
named directory the new root directory for all further pathnames that
-begin with a C<"/"> by your process and all its children. (It doesn't
+begin with a C</> by your process and all its children. (It doesn't
change your current working directory, which is unaffected.) For security
reasons, this call is restricted to the superuser. If FILENAME is
omitted, does a C<chroot> to C<$_>.
=item delete EXPR
-Deletes the specified key(s) and their associated values from a hash.
-For each key, returns the deleted value associated with that key, or
-the undefined value if there was no such key. Deleting from C<$ENV{}>
-modifies the environment. Deleting from a hash tied to a DBM file
-deletes the entry from the DBM file. (But deleting from a C<tie>d hash
-doesn't necessarily return anything.)
+Given an expression that specifies a hash element, array element, hash slice,
+or array slice, deletes the specified element(s) from the hash or array.
+If the array elements happen to be at the end of the array, the size
+of the array will shrink by that number of elements.
-The following deletes all the values of a hash:
+Returns each element so deleted or the undefined value if there was no such
+element. Deleting from C<$ENV{}> modifies the environment. Deleting from
+a hash tied to a DBM file deletes the entry from the DBM file. Deleting
+from a C<tie>d hash or array may not necessarily return anything.
+
+Deleting an array element effectively returns that position of the array
+to its initial, uninitialized state. Subsequently testing for the same
+element with exists() will return false. See L</exists>.
+
+The following (inefficiently) deletes all the values of %HASH and @ARRAY:
foreach $key (keys %HASH) {
delete $HASH{$key};
}
-And so does this:
+ foreach $index (0 .. $#ARRAY) {
+ delete $ARRAY[$index];
+ }
+
+And so do these:
- delete @HASH{keys %HASH}
+ delete @HASH{keys %HASH};
+
+ delete @ARRAY[0 .. $#ARRAY];
But both of these are slower than just assigning the empty list
-or undefining it:
+or undefining %HASH or @ARRAY:
+
+ %HASH = (); # completely empty %HASH
+ undef %HASH; # forget %HASH ever existed
- %hash = (); # completely empty %hash
- undef %hash; # forget %hash every existed
+ @ARRAY = (); # completely empty @ARRAY
+ undef @ARRAY; # forget @ARRAY ever existed
Note that the EXPR can be arbitrarily complicated as long as the final
-operation is a hash element lookup or hash slice:
+operation is a hash element, array element, hash slice, or array slice
+lookup:
delete $ref->[$x][$y]{$key};
delete @{$ref->[$x][$y]}{$key1, $key2, @morekeys};
+ delete $ref->[$x][$y][$index];
+ delete @{$ref->[$x][$y]}[$index1, $index2, @moreindices];
+
=item die LIST
Outside an C<eval>, prints the value of LIST to C<STDERR> and
C<eof(FILEHANDLE)> on it) after end-of-file is reached. File types such
as terminals may lose the end-of-file condition if you do.
-An C<eof> without an argument uses the last file read as argument.
-Using C<eof()> with empty parentheses is very different. It indicates
-the pseudo file formed of the files listed on the command line,
-i.e., C<eof()> is reasonable to use inside a C<while (E<lt>E<gt>)>
-loop to detect the end of only the last file. Use C<eof(ARGV)> or
-C<eof> without the parentheses to test I<each> file in a while
-(E<lt>E<gt>) loop. Examples:
+An C<eof> without an argument uses the last file read. Using C<eof()>
+with empty parentheses is very different. It refers to the pseudo file
+formed from the files listed on the command line and accessed via the
+C<E<lt>E<gt>> operator. Since C<E<lt>E<gt>> isn't explicitly opened,
+as a normal filehandle is, an C<eof()> before C<E<lt>E<gt>> has been
+used will cause C<@ARGV> to be examined to determine if input is
+available.
+
+In a C<while (E<lt>E<gt>)> loop, C<eof> or C<eof(ARGV)> can be used to
+detect the end of each file, C<eof()> will only detect the end of the
+last file. Examples:
# reset line numbering on each input file
while (<>) {
}
Practical hint: you almost never need to use C<eof> in Perl, because the
-input operators return false values when they run out of data, or if there
-was an error.
+input operators typically return C<undef> when they run out of data, or if
+there was an error.
=item eval EXPR
=item exists EXPR
-Returns true if the specified hash key exists in its hash, even
-if the corresponding value is undefined.
+Given an expression that specifies a hash element or array element,
+returns true if the specified element in the hash or array has ever
+been initialized, even if the corresponding value is undefined. The
+element is not autovivified if it doesn't exist.
- print "Exists\n" if exists $array{$key};
- print "Defined\n" if defined $array{$key};
- print "True\n" if $array{$key};
+ print "Exists\n" if exists $hash{$key};
+ print "Defined\n" if defined $hash{$key};
+ print "True\n" if $hash{$key};
-A hash element can be true only if it's defined, and defined if
+ print "Exists\n" if exists $array[$index];
+ print "Defined\n" if defined $array[$index];
+ print "True\n" if $array[$index];
+
+A hash or array element can be true only if it's defined, and defined if
it exists, but the reverse doesn't necessarily hold true.
Note that the EXPR can be arbitrarily complicated as long as the final
-operation is a hash key lookup:
+operation is a hash or array key lookup:
if (exists $ref->{A}->{B}->{$key}) { }
if (exists $hash{A}{B}{$key}) { }
-Although the last element will not spring into existence just because
-its existence was tested, intervening ones will. Thus C<$ref-E<gt>{"A"}>
-and C<$ref-E<gt>{"A"}-E<gt>{"B"}> will spring into existence due to the
-existence test for a $key element. This happens anywhere the arrow
-operator is used, including even
+ if (exists $ref->{A}->{B}->[$ix]) { }
+ if (exists $hash{A}{B}[$ix]) { }
+
+Although the deepest nested array or hash will not spring into existence
+just because its existence was tested, any intervening ones will.
+Thus C<$ref-E<gt>{"A"}> and C<$ref-E<gt>{"A"}-E<gt>{"B"}> will spring
+into existence due to the existence test for the $key element above.
+This happens anywhere the arrow operator is used, including even:
undef $ref;
if (exists $ref->{"Some key"}) { }
second--glance appear to be an lvalue context may be fixed in a future
release.
+See L<perlref/"Pseudo-hashes"> for specifics on how exists() acts when
+used on a pseudo-hash.
+
=item exit EXPR
Evaluates EXPR and exits immediately with that value. Example:
or die "can't fcntl F_GETFL: $!";
You don't have to check for C<defined> on the return from C<fnctl>.
-Like C<ioctl>, it maps a C<0> return from the system call into C<"0
-but true"> in Perl. This string is true in boolean context and C<0>
+Like C<ioctl>, it maps a C<0> return from the system call into
+C<"0 but true"> in Perl. This string is true in boolean context and C<0>
in numeric context. It is also exempt from the normal B<-w> warnings
on improper numeric conversions.
then you create non-Y2K-compliant programs--and you wouldn't want to do
that, would you?
+The proper way to get a complete 4-digit year is simply:
+
+ $year += 1900;
+
+And to get the last two digits of the year (e.g., '01' in 2001) do:
+
+ $year = sprintf("%02d", $year % 100);
+
If EXPR is omitted, does C<gmtime(time())>.
In scalar context, returns the ctime(3) value:
goto ("FOO", "BAR", "GLARCH")[$i];
-The C<goto-&NAME> form is highly magical, and substitutes a call to the
-named subroutine for the currently running subroutine. This is used by
-C<AUTOLOAD> subroutines that wish to load another subroutine and then
-pretend that the other subroutine had been called in the first place
-(except that any modifications to C<@_> in the current subroutine are
-propagated to the other subroutine.) After the C<goto>, not even C<caller>
-will be able to tell that this routine was called first.
+The C<goto-&NAME> form is quite different from the other forms of C<goto>.
+In fact, it isn't a goto in the normal sense at all, and doesn't have
+the stigma associated with other gotos. Instead, it
+substitutes a call to the named subroutine for the currently running
+subroutine. This is used by C<AUTOLOAD> subroutines that wish to load
+another subroutine and then pretend that the other subroutine had been
+called in the first place (except that any modifications to C<@_>
+in the current subroutine are propagated to the other subroutine.)
+After the C<goto>, not even C<caller> will be able to tell that this
+routine was called first.
+
+NAME needn't be the name of a subroutine; it can be a scalar variable
+containing a code reference, or a block which evaluates to a code
+reference.
=item grep BLOCK LIST
print hex 'aF'; # same
Hex strings may only represent integers. Strings that would cause
-integer overflow trigger a mandatory error message.
+integer overflow trigger a warning.
=item import
See also C<each>, C<values> and C<sort>.
-=item kill LIST
+=item kill SIGNAL, LIST
-Sends a signal to a list of processes. The first element of
-the list must be the signal to send. Returns the number of
+Sends a signal to a list of processes. Returns the number of
processes successfully signaled (which is not necessarily the
same as the number actually killed).
$cnt = kill 1, $child1, $child2;
kill 9, @goners;
-Unlike in the shell, in Perl if the I<SIGNAL> is negative, it kills
+If SIGNAL is zero, no signal is sent to the process. This is a
+useful way to check that the process is alive and hasn't changed
+its UID. See L<perlport> for notes on the portability of this
+construct.
+
+Unlike in the shell, if SIGNAL is negative, it kills
process groups instead of processes. (On System V, a negative I<PROCESS>
number will also kill process groups, but that's not portable.) That
means you usually want to use positive not negative signals. You may also
C<eval {}>, C<sub {}> or C<do {}>, and should not be used to exit
a grep() or map() operation.
+Note that a block by itself is semantically identical to a loop
+that executes once. Thus C<last> can be used to effect an early
+exit out of such a block.
+
See also L</continue> for an illustration of how C<last>, C<next>, and
C<redo> work.
then you create non-Y2K-compliant programs--and you wouldn't want to do
that, would you?
+The proper way to get a complete 4-digit year is simply:
+
+ $year += 1900;
+
+And to get the last two digits of the year (e.g., '01' in 2001) do:
+
+ $year = sprintf("%02d", $year % 100);
+
If EXPR is omitted, uses the current time (C<localtime(time)>).
In scalar context, returns the ctime(3) value:
first to get the correct constant definitions. If CMD is C<IPC_STAT>,
then ARG must be a variable which will hold the returned C<msqid_ds>
-structure. Returns like C<ioctl>: the undefined value for error, C<"0 but
-true"> for zero, or the actual return value otherwise. See also
+structure. Returns like C<ioctl>: the undefined value for error,
+C<"0 but true"> for zero, or the actual return value otherwise. See also
C<IPC::SysV> and C<IPC::Semaphore> documentation.
=item msgget KEY,FLAGS
C<eval {}>, C<sub {}> or C<do {}>, and should not be used to exit
a grep() or map() operation.
+Note that a block by itself is semantically identical to a loop
+that executes once. Thus C<next> will exit such a block early.
+
See also L</continue> for an illustration of how C<last>, C<next>, and
C<redo> work.
open(FILEHANDLE, "<&=$fd")
+Note that this feature depends on the fdopen() C library function.
+On many UNIX systems, fdopen() is known to fail when file descriptors
+exceed a certain value, typically 255. If you need more file
+descriptors than that, consider rebuilding Perl to use the C<sfio>
+library.
+
If you open a pipe on the command C<'-'>, i.e., either C<'|-'> or C<'-|'>
with 2-arguments (or 1-argument) form of open(), then
there is an implicit fork done, and the return value of open is the pid
(But only within the lexical scope of the C<our> declaration. In this
it differs from "use vars", which is package scoped.)
+An C<our> declaration declares a global variable that will be visible
+across its entire lexical scope, even across package boundaries. The
+package in which the variable is entered is determined at the point
+of the declaration, not at the point of use. This means the following
+behavior holds:
+
+ package Foo;
+ our $bar; # declares $Foo::bar for rest of lexical scope
+ $bar = 20;
+
+ package Bar;
+ print $bar; # prints 20
+
+Multiple C<our> declarations in the same lexical scope are allowed
+if they are in different packages. If they happened to be in the same
+package, Perl will emit warnings if you have asked for them.
+
+ use warnings;
+ package Foo;
+ our $bar; # declares $Foo::bar for rest of lexical scope
+ $bar = 20;
+
+ package Bar;
+ our $bar = 30; # declares $Bar::bar for rest of lexical scope
+ print $bar; # prints 30
+
+ our $bar; # emits warning
+
=item pack TEMPLATE,LIST
-Takes a list of values and packs it into a binary structure,
-returning the string containing the structure. The TEMPLATE is a
+Takes a LIST of values and converts it into a string using the rules
+given by the TEMPLATE. The resulting string is the concatenation of
+the converted values. Typically, each converted value looks
+like its machine-level representation. For example, on 32-bit machines
+a converted integer may be represented by a sequence of 4 bytes.
+
+The TEMPLATE is a
sequence of characters that give the order and type of values, as
follows:
A An ascii string, will be space padded.
Z A null terminated (asciz) string, will be null padded.
- b A bit string (ascending bit order, like vec()).
- B A bit string (descending bit order).
+ b A bit string (ascending bit order inside each byte, like vec()).
+ B A bit string (descending bit order inside each byte).
h A hex string (low nybble first).
H A hex string (high nybble first).
what a local C compiler calls 'long'. If you want
native-length longs, use the '!' suffix.)
- n A short in "network" (big-endian) order.
- N A long in "network" (big-endian) order.
- v A short in "VAX" (little-endian) order.
- V A long in "VAX" (little-endian) order.
+ n An unsigned short in "network" (big-endian) order.
+ N An unsigned long in "network" (big-endian) order.
+ v An unsigned short in "VAX" (little-endian) order.
+ V An unsigned long in "VAX" (little-endian) order.
(These 'shorts' and 'longs' are _exactly_ 16 bits and
_exactly_ 32 bits, respectively.)
=item *
Each letter may optionally be followed by a number giving a repeat
-count. With all types except C<"a">, C<"A">, C<"Z">, C<"b">, C<"B">, C<"h">,
-C<"H">, and C<"P"> the pack function will gobble up that many values from
+count. With all types except C<a>, C<A>, C<Z>, C<b>, C<B>, C<h>,
+C<H>, and C<P> the pack function will gobble up that many values from
the LIST. A C<*> for the repeat count means to use however many items are
-left.
+left, except for C<@>, C<x>, C<X>, where it is equivalent
+to C<0>, and C<u>, where it is equivalent to 1 (or 45, what is the
+same).
+
+When used with C<Z>, C<*> results in the addition of a trailing null
+byte (so the packed result will be one longer than the byte C<length>
+of the item).
+
+The repeat count for C<u> is interpreted as the maximal number of bytes
+to encode per line of output, with 0 and 1 replaced by 45.
=item *
-The C<"a">, C<"A">, and C<"Z"> types gobble just one value, but pack it as a
+The C<a>, C<A>, and C<Z> types gobble just one value, but pack it as a
string of length count, padding with nulls or spaces as necessary. When
-unpacking, C<"A"> strips trailing spaces and nulls, C<"Z"> strips everything
-after the first null, and C<"a"> returns data verbatim.
+unpacking, C<A> strips trailing spaces and nulls, C<Z> strips everything
+after the first null, and C<a> returns data verbatim. When packing,
+C<a>, and C<Z> are equivalent.
+
+If the value-to-pack is too long, it is truncated. If too long and an
+explicit count is provided, C<Z> packs only C<$count-1> bytes, followed
+by a null byte. Thus C<Z> always packs a trailing null byte under
+all circumstances.
=item *
-Likewise, the C<"b"> and C<"B"> fields pack a string that many bits long.
+Likewise, the C<b> and C<B> fields pack a string that many bits long.
+Each byte of the input field of pack() generates 1 bit of the result.
+Each result bit is based on the least-significant bit of the corresponding
+input byte, i.e., on C<ord($byte)%2>. In particular, bytes C<"0"> and
+C<"1"> generate bits 0 and 1, as do bytes C<"\0"> and C<"\1">.
+
+Starting from the beginning of the input string of pack(), each 8-tuple
+of bytes is converted to 1 byte of output. With format C<b>
+the first byte of the 8-tuple determines the least-significant bit of a
+byte, and with format C<B> it determines the most-significant bit of
+a byte.
+
+If the length of the input string is not exactly divisible by 8, the
+remainder is packed as if the input string were padded by null bytes
+at the end. Similarly, during unpack()ing the "extra" bits are ignored.
+
+If the input string of pack() is longer than needed, extra bytes are ignored.
+A C<*> for the repeat count of pack() means to use all the bytes of
+the input field. On unpack()ing the bits are converted to a string
+of C<"0">s and C<"1">s.
=item *
-The C<"h"> and C<"H"> fields pack a string that many nybbles (4-bit groups,
+The C<h> and C<H> fields pack a string that many nybbles (4-bit groups,
representable as hexadecimal digits, 0-9a-f) long.
+Each byte of the input field of pack() generates 4 bits of the result.
+For non-alphabetical bytes the result is based on the 4 least-significant
+bits of the input byte, i.e., on C<ord($byte)%16>. In particular,
+bytes C<"0"> and C<"1"> generate nybbles 0 and 1, as do bytes
+C<"\0"> and C<"\1">. For bytes C<"a".."f"> and C<"A".."F"> the result
+is compatible with the usual hexadecimal digits, so that C<"a"> and
+C<"A"> both generate the nybble C<0xa==10>. The result for bytes
+C<"g".."z"> and C<"G".."Z"> is not well-defined.
+
+Starting from the beginning of the input string of pack(), each pair
+of bytes is converted to 1 byte of output. With format C<h> the
+first byte of the pair determines the least-significant nybble of the
+output byte, and with format C<H> it determines the most-significant
+nybble.
+
+If the length of the input string is not even, it behaves as if padded
+by a null byte at the end. Similarly, during unpack()ing the "extra"
+nybbles are ignored.
+
+If the input string of pack() is longer than needed, extra bytes are ignored.
+A C<*> for the repeat count of pack() means to use all the bytes of
+the input field. On unpack()ing the bits are converted to a string
+of hexadecimal digits.
+
=item *
-The C<"p"> type packs a pointer to a null-terminated string. You are
+The C<p> type packs a pointer to a null-terminated string. You are
responsible for ensuring the string is not a temporary value (which can
potentially get deallocated before you get around to using the packed result).
-The C<"P"> type packs a pointer to a structure of the size indicated by the
-length. A NULL pointer is created if the corresponding value for C<"p"> or
-C<"P"> is C<undef>.
+The C<P> type packs a pointer to a structure of the size indicated by the
+length. A NULL pointer is created if the corresponding value for C<p> or
+C<P> is C<undef>, similarly for unpack().
=item *
-The C<"/"> character allows packing and unpacking of strings where the
-packed structure contains a byte count followed by the string itself.
+The C</> template character allows packing and unpacking of strings where
+the packed structure contains a byte count followed by the string itself.
You write I<length-item>C</>I<string-item>.
The I<length-item> can be any C<pack> template letter,
and describes how the length value is packed.
The ones likely to be of most use are integer-packing ones like
-C<"n"> (for Java strings), C<"w"> (for ASN.1 or SNMP)
-and C<"N"> (for Sun XDR).
+C<n> (for Java strings), C<w> (for ASN.1 or SNMP)
+and C<N> (for Sun XDR).
The I<string-item> must, at present, be C<"A*">, C<"a*"> or C<"Z*">.
For C<unpack> the length of the string is obtained from the I<length-item>,
The I<length-item> is not returned explicitly from C<unpack>.
-Adding a count to the I<length-item> letter
-is unlikely to do anything useful,
-unless that letter is C<"A">, C<"a"> or C<"Z">.
-Packing with a I<length-item> of C<"a"> or C<"Z">
-may introduce C<"\000"> characters,
+Adding a count to the I<length-item> letter is unlikely to do anything
+useful, unless that letter is C<A>, C<a> or C<Z>. Packing with a
+I<length-item> of C<a> or C<Z> may introduce C<"\000"> characters,
which Perl does not regard as legal in numeric strings.
=item *
-The integer types C<"s">, C<"S">, C<"l">, and C<"L"> may be
-immediately followed by a C<"!"> suffix to signify native shorts or
-longs--as you can see from above for example a bare C<"l"> does mean
+The integer types C<s>, C<S>, C<l>, and C<L> may be
+immediately followed by a C<!> suffix to signify native shorts or
+longs--as you can see from above for example a bare C<l> does mean
exactly 32 bits, the native C<long> (as seen by the local C compiler)
may be larger. This is an issue mainly in 64-bit platforms. You can
-see whether using C<"!"> makes any difference by
+see whether using C<!> makes any difference by
print length(pack("s")), " ", length(pack("s!")), "\n";
print length(pack("l")), " ", length(pack("l!")), "\n";
-C<"i!"> and C<"I!"> also work but only because of completeness;
-they are identical to C<"i"> and C<"I">.
+C<i!> and C<I!> also work but only because of completeness;
+they are identical to C<i> and C<I>.
The actual sizes (in bytes) of native shorts, ints, longs, and long
longs on the platform where Perl was built are also available via
=item *
-The integer formats C<"s">, C<"S">, C<"i">, C<"I">, C<"l">, and C<"L">
+The integer formats C<s>, C<S>, C<i>, C<I>, C<l>, and C<L>
are inherently non-portable between processors and operating systems
because they obey the native byteorder and endianness. For example a
4-byte integer 0x12345678 (305419896 decimal) be ordered natively
0x12 0x34 0x56 0x78 # little-endian
0x78 0x56 0x34 0x12 # big-endian
-Basically, the Intel, Alpha, and VAX CPUs and little-endian, while
+Basically, the Intel, Alpha, and VAX CPUs are little-endian, while
everybody else, for example Motorola m68k/88k, PPC, Sparc, HP PA,
Power, and Cray are big-endian. MIPS can be either: Digital used it
in little-endian mode; SGI uses it in big-endian mode.
Byteorders C<'1234'> and C<'12345678'> are little-endian, C<'4321'>
and C<'87654321'> are big-endian.
-If you want portable packed integers use the formats C<"n">, C<"N">,
-C<"v">, and C<"V">, their byte endianness and size is known.
+If you want portable packed integers use the formats C<n>, C<N>,
+C<v>, and C<V>, their byte endianness and size is known.
See also L<perlport>.
=item *
A comment in a TEMPLATE starts with C<#> and goes to the end of line.
+=item *
+
+If TEMPLATE requires more arguments to pack() than actually given, pack()
+assumes additional C<""> arguments. If TEMPLATE requires less arguments
+to pack() than actually given, extra arguments are ignored.
+
=back
Examples:
=item recv SOCKET,SCALAR,LENGTH,FLAGS
Receives a message on a socket. Attempts to receive LENGTH bytes of
-data into variable SCALAR from the specified SOCKET filehandle.
-Actually does a C C<recvfrom>, so that it can return the address of the
-sender. Returns the undefined value if there's an error. SCALAR will
-be grown or shrunk to the length actually read. Takes the same flags
-as the system call of the same name.
-See L<perlipc/"UDP: Message Passing"> for examples.
+data into variable SCALAR from the specified SOCKET filehandle. SCALAR
+will be grown or shrunk to the length actually read. Takes the same
+flags as the system call of the same name. Returns the address of the
+sender if SOCKET's protocol supports this; returns an empty string
+otherwise. If there's an error, returns the undefined value. This call
+is actually implemented in terms of recvfrom(2) system call. See
+L<perlipc/"UDP: Message Passing"> for examples.
=item redo LABEL
C<eval {}>, C<sub {}> or C<do {}>, and should not be used to exit
a grep() or map() operation.
+Note that a block by itself is semantically identical to a loop
+that executes once. Thus C<redo> inside such a block will effectively
+turn it into a looping construct.
+
See also L</continue> for an illustration of how C<last>, C<next>, and
C<redo> work.
foreach $prefix (@INC) {
$realfilename = "$prefix/$filename";
if (-f $realfilename) {
+ $INC{$filename} = $realfilename;
$result = do $realfilename;
last ITER;
}
}
die "Can't find $filename in \@INC";
}
+ delete $INC{$filename} if $@ || !$result;
die $@ if $@;
die "$filename did not return true value" unless $result;
- $INC{$filename} = $realfilename;
return $result;
}
Sets the current process group for the specified PID, C<0> for the current
process. Will produce a fatal error if used on a machine that doesn't
-implement setpgrp(2). If the arguments are omitted, it defaults to
-C<0,0>. Note that the POSIX version of C<setpgrp> does not accept any
-arguments, so only C<setpgrp(0,0)> is portable. See also C<POSIX::setsid()>.
+implement POSIX setpgid(2) or BSD setpgrp(2). If the arguments are omitted,
+it defaults to C<0,0>. Note that the BSD 4.2 version of C<setpgrp> does not
+accept any arguments, so only C<setpgrp(0,0)> is portable. See also
+C<POSIX::setsid()>.
=item setpriority WHICH,WHO,PRIORITY
array, returns the undefined value. If ARRAY is omitted, shifts the
C<@_> array within the lexical scope of subroutines and formats, and the
C<@ARGV> array at file scopes or within the lexical scopes established by
-the C<eval ''>, C<BEGIN {}>, C<END {}>, and C<INIT {}> constructs.
+the C<eval ''>, C<BEGIN {}>, C<INIT {}>, C<STOP {}>, and C<END {}>
+constructs.
+
See also C<unshift>, C<push>, and C<pop>. C<Shift()> and C<unshift> do the
same thing to the left end of an array that C<pop> and C<push> do to the
right end.
of a SUBNAME, you can provide a BLOCK as an anonymous, in-line sort
subroutine.
-In the interests of efficiency the normal calling code for subroutines is
-bypassed, with the following effects: the subroutine may not be a
-recursive subroutine, and the two elements to be compared are passed into
-the subroutine not via C<@_> but as the package global variables $a and
-$b (see example below). They are passed by reference, so don't
-modify $a and $b. And don't try to declare them as lexicals either.
+If the subroutine's prototype is C<($$)>, the elements to be compared
+are passed by reference in C<@_>, as for a normal subroutine. If not,
+the normal calling code for subroutines is bypassed in the interests of
+efficiency, and the elements to be compared are passed into the subroutine
+as the package global variables $a and $b (see example below). Note that
+in the latter case, it is usually counter-productive to declare $a and
+$b as lexicals.
+
+In either case, the subroutine may not be recursive. The values to be
+compared are always passed by reference, so don't modify them.
You also cannot exit out of the sort block or subroutine using any of the
loop control operators described in L<perlsyn> or with C<goto>.
||
$a->[2] cmp $b->[2]
} map { [$_, /=(\d+)/, uc($_)] } @old;
+
+ # using a prototype allows you to use any comparison subroutine
+ # as a sort subroutine (including other package's subroutines)
+ package other;
+ sub backwards ($$) { $_[1] cmp $_[0]; } # $a and $b are not set here
+
+ package main;
+ @new = sort other::backwards @old;
If you're using strict, you I<must not> declare $a
and $b as lexicals. They are package globals. That means
point in formatted real numbers is affected by the LC_NUMERIC locale.
See L<perllocale>.
-To cope with broken systems that allow the standard locales to be
-overridden by malicious users, the return value may be tainted
-if any of the floating point formats are used and the conversion
-yields something that doesn't look like a normal C-locale floating
-point number. This happens regardless of whether C<use locale> is
-in effect or not.
-
If Perl understands "quads" (64-bit integers) (this requires
either that the platform natively supports quads or that Perl
has been specifically compiled to support quads), the characters
5 gid numeric group ID of file's owner
6 rdev the device identifier (special files only)
7 size total size of file, in bytes
- 8 atime last access time since the epoch
- 9 mtime last modify time since the epoch
- 10 ctime inode change time (NOT creation time!) since the epoch
+ 8 atime last access time in seconds since the epoch
+ 9 mtime last modify time in seconds since the epoch
+ 10 ctime inode change time (NOT creation time!) in seconds since the epoch
11 blksize preferred block size for file system I/O
12 blocks actual number of blocks allocated
print;
}
-In searching for C</\bfoo\b/>, only those locations in C<$_> that contain C<"f">
-will be looked at, because C<"f"> is rarer than C<"o">. In general, this is
+In searching for C</\bfoo\b/>, only those locations in C<$_> that contain C<f>
+will be looked at, because C<f> is rarer than C<o>. In general, this is
a big win except in pathological cases. The only question is whether
it saves you more time than it took to build the linked list in the
first place.
supported by perl: zero means read-only, one means write-only, and two
means read/write. We know that these values do I<not> work under
OS/390 & VM/ESA Unix and on the Macintosh; you probably don't want to
-se them in new code, use thhe constants discussed in the preceding
-paragraph.
+use them in new code.
If the file named by FILENAME does not exist and the C<open> call creates
it (typically because MODE includes the C<O_CREAT> flag), then the value of
Better to omit it. See the perlfunc(1) entry on C<umask> for more
on this.
+Note that C<sysopen> depends on the fdopen() C library function.
+On many UNIX systems, fdopen() is known to fail when file descriptors
+exceed a certain value, typically 255. If you need more file
+descriptors than that, consider rebuilding Perl to use the C<sfio>
+library, or perhaps using the POSIX::open() function.
+
See L<perlopentut> for a kinder, gentler explanation of opening files.
=item sysread FILEHANDLE,SCALAR,LENGTH,OFFSET
=item unpack TEMPLATE,EXPR
C<unpack> does the reverse of C<pack>: it takes a string
-representing a structure and expands it out into a list of values.
+and expands it out into a list of values.
(In scalar context, it returns merely the first value produced.)
+
+The string is broken into chunks described by the TEMPLATE. Each chunk
+is converted separately to a value. Typically, either the string is a result
+of C<pack>, or the bytes of the string represent a C structure of some
+kind.
+
The TEMPLATE has the same format as in the C<pack> function.
Here's a subroutine that does substring:
sub ordinal { unpack("c",$_[0]); } # same as ord()
-In addition, you may prefix a field with a %E<lt>numberE<gt> to indicate that
+In addition to fields allowed in pack(), you may prefix a field with
+a %E<lt>numberE<gt> to indicate that
you want a E<lt>numberE<gt>-bit checksum of the items instead of the items
-themselves. Default is a 16-bit checksum. For example, the following
+themselves. Default is a 16-bit checksum. Checksum is calculated by
+summing numeric values of expanded values (for string fields the sum of
+C<ord($char)> is taken, for bit fields the sum of zeroes and ones).
+
+For example, the following
computes the same number as the System V sum program:
$checksum = do {
$setbits = unpack("%32b*", $selectmask);
-The C<"p"> and C<"P"> formats should be used with care. Since Perl
+The C<p> and C<P> formats should be used with care. Since Perl
has no way of checking whether the value passed to C<unpack()>
corresponds to a valid memory location, passing a pointer value that's
not known to be valid is likely to have disastrous consequences.
+If the repeat count of a field is larger than what the remainder of
+the input string allows, repeat count is decreased. If the input string
+is longer than one described by the TEMPLATE, the rest is ignored.
+
See L</pack> for more examples and notes.
=item untie VARIABLE
=item vec EXPR,OFFSET,BITS
-Treats the string in EXPR as a vector of unsigned integers, and
-returns the value of the bit field specified by OFFSET. BITS
-specifies the number of bits that are reserved for each entry in the
-bit vector. This must be a power of two from 1 to 32 (or 64, if your
-platform supports that).
+Treats the string in EXPR as a bit vector made up of elements of
+width BITS, and returns the value of the element specified by OFFSET
+as an unsigned integer. BITS therefore specifies the number of bits
+that are reserved for each element in the bit vector. This must
+be a power of two from 1 to 32 (or 64, if your platform supports
+that).
+
+If BITS is 8, "elements" coincide with bytes of the input string.
+
+If BITS is 16 or more, bytes of the input string are grouped into chunks
+of size BITS/8, and each group is converted to a number as with
+pack()/unpack() with big-endian formats C<n>/C<N> (and analoguously
+for BITS==64). See L<"pack"> for details.
+
+If bits is 4 or less, the string is broken into bytes, then the bits
+of each byte are broken into 8/BITS groups. Bits of a byte are
+numbered in a little-endian-ish way, as in C<0x01>, C<0x02>,
+C<0x04>, C<0x08>, C<0x10>, C<0x20>, C<0x40>, C<0x80>. For example,
+breaking the single input byte C<chr(0x36)> into two groups gives a list
+C<(0x6, 0x3)>; breaking it into 4 groups gives C<(0x2, 0x1, 0x3, 0x0)>.
C<vec> may also be assigned to, in which case parentheses are needed
to give the expression the correct precedence as in
my $foo = '';
vec($foo, 0, 32) = 0x5065726C; # 'Perl'
+
+ # $foo eq "Perl" eq "\x50\x65\x72\x6C", 32 bits
+ print vec($foo, 0, 8); # prints 80 == 0x50 == ord('P')
+
vec($foo, 2, 16) = 0x5065; # 'PerlPe'
vec($foo, 3, 16) = 0x726C; # 'PerlPerl'
vec($foo, 8, 8) = 0x50; # 'PerlPerlP'
If you know the exact length in bits, it can be used in place of the C<*>.
+Here is an example to illustrate how the bits actually fall in place:
+
+ #!/usr/bin/perl -wl
+
+ print <<'EOT';
+ 0 1 2 3
+ unpack("V",$_) 01234567890123456789012345678901
+ ------------------------------------------------------------------
+ EOT
+
+ for $w (0..3) {
+ $width = 2**$w;
+ for ($shift=0; $shift < $width; ++$shift) {
+ for ($off=0; $off < 32/$width; ++$off) {
+ $str = pack("B*", "0"x32);
+ $bits = (1<<$shift);
+ vec($str, $off, $width) = $bits;
+ $res = unpack("b*",$str);
+ $val = unpack("V", $str);
+ write;
+ }
+ }
+ }
+
+ format STDOUT =
+ vec($_,@#,@#) = @<< == @######### @>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+ $off, $width, $bits, $val, $res
+ .
+ __END__
+
+Regardless of the machine architecture on which it is run, the above
+example should print the following table:
+
+ 0 1 2 3
+ unpack("V",$_) 01234567890123456789012345678901
+ ------------------------------------------------------------------
+ vec($_, 0, 1) = 1 == 1 10000000000000000000000000000000
+ vec($_, 1, 1) = 1 == 2 01000000000000000000000000000000
+ vec($_, 2, 1) = 1 == 4 00100000000000000000000000000000
+ vec($_, 3, 1) = 1 == 8 00010000000000000000000000000000
+ vec($_, 4, 1) = 1 == 16 00001000000000000000000000000000
+ vec($_, 5, 1) = 1 == 32 00000100000000000000000000000000
+ vec($_, 6, 1) = 1 == 64 00000010000000000000000000000000
+ vec($_, 7, 1) = 1 == 128 00000001000000000000000000000000
+ vec($_, 8, 1) = 1 == 256 00000000100000000000000000000000
+ vec($_, 9, 1) = 1 == 512 00000000010000000000000000000000
+ vec($_,10, 1) = 1 == 1024 00000000001000000000000000000000
+ vec($_,11, 1) = 1 == 2048 00000000000100000000000000000000
+ vec($_,12, 1) = 1 == 4096 00000000000010000000000000000000
+ vec($_,13, 1) = 1 == 8192 00000000000001000000000000000000
+ vec($_,14, 1) = 1 == 16384 00000000000000100000000000000000
+ vec($_,15, 1) = 1 == 32768 00000000000000010000000000000000
+ vec($_,16, 1) = 1 == 65536 00000000000000001000000000000000
+ vec($_,17, 1) = 1 == 131072 00000000000000000100000000000000
+ vec($_,18, 1) = 1 == 262144 00000000000000000010000000000000
+ vec($_,19, 1) = 1 == 524288 00000000000000000001000000000000
+ vec($_,20, 1) = 1 == 1048576 00000000000000000000100000000000
+ vec($_,21, 1) = 1 == 2097152 00000000000000000000010000000000
+ vec($_,22, 1) = 1 == 4194304 00000000000000000000001000000000
+ vec($_,23, 1) = 1 == 8388608 00000000000000000000000100000000
+ vec($_,24, 1) = 1 == 16777216 00000000000000000000000010000000
+ vec($_,25, 1) = 1 == 33554432 00000000000000000000000001000000
+ vec($_,26, 1) = 1 == 67108864 00000000000000000000000000100000
+ vec($_,27, 1) = 1 == 134217728 00000000000000000000000000010000
+ vec($_,28, 1) = 1 == 268435456 00000000000000000000000000001000
+ vec($_,29, 1) = 1 == 536870912 00000000000000000000000000000100
+ vec($_,30, 1) = 1 == 1073741824 00000000000000000000000000000010
+ vec($_,31, 1) = 1 == 2147483648 00000000000000000000000000000001
+ vec($_, 0, 2) = 1 == 1 10000000000000000000000000000000
+ vec($_, 1, 2) = 1 == 4 00100000000000000000000000000000
+ vec($_, 2, 2) = 1 == 16 00001000000000000000000000000000
+ vec($_, 3, 2) = 1 == 64 00000010000000000000000000000000
+ vec($_, 4, 2) = 1 == 256 00000000100000000000000000000000
+ vec($_, 5, 2) = 1 == 1024 00000000001000000000000000000000
+ vec($_, 6, 2) = 1 == 4096 00000000000010000000000000000000
+ vec($_, 7, 2) = 1 == 16384 00000000000000100000000000000000
+ vec($_, 8, 2) = 1 == 65536 00000000000000001000000000000000
+ vec($_, 9, 2) = 1 == 262144 00000000000000000010000000000000
+ vec($_,10, 2) = 1 == 1048576 00000000000000000000100000000000
+ vec($_,11, 2) = 1 == 4194304 00000000000000000000001000000000
+ vec($_,12, 2) = 1 == 16777216 00000000000000000000000010000000
+ vec($_,13, 2) = 1 == 67108864 00000000000000000000000000100000
+ vec($_,14, 2) = 1 == 268435456 00000000000000000000000000001000
+ vec($_,15, 2) = 1 == 1073741824 00000000000000000000000000000010
+ vec($_, 0, 2) = 2 == 2 01000000000000000000000000000000
+ vec($_, 1, 2) = 2 == 8 00010000000000000000000000000000
+ vec($_, 2, 2) = 2 == 32 00000100000000000000000000000000
+ vec($_, 3, 2) = 2 == 128 00000001000000000000000000000000
+ vec($_, 4, 2) = 2 == 512 00000000010000000000000000000000
+ vec($_, 5, 2) = 2 == 2048 00000000000100000000000000000000
+ vec($_, 6, 2) = 2 == 8192 00000000000001000000000000000000
+ vec($_, 7, 2) = 2 == 32768 00000000000000010000000000000000
+ vec($_, 8, 2) = 2 == 131072 00000000000000000100000000000000
+ vec($_, 9, 2) = 2 == 524288 00000000000000000001000000000000
+ vec($_,10, 2) = 2 == 2097152 00000000000000000000010000000000
+ vec($_,11, 2) = 2 == 8388608 00000000000000000000000100000000
+ vec($_,12, 2) = 2 == 33554432 00000000000000000000000001000000
+ vec($_,13, 2) = 2 == 134217728 00000000000000000000000000010000
+ vec($_,14, 2) = 2 == 536870912 00000000000000000000000000000100
+ vec($_,15, 2) = 2 == 2147483648 00000000000000000000000000000001
+ vec($_, 0, 4) = 1 == 1 10000000000000000000000000000000
+ vec($_, 1, 4) = 1 == 16 00001000000000000000000000000000
+ vec($_, 2, 4) = 1 == 256 00000000100000000000000000000000
+ vec($_, 3, 4) = 1 == 4096 00000000000010000000000000000000
+ vec($_, 4, 4) = 1 == 65536 00000000000000001000000000000000
+ vec($_, 5, 4) = 1 == 1048576 00000000000000000000100000000000
+ vec($_, 6, 4) = 1 == 16777216 00000000000000000000000010000000
+ vec($_, 7, 4) = 1 == 268435456 00000000000000000000000000001000
+ vec($_, 0, 4) = 2 == 2 01000000000000000000000000000000
+ vec($_, 1, 4) = 2 == 32 00000100000000000000000000000000
+ vec($_, 2, 4) = 2 == 512 00000000010000000000000000000000
+ vec($_, 3, 4) = 2 == 8192 00000000000001000000000000000000
+ vec($_, 4, 4) = 2 == 131072 00000000000000000100000000000000
+ vec($_, 5, 4) = 2 == 2097152 00000000000000000000010000000000
+ vec($_, 6, 4) = 2 == 33554432 00000000000000000000000001000000
+ vec($_, 7, 4) = 2 == 536870912 00000000000000000000000000000100
+ vec($_, 0, 4) = 4 == 4 00100000000000000000000000000000
+ vec($_, 1, 4) = 4 == 64 00000010000000000000000000000000
+ vec($_, 2, 4) = 4 == 1024 00000000001000000000000000000000
+ vec($_, 3, 4) = 4 == 16384 00000000000000100000000000000000
+ vec($_, 4, 4) = 4 == 262144 00000000000000000010000000000000
+ vec($_, 5, 4) = 4 == 4194304 00000000000000000000001000000000
+ vec($_, 6, 4) = 4 == 67108864 00000000000000000000000000100000
+ vec($_, 7, 4) = 4 == 1073741824 00000000000000000000000000000010
+ vec($_, 0, 4) = 8 == 8 00010000000000000000000000000000
+ vec($_, 1, 4) = 8 == 128 00000001000000000000000000000000
+ vec($_, 2, 4) = 8 == 2048 00000000000100000000000000000000
+ vec($_, 3, 4) = 8 == 32768 00000000000000010000000000000000
+ vec($_, 4, 4) = 8 == 524288 00000000000000000001000000000000
+ vec($_, 5, 4) = 8 == 8388608 00000000000000000000000100000000
+ vec($_, 6, 4) = 8 == 134217728 00000000000000000000000000010000
+ vec($_, 7, 4) = 8 == 2147483648 00000000000000000000000000000001
+ vec($_, 0, 8) = 1 == 1 10000000000000000000000000000000
+ vec($_, 1, 8) = 1 == 256 00000000100000000000000000000000
+ vec($_, 2, 8) = 1 == 65536 00000000000000001000000000000000
+ vec($_, 3, 8) = 1 == 16777216 00000000000000000000000010000000
+ vec($_, 0, 8) = 2 == 2 01000000000000000000000000000000
+ vec($_, 1, 8) = 2 == 512 00000000010000000000000000000000
+ vec($_, 2, 8) = 2 == 131072 00000000000000000100000000000000
+ vec($_, 3, 8) = 2 == 33554432 00000000000000000000000001000000
+ vec($_, 0, 8) = 4 == 4 00100000000000000000000000000000
+ vec($_, 1, 8) = 4 == 1024 00000000001000000000000000000000
+ vec($_, 2, 8) = 4 == 262144 00000000000000000010000000000000
+ vec($_, 3, 8) = 4 == 67108864 00000000000000000000000000100000
+ vec($_, 0, 8) = 8 == 8 00010000000000000000000000000000
+ vec($_, 1, 8) = 8 == 2048 00000000000100000000000000000000
+ vec($_, 2, 8) = 8 == 524288 00000000000000000001000000000000
+ vec($_, 3, 8) = 8 == 134217728 00000000000000000000000000010000
+ vec($_, 0, 8) = 16 == 16 00001000000000000000000000000000
+ vec($_, 1, 8) = 16 == 4096 00000000000010000000000000000000
+ vec($_, 2, 8) = 16 == 1048576 00000000000000000000100000000000
+ vec($_, 3, 8) = 16 == 268435456 00000000000000000000000000001000
+ vec($_, 0, 8) = 32 == 32 00000100000000000000000000000000
+ vec($_, 1, 8) = 32 == 8192 00000000000001000000000000000000
+ vec($_, 2, 8) = 32 == 2097152 00000000000000000000010000000000
+ vec($_, 3, 8) = 32 == 536870912 00000000000000000000000000000100
+ vec($_, 0, 8) = 64 == 64 00000010000000000000000000000000
+ vec($_, 1, 8) = 64 == 16384 00000000000000100000000000000000
+ vec($_, 2, 8) = 64 == 4194304 00000000000000000000001000000000
+ vec($_, 3, 8) = 64 == 1073741824 00000000000000000000000000000010
+ vec($_, 0, 8) = 128 == 128 00000001000000000000000000000000
+ vec($_, 1, 8) = 128 == 32768 00000000000000010000000000000000
+ vec($_, 2, 8) = 128 == 8388608 00000000000000000000000100000000
+ vec($_, 3, 8) = 128 == 2147483648 00000000000000000000000000000001
+
=item wait
Behaves like the wait(2) system call on your system: it waits for a child
len);>. It might work with your compiler, but it won't work for everyone.
Break this sort of statement up into separate assignments:
+ SV *s;
STRLEN len;
char * ptr;
- ptr = SvPV(len);
+ ptr = SvPV(s, len);
foo(ptr, len);
If you want to know if the scalar value is TRUE, you can use:
SAVEDELETE(PL_defstash, savepv(tmpbuf), strlen(tmpbuf));
-=item C<SAVEDESTRUCTOR(f,p)>
+=item C<SAVEDESTRUCTOR(DESTRUCTORFUNC_NOCONTEXT_t f, void *p)>
At the end of I<pseudo-block> the function C<f> is called with the
-only argument (of type C<void*>) C<p>.
+only argument C<p>.
+
+=item C<SAVEDESTRUCTOR_X(DESTRUCTORFUNC_t f, void *p)>
+
+At the end of I<pseudo-block> the function C<f> is called with the
+implicit context argument (if any), and C<p>.
=item C<SAVESTACK_POS()>
Test two strings to see if they are equal. The C<len> parameter indicates
the number of bytes to compare. Returns true or false.
+(A wrapper for C<strncmp>).
- int strnEQ( char *s1, char *s2 )
+ int strnEQ( const char *s1, const char *s2, size_t len )
=item strnNE
Test two strings to see if they are different. The C<len> parameter
indicates the number of bytes to compare. Returns true or false.
+(A wrapper for C<strncmp>).
- int strnNE( char *s1, char *s2, int len )
+ int strnNE( const char *s1, const char *s2, size_t len )
=item sv_2mortal
--- /dev/null
+=head1 NAME
+
+perlhack - How to hack at the Perl internals
+
+=head1 DESCRIPTION
+
+This document attempts to explain how Perl development takes place,
+and ends with some suggestions for people wanting to become bona fide
+porters.
+
+The perl5-porters mailing list is where the Perl standard distribution
+is maintained and developed. The list can get anywhere from 10 to 150
+messages a day, depending on the heatedness of the debate. Most days
+there are two or three patches, extensions, features, or bugs being
+discussed at a time.
+
+A searchable archive of the list is at:
+
+ http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/
+
+The list is also archived under the usenet group name
+C<perl.porters-gw> at:
+
+ http://www.deja.com/
+
+List subscribers (the porters themselves) come in several flavours.
+Some are quiet curious lurkers, who rarely pitch in and instead watch
+the ongoing development to ensure they're forewarned of new changes or
+features in Perl. Some are representatives of vendors, who are there
+to make sure that Perl continues to compile and work on their
+platforms. Some patch any reported bug that they know how to fix,
+some are actively patching their pet area (threads, Win32, the regexp
+engine), while others seem to do nothing but complain. In other
+words, it's your usual mix of technical people.
+
+Over this group of porters presides Larry Wall. He has the final word
+in what does and does not change in the Perl language. Various
+releases of Perl are shepherded by a ``pumpking'', a porter
+responsible for gathering patches, deciding on a patch-by-patch
+feature-by-feature basis what will and will not go into the release.
+For instance, Gurusamy Sarathy is the pumpking for the 5.6 release of
+Perl.
+
+In addition, various people are pumpkings for different things. For
+instance, Andy Dougherty and Jarkko Hietaniemi share the I<Configure>
+pumpkin, and Tom Christiansen is the documentation pumpking.
+
+Larry sees Perl development along the lines of the US government:
+there's the Legislature (the porters), the Executive branch (the
+pumpkings), and the Supreme Court (Larry). The legislature can
+discuss and submit patches to the executive branch all they like, but
+the executive branch is free to veto them. Rarely, the Supreme Court
+will side with the executive branch over the legislature, or the
+legislature over the executive branch. Mostly, however, the
+legislature and the executive branch are supposed to get along and
+work out their differences without impeachment or court cases.
+
+You might sometimes see reference to Rule 1 and Rule 2. Larry's power
+as Supreme Court is expressed in The Rules:
+
+=over 4
+
+=item 1
+
+Larry is always by definition right about how Perl should behave.
+This means he has final veto power on the core functionality.
+
+=item 2
+
+Larry is allowed to change his mind about any matter at a later date,
+regardless of whether he previously invoked Rule 1.
+
+=back
+
+Got that? Larry is always right, even when he was wrong. It's rare
+to see either Rule exercised, but they are often alluded to.
+
+New features and extensions to the language are contentious, because
+the criteria used by the pumpkings, Larry, and other porters to decide
+which features should be implemented and incorporated are not codified
+in a few small design goals as with some other languages. Instead,
+the heuristics are flexible and often difficult to fathom. Here is
+one person's list, roughly in decreasing order of importance, of
+heuristics that new features have to be weighed against:
+
+=over 4
+
+=item Does concept match the general goals of Perl?
+
+These haven't been written anywhere in stone, but one approximation
+is:
+
+ 1. Keep it fast, simple, and useful.
+ 2. Keep features/concepts as orthogonal as possible.
+ 3. No arbitrary limits (platforms, data sizes, cultures).
+ 4. Keep it open and exciting to use/patch/advocate Perl everywhere.
+ 5. Either assimilate new technologies, or build bridges to them.
+
+=item Where is the implementation?
+
+All the talk in the world is useless without an implementation. In
+almost every case, the person or people who argue for a new feature
+will be expected to be the ones who implement it. Porters capable
+of coding new features have their own agendas, and are not available
+to implement your (possibly good) idea.
+
+=item Backwards compatibility
+
+It's a cardinal sin to break existing Perl programs. New warnings are
+contentious--some say that a program that emits warnings is not
+broken, while others say it is. Adding keywords has the potential to
+break programs, changing the meaning of existing token sequences or
+functions might break programs.
+
+=item Could it be a module instead?
+
+Perl 5 has extension mechanisms, modules and XS, specifically to avoid
+the need to keep changing the Perl interpreter. You can write modules
+that export functions, you can give those functions prototypes so they
+can be called like built-in functions, you can even write XS code to
+mess with the runtime data structures of the Perl interpreter if you
+want to implement really complicated things. If it can be done in a
+module instead of in the core, it's highly unlikely to be added.
+
+=item Is the feature generic enough?
+
+Is this something that only the submitter wants added to the language,
+or would it be broadly useful? Sometimes, instead of adding a feature
+with a tight focus, the porters might decide to wait until someone
+implements the more generalized feature. For instance, instead of
+implementing a ``delayed evaluation'' feature, the porters are waiting
+for a macro system that would permit delayed evaluation and much more.
+
+=item Does it potentially introduce new bugs?
+
+Radical rewrites of large chunks of the Perl interpreter have the
+potential to introduce new bugs. The smaller and more localized the
+change, the better.
+
+=item Does it preclude other desirable features?
+
+A patch is likely to be rejected if it closes off future avenues of
+development. For instance, a patch that placed a true and final
+interpretation on prototypes is likely to be rejected because there
+are still options for the future of prototypes that haven't been
+addressed.
+
+=item Is the implementation robust?
+
+Good patches (tight code, complete, correct) stand more chance of
+going in. Sloppy or incorrect patches might be placed on the back
+burner until the pumpking has time to fix, or might be discarded
+altogether without further notice.
+
+=item Is the implementation generic enough to be portable?
+
+The worst patches make use of a system-specific features. It's highly
+unlikely that nonportable additions to the Perl language will be
+accepted.
+
+=item Is there enough documentation?
+
+Patches without documentation are probably ill-thought out or
+incomplete. Nothing can be added without documentation, so submitting
+a patch for the appropriate manpages as well as the source code is
+always a good idea. If appropriate, patches should add to the test
+suite as well.
+
+=item Is there another way to do it?
+
+Larry said ``Although the Perl Slogan is I<There's More Than One Way
+to Do It>, I hesitate to make 10 ways to do something''. This is a
+tricky heuristic to navigate, though--one man's essential addition is
+another man's pointless cruft.
+
+=item Does it create too much work?
+
+Work for the pumpking, work for Perl programmers, work for module
+authors, ... Perl is supposed to be easy.
+
+=item Patches speak louder than words
+
+Working code is always preferred to pie-in-the-sky ideas. A patch to
+add a feature stands a much higher chance of making it to the language
+than does a random feature request, no matter how fervently argued the
+request might be. This ties into ``Will it be useful?'', as the fact
+that someone took the time to make the patch demonstrates a strong
+desire for the feature.
+
+=back
+
+If you're on the list, you might hear the word ``core'' bandied
+around. It refers to the standard distribution. ``Hacking on the
+core'' means you're changing the C source code to the Perl
+interpreter. ``A core module'' is one that ships with Perl.
+
+The source code to the Perl interpreter, in its different versions, is
+kept in a repository managed by a revision control system (which is
+currently the Perforce program, see http://perforce.com/). The
+pumpkings and a few others have access to the repository to check in
+changes. Periodically the pumpking for the development version of Perl
+will release a new version, so the rest of the porters can see what's
+changed. Plans are underway for a repository viewer, and for
+anonymous CVS access to the latest versions.
+
+Always submit patches to I<perl5-porters@perl.org>. This lets other
+porters review your patch, which catches a surprising number of errors
+in patches. Either use the diff program (available in source code
+form from I<ftp://ftp.gnu.org/pub/gnu/>), or use Johan Vromans'
+I<makepatch> (available from I<CPAN/authors/id/JV/>). Unified diffs
+are preferred, but context diffs are accepted. Do not send RCS-style
+diffs or diffs without context lines. More information is given in
+the I<Porting/patching.pod> file in the Perl source distribution.
+Please patch against the latest B<development> version (e.g., if
+you're fixing a bug in the 5.005 track, patch against the latest
+5.005_5x version). Only patches that survive the heat of the
+development branch get applied to maintenance versions.
+
+Your patch should update the documentation and test suite.
+
+To report a bug in Perl, use the program I<perlbug> which comes with
+Perl (if you can't get Perl to work, send mail to the address
+I<perlbug@perl.com> or I<perlbug@perl.org>). Reporting bugs through
+I<perlbug> feeds into the automated bug-tracking system, access to
+which is provided through the web at I<http://bugs.perl.org/>. It
+often pays to check the archives of the perl5-porters mailing list to
+see whether the bug you're reporting has been reported before, and if
+so whether it was considered a bug. See above for the location of
+the searchable archives.
+
+The CPAN testers (I<http://testers.cpan.org/>) are a group of
+volunteers who test CPAN modules on a variety of platforms. Perl Labs
+(I<http://labs.perl.org/>) automatically tests Perl source releases on
+platforms and gives feedback to the CPAN testers mailing list. Both
+efforts welcome volunteers.
+
+To become an active and patching Perl porter, you'll need to learn how
+Perl works on the inside. Chip Salzenberg, a pumpking, has written
+articles on Perl internals for The Perl Journal
+(I<http://www.tpj.com/>) which explain how various parts of the Perl
+interpreter work. The C<perlguts> manpage explains the internal data
+structures. And, of course, the C source code (sometimes sparsely
+commented, sometimes commented well) is a great place to start (begin
+with C<perl.c> and see where it goes from there). A lot of the style
+of the Perl source is explained in the I<Porting/pumpkin.pod> file in
+the source distribution.
+
+It is essential that you be comfortable using a good debugger
+(e.g. gdb, dbx) before you can patch perl. Stepping through perl
+as it executes a script is perhaps the best (if sometimes tedious)
+way to gain a precise understanding of the overall architecture of
+the language.
+
+If you build a version of the Perl interpreter with C<-DDEBUGGING>,
+Perl's B<-D> commandline flag will cause copious debugging information
+to be emitted (see the C<perlrun> manpage). If you build a version of
+Perl with compiler debugging information (e.g. with the C compiler's
+C<-g> option instead of C<-O>) then you can step through the execution
+of the interpreter with your favourite C symbolic debugger, setting
+breakpoints on particular functions.
+
+It's a good idea to read and lurk for a while before chipping in.
+That way you'll get to see the dynamic of the conversations, learn the
+personalities of the players, and hopefully be better prepared to make
+a useful contribution when do you speak up.
+
+If after all this you still think you want to join the perl5-porters
+mailing list, send mail to I<perl5-porters-subscribe@perl.org>. To
+unsubscribe, send mail to I<perl5-porters-unsubscribe@perl.org>.
+
+=head1 AUTHOR
+
+This document was written by Nathan Torkington, and is maintained by
+the perl5-porters mailing list.
+
};
if ($@ and $@ !~ /alarm clock restart/) { die }
+If the operation being timed out is system() or qx(), this technique
+is liable to generate zombies. If this matters to you, you'll
+need to do your own fork() and exec(), and kill the errant child process.
+
For more complex signal handling, you might see the standard POSIX
module. Lamentably, this is almost entirely undocumented, but
the F<t/lib/posix.t> file from the Perl source distribution has some
perllexwarn - Perl Lexical Warnings
=head1 DESCRIPTION
-
+
The C<use warnings> pragma is a replacement for both the command line
flag B<-w> and the equivalent Perl variable, C<$^W>.
lexical warnings and C<$^W>, this section will describe how they interact.
How Lexical Warnings interact with B<-w>/C<$^W>:
-
+
=over 5
=item 1.
=item *
-If the decimal point character in the C<LC_NUMERIC> locale is
-surreptitiously changed from a dot to a comma, C<sprintf("%g",
-0.123456e3)> produces a string result of "123,456". Many people would
-interpret this as one hundred and twenty-three thousand, four hundred
-and fifty-six.
+Some systems are broken in that they allow the "C" locale to be
+overridden by users. If the decimal point character in the
+C<LC_NUMERIC> category of the "C" locale is surreptitiously changed
+from a dot to a comma, C<sprintf("%g", 0.123456e3)> produces a
+string result of "123,456". Many people would interpret this as
+one hundred and twenty-three thousand, four hundred and fifty-six.
=item *
expression match involving C<\w>, C<\W>, C<\s>, or C<\S>; or of
case-mapping with C<\l>, C<\L>,C<\u> or C<\U>.
-=item B<In-memory formatting function> (sprintf()):
-
-Result is tainted if C<use locale> is in effect.
-
=item B<Output formatting functions> (printf() and write()):
Success/failure result is never tainted.
=head2 Package Constructors and Destructors
-Three special subroutines act as package
-constructors and destructors. These are the C<BEGIN>, C<INIT>, and
-C<END> routines. The C<sub> is optional for these routines.
+Four special subroutines act as package constructors and destructors.
+These are the C<BEGIN>, C<STOP>, C<INIT>, and C<END> routines. The
+C<sub> is optional for these routines.
A C<BEGIN> subroutine is executed as soon as possible, that is, the moment
it is completely defined, even before the rest of the containing file
has run, it is immediately undefined and any code it used is returned to
Perl's memory pool. This means you can't ever explicitly call a C<BEGIN>.
-Similar to C<BEGIN> blocks, C<INIT> blocks are run just before the
-Perl runtime begins execution. For example, the code generators
-documented in L<perlcc> make use of C<INIT> blocks to initialize
-and resolve pointers to XSUBs.
-
-An C<END> subroutine is executed as late as possible, that is, when
-the interpreter is being exited, even if it is exiting as a result of
-a die() function. (But not if it's polymorphing into another program
-via C<exec>, or being blown out of the water by a signal--you have to
-trap that yourself (if you can).) You may have multiple C<END> blocks
-within a file--they will execute in reverse order of definition; that is:
-last in, first out (LIFO).
+An C<END> subroutine is executed as late as possible, that is, after
+perl has finished running the program and just before the interpreter
+is being exited, even if it is exiting as a result of a die() function.
+(But not if it's polymorphing into another program via C<exec>, or
+being blown out of the water by a signal--you have to trap that yourself
+(if you can).) You may have multiple C<END> blocks within a file--they
+will execute in reverse order of definition; that is: last in, first
+out (LIFO). C<END> blocks are not executed when you run perl with the
+C<-c> switch.
Inside an C<END> subroutine, C<$?> contains the value that the program is
going to pass to C<exit()>. You can modify C<$?> to change the exit
value of the program. Beware of changing C<$?> by accident (e.g. by
running something via C<system>).
+Similar to C<BEGIN> blocks, C<INIT> blocks are run just before the
+Perl runtime begins execution, in "first in, first out" (FIFO) order.
+For example, the code generators documented in L<perlcc> make use of
+C<INIT> blocks to initialize and resolve pointers to XSUBs.
+
+Similar to C<END> blocks, C<STOP> blocks are run just after the
+Perl compile phase ends and before the run time begins, in
+LIFO order. C<STOP> blocks are again useful in the Perl compiler
+suite to save the compiled state of the program.
+
When you use the B<-n> and B<-p> switches to Perl, C<BEGIN> and
C<END> work just as they do in B<awk>, as a degenerate case. As currently
implemented (and subject to change, since its inconvenient at best),
=item attributes
-set/get the attributes of a subroutine or variable
+Get/set subroutine or variable attributes
=item attrs
-set/get attributes of a subroutine (obsolescent)
+Set/get attributes of a subroutine (deprecated)
=item autouse
-postpone load of modules until a function is used
+Postpone load of modules until a function is used
=item base
Use MakeMaker's uninstalled version of a package
+=item caller
+
+Inherit pragmatic attributes from caller's context
+
+=item charnames
+
+Define character names for C<\N{named}> string literal escape.
+
=item constant
-declare constants
+Declare constants
=item diagnostics
-Perl compiler pragma to force verbose warning diagnostics
+Force verbose warning diagnostics
=item fields
-compile-time class fields
+Declare a class's attribute fields at compile-time
=item filetest
-control the filetest permission operators
+Control the filetest operators like C<-r>, C<-w> for AFS, etc.
=item integer
-compute arithmetic in integer instead of double
+Compute arithmetic in integer instead of double
=item less
-perl pragma to request less of something from the compiler
+Request less of something from the compiler (unimplemented)
=item lib
-manipulate @INC at compile time
+Manipulate @INC at compile time
=item locale
-use and avoid POSIX locales for built-in operations
+Use or avoid POSIX locales for built-in operations
=item ops
-restrict unsafe operations when compiling
+Restrict unsafe operations when compiling
=item overload
-Package for overloading perl operations
+Overload Perl operations
=item re
-alter regular expression behavior
+Alter regular expression behavior
=item sigtrap
-enable simple signal handling
+Enable simple signal handling
=item strict
-restrict unsafe constructs
+Restrict unsafe constructs
=item subs
-predeclare sub names
+Predeclare subroutine names
=item utf8
-turn on UTF-8 and Unicode support
+Turn on UTF-8 and Unicode support
=item vars
-predeclare global variable names
+Predeclare global variable names (obsoleted by our())
=item warnings
-control optional warnings
-
-=item vmsish
-
-control VMS-specific language features
+Control optional warnings
=back
=item AnyDBM_File
-provide framework for multiple DBMs
+Provide framework for multiple DBM libraries
=item AutoLoader
-load subroutines only on demand
+Load subroutines only on demand
=item AutoSplit
-split a package for autoloading
+Split a package for autoloading
=item B
-The Perl Compiler; See also L<perlcc>.
+Guts of the Perl code generator (aka compiler)
=item B::Asmdata
=item B::Deparse
-Perl compiler backend to produce perl code
+Perl compiler backend to produce Perl code
=item B::Disassembler
=item B::Lint
-Perl lint
+Module to catch dubious constructs
=item B::Showlex
Helper module for CC backend
+B::Stash -- XXX NFI XXX
+
=item B::Terse
Walk Perl syntax tree, printing terse info about ops
=item Benchmark
-benchmark running times of code
+Benchmark running times of code
+
+=item ByteLoader
+
+Load byte-compiled Perl code
=item CGI
-Simple Common Gateway Interface Class
+Simple Common Gateway Interface class
=item CGI::Apache
CGI Interface for Fast CGI
+=item CGI::Pretty
+
+Module to produce nicely formatted HTML code
+
=item CGI::Push
Simple Interface to Server Push
=item CPAN
-query, download and build perl modules from CPAN sites
+Query, download, and build Perl modules from CPAN sites
=item CPAN::FirstTime
-Utility for CPAN::Config file Initialization
+Utility for CPAN::Config file initialization
=item CPAN::Nox
=item Carp
-warn of errors (from perspective of caller)
+Act like warn/die from perspective of caller
+
+=item Carp::Heavy
+
+Carp guts
=item Class::Struct
-declare struct-like datatypes as Perl classes
+Declare struct-like datatypes as Perl classes
=item Config
-access Perl configuration information
+Access Perl configuration information
=item Cwd
-get pathname of current working directory
+Get pathname of current working directory
=item DB
-programmatic interface to the Perl debugging API
+Programmatic interface to the Perl debugging API (experimental)
=item DB_File
=item Data::Dumper
-stringified perl data structures, suitable for both printing and C<eval>
+Serialize Perl data structures
+
+=item Devel::DProf
+
+A Perl execution profiler
=item Devel::Peek
=item Devel::SelfStubber
-generate stubs for a SelfLoading module
+Generate stubs for a SelfLoading module
=item DirHandle
-supply object methods for directory handles
+Supply object methods for directory handles
=item Dumpvalue
-provides screen dump of Perl data.
+Provide screen dump of Perl data
=item DynaLoader
=item English
-use nice English (or awk) names for ugly punctuation variables
+Use English (or awk) names for ugly punctuation variables
=item Env
-perl module that imports environment variables
+Access environment variables as regular ones
=item Errno
-System errno constants
+Load the libc errno.h defines
=item Exporter
-Implements default import method for modules
+Implement default import method for modules
+
+=item Exporter::Heavy
+
+Exporter guts
=item ExtUtils::Command
-utilities to replace common UNIX commands in Makefiles etc.
+Utilities to replace common Unix commands in Makefiles etc.
=item ExtUtils::Embed
-Utilities for embedding Perl in C/C++ applications
+Utilities for embedding Perl in C/C++ programs
=item ExtUtils::Install
-install files from here to there
+Install files from here to there
=item ExtUtils::Installed
=item ExtUtils::Liblist
-determine libraries to use and how to use them
+Determine libraries to use and how to use them
+
+=item ExtUtils::MM_Cygwin
+
+Methods to override Unix behavior in ExtUtils::MakeMaker
=item ExtUtils::MM_OS2
-methods to override UN*X behavior in ExtUtils::MakeMaker
+Methods to override Unix behavior in ExtUtils::MakeMaker
=item ExtUtils::MM_Unix
-methods used by ExtUtils::MakeMaker
+Methods used by ExtUtils::MakeMaker
=item ExtUtils::MM_VMS
-methods to override UN*X behavior in ExtUtils::MakeMaker
+Methods to override Unix behavior in ExtUtils::MakeMaker
=item ExtUtils::MM_Win32
-methods to override UN*X behavior in ExtUtils::MakeMaker
+Methods to override Unix behavior in ExtUtils::MakeMaker
=item ExtUtils::MakeMaker
-create an extension Makefile
+Create an extension Makefile
=item ExtUtils::Manifest
-utilities to write and check a MANIFEST file
-
-=item ExtUtils::Miniperl
+Utilities to write and check a MANIFEST file
-write the C code for perlmain.c
+ExtUtils::Miniperl, writemain - Write the C code for perlmain.c
=item ExtUtils::Mkbootstrap
-make a bootstrap file for use by DynaLoader
+Make a bootstrap file for use by DynaLoader
=item ExtUtils::Mksymlists
-write linker options files for dynamic extension
+Write linker options files for dynamic extension
=item ExtUtils::Packlist
-manage .packlist files
+Manage .packlist files
=item ExtUtils::testlib
-add blib/* directories to @INC
+Add blib/* directories to @INC
=item Fatal
-replace functions with equivalents which succeed or die
+Replace functions with equivalents which succeed or die
=item Fcntl
-load the C Fcntl.h defines
+Load the libc fcntl.h defines
=item File::Basename
-split a pathname into pieces
+Split a pathname into pieces
+
+=item File::CheckTree
+
+Run many filetest checks on a tree
=item File::Compare
=item File::DosGlob
-DOS like globbing and then some
+DOS-like globbing and then some
=item File::Find
-traverse a file tree
+Traverse a file tree
+
+=item File::Glob
+
+Perl extension for BSD filename globbing
=item File::Path
-create or remove a series of directories
+Create or remove a series of directories
=item File::Spec
-portably perform operations on file names
+Portably perform operations on file names
=item File::Spec::Functions
-portably perform operations on file names
+Portably perform operations on file names
=item File::Spec::Mac
=item File::Spec::OS2
-methods for OS/2 file specs
+Methods for OS/2 file specs
=item File::Spec::Unix
-methods used by File::Spec
+Methods used by File::Spec
=item File::Spec::VMS
-methods for VMS file specs
+Methods for VMS file specs
=item File::Spec::Win32
-methods for Win32 file specs
+Methods for Win32 file specs
=item File::stat
-by-name interface to Perl's built-in stat() functions
+By-name interface to Perl's built-in stat() functions
=item FileCache
-keep more files open than the system permits
+Keep more files open than the system permits
=item FileHandle
-supply object methods for filehandles
+Supply object methods for filehandles
=item FindBin
-Locate directory of original perl script
+Locate installation directory of running Perl program
=item GDBM_File
-Perl5 access to the gdbm library.
+Access to the gdbm library
=item Getopt::Long
-extended processing of command line options
+Extended processing of command line options
=item Getopt::Std
=item I18N::Collate
-compare 8-bit scalar data according to the current locale
+Compare 8-bit scalar data according to current locale
=item IO
-load various IO modules
+Front-end to load various IO modules
=item IO::Dir
-supply object methods for directory handles
+Supply object methods for directory handles
=item IO::File
-supply object methods for filehandles
+Supply object methods for filehandles
=item IO::Handle
-supply object methods for I/O handles
+Supply object methods for I/O handles
=item IO::Pipe
-supply object methods for pipes
+Supply object methods for pipes
=item IO::Poll
=item IO::Seekable
-supply seek based methods for I/O objects
+Supply seek based methods for I/O objects
=item IO::Select
=item IPC::Open2
-open a process for both reading and writing
+Open a process for both reading and writing
=item IPC::Open3
-open a process for reading, writing, and error handling
+Open a process for reading, writing, and error handling
=item IPC::Semaphore
=item Math::Complex
-complex numbers and associated mathematical functions
+Complex numbers and associated mathematical functions
=item Math::Trig
-trigonometric functions
-
-=item NDBM_File
-
-Tied access to ndbm files
+Trigonometric functions
=item Net::Ping
-check a remote host for reachability
+Check a remote host for reachability
=item Net::hostent
-by-name interface to Perl's built-in gethost*() functions
+By-name interface to Perl's built-in gethost*() functions
=item Net::netent
-by-name interface to Perl's built-in getnet*() functions
+By-name interface to Perl's built-in getnet*() functions
=item Net::protoent
-by-name interface to Perl's built-in getproto*() functions
+By-name interface to Perl's built-in getproto*() functions
=item Net::servent
-by-name interface to Perl's built-in getserv*() functions
+By-name interface to Perl's built-in getserv*() functions
=item O
=item Opcode
-Disable named opcodes when compiling perl code
+Disable named opcodes when compiling Perl code
=item POSIX
Perl interface to IEEE Std 1003.1
+=item Pod::Checker
+
+Check pod documents for syntax errors
+
=item Pod::Html
-module to convert pod files to HTML
+Module to convert pod files to HTML
+
+=item Pod::InputObjects
+
+Manage POD objects
+
+=item Pod::Man
+
+Convert POD data to formatted *roff input
+
+=item Pod::Parser
+
+Base class for creating POD filters and translators
+
+=item Pod::Select
+
+Extract selected sections of POD from input
=item Pod::Text
-convert POD data to formatted ASCII text
+Convert POD data to formatted ASCII text
+
+=item Pod::Text::Color
+
+Convert POD data to formatted color ASCII text
+
+=item Pod::Usage
+
+Print a usage message from embedded pod documentation
=item SDBM_File
=item Search::Dict
-search for key in dictionary file
+Search for key in dictionary file
=item SelectSaver
-save and restore selected file handle
+Save and restore selected file handle
=item SelfLoader
-load functions only on demand
+Load functions only on demand
=item Shell
-run shell commands transparently within perl
+Run shell commands transparently within Perl
=item Socket
-load the C socket.h defines and structure manipulators
+Load the libc socket.h defines and structure manipulators
=item Symbol
-manipulate Perl symbols and their names
+Manipulate Perl symbols and their names
=item Sys::Hostname
=item Sys::Syslog
-Perl interface to the UNIX syslog(3) calls
+Interface to the libc syslog(3) calls
=item Term::Cap
-Perl termcap interface
+Termcap interface
=item Term::Complete
-Perl word completion module
+Word completion module
=item Term::ReadLine
-Perl interface to various C<readline> packages.
+Interface to various `readline' packages.
=item Test
-provides a simple framework for writing test scripts
+Provides a simple framework for writing test scripts
=item Test::Harness
-run perl standard test scripts with statistics
+Run Perl standard test scripts with statistics
=item Text::Abbrev
-create an abbreviation table from a list
+Create an abbreviation table from a list
=item Text::ParseWords
-parse text into an array of tokens or array of arrays
+Parse text into a list of tokens or array of arrays
=item Text::Soundex
-Implementation of the Soundex Algorithm as Described by Knuth
+Implementation of the Soundex Algorithm as described by Knuth
-=item Text::Tabs -- expand and unexpand tabs per the unix expand(1) and unexpand(1)
+Text::Tabs -- expand and unexpand tabs per expand(1) and unexpand(1)
=item Text::Wrap
-line wrapping to form simple paragraphs
-
-=item Thread
-
-multithreading
-
-=item Thread::Queue
-
-thread-safe queues
-
-=item Thread::Semaphore
-
-thread-safe semaphores
-
-=item Thread::Signal
-
-Start a thread which runs signal handlers reliably
-
-=item Thread::Specific
-
-thread-specific keys
+Line wrapping to form simple paragraphs
=item Tie::Array
-base class for tied arrays
+Base class for tied arrays
=item Tie::Handle
-base class definitions for tied handles
+Base class definitions for tied handles
-=item Tie::Hash, Tie::StdHash
+=item Tie::Hash
-base class definitions for tied hashes
+Base class definitions for tied hashes
=item Tie::RefHash
-use references as hash keys
+Use references as hash keys
-=item Tie::Scalar, Tie::StdScalar
+=item Tie::Scalar
-base class definitions for tied scalars
+Base class definitions for tied scalars
=item Tie::SubstrHash
=item Time::Local
-efficiently compute time from local and GMT time
+Efficiently compute time from local and GMT time
=item Time::gmtime
-by-name interface to Perl's built-in gmtime() function
+By-name interface to Perl's built-in gmtime() function
=item Time::localtime
-by-name interface to Perl's built-in localtime() function
+By-name interface to Perl's built-in localtime() function
=item Time::tm
-internal object used by Time::gmtime and Time::localtime
+Internal object used by Time::gmtime and Time::localtime
=item UNIVERSAL
-base class for ALL classes (blessed references)
+Base class for ALL classes (blessed references)
=item User::grent
-by-name interface to Perl's built-in getgr*() functions
+By-name interface to Perl's built-in getgr*() functions
=item User::pwent
-by-name interface to Perl's built-in getpw*() functions
+By-name interface to Perl's built-in getpw*() functions
=back
=item Africa
- South Africa ftp://ftp.is.co.za/programming/perl/CPAN/
+ South Africa ftp://ftp.is.co.za/programming/perl/CPAN/
+ ftp://ftp.saix.net/pub/CPAN/
+ ftp://ftp.sun.ac.za/CPAN/
ftp://ftpza.co.za/pub/mirrors/cpan/
=item Asia
- China ftp://freesoft.cei.gov.cn/pub/languages/perl/CPAN/
- Hong Kong ftp://ftp.hkstar.com/pub/CPAN/
- Israel ftp://bioinfo.weizmann.ac.il/pub/software/perl/CPAN/
- Japan ftp://ftp.dti.ad.jp/pub/lang/CPAN/
+ China ftp://freesoft.cei.gov.cn/pub/languages/perl/CPAN/
+ Hong Kong ftp://ftp.hkstar.com/pub/CPAN/
+ ftp://ftp.pacific.net.hk/pub/mirror/CPAN/
+ Indonesia ftp://malone.piksi.itb.ac.id/pub/CPAN/
+ Israel ftp://bioinfo.weizmann.ac.il/pub/software/perl/CPAN/
+ Japan ftp://ftp.dti.ad.jp/pub/lang/CPAN/
ftp://ftp.jaist.ac.jp/pub/lang/perl/CPAN/
ftp://ftp.lab.kdd.co.jp/lang/perl/CPAN/
ftp://ftp.meisei-u.ac.jp/pub/CPAN/
ftp://ftp.ring.gr.jp/pub/lang/perl/CPAN/
ftp://mirror.nucba.ac.jp/mirror/Perl/
- Singapore ftp://ftp.nus.edu.sg/pub/unix/perl/CPAN/
- South Korea ftp://ftp.bora.net/pub/CPAN/
+ Singapore ftp://ftp.nus.edu.sg/pub/unix/perl/CPAN/
+ South Korea ftp://ftp.bora.net/pub/CPAN/
+ ftp://ftp.kornet.net/pub/CPAN/
ftp://ftp.nuri.net/pub/CPAN/
- Taiwan ftp://ftp.wownet.net/pub2/PERL/
+ Taiwan ftp://coda.nctu.edu.tw/computer-languages/perl/CPAN/
+ ftp://ftp.ee.ncku.edu.tw/pub3/perl/CPAN/
+ ftp://ftp.wownet.net/pub2/PERL/
ftp://ftp1.sinica.edu.tw/pub1/perl/CPAN/
- Thailand ftp://ftp.cs.riubon.ac.th/pub/mirrors/CPAN/
+ Thailand ftp://ftp.cs.riubon.ac.th/pub/mirrors/CPAN/
ftp://ftp.nectec.or.th/pub/mirrors/CPAN/
=item Australasia
- Australia ftp://cpan.topend.com.au/pub/CPAN/
+ Australia ftp://cpan.topend.com.au/pub/CPAN/
ftp://ftp.labyrinth.net.au/pub/perl/CPAN/
ftp://ftp.sage-au.org.au/pub/compilers/perl/CPAN/
ftp://mirror.aarnet.edu.au/pub/perl/CPAN/
- New Zealand ftp://ftp.auckland.ac.nz/pub/perl/CPAN/
+ New Zealand ftp://ftp.auckland.ac.nz/pub/perl/CPAN/
ftp://sunsite.net.nz/pub/languages/perl/CPAN/
-Central America
+=item Central America
- Costa Rica ftp://ftp.ucr.ac.cr/pub/Unix/CPAN/
+ Costa Rica ftp://ftp.ucr.ac.cr/pub/Unix/CPAN/
=item Europe
- Austria ftp://ftp.tuwien.ac.at/pub/languages/perl/CPAN/
- Belgium ftp://ftp.kulnet.kuleuven.ac.be/pub/mirror/CPAN/
- Bulgaria ftp://ftp.ntrl.net/pub/mirrors/CPAN/
- Croatia ftp://ftp.linux.hr/pub/CPAN/
- Czech Republic ftp://ftp.fi.muni.cz/pub/perl/
+ Austria ftp://ftp.tuwien.ac.at/pub/languages/perl/CPAN/
+ Belgium ftp://ftp.kulnet.kuleuven.ac.be/pub/mirror/CPAN/
+ Bulgaria ftp://ftp.ntrl.net/pub/mirrors/CPAN/
+ Croatia ftp://ftp.linux.hr/pub/CPAN/
+ Czech Republic ftp://ftp.fi.muni.cz/pub/perl/
ftp://sunsite.mff.cuni.cz/Languages/Perl/CPAN/
- Denmark ftp://sunsite.auc.dk/pub/languages/perl/CPAN/
- Estonia ftp://ftp.ut.ee/pub/languages/perl/CPAN/
- Finland ftp://ftp.funet.fi/pub/languages/perl/CPAN/
- France ftp://ftp.lip6.fr/pub/perl/CPAN/
+ Denmark ftp://sunsite.auc.dk/pub/languages/perl/CPAN/
+ Estonia ftp://ftp.ut.ee/pub/languages/perl/CPAN/
+ Finland ftp://ftp.funet.fi/pub/languages/perl/CPAN/
+ France ftp://ftp.lip6.fr/pub/perl/CPAN/
ftp://ftp.oleane.net/pub/mirrors/CPAN/
ftp://ftp.pasteur.fr/pub/computing/CPAN/
- Germany ftp://ftp.archive.de.uu.net/pub/CPAN/
+ ftp://ftp.uvsq.fr/pub/perl/CPAN/
+ Germany ftp://ftp.archive.de.uu.net/pub/CPAN/
ftp://ftp.gmd.de/packages/CPAN/
ftp://ftp.gwdg.de/pub/languages/perl/CPAN/
ftp://ftp.leo.org/pub/comp/programming/languages/script/perl/CPAN/
ftp://ftp.rz.ruhr-uni-bochum.de/pub/CPAN/
ftp://ftp.uni-erlangen.de/pub/source/CPAN/
ftp://ftp.uni-hamburg.de/pub/soft/lang/perl/CPAN/
- Greece ftp://ftp.ntua.gr/pub/lang/perl/
- Hungary ftp://ftp.kfki.hu/pub/packages/perl/CPAN/
- Ireland ftp://sunsite.compapp.dcu.ie/pub/perl/
- Italy ftp://cis.uniRoma2.it/CPAN/
+ Greece ftp://ftp.ntua.gr/pub/lang/perl/
+ Hungary ftp://ftp.kfki.hu/pub/packages/perl/CPAN/
+ Iceland ftp://ftp.gm.is/pub/CPAN/
+ Ireland ftp://cpan.indigo.ie/pub/CPAN/
+ ftp://sunsite.compapp.dcu.ie/pub/perl/
+ Italy ftp://cis.uniRoma2.it/CPAN/
ftp://ftp.flashnet.it/pub/CPAN/
ftp://ftp.unina.it/pub/Other/CPAN/
ftp://ftp.unipi.it/pub/mirror/perl/CPAN/
- Netherlands ftp://ftp.cs.uu.nl/mirror/CPAN/
+ Netherlands ftp://ftp.cs.uu.nl/mirror/CPAN/
ftp://ftp.EU.net/packages/cpan/
ftp://ftp.nluug.nl/pub/languages/perl/CPAN/
- Norway ftp://ftp.uit.no/pub/languages/perl/cpan/
+ Norway ftp://ftp.uit.no/pub/languages/perl/cpan/
ftp://sunsite.uio.no/pub/languages/perl/CPAN/
- Poland ftp://ftp.man.szczecin.pl/pub/perl/CPAN/
+ Poland ftp://ftp.man.szczecin.pl/pub/perl/CPAN/
ftp://ftp.man.torun.pl/pub/doc/CPAN/
ftp://ftp.pk.edu.pl/pub/lang/perl/CPAN/
ftp://sunsite.icm.edu.pl/pub/CPAN/
- Portugal ftp://ftp.ci.uminho.pt/pub/mirrors/cpan/
+ Portugal ftp://ftp.ci.uminho.pt/pub/mirrors/cpan/
ftp://ftp.ist.utl.pt/pub/CPAN/
ftp://ftp.ua.pt/pub/CPAN/
- Romania ftp://ftp.dntis.ro/pub/mirrors/perl-cpan/
+ Romania ftp://ftp.dntis.ro/pub/mirrors/perl-cpan/
ftp://ftp.dnttm.ro/pub/CPAN/
Russia ftp://ftp.chg.ru/pub/lang/perl/CPAN/
ftp://ftp.sai.msu.su/pub/lang/perl/CPAN/
- Slovakia ftp://ftp.entry.sk/pub/languages/perl/CPAN/
- Slovenia ftp://ftp.arnes.si/software/perl/CPAN/
- Spain ftp://ftp.etse.urv.es/pub/perl/
+ Slovakia ftp://ftp.entry.sk/pub/languages/perl/CPAN/
+ Slovenia ftp://ftp.arnes.si/software/perl/CPAN/
+ Spain ftp://ftp.etse.urv.es/pub/perl/
ftp://ftp.rediris.es/mirror/CPAN/
- Sweden ftp://ftp.sunet.se/pub/lang/perl/CPAN/
- Switzerland ftp://sunsite.cnlab-switch.ch/mirror/CPAN/
- Turkey ftp://sunsite.bilkent.edu.tr/pub/languages/CPAN/
- United Kingdom ftp://ftp.demon.co.uk/pub/mirrors/perl/CPAN/
+ Sweden ftp://ftp.sunet.se/pub/lang/perl/CPAN/
+ Switzerland ftp://sunsite.cnlab-switch.ch/mirror/CPAN/
+ Turkey ftp://sunsite.bilkent.edu.tr/pub/languages/CPAN/
+ United Kingdom ftp://ftp.demon.co.uk/pub/mirrors/perl/CPAN/
ftp://ftp.flirble.org/pub/languages/perl/CPAN/
+ ftp://ftp.mirror.ac.uk/sites/ftp.funet.fi/pub/languages/perl/CPAN/
ftp://ftp.plig.org/pub/CPAN/
ftp://sunsite.doc.ic.ac.uk/packages/CPAN/
- ftp://unix.hensa.ac.uk/mirrors/perl-CPAN/
=item North America
- Alberta ftp://sunsite.ualberta.ca/pub/Mirror/CPAN/
+ Alberta ftp://sunsite.ualberta.ca/pub/Mirror/CPAN/
+ California ftp://cpan.nas.nasa.gov/pub/perl/CPAN/
+ ftp://cpan.valueclick.com/CPAN/
+ ftp://ftp.cdrom.com/pub/perl/CPAN/
+ ftp://ftp.digital.com/pub/plan/perl/CPAN/
California ftp://cpan.nas.nasa.gov/pub/perl/CPAN/
+ ftp://cpan.valueclick.com/CPAN/
ftp://ftp.cdrom.com/pub/perl/CPAN/
ftp://ftp.digital.com/pub/plan/perl/CPAN/
- Colorado ftp://ftp.cs.colorado.edu/pub/perl/CPAN/
- Florida ftp://ftp.cise.ufl.edu/pub/perl/CPAN/
- Illinois ftp://uiarchive.uiuc.edu/pub/lang/perl/CPAN/
- Indiana ftp://csociety-ftp.ecn.purdue.edu/pub/CPAN/
+ Colorado ftp://ftp.cs.colorado.edu/pub/perl/CPAN/
+ Florida ftp://ftp.cise.ufl.edu/pub/perl/CPAN/
+ Illinois ftp://uiarchive.uiuc.edu/pub/lang/perl/CPAN/
+ Indiana ftp://csociety-ftp.ecn.purdue.edu/pub/CPAN/
ftp://ftp.uwsg.indiana.edu/pub/perl/CPAN/
- Manitoba ftp://theory.uwinnipeg.ca/pub/CPAN/
- Massachusetts ftp://ftp.ccs.neu.edu/net/mirrors/ftp.funet.fi/pub/languages/perl/CPAN/
+ Kentucky ftp://ftp.uky.edu/CPAN/
+ Manitoba ftp://theoryx5.uwinnipeg.ca/pub/CPAN/
+ Massachusetts ftp://ftp.ccs.neu.edu/net/mirrors/ftp.funet.fi/pub/languages/perl/CPAN/
ftp://ftp.iguide.com/pub/mirrors/packages/perl/CPAN/
Mexico ftp://ftp.msg.com.mx/pub/CPAN/
Minnesota ftp://ftp.midearthbbs.com/CPAN/
- New York ftp://ftp.rge.com/pub/languages/perl/
- North Carolina ftp://ftp.duke.edu/pub/perl/
- Oklahoma ftp://ftp.ou.edu/mirrors/CPAN/
+ New York ftp://ftp.deao.net/pub/CPAN/
+ ftp://ftp.rge.com/pub/languages/perl/
+ ftp://ftp.tpj.com/pub/CPAN/
+ Nova Scotia ftp://cpan.chebucto.ns.ca/pub/CPAN/
+ North Carolina ftp://ftp.duke.edu/pub/perl/
+ Oklahoma ftp://ftp.ou.edu/mirrors/CPAN/
Ontario ftp://ftp.crc.ca/pub/packages/lang/perl/CPAN/
- Oregon ftp://ftp.orst.edu/pub/packages/CPAN/
- Pennsylvania ftp://ftp.epix.net/pub/languages/perl/
- Texas ftp://ftp.sedl.org/pub/mirrors/CPAN/
- Utah ftp://mirror.xmission.com/CPAN/
- Virginia ftp://ftp.perl.org/pub/perl/CPAN/
+ Oregon ftp://ftp.orst.edu/pub/packages/CPAN/
+ Pennsylvania ftp://ftp.epix.net/pub/languages/perl/
+ Tennessee ftp://ftp.sunsite.utk.edu/pub/CPAN/
+ Texas ftp://ftp.sedl.org/pub/mirrors/CPAN/
+ Utah ftp://mirror.xmission.com/CPAN/
+ Virginia ftp://ftp.perl.org/pub/perl/CPAN/
ftp://ruff.cs.jmu.edu/pub/CPAN/
Washington ftp://ftp-mirror.internap.com/pub/CPAN/
ftp://ftp.spu.edu/pub/CPAN/
=item South America
- Brazil ftp://cpan.if.usp.br/pub/mirror/CPAN/
+ Brazil ftp://cpan.if.usp.br/pub/mirror/CPAN/
+ ftp://ftp.matrix.com.br/pub/perl/
Chile ftp://sunsite.dcc.uchile.cl/pub/Lang/perl/CPAN/
=back
right argument is an expression rather than a search pattern,
substitution, or transliteration, it is interpreted as a search pattern at run
time. This can be is less efficient than an explicit search, because the
-pattern must be compiled every time the expression is evaluated.
+pattern must be compiled every time the expression is evaluated).
Binary "!~" is just like "=~" except the return value is negated in
the logical sense.
operator is not as well defined for negative operands, but it will
execute faster.
-Binary "x" is the repetition operator. In scalar context, it
-returns a string consisting of the left operand repeated the number of
-times specified by the right operand. In list context, if the left
-operand is a list in parentheses, it repeats the list.
+Binary "x" is the repetition operator. In scalar context or if the left
+operand is not enclosed in parentheses, it returns a string consisting
+of the left operand repeated the number of times specified by the right
+operand. In list context, if the left operand is enclosed in
+parentheses, it repeats the list.
print '-' x 80; # print row of dashes
Although these are grouped by family, they all have the precedence
of assignment.
-Unlike in C, the assignment operator produces a valid lvalue. Modifying
-an assignment is equivalent to doing the assignment and then modifying
-the variable that was assigned to. This is useful for modifying
-a copy of something, like this:
+Unlike in C, the scalar assignment operator produces a valid lvalue.
+Modifying an assignment is equivalent to doing the assignment and
+then modifying the variable that was assigned to. This is useful
+for modifying a copy of something, like this:
($tmp = $global) =~ tr [A-Z] [a-z];
$a += 2;
$a *= 3;
+Similarly, a list assignment in list context produces the list of
+lvalues assigned to, and a list assignment in scalar context returns
+the number of elements produced by the expression on the right hand
+side of the assignment.
+
=head2 Comma Operator
Binary "," is the comma operator. In scalar context it evaluates
my @compiled = map qr/$_/i, @$patterns;
grep {
my $success = 0;
- foreach my $pat @compiled {
+ foreach my $pat (@compiled) {
$success = 1, last if /$pat/;
}
$success;
qw(foo bar baz)
-is exactly equivalent to the list:
+is semantically equivalent to the list:
- ('foo', 'bar', 'baz')
+ 'foo', 'bar', 'baz'
Some frequently seen examples:
character. That's also the case for Perl. The C<open> call
remains the same--just its argument differs.
-If the leading character is a pipe symbol, C<open) starts up a new
+If the leading character is a pipe symbol, C<open> starts up a new
command and open a write-only filehandle leading into that command.
This lets you write into that handle and have what you write show up on
that command's standard input. For example:
the standard input. If you open minus for writing, it really means to
access the standard output.
-If minus can be used as the default input or default output? What happens
+If minus can be used as the default input or default output, what happens
if you open a pipe into or out of minus? What's the default command it
-would run? The same script as you're current running! This is actually
+would run? The same script as you're currently running! This is actually
a stealth C<fork> hidden inside an C<open> call. See L<perlipc/"Safe Pipe
Opens"> for details.
Recent versions of Perl have been ported to platforms such as OS/400 on
AS/400 minicomputers as well as OS/390, VM/ESA, and BS2000 for S/390
Mainframes. Such computers use EBCDIC character sets internally (usually
-Character Code Set ID 00819 for OS/400 and 1047 for S/390 systems).
-On the mainframe perl currently works under the "Unix system services
-for OS/390" (formerly known as OpenEdition), VM/ESA OpenEdition, or
-the BS200 POSIX system (BS2000 is supported in perl 5.006 and greater).
+Character Code Set ID 0037 for OS/400 and either 1047 or POSIX-BC for S/390
+systems). On the mainframe perl currently works under the "Unix system
+services for OS/390" (formerly known as OpenEdition), VM/ESA OpenEdition, or
+the BS200 POSIX-BC system (BS2000 is supported in perl 5.6 and greater).
As of R2.5 of USS for OS/390 and Version 2.3 of VM/ESA these Unix
sub-systems do not support the C<#!> shebang trick for script invocation.
Available only for socket handles. (S<RISC OS>)
-=item kill LIST
+=item kill SIGNAL, LIST
Not implemented, hence not useful for taint checking. (S<Mac OS>,
S<RISC OS>)
-Available only for process handles returned by the C<system(1, ...)>
-method of spawning a process. (Win32)
+Unlike Unix platforms, C<kill(0, $pid)> will actually terminate
+the process. (Win32)
=item link OLDFILE,NEWFILE
=over 4
+=item v1.45, 20 December 1999
+
+Small changes from 5.005_63 distribution, more changes to EBCDIC info.
+
=item v1.44, 19 July 1999
A bunch of updates from Peter Prymmer for C<$^O> values,
Matthias Neeracher E<lt>neeri@iis.ee.ethz.chE<gt>,
Gary Ng E<lt>71564.1743@CompuServe.COME<gt>,
Tom Phoenix E<lt>rootbeer@teleport.comE<gt>,
+AndrE<eacute> Pirard E<lt>A.Pirard@ulg.ac.beE<gt>,
Peter Prymmer E<lt>pvhp@forte.comE<gt>,
Hugo van der Sanden E<lt>hv@crypt0.demon.co.ukE<gt>,
-Gurusamy Sarathy E<lt>gsar@umich.eduE<gt>,
+Gurusamy Sarathy E<lt>gsar@activestate.comE<gt>,
Paul J. Schinder E<lt>schinder@pobox.comE<gt>,
Michael G Schwern E<lt>schwern@pobox.comE<gt>,
Dan Sugalski E<lt>sugalskd@ous.eduE<gt>,
=head1 VERSION
-Version 1.44, last modified 22 July 1999
+Version 1.45, last modified 20 December 1999
This is usually 32766 on the most common platforms. The actual limit can
be seen in the error message generated by code such as this:
- $_ **= $_ , / {$_} / for 2 .. 42;
+ $_ **= $_ , / {$_} / for 2 .. 42;
By default, a quantified subpattern is "greedy", that is, it will match as
many times as possible (given a particular starting location) while still
the same as matching an English word). If C<use locale> is in effect, the
list of alphabetic characters generated by C<\w> is taken from the
current locale. See L<perllocale>. You may use C<\w>, C<\W>, C<\s>, C<\S>,
-C<\d>, and C<\D> within character classes (though not as either end of
-a range). See L<utf8> for details about C<\pP>, C<\PP>, and C<\X>.
+C<\d>, and C<\D> within character classes, but if you try to use them
+as endpoints of a range, that's not a range, the "-" is understood literally.
+See L<utf8> for details about C<\pP>, C<\PP>, and C<\X>.
The POSIX character class syntax
- [:class:]
+ [:class:]
is also available. The available classes and their backslash
equivalents (if available) are as follows:
Note that the C<[]> are part of the C<[::]> construct, not part of the whole
character class. For example:
- [01[:alpha:]%]
+ [01[:alpha:]%]
matches one, zero, any alphabetic character, and the percentage sign.
=item cntrl
- Any control character. Usually characters that don't produce
- output as such but instead control the terminal somehow:
- for example newline and backspace are control characters.
- All characters with ord() less than 32 are most often control
- classified as characters.
+Any control character. Usually characters that don't produce output as
+such but instead control the terminal somehow: for example newline and
+backspace are control characters. All characters with ord() less than
+32 are most often control classified as characters.
=item graph
- Any alphanumeric or punctuation character.
+Any alphanumeric or punctuation character.
=item print
- Any alphanumeric or punctuation character or space.
+Any alphanumeric or punctuation character or space.
=item punct
- Any punctuation character.
+Any punctuation character.
=item xdigit
- Any hexadecimal digit. Though this may feel silly
- (/0-9a-f/i would work just fine) it is included
- for completeness.
+Any hexadecimal digit. Though this may feel silly (/0-9a-f/i would
+work just fine) it is included for completeness.
=item
=head2 Backtracking
+NOTE: This section presents an abstract approximation of regular
+expression behavior. For a more rigorous (and complicated) view of
+the rules involved in selecting a match among possible alternatives,
+see L<Combining pieces together>.
+
A fundamental feature of regular expression matching involves the
notion called I<backtracking>, which is currently used (when needed)
by all regular expression quantifiers, namely C<*>, C<*?>, C<+>,
first character after the "[" is "^", the class matches any character not
in the list. Within a list, the "-" character specifies a
range, so that C<a-z> represents all characters between "a" and "z",
-inclusive. If you want "-" itself to be a member of a class, put it
-at the start or end of the list, or escape it with a backslash. (The
+inclusive. If you want either "-" or "]" itself to be a member of a
+class, put it at the start of the list (possibly after a "^"), or
+escape it with a backslash. "-" is also taken literally when it is
+at the end of the list, just before the closing "]". (The
following all specify the same class of three characters: C<[-az]>,
C<[az-]>, and C<[a\-z]>. All are different from C<[a-z]>, which
specifies a class containing twenty-six characters.)
+Also, if you try to use the character classes C<\w>, C<\W>, C<\s>,
+C<\S>, C<\d>, or C<\D> as endpoints of a range, that's not a range,
+the "-" is understood literally.
Note also that the whole range idea is rather unportable between
character sets--and even within character sets they may cause results
Zero-length matches at the end of the previous match are ignored
during C<split>.
+=head2 Combining pieces together
+
+Each of the elementary pieces of regular expressions which were described
+before (such as C<ab> or C<\Z>) could match at most one substring
+at the given position of the input string. However, in a typical regular
+expression these elementary pieces are combined into more complicated
+patterns using combining operators C<ST>, C<S|T>, C<S*> etc
+(in these examples C<S> and C<T> are regular subexpressions).
+
+Such combinations can include alternatives, leading to a problem of choice:
+if we match a regular expression C<a|ab> against C<"abc">, will it match
+substring C<"a"> or C<"ab">? One way to describe which substring is
+actually matched is the concept of backtracking (see L<"Backtracking">).
+However, this description is too low-level and makes you think
+in terms of a particular implementation.
+
+Another description starts with notions of "better"/"worse". All the
+substrings which may be matched by the given regular expression can be
+sorted from the "best" match to the "worst" match, and it is the "best"
+match which is chosen. This substitutes the question of "what is chosen?"
+by the question of "which matches are better, and which are worse?".
+
+Again, for elementary pieces there is no such question, since at most
+one match at a given position is possible. This section describes the
+notion of better/worse for combining operators. In the description
+below C<S> and C<T> are regular subexpressions.
+
+=over
+
+=item C<ST>
+
+Consider two possible matches, C<AB> and C<A'B'>, C<A> and C<A'> are
+substrings which can be matched by C<S>, C<B> and C<B'> are substrings
+which can be matched by C<T>.
+
+If C<A> is better match for C<S> than C<A'>, C<AB> is a better
+match than C<A'B'>.
+
+If C<A> and C<A'> coincide: C<AB> is a better match than C<AB'> if
+C<B> is better match for C<T> than C<B'>.
+
+=item C<S|T>
+
+When C<S> can match, it is a better match than when only C<T> can match.
+
+Ordering of two matches for C<S> is the same as for C<S>. Similar for
+two matches for C<T>.
+
+=item C<S{REPEAT_COUNT}>
+
+Matches as C<SSS...S> (repeated as many times as necessary).
+
+=item C<S{min,max}>
+
+Matches as C<S{max}|S{max-1}|...|S{min+1}|S{min}>.
+
+=item C<S{min,max}?>
+
+Matches as C<S{min}|S{min+1}|...|S{max-1}|S{max}>.
+
+=item C<S?>, C<S*>, C<S+>
+
+Same as C<S{0,1}>, C<S{0,BIG_NUMBER}>, C<S{1,BIG_NUMBER}> respectively.
+
+=item C<S??>, C<S*?>, C<S+?>
+
+Same as C<S{0,1}?>, C<S{0,BIG_NUMBER}?>, C<S{1,BIG_NUMBER}?> respectively.
+
+=item C<(?E<gt>S)>
+
+Matches the best match for C<S> and only that.
+
+=item C<(?=S)>, C<(?<=S)>
+
+Only the best match for C<S> is considered. (This is important only if
+C<S> has capturing parentheses, and backreferences are used somewhere
+else in the whole regular expression.)
+
+=item C<(?!S)>, C<(?<!S)>
+
+For this grouping operator there is no need to describe the ordering, since
+only whether or not C<S> can match is important.
+
+=item C<(?p{ EXPR })>
+
+The ordering is the same as for the regular expression which is
+the result of EXPR.
+
+=item C<(?(condition)yes-pattern|no-pattern)>
+
+Recall that which of C<yes-pattern> or C<no-pattern> actually matches is
+already determined. The ordering of the matches is the same as for the
+chosen subexpression.
+
+=back
+
+The above recipes describe the ordering of matches I<at a given position>.
+One more rule is needed to understand how a match is determined for the
+whole regular expression: a match at an earlier position is always better
+than a match at a later position.
+
=head2 Creating custom RE engines
Overloaded constants (see L<overload>) provide a simple way to extend
print "$k => $v\n";
}
-Perl will raise an exception if you try to delete keys from a pseudo-hash
-or try to access nonexistent fields. For better performance, Perl can also
+Perl will raise an exception if you try to access nonexistent fields.
+For better performance, Perl can also
do the translation from field names to array indices at compile time for
typed object references. See L<fields>.
+There are two ways to check for the existence of a key in a
+pseudo-hash. The first is to use exists(). This checks to see if the
+given field has ever been set. It acts this way to match the behavior
+of a regular hash. For instance:
+
+ $phash = [{foo =>1, bar => 2, pants => 3}, 'FOO'];
+ $phash->{pants} = undef;
+
+ print exists $phash->{foo}; # true, 'foo' was set in the declaration
+ print exists $phash->{bar}; # false, 'bar' has not been used.
+ print exists $phash->{pants}; # true, your 'pants' have been touched
+
+The second is to use exists() on the hash reference sitting in the
+first array element. This checks to see if the given key is a valid
+field in the pseudo-hash.
+
+ print exists $phash->[0]{bar}; # true, 'bar' is a valid field
+ print exists $phash->[0]{shoes};# false, 'shoes' can't be used
+
+delete() on a pseudo-hash element only deletes the value corresponding
+to the key, not the key itself. To delete the key, you'll have to
+explicitly delete it from the first hash element.
+
+ print delete $phash->{foo}; # prints $phash->[1], "FOO"
+ print exists $phash->{foo}; # false
+ print exists $phash->[0]{foo}; # true, key still exists
+ print delete $phash->[0]{foo}; # now key is gone
+ print $phash->{foo}; # runtime exception
+
=head2 Function Templates
As explained above, a closure is an anonymous function with access to the
=item B<-c>
causes Perl to check the syntax of the program and then exit without
-executing it. Actually, it I<will> execute C<BEGIN>, C<END>, and C<use> blocks,
-because these are considered as occurring outside the execution of
-your program. C<INIT> blocks, however, will be skipped.
+executing it. Actually, it I<will> execute C<BEGIN>, C<STOP>, and
+C<use> blocks, because these are considered as occurring outside the
+execution of your program. C<INIT> and C<END> blocks, however, will
+be skipped.
=item B<-d>
A colon-separated list of directories in which to look for Perl library
files before looking in the standard library and the current
-directory. If PERL5LIB is not defined, PERLLIB is used. When running
-taint checks (because the program was running setuid or setgid, or the
-B<-T> switch was used), neither variable is used. The program should
-instead say
+directory. Any architecture-specific directories under the specified
+locations are automatically included if they exist. If PERL5LIB is not
+defined, PERLLIB is used.
+
+When running taint checks (either because the program was running setuid
+or setgid, or the B<-T> switch was used), neither variable is used.
+The program should instead say:
use lib "/my/directory";
function in all capitals is a loosely-held convention meaning it
will be called indirectly by the run-time system itself, usually
due to a triggered event. Functions that do special, pre-defined
-things include C<BEGIN>, C<END>, C<AUTOLOAD>, and C<DESTROY>--plus
-all functions mentioned in L<perltie>. The 5.005 release adds
-C<INIT> to this list.
+things include C<BEGIN>, C<STOP>, C<INIT>, C<END>, C<AUTOLOAD>, and
+C<DESTROY>--plus all functions mentioned in L<perltie>.
=head2 Private Variables via my()
}
See L<perlmod/"Package Constructors and Destructors"> about the
-special triggered functions, C<BEGIN> and C<INIT>.
+special triggered functions, C<BEGIN>, C<STOP>, C<INIT> and C<END>.
If declared at the outermost scope (the file scope), then lexicals
work somewhat like C's file statics. They are available to all
refers to the innermost enclosing loop. This may include dynamically
looking back your call-stack at run time to find the LABEL. Such
desperate behavior triggers a warning if you use the B<-w> flag.
+Unlike a C<foreach> statement, a C<while> statement never implicitly
+localises any variables.
If there is a C<continue> BLOCK, it is always executed just before the
conditional is about to be evaluated again, just like the third part of a
FETCHSIZE and STORESIZE are used to provide C<$#array> and
equivalent C<scalar(@array)> access.
-The methods POP, PUSH, SHIFT, UNSHIFT, SPLICE are required if the perl
-operator with the corresponding (but lowercase) name is to operate on the
-tied array. The B<Tie::Array> class can be used as a base class to implement
-these in terms of the basic five methods above.
+The methods POP, PUSH, SHIFT, UNSHIFT, SPLICE, DELETE, and EXISTS are
+required if the perl operator with the corresponding (but lowercase) name
+is to operate on the tied array. The B<Tie::Array> class can be used as a
+base class to implement the first five of these in terms of the basic
+methods above. The default implementations of DELETE and EXISTS in
+B<Tie::Array> simply C<croak>.
In addition EXTEND will be called when perl would have pre-extended
allocation in a real array.
=item Where can I get information on Perl?
-=item What are the Perl newsgroups on USENET? Where do I post questions?
+=item What are the Perl newsgroups on Usenet? Where do I post questions?
=item Where should I post source code?
=item Perl on the Net: FTP and WWW Access
-=item What mailing lists are there for perl?
+=item What mailing lists are there for Perl?
=item Archives of comp.lang.perl.misc
=item How can I get C<#!perl> to work on [MS-DOS,NT,...]?
-=item Can I write useful perl programs on the command line?
+=item Can I write useful Perl programs on the command line?
-=item Why don't perl one-liners work on my DOS/Mac/VMS system?
+=item Why don't Perl one-liners work on my DOS/Mac/VMS system?
=item Where can I learn about CGI or Web programming in Perl?
=item How do I find yesterday's date?
-=item Does Perl have a year 2000 problem? Is Perl Y2K compliant?
+=item Does Perl have a Year 2000 problem? Is Perl Y2K compliant?
=back
=item AUTHOR AND COPYRIGHT
-=head2 perldelta - what's new for perl5.006 (as of 5.005_56)
+=head2 perldelta - what's new for perl v5.6 (as of v5.005_62)
=item DESCRIPTION
=item Perl Source Incompatibilities
+Treatment of list slices of undef has changed, Possibly changed
+pseudo-random number generator, Hashing function for hash keys has changed,
+C<undef> fails on read only values, Close-on-exec bit may be set on pipe()
+handles, Writing C<"$$1"> to mean C<"${$}1"> is unsupported, values(%h) and
+C<\(%h)> operate on aliases to values, not copies, vec(EXPR,OFFSET,BITS)
+enforces powers-of-two BITS, Text of some diagnostic output has changed,
+C<%@> has been removed
+
=item C Source Incompatibilities
-C<PERL_POLLUTE>, C<PERL_POLLUTE_MALLOC>, C<PL_na> and C<dTHR> Issues
+C<PERL_POLLUTE>, C<PERL_IMPLICIT_CONTEXT>, C<PERL_POLLUTE_MALLOC>, C<PL_na>
+and C<dTHR> Issues
=item Compatible C Source API Changes
-C<PATCHLEVEL> is now C<PERL_VERSION>
+C<PATCHLEVEL> is now C<PERL_VERSION>, Support for C++ exceptions
=item Binary Incompatibilities
=back
+=item Installation and Configuration Improvements
+
+=over
+
+=item New Configure flags
+
+=item -Dusethreads and -Duse64bits now more daring
+
+=item Long Doubles
+
+=item -Dusemorebits
+
+=item -Duselargefiles
+
+=item installusrbinperl
+
+=item SOCKS support
+
+=item C<-A> flag
+
+=item New Installation Scheme
+
+=back
+
=item Core Changes
=over
=item Lexically scoped warning categories
+=item Lvalue subroutines
+
+=item "our" declarations
+
+=item Weak references
+
=item Binary numbers supported
+=item Some arrows may be omitted in calls through references
+
=item syswrite() ease-of-use
+=item Filehandles can be autovivified
+
=item 64-bit support
+=item Large file support
+
+=item "more bits"
+
=item Better syntax checks on parenthesized unary operators
+=item POSIX character class syntax [: :] supported
+
=item Improved C<qw//> operator
=item pack() format 'Z' supported
=item pack() format modifier '!' supported
+=item pack() and unpack() support counted strings
+
+=item Comments in pack() templates
+
=item $^X variables may now have names longer than one character
+=item C<use attrs> implicit in subroutine attributes
+
+=item Regular expression improvements
+
+=item Overloading improvements
+
+=item open() with more than two arguments
+
+=item Support for interpolating named characters
+
+=item Experimental support for user-hooks in @INC
+
+=item C<require> and C<do> may be overridden
+
+=item New variable $^C reflects C<-c> switch
+
+=item Optional Y2K warnings
+
=back
=item Significant bug fixes
=item C<eval '...'> improvements
+=item All compilation errors are true errors
+
=item Automatic flushing of output buffers
+=item Better diagnostics on meaningless filehandle operations
+
+=item Where possible, buffered data discarded from duped input filehandle
+
+=item system(), backticks and pipe open now reflect exec() failure
+
+=item Implicitly closed filehandles are safer
+
+=item C<(\$)> prototype and C<$foo{a}>
+
+=item Pseudo-hashes work better
+
+=item C<goto &sub> and AUTOLOAD
+
+=item C<-bareword> allowed under C<use integer>
+
+=item Boolean assignment operators are legal lvalues
+
+=item C<sort $coderef @foo> allowed
+
+=item Failures in DESTROY()
+
+=item Locale bugs fixed
+
+=item Memory leaks
+
+=item Spurious subroutine stubs after failed subroutine calls
+
+=item Consistent numeric conversions
+
+=item Taint failures under C<-U>
+
+=item END blocks and the C<-c> switch
+
+=item Potential to leak DATA filehandles
+
+=item Diagnostics follow STDERR
+
+=item Other fixes for better diagnostics
+
=back
-=item Supported Platforms
+=item Performance enhancements
+
+=over
+
+=item Simple sort() using { $a <=> $b } and the like are optimized
+
+=item Optimized assignments to lexical variables
+
+=item Method lookups optimized
+
+=item Faster mechanism to invoke XSUBs
+
+=item Perl_malloc() improvements
+
+=item Faster subroutine calls
+
+=back
+
+=item Platform specific changes
+
+=over
+
+=item Additional supported platforms
+
+=item DOS
+
+=item OS/2
+
+=item VMS
+
+=item Win32
+
+=back
=item New tests
=item Modules
-Dumpvalue, Benchmark, Devel::Peek, Fcntl, File::Spec,
-File::Spec::Functions, Math::BigInt, Math::Complex, Math::Trig, SDBM_File,
-Time::Local, Win32, DBM Filters
+attributes, B, ByteLoader, B, constant, charnames, Data::Dumper, DB,
+DB_File, Devel::DProf, Dumpvalue, Benchmark, Devel::Peek,
+ExtUtils::MakeMaker, Fcntl, File::Compare, File::Find, File::Spec,
+File::Spec::Functions, Getopt::Long, IO, JPL, Math::BigInt, Math::Complex,
+Math::Trig, Pod::Parser, Pod::Text and Pod::Man, SDBM_File, Time::Local,
+Win32, DBM Filters
=item Pragmata
=item Utility Changes
+=over
+
+=item h2ph
+
+=item perlcc
+
+=item h2xs
+
+=back
+
=item Documentation Changes
-perlopentut.pod, perlreftut.pod, perltootc.pod
+perlopentut.pod, perlreftut.pod, perltootc.pod, perlcompile.pod
=item New Diagnostics
-/%s/: Unrecognized escape \\%c passed through, Unrecognized escape \\%c
-passed through, Missing command in piped open, defined(@array) is
-deprecated (and not really meaningful), defined(%hash) is deprecated (and
-not really meaningful)
+"my sub" not yet implemented, '!' allowed only after types %s, / cannot
+take a count, / must be followed by a, A or Z, / must be followed by a*, A*
+or Z*, / must follow a numeric type, Repeat count in pack overflows, Repeat
+count in unpack overflows, /%s/: Unrecognized escape \\%c passed through,
+/%s/ should probably be written as "%s", %s() called too early to check
+prototype, %s package attribute may clash with future reserved word: %s,
+ (in cleanup) %s, <> should be quotes, Attempt to join self, Bad
+evalled substitution pattern, Bad realloc() ignored, Binary number >
+0b11111111111111111111111111111111 non-portable, Bit vector size > 32
+non-portable, Buffer overflow in prime_env_iter: %s, Can't check filesystem
+of script "%s", Can't modify non-lvalue subroutine call, Can't read CRTL
+environ, Can't remove %s: %s, skipping file, Can't return %s from lvalue
+subroutine, Can't weaken a nonreference, Character class [:%s:] unknown,
+Character class syntax [%s] belongs inside character classes, Constant is
+not %s reference, constant(%s): %%^H is not localized, constant(%s): %s,
+defined(@array) is deprecated, defined(%hash) is deprecated, Did not
+produce a valid header, Document contains no data, entering effective %s
+failed, Filehandle %s opened only for output, Hexadecimal number >
+0xffffffff non-portable, Ill-formed CRTL environ value "%s", Ill-formed
+message in prime_env_iter: |%s|, Illegal binary digit %s, Illegal binary
+digit %s ignored, Illegal number of bits in vec, Integer overflow in %s
+number, Invalid %s attribute: %s, Invalid %s attributes: %s, Invalid
+separator character %s in attribute list, Invalid separator character %s in
+subroutine attribute list, leaving effective %s failed, Lvalue subs
+returning %s not implemented yet, Method %s not permitted, Missing
+%sbrace%s on \N{}, Missing command in piped open, Missing name in "my sub",
+no UTC offset information; assuming local time is UTC, Octal number >
+037777777777 non-portable, panic: del_backref, panic: kid popen errno read,
+panic: magic_killbackrefs, Possible Y2K bug: %s, Premature end of script
+headers, realloc() of freed memory ignored, Reference is already weak,
+setpgrp can't take arguments, Strange *+?{} on zero-length expression,
+switching effective %s is not implemented, This Perl can't reset CRTL
+eviron elements (%s), This Perl can't set CRTL environ elements (%s=%s),
+Unknown open() mode '%s', Unknown process %x sent message to
+prime_env_iter: %s, Unrecognized escape \\%c passed through, Unterminated
+attribute parameter in attribute list, Unterminated attribute list,
+Unterminated attribute parameter in subroutine attribute list, Unterminated
+subroutine attribute list, Value of CLI symbol "%s" too long, Version
+number must be a constant number
=item Obsolete Diagnostics
-=item Configuration Changes
+Character class syntax [: :] is reserved for future extensions, Ill-formed
+logical name |%s| in prime_env_iter, regexp too big, Use of "$$<digit>" to
+mean "${$}<digit>" is deprecated
=item BUGS
=item Regular Expressions
+cntrl, graph, print, punct, xdigit,
+
=item Extended Patterns
C<(?#text)>, C<(?imsx-imsx)>, C<(?:pattern)>, C<(?imsx-imsx:pattern)>,
B<-i>[I<extension>], B<-I>I<directory>, B<-l>[I<octnum>],
B<-m>[B<->]I<module>, B<-M>[B<->]I<module>, B<-M>[B<->]I<'module ...'>,
B<-[mM]>[B<->]I<module=arg[,arg]...>, B<-n>, B<-p>, B<-P>, B<-s>, B<-S>,
-B<-T>, B<-u>, B<-U>, B<-v>, B<-V>, B<-V:>I<name>, B<-w>, B<-x> I<directory>
+B<-T>, B<-u>, B<-U>, B<-v>, B<-V>, B<-V:>I<name>, B<-w>, B<-W>, B<-X>,
+B<-x> I<directory>
=back
OLDFILE,NEWFILE, listen SOCKET,QUEUESIZE, local EXPR, localtime EXPR, lock,
log EXPR, log, lstat FILEHANDLE, lstat EXPR, lstat, m//, map BLOCK LIST,
map EXPR,LIST, mkdir FILENAME,MASK, msgctl ID,CMD,ARG, msgget KEY,FLAGS,
-msgsnd ID,MSG,FLAGS, msgrcv ID,VAR,SIZE,TYPE,FLAGS, my EXPR, next LABEL,
-next, no Module LIST, oct EXPR, oct, open FILEHANDLE,EXPR, open FILEHANDLE,
-opendir DIRHANDLE,EXPR, ord EXPR, ord, pack TEMPLATE,LIST, package, package
-NAMESPACE, pipe READHANDLE,WRITEHANDLE, pop ARRAY, pop, pos SCALAR, pos,
-print FILEHANDLE LIST, print LIST, print, printf FILEHANDLE FORMAT, LIST,
-printf FORMAT, LIST, prototype FUNCTION, push ARRAY,LIST, q/STRING/,
+msgsnd ID,MSG,FLAGS, msgrcv ID,VAR,SIZE,TYPE,FLAGS, my EXPR, my EXPR :
+ATTRIBUTES, next LABEL, next, no Module LIST, oct EXPR, oct, open
+FILEHANDLE,MODE,EXPR, open FILEHANDLE,EXPR, open FILEHANDLE, opendir
+DIRHANDLE,EXPR, ord EXPR, ord, our EXPR, pack TEMPLATE,LIST, package,
+package NAMESPACE, pipe READHANDLE,WRITEHANDLE, pop ARRAY, pop, pos SCALAR,
+pos, print FILEHANDLE LIST, print LIST, print, printf FILEHANDLE FORMAT,
+LIST, printf FORMAT, LIST, prototype FUNCTION, push ARRAY,LIST, q/STRING/,
qq/STRING/, qr/STRING/, qx/STRING/, qw/STRING/, quotemeta EXPR, quotemeta,
rand EXPR, rand, read FILEHANDLE,SCALAR,LENGTH,OFFSET, read
FILEHANDLE,SCALAR,LENGTH, readdir DIRHANDLE, readline EXPR, readlink EXPR,
splice ARRAY,OFFSET, split /PATTERN/,EXPR,LIMIT, split /PATTERN/,EXPR,
split /PATTERN/, split, sprintf FORMAT, LIST, sqrt EXPR, sqrt, srand EXPR,
srand, stat FILEHANDLE, stat EXPR, stat, study SCALAR, study, sub BLOCK,
-sub NAME, sub NAME BLOCK, substr EXPR,OFFSET,LEN,REPLACEMENT, substr
-EXPR,OFFSET,LEN, substr EXPR,OFFSET, symlink OLDFILE,NEWFILE, syscall LIST,
-sysopen FILEHANDLE,FILENAME,MODE, sysopen FILEHANDLE,FILENAME,MODE,PERMS,
-sysread FILEHANDLE,SCALAR,LENGTH,OFFSET, sysread FILEHANDLE,SCALAR,LENGTH,
-sysseek FILEHANDLE,POSITION,WHENCE, system LIST, system PROGRAM LIST,
-syswrite FILEHANDLE,SCALAR,LENGTH,OFFSET, syswrite
-FILEHANDLE,SCALAR,LENGTH, syswrite FILEHANDLE,SCALAR, tell FILEHANDLE,
-tell, telldir DIRHANDLE, tie VARIABLE,CLASSNAME,LIST, tied VARIABLE, time,
-times, tr///, truncate FILEHANDLE,LENGTH, truncate EXPR,LENGTH, uc EXPR,
-uc, ucfirst EXPR, ucfirst, umask EXPR, umask, undef EXPR, undef, unlink
-LIST, unlink, unpack TEMPLATE,EXPR, untie VARIABLE, unshift ARRAY,LIST, use
-Module LIST, use Module, use Module VERSION LIST, use VERSION, utime LIST,
-values HASH, vec EXPR,OFFSET,BITS, wait, waitpid PID,FLAGS, wantarray, warn
-LIST, write FILEHANDLE, write EXPR, write, y///
+sub NAME, sub NAME BLOCK, substr EXPR,OFFSET,LENGTH,REPLACEMENT, substr
+EXPR,OFFSET,LENGTH, substr EXPR,OFFSET, symlink OLDFILE,NEWFILE, syscall
+LIST, sysopen FILEHANDLE,FILENAME,MODE, sysopen
+FILEHANDLE,FILENAME,MODE,PERMS, sysread FILEHANDLE,SCALAR,LENGTH,OFFSET,
+sysread FILEHANDLE,SCALAR,LENGTH, sysseek FILEHANDLE,POSITION,WHENCE,
+system LIST, system PROGRAM LIST, syswrite FILEHANDLE,SCALAR,LENGTH,OFFSET,
+syswrite FILEHANDLE,SCALAR,LENGTH, syswrite FILEHANDLE,SCALAR, tell
+FILEHANDLE, tell, telldir DIRHANDLE, tie VARIABLE,CLASSNAME,LIST, tied
+VARIABLE, time, times, tr///, truncate FILEHANDLE,LENGTH, truncate
+EXPR,LENGTH, uc EXPR, uc, ucfirst EXPR, ucfirst, umask EXPR, umask, undef
+EXPR, undef, unlink LIST, unlink, unpack TEMPLATE,EXPR, untie VARIABLE,
+unshift ARRAY,LIST, use Module LIST, use Module, use Module VERSION LIST,
+use VERSION, utime LIST, values HASH, vec EXPR,OFFSET,BITS, wait, waitpid
+PID,FLAGS, wantarray, warn LIST, write FILEHANDLE, write EXPR, write, y///
=back
$EFFECTIVE_GROUP_ID, $EGID, $), $PROGRAM_NAME, $0, $[, $PERL_VERSION, $],
$COMPILING, $^C, $DEBUGGING, $^D, $SYSTEM_FD_MAX, $^F, $^H, $INPLACE_EDIT,
$^I, $^M, $OSNAME, $^O, $PERLDB, $^P, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20,
-$^R, $^S, $BASETIME, $^T, $WARNING, $^W, $EXECUTABLE_NAME, $^X, $ARGV,
-@ARGV, @INC, @_, %INC, %ENV, $ENV{expr}, %SIG, $SIG{expr}
+$^R, $^S, $BASETIME, $^T, $WARNING, $^W, ${^Warnings}, $EXECUTABLE_NAME,
+$^X, $ARGV, @ARGV, @INC, @_, %INC, %ENV, $ENV{expr}, %SIG, $SIG{expr}
=item Error Indicators
=item Temporary Values via local()
+=item Lvalue subroutines
+
=item Passing Symbol Table Entries (typeglobs)
=item When to Still Use local()
=item Autoloading
+=item Subroutine Attributes
+
=back
=item SEE ALSO
=item Pragmatic Modules
-attrs, autouse, base, blib, constant, diagnostics, fields, filetest,
-integer, less, lib, locale, ops, overload, re, sigtrap, strict, subs, utf8,
-vars, vmsish, warnings
+attributes, attrs, autouse, base, blib, constant, diagnostics, fields,
+filetest, integer, less, lib, locale, ops, overload, re, sigtrap, strict,
+subs, utf8, vars, warnings, vmsish
=item Standard Modules
C<emx@iaehv.nl>,C<http://www.leo.org/pub/comp/os/os2/leo/gnu/emx+gcc/index.
html> or
C<ftp://hobbes.nmsu.edu/pub/os2/dev/emx>, Build instructions for Win32,
-L<perlwin32>, The ActiveState Pages, C<http://www.activestate.com/>
+L<perlwin32>, The ActiveState Pages, C<http://www.activestate.com/>, The
+Cygwin environment for Win32;
+L<README.cygwin>,C<http://sourceware.cygnus.com/cygwin/>, The U/WIN
+environment for Win32,C<http://www.research.att.com/sw/tools/uwin/>
=item S<Mac OS>
=item VMS
-L<perlvms.pod>, vmsperl list, C<majordomo@perl.org>, vmsperl on the web,
-C<http://www.sidhe.org/vmsperl/index.html>
+L<README.vms>, L<perlvms.pod>, vmsperl list, C<majordomo@perl.org>, vmsperl
+on the web, C<http://www.sidhe.org/vmsperl/index.html>
=item VOS
=item EBCDIC Platforms
-perl-mvs list, AS/400 Perl information at
-C<http://as400.rochester.ibm.com/>
+L<README.os390>, L<README.posix-bc>, L<README.vmesa>, perl-mvs list, AS/400
+Perl information at C<http://as400.rochester.ibm.com/>as well as on CPAN in
+the F<ports/> directory
=item Acorn RISC OS
=item Other perls
-Atari, Guido Flohr's page C<http://stud.uni-sb.de/~gufl0000/>, HP 300
-MPE/iX C<http://www.cccd.edu/~markb/perlix.html>, Novell Netware
+Amiga, L<README.amiga>, Atari, L<README.mint> and Guido Flohr's web
+pageC<http://stud.uni-sb.de/~gufl0000/>, Be OS, L<README.beos>, HP 300
+MPE/iX, L<README.mpeix> and Mark Bixby's web
+pageC<http://www.cccd.edu/~markb/perlix.html>, Novell Netware, Plan 9,
+L<README.plan9>
=back
=item CHANGES
-v1.43, 24 May 1999, v1.42, 22 May 1999, v1.41, 19 May 1999, v1.40, 11 April
-1999, v1.39, 11 February 1999, v1.38, 31 December 1998, v1.37, 19 December
-1998, v1.36, 9 September 1998, v1.35, 13 August 1998, v1.33, 06 August
-1998, v1.32, 05 August 1998, v1.30, 03 August 1998, v1.23, 10 July 1998
+v1.44, 19 July 1999, v1.43, 24 May 1999, v1.42, 22 May 1999, v1.41, 19 May
+1999, v1.40, 11 April 1999, v1.39, 11 February 1999, v1.38, 31 December
+1998, v1.37, 19 December 1998, v1.36, 9 September 1998, v1.35, 13 August
+1998, v1.33, 06 August 1998, v1.32, 05 August 1998, v1.30, 03 August 1998,
+v1.23, 10 July 1998
=item AUTHORS / CONTRIBUTORS
=item AUTHOR
-=head2 perlxstut, perlXStut - Tutorial for XSUBs
+=head2 perlxstut, perlXStut - Tutorial for writing XSUBs
=item DESCRIPTION
+=item SPECIAL NOTES
+
=over
-=item VERSION CAVEAT
+=item make
+
+=item Version caveat
+
+=item Dynamic Loading versus Static Loading
+
+=back
+
+=item TUTORIAL
-=item DYNAMIC VERSUS STATIC
+=over
=item EXAMPLE 1
=item EXAMPLE 2
-=item WHAT HAS GONE ON?
+=item What has gone on?
-=item WRITING GOOD TEST SCRIPTS
+=item Writing good test scripts
=item EXAMPLE 3
-=item WHAT'S NEW HERE?
+=item What's new here?
-=item INPUT AND OUTPUT PARAMETERS
+=item Input and Output Parameters
-=item THE XSUBPP COMPILER
+=item The XSUBPP Program
-=item THE TYPEMAP FILE
+=item The TYPEMAP file
-=item WARNING
+=item Warning about Output Arguments
=item EXAMPLE 4
-=item WHAT HAS HAPPENED HERE?
+=item What has happened here?
-=item SPECIFYING ARGUMENTS TO XSUBPP
+=item More about XSUBPP
-=item THE ARGUMENT STACK
+=item The Argument Stack
-=item EXTENDING YOUR EXTENSION
+=item Extending your Extension
-=item DOCUMENTING YOUR EXTENSION
+=item Documenting your Extension
-=item INSTALLING YOUR EXTENSION
+=item Installing your Extension
-=item SEE ALSO
+=item EXAMPLE 5
+
+=item New Things in this Example
+
+=item EXAMPLE 6 (Coming Soon)
+
+=item EXAMPLE 7 (Coming Soon)
+
+=item EXAMPLE 8 (Coming Soon)
+
+=item EXAMPLE 9 (Coming Soon)
+
+=item Troubleshooting these Examples
+
+=back
+
+=item See also
=item Author
+=over
+
=item Last Changed
=back
C<SAVEINT(int i)>, C<SAVEIV(IV i)>, C<SAVEI32(I32 i)>, C<SAVELONG(long i)>,
C<SAVESPTR(s)>, C<SAVEPPTR(p)>, C<SAVEFREESV(SV *sv)>, C<SAVEFREEOP(OP
*op)>, C<SAVEFREEPV(p)>, C<SAVECLEARSV(SV *sv)>, C<SAVEDELETE(HV *hv, char
-*key, I32 length)>, C<SAVEDESTRUCTOR(f,p)>, C<SAVESTACK_POS()>, C<SV*
-save_scalar(GV *gv)>, C<AV* save_ary(GV *gv)>, C<HV* save_hash(GV *gv)>,
-C<void save_item(SV *item)>, C<void save_list(SV **sarg, I32 maxsarg)>,
-C<SV* save_svref(SV **sptr)>, C<void save_aptr(AV **aptr)>, C<void
-save_hptr(HV **hptr)>
+*key, I32 length)>, C<SAVEDESTRUCTOR(DESTRUCTORFUNC_NOCONTEXT_t f, void
+*p)>, C<SAVEDESTRUCTOR_X(DESTRUCTORFUNC_t f, void *p)>, C<SAVESTACK_POS()>,
+C<SV* save_scalar(GV *gv)>, C<AV* save_ary(GV *gv)>, C<HV* save_hash(GV
+*gv)>, C<void save_item(SV *item)>, C<void save_list(SV **sarg, I32
+maxsarg)>, C<SV* save_svref(SV **sptr)>, C<void save_aptr(AV **aptr)>,
+C<void save_hptr(HV **hptr)>
=back
=back
+=item The Perl Internal API
+
+=over
+
+=item Background and PERL_IMPLICIT_CONTEXT
+
+=item How do I use all this in extensions?
+
+=item Future Plans and PERL_IMPLICIT_SYS
+
+=back
+
=item API LISTING
av_clear, av_extend, av_fetch, AvFILL, av_len, av_make, av_pop, av_push,
SvSTASH, SvTAINT, SvTAINTED, SvTAINTED_off, SvTAINTED_on, SVt_IV, SVt_PV,
SVt_PVAV, SVt_PVCV, SVt_PVHV, SVt_PVMG, SVt_NV, SvTRUE, SvTYPE, svtype,
PL_sv_undef, sv_unref, SvUPGRADE, sv_upgrade, sv_usepvn, sv_usepvn_mg,
-sv_vcatpvfn(sv, pat, patlen, args, svargs, svmax, used_locale),
-sv_vsetpvfn(sv, pat, patlen, args, svargs, svmax, used_locale), SvUV,
-SvUVX, PL_sv_yes, THIS, toLOWER, toUPPER, warn, XPUSHi, XPUSHn, XPUSHp,
-XPUSHs, XPUSHu, XS, XSRETURN, XSRETURN_EMPTY, XSRETURN_IV, XSRETURN_NO,
-XSRETURN_NV, XSRETURN_PV, XSRETURN_UNDEF, XSRETURN_YES, XST_mIV, XST_mNV,
-XST_mNO, XST_mPV, XST_mUNDEF, XST_mYES, XS_VERSION, XS_VERSION_BOOTCHECK,
-Zero
+sv_vcatpvfn, sv_vsetpvfn, SvUV, SvUVX, PL_sv_yes, THIS, toLOWER, toUPPER,
+warn, XPUSHi, XPUSHn, XPUSHp, XPUSHs, XPUSHu, XS, XSRETURN, XSRETURN_EMPTY,
+XSRETURN_IV, XSRETURN_NO, XSRETURN_NV, XSRETURN_PV, XSRETURN_UNDEF,
+XSRETURN_YES, XST_mIV, XST_mNV, XST_mNO, XST_mPV, XST_mUNDEF, XST_mYES,
+XS_VERSION, XS_VERSION_BOOTCHECK, Zero
=item AUTHORS
=item DATE
+=head2 perlcompile - Introduction to the Perl Compiler-Translator
+
+=item DESCRIPTION
+
+=over
+
+=item Layout
+
+B::Bytecode, B::C, B::CC, B::Lint, B::Deparse, B::Xref
+
+=back
+
+=item Using The Back Ends
+
+=over
+
+=item The Cross Referencing Back End (B::Xref)
+
+i, &, s, r
+
+=item The Decompiling Back End
+
+=item The Lint Back End (B::Lint)
+
+=item The Simple C Back End
+
+=item The Bytecode Back End
+
+=item The Optimized C Back End
+
+B, O, B::Asmdata, B::Assembler, B::Bblock, B::Bytecode, B::C, B::CC,
+B::Debug, B::Deparse, B::Disassembler, B::Lint, B::Showlex, B::Stackobj,
+B::Stash, B::Terse, B::Xref
+
+=back
+
+=item KNOWN PROBLEMS
+
+=item AUTHOR
+
=head2 perlhist - the Perl history records
=item DESCRIPTION
=head1 PRAGMA DOCUMENTATION
-=head2 attrs - set/get attributes of a subroutine
+=head2 attrs - set/get attributes of a subroutine (deprecated)
=item SYNOPSIS
=item DESCRIPTION
-=head2 attrs - set/get attributes of a subroutine
+=head2 attributes - get/set subroutine or variable attributes
+
+=item SYNOPSIS
+
+=item DESCRIPTION
+
+=over
+
+=item Built-in Attributes
+
+locked, method
+
+=item Available Subroutines
+
+get, reftype
+
+=item Package-specific Attribute Handling
+
+FETCH_I<type>_ATTRIBUTES, MODIFY_I<type>_ATTRIBUTES
+
+=item Syntax of Attribute Lists
+
+=back
+
+=item EXAMPLES
+
+=item SEE ALSO
+
+=head2 attrs - set/get attributes of a subroutine (deprecated)
=item SYNOPSIS
encoding
+=head2 charnames - define character names for C<\N{named}> string literal
+escape.
+
+=item SYNOPSIS
+
+=item DESCRIPTION
+
+=item CUSTOM TRANSLATORS
+
+=item BUGS
+
=head2 constant - Perl pragma to declare constants
=item SYNOPSIS
=over
-=item ADDING DIRECTORIES TO @INC
+=item Adding directories to @INC
-=item DELETING DIRECTORIES FROM @INC
+=item Deleting directories from @INC
-=item RESTORING ORIGINAL @INC
+=item Restoring original @INC
=back
=item DESCRIPTION
-C<warning deprecated>
-
=head1 MODULE DOCUMENTATION
=head2 AnyDBM_File - provide framework for multiple DBMs
=item B::OP METHODS
-next, sibling, ppaddr, desc, targ, type, seq, flags, private
+next, sibling, name, ppaddr, desc, targ, type, seq, flags, private
=item B::UNOP METHOD
=item OPTIONS
-B<-l>, B<-p>, B<-q>, B<-u>I<PACKAGE>, B<-s>I<LETTERS>, B<C>
+B<-l>, B<-p>, B<-q>, B<-u>I<PACKAGE>, B<-s>I<LETTERS>, B<C>, B<i>I<NUMBER>,
+B<T>, B<v>I<STRING>B<.>
+
+=item USING B::Deparse AS A MODULE
+
+=over
+
+=item Synopsis
+
+=item Description
+
+=item new
+
+=item coderef2text
+
+=back
=item BUGS
=item Methods
-new, debug
+new, debug, iters
=item Standard Exports
timeit(COUNT, CODE), timethis ( COUNT, CODE, [ TITLE, [ STYLE ]] ),
-timethese ( COUNT, CODEHASHREF, [ STYLE ] ), timediff ( T1, T2 ), timesum (
-T1, T2 ), timestr ( TIMEDIFF, [ STYLE, [ FORMAT ] ] )
+timethese ( COUNT, CODEHASHREF, [ STYLE ] ), timediff ( T1, T2 ), timestr (
+TIMEDIFF, [ STYLE, [ FORMAT ] ] )
=item Optional Exports
-clearcache ( COUNT ), clearallcache ( ), disablecache ( ), enablecache ( )
+clearcache ( COUNT ), clearallcache ( ), cmpthese ( COUT, CODEHASHREF, [
+STYLE ] ), cmpthese ( RESULTSHASHREF ), countit(TIME, CODE), disablecache (
+), enablecache ( ), timesum ( T1, T2 )
=back
=item SEE ALSO
+=head2 CGI::Pretty - module to produce nicely formatted HTML code
+
+=item SYNOPSIS
+
+=item DESCRIPTION
+
+=over
+
+=item Tags that won't be formatted
+
+=back
+
+=item BUGS
+
+=item AUTHOR
+
+=item SEE ALSO
+
=head2 CGI::Push - Simple Interface to Server Push
=item SYNOPSIS
=item BUGS
+=head2 Carp::Heavy - Carp guts
+
+=item SYNOPIS
+
+=item DESCRIPTION
+
=head2 Class::Struct - declare struct-like datatypes as Perl classes
=item SYNOPSIS
=item b
-C<baserev>, C<bash>, C<bin>, C<binexp>, C<bison>, C<byacc>, C<byteorder>
+C<baserev>, C<bash>, C<bin>, C<bincompat5005>, C<binexp>, C<bison>,
+C<byacc>, C<byteorder>
=item c
=item d
-C<d_access>, C<d_accessx>, C<d_alarm>, C<d_archlib>, C<d_attribut>,
-C<d_bcmp>, C<d_bcopy>, C<d_bsd>, C<d_bsdgetpgrp>, C<d_bsdsetpgrp>,
-C<d_bzero>, C<d_casti32>, C<d_castneg>, C<d_charvspr>, C<d_chown>,
-C<d_chroot>, C<d_chsize>, C<d_closedir>, C<d_cmsghdr_s>, C<d_const>,
-C<d_crypt>, C<d_csh>, C<d_cuserid>, C<d_dbl_dig>, C<d_dbmclose64>,
-C<d_dbminit64>, C<d_delete64>, C<d_difftime>, C<d_dirent64_s>,
-C<d_dirnamlen>, C<d_dlerror>, C<d_dlopen>, C<d_dlsymun>, C<d_dosuid>,
-C<d_drand48proto>, C<d_dup2>, C<d_eaccess>, C<d_endgrent>, C<d_endhent>,
-C<d_endnent>, C<d_endpent>, C<d_endpwent>, C<d_endsent>, C<d_eofnblk>,
-C<d_eunice>, C<d_fchmod>, C<d_fchown>, C<d_fcntl>, C<d_fd_macros>,
-C<d_fd_set>, C<d_fds_bits>, C<d_fetch64>, C<d_fgetpos64>, C<d_fgetpos>,
-C<d_firstkey64>, C<d_flexfnam>, C<d_flock64_s>, C<d_flock>, C<d_fopen64>,
-C<d_fork>, C<d_fpathconf>, C<d_freopen64>, C<d_fseek64>, C<d_fseeko64>,
-C<d_fseeko>, C<d_fsetpos64>, C<d_fsetpos>, C<d_fstat64>, C<d_fstatfs>,
-C<d_fstatvfs>, C<d_ftell64>, C<d_ftello64>, C<d_ftello>, C<d_ftime>,
-C<d_ftruncate64>, C<d_Gconvert>, C<d_getgrent>, C<d_getgrps>,
-C<d_gethbyaddr>, C<d_gethbyname>, C<d_gethent>, C<d_gethname>,
-C<d_gethostprotos>, C<d_getlogin>, C<d_getmntent>, C<d_getnbyaddr>,
-C<d_getnbyname>, C<d_getnent>, C<d_getnetprotos>, C<d_getpbyname>,
-C<d_getpbynumber>, C<d_getpent>, C<d_getpgid>, C<d_getpgrp2>, C<d_getpgrp>,
-C<d_getppid>, C<d_getprior>, C<d_getprotoprotos>, C<d_getpwent>,
-C<d_getsbyname>, C<d_getsbyport>, C<d_getsent>, C<d_getservprotos>,
+C<d_access>, C<d_accessx>, C<d_alarm>, C<d_archlib>, C<d_atolf>,
+C<d_atoll>, C<d_attribut>, C<d_bcmp>, C<d_bcopy>, C<d_bincompat5005>,
+C<d_bsd>, C<d_bsdgetpgrp>, C<d_bsdsetpgrp>, C<d_bzero>, C<d_casti32>,
+C<d_castneg>, C<d_charvspr>, C<d_chown>, C<d_chroot>, C<d_chsize>,
+C<d_closedir>, C<d_cmsghdr_s>, C<d_const>, C<d_crypt>, C<d_csh>,
+C<d_cuserid>, C<d_dbl_dig>, C<d_difftime>, C<d_dirnamlen>, C<d_dlerror>,
+C<d_dlopen>, C<d_dlsymun>, C<d_dosuid>, C<d_drand48proto>, C<d_dup2>,
+C<d_eaccess>, C<d_endgrent>, C<d_endhent>, C<d_endnent>, C<d_endpent>,
+C<d_endpwent>, C<d_endsent>, C<d_endspent>, C<d_eofnblk>, C<d_eunice>,
+C<d_fchmod>, C<d_fchown>, C<d_fcntl>, C<d_fd_macros>, C<d_fd_set>,
+C<d_fds_bits>, C<d_fgetpos>, C<d_flexfnam>, C<d_flock>, C<d_fork>,
+C<d_fpathconf>, C<d_fpos64_t>, C<d_fseeko>, C<d_fsetpos>, C<d_fstatfs>,
+C<d_fstatvfs>, C<d_ftello>, C<d_ftime>, C<d_Gconvert>, C<d_getgrent>,
+C<d_getgrps>, C<d_gethbyaddr>, C<d_gethbyname>, C<d_gethent>,
+C<d_gethname>, C<d_gethostprotos>, C<d_getlogin>, C<d_getmntent>,
+C<d_getnbyaddr>, C<d_getnbyname>, C<d_getnent>, C<d_getnetprotos>,
+C<d_getpbyname>, C<d_getpbynumber>, C<d_getpent>, C<d_getpgid>,
+C<d_getpgrp2>, C<d_getpgrp>, C<d_getppid>, C<d_getprior>,
+C<d_getprotoprotos>, C<d_getpwent>, C<d_getsbyname>, C<d_getsbyport>,
+C<d_getsent>, C<d_getservprotos>, C<d_getspent>, C<d_getspnam>,
C<d_gettimeod>, C<d_gnulibc>, C<d_grpasswd>, C<d_hasmntopt>, C<d_htonl>,
-C<d_index>, C<d_inetaton>, C<d_ino64_t>, C<d_int64t>, C<d_iovec_s>,
-C<d_isascii>, C<d_killpg>, C<d_lchown>, C<d_link>, C<d_llseek>,
-C<d_locconv>, C<d_lockf64>, C<d_lockf>, C<d_longdbl>, C<d_longlong>,
-C<d_lseek64>, C<d_lstat64>, C<d_lstat>, C<d_madvise>, C<d_mblen>,
-C<d_mbstowcs>, C<d_mbtowc>, C<d_memchr>, C<d_memcmp>, C<d_memcpy>,
-C<d_memmove>, C<d_memset>, C<d_mkdir>, C<d_mkfifo>, C<d_mktime>, C<d_mmap>,
-C<d_mprotect>, C<d_msg>, C<d_msg_ctrunc>, C<d_msg_dontroute>, C<d_msg_oob>,
-C<d_msg_peek>, C<d_msg_proxy>, C<d_msgctl>, C<d_msgget>, C<d_msghdr_s>,
-C<d_msgrcv>, C<d_msgsnd>, C<d_msync>, C<d_munmap>, C<d_mymalloc>,
-C<d_nextkey64>, C<d_nice>, C<d_off64_t>, C<d_offset_t>,
-C<d_old_pthread_create_joinable>, C<d_oldpthreads>, C<d_oldsock>,
-C<d_open3>, C<d_open64>, C<d_opendir64>, C<d_pathconf>, C<d_pause>,
-C<d_phostname>, C<d_pipe>, C<d_poll>, C<d_portable>, C<d_pthread_yield>,
-C<d_pwage>, C<d_pwchange>, C<d_pwclass>, C<d_pwcomment>, C<d_pwexpire>,
-C<d_pwgecos>, C<d_pwpasswd>, C<d_pwquota>, C<d_readdir64>, C<d_readdir>,
-C<d_readlink>, C<d_readv>, C<d_recvmsg>, C<d_rename>, C<d_rewinddir>,
-C<d_rmdir>, C<d_safebcpy>, C<d_safemcpy>, C<d_sanemcmp>, C<d_sched_yield>,
-C<d_scm_rights>, C<d_seekdir64>, C<d_seekdir>, C<d_select>, C<d_sem>,
+C<d_index>, C<d_inetaton>, C<d_int64t>, C<d_iovec_s>, C<d_isascii>,
+C<d_killpg>, C<d_lchown>, C<d_ldbl_dig>, C<d_link>, C<d_llseek>,
+C<d_locconv>, C<d_lockf>, C<d_longdbl>, C<d_longlong>, C<d_lstat>,
+C<d_madvise>, C<d_mblen>, C<d_mbstowcs>, C<d_mbtowc>, C<d_memchr>,
+C<d_memcmp>, C<d_memcpy>, C<d_memmove>, C<d_memset>, C<d_mkdir>,
+C<d_mkfifo>, C<d_mktime>, C<d_mmap>, C<d_mprotect>, C<d_msg>,
+C<d_msg_ctrunc>, C<d_msg_dontroute>, C<d_msg_oob>, C<d_msg_peek>,
+C<d_msg_proxy>, C<d_msgctl>, C<d_msgget>, C<d_msghdr_s>, C<d_msgrcv>,
+C<d_msgsnd>, C<d_msync>, C<d_munmap>, C<d_mymalloc>, C<d_nice>,
+C<d_off64_t>, C<d_old_pthread_create_joinable>, C<d_oldpthreads>,
+C<d_oldsock>, C<d_open3>, C<d_pathconf>, C<d_pause>, C<d_phostname>,
+C<d_pipe>, C<d_poll>, C<d_portable>, C<d_PRId64>, C<d_PRIeldbl>,
+C<d_PRIEldbl>, C<d_PRIfldbl>, C<d_PRIFldbl>, C<d_PRIgldbl>, C<d_PRIGldbl>,
+C<d_PRIi64>, C<d_PRIo64>, C<d_PRIu64>, C<d_PRIx64>, C<d_PRIX64>,
+C<d_pthread_yield>, C<d_pwage>, C<d_pwchange>, C<d_pwclass>,
+C<d_pwcomment>, C<d_pwexpire>, C<d_pwgecos>, C<d_pwpasswd>, C<d_pwquota>,
+C<d_readdir>, C<d_readlink>, C<d_readv>, C<d_recvmsg>, C<d_rename>,
+C<d_rewinddir>, C<d_rmdir>, C<d_safebcpy>, C<d_safemcpy>, C<d_sanemcmp>,
+C<d_sched_yield>, C<d_scm_rights>, C<d_seekdir>, C<d_select>, C<d_sem>,
C<d_semctl>, C<d_semctl_semid_ds>, C<d_semctl_semun>, C<d_semget>,
C<d_semop>, C<d_sendmsg>, C<d_setegid>, C<d_seteuid>, C<d_setgrent>,
C<d_setgrps>, C<d_sethent>, C<d_setlinebuf>, C<d_setlocale>, C<d_setnent>,
C<d_setpent>, C<d_setpgid>, C<d_setpgrp2>, C<d_setpgrp>, C<d_setprior>,
C<d_setpwent>, C<d_setregid>, C<d_setresgid>, C<d_setresuid>,
C<d_setreuid>, C<d_setrgid>, C<d_setruid>, C<d_setsent>, C<d_setsid>,
-C<d_setvbuf>, C<d_sfio>, C<d_shm>, C<d_shmat>, C<d_shmatprototype>,
-C<d_shmctl>, C<d_shmdt>, C<d_shmget>, C<d_sigaction>, C<d_sigsetjmp>,
-C<d_socket>, C<d_sockpair>, C<d_stat64>, C<d_statblks>, C<d_statfs>,
+C<d_setspent>, C<d_setvbuf>, C<d_sfio>, C<d_shm>, C<d_shmat>,
+C<d_shmatprototype>, C<d_shmctl>, C<d_shmdt>, C<d_shmget>, C<d_sigaction>,
+C<d_sigsetjmp>, C<d_socket>, C<d_sockpair>, C<d_statblks>, C<d_statfs>,
C<d_statfsflags>, C<d_statvfs>, C<d_stdio_cnt_lval>, C<d_stdio_ptr_lval>,
-C<d_stdio_stream_array>, C<d_stdiobase>, C<d_stdstdio>, C<d_store64>,
-C<d_strchr>, C<d_strcoll>, C<d_strctcpy>, C<d_strerrm>, C<d_strerror>,
-C<d_strtod>, C<d_strtol>, C<d_strtoul>, C<d_strxfrm>, C<d_suidsafe>,
+C<d_stdio_stream_array>, C<d_stdiobase>, C<d_stdstdio>, C<d_strchr>,
+C<d_strcoll>, C<d_strctcpy>, C<d_strerrm>, C<d_strerror>, C<d_strtod>,
+C<d_strtol>, C<d_strtoul>, C<d_strtoull>, C<d_strxfrm>, C<d_suidsafe>,
C<d_symlink>, C<d_syscall>, C<d_sysconf>, C<d_sysernlst>, C<d_syserrlst>,
-C<d_system>, C<d_tcgetpgrp>, C<d_tcsetpgrp>, C<d_telldir64>, C<d_telldir>,
-C<d_telldirproto>, C<d_time>, C<d_times>, C<d_tmpfile64>, C<d_truncate64>,
-C<d_truncate>, C<d_tzname>, C<d_umask>, C<d_uname>, C<d_union_semun>,
-C<d_vfork>, C<d_void_closedir>, C<d_voidsig>, C<d_voidtty>, C<d_volatile>,
+C<d_system>, C<d_tcgetpgrp>, C<d_tcsetpgrp>, C<d_telldir>,
+C<d_telldirproto>, C<d_time>, C<d_times>, C<d_truncate>, C<d_tzname>,
+C<d_umask>, C<d_uname>, C<d_union_semun>, C<d_vendorlib>, C<d_vfork>,
+C<d_void_closedir>, C<d_voidsig>, C<d_voidtty>, C<d_volatile>,
C<d_vprintf>, C<d_wait4>, C<d_waitpid>, C<d_wcstombs>, C<d_wctomb>,
C<d_writev>, C<d_xenix>, C<date>, C<db_hashtype>, C<db_prefixtype>,
C<defvoidused>, C<direntrytype>, C<dlext>, C<dlsrc>, C<doublesize>,
C<i_limits>, C<i_locale>, C<i_machcthr>, C<i_malloc>, C<i_math>,
C<i_memory>, C<i_mntent>, C<i_ndbm>, C<i_netdb>, C<i_neterrno>,
C<i_netinettcp>, C<i_niin>, C<i_poll>, C<i_pthread>, C<i_pwd>,
-C<i_rpcsvcdbm>, C<i_sfio>, C<i_sgtty>, C<i_stdarg>, C<i_stddef>,
-C<i_stdlib>, C<i_string>, C<i_sysaccess>, C<i_sysdir>, C<i_sysfile>,
-C<i_sysfilio>, C<i_sysin>, C<i_sysioctl>, C<i_sysmman>, C<i_sysmount>,
-C<i_sysndir>, C<i_sysparam>, C<i_sysresrc>, C<i_syssecrt>, C<i_sysselct>,
-C<i_syssockio>, C<i_sysstat>, C<i_sysstatvfs>, C<i_systime>, C<i_systimek>,
-C<i_systimes>, C<i_systypes>, C<i_sysuio>, C<i_sysun>, C<i_syswait>,
-C<i_termio>, C<i_termios>, C<i_time>, C<i_unistd>, C<i_utime>, C<i_values>,
-C<i_varargs>, C<i_varhdr>, C<i_vfork>, C<ignore_versioned_solibs>,
-C<incpath>, C<inews>, C<installarchlib>, C<installbin>, C<installman1dir>,
-C<installman3dir>, C<installprivlib>, C<installscript>, C<installsitearch>,
-C<installsitelib>, C<installusrbinperl>, C<intsize>
+C<i_rpcsvcdbm>, C<i_sfio>, C<i_sgtty>, C<i_shadow>, C<i_socks>,
+C<i_stdarg>, C<i_stddef>, C<i_stdlib>, C<i_string>, C<i_sysaccess>,
+C<i_sysdir>, C<i_sysfile>, C<i_sysfilio>, C<i_sysin>, C<i_sysioctl>,
+C<i_sysmman>, C<i_sysmount>, C<i_sysndir>, C<i_sysparam>, C<i_sysresrc>,
+C<i_syssecrt>, C<i_sysselct>, C<i_syssockio>, C<i_sysstat>,
+C<i_sysstatvfs>, C<i_systime>, C<i_systimek>, C<i_systimes>, C<i_systypes>,
+C<i_sysuio>, C<i_sysun>, C<i_syswait>, C<i_termio>, C<i_termios>,
+C<i_time>, C<i_unistd>, C<i_utime>, C<i_values>, C<i_varargs>, C<i_varhdr>,
+C<i_vfork>, C<ignore_versioned_solibs>, C<incpath>, C<inews>,
+C<installarchlib>, C<installbin>, C<installman1dir>, C<installman3dir>,
+C<installprefix>, C<installprefixexp>, C<installprivlib>, C<installscript>,
+C<installsitearch>, C<installsitelib>, C<installstyle>,
+C<installusrbinperl>, C<installvendorlib>, C<intsize>
=item k
=item l
-C<large>, C<ld>, C<lddlflags>, C<ldflags>, C<less>, C<lib_ext>, C<libc>,
-C<libperl>, C<libpth>, C<libs>, C<libswanted>, C<line>, C<lint>,
-C<lkflags>, C<ln>, C<lns>, C<locincpth>, C<loclibpth>, C<longdblsize>,
-C<longlongsize>, C<longsize>, C<lp>, C<lpr>, C<ls>, C<lseeksize>,
-C<lseektype>
+C<large>, C<ld>, C<lddlflags>, C<ldflags>, C<ldlibpthname>, C<less>,
+C<lib_ext>, C<libc>, C<libperl>, C<libpth>, C<libs>, C<libswanted>,
+C<line>, C<lint>, C<lkflags>, C<ln>, C<lns>, C<locincpth>, C<loclibpth>,
+C<longdblsize>, C<longlongsize>, C<longsize>, C<lp>, C<lpr>, C<ls>,
+C<lseeksize>, C<lseektype>
=item m
C<package>, C<pager>, C<passcat>, C<patchlevel>, C<path_sep>, C<perl>,
C<perladmin>, C<perlpath>, C<pg>, C<phostname>, C<pidtype>, C<plibpth>,
-C<pmake>, C<pr>, C<prefix>, C<prefixexp>, C<privlib>, C<privlibexp>,
-C<prototype>, C<ptrsize>
+C<pm_apiversion>, C<pmake>, C<pr>, C<prefix>, C<prefixexp>, C<privlib>,
+C<privlibexp>, C<prototype>, C<ptrsize>
=item r
C<selectminbits>, C<selecttype>, C<sendmail>, C<sh>, C<shar>, C<sharpbang>,
C<shmattype>, C<shortsize>, C<shrpenv>, C<shsharp>, C<sig_count>,
C<sig_name>, C<sig_name_init>, C<sig_num>, C<sig_num_init>, C<signal_t>,
-C<sitearch>, C<sitearchexp>, C<sitelib>, C<sitelibexp>, C<sizetype>,
-C<sleep>, C<smail>, C<small>, C<so>, C<sockethdr>, C<socketlib>, C<sort>,
-C<spackage>, C<spitshell>, C<split>, C<src>, C<ssizetype>, C<startperl>,
-C<startsh>, C<static_ext>, C<stdchar>, C<stdio_base>, C<stdio_bufsiz>,
-C<stdio_cnt>, C<stdio_filbuf>, C<stdio_ptr>, C<stdio_stream_array>,
-C<strings>, C<submit>, C<subversion>, C<sysman>
+C<sitearch>, C<sitearchexp>, C<sitelib>, C<sitelibexp>, C<siteprefix>,
+C<siteprefixexp>, C<sizetype>, C<sleep>, C<smail>, C<small>, C<so>,
+C<sockethdr>, C<socketlib>, C<sort>, C<spackage>, C<spitshell>, C<split>,
+C<sPRId64>, C<sPRIeldbl>, C<sPRIEldbl>, C<sPRIfldbl>, C<sPRIFldbl>,
+C<sPRIgldbl>, C<sPRIGldbl>, C<sPRIi64>, C<sPRIo64>, C<sPRIu64>, C<sPRIx64>,
+C<sPRIX64>, C<src>, C<ssizetype>, C<startperl>, C<startsh>, C<static_ext>,
+C<stdchar>, C<stdio_base>, C<stdio_bufsiz>, C<stdio_cnt>, C<stdio_filbuf>,
+C<stdio_ptr>, C<stdio_stream_array>, C<strings>, C<submit>, C<subversion>,
+C<sysman>
=item t
=item u
-C<uidtype>, C<uname>, C<uniq>, C<use64bits>, C<usedl>, C<usemultiplicity>,
+C<uidsign>, C<uidtype>, C<uname>, C<uniq>, C<use64bits>, C<usedl>,
+C<uselargefiles>, C<uselongdouble>, C<usemorebits>, C<usemultiplicity>,
C<usemymalloc>, C<usenm>, C<useopcode>, C<useperlio>, C<useposix>,
-C<usesfio>, C<useshrplib>, C<usethreads>, C<usevfork>, C<usrinc>, C<uuname>
+C<usesfio>, C<useshrplib>, C<usesocks>, C<usethreads>, C<usevendorprefix>,
+C<usevfork>, C<usrinc>, C<uuname>
=item v
+C<vendorlib>, C<vendorlibexp>, C<vendorprefix>, C<vendorprefixexp>,
C<version>, C<vi>, C<voidflags>
=item x
-C<xlibpth>
+C<xlibpth>, C<xs_apiversion>
=item z
=over
-=item Using DB_File with Berkeley DB version 2
+=item Using DB_File with Berkeley DB version 2 or 3
=item Interface to Berkeley DB
$flags]) ;>, B<$status = $X-E<gt>fd ;>, B<$status = $X-E<gt>seq($key,
$value, $flags) ;>, B<$status = $X-E<gt>sync([$flags]) ;>
+=item DBM FILTERS
+
+B<filter_store_key>, B<filter_store_value>, B<filter_fetch_key>,
+B<filter_fetch_value>
+
+=over
+
+=item The Filter
+
+=item An Example -- the NULL termination problem.
+
+=item Another Example -- Key is a C int.
+
+=back
+
=item HINTS AND TIPS
=over
=back
+=item REFERENCES
+
=item HISTORY
=item BUGS
$Data::Dumper::Toaster I<or> $I<OBJ>->Toaster(I<[NEWVAL]>),
$Data::Dumper::Deepcopy I<or> $I<OBJ>->Deepcopy(I<[NEWVAL]>),
$Data::Dumper::Quotekeys I<or> $I<OBJ>->Quotekeys(I<[NEWVAL]>),
-$Data::Dumper::Bless I<or> $I<OBJ>->Bless(I<[NEWVAL]>)
+$Data::Dumper::Bless I<or> $I<OBJ>->Bless(I<[NEWVAL]>),
+$Data::Dumper::Maxdepth I<or> $I<OBJ>->Maxdepth(I<[NEWVAL]>)
=item Exports
=item SEE ALSO
+=head2 Devel::DProf - a Perl code profiler
+
+=item SYNOPSIS
+
+=item DESCRIPTION
+
+=item PROFILE FORMAT
+
+=item AUTOLOAD
+
+=item ENVIRONMENT
+
+=item BUGS
+
+=item SEE ALSO
+
=head2 Devel::Peek - A data debugging tool for the XS programmer
=item SYNOPSIS
=head2 Dumpvalue - provides screen dump of Perl data.
-=item SYNOPSYS
+=item SYNOPSIS
=item DESCRIPTION
=over
+=item How to Export
+
=item Selecting What To Export
=item Specialised Import Lists
=back
+=head2 Exporter::Heavy - Exporter guts
+
+=item SYNOPIS
+
+=item DESCRIPTION
+
=head2 ExtUtils::Command - utilities to replace common UNIX commands in
Makefiles etc.
=item Methods to actually produce chunks of text for the Makefile
-fixin, force (o), guess_name, has_link_code, init_dirscan, init_main,
-init_others, install (o), installbin (o), libscan (o), linkext (o), lsdir,
-macro (o), makeaperl (o), makefile (o), manifypods (o), maybe_command,
-maybe_command_in_dirs, needs_linking (o), nicetext, parse_version,
-parse_abstract, pasthru (o), path, perl_script, perldepend (o), ppd,
-perm_rw (o), perm_rwx (o), pm_to_blib, post_constants (o), post_initialize
-(o), postamble (o), prefixify, processPL (o), realclean (o),
-replace_manpage_separator, static (o), static_lib (o), staticmake (o),
+fixin, force (o), guess_name, has_link_code, htmlifypods (o), init_dirscan,
+init_main, init_others, install (o), installbin (o), libscan (o), linkext
+(o), lsdir, macro (o), makeaperl (o), makefile (o), manifypods (o),
+maybe_command, maybe_command_in_dirs, needs_linking (o), nicetext,
+parse_version, parse_abstract, pasthru (o), path, perl_script, perldepend
+(o), ppd, perm_rw (o), perm_rwx (o), pm_to_blib, post_constants (o),
+post_initialize (o), postamble (o), prefixify, processPL (o), realclean
+(o), replace_manpage_separator, static (o), static_lib (o), staticmake (o),
subdir_x (o), subdirs (o), test (o), test_via_harness (o), test_via_script
(o), tool_autosplit (o), tools_other (o), tool_xsubpp (o), top_targets (o),
writedoc, xs_c (o), xs_cpp (o), xs_o (o), perl_archive, export_list
=item Methods always loaded
-eliminate_macros, fixpath, catdir, catfile, wraplist, curdir (override),
-rootdir (override), updir (override)
+wraplist, rootdir (override)
=item SelfLoaded methods
catfile, constants (o), static_lib (o), dynamic_bs (o), dynamic_lib (o),
canonpath, perl_script, pm_to_blib, test_via_harness (o), tool_autosplit
-(override), tools_other (o), xs_o (o), top_targets (o), manifypods (o),
-dist_ci (o), dist_core (o), pasthru (o)
+(override), tools_other (o), xs_o (o), top_targets (o), htmlifypods (o),
+manifypods (o), dist_ci (o), dist_core (o), pasthru (o)
=head2 ExtUtils::MakeMaker - create an extension Makefile
AUTHOR, ABSTRACT, ABSTRACT_FROM, BINARY_LOCATION, C, CAPI, CCFLAGS, CONFIG,
CONFIGURE, DEFINE, DIR, DISTNAME, DL_FUNCS, DL_VARS, EXCLUDE_EXT,
-EXE_FILES, FIRST_MAKEFILE, FULLPERL, FUNCLIST, H, IMPORTS, INC,
-INCLUDE_EXT, INSTALLARCHLIB, INSTALLBIN, INSTALLDIRS, INSTALLMAN1DIR,
-INSTALLMAN3DIR, INSTALLPRIVLIB, INSTALLSCRIPT, INSTALLSITEARCH,
-INSTALLSITELIB, INST_ARCHLIB, INST_BIN, INST_EXE, INST_LIB, INST_MAN1DIR,
-INST_MAN3DIR, INST_SCRIPT, LDFROM, LIB, LIBPERL_A, LIBS, LINKTYPE,
-MAKEAPERL, MAKEFILE, MAN1PODS, MAN3PODS, MAP_TARGET, MYEXTLIB, NAME,
-NEEDS_LINKING, NOECHO, NORECURS, NO_VC, OBJECT, OPTIMIZE, PERL, PERLMAINCC,
-PERL_ARCHLIB, PERL_LIB, PERL_SRC, PERM_RW, PERM_RWX, PL_FILES, PM,
-PMLIBDIRS, POLLUTE, PPM_INSTALL_EXEC, PPM_INSTALL_SCRIPT, PREFIX,
+EXE_FILES, FIRST_MAKEFILE, FULLPERL, FUNCLIST, H, HTMLLIBPODS,
+HTMLSCRIPTPODS, IMPORTS, INC, INCLUDE_EXT, INSTALLARCHLIB, INSTALLBIN,
+INSTALLDIRS, INSTALLHTMLPRIVLIBDIR, INSTALLHTMLSCRIPTDIR,
+INSTALLHTMLSITELIBDIR, INSTALLMAN1DIR, INSTALLMAN3DIR, INSTALLPRIVLIB,
+INSTALLSCRIPT, INSTALLSITEARCH, INSTALLSITELIB, INST_ARCHLIB, INST_BIN,
+INST_EXE, INST_LIB, INST_HTMLLIBDIR, INST_HTMLSCRIPTDIR, INST_MAN1DIR,
+INST_MAN3DIR, INST_SCRIPT, PERL_MALLOC_OK, LDFROM, LIB, LIBPERL_A, LIBS,
+LINKTYPE, MAKEAPERL, MAKEFILE, MAN1PODS, MAN3PODS, MAP_TARGET, MYEXTLIB,
+NAME, NEEDS_LINKING, NOECHO, NORECURS, NO_VC, OBJECT, OPTIMIZE, PERL,
+PERLMAINCC, PERL_ARCHLIB, PERL_LIB, PERL_SRC, PERM_RW, PERM_RWX, PL_FILES,
+PM, PMLIBDIRS, POLLUTE, PPM_INSTALL_EXEC, PPM_INSTALL_SCRIPT, PREFIX,
PREREQ_PM, SKIP, TYPEMAPS, VERSION, VERSION_FROM, XS, XSOPT, XSPROTOARG,
XS_VERSION
=item DESCRIPTION
+eliminate_macros, fixpath
+
=over
=item Methods always loaded
=item METHODS
-accept([PKG]), timeout([VAL]), sockopt(OPT [, VAL]), sockdomain, socktype,
-protocol, connected
+accept([PKG]), socketpair(DOMAIN, TYPE, PROTOCOL), timeout([VAL]),
+sockopt(OPT [, VAL]), sockdomain, socktype, protocol, connected
=item SEE ALSO
=item METHODS
-accept([PKG]), timeout([VAL]), sockopt(OPT [, VAL]), sockdomain, socktype,
-protocol, connected
+accept([PKG]), socketpair(DOMAIN, TYPE, PROTOCOL), timeout([VAL]),
+sockopt(OPT [, VAL]), sockdomain, socktype, protocol, connected
=item SEE ALSO
=item ARGUMENTS
help, htmldir, htmlroot, infile, outfile, podroot, podpath, libpods,
-netscape, nonetscape, index, noindex, recurse, norecurse, title, verbose
+netscape, nonetscape, index, noindex, recurse, norecurse, title, css,
+verbose, quiet
=item EXAMPLE
+=item ENVIRONMENT
+
=item AUTHOR
=item BUGS
=item AUTHOR
+=head2 Pod::Man - Convert POD data to formatted *roff input
+
+=item SYNOPSIS
+
+=item DESCRIPTION
+
+center, date, fixed, fixedbold, fixeditalic, fixedbolditalic, release,
+section
+
+=item DIAGNOSTICS
+
+roff font should be 1 or 2 chars, not `%s', Invalid link %s, Unknown escape
+EE<lt>%sE<gt>, Unknown sequence %s, Unmatched =back
+
+=item BUGS
+
+=item NOTES
+
+=item SEE ALSO
+
+=item AUTHOR
+
=head2 Pod::Parser - base class for creating POD filters and translators
=item SYNOPSIS
=item QUICK OVERVIEW
+=item PARSING OPTIONS
+
+B<-want_nonPODs> (default: unset), B<-process_cut_cmd> (default: unset)
+
=item RECOMMENDED SUBROUTINE/METHOD OVERRIDES
=item B<command()>
=item B<parse_text()>
-B<-expand_seq> =E<gt> I<code-ref>|I<method-name>, B<-expand_ptree> =E<gt>
+B<-expand_seq> =E<gt> I<code-ref>|I<method-name>, B<-expand_text> =E<gt>
+I<code-ref>|I<method-name>, B<-expand_ptree> =E<gt>
I<code-ref>|I<method-name>
=item B<interpolate()>
=item ACCESSOR METHODS
+=item B<errorsub()>
+
=item B<cutting()>
+=item B<parseopts()>
+
=item B<output_file()>
=item B<output_handle()>
=item B<_pop_input_stream()>
-=item SEE ALSO
-
-=item AUTHOR
-
-=head2 Pod::PlainText, pod2plaintext - function to convert POD data to
-formatted ASCII text
-
-=item SYNOPSIS
-
-=item REQUIRES
-
-=item EXPORTS
-
-=item DESCRIPTION
+=item TREE-BASED PARSING
=item SEE ALSO
=item AUTHOR
-=head2 Pod::Text - convert POD data to formatted ASCII text
+=head2 Pod::Text - Convert POD data to formatted ASCII text
=item SYNOPSIS
=item DESCRIPTION
+alt, indent, loose, sentence, width
+
+=item DIAGNOSTICS
+
+Bizarre space in item, Can't open %s for reading: %s, Unknown escape: %s,
+Unknown sequence: %s, Unmatched =back
+
+=item RESTRICTIONS
+
+=item NOTES
+
+=item SEE ALSO
+
=item AUTHOR
-=item TODO
+=head2 Pod::Text::Color - Convert POD data to formatted color ASCII text
+
+=item SYNOPSIS
+
+=item DESCRIPTION
+
+=item BUGS
+
+=item SEE ALSO
+
+=item AUTHOR
+
+=head2 Pod::Text::Termcap, Pod::Text::Color - Convert POD data to ASCII
+text with format escapes
+
+=item SYNOPSIS
+
+=item DESCRIPTION
+
+=item SEE ALSO
+
+=item AUTHOR
=head2 Pod::Usage, pod2usage() - print a usage message from embedded pod
documentation
=head2 END blocks
-END blocks need saving in compiled output.
+END blocks need saving in compiled output, now that STOP blocks
+are available.
=head2 _AUTOLOAD
# perl4 prints: second new
# perl5 prints: 3
-=item * Discontinuance
-
-In Perl 4 (and versions of Perl 5 before 5.004), C<'\r'> characters in
-Perl code were silently allowed, although they could cause (mysterious!)
-failures in certain constructs, particularly here documents. Now,
-C<'\r'> characters cause an immediate fatal error. (Note: In this
-example, the notation B<\015> represents the incorrect line
-ending. Depending upon your text viewer, it will look different.)
-
- print "foo";\015
- print "bar";
-
- # perl4 prints: foobar
- # perl5.003 prints: foobar
- # perl5.004 dies: Illegal character \015 (carriage return)
-
-See L<perldiag> for full details.
-
=item * Deprecation
Some error messages will be different.
Also see L<"General Regular Expression Traps using s///, etc.">
for another example of this new feature...
+=item * Bitwise string ops
+
+When bitwise operators which can operate upon either numbers or
+strings (C<& | ^ ~>) are given only strings as arguments, perl4 would
+treat the operands as bitstrings so long as the program contained a call
+to the C<vec()> function. perl5 treats the string operands as bitstrings.
+(See L<perlop/Bitwise String Operators> for more details.)
+
+ $fred = "10";
+ $barney = "12";
+ $betty = $fred & $barney;
+ print "$betty\n";
+ # Uncomment the next line to change perl4's behavior
+ # ($dummy) = vec("dummy", 0, 0);
+
+ # Perl4 prints:
+ 8
+
+ # Perl5 prints:
+ 10
+
+ # If vec() is used anywhere in the program, both print:
+ 10
+
=back
=head2 General data type traps
On VMS, record reads are done with the equivalent of C<sysread>,
so it's best not to mix record and non-record reads on the same
file. (This is unlikely to be a problem, because any file you'd
-want to read in record mode is probably usable in line mode.)
+want to read in record mode is probably unusable in line mode.)
Non-VMS systems do normal I/O, so it's safe to mix record and
non-record reads of a file.
=head2 Introduction
-XS is a language used to create an extension interface
-between Perl and some C library which one wishes to use with
-Perl. The XS interface is combined with the library to
-create a new library which can be linked to Perl. An B<XSUB>
-is a function in the XS language and is the core component
-of the Perl application interface.
-
-The XS compiler is called B<xsubpp>. This compiler will embed
-the constructs necessary to let an XSUB, which is really a C
-function in disguise, manipulate Perl values and creates the
-glue necessary to let Perl access the XSUB. The compiler
+XS is an interface description file format used to create an extension
+interface between Perl and C code (or a C library) which one wishes
+to use with Perl. The XS interface is combined with the library to
+create a new library which can then be either dynamically loaded
+or statically linked into perl. The XS interface description is
+written in the XS language and is the core component of the Perl
+extension interface.
+
+An B<XSUB> forms the basic unit of the XS interface. After compilation
+by the B<xsubpp> compiler, each XSUB amounts to a C function definition
+which will provide the glue between Perl calling conventions and C
+calling conventions.
+
+The glue code pulls the arguments from the Perl stack, converts these
+Perl values to the formats expected by a C function, call this C function,
+transfers the return values of the C function back to Perl.
+Return values here may be a conventional C return value or any C
+function arguments that may serve as output parameters. These return
+values may be passed back to Perl either by putting them on the
+Perl stack, or by modifying the arguments supplied from the Perl side.
+
+The above is a somewhat simplified view of what really happens. Since
+Perl allows more flexible calling conventions than C, XSUBs may do much
+more in practice, such as checking input parameters for validity,
+throwing exceptions (or returning undef/empty list) if the return value
+from the C function indicates failure, calling different C functions
+based on numbers and types of the arguments, providing an object-oriented
+interface, etc.
+
+Of course, one could write such glue code directly in C. However, this
+would be a tedious task, especially if one needs to write glue for
+multiple C functions, and/or one is not familiar enough with the Perl
+stack discipline and other such arcana. XS comes to the rescue here:
+instead of writing this glue C code in long-hand, one can write
+a more concise short-hand I<description> of what should be done by
+the glue, and let the XS compiler B<xsubpp> handle the rest.
+
+The XS language allows one to describe the mapping between how the C
+routine is used, and how the corresponding Perl routine is used. It
+also allows creation of Perl routines which are directly translated to
+C code and which are not related to a pre-existing C function. In cases
+when the C interface coincides with the Perl interface, the XSUB
+declaration is almost identical to a declaration of a C function (in K&R
+style). In such circumstances, there is another tool called C<h2xs>
+that is able to translate an entire C header file into a corresponding
+XS file that will provide glue to the functions/macros described in
+the header file.
+
+The XS compiler is called B<xsubpp>. This compiler creates
+the constructs necessary to let an XSUB manipulate Perl values, and
+creates the glue necessary to let Perl call the XSUB. The compiler
uses B<typemaps> to determine how to map C function parameters
-and variables to Perl values. The default typemap handles
-many common C types. A supplement typemap must be created
-to handle special structures and types for the library being
-linked.
+and output values to Perl values and back. The default typemap
+(which comes with Perl) handles many common C types. A supplementary
+typemap may also be needed to handle any special structures and types
+for the library being linked.
+
+A file in XS format starts with a C language section which goes until the
+first C<MODULE =Z<>> directive. Other XS directives and XSUB definitions
+may follow this line. The "language" used in this part of the file
+is usually referred to as the XS language.
See L<perlxstut> for a tutorial on the whole extension creation process.
-Note: For many extensions, Dave Beazley's SWIG system provides a
-significantly more convenient mechanism for creating the XS glue
+Note: For some extensions, Dave Beazley's SWIG system may provide a
+significantly more convenient mechanism for creating the extension glue
code. See L<http://www.cs.utah.edu/~beazley/SWIG> for more
information.
rpcb_gettime(host,timep)
char *host
time_t &timep
- OUTPUT:
+ OUTPUT:
timep
Any extension to Perl, including those containing XSUBs,
=head2 The Anatomy of an XSUB
+The simplest XSUBs consist of 3 parts: a description of the return
+value, the name of the XSUB routine and the names of its arguments,
+and a description of types or formats of the arguments.
+
The following XSUB allows a Perl program to access a C library function
called sin(). The XSUB will imitate the C function which takes a single
argument and returns a single value.
sin(x)
double x
-When using C pointers the indirection operator C<*> should be considered
-part of the type and the address operator C<&> should be considered part of
-the variable, as is demonstrated in the rpcb_gettime() function above. See
-the section on typemaps for more about handling qualifiers and unary
+When using parameters with C pointer types, as in
+
+ double string_to_double(char *s);
+
+there may be two ways to describe this argument to B<xsubpp>:
+
+ char * s
+ char &s
+
+Both these XS declarations correspond to the C<char*> C type, but they have
+different semantics. It is convenient to think that the indirection operator
+C<*> should be considered as a part of the type and the address operator C<&>
+should be considered part of the variable. See L<"The Typemap"> and
+L<"The & Unary Operator"> for more info about handling qualifiers and unary
operators in C types.
The function name and the return type must be placed on
-separate lines.
+separate lines and should be flush left-adjusted.
INCORRECT CORRECT
The function body may be indented or left-adjusted. The following example
shows a function with its body left-adjusted. Most examples in this
-document will indent the body.
+document will indent the body for better readability.
CORRECT
sin(x)
double x
+More complicated XSUBs may contain many other sections. Each section of
+an XSUB starts with the corresponding keyword, such as INIT: or CLEANUP:.
+However, the first two lines of an XSUB always contain the same data:
+descriptions of the return type and the names of the function and its
+parameters. Whatever immediately follows these is considered to be
+an INPUT: section unless explicitly marked with another keyword.
+(See L<The INPUT: Keyword>.)
+
+An XSUB section continues until another section-start keyword is found.
+
=head2 The Argument Stack
-The argument stack is used to store the values which are
+The Perl argument stack is used to store the values which are
sent as parameters to the XSUB and to store the XSUB's
-return value. In reality all Perl functions keep their
-values on this stack at the same time, each limited to its
-own range of positions on the stack. In this document the
+return value(s). In reality all Perl functions (including non-XSUB
+ones) keep their values on this stack all the same time, each limited
+to its own range of positions on the stack. In this document the
first position on that stack which belongs to the active
function will be referred to as position 0 for that function.
=head2 The RETVAL Variable
-The RETVAL variable is a magic variable which always matches
-the return type of the C library function. The B<xsubpp> compiler will
-supply this variable in each XSUB and by default will use it to hold the
-return value of the C library function being called. In simple cases the
-value of RETVAL will be placed in ST(0) of the argument stack where it can
-be received by Perl as the return value of the XSUB.
+The RETVAL variable is a special C variable that is declared automatically
+for you. The C type of RETVAL matches the return type of the C library
+function. The B<xsubpp> compiler will declare this variable in each XSUB
+with non-C<void> return type. By default the generated C function
+will use RETVAL to hold the return value of the C library function being
+called. In simple cases the value of RETVAL will be placed in ST(0) of
+the argument stack where it can be received by Perl as the return value
+of the XSUB.
If the XSUB has a return type of C<void> then the compiler will
-not supply a RETVAL variable for that function. When using
-the PPCODE: directive the RETVAL variable is not needed, unless used
-explicitly.
+not declare a RETVAL variable for that function. When using
+a PPCODE: section no manipulation of the RETVAL variable is required, the
+section may use direct stack manipulation to place output values on the stack.
If PPCODE: directive is not used, C<void> return value should be used
only for subroutines which do not return a value, I<even if> CODE:
The OUTPUT: keyword indicates that certain function parameters should be
updated (new values made visible to Perl) when the XSUB terminates or that
certain values should be returned to the calling Perl function. For
-simple functions, such as the sin() function above, the RETVAL variable is
-automatically designated as an output value. In more complex functions
+simple functions which have no CODE: or PPCODE: section,
+such as the sin() function above, the RETVAL variable is
+automatically designated as an output value. For more complex functions
the B<xsubpp> compiler will need help to determine which variables are output
variables.
rpcb_gettime(host,timep)
char *host
time_t &timep
- OUTPUT:
+ OUTPUT:
timep
The OUTPUT: keyword will also allow an output parameter to
rpcb_gettime(host,timep)
char *host
time_t &timep
- OUTPUT:
+ OUTPUT:
timep sv_setnv(ST(1), (double)timep);
B<xsubpp> emits an automatic C<SvSETMAGIC()> for all parameters in the
This keyword is used in more complicated XSUBs which require
special handling for the C function. The RETVAL variable is
-available but will not be returned unless it is specified
-under the OUTPUT: keyword.
+still declared, but it will not be returned unless it is specified
+in the OUTPUT: section.
The following XSUB is for a C function which requires special handling of
its parameters. The Perl usage is given first.
rpcb_gettime(host,timep)
char *host
time_t timep
- CODE:
+ CODE:
RETVAL = rpcb_gettime( host, &timep );
- OUTPUT:
+ OUTPUT:
timep
RETVAL
rpcb_gettime(host,timep)
char *host
time_t &timep
- INIT:
+ INIT:
printf("# Host is %s\n", host );
- OUTPUT:
+ OUTPUT:
timep
+Another use for the INIT: section is to check for preconditions before
+making a call to the C function:
+
+ long long
+ lldiv(a,b)
+ long long a
+ long long b
+ INIT:
+ if (a == 0 && b == 0)
+ XSRETURN_UNDEF;
+ if (b == 0)
+ croak("lldiv: cannot divide by 0");
+
=head2 The NO_INIT Keyword
The NO_INIT keyword is used to indicate that a function
rpcb_gettime(host,timep)
char *host
time_t &timep = NO_INIT
- OUTPUT:
+ OUTPUT:
timep
=head2 Initializing Function Parameters
-Function parameters are normally initialized with their
-values from the argument stack. The typemaps contain the
-code segments which are used to transfer the Perl values to
+C function parameters are normally initialized with their values from
+the argument stack (which in turn contains the parameters that were
+passed to the XSUB from Perl). The typemaps contain the
+code segments which are used to translate the Perl values to
the C parameters. The programmer, however, is allowed to
override the typemaps and supply alternate (or additional)
-initialization code.
+initialization code. Initialization code starts with the first
+C<=>, C<;> or C<+> on a line in the INPUT: section. The only
+exception happens if this C<;> terminates the line, then this C<;>
+is quietly ignored.
The following code demonstrates how to supply initialization code for
function parameters. The initialization code is eval'd within double
rpcb_gettime(host,timep)
char *host = (char *)SvPV($arg,PL_na);
time_t &timep = 0;
- OUTPUT:
+ OUTPUT:
timep
This should not be used to supply default values for parameters. One
another library function before it can be used. Default parameters are
covered in the next section.
-If the initialization begins with C<=>, then it is output on
-the same line where the input variable is declared. If the
-initialization begins with C<;> or C<+>, then it is output after
-all of the input variables have been declared. The C<=> and C<;>
-cases replace the initialization normally supplied from the typemap.
-For the C<+> case, the initialization from the typemap will precede
-the initialization code included after the C<+>. A global
+If the initialization begins with C<=>, then it is output in
+the declaration for the input variable, replacing the initialization
+supplied by the typemap. If the initialization
+begins with C<;> or C<+>, then it is performed after
+all of the input variables have been declared. In the C<;>
+case the initialization normally supplied by the typemap is not performed.
+For the C<+> case, the declaration for the variable will include the
+initialization from the typemap. A global
variable, C<%v>, is available for the truly rare case where
information from one initialization is needed in another
initialization.
+Here's a truly obscure example:
+
bool_t
rpcb_gettime(host,timep)
- time_t &timep ; /*\$v{time}=@{[$v{time}=$arg]}*/
- char *host + SvOK($v{time}) ? SvPV($arg,PL_na) : NULL;
- OUTPUT:
+ time_t &timep ; /* \$v{timep}=@{[$v{timep}=$arg]} */
+ char *host + SvOK($v{timep}) ? SvPV($arg,PL_na) : NULL;
+ OUTPUT:
timep
+The construct C<\$v{timep}=@{[$v{timep}=$arg]}> used in the above
+example has a two-fold purpose: first, when this line is processed by
+B<xsubpp>, the Perl snippet C<$v{timep}=$arg> is evaluated. Second,
+the text of the evaluated snippet is output into the generated C file
+(inside a C comment)! During the processing of C<char *host> line,
+$arg will evaluate to C<ST(0)>, and C<$v{timep}> will evaluate to
+C<ST(1)>.
+
=head2 Default Parameter Values
-Default values can be specified for function parameters by
+Default values for XSUB arguments can be specified by
placing an assignment statement in the parameter list. The
default value may be a number or a string. Defaults should
always be used on the right-most parameters only.
To allow the XSUB for rpcb_gettime() to have a default host
value the parameters to the XSUB could be rearranged. The
XSUB will then call the real rpcb_gettime() function with
-the parameters in the correct order. Perl will call this
-XSUB with either of the following statements.
+the parameters in the correct order. This XSUB can be called
+from Perl with either of the following statements:
$status = rpcb_gettime( $timep, $host );
rpcb_gettime(timep,host="localhost")
char *host
time_t timep = NO_INIT
- CODE:
+ CODE:
RETVAL = rpcb_gettime( host, &timep );
- OUTPUT:
+ OUTPUT:
timep
RETVAL
=head2 The PREINIT: Keyword
-The PREINIT: keyword allows extra variables to be declared before the
-typemaps are expanded. If a variable is declared in a CODE: block then that
-variable will follow any typemap code. This may result in a C syntax
-error. To force the variable to be declared before the typemap code, place
-it into a PREINIT: block. The PREINIT: keyword may be used one or more
-times within an XSUB.
+The PREINIT: keyword allows extra variables to be declared immediately
+before or after the declartions of the parameters from the INPUT: section
+are emitted.
+
+If a variable is declared inside a CODE: section it will follow any typemap
+code that is emitted for the input parameters. This may result in the
+declaration ending up after C code, which is C syntax error. Similar
+errors may happen with an explicit C<;>-type or C<+>-type initialization of
+parameters is used (see L<"Initializing Function Parameters">). Declaring
+these variables in an INIT: section will not help.
+
+In such cases, to force an additional variable to be declared together
+with declarations of other variables, place the declaration into a
+PREINIT: section. The PREINIT: keyword may be used one or more times
+within an XSUB.
The following examples are equivalent, but if the code is using complex
typemaps then the first example is safer.
bool_t
rpcb_gettime(timep)
time_t timep = NO_INIT
- PREINIT:
+ PREINIT:
char *host = "localhost";
- CODE:
+ CODE:
RETVAL = rpcb_gettime( host, &timep );
- OUTPUT:
+ OUTPUT:
timep
RETVAL
-A correct, but error-prone example.
+For this particular case an INIT: keyword would generate the
+same C code as the PREINIT: keyword. Another correct, but error-prone example:
bool_t
rpcb_gettime(timep)
time_t timep = NO_INIT
- CODE:
+ CODE:
char *host = "localhost";
RETVAL = rpcb_gettime( host, &timep );
- OUTPUT:
+ OUTPUT:
+ timep
+ RETVAL
+
+Another way to declare C<host> is to use a C block in the CODE: section:
+
+ bool_t
+ rpcb_gettime(timep)
+ time_t timep = NO_INIT
+ CODE:
+ {
+ char *host = "localhost";
+ RETVAL = rpcb_gettime( host, &timep );
+ }
+ OUTPUT:
+ timep
+ RETVAL
+
+The ability to put additional declarations before the typemap entries are
+processed is very handy in the cases when typemap conversions manipulate
+some global state:
+
+ MyObject
+ mutate(o)
+ PREINIT:
+ MyState st = global_state;
+ INPUT:
+ MyObject o;
+ CLEANUP:
+ reset_to(global_state, st);
+
+Here we suppose that conversion to C<MyObject> in the INPUT: section and from
+MyObject when processing RETVAL will modify a global variable C<global_state>.
+After these conversions are performed, we restore the old value of
+C<global_state> (to avoid memory leaks, for example).
+
+There is another way to trade clarity for compactness: INPUT sections allow
+declaration of C variables which do not appear in the parameter list of
+a subroutine. Thus the above code for mutate() can be rewritten as
+
+ MyObject
+ mutate(o)
+ MyState st = global_state;
+ MyObject o;
+ CLEANUP:
+ reset_to(global_state, st);
+
+and the code for rpcb_gettime() can be rewritten as
+
+ bool_t
+ rpcb_gettime(timep)
+ time_t timep = NO_INIT
+ char *host = "localhost";
+ C_ARGS:
+ host, &timep
+ OUTPUT:
timep
RETVAL
enabled, the XSUB will invoke ENTER and LEAVE automatically.
To support potentially complex type mappings, if a typemap entry used
-by this XSUB contains a comment like C</*scope*/> then scoping will
-automatically be enabled for that XSUB.
+by an XSUB contains a comment like C</*scope*/> then scoping will
+be automatically enabled for that XSUB.
To enable scoping:
bool_t
rpcb_gettime(host,timep)
char *host
- PREINIT:
+ PREINIT:
time_t tt;
- INPUT:
+ INPUT:
time_t timep
- CODE:
+ CODE:
RETVAL = rpcb_gettime( host, &tt );
timep = tt;
- OUTPUT:
+ OUTPUT:
timep
RETVAL
bool_t
rpcb_gettime(host,timep)
- PREINIT:
+ PREINIT:
time_t tt;
- INPUT:
+ INPUT:
char *host
- PREINIT:
+ PREINIT:
char *h;
- INPUT:
+ INPUT:
time_t timep
- CODE:
+ CODE:
h = host;
RETVAL = rpcb_gettime( h, &tt );
timep = tt;
- OUTPUT:
+ OUTPUT:
+ timep
+ RETVAL
+
+Since INPUT sections allow declaration of C variables which do not appear
+in the parameter list of a subroutine, this may be shortened to:
+
+ bool_t
+ rpcb_gettime(host,timep)
+ time_t tt;
+ char *host;
+ char *h = host;
+ time_t timep;
+ CODE:
+ RETVAL = rpcb_gettime( h, &tt );
+ timep = tt;
+ OUTPUT:
timep
RETVAL
+(We used our knowledge that input conversion for C<char *> is a "simple" one,
+thus C<host> is initialized on the declaration line, and our assignment
+C<h = host> is not performed too early. Otherwise one would need to have the
+assignment C<h = host> in a CODE: or INIT: section.)
+
=head2 Variable-length Parameter Lists
XSUBs can have variable-length parameter lists by specifying an ellipsis
bool_t
rpcb_gettime(timep, ...)
time_t timep = NO_INIT
- PREINIT:
+ PREINIT:
char *host = "localhost";
STRLEN n_a;
- CODE:
- if( items > 1 )
- host = (char *)SvPV(ST(1), n_a);
- RETVAL = rpcb_gettime( host, &timep );
- OUTPUT:
+ CODE:
+ if( items > 1 )
+ host = (char *)SvPV(ST(1), n_a);
+ RETVAL = rpcb_gettime( host, &timep );
+ OUTPUT:
timep
RETVAL
The C_ARGS: keyword allows creating of XSUBS which have different
calling sequence from Perl than from C, without a need to write
-CODE: or CPPCODE: section. The contents of the C_ARGS: paragraph is
+CODE: or PPCODE: section. The contents of the C_ARGS: paragraph is
put as the argument to the called C function without any change.
-For example, suppose that C function is declared as
+For example, suppose that a C function is declared as
symbolic nth_derivative(int n, symbolic function, int flags);
nth_derivative(function, n)
symbolic function
int n
- C_ARGS:
+ C_ARGS:
n, function, default_flags
=head2 The PPCODE: Keyword
control the argument stack for the XSUBs return values. Occasionally one
will want an XSUB to return a list of values rather than a single value.
In these cases one must use PPCODE: and then explicitly push the list of
-values on the stack. The PPCODE: and CODE: keywords are not used
+values on the stack. The PPCODE: and CODE: keywords should not be used
together within the same XSUB.
+The actual difference between PPCODE: and CODE: sections is in the
+initialization of C<SP> macro (which stands for the I<current> Perl
+stack pointer), and in the handling of data on the stack when returning
+from an XSUB. In CODE: sections SP preserves the value which was on
+entry to the XSUB: SP is on the function pointer (which follows the
+last parameter). In PPCODE: sections SP is moved backward to the
+beginning of the parameter list, which allows C<PUSH*()> macros
+to place output values in the place Perl expects them to be when
+the XSUB returns back to Perl.
+
+The generated trailer for a CODE: section ensures that the number of return
+values Perl will see is either 0 or 1 (depending on the C<void>ness of the
+return value of the C function, and heuristics mentioned in
+L<"The RETVAL Variable">). The trailer generated for a PPCODE: section
+is based on the number of return values and on the number of times
+C<SP> was updated by C<[X]PUSH*()> macros.
+
+Note that macros C<ST(i)>, C<XST_m*()> and C<XSRETURN*()> work equally
+well in CODE: sections and PPCODE: sections.
+
The following XSUB will call the C rpcb_gettime() function
and will return its two output values, timep and status, to
Perl as a single list.
void
rpcb_gettime(host)
char *host
- PREINIT:
+ PREINIT:
time_t timep;
bool_t status;
- PPCODE:
+ PPCODE:
status = rpcb_gettime( host, &timep );
EXTEND(SP, 2);
PUSHs(sv_2mortal(newSViv(status)));
SV *
rpcb_gettime(host)
char * host
- PREINIT:
+ PREINIT:
time_t timep;
bool_t x;
- CODE:
+ CODE:
ST(0) = sv_newmortal();
if( rpcb_gettime( host, &timep ) )
sv_setnv( ST(0), (double)timep);
SV *
rpcb_gettime(host)
char * host
- PREINIT:
+ PREINIT:
time_t timep;
bool_t x;
- CODE:
+ CODE:
ST(0) = sv_newmortal();
if( rpcb_gettime( host, &timep ) ){
sv_setnv( ST(0), (double)timep);
void
rpcb_gettime(host)
char *host
- PREINIT:
+ PREINIT:
time_t timep;
- PPCODE:
+ PPCODE:
if( rpcb_gettime( host, &timep ) )
PUSHs(sv_2mortal(newSViv(timep)));
else{
- /* Nothing pushed on stack, so an empty */
- /* list is implicitly returned. */
+ /* Nothing pushed on stack, so an empty
+ * list is implicitly returned. */
}
Some people may be inclined to include an explicit C<return> in the above
the XSUB stack is properly adjusted. Consult L<perlguts/"API LISTING"> for
other C<XSRETURN> macros.
+Since C<XSRETURN_*> macros can be used with CODE blocks as well, one can
+rewrite this example as:
+
+ int
+ rpcb_gettime(host)
+ char *host
+ PREINIT:
+ time_t timep;
+ CODE:
+ RETVAL = rpcb_gettime( host, &timep );
+ if (RETVAL == 0)
+ XSRETURN_UNDEF;
+ OUTPUT:
+ RETVAL
+
+In fact, one can put this check into a CLEANUP: section as well. Together
+with PREINIT: simplifications, this leads to:
+
+ int
+ rpcb_gettime(host)
+ char *host
+ time_t timep;
+ CLEANUP:
+ if (RETVAL == 0)
+ XSRETURN_UNDEF;
+
=head2 The REQUIRE: Keyword
The REQUIRE: keyword is used to indicate the minimum version of the
bool_t
rpcb_gettime(timep, ...)
time_t timep = NO_INIT
- PROTOTYPE: $;$
- PREINIT:
+ PROTOTYPE: $;$
+ PREINIT:
char *host = "localhost";
STRLEN n_a;
- CODE:
+ CODE:
if( items > 1 )
host = (char *)SvPV(ST(1), n_a);
RETVAL = rpcb_gettime( host, &timep );
- OUTPUT:
+ OUTPUT:
timep
RETVAL
rpcb_gettime(host,timep)
char *host
time_t &timep
- ALIAS:
+ ALIAS:
FOO::gettime = 1
BAR::getit = 2
- INIT:
+ INIT:
printf("# ix = %d\n", ix );
- OUTPUT:
+ OUTPUT:
timep
=head2 The INTERFACE: Keyword
This keyword declares the current XSUB as a keeper of the given
calling signature. If some text follows this keyword, it is
considered as a list of functions which have this signature, and
-should be attached to XSUBs.
+should be attached to the current XSUB.
-Say, if you have 4 functions multiply(), divide(), add(), subtract() all
-having the signature
+For example, if you have 4 C functions multiply(), divide(), add(),
+subtract() all having the signature:
symbolic f(symbolic, symbolic);
-you code them all by using XSUB
+you can make them all to use the same XSUB using this:
symbolic
interface_s_ss(arg1, arg2)
multiply divide
add subtract
-The advantage of this approach comparing to ALIAS: keyword is that one
+(This is the complete XSUB code for 4 Perl functions!) Four generated
+Perl function share names with corresponding C functions.
+
+The advantage of this approach comparing to ALIAS: keyword is that there
+is no need to code a switch statement, each Perl function (which shares
+the same XSUB) knows which C function it should call. Additionally, one
can attach an extra function remainder() at runtime by using
-
+
CV *mycv = newXSproto("Symbolic::remainder",
XS_Symbolic_interface_s_ss, __FILE__, "$$");
XSINTERFACE_FUNC_SET(mycv, remainder);
-(This example supposes that there was no INTERFACE_MACRO: section,
-otherwise one needs to use something else instead of
-C<XSINTERFACE_FUNC_SET>.)
+say, from another XSUB. (This example supposes that there was no
+INTERFACE_MACRO: section, otherwise one needs to use something else instead of
+C<XSINTERFACE_FUNC_SET>, see the next section.)
=head2 The INTERFACE_MACRO: Keyword
interface_s_ss(arg1, arg2)
symbolic arg1
symbolic arg2
- INTERFACE_MACRO:
+ INTERFACE_MACRO:
XSINTERFACE_FUNC_BYOFFSET
XSINTERFACE_FUNC_BYOFFSET_set
- INTERFACE:
+ INTERFACE:
multiply divide
add subtract
rpcb_gettime(host,timep)
char *host
time_t &timep
- OUTPUT:
+ OUTPUT:
timep
The XS module can use INCLUDE: to pull that file into it.
long
rpcb_gettime(a,b)
CASE: ix == 1
- ALIAS:
+ ALIAS:
x_gettime = 1
- INPUT:
+ INPUT:
# 'a' is timep, 'b' is host
char *b
time_t a = NO_INIT
- CODE:
+ CODE:
RETVAL = rpcb_gettime( b, &a );
- OUTPUT:
+ OUTPUT:
a
RETVAL
CASE:
# 'a' is host, 'b' is timep
char *a
time_t &b = NO_INIT
- OUTPUT:
+ OUTPUT:
b
RETVAL
=head2 The & Unary Operator
-The & unary operator is used to tell the compiler that it should dereference
-the object when it calls the C function. This is used when a CODE: block is
-not used and the object is a not a pointer type (the object is an C<int> or
-C<long> but not a C<int*> or C<long*>).
+The C<&> unary operator in the INPUT: section is used to tell B<xsubpp>
+that it should convert a Perl value to/from C using the C type to the left
+of C<&>, but provide a pointer to this value when the C function is called.
+
+This is useful to avoid a CODE: block for a C function which takes a parameter
+by reference. Typically, the parameter should be not a pointer type (an
+C<int> or C<long> but not a C<int*> or C<long*>).
-The following XSUB will generate incorrect C code. The xsubpp compiler will
+The following XSUB will generate incorrect C code. The B<xsubpp> compiler will
turn this into code which calls C<rpcb_gettime()> with parameters C<(char
*host, time_t timep)>, but the real C<rpcb_gettime()> wants the C<timep>
parameter to be of type C<time_t*> rather than C<time_t>.
rpcb_gettime(host,timep)
char *host
time_t timep
- OUTPUT:
+ OUTPUT:
timep
-That problem is corrected by using the C<&> operator. The xsubpp compiler
+That problem is corrected by using the C<&> operator. The B<xsubpp> compiler
will now turn this into code which calls C<rpcb_gettime()> correctly with
parameters C<(char *host, time_t *timep)>. It does this by carrying the
C<&> through, so the function call looks like C<rpcb_gettime(host, &timep)>.
rpcb_gettime(host,timep)
char *host
time_t &timep
- OUTPUT:
+ OUTPUT:
timep
=head2 Inserting Comments and C Preprocessor Directives
#if ... version2
#endif
-because otherwise xsubpp will believe that you made a duplicate
+because otherwise B<xsubpp> will believe that you made a duplicate
definition of the function. Also, put a blank line before the
#else/#endif so it will not be seen as part of the function body.
=head2 Using XS With C++
-If a function is defined as a C++ method then it will assume
+If an XSUB name contains C<::>, it is considered to be a C++ method.
+The generated Perl function will assume that
its first argument is an object pointer. The object pointer
will be stored in a variable called THIS. The object should
have been created by C++ with the new() function and should
blessing of the object by Perl can be handled by a typemap. An example
typemap is shown at the end of this section.
-If the method is defined as static it will call the C++
+If the return type of the XSUB includes C<static>, the method is considered
+to be a static method. It will call the C++
function using the class::method() syntax. If the method is not static
the function will be called using the THIS-E<gt>method() syntax.
color::set_blue( val )
int val
-Both functions will expect an object as the first parameter. The xsubpp
-compiler will call that object C<THIS> and will use it to call the specified
-method. So in the C++ code the blue() and set_blue() methods will be called
-in the following manner.
+Both Perl functions will expect an object as the first parameter. In the
+generated C++ code the object is called C<THIS>, and the method call will
+be performed on this object. So in the C++ code the blue() and set_blue()
+methods will be called as this:
RETVAL = THIS->blue();
THIS->set_blue( val );
If the function's name is B<DESTROY> then the C++ C<delete> function will be
-called and C<THIS> will be given as its parameter.
+called and C<THIS> will be given as its parameter. The generated C++ code for
void
color::DESTROY()
-The C++ code will call C<delete>.
+will look like this:
+
+ color *THIS = ...; // Initialized as in typemap
delete THIS;
color *
color::new()
-The C++ code will call C<new>.
+The generated C++ code will call C<new>.
- RETVAL = new color();
+ RETVAL = new color();
The following is an example of a typemap that could be used for this C++
example.
=head2 Interface Strategy
When designing an interface between Perl and a C library a straight
-translation from C to XS is often sufficient. The interface will often be
+translation from C to XS (such as created by C<h2xs -x>) is often sufficient.
+However, sometimes the interface will look
very C-like and occasionally nonintuitive, especially when the C function
-modifies one of its parameters. In cases where the programmer wishes to
+modifies one of its parameters, or returns failure inband (as in "negative
+return values mean failure"). In cases where the programmer wishes to
create a more Perl-like interface the following strategy may help to
identify the more critical parts of the interface.
-Identify the C functions which modify their parameters. The XSUBs for
-these functions may be able to return lists to Perl, or may be
-candidates to return undef or an empty list in case of failure.
+Identify the C functions with input/output or output parameters. The XSUBs for
+these functions may be able to return lists to Perl.
+
+Identify the C functions which use some inband info as an indication
+of failure. They may be
+candidates to return undef or an empty list in case of failure. If the
+failure may be detected without a call to the C function, you may want to use
+an INIT: section to report the failure. For failures detectable after the C
+function returns one may want to use a CLEANUP: section to process the
+failure. In more complicated cases use CODE: or PPCODE: sections.
+
+If many functions use the same failure indication based on the return value,
+you may want to create a special typedef to handle this situation. Put
+
+ typedef int negative_is_failure;
+
+near the beginning of XS file, and create an OUTPUT typemap entry
+for C<negative_is_failure> which converts negative values to C<undef>, or
+maybe croak()s. After this the return value of type C<negative_is_failure>
+will create more Perl-like interface.
Identify which values are used by only the C and XSUB functions
-themselves. If Perl does not need to access the contents of the value
+themselves, say, when a parameter to a function should be a contents of a
+global variable. If Perl does not need to access the contents of the value
then it may not be necessary to provide a translation for that value
from C to Perl.
Identify the pointers in the C function parameter lists and return
-values. Some pointers can be handled in XS with the & unary operator on
-the variable name while others will require the use of the * operator on
-the type name. In general it is easier to work with the & operator.
+values. Some pointers may be used to implement input/output or
+output parameters, they can be handled in XS with the C<&> unary operator,
+and, possibly, using the NO_INIT keyword.
+Some others will require handling of types like C<int *>, and one needs
+to decide what a useful Perl translation will do in such a case. When
+the semantic is clear, it is advisable to put the translation into a typemap
+file.
Identify the structures used by the C functions. In many
cases it may be helpful to use the T_PTROBJ typemap for
these structures so they can be manipulated by Perl as
-blessed objects.
+blessed objects. (This is handled automatically by C<h2xs -x>.)
+
+If the same C type is used in several different contexts which require
+different translations, C<typedef> several new types mapped to this C type,
+and create separate F<typemap> entries for these new types. Use these
+types in declarations of return type and parameters to XSUBs.
=head2 Perl Objects And C Structures
void
rpcb_DESTROY(netconf)
Netconfig *netconf
- CODE:
+ CODE:
printf("Now in NetconfigPtr::DESTROY\n");
free( netconf );
The typemap is a collection of code fragments which are used by the B<xsubpp>
compiler to map C function parameters and values to Perl values. The
typemap file may consist of three sections labeled C<TYPEMAP>, C<INPUT>, and
-C<OUTPUT>. Any unlabelled initial section is assumed to be a C<TYPEMAP>
-section if a name is not explicitly specified. The INPUT section tells
+C<OUTPUT>. An unlabelled initial section is assumed to be a C<TYPEMAP>
+section. The INPUT section tells
the compiler how to translate Perl values
into variables of certain C types. The OUTPUT section tells the compiler
how to translate the values from certain C types into values Perl can
here. Note that the C type is separated from the XS type with a tab and
that the C unary operator C<*> is considered to be a part of the C type name.
- TYPEMAP
- Netconfig *<tab>T_PTROBJ
+ TYPEMAP
+ Netconfig *<tab>T_PTROBJ
Here's a more complicated example: suppose that you wanted C<struct
netconfig> to be blessed into the class C<Net::Config>. One way to do
SV *
rpcb_gettime(host="localhost")
char *host
- PREINIT:
+ PREINIT:
time_t timep;
- CODE:
+ CODE:
ST(0) = sv_newmortal();
if( rpcb_gettime( host, &timep ) )
sv_setnv( ST(0), (double)timep );
void
rpcb_DESTROY(netconf)
Netconfig *netconf
- CODE:
+ CODE:
printf("NetconfigPtr::DESTROY\n");
free( netconf );
=head1 AUTHOR
-Dean Roehrich <F<roehrich@cray.com>>
-Jul 8, 1996
+Originally written by Dean Roehrich <F<roehrich@cray.com>>.
+
+Maintained since 1996 by The Perl Porters <F<perlbug@perl.com>>.
This tutorial assumes that the make program that Perl is configured to
use is called C<make>. Instead of running "make" in the examples that
follow, you may have to substitute whatever make program Perl has been
-configured to use. Running "perl -V:make" should tell you what it is.
+configured to use. Running B<perl -V:make> should tell you what it is.
=head2 Version caveat
-This tutorial tries hard to keep up with the latest development versions
-of Perl. This often means that it is sometimes in advance of the latest
-released version of Perl, and that certain features described here might
-not work on earlier versions. See the section on "Troubleshooting
-these Examples" for more information.
+When writing a Perl extension for general consumption, one should expect that
+the extension will be used with versions of Perl different from the
+version available on your machine. Since you are reading this document,
+the version of Perl on your machine is probably 5.005 or later, but the users
+of your extension may have more ancient versions.
+
+To understand what kinds of incompatibilities one may expect, and in the rare
+case that the version of Perl on your machine is older than this document,
+see the section on "Troubleshooting these Examples" for more information.
+
+If your extension uses some features of Perl which are not available on older
+releases of Perl, your users would appreciate an early meaningful warning.
+You would probably put this information into the F<README> file, but nowadays
+installation of extensions may be performed automatically, guided by F<CPAN.pm>
+module or other tools.
+
+In MakeMaker-based installations, F<Makefile.PL> provides the earliest
+opportunity to perform version checks. One can put something like this
+in F<Makefile.PL> for this purpose:
+
+ eval { require 5.007 }
+ or die <<EOD;
+ ############
+ ### This module uses frobnication framework which is not available before
+ ### version 5.007 of Perl. Upgrade your Perl before installing Kara::Mba.
+ ############
+ EOD
=head2 Dynamic Loading versus Static Loading
If you are on a Win32 system, and the build process fails with linker
errors for functions in the C library, check if your Perl is configured
-to use PerlCRT (running "perl -V:libc" should show you if this is the
+to use PerlCRT (running B<perl -V:libc> should show you if this is the
case). If Perl is configured to use PerlCRT, you have to make sure
PerlCRT.lib is copied to the same location that msvcrt.lib lives in,
so that the compiler can find it on its own. msvcrt.lib is usually
=head2 The XSUBPP Program
-The xsubpp program takes the XS code in the .xs file and translates it into
+The B<xsubpp> program takes the XS code in the .xs file and translates it into
C code, placing it in a file whose suffix is .c. The C code created makes
heavy use of the C functions within Perl.
=head2 The TYPEMAP file
-The xsubpp program uses rules to convert from Perl's data types (scalar,
+The B<xsubpp> program uses rules to convert from Perl's data types (scalar,
array, etc.) to C's data types (int, char, etc.). These rules are stored
in the typemap file ($PERLLIB/ExtUtils/typemap). This file is split into
three parts.
The first section maps various C data types to a name, which corresponds
somewhat with the various Perl types. The second section contains C code
-which xsubpp uses to handle input parameters. The third section contains
-C code which xsubpp uses to handle output parameters.
+which B<xsubpp> uses to handle input parameters. The third section contains
+C code which B<xsubpp> uses to handle output parameters.
Let's take a look at a portion of the .c file created for our extension.
The file name is Mytest.c:
=back
-=head2 More about XSUBPP
+=head2 Anatomy of .xs file
+
+The .xs file of L<"EXAMPLE 4"> contained some new elements. To understand
+the meaning of these elements, pay attention to the line which reads
+
+ MODULE = Mytest2 PACKAGE = Mytest2
+
+Anything before this line is plain C code which describes which headers
+to include, and defines some convenience functions. No translations are
+performed on this part, it goes into the generated output C file as is.
+
+Anything after this line is the description of XSUB functions.
+These descriptions are translated by B<xsubpp> into C code which
+implements these functions using Perl calling conventions, and which
+makes these functions visible from Perl interpreter.
+
+Pay a special attention to the function C<constant>. This name appears
+twice in the generated .xs file: once in the first part, as a static C
+function, the another time in the second part, when an XSUB interface to
+this static C function is defined.
+
+This is quite typical for .xs files: usually the .xs file provides
+an interface to an existing C function. Then this C function is defined
+somewhere (either in an external library, or in the first part of .xs file),
+and a Perl interface to this function (i.e. "Perl glue") is described in the
+second part of .xs file. The situation in L<"EXAMPLE 1">, L<"EXAMPLE 2">,
+and L<"EXAMPLE 3">, when all the work is done inside the "Perl glue", is
+somewhat of an exception rather than the rule.
+
+=head2 Getting the fat out of XSUBs
+
+In L<"EXAMPLE 4"> the second part of .xs file contained the following
+description of an XSUB:
+
+ double
+ foo(a,b,c)
+ int a
+ long b
+ const char * c
+ OUTPUT:
+ RETVAL
+
+Note that in contrast with L<"EXAMPLE 1">, L<"EXAMPLE 2"> and L<"EXAMPLE 3">,
+this description does not contain the actual I<code> for what is done
+is done during a call to Perl function foo(). To understand what is going
+on here, one can add a CODE section to this XSUB:
+
+ double
+ foo(a,b,c)
+ int a
+ long b
+ const char * c
+ CODE:
+ RETVAL = foo(a,b,c);
+ OUTPUT:
+ RETVAL
+
+However, these two XSUBs provide almost identical generated C code: B<xsubpp>
+compiler is smart enough to figure out the C<CODE:> section from the first
+two lines of the description of XSUB. What about C<OUTPUT:> section? In
+fact, that is absolutely the same! The C<OUTPUT:> section can be removed
+as well, I<as far as C<CODE:> section or C<PPCODE:> section> is not
+specified: B<xsubpp> can see that it needs to generate a function call
+section, and will autogenerate the OUTPUT section too. Thus one can
+shortcut the XSUB to become:
+
+ double
+ foo(a,b,c)
+ int a
+ long b
+ const char * c
+
+Can we do the same with an XSUB
+
+ int
+ is_even(input)
+ int input
+ CODE:
+ RETVAL = (input % 2 == 0);
+ OUTPUT:
+ RETVAL
+
+of L<"EXAMPLE 2">? To do this, one needs to define a C function C<int
+is_even(int input)>. As we saw in L<Anatomy of .xs file>, a proper place
+for this definition is in the first part of .xs file. In fact a C function
+
+ int
+ is_even(int arg)
+ {
+ return (arg % 2 == 0);
+ }
+
+is probably overkill for this. Something as simple as a C<#define> will
+do too:
+
+ #define is_even(arg) ((arg) % 2 == 0)
+
+After having this in the first part of .xs file, the "Perl glue" part becomes
+as simple as
+
+ int
+ is_even(input)
+ int input
+
+This technique of separation of the glue part from the workhorse part has
+obvious tradeoffs: if you want to change a Perl interface, you need to
+change two places in your code. However, it removes a lot of clutter,
+and makes the workhorse part independent from idiosyncrasies of Perl calling
+convention. (In fact, there is nothing Perl-specific in the above description,
+a different version of B<xsubpp> might have translated this to TCL glue or
+Python glue as well.)
+
+=head2 More about XSUB arguments
With the completion of Example 4, we now have an easy way to simulate some
real-life libraries whose interfaces may not be the cleanest in the world.
We shall now continue with a discussion of the arguments passed to the
-xsubpp compiler.
+B<xsubpp> compiler.
When you specify arguments to routines in the .xs file, you are really
passing three pieces of information for each argument listed. The first
piece is the order of that argument relative to the others (first, second,
etc). The second is the type of argument, and consists of the type
declaration of the argument (e.g., int, char*, etc). The third piece is
-the exact way in which the argument should be used in the call to the
-library function from this XSUB. This would mean whether or not to place
-a "&" before the argument or not, meaning the argument expects to be
-passed the address of the specified data type.
+the calling convention for the argument in the call to the library function.
+
+While Perl passes arguments to functions by reference,
+C passes arguments by value; to implement a C function which modifies data
+of one of the "arguments", the actual argument of this C function would be
+a pointer to the data. Thus two C functions with declarations
+
+ int string_length(char *s);
+ int upper_case_char(char *cp);
+
+may have completely different semantics: the first one may inspect an array
+of chars pointed by s, and the second one may immediately dereference C<cp>
+and manipulate C<*cp> only (using the return value as, say, a success
+indicator). From Perl one would use these functions in
+a completely different manner.
+
+One conveys this info to B<xsubpp> by replacing C<*> before the
+argument by C<&>. C<&> means that the argument should be passed to a library
+function by its address. The above two function may be XSUB-ified as
+
+ int
+ string_length(s)
+ char * s
+
+ int
+ upper_case_char(cp)
+ char &cp
-There is a difference between the two arguments in this hypothetical function:
+For example, consider:
int
foo(a,b)
char &a
char * b
-The first argument to this function would be treated as a char and assigned
+The first Perl argument to this function would be treated as a char and assigned
to the variable a, and its address would be passed into the function foo.
-The second argument would be treated as a string pointer and assigned to the
+The second Perl argument would be treated as a string pointer and assigned to the
variable b. The I<value> of b would be passed into the function foo. The
-actual call to the function foo that xsubpp generates would look like this:
+actual call to the function foo that B<xsubpp> generates would look like this:
foo(&a, b);
-Xsubpp will parse the following function argument lists identically:
+B<xsubpp> will parse the following function argument lists identically:
char &a
char&a
therefore the first argument passed to the XSUB, ST(1) is the second
argument, and so on.
-When you list the arguments to the XSUB in the .xs file, that tells xsubpp
+When you list the arguments to the XSUB in the .xs file, that tells B<xsubpp>
which argument corresponds to which of the argument stack (i.e., the first
one listed is the first argument, and so on). You invite disaster if you
do not list them in the same order as the function expects them.
The arg variable is initially set by taking the value from ST(0), then is
stored back into ST(0) at the end of the routine.
+XSUBs are also allowed to return lists, not just scalars. This must be
+done by manipulating stack values ST(0), ST(1), etc, in a subtly
+different way. See L<perlxs> for details.
+
+XSUBs are also allowed to avoid automatic conversion of Perl function arguments
+to C function arguments. See L<perlxs> for details. Some people prefer
+manual conversion by inspecting C<ST(i)> even in the cases when automatic
+conversion will do, arguing that this makes the logic of an XSUB call clearer.
+Compare with L<"Getting the fat out of XSUBs"> for a similar tradeoff of
+a complete separation of "Perl glue" and "workhorse" parts of an XSUB.
+
+While experts may argue about these idioms, a novice to Perl guts may
+prefer a way which is as little Perl-guts-specific as possible, meaning
+automatic conversion and automatic call generation, as in
+L<"Getting the fat out of XSUBs">. This approach has the additional
+benefit of protecting the XSUB writer from future changes to the Perl API.
+
=head2 Extending your Extension
Sometimes you might want to provide some extra methods or subroutines
void
statfs(path)
char * path
- PREINIT:
+ INIT:
int i;
struct statfs buf;
=item *
-The PREINIT: directive contains code that will be placed immediately after
-variable declaration and before the argument stack is decoded. Some compilers
-cannot handle variable declarations at arbitrary locations inside a function,
+The INIT: directive contains code that will be placed immediately after
+the argument stack is decoded. C does not allow variable declarations at
+arbitrary locations inside a function,
so this is usually the best way to declare local variables needed by the XSUB.
+(Alternatively, one could put the whole C<PPCODE:> section into braces, and
+put these declarations on top.)
=item *
returned.
We do this by using the PPCODE: directive, rather than the CODE: directive.
-This tells xsubpp that we will be managing the return values that will be
+This tells B<xsubpp> that we will be managing the return values that will be
put on the argument stack by ourselves.
=item *
we use the series of macros that begin with "XPUSH". There are five
different versions, for placing integers, unsigned integers, doubles,
strings, and Perl scalars on the stack. In our example, we placed a
-Perl scalar onto the stack.
+Perl scalar onto the stack. (In fact this is the only macro which
+can be used to return multiple values.)
The XPUSH* macros will automatically extend the return stack to prevent
it from being overrun. You push values onto the stack in the order you
If they were not mortal, then they would continue to exist after the XSUB
routine returned, but would not be accessible. This is a memory leak.
+=item *
+
+If we were interested in performance, not in code compactness, in the success
+branch we would not use C<XPUSHs> macros, but C<PUSHs> macros, and would
+pre-extend the stack before pushing the return values:
+
+ EXTEND(SP, 9);
+
+The tradeoff is that one needs to calculate the number of return values
+in advance (though overextending the stack will not typically hurt
+anything but memory consumption).
+
+Similarly, in the failure branch we could use C<PUSHs> I<without> extending
+the stack: the Perl function reference comes to an XSUB on the stack, thus
+the stack is I<always> large enough to take one return value.
+
=back
=head2 EXAMPLE 6 (Coming Soon)
=head2 Last Changed
-1999/5/25
+1999/11/30
# have to mention them as if they were shell variables, not
# %Config entries. Thus you write
# $startperl
-# $man3ext
# to ensure Configure will look for $Config{startperl}.
# This forces PL files to create target in same directory as PL file.
print OUT <<"!GROK!THIS!";
$Config{startperl}
eval 'exec $Config{perlpath} -S \$0 \${1+"\$@"}'
- if \$running_under_some_shell;
-
-\$DEF_PM_SECTION = '$Config{man3ext}' || '3';
+ if \$running_under_some_shell;
!GROK!THIS!
# In the following, perl variables are not expanded during extraction.
print OUT <<'!NO!SUBS!';
-=head1 NAME
-
-pod2man - translate embedded Perl pod directives into man pages
-
-=head1 SYNOPSIS
-
-B<pod2man>
-[ B<--section=>I<manext> ]
-[ B<--release=>I<relpatch> ]
-[ B<--center=>I<string> ]
-[ B<--date=>I<string> ]
-[ B<--fixed=>I<font> ]
-[ B<--official> ]
-[ B<--lax> ]
-I<inputfile>
-
-=head1 DESCRIPTION
-
-B<pod2man> converts its input file containing embedded pod directives (see
-L<perlpod>) into nroff source suitable for viewing with nroff(1) or
-troff(1) using the man(7) macro set.
-
-Besides the obvious pod conversions, B<pod2man> also takes care of
-func(), func(n), and simple variable references like $foo or @bar so
-you don't have to use code escapes for them; complex expressions like
-C<$fred{'stuff'}> will still need to be escaped, though. Other nagging
-little roffish things that it catches include translating the minus in
-something like foo-bar, making a long dash--like this--into a real em
-dash, fixing up "paired quotes", putting a little space after the
-parens in something like func(), making C++ and PI look right, making
-double underbars have a little tiny space between them, making ALLCAPS
-a teeny bit smaller in troff(1), and escaping backslashes so you don't
-have to.
-
-=head1 OPTIONS
-
-=over 8
-
-=item center
-
-Set the centered header to a specific string. The default is
-"User Contributed Perl Documentation", unless the C<--official> flag is
-given, in which case the default is "Perl Programmers Reference Guide".
-
-=item date
-
-Set the left-hand footer string to this value. By default,
-the modification date of the input file will be used.
-
-=item fixed
-
-The fixed font to use for code refs. Defaults to CW.
-
-=item official
-
-Set the default header to indicate that this page is of
-the standard release in case C<--center> is not given.
-
-=item release
-
-Set the centered footer. By default, this is the current
-perl release.
-
-=item section
-
-Set the section for the C<.TH> macro. The standard conventions on
-sections are to use 1 for user commands, 2 for system calls, 3 for
-functions, 4 for devices, 5 for file formats, 6 for games, 7 for
-miscellaneous information, and 8 for administrator commands. This works
-best if you put your Perl man pages in a separate tree, like
-F</usr/local/perl/man/>. By default, section 1 will be used
-unless the file ends in F<.pm> in which case section 3 will be selected.
-
-=item lax
-
-Don't complain when required sections aren't present.
-
-=back
-
-=head1 Anatomy of a Proper Man Page
-
-For those not sure of the proper layout of a man page, here's
-an example of the skeleton of a proper man page. Head of the
-major headers should be setout as a C<=head1> directive, and
-are historically written in the rather startling ALL UPPER CASE
-format, although this is not mandatory.
-Minor headers may be included using C<=head2>, and are
-typically in mixed case.
-
-=over 10
-
-=item NAME
+# pod2man -- Convert POD data to formatted *roff input.
+#
+# Copyright 1999 by Russ Allbery <rra@stanford.edu>
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the same terms as Perl itself.
+#
+# The driver script for Pod::Man. This script is expected to eventually
+# replace pod2man in the standard Perl distribution.
+
+require 5.004;
+
+use Getopt::Long qw(GetOptions);
+use Pod::Man ();
+use Pod::Usage qw(pod2usage);
+
+use strict;
+use vars;
+
+# Parse our options, trying to retain backwards compatibility with pod2man
+# but allowing short forms as well. --lax is currently ignored.
+my %options;
+Getopt::Long::config ('bundling');
+GetOptions (\%options, 'section|s=s', 'release|r=s', 'center|c=s',
+ 'date|d=s', 'fixed=s', 'fixedbold=s', 'fixeditalic=s',
+ 'fixedbolditalic=s', 'official|o', 'lax|l', 'help|h') or exit 1;
+pod2usage (0) if $options{help};
+
+# Official sets --center, but don't override things explicitly set.
+if ($options{official} && !defined $options{center}) {
+ $options{center} = 'Perl Programmers Reference Guide';
+}
-Mandatory section; should be a comma-separated list of programs or
-functions documented by this podpage, such as:
+# Initialize and run the formatter.
+my $parser = Pod::Man->new (%options);
+$parser->parse_from_file (@ARGV);
- foo, bar - programs to do something
+__END__
-=item SYNOPSIS
+=head1 NAME
-A short usage summary for programs and functions, which
-may someday be deemed mandatory.
+pod2man - Convert POD data to formatted *roff input
-=item DESCRIPTION
+=head1 SYNOPSIS
-Long drawn out discussion of the program. It's a good idea to break this
-up into subsections using the C<=head2> directives, like
+pod2txt [B<--section>=I<manext>] [B<--release>=I<version>]
+[B<--center>=I<string>] [B<--date>=I<string>] [B<--fixed>=I<font>]
+[B<--fixedbold>=I<font>] [B<--fixeditalic>=I<font>]
+[B<--fixedbolditalic>=I<font>] [B<--official>] [B<--lax>] [I<input>
+[I<output>]]
- =head2 A Sample Subection
+pod2txt B<--help>
- =head2 Yet Another Sample Subection
+=head1 DESCRIPTION
-=item OPTIONS
+B<pod2man> is a front-end for Pod::Man, using it to generate *roff input
+from POD source. The resulting *roff code is suitable for display on a
+terminal using nroff(1), normally via man(1), or printing using troff(1).
+
+I<input> is the file to read for POD source (the POD can be embedded in
+code). If I<input> isn't given, it defaults to STDIN. I<output>, if given,
+is the file to which to write the formatted output. If I<output> isn't
+given, the formatted output is written to STDOUT.
+
+B<--section>, B<--release>, B<--center>, B<--date>, and B<--official> can be
+used to set the headers and footers to use; if not given, Pod::Man will
+assume various defaults. See below or L<Pod::Man> for details.
+
+B<pod2man> assumes that your *roff formatters have a fixed-width font named
+CW. If yours is called something else (like CR), use B<--fixed> to specify
+it. This generally only matters for troff output for printing. Similarly,
+you can set the fonts used for bold, italic, and bold italic fixed-width
+output.
+
+Besides the obvious pod conversions, Pod::Man, and therefore pod2man also
+takes care of formatting func(), func(n), and simple variable references
+like $foo or @bar so you don't have to use code escapes for them; complex
+expressions like C<$fred{'stuff'}> will still need to be escaped, though.
+It also translates dashes that aren't used as hyphens into en dashes, makes
+long dashes--like this--into proper em dashes, fixes "paired quotes," and
+takes care of several other troff-specific tweaks. See L<Pod::Man> for
+complete information.
-Some people make this separate from the description.
+=head1 OPTIONS
-=item RETURN VALUE
+=over 4
-What the program or function returns if successful.
+=item B<-c> I<string>, B<--center>=I<string>
-=item ERRORS
+Sets the centered page header to I<string>. The default is "User
+Contributed Perl Documentation", but also see B<--official> below.
-Exceptions, return codes, exit stati, and errno settings.
+=item B<-d> I<string>, B<--date>=I<string>
-=item EXAMPLES
+Set the left-hand footer string to this value. By default, the modification
+date of the input file will be used, or the current date if input comes from
+STDIN.
-Give some example uses of the program.
+=item B<--fixed>=I<font>
-=item ENVIRONMENT
+The fixed-width font to use for vertabim text and code. Defaults to CW.
+Some systems may want CR instead. Only matters for troff(1) output.
-Envariables this program might care about.
+=item B<--fixedbold>=I<font>
-=item FILES
+Bold version of the fixed-width font. Defaults to CB. Only matters for
+troff(1) output.
-All files used by the program. You should probably use the FE<lt>E<gt>
-for these.
+=item B<--fixeditalic>=I<font>
-=item SEE ALSO
+Italic version of the fixed-width font (actually, something of a misnomer,
+since most fixed-width fonts only have an oblique version, not an italic
+version). Defaults to CI. Only matters for troff(1) output.
-Other man pages to check out, like man(1), man(7), makewhatis(8), or catman(8).
+=item B<--fixedbolditalic>=I<font>
-=item NOTES
+Bold italic (probably actually oblique) version of the fixed-width font.
+Pod::Man doesn't assume you have this, and defaults to CB. Some systems
+(such as Solaris) have this font available as CX. Only matters for troff(1)
+output.
-Miscellaneous commentary.
+=item B<-h>, B<--help>
-=item CAVEATS
+Print out usage information.
-Things to take special care with; sometimes called WARNINGS.
+=item B<-l>, B<--lax>
-=item DIAGNOSTICS
+Don't complain when required sections are missing. Not currently used, as
+POD checking functionality is not yet implemented in Pod::Man.
-All possible messages the program can print out--and
-what they mean.
+=item B<-o>, B<--official>
-=item BUGS
+Set the default header to indicate that this page is part of the standard
+Perl release, if B<--center> is not also given.
-Things that are broken or just don't work quite right.
+=item B<-r>, B<--release>
-=item RESTRICTIONS
+Set the centered footer. By default, this is the version of Perl you run
+B<pod2man> under. Note that some system an macro sets assume that the
+centered footer will be a modification date and will prepend something like
+"Last modified: "; if this is the case, you may want to set B<--release> to
+the last modified date and B<--date> to the version number.
-Bugs you don't plan to fix :-)
+=item B<-s>, B<--section>
-=item AUTHOR
+Set the section for the C<.TH> macro. The standard section numbering
+convention is to use 1 for user commands, 2 for system calls, 3 for
+functions, 4 for devices, 5 for file formats, 6 for games, 7 for
+miscellaneous information, and 8 for administrator commands. There is a lot
+of variation here, however; some systems (like Solaris) use 4 for file
+formats, 5 for miscellaneous information, and 7 for devices. Still others
+use 1m instead of 8, or some mix of both. About the only section numbers
+that are reliably consistent are 1, 2, and 3.
-Who wrote it (or AUTHORS if multiple).
+By default, section 1 will be used unless the file ends in .pm in which case
+section 3 will be selected.
-=item HISTORY
+=back
-Programs derived from other sources sometimes have this, or
-you might keep a modification log here.
+=head1 DIAGNOSTICS
-=back
+If B<pod2man> fails with errors, see L<Pod::Man> and L<Pod::Parser> for
+information about what those errors might mean.
=head1 EXAMPLES
pod2man program > program.1
- pod2man some_module.pm > /usr/perl/man/man3/some_module.3
+ pod2man SomeModule.pm /usr/perl/man/man3/SomeModule.3
pod2man --section=7 note.pod > note.7
-=head1 DIAGNOSTICS
+If you would like to print out a lot of man page continuously, you probably
+want to set the C and D registers to set contiguous page numbering and
+even/odd paging, at least on some versions of man(7).
-The following diagnostics are generated by B<pod2man>. Items
-marked "(W)" are non-fatal, whereas the "(F)" errors will cause
-B<pod2man> to immediately exit with a non-zero status.
+ troff -man -rC1 -rD1 perl.1 perldata.1 perlsyn.1 ...
-=over 4
+To get index entries on stderr, turn on the F register, as in:
-=item bad option in paragraph %d of %s: ``%s'' should be [%s]<%s>
+ troff -man -rF1 perl.1
-(W) If you start include an option, you should set it off
-as bold, italic, or code.
+The indexing merely outputs messages via C<.tm> for each major page,
+section, subsection, item, and any C<XE<lt>E<gt>> directives. See
+L<Pod::Man> for more details.
-=item can't open %s: %s
+=head1 BUGS
-(F) The input file wasn't available for the given reason.
+Lots of this documentation is duplicated from L<Pod::Man>.
-=item Improper man page - no dash in NAME header in paragraph %d of %s
+POD checking and the corresponding B<--lax> option don't work yet.
-(W) The NAME header did not have an isolated dash in it. This is
-considered important.
+=head1 NOTES
-=item Invalid man page - no NAME line in %s
+For those not sure of the proper layout of a man page, here are some notes
+on writing a proper man page.
-(F) You did not include a NAME header, which is essential.
+The name of the program being documented is conventionally written in bold
+(using BE<lt>E<gt>) wherever it occurs, as are all program options.
+Arguments should be written in italics (IE<lt>E<gt>). Functions are
+traditionally written in italics; if you write a function as function(),
+Pod::Man will take care of this for you. Literal code or commands should
+be in CE<lt>E<gt>. References to other man pages should be in the form
+C<manpage(section)>, and Pod::Man will automatically format those
+appropriately. As an exception, it's traditional not to use this form when
+referring to module documentation; use C<LE<lt>Module::NameE<gt>> instead.
-=item roff font should be 1 or 2 chars, not `%s' (F)
+References to other programs or functions are normally in the form of man
+page references so that cross-referencing tools can provide the user with
+links and the like. It's possible to overdo this, though, so be careful not
+to clutter your documentation with too much markup.
-(F) The font specified with the C<--fixed> option was not
-a one- or two-digit roff font.
+The major headers should be set out using a C<=head1> directive, and are
+historically written in the rather startling ALL UPPER CASE format, although
+this is not mandatory. Minor headers may be included using C<=head2>, and
+are typically in mixed case.
-=item %s is missing required section: %s
+The standard sections of a manual page are:
-(W) Required sections include NAME, DESCRIPTION, and if you're
-using a section starting with a 3, also a SYNOPSIS. Actually,
-not having a NAME is a fatal.
+=over 4
-=item Unknown escape: %s in %s
+=item NAME
-(W) An unknown HTML entity (probably for an 8-bit character) was given via
-a C<EE<lt>E<gt>> directive. Besides amp, lt, gt, and quot, recognized
-entities are Aacute, aacute, Acirc, acirc, AElig, aelig, Agrave, agrave,
-Aring, aring, Atilde, atilde, Auml, auml, Ccedil, ccedil, Eacute, eacute,
-Ecirc, ecirc, Egrave, egrave, ETH, eth, Euml, euml, Iacute, iacute, Icirc,
-icirc, Igrave, igrave, Iuml, iuml, Ntilde, ntilde, Oacute, oacute, Ocirc,
-ocirc, Ograve, ograve, Oslash, oslash, Otilde, otilde, Ouml, ouml, szlig,
-THORN, thorn, Uacute, uacute, Ucirc, ucirc, Ugrave, ugrave, Uuml, uuml,
-Yacute, yacute, and yuml.
+Mandatory section; should be a comma-separated list of programs or functions
+documented by this podpage, such as:
-=item Unmatched =back
+ foo, bar - programs to do something
-(W) You have a C<=back> without a corresponding C<=over>.
+Manual page indexers are often extremely picky about the format of this
+section, so don't put anything in it except this line. A single dash, and
+only a single dash, should separate the list of programs or functions from
+the description. Functions should not be qualified with C<()> or the like.
+The description should ideally fit on a single line, even if a man program
+replaces the dash with a few tabs.
-=item Unrecognized pod directive: %s
+=item SYNOPSIS
-(W) You specified a pod directive that isn't in the known list of
-C<=head1>, C<=head2>, C<=item>, C<=over>, C<=back>, or C<=cut>.
+A short usage summary for programs and functions. This section is mandatory
+for section 3 pages.
+=item DESCRIPTION
-=back
+Extended description and discussion of the program or functions, or the body
+of the documentation for man pages that document something else. If
+particularly long, it's a good idea to break this up into subsections
+C<=head2> directives like:
-=head1 NOTES
+ =head2 Normal Usage
-If you would like to print out a lot of man page continuously, you
-probably want to set the C and D registers to set contiguous page
-numbering and even/odd paging, at least on some versions of man(7).
-Settting the F register will get you some additional experimental
-indexing:
+ =head2 Advanced Features
- troff -man -rC1 -rD1 -rF1 perl.1 perldata.1 perlsyn.1 ...
+ =head2 Writing Configuration Files
-The indexing merely outputs messages via C<.tm> for each
-major page, section, subsection, item, and any C<XE<lt>E<gt>>
-directives.
+or whatever is appropriate for your documentation.
+=item OPTIONS
-=head1 RESTRICTIONS
+Detailed description of each of the command-line options taken by the
+program. This should be separate from the description for the use of things
+like L<Pod::Usage|Pod::Usage>. This is normally presented as a list, with
+each option as a separate C<=item>. The specific option string should be
+enclosed in BE<lt>E<gt>. Any values that the option takes should be
+enclosed in IE<lt>E<gt>. For example, the section for the option
+B<--section>=I<manext> would be introduced with:
-None at this time.
+ =item B<--section>=I<manext>
-=head1 BUGS
+Synonymous options (like both the short and long forms) are separated by a
+comma and a space on the same C<=item> line, or optionally listed as their
+own item with a reference to the canonical name. For example, since
+B<--section> can also be written as B<-s>, the above would be:
-The =over and =back directives don't really work right. They
-take absolute positions instead of offsets, don't nest well, and
-making people count is suboptimal in any event.
+ =item B<-s> I<manext>, B<--section>=I<manext>
-=head1 AUTHORS
+(Writing the short option first is arguably easier to read, since the long
+option is long enough to draw the eye to it anyway and the short option can
+otherwise get lost in visual noise.)
-Original prototype by Larry Wall, but so massively hacked over by
-Tom Christiansen such that Larry probably doesn't recognize it anymore.
+=item RETURN VALUE
-=cut
+What the program or function returns, if successful. This section can be
+omitted for programs whose precise exit codes aren't important, provided
+they return 0 on success as is standard. It should always be present for
+functions.
-$/ = "";
-$cutting = 1;
-@Indices = ();
-
-# We try first to get the version number from a local binary, in case we're
-# running an installed version of Perl to produce documentation from an
-# uninstalled newer version's pod files.
-if ($^O ne 'plan9' and $^O ne 'dos' and $^O ne 'os2' and $^O ne 'MSWin32') {
- my $perl = (-x './perl' && -f './perl' ) ?
- './perl' :
- ((-x '../perl' && -f '../perl') ?
- '../perl' :
- '');
- ($version,$patch) = `$perl -e 'print $]'` =~ /^(\d\.\d{3})(\d{2})?/ if $perl;
-}
-# No luck; we'll just go with the running Perl's version
-($version,$patch) = $] =~ /^(.{5})(\d{2})?/ unless $version;
-$DEF_RELEASE = "perl $version";
-$DEF_RELEASE .= ", patch $patch" if $patch;
-
-
-sub makedate {
- my $secs = shift;
- my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($secs);
- my $mname = (qw{Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec})[$mon];
- $year += 1900;
- return "$mday/$mname/$year";
-}
+=item ERRORS
-use Getopt::Long;
-
-$DEF_SECTION = 1;
-$DEF_CENTER = "User Contributed Perl Documentation";
-$STD_CENTER = "Perl Programmers Reference Guide";
-$DEF_FIXED = 'CW';
-$DEF_LAX = 0;
-
-sub usage {
- warn "$0: @_\n" if @_;
- die <<EOF;
-usage: $0 [options] podpage
-Options are:
- --section=manext (default "$DEF_SECTION")
- --release=relpatch (default "$DEF_RELEASE")
- --center=string (default "$DEF_CENTER")
- --date=string (default "$DEF_DATE")
- --fixed=font (default "$DEF_FIXED")
- --official (default NOT)
- --lax (default NOT)
-EOF
-}
+Exceptions, error return codes, exit stati, and errno settings. Typically
+used for function documentation; program documentation uses DIAGNOSTICS
+instead. The general rule of thumb is that errors printed to STDOUT or
+STDERR and intended for the end user are documented in DIAGNOSTICS while
+errors passed internal to the calling program and intended for other
+programmers are documented in ERRORS. When documenting a function that sets
+errno, a full list of the possible errno values should be given here.
-$uok = GetOptions( qw(
- section=s
- release=s
- center=s
- date=s
- fixed=s
- official
- lax
- help));
+=item DIAGNOSTICS
-$DEF_DATE = makedate((stat($ARGV[0]))[9] || time());
+All possible messages the program can print out--and what they mean. You
+may wish to follow the same documentation style as the Perl documentation;
+see perldiag(1) for more details (and look at the POD source as well).
-usage("Usage error!") unless $uok;
-usage() if $opt_help;
-usage("Need one and only one podpage argument") unless @ARGV == 1;
+If applicable, please include details on what the user should do to correct
+the error; documenting an error as indicating "the input buffer is too
+small" without telling the user how to increase the size of the input buffer
+(or at least telling them that it isn't possible) aren't very useful.
-$section = $opt_section || ($ARGV[0] =~ /\.pm$/
- ? $DEF_PM_SECTION : $DEF_SECTION);
-$RP = $opt_release || $DEF_RELEASE;
-$center = $opt_center || ($opt_official ? $STD_CENTER : $DEF_CENTER);
-$lax = $opt_lax || $DEF_LAX;
+=item EXAMPLES
-$CFont = $opt_fixed || $DEF_FIXED;
+Give some example uses of the program or function. Don't skimp; users often
+find this the most useful part of the documentation. The examples are
+generally given as verbatim paragraphs.
-if (length($CFont) == 2) {
- $CFont_embed = "\\f($CFont";
-}
-elsif (length($CFont) == 1) {
- $CFont_embed = "\\f$CFont";
-}
-else {
- die "roff font should be 1 or 2 chars, not `$CFont_embed'";
-}
+Don't just present an example without explaining what it does. Adding a
+short paragraph saying what the example will do can increase the value of
+the example immensely.
-$date = $opt_date || $DEF_DATE;
+=item ENVIRONMENT
-for (qw{NAME DESCRIPTION}) {
-# for (qw{NAME DESCRIPTION AUTHOR}) {
- $wanna_see{$_}++;
-}
-$wanna_see{SYNOPSIS}++ if $section =~ /^3/;
+Environment variables that the program cares about, normally presented as a
+list using C<=over>, C<=item>, and C<=back>. For example:
+ =over 6
-$name = @ARGV ? $ARGV[0] : "<STDIN>";
-$Filename = $name;
-if ($section =~ /^1/) {
- require File::Basename;
- $name = uc File::Basename::basename($name);
-}
-$name =~ s/\.(pod|p[lm])$//i;
-
-# Lose everything up to the first of
-# */lib/*perl* standard or site_perl module
-# */*perl*/lib from -D prefix=/opt/perl
-# */*perl*/ random module hierarchy
-# which works.
-$name =~ s-//+-/-g;
-if ($name =~ s-^.*?/lib/[^/]*perl[^/]*/--i
- or $name =~ s-^.*?/[^/]*perl[^/]*/lib/--i
- or $name =~ s-^.*?/[^/]*perl[^/]*/--i) {
- # Lose ^site(_perl)?/.
- $name =~ s-^site(_perl)?/--;
- # Lose ^arch/. (XXX should we use Config? Just for archname?)
- $name =~ s~^(.*-$^O|$^O-.*)/~~o;
- # Lose ^version/.
- $name =~ s-^\d+\.\d+/--;
-}
+ =item HOME
-# Translate Getopt/Long to Getopt::Long, etc.
-$name =~ s(/)(::)g;
-
-if ($name ne 'something') {
- FCHECK: {
- open(F, "< $ARGV[0]") || die "can't open $ARGV[0]: $!";
- while (<F>) {
- next unless /^=\b/;
- if (/^=head1\s+NAME\s*$/) { # an /m would forgive mistakes
- $_ = <F>;
- unless (/\s*-+\s+/) {
- $oops++;
- warn "$0: Improper man page - no dash in NAME header in paragraph $. of $ARGV[0]\n"
- } else {
- my @n = split /\s+-+\s+/;
- if (@n != 2) {
- $oops++;
- warn "$0: Improper man page - malformed NAME header in paragraph $. of $ARGV[0]\n"
- }
- else {
- %namedesc = @n;
- }
- }
- last FCHECK;
- }
- next if /^=cut\b/; # DB_File and Net::Ping have =cut before NAME
- next if /^=pod\b/; # It is OK to have =pod before NAME
- die "$0: Invalid man page - 1st pod line is not NAME in $ARGV[0]\n" unless $lax;
- }
- die "$0: Invalid man page - no documentation in $ARGV[0]\n" unless $lax;
- }
- close F;
-}
+ Used to determine the user's home directory. F<.foorc> in this
+ directory is read for configuration details, if it exists.
-print <<"END";
-.rn '' }`
-''' \$RCSfile\$\$Revision\$\$Date\$
-'''
-''' \$Log\$
-'''
-.de Sh
-.br
-.if t .Sp
-.ne 5
-.PP
-\\fB\\\\\$1\\fR
-.PP
-..
-.de Sp
-.if t .sp .5v
-.if n .sp
-..
-.de Ip
-.br
-.ie \\\\n(.\$>=3 .ne \\\\\$3
-.el .ne 3
-.IP "\\\\\$1" \\\\\$2
-..
-.de Vb
-.ft $CFont
-.nf
-.ne \\\\\$1
-..
-.de Ve
-.ft R
-
-.fi
-..
-'''
-'''
-''' Set up \\*(-- to give an unbreakable dash;
-''' string Tr holds user defined translation string.
-''' Bell System Logo is used as a dummy character.
-'''
-.tr \\(*W-|\\(bv\\*(Tr
-.ie n \\{\\
-.ds -- \\(*W-
-.ds PI pi
-.if (\\n(.H=4u)&(1m=24u) .ds -- \\(*W\\h'-12u'\\(*W\\h'-12u'-\\" diablo 10 pitch
-.if (\\n(.H=4u)&(1m=20u) .ds -- \\(*W\\h'-12u'\\(*W\\h'-8u'-\\" diablo 12 pitch
-.ds L" ""
-.ds R" ""
-''' \\*(M", \\*(S", \\*(N" and \\*(T" are the equivalent of
-''' \\*(L" and \\*(R", except that they are used on ".xx" lines,
-''' such as .IP and .SH, which do another additional levels of
-''' double-quote interpretation
-.ds M" """
-.ds S" """
-.ds N" """""
-.ds T" """""
-.ds L' '
-.ds R' '
-.ds M' '
-.ds S' '
-.ds N' '
-.ds T' '
-'br\\}
-.el\\{\\
-.ds -- \\(em\\|
-.tr \\*(Tr
-.ds L" ``
-.ds R" ''
-.ds M" ``
-.ds S" ''
-.ds N" ``
-.ds T" ''
-.ds L' `
-.ds R' '
-.ds M' `
-.ds S' '
-.ds N' `
-.ds T' '
-.ds PI \\(*p
-'br\\}
-END
-
-print <<'END';
-.\" If the F register is turned on, we'll generate
-.\" index entries out stderr for the following things:
-.\" TH Title
-.\" SH Header
-.\" Sh Subsection
-.\" Ip Item
-.\" X<> Xref (embedded
-.\" Of course, you have to process the output yourself
-.\" in some meaninful fashion.
-.if \nF \{
-.de IX
-.tm Index:\\$1\t\\n%\t"\\$2"
-..
-.nr % 0
-.rr F
-.\}
-END
-
-print <<"END";
-.TH $name $section "$date" "$RP" "$center"
-.UC
-END
-
-push(@Indices, qq{.IX Title "$name $section"});
-
-while (($name, $desc) = each %namedesc) {
- for ($name, $desc) { s/^\s+//; s/\s+$//; }
- push(@Indices, qq(.IX Name "$name - $desc"\n));
-}
+ =back
-print <<'END';
-.if n .hy 0
-.if n .na
-.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
-.de CQ \" put $1 in typewriter font
-END
-print ".ft $CFont\n";
-print <<'END';
-'if n "\c
-'if t \\&\\$1\c
-'if n \\&\\$1\c
-'if n \&"
-\\&\\$2 \\$3 \\$4 \\$5 \\$6 \\$7
-'.ft R
-..
-.\" @(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2
-. \" AM - accent mark definitions
-.bd B 3
-. \" fudge factors for nroff and troff
-.if n \{\
-. ds #H 0
-. ds #V .8m
-. ds #F .3m
-. ds #[ \f1
-. ds #] \fP
-.\}
-.if t \{\
-. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
-. ds #V .6m
-. ds #F 0
-. ds #[ \&
-. ds #] \&
-.\}
-. \" simple accents for nroff and troff
-.if n \{\
-. ds ' \&
-. ds ` \&
-. ds ^ \&
-. ds , \&
-. ds ~ ~
-. ds ? ?
-. ds ! !
-. ds /
-. ds q
-.\}
-.if t \{\
-. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
-. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
-. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
-. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
-. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
-. ds ? \s-2c\h'-\w'c'u*7/10'\u\h'\*(#H'\zi\d\s+2\h'\w'c'u*8/10'
-. ds ! \s-2\(or\s+2\h'-\w'\(or'u'\v'-.8m'.\v'.8m'
-. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
-. ds q o\h'-\w'o'u*8/10'\s-4\v'.4m'\z\(*i\v'-.4m'\s+4\h'\w'o'u*8/10'
-.\}
-. \" troff and (daisy-wheel) nroff accents
-.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
-.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
-.ds v \\k:\h'-(\\n(.wu*9/10-\*(#H)'\v'-\*(#V'\*(#[\s-4v\s0\v'\*(#V'\h'|\\n:u'\*(#]
-.ds _ \\k:\h'-(\\n(.wu*9/10-\*(#H+(\*(#F*2/3))'\v'-.4m'\z\(hy\v'.4m'\h'|\\n:u'
-.ds . \\k:\h'-(\\n(.wu*8/10)'\v'\*(#V*4/10'\z.\v'-\*(#V*4/10'\h'|\\n:u'
-.ds 3 \*(#[\v'.2m'\s-2\&3\s0\v'-.2m'\*(#]
-.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
-.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
-.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
-.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
-.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
-.ds ae a\h'-(\w'a'u*4/10)'e
-.ds Ae A\h'-(\w'A'u*4/10)'E
-.ds oe o\h'-(\w'o'u*4/10)'e
-.ds Oe O\h'-(\w'O'u*4/10)'E
-. \" corrections for vroff
-.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
-.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
-. \" for low resolution devices (crt and lpr)
-.if \n(.H>23 .if \n(.V>19 \
-\{\
-. ds : e
-. ds 8 ss
-. ds v \h'-1'\o'\(aa\(ga'
-. ds _ \h'-1'^
-. ds . \h'-1'.
-. ds 3 3
-. ds o a
-. ds d- d\h'-1'\(ga
-. ds D- D\h'-1'\(hy
-. ds th \o'bp'
-. ds Th \o'LP'
-. ds ae ae
-. ds Ae AE
-. ds oe oe
-. ds Oe OE
-.\}
-.rm #[ #] #H #V #F C
-END
-
-$indent = 0;
-
-$begun = "";
-
-# Unrolling [^-=A-Z>]|[A-Z](?!<)|[-=](?![A-Z]<)[\x00-\xFF] gives: // MRE pp 165.
-my $nonest = q{(?x) # Turn on /x mode.
- (?: # Group
- [^-=A-Z>]* # Anything that isn't a dash, equal sign or
- # closing hook isn't special. Eat as much as
- # we can.
- (?: # Group.
- (?: # Group.
- [-=] # We want to recognize -> and =>.
- (?![A-Z]<) # So, as long as it isn't followed by markup
- [\x00-\xFF] # anything may follow - and =
- |
- [A-Z] # Capitals are fine too,
- (?!<) # But not if they start markup.
- ) # End of special sequences.
- [^-=A-Z>]* # Followed by zero or more non-special chars.
- )* # And we can repeat this as often as we can.
- )}; # That's all folks.
-
-while (<>) {
- if ($cutting) {
- next unless /^=/;
- $cutting = 0;
- }
- if ($begun) {
- if (/^=end\s+$begun/) {
- $begun = "";
- }
- elsif ($begun =~ /^(roff|man)$/) {
- print STDOUT $_;
- }
- next;
- }
- chomp;
-
- # Translate verbatim paragraph
-
- if (/^\s/) {
- @lines = split(/\n/);
- for (@lines) {
- 1 while s
- {^( [^\t]* ) \t ( \t* ) }
- { $1 . ' ' x (8 - (length($1)%8) + 8 * (length($2))) }ex;
- s/\\/\\e/g;
- s/\A/\\&/s;
- }
- $lines = @lines;
- makespace() unless $verbatim++;
- print ".Vb $lines\n";
- print join("\n", @lines), "\n";
- print ".Ve\n";
- $needspace = 0;
- next;
- }
-
- $verbatim = 0;
-
- if (/^=for\s+(\S+)\s*/s) {
- if ($1 eq "man" or $1 eq "roff") {
- print STDOUT $',"\n\n";
- } else {
- # ignore unknown for
- }
- next;
- }
- elsif (/^=begin\s+(\S+)\s*/s) {
- $begun = $1;
- if ($1 eq "man" or $1 eq "roff") {
- print STDOUT $'."\n\n";
- }
- next;
- }
-
- # check for things that'll hosed our noremap scheme; affects $_
- init_noremap();
-
- if (!/^=item/) {
-
- # trofficate backslashes; must do it before what happens below
- s/\\/noremap('\\e')/ge;
-
- # protect leading periods and quotes against *roff
- # mistaking them for directives
- s/^(?:[A-Z]<)?[.']/\\&$&/gm;
-
- # first hide the escapes in case we need to
- # intuit something and get it wrong due to fmting
-
- 1 while s/([A-Z]<$nonest>)/noremap($1)/ge;
-
- # func() is a reference to a perl function
- s{
- \b
- (
- [:\w]+ \(\)
- )
- } {I<$1>}gx;
-
- # func(n) is a reference to a perl function or a man page
- s{
- ([:\w]+)
- (
- \( [^\051]+ \)
- )
- } {I<$1>\\|$2}gx;
-
- # convert simple variable references
- s/(\s+)([\$\@%&*][\w:]+)(?!\()/${1}C<$2>/g;
-
- if (m{ (
- [\-\w]+
- \(
- [^\051]*?
- [\@\$,]
- [^\051]*?
- \)
- )
- }x && $` !~ /([LCI]<[^<>]*|-)$/ && !/^=\w/)
- {
- warn "$0: bad option in paragraph $. of $ARGV: ``$1'' should be [LCI]<$1>\n";
- $oops++;
- }
-
- while (/(-[a-zA-Z])\b/g && $` !~ /[\w\-]$/) {
- warn "$0: bad option in paragraph $. of $ARGV: ``$1'' should be [CB]<$1>\n";
- $oops++;
- }
-
- # put it back so we get the <> processed again;
- clear_noremap(0); # 0 means leave the E's
-
- } else {
- # trofficate backslashes
- s/\\/noremap('\\e')/ge;
-
- }
-
- # need to hide E<> first; they're processed in clear_noremap
- s/(E<[^<>]+>)/noremap($1)/ge;
-
-
- $maxnest = 10;
- while ($maxnest-- && /[A-Z]</) {
-
- # can't do C font here
- s/([BI])<($nonest)>/font($1) . $2 . font('R')/eg;
-
- # files and filelike refs in italics
- s/F<($nonest)>/I<$1>/g;
-
- # no break -- usually we want C<> for this
- s/S<($nonest)>/nobreak($1)/eg;
-
- # LREF: a la HREF L<show this text|man/section>
- s:L<([^|>]+)\|[^>]+>:$1:g;
-
- # LREF: a manpage(3f)
- s:L<([a-zA-Z][^\s\/]+)(\([^\)]+\))?>:the I<$1>$2 manpage:g;
-
- # LREF: an =item on another manpage
- s{
- L<
- ([^/]+)
- /
- (
- [:\w]+
- (\(\))?
- )
- >
- } {the C<$2> entry in the I<$1> manpage}gx;
-
- # LREF: an =item on this manpage
- s{
- ((?:
- L<
- /
- (
- [:\w]+
- (\(\))?
- )
- >
- (,?\s+(and\s+)?)?
- )+)
- } { internal_lrefs($1) }gex;
-
- # LREF: a =head2 (head1?), maybe on a manpage, maybe right here
- # the "func" can disambiguate
- s{
- L<
- (?:
- ([a-zA-Z]\S+?) /
- )?
- "?(.*?)"?
- >
- }{
- do {
- $1 # if no $1, assume it means on this page.
- ? "the section on I<$2> in the I<$1> manpage"
- : "the section on I<$2>"
- }
- }gesx; # s in case it goes over multiple lines, so . matches \n
-
- s/Z<>/\\&/g;
-
- # comes last because not subject to reprocessing
- s/C<($nonest)>/noremap("${CFont_embed}${1}\\fR")/eg;
- }
-
- if (s/^=//) {
- $needspace = 0; # Assume this.
-
- s/\n/ /g;
-
- ($Cmd, $_) = split(' ', $_, 2);
-
- $dotlevel = 1;
- if ($Cmd eq 'head1') {
- $dotlevel = 1;
- }
- elsif ($Cmd eq 'head2') {
- $dotlevel = 1;
- }
- elsif ($Cmd eq 'item') {
- $dotlevel = 2;
- }
-
- if (defined $_) {
- &escapes($dotlevel);
- s/"/""/g;
- }
-
- clear_noremap(1);
-
- if ($Cmd eq 'cut') {
- $cutting = 1;
- }
- elsif ($Cmd eq 'head1') {
- s/\s+$//;
- delete $wanna_see{$_} if exists $wanna_see{$_};
- print qq{.SH "$_"\n};
- push(@Indices, qq{.IX Header "$_"\n});
- }
- elsif ($Cmd eq 'head2') {
- print qq{.Sh "$_"\n};
- push(@Indices, qq{.IX Subsection "$_"\n});
- }
- elsif ($Cmd eq 'over') {
- push(@indent,$indent);
- $indent += ($_ + 0) || 5;
- }
- elsif ($Cmd eq 'back') {
- $indent = pop(@indent);
- warn "$0: Unmatched =back in paragraph $. of $ARGV\n" unless defined $indent;
- $needspace = 1;
- }
- elsif ($Cmd eq 'item') {
- s/^\*( |$)/\\(bu$1/g;
- # if you know how to get ":s please do
- s/\\\*\(L"([^"]+?)\\\*\(R"/'$1'/g;
- s/\\\*\(L"([^"]+?)""/'$1'/g;
- s/[^"]""([^"]+?)""[^"]/'$1'/g;
- # here do something about the $" in perlvar?
- print STDOUT qq{.Ip "$_" $indent\n};
- push(@Indices, qq{.IX Item "$_"\n});
- }
- elsif ($Cmd eq 'pod') {
- # this is just a comment
- }
- else {
- warn "$0: Unrecognized pod directive in paragraph $. of $ARGV: $Cmd\n";
- }
- }
- else {
- if ($needspace) {
- &makespace;
- }
- &escapes(0);
- clear_noremap(1);
- print $_, "\n";
- $needspace = 1;
- }
-}
+Since environment variables are normally in all uppercase, no additional
+special formatting is generally needed; they're glaring enough as it is.
-print <<"END";
+=item FILES
-.rn }` ''
-END
+All files used by the program or function, normally presented as a list, and
+what it uses them for. File names should be enclosed in FE<lt>E<gt>. It's
+particularly important to document files that will be potentially modified.
-if (%wanna_see && !$lax) {
- @missing = keys %wanna_see;
- warn "$0: $Filename is missing required section"
- . (@missing > 1 && "s")
- . ": @missing\n";
- $oops++;
-}
+=item CAVEATS
-foreach (@Indices) { print "$_\n"; }
+Things to take special care with, sometimes called WARNINGS.
-exit;
-#exit ($oops != 0);
+=item BUGS
-#########################################################################
+Things that are broken or just don't work quite right.
-sub nobreak {
- my $string = shift;
- $string =~ s/ /\\ /g;
- $string;
-}
+=item RESTRICTIONS
-sub escapes {
- my $indot = shift;
-
- s/X<(.*?)>/mkindex($1)/ge;
-
- # translate the minus in foo-bar into foo\-bar for roff
- s/([^0-9a-z-])-([^-])/$1\\-$2/g;
-
- # make -- into the string version \*(-- (defined above)
- s/\b--\b/\\*(--/g;
- s/"--([^"])/"\\*(--$1/g; # should be a better way
- s/([^"])--"/$1\\*(--"/g;
-
- # fix up quotes; this is somewhat tricky
- my $dotmacroL = 'L';
- my $dotmacroR = 'R';
- if ( $indot == 1 ) {
- $dotmacroL = 'M';
- $dotmacroR = 'S';
- }
- elsif ( $indot >= 2 ) {
- $dotmacroL = 'N';
- $dotmacroR = 'T';
- }
- if (!/""/) {
- s/(^|\s)(['"])/noremap("$1\\*($dotmacroL$2")/ge;
- s/(['"])($|[\-\s,;\\!?.])/noremap("\\*($dotmacroR$1$2")/ge;
- }
-
- #s/(?!")(?:.)--(?!")(?:.)/\\*(--/g;
- #s/(?:(?!")(?:.)--(?:"))|(?:(?:")--(?!")(?:.))/\\*(--/g;
-
-
- # make sure that func() keeps a bit a space tween the parens
- ### s/\b\(\)/\\|()/g;
- ### s/\b\(\)/(\\|)/g;
-
- # make C++ into \*C+, which is a squinched version (defined above)
- s/\bC\+\+/\\*(C+/g;
-
- # make double underbars have a little tiny space between them
- s/__/_\\|_/g;
-
- # PI goes to \*(PI (defined above)
- s/\bPI\b/noremap('\\*(PI')/ge;
-
- # make all caps a teeny bit smaller, but don't muck with embedded code literals
- my $hidCFont = font('C');
- if ($Cmd !~ /^head1/) { # SH already makes smaller
- # /g isn't enough; 1 while or we'll be off
-
-# 1 while s{
-# (?!$hidCFont)(..|^.|^)
-# \b
-# (
-# [A-Z][\/A-Z+:\-\d_$.]+
-# )
-# (s?)
-# \b
-# } {$1\\s-1$2\\s0}gmox;
-
- 1 while s{
- (?!$hidCFont)(..|^.|^)
- (
- \b[A-Z]{2,}[\/A-Z+:\-\d_\$]*\b
- )
- } {
- $1 . noremap( '\\s-1' . $2 . '\\s0' )
- }egmox;
-
- }
-}
+Bugs you don't plan to fix. :-)
-# make troff just be normal, but make small nroff get quoted
-# decided to just put the quotes in the text; sigh;
-sub ccvt {
- local($_,$prev) = @_;
- noremap(qq{.CQ "$_" \n\\&});
-}
+=item NOTES
-sub makespace {
- if ($indent) {
- print ".Sp\n";
- }
- else {
- print ".PP\n";
- }
-}
+Miscellaneous commentary.
-sub mkindex {
- my ($entry) = @_;
- my @entries = split m:\s*/\s*:, $entry;
- push @Indices, ".IX Xref " . join ' ', map {qq("$_")} @entries;
- return '';
-}
+=item SEE ALSO
-sub font {
- local($font) = shift;
- return '\\f' . noremap($font);
-}
+Other man pages to check out, like man(1), man(7), makewhatis(8), or
+catman(8). Normally a simple list of man pages separated by commas, or a
+paragraph giving the name of a reference work. Man page references, if they
+use the standard C<name(section)> form, don't have to be enclosed in
+LE<lt>E<gt>, but other things in this section probably should be when
+appropriate. You may need to use the C<LE<lt>...|...E<gt>> syntax to keep
+B<pod2man> and B<pod2text> from being too verbose; see perlpod(1).
-sub noremap {
- local($thing_to_hide) = shift;
- $thing_to_hide =~ tr/\000-\177/\200-\377/;
- return $thing_to_hide;
-}
+If the package has a web site, include a URL here.
-sub init_noremap {
- # escape high bit characters in input stream
- s/([\200-\377])/"E<".ord($1).">"/ge;
-}
+=item AUTHOR
-sub clear_noremap {
- my $ready_to_print = $_[0];
-
- tr/\200-\377/\000-\177/;
-
- # trofficate backslashes
- # s/(?!\\e)(?:..|^.|^)\\/\\e/g;
-
- # now for the E<>s, which have been hidden until now
- # otherwise the interative \w<> processing would have
- # been hosed by the E<gt>
- s {
- E<
- (
- ( \d + )
- | ( [A-Za-z]+ )
- )
- >
- } {
- do {
- defined $2
- ? chr($2)
- :
- exists $HTML_Escapes{$3}
- ? do { $HTML_Escapes{$3} }
- : do {
- warn "$0: Unknown escape in paragraph $. of $ARGV: ``$&''\n";
- "E<$1>";
- }
- }
- }egx if $ready_to_print;
-}
+Who wrote it (use AUTHORS for multiple people). Including your current
+e-mail address (or some e-mail address to which bug reports should be sent)
+so that users have a way of contacting you is a good idea. Remember that
+program documentation tends to roam the wild for far longer than you expect
+and pick an e-mail address that's likely to last if possible.
-sub internal_lrefs {
- local($_) = shift;
- local $trailing_and = s/and\s+$// ? "and " : "";
-
- s{L</([^>]+)>}{$1}g;
- my(@items) = split( /(?:,?\s+(?:and\s+)?)/ );
- my $retstr = "the ";
- my $i;
- for ($i = 0; $i <= $#items; $i++) {
- $retstr .= "C<$items[$i]>";
- $retstr .= ", " if @items > 2 && $i != $#items;
- $retstr .= " and " if $i+2 == @items;
- }
-
- $retstr .= " entr" . ( @items > 1 ? "ies" : "y" )
- . " elsewhere in this document";
- # terminal space to avoid words running together (pattern used
- # strips terminal spaces)
- $retstr .= " " if length $trailing_and;
- $retstr .= $trailing_and;
-
- return $retstr;
+=item HISTORY
-}
+Programs derived from other sources sometimes have this, or you might keep a
+modification log here.
-BEGIN {
-%HTML_Escapes = (
- 'amp' => '&', # ampersand
- 'lt' => '<', # left chevron, less-than
- 'gt' => '>', # right chevron, greater-than
- 'quot' => '"', # double quote
-
- "Aacute" => "A\\*'", # capital A, acute accent
- "aacute" => "a\\*'", # small a, acute accent
- "Acirc" => "A\\*^", # capital A, circumflex accent
- "acirc" => "a\\*^", # small a, circumflex accent
- "AElig" => '\*(AE', # capital AE diphthong (ligature)
- "aelig" => '\*(ae', # small ae diphthong (ligature)
- "Agrave" => "A\\*`", # capital A, grave accent
- "agrave" => "A\\*`", # small a, grave accent
- "Aring" => 'A\\*o', # capital A, ring
- "aring" => 'a\\*o', # small a, ring
- "Atilde" => 'A\\*~', # capital A, tilde
- "atilde" => 'a\\*~', # small a, tilde
- "Auml" => 'A\\*:', # capital A, dieresis or umlaut mark
- "auml" => 'a\\*:', # small a, dieresis or umlaut mark
- "Ccedil" => 'C\\*,', # capital C, cedilla
- "ccedil" => 'c\\*,', # small c, cedilla
- "Eacute" => "E\\*'", # capital E, acute accent
- "eacute" => "e\\*'", # small e, acute accent
- "Ecirc" => "E\\*^", # capital E, circumflex accent
- "ecirc" => "e\\*^", # small e, circumflex accent
- "Egrave" => "E\\*`", # capital E, grave accent
- "egrave" => "e\\*`", # small e, grave accent
- "ETH" => '\\*(D-', # capital Eth, Icelandic
- "eth" => '\\*(d-', # small eth, Icelandic
- "Euml" => "E\\*:", # capital E, dieresis or umlaut mark
- "euml" => "e\\*:", # small e, dieresis or umlaut mark
- "Iacute" => "I\\*'", # capital I, acute accent
- "iacute" => "i\\*'", # small i, acute accent
- "Icirc" => "I\\*^", # capital I, circumflex accent
- "icirc" => "i\\*^", # small i, circumflex accent
- "Igrave" => "I\\*`", # capital I, grave accent
- "igrave" => "i\\*`", # small i, grave accent
- "Iuml" => "I\\*:", # capital I, dieresis or umlaut mark
- "iuml" => "i\\*:", # small i, dieresis or umlaut mark
- "Ntilde" => 'N\*~', # capital N, tilde
- "ntilde" => 'n\*~', # small n, tilde
- "Oacute" => "O\\*'", # capital O, acute accent
- "oacute" => "o\\*'", # small o, acute accent
- "Ocirc" => "O\\*^", # capital O, circumflex accent
- "ocirc" => "o\\*^", # small o, circumflex accent
- "Ograve" => "O\\*`", # capital O, grave accent
- "ograve" => "o\\*`", # small o, grave accent
- "Oslash" => "O\\*/", # capital O, slash
- "oslash" => "o\\*/", # small o, slash
- "Otilde" => "O\\*~", # capital O, tilde
- "otilde" => "o\\*~", # small o, tilde
- "Ouml" => "O\\*:", # capital O, dieresis or umlaut mark
- "ouml" => "o\\*:", # small o, dieresis or umlaut mark
- "szlig" => '\*8', # small sharp s, German (sz ligature)
- "THORN" => '\\*(Th', # capital THORN, Icelandic
- "thorn" => '\\*(th',, # small thorn, Icelandic
- "Uacute" => "U\\*'", # capital U, acute accent
- "uacute" => "u\\*'", # small u, acute accent
- "Ucirc" => "U\\*^", # capital U, circumflex accent
- "ucirc" => "u\\*^", # small u, circumflex accent
- "Ugrave" => "U\\*`", # capital U, grave accent
- "ugrave" => "u\\*`", # small u, grave accent
- "Uuml" => "U\\*:", # capital U, dieresis or umlaut mark
- "uuml" => "u\\*:", # small u, dieresis or umlaut mark
- "Yacute" => "Y\\*'", # capital Y, acute accent
- "yacute" => "y\\*'", # small y, acute accent
- "yuml" => "y\\*:", # small y, dieresis or umlaut mark
-);
-}
+=back
+
+In addition, some systems use CONFORMING TO to note conformance to relevant
+standards and MT-LEVEL to note safeness for use in threaded programs or
+signal handlers. These headings are primarily useful when documenting parts
+of a C library. Documentation of object-oriented libraries or modules may
+use CONSTRUCTORS and METHODS sections for detailed documentation of the
+parts of the library and save the DESCRIPTION section for an overview; other
+large modules may use FUNCTIONS for similar reasons. Some people use
+OVERVIEW to summarize the description if it's quite long. Sometimes there's
+an additional COPYRIGHT section at the bottom, for licensing terms.
+AVAILABILITY is sometimes added, giving the canonical download site for the
+software or a URL for updates.
+
+Section ordering varies, although NAME should I<always> be the first section
+(you'll break some man page systems otherwise), and NAME, SYNOPSIS,
+DESCRIPTION, and OPTIONS generally always occur first and in that order if
+present. In general, SEE ALSO, AUTHOR, and similar material should be left
+for last. Some systems also move WARNINGS and NOTES to last. The order
+given above should be reasonable for most purposes.
+
+Finally, as a general note, try not to use an excessive amount of markup.
+As documented here and in L<Pod::Man>, you can safely leave Perl variables,
+function names, man page references, and the like unadorned by markup and
+the POD translators will figure it out for you. This makes it much easier
+to later edit the documentation. Note that many existing translators
+(including this one currently) will do the wrong thing with e-mail addresses
+or URLs when wrapped in LE<lt>E<gt>, so don't do that.
+
+For additional information that may be more accurate for your specific
+system, see either man(5) or man(7) depending on your system manual section
+numbering conventions.
+
+=head1 SEE ALSO
+
+L<Pod::Man|Pod::Man>, L<Pod::Parser|Pod::Parser>, man(1), nroff(1),
+troff(1), man(7)
+
+The man page documenting the an macro set may be man(5) instead of man(7) on
+your system.
+
+=head1 AUTHOR
+
+Russ Allbery E<lt>rra@stanford.eduE<gt>, based I<very> heavily on the
+original B<pod2man> by Larry Wall and Tom Christiansen. Large portions of
+this documentation, particularly the sections on the anatomy of a proper man
+page, are taken from the B<pod2man> documentation by Tom.
+=cut
!NO!SUBS!
close OUT or die "Can't close $file: $!";
print OUT <<"!GROK!THIS!";
$Config{startperl}
eval 'exec $Config{perlpath} -S \$0 \${1+"\$@"}'
- if \$running_under_some_shell;
+ if \$running_under_some_shell;
!GROK!THIS!
# In the following, perl variables are not expanded during extraction.
print OUT <<'!NO!SUBS!';
-$ID = q$Id: pod2text,v 0.1 1999/06/13 02:42:18 eagle Exp $;
-
# pod2text -- Convert POD data to formatted ASCII text.
-# Copyright 1999 by Russ Allbery <rra@stanford.edu>
+#
+# Copyright 1999 by Russ Allbery <rra@stanford.edu>
#
# This program is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#
-# The driver script for Pod::Text, Pod::Text::Termcap, and
-# Pod::Text::Color, invoked by perldoc -t among other things.
+# The driver script for Pod::Text, Pod::Text::Termcap, and Pod::Text::Color,
+# invoked by perldoc -t among other things.
require 5.004;
}
}
-# Parse our options. Use the same names as Pod::Text for simplicity,
-# and default to sentence boundaries turned off for compatibility.
+# Parse our options. Use the same names as Pod::Text for simplicity, and
+# default to sentence boundaries turned off for compatibility.
my %options;
$options{termcap} = -t STDOUT;
$options{sentence} = 0;
my $formatter = 'Pod::Text';
if ($options{color}) {
$formatter = 'Pod::Text::Color';
+ eval { require Term::ANSIColor };
+ if ($@) { die "-c (--color) requires Term::ANSIColor be installed\n" }
require Pod::Text::Color;
} elsif ($options{termcap}) {
$formatter = 'Pod::Text::Termcap';
=head1 DESCRIPTION
-B<pod2text> is a front-end for Pod::Text and its subclasses. It uses
-them to generate formatted ASCII text from POD source. It can optionally
-use either termcap sequences or ANSI color escape sequences to format the
-text.
+B<pod2text> is a front-end for Pod::Text and its subclasses. It uses them
+to generate formatted ASCII text from POD source. It can optionally use
+either termcap sequences or ANSI color escape sequences to format the text.
I<input> is the file to read for POD source (the POD can be embedded in
code). If I<input> isn't given, it defaults to STDIN. I<output>, if given,
is the file to which to write the formatted output. If I<output> isn't
given, the formatted output is written to STDOUT.
+B<pod2text> defaults to trying to use Pod::Text::Termcap if STDOUT is a tty.
+To explicitly say not to attempt termcap escape sequences, use
+B<--notermcap>.
+
=head1 OPTIONS
=over 4
Set the number of spaces to indent regular text, and the default indentation
for C<=over> blocks. Defaults to 4 spaces if this option isn't given.
+=item B<-h>, B<--help>
+
+Print out usage information and exit.
+
=item B<-l>, B<--loose>
Print a blank line after a C<=head1> heading. Normally, no blank line is
-printed after C<=head1>, although one is still printed after C<=head2>.
-This is the default because it's the expected formatting for manual pages;
-if you're formatting arbitrary text documents, using this option is
-recommended.
+printed after C<=head1>, although one is still printed after C<=head2>,
+because this is the expected formatting for manual pages; if you're
+formatting arbitrary text documents, using this option is recommended.
=item B<-s>, B<--sentence>
-Assume each sentence ends in two spaces and try to preserve that spacing.
+Assume each sentence ends with two spaces and try to preserve that spacing.
Without this option, all consecutive whitespace in non-verbatim paragraphs
is compressed into a single space.
formatting the output. Output will be wrapped at two columns less than the
width of your terminal device. Using this option requires that your system
have a termcap file somewhere where Term::Cap can find it. With this
-option, the output of B<pod2text> will contain terminal control sequences for
-your current terminal type.
+option, the output of B<pod2text> will contain terminal control sequences
+for your current terminal type.
=item B<-w>, B<--width=>I<width>, B<->I<width>
=back
+=head1 DIAGNOSTICS
+
+If B<pod2text> fails with errors, see L<Pod::Text> and L<Pod::Parser> for
+information about what those errors might mean. Internally, it can also
+produce the following diagnostics:
+
+=over 4
+
+=item -c (--color) requires Term::ANSIColor be installed
+
+(F) B<-c> or B<--color> were given, but Term::ANSIColor could not be
+loaded.
+
+=item Unknown option: %s
+
+(F) An unknown command line option was given.
+
+=back
+
+In addition, other L<Getopt::Long|Getopt::Long> error messages may result
+from invalid command-line options.
+
=head1 ENVIRONMENT
=over 4
=back
-=head1 DIAGNOSTICS
-
-If B<pod2text> fails with POD errors, see L<Pod::Text> and
-L<Pod::Parser> for information about what those errors might mean.
-
=head1 SEE ALSO
L<Pod::Text|Pod::Text>, L<Pod::Text::Color|Pod::Text::Color>,
#############################################################################
# pod2usage -- command to print usage messages from embedded pod docs
#
-# Derived from Tom Christiansen's pod2text script.
-# (with extensive modifications)
-#
-# Copyright (c) 1996 Bradford Appleton. All rights reserved.
+# Copyright (c) 1996-1999 by Bradford Appleton. All rights reserved.
# This file is part of "PodParser". PodParser is free software;
# you can redistribute it and/or modify it under the same terms
# as Perl itself.
#############################################################################
# podchecker -- command to invoke the podchecker function in Pod::Checker
#
-# Derived from Tom Christiansen's pod2text script.
-# (with extensive modifications)
-#
-# Copyright (c) 1998 Bradford Appleton. All rights reserved.
+# Copyright (c) 1998-1999 by Bradford Appleton. All rights reserved.
# This file is part of "PodParser". PodParser is free software;
# you can redistribute it and/or modify it under the same terms
# as Perl itself.
#############################################################################
use strict;
-use diagnostics;
+#use diagnostics;
=head1 NAME
=head1 SYNOPSIS
-B<podchecker> [B<-help>] [B<-man>] [I<file>S< >...]
+B<podchecker> [B<-help>] [B<-man>] [B<-(no)warnings>] [I<file>S< >...]
=head1 OPTIONS AND ARGUMENTS
Print the manual page and exit.
+=item B<-warnings> B<-nowarnings>
+
+Turn on/off printing of warnings.
+
=item I<file>
The pathname of a POD file to syntax-check (defaults to standard input).
B<podchecker> invokes the B<podchecker()> function exported by B<Pod::Checker>
Please see L<Pod::Checker/podchecker()> for more details.
+=head1 RETURN VALUE
+
+B<podchecker> returns a 0 (zero) exit status if all specified
+POD files are ok.
+
+=head1 ERRORS
+
+B<podchecker> returns the exit status 1 if at least one of
+the given POD files has syntax errors.
+
+The status 2 indicates that at least one of the specified
+files does not contain I<any> POD commands.
+
+Status 1 overrides status 2. If you want unambigouus
+results, call B<podchecker> with one single argument only.
+
=head1 SEE ALSO
L<Pod::Parser> and L<Pod::Checker>
-=head1 AUTHOR
+=head1 AUTHORS
-Brad Appleton E<lt>bradapp@enteract.comE<gt>
+Brad Appleton E<lt>bradapp@enteract.comE<gt>,
+Marek Rouchal E<lt>marek@saftsack.fs.uni-bayreuth.deE<gt>
Based on code for B<Pod::Text::pod2text(1)> written by
Tom Christiansen E<lt>tchrist@mox.perl.comE<gt>
my %options = (
"help" => 0,
"man" => 0,
+ "warnings" => 1,
);
## Parse options
-GetOptions(\%options, "help", "man") || pod2usage(2);
+GetOptions(\%options, "help", "man", "warnings!") || pod2usage(2);
pod2usage(1) if ($options{help});
pod2usage(-verbose => 2) if ($options{man});
pod2usage(2) if ((@ARGV == 0) && (-t STDIN));
## Invoke podchecker()
-if(@ARGV) {
- for (@ARGV) { podchecker($_) };
-} else {
- podchecker("<&STDIN");
+my $status = 0;
+@ARGV = ("<&STDIN") unless(@ARGV);
+for (@ARGV) {
+ my $s = podchecker($_, undef, '-warnings' => $options{warnings});
+ if($s > 0) {
+ # errors occurred
+ $status = 1;
+ }
+ elsif($s < 0) {
+ # no pod found
+ $status = 2 unless($status);
+ }
}
+exit $status;
!NO!SUBS!
#############################################################################
# podselect -- command to invoke the podselect function in Pod::Select
#
-# Derived from Tom Christiansen's pod2text script.
-# (with extensive modifications)
-#
-# Copyright (c) 1996 Bradford Appleton. All rights reserved.
+# Copyright (c) 1996-1999 by Bradford Appleton. All rights reserved.
# This file is part of "PodParser". PodParser is free software;
# you can redistribute it and/or modify it under the same terms
# as Perl itself.
$mandir/perlmod.1 \
$mandir/perlmodlib.1 \
$mandir/perlmodinstall.1 \
+ $mandir/perlfork.1 \
$mandir/perlform.1 \
$mandir/perllocale.1 \
$mandir/perlref.1 \
$mandir/perlcall.1 \
$mandir/perlcompile.1 \
$mandir/perltodo.1 \
+ $mandir/perlhack.1 \
$mandir/perlhist.1 \
$mandir/perldelta.1 \
$mandir/perl5004delta.1 \
* NI-S 1999/05/07
*/
if (PL_op->op_private & OPpDEREF) {
- GV *gv = (GV *) newSV(0);
- STRLEN len = 0;
- char *name = "";
- if (cUNOP->op_first->op_type == OP_PADSV) {
- SV *padname = *av_fetch(PL_comppad_name, cUNOP->op_first->op_targ, 4);
- name = SvPV(padname,len);
+ char *name;
+ GV *gv;
+ if (cUNOP->op_targ) {
+ STRLEN len;
+ SV *namesv = PL_curpad[cUNOP->op_targ];
+ name = SvPV(namesv, len);
+ gv = (GV*)NEWSV(0,0);
+ gv_init(gv, CopSTASH(PL_curcop), name, len, 0);
+ }
+ else {
+ name = CopSTASHPV(PL_curcop);
+ gv = newGVgen(name);
}
- gv_init(gv, PL_curcop->cop_stash, name, len, 0);
sv_upgrade(sv, SVt_RV);
- SvRV(sv) = (SV *) gv;
+ SvRV(sv) = (SV*)gv;
SvROK_on(sv);
SvSETMAGIC(sv);
goto wasref;
- }
+ }
if (PL_op->op_flags & OPf_REF ||
PL_op->op_private & HINT_STRICT_REFS)
DIE(aTHX_ PL_no_usym, "a symbol");
if (ckWARN(WARN_UNINITIALIZED))
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
RETSETUNDEF;
}
sym = SvPV(sv, n_a);
PL_op->op_private & HINT_STRICT_REFS)
DIE(aTHX_ PL_no_usym, "a SCALAR");
if (ckWARN(WARN_UNINITIALIZED))
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
RETSETUNDEF;
}
sym = SvPV(sv, n_a);
HV *stash;
if (MAXARG == 1)
- stash = PL_curcop->cop_stash;
+ stash = CopSTASH(PL_curcop);
else {
SV *ssv = POPs;
STRLEN len;
Newz(602, gp, 1, GP);
GvGP(sv) = gp_ref(gp);
GvSV(sv) = NEWSV(72,0);
- GvLINE(sv) = PL_curcop->cop_line;
+ GvLINE(sv) = CopLINE(PL_curcop);
GvEGV(sv) = (GV*)sv;
GvMULTI_on(sv);
}
u = (U32)SEED_C1 * when;
# endif
#endif
- u += SEED_C3 * (U32)getpid();
+ u += SEED_C3 * (U32)PerlProc_getpid();
u += SEED_C4 * (U32)PTR2UV(PL_stack_sp);
#ifndef PLAN9 /* XXX Plan9 assembler chokes on this; fix needed */
u += SEED_C5 * (U32)PTR2UV(&when);
sv_pos_u2b(sv, &pos, &rem);
tmps += pos;
sv_setpvn(TARG, tmps, rem);
- if (lvalue) { /* it's an lvalue! */
+ if (repl)
+ sv_insert(sv, pos, rem, repl, repl_len);
+ else if (lvalue) { /* it's an lvalue! */
if (!SvGMAGICAL(sv)) {
if (SvROK(sv)) {
STRLEN n_a;
LvTARGOFF(TARG) = pos;
LvTARGLEN(TARG) = rem;
}
- else if (repl)
- sv_insert(sv, pos, rem, repl, repl_len);
}
SPAGAIN;
PUSHs(TARG); /* avoid SvSETMAGIC here */
tend = uv_to_utf8(tmpbuf, uv);
- if (!SvPADTMP(sv) || tend - tmpbuf != ulen) {
+ if (!SvPADTMP(sv) || tend - tmpbuf != ulen || SvREADONLY(sv)) {
dTARGET;
sv_setpvn(TARG, (char*)tmpbuf, tend - tmpbuf);
sv_catpvn(TARG, (char*)(s + ulen), slen - ulen);
}
}
else {
- if (!SvPADTMP(sv)) {
+ if (!SvPADTMP(sv) || SvREADONLY(sv)) {
dTARGET;
sv_setsv(TARG, sv);
sv = TARG;
tend = uv_to_utf8(tmpbuf, uv);
- if (!SvPADTMP(sv) || tend - tmpbuf != ulen) {
+ if (!SvPADTMP(sv) || tend - tmpbuf != ulen || SvREADONLY(sv)) {
dTARGET;
sv_setpvn(TARG, (char*)tmpbuf, tend - tmpbuf);
sv_catpvn(TARG, (char*)(s + ulen), slen - ulen);
}
}
else {
- if (!SvPADTMP(sv)) {
+ if (!SvPADTMP(sv) || SvREADONLY(sv)) {
dTARGET;
sv_setsv(TARG, sv);
sv = TARG;
}
}
else {
- if (!SvPADTMP(sv)) {
+ if (!SvPADTMP(sv) || SvREADONLY(sv)) {
dTARGET;
sv_setsv(TARG, sv);
sv = TARG;
}
}
else {
- if (!SvPADTMP(sv)) {
+ if (!SvPADTMP(sv) || SvREADONLY(sv)) {
dTARGET;
sv_setsv(TARG, sv);
sv = TARG;
U32 hvtype;
hv = (HV*)POPs;
hvtype = SvTYPE(hv);
- while (++MARK <= SP) {
- if (hvtype == SVt_PVHV)
+ if (hvtype == SVt_PVHV) { /* hash element */
+ while (++MARK <= SP) {
sv = hv_delete_ent(hv, *MARK, discard, 0);
- else
- DIE(aTHX_ "Not a HASH reference");
- *MARK = sv ? sv : &PL_sv_undef;
+ *MARK = sv ? sv : &PL_sv_undef;
+ }
}
+ else if (hvtype == SVt_PVAV) {
+ if (PL_op->op_flags & OPf_SPECIAL) { /* array element */
+ while (++MARK <= SP) {
+ sv = av_delete((AV*)hv, SvIV(*MARK), discard);
+ *MARK = sv ? sv : &PL_sv_undef;
+ }
+ }
+ else { /* pseudo-hash element */
+ while (++MARK <= SP) {
+ sv = avhv_delete_ent((AV*)hv, *MARK, discard, 0);
+ *MARK = sv ? sv : &PL_sv_undef;
+ }
+ }
+ }
+ else
+ DIE(aTHX_ "Not a HASH reference");
if (discard)
SP = ORIGMARK;
else if (gimme == G_SCALAR) {
hv = (HV*)POPs;
if (SvTYPE(hv) == SVt_PVHV)
sv = hv_delete_ent(hv, keysv, discard, 0);
+ else if (SvTYPE(hv) == SVt_PVAV) {
+ if (PL_op->op_flags & OPf_SPECIAL)
+ sv = av_delete((AV*)hv, SvIV(keysv), discard);
+ else
+ sv = avhv_delete_ent((AV*)hv, keysv, discard, 0);
+ }
else
DIE(aTHX_ "Not a HASH reference");
if (!sv)
RETPUSHYES;
}
else if (SvTYPE(hv) == SVt_PVAV) {
- if (avhv_exists_ent((AV*)hv, tmpsv, 0))
+ if (PL_op->op_flags & OPf_SPECIAL) { /* array element */
+ if (av_exists((AV*)hv, SvIV(tmpsv)))
+ RETPUSHYES;
+ }
+ else if (avhv_exists_ent((AV*)hv, tmpsv, 0)) /* pseudo-hash element */
RETPUSHYES;
}
else {
*MARK++ = *SP;
*SP-- = tmp;
}
+ /* safe as long as stack cannot get extended in the above */
SP = oldsp;
}
else {
{
djSP;
dPOPPOPssrl;
- SV **oldsp = SP;
+ I32 start_sp_offset = SP - PL_stack_base;
I32 gimme = GIMME_V;
SV *sv;
STRLEN llen;
I32 datumtype;
register I32 len;
register I32 bits;
+ register char *str;
/* These must not be in registers: */
I16 ashort;
register U32 culong;
NV cdouble;
int commas = 0;
+ int star;
#ifdef PERL_NATINT_PACK
int natint; /* native integer */
int unatint; /* unsigned native integer */
else
DIE(aTHX_ "'!' allowed only after types %s", natstr);
}
+ star = 0;
if (pat >= patend)
len = 1;
else if (*pat == '*') {
len = strend - strbeg; /* long enough */
pat++;
+ star = 1;
}
else if (isDIGIT(*pat)) {
len = *pat++ - '0';
}
else
len = (datumtype != '@');
+ redo_switch:
switch(datumtype) {
default:
DIE(aTHX_ "Invalid type in unpack: '%c'", (int)datumtype);
s += len;
break;
case '/':
- if (oldsp >= SP)
+ if (start_sp_offset >= SP - PL_stack_base)
DIE(aTHX_ "/ must follow a numeric type");
- if (*pat != 'a' && *pat != 'A' && *pat != 'Z')
- DIE(aTHX_ "/ must be followed by a, A or Z");
datumtype = *pat++;
if (*pat == '*')
pat++; /* ignore '*' for compatibility with pack */
if (isDIGIT(*pat))
DIE(aTHX_ "/ cannot take a count" );
len = POPi;
- /* drop through */
+ star = 0;
+ goto redo_switch;
case 'A':
case 'Z':
case 'a':
break;
case 'B':
case 'b':
- if (pat[-1] == '*' || len > (strend - s) * 8)
+ if (star || len > (strend - s) * 8)
len = (strend - s) * 8;
if (checksum) {
if (!PL_bitcount) {
sv = NEWSV(35, len + 1);
SvCUR_set(sv, len);
SvPOK_on(sv);
- aptr = pat; /* borrow register */
- pat = SvPVX(sv);
+ str = SvPVX(sv);
if (datumtype == 'b') {
aint = len;
for (len = 0; len < aint; len++) {
bits >>= 1;
else
bits = *s++;
- *pat++ = '0' + (bits & 1);
+ *str++ = '0' + (bits & 1);
}
}
else {
bits <<= 1;
else
bits = *s++;
- *pat++ = '0' + ((bits & 128) != 0);
+ *str++ = '0' + ((bits & 128) != 0);
}
}
- *pat = '\0';
- pat = aptr; /* unborrow register */
+ *str = '\0';
XPUSHs(sv_2mortal(sv));
break;
case 'H':
case 'h':
- if (pat[-1] == '*' || len > (strend - s) * 2)
+ if (star || len > (strend - s) * 2)
len = (strend - s) * 2;
sv = NEWSV(35, len + 1);
SvCUR_set(sv, len);
SvPOK_on(sv);
- aptr = pat; /* borrow register */
- pat = SvPVX(sv);
+ str = SvPVX(sv);
if (datumtype == 'h') {
aint = len;
for (len = 0; len < aint; len++) {
bits >>= 4;
else
bits = *s++;
- *pat++ = PL_hexdigit[bits & 15];
+ *str++ = PL_hexdigit[bits & 15];
}
}
else {
bits <<= 4;
else
bits = *s++;
- *pat++ = PL_hexdigit[(bits >> 4) & 15];
+ *str++ = PL_hexdigit[(bits >> 4) & 15];
}
}
- *pat = '\0';
- pat = aptr; /* unborrow register */
+ *str = '\0';
XPUSHs(sv_2mortal(sv));
break;
case 'c':
checksum = 0;
}
}
- if (SP == oldsp && gimme == G_SCALAR)
+ if (SP - PL_stack_base == start_sp_offset && gimme == G_SCALAR)
PUSHs(&PL_sv_undef);
RETURN;
}
case 'a':
fromstr = NEXTFROM;
aptr = SvPV(fromstr, fromlen);
- if (pat[-1] == '*')
+ if (pat[-1] == '*') {
len = fromlen;
- if (fromlen > len)
+ if (datumtype == 'Z')
+ ++len;
+ }
+ if (fromlen >= len) {
sv_catpvn(cat, aptr, len);
+ if (datumtype == 'Z')
+ *(SvEND(cat)-1) = '\0';
+ }
else {
sv_catpvn(cat, aptr, fromlen);
len -= fromlen;
case 'B':
case 'b':
{
- char *savepat = pat;
+ register char *str;
I32 saveitems;
fromstr = NEXTFROM;
saveitems = items;
- aptr = SvPV(fromstr, fromlen);
+ str = SvPV(fromstr, fromlen);
if (pat[-1] == '*')
len = fromlen;
- pat = aptr;
aint = SvCUR(cat);
SvCUR(cat) += (len+7)/8;
SvGROW(cat, SvCUR(cat) + 1);
items = 0;
if (datumtype == 'B') {
for (len = 0; len++ < aint;) {
- items |= *pat++ & 1;
+ items |= *str++ & 1;
if (len & 7)
items <<= 1;
else {
}
else {
for (len = 0; len++ < aint;) {
- if (*pat++ & 1)
+ if (*str++ & 1)
items |= 128;
if (len & 7)
items >>= 1;
items >>= 7 - (aint & 7);
*aptr++ = items & 0xff;
}
- pat = SvPVX(cat) + SvCUR(cat);
- while (aptr <= pat)
+ str = SvPVX(cat) + SvCUR(cat);
+ while (aptr <= str)
*aptr++ = '\0';
- pat = savepat;
items = saveitems;
}
break;
case 'H':
case 'h':
{
- char *savepat = pat;
+ register char *str;
I32 saveitems;
fromstr = NEXTFROM;
saveitems = items;
- aptr = SvPV(fromstr, fromlen);
+ str = SvPV(fromstr, fromlen);
if (pat[-1] == '*')
len = fromlen;
- pat = aptr;
aint = SvCUR(cat);
SvCUR(cat) += (len+1)/2;
SvGROW(cat, SvCUR(cat) + 1);
items = 0;
if (datumtype == 'H') {
for (len = 0; len++ < aint;) {
- if (isALPHA(*pat))
- items |= ((*pat++ & 15) + 9) & 15;
+ if (isALPHA(*str))
+ items |= ((*str++ & 15) + 9) & 15;
else
- items |= *pat++ & 15;
+ items |= *str++ & 15;
if (len & 1)
items <<= 4;
else {
}
else {
for (len = 0; len++ < aint;) {
- if (isALPHA(*pat))
- items |= (((*pat++ & 15) + 9) & 15) << 4;
+ if (isALPHA(*str))
+ items |= (((*str++ & 15) + 9) & 15) << 4;
else
- items |= (*pat++ & 15) << 4;
+ items |= (*str++ & 15) << 4;
if (len & 1)
items >>= 4;
else {
}
if (aint & 1)
*aptr++ = items & 0xff;
- pat = SvPVX(cat) + SvCUR(cat);
- while (aptr <= pat)
+ str = SvPVX(cat) + SvCUR(cat);
+ while (aptr <= str)
*aptr++ = '\0';
- pat = savepat;
items = saveitems;
}
break;
sv_catpvn(cat, (char*)&aquad, sizeof(Quad_t));
}
break;
-#endif /* HAS_QUAD */
+#endif
case 'P':
len = 1; /* assume SV is correct length */
/* FALL THROUGH */
* of pack() (and all copies of the result) are
* gone.
*/
- if (ckWARN(WARN_UNSAFE) && (SvTEMP(fromstr) || SvPADTMP(fromstr)))
+ if (ckWARN(WARN_UNSAFE) && (SvTEMP(fromstr)
+ || (SvPADTMP(fromstr)
+ && !SvREADONLY(fromstr))))
+ {
Perl_warner(aTHX_ WARN_UNSAFE,
"Attempt to pack pointer to temporary value");
+ }
if (SvPOK(fromstr) || SvNIOK(fromstr))
aptr = SvPV(fromstr,n_a);
else
TAINT_IF((pm->op_pmflags & PMf_LOCALE) &&
(pm->op_pmflags & (PMf_WHITE | PMf_SKIPWHITE)));
- if (pm->op_pmreplroot)
+ if (pm->op_pmreplroot) {
+#ifdef USE_ITHREADS
+ ary = GvAVn((GV*)PL_curpad[(PADOFFSET)pm->op_pmreplroot]);
+#else
ary = GvAVn((GV*)pm->op_pmreplroot);
+#endif
+ }
else if (gimme != G_ARRAY)
#ifdef USE_THREADS
ary = (AV*)PL_curpad[0];
Perl_croak(aTHX_ "panic: unlock_condpair unlocking mutex that we don't own");
MgOWNER(mg) = 0;
COND_SIGNAL(MgOWNERCONDP(mg));
- DEBUG_S(PerlIO_printf(PerlIO_stderr(), "0x%lx: unlock 0x%lx\n",
- (unsigned long)thr, (unsigned long)svv);)
+ DEBUG_S(PerlIO_printf(Perl_debug_log, "0x%"UVxf": unlock 0x%"UVxf"\n",
+ PTR2UV(thr), PTR2UV(svv));)
MUTEX_UNLOCK(MgMUTEXP(mg));
}
#endif /* USE_THREADS */
while (MgOWNER(mg))
COND_WAIT(MgOWNERCONDP(mg), MgMUTEXP(mg));
MgOWNER(mg) = thr;
- DEBUG_S(PerlIO_printf(PerlIO_stderr(), "0x%lx: pp_lock lock 0x%lx\n",
- (unsigned long)thr, (unsigned long)sv);)
+ DEBUG_S(PerlIO_printf(Perl_debug_log, "0x%"UVxf": pp_lock lock 0x%"UVxf"\n",
+ PTR2UV(thr), PTR2UV(sv));)
MUTEX_UNLOCK(MgMUTEXP(mg));
- SAVEDESTRUCTOR(Perl_unlock_condpair, sv);
+ SAVEDESTRUCTOR_X(Perl_unlock_condpair, sv);
}
#endif /* USE_THREADS */
if (SvTYPE(retsv) == SVt_PVAV || SvTYPE(retsv) == SVt_PVHV
#define DOCATCH(o) ((CATCH_GET == TRUE) ? docatch(o) : (o))
static I32 sortcv(pTHXo_ SV *a, SV *b);
+static I32 sortcv_stacked(pTHXo_ SV *a, SV *b);
+static I32 sortcv_xsub(pTHXo_ SV *a, SV *b);
static I32 sv_ncmp(pTHXo_ SV *a, SV *b);
static I32 sv_i_ncmp(pTHXo_ SV *a, SV *b);
static I32 amagic_ncmp(pTHXo_ SV *a, SV *b);
else if (strEQ("\\s+", pm->op_pmregexp->precomp))
pm->op_pmflags |= PMf_WHITE;
+ /* XXX runtime compiled output needs to move to the pad */
if (pm->op_pmflags & PMf_KEEP) {
pm->op_private &= ~OPpRUNTIME; /* no point compiling again */
+#if !defined(USE_ITHREADS) && !defined(USE_THREADS)
+ /* XXX can't change the optree at runtime either */
cLOGOP->op_first->op_next = PL_op->op_next;
+#endif
}
RETURN;
}
case FF_END: name = "END"; break;
}
if (arg >= 0)
- PerlIO_printf(PerlIO_stderr(), "%-16s%ld\n", name, (long) arg);
+ PerlIO_printf(Perl_debug_log, "%-16s%ld\n", name, (long) arg);
else
- PerlIO_printf(PerlIO_stderr(), "%-16s\n", name);
+ PerlIO_printf(Perl_debug_log, "%-16s\n", name);
} )
switch (*fpc++) {
case FF_LINEMARK:
/* SAVE_DEFSV does *not* suffice here for USE_THREADS */
SAVESPTR(DEFSV);
ENTER; /* enter inner scope */
- SAVESPTR(PL_curpm);
+ SAVEVPTR(PL_curpm);
src = PL_stack_base[*PL_markstack_ptr];
SvTEMP_off(src);
SV *src;
ENTER; /* enter inner scope */
- SAVESPTR(PL_curpm);
+ SAVEVPTR(PL_curpm);
src = PL_stack_base[PL_markstack_ptr[-1]];
SvTEMP_off(src);
I32 gimme = GIMME;
OP* nextop = PL_op->op_next;
I32 overloading = 0;
+ bool hasargs = FALSE;
+ I32 is_xsub = 0;
if (gimme != G_ARRAY) {
SP = MARK;
}
ENTER;
- SAVEPPTR(PL_sortcop);
+ SAVEVPTR(PL_sortcop);
if (PL_op->op_flags & OPf_STACKED) {
if (PL_op->op_flags & OPf_SPECIAL) {
OP *kid = cLISTOP->op_first->op_sibling; /* pass pushmark */
kid = kUNOP->op_first; /* pass rv2gv */
kid = kUNOP->op_first; /* pass leave */
PL_sortcop = kid->op_next;
- stash = PL_curcop->cop_stash;
+ stash = CopSTASH(PL_curcop);
}
else {
cv = sv_2cv(*++MARK, &stash, &gv, 0);
+ if (cv && SvPOK(cv)) {
+ STRLEN n_a;
+ char *proto = SvPV((SV*)cv, n_a);
+ if (proto && strEQ(proto, "$$")) {
+ hasargs = TRUE;
+ }
+ }
if (!(cv && CvROOT(cv))) {
- if (gv) {
+ if (cv && CvXSUB(cv)) {
+ is_xsub = 1;
+ }
+ else if (gv) {
SV *tmpstr = sv_newmortal();
gv_efullname3(tmpstr, gv, Nullch);
- if (cv && CvXSUB(cv))
- DIE(aTHX_ "Xsub \"%s\" called in sort", SvPVX(tmpstr));
DIE(aTHX_ "Undefined sort subroutine \"%s\" called",
SvPVX(tmpstr));
}
- if (cv) {
- if (CvXSUB(cv))
- DIE(aTHX_ "Xsub called in sort");
+ else {
DIE(aTHX_ "Undefined subroutine in sort");
}
- DIE(aTHX_ "Not a CODE reference in sort");
}
- PL_sortcop = CvSTART(cv);
- SAVESPTR(CvROOT(cv)->op_ppaddr);
- CvROOT(cv)->op_ppaddr = PL_ppaddr[OP_NULL];
- SAVESPTR(PL_curpad);
- PL_curpad = AvARRAY((AV*)AvARRAY(CvPADLIST(cv))[1]);
+ if (is_xsub)
+ PL_sortcop = (OP*)cv;
+ else {
+ PL_sortcop = CvSTART(cv);
+ SAVEVPTR(CvROOT(cv)->op_ppaddr);
+ CvROOT(cv)->op_ppaddr = PL_ppaddr[OP_NULL];
+
+ SAVEVPTR(PL_curpad);
+ PL_curpad = AvARRAY((AV*)AvARRAY(CvPADLIST(cv))[1]);
+ }
}
}
else {
PL_sortcop = Nullop;
- stash = PL_curcop->cop_stash;
+ stash = CopSTASH(PL_curcop);
}
up = myorigmark + 1;
PUSHBLOCK(cx, CXt_NULL, PL_stack_base);
if (!(PL_op->op_flags & OPf_SPECIAL)) {
- bool hasargs = FALSE;
cx->cx_type = CXt_SUB;
cx->blk_gimme = G_SCALAR;
PUSHSUB(cx);
(void)SvREFCNT_inc(cv); /* in preparation for POPSUB */
}
PL_sortcxix = cxstack_ix;
- qsortsv((myorigmark+1), max, sortcv);
+
+ if (hasargs && !is_xsub) {
+ /* This is mostly copied from pp_entersub */
+ AV *av = (AV*)PL_curpad[0];
+
+#ifndef USE_THREADS
+ cx->blk_sub.savearray = GvAV(PL_defgv);
+ GvAV(PL_defgv) = (AV*)SvREFCNT_inc(av);
+#endif /* USE_THREADS */
+ cx->blk_sub.argarray = av;
+ }
+ qsortsv((myorigmark+1), max,
+ is_xsub ? sortcv_xsub : hasargs ? sortcv_stacked : sortcv);
POPBLOCK(cx,PL_curpm);
PL_stack_sp = newsp;
mg_get(right);
if (SvNIOKp(left) || !SvPOKp(left) ||
- (looks_like_number(left) && *SvPVX(left) != '0') )
+ SvNIOKp(right) || !SvPOKp(right) ||
+ (looks_like_number(left) && *SvPVX(left) != '0' &&
+ looks_like_number(right) && *SvPVX(right) != '0'))
{
if (SvNV(left) < IV_MIN || SvNV(right) > IV_MAX)
DIE(aTHX_ "Range iterator outside integer range");
Perl_warner(aTHX_ WARN_UNSAFE, "Exiting subroutine via %s",
PL_op_name[PL_op->op_type]);
break;
+ case CXt_FORMAT:
+ if (ckWARN(WARN_UNSAFE))
+ Perl_warner(aTHX_ WARN_UNSAFE, "Exiting format via %s",
+ PL_op_name[PL_op->op_type]);
+ break;
case CXt_EVAL:
if (ckWARN(WARN_UNSAFE))
Perl_warner(aTHX_ WARN_UNSAFE, "Exiting eval via %s",
continue;
case CXt_EVAL:
case CXt_SUB:
+ case CXt_FORMAT:
DEBUG_l( Perl_deb(aTHX_ "(Found sub #%ld)\n", (long)i));
return i;
}
Perl_warner(aTHX_ WARN_UNSAFE, "Exiting subroutine via %s",
PL_op_name[PL_op->op_type]);
break;
+ case CXt_FORMAT:
+ if (ckWARN(WARN_UNSAFE))
+ Perl_warner(aTHX_ WARN_UNSAFE, "Exiting format via %s",
+ PL_op_name[PL_op->op_type]);
+ break;
case CXt_EVAL:
if (ckWARN(WARN_UNSAFE))
Perl_warner(aTHX_ WARN_UNSAFE, "Exiting eval via %s",
I32 optype;
while (cxstack_ix > cxix) {
+ SV *sv;
cx = &cxstack[cxstack_ix];
DEBUG_l(PerlIO_printf(Perl_debug_log, "Unwinding block %ld, type %s\n",
(long) cxstack_ix, PL_block_type[CxTYPE(cx)]));
POPSUBST(cx);
continue; /* not break */
case CXt_SUB:
- POPSUB(cx);
+ POPSUB(cx,sv);
+ LEAVESUB(sv);
break;
case CXt_EVAL:
POPEVAL(cx);
break;
case CXt_NULL:
break;
+ case CXt_FORMAT:
+ POPFORMAT(cx);
+ break;
}
cxstack_ix--;
}
if (message) {
if (PL_in_eval & EVAL_KEEPERR) {
- SV **svp;
-
- svp = hv_fetch(ERRHV, message, msglen, TRUE);
- if (svp) {
- if (!SvIOK(*svp)) {
- static char prefix[] = "\t(in cleanup) ";
- SV *err = ERRSV;
- sv_upgrade(*svp, SVt_IV);
- (void)SvIOK_only(*svp);
- if (!SvPOK(err))
- sv_setpv(err,"");
- SvGROW(err, SvCUR(err)+sizeof(prefix)+msglen);
- sv_catpvn(err, prefix, sizeof(prefix)-1);
- sv_catpvn(err, message, msglen);
- if (ckWARN(WARN_UNSAFE)) {
- STRLEN start = SvCUR(err)-msglen-sizeof(prefix)+1;
- Perl_warner(aTHX_ WARN_UNSAFE, SvPVX(err)+start);
- }
+ static char prefix[] = "\t(in cleanup) ";
+ SV *err = ERRSV;
+ char *e = Nullch;
+ if (!SvPOK(err))
+ sv_setpv(err,"");
+ else if (SvCUR(err) >= sizeof(prefix)+msglen-1) {
+ e = SvPV(err, n_a);
+ e += n_a - msglen;
+ if (*e != *message || strNE(e,message))
+ e = Nullch;
+ }
+ if (!e) {
+ SvGROW(err, SvCUR(err)+sizeof(prefix)+msglen);
+ sv_catpvn(err, prefix, sizeof(prefix)-1);
+ sv_catpvn(err, message, msglen);
+ if (ckWARN(WARN_UNSAFE)) {
+ STRLEN start = SvCUR(err)-msglen-sizeof(prefix)+1;
+ Perl_warner(aTHX_ WARN_UNSAFE, SvPVX(err)+start);
}
- sv_inc(*svp);
}
}
else
POPBLOCK(cx,PL_curpm);
if (CxTYPE(cx) != CXt_EVAL) {
- PerlIO_write(PerlIO_stderr(), "panic: die ", 11);
- PerlIO_write(PerlIO_stderr(), message, msglen);
+ PerlIO_write(Perl_error_log, "panic: die ", 11);
+ PerlIO_write(Perl_error_log, message, msglen);
my_exit(1);
}
POPEVAL(cx);
/* SFIO can really mess with your errno */
int e = errno;
#endif
- PerlIO_write(PerlIO_stderr(), message, msglen);
- (void)PerlIO_flush(PerlIO_stderr());
+ PerlIO *serr = Perl_error_log;
+
+ PerlIO_write(serr, message, msglen);
+ (void)PerlIO_flush(serr);
#ifdef USE_SFIO
errno = e;
#endif
PERL_SI *top_si = PL_curstackinfo;
I32 dbcxix;
I32 gimme;
- HV *hv;
+ char *stashname;
SV *sv;
I32 count = 0;
}
cx = &ccstack[cxix];
- if (CxTYPE(cx) == CXt_SUB) {
+ if (CxTYPE(cx) == CXt_SUB || CxTYPE(cx) == CXt_FORMAT) {
dbcxix = dopoptosub_at(ccstack, cxix - 1);
/* We expect that ccstack[dbcxix] is CXt_SUB, anyway, the
field below is defined for any cx. */
cx = &ccstack[dbcxix];
}
+ stashname = CopSTASHPV(cx->blk_oldcop);
if (GIMME != G_ARRAY) {
- hv = cx->blk_oldcop->cop_stash;
- if (!hv)
+ if (!stashname)
PUSHs(&PL_sv_undef);
else {
dTARGET;
- sv_setpv(TARG, HvNAME(hv));
+ sv_setpv(TARG, stashname);
PUSHs(TARG);
}
RETURN;
}
- hv = cx->blk_oldcop->cop_stash;
- if (!hv)
+ if (!stashname)
PUSHs(&PL_sv_undef);
else
- PUSHs(sv_2mortal(newSVpv(HvNAME(hv), 0)));
- PUSHs(sv_2mortal(newSVpvn(SvPVX(GvSV(cx->blk_oldcop->cop_filegv)),
- SvCUR(GvSV(cx->blk_oldcop->cop_filegv)))));
- PUSHs(sv_2mortal(newSViv((I32)cx->blk_oldcop->cop_line)));
+ PUSHs(sv_2mortal(newSVpv(stashname, 0)));
+ PUSHs(sv_2mortal(newSVpv(CopFILE(cx->blk_oldcop), 0)));
+ PUSHs(sv_2mortal(newSViv((I32)CopLINE(cx->blk_oldcop))));
if (!MAXARG)
RETURN;
- if (CxTYPE(cx) == CXt_SUB) { /* So is ccstack[dbcxix]. */
+ if (CxTYPE(cx) == CXt_SUB || CxTYPE(cx) == CXt_FORMAT) {
+ /* So is ccstack[dbcxix]. */
sv = NEWSV(49, 0);
gv_efullname3(sv, CvGV(ccstack[cxix].blk_sub.cv), Nullch);
PUSHs(sv_2mortal(sv));
PUSHs(&PL_sv_undef);
}
if (CxTYPE(cx) == CXt_SUB && cx->blk_sub.hasargs
- && PL_curcop->cop_stash == PL_debstash)
+ && CopSTASH_eq(PL_curcop, PL_debstash))
{
AV *ary = cx->blk_sub.argarray;
int off = AvARRAY(ary) - AvALLOC(ary);
tmps = "";
else
tmps = POPpx;
- sv_reset(tmps, PL_curcop->cop_stash);
+ sv_reset(tmps, CopSTASH(PL_curcop));
PUSHs(&PL_sv_yes);
RETURN;
}
PUSHSUB(cx);
CvDEPTH(cv)++;
(void)SvREFCNT_inc(cv);
- SAVESPTR(PL_curpad);
+ SAVEVPTR(PL_curpad);
PL_curpad = AvARRAY((AV*)*av_fetch(CvPADLIST(cv),1,FALSE));
RETURNOP(CvSTART(cv));
}
register PERL_CONTEXT *cx;
I32 gimme = GIMME_V;
SV **svp;
+ U32 cxtype = CXt_LOOP;
+#ifdef USE_ITHREADS
+ void *iterdata;
+#endif
ENTER;
SAVETMPS;
if (PL_op->op_targ) {
svp = &PL_curpad[PL_op->op_targ]; /* "my" variable */
SAVESPTR(*svp);
+#ifdef USE_ITHREADS
+ iterdata = (void*)PL_op->op_targ;
+ cxtype |= CXp_PADVAR;
+#endif
}
else {
- svp = &GvSV((GV*)POPs); /* symbol table variable */
+ GV *gv = (GV*)POPs;
+ svp = &GvSV(gv); /* symbol table variable */
SAVEGENERICSV(*svp);
*svp = NEWSV(0,0);
+#ifdef USE_ITHREADS
+ iterdata = (void*)gv;
+#endif
}
ENTER;
- PUSHBLOCK(cx, CXt_LOOP, SP);
+ PUSHBLOCK(cx, cxtype, SP);
+#ifdef USE_ITHREADS
+ PUSHLOOP(cx, iterdata, MARK);
+#else
PUSHLOOP(cx, svp, MARK);
+#endif
if (PL_op->op_flags & OPf_STACKED) {
cx->blk_loop.iterary = (AV*)SvREFCNT_inc(POPs);
if (SvTYPE(cx->blk_loop.iterary) != SVt_PVAV) {
dPOPss;
if (SvNIOKp(sv) || !SvPOKp(sv) ||
- (looks_like_number(sv) && *SvPVX(sv) != '0')) {
+ SvNIOKp(cx->blk_loop.iterary) || !SvPOKp(cx->blk_loop.iterary) ||
+ (looks_like_number(sv) && *SvPVX(sv) != '0' &&
+ looks_like_number((SV*)cx->blk_loop.iterary) &&
+ *SvPVX(cx->blk_loop.iterary) != '0'))
+ {
if (SvNV(sv) < IV_MIN ||
SvNV((SV*)cx->blk_loop.iterary) >= IV_MAX)
DIE(aTHX_ "Range iterator outside integer range");
{
djSP;
register PERL_CONTEXT *cx;
- struct block_loop cxloop;
I32 gimme;
SV **newsp;
PMOP *newpm;
POPBLOCK(cx,newpm);
mark = newsp;
- POPLOOP1(cx); /* Delay POPLOOP2 until stack values are safe */
+ newsp = PL_stack_base + cx->blk_loop.resetsp;
TAINT_NOT;
if (gimme == G_VOID)
SP = newsp;
PUTBACK;
- POPLOOP2(); /* Stack values are safe: release loop vars ... */
+ POPLOOP(cx); /* Stack values are safe: release loop vars ... */
PL_curpm = newpm; /* ... and pop $1 et al */
LEAVE;
djSP; dMARK;
I32 cxix;
register PERL_CONTEXT *cx;
- struct block_sub cxsub;
bool popsub2 = FALSE;
I32 gimme;
SV **newsp;
PMOP *newpm;
I32 optype = 0;
+ SV *sv;
if (PL_curstackinfo->si_type == PERLSI_SORT) {
- if (cxstack_ix == PL_sortcxix || dopoptosub(cxstack_ix) <= PL_sortcxix) {
+ if (cxstack_ix == PL_sortcxix
+ || dopoptosub(cxstack_ix) <= PL_sortcxix)
+ {
if (cxstack_ix > PL_sortcxix)
dounwind(PL_sortcxix);
AvARRAY(PL_curstack)[1] = *SP;
POPBLOCK(cx,newpm);
switch (CxTYPE(cx)) {
case CXt_SUB:
- POPSUB1(cx); /* Delay POPSUB2 until stack values are safe */
popsub2 = TRUE;
break;
case CXt_EVAL:
DIE(aTHX_ "%s did not return a true value", name);
}
break;
+ case CXt_FORMAT:
+ POPFORMAT(cx);
+ break;
default:
DIE(aTHX_ "panic: return");
}
if (gimme == G_SCALAR) {
if (MARK < SP) {
if (popsub2) {
- if (cxsub.cv && CvDEPTH(cxsub.cv) > 1) {
+ if (cx->blk_sub.cv && CvDEPTH(cx->blk_sub.cv) > 1) {
if (SvTEMP(TOPs)) {
*++newsp = SvREFCNT_inc(*SP);
FREETMPS;
/* Stack values are safe: */
if (popsub2) {
- POPSUB2(); /* release CV and @_ ... */
+ POPSUB(cx,sv); /* release CV and @_ ... */
}
+ else
+ sv = Nullsv;
PL_curpm = newpm; /* ... and pop $1 et al */
LEAVE;
+ LEAVESUB(sv);
return pop_return();
}
djSP;
I32 cxix;
register PERL_CONTEXT *cx;
- struct block_loop cxloop;
- struct block_sub cxsub;
I32 pop2 = 0;
I32 gimme;
I32 optype;
OP *nextop;
SV **newsp;
PMOP *newpm;
- SV **mark = PL_stack_base + cxstack[cxstack_ix].blk_oldsp;
+ SV **mark;
+ SV *sv = Nullsv;
if (PL_op->op_flags & OPf_SPECIAL) {
cxix = dopoptoloop(cxstack_ix);
if (cxix < 0)
- DIE(aTHX_ "Can't \"last\" outside a block");
+ DIE(aTHX_ "Can't \"last\" outside a loop block");
}
else {
cxix = dopoptolabel(cPVOP->op_pv);
dounwind(cxix);
POPBLOCK(cx,newpm);
+ mark = newsp;
switch (CxTYPE(cx)) {
case CXt_LOOP:
- POPLOOP1(cx); /* Delay POPLOOP2 until stack values are safe */
pop2 = CXt_LOOP;
- nextop = cxloop.last_op->op_next;
+ newsp = PL_stack_base + cx->blk_loop.resetsp;
+ nextop = cx->blk_loop.last_op->op_next;
break;
case CXt_SUB:
- POPSUB1(cx); /* Delay POPSUB2 until stack values are safe */
pop2 = CXt_SUB;
nextop = pop_return();
break;
POPEVAL(cx);
nextop = pop_return();
break;
+ case CXt_FORMAT:
+ POPFORMAT(cx);
+ nextop = pop_return();
+ break;
default:
DIE(aTHX_ "panic: last");
}
/* Stack values are safe: */
switch (pop2) {
case CXt_LOOP:
- POPLOOP2(); /* release loop vars ... */
+ POPLOOP(cx); /* release loop vars ... */
LEAVE;
break;
case CXt_SUB:
- POPSUB2(); /* release CV and @_ ... */
+ POPSUB(cx,sv); /* release CV and @_ ... */
break;
}
PL_curpm = newpm; /* ... and pop $1 et al */
LEAVE;
+ LEAVESUB(sv);
return nextop;
}
if (PL_op->op_flags & OPf_SPECIAL) {
cxix = dopoptoloop(cxstack_ix);
if (cxix < 0)
- DIE(aTHX_ "Can't \"next\" outside a block");
+ DIE(aTHX_ "Can't \"next\" outside a loop block");
}
else {
cxix = dopoptolabel(cPVOP->op_pv);
if (PL_op->op_flags & OPf_SPECIAL) {
cxix = dopoptoloop(cxstack_ix);
if (cxix < 0)
- DIE(aTHX_ "Can't \"redo\" outside a block");
+ DIE(aTHX_ "Can't \"redo\" outside a loop block");
}
else {
cxix = dopoptolabel(cPVOP->op_pv);
SP[1] = SP[0];
SP--;
}
- fp3 = (I32(*)(int,int,int)))CvXSUB(cv;
+ fp3 = (I32(*)(int,int,int))CvXSUB(cv);
items = (*fp3)(CvXSUBANY(cv).any_i32,
mark - PL_stack_base + 1,
items);
AV *newpad = newAV();
SV **oldpad = AvARRAY(svp[CvDEPTH(cv)-1]);
I32 ix = AvFILLp((AV*)svp[1]);
+ I32 names_fill = AvFILLp((AV*)svp[0]);
svp = AvARRAY(svp[0]);
for ( ;ix > 0; ix--) {
- if (svp[ix] != &PL_sv_undef) {
+ if (names_fill >= ix && svp[ix] != &PL_sv_undef) {
char *name = SvPVX(svp[ix]);
if ((SvFLAGS(svp[ix]) & SVf_FAKE)
|| *name == '&')
SvPADMY_on(sv);
}
}
+ else if (IS_PADGV(oldpad[ix]) || IS_PADCONST(oldpad[ix])) {
+ av_store(newpad, ix, sv = SvREFCNT_inc(oldpad[ix]));
+ }
else {
av_store(newpad, ix, sv = NEWSV(0,0));
SvPADTMP_on(sv);
}
}
#endif /* USE_THREADS */
- SAVESPTR(PL_curpad);
+ SAVEVPTR(PL_curpad);
PL_curpad = AvARRAY((AV*)svp[CvDEPTH(cv)]);
#ifndef USE_THREADS
if (cx->blk_sub.hasargs)
break;
}
/* FALL THROUGH */
+ case CXt_FORMAT:
case CXt_NULL:
- DIE(aTHX_ "Can't \"goto\" outside a block");
+ DIE(aTHX_ "Can't \"goto\" out of a pseudo block");
default:
if (ix)
DIE(aTHX_ "panic: goto");
anum = 0;
#endif
}
+ PL_exit_flags |= PERL_EXIT_EXPECTED;
my_exit(anum);
PUSHs(&PL_sv_undef);
RETURN;
dTHR;
int ret;
OP *oldop = PL_op;
+ volatile PERL_SI *cursi = PL_curstackinfo;
+ dJMPENV;
#ifdef DEBUGGING
assert(CATCH_GET == TRUE);
#endif
PL_op = o;
redo_body:
- CALLPROTECT(aTHX_ &ret, MEMBER_TO_FPTR(S_docatch_body));
+ CALLPROTECT(aTHX_ pcur_env, &ret, MEMBER_TO_FPTR(S_docatch_body));
switch (ret) {
case 0:
break;
case 3:
- if (PL_restartop) {
+ if (PL_restartop && cursi == PL_curstackinfo) {
PL_op = PL_restartop;
PL_restartop = 0;
goto redo_body;
/* switch to eval mode */
if (PL_curcop == &PL_compiling) {
- SAVESPTR(PL_compiling.cop_stash);
- PL_compiling.cop_stash = PL_curstash;
+ SAVECOPSTASH(&PL_compiling);
+ CopSTASH_set(&PL_compiling, PL_curstash);
}
- SAVESPTR(PL_compiling.cop_filegv);
- SAVEI16(PL_compiling.cop_line);
+ SAVECOPFILE(&PL_compiling);
+ SAVECOPLINE(&PL_compiling);
sprintf(tmpbuf, "_<(%.10s_eval %lu)", code, (unsigned long)++PL_evalseq);
- PL_compiling.cop_filegv = gv_fetchfile(tmpbuf+2);
- PL_compiling.cop_line = 1;
+ CopFILE_set(&PL_compiling, tmpbuf+2);
+ CopLINE_set(&PL_compiling, 1);
/* XXX For C<eval "...">s within BEGIN {} blocks, this ends up
deleting the eval's FILEGV from the stash before gv_check() runs
(i.e. before run-time proper). To work around the coredump that
#ifdef OP_IN_REGISTER
PL_opsave = op;
#else
- SAVEPPTR(PL_op);
+ SAVEVPTR(PL_op);
#endif
PL_hints = 0;
PL_op->op_type = OP_ENTEREVAL;
PL_op->op_flags = 0; /* Avoid uninit warning. */
PUSHBLOCK(cx, CXt_EVAL, SP);
- PUSHEVAL(cx, 0, PL_compiling.cop_filegv);
+ PUSHEVAL(cx, 0, Nullgv);
rop = doeval(G_SCALAR, startop);
POPBLOCK(cx,PL_curpm);
POPEVAL(cx);
{
dSP;
OP *saveop = PL_op;
- HV *newstash;
CV *caller;
AV* comppadlist;
I32 i;
/* set up a scratch pad */
SAVEI32(PL_padix);
- SAVESPTR(PL_curpad);
+ SAVEVPTR(PL_curpad);
SAVESPTR(PL_comppad);
SAVESPTR(PL_comppad_name);
SAVEI32(PL_comppad_name_fill);
PERL_CONTEXT *cx = &cxstack[i];
if (CxTYPE(cx) == CXt_EVAL)
break;
- else if (CxTYPE(cx) == CXt_SUB) {
+ else if (CxTYPE(cx) == CXt_SUB || CxTYPE(cx) == CXt_FORMAT) {
caller = cx->blk_sub.cv;
break;
}
/* make sure we compile in the right package */
- newstash = PL_curcop->cop_stash;
- if (PL_curstash != newstash) {
+ if (CopSTASH_ne(PL_curcop, PL_curstash)) {
SAVESPTR(PL_curstash);
- PL_curstash = newstash;
+ PL_curstash = CopSTASH(PL_curcop);
}
SAVESPTR(PL_beginav);
PL_beginav = newAV();
}
SvREFCNT_dec(PL_rs);
PL_rs = SvREFCNT_inc(PL_nrs);
- PL_compiling.cop_line = 0;
+ CopLINE_set(&PL_compiling, 0);
if (startop) {
*startop = PL_eval_root;
SvREFCNT_dec(CvOUTSIDE(PL_compcv));
if (cv) {
dSP;
PUSHMARK(SP);
- XPUSHs((SV*)PL_compiling.cop_filegv);
+ XPUSHs((SV*)CopFILEGV(&PL_compiling));
PUTBACK;
call_sv((SV*)cv, G_DISCARD);
}
SV *filter_sub = 0;
sv = POPs;
- if (SvNIOKp(sv) && !SvPOKp(sv)) {
- if (Atof(PL_patchlevel) + 0.00000999 < SvNV(sv))
- DIE(aTHX_ "Perl %s required--this is only version %s, stopped",
- SvPV(sv,n_a),PL_patchlevel);
+ if (SvNIOKp(sv)) {
+ UV rev, ver, sver;
+ if (SvPOKp(sv) && SvUTF8(sv)) { /* require v5.6.1 */
+ I32 len;
+ U8 *s = (U8*)SvPVX(sv);
+ U8 *end = (U8*)SvPVX(sv) + SvCUR(sv);
+ if (s < end) {
+ rev = utf8_to_uv(s, &len);
+ s += len;
+ if (s < end) {
+ ver = utf8_to_uv(s, &len);
+ s += len;
+ if (s < end)
+ sver = utf8_to_uv(s, &len);
+ else
+ sver = 0;
+ }
+ else
+ ver = 0;
+ }
+ else
+ rev = 0;
+ if (PERL_REVISION < rev
+ || (PERL_REVISION == rev
+ && (PERL_VERSION < ver
+ || (PERL_VERSION == ver
+ && PERL_SUBVERSION < sver))))
+ {
+ DIE(aTHX_ "Perl v%"UVuf".%"UVuf".%"UVuf" required--this is only version "
+ "v%"UVuf".%"UVuf".%"UVuf", stopped", rev, ver, sver, PERL_REVISION,
+ PERL_VERSION, PERL_SUBVERSION);
+ }
+ }
+ else if (!SvPOKp(sv)) { /* require 5.005_03 */
+ NV n = SvNV(sv);
+ rev = (UV)n;
+ ver = (UV)((n-rev)*1000);
+ sver = (UV)((((n-rev)*1000 - ver) + 0.0009) * 1000);
+
+ if ((NV)PERL_REVISION + ((NV)PERL_VERSION/(NV)1000)
+ + ((NV)PERL_SUBVERSION/(NV)1000000)
+ + 0.00000099 < SvNV(sv))
+ {
+ DIE(aTHX_ "Perl v%"UVuf".%"UVuf".%"UVuf" required--this is only version "
+ "v%"UVuf".%"UVuf".%"UVuf", stopped", rev, ver, sver, PERL_REVISION,
+ PERL_VERSION, PERL_SUBVERSION);
+ }
+ }
RETPUSHYES;
}
name = SvPV(sv, len);
/* prepare to compile file */
- if (*name == '/' ||
- (*name == '.' &&
- (name[1] == '/' ||
- (name[1] == '.' && name[2] == '/')))
-#ifdef DOSISH
- || (name[0] && name[1] == ':')
-#endif
-#ifdef WIN32
- || (name[0] == '\\' && name[1] == '\\') /* UNC path */
-#endif
-#ifdef VMS
- || (strchr(name,':') || ((*name == '[' || *name == '<') &&
- (isALNUM(name[1]) || strchr("$-_]>",name[1]))))
-#endif
- )
+ if (PERL_FILE_IS_ABSOLUTE(name)
+ || (*name == '.' && (name[1] == '/' ||
+ (name[1] == '.' && name[2] == '/'))))
{
tryname = name;
tryrsfp = doopen_pmc(name,PERL_SCRIPT_MODE);
loader = *av_fetch((AV *)SvRV(loader), 0, TRUE);
}
- Perl_sv_setpvf(aTHX_ namesv, "/loader/0x%lx/%s",
- SvANY(loader), name);
+ Perl_sv_setpvf(aTHX_ namesv, "/loader/0x%"UVxf"/%s",
+ PTR2UV(SvANY(loader)), name);
tryname = SvPVX(namesv);
tryrsfp = 0;
}
}
}
- SAVESPTR(PL_compiling.cop_filegv);
- PL_compiling.cop_filegv = gv_fetchfile(tryrsfp ? tryname : name);
+ SAVECOPFILE(&PL_compiling);
+ CopFILE_set(&PL_compiling, tryrsfp ? tryname : name);
SvREFCNT_dec(namesv);
if (!tryrsfp) {
if (PL_op->op_type == OP_REQUIRE) {
/* Assume success here to prevent recursive requirement. */
(void)hv_store(GvHVn(PL_incgv), name, strlen(name),
- newSVsv(GvSV(PL_compiling.cop_filegv)), 0 );
+ newSVpv(CopFILE(&PL_compiling), 0), 0 );
ENTER;
SAVETMPS;
PL_rsfp_filters = Nullav;
PL_rsfp = tryrsfp;
- name = savepv(name);
- SAVEFREEPV(name);
SAVEHINTS();
PL_hints = 0;
- SAVEPPTR(PL_compiling.cop_warnings);
+ SAVESPTR(PL_compiling.cop_warnings);
if (PL_dowarn & G_WARN_ALL_ON)
PL_compiling.cop_warnings = WARN_ALL ;
else if (PL_dowarn & G_WARN_ALL_OFF)
/* switch to eval mode */
push_return(PL_op->op_next);
PUSHBLOCK(cx, CXt_EVAL, SP);
- PUSHEVAL(cx, name, PL_compiling.cop_filegv);
+ PUSHEVAL(cx, name, Nullgv);
- SAVEI16(PL_compiling.cop_line);
- PL_compiling.cop_line = 0;
+ SAVECOPLINE(&PL_compiling);
+ CopLINE_set(&PL_compiling, 0);
PUTBACK;
#ifdef USE_THREADS
/* switch to eval mode */
- SAVESPTR(PL_compiling.cop_filegv);
+ SAVECOPFILE(&PL_compiling);
sprintf(tmpbuf, "_<(eval %lu)", (unsigned long)++PL_evalseq);
- PL_compiling.cop_filegv = gv_fetchfile(tmpbuf+2);
- PL_compiling.cop_line = 1;
+ CopFILE_set(&PL_compiling, tmpbuf+2);
+ CopLINE_set(&PL_compiling, 1);
/* XXX For C<eval "...">s within BEGIN {} blocks, this ends up
deleting the eval's FILEGV from the stash before gv_check() runs
(i.e. before run-time proper). To work around the coredump that
SAVEDELETE(PL_defstash, safestr, strlen(safestr));
SAVEHINTS();
PL_hints = PL_op->op_targ;
- SAVEPPTR(PL_compiling.cop_warnings);
+ SAVESPTR(PL_compiling.cop_warnings);
if (!specialWARN(PL_compiling.cop_warnings)) {
PL_compiling.cop_warnings = newSVsv(PL_compiling.cop_warnings) ;
SAVEFREESV(PL_compiling.cop_warnings) ;
push_return(PL_op->op_next);
PUSHBLOCK(cx, (CXt_EVAL|CXp_REAL), SP);
- PUSHEVAL(cx, 0, PL_compiling.cop_filegv);
+ PUSHEVAL(cx, 0, Nullgv);
/* prepare to compile string */
if (PERLDB_LINE && PL_curstash != PL_debstash)
- save_lines(GvAV(PL_compiling.cop_filegv), PL_linestr);
+ save_lines(CopFILEAV(&PL_compiling), PL_linestr);
PUTBACK;
#ifdef USE_THREADS
MUTEX_LOCK(&PL_eval_mutex);
MEXTEND(mark,0);
*MARK = &PL_sv_undef;
}
+ SP = MARK;
}
else {
/* in case LEAVE wipes old return values */
#ifdef PERL_OBJECT
-#define NO_XSLOCKS
#undef this
#define this pPerl
#include "XSUB.h"
return result;
}
+static I32
+sortcv_stacked(pTHXo_ SV *a, SV *b)
+{
+ dTHR;
+ I32 oldsaveix = PL_savestack_ix;
+ I32 oldscopeix = PL_scopestack_ix;
+ I32 result;
+ AV *av;
+
+#ifdef USE_THREADS
+ av = (AV*)PL_curpad[0];
+#else
+ av = GvAV(PL_defgv);
+#endif
+
+ if (AvMAX(av) < 1) {
+ SV** ary = AvALLOC(av);
+ if (AvARRAY(av) != ary) {
+ AvMAX(av) += AvARRAY(av) - AvALLOC(av);
+ SvPVX(av) = (char*)ary;
+ }
+ if (AvMAX(av) < 1) {
+ AvMAX(av) = 1;
+ Renew(ary,2,SV*);
+ SvPVX(av) = (char*)ary;
+ }
+ }
+ AvFILLp(av) = 1;
+
+ AvARRAY(av)[0] = a;
+ AvARRAY(av)[1] = b;
+ PL_stack_sp = PL_stack_base;
+ PL_op = PL_sortcop;
+ CALLRUNOPS(aTHX);
+ if (PL_stack_sp != PL_stack_base + 1)
+ Perl_croak(aTHX_ "Sort subroutine didn't return single value");
+ if (!SvNIOKp(*PL_stack_sp))
+ Perl_croak(aTHX_ "Sort subroutine didn't return a numeric value");
+ result = SvIV(*PL_stack_sp);
+ while (PL_scopestack_ix > oldscopeix) {
+ LEAVE;
+ }
+ leave_scope(oldsaveix);
+ return result;
+}
+
+static I32
+sortcv_xsub(pTHXo_ SV *a, SV *b)
+{
+ dSP;
+ I32 oldsaveix = PL_savestack_ix;
+ I32 oldscopeix = PL_scopestack_ix;
+ I32 result;
+ CV *cv=(CV*)PL_sortcop;
+
+ SP = PL_stack_base;
+ PUSHMARK(SP);
+ EXTEND(SP, 2);
+ *++SP = a;
+ *++SP = b;
+ PUTBACK;
+ (void)(*CvXSUB(cv))(aTHXo_ cv);
+ if (PL_stack_sp != PL_stack_base + 1)
+ Perl_croak(aTHX_ "Sort subroutine didn't return single value");
+ if (!SvNIOKp(*PL_stack_sp))
+ Perl_croak(aTHX_ "Sort subroutine didn't return a numeric value");
+ result = SvIV(*PL_stack_sp);
+ while (PL_scopestack_ix > oldscopeix) {
+ LEAVE;
+ }
+ leave_scope(oldsaveix);
+ return result;
+}
+
static I32
sv_ncmp(pTHXo_ SV *a, SV *b)
#include <sys/file.h>
#endif
-#define HOP(pos,off) (IN_UTF8 ? utf8_hop(pos, off) : (pos + off))
/* Hot code. */
PP(pp_const)
{
djSP;
- XPUSHs(cSVOP->op_sv);
+ XPUSHs(cSVOP_sv);
RETURN;
}
djSP;
EXTEND(SP,1);
if (PL_op->op_private & OPpLVAL_INTRO)
- PUSHs(save_scalar(cGVOP->op_gv));
+ PUSHs(save_scalar(cGVOP_gv));
else
- PUSHs(GvSV(cGVOP->op_gv));
+ PUSHs(GvSV(cGVOP_gv));
RETURN;
}
PP(pp_gv)
{
djSP;
- XPUSHs((SV*)cGVOP->op_gv);
+ XPUSHs((SV*)cGVOP_gv);
RETURN;
}
dPOPTOPssrl;
STRLEN len;
char *s;
+
if (TARG != left) {
s = SvPV(left,len);
+ if (TARG == right) {
+ sv_insert(TARG, 0, 0, s, len);
+ SETs(TARG);
+ RETURN;
+ }
sv_setpvn(TARG,s,len);
}
else if (SvGMAGICAL(TARG))
PP(pp_aelemfast)
{
djSP;
- AV *av = GvAV((GV*)cSVOP->op_sv);
+ AV *av = GvAV(cGVOP_gv);
U32 lval = PL_op->op_flags & OPf_MOD;
SV** svp = av_fetch(av, PL_op->op_private, lval);
SV *sv = (svp ? *svp : &PL_sv_undef);
SvPV(sv,n_a));
else if (ckWARN(WARN_CLOSED))
Perl_warner(aTHX_ WARN_CLOSED,
- "print on closed filehandle %s", SvPV(sv,n_a));
+ "print() on closed filehandle %s", SvPV(sv,n_a));
}
SETERRNO(EBADF,IoIFP(io)?RMS$_FAC:RMS$_IFI);
goto just_say_no;
PL_op->op_private & HINT_STRICT_REFS)
DIE(aTHX_ PL_no_usym, "an ARRAY");
if (ckWARN(WARN_UNINITIALIZED))
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
if (GIMME == G_ARRAY) {
(void)POPs;
RETURN;
PL_op->op_private & HINT_STRICT_REFS)
DIE(aTHX_ PL_no_usym, "a HASH");
if (ckWARN(WARN_UNINITIALIZED))
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
if (GIMME == G_ARRAY) {
SP--;
RETURN;
dTARGET;
if (SvTYPE(hv) == SVt_PVAV)
hv = avhv_keys((AV*)hv);
-#ifdef IV_IS_QUAD
- if (HvFILL(hv))
- Perl_sv_setpvf(aTHX_ TARG, "%" PERL_PRId64 "/%" PERL_PRId64,
- (Quad_t)HvFILL(hv), (Quad_t)HvMAX(hv) + 1);
-#else
if (HvFILL(hv))
- Perl_sv_setpvf(aTHX_ TARG, "%ld/%ld",
- (long)HvFILL(hv), (long)HvMAX(hv) + 1);
-#endif
+ Perl_sv_setpvf(aTHX_ TARG, "%"IVdf"/%"IVdf,
+ (IV)HvFILL(hv), (IV)HvMAX(hv) + 1);
else
sv_setiv(TARG, 0);
if (!fp) {
if (IoFLAGS(io) & IOf_ARGV) {
if (IoFLAGS(io) & IOf_START) {
- IoFLAGS(io) &= ~IOf_START;
IoLINES(io) = 0;
if (av_len(GvAVn(PL_last_in_gv)) < 0) {
+ IoFLAGS(io) &= ~IOf_START;
do_open(PL_last_in_gv,"-",1,FALSE,O_RDONLY,0,Nullfp);
sv_setpvn(GvSV(PL_last_in_gv), "-", 1);
SvSETMAGIC(GvSV(PL_last_in_gv));
fp = nextargv(PL_last_in_gv);
if (!fp) { /* Note: fp != IoIFP(io) */
(void)do_close(PL_last_in_gv, FALSE); /* now it does*/
- IoFLAGS(io) |= IOf_START;
}
}
else if (type == OP_GLOB) {
}
}
#else /* !VMS */
+#ifdef MACOS_TRADITIONAL
+ sv_setpv(tmpcmd, "glob ");
+ sv_catsv(tmpcmd, tmpglob);
+ sv_catpv(tmpcmd, " |");
+#else
#ifdef DOSISH
#ifdef OS2
sv_setpv(tmpcmd, "for a in ");
#endif
#endif /* !CSH */
#endif /* !DOSISH */
+#endif /* MACOS_TRADITIONAL */
(void)do_open(PL_last_in_gv, SvPVX(tmpcmd), SvCUR(tmpcmd),
FALSE, O_RDONLY, 0, Nullfp);
fp = IoIFP(io);
SV* sv = sv_newmortal();
gv_efullname3(sv, PL_last_in_gv, Nullch);
Perl_warner(aTHX_ WARN_CLOSED,
- "Read on closed filehandle %s",
+ "readline() on closed filehandle %s",
SvPV_nolen(sv));
}
}
offset = 0;
}
-/* flip-flop EOF state for a snarfed empty file */
+/* delay EOF state for a snarfed empty file */
#define SNARF_EOF(gimme,rs,io,sv) \
- ((gimme != G_SCALAR || SvCUR(sv) \
- || (IoFLAGS(io) & IOf_NOLINE) || IoLINES(io) || !RsSNARF(rs)) \
- ? ((IoFLAGS(io) &= ~IOf_NOLINE), TRUE) \
- : ((IoFLAGS(io) |= IOf_NOLINE), FALSE))
+ (gimme != G_SCALAR || SvCUR(sv) \
+ || !RsSNARF(rs) || (IoFLAGS(io) & IOf_NOLINE) \
+ || ((IoFLAGS(io) |= IOf_NOLINE), FALSE))
for (;;) {
if (!sv_gets(sv, fp, offset)
if (fp)
continue;
(void)do_close(PL_last_in_gv, FALSE);
- IoFLAGS(io) |= IOf_START;
}
else if (type == OP_GLOB) {
if (!do_close(PL_last_in_gv, FALSE) && ckWARN(WARN_CLOSED)) {
register PERL_CONTEXT *cx;
SV* sv;
AV* av;
+ SV **itersvp;
EXTEND(SP, 1);
cx = &cxstack[cxstack_ix];
if (CxTYPE(cx) != CXt_LOOP)
DIE(aTHX_ "panic: pp_iter");
+ itersvp = CxITERVAR(cx);
av = cx->blk_loop.iterary;
if (SvTYPE(av) != SVt_PVAV) {
/* iterate ($min .. $max) */
char *max = SvPV((SV*)av, maxlen);
if (!SvNIOK(cur) && SvCUR(cur) <= maxlen) {
#ifndef USE_THREADS /* don't risk potential race */
- if (SvREFCNT(*cx->blk_loop.itervar) == 1
- && !SvMAGICAL(*cx->blk_loop.itervar))
- {
+ if (SvREFCNT(*itersvp) == 1 && !SvMAGICAL(*itersvp)) {
/* safe to reuse old SV */
- sv_setsv(*cx->blk_loop.itervar, cur);
+ sv_setsv(*itersvp, cur);
}
else
#endif
/* we need a fresh SV every time so that loop body sees a
* completely new SV for closures/references to work as
* they used to */
- SvREFCNT_dec(*cx->blk_loop.itervar);
- *cx->blk_loop.itervar = newSVsv(cur);
+ SvREFCNT_dec(*itersvp);
+ *itersvp = newSVsv(cur);
}
if (strEQ(SvPVX(cur), max))
sv_setiv(cur, 0); /* terminate next time */
RETPUSHNO;
#ifndef USE_THREADS /* don't risk potential race */
- if (SvREFCNT(*cx->blk_loop.itervar) == 1
- && !SvMAGICAL(*cx->blk_loop.itervar))
- {
+ if (SvREFCNT(*itersvp) == 1 && !SvMAGICAL(*itersvp)) {
/* safe to reuse old SV */
- sv_setiv(*cx->blk_loop.itervar, cx->blk_loop.iterix++);
+ sv_setiv(*itersvp, cx->blk_loop.iterix++);
}
else
#endif
/* we need a fresh SV every time so that loop body sees a
* completely new SV for closures/references to work as they
* used to */
- SvREFCNT_dec(*cx->blk_loop.itervar);
- *cx->blk_loop.itervar = newSViv(cx->blk_loop.iterix++);
+ SvREFCNT_dec(*itersvp);
+ *itersvp = newSViv(cx->blk_loop.iterix++);
}
RETPUSHYES;
}
if (cx->blk_loop.iterix >= (av == PL_curstack ? cx->blk_oldsp : AvFILL(av)))
RETPUSHNO;
- SvREFCNT_dec(*cx->blk_loop.itervar);
+ SvREFCNT_dec(*itersvp);
if (sv = (SvMAGICAL(av))
? *av_fetch(av, ++cx->blk_loop.iterix, FALSE)
sv = (SV*)lv;
}
- *cx->blk_loop.itervar = SvREFCNT_inc(sv);
+ *itersvp = SvREFCNT_inc(sv);
RETPUSHYES;
}
SV *src;
ENTER; /* enter inner scope */
- SAVESPTR(PL_curpm);
+ SAVEVPTR(PL_curpm);
src = PL_stack_base[*PL_markstack_ptr];
SvTEMP_off(src);
PMOP *newpm;
I32 gimme;
register PERL_CONTEXT *cx;
- struct block_sub cxsub;
+ SV *sv;
POPBLOCK(cx,newpm);
- POPSUB1(cx); /* Delay POPSUB2 until stack values are safe */
TAINT_NOT;
if (gimme == G_SCALAR) {
MARK = newsp + 1;
if (MARK <= SP) {
- if (cxsub.cv && CvDEPTH(cxsub.cv) > 1) {
+ if (cx->blk_sub.cv && CvDEPTH(cx->blk_sub.cv) > 1) {
if (SvTEMP(TOPs)) {
*MARK = SvREFCNT_inc(TOPs);
FREETMPS;
}
PUTBACK;
- POPSUB2(); /* Stack values are safe: release CV and @_ ... */
+ POPSUB(cx,sv); /* Stack values are safe: release CV and @_ ... */
PL_curpm = newpm; /* ... and pop $1 et al */
LEAVE;
+ LEAVESUB(sv);
return pop_return();
}
PMOP *newpm;
I32 gimme;
register PERL_CONTEXT *cx;
- struct block_sub cxsub;
+ SV *sv;
POPBLOCK(cx,newpm);
- POPSUB1(cx); /* Delay POPSUB2 until stack values are safe */
TAINT_NOT;
if (gimme == G_SCALAR)
goto temporise;
if (gimme == G_ARRAY) {
- if (!CvLVALUE(cxsub.cv))
+ if (!CvLVALUE(cx->blk_sub.cv))
goto temporise_array;
EXTEND_MORTAL(SP - newsp);
for (mark = newsp + 1; mark <= SP; mark++) {
else {
/* Can be a localized value subject to deletion. */
PL_tmps_stack[++PL_tmps_ix] = *mark;
- SvREFCNT_inc(*mark);
+ (void)SvREFCNT_inc(*mark);
}
}
}
/* Here we go for robustness, not for speed, so we change all
* the refcounts so the caller gets a live guy. Cannot set
* TEMP, so sv_2mortal is out of question. */
- if (!CvLVALUE(cxsub.cv)) {
- POPSUB2();
+ if (!CvLVALUE(cx->blk_sub.cv)) {
+ POPSUB(cx,sv);
PL_curpm = newpm;
+ LEAVE;
+ LEAVESUB(sv);
DIE(aTHX_ "Can't modify non-lvalue subroutine call");
}
if (gimme == G_SCALAR) {
EXTEND_MORTAL(1);
if (MARK == SP) {
if (SvFLAGS(TOPs) & (SVs_TEMP | SVs_PADTMP | SVf_READONLY)) {
- POPSUB2();
+ POPSUB(cx,sv);
PL_curpm = newpm;
+ LEAVE;
+ LEAVESUB(sv);
DIE(aTHX_ "Can't return a %s from lvalue subroutine",
SvREADONLY(TOPs) ? "readonly value" : "temporary");
}
else { /* Can be a localized value
* subject to deletion. */
PL_tmps_stack[++PL_tmps_ix] = *mark;
- SvREFCNT_inc(*mark);
+ (void)SvREFCNT_inc(*mark);
}
}
else { /* Should not happen? */
- POPSUB2();
+ POPSUB(cx,sv);
PL_curpm = newpm;
+ LEAVE;
+ LEAVESUB(sv);
DIE(aTHX_ "%s returned from lvalue subroutine in scalar context",
(MARK > SP ? "Empty array" : "Array"));
}
if (SvFLAGS(*mark) & (SVs_TEMP | SVs_PADTMP | SVf_READONLY)) {
/* Might be flattened array after $#array = */
PUTBACK;
- POPSUB2();
+ POPSUB(cx,sv);
PL_curpm = newpm;
+ LEAVE;
+ LEAVESUB(sv);
DIE(aTHX_ "Can't return %s from lvalue subroutine",
(*mark != &PL_sv_undef)
? (SvREADONLY(TOPs)
mortalize:
/* Can be a localized value subject to deletion. */
PL_tmps_stack[++PL_tmps_ix] = *mark;
- SvREFCNT_inc(*mark);
+ (void)SvREFCNT_inc(*mark);
}
}
}
temporise:
MARK = newsp + 1;
if (MARK <= SP) {
- if (cxsub.cv && CvDEPTH(cxsub.cv) > 1) {
+ if (cx->blk_sub.cv && CvDEPTH(cx->blk_sub.cv) > 1) {
if (SvTEMP(TOPs)) {
*MARK = SvREFCNT_inc(TOPs);
FREETMPS;
}
PUTBACK;
- POPSUB2(); /* Stack values are safe: release CV and @_ ... */
+ POPSUB(cx,sv); /* Stack values are safe: release CV and @_ ... */
PL_curpm = newpm; /* ... and pop $1 et al */
LEAVE;
+ LEAVESUB(sv);
return pop_return();
}
while (MgOWNER(mg))
COND_WAIT(MgOWNERCONDP(mg), MgMUTEXP(mg));
MgOWNER(mg) = thr;
- DEBUG_S(PerlIO_printf(PerlIO_stderr(), "%p: pp_entersub lock %p\n",
+ DEBUG_S(PerlIO_printf(Perl_debug_log, "%p: pp_entersub lock %p\n",
thr, sv);)
MUTEX_UNLOCK(MgMUTEXP(mg));
- SAVEDESTRUCTOR(Perl_unlock_condpair, sv);
+ SAVEDESTRUCTOR_X(Perl_unlock_condpair, sv);
}
MUTEX_LOCK(CvMUTEXP(cv));
}
/* We already have a clone to use */
MUTEX_UNLOCK(CvMUTEXP(cv));
cv = *(CV**)svp;
- DEBUG_S(PerlIO_printf(PerlIO_stderr(),
+ DEBUG_S(PerlIO_printf(Perl_debug_log,
"entersub: %p already has clone %p:%s\n",
thr, cv, SvPEEK((SV*)cv)));
CvOWNER(cv) = thr;
SvREFCNT_inc(cv);
if (CvDEPTH(cv) == 0)
- SAVEDESTRUCTOR(unset_cvowner, (void*) cv);
+ SAVEDESTRUCTOR_X(unset_cvowner, (void*) cv);
}
else {
/* (2) => grab ownership of cv. (3) => make clone */
CvOWNER(cv) = thr;
SvREFCNT_inc(cv);
MUTEX_UNLOCK(CvMUTEXP(cv));
- DEBUG_S(PerlIO_printf(PerlIO_stderr(),
+ DEBUG_S(PerlIO_printf(Perl_debug_log,
"entersub: %p grabbing %p:%s in stash %s\n",
thr, cv, SvPEEK((SV*)cv), CvSTASH(cv) ?
HvNAME(CvSTASH(cv)) : "(none)"));
CV *clonecv;
SvREFCNT_inc(cv); /* don't let it vanish from under us */
MUTEX_UNLOCK(CvMUTEXP(cv));
- DEBUG_S((PerlIO_printf(PerlIO_stderr(),
+ DEBUG_S((PerlIO_printf(Perl_debug_log,
"entersub: %p cloning %p:%s\n",
thr, cv, SvPEEK((SV*)cv))));
/*
SvREFCNT_inc(cv);
}
DEBUG_S(if (CvDEPTH(cv) != 0)
- PerlIO_printf(PerlIO_stderr(), "depth %ld != 0\n",
+ PerlIO_printf(Perl_debug_log, "depth %ld != 0\n",
CvDEPTH(cv)););
- SAVEDESTRUCTOR(unset_cvowner, (void*) cv);
+ SAVEDESTRUCTOR_X(unset_cvowner, (void*) cv);
}
}
#endif /* USE_THREADS */
SP--;
}
PL_stack_sp = mark + 1;
- fp3 = (I32(*)(int,int,int)))CvXSUB(cv;
+ fp3 = (I32(*)(int,int,int))CvXSUB(cv);
items = (*fp3)(CvXSUBANY(cv).any_i32,
MARK - PL_stack_base + 1,
items);
}
/* We assume first XSUB in &DB::sub is the called one. */
if (PL_curcopdb) {
- SAVESPTR(PL_curcop);
+ SAVEVPTR(PL_curcop);
PL_curcop = PL_curcopdb;
PL_curcopdb = NULL;
}
if (CvDEPTH(cv) < 2)
(void)SvREFCNT_inc(cv);
else { /* save temporaries on recursion? */
+ PERL_STACK_OVERFLOW_CHECK();
if (CvDEPTH(cv) > AvFILLp(padlist)) {
AV *av;
AV *newpad = newAV();
SV **oldpad = AvARRAY(svp[CvDEPTH(cv)-1]);
I32 ix = AvFILLp((AV*)svp[1]);
+ I32 names_fill = AvFILLp((AV*)svp[0]);
svp = AvARRAY(svp[0]);
for ( ;ix > 0; ix--) {
- if (svp[ix] != &PL_sv_undef) {
+ if (names_fill >= ix && svp[ix] != &PL_sv_undef) {
char *name = SvPVX(svp[ix]);
if ((SvFLAGS(svp[ix]) & SVf_FAKE) /* outer lexical? */
|| *name == '&') /* anonymous code? */
SvPADMY_on(sv);
}
}
+ else if (IS_PADGV(oldpad[ix]) || IS_PADCONST(oldpad[ix])) {
+ av_store(newpad, ix, sv = SvREFCNT_inc(oldpad[ix]));
+ }
else {
av_store(newpad, ix, sv = NEWSV(0,0));
SvPADTMP_on(sv);
}
}
#endif /* USE_THREADS */
- SAVESPTR(PL_curpad);
+ SAVEVPTR(PL_curpad);
PL_curpad = AvARRAY((AV*)svp[CvDEPTH(cv)]);
#ifndef USE_THREADS
if (hasargs)
SV** ary;
#if 0
- DEBUG_S(PerlIO_printf(PerlIO_stderr(),
+ DEBUG_S(PerlIO_printf(Perl_debug_log,
"%p entersub preparing @_\n", thr));
#endif
av = (AV*)PL_curpad[0];
- assert(!AvREAL(av));
+ if (AvREAL(av)) {
+ /* @_ is normally not REAL--this should only ever
+ * happen when DB::sub() calls things that modify @_ */
+ av_clear(av);
+ AvREAL_off(av);
+ AvREIFY_on(av);
+ }
#ifndef USE_THREADS
cx->blk_sub.savearray = GvAV(PL_defgv);
GvAV(PL_defgv) = (AV*)SvREFCNT_inc(av);
&& !(PERLDB_SUB && cv == GvCV(PL_DBsub)))
sub_crush_depth(cv);
#if 0
- DEBUG_S(PerlIO_printf(PerlIO_stderr(),
+ DEBUG_S(PerlIO_printf(Perl_debug_log,
"%p entersub returning %p\n", thr, CvSTART(cv)));
#endif
RETURNOP(CvSTART(cv));
sep = p, leaf = p + 2;
}
if (!sep || ((sep - name) == 5 && strnEQ(name, "SUPER", 5))) {
- packname = HvNAME(sep ? PL_curcop->cop_stash : stash);
+ packname = sep ? CopSTASHPV(PL_curcop) : HvNAME(stash);
packlen = strlen(packname);
}
else {
dTHR;
#endif /* DEBUGGING */
- DEBUG_S((PerlIO_printf(PerlIO_stderr(), "%p unsetting CvOWNER of %p:%s\n",
+ DEBUG_S((PerlIO_printf(Perl_debug_log, "%p unsetting CvOWNER of %p:%s\n",
thr, cv, SvPEEK((SV*)cv))));
MUTEX_LOCK(CvMUTEXP(cv));
DEBUG_S(if (CvDEPTH(cv) != 0)
- PerlIO_printf(PerlIO_stderr(), "depth %ld != 0\n",
+ PerlIO_printf(Perl_debug_log, "depth %ld != 0\n",
CvDEPTH(cv)););
assert(thr == CvOWNER(cv));
CvOWNER(cv) = 0;
Gid_t egid = getegid();
int res;
- MUTEX_LOCK(&PL_cred_mutex);
+ LOCK_CRED_MUTEX;
#if !defined(HAS_SETREUID) && !defined(HAS_SETRESUID)
Perl_croak(aTHX_ "switching effective uid is not implemented");
#else
#endif
#endif
Perl_croak(aTHX_ "leaving effective gid failed");
- MUTEX_UNLOCK(&PL_cred_mutex);
+ UNLOCK_CRED_MUTEX;
return res;
}
PP(pp_rcatline)
{
- PL_last_in_gv = cGVOP->op_gv;
+ PL_last_in_gv = cGVOP_gv;
return do_readline();
}
HV *stash = SvSTASH(SvRV(error));
GV *gv = gv_fetchmethod(stash, "PROPAGATE");
if (gv) {
- SV *file = sv_2mortal(newSVsv(GvSV(PL_curcop->cop_filegv)));
- SV *line = sv_2mortal(newSViv(PL_curcop->cop_line));
+ SV *file = sv_2mortal(newSVpv(CopFILE(PL_curcop),0));
+ SV *line = sv_2mortal(newSViv(CopLINE(PL_curcop)));
EXTEND(SP, 3);
PUSHMARK(SP);
PUSHs(error);
if (GvIOp(gv))
IoFLAGS(GvIOp(gv)) &= ~IOf_UNTAINT;
-#if 0 /* no undef means tmpfile() yet */
- if (sv == &PL_sv_undef) {
-#ifdef PerlIO
- PerlIO *fp = PerlIO_tmpfile();
-#else
- PerlIO *fp = tmpfile();
-#endif
- if (fp != Nullfp && do_open(gv, "+>&", 3, FALSE, 0, 0, fp))
- PUSHi( (I32)PL_forkprocess );
- else
- RETPUSHUNDEF;
- RETURN;
- }
-#endif /* no undef means tmpfile() yet */
-
-
if (mg = SvTIED_mg((SV*)gv, 'q')) {
PUSHMARK(SP);
XPUSHs(SvTIED_obj((SV*)gv, mg));
if (ckWARN(WARN_UNTIE)) {
MAGIC * mg ;
if (mg = SvTIED_mg(sv, how)) {
-#ifdef IV_IS_QUAD
if (mg && SvREFCNT(SvRV(mg->mg_obj)) > 1)
Perl_warner(aTHX_ WARN_UNTIE,
- "untie attempted while %" PERL_PRIu64 " inner references still exist",
+ "untie attempted while %"UVuf" inner references still exist",
(UV)SvREFCNT(SvRV(mg->mg_obj)) - 1 ) ;
-#else
- if (mg && SvREFCNT(SvRV(mg->mg_obj)) > 1)
- Perl_warner(aTHX_ WARN_UNTIE,
- "untie attempted while %lu inner references still exist",
- (unsigned long)SvREFCNT(SvRV(mg->mg_obj)) - 1 ) ;
-#endif
}
}
gv = PL_stdingv;
else
gv = (GV*)POPs;
- if (!gv)
- gv = PL_argvgv;
if (mg = SvTIED_mg((SV*)gv, 'q')) {
I32 gimme = GIMME_V;
SAVETMPS;
push_return(retop);
- PUSHBLOCK(cx, CXt_SUB, PL_stack_sp);
+ PUSHBLOCK(cx, CXt_FORMAT, PL_stack_sp);
PUSHFORMAT(cx);
- SAVESPTR(PL_curpad);
+ SAVEVPTR(PL_curpad);
PL_curpad = AvARRAY((AV*)svp[1]);
setdefout(gv); /* locally select filehandle so $% et al work */
SvPV_nolen(sv));
else if (ckWARN(WARN_CLOSED))
Perl_warner(aTHX_ WARN_CLOSED,
- "Write on closed filehandle %s", SvPV_nolen(sv));
+ "write() on closed filehandle %s", SvPV_nolen(sv));
}
PUSHs(&PL_sv_no);
}
SvPV(sv,n_a));
else if (ckWARN(WARN_CLOSED))
Perl_warner(aTHX_ WARN_CLOSED,
- "printf on closed filehandle %s", SvPV(sv,n_a));
+ "printf() on closed filehandle %s", SvPV(sv,n_a));
}
SETERRNO(EBADF,IoIFP(io)?RMS$_FAC:RMS$_IFI);
goto just_say_no;
djSP; dMARK; dORIGMARK; dTARGET;
GV *gv;
IO *io;
- int offset;
+ Off_t offset;
SV *bufsv;
char *buffer;
- int length;
+ Off_t length;
STRLEN blen;
MAGIC *mg;
goto say_undef;
bufsv = *++MARK;
buffer = SvPV(bufsv, blen);
+#if Off_t_SIZE > IVSIZE
+ length = SvNVx(*++MARK);
+#else
length = SvIVx(*++MARK);
+#endif
if (length < 0)
DIE(aTHX_ "Negative length");
SETERRNO(0,0);
length = -1;
if (ckWARN(WARN_CLOSED)) {
if (PL_op->op_type == OP_SYSWRITE)
- Perl_warner(aTHX_ WARN_CLOSED, "Syswrite on closed filehandle");
+ Perl_warner(aTHX_ WARN_CLOSED, "syswrite() on closed filehandle");
else
- Perl_warner(aTHX_ WARN_CLOSED, "Send on closed socket");
+ Perl_warner(aTHX_ WARN_CLOSED, "send() on closed socket");
}
}
else if (PL_op->op_type == OP_SYSWRITE) {
if (MARK < SP) {
+#if Off_t_SIZE > IVSIZE
+ offset = SvNVx(*++MARK);
+#else
offset = SvIVx(*++MARK);
+#endif
if (offset < 0) {
if (-offset > blen)
DIE(aTHX_ "Offset outside string");
GV *gv;
MAGIC *mg;
- if (MAXARG <= 0)
- gv = PL_last_in_gv;
+ if (MAXARG <= 0) {
+ if (PL_op->op_flags & OPf_SPECIAL) { /* eof() */
+ IO *io;
+ gv = PL_last_in_gv = PL_argvgv;
+ io = GvIO(gv);
+ if (io && !IoIFP(io)) {
+ if ((IoFLAGS(io) & IOf_START) && av_len(GvAVn(gv)) < 0) {
+ IoLINES(io) = 0;
+ IoFLAGS(io) &= ~IOf_START;
+ do_open(gv, "-", 1, FALSE, O_RDONLY, 0, Nullfp);
+ sv_setpvn(GvSV(gv), "-", 1);
+ SvSETMAGIC(GvSV(gv));
+ }
+ else if (!nextargv(gv))
+ RETPUSHYES;
+ }
+ }
+ else
+ gv = PL_last_in_gv; /* eof */
+ }
else
- gv = PL_last_in_gv = (GV*)POPs;
+ gv = PL_last_in_gv = (GV*)POPs; /* eof(FH) */
if (gv && (mg = SvTIED_mg((SV*)gv, 'q'))) {
PUSHMARK(SP);
RETURN;
}
+#if LSEEKSIZE > IVSIZE
+ PUSHn( do_tell(gv) );
+#else
PUSHi( do_tell(gv) );
+#endif
RETURN;
}
djSP;
GV *gv;
int whence = POPi;
+#if LSEEKSIZE > IVSIZE
+ Off_t offset = (Off_t)SvNVx(POPs);
+#else
Off_t offset = (Off_t)SvIVx(POPs);
+#endif
MAGIC *mg;
gv = PL_last_in_gv = (GV*)POPs;
PUSHs(boolSV(do_seek(gv, offset, whence)));
else {
Off_t n = do_sysseek(gv, offset, whence);
- PUSHs((n < 0) ? &PL_sv_undef
- : sv_2mortal(n ? newSViv((IV)n)
- : newSVpvn(zero_but_true, ZBTLEN)));
+ if (n < 0)
+ PUSHs(&PL_sv_undef);
+ else {
+ SV* sv = n ?
+#if LSEEKSIZE > IVSIZE
+ newSVnv((NV)n)
+#else
+ newSViv((IV)n)
+#endif
+ : newSVpvn(zero_but_true, ZBTLEN);
+ PUSHs(sv_2mortal(sv));
+ }
}
RETURN;
}
nuts:
if (ckWARN(WARN_CLOSED))
- Perl_warner(aTHX_ WARN_CLOSED, "bind() on closed fd");
+ Perl_warner(aTHX_ WARN_CLOSED, "bind() on closed socket");
SETERRNO(EBADF,SS$_IVCHAN);
RETPUSHUNDEF;
#else
nuts:
if (ckWARN(WARN_CLOSED))
- Perl_warner(aTHX_ WARN_CLOSED, "connect() on closed fd");
+ Perl_warner(aTHX_ WARN_CLOSED, "connect() on closed socket");
SETERRNO(EBADF,SS$_IVCHAN);
RETPUSHUNDEF;
#else
nuts:
if (ckWARN(WARN_CLOSED))
- Perl_warner(aTHX_ WARN_CLOSED, "listen() on closed fd");
+ Perl_warner(aTHX_ WARN_CLOSED, "listen() on closed socket");
SETERRNO(EBADF,SS$_IVCHAN);
RETPUSHUNDEF;
#else
nuts:
if (ckWARN(WARN_CLOSED))
- Perl_warner(aTHX_ WARN_CLOSED, "accept() on closed fd");
+ Perl_warner(aTHX_ WARN_CLOSED, "accept() on closed socket");
SETERRNO(EBADF,SS$_IVCHAN);
badexit:
nuts:
if (ckWARN(WARN_CLOSED))
- Perl_warner(aTHX_ WARN_CLOSED, "shutdown() on closed fd");
+ Perl_warner(aTHX_ WARN_CLOSED, "shutdown() on closed socket");
SETERRNO(EBADF,SS$_IVCHAN);
RETPUSHUNDEF;
#else
nuts:
if (ckWARN(WARN_CLOSED))
- Perl_warner(aTHX_ WARN_CLOSED, "[gs]etsockopt() on closed fd");
+ Perl_warner(aTHX_ WARN_CLOSED, "%cetsockopt() on closed socket",
+ optype == OP_GSOCKOPT ? 'g' : 's');
SETERRNO(EBADF,SS$_IVCHAN);
nuts2:
RETPUSHUNDEF;
nuts:
if (ckWARN(WARN_CLOSED))
- Perl_warner(aTHX_ WARN_CLOSED, "get{sock, peer}name() on closed fd");
+ Perl_warner(aTHX_ WARN_CLOSED, "get%sname() on closed socket",
+ optype == OP_GETSOCKNAME ? "sock" : "peer");
SETERRNO(EBADF,SS$_IVCHAN);
nuts2:
RETPUSHUNDEF;
STRLEN n_a;
if (PL_op->op_flags & OPf_REF) {
- tmpgv = cGVOP->op_gv;
+ tmpgv = cGVOP_gv;
do_fstat:
if (tmpgv != PL_defgv) {
PL_laststype = OP_STAT;
PUSHs(sv_2mortal(newSViv(PL_statcache.st_ino)));
PUSHs(sv_2mortal(newSViv(PL_statcache.st_mode)));
PUSHs(sv_2mortal(newSViv(PL_statcache.st_nlink)));
+#if Uid_t_size > IVSIZE
+ PUSHs(sv_2mortal(newSVnv(PL_statcache.st_uid)));
+#else
PUSHs(sv_2mortal(newSViv(PL_statcache.st_uid)));
+#endif
+#if Gid_t_size > IVSIZE
+ PUSHs(sv_2mortal(newSVnv(PL_statcache.st_gid)));
+#else
PUSHs(sv_2mortal(newSViv(PL_statcache.st_gid)));
+#endif
#ifdef USE_STAT_RDEV
PUSHs(sv_2mortal(newSViv(PL_statcache.st_rdev)));
#else
PUSHs(sv_2mortal(newSVpvn("", 0)));
#endif
+#if Off_t_size > IVSIZE
+ PUSHs(sv_2mortal(newSVnv(PL_statcache.st_size)));
+#else
PUSHs(sv_2mortal(newSViv(PL_statcache.st_size)));
+#endif
#ifdef BIG_TIME
PUSHs(sv_2mortal(newSVnv(PL_statcache.st_atime)));
PUSHs(sv_2mortal(newSVnv(PL_statcache.st_mtime)));
djSP;
if (result < 0)
RETPUSHUNDEF;
- if (PL_statcache.st_uid == (PL_op->op_type == OP_FTEOWNED ? PL_euid : PL_uid) )
+ if (PL_statcache.st_uid == (PL_op->op_type == OP_FTEOWNED ?
+ PL_euid : PL_uid) )
RETPUSHYES;
RETPUSHNO;
}
djSP;
if (result < 0)
RETPUSHUNDEF;
- if (!PL_statcache.st_size)
+ if (PL_statcache.st_size == 0)
RETPUSHYES;
RETPUSHNO;
}
djSP; dTARGET;
if (result < 0)
RETPUSHUNDEF;
+#if Off_t_size > IVSIZE
+ PUSHn(PL_statcache.st_size);
+#else
PUSHi(PL_statcache.st_size);
+#endif
RETURN;
}
STRLEN n_a;
if (PL_op->op_flags & OPf_REF)
- gv = cGVOP->op_gv;
+ gv = cGVOP_gv;
else if (isGV(TOPs))
gv = (GV*)POPs;
else if (SvROK(TOPs) && isGV(SvRV(TOPs)))
register SV *sv;
GV *gv;
STRLEN n_a;
+ PerlIO *fp;
if (PL_op->op_flags & OPf_REF)
- gv = cGVOP->op_gv;
+ gv = cGVOP_gv;
else if (isGV(TOPs))
gv = (GV*)POPs;
else if (SvROK(TOPs) && isGV(SvRV(TOPs)))
len = 512;
}
else {
- if (ckWARN(WARN_UNOPENED))
+ if (ckWARN(WARN_UNOPENED)) {
+ gv = cGVOP_gv;
Perl_warner(aTHX_ WARN_UNOPENED, "Test on unopened file <%s>",
- GvENAME(cGVOP->op_gv));
+ GvENAME(gv));
+ }
SETERRNO(EBADF,RMS$_IFI);
RETPUSHUNDEF;
}
PL_statgv = Nullgv;
PL_laststatval = -1;
sv_setpv(PL_statname, SvPV(sv, n_a));
-#ifdef HAS_OPEN3
- i = PerlLIO_open3(SvPV(sv, n_a), O_RDONLY, 0);
-#else
- i = PerlLIO_open(SvPV(sv, n_a), 0);
-#endif
- if (i < 0) {
+ if (!(fp = PerlIO_open(SvPVX(PL_statname), "r"))) {
if (ckWARN(WARN_NEWLINE) && strchr(SvPV(sv, n_a), '\n'))
Perl_warner(aTHX_ WARN_NEWLINE, PL_warn_nl, "open");
RETPUSHUNDEF;
}
- PL_laststatval = PerlLIO_fstat(i, &PL_statcache);
- if (PL_laststatval < 0)
+ PL_laststatval = PerlLIO_fstat(PerlIO_fileno(fp), &PL_statcache);
+ if (PL_laststatval < 0) {
+ (void)PerlIO_close(fp);
RETPUSHUNDEF;
- len = PerlLIO_read(i, tbuf, 512);
- (void)PerlLIO_close(i);
+ }
+ do_binmode(fp, '<', TRUE);
+ len = PerlIO_read(fp, tbuf, sizeof(tbuf));
+ (void)PerlIO_close(fp);
if (len <= 0) {
if (S_ISDIR(PL_statcache.st_mode) && PL_op->op_type == OP_FTTEXT)
RETPUSHNO; /* special case NFS directories */
/* now scan s to look for textiness */
/* XXX ASCII dependent code */
+#if defined(DOSISH) || defined(USEMYBINMODE)
+ /* ignore trailing ^Z on short files */
+ if (len && len < sizeof(tbuf) && tbuf[len-1] == 26)
+ --len;
+#endif
+
for (i = 0; i < len; i++, s++) {
if (!*s) { /* null never allowed in text */
odd += len;
else if (!(isPRINT(*s) || isSPACE(*s)))
odd++;
#else
- else if (*s & 128)
- odd++;
+ else if (*s & 128) {
+#ifdef USE_LOCALE
+ if (!(PL_op->op_private & OPpLOCALE) || !isALPHA_LC(*s))
+#endif
+ odd++;
+ }
else if (*s < 32 &&
*s != '\n' && *s != '\r' && *s != '\b' &&
*s != '\t' && *s != '\f' && *s != 27)
char *tmps2 = POPpx;
char *tmps = SvPV(TOPs, n_a);
TAINT_PROPER("link");
- SETi( link(tmps, tmps2) >= 0 );
+ SETi( PerlLIO_link(tmps, tmps2) >= 0 );
#else
DIE(aTHX_ PL_no_func, "Unsupported function link");
#endif
if (!childpid) {
/*SUPPRESS 560*/
if (tmpgv = gv_fetchpv("$", TRUE, SVt_PV))
- sv_setiv(GvSV(tmpgv), (IV)getpid());
+ sv_setiv(GvSV(tmpgv), (IV)PerlProc_getpid());
hv_clear(PL_pidstatus); /* no kids, so don't wait for 'em */
}
PUSHi(childpid);
RETURN;
#else
+# if defined(USE_ITHREADS) && defined(PERL_IMPLICIT_SYS)
+ djSP; dTARGET;
+ Pid_t childpid;
+
+ EXTEND(SP, 1);
+ PERL_FLUSHALL_FOR_CHILD;
+ childpid = PerlProc_fork();
+ PUSHi(childpid);
+ RETURN;
+# else
DIE(aTHX_ PL_no_func, "Unsupported function fork");
+# endif
#endif
}
PP(pp_wait)
{
-#if !defined(DOSISH) || defined(OS2) || defined(WIN32)
+#if (!defined(DOSISH) || defined(OS2) || defined(WIN32)) && !defined(MACOS_TRADITIONAL)
djSP; dTARGET;
Pid_t childpid;
int argflags;
PP(pp_waitpid)
{
-#if !defined(DOSISH) || defined(OS2) || defined(WIN32)
+#if (!defined(DOSISH) || defined(OS2) || defined(WIN32)) && !defined(MACOS_TRADITIONAL)
djSP; dTARGET;
Pid_t childpid;
int optype;
# endif
#endif
}
+
+#if !defined(HAS_FORK) && defined(USE_ITHREADS) && defined(PERL_IMPLICIT_SYS)
+ if (value >= 0)
+ my_exit(value);
+#endif
+
SP = ORIGMARK;
PUSHi(value);
RETURN;
#ifdef BSD_GETPGRP
pgrp = (I32)BSD_GETPGRP(pid);
#else
- if (pid != 0 && pid != getpid())
+ if (pid != 0 && pid != PerlProc_getpid())
DIE(aTHX_ "POSIX getpgrp can't take an argument");
pgrp = getpgrp();
#endif
#ifdef BSD_SETPGRP
SETi( BSD_SETPGRP(pid, pgrp) >= 0 );
#else
- if ((pgrp != 0 && pgrp != getpid()) || (pid != 0 && pid != getpid()))
- DIE(aTHX_ "POSIX setpgrp can't take an argument");
+ if ((pgrp != 0 && pgrp != PerlProc_getpid())
+ || (pid != 0 && pid != PerlProc_getpid()))
+ {
+ DIE(aTHX_ "setpgrp can't take arguments");
+ }
SETi( setpgrp() >= 0 );
#endif /* USE_BSDPGRP */
RETURN;
* and run 'make regen_headers' to effect changes.
*/
+
+
+START_EXTERN_C
+
+#if defined(PERL_IMPLICIT_SYS)
+PERL_CALLCONV PerlInterpreter* perl_alloc_using(struct IPerlMem* m, struct IPerlMem* ms, struct IPerlMem* mp, struct IPerlEnv* e, struct IPerlStdIO* io, struct IPerlLIO* lio, struct IPerlDir* d, struct IPerlSock* s, struct IPerlProc* p);
+#else
+PERL_CALLCONV PerlInterpreter* perl_alloc(void);
+#endif
+PERL_CALLCONV void perl_construct(PerlInterpreter* interp);
+PERL_CALLCONV void perl_destruct(PerlInterpreter* interp);
+PERL_CALLCONV void perl_free(PerlInterpreter* interp);
+PERL_CALLCONV int perl_run(PerlInterpreter* interp);
+PERL_CALLCONV int perl_parse(PerlInterpreter* interp, XSINIT_t xsinit, int argc, char** argv, char** env);
+#if defined(USE_ITHREADS)
+PERL_CALLCONV PerlInterpreter* perl_clone(PerlInterpreter* interp, UV flags);
+# if defined(PERL_IMPLICIT_SYS)
+PERL_CALLCONV PerlInterpreter* perl_clone_using(PerlInterpreter *interp, UV flags, struct IPerlMem* m, struct IPerlMem* ms, struct IPerlMem* mp, struct IPerlEnv* e, struct IPerlStdIO* io, struct IPerlLIO* lio, struct IPerlDir* d, struct IPerlSock* s, struct IPerlProc* p);
+# endif
+#endif
+
+#if defined(MYMALLOC)
+PERL_CALLCONV Malloc_t Perl_malloc(MEM_SIZE nbytes);
+PERL_CALLCONV Malloc_t Perl_calloc(MEM_SIZE elements, MEM_SIZE size);
+PERL_CALLCONV Malloc_t Perl_realloc(Malloc_t where, MEM_SIZE nbytes);
+PERL_CALLCONV Free_t Perl_mfree(Malloc_t where);
+PERL_CALLCONV MEM_SIZE Perl_malloced_size(void *p);
+#endif
+
+END_EXTERN_C
+
+/* functions with flag 'n' should come before here */
#if defined(PERL_OBJECT)
+class CPerlObj {
public:
+ struct interpreter interp;
+ CPerlObj(IPerlMem*, IPerlMem*, IPerlMem*, IPerlEnv*, IPerlStdIO*,
+ IPerlLIO*, IPerlDir*, IPerlSock*, IPerlProc*);
+ void* operator new(size_t nSize, IPerlMem *pvtbl);
+#ifndef __BORLANDC__
+ static void operator delete(void* pPerl, IPerlMem *pvtbl);
#endif
-VIRTUAL SV* Perl_amagic_call(pTHX_ SV* left, SV* right, int method, int dir);
-VIRTUAL bool Perl_Gv_AMupdate(pTHX_ HV* stash);
-VIRTUAL OP* Perl_append_elem(pTHX_ I32 optype, OP* head, OP* tail);
-VIRTUAL OP* Perl_append_list(pTHX_ I32 optype, LISTOP* first, LISTOP* last);
-VIRTUAL I32 Perl_apply(pTHX_ I32 type, SV** mark, SV** sp);
-VIRTUAL bool Perl_avhv_exists_ent(pTHX_ AV *ar, SV* keysv, U32 hash);
-VIRTUAL SV** Perl_avhv_fetch_ent(pTHX_ AV *ar, SV* keysv, I32 lval, U32 hash);
-VIRTUAL HE* Perl_avhv_iternext(pTHX_ AV *ar);
-VIRTUAL SV* Perl_avhv_iterval(pTHX_ AV *ar, HE* entry);
-VIRTUAL HV* Perl_avhv_keys(pTHX_ AV *ar);
-VIRTUAL void Perl_av_clear(pTHX_ AV* ar);
-VIRTUAL void Perl_av_extend(pTHX_ AV* ar, I32 key);
-VIRTUAL AV* Perl_av_fake(pTHX_ I32 size, SV** svp);
-VIRTUAL SV** Perl_av_fetch(pTHX_ AV* ar, I32 key, I32 lval);
-VIRTUAL void Perl_av_fill(pTHX_ AV* ar, I32 fill);
-VIRTUAL I32 Perl_av_len(pTHX_ AV* ar);
-VIRTUAL AV* Perl_av_make(pTHX_ I32 size, SV** svp);
-VIRTUAL SV* Perl_av_pop(pTHX_ AV* ar);
-VIRTUAL void Perl_av_push(pTHX_ AV* ar, SV* val);
-VIRTUAL void Perl_av_reify(pTHX_ AV* ar);
-VIRTUAL SV* Perl_av_shift(pTHX_ AV* ar);
-VIRTUAL SV** Perl_av_store(pTHX_ AV* ar, I32 key, SV* val);
-VIRTUAL void Perl_av_undef(pTHX_ AV* ar);
-VIRTUAL void Perl_av_unshift(pTHX_ AV* ar, I32 num);
-VIRTUAL OP* Perl_bind_match(pTHX_ I32 type, OP* left, OP* pat);
-VIRTUAL OP* Perl_block_end(pTHX_ I32 floor, OP* seq);
-VIRTUAL I32 Perl_block_gimme(pTHX);
-VIRTUAL int Perl_block_start(pTHX_ int full);
-VIRTUAL void Perl_boot_core_UNIVERSAL(pTHX);
-VIRTUAL void Perl_call_list(pTHX_ I32 oldscope, AV* av_list);
-VIRTUAL bool Perl_cando(pTHX_ Mode_t mode, Uid_t effective, Stat_t* statbufp);
-VIRTUAL U32 Perl_cast_ulong(pTHX_ NV f);
-VIRTUAL I32 Perl_cast_i32(pTHX_ NV f);
-VIRTUAL IV Perl_cast_iv(pTHX_ NV f);
-VIRTUAL UV Perl_cast_uv(pTHX_ NV f);
+ int do_aspawn (void *vreally, void **vmark, void **vsp);
+#endif
+#if defined(PERL_OBJECT)
+public:
+#else
+START_EXTERN_C
+#endif
+# include "pp_proto.h"
+PERL_CALLCONV SV* Perl_amagic_call(pTHX_ SV* left, SV* right, int method, int dir);
+PERL_CALLCONV bool Perl_Gv_AMupdate(pTHX_ HV* stash);
+PERL_CALLCONV OP* Perl_append_elem(pTHX_ I32 optype, OP* head, OP* tail);
+PERL_CALLCONV OP* Perl_append_list(pTHX_ I32 optype, LISTOP* first, LISTOP* last);
+PERL_CALLCONV I32 Perl_apply(pTHX_ I32 type, SV** mark, SV** sp);
+PERL_CALLCONV SV* Perl_avhv_delete_ent(pTHX_ AV *ar, SV* keysv, I32 flags, U32 hash);
+PERL_CALLCONV bool Perl_avhv_exists_ent(pTHX_ AV *ar, SV* keysv, U32 hash);
+PERL_CALLCONV SV** Perl_avhv_fetch_ent(pTHX_ AV *ar, SV* keysv, I32 lval, U32 hash);
+PERL_CALLCONV HE* Perl_avhv_iternext(pTHX_ AV *ar);
+PERL_CALLCONV SV* Perl_avhv_iterval(pTHX_ AV *ar, HE* entry);
+PERL_CALLCONV HV* Perl_avhv_keys(pTHX_ AV *ar);
+PERL_CALLCONV void Perl_av_clear(pTHX_ AV* ar);
+PERL_CALLCONV SV* Perl_av_delete(pTHX_ AV* ar, I32 key, I32 flags);
+PERL_CALLCONV bool Perl_av_exists(pTHX_ AV* ar, I32 key);
+PERL_CALLCONV void Perl_av_extend(pTHX_ AV* ar, I32 key);
+PERL_CALLCONV AV* Perl_av_fake(pTHX_ I32 size, SV** svp);
+PERL_CALLCONV SV** Perl_av_fetch(pTHX_ AV* ar, I32 key, I32 lval);
+PERL_CALLCONV void Perl_av_fill(pTHX_ AV* ar, I32 fill);
+PERL_CALLCONV I32 Perl_av_len(pTHX_ AV* ar);
+PERL_CALLCONV AV* Perl_av_make(pTHX_ I32 size, SV** svp);
+PERL_CALLCONV SV* Perl_av_pop(pTHX_ AV* ar);
+PERL_CALLCONV void Perl_av_push(pTHX_ AV* ar, SV* val);
+PERL_CALLCONV void Perl_av_reify(pTHX_ AV* ar);
+PERL_CALLCONV SV* Perl_av_shift(pTHX_ AV* ar);
+PERL_CALLCONV SV** Perl_av_store(pTHX_ AV* ar, I32 key, SV* val);
+PERL_CALLCONV void Perl_av_undef(pTHX_ AV* ar);
+PERL_CALLCONV void Perl_av_unshift(pTHX_ AV* ar, I32 num);
+PERL_CALLCONV OP* Perl_bind_match(pTHX_ I32 type, OP* left, OP* pat);
+PERL_CALLCONV OP* Perl_block_end(pTHX_ I32 floor, OP* seq);
+PERL_CALLCONV I32 Perl_block_gimme(pTHX);
+PERL_CALLCONV int Perl_block_start(pTHX_ int full);
+PERL_CALLCONV void Perl_boot_core_UNIVERSAL(pTHX);
+PERL_CALLCONV void Perl_call_list(pTHX_ I32 oldscope, AV* av_list);
+PERL_CALLCONV bool Perl_cando(pTHX_ Mode_t mode, Uid_t effective, Stat_t* statbufp);
+PERL_CALLCONV U32 Perl_cast_ulong(pTHX_ NV f);
+PERL_CALLCONV I32 Perl_cast_i32(pTHX_ NV f);
+PERL_CALLCONV IV Perl_cast_iv(pTHX_ NV f);
+PERL_CALLCONV UV Perl_cast_uv(pTHX_ NV f);
#if !defined(HAS_TRUNCATE) && !defined(HAS_CHSIZE) && defined(F_FREESP)
-VIRTUAL I32 Perl_my_chsize(pTHX_ int fd, Off_t length);
+PERL_CALLCONV I32 Perl_my_chsize(pTHX_ int fd, Off_t length);
#endif
#if defined(USE_THREADS)
-VIRTUAL MAGIC* Perl_condpair_magic(pTHX_ SV *sv);
+PERL_CALLCONV MAGIC* Perl_condpair_magic(pTHX_ SV *sv);
#endif
-VIRTUAL OP* Perl_convert(pTHX_ I32 optype, I32 flags, OP* o);
-VIRTUAL void Perl_croak(pTHX_ const char* pat, ...) __attribute__((noreturn));
-VIRTUAL void Perl_vcroak(pTHX_ const char* pat, va_list* args) __attribute__((noreturn));
+PERL_CALLCONV OP* Perl_convert(pTHX_ I32 optype, I32 flags, OP* o);
+PERL_CALLCONV void Perl_croak(pTHX_ const char* pat, ...) __attribute__((noreturn));
+PERL_CALLCONV void Perl_vcroak(pTHX_ const char* pat, va_list* args) __attribute__((noreturn));
#if defined(PERL_IMPLICIT_CONTEXT)
-VIRTUAL void Perl_croak_nocontext(const char* pat, ...) __attribute__((noreturn));
-VIRTUAL OP* Perl_die_nocontext(const char* pat, ...);
-VIRTUAL void Perl_deb_nocontext(const char* pat, ...);
-VIRTUAL char* Perl_form_nocontext(const char* pat, ...);
-VIRTUAL SV* Perl_mess_nocontext(const char* pat, ...);
-VIRTUAL void Perl_warn_nocontext(const char* pat, ...);
-VIRTUAL void Perl_warner_nocontext(U32 err, const char* pat, ...);
-VIRTUAL SV* Perl_newSVpvf_nocontext(const char* pat, ...);
-VIRTUAL void Perl_sv_catpvf_nocontext(SV* sv, const char* pat, ...);
-VIRTUAL void Perl_sv_setpvf_nocontext(SV* sv, const char* pat, ...);
-VIRTUAL void Perl_sv_catpvf_mg_nocontext(SV* sv, const char* pat, ...);
-VIRTUAL void Perl_sv_setpvf_mg_nocontext(SV* sv, const char* pat, ...);
-VIRTUAL int Perl_fprintf_nocontext(PerlIO* stream, const char* fmt, ...);
-#endif
-VIRTUAL void Perl_cv_ckproto(pTHX_ CV* cv, GV* gv, char* p);
-VIRTUAL CV* Perl_cv_clone(pTHX_ CV* proto);
-VIRTUAL SV* Perl_cv_const_sv(pTHX_ CV* cv);
-VIRTUAL SV* Perl_op_const_sv(pTHX_ OP* o, CV* cv);
-VIRTUAL void Perl_cv_undef(pTHX_ CV* cv);
-VIRTUAL void Perl_cx_dump(pTHX_ PERL_CONTEXT* cs);
-VIRTUAL SV* Perl_filter_add(pTHX_ filter_t funcp, SV* datasv);
-VIRTUAL void Perl_filter_del(pTHX_ filter_t funcp);
-VIRTUAL I32 Perl_filter_read(pTHX_ int idx, SV* buffer, int maxlen);
-VIRTUAL char** Perl_get_op_descs(pTHX);
-VIRTUAL char** Perl_get_op_names(pTHX);
-VIRTUAL char* Perl_get_no_modify(pTHX);
-VIRTUAL U32* Perl_get_opargs(pTHX);
-VIRTUAL PPADDR_t* Perl_get_ppaddr(pTHX);
-VIRTUAL I32 Perl_cxinc(pTHX);
-VIRTUAL void Perl_deb(pTHX_ const char* pat, ...);
-VIRTUAL void Perl_vdeb(pTHX_ const char* pat, va_list* args);
-VIRTUAL void Perl_deb_growlevel(pTHX);
-VIRTUAL void Perl_debprofdump(pTHX);
-VIRTUAL I32 Perl_debop(pTHX_ OP* o);
-VIRTUAL I32 Perl_debstack(pTHX);
-VIRTUAL I32 Perl_debstackptrs(pTHX);
-VIRTUAL char* Perl_delimcpy(pTHX_ char* to, char* toend, char* from, char* fromend, int delim, I32* retlen);
-VIRTUAL void Perl_deprecate(pTHX_ char* s);
-VIRTUAL OP* Perl_die(pTHX_ const char* pat, ...);
-VIRTUAL OP* Perl_vdie(pTHX_ const char* pat, va_list* args);
-VIRTUAL OP* Perl_die_where(pTHX_ char* message, STRLEN msglen);
-VIRTUAL void Perl_dounwind(pTHX_ I32 cxix);
-VIRTUAL bool Perl_do_aexec(pTHX_ SV* really, SV** mark, SV** sp);
-VIRTUAL bool Perl_do_aexec5(pTHX_ SV* really, SV** mark, SV** sp, int fd, int flag);
-VIRTUAL int Perl_do_binmode(pTHX_ PerlIO *fp, int iotype, int flag);
-VIRTUAL void Perl_do_chop(pTHX_ SV* asv, SV* sv);
-VIRTUAL bool Perl_do_close(pTHX_ GV* gv, bool not_implicit);
-VIRTUAL bool Perl_do_eof(pTHX_ GV* gv);
-VIRTUAL bool Perl_do_exec(pTHX_ char* cmd);
+PERL_CALLCONV void Perl_croak_nocontext(const char* pat, ...) __attribute__((noreturn));
+PERL_CALLCONV OP* Perl_die_nocontext(const char* pat, ...);
+PERL_CALLCONV void Perl_deb_nocontext(const char* pat, ...);
+PERL_CALLCONV char* Perl_form_nocontext(const char* pat, ...);
+PERL_CALLCONV SV* Perl_mess_nocontext(const char* pat, ...);
+PERL_CALLCONV void Perl_warn_nocontext(const char* pat, ...);
+PERL_CALLCONV void Perl_warner_nocontext(U32 err, const char* pat, ...);
+PERL_CALLCONV SV* Perl_newSVpvf_nocontext(const char* pat, ...);
+PERL_CALLCONV void Perl_sv_catpvf_nocontext(SV* sv, const char* pat, ...);
+PERL_CALLCONV void Perl_sv_setpvf_nocontext(SV* sv, const char* pat, ...);
+PERL_CALLCONV void Perl_sv_catpvf_mg_nocontext(SV* sv, const char* pat, ...);
+PERL_CALLCONV void Perl_sv_setpvf_mg_nocontext(SV* sv, const char* pat, ...);
+PERL_CALLCONV int Perl_fprintf_nocontext(PerlIO* stream, const char* fmt, ...);
+#endif
+PERL_CALLCONV void Perl_cv_ckproto(pTHX_ CV* cv, GV* gv, char* p);
+PERL_CALLCONV CV* Perl_cv_clone(pTHX_ CV* proto);
+PERL_CALLCONV SV* Perl_cv_const_sv(pTHX_ CV* cv);
+PERL_CALLCONV SV* Perl_op_const_sv(pTHX_ OP* o, CV* cv);
+PERL_CALLCONV void Perl_cv_undef(pTHX_ CV* cv);
+PERL_CALLCONV void Perl_cx_dump(pTHX_ PERL_CONTEXT* cs);
+PERL_CALLCONV SV* Perl_filter_add(pTHX_ filter_t funcp, SV* datasv);
+PERL_CALLCONV void Perl_filter_del(pTHX_ filter_t funcp);
+PERL_CALLCONV I32 Perl_filter_read(pTHX_ int idx, SV* buffer, int maxlen);
+PERL_CALLCONV char** Perl_get_op_descs(pTHX);
+PERL_CALLCONV char** Perl_get_op_names(pTHX);
+PERL_CALLCONV char* Perl_get_no_modify(pTHX);
+PERL_CALLCONV U32* Perl_get_opargs(pTHX);
+PERL_CALLCONV PPADDR_t* Perl_get_ppaddr(pTHX);
+PERL_CALLCONV I32 Perl_cxinc(pTHX);
+PERL_CALLCONV void Perl_deb(pTHX_ const char* pat, ...);
+PERL_CALLCONV void Perl_vdeb(pTHX_ const char* pat, va_list* args);
+PERL_CALLCONV void Perl_debprofdump(pTHX);
+PERL_CALLCONV I32 Perl_debop(pTHX_ OP* o);
+PERL_CALLCONV I32 Perl_debstack(pTHX);
+PERL_CALLCONV I32 Perl_debstackptrs(pTHX);
+PERL_CALLCONV char* Perl_delimcpy(pTHX_ char* to, char* toend, char* from, char* fromend, int delim, I32* retlen);
+PERL_CALLCONV void Perl_deprecate(pTHX_ char* s);
+PERL_CALLCONV OP* Perl_die(pTHX_ const char* pat, ...);
+PERL_CALLCONV OP* Perl_vdie(pTHX_ const char* pat, va_list* args);
+PERL_CALLCONV OP* Perl_die_where(pTHX_ char* message, STRLEN msglen);
+PERL_CALLCONV void Perl_dounwind(pTHX_ I32 cxix);
+PERL_CALLCONV bool Perl_do_aexec(pTHX_ SV* really, SV** mark, SV** sp);
+PERL_CALLCONV bool Perl_do_aexec5(pTHX_ SV* really, SV** mark, SV** sp, int fd, int flag);
+PERL_CALLCONV int Perl_do_binmode(pTHX_ PerlIO *fp, int iotype, int flag);
+PERL_CALLCONV void Perl_do_chop(pTHX_ SV* asv, SV* sv);
+PERL_CALLCONV bool Perl_do_close(pTHX_ GV* gv, bool not_implicit);
+PERL_CALLCONV bool Perl_do_eof(pTHX_ GV* gv);
+PERL_CALLCONV bool Perl_do_exec(pTHX_ char* cmd);
#if !defined(WIN32)
-VIRTUAL bool Perl_do_exec3(pTHX_ char* cmd, int fd, int flag);
+PERL_CALLCONV bool Perl_do_exec3(pTHX_ char* cmd, int fd, int flag);
#endif
-VIRTUAL void Perl_do_execfree(pTHX);
+PERL_CALLCONV void Perl_do_execfree(pTHX);
#if defined(HAS_MSG) || defined(HAS_SEM) || defined(HAS_SHM)
-VIRTUAL I32 Perl_do_ipcctl(pTHX_ I32 optype, SV** mark, SV** sp);
-VIRTUAL I32 Perl_do_ipcget(pTHX_ I32 optype, SV** mark, SV** sp);
-VIRTUAL I32 Perl_do_msgrcv(pTHX_ SV** mark, SV** sp);
-VIRTUAL I32 Perl_do_msgsnd(pTHX_ SV** mark, SV** sp);
-VIRTUAL I32 Perl_do_semop(pTHX_ SV** mark, SV** sp);
-VIRTUAL I32 Perl_do_shmio(pTHX_ I32 optype, SV** mark, SV** sp);
-#endif
-VIRTUAL void Perl_do_join(pTHX_ SV* sv, SV* del, SV** mark, SV** sp);
-VIRTUAL OP* Perl_do_kv(pTHX);
-VIRTUAL bool Perl_do_open(pTHX_ GV* gv, char* name, I32 len, int as_raw, int rawmode, int rawperm, PerlIO* supplied_fp);
-VIRTUAL bool Perl_do_open9(pTHX_ GV *gv, char *name, I32 len, int as_raw, int rawmode, int rawperm, PerlIO *supplied_fp, SV *svs, I32 num);
-VIRTUAL void Perl_do_pipe(pTHX_ SV* sv, GV* rgv, GV* wgv);
-VIRTUAL bool Perl_do_print(pTHX_ SV* sv, PerlIO* fp);
-VIRTUAL OP* Perl_do_readline(pTHX);
-VIRTUAL I32 Perl_do_chomp(pTHX_ SV* sv);
-VIRTUAL bool Perl_do_seek(pTHX_ GV* gv, Off_t pos, int whence);
-VIRTUAL void Perl_do_sprintf(pTHX_ SV* sv, I32 len, SV** sarg);
-VIRTUAL Off_t Perl_do_sysseek(pTHX_ GV* gv, Off_t pos, int whence);
-VIRTUAL Off_t Perl_do_tell(pTHX_ GV* gv);
-VIRTUAL I32 Perl_do_trans(pTHX_ SV* sv);
-VIRTUAL UV Perl_do_vecget(pTHX_ SV* sv, I32 offset, I32 size);
-VIRTUAL void Perl_do_vecset(pTHX_ SV* sv);
-VIRTUAL void Perl_do_vop(pTHX_ I32 optype, SV* sv, SV* left, SV* right);
-VIRTUAL OP* Perl_dofile(pTHX_ OP* term);
-VIRTUAL I32 Perl_dowantarray(pTHX);
-VIRTUAL void Perl_dump_all(pTHX);
-VIRTUAL void Perl_dump_eval(pTHX);
+PERL_CALLCONV I32 Perl_do_ipcctl(pTHX_ I32 optype, SV** mark, SV** sp);
+PERL_CALLCONV I32 Perl_do_ipcget(pTHX_ I32 optype, SV** mark, SV** sp);
+PERL_CALLCONV I32 Perl_do_msgrcv(pTHX_ SV** mark, SV** sp);
+PERL_CALLCONV I32 Perl_do_msgsnd(pTHX_ SV** mark, SV** sp);
+PERL_CALLCONV I32 Perl_do_semop(pTHX_ SV** mark, SV** sp);
+PERL_CALLCONV I32 Perl_do_shmio(pTHX_ I32 optype, SV** mark, SV** sp);
+#endif
+PERL_CALLCONV void Perl_do_join(pTHX_ SV* sv, SV* del, SV** mark, SV** sp);
+PERL_CALLCONV OP* Perl_do_kv(pTHX);
+PERL_CALLCONV bool Perl_do_open(pTHX_ GV* gv, char* name, I32 len, int as_raw, int rawmode, int rawperm, PerlIO* supplied_fp);
+PERL_CALLCONV bool Perl_do_open9(pTHX_ GV *gv, char *name, I32 len, int as_raw, int rawmode, int rawperm, PerlIO *supplied_fp, SV *svs, I32 num);
+PERL_CALLCONV void Perl_do_pipe(pTHX_ SV* sv, GV* rgv, GV* wgv);
+PERL_CALLCONV bool Perl_do_print(pTHX_ SV* sv, PerlIO* fp);
+PERL_CALLCONV OP* Perl_do_readline(pTHX);
+PERL_CALLCONV I32 Perl_do_chomp(pTHX_ SV* sv);
+PERL_CALLCONV bool Perl_do_seek(pTHX_ GV* gv, Off_t pos, int whence);
+PERL_CALLCONV void Perl_do_sprintf(pTHX_ SV* sv, I32 len, SV** sarg);
+PERL_CALLCONV Off_t Perl_do_sysseek(pTHX_ GV* gv, Off_t pos, int whence);
+PERL_CALLCONV Off_t Perl_do_tell(pTHX_ GV* gv);
+PERL_CALLCONV I32 Perl_do_trans(pTHX_ SV* sv);
+PERL_CALLCONV UV Perl_do_vecget(pTHX_ SV* sv, I32 offset, I32 size);
+PERL_CALLCONV void Perl_do_vecset(pTHX_ SV* sv);
+PERL_CALLCONV void Perl_do_vop(pTHX_ I32 optype, SV* sv, SV* left, SV* right);
+PERL_CALLCONV OP* Perl_dofile(pTHX_ OP* term);
+PERL_CALLCONV I32 Perl_dowantarray(pTHX);
+PERL_CALLCONV void Perl_dump_all(pTHX);
+PERL_CALLCONV void Perl_dump_eval(pTHX);
#if defined(DUMP_FDS)
-VIRTUAL void Perl_dump_fds(pTHX_ char* s);
-#endif
-VIRTUAL void Perl_dump_form(pTHX_ GV* gv);
-VIRTUAL void Perl_gv_dump(pTHX_ GV* gv);
-VIRTUAL void Perl_op_dump(pTHX_ OP* arg);
-VIRTUAL void Perl_pmop_dump(pTHX_ PMOP* pm);
-VIRTUAL void Perl_dump_packsubs(pTHX_ HV* stash);
-VIRTUAL void Perl_dump_sub(pTHX_ GV* gv);
-VIRTUAL void Perl_fbm_compile(pTHX_ SV* sv, U32 flags);
-VIRTUAL char* Perl_fbm_instr(pTHX_ unsigned char* big, unsigned char* bigend, SV* littlesv, U32 flags);
-VIRTUAL char* Perl_find_script(pTHX_ char *scriptname, bool dosearch, char **search_ext, I32 flags);
+PERL_CALLCONV void Perl_dump_fds(pTHX_ char* s);
+#endif
+PERL_CALLCONV void Perl_dump_form(pTHX_ GV* gv);
+PERL_CALLCONV void Perl_gv_dump(pTHX_ GV* gv);
+PERL_CALLCONV void Perl_op_dump(pTHX_ OP* arg);
+PERL_CALLCONV void Perl_pmop_dump(pTHX_ PMOP* pm);
+PERL_CALLCONV void Perl_dump_packsubs(pTHX_ HV* stash);
+PERL_CALLCONV void Perl_dump_sub(pTHX_ GV* gv);
+PERL_CALLCONV void Perl_fbm_compile(pTHX_ SV* sv, U32 flags);
+PERL_CALLCONV char* Perl_fbm_instr(pTHX_ unsigned char* big, unsigned char* bigend, SV* littlesv, U32 flags);
+PERL_CALLCONV char* Perl_find_script(pTHX_ char *scriptname, bool dosearch, char **search_ext, I32 flags);
#if defined(USE_THREADS)
-VIRTUAL PADOFFSET Perl_find_threadsv(pTHX_ const char *name);
-#endif
-VIRTUAL OP* Perl_force_list(pTHX_ OP* arg);
-VIRTUAL OP* Perl_fold_constants(pTHX_ OP* arg);
-VIRTUAL char* Perl_form(pTHX_ const char* pat, ...);
-VIRTUAL char* Perl_vform(pTHX_ const char* pat, va_list* args);
-VIRTUAL void Perl_free_tmps(pTHX);
-VIRTUAL OP* Perl_gen_constant_list(pTHX_ OP* o);
+PERL_CALLCONV PADOFFSET Perl_find_threadsv(pTHX_ const char *name);
+#endif
+PERL_CALLCONV OP* Perl_force_list(pTHX_ OP* arg);
+PERL_CALLCONV OP* Perl_fold_constants(pTHX_ OP* arg);
+PERL_CALLCONV char* Perl_form(pTHX_ const char* pat, ...);
+PERL_CALLCONV char* Perl_vform(pTHX_ const char* pat, va_list* args);
+PERL_CALLCONV void Perl_free_tmps(pTHX);
+PERL_CALLCONV OP* Perl_gen_constant_list(pTHX_ OP* o);
#if !defined(HAS_GETENV_LEN)
-VIRTUAL char* Perl_getenv_len(pTHX_ char* key, unsigned long *len);
-#endif
-VIRTUAL void Perl_gp_free(pTHX_ GV* gv);
-VIRTUAL GP* Perl_gp_ref(pTHX_ GP* gp);
-VIRTUAL GV* Perl_gv_AVadd(pTHX_ GV* gv);
-VIRTUAL GV* Perl_gv_HVadd(pTHX_ GV* gv);
-VIRTUAL GV* Perl_gv_IOadd(pTHX_ GV* gv);
-VIRTUAL GV* Perl_gv_autoload4(pTHX_ HV* stash, const char* name, STRLEN len, I32 method);
-VIRTUAL void Perl_gv_check(pTHX_ HV* stash);
-VIRTUAL void Perl_gv_efullname(pTHX_ SV* sv, GV* gv);
-VIRTUAL void Perl_gv_efullname3(pTHX_ SV* sv, GV* gv, const char* prefix);
-VIRTUAL GV* Perl_gv_fetchfile(pTHX_ const char* name);
-VIRTUAL GV* Perl_gv_fetchmeth(pTHX_ HV* stash, const char* name, STRLEN len, I32 level);
-VIRTUAL GV* Perl_gv_fetchmethod(pTHX_ HV* stash, const char* name);
-VIRTUAL GV* Perl_gv_fetchmethod_autoload(pTHX_ HV* stash, const char* name, I32 autoload);
-VIRTUAL GV* Perl_gv_fetchpv(pTHX_ const char* name, I32 add, I32 sv_type);
-VIRTUAL void Perl_gv_fullname(pTHX_ SV* sv, GV* gv);
-VIRTUAL void Perl_gv_fullname3(pTHX_ SV* sv, GV* gv, const char* prefix);
-VIRTUAL void Perl_gv_init(pTHX_ GV* gv, HV* stash, const char* name, STRLEN len, int multi);
-VIRTUAL HV* Perl_gv_stashpv(pTHX_ const char* name, I32 create);
-VIRTUAL HV* Perl_gv_stashpvn(pTHX_ const char* name, U32 namelen, I32 create);
-VIRTUAL HV* Perl_gv_stashsv(pTHX_ SV* sv, I32 create);
-VIRTUAL void Perl_hv_clear(pTHX_ HV* tb);
-VIRTUAL void Perl_hv_delayfree_ent(pTHX_ HV* hv, HE* entry);
-VIRTUAL SV* Perl_hv_delete(pTHX_ HV* tb, const char* key, U32 klen, I32 flags);
-VIRTUAL SV* Perl_hv_delete_ent(pTHX_ HV* tb, SV* key, I32 flags, U32 hash);
-VIRTUAL bool Perl_hv_exists(pTHX_ HV* tb, const char* key, U32 klen);
-VIRTUAL bool Perl_hv_exists_ent(pTHX_ HV* tb, SV* key, U32 hash);
-VIRTUAL SV** Perl_hv_fetch(pTHX_ HV* tb, const char* key, U32 klen, I32 lval);
-VIRTUAL HE* Perl_hv_fetch_ent(pTHX_ HV* tb, SV* key, I32 lval, U32 hash);
-VIRTUAL void Perl_hv_free_ent(pTHX_ HV* hv, HE* entry);
-VIRTUAL I32 Perl_hv_iterinit(pTHX_ HV* tb);
-VIRTUAL char* Perl_hv_iterkey(pTHX_ HE* entry, I32* retlen);
-VIRTUAL SV* Perl_hv_iterkeysv(pTHX_ HE* entry);
-VIRTUAL HE* Perl_hv_iternext(pTHX_ HV* tb);
-VIRTUAL SV* Perl_hv_iternextsv(pTHX_ HV* hv, char** key, I32* retlen);
-VIRTUAL SV* Perl_hv_iterval(pTHX_ HV* tb, HE* entry);
-VIRTUAL void Perl_hv_ksplit(pTHX_ HV* hv, IV newmax);
-VIRTUAL void Perl_hv_magic(pTHX_ HV* hv, GV* gv, int how);
-VIRTUAL SV** Perl_hv_store(pTHX_ HV* tb, const char* key, U32 klen, SV* val, U32 hash);
-VIRTUAL HE* Perl_hv_store_ent(pTHX_ HV* tb, SV* key, SV* val, U32 hash);
-VIRTUAL void Perl_hv_undef(pTHX_ HV* tb);
-VIRTUAL I32 Perl_ibcmp(pTHX_ const char* a, const char* b, I32 len);
-VIRTUAL I32 Perl_ibcmp_locale(pTHX_ const char* a, const char* b, I32 len);
-VIRTUAL bool Perl_ingroup(pTHX_ Gid_t testgid, Uid_t effective);
-VIRTUAL void Perl_init_debugger(pTHX);
-VIRTUAL void Perl_init_stacks(pTHX);
-VIRTUAL U32 Perl_intro_my(pTHX);
-VIRTUAL char* Perl_instr(pTHX_ const char* big, const char* little);
-VIRTUAL bool Perl_io_close(pTHX_ IO* io, bool not_implicit);
-VIRTUAL OP* Perl_invert(pTHX_ OP* cmd);
-VIRTUAL bool Perl_is_uni_alnum(pTHX_ U32 c);
-VIRTUAL bool Perl_is_uni_alnumc(pTHX_ U32 c);
-VIRTUAL bool Perl_is_uni_idfirst(pTHX_ U32 c);
-VIRTUAL bool Perl_is_uni_alpha(pTHX_ U32 c);
-VIRTUAL bool Perl_is_uni_ascii(pTHX_ U32 c);
-VIRTUAL bool Perl_is_uni_space(pTHX_ U32 c);
-VIRTUAL bool Perl_is_uni_cntrl(pTHX_ U32 c);
-VIRTUAL bool Perl_is_uni_graph(pTHX_ U32 c);
-VIRTUAL bool Perl_is_uni_digit(pTHX_ U32 c);
-VIRTUAL bool Perl_is_uni_upper(pTHX_ U32 c);
-VIRTUAL bool Perl_is_uni_lower(pTHX_ U32 c);
-VIRTUAL bool Perl_is_uni_print(pTHX_ U32 c);
-VIRTUAL bool Perl_is_uni_punct(pTHX_ U32 c);
-VIRTUAL bool Perl_is_uni_xdigit(pTHX_ U32 c);
-VIRTUAL U32 Perl_to_uni_upper(pTHX_ U32 c);
-VIRTUAL U32 Perl_to_uni_title(pTHX_ U32 c);
-VIRTUAL U32 Perl_to_uni_lower(pTHX_ U32 c);
-VIRTUAL bool Perl_is_uni_alnum_lc(pTHX_ U32 c);
-VIRTUAL bool Perl_is_uni_alnumc_lc(pTHX_ U32 c);
-VIRTUAL bool Perl_is_uni_idfirst_lc(pTHX_ U32 c);
-VIRTUAL bool Perl_is_uni_alpha_lc(pTHX_ U32 c);
-VIRTUAL bool Perl_is_uni_ascii_lc(pTHX_ U32 c);
-VIRTUAL bool Perl_is_uni_space_lc(pTHX_ U32 c);
-VIRTUAL bool Perl_is_uni_cntrl_lc(pTHX_ U32 c);
-VIRTUAL bool Perl_is_uni_graph_lc(pTHX_ U32 c);
-VIRTUAL bool Perl_is_uni_digit_lc(pTHX_ U32 c);
-VIRTUAL bool Perl_is_uni_upper_lc(pTHX_ U32 c);
-VIRTUAL bool Perl_is_uni_lower_lc(pTHX_ U32 c);
-VIRTUAL bool Perl_is_uni_print_lc(pTHX_ U32 c);
-VIRTUAL bool Perl_is_uni_punct_lc(pTHX_ U32 c);
-VIRTUAL bool Perl_is_uni_xdigit_lc(pTHX_ U32 c);
-VIRTUAL U32 Perl_to_uni_upper_lc(pTHX_ U32 c);
-VIRTUAL U32 Perl_to_uni_title_lc(pTHX_ U32 c);
-VIRTUAL U32 Perl_to_uni_lower_lc(pTHX_ U32 c);
-VIRTUAL bool Perl_is_utf8_alnum(pTHX_ U8 *p);
-VIRTUAL bool Perl_is_utf8_alnumc(pTHX_ U8 *p);
-VIRTUAL bool Perl_is_utf8_idfirst(pTHX_ U8 *p);
-VIRTUAL bool Perl_is_utf8_alpha(pTHX_ U8 *p);
-VIRTUAL bool Perl_is_utf8_ascii(pTHX_ U8 *p);
-VIRTUAL bool Perl_is_utf8_space(pTHX_ U8 *p);
-VIRTUAL bool Perl_is_utf8_cntrl(pTHX_ U8 *p);
-VIRTUAL bool Perl_is_utf8_digit(pTHX_ U8 *p);
-VIRTUAL bool Perl_is_utf8_graph(pTHX_ U8 *p);
-VIRTUAL bool Perl_is_utf8_upper(pTHX_ U8 *p);
-VIRTUAL bool Perl_is_utf8_lower(pTHX_ U8 *p);
-VIRTUAL bool Perl_is_utf8_print(pTHX_ U8 *p);
-VIRTUAL bool Perl_is_utf8_punct(pTHX_ U8 *p);
-VIRTUAL bool Perl_is_utf8_xdigit(pTHX_ U8 *p);
-VIRTUAL bool Perl_is_utf8_mark(pTHX_ U8 *p);
-VIRTUAL OP* Perl_jmaybe(pTHX_ OP* arg);
-VIRTUAL I32 Perl_keyword(pTHX_ char* d, I32 len);
-VIRTUAL void Perl_leave_scope(pTHX_ I32 base);
-VIRTUAL void Perl_lex_end(pTHX);
-VIRTUAL void Perl_lex_start(pTHX_ SV* line);
-VIRTUAL OP* Perl_linklist(pTHX_ OP* o);
-VIRTUAL OP* Perl_list(pTHX_ OP* o);
-VIRTUAL OP* Perl_listkids(pTHX_ OP* o);
-VIRTUAL OP* Perl_localize(pTHX_ OP* arg, I32 lexical);
-VIRTUAL I32 Perl_looks_like_number(pTHX_ SV* sv);
-VIRTUAL int Perl_magic_clearenv(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_clear_all_env(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_clearpack(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_clearsig(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_existspack(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_freeregexp(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_get(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_getarylen(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_getdefelem(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_getglob(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_getnkeys(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_getpack(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_getpos(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_getsig(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_getsubstr(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_gettaint(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_getuvar(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_getvec(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL U32 Perl_magic_len(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV char* Perl_getenv_len(pTHX_ char* key, unsigned long *len);
+#endif
+PERL_CALLCONV void Perl_gp_free(pTHX_ GV* gv);
+PERL_CALLCONV GP* Perl_gp_ref(pTHX_ GP* gp);
+PERL_CALLCONV GV* Perl_gv_AVadd(pTHX_ GV* gv);
+PERL_CALLCONV GV* Perl_gv_HVadd(pTHX_ GV* gv);
+PERL_CALLCONV GV* Perl_gv_IOadd(pTHX_ GV* gv);
+PERL_CALLCONV GV* Perl_gv_autoload4(pTHX_ HV* stash, const char* name, STRLEN len, I32 method);
+PERL_CALLCONV void Perl_gv_check(pTHX_ HV* stash);
+PERL_CALLCONV void Perl_gv_efullname(pTHX_ SV* sv, GV* gv);
+PERL_CALLCONV void Perl_gv_efullname3(pTHX_ SV* sv, GV* gv, const char* prefix);
+PERL_CALLCONV GV* Perl_gv_fetchfile(pTHX_ const char* name);
+PERL_CALLCONV GV* Perl_gv_fetchmeth(pTHX_ HV* stash, const char* name, STRLEN len, I32 level);
+PERL_CALLCONV GV* Perl_gv_fetchmethod(pTHX_ HV* stash, const char* name);
+PERL_CALLCONV GV* Perl_gv_fetchmethod_autoload(pTHX_ HV* stash, const char* name, I32 autoload);
+PERL_CALLCONV GV* Perl_gv_fetchpv(pTHX_ const char* name, I32 add, I32 sv_type);
+PERL_CALLCONV void Perl_gv_fullname(pTHX_ SV* sv, GV* gv);
+PERL_CALLCONV void Perl_gv_fullname3(pTHX_ SV* sv, GV* gv, const char* prefix);
+PERL_CALLCONV void Perl_gv_init(pTHX_ GV* gv, HV* stash, const char* name, STRLEN len, int multi);
+PERL_CALLCONV HV* Perl_gv_stashpv(pTHX_ const char* name, I32 create);
+PERL_CALLCONV HV* Perl_gv_stashpvn(pTHX_ const char* name, U32 namelen, I32 create);
+PERL_CALLCONV HV* Perl_gv_stashsv(pTHX_ SV* sv, I32 create);
+PERL_CALLCONV void Perl_hv_clear(pTHX_ HV* tb);
+PERL_CALLCONV void Perl_hv_delayfree_ent(pTHX_ HV* hv, HE* entry);
+PERL_CALLCONV SV* Perl_hv_delete(pTHX_ HV* tb, const char* key, U32 klen, I32 flags);
+PERL_CALLCONV SV* Perl_hv_delete_ent(pTHX_ HV* tb, SV* key, I32 flags, U32 hash);
+PERL_CALLCONV bool Perl_hv_exists(pTHX_ HV* tb, const char* key, U32 klen);
+PERL_CALLCONV bool Perl_hv_exists_ent(pTHX_ HV* tb, SV* key, U32 hash);
+PERL_CALLCONV SV** Perl_hv_fetch(pTHX_ HV* tb, const char* key, U32 klen, I32 lval);
+PERL_CALLCONV HE* Perl_hv_fetch_ent(pTHX_ HV* tb, SV* key, I32 lval, U32 hash);
+PERL_CALLCONV void Perl_hv_free_ent(pTHX_ HV* hv, HE* entry);
+PERL_CALLCONV I32 Perl_hv_iterinit(pTHX_ HV* tb);
+PERL_CALLCONV char* Perl_hv_iterkey(pTHX_ HE* entry, I32* retlen);
+PERL_CALLCONV SV* Perl_hv_iterkeysv(pTHX_ HE* entry);
+PERL_CALLCONV HE* Perl_hv_iternext(pTHX_ HV* tb);
+PERL_CALLCONV SV* Perl_hv_iternextsv(pTHX_ HV* hv, char** key, I32* retlen);
+PERL_CALLCONV SV* Perl_hv_iterval(pTHX_ HV* tb, HE* entry);
+PERL_CALLCONV void Perl_hv_ksplit(pTHX_ HV* hv, IV newmax);
+PERL_CALLCONV void Perl_hv_magic(pTHX_ HV* hv, GV* gv, int how);
+PERL_CALLCONV SV** Perl_hv_store(pTHX_ HV* tb, const char* key, U32 klen, SV* val, U32 hash);
+PERL_CALLCONV HE* Perl_hv_store_ent(pTHX_ HV* tb, SV* key, SV* val, U32 hash);
+PERL_CALLCONV void Perl_hv_undef(pTHX_ HV* tb);
+PERL_CALLCONV I32 Perl_ibcmp(pTHX_ const char* a, const char* b, I32 len);
+PERL_CALLCONV I32 Perl_ibcmp_locale(pTHX_ const char* a, const char* b, I32 len);
+PERL_CALLCONV bool Perl_ingroup(pTHX_ Gid_t testgid, Uid_t effective);
+PERL_CALLCONV void Perl_init_debugger(pTHX);
+PERL_CALLCONV void Perl_init_stacks(pTHX);
+PERL_CALLCONV U32 Perl_intro_my(pTHX);
+PERL_CALLCONV char* Perl_instr(pTHX_ const char* big, const char* little);
+PERL_CALLCONV bool Perl_io_close(pTHX_ IO* io, bool not_implicit);
+PERL_CALLCONV OP* Perl_invert(pTHX_ OP* cmd);
+PERL_CALLCONV bool Perl_is_uni_alnum(pTHX_ U32 c);
+PERL_CALLCONV bool Perl_is_uni_alnumc(pTHX_ U32 c);
+PERL_CALLCONV bool Perl_is_uni_idfirst(pTHX_ U32 c);
+PERL_CALLCONV bool Perl_is_uni_alpha(pTHX_ U32 c);
+PERL_CALLCONV bool Perl_is_uni_ascii(pTHX_ U32 c);
+PERL_CALLCONV bool Perl_is_uni_space(pTHX_ U32 c);
+PERL_CALLCONV bool Perl_is_uni_cntrl(pTHX_ U32 c);
+PERL_CALLCONV bool Perl_is_uni_graph(pTHX_ U32 c);
+PERL_CALLCONV bool Perl_is_uni_digit(pTHX_ U32 c);
+PERL_CALLCONV bool Perl_is_uni_upper(pTHX_ U32 c);
+PERL_CALLCONV bool Perl_is_uni_lower(pTHX_ U32 c);
+PERL_CALLCONV bool Perl_is_uni_print(pTHX_ U32 c);
+PERL_CALLCONV bool Perl_is_uni_punct(pTHX_ U32 c);
+PERL_CALLCONV bool Perl_is_uni_xdigit(pTHX_ U32 c);
+PERL_CALLCONV U32 Perl_to_uni_upper(pTHX_ U32 c);
+PERL_CALLCONV U32 Perl_to_uni_title(pTHX_ U32 c);
+PERL_CALLCONV U32 Perl_to_uni_lower(pTHX_ U32 c);
+PERL_CALLCONV bool Perl_is_uni_alnum_lc(pTHX_ U32 c);
+PERL_CALLCONV bool Perl_is_uni_alnumc_lc(pTHX_ U32 c);
+PERL_CALLCONV bool Perl_is_uni_idfirst_lc(pTHX_ U32 c);
+PERL_CALLCONV bool Perl_is_uni_alpha_lc(pTHX_ U32 c);
+PERL_CALLCONV bool Perl_is_uni_ascii_lc(pTHX_ U32 c);
+PERL_CALLCONV bool Perl_is_uni_space_lc(pTHX_ U32 c);
+PERL_CALLCONV bool Perl_is_uni_cntrl_lc(pTHX_ U32 c);
+PERL_CALLCONV bool Perl_is_uni_graph_lc(pTHX_ U32 c);
+PERL_CALLCONV bool Perl_is_uni_digit_lc(pTHX_ U32 c);
+PERL_CALLCONV bool Perl_is_uni_upper_lc(pTHX_ U32 c);
+PERL_CALLCONV bool Perl_is_uni_lower_lc(pTHX_ U32 c);
+PERL_CALLCONV bool Perl_is_uni_print_lc(pTHX_ U32 c);
+PERL_CALLCONV bool Perl_is_uni_punct_lc(pTHX_ U32 c);
+PERL_CALLCONV bool Perl_is_uni_xdigit_lc(pTHX_ U32 c);
+PERL_CALLCONV U32 Perl_to_uni_upper_lc(pTHX_ U32 c);
+PERL_CALLCONV U32 Perl_to_uni_title_lc(pTHX_ U32 c);
+PERL_CALLCONV U32 Perl_to_uni_lower_lc(pTHX_ U32 c);
+PERL_CALLCONV bool Perl_is_utf8_alnum(pTHX_ U8 *p);
+PERL_CALLCONV bool Perl_is_utf8_alnumc(pTHX_ U8 *p);
+PERL_CALLCONV bool Perl_is_utf8_idfirst(pTHX_ U8 *p);
+PERL_CALLCONV bool Perl_is_utf8_alpha(pTHX_ U8 *p);
+PERL_CALLCONV bool Perl_is_utf8_ascii(pTHX_ U8 *p);
+PERL_CALLCONV bool Perl_is_utf8_space(pTHX_ U8 *p);
+PERL_CALLCONV bool Perl_is_utf8_cntrl(pTHX_ U8 *p);
+PERL_CALLCONV bool Perl_is_utf8_digit(pTHX_ U8 *p);
+PERL_CALLCONV bool Perl_is_utf8_graph(pTHX_ U8 *p);
+PERL_CALLCONV bool Perl_is_utf8_upper(pTHX_ U8 *p);
+PERL_CALLCONV bool Perl_is_utf8_lower(pTHX_ U8 *p);
+PERL_CALLCONV bool Perl_is_utf8_print(pTHX_ U8 *p);
+PERL_CALLCONV bool Perl_is_utf8_punct(pTHX_ U8 *p);
+PERL_CALLCONV bool Perl_is_utf8_xdigit(pTHX_ U8 *p);
+PERL_CALLCONV bool Perl_is_utf8_mark(pTHX_ U8 *p);
+PERL_CALLCONV OP* Perl_jmaybe(pTHX_ OP* arg);
+PERL_CALLCONV I32 Perl_keyword(pTHX_ char* d, I32 len);
+PERL_CALLCONV void Perl_leave_scope(pTHX_ I32 base);
+PERL_CALLCONV void Perl_lex_end(pTHX);
+PERL_CALLCONV void Perl_lex_start(pTHX_ SV* line);
+PERL_CALLCONV OP* Perl_linklist(pTHX_ OP* o);
+PERL_CALLCONV OP* Perl_list(pTHX_ OP* o);
+PERL_CALLCONV OP* Perl_listkids(pTHX_ OP* o);
+PERL_CALLCONV OP* Perl_localize(pTHX_ OP* arg, I32 lexical);
+PERL_CALLCONV I32 Perl_looks_like_number(pTHX_ SV* sv);
+PERL_CALLCONV int Perl_magic_clearenv(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_clear_all_env(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_clearpack(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_clearsig(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_existspack(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_freeregexp(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_get(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_getarylen(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_getdefelem(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_getglob(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_getnkeys(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_getpack(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_getpos(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_getsig(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_getsubstr(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_gettaint(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_getuvar(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_getvec(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV U32 Perl_magic_len(pTHX_ SV* sv, MAGIC* mg);
#if defined(USE_THREADS)
-VIRTUAL int Perl_magic_mutexfree(pTHX_ SV* sv, MAGIC* mg);
-#endif
-VIRTUAL int Perl_magic_nextpack(pTHX_ SV* sv, MAGIC* mg, SV* key);
-VIRTUAL U32 Perl_magic_regdata_cnt(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_regdatum_get(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_set(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_setamagic(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_setarylen(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_setbm(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_setdbline(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_mutexfree(pTHX_ SV* sv, MAGIC* mg);
+#endif
+PERL_CALLCONV int Perl_magic_nextpack(pTHX_ SV* sv, MAGIC* mg, SV* key);
+PERL_CALLCONV U32 Perl_magic_regdata_cnt(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_regdatum_get(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_set(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_setamagic(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_setarylen(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_setbm(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_setdbline(pTHX_ SV* sv, MAGIC* mg);
#if defined(USE_LOCALE_COLLATE)
-VIRTUAL int Perl_magic_setcollxfrm(pTHX_ SV* sv, MAGIC* mg);
-#endif
-VIRTUAL int Perl_magic_setdefelem(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_setenv(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_setfm(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_setisa(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_setglob(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_setmglob(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_setnkeys(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_setpack(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_setpos(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_setsig(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_setsubstr(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_settaint(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_setuvar(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_setvec(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_set_all_env(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL U32 Perl_magic_sizepack(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL int Perl_magic_wipepack(pTHX_ SV* sv, MAGIC* mg);
-VIRTUAL void Perl_magicname(pTHX_ char* sym, char* name, I32 namlen);
-#if defined(MYMALLOC)
-VIRTUAL MEM_SIZE Perl_malloced_size(void *p);
+PERL_CALLCONV int Perl_magic_setcollxfrm(pTHX_ SV* sv, MAGIC* mg);
#endif
-VIRTUAL void Perl_markstack_grow(pTHX);
+PERL_CALLCONV int Perl_magic_setdefelem(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_setenv(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_setfm(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_setisa(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_setglob(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_setmglob(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_setnkeys(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_setpack(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_setpos(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_setsig(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_setsubstr(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_settaint(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_setuvar(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_setvec(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_set_all_env(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV U32 Perl_magic_sizepack(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV int Perl_magic_wipepack(pTHX_ SV* sv, MAGIC* mg);
+PERL_CALLCONV void Perl_magicname(pTHX_ char* sym, char* name, I32 namlen);
+PERL_CALLCONV void Perl_markstack_grow(pTHX);
#if defined(USE_LOCALE_COLLATE)
-VIRTUAL char* Perl_mem_collxfrm(pTHX_ const char* s, STRLEN len, STRLEN* xlen);
-#endif
-VIRTUAL SV* Perl_mess(pTHX_ const char* pat, ...);
-VIRTUAL SV* Perl_vmess(pTHX_ const char* pat, va_list* args);
-VIRTUAL void Perl_qerror(pTHX_ SV* err);
-VIRTUAL int Perl_mg_clear(pTHX_ SV* sv);
-VIRTUAL int Perl_mg_copy(pTHX_ SV* sv, SV* nsv, const char* key, I32 klen);
-VIRTUAL MAGIC* Perl_mg_find(pTHX_ SV* sv, int type);
-VIRTUAL int Perl_mg_free(pTHX_ SV* sv);
-VIRTUAL int Perl_mg_get(pTHX_ SV* sv);
-VIRTUAL U32 Perl_mg_length(pTHX_ SV* sv);
-VIRTUAL void Perl_mg_magical(pTHX_ SV* sv);
-VIRTUAL int Perl_mg_set(pTHX_ SV* sv);
-VIRTUAL I32 Perl_mg_size(pTHX_ SV* sv);
-VIRTUAL OP* Perl_mod(pTHX_ OP* o, I32 type);
-VIRTUAL char* Perl_moreswitches(pTHX_ char* s);
-VIRTUAL OP* Perl_my(pTHX_ OP* o);
-VIRTUAL NV Perl_my_atof(pTHX_ const char *s);
+PERL_CALLCONV char* Perl_mem_collxfrm(pTHX_ const char* s, STRLEN len, STRLEN* xlen);
+#endif
+PERL_CALLCONV SV* Perl_mess(pTHX_ const char* pat, ...);
+PERL_CALLCONV SV* Perl_vmess(pTHX_ const char* pat, va_list* args);
+PERL_CALLCONV void Perl_qerror(pTHX_ SV* err);
+PERL_CALLCONV int Perl_mg_clear(pTHX_ SV* sv);
+PERL_CALLCONV int Perl_mg_copy(pTHX_ SV* sv, SV* nsv, const char* key, I32 klen);
+PERL_CALLCONV MAGIC* Perl_mg_find(pTHX_ SV* sv, int type);
+PERL_CALLCONV int Perl_mg_free(pTHX_ SV* sv);
+PERL_CALLCONV int Perl_mg_get(pTHX_ SV* sv);
+PERL_CALLCONV U32 Perl_mg_length(pTHX_ SV* sv);
+PERL_CALLCONV void Perl_mg_magical(pTHX_ SV* sv);
+PERL_CALLCONV int Perl_mg_set(pTHX_ SV* sv);
+PERL_CALLCONV I32 Perl_mg_size(pTHX_ SV* sv);
+PERL_CALLCONV OP* Perl_mod(pTHX_ OP* o, I32 type);
+PERL_CALLCONV char* Perl_moreswitches(pTHX_ char* s);
+PERL_CALLCONV OP* Perl_my(pTHX_ OP* o);
+PERL_CALLCONV NV Perl_my_atof(pTHX_ const char *s);
#if !defined(HAS_BCOPY) || !defined(HAS_SAFE_BCOPY)
-VIRTUAL char* Perl_my_bcopy(pTHX_ const char* from, char* to, I32 len);
+PERL_CALLCONV char* Perl_my_bcopy(const char* from, char* to, I32 len);
#endif
#if !defined(HAS_BZERO) && !defined(HAS_MEMSET)
-VIRTUAL char* Perl_my_bzero(pTHX_ char* loc, I32 len);
+PERL_CALLCONV char* Perl_my_bzero(char* loc, I32 len);
#endif
-VIRTUAL void Perl_my_exit(pTHX_ U32 status) __attribute__((noreturn));
-VIRTUAL void Perl_my_failure_exit(pTHX) __attribute__((noreturn));
-VIRTUAL I32 Perl_my_fflush_all(pTHX);
-VIRTUAL I32 Perl_my_lstat(pTHX);
+PERL_CALLCONV void Perl_my_exit(pTHX_ U32 status) __attribute__((noreturn));
+PERL_CALLCONV void Perl_my_failure_exit(pTHX) __attribute__((noreturn));
+PERL_CALLCONV I32 Perl_my_fflush_all(pTHX);
+PERL_CALLCONV I32 Perl_my_lstat(pTHX);
#if !defined(HAS_MEMCMP) || !defined(HAS_SANE_MEMCMP)
-VIRTUAL I32 Perl_my_memcmp(pTHX_ const char* s1, const char* s2, I32 len);
+PERL_CALLCONV I32 Perl_my_memcmp(const char* s1, const char* s2, I32 len);
#endif
#if !defined(HAS_MEMSET)
-VIRTUAL void* Perl_my_memset(pTHX_ char* loc, I32 ch, I32 len);
+PERL_CALLCONV void* Perl_my_memset(char* loc, I32 ch, I32 len);
#endif
#if !defined(PERL_OBJECT)
-VIRTUAL I32 Perl_my_pclose(pTHX_ PerlIO* ptr);
-VIRTUAL PerlIO* Perl_my_popen(pTHX_ char* cmd, char* mode);
+PERL_CALLCONV I32 Perl_my_pclose(pTHX_ PerlIO* ptr);
+PERL_CALLCONV PerlIO* Perl_my_popen(pTHX_ char* cmd, char* mode);
#endif
-VIRTUAL void Perl_my_setenv(pTHX_ char* nam, char* val);
-VIRTUAL I32 Perl_my_stat(pTHX);
+PERL_CALLCONV void Perl_my_setenv(pTHX_ char* nam, char* val);
+PERL_CALLCONV I32 Perl_my_stat(pTHX);
#if defined(MYSWAP)
-VIRTUAL short Perl_my_swap(pTHX_ short s);
-VIRTUAL long Perl_my_htonl(pTHX_ long l);
-VIRTUAL long Perl_my_ntohl(pTHX_ long l);
-#endif
-VIRTUAL void Perl_my_unexec(pTHX);
-VIRTUAL OP* Perl_newANONLIST(pTHX_ OP* o);
-VIRTUAL OP* Perl_newANONHASH(pTHX_ OP* o);
-VIRTUAL OP* Perl_newANONSUB(pTHX_ I32 floor, OP* proto, OP* block);
-VIRTUAL OP* Perl_newASSIGNOP(pTHX_ I32 flags, OP* left, I32 optype, OP* right);
-VIRTUAL OP* Perl_newCONDOP(pTHX_ I32 flags, OP* expr, OP* trueop, OP* falseop);
-VIRTUAL void Perl_newCONSTSUB(pTHX_ HV* stash, char* name, SV* sv);
-VIRTUAL void Perl_newFORM(pTHX_ I32 floor, OP* o, OP* block);
-VIRTUAL OP* Perl_newFOROP(pTHX_ I32 flags, char* label, line_t forline, OP* sclr, OP* expr, OP*block, OP*cont);
-VIRTUAL OP* Perl_newLOGOP(pTHX_ I32 optype, I32 flags, OP* left, OP* right);
-VIRTUAL OP* Perl_newLOOPEX(pTHX_ I32 type, OP* label);
-VIRTUAL OP* Perl_newLOOPOP(pTHX_ I32 flags, I32 debuggable, OP* expr, OP* block);
-VIRTUAL OP* Perl_newNULLLIST(pTHX);
-VIRTUAL OP* Perl_newOP(pTHX_ I32 optype, I32 flags);
-VIRTUAL void Perl_newPROG(pTHX_ OP* o);
-VIRTUAL OP* Perl_newRANGE(pTHX_ I32 flags, OP* left, OP* right);
-VIRTUAL OP* Perl_newSLICEOP(pTHX_ I32 flags, OP* subscript, OP* listop);
-VIRTUAL OP* Perl_newSTATEOP(pTHX_ I32 flags, char* label, OP* o);
-VIRTUAL CV* Perl_newSUB(pTHX_ I32 floor, OP* o, OP* proto, OP* block);
-VIRTUAL CV* Perl_newXS(pTHX_ char* name, XSUBADDR_t f, char* filename);
-VIRTUAL AV* Perl_newAV(pTHX);
-VIRTUAL OP* Perl_newAVREF(pTHX_ OP* o);
-VIRTUAL OP* Perl_newBINOP(pTHX_ I32 type, I32 flags, OP* first, OP* last);
-VIRTUAL OP* Perl_newCVREF(pTHX_ I32 flags, OP* o);
-VIRTUAL OP* Perl_newGVOP(pTHX_ I32 type, I32 flags, GV* gv);
-VIRTUAL GV* Perl_newGVgen(pTHX_ char* pack);
-VIRTUAL OP* Perl_newGVREF(pTHX_ I32 type, OP* o);
-VIRTUAL OP* Perl_newHVREF(pTHX_ OP* o);
-VIRTUAL HV* Perl_newHV(pTHX);
-VIRTUAL HV* Perl_newHVhv(pTHX_ HV* hv);
-VIRTUAL IO* Perl_newIO(pTHX);
-VIRTUAL OP* Perl_newLISTOP(pTHX_ I32 type, I32 flags, OP* first, OP* last);
-VIRTUAL OP* Perl_newPMOP(pTHX_ I32 type, I32 flags);
-VIRTUAL OP* Perl_newPVOP(pTHX_ I32 type, I32 flags, char* pv);
-VIRTUAL SV* Perl_newRV(pTHX_ SV* pref);
-VIRTUAL SV* Perl_newRV_noinc(pTHX_ SV *sv);
-VIRTUAL SV* Perl_newSV(pTHX_ STRLEN len);
-VIRTUAL OP* Perl_newSVREF(pTHX_ OP* o);
-VIRTUAL OP* Perl_newSVOP(pTHX_ I32 type, I32 flags, SV* sv);
-VIRTUAL SV* Perl_newSViv(pTHX_ IV i);
-VIRTUAL SV* Perl_newSVnv(pTHX_ NV n);
-VIRTUAL SV* Perl_newSVpv(pTHX_ const char* s, STRLEN len);
-VIRTUAL SV* Perl_newSVpvn(pTHX_ const char* s, STRLEN len);
-VIRTUAL SV* Perl_newSVpvf(pTHX_ const char* pat, ...);
-VIRTUAL SV* Perl_vnewSVpvf(pTHX_ const char* pat, va_list* args);
-VIRTUAL SV* Perl_newSVrv(pTHX_ SV* rv, const char* classname);
-VIRTUAL SV* Perl_newSVsv(pTHX_ SV* old);
-VIRTUAL OP* Perl_newUNOP(pTHX_ I32 type, I32 flags, OP* first);
-VIRTUAL OP* Perl_newWHILEOP(pTHX_ I32 flags, I32 debuggable, LOOP* loop, I32 whileline, OP* expr, OP* block, OP* cont);
-VIRTUAL PERL_SI* Perl_new_stackinfo(pTHX_ I32 stitems, I32 cxitems);
-VIRTUAL PerlIO* Perl_nextargv(pTHX_ GV* gv);
-VIRTUAL char* Perl_ninstr(pTHX_ const char* big, const char* bigend, const char* little, const char* lend);
-VIRTUAL OP* Perl_oopsCV(pTHX_ OP* o);
-VIRTUAL void Perl_op_free(pTHX_ OP* arg);
-VIRTUAL void Perl_package(pTHX_ OP* o);
-VIRTUAL PADOFFSET Perl_pad_alloc(pTHX_ I32 optype, U32 tmptype);
-VIRTUAL PADOFFSET Perl_pad_allocmy(pTHX_ char* name);
-VIRTUAL PADOFFSET Perl_pad_findmy(pTHX_ char* name);
-VIRTUAL OP* Perl_oopsAV(pTHX_ OP* o);
-VIRTUAL OP* Perl_oopsHV(pTHX_ OP* o);
-VIRTUAL void Perl_pad_leavemy(pTHX_ I32 fill);
-VIRTUAL SV* Perl_pad_sv(pTHX_ PADOFFSET po);
-VIRTUAL void Perl_pad_free(pTHX_ PADOFFSET po);
-VIRTUAL void Perl_pad_reset(pTHX);
-VIRTUAL void Perl_pad_swipe(pTHX_ PADOFFSET po);
-VIRTUAL void Perl_peep(pTHX_ OP* o);
+PERL_CALLCONV short Perl_my_swap(pTHX_ short s);
+PERL_CALLCONV long Perl_my_htonl(pTHX_ long l);
+PERL_CALLCONV long Perl_my_ntohl(pTHX_ long l);
+#endif
+PERL_CALLCONV void Perl_my_unexec(pTHX);
+PERL_CALLCONV OP* Perl_newANONLIST(pTHX_ OP* o);
+PERL_CALLCONV OP* Perl_newANONHASH(pTHX_ OP* o);
+PERL_CALLCONV OP* Perl_newANONSUB(pTHX_ I32 floor, OP* proto, OP* block);
+PERL_CALLCONV OP* Perl_newASSIGNOP(pTHX_ I32 flags, OP* left, I32 optype, OP* right);
+PERL_CALLCONV OP* Perl_newCONDOP(pTHX_ I32 flags, OP* expr, OP* trueop, OP* falseop);
+PERL_CALLCONV void Perl_newCONSTSUB(pTHX_ HV* stash, char* name, SV* sv);
+PERL_CALLCONV void Perl_newFORM(pTHX_ I32 floor, OP* o, OP* block);
+PERL_CALLCONV OP* Perl_newFOROP(pTHX_ I32 flags, char* label, line_t forline, OP* sclr, OP* expr, OP*block, OP*cont);
+PERL_CALLCONV OP* Perl_newLOGOP(pTHX_ I32 optype, I32 flags, OP* left, OP* right);
+PERL_CALLCONV OP* Perl_newLOOPEX(pTHX_ I32 type, OP* label);
+PERL_CALLCONV OP* Perl_newLOOPOP(pTHX_ I32 flags, I32 debuggable, OP* expr, OP* block);
+PERL_CALLCONV OP* Perl_newNULLLIST(pTHX);
+PERL_CALLCONV OP* Perl_newOP(pTHX_ I32 optype, I32 flags);
+PERL_CALLCONV void Perl_newPROG(pTHX_ OP* o);
+PERL_CALLCONV OP* Perl_newRANGE(pTHX_ I32 flags, OP* left, OP* right);
+PERL_CALLCONV OP* Perl_newSLICEOP(pTHX_ I32 flags, OP* subscript, OP* listop);
+PERL_CALLCONV OP* Perl_newSTATEOP(pTHX_ I32 flags, char* label, OP* o);
+PERL_CALLCONV CV* Perl_newSUB(pTHX_ I32 floor, OP* o, OP* proto, OP* block);
+PERL_CALLCONV CV* Perl_newXS(pTHX_ char* name, XSUBADDR_t f, char* filename);
+PERL_CALLCONV AV* Perl_newAV(pTHX);
+PERL_CALLCONV OP* Perl_newAVREF(pTHX_ OP* o);
+PERL_CALLCONV OP* Perl_newBINOP(pTHX_ I32 type, I32 flags, OP* first, OP* last);
+PERL_CALLCONV OP* Perl_newCVREF(pTHX_ I32 flags, OP* o);
+PERL_CALLCONV OP* Perl_newGVOP(pTHX_ I32 type, I32 flags, GV* gv);
+PERL_CALLCONV GV* Perl_newGVgen(pTHX_ char* pack);
+PERL_CALLCONV OP* Perl_newGVREF(pTHX_ I32 type, OP* o);
+PERL_CALLCONV OP* Perl_newHVREF(pTHX_ OP* o);
+PERL_CALLCONV HV* Perl_newHV(pTHX);
+PERL_CALLCONV HV* Perl_newHVhv(pTHX_ HV* hv);
+PERL_CALLCONV IO* Perl_newIO(pTHX);
+PERL_CALLCONV OP* Perl_newLISTOP(pTHX_ I32 type, I32 flags, OP* first, OP* last);
+PERL_CALLCONV OP* Perl_newPADOP(pTHX_ I32 type, I32 flags, SV* sv);
+PERL_CALLCONV OP* Perl_newPMOP(pTHX_ I32 type, I32 flags);
+PERL_CALLCONV OP* Perl_newPVOP(pTHX_ I32 type, I32 flags, char* pv);
+PERL_CALLCONV SV* Perl_newRV(pTHX_ SV* pref);
+PERL_CALLCONV SV* Perl_newRV_noinc(pTHX_ SV *sv);
+PERL_CALLCONV SV* Perl_newSV(pTHX_ STRLEN len);
+PERL_CALLCONV OP* Perl_newSVREF(pTHX_ OP* o);
+PERL_CALLCONV OP* Perl_newSVOP(pTHX_ I32 type, I32 flags, SV* sv);
+PERL_CALLCONV SV* Perl_newSViv(pTHX_ IV i);
+PERL_CALLCONV SV* Perl_newSVnv(pTHX_ NV n);
+PERL_CALLCONV SV* Perl_newSVpv(pTHX_ const char* s, STRLEN len);
+PERL_CALLCONV SV* Perl_newSVpvn(pTHX_ const char* s, STRLEN len);
+PERL_CALLCONV SV* Perl_newSVpvf(pTHX_ const char* pat, ...);
+PERL_CALLCONV SV* Perl_vnewSVpvf(pTHX_ const char* pat, va_list* args);
+PERL_CALLCONV SV* Perl_newSVrv(pTHX_ SV* rv, const char* classname);
+PERL_CALLCONV SV* Perl_newSVsv(pTHX_ SV* old);
+PERL_CALLCONV OP* Perl_newUNOP(pTHX_ I32 type, I32 flags, OP* first);
+PERL_CALLCONV OP* Perl_newWHILEOP(pTHX_ I32 flags, I32 debuggable, LOOP* loop, I32 whileline, OP* expr, OP* block, OP* cont);
+
+PERL_CALLCONV PERL_SI* Perl_new_stackinfo(pTHX_ I32 stitems, I32 cxitems);
+PERL_CALLCONV PerlIO* Perl_nextargv(pTHX_ GV* gv);
+PERL_CALLCONV char* Perl_ninstr(pTHX_ const char* big, const char* bigend, const char* little, const char* lend);
+PERL_CALLCONV OP* Perl_oopsCV(pTHX_ OP* o);
+PERL_CALLCONV void Perl_op_free(pTHX_ OP* arg);
+PERL_CALLCONV void Perl_package(pTHX_ OP* o);
+PERL_CALLCONV PADOFFSET Perl_pad_alloc(pTHX_ I32 optype, U32 tmptype);
+PERL_CALLCONV PADOFFSET Perl_pad_allocmy(pTHX_ char* name);
+PERL_CALLCONV PADOFFSET Perl_pad_findmy(pTHX_ char* name);
+PERL_CALLCONV OP* Perl_oopsAV(pTHX_ OP* o);
+PERL_CALLCONV OP* Perl_oopsHV(pTHX_ OP* o);
+PERL_CALLCONV void Perl_pad_leavemy(pTHX_ I32 fill);
+PERL_CALLCONV SV* Perl_pad_sv(pTHX_ PADOFFSET po);
+PERL_CALLCONV void Perl_pad_free(pTHX_ PADOFFSET po);
+PERL_CALLCONV void Perl_pad_reset(pTHX);
+PERL_CALLCONV void Perl_pad_swipe(pTHX_ PADOFFSET po);
+PERL_CALLCONV void Perl_peep(pTHX_ OP* o);
#if defined(PERL_OBJECT)
-VIRTUAL void perl_construct(void);
-VIRTUAL void perl_destruct(void);
-VIRTUAL void perl_free(void);
-VIRTUAL int perl_run(void);
-VIRTUAL int perl_parse(XSINIT_t xsinit, int argc, char** argv, char** env);
-#else
-VIRTUAL PerlInterpreter* perl_alloc(void);
-VIRTUAL void perl_construct(PerlInterpreter* sv_interp);
-VIRTUAL void perl_destruct(PerlInterpreter* sv_interp);
-VIRTUAL void perl_free(PerlInterpreter* sv_interp);
-VIRTUAL int perl_run(PerlInterpreter* sv_interp);
-VIRTUAL int perl_parse(PerlInterpreter* sv_interp, XSINIT_t xsinit, int argc, char** argv, char** env);
+PERL_CALLCONV void Perl_construct(pTHX);
+PERL_CALLCONV void Perl_destruct(pTHX);
+PERL_CALLCONV void Perl_free(pTHX);
+PERL_CALLCONV int Perl_run(pTHX);
+PERL_CALLCONV int Perl_parse(pTHX_ XSINIT_t xsinit, int argc, char** argv, char** env);
+#endif
#if defined(USE_THREADS)
-VIRTUAL struct perl_thread* Perl_new_struct_thread(pTHX_ struct perl_thread *t);
-#endif
-#endif
-VIRTUAL void Perl_call_atexit(pTHX_ ATEXIT_t fn, void *ptr);
-VIRTUAL I32 Perl_call_argv(pTHX_ const char* sub_name, I32 flags, char** argv);
-VIRTUAL I32 Perl_call_method(pTHX_ const char* methname, I32 flags);
-VIRTUAL I32 Perl_call_pv(pTHX_ const char* sub_name, I32 flags);
-VIRTUAL I32 Perl_call_sv(pTHX_ SV* sv, I32 flags);
-VIRTUAL SV* Perl_eval_pv(pTHX_ const char* p, I32 croak_on_error);
-VIRTUAL I32 Perl_eval_sv(pTHX_ SV* sv, I32 flags);
-VIRTUAL SV* Perl_get_sv(pTHX_ const char* name, I32 create);
-VIRTUAL AV* Perl_get_av(pTHX_ const char* name, I32 create);
-VIRTUAL HV* Perl_get_hv(pTHX_ const char* name, I32 create);
-VIRTUAL CV* Perl_get_cv(pTHX_ const char* name, I32 create);
-VIRTUAL int Perl_init_i18nl10n(pTHX_ int printwarn);
-VIRTUAL int Perl_init_i18nl14n(pTHX_ int printwarn);
-VIRTUAL void Perl_new_collate(pTHX_ const char* newcoll);
-VIRTUAL void Perl_new_ctype(pTHX_ const char* newctype);
-VIRTUAL void Perl_new_numeric(pTHX_ const char* newcoll);
-VIRTUAL void Perl_set_numeric_local(pTHX);
-VIRTUAL void Perl_set_numeric_radix(pTHX);
-VIRTUAL void Perl_set_numeric_standard(pTHX);
-VIRTUAL void Perl_require_pv(pTHX_ const char* pv);
-VIRTUAL void Perl_pidgone(pTHX_ Pid_t pid, int status);
-VIRTUAL void Perl_pmflag(pTHX_ U16* pmfl, int ch);
-VIRTUAL OP* Perl_pmruntime(pTHX_ OP* pm, OP* expr, OP* repl);
-VIRTUAL OP* Perl_pmtrans(pTHX_ OP* o, OP* expr, OP* repl);
-VIRTUAL OP* Perl_pop_return(pTHX);
-VIRTUAL void Perl_pop_scope(pTHX);
-VIRTUAL OP* Perl_prepend_elem(pTHX_ I32 optype, OP* head, OP* tail);
-VIRTUAL void Perl_push_return(pTHX_ OP* o);
-VIRTUAL void Perl_push_scope(pTHX);
-VIRTUAL OP* Perl_ref(pTHX_ OP* o, I32 type);
-VIRTUAL OP* Perl_refkids(pTHX_ OP* o, I32 type);
-VIRTUAL void Perl_regdump(pTHX_ regexp* r);
-VIRTUAL I32 Perl_pregexec(pTHX_ regexp* prog, char* stringarg, char* strend, char* strbeg, I32 minend, SV* screamer, U32 nosave);
-VIRTUAL void Perl_pregfree(pTHX_ struct regexp* r);
-VIRTUAL regexp* Perl_pregcomp(pTHX_ char* exp, char* xend, PMOP* pm);
-VIRTUAL char* Perl_re_intuit_start(pTHX_ regexp* prog, SV* sv, char* strpos, char* strend, U32 flags, struct re_scream_pos_data_s *data);
-VIRTUAL SV* Perl_re_intuit_string(pTHX_ regexp* prog);
-VIRTUAL I32 Perl_regexec_flags(pTHX_ regexp* prog, char* stringarg, char* strend, char* strbeg, I32 minend, SV* screamer, void* data, U32 flags);
-VIRTUAL regnode* Perl_regnext(pTHX_ regnode* p);
-VIRTUAL void Perl_regprop(pTHX_ SV* sv, regnode* o);
-VIRTUAL void Perl_repeatcpy(pTHX_ char* to, const char* from, I32 len, I32 count);
-VIRTUAL char* Perl_rninstr(pTHX_ const char* big, const char* bigend, const char* little, const char* lend);
-VIRTUAL Sighandler_t Perl_rsignal(pTHX_ int i, Sighandler_t t);
-VIRTUAL int Perl_rsignal_restore(pTHX_ int i, Sigsave_t* t);
-VIRTUAL int Perl_rsignal_save(pTHX_ int i, Sighandler_t t1, Sigsave_t* t2);
-VIRTUAL Sighandler_t Perl_rsignal_state(pTHX_ int i);
-VIRTUAL void Perl_rxres_free(pTHX_ void** rsp);
-VIRTUAL void Perl_rxres_restore(pTHX_ void** rsp, REGEXP* prx);
-VIRTUAL void Perl_rxres_save(pTHX_ void** rsp, REGEXP* prx);
+PERL_CALLCONV struct perl_thread* Perl_new_struct_thread(pTHX_ struct perl_thread *t);
+#endif
+PERL_CALLCONV void Perl_call_atexit(pTHX_ ATEXIT_t fn, void *ptr);
+PERL_CALLCONV I32 Perl_call_argv(pTHX_ const char* sub_name, I32 flags, char** argv);
+PERL_CALLCONV I32 Perl_call_method(pTHX_ const char* methname, I32 flags);
+PERL_CALLCONV I32 Perl_call_pv(pTHX_ const char* sub_name, I32 flags);
+PERL_CALLCONV I32 Perl_call_sv(pTHX_ SV* sv, I32 flags);
+PERL_CALLCONV SV* Perl_eval_pv(pTHX_ const char* p, I32 croak_on_error);
+PERL_CALLCONV I32 Perl_eval_sv(pTHX_ SV* sv, I32 flags);
+PERL_CALLCONV SV* Perl_get_sv(pTHX_ const char* name, I32 create);
+PERL_CALLCONV AV* Perl_get_av(pTHX_ const char* name, I32 create);
+PERL_CALLCONV HV* Perl_get_hv(pTHX_ const char* name, I32 create);
+PERL_CALLCONV CV* Perl_get_cv(pTHX_ const char* name, I32 create);
+PERL_CALLCONV int Perl_init_i18nl10n(pTHX_ int printwarn);
+PERL_CALLCONV int Perl_init_i18nl14n(pTHX_ int printwarn);
+PERL_CALLCONV void Perl_new_collate(pTHX_ const char* newcoll);
+PERL_CALLCONV void Perl_new_ctype(pTHX_ const char* newctype);
+PERL_CALLCONV void Perl_new_numeric(pTHX_ const char* newcoll);
+PERL_CALLCONV void Perl_set_numeric_local(pTHX);
+PERL_CALLCONV void Perl_set_numeric_radix(pTHX);
+PERL_CALLCONV void Perl_set_numeric_standard(pTHX);
+PERL_CALLCONV void Perl_require_pv(pTHX_ const char* pv);
+PERL_CALLCONV void Perl_pidgone(pTHX_ Pid_t pid, int status);
+PERL_CALLCONV void Perl_pmflag(pTHX_ U16* pmfl, int ch);
+PERL_CALLCONV OP* Perl_pmruntime(pTHX_ OP* pm, OP* expr, OP* repl);
+PERL_CALLCONV OP* Perl_pmtrans(pTHX_ OP* o, OP* expr, OP* repl);
+PERL_CALLCONV OP* Perl_pop_return(pTHX);
+PERL_CALLCONV void Perl_pop_scope(pTHX);
+PERL_CALLCONV OP* Perl_prepend_elem(pTHX_ I32 optype, OP* head, OP* tail);
+PERL_CALLCONV void Perl_push_return(pTHX_ OP* o);
+PERL_CALLCONV void Perl_push_scope(pTHX);
+PERL_CALLCONV OP* Perl_ref(pTHX_ OP* o, I32 type);
+PERL_CALLCONV OP* Perl_refkids(pTHX_ OP* o, I32 type);
+PERL_CALLCONV void Perl_regdump(pTHX_ regexp* r);
+PERL_CALLCONV I32 Perl_pregexec(pTHX_ regexp* prog, char* stringarg, char* strend, char* strbeg, I32 minend, SV* screamer, U32 nosave);
+PERL_CALLCONV void Perl_pregfree(pTHX_ struct regexp* r);
+PERL_CALLCONV regexp* Perl_pregcomp(pTHX_ char* exp, char* xend, PMOP* pm);
+PERL_CALLCONV char* Perl_re_intuit_start(pTHX_ regexp* prog, SV* sv, char* strpos, char* strend, U32 flags, struct re_scream_pos_data_s *data);
+PERL_CALLCONV SV* Perl_re_intuit_string(pTHX_ regexp* prog);
+PERL_CALLCONV I32 Perl_regexec_flags(pTHX_ regexp* prog, char* stringarg, char* strend, char* strbeg, I32 minend, SV* screamer, void* data, U32 flags);
+PERL_CALLCONV regnode* Perl_regnext(pTHX_ regnode* p);
+PERL_CALLCONV void Perl_regprop(pTHX_ SV* sv, regnode* o);
+PERL_CALLCONV void Perl_repeatcpy(pTHX_ char* to, const char* from, I32 len, I32 count);
+PERL_CALLCONV char* Perl_rninstr(pTHX_ const char* big, const char* bigend, const char* little, const char* lend);
+PERL_CALLCONV Sighandler_t Perl_rsignal(pTHX_ int i, Sighandler_t t);
+PERL_CALLCONV int Perl_rsignal_restore(pTHX_ int i, Sigsave_t* t);
+PERL_CALLCONV int Perl_rsignal_save(pTHX_ int i, Sighandler_t t1, Sigsave_t* t2);
+PERL_CALLCONV Sighandler_t Perl_rsignal_state(pTHX_ int i);
+PERL_CALLCONV void Perl_rxres_free(pTHX_ void** rsp);
+PERL_CALLCONV void Perl_rxres_restore(pTHX_ void** rsp, REGEXP* prx);
+PERL_CALLCONV void Perl_rxres_save(pTHX_ void** rsp, REGEXP* prx);
#if !defined(HAS_RENAME)
-VIRTUAL I32 Perl_same_dirent(pTHX_ char* a, char* b);
-#endif
-VIRTUAL char* Perl_savepv(pTHX_ const char* sv);
-VIRTUAL char* Perl_savepvn(pTHX_ const char* sv, I32 len);
-VIRTUAL void Perl_savestack_grow(pTHX);
-VIRTUAL void Perl_save_aelem(pTHX_ AV* av, I32 idx, SV **sptr);
-VIRTUAL I32 Perl_save_alloc(pTHX_ I32 size, I32 pad);
-VIRTUAL void Perl_save_aptr(pTHX_ AV** aptr);
-VIRTUAL AV* Perl_save_ary(pTHX_ GV* gv);
-VIRTUAL void Perl_save_clearsv(pTHX_ SV** svp);
-VIRTUAL void Perl_save_delete(pTHX_ HV* hv, char* key, I32 klen);
-VIRTUAL void Perl_save_destructor(pTHX_ DESTRUCTORFUNC_t f, void* p);
-VIRTUAL void Perl_save_freesv(pTHX_ SV* sv);
-VIRTUAL void Perl_save_freeop(pTHX_ OP* o);
-VIRTUAL void Perl_save_freepv(pTHX_ char* pv);
-VIRTUAL void Perl_save_generic_svref(pTHX_ SV** sptr);
-VIRTUAL void Perl_save_gp(pTHX_ GV* gv, I32 empty);
-VIRTUAL HV* Perl_save_hash(pTHX_ GV* gv);
-VIRTUAL void Perl_save_helem(pTHX_ HV* hv, SV *key, SV **sptr);
-VIRTUAL void Perl_save_hints(pTHX);
-VIRTUAL void Perl_save_hptr(pTHX_ HV** hptr);
-VIRTUAL void Perl_save_I16(pTHX_ I16* intp);
-VIRTUAL void Perl_save_I32(pTHX_ I32* intp);
-VIRTUAL void Perl_save_int(pTHX_ int* intp);
-VIRTUAL void Perl_save_item(pTHX_ SV* item);
-VIRTUAL void Perl_save_iv(pTHX_ IV* iv);
-VIRTUAL void Perl_save_list(pTHX_ SV** sarg, I32 maxsarg);
-VIRTUAL void Perl_save_long(pTHX_ long* longp);
-VIRTUAL void Perl_save_nogv(pTHX_ GV* gv);
-VIRTUAL void Perl_save_op(pTHX);
-VIRTUAL SV* Perl_save_scalar(pTHX_ GV* gv);
-VIRTUAL void Perl_save_pptr(pTHX_ char** pptr);
-VIRTUAL void Perl_save_re_context(pTHX);
-VIRTUAL void Perl_save_sptr(pTHX_ SV** sptr);
-VIRTUAL SV* Perl_save_svref(pTHX_ SV** sptr);
-VIRTUAL SV** Perl_save_threadsv(pTHX_ PADOFFSET i);
-VIRTUAL OP* Perl_sawparens(pTHX_ OP* o);
-VIRTUAL OP* Perl_scalar(pTHX_ OP* o);
-VIRTUAL OP* Perl_scalarkids(pTHX_ OP* o);
-VIRTUAL OP* Perl_scalarseq(pTHX_ OP* o);
-VIRTUAL OP* Perl_scalarvoid(pTHX_ OP* o);
-VIRTUAL NV Perl_scan_bin(pTHX_ char* start, I32 len, I32* retlen);
-VIRTUAL NV Perl_scan_hex(pTHX_ char* start, I32 len, I32* retlen);
-VIRTUAL char* Perl_scan_num(pTHX_ char* s);
-VIRTUAL NV Perl_scan_oct(pTHX_ char* start, I32 len, I32* retlen);
-VIRTUAL OP* Perl_scope(pTHX_ OP* o);
-VIRTUAL char* Perl_screaminstr(pTHX_ SV* bigsv, SV* littlesv, I32 start_shift, I32 end_shift, I32 *state, I32 last);
+PERL_CALLCONV I32 Perl_same_dirent(pTHX_ char* a, char* b);
+#endif
+PERL_CALLCONV char* Perl_savepv(pTHX_ const char* sv);
+PERL_CALLCONV char* Perl_savepvn(pTHX_ const char* sv, I32 len);
+PERL_CALLCONV void Perl_savestack_grow(pTHX);
+PERL_CALLCONV void Perl_save_aelem(pTHX_ AV* av, I32 idx, SV **sptr);
+PERL_CALLCONV I32 Perl_save_alloc(pTHX_ I32 size, I32 pad);
+PERL_CALLCONV void Perl_save_aptr(pTHX_ AV** aptr);
+PERL_CALLCONV AV* Perl_save_ary(pTHX_ GV* gv);
+PERL_CALLCONV void Perl_save_clearsv(pTHX_ SV** svp);
+PERL_CALLCONV void Perl_save_delete(pTHX_ HV* hv, char* key, I32 klen);
+PERL_CALLCONV void Perl_save_destructor(pTHX_ DESTRUCTORFUNC_NOCONTEXT_t f, void* p);
+PERL_CALLCONV void Perl_save_destructor_x(pTHX_ DESTRUCTORFUNC_t f, void* p);
+PERL_CALLCONV void Perl_save_freesv(pTHX_ SV* sv);
+PERL_CALLCONV void Perl_save_freeop(pTHX_ OP* o);
+PERL_CALLCONV void Perl_save_freepv(pTHX_ char* pv);
+PERL_CALLCONV void Perl_save_generic_svref(pTHX_ SV** sptr);
+PERL_CALLCONV void Perl_save_gp(pTHX_ GV* gv, I32 empty);
+PERL_CALLCONV HV* Perl_save_hash(pTHX_ GV* gv);
+PERL_CALLCONV void Perl_save_helem(pTHX_ HV* hv, SV *key, SV **sptr);
+PERL_CALLCONV void Perl_save_hints(pTHX);
+PERL_CALLCONV void Perl_save_hptr(pTHX_ HV** hptr);
+PERL_CALLCONV void Perl_save_I16(pTHX_ I16* intp);
+PERL_CALLCONV void Perl_save_I32(pTHX_ I32* intp);
+PERL_CALLCONV void Perl_save_I8(pTHX_ I8* bytep);
+PERL_CALLCONV void Perl_save_int(pTHX_ int* intp);
+PERL_CALLCONV void Perl_save_item(pTHX_ SV* item);
+PERL_CALLCONV void Perl_save_iv(pTHX_ IV* iv);
+PERL_CALLCONV void Perl_save_list(pTHX_ SV** sarg, I32 maxsarg);
+PERL_CALLCONV void Perl_save_long(pTHX_ long* longp);
+PERL_CALLCONV void Perl_save_nogv(pTHX_ GV* gv);
+PERL_CALLCONV void Perl_save_op(pTHX);
+PERL_CALLCONV SV* Perl_save_scalar(pTHX_ GV* gv);
+PERL_CALLCONV void Perl_save_pptr(pTHX_ char** pptr);
+PERL_CALLCONV void Perl_save_vptr(pTHX_ void* pptr);
+PERL_CALLCONV void Perl_save_re_context(pTHX);
+PERL_CALLCONV void Perl_save_sptr(pTHX_ SV** sptr);
+PERL_CALLCONV SV* Perl_save_svref(pTHX_ SV** sptr);
+PERL_CALLCONV SV** Perl_save_threadsv(pTHX_ PADOFFSET i);
+PERL_CALLCONV OP* Perl_sawparens(pTHX_ OP* o);
+PERL_CALLCONV OP* Perl_scalar(pTHX_ OP* o);
+PERL_CALLCONV OP* Perl_scalarkids(pTHX_ OP* o);
+PERL_CALLCONV OP* Perl_scalarseq(pTHX_ OP* o);
+PERL_CALLCONV OP* Perl_scalarvoid(pTHX_ OP* o);
+PERL_CALLCONV NV Perl_scan_bin(pTHX_ char* start, I32 len, I32* retlen);
+PERL_CALLCONV NV Perl_scan_hex(pTHX_ char* start, I32 len, I32* retlen);
+PERL_CALLCONV char* Perl_scan_num(pTHX_ char* s);
+PERL_CALLCONV NV Perl_scan_oct(pTHX_ char* start, I32 len, I32* retlen);
+PERL_CALLCONV OP* Perl_scope(pTHX_ OP* o);
+PERL_CALLCONV char* Perl_screaminstr(pTHX_ SV* bigsv, SV* littlesv, I32 start_shift, I32 end_shift, I32 *state, I32 last);
#if !defined(VMS)
-VIRTUAL I32 Perl_setenv_getix(pTHX_ char* nam);
-#endif
-VIRTUAL void Perl_setdefout(pTHX_ GV* gv);
-VIRTUAL char* Perl_sharepvn(pTHX_ const char* sv, I32 len, U32 hash);
-VIRTUAL HEK* Perl_share_hek(pTHX_ const char* sv, I32 len, U32 hash);
-VIRTUAL Signal_t Perl_sighandler(int sig);
-VIRTUAL SV** Perl_stack_grow(pTHX_ SV** sp, SV**p, int n);
-VIRTUAL I32 Perl_start_subparse(pTHX_ I32 is_format, U32 flags);
-VIRTUAL void Perl_sub_crush_depth(pTHX_ CV* cv);
-VIRTUAL bool Perl_sv_2bool(pTHX_ SV* sv);
-VIRTUAL CV* Perl_sv_2cv(pTHX_ SV* sv, HV** st, GV** gvp, I32 lref);
-VIRTUAL IO* Perl_sv_2io(pTHX_ SV* sv);
-VIRTUAL IV Perl_sv_2iv(pTHX_ SV* sv);
-VIRTUAL SV* Perl_sv_2mortal(pTHX_ SV* sv);
-VIRTUAL NV Perl_sv_2nv(pTHX_ SV* sv);
-VIRTUAL char* Perl_sv_2pv(pTHX_ SV* sv, STRLEN* lp);
-VIRTUAL UV Perl_sv_2uv(pTHX_ SV* sv);
-VIRTUAL IV Perl_sv_iv(pTHX_ SV* sv);
-VIRTUAL UV Perl_sv_uv(pTHX_ SV* sv);
-VIRTUAL NV Perl_sv_nv(pTHX_ SV* sv);
-VIRTUAL char* Perl_sv_pvn(pTHX_ SV *sv, STRLEN *len);
-VIRTUAL I32 Perl_sv_true(pTHX_ SV *sv);
-VIRTUAL void Perl_sv_add_arena(pTHX_ char* ptr, U32 size, U32 flags);
-VIRTUAL int Perl_sv_backoff(pTHX_ SV* sv);
-VIRTUAL SV* Perl_sv_bless(pTHX_ SV* sv, HV* stash);
-VIRTUAL void Perl_sv_catpvf(pTHX_ SV* sv, const char* pat, ...);
-VIRTUAL void Perl_sv_vcatpvf(pTHX_ SV* sv, const char* pat, va_list* args);
-VIRTUAL void Perl_sv_catpv(pTHX_ SV* sv, const char* ptr);
-VIRTUAL void Perl_sv_catpvn(pTHX_ SV* sv, const char* ptr, STRLEN len);
-VIRTUAL void Perl_sv_catsv(pTHX_ SV* dsv, SV* ssv);
-VIRTUAL void Perl_sv_chop(pTHX_ SV* sv, char* ptr);
-VIRTUAL void Perl_sv_clean_all(pTHX);
-VIRTUAL void Perl_sv_clean_objs(pTHX);
-VIRTUAL void Perl_sv_clear(pTHX_ SV* sv);
-VIRTUAL I32 Perl_sv_cmp(pTHX_ SV* sv1, SV* sv2);
-VIRTUAL I32 Perl_sv_cmp_locale(pTHX_ SV* sv1, SV* sv2);
+PERL_CALLCONV I32 Perl_setenv_getix(pTHX_ char* nam);
+#endif
+PERL_CALLCONV void Perl_setdefout(pTHX_ GV* gv);
+PERL_CALLCONV char* Perl_sharepvn(pTHX_ const char* sv, I32 len, U32 hash);
+PERL_CALLCONV HEK* Perl_share_hek(pTHX_ const char* sv, I32 len, U32 hash);
+PERL_CALLCONV Signal_t Perl_sighandler(int sig);
+PERL_CALLCONV SV** Perl_stack_grow(pTHX_ SV** sp, SV**p, int n);
+PERL_CALLCONV I32 Perl_start_subparse(pTHX_ I32 is_format, U32 flags);
+PERL_CALLCONV void Perl_sub_crush_depth(pTHX_ CV* cv);
+PERL_CALLCONV bool Perl_sv_2bool(pTHX_ SV* sv);
+PERL_CALLCONV CV* Perl_sv_2cv(pTHX_ SV* sv, HV** st, GV** gvp, I32 lref);
+PERL_CALLCONV IO* Perl_sv_2io(pTHX_ SV* sv);
+PERL_CALLCONV IV Perl_sv_2iv(pTHX_ SV* sv);
+PERL_CALLCONV SV* Perl_sv_2mortal(pTHX_ SV* sv);
+PERL_CALLCONV NV Perl_sv_2nv(pTHX_ SV* sv);
+PERL_CALLCONV char* Perl_sv_2pv(pTHX_ SV* sv, STRLEN* lp);
+PERL_CALLCONV char* Perl_sv_2pvutf8(pTHX_ SV* sv, STRLEN* lp);
+PERL_CALLCONV char* Perl_sv_2pvbyte(pTHX_ SV* sv, STRLEN* lp);
+PERL_CALLCONV UV Perl_sv_2uv(pTHX_ SV* sv);
+PERL_CALLCONV IV Perl_sv_iv(pTHX_ SV* sv);
+PERL_CALLCONV UV Perl_sv_uv(pTHX_ SV* sv);
+PERL_CALLCONV NV Perl_sv_nv(pTHX_ SV* sv);
+PERL_CALLCONV char* Perl_sv_pvn(pTHX_ SV *sv, STRLEN *len);
+PERL_CALLCONV char* Perl_sv_pvutf8n(pTHX_ SV *sv, STRLEN *len);
+PERL_CALLCONV char* Perl_sv_pvbyten(pTHX_ SV *sv, STRLEN *len);
+PERL_CALLCONV I32 Perl_sv_true(pTHX_ SV *sv);
+PERL_CALLCONV void Perl_sv_add_arena(pTHX_ char* ptr, U32 size, U32 flags);
+PERL_CALLCONV int Perl_sv_backoff(pTHX_ SV* sv);
+PERL_CALLCONV SV* Perl_sv_bless(pTHX_ SV* sv, HV* stash);
+PERL_CALLCONV void Perl_sv_catpvf(pTHX_ SV* sv, const char* pat, ...);
+PERL_CALLCONV void Perl_sv_vcatpvf(pTHX_ SV* sv, const char* pat, va_list* args);
+PERL_CALLCONV void Perl_sv_catpv(pTHX_ SV* sv, const char* ptr);
+PERL_CALLCONV void Perl_sv_catpvn(pTHX_ SV* sv, const char* ptr, STRLEN len);
+PERL_CALLCONV void Perl_sv_catsv(pTHX_ SV* dsv, SV* ssv);
+PERL_CALLCONV void Perl_sv_chop(pTHX_ SV* sv, char* ptr);
+PERL_CALLCONV void Perl_sv_clean_all(pTHX);
+PERL_CALLCONV void Perl_sv_clean_objs(pTHX);
+PERL_CALLCONV void Perl_sv_clear(pTHX_ SV* sv);
+PERL_CALLCONV I32 Perl_sv_cmp(pTHX_ SV* sv1, SV* sv2);
+PERL_CALLCONV I32 Perl_sv_cmp_locale(pTHX_ SV* sv1, SV* sv2);
#if defined(USE_LOCALE_COLLATE)
-VIRTUAL char* Perl_sv_collxfrm(pTHX_ SV* sv, STRLEN* nxp);
-#endif
-VIRTUAL OP* Perl_sv_compile_2op(pTHX_ SV* sv, OP** startp, char* code, AV** avp);
-VIRTUAL void Perl_sv_dec(pTHX_ SV* sv);
-VIRTUAL void Perl_sv_dump(pTHX_ SV* sv);
-VIRTUAL bool Perl_sv_derived_from(pTHX_ SV* sv, const char* name);
-VIRTUAL I32 Perl_sv_eq(pTHX_ SV* sv1, SV* sv2);
-VIRTUAL void Perl_sv_free(pTHX_ SV* sv);
-VIRTUAL void Perl_sv_free_arenas(pTHX);
-VIRTUAL char* Perl_sv_gets(pTHX_ SV* sv, PerlIO* fp, I32 append);
-VIRTUAL char* Perl_sv_grow(pTHX_ SV* sv, STRLEN newlen);
-VIRTUAL void Perl_sv_inc(pTHX_ SV* sv);
-VIRTUAL void Perl_sv_insert(pTHX_ SV* bigsv, STRLEN offset, STRLEN len, char* little, STRLEN littlelen);
-VIRTUAL int Perl_sv_isa(pTHX_ SV* sv, const char* name);
-VIRTUAL int Perl_sv_isobject(pTHX_ SV* sv);
-VIRTUAL STRLEN Perl_sv_len(pTHX_ SV* sv);
-VIRTUAL STRLEN Perl_sv_len_utf8(pTHX_ SV* sv);
-VIRTUAL void Perl_sv_magic(pTHX_ SV* sv, SV* obj, int how, const char* name, I32 namlen);
-VIRTUAL SV* Perl_sv_mortalcopy(pTHX_ SV* oldsv);
-VIRTUAL SV* Perl_sv_newmortal(pTHX);
-VIRTUAL SV* Perl_sv_newref(pTHX_ SV* sv);
-VIRTUAL char* Perl_sv_peek(pTHX_ SV* sv);
-VIRTUAL void Perl_sv_pos_u2b(pTHX_ SV* sv, I32* offsetp, I32* lenp);
-VIRTUAL void Perl_sv_pos_b2u(pTHX_ SV* sv, I32* offsetp);
-VIRTUAL char* Perl_sv_pvn_force(pTHX_ SV* sv, STRLEN* lp);
-VIRTUAL char* Perl_sv_reftype(pTHX_ SV* sv, int ob);
-VIRTUAL void Perl_sv_replace(pTHX_ SV* sv, SV* nsv);
-VIRTUAL void Perl_sv_report_used(pTHX);
-VIRTUAL void Perl_sv_reset(pTHX_ char* s, HV* stash);
-VIRTUAL void Perl_sv_setpvf(pTHX_ SV* sv, const char* pat, ...);
-VIRTUAL void Perl_sv_vsetpvf(pTHX_ SV* sv, const char* pat, va_list* args);
-VIRTUAL void Perl_sv_setiv(pTHX_ SV* sv, IV num);
-VIRTUAL void Perl_sv_setpviv(pTHX_ SV* sv, IV num);
-VIRTUAL void Perl_sv_setuv(pTHX_ SV* sv, UV num);
-VIRTUAL void Perl_sv_setnv(pTHX_ SV* sv, NV num);
-VIRTUAL SV* Perl_sv_setref_iv(pTHX_ SV* rv, const char* classname, IV iv);
-VIRTUAL SV* Perl_sv_setref_nv(pTHX_ SV* rv, const char* classname, NV nv);
-VIRTUAL SV* Perl_sv_setref_pv(pTHX_ SV* rv, const char* classname, void* pv);
-VIRTUAL SV* Perl_sv_setref_pvn(pTHX_ SV* rv, const char* classname, char* pv, STRLEN n);
-VIRTUAL void Perl_sv_setpv(pTHX_ SV* sv, const char* ptr);
-VIRTUAL void Perl_sv_setpvn(pTHX_ SV* sv, const char* ptr, STRLEN len);
-VIRTUAL void Perl_sv_setsv(pTHX_ SV* dsv, SV* ssv);
-VIRTUAL void Perl_sv_taint(pTHX_ SV* sv);
-VIRTUAL bool Perl_sv_tainted(pTHX_ SV* sv);
-VIRTUAL int Perl_sv_unmagic(pTHX_ SV* sv, int type);
-VIRTUAL void Perl_sv_unref(pTHX_ SV* sv);
-VIRTUAL void Perl_sv_untaint(pTHX_ SV* sv);
-VIRTUAL bool Perl_sv_upgrade(pTHX_ SV* sv, U32 mt);
-VIRTUAL void Perl_sv_usepvn(pTHX_ SV* sv, char* ptr, STRLEN len);
-VIRTUAL void Perl_sv_vcatpvfn(pTHX_ SV* sv, const char* pat, STRLEN patlen, va_list* args, SV** svargs, I32 svmax, bool *maybe_tainted);
-VIRTUAL void Perl_sv_vsetpvfn(pTHX_ SV* sv, const char* pat, STRLEN patlen, va_list* args, SV** svargs, I32 svmax, bool *maybe_tainted);
-VIRTUAL SV* Perl_swash_init(pTHX_ char* pkg, char* name, SV* listsv, I32 minbits, I32 none);
-VIRTUAL UV Perl_swash_fetch(pTHX_ SV *sv, U8 *ptr);
-VIRTUAL void Perl_taint_env(pTHX);
-VIRTUAL void Perl_taint_proper(pTHX_ const char* f, char* s);
-VIRTUAL UV Perl_to_utf8_lower(pTHX_ U8 *p);
-VIRTUAL UV Perl_to_utf8_upper(pTHX_ U8 *p);
-VIRTUAL UV Perl_to_utf8_title(pTHX_ U8 *p);
+PERL_CALLCONV char* Perl_sv_collxfrm(pTHX_ SV* sv, STRLEN* nxp);
+#endif
+PERL_CALLCONV OP* Perl_sv_compile_2op(pTHX_ SV* sv, OP** startp, char* code, AV** avp);
+PERL_CALLCONV void Perl_sv_dec(pTHX_ SV* sv);
+PERL_CALLCONV void Perl_sv_dump(pTHX_ SV* sv);
+PERL_CALLCONV bool Perl_sv_derived_from(pTHX_ SV* sv, const char* name);
+PERL_CALLCONV I32 Perl_sv_eq(pTHX_ SV* sv1, SV* sv2);
+PERL_CALLCONV void Perl_sv_free(pTHX_ SV* sv);
+PERL_CALLCONV void Perl_sv_free_arenas(pTHX);
+PERL_CALLCONV char* Perl_sv_gets(pTHX_ SV* sv, PerlIO* fp, I32 append);
+PERL_CALLCONV char* Perl_sv_grow(pTHX_ SV* sv, STRLEN newlen);
+PERL_CALLCONV void Perl_sv_inc(pTHX_ SV* sv);
+PERL_CALLCONV void Perl_sv_insert(pTHX_ SV* bigsv, STRLEN offset, STRLEN len, char* little, STRLEN littlelen);
+PERL_CALLCONV int Perl_sv_isa(pTHX_ SV* sv, const char* name);
+PERL_CALLCONV int Perl_sv_isobject(pTHX_ SV* sv);
+PERL_CALLCONV STRLEN Perl_sv_len(pTHX_ SV* sv);
+PERL_CALLCONV STRLEN Perl_sv_len_utf8(pTHX_ SV* sv);
+PERL_CALLCONV void Perl_sv_magic(pTHX_ SV* sv, SV* obj, int how, const char* name, I32 namlen);
+PERL_CALLCONV SV* Perl_sv_mortalcopy(pTHX_ SV* oldsv);
+PERL_CALLCONV SV* Perl_sv_newmortal(pTHX);
+PERL_CALLCONV SV* Perl_sv_newref(pTHX_ SV* sv);
+PERL_CALLCONV char* Perl_sv_peek(pTHX_ SV* sv);
+PERL_CALLCONV void Perl_sv_pos_u2b(pTHX_ SV* sv, I32* offsetp, I32* lenp);
+PERL_CALLCONV void Perl_sv_pos_b2u(pTHX_ SV* sv, I32* offsetp);
+PERL_CALLCONV char* Perl_sv_pvn_force(pTHX_ SV* sv, STRLEN* lp);
+PERL_CALLCONV char* Perl_sv_pvutf8n_force(pTHX_ SV* sv, STRLEN* lp);
+PERL_CALLCONV char* Perl_sv_pvbyten_force(pTHX_ SV* sv, STRLEN* lp);
+PERL_CALLCONV char* Perl_sv_reftype(pTHX_ SV* sv, int ob);
+PERL_CALLCONV void Perl_sv_replace(pTHX_ SV* sv, SV* nsv);
+PERL_CALLCONV void Perl_sv_report_used(pTHX);
+PERL_CALLCONV void Perl_sv_reset(pTHX_ char* s, HV* stash);
+PERL_CALLCONV void Perl_sv_setpvf(pTHX_ SV* sv, const char* pat, ...);
+PERL_CALLCONV void Perl_sv_vsetpvf(pTHX_ SV* sv, const char* pat, va_list* args);
+PERL_CALLCONV void Perl_sv_setiv(pTHX_ SV* sv, IV num);
+PERL_CALLCONV void Perl_sv_setpviv(pTHX_ SV* sv, IV num);
+PERL_CALLCONV void Perl_sv_setuv(pTHX_ SV* sv, UV num);
+PERL_CALLCONV void Perl_sv_setnv(pTHX_ SV* sv, NV num);
+PERL_CALLCONV SV* Perl_sv_setref_iv(pTHX_ SV* rv, const char* classname, IV iv);
+PERL_CALLCONV SV* Perl_sv_setref_nv(pTHX_ SV* rv, const char* classname, NV nv);
+PERL_CALLCONV SV* Perl_sv_setref_pv(pTHX_ SV* rv, const char* classname, void* pv);
+PERL_CALLCONV SV* Perl_sv_setref_pvn(pTHX_ SV* rv, const char* classname, char* pv, STRLEN n);
+PERL_CALLCONV void Perl_sv_setpv(pTHX_ SV* sv, const char* ptr);
+PERL_CALLCONV void Perl_sv_setpvn(pTHX_ SV* sv, const char* ptr, STRLEN len);
+PERL_CALLCONV void Perl_sv_setsv(pTHX_ SV* dsv, SV* ssv);
+PERL_CALLCONV void Perl_sv_taint(pTHX_ SV* sv);
+PERL_CALLCONV bool Perl_sv_tainted(pTHX_ SV* sv);
+PERL_CALLCONV int Perl_sv_unmagic(pTHX_ SV* sv, int type);
+PERL_CALLCONV void Perl_sv_unref(pTHX_ SV* sv);
+PERL_CALLCONV void Perl_sv_untaint(pTHX_ SV* sv);
+PERL_CALLCONV bool Perl_sv_upgrade(pTHX_ SV* sv, U32 mt);
+PERL_CALLCONV void Perl_sv_usepvn(pTHX_ SV* sv, char* ptr, STRLEN len);
+PERL_CALLCONV void Perl_sv_vcatpvfn(pTHX_ SV* sv, const char* pat, STRLEN patlen, va_list* args, SV** svargs, I32 svmax, bool *maybe_tainted);
+PERL_CALLCONV void Perl_sv_vsetpvfn(pTHX_ SV* sv, const char* pat, STRLEN patlen, va_list* args, SV** svargs, I32 svmax, bool *maybe_tainted);
+PERL_CALLCONV SV* Perl_swash_init(pTHX_ char* pkg, char* name, SV* listsv, I32 minbits, I32 none);
+PERL_CALLCONV UV Perl_swash_fetch(pTHX_ SV *sv, U8 *ptr);
+PERL_CALLCONV void Perl_taint_env(pTHX);
+PERL_CALLCONV void Perl_taint_proper(pTHX_ const char* f, const char* s);
+PERL_CALLCONV UV Perl_to_utf8_lower(pTHX_ U8 *p);
+PERL_CALLCONV UV Perl_to_utf8_upper(pTHX_ U8 *p);
+PERL_CALLCONV UV Perl_to_utf8_title(pTHX_ U8 *p);
#if defined(UNLINK_ALL_VERSIONS)
-VIRTUAL I32 Perl_unlnk(pTHX_ char* f);
+PERL_CALLCONV I32 Perl_unlnk(pTHX_ char* f);
#endif
#if defined(USE_THREADS)
-VIRTUAL void Perl_unlock_condpair(pTHX_ void* svv);
-#endif
-VIRTUAL void Perl_unsharepvn(pTHX_ const char* sv, I32 len, U32 hash);
-VIRTUAL void Perl_unshare_hek(pTHX_ HEK* hek);
-VIRTUAL void Perl_utilize(pTHX_ int aver, I32 floor, OP* version, OP* id, OP* arg);
-VIRTUAL U8* Perl_utf16_to_utf8(pTHX_ U16* p, U8 *d, I32 bytelen);
-VIRTUAL U8* Perl_utf16_to_utf8_reversed(pTHX_ U16* p, U8 *d, I32 bytelen);
-VIRTUAL I32 Perl_utf8_distance(pTHX_ U8 *a, U8 *b);
-VIRTUAL U8* Perl_utf8_hop(pTHX_ U8 *s, I32 off);
-VIRTUAL UV Perl_utf8_to_uv(pTHX_ U8 *s, I32* retlen);
-VIRTUAL U8* Perl_uv_to_utf8(pTHX_ U8 *d, UV uv);
-VIRTUAL void Perl_vivify_defelem(pTHX_ SV* sv);
-VIRTUAL void Perl_vivify_ref(pTHX_ SV* sv, U32 to_what);
-VIRTUAL I32 Perl_wait4pid(pTHX_ Pid_t pid, int* statusp, int flags);
-VIRTUAL void Perl_warn(pTHX_ const char* pat, ...);
-VIRTUAL void Perl_vwarn(pTHX_ const char* pat, va_list* args);
-VIRTUAL void Perl_warner(pTHX_ U32 err, const char* pat, ...);
-VIRTUAL void Perl_vwarner(pTHX_ U32 err, const char* pat, va_list* args);
-VIRTUAL void Perl_watch(pTHX_ char** addr);
-VIRTUAL I32 Perl_whichsig(pTHX_ char* sig);
-VIRTUAL int Perl_yyerror(pTHX_ char* s);
+PERL_CALLCONV void Perl_unlock_condpair(pTHX_ void* svv);
+#endif
+PERL_CALLCONV void Perl_unsharepvn(pTHX_ const char* sv, I32 len, U32 hash);
+PERL_CALLCONV void Perl_unshare_hek(pTHX_ HEK* hek);
+PERL_CALLCONV void Perl_utilize(pTHX_ int aver, I32 floor, OP* version, OP* id, OP* arg);
+PERL_CALLCONV U8* Perl_utf16_to_utf8(pTHX_ U16* p, U8 *d, I32 bytelen);
+PERL_CALLCONV U8* Perl_utf16_to_utf8_reversed(pTHX_ U16* p, U8 *d, I32 bytelen);
+PERL_CALLCONV I32 Perl_utf8_distance(pTHX_ U8 *a, U8 *b);
+PERL_CALLCONV U8* Perl_utf8_hop(pTHX_ U8 *s, I32 off);
+PERL_CALLCONV UV Perl_utf8_to_uv(pTHX_ U8 *s, I32* retlen);
+PERL_CALLCONV U8* Perl_uv_to_utf8(pTHX_ U8 *d, UV uv);
+PERL_CALLCONV void Perl_vivify_defelem(pTHX_ SV* sv);
+PERL_CALLCONV void Perl_vivify_ref(pTHX_ SV* sv, U32 to_what);
+PERL_CALLCONV I32 Perl_wait4pid(pTHX_ Pid_t pid, int* statusp, int flags);
+PERL_CALLCONV void Perl_report_uninit(pTHX);
+PERL_CALLCONV void Perl_warn(pTHX_ const char* pat, ...);
+PERL_CALLCONV void Perl_vwarn(pTHX_ const char* pat, va_list* args);
+PERL_CALLCONV void Perl_warner(pTHX_ U32 err, const char* pat, ...);
+PERL_CALLCONV void Perl_vwarner(pTHX_ U32 err, const char* pat, va_list* args);
+PERL_CALLCONV void Perl_watch(pTHX_ char** addr);
+PERL_CALLCONV I32 Perl_whichsig(pTHX_ char* sig);
+PERL_CALLCONV int Perl_yyerror(pTHX_ char* s);
#if defined(USE_PURE_BISON)
-VIRTUAL int Perl_yylex(pTHX_ YYSTYPE *lvalp, int *lcharp);
+PERL_CALLCONV int Perl_yylex(pTHX_ YYSTYPE *lvalp, int *lcharp);
#else
-VIRTUAL int Perl_yylex(pTHX);
+PERL_CALLCONV int Perl_yylex(pTHX);
#endif
-VIRTUAL int Perl_yyparse(pTHX);
-VIRTUAL int Perl_yywarn(pTHX_ char* s);
+PERL_CALLCONV int Perl_yyparse(pTHX);
+PERL_CALLCONV int Perl_yywarn(pTHX_ char* s);
#if defined(MYMALLOC)
-VIRTUAL void Perl_dump_mstats(pTHX_ char* s);
-VIRTUAL Malloc_t Perl_malloc(MEM_SIZE nbytes);
-VIRTUAL Malloc_t Perl_calloc(MEM_SIZE elements, MEM_SIZE size);
-VIRTUAL Malloc_t Perl_realloc(Malloc_t where, MEM_SIZE nbytes);
-VIRTUAL Free_t Perl_mfree(Malloc_t where);
-#endif
-VIRTUAL Malloc_t Perl_safesysmalloc(MEM_SIZE nbytes);
-VIRTUAL Malloc_t Perl_safesyscalloc(MEM_SIZE elements, MEM_SIZE size);
-VIRTUAL Malloc_t Perl_safesysrealloc(Malloc_t where, MEM_SIZE nbytes);
-VIRTUAL Free_t Perl_safesysfree(Malloc_t where);
+PERL_CALLCONV void Perl_dump_mstats(pTHX_ char* s);
+#endif
+PERL_CALLCONV Malloc_t Perl_safesysmalloc(MEM_SIZE nbytes);
+PERL_CALLCONV Malloc_t Perl_safesyscalloc(MEM_SIZE elements, MEM_SIZE size);
+PERL_CALLCONV Malloc_t Perl_safesysrealloc(Malloc_t where, MEM_SIZE nbytes);
+PERL_CALLCONV Free_t Perl_safesysfree(Malloc_t where);
#if defined(LEAKTEST)
-VIRTUAL Malloc_t Perl_safexmalloc(I32 x, MEM_SIZE size);
-VIRTUAL Malloc_t Perl_safexcalloc(I32 x, MEM_SIZE elements, MEM_SIZE size);
-VIRTUAL Malloc_t Perl_safexrealloc(Malloc_t where, MEM_SIZE size);
-VIRTUAL void Perl_safexfree(Malloc_t where);
+PERL_CALLCONV Malloc_t Perl_safexmalloc(I32 x, MEM_SIZE size);
+PERL_CALLCONV Malloc_t Perl_safexcalloc(I32 x, MEM_SIZE elements, MEM_SIZE size);
+PERL_CALLCONV Malloc_t Perl_safexrealloc(Malloc_t where, MEM_SIZE size);
+PERL_CALLCONV void Perl_safexfree(Malloc_t where);
#endif
#if defined(PERL_GLOBAL_STRUCT)
-VIRTUAL struct perl_vars * Perl_GetVars(pTHX);
-#endif
-VIRTUAL int Perl_runops_standard(pTHX);
-VIRTUAL int Perl_runops_debug(pTHX);
-VIRTUAL void Perl_sv_catpvf_mg(pTHX_ SV *sv, const char* pat, ...);
-VIRTUAL void Perl_sv_vcatpvf_mg(pTHX_ SV* sv, const char* pat, va_list* args);
-VIRTUAL void Perl_sv_catpv_mg(pTHX_ SV *sv, const char *ptr);
-VIRTUAL void Perl_sv_catpvn_mg(pTHX_ SV *sv, const char *ptr, STRLEN len);
-VIRTUAL void Perl_sv_catsv_mg(pTHX_ SV *dstr, SV *sstr);
-VIRTUAL void Perl_sv_setpvf_mg(pTHX_ SV *sv, const char* pat, ...);
-VIRTUAL void Perl_sv_vsetpvf_mg(pTHX_ SV* sv, const char* pat, va_list* args);
-VIRTUAL void Perl_sv_setiv_mg(pTHX_ SV *sv, IV i);
-VIRTUAL void Perl_sv_setpviv_mg(pTHX_ SV *sv, IV iv);
-VIRTUAL void Perl_sv_setuv_mg(pTHX_ SV *sv, UV u);
-VIRTUAL void Perl_sv_setnv_mg(pTHX_ SV *sv, NV num);
-VIRTUAL void Perl_sv_setpv_mg(pTHX_ SV *sv, const char *ptr);
-VIRTUAL void Perl_sv_setpvn_mg(pTHX_ SV *sv, const char *ptr, STRLEN len);
-VIRTUAL void Perl_sv_setsv_mg(pTHX_ SV *dstr, SV *sstr);
-VIRTUAL void Perl_sv_usepvn_mg(pTHX_ SV *sv, char *ptr, STRLEN len);
-VIRTUAL MGVTBL* Perl_get_vtbl(pTHX_ int vtbl_id);
-VIRTUAL char* Perl_pv_display(pTHX_ SV *sv, char *pv, STRLEN cur, STRLEN len, STRLEN pvlim);
-VIRTUAL void Perl_dump_indent(pTHX_ I32 level, PerlIO *file, const char* pat, ...);
-VIRTUAL void Perl_dump_vindent(pTHX_ I32 level, PerlIO *file, const char* pat, va_list *args);
-VIRTUAL void Perl_do_gv_dump(pTHX_ I32 level, PerlIO *file, char *name, GV *sv);
-VIRTUAL void Perl_do_gvgv_dump(pTHX_ I32 level, PerlIO *file, char *name, GV *sv);
-VIRTUAL void Perl_do_hv_dump(pTHX_ I32 level, PerlIO *file, char *name, HV *sv);
-VIRTUAL void Perl_do_magic_dump(pTHX_ I32 level, PerlIO *file, MAGIC *mg, I32 nest, I32 maxnest, bool dumpops, STRLEN pvlim);
-VIRTUAL void Perl_do_op_dump(pTHX_ I32 level, PerlIO *file, OP *o);
-VIRTUAL void Perl_do_pmop_dump(pTHX_ I32 level, PerlIO *file, PMOP *pm);
-VIRTUAL void Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bool dumpops, STRLEN pvlim);
-VIRTUAL void Perl_magic_dump(pTHX_ MAGIC *mg);
-VIRTUAL void* Perl_default_protect(pTHX_ int *excpt, protect_body_t body, ...);
-VIRTUAL void* Perl_vdefault_protect(pTHX_ int *excpt, protect_body_t body, va_list *args);
-VIRTUAL void Perl_reginitcolors(pTHX);
-VIRTUAL char* Perl_sv_2pv_nolen(pTHX_ SV* sv);
-VIRTUAL char* Perl_sv_pv(pTHX_ SV *sv);
-VIRTUAL void Perl_sv_force_normal(pTHX_ SV *sv);
-VIRTUAL void Perl_tmps_grow(pTHX_ I32 n);
-VIRTUAL SV* Perl_sv_rvweaken(pTHX_ SV *sv);
-VIRTUAL int Perl_magic_killbackrefs(pTHX_ SV *sv, MAGIC *mg);
-VIRTUAL OP* Perl_newANONATTRSUB(pTHX_ I32 floor, OP *proto, OP *attrs, OP *block);
-VIRTUAL CV* Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block);
-VIRTUAL void Perl_newMYSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block);
-VIRTUAL OP * Perl_my_attrs(pTHX_ OP *o, OP *attrs);
-VIRTUAL void Perl_boot_core_xsutils(pTHX);
+PERL_CALLCONV struct perl_vars * Perl_GetVars(pTHX);
+#endif
+PERL_CALLCONV int Perl_runops_standard(pTHX);
+PERL_CALLCONV int Perl_runops_debug(pTHX);
+PERL_CALLCONV void Perl_sv_catpvf_mg(pTHX_ SV *sv, const char* pat, ...);
+PERL_CALLCONV void Perl_sv_vcatpvf_mg(pTHX_ SV* sv, const char* pat, va_list* args);
+PERL_CALLCONV void Perl_sv_catpv_mg(pTHX_ SV *sv, const char *ptr);
+PERL_CALLCONV void Perl_sv_catpvn_mg(pTHX_ SV *sv, const char *ptr, STRLEN len);
+PERL_CALLCONV void Perl_sv_catsv_mg(pTHX_ SV *dstr, SV *sstr);
+PERL_CALLCONV void Perl_sv_setpvf_mg(pTHX_ SV *sv, const char* pat, ...);
+PERL_CALLCONV void Perl_sv_vsetpvf_mg(pTHX_ SV* sv, const char* pat, va_list* args);
+PERL_CALLCONV void Perl_sv_setiv_mg(pTHX_ SV *sv, IV i);
+PERL_CALLCONV void Perl_sv_setpviv_mg(pTHX_ SV *sv, IV iv);
+PERL_CALLCONV void Perl_sv_setuv_mg(pTHX_ SV *sv, UV u);
+PERL_CALLCONV void Perl_sv_setnv_mg(pTHX_ SV *sv, NV num);
+PERL_CALLCONV void Perl_sv_setpv_mg(pTHX_ SV *sv, const char *ptr);
+PERL_CALLCONV void Perl_sv_setpvn_mg(pTHX_ SV *sv, const char *ptr, STRLEN len);
+PERL_CALLCONV void Perl_sv_setsv_mg(pTHX_ SV *dstr, SV *sstr);
+PERL_CALLCONV void Perl_sv_usepvn_mg(pTHX_ SV *sv, char *ptr, STRLEN len);
+PERL_CALLCONV MGVTBL* Perl_get_vtbl(pTHX_ int vtbl_id);
+PERL_CALLCONV char* Perl_pv_display(pTHX_ SV *sv, char *pv, STRLEN cur, STRLEN len, STRLEN pvlim);
+PERL_CALLCONV void Perl_dump_indent(pTHX_ I32 level, PerlIO *file, const char* pat, ...);
+PERL_CALLCONV void Perl_dump_vindent(pTHX_ I32 level, PerlIO *file, const char* pat, va_list *args);
+PERL_CALLCONV void Perl_do_gv_dump(pTHX_ I32 level, PerlIO *file, char *name, GV *sv);
+PERL_CALLCONV void Perl_do_gvgv_dump(pTHX_ I32 level, PerlIO *file, char *name, GV *sv);
+PERL_CALLCONV void Perl_do_hv_dump(pTHX_ I32 level, PerlIO *file, char *name, HV *sv);
+PERL_CALLCONV void Perl_do_magic_dump(pTHX_ I32 level, PerlIO *file, MAGIC *mg, I32 nest, I32 maxnest, bool dumpops, STRLEN pvlim);
+PERL_CALLCONV void Perl_do_op_dump(pTHX_ I32 level, PerlIO *file, OP *o);
+PERL_CALLCONV void Perl_do_pmop_dump(pTHX_ I32 level, PerlIO *file, PMOP *pm);
+PERL_CALLCONV void Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bool dumpops, STRLEN pvlim);
+PERL_CALLCONV void Perl_magic_dump(pTHX_ MAGIC *mg);
+PERL_CALLCONV void* Perl_default_protect(pTHX_ volatile JMPENV *je, int *excpt, protect_body_t body, ...);
+PERL_CALLCONV void* Perl_vdefault_protect(pTHX_ volatile JMPENV *je, int *excpt, protect_body_t body, va_list *args);
+PERL_CALLCONV void Perl_reginitcolors(pTHX);
+PERL_CALLCONV char* Perl_sv_2pv_nolen(pTHX_ SV* sv);
+PERL_CALLCONV char* Perl_sv_2pvutf8_nolen(pTHX_ SV* sv);
+PERL_CALLCONV char* Perl_sv_2pvbyte_nolen(pTHX_ SV* sv);
+PERL_CALLCONV char* Perl_sv_pv(pTHX_ SV *sv);
+PERL_CALLCONV char* Perl_sv_pvutf8(pTHX_ SV *sv);
+PERL_CALLCONV char* Perl_sv_pvbyte(pTHX_ SV *sv);
+PERL_CALLCONV void Perl_sv_force_normal(pTHX_ SV *sv);
+PERL_CALLCONV void Perl_tmps_grow(pTHX_ I32 n);
+PERL_CALLCONV SV* Perl_sv_rvweaken(pTHX_ SV *sv);
+PERL_CALLCONV int Perl_magic_killbackrefs(pTHX_ SV *sv, MAGIC *mg);
+PERL_CALLCONV OP* Perl_newANONATTRSUB(pTHX_ I32 floor, OP *proto, OP *attrs, OP *block);
+PERL_CALLCONV CV* Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block);
+PERL_CALLCONV void Perl_newMYSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block);
+PERL_CALLCONV OP * Perl_my_attrs(pTHX_ OP *o, OP *attrs);
+PERL_CALLCONV void Perl_boot_core_xsutils(pTHX);
+#if defined(USE_ITHREADS)
+PERL_CALLCONV PERL_CONTEXT* Perl_cx_dup(pTHX_ PERL_CONTEXT* cx, I32 ix, I32 max);
+PERL_CALLCONV PERL_SI* Perl_si_dup(pTHX_ PERL_SI* si);
+PERL_CALLCONV ANY* Perl_ss_dup(pTHX_ PerlInterpreter* proto_perl);
+PERL_CALLCONV void* Perl_any_dup(pTHX_ void* v, PerlInterpreter* proto_perl);
+PERL_CALLCONV HE* Perl_he_dup(pTHX_ HE* e, bool shared);
+PERL_CALLCONV REGEXP* Perl_re_dup(pTHX_ REGEXP* r);
+PERL_CALLCONV PerlIO* Perl_fp_dup(pTHX_ PerlIO* fp, char type);
+PERL_CALLCONV DIR* Perl_dirp_dup(pTHX_ DIR* dp);
+PERL_CALLCONV GP* Perl_gp_dup(pTHX_ GP* gp);
+PERL_CALLCONV MAGIC* Perl_mg_dup(pTHX_ MAGIC* mg);
+PERL_CALLCONV SV* Perl_sv_dup(pTHX_ SV* sstr);
+#if defined(HAVE_INTERP_INTERN)
+PERL_CALLCONV void Perl_sys_intern_dup(pTHX_ struct interp_intern* src, struct interp_intern* dst);
+#endif
+PERL_CALLCONV PTR_TBL_t* Perl_ptr_table_new(pTHX);
+PERL_CALLCONV void* Perl_ptr_table_fetch(pTHX_ PTR_TBL_t *tbl, void *sv);
+PERL_CALLCONV void Perl_ptr_table_store(pTHX_ PTR_TBL_t *tbl, void *oldsv, void *newsv);
+PERL_CALLCONV void Perl_ptr_table_split(pTHX_ PTR_TBL_t *tbl);
+#endif
+
#if defined(PERL_OBJECT)
protected:
+#else
+END_EXTERN_C
#endif
+
#if defined(PERL_IN_AV_C) || defined(PERL_DECL_PROT)
STATIC I32 S_avhv_index_sv(pTHX_ SV* sv);
#endif
+
#if defined(PERL_IN_DOOP_C) || defined(PERL_DECL_PROT)
STATIC I32 S_do_trans_CC_simple(pTHX_ SV *sv);
STATIC I32 S_do_trans_CC_count(pTHX_ SV *sv);
STATIC I32 S_do_trans_UC_trivial(pTHX_ SV *sv);
STATIC I32 S_do_trans_CU_trivial(pTHX_ SV *sv);
#endif
+
#if defined(PERL_IN_GV_C) || defined(PERL_DECL_PROT)
STATIC void S_gv_init_sv(pTHX_ GV *gv, I32 sv_type);
#endif
+
#if defined(PERL_IN_HV_C) || defined(PERL_DECL_PROT)
STATIC void S_hsplit(pTHX_ HV *hv);
STATIC void S_hfreeentries(pTHX_ HV *hv);
STATIC HEK* S_save_hek(pTHX_ const char *str, I32 len, U32 hash);
STATIC void S_hv_magic_check(pTHX_ HV *hv, bool *needs_copy, bool *needs_store);
#endif
+
#if defined(PERL_IN_MG_C) || defined(PERL_DECL_PROT)
STATIC void S_save_magic(pTHX_ I32 mgs_ix, SV *sv);
STATIC int S_magic_methpack(pTHX_ SV *sv, MAGIC *mg, char *meth);
STATIC int S_magic_methcall(pTHX_ SV *sv, MAGIC *mg, char *meth, I32 f, int n, SV *val);
#endif
+
#if defined(PERL_IN_OP_C) || defined(PERL_DECL_PROT)
STATIC I32 S_list_assignment(pTHX_ OP *o);
STATIC void S_bad_type(pTHX_ I32 n, char *t, char *name, OP *kid);
STATIC void S_simplify_sort(pTHX_ OP *o);
STATIC bool S_is_handle_constructor(pTHX_ OP *o, I32 argnum);
STATIC char* S_gv_ename(pTHX_ GV *gv);
+STATIC void S_cv_dump(pTHX_ CV *cv);
STATIC CV* S_cv_clone2(pTHX_ CV *proto, CV *outside);
STATIC bool S_scalar_mod_type(pTHX_ OP *o, I32 type);
STATIC OP * S_my_kid(pTHX_ OP *o, OP *attrs);
STATIC void* S_Slab_Alloc(pTHX_ int m, size_t sz);
# endif
#endif
+
#if defined(PERL_IN_PERL_C) || defined(PERL_DECL_PROT)
STATIC void S_find_beginning(pTHX);
STATIC void S_forbid_setid(pTHX_ char *);
STATIC struct perl_thread * S_init_main_thread(pTHX);
# endif
#endif
+
#if defined(PERL_IN_PP_C) || defined(PERL_DECL_PROT)
STATIC void S_doencodes(pTHX_ SV* sv, char* s, I32 len);
STATIC SV* S_refto(pTHX_ SV* sv);
STATIC SV* S_is_an_int(pTHX_ char *s, STRLEN l);
STATIC int S_div128(pTHX_ SV *pnum, bool *done);
#endif
+
#if defined(PERL_IN_PP_CTL_C) || defined(PERL_DECL_PROT)
STATIC OP* S_docatch(pTHX_ OP *o);
STATIC void* S_docatch_body(pTHX_ va_list args);
STATIC PerlIO * S_doopen_pmc(pTHX_ const char *name, const char *mode);
STATIC void S_qsortsv(pTHX_ SV ** array, size_t num_elts, SVCOMPARE_t f);
#endif
+
#if defined(PERL_IN_PP_HOT_C) || defined(PERL_DECL_PROT)
STATIC CV* S_get_db_sub(pTHX_ SV **svp, CV *cv);
STATIC SV* S_method_common(pTHX_ SV* meth, U32* hashp);
#endif
+
#if defined(PERL_IN_PP_SYS_C) || defined(PERL_DECL_PROT)
STATIC OP* S_doform(pTHX_ CV *cv, GV *gv, OP *retop);
STATIC int S_emulate_eaccess(pTHX_ const char* path, Mode_t mode);
STATIC int S_dooneliner(pTHX_ char *cmd, char *filename);
# endif
#endif
+
#if defined(PERL_IN_REGCOMP_C) || defined(PERL_DECL_PROT)
STATIC regnode* S_reg(pTHX_ I32, I32 *);
STATIC regnode* S_reganode(pTHX_ U8, U32);
STATIC char* S_regwhite(pTHX_ char *, char *);
STATIC char* S_nextchar(pTHX);
STATIC regnode* S_dumpuntil(pTHX_ regnode *start, regnode *node, regnode *last, SV* sv, I32 l);
+STATIC void S_put_byte(pTHX_ SV* sv, int c);
STATIC void S_scan_commit(pTHX_ struct scan_data_t *data);
+STATIC void S_cl_anything(pTHX_ struct regnode_charclass_class *cl);
+STATIC int S_cl_is_anything(pTHX_ struct regnode_charclass_class *cl);
+STATIC void S_cl_init(pTHX_ struct regnode_charclass_class *cl);
+STATIC void S_cl_init_zero(pTHX_ struct regnode_charclass_class *cl);
+STATIC void S_cl_and(pTHX_ struct regnode_charclass_class *cl, struct regnode_charclass_class *and_with);
+STATIC void S_cl_or(pTHX_ struct regnode_charclass_class *cl, struct regnode_charclass_class *or_with);
STATIC I32 S_study_chunk(pTHX_ regnode **scanp, I32 *deltap, regnode *last, struct scan_data_t *data, U32 flags);
STATIC I32 S_add_data(pTHX_ I32 n, char *s);
STATIC void S_re_croak2(pTHX_ const char* pat1, const char* pat2, ...) __attribute__((noreturn));
STATIC I32 S_regpposixcc(pTHX_ I32 value);
STATIC void S_checkposixcc(pTHX);
#endif
+
#if defined(PERL_IN_REGEXEC_C) || defined(PERL_DECL_PROT)
STATIC I32 S_regmatch(pTHX_ regnode *prog);
STATIC I32 S_regrepeat(pTHX_ regnode *p, I32 max);
STATIC I32 S_regrepeat_hard(pTHX_ regnode *p, I32 max, I32 *lp);
STATIC I32 S_regtry(pTHX_ regexp *prog, char *startpos);
-STATIC bool S_reginclass(pTHX_ char *p, I32 c);
+STATIC bool S_reginclass(pTHX_ regnode *p, I32 c);
STATIC bool S_reginclassutf8(pTHX_ regnode *f, U8* p);
STATIC CHECKPOINT S_regcppush(pTHX_ I32 parenfloor);
STATIC char* S_regcppop(pTHX);
STATIC void S_cache_re(pTHX_ regexp *prog);
STATIC U8* S_reghop(pTHX_ U8 *pos, I32 off);
STATIC U8* S_reghopmaybe(pTHX_ U8 *pos, I32 off);
+STATIC char* S_find_byclass(pTHX_ regexp * prog, regnode *c, char *s, char *strend, char *startpos, I32 norun);
#endif
+
#if defined(PERL_IN_RUN_C) || defined(PERL_DECL_PROT)
STATIC void S_debprof(pTHX_ OP *o);
#endif
+
#if defined(PERL_IN_SCOPE_C) || defined(PERL_DECL_PROT)
STATIC SV* S_save_scalar_at(pTHX_ SV **sptr);
#endif
+
#if defined(PERL_IN_SV_C) || defined(PERL_DECL_PROT)
STATIC IV S_asIV(pTHX_ SV* sv);
STATIC UV S_asUV(pTHX_ SV* sv);
STATIC void S_del_sv(pTHX_ SV *p);
# endif
#endif
+
#if defined(PERL_IN_TOKE_C) || defined(PERL_DECL_PROT)
STATIC void S_check_uni(pTHX);
STATIC void S_force_next(pTHX_ I32 type);
STATIC void S_incline(pTHX_ char *s);
STATIC int S_intuit_method(pTHX_ char *s, GV *gv);
STATIC int S_intuit_more(pTHX_ char *s);
-STATIC I32 S_lop(pTHX_ I32 f, expectation x, char *s);
+STATIC I32 S_lop(pTHX_ I32 f, int x, char *s);
STATIC void S_missingterm(pTHX_ char *s);
STATIC void S_no_op(pTHX_ char *what, char *s);
STATIC void S_set_csh(pTHX);
STATIC I32 S_sublex_push(pTHX);
STATIC I32 S_sublex_start(pTHX);
STATIC char * S_filter_gets(pTHX_ SV *sv, PerlIO *fp, STRLEN append);
-STATIC SV* S_new_constant(pTHX_ char *s, STRLEN len, char *key, SV *sv, SV *pv, char *type);
+STATIC SV* S_new_constant(pTHX_ char *s, STRLEN len, const char *key, SV *sv, SV *pv, const char *type);
STATIC int S_ao(pTHX_ int toketype);
STATIC void S_depcom(pTHX);
STATIC char* S_incl_perldb(pTHX);
# if defined(CRIPPLED_CC)
STATIC int S_uni(pTHX_ I32 f, char *s);
# endif
-# if defined(WIN32)
-STATIC I32 S_win32_textfilter(pTHX_ int idx, SV *sv, int maxlen);
+# if defined(PERL_CR_FILTER)
+STATIC I32 S_cr_textfilter(pTHX_ int idx, SV *sv, int maxlen);
# endif
#endif
+
#if defined(PERL_IN_UNIVERSAL_C) || defined(PERL_DECL_PROT)
STATIC SV* S_isa_lookup(pTHX_ HV *stash, const char *name, int len, int level);
#endif
+
#if defined(PERL_IN_UTIL_C) || defined(PERL_DECL_PROT)
STATIC SV* S_mess_alloc(pTHX);
# if defined(LEAKTEST)
STATIC void S_xstat(pTHX_ int);
# endif
#endif
+
+#if defined(PERL_OBJECT)
+};
+#endif
I32 offset_float_max;
I32 flags;
I32 whilem_c;
+ struct regnode_charclass_class *start_class;
} scan_data_t;
/*
*/
static scan_data_t zero_scan_data = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0 };
+ 0, 0, 0, 0, 0 };
#define SF_BEFORE_EOL (SF_BEFORE_SEOL|SF_BEFORE_MEOL)
#define SF_BEFORE_SEOL 0x1
#define SF_IN_PAR 0x100
#define SF_HAS_EVAL 0x200
#define SCF_DO_SUBSTR 0x400
+#define SCF_DO_STCLASS_AND 0x0800
+#define SCF_DO_STCLASS_OR 0x1000
+#define SCF_DO_STCLASS (SCF_DO_STCLASS_AND|SCF_DO_STCLASS_OR)
#define RF_utf8 8
#define UTF (PL_reg_flags & RF_utf8)
static void clear_re(pTHXo_ void *r);
+/* Mark that we cannot extend a found fixed substring at this point.
+ Updata the longest found anchored substring and the longest found
+ floating substrings if needed. */
+
STATIC void
S_scan_commit(pTHX_ scan_data_t *data)
{
data->flags &= ~SF_BEFORE_EOL;
}
+/* Can match anything (initialization) */
+STATIC void
+S_cl_anything(pTHX_ struct regnode_charclass_class *cl)
+{
+ int value;
+
+ ANYOF_CLASS_ZERO(cl);
+ for (value = 0; value < 256; ++value)
+ ANYOF_BITMAP_SET(cl, value);
+ cl->flags = ANYOF_EOS;
+ if (LOC)
+ cl->flags |= ANYOF_LOCALE;
+}
+
+/* Can match anything (initialization) */
+STATIC int
+S_cl_is_anything(pTHX_ struct regnode_charclass_class *cl)
+{
+ int value;
+
+ for (value = 0; value < ANYOF_MAX; value += 2)
+ if (ANYOF_CLASS_TEST(cl, value) && ANYOF_CLASS_TEST(cl, value + 1))
+ return 1;
+ for (value = 0; value < 256; ++value)
+ if (!ANYOF_BITMAP_TEST(cl, value))
+ return 0;
+ return 1;
+}
+
+/* Can match anything (initialization) */
+STATIC void
+S_cl_init(pTHX_ struct regnode_charclass_class *cl)
+{
+ cl->type = ANYOF;
+ cl_anything(cl);
+}
+
+STATIC void
+S_cl_init_zero(pTHX_ struct regnode_charclass_class *cl)
+{
+ cl->type = ANYOF;
+ cl_anything(cl);
+ ANYOF_CLASS_ZERO(cl);
+ ANYOF_BITMAP_ZERO(cl);
+ if (LOC)
+ cl->flags |= ANYOF_LOCALE;
+}
+
+/* 'And' a given class with another one. Can create false positives */
+/* We assume that cl is not inverted */
+STATIC void
+S_cl_and(pTHX_ struct regnode_charclass_class *cl,
+ struct regnode_charclass_class *and_with)
+{
+ int value;
+
+ if (!(and_with->flags & ANYOF_CLASS)
+ && !(cl->flags & ANYOF_CLASS)
+ && (and_with->flags & ANYOF_LOCALE) == (cl->flags & ANYOF_LOCALE)
+ && !(and_with->flags & ANYOF_FOLD)
+ && !(cl->flags & ANYOF_FOLD)) {
+ int i;
+
+ if (and_with->flags & ANYOF_INVERT)
+ for (i = 0; i < ANYOF_BITMAP_SIZE; i++)
+ cl->bitmap[i] &= ~and_with->bitmap[i];
+ else
+ for (i = 0; i < ANYOF_BITMAP_SIZE; i++)
+ cl->bitmap[i] &= and_with->bitmap[i];
+ } /* XXXX: logic is complicated otherwise, leave it along for a moment. */
+ if (!(and_with->flags & ANYOF_EOS))
+ cl->flags &= ~ANYOF_EOS;
+}
+
+/* 'OR' a given class with another one. Can create false positives */
+/* We assume that cl is not inverted */
+STATIC void
+S_cl_or(pTHX_ struct regnode_charclass_class *cl, struct regnode_charclass_class *or_with)
+{
+ int value;
+
+ if (or_with->flags & ANYOF_INVERT) {
+ /* We do not use
+ * (B1 | CL1) | (!B2 & !CL2) = (B1 | !B2 & !CL2) | (CL1 | (!B2 & !CL2))
+ * <= (B1 | !B2) | (CL1 | !CL2)
+ * which is wasteful if CL2 is small, but we ignore CL2:
+ * (B1 | CL1) | (!B2 & !CL2) <= (B1 | CL1) | !B2 = (B1 | !B2) | CL1
+ * XXXX Can we handle case-fold? Unclear:
+ * (OK1(i) | OK1(i')) | !(OK1(i) | OK1(i')) =
+ * (OK1(i) | OK1(i')) | (!OK1(i) & !OK1(i'))
+ */
+ if ( (or_with->flags & ANYOF_LOCALE) == (cl->flags & ANYOF_LOCALE)
+ && !(or_with->flags & ANYOF_FOLD)
+ && !(cl->flags & ANYOF_FOLD) ) {
+ int i;
+
+ for (i = 0; i < ANYOF_BITMAP_SIZE; i++)
+ cl->bitmap[i] |= ~or_with->bitmap[i];
+ } /* XXXX: logic is complicated otherwise */
+ else {
+ cl_anything(cl);
+ }
+ } else {
+ /* (B1 | CL1) | (B2 | CL2) = (B1 | B2) | (CL1 | CL2)) */
+ if ( (or_with->flags & ANYOF_LOCALE) == (cl->flags & ANYOF_LOCALE)
+ && (!(or_with->flags & ANYOF_FOLD)
+ || (cl->flags & ANYOF_FOLD)) ) {
+ int i;
+
+ /* OR char bitmap and class bitmap separately */
+ for (i = 0; i < ANYOF_BITMAP_SIZE; i++)
+ cl->bitmap[i] |= or_with->bitmap[i];
+ if (or_with->flags & ANYOF_CLASS) {
+ for (i = 0; i < ANYOF_CLASSBITMAP_SIZE; i++)
+ cl->classflags[i] |= or_with->classflags[i];
+ cl->flags |= ANYOF_CLASS;
+ }
+ }
+ else { /* XXXX: logic is complicated, leave it along for a moment. */
+ cl_anything(cl);
+ }
+ }
+ if (or_with->flags & ANYOF_EOS)
+ cl->flags |= ANYOF_EOS;
+}
+
+/* REx optimizer. Converts nodes into quickier variants "in place".
+ Finds fixed substrings. */
+
/* Stops at toplevel WHILEM as well as at `last'. At end *scanp is set
to the position after last scanned or to NULL. */
int is_inf_internal = 0; /* The studied chunk is infinite */
I32 is_par = OP(scan) == OPEN ? ARG(scan) : 0;
scan_data_t data_fake;
+ struct regnode_charclass_class and_with; /* Valid if flags & SCF_DO_STCLASS_OR */
while (scan && OP(scan) != END && scan < last) {
/* Peephole optimizer: */
if (PL_regkind[(U8)OP(scan)] == EXACT) {
+ /* Merge several consecutive EXACTish nodes into one. */
regnode *n = regnext(scan);
U32 stringok = 1;
#ifdef DEBUGGING
/* Allow dumping */
n = scan + NODE_SZ_STR(scan);
while (n <= stop) {
- /* Purify reports a benign UMR here sometimes, because we
- * don't initialize the OP() slot of a node when that node
- * is occupied by just the trailing null of the string in
- * an EXACT node */
if (PL_regkind[(U8)OP(n)] != NOTHING || OP(n) == NOTHING) {
OP(n) = OPTIMIZED;
NEXT_OFF(n) = 0;
}
n++;
}
-#endif
-
+#endif
}
+ /* Follow the next-chain of the current node and optimize
+ away all the NOTHINGs from it. */
if (OP(scan) != CURLYX) {
int max = (reg_off_by_arg[OP(scan)]
? I32_MAX
else
NEXT_OFF(scan) = off;
}
+ /* The principal pseudo-switch. Cannot be a switch, since we
+ look into several different things. */
if (OP(scan) == BRANCH || OP(scan) == BRANCHJ
|| OP(scan) == IFTHEN || OP(scan) == SUSPEND) {
next = regnext(scan);
if (OP(next) == code || code == IFTHEN || code == SUSPEND) {
I32 max1 = 0, min1 = I32_MAX, num = 0;
+ struct regnode_charclass_class accum;
- if (flags & SCF_DO_SUBSTR)
- scan_commit(data);
+ if (flags & SCF_DO_SUBSTR) /* XXXX Add !SUSPEND? */
+ scan_commit(data); /* Cannot merge strings after this. */
+ if (flags & SCF_DO_STCLASS)
+ cl_init_zero(&accum);
while (OP(scan) == code) {
- I32 deltanext, minnext;
+ I32 deltanext, minnext, f = 0;
+ struct regnode_charclass_class this_class;
num++;
data_fake.flags = 0;
scan = NEXTOPER(scan);
if (code != BRANCH)
scan = NEXTOPER(scan);
- /* We suppose the run is continuous, last=next...*/
+ if (flags & SCF_DO_STCLASS) {
+ cl_init(&this_class);
+ data_fake.start_class = &this_class;
+ f = SCF_DO_STCLASS_AND;
+ }
+ /* we suppose the run is continuous, last=next...*/
minnext = study_chunk(&scan, &deltanext, next,
- &data_fake, 0);
+ &data_fake, f);
if (min1 > minnext)
min1 = minnext;
if (max1 < minnext + deltanext)
data->flags |= SF_HAS_EVAL;
if (data)
data->whilem_c = data_fake.whilem_c;
+ if (flags & SCF_DO_STCLASS)
+ cl_or(&accum, &this_class);
if (code == SUSPEND)
break;
}
}
min += min1;
delta += max1 - min1;
+ if (flags & SCF_DO_STCLASS_OR) {
+ cl_or(data->start_class, &accum);
+ if (min1) {
+ cl_and(data->start_class, &and_with);
+ flags &= ~SCF_DO_STCLASS;
+ }
+ }
+ else if (flags & SCF_DO_STCLASS_AND) {
+ if (min1) {
+ cl_and(data->start_class, &accum);
+ flags &= ~SCF_DO_STCLASS;
+ }
+ else {
+ /* Switch to OR mode: cache the old value of
+ * data->start_class */
+ StructCopy(data->start_class, &and_with,
+ struct regnode_charclass_class);
+ flags &= ~SCF_DO_STCLASS_AND;
+ StructCopy(&accum, data->start_class,
+ struct regnode_charclass_class);
+ flags |= SCF_DO_STCLASS_OR;
+ data->start_class->flags |= ANYOF_EOS;
+ }
+ }
}
else if (code == BRANCHJ) /* single branch is optimized. */
scan = NEXTOPER(NEXTOPER(scan));
data->pos_min += l; /* As in the first entry. */
data->flags &= ~SF_BEFORE_EOL;
}
+ if (flags & SCF_DO_STCLASS_AND) {
+ /* Check whether it is compatible with what we know already! */
+ int compat = 1;
+
+ if (!(data->start_class->flags & (ANYOF_CLASS | ANYOF_LOCALE))
+ && !ANYOF_BITMAP_TEST(data->start_class, *STRING(scan))
+ && (!(data->start_class->flags & ANYOF_FOLD)
+ || !ANYOF_BITMAP_TEST(data->start_class,
+ PL_fold[*STRING(scan)])))
+ compat = 0;
+ ANYOF_CLASS_ZERO(data->start_class);
+ ANYOF_BITMAP_ZERO(data->start_class);
+ if (compat)
+ ANYOF_BITMAP_SET(data->start_class, *STRING(scan));
+ data->start_class->flags &= ~ANYOF_EOS;
+ }
+ else if (flags & SCF_DO_STCLASS_OR) {
+ /* false positive possible if the class is case-folded */
+ ANYOF_BITMAP_SET(data->start_class, *STRING(scan));
+ data->start_class->flags &= ~ANYOF_EOS;
+ cl_and(data->start_class, &and_with);
+ }
+ flags &= ~SCF_DO_STCLASS;
}
- else if (PL_regkind[(U8)OP(scan)] == EXACT) {
+ else if (PL_regkind[(U8)OP(scan)] == EXACT) { /* But OP != EXACT! */
I32 l = STR_LEN(scan);
+
+ /* Search for fixed substrings supports EXACT only. */
if (flags & SCF_DO_SUBSTR)
scan_commit(data);
if (UTF) {
min += l;
if (data && (flags & SCF_DO_SUBSTR))
data->pos_min += l;
+ if (flags & SCF_DO_STCLASS_AND) {
+ /* Check whether it is compatible with what we know already! */
+ int compat = 1;
+
+ if (!(data->start_class->flags & (ANYOF_CLASS | ANYOF_LOCALE))
+ && !ANYOF_BITMAP_TEST(data->start_class, *STRING(scan))
+ && !ANYOF_BITMAP_TEST(data->start_class,
+ PL_fold[*STRING(scan)]))
+ compat = 0;
+ ANYOF_CLASS_ZERO(data->start_class);
+ ANYOF_BITMAP_ZERO(data->start_class);
+ if (compat) {
+ ANYOF_BITMAP_SET(data->start_class, *STRING(scan));
+ data->start_class->flags &= ~ANYOF_EOS;
+ data->start_class->flags |= ANYOF_FOLD;
+ if (OP(scan) == EXACTFL)
+ data->start_class->flags |= ANYOF_LOCALE;
+ }
+ }
+ else if (flags & SCF_DO_STCLASS_OR) {
+ if (data->start_class->flags & ANYOF_FOLD) {
+ /* false positive possible if the class is case-folded.
+ Assume that the locale settings are the same... */
+ ANYOF_BITMAP_SET(data->start_class, *STRING(scan));
+ data->start_class->flags &= ~ANYOF_EOS;
+ }
+ cl_and(data->start_class, &and_with);
+ }
+ flags &= ~SCF_DO_STCLASS;
}
else if (strchr((char*)PL_varies,OP(scan))) {
I32 mincount, maxcount, minnext, deltanext, pos_before, fl;
+ I32 f = flags;
regnode *oscan = scan;
-
+ struct regnode_charclass_class this_class;
+ struct regnode_charclass_class *oclass = NULL;
+
switch (PL_regkind[(U8)OP(scan)]) {
- case WHILEM:
+ case WHILEM: /* End of (?:...)* . */
scan = NEXTOPER(scan);
goto finish;
case PLUS:
- if (flags & SCF_DO_SUBSTR) {
+ if (flags & (SCF_DO_SUBSTR | SCF_DO_STCLASS)) {
next = NEXTOPER(scan);
- if (OP(next) == EXACT) {
+ if (OP(next) == EXACT || (flags & SCF_DO_STCLASS)) {
mincount = 1;
maxcount = REG_INFTY;
next = regnext(scan);
min++;
/* Fall through. */
case STAR:
+ if (flags & SCF_DO_STCLASS) {
+ mincount = 0;
+ maxcount = REG_INFTY;
+ next = regnext(scan);
+ scan = NEXTOPER(scan);
+ goto do_curly;
+ }
is_inf = is_inf_internal = 1;
scan = regnext(scan);
if (flags & SCF_DO_SUBSTR) {
- scan_commit(data);
+ scan_commit(data); /* Cannot extend fixed substrings */
data->longest = &(data->longest_float);
}
goto optimize_curly_tail;
scan = NEXTOPER(scan) + EXTRA_STEP_2ARGS;
do_curly:
if (flags & SCF_DO_SUBSTR) {
- if (mincount == 0) scan_commit(data);
+ if (mincount == 0) scan_commit(data); /* Cannot extend fixed substrings */
pos_before = data->pos_min;
}
if (data) {
if (is_inf)
data->flags |= SF_IS_INF;
}
+ if (flags & SCF_DO_STCLASS) {
+ cl_init(&this_class);
+ oclass = data->start_class;
+ data->start_class = &this_class;
+ f |= SCF_DO_STCLASS_AND;
+ f &= ~SCF_DO_STCLASS_OR;
+ }
+
/* This will finish on WHILEM, setting scan, or on NULL: */
minnext = study_chunk(&scan, &deltanext, last, data,
mincount == 0
- ? (flags & ~SCF_DO_SUBSTR) : flags);
+ ? (f & ~SCF_DO_SUBSTR) : f);
+
+ if (flags & SCF_DO_STCLASS)
+ data->start_class = oclass;
+ if (mincount == 0 || minnext == 0) {
+ if (flags & SCF_DO_STCLASS_OR) {
+ cl_or(data->start_class, &this_class);
+ }
+ else if (flags & SCF_DO_STCLASS_AND) {
+ /* Switch to OR mode: cache the old value of
+ * data->start_class */
+ StructCopy(data->start_class, &and_with,
+ struct regnode_charclass_class);
+ flags &= ~SCF_DO_STCLASS_AND;
+ StructCopy(&this_class, data->start_class,
+ struct regnode_charclass_class);
+ flags |= SCF_DO_STCLASS_OR;
+ data->start_class->flags |= ANYOF_EOS;
+ }
+ } else { /* Non-zero len */
+ if (flags & SCF_DO_STCLASS_OR) {
+ cl_or(data->start_class, &this_class);
+ cl_and(data->start_class, &and_with);
+ }
+ else if (flags & SCF_DO_STCLASS_AND)
+ cl_and(data->start_class, &this_class);
+ flags &= ~SCF_DO_STCLASS;
+ }
if (!scan) /* It was not CURLYX, but CURLY. */
scan = next;
if (ckWARN(WARN_UNSAFE) && (minnext + deltanext == 0)
data->pos_delta += - counted * deltanext +
(minnext + deltanext) * maxcount - minnext * mincount;
if (mincount != maxcount) {
+ /* Cannot extend fixed substrings found inside
+ the group. */
scan_commit(data);
if (mincount && last_str) {
sv_setsv(data->last_found, last_str);
NEXT_OFF(oscan) += NEXT_OFF(next);
}
continue;
- default: /* REF only? */
+ default: /* REF and CLUMP only? */
if (flags & SCF_DO_SUBSTR) {
- scan_commit(data);
+ scan_commit(data); /* Cannot expect anything... */
data->longest = &(data->longest_float);
}
is_inf = is_inf_internal = 1;
+ if (flags & SCF_DO_STCLASS_OR)
+ cl_anything(data->start_class);
+ flags &= ~SCF_DO_STCLASS;
break;
}
}
else if (strchr((char*)PL_simple,OP(scan)) || PL_regkind[(U8)OP(scan)] == ANYUTF8) {
+ int value;
+
if (flags & SCF_DO_SUBSTR) {
scan_commit(data);
data->pos_min++;
}
min++;
+ if (flags & SCF_DO_STCLASS) {
+ data->start_class->flags &= ~ANYOF_EOS; /* No match on empty */
+
+ /* Some of the logic below assumes that switching
+ locale on will only add false positives. */
+ switch (PL_regkind[(U8)OP(scan)]) {
+ case ANYUTF8:
+ case SANY:
+ case SANYUTF8:
+ case ALNUMUTF8:
+ case ANYOFUTF8:
+ case ALNUMLUTF8:
+ case NALNUMUTF8:
+ case NALNUMLUTF8:
+ case SPACEUTF8:
+ case NSPACEUTF8:
+ case SPACELUTF8:
+ case NSPACELUTF8:
+ case DIGITUTF8:
+ case NDIGITUTF8:
+ default:
+ do_default:
+ /* Perl_croak(aTHX_ "panic: unexpected simple REx opcode %d", OP(scan)); */
+ if (flags & SCF_DO_STCLASS_OR) /* Allow everything */
+ cl_anything(data->start_class);
+ break;
+ case REG_ANY:
+ if (OP(scan) == SANY)
+ goto do_default;
+ if (flags & SCF_DO_STCLASS_OR) { /* Everything but \n */
+ value = (ANYOF_BITMAP_TEST(data->start_class,'\n')
+ || (data->start_class->flags & ANYOF_CLASS));
+ cl_anything(data->start_class);
+ }
+ if (flags & SCF_DO_STCLASS_AND || !value)
+ ANYOF_BITMAP_CLEAR(data->start_class,'\n');
+ break;
+ case ANYOF:
+ if (flags & SCF_DO_STCLASS_AND)
+ cl_and(data->start_class,
+ (struct regnode_charclass_class*)scan);
+ else
+ cl_or(data->start_class,
+ (struct regnode_charclass_class*)scan);
+ break;
+ case ALNUM:
+ if (flags & SCF_DO_STCLASS_AND) {
+ if (!(data->start_class->flags & ANYOF_LOCALE)) {
+ ANYOF_CLASS_CLEAR(data->start_class,ANYOF_NALNUM);
+ for (value = 0; value < 256; value++)
+ if (!isALNUM(value))
+ ANYOF_BITMAP_CLEAR(data->start_class, value);
+ }
+ }
+ else {
+ if (data->start_class->flags & ANYOF_LOCALE)
+ ANYOF_CLASS_SET(data->start_class,ANYOF_ALNUM);
+ else {
+ for (value = 0; value < 256; value++)
+ if (isALNUM(value))
+ ANYOF_BITMAP_SET(data->start_class, value);
+ }
+ }
+ break;
+ case ALNUML:
+ if (flags & SCF_DO_STCLASS_AND) {
+ if (data->start_class->flags & ANYOF_LOCALE)
+ ANYOF_CLASS_CLEAR(data->start_class,ANYOF_NALNUM);
+ }
+ else {
+ ANYOF_CLASS_SET(data->start_class,ANYOF_ALNUM);
+ data->start_class->flags |= ANYOF_LOCALE;
+ }
+ break;
+ case NALNUM:
+ if (flags & SCF_DO_STCLASS_AND) {
+ if (!(data->start_class->flags & ANYOF_LOCALE)) {
+ ANYOF_CLASS_CLEAR(data->start_class,ANYOF_ALNUM);
+ for (value = 0; value < 256; value++)
+ if (isALNUM(value))
+ ANYOF_BITMAP_CLEAR(data->start_class, value);
+ }
+ }
+ else {
+ if (data->start_class->flags & ANYOF_LOCALE)
+ ANYOF_CLASS_SET(data->start_class,ANYOF_NALNUM);
+ else {
+ for (value = 0; value < 256; value++)
+ if (!isALNUM(value))
+ ANYOF_BITMAP_SET(data->start_class, value);
+ }
+ }
+ break;
+ case NALNUML:
+ if (flags & SCF_DO_STCLASS_AND) {
+ if (data->start_class->flags & ANYOF_LOCALE)
+ ANYOF_CLASS_CLEAR(data->start_class,ANYOF_ALNUM);
+ }
+ else {
+ data->start_class->flags |= ANYOF_LOCALE;
+ ANYOF_CLASS_SET(data->start_class,ANYOF_NALNUM);
+ }
+ break;
+ case SPACE:
+ if (flags & SCF_DO_STCLASS_AND) {
+ if (!(data->start_class->flags & ANYOF_LOCALE)) {
+ ANYOF_CLASS_CLEAR(data->start_class,ANYOF_NSPACE);
+ for (value = 0; value < 256; value++)
+ if (!isSPACE(value))
+ ANYOF_BITMAP_CLEAR(data->start_class, value);
+ }
+ }
+ else {
+ if (data->start_class->flags & ANYOF_LOCALE)
+ ANYOF_CLASS_SET(data->start_class,ANYOF_SPACE);
+ else {
+ for (value = 0; value < 256; value++)
+ if (isSPACE(value))
+ ANYOF_BITMAP_SET(data->start_class, value);
+ }
+ }
+ break;
+ case SPACEL:
+ if (flags & SCF_DO_STCLASS_AND) {
+ if (data->start_class->flags & ANYOF_LOCALE)
+ ANYOF_CLASS_CLEAR(data->start_class,ANYOF_NSPACE);
+ }
+ else {
+ data->start_class->flags |= ANYOF_LOCALE;
+ ANYOF_CLASS_SET(data->start_class,ANYOF_SPACE);
+ }
+ break;
+ case NSPACE:
+ if (flags & SCF_DO_STCLASS_AND) {
+ if (!(data->start_class->flags & ANYOF_LOCALE)) {
+ ANYOF_CLASS_CLEAR(data->start_class,ANYOF_SPACE);
+ for (value = 0; value < 256; value++)
+ if (isSPACE(value))
+ ANYOF_BITMAP_CLEAR(data->start_class, value);
+ }
+ }
+ else {
+ if (data->start_class->flags & ANYOF_LOCALE)
+ ANYOF_CLASS_SET(data->start_class,ANYOF_NSPACE);
+ else {
+ for (value = 0; value < 256; value++)
+ if (!isSPACE(value))
+ ANYOF_BITMAP_SET(data->start_class, value);
+ }
+ }
+ break;
+ case NSPACEL:
+ if (flags & SCF_DO_STCLASS_AND) {
+ if (data->start_class->flags & ANYOF_LOCALE) {
+ ANYOF_CLASS_CLEAR(data->start_class,ANYOF_SPACE);
+ for (value = 0; value < 256; value++)
+ if (!isSPACE(value))
+ ANYOF_BITMAP_CLEAR(data->start_class, value);
+ }
+ }
+ else {
+ data->start_class->flags |= ANYOF_LOCALE;
+ ANYOF_CLASS_SET(data->start_class,ANYOF_NSPACE);
+ }
+ break;
+ case DIGIT:
+ if (flags & SCF_DO_STCLASS_AND) {
+ ANYOF_CLASS_CLEAR(data->start_class,ANYOF_NDIGIT);
+ for (value = 0; value < 256; value++)
+ if (!isDIGIT(value))
+ ANYOF_BITMAP_CLEAR(data->start_class, value);
+ }
+ else {
+ if (data->start_class->flags & ANYOF_LOCALE)
+ ANYOF_CLASS_SET(data->start_class,ANYOF_DIGIT);
+ else {
+ for (value = 0; value < 256; value++)
+ if (isDIGIT(value))
+ ANYOF_BITMAP_SET(data->start_class, value);
+ }
+ }
+ break;
+ case NDIGIT:
+ if (flags & SCF_DO_STCLASS_AND) {
+ ANYOF_CLASS_CLEAR(data->start_class,ANYOF_DIGIT);
+ for (value = 0; value < 256; value++)
+ if (isDIGIT(value))
+ ANYOF_BITMAP_CLEAR(data->start_class, value);
+ }
+ else {
+ if (data->start_class->flags & ANYOF_LOCALE)
+ ANYOF_CLASS_SET(data->start_class,ANYOF_NDIGIT);
+ else {
+ for (value = 0; value < 256; value++)
+ if (!isDIGIT(value))
+ ANYOF_BITMAP_SET(data->start_class, value);
+ }
+ }
+ break;
+ }
+ if (flags & SCF_DO_STCLASS_OR)
+ cl_and(data->start_class, &and_with);
+ flags &= ~SCF_DO_STCLASS;
+ }
}
else if (PL_regkind[(U8)OP(scan)] == EOL && flags & SCF_DO_SUBSTR) {
data->flags |= (OP(scan) == MEOL
? SF_BEFORE_MEOL
: SF_BEFORE_SEOL);
}
- else if (PL_regkind[(U8)OP(scan)] == BRANCHJ
- && (scan->flags || data)
+ else if ( PL_regkind[(U8)OP(scan)] == BRANCHJ
+ /* Lookbehind, or need to calculate parens/evals/stclass: */
+ && (scan->flags || data || (flags & SCF_DO_STCLASS))
&& (OP(scan) == IFMATCH || OP(scan) == UNLESSM)) {
+ /* Lookahead/lookbehind */
I32 deltanext, minnext;
regnode *nscan;
+ struct regnode_charclass_class intrnl;
+ int f = 0;
data_fake.flags = 0;
if (data)
data_fake.whilem_c = data->whilem_c;
+ if ( flags & SCF_DO_STCLASS && !scan->flags
+ && OP(scan) == IFMATCH ) { /* Lookahead */
+ cl_init(&intrnl);
+ data_fake.start_class = &intrnl;
+ f = SCF_DO_STCLASS_AND;
+ }
next = regnext(scan);
nscan = NEXTOPER(NEXTOPER(scan));
- minnext = study_chunk(&nscan, &deltanext, last, &data_fake, 0);
+ minnext = study_chunk(&nscan, &deltanext, last, &data_fake, f);
if (scan->flags) {
if (deltanext) {
FAIL("variable length lookbehind not implemented");
}
else if (minnext > U8_MAX) {
-#ifdef UV_IS_QUAD
- FAIL2("lookbehind longer than %" PERL_PRIu64 " not implemented", (UV)U8_MAX);
-#else
- FAIL2("lookbehind longer than %d not implemented", U8_MAX);
-#endif
+ FAIL2("lookbehind longer than %"UVuf" not implemented", (UV)U8_MAX);
}
scan->flags = minnext;
}
data->flags |= SF_HAS_EVAL;
if (data)
data->whilem_c = data_fake.whilem_c;
+ if (f) {
+ int was = (data->start_class->flags & ANYOF_EOS);
+
+ cl_and(data->start_class, &intrnl);
+ if (was)
+ data->start_class->flags |= ANYOF_EOS;
+ }
}
else if (OP(scan) == OPEN) {
pars++;
data->longest = &(data->longest_float);
}
is_inf = is_inf_internal = 1;
+ if (flags & SCF_DO_STCLASS_OR) /* Allow everything */
+ cl_anything(data->start_class);
}
/* Else: zero-length, ignore. */
scan = regnext(scan);
data->flags |= SF_HAS_PAR;
data->flags &= ~SF_IN_PAR;
}
+ if (flags & SCF_DO_STCLASS_OR)
+ cl_and(data->start_class, &and_with);
return min;
}
DEBUG_r(if (!PL_colorset) reginitcolors());
DEBUG_r(PerlIO_printf(Perl_debug_log, "%sCompiling REx%s `%s%*s%s'\n",
PL_colors[4],PL_colors[5],PL_colors[0],
- xend - exp, PL_regprecomp, PL_colors[1]));
+ (int)(xend - exp), PL_regprecomp, PL_colors[1]));
PL_regflags = pm->op_pmflags;
PL_regsawback = 0;
PL_regprecomp = Nullch;
return(NULL);
}
- DEBUG_r(PerlIO_printf(Perl_debug_log, "size %d ", PL_regsize));
+ DEBUG_r(PerlIO_printf(Perl_debug_log, "size %"IVdf" ", (IV)PL_regsize));
/* Small enough for pointer-storage convention?
If extralen==0, this means that we will not need long jumps. */
Newz(1004, r->substrs, 1, struct reg_substr_data);
StructCopy(&zero_scan_data, &data, scan_data_t);
+ /* XXXX Should not we check for something else? Usually it is OPEN1... */
if (OP(scan) != BRANCH) { /* Only one top-level choice. */
I32 fake;
STRLEN longest_float_length, longest_fixed_length;
+ struct regnode_charclass_class ch_class;
+ int stclass_flag;
first = scan;
/* Skip introductions and multiplicators >= 1. */
while ((OP(first) == OPEN && (sawopen = 1)) ||
+ /* An OR of *one* alternative - should not happen now. */
(OP(first) == BRANCH && OP(regnext(first)) != BRANCH) ||
(OP(first) == PLUS) ||
(OP(first) == MINMOD) ||
+ /* An {n,m} with n>0 */
(PL_regkind[(U8)OP(first)] == CURLY && ARG1(first) > 0) ) {
if (OP(first) == PLUS)
sawplus = 1;
/* Starting-point info. */
again:
- if (OP(first) == EXACT); /* Empty, get anchored substr later. */
- else if (strchr((char*)PL_simple+4,OP(first)))
+ if (PL_regkind[(U8)OP(first)] == EXACT) {
+ if (OP(first) == EXACT); /* Empty, get anchored substr later. */
+ else if ((OP(first) == EXACTF || OP(first) == EXACTFL)
+ && !UTF)
+ r->regstclass = first;
+ }
+ else if (strchr((char*)PL_simple,OP(first)))
r->regstclass = first;
else if (PL_regkind[(U8)OP(first)] == BOUND ||
PL_regkind[(U8)OP(first)] == NBOUND)
r->reganch |= ROPT_SKIP;
/* Scan is after the zeroth branch, first is atomic matcher. */
- DEBUG_r(PerlIO_printf(Perl_debug_log, "first at %d\n",
- first - scan + 1));
+ DEBUG_r(PerlIO_printf(Perl_debug_log, "first at %"IVdf"\n",
+ (IV)(first - scan + 1)));
/*
* If there's something expensive in the r.e., find the
* longest literal string that must appear and make it the
data.last_found = newSVpvn("",0);
data.longest = &(data.longest_fixed);
first = scan;
-
+ if (!r->regstclass) {
+ cl_init(&ch_class);
+ data.start_class = &ch_class;
+ stclass_flag = SCF_DO_STCLASS_AND;
+ } else /* XXXX Check for BOUND? */
+ stclass_flag = 0;
+
minlen = study_chunk(&first, &fake, scan + PL_regsize, /* Up to end */
- &data, SCF_DO_SUBSTR);
+ &data, SCF_DO_SUBSTR | stclass_flag);
if ( PL_regnpar == 1 && data.longest == &(data.longest_fixed)
&& data.last_start_min == 0 && data.last_end > 0
&& !PL_seen_zerolen
SvREFCNT_dec(data.longest_fixed);
longest_fixed_length = 0;
}
+ if (r->regstclass
+ && (OP(r->regstclass) == REG_ANY || OP(r->regstclass) == ANYUTF8
+ || OP(r->regstclass) == SANYUTF8 || OP(r->regstclass) == SANY))
+ r->regstclass = NULL;
+ if ((!r->anchored_substr || r->anchored_offset) && stclass_flag
+ && !(data.start_class->flags & ANYOF_EOS)
+ && !cl_is_anything(data.start_class)) {
+ SV *sv;
+ I32 n = add_data(1, "f");
+
+ New(1006, PL_regcomp_rx->data->data[n], 1,
+ struct regnode_charclass_class);
+ StructCopy(data.start_class,
+ (struct regnode_charclass_class*)PL_regcomp_rx->data->data[n],
+ struct regnode_charclass_class);
+ r->regstclass = (regnode*)PL_regcomp_rx->data->data[n];
+ r->reganch &= ~ROPT_SKIP; /* Used in find_byclass(). */
+ DEBUG_r((sv = sv_newmortal(),
+ regprop(sv, (regnode*)data.start_class),
+ PerlIO_printf(Perl_debug_log, "synthetic stclass.\n",
+ SvPVX(sv))));
+ }
/* A temporary algorithm prefers floated substr to fixed one to dig more info. */
if (longest_fixed_length > longest_float_length) {
r->check_offset_min = data.offset_float_min;
r->check_offset_max = data.offset_float_max;
}
- if (r->check_substr) {
+ /* XXXX Currently intuiting is not compatible with ANCH_GPOS.
+ This should be changed ASAP! */
+ if (r->check_substr && !(r->reganch & ROPT_ANCH_GPOS)) {
r->reganch |= RE_USE_INTUIT;
if (SvTAIL(r->check_substr))
r->reganch |= RE_INTUIT_TAIL;
else {
/* Several toplevels. Best we can is to set minlen. */
I32 fake;
+ struct regnode_charclass_class ch_class;
DEBUG_r(PerlIO_printf(Perl_debug_log, "\n"));
scan = r->program + 1;
- minlen = study_chunk(&scan, &fake, scan + PL_regsize, &data, 0);
+ cl_init(&ch_class);
+ data.start_class = &ch_class;
+ minlen = study_chunk(&scan, &fake, scan + PL_regsize, &data, SCF_DO_STCLASS_AND);
r->check_substr = r->anchored_substr = r->float_substr = Nullsv;
+ if (!(data.start_class->flags & ANYOF_EOS)
+ && !cl_is_anything(data.start_class)) {
+ SV *sv;
+ I32 n = add_data(1, "f");
+
+ New(1006, PL_regcomp_rx->data->data[n], 1,
+ struct regnode_charclass_class);
+ StructCopy(data.start_class,
+ (struct regnode_charclass_class*)PL_regcomp_rx->data->data[n],
+ struct regnode_charclass_class);
+ r->regstclass = (regnode*)PL_regcomp_rx->data->data[n];
+ r->reganch &= ~ROPT_SKIP; /* Used in find_byclass(). */
+ DEBUG_r((sv = sv_newmortal(),
+ regprop(sv, (regnode*)data.start_class),
+ PerlIO_printf(Perl_debug_log, "synthetic stclass.\n",
+ SvPVX(sv))));
+ }
}
r->minlen = minlen;
p++;
break;
case 'e':
- ender = '\033';
+#ifdef ASCIIish
+ ender = '\033';
+#else
+ ender = '\047';
+#endif
p++;
break;
case 'a':
- ender = '\007';
+#ifdef ASCIIish
+ ender = '\007';
+#else
+ ender = '\057';
+#endif
p++;
break;
case 'x':
if (!e)
FAIL("Missing right brace on \\x{}");
else if (UTF) {
- ender = scan_hex(p + 1, e - p, &numlen);
+ ender = (UV)scan_hex(p + 1, e - p, &numlen);
if (numlen + len >= 127) { /* numlen is generous */
p--;
goto loopdone;
FAIL("Can't use \\x{} without 'use utf8' declaration");
}
else {
- ender = scan_hex(p, 2, &numlen);
+ ender = (UV)scan_hex(p, 2, &numlen);
p += numlen;
}
break;
case '5': case '6': case '7': case '8':case '9':
if (*p == '0' ||
(isDIGIT(p[1]) && atoi(p) >= PL_regnpar) ) {
- ender = scan_oct(p, 3, &numlen);
+ ender = (UV)scan_oct(p, 3, &numlen);
p += numlen;
}
else {
default:
if (!SIZE_ONLY && ckWARN(WARN_UNSAFE) && isALPHA(*p))
Perl_warner(aTHX_ WARN_UNSAFE,
- "/%.127s/: Unrecognized escape \\%c passed through",
- PL_regprecomp,
- *p);
+ "/%.127s/: Unrecognized escape \\%c passed through",
+ PL_regprecomp,
+ *p);
goto normal_default;
}
break;
{
dTHR;
char *posixcc = 0;
- I32 namedclass = -1;
+ I32 namedclass = OOB_NAMEDCLASS;
if (value == '[' && PL_regcomp_parse + 1 < PL_regxend &&
/* I smell either [: or [= or [. -- POSIX has been here, right? */
STATIC void
S_checkposixcc(pTHX)
{
- if (ckWARN(WARN_UNSAFE) && !SIZE_ONLY &&
+ if (!SIZE_ONLY && ckWARN(WARN_UNSAFE) &&
(*PL_regcomp_parse == ':' ||
*PL_regcomp_parse == '=' ||
*PL_regcomp_parse == '.')) {
S_regclass(pTHX)
{
dTHR;
- register char *opnd, *s;
- register I32 value;
+ register UV value;
register I32 lastvalue = OOB_CHAR8;
register I32 range = 0;
register regnode *ret;
register I32 def;
I32 numlen;
I32 namedclass;
+ char *rangebegin;
+ bool need_class = 0;
- s = opnd = MASK(PL_regcode);
ret = reg_node(ANYOF);
- for (value = 0; value < ANYOF_SIZE; value++)
- REGC(0, s++);
+ if (SIZE_ONLY)
+ PL_regsize += ANYOF_SKIP;
+ else {
+ ret->flags = 0;
+ ANYOF_BITMAP_ZERO(ret);
+ PL_regcode += ANYOF_SKIP;
+ if (FOLD)
+ ANYOF_FLAGS(ret) |= ANYOF_FOLD;
+ if (LOC)
+ ANYOF_FLAGS(ret) |= ANYOF_LOCALE;
+ }
if (*PL_regcomp_parse == '^') { /* Complement of range. */
PL_regnaughty++;
PL_regcomp_parse++;
if (!SIZE_ONLY)
- ANYOF_FLAGS(opnd) |= ANYOF_INVERT;
- }
- if (!SIZE_ONLY) {
- PL_regcode += ANY_SKIP;
- if (FOLD)
- ANYOF_FLAGS(opnd) |= ANYOF_FOLD;
- if (LOC)
- ANYOF_FLAGS(opnd) |= ANYOF_LOCALE;
- }
- else {
- PL_regsize += ANY_SKIP;
+ ANYOF_FLAGS(ret) |= ANYOF_INVERT;
}
- checkposixcc();
+ if (!SIZE_ONLY && ckWARN(WARN_UNSAFE))
+ checkposixcc();
if (*PL_regcomp_parse == ']' || *PL_regcomp_parse == '-')
goto skipcond; /* allow 1st char to be ] or - */
while (PL_regcomp_parse < PL_regxend && *PL_regcomp_parse != ']') {
skipcond:
namedclass = OOB_NAMEDCLASS;
+ if (!range)
+ rangebegin = PL_regcomp_parse;
value = UCHARAT(PL_regcomp_parse++);
if (value == '[')
namedclass = regpposixcc(value);
case 't': value = '\t'; break;
case 'f': value = '\f'; break;
case 'b': value = '\b'; break;
+#ifdef ASCIIish
case 'e': value = '\033'; break;
case 'a': value = '\007'; break;
+#else
+ case 'e': value = '\047'; break;
+ case 'a': value = '\057'; break;
+#endif
case 'x':
- value = scan_hex(PL_regcomp_parse, 2, &numlen);
+ value = (UV)scan_hex(PL_regcomp_parse, 2, &numlen);
PL_regcomp_parse += numlen;
break;
case 'c':
break;
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
- value = scan_oct(--PL_regcomp_parse, 3, &numlen);
+ value = (UV)scan_oct(--PL_regcomp_parse, 3, &numlen);
PL_regcomp_parse += numlen;
break;
+ default:
+ if (!SIZE_ONLY && ckWARN(WARN_UNSAFE) && isALPHA(value))
+ Perl_warner(aTHX_ WARN_UNSAFE,
+ "/%.127s/: Unrecognized escape \\%c in character class passed through",
+ PL_regprecomp,
+ (int)value);
+ break;
}
}
- if (!SIZE_ONLY && namedclass > OOB_NAMEDCLASS) {
- if (range)
- FAIL("invalid [] range in regexp"); /* [a-\w], [a-[:word:]] */
- switch (namedclass) {
- case ANYOF_ALNUM:
- if (LOC)
- ANYOF_CLASS_SET(opnd, ANYOF_ALNUM);
- else {
- for (value = 0; value < 256; value++)
- if (isALNUM(value))
- ANYOF_BITMAP_SET(opnd, value);
- }
- break;
- case ANYOF_NALNUM:
- if (LOC)
- ANYOF_CLASS_SET(opnd, ANYOF_NALNUM);
- else {
- for (value = 0; value < 256; value++)
- if (!isALNUM(value))
- ANYOF_BITMAP_SET(opnd, value);
- }
- break;
- case ANYOF_SPACE:
- if (LOC)
- ANYOF_CLASS_SET(opnd, ANYOF_SPACE);
- else {
- for (value = 0; value < 256; value++)
- if (isSPACE(value))
- ANYOF_BITMAP_SET(opnd, value);
- }
- break;
- case ANYOF_NSPACE:
- if (LOC)
- ANYOF_CLASS_SET(opnd, ANYOF_NSPACE);
- else {
- for (value = 0; value < 256; value++)
- if (!isSPACE(value))
- ANYOF_BITMAP_SET(opnd, value);
- }
- break;
- case ANYOF_DIGIT:
- if (LOC)
- ANYOF_CLASS_SET(opnd, ANYOF_DIGIT);
- else {
- for (value = '0'; value <= '9'; value++)
- ANYOF_BITMAP_SET(opnd, value);
- }
- break;
- case ANYOF_NDIGIT:
- if (LOC)
- ANYOF_CLASS_SET(opnd, ANYOF_NDIGIT);
- else {
- for (value = 0; value < '0'; value++)
- ANYOF_BITMAP_SET(opnd, value);
- for (value = '9' + 1; value < 256; value++)
- ANYOF_BITMAP_SET(opnd, value);
- }
- break;
- case ANYOF_NALNUMC:
- if (LOC)
- ANYOF_CLASS_SET(opnd, ANYOF_NALNUMC);
- else {
- for (value = 0; value < 256; value++)
- if (!isALNUMC(value))
- ANYOF_BITMAP_SET(opnd, value);
- }
- break;
- case ANYOF_ALNUMC:
- if (LOC)
- ANYOF_CLASS_SET(opnd, ANYOF_ALNUMC);
- else {
- for (value = 0; value < 256; value++)
- if (isALNUMC(value))
- ANYOF_BITMAP_SET(opnd, value);
- }
- break;
- case ANYOF_ALPHA:
- if (LOC)
- ANYOF_CLASS_SET(opnd, ANYOF_ALPHA);
- else {
- for (value = 0; value < 256; value++)
- if (isALPHA(value))
- ANYOF_BITMAP_SET(opnd, value);
- }
- break;
- case ANYOF_NALPHA:
- if (LOC)
- ANYOF_CLASS_SET(opnd, ANYOF_NALPHA);
- else {
- for (value = 0; value < 256; value++)
- if (!isALPHA(value))
- ANYOF_BITMAP_SET(opnd, value);
- }
- break;
- case ANYOF_ASCII:
- if (LOC)
- ANYOF_CLASS_SET(opnd, ANYOF_ASCII);
- else {
- for (value = 0; value < 128; value++)
- ANYOF_BITMAP_SET(opnd, value);
- }
- break;
- case ANYOF_NASCII:
- if (LOC)
- ANYOF_CLASS_SET(opnd, ANYOF_NASCII);
- else {
- for (value = 128; value < 256; value++)
- ANYOF_BITMAP_SET(opnd, value);
- }
- break;
- case ANYOF_CNTRL:
- if (LOC)
- ANYOF_CLASS_SET(opnd, ANYOF_CNTRL);
- else {
- for (value = 0; value < 256; value++)
- if (isCNTRL(value))
- ANYOF_BITMAP_SET(opnd, value);
- }
- lastvalue = OOB_CHAR8;
- break;
- case ANYOF_NCNTRL:
- if (LOC)
- ANYOF_CLASS_SET(opnd, ANYOF_NCNTRL);
- else {
- for (value = 0; value < 256; value++)
- if (!isCNTRL(value))
- ANYOF_BITMAP_SET(opnd, value);
- }
- break;
- case ANYOF_GRAPH:
- if (LOC)
- ANYOF_CLASS_SET(opnd, ANYOF_GRAPH);
- else {
- for (value = 0; value < 256; value++)
- if (isGRAPH(value))
- ANYOF_BITMAP_SET(opnd, value);
- }
- break;
- case ANYOF_NGRAPH:
- if (LOC)
- ANYOF_CLASS_SET(opnd, ANYOF_NGRAPH);
- else {
- for (value = 0; value < 256; value++)
- if (!isGRAPH(value))
- ANYOF_BITMAP_SET(opnd, value);
- }
- break;
- case ANYOF_LOWER:
- if (LOC)
- ANYOF_CLASS_SET(opnd, ANYOF_LOWER);
- else {
- for (value = 0; value < 256; value++)
- if (isLOWER(value))
- ANYOF_BITMAP_SET(opnd, value);
- }
- break;
- case ANYOF_NLOWER:
- if (LOC)
- ANYOF_CLASS_SET(opnd, ANYOF_NLOWER);
- else {
- for (value = 0; value < 256; value++)
- if (!isLOWER(value))
- ANYOF_BITMAP_SET(opnd, value);
- }
- break;
- case ANYOF_PRINT:
- if (LOC)
- ANYOF_CLASS_SET(opnd, ANYOF_PRINT);
- else {
- for (value = 0; value < 256; value++)
- if (isPRINT(value))
- ANYOF_BITMAP_SET(opnd, value);
- }
- break;
- case ANYOF_NPRINT:
- if (LOC)
- ANYOF_CLASS_SET(opnd, ANYOF_NPRINT);
- else {
- for (value = 0; value < 256; value++)
- if (!isPRINT(value))
- ANYOF_BITMAP_SET(opnd, value);
- }
- break;
- case ANYOF_PUNCT:
- if (LOC)
- ANYOF_CLASS_SET(opnd, ANYOF_PUNCT);
- else {
- for (value = 0; value < 256; value++)
- if (isPUNCT(value))
- ANYOF_BITMAP_SET(opnd, value);
- }
- break;
- case ANYOF_NPUNCT:
- if (LOC)
- ANYOF_CLASS_SET(opnd, ANYOF_NPUNCT);
- else {
- for (value = 0; value < 256; value++)
- if (!isPUNCT(value))
- ANYOF_BITMAP_SET(opnd, value);
- }
- break;
- case ANYOF_UPPER:
- if (LOC)
- ANYOF_CLASS_SET(opnd, ANYOF_UPPER);
- else {
- for (value = 0; value < 256; value++)
- if (isUPPER(value))
- ANYOF_BITMAP_SET(opnd, value);
- }
- break;
- case ANYOF_NUPPER:
- if (LOC)
- ANYOF_CLASS_SET(opnd, ANYOF_NUPPER);
- else {
- for (value = 0; value < 256; value++)
- if (!isUPPER(value))
- ANYOF_BITMAP_SET(opnd, value);
+ if (namedclass > OOB_NAMEDCLASS) {
+ if (!need_class && !SIZE_ONLY)
+ ANYOF_CLASS_ZERO(ret);
+ need_class = 1;
+ if (range) { /* a-\d, a-[:digit:] */
+ if (!SIZE_ONLY) {
+ if (ckWARN(WARN_UNSAFE))
+ Perl_warner(aTHX_ WARN_UNSAFE,
+ "/%.127s/: false [] range \"%*.*s\" in regexp",
+ PL_regprecomp,
+ PL_regcomp_parse - rangebegin,
+ PL_regcomp_parse - rangebegin,
+ rangebegin);
+ ANYOF_BITMAP_SET(ret, lastvalue);
+ ANYOF_BITMAP_SET(ret, '-');
}
- break;
- case ANYOF_XDIGIT:
- if (LOC)
- ANYOF_CLASS_SET(opnd, ANYOF_XDIGIT);
- else {
- for (value = 0; value < 256; value++)
- if (isXDIGIT(value))
- ANYOF_BITMAP_SET(opnd, value);
+ range = 0; /* this is not a true range */
+ }
+ if (!SIZE_ONLY) {
+ switch (namedclass) {
+ case ANYOF_ALNUM:
+ if (LOC)
+ ANYOF_CLASS_SET(ret, ANYOF_ALNUM);
+ else {
+ for (value = 0; value < 256; value++)
+ if (isALNUM(value))
+ ANYOF_BITMAP_SET(ret, value);
+ }
+ break;
+ case ANYOF_NALNUM:
+ if (LOC)
+ ANYOF_CLASS_SET(ret, ANYOF_NALNUM);
+ else {
+ for (value = 0; value < 256; value++)
+ if (!isALNUM(value))
+ ANYOF_BITMAP_SET(ret, value);
+ }
+ break;
+ case ANYOF_SPACE:
+ if (LOC)
+ ANYOF_CLASS_SET(ret, ANYOF_SPACE);
+ else {
+ for (value = 0; value < 256; value++)
+ if (isSPACE(value))
+ ANYOF_BITMAP_SET(ret, value);
+ }
+ break;
+ case ANYOF_NSPACE:
+ if (LOC)
+ ANYOF_CLASS_SET(ret, ANYOF_NSPACE);
+ else {
+ for (value = 0; value < 256; value++)
+ if (!isSPACE(value))
+ ANYOF_BITMAP_SET(ret, value);
+ }
+ break;
+ case ANYOF_DIGIT:
+ if (LOC)
+ ANYOF_CLASS_SET(ret, ANYOF_DIGIT);
+ else {
+ for (value = '0'; value <= '9'; value++)
+ ANYOF_BITMAP_SET(ret, value);
+ }
+ break;
+ case ANYOF_NDIGIT:
+ if (LOC)
+ ANYOF_CLASS_SET(ret, ANYOF_NDIGIT);
+ else {
+ for (value = 0; value < '0'; value++)
+ ANYOF_BITMAP_SET(ret, value);
+ for (value = '9' + 1; value < 256; value++)
+ ANYOF_BITMAP_SET(ret, value);
+ }
+ break;
+ case ANYOF_NALNUMC:
+ if (LOC)
+ ANYOF_CLASS_SET(ret, ANYOF_NALNUMC);
+ else {
+ for (value = 0; value < 256; value++)
+ if (!isALNUMC(value))
+ ANYOF_BITMAP_SET(ret, value);
+ }
+ break;
+ case ANYOF_ALNUMC:
+ if (LOC)
+ ANYOF_CLASS_SET(ret, ANYOF_ALNUMC);
+ else {
+ for (value = 0; value < 256; value++)
+ if (isALNUMC(value))
+ ANYOF_BITMAP_SET(ret, value);
+ }
+ break;
+ case ANYOF_ALPHA:
+ if (LOC)
+ ANYOF_CLASS_SET(ret, ANYOF_ALPHA);
+ else {
+ for (value = 0; value < 256; value++)
+ if (isALPHA(value))
+ ANYOF_BITMAP_SET(ret, value);
+ }
+ break;
+ case ANYOF_NALPHA:
+ if (LOC)
+ ANYOF_CLASS_SET(ret, ANYOF_NALPHA);
+ else {
+ for (value = 0; value < 256; value++)
+ if (!isALPHA(value))
+ ANYOF_BITMAP_SET(ret, value);
+ }
+ break;
+ case ANYOF_ASCII:
+ if (LOC)
+ ANYOF_CLASS_SET(ret, ANYOF_ASCII);
+ else {
+#ifdef ASCIIish
+ for (value = 0; value < 128; value++)
+ ANYOF_BITMAP_SET(ret, value);
+#else /* EBCDIC */
+ for (value = 0; value < 256; value++)
+ if (isASCII(value))
+ ANYOF_BITMAP_SET(ret, value);
+#endif /* EBCDIC */
+ }
+ break;
+ case ANYOF_NASCII:
+ if (LOC)
+ ANYOF_CLASS_SET(ret, ANYOF_NASCII);
+ else {
+#ifdef ASCIIish
+ for (value = 128; value < 256; value++)
+ ANYOF_BITMAP_SET(ret, value);
+#else /* EBCDIC */
+ for (value = 0; value < 256; value++)
+ if (!isASCII(value))
+ ANYOF_BITMAP_SET(ret, value);
+#endif /* EBCDIC */
+ }
+ break;
+ case ANYOF_CNTRL:
+ if (LOC)
+ ANYOF_CLASS_SET(ret, ANYOF_CNTRL);
+ else {
+ for (value = 0; value < 256; value++)
+ if (isCNTRL(value))
+ ANYOF_BITMAP_SET(ret, value);
+ }
+ lastvalue = OOB_CHAR8;
+ break;
+ case ANYOF_NCNTRL:
+ if (LOC)
+ ANYOF_CLASS_SET(ret, ANYOF_NCNTRL);
+ else {
+ for (value = 0; value < 256; value++)
+ if (!isCNTRL(value))
+ ANYOF_BITMAP_SET(ret, value);
+ }
+ break;
+ case ANYOF_GRAPH:
+ if (LOC)
+ ANYOF_CLASS_SET(ret, ANYOF_GRAPH);
+ else {
+ for (value = 0; value < 256; value++)
+ if (isGRAPH(value))
+ ANYOF_BITMAP_SET(ret, value);
+ }
+ break;
+ case ANYOF_NGRAPH:
+ if (LOC)
+ ANYOF_CLASS_SET(ret, ANYOF_NGRAPH);
+ else {
+ for (value = 0; value < 256; value++)
+ if (!isGRAPH(value))
+ ANYOF_BITMAP_SET(ret, value);
+ }
+ break;
+ case ANYOF_LOWER:
+ if (LOC)
+ ANYOF_CLASS_SET(ret, ANYOF_LOWER);
+ else {
+ for (value = 0; value < 256; value++)
+ if (isLOWER(value))
+ ANYOF_BITMAP_SET(ret, value);
+ }
+ break;
+ case ANYOF_NLOWER:
+ if (LOC)
+ ANYOF_CLASS_SET(ret, ANYOF_NLOWER);
+ else {
+ for (value = 0; value < 256; value++)
+ if (!isLOWER(value))
+ ANYOF_BITMAP_SET(ret, value);
+ }
+ break;
+ case ANYOF_PRINT:
+ if (LOC)
+ ANYOF_CLASS_SET(ret, ANYOF_PRINT);
+ else {
+ for (value = 0; value < 256; value++)
+ if (isPRINT(value))
+ ANYOF_BITMAP_SET(ret, value);
+ }
+ break;
+ case ANYOF_NPRINT:
+ if (LOC)
+ ANYOF_CLASS_SET(ret, ANYOF_NPRINT);
+ else {
+ for (value = 0; value < 256; value++)
+ if (!isPRINT(value))
+ ANYOF_BITMAP_SET(ret, value);
+ }
+ break;
+ case ANYOF_PUNCT:
+ if (LOC)
+ ANYOF_CLASS_SET(ret, ANYOF_PUNCT);
+ else {
+ for (value = 0; value < 256; value++)
+ if (isPUNCT(value))
+ ANYOF_BITMAP_SET(ret, value);
+ }
+ break;
+ case ANYOF_NPUNCT:
+ if (LOC)
+ ANYOF_CLASS_SET(ret, ANYOF_NPUNCT);
+ else {
+ for (value = 0; value < 256; value++)
+ if (!isPUNCT(value))
+ ANYOF_BITMAP_SET(ret, value);
+ }
+ break;
+ case ANYOF_UPPER:
+ if (LOC)
+ ANYOF_CLASS_SET(ret, ANYOF_UPPER);
+ else {
+ for (value = 0; value < 256; value++)
+ if (isUPPER(value))
+ ANYOF_BITMAP_SET(ret, value);
+ }
+ break;
+ case ANYOF_NUPPER:
+ if (LOC)
+ ANYOF_CLASS_SET(ret, ANYOF_NUPPER);
+ else {
+ for (value = 0; value < 256; value++)
+ if (!isUPPER(value))
+ ANYOF_BITMAP_SET(ret, value);
+ }
+ break;
+ case ANYOF_XDIGIT:
+ if (LOC)
+ ANYOF_CLASS_SET(ret, ANYOF_XDIGIT);
+ else {
+ for (value = 0; value < 256; value++)
+ if (isXDIGIT(value))
+ ANYOF_BITMAP_SET(ret, value);
+ }
+ break;
+ case ANYOF_NXDIGIT:
+ if (LOC)
+ ANYOF_CLASS_SET(ret, ANYOF_NXDIGIT);
+ else {
+ for (value = 0; value < 256; value++)
+ if (!isXDIGIT(value))
+ ANYOF_BITMAP_SET(ret, value);
+ }
+ break;
+ default:
+ FAIL("invalid [::] class in regexp");
+ break;
}
- break;
- case ANYOF_NXDIGIT:
if (LOC)
- ANYOF_CLASS_SET(opnd, ANYOF_NXDIGIT);
- else {
- for (value = 0; value < 256; value++)
- if (!isXDIGIT(value))
- ANYOF_BITMAP_SET(opnd, value);
- }
- break;
- default:
- FAIL("invalid [::] class in regexp");
- break;
+ ANYOF_FLAGS(ret) |= ANYOF_CLASS;
+ continue;
}
- if (LOC)
- ANYOF_FLAGS(opnd) |= ANYOF_CLASS;
- continue;
}
if (range) {
- if (lastvalue > value)
- FAIL("invalid [] range in regexp"); /* [b-a] */
+ if (lastvalue > value) /* b-a */ {
+ Perl_croak(aTHX_
+ "/%.127s/: invalid [] range \"%*.*s\" in regexp",
+ PL_regprecomp,
+ PL_regcomp_parse - rangebegin,
+ PL_regcomp_parse - rangebegin,
+ rangebegin);
+ }
range = 0;
}
else {
lastvalue = value;
if (*PL_regcomp_parse == '-' && PL_regcomp_parse+1 < PL_regxend &&
PL_regcomp_parse[1] != ']') {
- if (namedclass > OOB_NAMEDCLASS)
- FAIL("invalid [] range in regexp"); /* [\w-a] */
PL_regcomp_parse++;
- range = 1;
+ if (namedclass > OOB_NAMEDCLASS) { /* \w-, [:word:]- */
+ if (ckWARN(WARN_UNSAFE))
+ Perl_warner(aTHX_ WARN_UNSAFE,
+ "/%.127s/: false [] range \"%*.*s\" in regexp",
+ PL_regprecomp,
+ PL_regcomp_parse - rangebegin,
+ PL_regcomp_parse - rangebegin,
+ rangebegin);
+ if (!SIZE_ONLY)
+ ANYOF_BITMAP_SET(ret, '-');
+ } else
+ range = 1;
continue; /* do it next time */
}
}
if (isLOWER(lastvalue)) {
for (i = lastvalue; i <= value; i++)
if (isLOWER(i))
- ANYOF_BITMAP_SET(opnd, i);
+ ANYOF_BITMAP_SET(ret, i);
} else {
for (i = lastvalue; i <= value; i++)
if (isUPPER(i))
- ANYOF_BITMAP_SET(opnd, i);
+ ANYOF_BITMAP_SET(ret, i);
}
}
else
#endif
for ( ; lastvalue <= value; lastvalue++)
- ANYOF_BITMAP_SET(opnd, lastvalue);
+ ANYOF_BITMAP_SET(ret, lastvalue);
}
range = 0;
}
+ if (need_class) {
+ if (SIZE_ONLY)
+ PL_regsize += ANYOF_CLASS_ADD_SKIP;
+ else
+ PL_regcode += ANYOF_CLASS_ADD_SKIP;
+ }
/* optimize case-insensitive simple patterns (e.g. /[a-z]/i) */
if (!SIZE_ONLY &&
- (ANYOF_FLAGS(opnd) & (ANYOF_FLAGS_ALL ^ ANYOF_INVERT)) == ANYOF_FOLD) {
+ (ANYOF_FLAGS(ret) & (ANYOF_FLAGS_ALL ^ ANYOF_INVERT)) == ANYOF_FOLD) {
for (value = 0; value < 256; ++value) {
- if (ANYOF_BITMAP_TEST(opnd, value)) {
+ if (ANYOF_BITMAP_TEST(ret, value)) {
I32 cf = PL_fold[value];
- ANYOF_BITMAP_SET(opnd, cf);
+ ANYOF_BITMAP_SET(ret, cf);
}
}
- ANYOF_FLAGS(opnd) &= ~ANYOF_FOLD;
+ ANYOF_FLAGS(ret) &= ~ANYOF_FOLD;
}
/* optimize inverted simple patterns (e.g. [^a-z]) */
- if (!SIZE_ONLY && (ANYOF_FLAGS(opnd) & ANYOF_FLAGS_ALL) == ANYOF_INVERT) {
+ if (!SIZE_ONLY && (ANYOF_FLAGS(ret) & ANYOF_FLAGS_ALL) == ANYOF_INVERT) {
for (value = 0; value < ANYOF_BITMAP_SIZE; ++value)
- opnd[ANYOF_BITMAP_OFFSET + value] ^= ANYOF_FLAGS_ALL;
- ANYOF_FLAGS(opnd) = 0;
+ ANYOF_BITMAP(ret)[value] ^= ANYOF_FLAGS_ALL;
+ ANYOF_FLAGS(ret) = 0;
}
return ret;
}
S_regclassutf8(pTHX)
{
dTHR;
- register char *opnd, *e;
- register U32 value;
+ register char *e;
+ register UV value;
register U32 lastvalue = OOB_UTF8;
register I32 range = 0;
register regnode *ret;
SV *listsv;
U8 flags = 0;
I32 namedclass;
+ char *rangebegin;
if (*PL_regcomp_parse == '^') { /* Complement of range. */
PL_regnaughty++;
listsv = newSVpvn("# comment\n",10);
}
- checkposixcc();
+ if (!SIZE_ONLY && ckWARN(WARN_UNSAFE))
+ checkposixcc();
if (*PL_regcomp_parse == ']' || *PL_regcomp_parse == '-')
goto skipcond; /* allow 1st char to be ] or - */
while (PL_regcomp_parse < PL_regxend && *PL_regcomp_parse != ']') {
skipcond:
namedclass = OOB_NAMEDCLASS;
+ if (!range)
+ rangebegin = PL_regcomp_parse;
value = utf8_to_uv((U8*)PL_regcomp_parse, &numlen);
PL_regcomp_parse += numlen;
-
if (value == '[')
namedclass = regpposixcc(value);
else if (value == '\\') {
case 't': value = '\t'; break;
case 'f': value = '\f'; break;
case 'b': value = '\b'; break;
+#ifdef ASCIIish
case 'e': value = '\033'; break;
case 'a': value = '\007'; break;
+#else
+ case 'e': value = '\047'; break;
+ case 'a': value = '\057'; break;
+#endif
case 'x':
if (*PL_regcomp_parse == '{') {
e = strchr(PL_regcomp_parse++, '}');
if (!e)
FAIL("Missing right brace on \\x{}");
- value = scan_hex(PL_regcomp_parse,
+ value = (UV)scan_hex(PL_regcomp_parse,
e - PL_regcomp_parse,
&numlen);
PL_regcomp_parse = e + 1;
}
else {
- value = scan_hex(PL_regcomp_parse, 2, &numlen);
+ value = (UV)scan_hex(PL_regcomp_parse, 2, &numlen);
PL_regcomp_parse += numlen;
}
break;
break;
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
- value = scan_oct(--PL_regcomp_parse, 3, &numlen);
+ value = (UV)scan_oct(--PL_regcomp_parse, 3, &numlen);
PL_regcomp_parse += numlen;
break;
+ default:
+ if (!SIZE_ONLY && ckWARN(WARN_UNSAFE) && isALPHA(value))
+ Perl_warner(aTHX_ WARN_UNSAFE,
+ "/%.127s/: Unrecognized escape \\%c in character class passed through",
+ PL_regprecomp,
+ (int)value);
+ break;
}
}
- if (!SIZE_ONLY && namedclass > OOB_NAMEDCLASS) {
- if (range)
- FAIL("invalid [] range in regexp"); /* [a-\w], [a-[:word:]] */
- switch (namedclass) {
- case ANYOF_ALNUM:
- Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsWord\n"); break;
- case ANYOF_NALNUM:
- Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsWord\n"); break;
- case ANYOF_ALNUMC:
- Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsAlnum\n"); break;
- case ANYOF_NALNUMC:
- Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsAlnum\n"); break;
- case ANYOF_ALPHA:
- Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsAlpha\n"); break;
- case ANYOF_NALPHA:
- Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsAlpha\n"); break;
- case ANYOF_ASCII:
- Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsASCII\n"); break;
- case ANYOF_NASCII:
- Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsASCII\n"); break;
- case ANYOF_CNTRL:
- Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsCntrl\n"); break;
- case ANYOF_NCNTRL:
- Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsCntrl\n"); break;
- case ANYOF_GRAPH:
- Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsGraph\n"); break;
- case ANYOF_NGRAPH:
- Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsGraph\n"); break;
- case ANYOF_DIGIT:
- Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsDigit\n"); break;
- case ANYOF_NDIGIT:
- Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsDigit\n"); break;
- case ANYOF_LOWER:
- Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsLower\n"); break;
- case ANYOF_NLOWER:
- Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsLower\n"); break;
- case ANYOF_PRINT:
- Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsPrint\n"); break;
- case ANYOF_NPRINT:
- Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsPrint\n"); break;
- case ANYOF_PUNCT:
- Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsPunct\n"); break;
- case ANYOF_NPUNCT:
- Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsPunct\n"); break;
- case ANYOF_SPACE:
- Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsSpace\n"); break;
- case ANYOF_NSPACE:
- Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsSpace\n"); break;
- case ANYOF_UPPER:
- Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsUpper\n"); break;
- case ANYOF_NUPPER:
- Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsUpper\n"); break;
- case ANYOF_XDIGIT:
- Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsXDigit\n"); break;
- case ANYOF_NXDIGIT:
- Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsXDigit\n"); break;
+ if (namedclass > OOB_NAMEDCLASS) {
+ if (range) { /* a-\d, a-[:digit:] */
+ if (!SIZE_ONLY) {
+ if (ckWARN(WARN_UNSAFE))
+ Perl_warner(aTHX_ WARN_UNSAFE,
+ "/%.127s/: false [] range \"%*.*s\" in regexp",
+ PL_regprecomp,
+ PL_regcomp_parse - rangebegin,
+ PL_regcomp_parse - rangebegin,
+ rangebegin);
+ Perl_sv_catpvf(aTHX_ listsv,
+ /* 0x002D is Unicode for '-' */
+ "%04"UVxf"\n002D\n", (UV)lastvalue);
+ }
+ range = 0;
+ }
+ if (!SIZE_ONLY) {
+ switch (namedclass) {
+ case ANYOF_ALNUM:
+ Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsWord\n"); break;
+ case ANYOF_NALNUM:
+ Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsWord\n"); break;
+ case ANYOF_ALNUMC:
+ Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsAlnum\n"); break;
+ case ANYOF_NALNUMC:
+ Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsAlnum\n"); break;
+ case ANYOF_ALPHA:
+ Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsAlpha\n"); break;
+ case ANYOF_NALPHA:
+ Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsAlpha\n"); break;
+ case ANYOF_ASCII:
+ Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsASCII\n"); break;
+ case ANYOF_NASCII:
+ Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsASCII\n"); break;
+ case ANYOF_CNTRL:
+ Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsCntrl\n"); break;
+ case ANYOF_NCNTRL:
+ Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsCntrl\n"); break;
+ case ANYOF_GRAPH:
+ Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsGraph\n"); break;
+ case ANYOF_NGRAPH:
+ Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsGraph\n"); break;
+ case ANYOF_DIGIT:
+ Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsDigit\n"); break;
+ case ANYOF_NDIGIT:
+ Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsDigit\n"); break;
+ case ANYOF_LOWER:
+ Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsLower\n"); break;
+ case ANYOF_NLOWER:
+ Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsLower\n"); break;
+ case ANYOF_PRINT:
+ Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsPrint\n"); break;
+ case ANYOF_NPRINT:
+ Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsPrint\n"); break;
+ case ANYOF_PUNCT:
+ Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsPunct\n"); break;
+ case ANYOF_NPUNCT:
+ Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsPunct\n"); break;
+ case ANYOF_SPACE:
+ Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsSpace\n"); break;
+ case ANYOF_NSPACE:
+ Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsSpace\n"); break;
+ case ANYOF_UPPER:
+ Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsUpper\n"); break;
+ case ANYOF_NUPPER:
+ Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsUpper\n"); break;
+ case ANYOF_XDIGIT:
+ Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsXDigit\n"); break;
+ case ANYOF_NXDIGIT:
+ Perl_sv_catpvf(aTHX_ listsv, "!utf8::IsXDigit\n"); break;
+ }
+ continue;
}
- continue;
}
if (range) {
- if (lastvalue > value)
- FAIL("invalid [] range in regexp"); /* [b-a] */
-#ifdef UV_IS_QUAD
- if (!SIZE_ONLY)
- Perl_sv_catpvf(aTHX_ listsv, "%04" PERL_PRIx64 "\t%04" PERL_PRIx64 "\n", (UV)lastvalue, (UV)value);
-#else
- if (!SIZE_ONLY)
- Perl_sv_catpvf(aTHX_ listsv, "%04x\t%04x\n", lastvalue, value);
-#endif
+ if (lastvalue > value) { /* b-a */
+ Perl_croak(aTHX_
+ "/%.127s/: invalid [] range \"%*.*s\" in regexp",
+ PL_regprecomp,
+ PL_regcomp_parse - rangebegin,
+ PL_regcomp_parse - rangebegin,
+ rangebegin);
+ }
range = 0;
}
else {
lastvalue = value;
if (*PL_regcomp_parse == '-' && PL_regcomp_parse+1 < PL_regxend &&
PL_regcomp_parse[1] != ']') {
- if (namedclass > OOB_NAMEDCLASS)
- FAIL("invalid [] range in regexp"); /* [\w-a] */
PL_regcomp_parse++;
- range = 1;
+ if (namedclass > OOB_NAMEDCLASS) { /* \w-, [:word:]- */
+ if (ckWARN(WARN_UNSAFE))
+ Perl_warner(aTHX_ WARN_UNSAFE,
+ "/%.127s/: false [] range \"%*.*s\" in regexp",
+ PL_regprecomp,
+ PL_regcomp_parse - rangebegin,
+ PL_regcomp_parse - rangebegin,
+ rangebegin);
+ if (!SIZE_ONLY)
+ Perl_sv_catpvf(aTHX_ listsv,
+ /* 0x002D is Unicode for '-' */
+ "002D\n");
+ } else
+ range = 1;
continue; /* do it next time */
}
}
/* now is the next time */
-#ifdef UV_IS_QUAD
- if (!SIZE_ONLY)
- Perl_sv_catpvf(aTHX_ listsv, "%04" PERL_PRIx64 "\n", (UV)value);
-#else
if (!SIZE_ONLY)
- Perl_sv_catpvf(aTHX_ listsv, "%04x\n", value);
-#endif
+ Perl_sv_catpvf(aTHX_ listsv, "%04"UVxf"\t%04"UVxf"\n",
+ (UV)lastvalue, (UV)value);
range = 0;
}
if (OP(node) == OPTIMIZED)
goto after_print;
regprop(sv, node);
- PerlIO_printf(Perl_debug_log, "%4d:%*s%s", node - start,
- 2*l + 1, "", SvPVX(sv));
+ PerlIO_printf(Perl_debug_log, "%4"IVdf":%*s%s", (IV)(node - start),
+ (int)(2*l + 1), "", SvPVX(sv));
if (next == NULL) /* Next ptr. */
PerlIO_printf(Perl_debug_log, "(0)");
else
- PerlIO_printf(Perl_debug_log, "(%d)", next - start);
+ PerlIO_printf(Perl_debug_log, "(%"IVdf")", (IV)(next - start));
(void)PerlIO_putc(Perl_debug_log, '\n');
after_print:
if (PL_regkind[(U8)op] == BRANCHJ) {
}
else if (op == ANYOF) {
node = NEXTOPER(node);
- node += ANY_SKIP;
+ node += ANYOF_SKIP;
}
else if (PL_regkind[(U8)op] == EXACT) {
/* Literal string, where present. */
/* Header fields of interest. */
if (r->anchored_substr)
- PerlIO_printf(Perl_debug_log, "anchored `%s%.*s%s'%s at %d ",
+ PerlIO_printf(Perl_debug_log,
+ "anchored `%s%.*s%s'%s at %"IVdf" ",
PL_colors[0],
- SvCUR(r->anchored_substr) - (SvTAIL(r->anchored_substr)!=0),
+ (int)(SvCUR(r->anchored_substr) - (SvTAIL(r->anchored_substr)!=0)),
SvPVX(r->anchored_substr),
PL_colors[1],
SvTAIL(r->anchored_substr) ? "$" : "",
- r->anchored_offset);
+ (IV)r->anchored_offset);
if (r->float_substr)
- PerlIO_printf(Perl_debug_log, "floating `%s%.*s%s'%s at %d..%u ",
+ PerlIO_printf(Perl_debug_log,
+ "floating `%s%.*s%s'%s at %"IVdf"..%"UVuf" ",
PL_colors[0],
- SvCUR(r->float_substr) - (SvTAIL(r->float_substr)!=0),
+ (int)(SvCUR(r->float_substr) - (SvTAIL(r->float_substr)!=0)),
SvPVX(r->float_substr),
PL_colors[1],
SvTAIL(r->float_substr) ? "$" : "",
- r->float_min_offset, r->float_max_offset);
+ (IV)r->float_min_offset, (UV)r->float_max_offset);
if (r->check_substr)
PerlIO_printf(Perl_debug_log,
r->check_substr == r->float_substr
#endif /* DEBUGGING */
}
+STATIC void
+S_put_byte(pTHX_ SV *sv, int c)
+{
+ if (c <= ' ' || c == 127 || c == 255)
+ Perl_sv_catpvf(aTHX_ sv, "\\%o", c);
+ else if (c == '-' || c == ']' || c == '\\' || c == '^')
+ Perl_sv_catpvf(aTHX_ sv, "\\%c", c);
+ else
+ Perl_sv_catpvf(aTHX_ sv, "%c", c);
+}
+
/*
- regprop - printable representation of opcode
*/
Perl_sv_catpvf(aTHX_ sv, "%d", ARG(o)); /* Parenth number */
else if (k == LOGICAL)
Perl_sv_catpvf(aTHX_ sv, "[%d]", o->flags); /* 2: embedded, otherwise 1 */
+ else if (k == ANYOF) {
+ int i, rangestart = -1;
+ const char * const out[] = { /* Should be syncronized with
+ a table in regcomp.h */
+ "\\w",
+ "\\W",
+ "\\s",
+ "\\S",
+ "\\d",
+ "\\D",
+ "[:alnum:]",
+ "[:^alnum:]",
+ "[:alpha:]",
+ "[:^alpha:]",
+ "[:ascii:]",
+ "[:^ascii:]",
+ "[:ctrl:]",
+ "[:^ctrl:]",
+ "[:graph:]",
+ "[:^graph:]",
+ "[:lower:]",
+ "[:^lower:]",
+ "[:print:]",
+ "[:^print:]",
+ "[:punct:]",
+ "[:^punct:]",
+ "[:upper:]",
+ "[:!upper:]",
+ "[:xdigit:]",
+ "[:^xdigit:]"
+ };
+
+ if (o->flags & ANYOF_LOCALE)
+ sv_catpv(sv, "{loc}");
+ if (o->flags & ANYOF_FOLD)
+ sv_catpv(sv, "{i}");
+ Perl_sv_catpvf(aTHX_ sv, "[%s", PL_colors[0]);
+ if (o->flags & ANYOF_INVERT)
+ sv_catpv(sv, "^");
+ for (i = 0; i <= 256; i++) {
+ if (i < 256 && ANYOF_BITMAP_TEST(o,i)) {
+ if (rangestart == -1)
+ rangestart = i;
+ } else if (rangestart != -1) {
+ if (i <= rangestart + 3)
+ for (; rangestart < i; rangestart++)
+ put_byte(sv, rangestart);
+ else {
+ put_byte(sv, rangestart);
+ sv_catpv(sv, "-");
+ put_byte(sv, i - 1);
+ }
+ rangestart = -1;
+ }
+ }
+ if (o->flags & ANYOF_CLASS)
+ for (i = 0; i < sizeof(out)/sizeof(char*); i++)
+ if (ANYOF_CLASS_TEST(o,i))
+ sv_catpv(sv, out[i]);
+ Perl_sv_catpvf(aTHX_ sv, "%s]", PL_colors[1]);
+ }
else if (k == BRANCHJ && (OP(o) == UNLESSM || OP(o) == IFMATCH))
Perl_sv_catpvf(aTHX_ sv, "[-%d]", o->flags);
#endif /* DEBUGGING */
case 's':
SvREFCNT_dec((SV*)r->data->data[n]);
break;
+ case 'f':
+ Safefree(r->data->data[n]);
+ break;
case 'p':
new_comppad = (AV*)r->data->data[n];
break;
SAVEPPTR(PL_reginput); /* String-input pointer. */
SAVEPPTR(PL_regbol); /* Beginning of input, for ^ check. */
SAVEPPTR(PL_regeol); /* End of input, for $ check. */
- SAVESPTR(PL_regstartp); /* Pointer to startp array. */
- SAVESPTR(PL_regendp); /* Ditto for endp. */
- SAVESPTR(PL_reglastparen); /* Similarly for lastparen. */
+ SAVEVPTR(PL_regstartp); /* Pointer to startp array. */
+ SAVEVPTR(PL_regendp); /* Ditto for endp. */
+ SAVEVPTR(PL_reglastparen); /* Similarly for lastparen. */
SAVEPPTR(PL_regtill); /* How far we are required to go. */
- SAVEI32(PL_regprev); /* char before regbol, \n if none */
- SAVESPTR(PL_reg_start_tmp); /* from regexec.c */
+ SAVEI8(PL_regprev); /* char before regbol, \n if none */
+ SAVEVPTR(PL_reg_start_tmp); /* from regexec.c */
PL_reg_start_tmp = 0;
SAVEFREEPV(PL_reg_start_tmp);
SAVEI32(PL_reg_start_tmpl); /* from regexec.c */
PL_reg_start_tmpl = 0;
- SAVESPTR(PL_regdata);
+ SAVEVPTR(PL_regdata);
SAVEI32(PL_reg_flags); /* from regexec.c */
SAVEI32(PL_reg_eval_set); /* from regexec.c */
SAVEI32(PL_regnarrate); /* from regexec.c */
- SAVESPTR(PL_regprogram); /* from regexec.c */
+ SAVEVPTR(PL_regprogram); /* from regexec.c */
SAVEINT(PL_regindent); /* from regexec.c */
- SAVESPTR(PL_regcc); /* from regexec.c */
- SAVESPTR(PL_curcop);
- SAVESPTR(PL_regcomp_rx); /* from regcomp.c */
+ SAVEVPTR(PL_regcc); /* from regexec.c */
+ SAVEVPTR(PL_curcop);
+ SAVEVPTR(PL_regcomp_rx); /* from regcomp.c */
SAVEI32(PL_regseen); /* from regcomp.c */
SAVEI32(PL_regsawback); /* Did we see \1, ...? */
SAVEI32(PL_regnaughty); /* How bad is this pattern? */
- SAVESPTR(PL_regcode); /* Code-emit pointer; ®dummy = don't */
+ SAVEVPTR(PL_regcode); /* Code-emit pointer; ®dummy = don't */
SAVEPPTR(PL_regxend); /* End of input for compile */
SAVEPPTR(PL_regcomp_parse); /* Input-scan pointer. */
- SAVESPTR(PL_reg_call_cc); /* from regexec.c */
- SAVESPTR(PL_reg_re); /* from regexec.c */
+ SAVEVPTR(PL_reg_call_cc); /* from regexec.c */
+ SAVEVPTR(PL_reg_re); /* from regexec.c */
SAVEPPTR(PL_reg_ganch); /* from regexec.c */
SAVESPTR(PL_reg_sv); /* from regexec.c */
- SAVESPTR(PL_reg_magic); /* from regexec.c */
+ SAVEVPTR(PL_reg_magic); /* from regexec.c */
SAVEI32(PL_reg_oldpos); /* from regexec.c */
- SAVESPTR(PL_reg_oldcurpm); /* from regexec.c */
- SAVESPTR(PL_reg_curpm); /* from regexec.c */
+ SAVEVPTR(PL_reg_oldcurpm); /* from regexec.c */
+ SAVEVPTR(PL_reg_curpm); /* from regexec.c */
#ifdef DEBUGGING
SAVEPPTR(PL_reg_starttry); /* from regexec.c */
#endif
}
#ifdef PERL_OBJECT
-#define NO_XSLOCKS
#include "XSUB.h"
#undef this
#define this pPerl
U16 arg2;
};
+#define ANYOF_BITMAP_SIZE 32 /* 256 b/(8 b/B) */
+#define ANYOF_CLASSBITMAP_SIZE 4
+
+struct regnode_charclass {
+ U8 flags;
+ U8 type;
+ U16 next_off;
+ char bitmap[ANYOF_BITMAP_SIZE];
+};
+
+struct regnode_charclass_class {
+ U8 flags;
+ U8 type;
+ U16 next_off;
+ char bitmap[ANYOF_BITMAP_SIZE];
+ char classflags[ANYOF_CLASSBITMAP_SIZE];
+};
+
/* XXX fix this description.
Impose a limit of REG_INFTY on various pattern matching operations
to limit stack growth and to avoid "infinite" recursions.
#define SIZE_ONLY (PL_regcode == &PL_regdummy)
-/* Flags for first parameter byte [0] of ANYOF */
+/* Flags for node->flags of ANYOF */
#define ANYOF_CLASS 0x08
#define ANYOF_INVERT 0x04
#define ANYOF_FOLD 0x02
#define ANYOF_LOCALE 0x01
-/* Character classes for bytes [1..4] of ANYOF */
+/* Used for regstclass only */
+#define ANYOF_EOS 0x10 /* Can match an empty string too */
+
+/* Character classes for node->classflags of ANYOF */
+/* Should be synchronized with a table in regprop() */
+/* 2n should pair with 2n+1 */
#define ANYOF_ALNUM 0 /* \w, utf8::IsWord, isALNUM() */
#define ANYOF_NALNUM 1
/* Utility macros for the bitmap and classes of ANYOF */
-#define ANYOF_OPND_SIZE 1
-#define ANYOF_CLASS_SIZE 4
-#define ANYOF_BITMAP_SIZE 32 /* 256 b/(8 b/B) */
-#define ANYOF_SIZE (ANYOF_OPND_SIZE+ANYOF_CLASS_SIZE+ANYOF_BITMAP_SIZE)
+#define ANYOF_SIZE (sizeof(struct regnode_charclass))
+#define ANYOF_CLASS_SIZE (sizeof(struct regnode_charclass_class))
-#define ANYOF_FLAGS(p) ((p)[0])
+#define ANYOF_FLAGS(p) ((p)->flags)
#define ANYOF_FLAGS_ALL 0xff
#define ANYOF_BIT(c) (1 << ((c) & 7))
-#define ANYOF_CLASS_OFFSET ANYOF_OPND_SIZE
-#define ANYOF_CLASS_BYTE(p, c) ((p)[ANYOF_CLASS_OFFSET + (((c) >> 3) & 3)])
+#define ANYOF_CLASS_BYTE(p, c) (((struct regnode_charclass_class*)(p))->classflags[((c) >> 3) & 3])
#define ANYOF_CLASS_SET(p, c) (ANYOF_CLASS_BYTE(p, c) |= ANYOF_BIT(c))
#define ANYOF_CLASS_CLEAR(p, c) (ANYOF_CLASS_BYTE(p, c) &= ~ANYOF_BIT(c))
#define ANYOF_CLASS_TEST(p, c) (ANYOF_CLASS_BYTE(p, c) & ANYOF_BIT(c))
-#define ANYOF_BITMAP_OFFSET (ANYOF_CLASS_OFFSET+ANYOF_CLASS_SIZE)
-#define ANYOF_BITMAP_BYTE(p, c) ((p)[ANYOF_BITMAP_OFFSET + (((c) >> 3) & 31)])
+#define ANYOF_CLASS_ZERO(ret) Zero(((struct regnode_charclass_class*)(ret))->classflags, ANYOF_CLASSBITMAP_SIZE, char)
+#define ANYOF_BITMAP_ZERO(ret) Zero(((struct regnode_charclass*)(ret))->bitmap, ANYOF_BITMAP_SIZE, char)
+
+#define ANYOF_BITMAP(p) (((struct regnode_charclass*)(p))->bitmap)
+#define ANYOF_BITMAP_BYTE(p, c) (ANYOF_BITMAP(p)[((c) >> 3) & 31])
#define ANYOF_BITMAP_SET(p, c) (ANYOF_BITMAP_BYTE(p, c) |= ANYOF_BIT(c))
#define ANYOF_BITMAP_CLEAR(p,c) (ANYOF_BITMAP_BYTE(p, c) &= ~ANYOF_BIT(c))
#define ANYOF_BITMAP_TEST(p, c) (ANYOF_BITMAP_BYTE(p, c) & ANYOF_BIT(c))
-#define ANY_SKIP ((ANYOF_SIZE - 1)/sizeof(regnode) + 1)
+#define ANYOF_SKIP ((ANYOF_SIZE - 1)/sizeof(regnode))
+#define ANYOF_CLASS_SKIP ((ANYOF_CLASS_SIZE - 1)/sizeof(regnode))
+#define ANYOF_CLASS_ADD_SKIP (ANYOF_CLASS_SKIP - ANYOF_SKIP)
/*
* Utility definitions.
#define FAIL(m) \
STMT_START { \
if (!SIZE_ONLY) \
- SAVEDESTRUCTOR(clear_re,(void*)PL_regcomp_rx); \
+ SAVEDESTRUCTOR_X(clear_re,(void*)PL_regcomp_rx); \
Perl_croak(aTHX_ "/%.127s/: %s", PL_regprecomp,m); \
} STMT_END
#define FAIL2(pat,m) \
STMT_START { \
if (!SIZE_ONLY) \
- SAVEDESTRUCTOR(clear_re,(void*)PL_regcomp_rx); \
+ SAVEDESTRUCTOR_X(clear_re,(void*)PL_regcomp_rx); \
S_re_croak2(aTHX_ "/%.127s/: ",pat,PL_regprecomp,m); \
} STMT_END
/* These are needed since we do not localize EVAL nodes: */
# define REGCP_SET DEBUG_r(PerlIO_printf(Perl_debug_log, \
- " Setting an EVAL scope, savestack=%i\n", \
- PL_savestack_ix)); lastcp = PL_savestack_ix
+ " Setting an EVAL scope, savestack=%"IVdf"\n", \
+ (IV)PL_savestack_ix)); lastcp = PL_savestack_ix
# define REGCP_UNWIND DEBUG_r(lastcp != PL_savestack_ix ? \
PerlIO_printf(Perl_debug_log, \
- " Clearing an EVAL scope, savestack=%i..%i\n", \
- lastcp, PL_savestack_ix) : 0); regcpblow(lastcp)
+ " Clearing an EVAL scope, savestack=%"IVdf"..%"IVdf"\n", \
+ (IV)lastcp, (IV)PL_savestack_ix) : 0); regcpblow(lastcp)
STATIC char *
S_regcppop(pTHX)
PL_regendp[paren] = tmps;
DEBUG_r(
PerlIO_printf(Perl_debug_log,
- " restoring \\%d to %d(%d)..%d%s\n",
- paren, PL_regstartp[paren],
- PL_reg_start_tmp[paren] - PL_bostr,
- PL_regendp[paren],
+ " restoring \\%"UVuf" to %"IVdf"(%"IVdf")..%"IVdf"%s\n",
+ (UV)paren, (IV)PL_regstartp[paren],
+ (IV)(PL_reg_start_tmp[paren] - PL_bostr),
+ (IV)PL_regendp[paren],
(paren > *PL_reglastparen ? "(no)" : ""));
);
}
DEBUG_r(
if (*PL_reglastparen + 1 <= PL_regnpar) {
PerlIO_printf(Perl_debug_log,
- " restoring \\%d..\\%d to undef\n",
- *PL_reglastparen + 1, PL_regnpar);
+ " restoring \\%"IVdf"..\\%"IVdf" to undef\n",
+ (IV)(*PL_reglastparen + 1), (IV)PL_regnpar);
}
);
for (paren = *PL_reglastparen + 1; paren <= PL_regnpar; paren++) {
/* XXXX We assume that strpos is strbeg unless sv. */
+/* XXXX Some places assume that there is a fixed substring.
+ An update may be needed if optimizer marks as "INTUITable"
+ RExen without fixed substrings. Similarly, it is assumed that
+ lengths of all the strings are no more than minlen, thus they
+ cannot come from lookahead.
+ (Or minlen should take into account lookahead.) */
+
/* A failure to find a constant substring means that there is no need to make
an expensive call to REx engine, thus we celebrate a failure. Similarly,
finding a substring too deep into the string means that less calls to
b) Fixed substring;
c) Whether we are anchored (beginning-of-line or \G);
d) First node (of those at offset 0) which may distingush positions;
- We use 'a', 'b', multiline-part of 'c', and try to find a position in the
+ We use a)b)d) and multiline-part of c), and try to find a position in the
string which does not contradict any of them.
*/
+/* Most of decisions we do here should have been done at compile time.
+ The nodes of the REx which we used for the search should have been
+ deleted from the finite automaton. */
+
char *
Perl_re_intuit_start(pTHX_ regexp *prog, SV *sv, char *strpos,
char *strend, U32 flags, re_scream_pos_data *data)
char *t;
I32 ml_anch;
char *tmp;
- register char *other_last = Nullch;
+ register char *other_last = Nullch; /* other substr checked before this */
+ char *check_at; /* check substr found at this pos */
#ifdef DEBUGGING
char *i_strpos = strpos;
#endif
PL_colors[1],
(strlen(prog->precomp) > 60 ? "..." : ""),
PL_colors[0],
- (strend - strpos > 60 ? 60 : strend - strpos),
+ (int)(strend - strpos > 60 ? 60 : strend - strpos),
strpos, PL_colors[1],
(strend - strpos > 60 ? "..." : ""))
);
DEBUG_r(PerlIO_printf(Perl_debug_log, "String too short...\n"));
goto fail;
}
+ check = prog->check_substr;
if (prog->reganch & ROPT_ANCH) { /* Match at beg-of-str or after \n */
ml_anch = !( (prog->reganch & ROPT_ANCH_SINGLE)
|| ( (prog->reganch & ROPT_ANCH_BOL)
}
PL_regeol = strend; /* Used in HOP() */
s = HOPc(strpos, prog->check_offset_min);
- if (SvTAIL(prog->check_substr)) {
- slen = SvCUR(prog->check_substr); /* >= 1 */
+ if (SvTAIL(check)) {
+ slen = SvCUR(check); /* >= 1 */
if ( strend - s > slen || strend - s < slen - 1
|| (strend - s == slen && strend[-1] != '\n')) {
}
/* Now should match s[0..slen-2] */
slen--;
- if (slen && (*SvPVX(prog->check_substr) != *s
+ if (slen && (*SvPVX(check) != *s
|| (slen > 1
- && memNE(SvPVX(prog->check_substr), s, slen)))) {
+ && memNE(SvPVX(check), s, slen)))) {
report_neq:
DEBUG_r(PerlIO_printf(Perl_debug_log, "String not equal...\n"));
goto fail_finish;
}
}
- else if (*SvPVX(prog->check_substr) != *s
- || ((slen = SvCUR(prog->check_substr)) > 1
- && memNE(SvPVX(prog->check_substr), s, slen)))
+ else if (*SvPVX(check) != *s
+ || ((slen = SvCUR(check)) > 1
+ && memNE(SvPVX(check), s, slen)))
goto report_neq;
goto success_at_start;
}
/* Match is anchored, but substr is not anchored wrt beg-of-str. */
s = strpos;
start_shift = prog->check_offset_min; /* okay to underestimate on CC */
- /* Should be nonnegative! */
end_shift = prog->minlen - start_shift -
- CHR_SVLEN(prog->check_substr) + (SvTAIL(prog->check_substr) != 0);
+ CHR_SVLEN(check) + (SvTAIL(check) != 0);
if (!ml_anch) {
- I32 end = prog->check_offset_max + CHR_SVLEN(prog->check_substr)
- - (SvTAIL(prog->check_substr) != 0);
+ I32 end = prog->check_offset_max + CHR_SVLEN(check)
+ - (SvTAIL(check) != 0);
I32 eshift = strend - s - end;
if (end_shift < eshift)
start_shift = prog->check_offset_min; /* okay to underestimate on CC */
/* Should be nonnegative! */
end_shift = prog->minlen - start_shift -
- CHR_SVLEN(prog->check_substr) + (SvTAIL(prog->check_substr) != 0);
+ CHR_SVLEN(check) + (SvTAIL(check) != 0);
}
#ifdef DEBUGGING /* 7/99: reports of failure (with the older version) */
Perl_croak(aTHX_ "panic: end_shift");
#endif
- check = prog->check_substr;
restart:
/* Find a possible match in the region s..strend by looking for
the "check" substring in the region corrected by start/end_shift. */
(s ? "Found" : "Did not find"),
((check == prog->anchored_substr) ? "anchored" : "floating"),
PL_colors[0],
- SvCUR(check) - (SvTAIL(check)!=0), SvPVX(check),
+ (int)(SvCUR(check) - (SvTAIL(check)!=0)),
+ SvPVX(check),
PL_colors[1], (SvTAIL(check) ? "$" : ""),
(s ? " at offset " : "...\n") ) );
if (!s)
goto fail_finish;
+ check_at = s;
+
/* Finish the diagnostic message */
DEBUG_r(PerlIO_printf(Perl_debug_log, "%ld...\n", (long)(s - i_strpos)) );
/* Take into account the "other" substring. */
/* XXXX May be hopelessly wrong for UTF... */
if (!other_last)
- other_last = strpos - 1;
+ other_last = strpos;
if (check == prog->float_substr) {
do_other_anchored:
{
else
t = strpos;
t += prog->anchored_offset;
- if (t <= other_last)
- t = other_last + 1;
+ if (t < other_last) /* These positions already checked */
+ t = other_last;
PL_bostr = tmp;
last2 = last1 = strend - prog->minlen;
if (last < last1)
DEBUG_r(PerlIO_printf(Perl_debug_log, "%s anchored substr `%s%.*s%s'%s",
(s ? "Found" : "Contradicts"),
PL_colors[0],
- SvCUR(prog->anchored_substr)
- - (SvTAIL(prog->anchored_substr)!=0),
+ (int)(SvCUR(prog->anchored_substr)
+ - (SvTAIL(prog->anchored_substr)!=0)),
SvPVX(prog->anchored_substr),
PL_colors[1], (SvTAIL(prog->anchored_substr) ? "$" : "")));
if (!s) {
", trying floating at offset %ld...\n",
(long)(s1 + 1 - i_strpos)));
PL_regeol = strend; /* Used in HOP() */
- other_last = last1 + prog->anchored_offset;
+ other_last = last1 + prog->anchored_offset + 1;
s = HOPc(last, 1);
goto restart;
}
DEBUG_r(PerlIO_printf(Perl_debug_log, " at offset %ld...\n",
(long)(s - i_strpos)));
t = s - prog->anchored_offset;
- other_last = s - 1;
+ other_last = s + 1;
s = s1;
if (t == strpos)
goto try_at_start;
if (last - t > prog->float_max_offset)
last = t + prog->float_max_offset;
s = t + prog->float_min_offset;
- if (s <= other_last)
- s = other_last + 1;
+ if (s < other_last)
+ s = other_last;
/* XXXX It is not documented what units *_offsets are in. Assume bytes. */
/* fbm_instr() takes into account exact value of end-of-str
if the check is SvTAIL(ed). Since false positives are OK,
DEBUG_r(PerlIO_printf(Perl_debug_log, "%s floating substr `%s%.*s%s'%s",
(s ? "Found" : "Contradicts"),
PL_colors[0],
- SvCUR(prog->float_substr)
- - (SvTAIL(prog->float_substr)!=0),
+ (int)(SvCUR(prog->float_substr)
+ - (SvTAIL(prog->float_substr)!=0)),
SvPVX(prog->float_substr),
PL_colors[1], (SvTAIL(prog->float_substr) ? "$" : "")));
if (!s) {
DEBUG_r(PerlIO_printf(Perl_debug_log,
", trying anchored starting at offset %ld...\n",
(long)(s1 + 1 - i_strpos)));
- other_last = last;
+ other_last = last + 1;
PL_regeol = strend; /* Used in HOP() */
s = HOPc(t, 1);
goto restart;
else {
DEBUG_r(PerlIO_printf(Perl_debug_log, " at offset %ld...\n",
(long)(s - i_strpos)));
- other_last = s - 1;
+ other_last = s + 1;
s = s1;
if (t == strpos)
goto try_at_start;
/* Even in this situation we may use MBOL flag if strpos is offset
wrt the start of the string. */
if (ml_anch && sv
- && (strpos + SvCUR(sv) != strend) && strpos[-1] != '\n') {
+ && (strpos + SvCUR(sv) != strend) && strpos[-1] != '\n'
+ /* May be due to an implicit anchor of m{.*foo} */
+ && !(prog->reganch & ROPT_IMPLICIT))
+ {
t = strpos;
goto find_anchor;
}
);
success_at_start:
if (!(prog->reganch & ROPT_NAUGHTY) /* XXXX If strpos moved? */
+ && prog->check_substr /* Could be deleted already */
&& --BmUSEFUL(prog->check_substr) < 0
- && prog->check_substr == prog->float_substr) { /* boo */
+ && prog->check_substr == prog->float_substr)
+ {
/* If flags & SOMETHING - do not do it many times on the same match */
SvREFCNT_dec(prog->check_substr);
prog->check_substr = Nullsv; /* disable */
prog->float_substr = Nullsv; /* clear */
s = strpos;
+ /* XXXX This is a remnant of the old implementation. It
+ looks wasteful, since now INTUIT can use many
+ other heuristics. */
prog->reganch &= ~RE_USE_INTUIT;
}
else
s = strpos;
}
+ /* Last resort... */
+ /* XXXX BmUSEFUL already changed, maybe multiple change is meaningful... */
+ if (prog->regstclass) {
+ /* minlen == 0 is possible if regstclass is \b or \B,
+ and the fixed substr is ''$.
+ Since minlen is already taken into account, s+1 is before strend;
+ accidentally, minlen >= 1 guaranties no false positives at s + 1
+ even for \b or \B. But (minlen? 1 : 0) below assumes that
+ regstclass does not come from lookahead... */
+ /* If regstclass takes bytelength more than 1: If charlength==1, OK.
+ This leaves EXACTF only, which is dealt with in find_byclass(). */
+ int cl_l = (PL_regkind[(U8)OP(prog->regstclass)] == EXACT
+ ? STR_LEN(prog->regstclass)
+ : 1);
+ char *endpos = (prog->anchored_substr || ml_anch)
+ ? s + (prog->minlen? cl_l : 0)
+ : (prog->float_substr ? check_at - start_shift + cl_l
+ : strend) ;
+ char *startpos = sv ? strend - SvCUR(sv) : s;
+
+ t = s;
+ if (prog->reganch & ROPT_UTF8) {
+ PL_regdata = prog->data; /* Used by REGINCLASS UTF logic */
+ PL_bostr = startpos;
+ }
+ s = find_byclass(prog, prog->regstclass, s, endpos, startpos, 1);
+ if (!s) {
+#ifdef DEBUGGING
+ char *what;
+#endif
+ if (endpos == strend) {
+ DEBUG_r( PerlIO_printf(Perl_debug_log,
+ "Could not match STCLASS...\n") );
+ goto fail;
+ }
+ DEBUG_r( PerlIO_printf(Perl_debug_log,
+ "This position contradicts STCLASS...\n") );
+ if ((prog->reganch & ROPT_ANCH) && !ml_anch)
+ goto fail;
+ /* Contradict one of substrings */
+ if (prog->anchored_substr) {
+ if (prog->anchored_substr == check) {
+ DEBUG_r( what = "anchored" );
+ hop_and_restart:
+ PL_regeol = strend; /* Used in HOP() */
+ s = HOPc(t, 1);
+ if (s + start_shift + end_shift > strend) {
+ /* XXXX Should be taken into account earlier? */
+ DEBUG_r( PerlIO_printf(Perl_debug_log,
+ "Could not match STCLASS...\n") );
+ goto fail;
+ }
+ DEBUG_r( PerlIO_printf(Perl_debug_log,
+ "Trying %s substr starting at offset %ld...\n",
+ what, (long)(s + start_shift - i_strpos)) );
+ goto restart;
+ }
+ /* Have both, check_string is floating */
+ if (t + start_shift >= check_at) /* Contradicts floating=check */
+ goto retry_floating_check;
+ /* Recheck anchored substring, but not floating... */
+ s = check_at;
+ DEBUG_r( PerlIO_printf(Perl_debug_log,
+ "Trying anchored substr starting at offset %ld...\n",
+ (long)(other_last - i_strpos)) );
+ goto do_other_anchored;
+ }
+ /* Another way we could have checked stclass at the
+ current position only: */
+ if (ml_anch) {
+ s = t = t + 1;
+ DEBUG_r( PerlIO_printf(Perl_debug_log,
+ "Trying /^/m starting at offset %ld...\n",
+ (long)(t - i_strpos)) );
+ goto try_at_offset;
+ }
+ if (!prog->float_substr) /* Could have been deleted */
+ goto fail;
+ /* Check is floating subtring. */
+ retry_floating_check:
+ t = check_at - start_shift;
+ DEBUG_r( what = "floating" );
+ goto hop_and_restart;
+ }
+ DEBUG_r( if (t != s)
+ PerlIO_printf(Perl_debug_log,
+ "By STCLASS: moving %ld --> %ld\n",
+ (long)(t - i_strpos), (long)(s - i_strpos));
+ else
+ PerlIO_printf(Perl_debug_log,
+ "Does not contradict STCLASS...\n") );
+ }
DEBUG_r(PerlIO_printf(Perl_debug_log, "%sGuessed:%s match at offset %ld\n",
PL_colors[4], PL_colors[5], (long)(s - i_strpos)) );
return s;
fail_finish: /* Substring not found */
- BmUSEFUL(prog->check_substr) += 5; /* hooray */
+ if (prog->check_substr) /* could be removed already */
+ BmUSEFUL(prog->check_substr) += 5; /* hooray */
fail:
DEBUG_r(PerlIO_printf(Perl_debug_log, "%sMatch rejected by optimizer%s\n",
PL_colors[4],PL_colors[5]));
return Nullch;
}
-/*
- - regexec_flags - match a regexp against a string
- */
-I32
-Perl_regexec_flags(pTHX_ register regexp *prog, char *stringarg, register char *strend,
- char *strbeg, I32 minend, SV *sv, void *data, U32 flags)
-/* strend: pointer to null at end of string */
-/* strbeg: real beginning of string */
-/* minend: end of match must be >=minend after stringarg. */
-/* data: May be used for some additional optimizations. */
-/* nosave: For optimizations. */
+/* We know what class REx starts with. Try to find this position... */
+STATIC char *
+S_find_byclass(pTHX_ regexp * prog, regnode *c, char *s, char *strend, char *startpos, I32 norun)
{
- dTHR;
- register char *s;
- register regnode *c;
- register char *startpos = stringarg;
- register I32 tmp;
- I32 minlen; /* must match at least this many chars */
- I32 dontbother = 0; /* how many characters not to try at end */
- I32 start_shift = 0; /* Offset of the start to find
- constant substr. */ /* CC */
- I32 end_shift = 0; /* Same for the end. */ /* CC */
- I32 scream_pos = -1; /* Internal iterator of scream. */
- char *scream_olds;
- SV* oreplsv = GvSV(PL_replgv);
-
- PL_regcc = 0;
-
- cache_re(prog);
-#ifdef DEBUGGING
- PL_regnarrate = PL_debug & 512;
-#endif
-
- /* Be paranoid... */
- if (prog == NULL || startpos == NULL) {
- Perl_croak(aTHX_ "NULL regexp parameter");
- return 0;
- }
-
- minlen = prog->minlen;
- if (strend - startpos < minlen) goto phooey;
-
- if (startpos == strbeg) /* is ^ valid at stringarg? */
- PL_regprev = '\n';
- else {
- PL_regprev = (U32)stringarg[-1];
- if (!PL_multiline && PL_regprev == '\n')
- PL_regprev = '\0'; /* force ^ to NOT match */
- }
-
- /* Check validity of program. */
- if (UCHARAT(prog->program) != REG_MAGIC) {
- Perl_croak(aTHX_ "corrupted regexp program");
- }
-
- PL_reg_flags = 0;
- PL_reg_eval_set = 0;
- PL_reg_maxiter = 0;
-
- if (prog->reganch & ROPT_UTF8)
- PL_reg_flags |= RF_utf8;
-
- /* Mark beginning of line for ^ and lookbehind. */
- PL_regbol = startpos;
- PL_bostr = strbeg;
- PL_reg_sv = sv;
-
- /* Mark end of line for $ (and such) */
- PL_regeol = strend;
-
- /* see how far we have to get to not match where we matched before */
- PL_regtill = startpos+minend;
-
- /* We start without call_cc context. */
- PL_reg_call_cc = 0;
-
- /* If there is a "must appear" string, look for it. */
- s = startpos;
-
- if (prog->reganch & ROPT_GPOS_SEEN) {
- MAGIC *mg;
-
- if (!(flags & REXEC_IGNOREPOS) && sv && SvTYPE(sv) >= SVt_PVMG
- && SvMAGIC(sv) && (mg = mg_find(sv, 'g')) && mg->mg_len >= 0)
- PL_reg_ganch = strbeg + mg->mg_len;
- else
- PL_reg_ganch = startpos;
- if (prog->reganch & ROPT_ANCH_GPOS) {
- if (s > PL_reg_ganch)
- goto phooey;
- s = PL_reg_ganch;
- }
- }
-
- if (!(flags & REXEC_CHECKED) && prog->check_substr != Nullsv) {
- re_scream_pos_data d;
-
- d.scream_olds = &scream_olds;
- d.scream_pos = &scream_pos;
- s = re_intuit_start(prog, sv, s, strend, flags, &d);
- if (!s)
- goto phooey; /* not present */
- }
-
- DEBUG_r( if (!PL_colorset) reginitcolors() );
- DEBUG_r(PerlIO_printf(Perl_debug_log,
- "%sMatching REx%s `%s%.60s%s%s' against `%s%.*s%s%s'\n",
- PL_colors[4],PL_colors[5],PL_colors[0],
- prog->precomp,
- PL_colors[1],
- (strlen(prog->precomp) > 60 ? "..." : ""),
- PL_colors[0],
- (strend - startpos > 60 ? 60 : strend - startpos),
- startpos, PL_colors[1],
- (strend - startpos > 60 ? "..." : ""))
- );
-
- /* Simplest case: anchored match need be tried only once. */
- /* [unless only anchor is BOL and multiline is set] */
- if (prog->reganch & (ROPT_ANCH & ~ROPT_ANCH_GPOS)) {
- if (s == startpos && regtry(prog, startpos))
- goto got_it;
- else if (PL_multiline || (prog->reganch & ROPT_IMPLICIT)
- || (prog->reganch & ROPT_ANCH_MBOL)) /* XXXX SBOL? */
- {
- char *end;
+ I32 doevery = (prog->reganch & ROPT_SKIP) == 0;
+ char *m;
+ int ln;
+ int c1;
+ int c2;
+ char *e;
+ register I32 tmp = 1; /* Scratch variable? */
- if (minlen)
- dontbother = minlen - 1;
- end = HOPc(strend, -dontbother) - 1;
- /* for multiline we only have to try after newlines */
- if (prog->check_substr) {
- if (s == startpos)
- goto after_try;
- while (1) {
- if (regtry(prog, s))
+ /* We know what class it must start with. */
+ switch (OP(c)) {
+ case ANYOFUTF8:
+ while (s < strend) {
+ if (REGINCLASSUTF8(c, (U8*)s)) {
+ if (tmp && (norun || regtry(prog, s)))
goto got_it;
- after_try:
- if (s >= end)
- goto phooey;
- s = re_intuit_start(prog, sv, s + 1, strend, flags, NULL);
- if (!s)
- goto phooey;
- }
+ else
+ tmp = doevery;
+ }
+ else
+ tmp = 1;
+ s += UTF8SKIP(s);
+ }
+ break;
+ case ANYOF:
+ while (s < strend) {
+ if (REGINCLASS(c, *s)) {
+ if (tmp && (norun || regtry(prog, s)))
+ goto got_it;
+ else
+ tmp = doevery;
+ }
+ else
+ tmp = 1;
+ s++;
+ }
+ break;
+ case EXACTF:
+ m = STRING(c);
+ ln = STR_LEN(c);
+ c1 = *m;
+ c2 = PL_fold[c1];
+ goto do_exactf;
+ case EXACTFL:
+ m = STRING(c);
+ ln = STR_LEN(c);
+ c1 = *m;
+ c2 = PL_fold_locale[c1];
+ do_exactf:
+ e = strend - ln;
+
+ if (norun && e < s)
+ e = s; /* Due to minlen logic of intuit() */
+ /* Here it is NOT UTF! */
+ if (c1 == c2) {
+ while (s <= e) {
+ if ( *s == c1
+ && (ln == 1 || !(OP(c) == EXACTF
+ ? ibcmp(s, m, ln)
+ : ibcmp_locale(s, m, ln)))
+ && (norun || regtry(prog, s)) )
+ goto got_it;
+ s++;
+ }
} else {
- if (s > startpos)
- s--;
- while (s < end) {
- if (*s++ == '\n') { /* don't need PL_utf8skip here */
- if (regtry(prog, s))
- goto got_it;
- }
- }
+ while (s <= e) {
+ if ( (*s == c1 || *s == c2)
+ && (ln == 1 || !(OP(c) == EXACTF
+ ? ibcmp(s, m, ln)
+ : ibcmp_locale(s, m, ln)))
+ && (norun || regtry(prog, s)) )
+ goto got_it;
+ s++;
+ }
}
- }
- goto phooey;
- } else if (prog->reganch & ROPT_ANCH_GPOS) {
- if (regtry(prog, PL_reg_ganch))
- goto got_it;
- goto phooey;
- }
-
- /* Messy cases: unanchored match. */
- if (prog->anchored_substr && prog->reganch & ROPT_SKIP) {
- /* we have /x+whatever/ */
- /* it must be a one character string (XXXX Except UTF?) */
- char ch = SvPVX(prog->anchored_substr)[0];
- if (UTF) {
+ break;
+ case BOUNDL:
+ PL_reg_flags |= RF_tainted;
+ /* FALL THROUGH */
+ case BOUND:
+ tmp = (s != startpos) ? UCHARAT(s - 1) : '\n';
+ tmp = ((OP(c) == BOUND ? isALNUM(tmp) : isALNUM_LC(tmp)) != 0);
while (s < strend) {
- if (*s == ch) {
- if (regtry(prog, s)) goto got_it;
- s += UTF8SKIP(s);
- while (s < strend && *s == ch)
- s += UTF8SKIP(s);
+ if (tmp == !(OP(c) == BOUND ? isALNUM(*s) : isALNUM_LC(*s))) {
+ tmp = !tmp;
+ if ((norun || regtry(prog, s)))
+ goto got_it;
}
- s += UTF8SKIP(s);
+ s++;
}
- }
- else {
+ if ((!prog->minlen && tmp) && (norun || regtry(prog, s)))
+ goto got_it;
+ break;
+ case BOUNDLUTF8:
+ PL_reg_flags |= RF_tainted;
+ /* FALL THROUGH */
+ case BOUNDUTF8:
+ tmp = (I32)(s != startpos) ? utf8_to_uv(reghop((U8*)s, -1), 0) : '\n';
+ tmp = ((OP(c) == BOUNDUTF8 ? isALNUM_uni(tmp) : isALNUM_LC_uni(tmp)) != 0);
while (s < strend) {
- if (*s == ch) {
- if (regtry(prog, s)) goto got_it;
- s++;
- while (s < strend && *s == ch)
- s++;
+ if (tmp == !(OP(c) == BOUNDUTF8 ?
+ swash_fetch(PL_utf8_alnum, (U8*)s) :
+ isALNUM_LC_utf8((U8*)s)))
+ {
+ tmp = !tmp;
+ if ((norun || regtry(prog, s)))
+ goto got_it;
}
+ s += UTF8SKIP(s);
+ }
+ if ((!prog->minlen && tmp) && (norun || regtry(prog, s)))
+ goto got_it;
+ break;
+ case NBOUNDL:
+ PL_reg_flags |= RF_tainted;
+ /* FALL THROUGH */
+ case NBOUND:
+ tmp = (s != startpos) ? UCHARAT(s - 1) : '\n';
+ tmp = ((OP(c) == NBOUND ? isALNUM(tmp) : isALNUM_LC(tmp)) != 0);
+ while (s < strend) {
+ if (tmp == !(OP(c) == NBOUND ? isALNUM(*s) : isALNUM_LC(*s)))
+ tmp = !tmp;
+ else if ((norun || regtry(prog, s)))
+ goto got_it;
s++;
}
- }
- }
- /*SUPPRESS 560*/
- else if (prog->anchored_substr != Nullsv
- || (prog->float_substr != Nullsv
- && prog->float_max_offset < strend - s)) {
- SV *must = prog->anchored_substr
- ? prog->anchored_substr : prog->float_substr;
- I32 back_max =
- prog->anchored_substr ? prog->anchored_offset : prog->float_max_offset;
- I32 back_min =
- prog->anchored_substr ? prog->anchored_offset : prog->float_min_offset;
- I32 delta = back_max - back_min;
- char *last = HOPc(strend, /* Cannot start after this */
- -(I32)(CHR_SVLEN(must)
- - (SvTAIL(must) != 0) + back_min));
- char *last1; /* Last position checked before */
-
- if (s > PL_bostr)
- last1 = HOPc(s, -1);
- else
- last1 = s - 1; /* bogus */
-
- /* XXXX check_substr already used to find `s', can optimize if
- check_substr==must. */
- scream_pos = -1;
- dontbother = end_shift;
- strend = HOPc(strend, -dontbother);
- while ( (s <= last) &&
- ((flags & REXEC_SCREAM)
- ? (s = screaminstr(sv, must, HOPc(s, back_min) - strbeg,
- end_shift, &scream_pos, 0))
- : (s = fbm_instr((unsigned char*)HOP(s, back_min),
- (unsigned char*)strend, must,
- PL_multiline ? FBMrf_MULTILINE : 0))) ) {
- if (HOPc(s, -back_max) > last1) {
- last1 = HOPc(s, -back_min);
- s = HOPc(s, -back_max);
- }
- else {
- char *t = (last1 >= PL_bostr) ? HOPc(last1, 1) : last1 + 1;
-
- last1 = HOPc(s, -back_min);
- s = t;
- }
- if (UTF) {
- while (s <= last1) {
- if (regtry(prog, s))
- goto got_it;
- s += UTF8SKIP(s);
- }
- }
- else {
- while (s <= last1) {
- if (regtry(prog, s))
- goto got_it;
- s++;
- }
- }
- }
- goto phooey;
- }
- else if (c = prog->regstclass) {
- I32 doevery = (prog->reganch & ROPT_SKIP) == 0;
- char *cc;
-
- if (minlen)
- dontbother = minlen - 1;
- strend = HOPc(strend, -dontbother); /* don't bother with what can't match */
- tmp = 1;
- /* We know what class it must start with. */
- switch (OP(c)) {
- case ANYOFUTF8:
- cc = MASK(c);
- while (s < strend) {
- if (REGINCLASSUTF8(c, (U8*)s)) {
- if (tmp && regtry(prog, s))
- goto got_it;
- else
- tmp = doevery;
- }
- else
- tmp = 1;
- s += UTF8SKIP(s);
- }
- break;
- case ANYOF:
- cc = MASK(c);
- while (s < strend) {
- if (REGINCLASS(cc, *s)) {
- if (tmp && regtry(prog, s))
- goto got_it;
- else
- tmp = doevery;
- }
- else
- tmp = 1;
- s++;
- }
- break;
- case BOUNDL:
- PL_reg_flags |= RF_tainted;
- /* FALL THROUGH */
- case BOUND:
- if (minlen) {
- dontbother++;
- strend -= 1;
- }
- tmp = (s != startpos) ? UCHARAT(s - 1) : PL_regprev;
- tmp = ((OP(c) == BOUND ? isALNUM(tmp) : isALNUM_LC(tmp)) != 0);
- while (s < strend) {
- if (tmp == !(OP(c) == BOUND ? isALNUM(*s) : isALNUM_LC(*s))) {
- tmp = !tmp;
- if (regtry(prog, s))
- goto got_it;
- }
- s++;
- }
- if ((minlen || tmp) && regtry(prog,s))
- goto got_it;
- break;
- case BOUNDLUTF8:
- PL_reg_flags |= RF_tainted;
- /* FALL THROUGH */
- case BOUNDUTF8:
- if (minlen) {
- dontbother++;
- strend = reghop_c(strend, -1);
- }
- tmp = (I32)(s != startpos) ? utf8_to_uv(reghop((U8*)s, -1), 0) : PL_regprev;
- tmp = ((OP(c) == BOUND ? isALNUM_uni(tmp) : isALNUM_LC_uni(tmp)) != 0);
- while (s < strend) {
- if (tmp == !(OP(c) == BOUND ?
- swash_fetch(PL_utf8_alnum, (U8*)s) :
- isALNUM_LC_utf8((U8*)s)))
- {
- tmp = !tmp;
- if (regtry(prog, s))
- goto got_it;
- }
- s += UTF8SKIP(s);
- }
- if ((minlen || tmp) && regtry(prog,s))
- goto got_it;
- break;
- case NBOUNDL:
- PL_reg_flags |= RF_tainted;
- /* FALL THROUGH */
- case NBOUND:
- if (minlen) {
- dontbother++;
- strend -= 1;
- }
- tmp = (s != startpos) ? UCHARAT(s - 1) : PL_regprev;
- tmp = ((OP(c) == NBOUND ? isALNUM(tmp) : isALNUM_LC(tmp)) != 0);
- while (s < strend) {
- if (tmp == !(OP(c) == NBOUND ? isALNUM(*s) : isALNUM_LC(*s)))
- tmp = !tmp;
- else if (regtry(prog, s))
- goto got_it;
- s++;
- }
- if ((minlen || !tmp) && regtry(prog,s))
+ if ((!prog->minlen && !tmp) && (norun || regtry(prog, s)))
goto got_it;
break;
case NBOUNDLUTF8:
PL_reg_flags |= RF_tainted;
/* FALL THROUGH */
case NBOUNDUTF8:
- if (minlen) {
- dontbother++;
- strend = reghop_c(strend, -1);
- }
- tmp = (I32)(s != startpos) ? utf8_to_uv(reghop((U8*)s, -1), 0) : PL_regprev;
- tmp = ((OP(c) == NBOUND ? isALNUM_uni(tmp) : isALNUM_LC_uni(tmp)) != 0);
+ tmp = (I32)(s != startpos) ? utf8_to_uv(reghop((U8*)s, -1), 0) : '\n';
+ tmp = ((OP(c) == NBOUNDUTF8 ? isALNUM_uni(tmp) : isALNUM_LC_uni(tmp)) != 0);
while (s < strend) {
- if (tmp == !(OP(c) == NBOUND ?
+ if (tmp == !(OP(c) == NBOUNDUTF8 ?
swash_fetch(PL_utf8_alnum, (U8*)s) :
isALNUM_LC_utf8((U8*)s)))
tmp = !tmp;
- else if (regtry(prog, s))
+ else if ((norun || regtry(prog, s)))
goto got_it;
s += UTF8SKIP(s);
}
- if ((minlen || !tmp) && regtry(prog,s))
+ if ((!prog->minlen && !tmp) && (norun || regtry(prog, s)))
goto got_it;
break;
case ALNUM:
while (s < strend) {
if (isALNUM(*s)) {
- if (tmp && regtry(prog, s))
+ if (tmp && (norun || regtry(prog, s)))
goto got_it;
else
tmp = doevery;
case ALNUMUTF8:
while (s < strend) {
if (swash_fetch(PL_utf8_alnum, (U8*)s)) {
- if (tmp && regtry(prog, s))
+ if (tmp && (norun || regtry(prog, s)))
goto got_it;
else
tmp = doevery;
PL_reg_flags |= RF_tainted;
while (s < strend) {
if (isALNUM_LC(*s)) {
- if (tmp && regtry(prog, s))
+ if (tmp && (norun || regtry(prog, s)))
goto got_it;
else
tmp = doevery;
PL_reg_flags |= RF_tainted;
while (s < strend) {
if (isALNUM_LC_utf8((U8*)s)) {
- if (tmp && regtry(prog, s))
+ if (tmp && (norun || regtry(prog, s)))
goto got_it;
else
tmp = doevery;
case NALNUM:
while (s < strend) {
if (!isALNUM(*s)) {
- if (tmp && regtry(prog, s))
+ if (tmp && (norun || regtry(prog, s)))
goto got_it;
else
tmp = doevery;
case NALNUMUTF8:
while (s < strend) {
if (!swash_fetch(PL_utf8_alnum, (U8*)s)) {
- if (tmp && regtry(prog, s))
+ if (tmp && (norun || regtry(prog, s)))
goto got_it;
else
tmp = doevery;
PL_reg_flags |= RF_tainted;
while (s < strend) {
if (!isALNUM_LC(*s)) {
- if (tmp && regtry(prog, s))
+ if (tmp && (norun || regtry(prog, s)))
goto got_it;
else
tmp = doevery;
PL_reg_flags |= RF_tainted;
while (s < strend) {
if (!isALNUM_LC_utf8((U8*)s)) {
- if (tmp && regtry(prog, s))
+ if (tmp && (norun || regtry(prog, s)))
goto got_it;
else
tmp = doevery;
case SPACE:
while (s < strend) {
if (isSPACE(*s)) {
- if (tmp && regtry(prog, s))
+ if (tmp && (norun || regtry(prog, s)))
goto got_it;
else
tmp = doevery;
case SPACEUTF8:
while (s < strend) {
if (*s == ' ' || swash_fetch(PL_utf8_space,(U8*)s)) {
- if (tmp && regtry(prog, s))
+ if (tmp && (norun || regtry(prog, s)))
goto got_it;
else
tmp = doevery;
PL_reg_flags |= RF_tainted;
while (s < strend) {
if (isSPACE_LC(*s)) {
- if (tmp && regtry(prog, s))
+ if (tmp && (norun || regtry(prog, s)))
goto got_it;
else
tmp = doevery;
PL_reg_flags |= RF_tainted;
while (s < strend) {
if (*s == ' ' || isSPACE_LC_utf8((U8*)s)) {
- if (tmp && regtry(prog, s))
+ if (tmp && (norun || regtry(prog, s)))
goto got_it;
else
tmp = doevery;
case NSPACE:
while (s < strend) {
if (!isSPACE(*s)) {
- if (tmp && regtry(prog, s))
+ if (tmp && (norun || regtry(prog, s)))
goto got_it;
else
tmp = doevery;
case NSPACEUTF8:
while (s < strend) {
if (!(*s == ' ' || swash_fetch(PL_utf8_space,(U8*)s))) {
- if (tmp && regtry(prog, s))
+ if (tmp && (norun || regtry(prog, s)))
goto got_it;
else
tmp = doevery;
PL_reg_flags |= RF_tainted;
while (s < strend) {
if (!isSPACE_LC(*s)) {
- if (tmp && regtry(prog, s))
+ if (tmp && (norun || regtry(prog, s)))
goto got_it;
else
tmp = doevery;
PL_reg_flags |= RF_tainted;
while (s < strend) {
if (!(*s == ' ' || isSPACE_LC_utf8((U8*)s))) {
- if (tmp && regtry(prog, s))
+ if (tmp && (norun || regtry(prog, s)))
goto got_it;
else
tmp = doevery;
case DIGIT:
while (s < strend) {
if (isDIGIT(*s)) {
- if (tmp && regtry(prog, s))
+ if (tmp && (norun || regtry(prog, s)))
goto got_it;
else
tmp = doevery;
case DIGITUTF8:
while (s < strend) {
if (swash_fetch(PL_utf8_digit,(U8*)s)) {
- if (tmp && regtry(prog, s))
+ if (tmp && (norun || regtry(prog, s)))
goto got_it;
else
tmp = doevery;
PL_reg_flags |= RF_tainted;
while (s < strend) {
if (isDIGIT_LC(*s)) {
- if (tmp && regtry(prog, s))
+ if (tmp && (norun || regtry(prog, s)))
goto got_it;
else
tmp = doevery;
PL_reg_flags |= RF_tainted;
while (s < strend) {
if (isDIGIT_LC_utf8((U8*)s)) {
- if (tmp && regtry(prog, s))
+ if (tmp && (norun || regtry(prog, s)))
goto got_it;
else
tmp = doevery;
case NDIGIT:
while (s < strend) {
if (!isDIGIT(*s)) {
- if (tmp && regtry(prog, s))
+ if (tmp && (norun || regtry(prog, s)))
goto got_it;
else
tmp = doevery;
case NDIGITUTF8:
while (s < strend) {
if (!swash_fetch(PL_utf8_digit,(U8*)s)) {
- if (tmp && regtry(prog, s))
+ if (tmp && (norun || regtry(prog, s)))
goto got_it;
else
tmp = doevery;
PL_reg_flags |= RF_tainted;
while (s < strend) {
if (!isDIGIT_LC(*s)) {
- if (tmp && regtry(prog, s))
+ if (tmp && (norun || regtry(prog, s)))
goto got_it;
else
tmp = doevery;
PL_reg_flags |= RF_tainted;
while (s < strend) {
if (!isDIGIT_LC_utf8((U8*)s)) {
- if (tmp && regtry(prog, s))
+ if (tmp && (norun || regtry(prog, s)))
goto got_it;
else
tmp = doevery;
s += UTF8SKIP(s);
}
break;
+ default:
+ Perl_croak(aTHX_ "panic: unknown regstclass %d", (int)OP(c));
+ break;
+ }
+ return 0;
+ got_it:
+ return s;
+}
+
+/*
+ - regexec_flags - match a regexp against a string
+ */
+I32
+Perl_regexec_flags(pTHX_ register regexp *prog, char *stringarg, register char *strend,
+ char *strbeg, I32 minend, SV *sv, void *data, U32 flags)
+/* strend: pointer to null at end of string */
+/* strbeg: real beginning of string */
+/* minend: end of match must be >=minend after stringarg. */
+/* data: May be used for some additional optimizations. */
+/* nosave: For optimizations. */
+{
+ dTHR;
+ register char *s;
+ register regnode *c;
+ register char *startpos = stringarg;
+ register I32 tmp;
+ I32 minlen; /* must match at least this many chars */
+ I32 dontbother = 0; /* how many characters not to try at end */
+ I32 start_shift = 0; /* Offset of the start to find
+ constant substr. */ /* CC */
+ I32 end_shift = 0; /* Same for the end. */ /* CC */
+ I32 scream_pos = -1; /* Internal iterator of scream. */
+ char *scream_olds;
+ SV* oreplsv = GvSV(PL_replgv);
+
+ PL_regcc = 0;
+
+ cache_re(prog);
+#ifdef DEBUGGING
+ PL_regnarrate = PL_debug & 512;
+#endif
+
+ /* Be paranoid... */
+ if (prog == NULL || startpos == NULL) {
+ Perl_croak(aTHX_ "NULL regexp parameter");
+ return 0;
+ }
+
+ minlen = prog->minlen;
+ if (strend - startpos < minlen) goto phooey;
+
+ if (startpos == strbeg) /* is ^ valid at stringarg? */
+ PL_regprev = '\n';
+ else {
+ PL_regprev = (U32)stringarg[-1];
+ if (!PL_multiline && PL_regprev == '\n')
+ PL_regprev = '\0'; /* force ^ to NOT match */
+ }
+
+ /* Check validity of program. */
+ if (UCHARAT(prog->program) != REG_MAGIC) {
+ Perl_croak(aTHX_ "corrupted regexp program");
+ }
+
+ PL_reg_flags = 0;
+ PL_reg_eval_set = 0;
+ PL_reg_maxiter = 0;
+
+ if (prog->reganch & ROPT_UTF8)
+ PL_reg_flags |= RF_utf8;
+
+ /* Mark beginning of line for ^ and lookbehind. */
+ PL_regbol = startpos;
+ PL_bostr = strbeg;
+ PL_reg_sv = sv;
+
+ /* Mark end of line for $ (and such) */
+ PL_regeol = strend;
+
+ /* see how far we have to get to not match where we matched before */
+ PL_regtill = startpos+minend;
+
+ /* We start without call_cc context. */
+ PL_reg_call_cc = 0;
+
+ /* If there is a "must appear" string, look for it. */
+ s = startpos;
+
+ if (prog->reganch & ROPT_GPOS_SEEN) { /* Need to have PL_reg_ganch */
+ MAGIC *mg;
+
+ if (flags & REXEC_IGNOREPOS) /* Means: check only at start */
+ PL_reg_ganch = startpos;
+ else if (sv && SvTYPE(sv) >= SVt_PVMG
+ && SvMAGIC(sv)
+ && (mg = mg_find(sv, 'g')) && mg->mg_len >= 0) {
+ PL_reg_ganch = strbeg + mg->mg_len; /* Defined pos() */
+ if (prog->reganch & ROPT_ANCH_GPOS) {
+ if (s > PL_reg_ganch)
+ goto phooey;
+ s = PL_reg_ganch;
+ }
+ }
+ else /* pos() not defined */
+ PL_reg_ganch = strbeg;
+ }
+
+ if (!(flags & REXEC_CHECKED) && prog->check_substr != Nullsv) {
+ re_scream_pos_data d;
+
+ d.scream_olds = &scream_olds;
+ d.scream_pos = &scream_pos;
+ s = re_intuit_start(prog, sv, s, strend, flags, &d);
+ if (!s)
+ goto phooey; /* not present */
+ }
+
+ DEBUG_r( if (!PL_colorset) reginitcolors() );
+ DEBUG_r(PerlIO_printf(Perl_debug_log,
+ "%sMatching REx%s `%s%.60s%s%s' against `%s%.*s%s%s'\n",
+ PL_colors[4],PL_colors[5],PL_colors[0],
+ prog->precomp,
+ PL_colors[1],
+ (strlen(prog->precomp) > 60 ? "..." : ""),
+ PL_colors[0],
+ (int)(strend - startpos > 60 ? 60 : strend - startpos),
+ startpos, PL_colors[1],
+ (strend - startpos > 60 ? "..." : ""))
+ );
+
+ /* Simplest case: anchored match need be tried only once. */
+ /* [unless only anchor is BOL and multiline is set] */
+ if (prog->reganch & (ROPT_ANCH & ~ROPT_ANCH_GPOS)) {
+ if (s == startpos && regtry(prog, startpos))
+ goto got_it;
+ else if (PL_multiline || (prog->reganch & ROPT_IMPLICIT)
+ || (prog->reganch & ROPT_ANCH_MBOL)) /* XXXX SBOL? */
+ {
+ char *end;
+
+ if (minlen)
+ dontbother = minlen - 1;
+ end = HOPc(strend, -dontbother) - 1;
+ /* for multiline we only have to try after newlines */
+ if (prog->check_substr) {
+ if (s == startpos)
+ goto after_try;
+ while (1) {
+ if (regtry(prog, s))
+ goto got_it;
+ after_try:
+ if (s >= end)
+ goto phooey;
+ if (prog->reganch & RE_USE_INTUIT) {
+ s = re_intuit_start(prog, sv, s + 1, strend, flags, NULL);
+ if (!s)
+ goto phooey;
+ }
+ else
+ s++;
+ }
+ } else {
+ if (s > startpos)
+ s--;
+ while (s < end) {
+ if (*s++ == '\n') { /* don't need PL_utf8skip here */
+ if (regtry(prog, s))
+ goto got_it;
+ }
+ }
+ }
+ }
+ goto phooey;
+ } else if (prog->reganch & ROPT_ANCH_GPOS) {
+ if (regtry(prog, PL_reg_ganch))
+ goto got_it;
+ goto phooey;
+ }
+
+ /* Messy cases: unanchored match. */
+ if (prog->anchored_substr && prog->reganch & ROPT_SKIP) {
+ /* we have /x+whatever/ */
+ /* it must be a one character string (XXXX Except UTF?) */
+ char ch = SvPVX(prog->anchored_substr)[0];
+ if (UTF) {
+ while (s < strend) {
+ if (*s == ch) {
+ if (regtry(prog, s)) goto got_it;
+ s += UTF8SKIP(s);
+ while (s < strend && *s == ch)
+ s += UTF8SKIP(s);
+ }
+ s += UTF8SKIP(s);
+ }
+ }
+ else {
+ while (s < strend) {
+ if (*s == ch) {
+ if (regtry(prog, s)) goto got_it;
+ s++;
+ while (s < strend && *s == ch)
+ s++;
+ }
+ s++;
+ }
+ }
+ }
+ /*SUPPRESS 560*/
+ else if (prog->anchored_substr != Nullsv
+ || (prog->float_substr != Nullsv
+ && prog->float_max_offset < strend - s)) {
+ SV *must = prog->anchored_substr
+ ? prog->anchored_substr : prog->float_substr;
+ I32 back_max =
+ prog->anchored_substr ? prog->anchored_offset : prog->float_max_offset;
+ I32 back_min =
+ prog->anchored_substr ? prog->anchored_offset : prog->float_min_offset;
+ I32 delta = back_max - back_min;
+ char *last = HOPc(strend, /* Cannot start after this */
+ -(I32)(CHR_SVLEN(must)
+ - (SvTAIL(must) != 0) + back_min));
+ char *last1; /* Last position checked before */
+
+ if (s > PL_bostr)
+ last1 = HOPc(s, -1);
+ else
+ last1 = s - 1; /* bogus */
+
+ /* XXXX check_substr already used to find `s', can optimize if
+ check_substr==must. */
+ scream_pos = -1;
+ dontbother = end_shift;
+ strend = HOPc(strend, -dontbother);
+ while ( (s <= last) &&
+ ((flags & REXEC_SCREAM)
+ ? (s = screaminstr(sv, must, HOPc(s, back_min) - strbeg,
+ end_shift, &scream_pos, 0))
+ : (s = fbm_instr((unsigned char*)HOP(s, back_min),
+ (unsigned char*)strend, must,
+ PL_multiline ? FBMrf_MULTILINE : 0))) ) {
+ if (HOPc(s, -back_max) > last1) {
+ last1 = HOPc(s, -back_min);
+ s = HOPc(s, -back_max);
+ }
+ else {
+ char *t = (last1 >= PL_bostr) ? HOPc(last1, 1) : last1 + 1;
+
+ last1 = HOPc(s, -back_min);
+ s = t;
+ }
+ if (UTF) {
+ while (s <= last1) {
+ if (regtry(prog, s))
+ goto got_it;
+ s += UTF8SKIP(s);
+ }
+ }
+ else {
+ while (s <= last1) {
+ if (regtry(prog, s))
+ goto got_it;
+ s++;
+ }
+ }
}
+ goto phooey;
+ }
+ else if (c = prog->regstclass) {
+ if (minlen && PL_regkind[(U8)OP(prog->regstclass)] != EXACT)
+ /* don't bother with what can't match */
+ strend = HOPc(strend, -(minlen - 1));
+ if (find_byclass(prog, c, s, strend, startpos, 0))
+ goto got_it;
}
else {
dontbother = 0;
PL_reg_eval_set = RS_init;
DEBUG_r(DEBUG_s(
- PerlIO_printf(Perl_debug_log, " setting stack tmpbase at %i\n",
- PL_stack_sp - PL_stack_base);
+ PerlIO_printf(Perl_debug_log, " setting stack tmpbase at %"IVdf"\n",
+ (IV)(PL_stack_sp - PL_stack_base));
));
- SAVEINT(cxstack[cxstack_ix].blk_oldsp);
+ SAVEI32(cxstack[cxstack_ix].blk_oldsp);
cxstack[cxstack_ix].blk_oldsp = PL_stack_sp - PL_stack_base;
/* Otherwise OP_NEXTSTATE will free whatever on stack now. */
SAVETMPS;
/* Apparently this is not needed, judging by wantarray. */
- /* SAVEINT(cxstack[cxstack_ix].blk_gimme);
+ /* SAVEI8(cxstack[cxstack_ix].blk_gimme);
cxstack[cxstack_ix].blk_gimme = G_SCALAR; */
if (PL_reg_sv) {
}
PL_reg_magic = mg;
PL_reg_oldpos = mg->mg_len;
- SAVEDESTRUCTOR(restore_pos, 0);
+ SAVEDESTRUCTOR_X(restore_pos, 0);
}
if (!PL_reg_curpm)
New(22,PL_reg_curpm, 1, PMOP);
pref0_len = pref_len;
regprop(prop, scan);
PerlIO_printf(Perl_debug_log,
- "%4i <%s%.*s%s%s%.*s%s%s%s%.*s%s>%*s|%3d:%*s%s\n",
- locinput - PL_bostr,
+ "%4"IVdf" <%s%.*s%s%s%.*s%s%s%s%.*s%s>%*s|%3"IVdf":%*s%s\n",
+ (IV)(locinput - PL_bostr),
PL_colors[4], pref0_len,
locinput - pref_len, PL_colors[5],
PL_colors[2], pref_len - pref0_len,
PL_colors[0], l, locinput, PL_colors[1],
15 - l - pref_len + 1,
"",
- scan - PL_regprogram, PL_regindent*2, "",
+ (IV)(scan - PL_regprogram), PL_regindent*2, "",
SvPVX(prop));
} );
nextchr = UCHARAT(locinput);
break;
case ANYOFUTF8:
- s = MASK(scan);
if (!REGINCLASSUTF8(scan, (U8*)locinput))
sayNO;
if (locinput >= PL_regeol)
nextchr = UCHARAT(locinput);
break;
case ANYOF:
- s = MASK(scan);
if (nextchr < 0)
nextchr = UCHARAT(locinput);
- if (!REGINCLASS(s, nextchr))
+ if (!REGINCLASS(scan, nextchr))
sayNO;
if (!nextchr && locinput >= PL_regeol)
sayNO;
n = ARG(scan);
PL_op = (OP_4tree*)PL_regdata->data[n];
- DEBUG_r( PerlIO_printf(Perl_debug_log, " re_eval 0x%x\n", PL_op) );
+ DEBUG_r( PerlIO_printf(Perl_debug_log, " re_eval 0x%"UVxf"\n", PTR2UV(PL_op)) );
PL_curpad = AvARRAY((AV*)PL_regdata->data[n + 2]);
PL_regendp[0] = PL_reg_magic->mg_len = locinput - PL_bostr;
locinput = PL_reginput;
DEBUG_r(
PerlIO_printf(Perl_debug_log,
- "%*s matched %ld times, len=%ld...\n",
- REPORT_CODE_OFF+PL_regindent*2, "", n, l)
+ "%*s matched %"IVdf" times, len=%"IVdf"...\n",
+ (int)(REPORT_CODE_OFF+PL_regindent*2), "",
+ (IV) n, (IV)l)
);
if (n >= ln) {
if (PL_regkind[(U8)OP(next)] == EXACT) {
{
DEBUG_r(
PerlIO_printf(Perl_debug_log,
- "%*s trying tail with n=%ld...\n",
- REPORT_CODE_OFF+PL_regindent*2, "", n)
+ "%*s trying tail with n=%"IVdf"...\n",
+ (int)(REPORT_CODE_OFF+PL_regindent*2), "", (IV)n)
);
if (paren) {
if (n) {
next = NULL;
break;
default:
- PerlIO_printf(PerlIO_stderr(), "%lx %d\n",
- (unsigned long)scan, OP(scan));
+ PerlIO_printf(Perl_error_log, "%"UVxf" %d\n",
+ PTR2UV(scan), OP(scan));
Perl_croak(aTHX_ "regexp memory corruption");
}
scan = next;
{
dTHR;
register char *scan;
- register char *opnd;
register I32 c;
register char *loceol = PL_regeol;
register I32 hardcount = 0;
}
break;
case ANYOF:
- opnd = MASK(p);
- while (scan < loceol && REGINCLASS(opnd, *scan))
+ while (scan < loceol && REGINCLASS(p, *scan))
scan++;
break;
case ALNUM:
regprop(prop, p);
PerlIO_printf(Perl_debug_log,
- "%*s %s can match %ld times out of %ld...\n",
- REPORT_CODE_OFF+1, "", SvPVX(prop),c,max);
+ "%*s %s can match %"IVdf" times out of %"IVdf"...\n",
+ REPORT_CODE_OFF+1, "", SvPVX(prop),(IV)c,(IV)max);
});
return(c);
*/
STATIC bool
-S_reginclass(pTHX_ register char *p, register I32 c)
+S_reginclass(pTHX_ register regnode *p, register I32 c)
{
dTHR;
char flags = ANYOF_FLAGS(p);
}
#ifdef PERL_OBJECT
-#define NO_XSLOCKS
#include "XSUB.h"
#endif
#define ROPT_CHECK_ALL 0x00100
#define ROPT_LOOKBEHIND_SEEN 0x00200
#define ROPT_EVAL_SEEN 0x00400
-#define ROPT_TAINTED_SEEN 0x00800
/* 0xf800 of reganch is used by PMf_COMPILETIME */
#define ROPT_UTF8 0x10000
#define ROPT_NAUGHTY 0x20000 /* how exponential is this pattern? */
#define ROPT_COPY_DONE 0x40000 /* subbeg is a copy of the string */
+#define ROPT_TAINTED_SEEN 0x80000
#define RE_USE_INTUIT_NOML 0x0100000 /* Best to intuit before matching */
#define RE_USE_INTUIT_ML 0x0200000
{
dTHR;
- while ( PL_op = CALL_FPTR(PL_op->op_ppaddr)(aTHX) ) ;
+ while ( PL_op = CALL_FPTR(PL_op->op_ppaddr)(aTHX) ) {
+ PERL_ASYNC_CHECK();
+ }
TAINT_NOT;
return 0;
}
do {
+ PERL_ASYNC_CHECK();
if (PL_debug) {
if (PL_watchaddr != 0 && *PL_watchaddr != PL_watchok)
- PerlIO_printf(Perl_debug_log, "WARNING: %lx changed from %lx to %lx\n",
- (long)PL_watchaddr, (long)PL_watchok, (long)*PL_watchaddr);
+ PerlIO_printf(Perl_debug_log,
+ "WARNING: %"UVxf" changed from %"UVxf" to %"UVxf"\n",
+ PTR2UV(PL_watchaddr), PTR2UV(PL_watchok),
+ PTR2UV(*PL_watchaddr));
DEBUG_s(debstack());
DEBUG_t(debop(PL_op));
DEBUG_P(debprof(PL_op));
Perl_deb(aTHX_ "%s", PL_op_name[o->op_type]);
switch (o->op_type) {
case OP_CONST:
- PerlIO_printf(Perl_debug_log, "(%s)", SvPEEK(cSVOPo->op_sv));
+ PerlIO_printf(Perl_debug_log, "(%s)", SvPEEK(cSVOPo_sv));
break;
case OP_GVSV:
case OP_GV:
- if (cGVOPo->op_gv) {
+ if (cGVOPo_gv) {
sv = NEWSV(0,0);
- gv_fullname3(sv, cGVOPo->op_gv, Nullch);
+ gv_fullname3(sv, cGVOPo_gv, Nullch);
PerlIO_printf(Perl_debug_log, "(%s)", SvPV(sv, n_a));
SvREFCNT_dec(sv);
}
dTHR;
PL_watchaddr = addr;
PL_watchok = *addr;
- PerlIO_printf(Perl_debug_log, "WATCHING, %lx is currently %lx\n",
- (long)PL_watchaddr, (long)PL_watchok);
+ PerlIO_printf(Perl_debug_log, "WATCHING, %"UVxf" is currently %"UVxf"\n",
+ PTR2UV(PL_watchaddr), PTR2UV(PL_watchok));
#endif /* DEBUGGING */
}
#include "perl.h"
void *
-Perl_default_protect(pTHX_ int *excpt, protect_body_t body, ...)
+Perl_default_protect(pTHX_ volatile JMPENV *pcur_env, int *excpt,
+ protect_body_t body, ...)
{
void *ret;
va_list args;
va_start(args, body);
- ret = vdefault_protect(excpt, body, &args);
+ ret = vdefault_protect(pcur_env, excpt, body, &args);
va_end(args);
return ret;
}
void *
-Perl_vdefault_protect(pTHX_ int *excpt, protect_body_t body, va_list *args)
+Perl_vdefault_protect(pTHX_ volatile JMPENV *pcur_env, int *excpt,
+ protect_body_t body, va_list *args)
{
dTHR;
- dJMPENV;
int ex;
void *ret;
DEBUG_l(Perl_deb(aTHX_ "Setting up local jumplevel %p, was %p\n",
- &cur_env, PL_top_env));
+ pcur_env, PL_top_env));
JMPENV_PUSH(ex);
if (ex)
ret = NULL;
if (empty) {
register GP *gp;
+ Newz(602, gp, 1, GP);
+
if (GvCVu(gv))
PL_sub_generation++; /* taking a method out of circulation */
- Newz(602, gp, 1, GP);
+ if (GvIOp(gv) && (IoFLAGS(GvIOp(gv)) & IOf_ARGV)) {
+ gp->gp_io = newIO();
+ IoFLAGS(gp->gp_io) |= IOf_ARGV|IOf_START;
+ }
GvGP(gv) = gp_ref(gp);
GvSV(gv) = NEWSV(72,0);
- GvLINE(gv) = PL_curcop->cop_line;
+ GvLINE(gv) = CopLINE(PL_curcop);
GvEGV(gv) = gv;
}
else {
}
void
+Perl_save_I8(pTHX_ I8 *bytep)
+{
+ dTHR;
+ SSCHECK(3);
+ SSPUSHINT(*bytep);
+ SSPUSHPTR(bytep);
+ SSPUSHINT(SAVEt_I8);
+}
+
+void
Perl_save_iv(pTHX_ IV *ivp)
{
dTHR;
}
void
+Perl_save_vptr(pTHX_ void *ptr)
+{
+ dTHR;
+ SSCHECK(3);
+ SSPUSHPTR(*(char**)ptr);
+ SSPUSHPTR(ptr);
+ SSPUSHINT(SAVEt_VPTR);
+}
+
+void
Perl_save_sptr(pTHX_ SV **sptr)
{
dTHR;
#ifdef USE_THREADS
dTHR;
SV **svp = &THREADSV(i); /* XXX Change to save by offset */
- DEBUG_S(PerlIO_printf(PerlIO_stderr(), "save_threadsv %u: %p %p:%s\n",
- i, svp, *svp, SvPEEK(*svp)));
+ DEBUG_S(PerlIO_printf(Perl_debug_log, "save_threadsv %"UVuf": %p %p:%s\n",
+ (UV)i, svp, *svp, SvPEEK(*svp)));
save_svref(svp);
return svp;
#else
}
void
-Perl_save_destructor(pTHX_ DESTRUCTORFUNC_t f, void* p)
+Perl_save_destructor(pTHX_ DESTRUCTORFUNC_NOCONTEXT_t f, void* p)
{
dTHR;
SSCHECK(3);
}
void
+Perl_save_destructor_x(pTHX_ DESTRUCTORFUNC_t f, void* p)
+{
+ dTHR;
+ SSCHECK(3);
+ SSPUSHDXPTR(f);
+ SSPUSHPTR(p);
+ SSPUSHINT(SAVEt_DESTRUCTOR_X);
+}
+
+void
Perl_save_aelem(pTHX_ AV *av, I32 idx, SV **sptr)
{
dTHR;
ptr = SSPOPPTR;
restore_sv:
sv = *(SV**)ptr;
- DEBUG_S(PerlIO_printf(PerlIO_stderr(),
+ DEBUG_S(PerlIO_printf(Perl_debug_log,
"restore svref: %p %p:%s -> %p:%s\n",
ptr, sv, SvPEEK(sv), value, SvPEEK(value)));
if (SvTYPE(sv) >= SVt_PVMG && SvMAGIC(sv) &&
ptr = SSPOPPTR;
*(I16*)ptr = (I16)SSPOPINT;
break;
+ case SAVEt_I8: /* I8 reference */
+ ptr = SSPOPPTR;
+ *(I8*)ptr = (I8)SSPOPINT;
+ break;
case SAVEt_IV: /* IV reference */
ptr = SSPOPPTR;
*(IV*)ptr = (IV)SSPOPIV;
ptr = SSPOPPTR;
*(SV**)ptr = (SV*)SSPOPPTR;
break;
+ case SAVEt_VPTR: /* random* reference */
case SAVEt_PPTR: /* char* reference */
ptr = SSPOPPTR;
*(char**)ptr = (char*)SSPOPPTR;
break;
case SAVEt_DESTRUCTOR:
ptr = SSPOPPTR;
- CALLDESTRUCTOR(aTHXo_ ptr);
+ (*SSPOPDPTR)(ptr);
+ break;
+ case SAVEt_DESTRUCTOR_X:
+ ptr = SSPOPPTR;
+ (*SSPOPDXPTR)(aTHXo_ ptr);
break;
case SAVEt_REGCONTEXT:
case SAVEt_ALLOC:
PerlIO_printf(Perl_debug_log, "CX %ld = %s\n", (long)(cx - cxstack), PL_block_type[CxTYPE(cx)]);
if (CxTYPE(cx) != CXt_SUBST) {
PerlIO_printf(Perl_debug_log, "BLK_OLDSP = %ld\n", (long)cx->blk_oldsp);
- PerlIO_printf(Perl_debug_log, "BLK_OLDCOP = 0x%lx\n", (long)cx->blk_oldcop);
+ PerlIO_printf(Perl_debug_log, "BLK_OLDCOP = 0x%"UVxf"\n",
+ PTR2UV(cx->blk_oldcop));
PerlIO_printf(Perl_debug_log, "BLK_OLDMARKSP = %ld\n", (long)cx->blk_oldmarksp);
PerlIO_printf(Perl_debug_log, "BLK_OLDSCOPESP = %ld\n", (long)cx->blk_oldscopesp);
PerlIO_printf(Perl_debug_log, "BLK_OLDRETSP = %ld\n", (long)cx->blk_oldretsp);
- PerlIO_printf(Perl_debug_log, "BLK_OLDPM = 0x%lx\n", (long)cx->blk_oldpm);
+ PerlIO_printf(Perl_debug_log, "BLK_OLDPM = 0x%"UVxf"\n",
+ PTR2UV(cx->blk_oldpm));
PerlIO_printf(Perl_debug_log, "BLK_GIMME = %s\n", cx->blk_gimme ? "LIST" : "SCALAR");
}
switch (CxTYPE(cx)) {
case CXt_NULL:
case CXt_BLOCK:
break;
+ case CXt_FORMAT:
+ PerlIO_printf(Perl_debug_log, "BLK_SUB.CV = 0x%"UVxf"\n",
+ PTR2UV(cx->blk_sub.cv));
+ PerlIO_printf(Perl_debug_log, "BLK_SUB.GV = 0x%"UVxf"\n",
+ PTR2UV(cx->blk_sub.gv));
+ PerlIO_printf(Perl_debug_log, "BLK_SUB.DFOUTGV = 0x%"UVxf"\n",
+ PTR2UV(cx->blk_sub.dfoutgv));
+ PerlIO_printf(Perl_debug_log, "BLK_SUB.HASARGS = %d\n",
+ (int)cx->blk_sub.hasargs);
+ break;
case CXt_SUB:
- PerlIO_printf(Perl_debug_log, "BLK_SUB.CV = 0x%lx\n",
- (long)cx->blk_sub.cv);
- PerlIO_printf(Perl_debug_log, "BLK_SUB.GV = 0x%lx\n",
- (long)cx->blk_sub.gv);
- PerlIO_printf(Perl_debug_log, "BLK_SUB.DFOUTGV = 0x%lx\n",
- (long)cx->blk_sub.dfoutgv);
+ PerlIO_printf(Perl_debug_log, "BLK_SUB.CV = 0x%"UVxf"\n",
+ PTR2UV(cx->blk_sub.cv));
PerlIO_printf(Perl_debug_log, "BLK_SUB.OLDDEPTH = %ld\n",
(long)cx->blk_sub.olddepth);
PerlIO_printf(Perl_debug_log, "BLK_SUB.HASARGS = %d\n",
(int)cx->blk_sub.hasargs);
+ PerlIO_printf(Perl_debug_log, "BLK_SUB.LVAL = %d\n",
+ (int)cx->blk_sub.lval);
break;
case CXt_EVAL:
PerlIO_printf(Perl_debug_log, "BLK_EVAL.OLD_IN_EVAL = %ld\n",
PL_op_desc[cx->blk_eval.old_op_type]);
PerlIO_printf(Perl_debug_log, "BLK_EVAL.OLD_NAME = %s\n",
cx->blk_eval.old_name);
- PerlIO_printf(Perl_debug_log, "BLK_EVAL.OLD_EVAL_ROOT = 0x%lx\n",
- (long)cx->blk_eval.old_eval_root);
+ PerlIO_printf(Perl_debug_log, "BLK_EVAL.OLD_EVAL_ROOT = 0x%"UVxf"\n",
+ PTR2UV(cx->blk_eval.old_eval_root));
break;
case CXt_LOOP:
cx->blk_loop.label);
PerlIO_printf(Perl_debug_log, "BLK_LOOP.RESETSP = %ld\n",
(long)cx->blk_loop.resetsp);
- PerlIO_printf(Perl_debug_log, "BLK_LOOP.REDO_OP = 0x%lx\n",
- (long)cx->blk_loop.redo_op);
- PerlIO_printf(Perl_debug_log, "BLK_LOOP.NEXT_OP = 0x%lx\n",
- (long)cx->blk_loop.next_op);
- PerlIO_printf(Perl_debug_log, "BLK_LOOP.LAST_OP = 0x%lx\n",
- (long)cx->blk_loop.last_op);
+ PerlIO_printf(Perl_debug_log, "BLK_LOOP.REDO_OP = 0x%"UVxf"\n",
+ PTR2UV(cx->blk_loop.redo_op));
+ PerlIO_printf(Perl_debug_log, "BLK_LOOP.NEXT_OP = 0x%"UVxf"\n",
+ PTR2UV(cx->blk_loop.next_op));
+ PerlIO_printf(Perl_debug_log, "BLK_LOOP.LAST_OP = 0x%"UVxf"\n",
+ PTR2UV(cx->blk_loop.last_op));
PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERIX = %ld\n",
(long)cx->blk_loop.iterix);
- PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERARY = 0x%lx\n",
- (long)cx->blk_loop.iterary);
- PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERVAR = 0x%lx\n",
- (long)cx->blk_loop.itervar);
- if (cx->blk_loop.itervar)
- PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERSAVE = 0x%lx\n",
- (long)cx->blk_loop.itersave);
- PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERLVAL = 0x%lx\n",
- (long)cx->blk_loop.iterlval);
+ PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERARY = 0x%"UVxf"\n",
+ PTR2UV(cx->blk_loop.iterary));
+ PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERVAR = 0x%"UVxf"\n",
+ PTR2UV(CxITERVAR(cx)));
+ if (CxITERVAR(cx))
+ PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERSAVE = 0x%"UVxf"\n",
+ PTR2UV(cx->blk_loop.itersave));
+ PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERLVAL = 0x%"UVxf"\n",
+ PTR2UV(cx->blk_loop.iterlval));
break;
case CXt_SUBST:
(long)cx->sb_once);
PerlIO_printf(Perl_debug_log, "SB_ORIG = %s\n",
cx->sb_orig);
- PerlIO_printf(Perl_debug_log, "SB_DSTR = 0x%lx\n",
- (long)cx->sb_dstr);
- PerlIO_printf(Perl_debug_log, "SB_TARG = 0x%lx\n",
- (long)cx->sb_targ);
- PerlIO_printf(Perl_debug_log, "SB_S = 0x%lx\n",
- (long)cx->sb_s);
- PerlIO_printf(Perl_debug_log, "SB_M = 0x%lx\n",
- (long)cx->sb_m);
- PerlIO_printf(Perl_debug_log, "SB_STREND = 0x%lx\n",
- (long)cx->sb_strend);
- PerlIO_printf(Perl_debug_log, "SB_RXRES = 0x%lx\n",
- (long)cx->sb_rxres);
+ PerlIO_printf(Perl_debug_log, "SB_DSTR = 0x%"UVxf"\n",
+ PTR2UV(cx->sb_dstr));
+ PerlIO_printf(Perl_debug_log, "SB_TARG = 0x%"UVxf"\n",
+ PTR2UV(cx->sb_targ));
+ PerlIO_printf(Perl_debug_log, "SB_S = 0x%"UVxf"\n",
+ PTR2UV(cx->sb_s));
+ PerlIO_printf(Perl_debug_log, "SB_M = 0x%"UVxf"\n",
+ PTR2UV(cx->sb_m));
+ PerlIO_printf(Perl_debug_log, "SB_STREND = 0x%"UVxf"\n",
+ PTR2UV(cx->sb_strend));
+ PerlIO_printf(Perl_debug_log, "SB_RXRES = 0x%"UVxf"\n",
+ PTR2UV(cx->sb_rxres));
break;
}
#endif /* DEBUGGING */
#define SAVEt_HINTS 27
#define SAVEt_ALLOC 28
#define SAVEt_GENERIC_SVREF 29
+#define SAVEt_DESTRUCTOR_X 30
+#define SAVEt_VPTR 31
+#define SAVEt_I8 32
#define SSCHECK(need) if (PL_savestack_ix + need > PL_savestack_max) savestack_grow()
#define SSPUSHINT(i) (PL_savestack[PL_savestack_ix++].any_i32 = (I32)(i))
#define SSPUSHIV(i) (PL_savestack[PL_savestack_ix++].any_iv = (IV)(i))
#define SSPUSHPTR(p) (PL_savestack[PL_savestack_ix++].any_ptr = (void*)(p))
#define SSPUSHDPTR(p) (PL_savestack[PL_savestack_ix++].any_dptr = (p))
+#define SSPUSHDXPTR(p) (PL_savestack[PL_savestack_ix++].any_dxptr = (p))
#define SSPOPINT (PL_savestack[--PL_savestack_ix].any_i32)
#define SSPOPLONG (PL_savestack[--PL_savestack_ix].any_long)
#define SSPOPIV (PL_savestack[--PL_savestack_ix].any_iv)
#define SSPOPPTR (PL_savestack[--PL_savestack_ix].any_ptr)
#define SSPOPDPTR (PL_savestack[--PL_savestack_ix].any_dptr)
+#define SSPOPDXPTR (PL_savestack[--PL_savestack_ix].any_dxptr)
#define SAVETMPS save_int((int*)&PL_tmps_floor), PL_tmps_floor = PL_tmps_ix
#define FREETMPS if (PL_tmps_ix > PL_tmps_floor) free_tmps()
* Not using SOFT_CAST on SAVESPTR, SAVEGENERICSV and SAVEFREESV
* because these are used for several kinds of pointer values
*/
+#define SAVEI8(i) save_I8(SOFT_CAST(I8*)&(i))
#define SAVEI16(i) save_I16(SOFT_CAST(I16*)&(i))
#define SAVEI32(i) save_I32(SOFT_CAST(I32*)&(i))
#define SAVEINT(i) save_int(SOFT_CAST(int*)&(i))
#define SAVELONG(l) save_long(SOFT_CAST(long*)&(l))
#define SAVESPTR(s) save_sptr((SV**)&(s))
#define SAVEPPTR(s) save_pptr(SOFT_CAST(char**)&(s))
+#define SAVEVPTR(s) save_vptr((void*)&(s))
#define SAVEFREESV(s) save_freesv((SV*)(s))
#define SAVEFREEOP(o) save_freeop(SOFT_CAST(OP*)(o))
#define SAVEFREEPV(p) save_freepv(SOFT_CAST(char*)(p))
#define SAVEGENERICSV(s) save_generic_svref((SV**)&(s))
#define SAVEDELETE(h,k,l) \
save_delete(SOFT_CAST(HV*)(h), SOFT_CAST(char*)(k), (I32)(l))
-#define CALLDESTRUCTOR (*SSPOPDPTR)
#define SAVEDESTRUCTOR(f,p) \
- save_destructor((DESTRUCTORFUNC_t)(f), SOFT_CAST(void*)(p))
+ save_destructor((DESTRUCTORFUNC_NOCONTEXT_t)(f), SOFT_CAST(void*)(p))
+
+#define SAVEDESTRUCTOR_X(f,p) \
+ save_destructor_x((DESTRUCTORFUNC_t)(f), SOFT_CAST(void*)(p))
#define SAVESTACK_POS() \
STMT_START { \
} \
} STMT_END
+#ifdef USE_ITHREADS
+# define SAVECOPSTASH(cop) SAVEPPTR(CopSTASHPV(cop))
+# define SAVECOPFILE(cop) SAVEPPTR(CopFILE(cop))
+#else
+# define SAVECOPSTASH(cop) SAVESPTR(CopSTASH(cop))
+# define SAVECOPFILE(cop) SAVESPTR(CopFILEGV(cop))
+#endif
+
+#define SAVECOPLINE(cop) SAVEI16(CopLINE(cop))
+
/* SSNEW() temporarily allocates a specified number of bytes of data on the
* savestack. It returns an integer index into the savestack, because a
* pointer would get broken if the savestack is moved on reallocation.
int je_ret; /* last exception thrown */
bool je_mustcatch; /* need to call longjmp()? */
void (*je_throw)(int v); /* last for bincompat */
+ bool je_noset; /* no need for setjmp() */
};
typedef struct jmpenv JMPENV;
* body of protected processing.
*/
typedef void *(CPERLscope(*protect_body_t)) (pTHX_ va_list);
-typedef void *(CPERLscope(*protect_proc_t)) (pTHX_ int *, protect_body_t, ...);
+typedef void *(CPERLscope(*protect_proc_t)) (pTHX_ volatile JMPENV *pcur_env,
+ int *, protect_body_t, ...);
/*
* How to build the first jmpenv.
PL_start_env.je_throw = NULL; \
PL_start_env.je_ret = -1; \
PL_start_env.je_mustcatch = TRUE; \
+ PL_start_env.je_noset = 0; \
PL_top_env = &PL_start_env; \
} STMT_END
* JMPENV_POP; // don't forget this!
*/
-#define dJMPENV JMPENV cur_env
+#define dJMPENV JMPENV cur_env; \
+ volatile JMPENV *pcur_env = ((cur_env.je_noset = 0),&cur_env)
-#define JMPENV_PUSH_INIT_ENV(cur_env,THROWFUNC) \
+#define JMPENV_PUSH_INIT_ENV(ce,THROWFUNC) \
STMT_START { \
- cur_env.je_throw = (THROWFUNC); \
- cur_env.je_ret = -1; \
- cur_env.je_mustcatch = FALSE; \
- cur_env.je_prev = PL_top_env; \
- PL_top_env = &cur_env; \
+ (ce).je_throw = (THROWFUNC); \
+ (ce).je_ret = -1; \
+ (ce).je_mustcatch = FALSE; \
+ (ce).je_prev = PL_top_env; \
+ PL_top_env = &(ce); \
OP_REG_TO_MEM; \
} STMT_END
-#define JMPENV_PUSH_INIT(THROWFUNC) JMPENV_PUSH_INIT_ENV(cur_env,THROWFUNC)
+#define JMPENV_PUSH_INIT(THROWFUNC) JMPENV_PUSH_INIT_ENV(*(JMPENV*)pcur_env,THROWFUNC)
-#define JMPENV_POST_CATCH_ENV(cur_env) \
+#define JMPENV_POST_CATCH_ENV(ce) \
STMT_START { \
OP_MEM_TO_REG; \
- PL_top_env = &cur_env; \
+ PL_top_env = &(ce); \
} STMT_END
-#define JMPENV_POST_CATCH JMPENV_POST_CATCH_ENV(cur_env)
+#define JMPENV_POST_CATCH JMPENV_POST_CATCH_ENV(*(JMPENV*)pcur_env)
-#define JMPENV_PUSH_ENV(cur_env,v) \
- STMT_START { \
- JMPENV_PUSH_INIT_ENV(cur_env,NULL); \
- EXCEPT_SET_ENV(cur_env,PerlProc_setjmp(cur_env.je_buf, 1)); \
- JMPENV_POST_CATCH_ENV(cur_env); \
- (v) = EXCEPT_GET_ENV(cur_env); \
+#define JMPENV_PUSH_ENV(ce,v) \
+ STMT_START { \
+ if (!(ce).je_noset) { \
+ JMPENV_PUSH_INIT_ENV(ce,NULL); \
+ EXCEPT_SET_ENV(ce,PerlProc_setjmp((ce).je_buf, 1));\
+ (ce).je_noset = 1; \
+ } \
+ else \
+ EXCEPT_SET_ENV(ce,0); \
+ JMPENV_POST_CATCH_ENV(ce); \
+ (v) = EXCEPT_GET_ENV(ce); \
} STMT_END
-#define JMPENV_PUSH(v) JMPENV_PUSH_ENV(cur_env,v)
+#define JMPENV_PUSH(v) JMPENV_PUSH_ENV(*(JMPENV*)pcur_env,v)
-#define JMPENV_POP_ENV(cur_env) \
- STMT_START { PL_top_env = cur_env.je_prev; } STMT_END
+#define JMPENV_POP_ENV(ce) \
+ STMT_START { PL_top_env = (ce).je_prev; } STMT_END
-#define JMPENV_POP JMPENV_POP_ENV(cur_env)
+#define JMPENV_POP JMPENV_POP_ENV(*(JMPENV*)pcur_env)
#define JMPENV_JUMP(v) \
STMT_START { \
} \
if ((v) == 2) \
PerlProc_exit(STATUS_NATIVE_EXPORT); \
- PerlIO_printf(PerlIO_stderr(), "panic: top_env\n"); \
+ PerlIO_printf(Perl_error_log, "panic: top_env\n"); \
PerlProc_exit(1); \
} STMT_END
-#define EXCEPT_GET_ENV(cur_env) (cur_env.je_ret)
-#define EXCEPT_GET EXCEPT_GET_ENV(cur_env)
-#define EXCEPT_SET_ENV(cur_env,v) (cur_env.je_ret = (v))
-#define EXCEPT_SET(v) EXCEPT_SET_ENV(cur_env,v)
+#define EXCEPT_GET_ENV(ce) ((ce).je_ret)
+#define EXCEPT_GET EXCEPT_GET_ENV(*(JMPENV*)pcur_env)
+#define EXCEPT_SET_ENV(ce,v) ((ce).je_ret = (v))
+#define EXCEPT_SET(v) EXCEPT_SET_ENV(*(JMPENV*)pcur_env,v)
-#define CATCH_GET (PL_top_env->je_mustcatch)
-#define CATCH_SET(v) (PL_top_env->je_mustcatch = (v))
-
+#define CATCH_GET (PL_top_env->je_mustcatch)
+#define CATCH_SET(v) (PL_top_env->je_mustcatch = (v))
if (!ok) {
if (ckWARN_d(WARN_INTERNAL))
Perl_warner(aTHX_ WARN_INTERNAL,
- "Attempt to free non-arena SV: 0x%lx", (unsigned long)p);
+ "Attempt to free non-arena SV: 0x%"UVxf,
+ PTR2UV(p));
return;
}
}
PL_sv_root = 0;
}
+void
+Perl_report_uninit(pTHX)
+{
+ if (PL_op)
+ Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit,
+ " in ", PL_op_desc[PL_op->op_type]);
+ else
+ Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit, "", "");
+}
+
STATIC XPVIV*
S_new_xiv(pTHX)
{
#ifdef HAS_64K_LIMIT
if (newlen >= 0x10000) {
- PerlIO_printf(Perl_debug_log, "Allocation too large: %lx\n", newlen);
+ PerlIO_printf(Perl_debug_log,
+ "Allocation too large: %"UVxf"\n", (UV)newlen);
my_exit(1);
}
#endif /* HAS_64K_LIMIT */
if (!(SvFLAGS(sv) & SVs_PADTMP)) {
dTHR;
if (ckWARN(WARN_UNINITIALIZED) && !PL_localizing)
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
}
return 0;
}
if (SvREADONLY(sv) && !SvOK(sv)) {
dTHR;
if (ckWARN(WARN_UNINITIALIZED))
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
return 0;
}
}
SvUVX(sv) = U_V(SvNVX(sv));
SvIsUV_on(sv);
ret_iv_max:
-#ifdef IV_IS_QUAD
DEBUG_c(PerlIO_printf(Perl_debug_log,
- "0x%" PERL_PRIx64 " 2iv(%" PERL_PRIu64 " => %" PERL_PRId64 ") (as unsigned)\n",
+ "0x%"UVxf" 2iv(%"UVuf" => %"IVdf") (as unsigned)\n",
PTR2UV(sv),
- (UV)SvUVX(sv), (IV)SvUVX(sv)));
-#else
- DEBUG_c(PerlIO_printf(Perl_debug_log,
- "0x%lx 2iv(%lu => %ld) (as unsigned)\n",
- (unsigned long)sv,
- (unsigned long)SvUVX(sv), (long)(IV)SvUVX(sv)));
-#endif
+ SvUVX(sv),
+ SvUVX(sv)));
return (IV)SvUVX(sv);
}
}
(void)SvNOK_on(sv);
(void)SvIOK_on(sv);
#if defined(USE_LONG_DOUBLE)
- DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%lx 2nv(%" PERL_PRIgldbl ")\n",
- (unsigned long)sv, SvNVX(sv)));
+ DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%"UVxf" 2nv(%" PERL_PRIgldbl ")\n",
+ PTR2UV(sv), SvNVX(sv)));
#else
- DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%lx 2nv(%g)\n",
- (unsigned long)sv, SvNVX(sv)));
+ DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%"UVxf" 2nv(%g)\n",
+ PTR2UV(sv), SvNVX(sv)));
#endif
if (SvNVX(sv) < (NV)IV_MAX + 0.5)
SvIVX(sv) = I_V(SvNVX(sv));
else {
dTHR;
if (ckWARN(WARN_UNINITIALIZED) && !PL_localizing && !(SvFLAGS(sv) & SVs_PADTMP))
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
if (SvTYPE(sv) < SVt_IV)
/* Typically the caller expects that sv_any is not NULL now. */
sv_upgrade(sv, SVt_IV);
return 0;
}
- DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%lx 2iv(%ld)\n",
- (unsigned long)sv,(long)SvIVX(sv)));
+ DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%"UVxf" 2iv(%"IVdf")\n",
+ PTR2UV(sv),SvIVX(sv)));
return SvIsUV(sv) ? (IV)SvUVX(sv) : SvIVX(sv);
}
if (!(SvFLAGS(sv) & SVs_PADTMP)) {
dTHR;
if (ckWARN(WARN_UNINITIALIZED) && !PL_localizing)
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
}
return 0;
}
if (SvREADONLY(sv) && !SvOK(sv)) {
dTHR;
if (ckWARN(WARN_UNINITIALIZED))
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
return 0;
}
}
else {
SvIVX(sv) = I_V(SvNVX(sv));
ret_zero:
-#ifdef IV_IS_QUAD
DEBUG_c(PerlIO_printf(Perl_debug_log,
- "0x%" PERL_PRIx64 " 2uv(%" PERL_PRId64 " => %" PERL_PRIu64 ") (as signed)\n",
- (unsigned long)sv,(long)SvIVX(sv),
- (long)(UV)SvIVX(sv)));
-#else
- DEBUG_c(PerlIO_printf(Perl_debug_log,
- "0x%lx 2uv(%ld => %lu) (as signed)\n",
- (unsigned long)sv,(long)SvIVX(sv),
- (long)(UV)SvIVX(sv)));
-#endif
+ "0x%"UVxf" 2uv(%"IVdf" => %"IVdf") (as signed)\n",
+ PTR2UV(sv),
+ SvIVX(sv),
+ (IV)(UV)SvIVX(sv)));
return (UV)SvIVX(sv);
}
}
(void)SvNOK_on(sv);
(void)SvIOK_on(sv);
#if defined(USE_LONG_DOUBLE)
- DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%lx 2nv(%" PERL_PRIgldbl ")\n",
- (unsigned long)sv, SvNVX(sv)));
+ DEBUG_c(PerlIO_printf(Perl_debug_log,
+ "0x%"UVxf" 2nv(%" PERL_PRIgldbl ")\n",
+ PTR2UV(sv), SvNVX(sv)));
#else
- DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%lx 2nv(%g)\n",
- (unsigned long)sv, SvNVX(sv)));
+ DEBUG_c(PerlIO_printf(Perl_debug_log,
+ "0x%"UVxf" 2nv(%g)\n",
+ PTR2UV(sv), SvNVX(sv)));
#endif
if (SvNVX(sv) < -0.5) {
SvIVX(sv) = I_V(SvNVX(sv));
if (!(SvFLAGS(sv) & SVs_PADTMP)) {
dTHR;
if (ckWARN(WARN_UNINITIALIZED) && !PL_localizing)
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
}
if (SvTYPE(sv) < SVt_IV)
/* Typically the caller expects that sv_any is not NULL now. */
return 0;
}
- DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%lx 2uv(%lu)\n",
- (unsigned long)sv,SvUVX(sv)));
+ DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%"UVxf" 2uv(%"UVuf")\n",
+ PTR2UV(sv),SvUVX(sv)));
return SvIsUV(sv) ? SvUVX(sv) : (UV)SvIVX(sv);
}
if (!(SvFLAGS(sv) & SVs_PADTMP)) {
dTHR;
if (ckWARN(WARN_UNINITIALIZED) && !PL_localizing)
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
}
return 0;
}
if (SvREADONLY(sv) && !SvOK(sv)) {
dTHR;
if (ckWARN(WARN_UNINITIALIZED))
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
return 0.0;
}
}
#if defined(USE_LONG_DOUBLE)
DEBUG_c({
RESTORE_NUMERIC_STANDARD();
- PerlIO_printf(Perl_debug_log, "0x%lx num(%" PERL_PRIgldbl ")\n",
- (unsigned long)sv, SvNVX(sv));
+ PerlIO_printf(Perl_debug_log,
+ "0x%"UVxf" num(%" PERL_PRIgldbl ")\n",
+ PTR2UV(sv), SvNVX(sv));
RESTORE_NUMERIC_LOCAL();
});
#else
DEBUG_c({
RESTORE_NUMERIC_STANDARD();
- PerlIO_printf(Perl_debug_log, "0x%lx num(%g)\n",
- (unsigned long)sv, SvNVX(sv));
+ PerlIO_printf(Perl_debug_log, "0x%"UVxf" num(%g)\n",
+ PTR2UV(sv), SvNVX(sv));
RESTORE_NUMERIC_LOCAL();
});
#endif
else {
dTHR;
if (ckWARN(WARN_UNINITIALIZED) && !PL_localizing && !(SvFLAGS(sv) & SVs_PADTMP))
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
if (SvTYPE(sv) < SVt_NV)
/* Typically the caller expects that sv_any is not NULL now. */
sv_upgrade(sv, SVt_NV);
#if defined(USE_LONG_DOUBLE)
DEBUG_c({
RESTORE_NUMERIC_STANDARD();
- PerlIO_printf(Perl_debug_log, "0x%lx 2nv(%" PERL_PRIgldbl ")\n",
- (unsigned long)sv, SvNVX(sv));
+ PerlIO_printf(Perl_debug_log, "0x%"UVxf" 2nv(%" PERL_PRIgldbl ")\n",
+ PTR2UV(sv), SvNVX(sv));
RESTORE_NUMERIC_LOCAL();
});
#else
DEBUG_c({
RESTORE_NUMERIC_STANDARD();
- PerlIO_printf(Perl_debug_log, "0x%lx 1nv(%g)\n",
- (unsigned long)sv, SvNVX(sv));
+ PerlIO_printf(Perl_debug_log, "0x%"UVxf" 1nv(%g)\n",
+ PTR2UV(sv), SvNVX(sv));
RESTORE_NUMERIC_LOCAL();
});
#endif
return SvPVX(sv);
}
if (SvIOKp(sv)) {
-#ifdef IV_IS_QUAD
if (SvIsUV(sv))
- (void)sprintf(tmpbuf,"%" PERL_PRIu64,(UV)SvUVX(sv));
+ (void)sprintf(tmpbuf,"%"UVuf, (UV)SvUVX(sv));
else
- (void)sprintf(tmpbuf,"%" PERL_PRId64,(IV)SvIVX(sv));
-#else
- if (SvIsUV(sv))
- (void)sprintf(tmpbuf,"%lu",(unsigned long)SvUVX(sv));
- else
- (void)sprintf(tmpbuf,"%ld",(long)SvIVX(sv));
-#endif
+ (void)sprintf(tmpbuf,"%"IVdf, (IV)SvIVX(sv));
tsv = Nullsv;
goto tokensave;
}
if (!(SvFLAGS(sv) & SVs_PADTMP)) {
dTHR;
if (ckWARN(WARN_UNINITIALIZED) && !PL_localizing)
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
}
*lp = 0;
return "";
Perl_sv_setpvf(aTHX_ tsv, "%s=%s", HvNAME(SvSTASH(sv)), s);
else
sv_setpv(tsv, s);
-#ifdef IV_IS_QUAD
- Perl_sv_catpvf(aTHX_ tsv, "(0x%" PERL_PRIx64")", PTR2UV(sv));
-#else
- Perl_sv_catpvf(aTHX_ tsv, "(0x%lx)", (unsigned long)sv);
-#endif
+ Perl_sv_catpvf(aTHX_ tsv, "(0x%"UVxf")", PTR2UV(sv));
goto tokensaveref;
}
*lp = strlen(s);
if (SvREADONLY(sv) && !SvOK(sv)) {
dTHR;
if (ckWARN(WARN_UNINITIALIZED))
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
*lp = 0;
return "";
}
if (ckWARN(WARN_UNINITIALIZED)
&& !PL_localizing && !(SvFLAGS(sv) & SVs_PADTMP))
{
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
}
*lp = 0;
if (SvTYPE(sv) < SVt_PV)
*lp = s - SvPVX(sv);
SvCUR_set(sv, *lp);
SvPOK_on(sv);
- DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%lx 2pv(%s)\n",
- (unsigned long)sv,SvPVX(sv)));
+ DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%"UVxf" 2pv(%s)\n",
+ PTR2UV(sv),SvPVX(sv)));
return SvPVX(sv);
tokensave:
}
}
+char *
+Perl_sv_2pvbyte_nolen(pTHX_ register SV *sv)
+{
+ return sv_2pv_nolen(sv);
+}
+
+char *
+Perl_sv_2pvbyte(pTHX_ register SV *sv, STRLEN *lp)
+{
+ return sv_2pv(sv,lp);
+}
+
+char *
+Perl_sv_2pvutf8_nolen(pTHX_ register SV *sv)
+{
+ return sv_2pv_nolen(sv);
+}
+
+char *
+Perl_sv_2pvutf8(pTHX_ register SV *sv, STRLEN *lp)
+{
+ return sv_2pv(sv,lp);
+}
+
/* This function is only called on magical items */
bool
Perl_sv_2bool(pTHX_ register SV *sv)
SvTYPE(SvRV(sstr)) == SVt_PVGV) {
sstr = SvRV(sstr);
if (sstr == dstr) {
- if (PL_curcop->cop_stash != GvSTASH(dstr))
+ if (GvIMPORTED(dstr) != GVf_IMPORTED
+ && CopSTASH_ne(PL_curcop, GvSTASH(dstr)))
+ {
GvIMPORTED_on(dstr);
+ }
GvMULTI_on(dstr);
return;
}
gp_free((GV*)dstr);
GvGP(dstr) = gp_ref(GvGP(sstr));
SvTAINT(dstr);
- if (PL_curcop->cop_stash != GvSTASH(dstr))
+ if (GvIMPORTED(dstr) != GVf_IMPORTED
+ && CopSTASH_ne(PL_curcop, GvSTASH(dstr)))
+ {
GvIMPORTED_on(dstr);
+ }
GvMULTI_on(dstr);
return;
}
if (intro) {
GP *gp;
- GvGP(dstr)->gp_refcnt--;
+ gp_free((GV*)dstr);
GvINTRO_off(dstr); /* one-shot flag */
Newz(602,gp, 1, GP);
GvGP(dstr) = gp_ref(gp);
GvSV(dstr) = NEWSV(72,0);
- GvLINE(dstr) = PL_curcop->cop_line;
+ GvLINE(dstr) = CopLINE(PL_curcop);
GvEGV(dstr) = (GV*)dstr;
}
GvMULTI_on(dstr);
else
dref = (SV*)GvAV(dstr);
GvAV(dstr) = (AV*)sref;
- if (PL_curcop->cop_stash != GvSTASH(dstr))
+ if (GvIMPORTED_AV_off(dstr)
+ && CopSTASH_ne(PL_curcop, GvSTASH(dstr)))
+ {
GvIMPORTED_AV_on(dstr);
+ }
break;
case SVt_PVHV:
if (intro)
else
dref = (SV*)GvHV(dstr);
GvHV(dstr) = (HV*)sref;
- if (PL_curcop->cop_stash != GvSTASH(dstr))
+ if (GvIMPORTED_HV_off(dstr)
+ && CopSTASH_ne(PL_curcop, GvSTASH(dstr)))
+ {
GvIMPORTED_HV_on(dstr);
+ }
break;
case SVt_PVCV:
if (intro) {
GvASSUMECV_on(dstr);
PL_sub_generation++;
}
- if (PL_curcop->cop_stash != GvSTASH(dstr))
+ if (GvIMPORTED_CV_off(dstr)
+ && CopSTASH_ne(PL_curcop, GvSTASH(dstr)))
+ {
GvIMPORTED_CV_on(dstr);
+ }
break;
case SVt_PVIO:
if (intro)
else
dref = (SV*)GvSV(dstr);
GvSV(dstr) = sref;
- if (PL_curcop->cop_stash != GvSTASH(dstr))
+ if (GvIMPORTED_SV_off(dstr)
+ && CopSTASH_ne(PL_curcop, GvSTASH(dstr)))
+ {
GvIMPORTED_SV_on(dstr);
+ }
break;
}
if (dref)
*SvEND(dstr) = '\0';
(void)SvPOK_only(dstr);
}
+ if (SvUTF8(sstr))
+ SvUTF8_on(dstr);
/*SUPPRESS 560*/
if (sflags & SVp_NOK) {
SvNOK_on(dstr);
if (mg->mg_type == type) {
MGVTBL* vtbl = mg->mg_virtual;
*mgp = mg->mg_moremagic;
- if (vtbl && (vtbl->svt_free != NULL))
+ if (vtbl && vtbl->svt_free)
CALL_FPTR(vtbl->svt_free)(aTHX_ sv, mg);
if (mg->mg_ptr && mg->mg_type != 'g')
if (mg->mg_len >= 0)
SvCUR_set(bigstr, offset+len);
}
+ SvTAINT(bigstr);
i = littlelen - len;
if (i > 0) { /* string might grow */
big = SvGROW(bigstr, SvCUR(bigstr) + i + 1);
{
io_close((IO*)sv, FALSE);
}
- if (IoDIRP(sv)) {
+ if (IoDIRP(sv) && !(IoFLAGS(sv) & IOf_FAKE_DIRP))
PerlDir_close(IoDIRP(sv));
- IoDIRP(sv) = 0;
- }
+ IoDIRP(sv) = (DIR*)NULL;
Safefree(IoTOP_NAME(sv));
Safefree(IoFMT_NAME(sv));
Safefree(IoBOTTOM_NAME(sv));
if (SvTEMP(sv)) {
if (ckWARN_d(WARN_DEBUGGING))
Perl_warner(aTHX_ WARN_DEBUGGING,
- "Attempt to free temp prematurely: SV 0x%lx", (unsigned long)sv);
+ "Attempt to free temp prematurely: SV 0x%"UVxf,
+ PTR2UV(sv));
return;
}
#endif
bp = (STDCHAR*)SvPVX(sv) + append; /* move these two too to registers */
ptr = (STDCHAR*)PerlIO_get_ptr(fp);
DEBUG_P(PerlIO_printf(Perl_debug_log,
- "Screamer: entering, ptr=%ld, cnt=%ld\n",(long)ptr,(long)cnt));
+ "Screamer: entering, ptr=%"UVuf", cnt=%ld\n",PTR2UV(ptr),(long)cnt));
DEBUG_P(PerlIO_printf(Perl_debug_log,
- "Screamer: entering: FILE * thinks ptr=%ld, cnt=%ld, base=%ld\n",
- (long)PerlIO_get_ptr(fp), (long)PerlIO_get_cnt(fp),
- (long)(PerlIO_has_base(fp) ? PerlIO_get_base(fp) : 0)));
+ "Screamer: entering: FILE * thinks ptr=%"UVuf", cnt=%ld, base=%"UVuf"\n",
+ PTR2UV(PerlIO_get_ptr(fp)), (long)PerlIO_get_cnt(fp),
+ PTR2UV(PerlIO_has_base(fp) ? PerlIO_get_base(fp) : 0)));
for (;;) {
screamer:
if (cnt > 0) {
}
DEBUG_P(PerlIO_printf(Perl_debug_log,
- "Screamer: going to getc, ptr=%ld, cnt=%ld\n",(long)ptr,(long)cnt));
+ "Screamer: going to getc, ptr=%"UVuf", cnt=%ld\n",
+ PTR2UV(ptr),(long)cnt));
PerlIO_set_ptrcnt(fp, ptr, cnt); /* deregisterize cnt and ptr */
DEBUG_P(PerlIO_printf(Perl_debug_log,
- "Screamer: pre: FILE * thinks ptr=%ld, cnt=%ld, base=%ld\n",
- (long)PerlIO_get_ptr(fp), (long)PerlIO_get_cnt(fp),
- (long)(PerlIO_has_base (fp) ? PerlIO_get_base(fp) : 0)));
+ "Screamer: pre: FILE * thinks ptr=%"UVuf", cnt=%ld, base=%"UVuf"\n",
+ PTR2UV(PerlIO_get_ptr(fp)), (long)PerlIO_get_cnt(fp),
+ PTR2UV(PerlIO_has_base (fp) ? PerlIO_get_base(fp) : 0)));
/* This used to call 'filbuf' in stdio form, but as that behaves like
getc when cnt <= 0 we use PerlIO_getc here to avoid introducing
another abstraction. */
i = PerlIO_getc(fp); /* get more characters */
DEBUG_P(PerlIO_printf(Perl_debug_log,
- "Screamer: post: FILE * thinks ptr=%ld, cnt=%ld, base=%ld\n",
- (long)PerlIO_get_ptr(fp), (long)PerlIO_get_cnt(fp),
- (long)(PerlIO_has_base (fp) ? PerlIO_get_base(fp) : 0)));
+ "Screamer: post: FILE * thinks ptr=%"UVuf", cnt=%ld, base=%"UVuf"\n",
+ PTR2UV(PerlIO_get_ptr(fp)), (long)PerlIO_get_cnt(fp),
+ PTR2UV(PerlIO_has_base (fp) ? PerlIO_get_base(fp) : 0)));
cnt = PerlIO_get_cnt(fp);
ptr = (STDCHAR*)PerlIO_get_ptr(fp); /* reregisterize cnt and ptr */
DEBUG_P(PerlIO_printf(Perl_debug_log,
- "Screamer: after getc, ptr=%ld, cnt=%ld\n",(long)ptr,(long)cnt));
+ "Screamer: after getc, ptr=%"UVuf", cnt=%ld\n",PTR2UV(ptr),(long)cnt));
if (i == EOF) /* all done for ever? */
goto thats_really_all_folks;
if (shortbuffered)
cnt += shortbuffered;
DEBUG_P(PerlIO_printf(Perl_debug_log,
- "Screamer: quitting, ptr=%ld, cnt=%ld\n",(long)ptr,(long)cnt));
+ "Screamer: quitting, ptr=%"UVuf", cnt=%ld\n",PTR2UV(ptr),(long)cnt));
PerlIO_set_ptrcnt(fp, ptr, cnt); /* put these back or we're in trouble */
DEBUG_P(PerlIO_printf(Perl_debug_log,
- "Screamer: end: FILE * thinks ptr=%ld, cnt=%ld, base=%ld\n",
- (long)PerlIO_get_ptr(fp), (long)PerlIO_get_cnt(fp),
- (long)(PerlIO_has_base (fp) ? PerlIO_get_base(fp) : 0)));
+ "Screamer: end: FILE * thinks ptr=%"UVuf", cnt=%ld, base=%"UVuf"\n",
+ PTR2UV(PerlIO_get_ptr(fp)), (long)PerlIO_get_cnt(fp),
+ PTR2UV(PerlIO_has_base (fp) ? PerlIO_get_base(fp) : 0)));
*bp = '\0';
SvCUR_set(sv, bp - (STDCHAR*)SvPVX(sv)); /* set length */
DEBUG_P(PerlIO_printf(Perl_debug_log,
}
}
-#ifdef WIN32
- win32_strip_return(sv);
-#endif
-
return (SvCUR(sv) - append) ? SvPVX(sv) : Nullch;
}
if (!SvPOK(sv)) {
SvPOK_on(sv); /* validate pointer */
SvTAINT(sv);
- DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%lx 2pv(%s)\n",
- (unsigned long)sv,SvPVX(sv)));
+ DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%"UVxf" 2pv(%s)\n",
+ PTR2UV(sv),SvPVX(sv)));
}
}
return SvPVX(sv);
}
char *
+Perl_sv_pvbyte(pTHX_ SV *sv)
+{
+ return sv_pv(sv);
+}
+
+char *
+Perl_sv_pvbyten(pTHX_ SV *sv, STRLEN *lp)
+{
+ return sv_pvn(sv,lp);
+}
+
+char *
+Perl_sv_pvbyten_force(pTHX_ SV *sv, STRLEN *lp)
+{
+ return sv_pvn_force(sv,lp);
+}
+
+char *
+Perl_sv_pvutf8(pTHX_ SV *sv)
+{
+ return sv_pv(sv);
+}
+
+char *
+Perl_sv_pvutf8n(pTHX_ SV *sv, STRLEN *lp)
+{
+ return sv_pvn(sv,lp);
+}
+
+char *
+Perl_sv_pvutf8n_force(pTHX_ SV *sv, STRLEN *lp)
+{
+ return sv_pvn_force(sv,lp);
+}
+
+char *
Perl_sv_reftype(pTHX_ SV *sv, int ob)
{
if (ob && SvOBJECT(sv))
/* SIZE */
switch (*q) {
+#ifdef HAS_QUAD
+ case 'L': /* Ld */
+ case 'q': /* qd */
+ intsize = 'q';
+ q++;
+ break;
+#endif
case 'l':
#ifdef HAS_QUAD
if (*(q + 1) == 'l') { /* lld */
q += 2;
break;
}
- case 'L': /* Ld */
- case 'q': /* qd */
- intsize = 'q';
- q++;
- break;
#endif
+ /* FALL THROUGH */
case 'h':
/* FALL THROUGH */
case 'V':
if (args) {
eptr = va_arg(*args, char*);
if (eptr)
+#ifdef MACOS_TRADITIONAL
+ /* On MacOS, %#s format is used for Pascal strings */
+ if (alt)
+ elen = *eptr++;
+ else
+#endif
elen = strlen(eptr);
else {
eptr = nullstr;
case 16:
if (!uv)
alt = FALSE;
- p = (c == 'X') ? "0123456789ABCDEF" : "0123456789abcdef";
+ p = (char*)((c == 'X')
+ ? "0123456789ABCDEF" : "0123456789abcdef");
do {
dig = uv & 15;
*--eptr = p[dig];
eptr = PL_efloatbuf;
elen = strlen(PL_efloatbuf);
-
-#ifdef USE_LOCALE_NUMERIC
- /*
- * User-defined locales may include arbitrary characters.
- * And, unfortunately, some (broken) systems may allow the
- * "C" locale to be overridden by a malicious user.
- * XXX This is an extreme way to cope with broken systems.
- */
- if (maybe_tainted && PL_tainting) {
- /* safe if it matches /[-+]?\d*(\.\d*)?([eE][-+]?\d*)?/ */
- if (*eptr == '-' || *eptr == '+')
- ++eptr;
- while (isDIGIT(*eptr))
- ++eptr;
- if (*eptr == '.') {
- ++eptr;
- while (isDIGIT(*eptr))
- ++eptr;
- }
- if (*eptr == 'e' || *eptr == 'E') {
- ++eptr;
- if (*eptr == '-' || *eptr == '+')
- ++eptr;
- while (isDIGIT(*eptr))
- ++eptr;
- }
- if (*eptr)
- *maybe_tainted = TRUE; /* results are suspect */
- eptr = PL_efloatbuf;
- }
-#endif /* USE_LOCALE_NUMERIC */
-
break;
/* SPECIAL */
Perl_sv_setpvf(aTHX_ msg, "Invalid conversion in %s: ",
(PL_op->op_type == OP_PRTF) ? "printf" : "sprintf");
if (c) {
-#ifdef UV_IS_QUAD
if (isPRINT(c))
Perl_sv_catpvf(aTHX_ msg,
"\"%%%c\"", c & 0xFF);
else
Perl_sv_catpvf(aTHX_ msg,
- "\"%%\\%03" PERL_PRIo64 "\"",
+ "\"%%\\%03"UVof"\"",
(UV)c & 0xFF);
-#else
- Perl_sv_catpvf(aTHX_ msg, isPRINT(c) ?
- "\"%%%c\"" : "\"%%\\%03o\"",
- c & 0xFF);
-#endif
} else
sv_catpv(msg, "end of string");
Perl_warner(aTHX_ WARN_PRINTF, "%_", msg); /* yes, this is reentrant */
}
}
+#if defined(USE_ITHREADS)
+
+#if defined(USE_THREADS)
+# include "error: USE_THREADS and USE_ITHREADS are incompatible"
+#endif
+
+#ifndef OpREFCNT_inc
+# define OpREFCNT_inc(o) ((o) ? (++(o)->op_targ, (o)) : Nullop)
+#endif
+
+#ifndef GpREFCNT_inc
+# define GpREFCNT_inc(gp) ((gp) ? (++(gp)->gp_refcnt, (gp)) : (GP*)NULL)
+#endif
+
+
+#define sv_dup_inc(s) SvREFCNT_inc(sv_dup(s))
+#define av_dup(s) (AV*)sv_dup((SV*)s)
+#define av_dup_inc(s) (AV*)SvREFCNT_inc(sv_dup((SV*)s))
+#define hv_dup(s) (HV*)sv_dup((SV*)s)
+#define hv_dup_inc(s) (HV*)SvREFCNT_inc(sv_dup((SV*)s))
+#define cv_dup(s) (CV*)sv_dup((SV*)s)
+#define cv_dup_inc(s) (CV*)SvREFCNT_inc(sv_dup((SV*)s))
+#define io_dup(s) (IO*)sv_dup((SV*)s)
+#define io_dup_inc(s) (IO*)SvREFCNT_inc(sv_dup((SV*)s))
+#define gv_dup(s) (GV*)sv_dup((SV*)s)
+#define gv_dup_inc(s) (GV*)SvREFCNT_inc(sv_dup((SV*)s))
+#define SAVEPV(p) (p ? savepv(p) : Nullch)
+#define SAVEPVN(p,n) (p ? savepvn(p,n) : Nullch)
+
+REGEXP *
+Perl_re_dup(pTHX_ REGEXP *r)
+{
+ /* XXX fix when pmop->op_pmregexp becomes shared */
+ return ReREFCNT_inc(r);
+}
+
+PerlIO *
+Perl_fp_dup(pTHX_ PerlIO *fp, char type)
+{
+ PerlIO *ret;
+ if (!fp)
+ return (PerlIO*)NULL;
+
+ /* look for it in the table first */
+ ret = (PerlIO*)ptr_table_fetch(PL_ptr_table, fp);
+ if (ret)
+ return ret;
+
+ /* create anew and remember what it is */
+ ret = PerlIO_fdupopen(fp);
+ ptr_table_store(PL_ptr_table, fp, ret);
+ return ret;
+}
+
+DIR *
+Perl_dirp_dup(pTHX_ DIR *dp)
+{
+ if (!dp)
+ return (DIR*)NULL;
+ /* XXX TODO */
+ return dp;
+}
+
+GP *
+Perl_gp_dup(pTHX_ GP *gp)
+{
+ GP *ret;
+ if (!gp)
+ return (GP*)NULL;
+ /* look for it in the table first */
+ ret = (GP*)ptr_table_fetch(PL_ptr_table, gp);
+ if (ret)
+ return ret;
+
+ /* create anew and remember what it is */
+ Newz(0, ret, 1, GP);
+ ptr_table_store(PL_ptr_table, gp, ret);
+
+ /* clone */
+ ret->gp_refcnt = 0; /* must be before any other dups! */
+ ret->gp_sv = sv_dup_inc(gp->gp_sv);
+ ret->gp_io = io_dup_inc(gp->gp_io);
+ ret->gp_form = cv_dup_inc(gp->gp_form);
+ ret->gp_av = av_dup_inc(gp->gp_av);
+ ret->gp_hv = hv_dup_inc(gp->gp_hv);
+ ret->gp_egv = gv_dup(gp->gp_egv); /* GvEGV is not refcounted */
+ ret->gp_cv = cv_dup_inc(gp->gp_cv);
+ ret->gp_cvgen = gp->gp_cvgen;
+ ret->gp_flags = gp->gp_flags;
+ ret->gp_line = gp->gp_line;
+ ret->gp_file = gp->gp_file; /* points to COP.cop_file */
+ return ret;
+}
+
+MAGIC *
+Perl_mg_dup(pTHX_ MAGIC *mg)
+{
+ MAGIC *mgret = (MAGIC*)NULL;
+ MAGIC *mgprev;
+ if (!mg)
+ return (MAGIC*)NULL;
+ /* look for it in the table first */
+ mgret = (MAGIC*)ptr_table_fetch(PL_ptr_table, mg);
+ if (mgret)
+ return mgret;
+
+ for (; mg; mg = mg->mg_moremagic) {
+ MAGIC *nmg;
+ Newz(0, nmg, 1, MAGIC);
+ if (!mgret)
+ mgret = nmg;
+ else
+ mgprev->mg_moremagic = nmg;
+ nmg->mg_virtual = mg->mg_virtual; /* XXX copy dynamic vtable? */
+ nmg->mg_private = mg->mg_private;
+ nmg->mg_type = mg->mg_type;
+ nmg->mg_flags = mg->mg_flags;
+ if (mg->mg_type == 'r') {
+ nmg->mg_obj = (SV*)re_dup((REGEXP*)mg->mg_obj);
+ }
+ else {
+ nmg->mg_obj = (mg->mg_flags & MGf_REFCOUNTED)
+ ? sv_dup_inc(mg->mg_obj)
+ : sv_dup(mg->mg_obj);
+ }
+ nmg->mg_len = mg->mg_len;
+ nmg->mg_ptr = mg->mg_ptr; /* XXX random ptr? */
+ if (mg->mg_ptr && mg->mg_type != 'g') {
+ if (mg->mg_len >= 0) {
+ nmg->mg_ptr = SAVEPVN(mg->mg_ptr, mg->mg_len);
+ if (mg->mg_type == 'c' && AMT_AMAGIC((AMT*)mg->mg_ptr)) {
+ AMT *amtp = (AMT*)mg->mg_ptr;
+ AMT *namtp = (AMT*)nmg->mg_ptr;
+ I32 i;
+ for (i = 1; i < NofAMmeth; i++) {
+ namtp->table[i] = cv_dup_inc(amtp->table[i]);
+ }
+ }
+ }
+ else if (mg->mg_len == HEf_SVKEY)
+ nmg->mg_ptr = (char*)sv_dup_inc((SV*)mg->mg_ptr);
+ }
+ mgprev = nmg;
+ }
+ return mgret;
+}
+
+PTR_TBL_t *
+Perl_ptr_table_new(pTHX)
+{
+ PTR_TBL_t *tbl;
+ Newz(0, tbl, 1, PTR_TBL_t);
+ tbl->tbl_max = 511;
+ tbl->tbl_items = 0;
+ Newz(0, tbl->tbl_ary, tbl->tbl_max + 1, PTR_TBL_ENT_t*);
+ return tbl;
+}
+
+void *
+Perl_ptr_table_fetch(pTHX_ PTR_TBL_t *tbl, void *sv)
+{
+ PTR_TBL_ENT_t *tblent;
+ UV hash = (UV)sv;
+ assert(tbl);
+ tblent = tbl->tbl_ary[hash & tbl->tbl_max];
+ for (; tblent; tblent = tblent->next) {
+ if (tblent->oldval == sv)
+ return tblent->newval;
+ }
+ return (void*)NULL;
+}
+
+void
+Perl_ptr_table_store(pTHX_ PTR_TBL_t *tbl, void *oldv, void *newv)
+{
+ PTR_TBL_ENT_t *tblent, **otblent;
+ /* XXX this may be pessimal on platforms where pointers aren't good
+ * hash values e.g. if they grow faster in the most significant
+ * bits */
+ UV hash = (UV)oldv;
+ bool i = 1;
+
+ assert(tbl);
+ otblent = &tbl->tbl_ary[hash & tbl->tbl_max];
+ for (tblent = *otblent; tblent; i=0, tblent = tblent->next) {
+ if (tblent->oldval == oldv) {
+ tblent->newval = newv;
+ tbl->tbl_items++;
+ return;
+ }
+ }
+ Newz(0, tblent, 1, PTR_TBL_ENT_t);
+ tblent->oldval = oldv;
+ tblent->newval = newv;
+ tblent->next = *otblent;
+ *otblent = tblent;
+ tbl->tbl_items++;
+ if (i && tbl->tbl_items > tbl->tbl_max)
+ ptr_table_split(tbl);
+}
+
+void
+Perl_ptr_table_split(pTHX_ PTR_TBL_t *tbl)
+{
+ PTR_TBL_ENT_t **ary = tbl->tbl_ary;
+ UV oldsize = tbl->tbl_max + 1;
+ UV newsize = oldsize * 2;
+ UV i;
+
+ Renew(ary, newsize, PTR_TBL_ENT_t*);
+ Zero(&ary[oldsize], newsize-oldsize, PTR_TBL_ENT_t*);
+ tbl->tbl_max = --newsize;
+ tbl->tbl_ary = ary;
+ for (i=0; i < oldsize; i++, ary++) {
+ PTR_TBL_ENT_t **curentp, **entp, *ent;
+ if (!*ary)
+ continue;
+ curentp = ary + oldsize;
+ for (entp = ary, ent = *ary; ent; ent = *entp) {
+ if ((newsize & (UV)ent->oldval) != i) {
+ *entp = ent->next;
+ ent->next = *curentp;
+ *curentp = ent;
+ continue;
+ }
+ else
+ entp = &ent->next;
+ }
+ }
+}
+
+#ifdef DEBUGGING
+char *PL_watch_pvx;
+#endif
+
+SV *
+Perl_sv_dup(pTHX_ SV *sstr)
+{
+ U32 sflags;
+ int dtype;
+ int stype;
+ SV *dstr;
+
+ if (!sstr || SvTYPE(sstr) == SVTYPEMASK)
+ return Nullsv;
+ /* look for it in the table first */
+ dstr = (SV*)ptr_table_fetch(PL_ptr_table, sstr);
+ if (dstr)
+ return dstr;
+
+ /* create anew and remember what it is */
+ new_SV(dstr);
+ ptr_table_store(PL_ptr_table, sstr, dstr);
+
+ /* clone */
+ SvFLAGS(dstr) = SvFLAGS(sstr);
+ SvFLAGS(dstr) &= ~SVf_OOK; /* don't propagate OOK hack */
+ SvREFCNT(dstr) = 0; /* must be before any other dups! */
+
+#ifdef DEBUGGING
+ if (SvANY(sstr) && PL_watch_pvx && SvPVX(sstr) == PL_watch_pvx)
+ PerlIO_printf(Perl_debug_log, "watch at %p hit, found string \"%s\"\n",
+ PL_watch_pvx, SvPVX(sstr));
+#endif
+
+ switch (SvTYPE(sstr)) {
+ case SVt_NULL:
+ SvANY(dstr) = NULL;
+ break;
+ case SVt_IV:
+ SvANY(dstr) = new_XIV();
+ SvIVX(dstr) = SvIVX(sstr);
+ break;
+ case SVt_NV:
+ SvANY(dstr) = new_XNV();
+ SvNVX(dstr) = SvNVX(sstr);
+ break;
+ case SVt_RV:
+ SvANY(dstr) = new_XRV();
+ SvRV(dstr) = sv_dup_inc(SvRV(sstr));
+ break;
+ case SVt_PV:
+ SvANY(dstr) = new_XPV();
+ SvCUR(dstr) = SvCUR(sstr);
+ SvLEN(dstr) = SvLEN(sstr);
+ if (SvROK(sstr))
+ SvRV(dstr) = sv_dup_inc(SvRV(sstr));
+ else if (SvPVX(sstr) && SvLEN(sstr))
+ SvPVX(dstr) = SAVEPVN(SvPVX(sstr), SvLEN(sstr)-1);
+ else
+ SvPVX(dstr) = SvPVX(sstr); /* XXX shared string/random ptr? */
+ break;
+ case SVt_PVIV:
+ SvANY(dstr) = new_XPVIV();
+ SvCUR(dstr) = SvCUR(sstr);
+ SvLEN(dstr) = SvLEN(sstr);
+ SvIVX(dstr) = SvIVX(sstr);
+ if (SvROK(sstr))
+ SvRV(dstr) = sv_dup_inc(SvRV(sstr));
+ else if (SvPVX(sstr) && SvLEN(sstr))
+ SvPVX(dstr) = SAVEPVN(SvPVX(sstr), SvLEN(sstr)-1);
+ else
+ SvPVX(dstr) = SvPVX(sstr); /* XXX shared string/random ptr? */
+ break;
+ case SVt_PVNV:
+ SvANY(dstr) = new_XPVNV();
+ SvCUR(dstr) = SvCUR(sstr);
+ SvLEN(dstr) = SvLEN(sstr);
+ SvIVX(dstr) = SvIVX(sstr);
+ SvNVX(dstr) = SvNVX(sstr);
+ if (SvROK(sstr))
+ SvRV(dstr) = sv_dup_inc(SvRV(sstr));
+ else if (SvPVX(sstr) && SvLEN(sstr))
+ SvPVX(dstr) = SAVEPVN(SvPVX(sstr), SvLEN(sstr)-1);
+ else
+ SvPVX(dstr) = SvPVX(sstr); /* XXX shared string/random ptr? */
+ break;
+ case SVt_PVMG:
+ SvANY(dstr) = new_XPVMG();
+ SvCUR(dstr) = SvCUR(sstr);
+ SvLEN(dstr) = SvLEN(sstr);
+ SvIVX(dstr) = SvIVX(sstr);
+ SvNVX(dstr) = SvNVX(sstr);
+ SvMAGIC(dstr) = mg_dup(SvMAGIC(sstr));
+ SvSTASH(dstr) = hv_dup_inc(SvSTASH(sstr));
+ if (SvROK(sstr))
+ SvRV(dstr) = sv_dup_inc(SvRV(sstr));
+ else if (SvPVX(sstr) && SvLEN(sstr))
+ SvPVX(dstr) = SAVEPVN(SvPVX(sstr), SvLEN(sstr)-1);
+ else
+ SvPVX(dstr) = SvPVX(sstr); /* XXX shared string/random ptr? */
+ break;
+ case SVt_PVBM:
+ SvANY(dstr) = new_XPVBM();
+ SvCUR(dstr) = SvCUR(sstr);
+ SvLEN(dstr) = SvLEN(sstr);
+ SvIVX(dstr) = SvIVX(sstr);
+ SvNVX(dstr) = SvNVX(sstr);
+ SvMAGIC(dstr) = mg_dup(SvMAGIC(sstr));
+ SvSTASH(dstr) = hv_dup_inc(SvSTASH(sstr));
+ if (SvROK(sstr))
+ SvRV(dstr) = sv_dup_inc(SvRV(sstr));
+ else if (SvPVX(sstr) && SvLEN(sstr))
+ SvPVX(dstr) = SAVEPVN(SvPVX(sstr), SvLEN(sstr)-1);
+ else
+ SvPVX(dstr) = SvPVX(sstr); /* XXX shared string/random ptr? */
+ BmRARE(dstr) = BmRARE(sstr);
+ BmUSEFUL(dstr) = BmUSEFUL(sstr);
+ BmPREVIOUS(dstr)= BmPREVIOUS(sstr);
+ break;
+ case SVt_PVLV:
+ SvANY(dstr) = new_XPVLV();
+ SvCUR(dstr) = SvCUR(sstr);
+ SvLEN(dstr) = SvLEN(sstr);
+ SvIVX(dstr) = SvIVX(sstr);
+ SvNVX(dstr) = SvNVX(sstr);
+ SvMAGIC(dstr) = mg_dup(SvMAGIC(sstr));
+ SvSTASH(dstr) = hv_dup_inc(SvSTASH(sstr));
+ if (SvROK(sstr))
+ SvRV(dstr) = sv_dup_inc(SvRV(sstr));
+ else if (SvPVX(sstr) && SvLEN(sstr))
+ SvPVX(dstr) = SAVEPVN(SvPVX(sstr), SvLEN(sstr)-1);
+ else
+ SvPVX(dstr) = SvPVX(sstr); /* XXX shared string/random ptr? */
+ LvTARGOFF(dstr) = LvTARGOFF(sstr); /* XXX sometimes holds PMOP* when DEBUGGING */
+ LvTARGLEN(dstr) = LvTARGLEN(sstr);
+ LvTARG(dstr) = sv_dup_inc(LvTARG(sstr));
+ LvTYPE(dstr) = LvTYPE(sstr);
+ break;
+ case SVt_PVGV:
+ SvANY(dstr) = new_XPVGV();
+ SvCUR(dstr) = SvCUR(sstr);
+ SvLEN(dstr) = SvLEN(sstr);
+ SvIVX(dstr) = SvIVX(sstr);
+ SvNVX(dstr) = SvNVX(sstr);
+ SvMAGIC(dstr) = mg_dup(SvMAGIC(sstr));
+ SvSTASH(dstr) = hv_dup_inc(SvSTASH(sstr));
+ if (SvROK(sstr))
+ SvRV(dstr) = sv_dup_inc(SvRV(sstr));
+ else if (SvPVX(sstr) && SvLEN(sstr))
+ SvPVX(dstr) = SAVEPVN(SvPVX(sstr), SvLEN(sstr)-1);
+ else
+ SvPVX(dstr) = SvPVX(sstr); /* XXX shared string/random ptr? */
+ GvNAMELEN(dstr) = GvNAMELEN(sstr);
+ GvNAME(dstr) = SAVEPVN(GvNAME(sstr), GvNAMELEN(sstr));
+ GvSTASH(dstr) = hv_dup_inc(GvSTASH(sstr));
+ GvFLAGS(dstr) = GvFLAGS(sstr);
+ GvGP(dstr) = gp_dup(GvGP(sstr));
+ (void)GpREFCNT_inc(GvGP(dstr));
+ break;
+ case SVt_PVIO:
+ SvANY(dstr) = new_XPVIO();
+ SvCUR(dstr) = SvCUR(sstr);
+ SvLEN(dstr) = SvLEN(sstr);
+ SvIVX(dstr) = SvIVX(sstr);
+ SvNVX(dstr) = SvNVX(sstr);
+ SvMAGIC(dstr) = mg_dup(SvMAGIC(sstr));
+ SvSTASH(dstr) = hv_dup_inc(SvSTASH(sstr));
+ if (SvROK(sstr))
+ SvRV(dstr) = sv_dup_inc(SvRV(sstr));
+ else if (SvPVX(sstr) && SvLEN(sstr))
+ SvPVX(dstr) = SAVEPVN(SvPVX(sstr), SvLEN(sstr)-1);
+ else
+ SvPVX(dstr) = SvPVX(sstr); /* XXX shared string/random ptr? */
+ IoIFP(dstr) = fp_dup(IoIFP(sstr), IoTYPE(sstr));
+ if (IoOFP(sstr) == IoIFP(sstr))
+ IoOFP(dstr) = IoIFP(dstr);
+ else
+ IoOFP(dstr) = fp_dup(IoOFP(sstr), IoTYPE(sstr));
+ /* PL_rsfp_filters entries have fake IoDIRP() */
+ if (IoDIRP(sstr) && !(IoFLAGS(sstr) & IOf_FAKE_DIRP))
+ IoDIRP(dstr) = dirp_dup(IoDIRP(sstr));
+ else
+ IoDIRP(dstr) = IoDIRP(sstr);
+ IoLINES(dstr) = IoLINES(sstr);
+ IoPAGE(dstr) = IoPAGE(sstr);
+ IoPAGE_LEN(dstr) = IoPAGE_LEN(sstr);
+ IoLINES_LEFT(dstr) = IoLINES_LEFT(sstr);
+ IoTOP_NAME(dstr) = SAVEPV(IoTOP_NAME(sstr));
+ IoTOP_GV(dstr) = gv_dup(IoTOP_GV(sstr));
+ IoFMT_NAME(dstr) = SAVEPV(IoFMT_NAME(sstr));
+ IoFMT_GV(dstr) = gv_dup(IoFMT_GV(sstr));
+ IoBOTTOM_NAME(dstr) = SAVEPV(IoBOTTOM_NAME(sstr));
+ IoBOTTOM_GV(dstr) = gv_dup(IoBOTTOM_GV(sstr));
+ IoSUBPROCESS(dstr) = IoSUBPROCESS(sstr);
+ IoTYPE(dstr) = IoTYPE(sstr);
+ IoFLAGS(dstr) = IoFLAGS(sstr);
+ break;
+ case SVt_PVAV:
+ SvANY(dstr) = new_XPVAV();
+ SvCUR(dstr) = SvCUR(sstr);
+ SvLEN(dstr) = SvLEN(sstr);
+ SvIVX(dstr) = SvIVX(sstr);
+ SvNVX(dstr) = SvNVX(sstr);
+ SvMAGIC(dstr) = mg_dup(SvMAGIC(sstr));
+ SvSTASH(dstr) = hv_dup_inc(SvSTASH(sstr));
+ AvARYLEN((AV*)dstr) = sv_dup_inc(AvARYLEN((AV*)sstr));
+ AvFLAGS((AV*)dstr) = AvFLAGS((AV*)sstr);
+ if (AvARRAY((AV*)sstr)) {
+ SV **dst_ary, **src_ary;
+ SSize_t items = AvFILLp((AV*)sstr) + 1;
+
+ src_ary = AvARRAY((AV*)sstr);
+ Newz(0, dst_ary, AvMAX((AV*)sstr)+1, SV*);
+ ptr_table_store(PL_ptr_table, src_ary, dst_ary);
+ SvPVX(dstr) = (char*)dst_ary;
+ AvALLOC((AV*)dstr) = dst_ary;
+ if (AvREAL((AV*)sstr)) {
+ while (items-- > 0)
+ *dst_ary++ = sv_dup_inc(*src_ary++);
+ }
+ else {
+ while (items-- > 0)
+ *dst_ary++ = sv_dup(*src_ary++);
+ }
+ items = AvMAX((AV*)sstr) - AvFILLp((AV*)sstr);
+ while (items-- > 0) {
+ *dst_ary++ = &PL_sv_undef;
+ }
+ }
+ else {
+ SvPVX(dstr) = Nullch;
+ AvALLOC((AV*)dstr) = (SV**)NULL;
+ }
+ break;
+ case SVt_PVHV:
+ SvANY(dstr) = new_XPVHV();
+ SvCUR(dstr) = SvCUR(sstr);
+ SvLEN(dstr) = SvLEN(sstr);
+ SvIVX(dstr) = SvIVX(sstr);
+ SvNVX(dstr) = SvNVX(sstr);
+ SvMAGIC(dstr) = mg_dup(SvMAGIC(sstr));
+ SvSTASH(dstr) = hv_dup_inc(SvSTASH(sstr));
+ HvRITER((HV*)dstr) = HvRITER((HV*)sstr);
+ if (HvARRAY((HV*)sstr)) {
+ HE *entry;
+ STRLEN i = 0;
+ XPVHV *dxhv = (XPVHV*)SvANY(dstr);
+ XPVHV *sxhv = (XPVHV*)SvANY(sstr);
+ Newz(0, dxhv->xhv_array,
+ PERL_HV_ARRAY_ALLOC_BYTES(dxhv->xhv_max+1), char);
+ while (i <= sxhv->xhv_max) {
+ ((HE**)dxhv->xhv_array)[i] = he_dup(((HE**)sxhv->xhv_array)[i],
+ !!HvSHAREKEYS(sstr));
+ ++i;
+ }
+ dxhv->xhv_eiter = he_dup(sxhv->xhv_eiter, !!HvSHAREKEYS(sstr));
+ }
+ else {
+ SvPVX(dstr) = Nullch;
+ HvEITER((HV*)dstr) = (HE*)NULL;
+ }
+ HvPMROOT((HV*)dstr) = HvPMROOT((HV*)sstr); /* XXX */
+ HvNAME((HV*)dstr) = SAVEPV(HvNAME((HV*)sstr));
+ break;
+ case SVt_PVFM:
+ SvANY(dstr) = new_XPVFM();
+ FmLINES(dstr) = FmLINES(sstr);
+ goto dup_pvcv;
+ /* NOTREACHED */
+ case SVt_PVCV:
+ SvANY(dstr) = new_XPVCV();
+dup_pvcv:
+ SvCUR(dstr) = SvCUR(sstr);
+ SvLEN(dstr) = SvLEN(sstr);
+ SvIVX(dstr) = SvIVX(sstr);
+ SvNVX(dstr) = SvNVX(sstr);
+ SvMAGIC(dstr) = mg_dup(SvMAGIC(sstr));
+ SvSTASH(dstr) = hv_dup_inc(SvSTASH(sstr));
+ if (SvPVX(sstr) && SvLEN(sstr))
+ SvPVX(dstr) = SAVEPVN(SvPVX(sstr), SvLEN(sstr)-1);
+ else
+ SvPVX(dstr) = SvPVX(sstr); /* XXX shared string/random ptr? */
+ CvSTASH(dstr) = hv_dup(CvSTASH(sstr));/* NOTE: not refcounted */
+ CvSTART(dstr) = CvSTART(sstr);
+ CvROOT(dstr) = OpREFCNT_inc(CvROOT(sstr));
+ CvXSUB(dstr) = CvXSUB(sstr);
+ CvXSUBANY(dstr) = CvXSUBANY(sstr);
+ CvGV(dstr) = gv_dup_inc(CvGV(sstr));
+ CvDEPTH(dstr) = CvDEPTH(sstr);
+ if (CvPADLIST(sstr) && !AvREAL(CvPADLIST(sstr))) {
+ /* XXX padlists are real, but pretend to be not */
+ AvREAL_on(CvPADLIST(sstr));
+ CvPADLIST(dstr) = av_dup_inc(CvPADLIST(sstr));
+ AvREAL_off(CvPADLIST(sstr));
+ AvREAL_off(CvPADLIST(dstr));
+ }
+ else
+ CvPADLIST(dstr) = av_dup_inc(CvPADLIST(sstr));
+ CvOUTSIDE(dstr) = cv_dup_inc(CvOUTSIDE(sstr));
+ CvFLAGS(dstr) = CvFLAGS(sstr);
+ break;
+ default:
+ Perl_croak(aTHX_ "Bizarre SvTYPE [%d]", SvTYPE(sstr));
+ break;
+ }
+
+ if (SvOBJECT(dstr) && SvTYPE(dstr) != SVt_PVIO)
+ ++PL_sv_objcount;
+
+ return dstr;
+}
+
+PERL_CONTEXT *
+Perl_cx_dup(pTHX_ PERL_CONTEXT *cxs, I32 ix, I32 max)
+{
+ PERL_CONTEXT *ncxs;
+
+ if (!cxs)
+ return (PERL_CONTEXT*)NULL;
+
+ /* look for it in the table first */
+ ncxs = (PERL_CONTEXT*)ptr_table_fetch(PL_ptr_table, cxs);
+ if (ncxs)
+ return ncxs;
+
+ /* create anew and remember what it is */
+ Newz(56, ncxs, max + 1, PERL_CONTEXT);
+ ptr_table_store(PL_ptr_table, cxs, ncxs);
+
+ while (ix >= 0) {
+ PERL_CONTEXT *cx = &cxs[ix];
+ PERL_CONTEXT *ncx = &ncxs[ix];
+ ncx->cx_type = cx->cx_type;
+ if (CxTYPE(cx) == CXt_SUBST) {
+ Perl_croak(aTHX_ "Cloning substitution context is unimplemented");
+ }
+ else {
+ ncx->blk_oldsp = cx->blk_oldsp;
+ ncx->blk_oldcop = cx->blk_oldcop;
+ ncx->blk_oldretsp = cx->blk_oldretsp;
+ ncx->blk_oldmarksp = cx->blk_oldmarksp;
+ ncx->blk_oldscopesp = cx->blk_oldscopesp;
+ ncx->blk_oldpm = cx->blk_oldpm;
+ ncx->blk_gimme = cx->blk_gimme;
+ switch (CxTYPE(cx)) {
+ case CXt_SUB:
+ ncx->blk_sub.cv = (cx->blk_sub.olddepth == 0
+ ? cv_dup_inc(cx->blk_sub.cv)
+ : cv_dup(cx->blk_sub.cv));
+ ncx->blk_sub.argarray = (cx->blk_sub.hasargs
+ ? av_dup_inc(cx->blk_sub.argarray)
+ : Nullav);
+ ncx->blk_sub.savearray = av_dup(cx->blk_sub.savearray);
+ ncx->blk_sub.olddepth = cx->blk_sub.olddepth;
+ ncx->blk_sub.hasargs = cx->blk_sub.hasargs;
+ ncx->blk_sub.lval = cx->blk_sub.lval;
+ break;
+ case CXt_EVAL:
+ ncx->blk_eval.old_in_eval = cx->blk_eval.old_in_eval;
+ ncx->blk_eval.old_op_type = cx->blk_eval.old_op_type;
+ ncx->blk_eval.old_name = SAVEPV(cx->blk_eval.old_name);
+ ncx->blk_eval.old_eval_root = cx->blk_eval.old_eval_root;
+ ncx->blk_eval.cur_text = sv_dup(cx->blk_eval.cur_text);
+ break;
+ case CXt_LOOP:
+ ncx->blk_loop.label = cx->blk_loop.label;
+ ncx->blk_loop.resetsp = cx->blk_loop.resetsp;
+ ncx->blk_loop.redo_op = cx->blk_loop.redo_op;
+ ncx->blk_loop.next_op = cx->blk_loop.next_op;
+ ncx->blk_loop.last_op = cx->blk_loop.last_op;
+ ncx->blk_loop.iterdata = (CxPADLOOP(cx)
+ ? cx->blk_loop.iterdata
+ : gv_dup((GV*)cx->blk_loop.iterdata));
+ ncx->blk_loop.itersave = sv_dup_inc(cx->blk_loop.itersave);
+ ncx->blk_loop.iterlval = sv_dup_inc(cx->blk_loop.iterlval);
+ ncx->blk_loop.iterary = av_dup_inc(cx->blk_loop.iterary);
+ ncx->blk_loop.iterix = cx->blk_loop.iterix;
+ ncx->blk_loop.itermax = cx->blk_loop.itermax;
+ break;
+ case CXt_FORMAT:
+ ncx->blk_sub.cv = cv_dup(cx->blk_sub.cv);
+ ncx->blk_sub.gv = gv_dup(cx->blk_sub.gv);
+ ncx->blk_sub.dfoutgv = gv_dup_inc(cx->blk_sub.dfoutgv);
+ ncx->blk_sub.hasargs = cx->blk_sub.hasargs;
+ break;
+ case CXt_BLOCK:
+ case CXt_NULL:
+ break;
+ }
+ }
+ --ix;
+ }
+ return ncxs;
+}
+
+PERL_SI *
+Perl_si_dup(pTHX_ PERL_SI *si)
+{
+ PERL_SI *nsi;
+
+ if (!si)
+ return (PERL_SI*)NULL;
+
+ /* look for it in the table first */
+ nsi = (PERL_SI*)ptr_table_fetch(PL_ptr_table, si);
+ if (nsi)
+ return nsi;
+
+ /* create anew and remember what it is */
+ Newz(56, nsi, 1, PERL_SI);
+ ptr_table_store(PL_ptr_table, si, nsi);
+
+ nsi->si_stack = av_dup_inc(si->si_stack);
+ nsi->si_cxix = si->si_cxix;
+ nsi->si_cxmax = si->si_cxmax;
+ nsi->si_cxstack = cx_dup(si->si_cxstack, si->si_cxix, si->si_cxmax);
+ nsi->si_type = si->si_type;
+ nsi->si_prev = si_dup(si->si_prev);
+ nsi->si_next = si_dup(si->si_next);
+ nsi->si_markoff = si->si_markoff;
+
+ return nsi;
+}
+
+#define POPINT(ss,ix) ((ss)[--(ix)].any_i32)
+#define TOPINT(ss,ix) ((ss)[ix].any_i32)
+#define POPLONG(ss,ix) ((ss)[--(ix)].any_long)
+#define TOPLONG(ss,ix) ((ss)[ix].any_long)
+#define POPIV(ss,ix) ((ss)[--(ix)].any_iv)
+#define TOPIV(ss,ix) ((ss)[ix].any_iv)
+#define POPPTR(ss,ix) ((ss)[--(ix)].any_ptr)
+#define TOPPTR(ss,ix) ((ss)[ix].any_ptr)
+#define POPDPTR(ss,ix) ((ss)[--(ix)].any_dptr)
+#define TOPDPTR(ss,ix) ((ss)[ix].any_dptr)
+#define POPDXPTR(ss,ix) ((ss)[--(ix)].any_dxptr)
+#define TOPDXPTR(ss,ix) ((ss)[ix].any_dxptr)
+
+/* XXXXX todo */
+#define pv_dup_inc(p) SAVEPV(p)
+#define pv_dup(p) SAVEPV(p)
+#define svp_dup_inc(p,pp) any_dup(p,pp)
+
+void *
+Perl_any_dup(pTHX_ void *v, PerlInterpreter *proto_perl)
+{
+ void *ret;
+
+ if (!v)
+ return (void*)NULL;
+
+ /* look for it in the table first */
+ ret = ptr_table_fetch(PL_ptr_table, v);
+ if (ret)
+ return ret;
+
+ /* see if it is part of the interpreter structure */
+ if (v >= (void*)proto_perl && v < (void*)(proto_perl+1))
+ ret = (void*)(((char*)aTHXo) + (((char*)v) - (char*)proto_perl));
+ else
+ ret = v;
+
+ return ret;
+}
+
+ANY *
+Perl_ss_dup(pTHX_ PerlInterpreter *proto_perl)
+{
+ ANY *ss = proto_perl->Tsavestack;
+ I32 ix = proto_perl->Tsavestack_ix;
+ I32 max = proto_perl->Tsavestack_max;
+ ANY *nss;
+ SV *sv;
+ GV *gv;
+ AV *av;
+ HV *hv;
+ void* ptr;
+ int intval;
+ long longval;
+ GP *gp;
+ IV iv;
+ I32 i;
+ char *c;
+ void (*dptr) (void*);
+ void (*dxptr) (pTHXo_ void*);
+
+ Newz(54, nss, max, ANY);
+
+ while (ix > 0) {
+ i = POPINT(ss,ix);
+ TOPINT(nss,ix) = i;
+ switch (i) {
+ case SAVEt_ITEM: /* normal string */
+ sv = (SV*)POPPTR(ss,ix);
+ TOPPTR(nss,ix) = sv_dup_inc(sv);
+ sv = (SV*)POPPTR(ss,ix);
+ TOPPTR(nss,ix) = sv_dup_inc(sv);
+ break;
+ case SAVEt_SV: /* scalar reference */
+ sv = (SV*)POPPTR(ss,ix);
+ TOPPTR(nss,ix) = sv_dup_inc(sv);
+ gv = (GV*)POPPTR(ss,ix);
+ TOPPTR(nss,ix) = gv_dup_inc(gv);
+ break;
+ case SAVEt_GENERIC_SVREF: /* generic sv */
+ case SAVEt_SVREF: /* scalar reference */
+ sv = (SV*)POPPTR(ss,ix);
+ TOPPTR(nss,ix) = sv_dup_inc(sv);
+ ptr = POPPTR(ss,ix);
+ TOPPTR(nss,ix) = svp_dup_inc((SV**)ptr, proto_perl);/* XXXXX */
+ break;
+ case SAVEt_AV: /* array reference */
+ av = (AV*)POPPTR(ss,ix);
+ TOPPTR(nss,ix) = av_dup_inc(av);
+ gv = (GV*)POPPTR(ss,ix);
+ TOPPTR(nss,ix) = gv_dup(gv);
+ break;
+ case SAVEt_HV: /* hash reference */
+ hv = (HV*)POPPTR(ss,ix);
+ TOPPTR(nss,ix) = hv_dup_inc(hv);
+ gv = (GV*)POPPTR(ss,ix);
+ TOPPTR(nss,ix) = gv_dup(gv);
+ break;
+ case SAVEt_INT: /* int reference */
+ ptr = POPPTR(ss,ix);
+ TOPPTR(nss,ix) = any_dup(ptr, proto_perl);
+ intval = (int)POPINT(ss,ix);
+ TOPINT(nss,ix) = intval;
+ break;
+ case SAVEt_LONG: /* long reference */
+ ptr = POPPTR(ss,ix);
+ TOPPTR(nss,ix) = any_dup(ptr, proto_perl);
+ longval = (long)POPLONG(ss,ix);
+ TOPLONG(nss,ix) = longval;
+ break;
+ case SAVEt_I32: /* I32 reference */
+ case SAVEt_I16: /* I16 reference */
+ case SAVEt_I8: /* I8 reference */
+ ptr = POPPTR(ss,ix);
+ TOPPTR(nss,ix) = any_dup(ptr, proto_perl);
+ i = POPINT(ss,ix);
+ TOPINT(nss,ix) = i;
+ break;
+ case SAVEt_IV: /* IV reference */
+ ptr = POPPTR(ss,ix);
+ TOPPTR(nss,ix) = any_dup(ptr, proto_perl);
+ iv = POPIV(ss,ix);
+ TOPIV(nss,ix) = iv;
+ break;
+ case SAVEt_SPTR: /* SV* reference */
+ ptr = POPPTR(ss,ix);
+ TOPPTR(nss,ix) = any_dup(ptr, proto_perl);
+ sv = (SV*)POPPTR(ss,ix);
+ TOPPTR(nss,ix) = sv_dup(sv);
+ break;
+ case SAVEt_VPTR: /* random* reference */
+ ptr = POPPTR(ss,ix);
+ TOPPTR(nss,ix) = any_dup(ptr, proto_perl);
+ ptr = POPPTR(ss,ix);
+ TOPPTR(nss,ix) = any_dup(ptr, proto_perl);
+ break;
+ case SAVEt_PPTR: /* char* reference */
+ ptr = POPPTR(ss,ix);
+ TOPPTR(nss,ix) = any_dup(ptr, proto_perl);
+ c = (char*)POPPTR(ss,ix);
+ TOPPTR(nss,ix) = pv_dup(c);
+ break;
+ case SAVEt_HPTR: /* HV* reference */
+ ptr = POPPTR(ss,ix);
+ TOPPTR(nss,ix) = any_dup(ptr, proto_perl);
+ hv = (HV*)POPPTR(ss,ix);
+ TOPPTR(nss,ix) = hv_dup(hv);
+ break;
+ case SAVEt_APTR: /* AV* reference */
+ ptr = POPPTR(ss,ix);
+ TOPPTR(nss,ix) = any_dup(ptr, proto_perl);
+ av = (AV*)POPPTR(ss,ix);
+ TOPPTR(nss,ix) = av_dup(av);
+ break;
+ case SAVEt_NSTAB:
+ gv = (GV*)POPPTR(ss,ix);
+ TOPPTR(nss,ix) = gv_dup(gv);
+ break;
+ case SAVEt_GP: /* scalar reference */
+ gp = (GP*)POPPTR(ss,ix);
+ TOPPTR(nss,ix) = gp = gp_dup(gp);
+ (void)GpREFCNT_inc(gp);
+ gv = (GV*)POPPTR(ss,ix);
+ TOPPTR(nss,ix) = gv_dup_inc(c);
+ c = (char*)POPPTR(ss,ix);
+ TOPPTR(nss,ix) = pv_dup(c);
+ iv = POPIV(ss,ix);
+ TOPIV(nss,ix) = iv;
+ iv = POPIV(ss,ix);
+ TOPIV(nss,ix) = iv;
+ break;
+ case SAVEt_FREESV:
+ sv = (SV*)POPPTR(ss,ix);
+ TOPPTR(nss,ix) = sv_dup_inc(sv);
+ break;
+ case SAVEt_FREEOP:
+ ptr = POPPTR(ss,ix);
+ if (ptr && (((OP*)ptr)->op_private & OPpREFCOUNTED)) {
+ /* these are assumed to be refcounted properly */
+ switch (((OP*)ptr)->op_type) {
+ case OP_LEAVESUB:
+ case OP_LEAVESUBLV:
+ case OP_LEAVEEVAL:
+ case OP_LEAVE:
+ case OP_SCOPE:
+ case OP_LEAVEWRITE:
+ TOPPTR(nss,ix) = any_dup(ptr, proto_perl);
+ break;
+ default:
+ TOPPTR(nss,ix) = Nullop;
+ break;
+ }
+ }
+ else
+ TOPPTR(nss,ix) = Nullop;
+ break;
+ case SAVEt_FREEPV:
+ c = (char*)POPPTR(ss,ix);
+ TOPPTR(nss,ix) = pv_dup_inc(c);
+ break;
+ case SAVEt_CLEARSV:
+ longval = POPLONG(ss,ix);
+ TOPLONG(nss,ix) = longval;
+ break;
+ case SAVEt_DELETE:
+ hv = (HV*)POPPTR(ss,ix);
+ TOPPTR(nss,ix) = hv_dup_inc(hv);
+ c = (char*)POPPTR(ss,ix);
+ TOPPTR(nss,ix) = pv_dup_inc(c);
+ i = POPINT(ss,ix);
+ TOPINT(nss,ix) = i;
+ break;
+ case SAVEt_DESTRUCTOR:
+ ptr = POPPTR(ss,ix);
+ TOPPTR(nss,ix) = any_dup(ptr, proto_perl); /* XXX quite arbitrary */
+ dptr = POPDPTR(ss,ix);
+ TOPDPTR(nss,ix) = (void (*)(void*))any_dup(dptr, proto_perl);
+ break;
+ case SAVEt_DESTRUCTOR_X:
+ ptr = POPPTR(ss,ix);
+ TOPPTR(nss,ix) = any_dup(ptr, proto_perl); /* XXX quite arbitrary */
+ dxptr = POPDXPTR(ss,ix);
+ TOPDXPTR(nss,ix) = (void (*)(pTHXo_ void*))any_dup(dxptr, proto_perl);
+ break;
+ case SAVEt_REGCONTEXT:
+ case SAVEt_ALLOC:
+ i = POPINT(ss,ix);
+ TOPINT(nss,ix) = i;
+ ix -= i;
+ break;
+ case SAVEt_STACK_POS: /* Position on Perl stack */
+ i = POPINT(ss,ix);
+ TOPINT(nss,ix) = i;
+ break;
+ case SAVEt_AELEM: /* array element */
+ sv = (SV*)POPPTR(ss,ix);
+ TOPPTR(nss,ix) = sv_dup_inc(sv);
+ i = POPINT(ss,ix);
+ TOPINT(nss,ix) = i;
+ av = (AV*)POPPTR(ss,ix);
+ TOPPTR(nss,ix) = av_dup_inc(av);
+ break;
+ case SAVEt_HELEM: /* hash element */
+ sv = (SV*)POPPTR(ss,ix);
+ TOPPTR(nss,ix) = sv_dup_inc(sv);
+ sv = (SV*)POPPTR(ss,ix);
+ TOPPTR(nss,ix) = sv_dup_inc(sv);
+ hv = (HV*)POPPTR(ss,ix);
+ TOPPTR(nss,ix) = hv_dup_inc(hv);
+ break;
+ case SAVEt_OP:
+ ptr = POPPTR(ss,ix);
+ TOPPTR(nss,ix) = ptr;
+ break;
+ case SAVEt_HINTS:
+ i = POPINT(ss,ix);
+ TOPINT(nss,ix) = i;
+ break;
+ default:
+ Perl_croak(aTHX_ "panic: ss_dup inconsistency");
+ }
+ }
+
+ return nss;
+}
+
+#ifdef PERL_OBJECT
+#include "XSUB.h"
+#endif
+
+PerlInterpreter *
+perl_clone(PerlInterpreter *proto_perl, UV flags)
+{
+#ifdef PERL_OBJECT
+ CPerlObj *pPerl = (CPerlObj*)proto_perl;
+#endif
+
+#ifdef PERL_IMPLICIT_SYS
+ return perl_clone_using(proto_perl, flags,
+ proto_perl->IMem,
+ proto_perl->IMemShared,
+ proto_perl->IMemParse,
+ proto_perl->IEnv,
+ proto_perl->IStdIO,
+ proto_perl->ILIO,
+ proto_perl->IDir,
+ proto_perl->ISock,
+ proto_perl->IProc);
+}
+
+PerlInterpreter *
+perl_clone_using(PerlInterpreter *proto_perl, UV flags,
+ struct IPerlMem* ipM, struct IPerlMem* ipMS,
+ struct IPerlMem* ipMP, struct IPerlEnv* ipE,
+ struct IPerlStdIO* ipStd, struct IPerlLIO* ipLIO,
+ struct IPerlDir* ipD, struct IPerlSock* ipS,
+ struct IPerlProc* ipP)
+{
+ /* XXX many of the string copies here can be optimized if they're
+ * constants; they need to be allocated as common memory and just
+ * their pointers copied. */
+
+ IV i;
+ SV *sv;
+ SV **svp;
+# ifdef PERL_OBJECT
+ CPerlObj *pPerl = new(ipM) CPerlObj(ipM, ipMS, ipMP, ipE, ipStd, ipLIO,
+ ipD, ipS, ipP);
+ PERL_SET_INTERP(pPerl);
+# else /* !PERL_OBJECT */
+ PerlInterpreter *my_perl = (PerlInterpreter*)(*ipM->pMalloc)(ipM, sizeof(PerlInterpreter));
+ PERL_SET_INTERP(my_perl);
+
+# ifdef DEBUGGING
+ memset(my_perl, 0xab, sizeof(PerlInterpreter));
+ PL_markstack = 0;
+ PL_scopestack = 0;
+ PL_savestack = 0;
+ PL_retstack = 0;
+# else /* !DEBUGGING */
+ Zero(my_perl, 1, PerlInterpreter);
+# endif /* DEBUGGING */
+
+ /* host pointers */
+ PL_Mem = ipM;
+ PL_MemShared = ipMS;
+ PL_MemParse = ipMP;
+ PL_Env = ipE;
+ PL_StdIO = ipStd;
+ PL_LIO = ipLIO;
+ PL_Dir = ipD;
+ PL_Sock = ipS;
+ PL_Proc = ipP;
+# endif /* PERL_OBJECT */
+#else /* !PERL_IMPLICIT_SYS */
+ IV i;
+ SV *sv;
+ SV **svp;
+ PerlInterpreter *my_perl = (PerlInterpreter*)PerlMem_malloc(sizeof(PerlInterpreter));
+ PERL_SET_INTERP(my_perl);
+
+# ifdef DEBUGGING
+ memset(my_perl, 0xab, sizeof(PerlInterpreter));
+ PL_markstack = 0;
+ PL_scopestack = 0;
+ PL_savestack = 0;
+ PL_retstack = 0;
+# else /* !DEBUGGING */
+ Zero(my_perl, 1, PerlInterpreter);
+# endif /* DEBUGGING */
+#endif /* PERL_IMPLICIT_SYS */
+
+ /* arena roots */
+ PL_xiv_arenaroot = NULL;
+ PL_xiv_root = NULL;
+ PL_xnv_root = NULL;
+ PL_xrv_root = NULL;
+ PL_xpv_root = NULL;
+ PL_xpviv_root = NULL;
+ PL_xpvnv_root = NULL;
+ PL_xpvcv_root = NULL;
+ PL_xpvav_root = NULL;
+ PL_xpvhv_root = NULL;
+ PL_xpvmg_root = NULL;
+ PL_xpvlv_root = NULL;
+ PL_xpvbm_root = NULL;
+ PL_he_root = NULL;
+ PL_nice_chunk = NULL;
+ PL_nice_chunk_size = 0;
+ PL_sv_count = 0;
+ PL_sv_objcount = 0;
+ PL_sv_root = Nullsv;
+ PL_sv_arenaroot = Nullsv;
+
+ PL_debug = proto_perl->Idebug;
+
+ /* create SV map for pointer relocation */
+ PL_ptr_table = ptr_table_new();
+
+ /* initialize these special pointers as early as possible */
+ SvANY(&PL_sv_undef) = NULL;
+ SvREFCNT(&PL_sv_undef) = (~(U32)0)/2;
+ SvFLAGS(&PL_sv_undef) = SVf_READONLY|SVt_NULL;
+ ptr_table_store(PL_ptr_table, &proto_perl->Isv_undef, &PL_sv_undef);
+
+#ifdef PERL_OBJECT
+ SvUPGRADE(&PL_sv_no, SVt_PVNV);
+#else
+ SvANY(&PL_sv_no) = new_XPVNV();
+#endif
+ SvREFCNT(&PL_sv_no) = (~(U32)0)/2;
+ SvFLAGS(&PL_sv_no) = SVp_NOK|SVf_NOK|SVp_POK|SVf_POK|SVf_READONLY|SVt_PVNV;
+ SvPVX(&PL_sv_no) = SAVEPVN(PL_No, 0);
+ SvCUR(&PL_sv_no) = 0;
+ SvLEN(&PL_sv_no) = 1;
+ SvNVX(&PL_sv_no) = 0;
+ ptr_table_store(PL_ptr_table, &proto_perl->Isv_no, &PL_sv_no);
+
+#ifdef PERL_OBJECT
+ SvUPGRADE(&PL_sv_yes, SVt_PVNV);
+#else
+ SvANY(&PL_sv_yes) = new_XPVNV();
+#endif
+ SvREFCNT(&PL_sv_yes) = (~(U32)0)/2;
+ SvFLAGS(&PL_sv_yes) = SVp_NOK|SVf_NOK|SVp_POK|SVf_POK|SVf_READONLY|SVt_PVNV;
+ SvPVX(&PL_sv_yes) = SAVEPVN(PL_Yes, 1);
+ SvCUR(&PL_sv_yes) = 1;
+ SvLEN(&PL_sv_yes) = 2;
+ SvNVX(&PL_sv_yes) = 1;
+ ptr_table_store(PL_ptr_table, &proto_perl->Isv_yes, &PL_sv_yes);
+
+ /* create shared string table */
+ PL_strtab = newHV();
+ HvSHAREKEYS_off(PL_strtab);
+ hv_ksplit(PL_strtab, 512);
+ ptr_table_store(PL_ptr_table, proto_perl->Istrtab, PL_strtab);
+
+ PL_compiling = proto_perl->Icompiling;
+ PL_compiling.cop_stashpv = SAVEPV(PL_compiling.cop_stashpv);
+ PL_compiling.cop_file = SAVEPV(PL_compiling.cop_file);
+ ptr_table_store(PL_ptr_table, &proto_perl->Icompiling, &PL_compiling);
+ if (!specialWARN(PL_compiling.cop_warnings))
+ PL_compiling.cop_warnings = sv_dup_inc(PL_compiling.cop_warnings);
+ PL_curcop = (COP*)any_dup(proto_perl->Tcurcop, proto_perl);
+
+ /* pseudo environmental stuff */
+ PL_origargc = proto_perl->Iorigargc;
+ i = PL_origargc;
+ New(0, PL_origargv, i+1, char*);
+ PL_origargv[i] = '\0';
+ while (i-- > 0) {
+ PL_origargv[i] = SAVEPV(proto_perl->Iorigargv[i]);
+ }
+ PL_envgv = gv_dup(proto_perl->Ienvgv);
+ PL_incgv = gv_dup(proto_perl->Iincgv);
+ PL_hintgv = gv_dup(proto_perl->Ihintgv);
+ PL_origfilename = SAVEPV(proto_perl->Iorigfilename);
+ PL_diehook = sv_dup_inc(proto_perl->Idiehook);
+ PL_warnhook = sv_dup_inc(proto_perl->Iwarnhook);
+
+ /* switches */
+ PL_minus_c = proto_perl->Iminus_c;
+ PL_patchlevel = sv_dup_inc(proto_perl->Ipatchlevel);
+ PL_localpatches = proto_perl->Ilocalpatches;
+ PL_splitstr = proto_perl->Isplitstr;
+ PL_preprocess = proto_perl->Ipreprocess;
+ PL_minus_n = proto_perl->Iminus_n;
+ PL_minus_p = proto_perl->Iminus_p;
+ PL_minus_l = proto_perl->Iminus_l;
+ PL_minus_a = proto_perl->Iminus_a;
+ PL_minus_F = proto_perl->Iminus_F;
+ PL_doswitches = proto_perl->Idoswitches;
+ PL_dowarn = proto_perl->Idowarn;
+ PL_doextract = proto_perl->Idoextract;
+ PL_sawampersand = proto_perl->Isawampersand;
+ PL_unsafe = proto_perl->Iunsafe;
+ PL_inplace = SAVEPV(proto_perl->Iinplace);
+ PL_e_script = sv_dup_inc(proto_perl->Ie_script);
+ PL_perldb = proto_perl->Iperldb;
+ PL_perl_destruct_level = proto_perl->Iperl_destruct_level;
+
+ /* magical thingies */
+ /* XXX time(&PL_basetime) when asked for? */
+ PL_basetime = proto_perl->Ibasetime;
+ PL_formfeed = sv_dup(proto_perl->Iformfeed);
+
+ PL_maxsysfd = proto_perl->Imaxsysfd;
+ PL_multiline = proto_perl->Imultiline;
+ PL_statusvalue = proto_perl->Istatusvalue;
+#ifdef VMS
+ PL_statusvalue_vms = proto_perl->Istatusvalue_vms;
+#endif
+
+ /* shortcuts to various I/O objects */
+ PL_stdingv = gv_dup(proto_perl->Istdingv);
+ PL_stderrgv = gv_dup(proto_perl->Istderrgv);
+ PL_defgv = gv_dup(proto_perl->Idefgv);
+ PL_argvgv = gv_dup(proto_perl->Iargvgv);
+ PL_argvoutgv = gv_dup(proto_perl->Iargvoutgv);
+ PL_argvout_stack = av_dup(proto_perl->Iargvout_stack);
+
+ /* shortcuts to regexp stuff */
+ PL_replgv = gv_dup(proto_perl->Ireplgv);
+
+ /* shortcuts to misc objects */
+ PL_errgv = gv_dup(proto_perl->Ierrgv);
+
+ /* shortcuts to debugging objects */
+ PL_DBgv = gv_dup(proto_perl->IDBgv);
+ PL_DBline = gv_dup(proto_perl->IDBline);
+ PL_DBsub = gv_dup(proto_perl->IDBsub);
+ PL_DBsingle = sv_dup(proto_perl->IDBsingle);
+ PL_DBtrace = sv_dup(proto_perl->IDBtrace);
+ PL_DBsignal = sv_dup(proto_perl->IDBsignal);
+ PL_lineary = av_dup(proto_perl->Ilineary);
+ PL_dbargs = av_dup(proto_perl->Idbargs);
+
+ /* symbol tables */
+ PL_defstash = hv_dup_inc(proto_perl->Tdefstash);
+ PL_curstash = hv_dup(proto_perl->Tcurstash);
+ PL_debstash = hv_dup(proto_perl->Idebstash);
+ PL_globalstash = hv_dup(proto_perl->Iglobalstash);
+ PL_curstname = sv_dup_inc(proto_perl->Icurstname);
+
+ PL_beginav = av_dup_inc(proto_perl->Ibeginav);
+ PL_endav = av_dup_inc(proto_perl->Iendav);
+ PL_stopav = av_dup_inc(proto_perl->Istopav);
+ PL_initav = av_dup_inc(proto_perl->Iinitav);
+
+ PL_sub_generation = proto_perl->Isub_generation;
+
+ /* funky return mechanisms */
+ PL_forkprocess = proto_perl->Iforkprocess;
+
+ /* subprocess state */
+ PL_fdpid = av_dup_inc(proto_perl->Ifdpid);
+
+ /* internal state */
+ PL_tainting = proto_perl->Itainting;
+ PL_maxo = proto_perl->Imaxo;
+ if (proto_perl->Iop_mask)
+ PL_op_mask = SAVEPVN(proto_perl->Iop_mask, PL_maxo);
+ else
+ PL_op_mask = Nullch;
+
+ /* current interpreter roots */
+ PL_main_cv = cv_dup_inc(proto_perl->Imain_cv);
+ PL_main_root = OpREFCNT_inc(proto_perl->Imain_root);
+ PL_main_start = proto_perl->Imain_start;
+ PL_eval_root = OpREFCNT_inc(proto_perl->Ieval_root);
+ PL_eval_start = proto_perl->Ieval_start;
+
+ /* runtime control stuff */
+ PL_curcopdb = (COP*)any_dup(proto_perl->Icurcopdb, proto_perl);
+ PL_copline = proto_perl->Icopline;
+
+ PL_filemode = proto_perl->Ifilemode;
+ PL_lastfd = proto_perl->Ilastfd;
+ PL_oldname = proto_perl->Ioldname; /* XXX not quite right */
+ PL_Argv = NULL;
+ PL_Cmd = Nullch;
+ PL_gensym = proto_perl->Igensym;
+ PL_preambled = proto_perl->Ipreambled;
+ PL_preambleav = av_dup_inc(proto_perl->Ipreambleav);
+ PL_laststatval = proto_perl->Ilaststatval;
+ PL_laststype = proto_perl->Ilaststype;
+ PL_mess_sv = Nullsv;
+
+ PL_orslen = proto_perl->Iorslen;
+ PL_ors = SAVEPVN(proto_perl->Iors, PL_orslen);
+ PL_ofmt = SAVEPV(proto_perl->Iofmt);
+
+ /* interpreter atexit processing */
+ PL_exitlistlen = proto_perl->Iexitlistlen;
+ if (PL_exitlistlen) {
+ New(0, PL_exitlist, PL_exitlistlen, PerlExitListEntry);
+ Copy(proto_perl->Iexitlist, PL_exitlist, PL_exitlistlen, PerlExitListEntry);
+ }
+ else
+ PL_exitlist = (PerlExitListEntry*)NULL;
+ PL_modglobal = hv_dup_inc(proto_perl->Imodglobal);
+
+ PL_profiledata = NULL;
+ PL_rsfp = fp_dup(proto_perl->Irsfp, '<');
+ /* PL_rsfp_filters entries have fake IoDIRP() */
+ PL_rsfp_filters = av_dup_inc(proto_perl->Irsfp_filters);
+
+ PL_compcv = cv_dup(proto_perl->Icompcv);
+ PL_comppad = av_dup(proto_perl->Icomppad);
+ PL_comppad_name = av_dup(proto_perl->Icomppad_name);
+ PL_comppad_name_fill = proto_perl->Icomppad_name_fill;
+ PL_comppad_name_floor = proto_perl->Icomppad_name_floor;
+ PL_curpad = (SV**)ptr_table_fetch(PL_ptr_table,
+ proto_perl->Tcurpad);
+
+#ifdef HAVE_INTERP_INTERN
+ sys_intern_dup(&proto_perl->Isys_intern, &PL_sys_intern);
+#endif
+
+ /* more statics moved here */
+ PL_generation = proto_perl->Igeneration;
+ PL_DBcv = cv_dup(proto_perl->IDBcv);
+
+ PL_in_clean_objs = proto_perl->Iin_clean_objs;
+ PL_in_clean_all = proto_perl->Iin_clean_all;
+
+ PL_uid = proto_perl->Iuid;
+ PL_euid = proto_perl->Ieuid;
+ PL_gid = proto_perl->Igid;
+ PL_egid = proto_perl->Iegid;
+ PL_nomemok = proto_perl->Inomemok;
+ PL_an = proto_perl->Ian;
+ PL_cop_seqmax = proto_perl->Icop_seqmax;
+ PL_op_seqmax = proto_perl->Iop_seqmax;
+ PL_evalseq = proto_perl->Ievalseq;
+ PL_origenviron = proto_perl->Iorigenviron; /* XXX not quite right */
+ PL_origalen = proto_perl->Iorigalen;
+ PL_pidstatus = newHV(); /* XXX flag for cloning? */
+ PL_osname = SAVEPV(proto_perl->Iosname);
+ PL_sh_path = SAVEPV(proto_perl->Ish_path);
+ PL_sighandlerp = proto_perl->Isighandlerp;
+
+
+ PL_runops = proto_perl->Irunops;
+
+ Copy(proto_perl->Itokenbuf, PL_tokenbuf, 256, char);
+
+#ifdef CSH
+ PL_cshlen = proto_perl->Icshlen;
+ PL_cshname = SAVEPVN(proto_perl->Icshname, PL_cshlen);
+#endif
+
+ PL_lex_state = proto_perl->Ilex_state;
+ PL_lex_defer = proto_perl->Ilex_defer;
+ PL_lex_expect = proto_perl->Ilex_expect;
+ PL_lex_formbrack = proto_perl->Ilex_formbrack;
+ PL_lex_dojoin = proto_perl->Ilex_dojoin;
+ PL_lex_starts = proto_perl->Ilex_starts;
+ PL_lex_stuff = sv_dup_inc(proto_perl->Ilex_stuff);
+ PL_lex_repl = sv_dup_inc(proto_perl->Ilex_repl);
+ PL_lex_op = proto_perl->Ilex_op;
+ PL_lex_inpat = proto_perl->Ilex_inpat;
+ PL_lex_inwhat = proto_perl->Ilex_inwhat;
+ PL_lex_brackets = proto_perl->Ilex_brackets;
+ i = (PL_lex_brackets < 120 ? 120 : PL_lex_brackets);
+ PL_lex_brackstack = SAVEPVN(proto_perl->Ilex_brackstack,i);
+ PL_lex_casemods = proto_perl->Ilex_casemods;
+ i = (PL_lex_casemods < 12 ? 12 : PL_lex_casemods);
+ PL_lex_casestack = SAVEPVN(proto_perl->Ilex_casestack,i);
+
+ Copy(proto_perl->Inextval, PL_nextval, 5, YYSTYPE);
+ Copy(proto_perl->Inexttype, PL_nexttype, 5, I32);
+ PL_nexttoke = proto_perl->Inexttoke;
+
+ PL_linestr = sv_dup_inc(proto_perl->Ilinestr);
+ i = proto_perl->Ibufptr - SvPVX(proto_perl->Ilinestr);
+ PL_bufptr = SvPVX(PL_linestr) + (i < 0 ? 0 : i);
+ i = proto_perl->Ioldbufptr - SvPVX(proto_perl->Ilinestr);
+ PL_oldbufptr = SvPVX(PL_linestr) + (i < 0 ? 0 : i);
+ i = proto_perl->Ioldoldbufptr - SvPVX(proto_perl->Ilinestr);
+ PL_oldoldbufptr = SvPVX(PL_linestr) + (i < 0 ? 0 : i);
+ PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr);
+ i = proto_perl->Ilinestart - SvPVX(proto_perl->Ilinestr);
+ PL_linestart = SvPVX(PL_linestr) + (i < 0 ? 0 : i);
+ PL_pending_ident = proto_perl->Ipending_ident;
+ PL_sublex_info = proto_perl->Isublex_info; /* XXX not quite right */
+
+ PL_expect = proto_perl->Iexpect;
+
+ PL_multi_start = proto_perl->Imulti_start;
+ PL_multi_end = proto_perl->Imulti_end;
+ PL_multi_open = proto_perl->Imulti_open;
+ PL_multi_close = proto_perl->Imulti_close;
+
+ PL_error_count = proto_perl->Ierror_count;
+ PL_subline = proto_perl->Isubline;
+ PL_subname = sv_dup_inc(proto_perl->Isubname);
+
+ PL_min_intro_pending = proto_perl->Imin_intro_pending;
+ PL_max_intro_pending = proto_perl->Imax_intro_pending;
+ PL_padix = proto_perl->Ipadix;
+ PL_padix_floor = proto_perl->Ipadix_floor;
+ PL_pad_reset_pending = proto_perl->Ipad_reset_pending;
+
+ i = proto_perl->Ilast_uni - SvPVX(proto_perl->Ilinestr);
+ PL_last_uni = SvPVX(PL_linestr) + (i < 0 ? 0 : i);
+ i = proto_perl->Ilast_lop - SvPVX(proto_perl->Ilinestr);
+ PL_last_lop = SvPVX(PL_linestr) + (i < 0 ? 0 : i);
+ PL_last_lop_op = proto_perl->Ilast_lop_op;
+ PL_in_my = proto_perl->Iin_my;
+ PL_in_my_stash = hv_dup(proto_perl->Iin_my_stash);
+#ifdef FCRYPT
+ PL_cryptseen = proto_perl->Icryptseen;
+#endif
+
+ PL_hints = proto_perl->Ihints;
+
+ PL_amagic_generation = proto_perl->Iamagic_generation;
+
+#ifdef USE_LOCALE_COLLATE
+ PL_collation_ix = proto_perl->Icollation_ix;
+ PL_collation_name = SAVEPV(proto_perl->Icollation_name);
+ PL_collation_standard = proto_perl->Icollation_standard;
+ PL_collxfrm_base = proto_perl->Icollxfrm_base;
+ PL_collxfrm_mult = proto_perl->Icollxfrm_mult;
+#endif /* USE_LOCALE_COLLATE */
+
+#ifdef USE_LOCALE_NUMERIC
+ PL_numeric_name = SAVEPV(proto_perl->Inumeric_name);
+ PL_numeric_standard = proto_perl->Inumeric_standard;
+ PL_numeric_local = proto_perl->Inumeric_local;
+ PL_numeric_radix = proto_perl->Inumeric_radix;
+#endif /* !USE_LOCALE_NUMERIC */
+
+ /* utf8 character classes */
+ PL_utf8_alnum = sv_dup_inc(proto_perl->Iutf8_alnum);
+ PL_utf8_alnumc = sv_dup_inc(proto_perl->Iutf8_alnumc);
+ PL_utf8_ascii = sv_dup_inc(proto_perl->Iutf8_ascii);
+ PL_utf8_alpha = sv_dup_inc(proto_perl->Iutf8_alpha);
+ PL_utf8_space = sv_dup_inc(proto_perl->Iutf8_space);
+ PL_utf8_cntrl = sv_dup_inc(proto_perl->Iutf8_cntrl);
+ PL_utf8_graph = sv_dup_inc(proto_perl->Iutf8_graph);
+ PL_utf8_digit = sv_dup_inc(proto_perl->Iutf8_digit);
+ PL_utf8_upper = sv_dup_inc(proto_perl->Iutf8_upper);
+ PL_utf8_lower = sv_dup_inc(proto_perl->Iutf8_lower);
+ PL_utf8_print = sv_dup_inc(proto_perl->Iutf8_print);
+ PL_utf8_punct = sv_dup_inc(proto_perl->Iutf8_punct);
+ PL_utf8_xdigit = sv_dup_inc(proto_perl->Iutf8_xdigit);
+ PL_utf8_mark = sv_dup_inc(proto_perl->Iutf8_mark);
+ PL_utf8_toupper = sv_dup_inc(proto_perl->Iutf8_toupper);
+ PL_utf8_totitle = sv_dup_inc(proto_perl->Iutf8_totitle);
+ PL_utf8_tolower = sv_dup_inc(proto_perl->Iutf8_tolower);
+
+ /* swatch cache */
+ PL_last_swash_hv = Nullhv; /* reinits on demand */
+ PL_last_swash_klen = 0;
+ PL_last_swash_key[0]= '\0';
+ PL_last_swash_tmps = (U8*)NULL;
+ PL_last_swash_slen = 0;
+
+ /* perly.c globals */
+ PL_yydebug = proto_perl->Iyydebug;
+ PL_yynerrs = proto_perl->Iyynerrs;
+ PL_yyerrflag = proto_perl->Iyyerrflag;
+ PL_yychar = proto_perl->Iyychar;
+ PL_yyval = proto_perl->Iyyval;
+ PL_yylval = proto_perl->Iyylval;
+
+ PL_glob_index = proto_perl->Iglob_index;
+ PL_srand_called = proto_perl->Isrand_called;
+ PL_uudmap['M'] = 0; /* reinits on demand */
+ PL_bitcount = Nullch; /* reinits on demand */
+
+ if (proto_perl->Ipsig_ptr) {
+ int sig_num[] = { SIG_NUM };
+ Newz(0, PL_psig_ptr, sizeof(sig_num)/sizeof(*sig_num), SV*);
+ Newz(0, PL_psig_name, sizeof(sig_num)/sizeof(*sig_num), SV*);
+ for (i = 1; PL_sig_name[i]; i++) {
+ PL_psig_ptr[i] = sv_dup_inc(proto_perl->Ipsig_ptr[i]);
+ PL_psig_name[i] = sv_dup_inc(proto_perl->Ipsig_name[i]);
+ }
+ }
+ else {
+ PL_psig_ptr = (SV**)NULL;
+ PL_psig_name = (SV**)NULL;
+ }
+
+ /* thrdvar.h stuff */
+
+ if (flags & 1) {
+ /* next allocation will be PL_tmps_stack[PL_tmps_ix+1] */
+ PL_tmps_ix = proto_perl->Ttmps_ix;
+ PL_tmps_max = proto_perl->Ttmps_max;
+ PL_tmps_floor = proto_perl->Ttmps_floor;
+ Newz(50, PL_tmps_stack, PL_tmps_max, SV*);
+ i = 0;
+ while (i <= PL_tmps_ix) {
+ PL_tmps_stack[i] = sv_dup_inc(proto_perl->Ttmps_stack[i]);
+ ++i;
+ }
+
+ /* next PUSHMARK() sets *(PL_markstack_ptr+1) */
+ i = proto_perl->Tmarkstack_max - proto_perl->Tmarkstack;
+ Newz(54, PL_markstack, i, I32);
+ PL_markstack_max = PL_markstack + (proto_perl->Tmarkstack_max
+ - proto_perl->Tmarkstack);
+ PL_markstack_ptr = PL_markstack + (proto_perl->Tmarkstack_ptr
+ - proto_perl->Tmarkstack);
+ Copy(proto_perl->Tmarkstack, PL_markstack,
+ PL_markstack_ptr - PL_markstack + 1, I32);
+
+ /* next push_scope()/ENTER sets PL_scopestack[PL_scopestack_ix]
+ * NOTE: unlike the others! */
+ PL_scopestack_ix = proto_perl->Tscopestack_ix;
+ PL_scopestack_max = proto_perl->Tscopestack_max;
+ Newz(54, PL_scopestack, PL_scopestack_max, I32);
+ Copy(proto_perl->Tscopestack, PL_scopestack, PL_scopestack_ix, I32);
+
+ /* next push_return() sets PL_retstack[PL_retstack_ix]
+ * NOTE: unlike the others! */
+ PL_retstack_ix = proto_perl->Tretstack_ix;
+ PL_retstack_max = proto_perl->Tretstack_max;
+ Newz(54, PL_retstack, PL_retstack_max, OP*);
+ Copy(proto_perl->Tretstack, PL_retstack, PL_retstack_ix, I32);
+
+ /* NOTE: si_dup() looks at PL_markstack */
+ PL_curstackinfo = si_dup(proto_perl->Tcurstackinfo);
+
+ /* PL_curstack = PL_curstackinfo->si_stack; */
+ PL_curstack = av_dup(proto_perl->Tcurstack);
+ PL_mainstack = av_dup(proto_perl->Tmainstack);
+
+ /* next PUSHs() etc. set *(PL_stack_sp+1) */
+ PL_stack_base = AvARRAY(PL_curstack);
+ PL_stack_sp = PL_stack_base + (proto_perl->Tstack_sp
+ - proto_perl->Tstack_base);
+ PL_stack_max = PL_stack_base + AvMAX(PL_curstack);
+
+ /* next SSPUSHFOO() sets PL_savestack[PL_savestack_ix]
+ * NOTE: unlike the others! */
+ PL_savestack_ix = proto_perl->Tsavestack_ix;
+ PL_savestack_max = proto_perl->Tsavestack_max;
+ /*Newz(54, PL_savestack, PL_savestack_max, ANY);*/
+ PL_savestack = ss_dup(proto_perl);
+ }
+ else {
+ init_stacks();
+ }
+
+ PL_start_env = proto_perl->Tstart_env; /* XXXXXX */
+ PL_top_env = &PL_start_env;
+
+ PL_op = proto_perl->Top;
+
+ PL_Sv = Nullsv;
+ PL_Xpv = (XPV*)NULL;
+ PL_na = proto_perl->Tna;
+
+ PL_statbuf = proto_perl->Tstatbuf;
+ PL_statcache = proto_perl->Tstatcache;
+ PL_statgv = gv_dup(proto_perl->Tstatgv);
+ PL_statname = sv_dup_inc(proto_perl->Tstatname);
+#ifdef HAS_TIMES
+ PL_timesbuf = proto_perl->Ttimesbuf;
+#endif
+
+ PL_tainted = proto_perl->Ttainted;
+ PL_curpm = proto_perl->Tcurpm; /* XXX No PMOP ref count */
+ PL_nrs = sv_dup_inc(proto_perl->Tnrs);
+ PL_rs = sv_dup_inc(proto_perl->Trs);
+ PL_last_in_gv = gv_dup(proto_perl->Tlast_in_gv);
+ PL_ofslen = proto_perl->Tofslen;
+ PL_ofs = SAVEPVN(proto_perl->Tofs, PL_ofslen);
+ PL_defoutgv = gv_dup_inc(proto_perl->Tdefoutgv);
+ PL_chopset = proto_perl->Tchopset; /* XXX never deallocated */
+ PL_toptarget = sv_dup_inc(proto_perl->Ttoptarget);
+ PL_bodytarget = sv_dup_inc(proto_perl->Tbodytarget);
+ PL_formtarget = sv_dup(proto_perl->Tformtarget);
+
+ PL_restartop = proto_perl->Trestartop;
+ PL_in_eval = proto_perl->Tin_eval;
+ PL_delaymagic = proto_perl->Tdelaymagic;
+ PL_dirty = proto_perl->Tdirty;
+ PL_localizing = proto_perl->Tlocalizing;
+
+ PL_protect = proto_perl->Tprotect;
+ PL_errors = sv_dup_inc(proto_perl->Terrors);
+ PL_av_fetch_sv = Nullsv;
+ PL_hv_fetch_sv = Nullsv;
+ Zero(&PL_hv_fetch_ent_mh, 1, HE); /* XXX */
+ PL_modcount = proto_perl->Tmodcount;
+ PL_lastgotoprobe = Nullop;
+ PL_dumpindent = proto_perl->Tdumpindent;
+
+ PL_sortcop = (OP*)any_dup(proto_perl->Tsortcop, proto_perl);
+ PL_sortstash = hv_dup(proto_perl->Tsortstash);
+ PL_firstgv = gv_dup(proto_perl->Tfirstgv);
+ PL_secondgv = gv_dup(proto_perl->Tsecondgv);
+ PL_sortcxix = proto_perl->Tsortcxix;
+ PL_efloatbuf = Nullch; /* reinits on demand */
+ PL_efloatsize = 0; /* reinits on demand */
+
+ /* regex stuff */
+
+ PL_screamfirst = NULL;
+ PL_screamnext = NULL;
+ PL_maxscream = -1; /* reinits on demand */
+ PL_lastscream = Nullsv;
+
+ PL_watchaddr = NULL;
+ PL_watchok = Nullch;
+
+ PL_regdummy = proto_perl->Tregdummy;
+ PL_regcomp_parse = Nullch;
+ PL_regxend = Nullch;
+ PL_regcode = (regnode*)NULL;
+ PL_regnaughty = 0;
+ PL_regsawback = 0;
+ PL_regprecomp = Nullch;
+ PL_regnpar = 0;
+ PL_regsize = 0;
+ PL_regflags = 0;
+ PL_regseen = 0;
+ PL_seen_zerolen = 0;
+ PL_seen_evals = 0;
+ PL_regcomp_rx = (regexp*)NULL;
+ PL_extralen = 0;
+ PL_colorset = 0; /* reinits PL_colors[] */
+ /*PL_colors[6] = {0,0,0,0,0,0};*/
+ PL_reg_whilem_seen = 0;
+ PL_reginput = Nullch;
+ PL_regbol = Nullch;
+ PL_regeol = Nullch;
+ PL_regstartp = (I32*)NULL;
+ PL_regendp = (I32*)NULL;
+ PL_reglastparen = (U32*)NULL;
+ PL_regtill = Nullch;
+ PL_regprev = '\n';
+ PL_reg_start_tmp = (char**)NULL;
+ PL_reg_start_tmpl = 0;
+ PL_regdata = (struct reg_data*)NULL;
+ PL_bostr = Nullch;
+ PL_reg_flags = 0;
+ PL_reg_eval_set = 0;
+ PL_regnarrate = 0;
+ PL_regprogram = (regnode*)NULL;
+ PL_regindent = 0;
+ PL_regcc = (CURCUR*)NULL;
+ PL_reg_call_cc = (struct re_cc_state*)NULL;
+ PL_reg_re = (regexp*)NULL;
+ PL_reg_ganch = Nullch;
+ PL_reg_sv = Nullsv;
+ PL_reg_magic = (MAGIC*)NULL;
+ PL_reg_oldpos = 0;
+ PL_reg_oldcurpm = (PMOP*)NULL;
+ PL_reg_curpm = (PMOP*)NULL;
+ PL_reg_oldsaved = Nullch;
+ PL_reg_oldsavedlen = 0;
+ PL_reg_maxiter = 0;
+ PL_reg_leftiter = 0;
+ PL_reg_poscache = Nullch;
+ PL_reg_poscache_size= 0;
+
+ /* RE engine - function pointers */
+ PL_regcompp = proto_perl->Tregcompp;
+ PL_regexecp = proto_perl->Tregexecp;
+ PL_regint_start = proto_perl->Tregint_start;
+ PL_regint_string = proto_perl->Tregint_string;
+ PL_regfree = proto_perl->Tregfree;
+
+ PL_reginterp_cnt = 0;
+ PL_reg_starttry = 0;
+
+#ifdef PERL_OBJECT
+ return (PerlInterpreter*)pPerl;
+#else
+ return my_perl;
+#endif
+}
+
+#else /* !USE_ITHREADS */
#ifdef PERL_OBJECT
-#define NO_XSLOCKS
#include "XSUB.h"
#endif
+#endif /* USE_ITHREADS */
+
static void
do_report_used(pTHXo_ SV *sv)
{
if (SvTYPE(sv) != SVTYPEMASK) {
- /* XXX Perhaps this ought to go to Perl_debug_log, if DEBUGGING. */
- PerlIO_printf(PerlIO_stderr(), "****\n");
+ PerlIO_printf(Perl_debug_log, "****\n");
sv_dump(sv);
}
}
static void
do_clean_named_objs(pTHXo_ SV *sv)
{
- if (SvTYPE(sv) == SVt_PVGV) {
+ if (SvTYPE(sv) == SVt_PVGV && GvGP(sv)) {
if ( SvOBJECT(GvSV(sv)) ||
GvAV(sv) && SvOBJECT(GvAV(sv)) ||
GvHV(sv) && SvOBJECT(GvHV(sv)) ||
static void
do_clean_all(pTHXo_ SV *sv)
{
- DEBUG_D((PerlIO_printf(Perl_debug_log, "Cleaning loops: SV at 0x%lx\n", sv) );)
+ DEBUG_D((PerlIO_printf(Perl_debug_log, "Cleaning loops: SV at 0x%"UVxf"\n", PTR2UV(sv)) );)
SvFLAGS(sv) |= SVf_BREAK;
SvREFCNT_dec(sv);
}
#define SVf_BREAK 0x00400000 /* refcnt is artificially low */
#define SVf_READONLY 0x00800000 /* may not be modified */
-#define SVf_THINKFIRST (SVf_READONLY|SVf_ROK|SVf_FAKE)
#define SVp_IOK 0x01000000 /* has valid non-public integer value */
#define SVp_NOK 0x02000000 /* has valid non-public numeric value */
#define SVp_POK 0x04000000 /* has valid non-public pointer value */
#define SVp_SCREAM 0x08000000 /* has been studied? */
+#define SVf_UTF8 0x20000000 /* SvPVX is UTF-8 encoded */
+
+#define SVf_THINKFIRST (SVf_READONLY|SVf_ROK|SVf_FAKE|SVf_UTF8)
+
#define SVf_OK (SVf_IOK|SVf_NOK|SVf_POK|SVf_ROK| \
SVp_IOK|SVp_NOK|SVp_POK)
/* Some private flags. */
+/* SVpad_OUR may be set on SVt_PV{NV,MG,GV} types */
#define SVpad_OUR 0x80000000 /* pad name is "our" instead of "my" */
#define SVf_IVisUV 0x80000000 /* use XPVUV instead of XPVIV */
U8 xbm_rare; /* rarest character in string */
};
-/* This structure much match XPVCV */
+/* This structure much match XPVCV in cv.h */
typedef U16 cv_flags_t;
void (*xcv_xsub)(pTHXo_ CV*);
ANY xcv_xsubany;
GV * xcv_gv;
- GV * xcv_filegv;
- long xcv_depth; /* >= 2 indicates recursive call */
+ char * xcv_file;
+ long xcv_depth; /* >= 2 indicates recursive call */
AV * xcv_padlist;
CV * xcv_outside;
#ifdef USE_THREADS
char xio_flags;
};
-#define IOf_ARGV 1 /* this fp iterates over ARGV */
-#define IOf_START 2 /* check for null ARGV and substitute '-' */
-#define IOf_FLUSH 4 /* this fp wants a flush after write op */
-#define IOf_DIDTOP 8 /* just did top of form */
-#define IOf_UNTAINT 16 /* consider this fp (and its data) "safe" */
-#define IOf_NOLINE 32 /* slurped a pseudo-line from empty file */
+#define IOf_ARGV 1 /* this fp iterates over ARGV */
+#define IOf_START 2 /* check for null ARGV and substitute '-' */
+#define IOf_FLUSH 4 /* this fp wants a flush after write op */
+#define IOf_DIDTOP 8 /* just did top of form */
+#define IOf_UNTAINT 16 /* consider this fp (and its data) "safe" */
+#define IOf_NOLINE 32 /* slurped a pseudo-line from empty file */
+#define IOf_FAKE_DIRP 64 /* xio_dirp is fake (source filters kludge) */
/* The following macros define implementation-independent predicates on SVs. */
SvFLAGS(sv) |= (SVf_IOK|SVp_IOK))
#define SvIOK_only_UV(sv) (SvOK_off_exc_UV(sv), \
SvFLAGS(sv) |= (SVf_IOK|SVp_IOK))
-
+
#define SvIOK_UV(sv) ((SvFLAGS(sv) & (SVf_IOK|SVf_IVisUV)) \
== (SVf_IOK|SVf_IVisUV))
#define SvIOK_notUV(sv) ((SvFLAGS(sv) & (SVf_IOK|SVf_IVisUV)) \
#define SvNOK_only(sv) (SvOK_off(sv), \
SvFLAGS(sv) |= (SVf_NOK|SVp_NOK))
+#define SvUTF8(sv) (SvFLAGS(sv) & SVf_UTF8)
+#define SvUTF8_on(sv) (SvFLAGS(sv) |= (SVf_UTF8))
+#define SvUTF8_off(sv) (SvFLAGS(sv) &= ~(SVf_UTF8))
+
#define SvPOK(sv) (SvFLAGS(sv) & SVf_POK)
#define SvPOK_on(sv) (SvFLAGS(sv) |= (SVf_POK|SVp_POK))
#define SvPOK_off(sv) (SvFLAGS(sv) &= ~(SVf_POK|SVp_POK))
#define SvPV_force(sv, lp) sv_pvn_force(sv, &lp)
#define SvPV(sv, lp) sv_pvn(sv, &lp)
#define SvPV_nolen(sv) sv_pv(sv)
+
+#define SvPVutf8_force(sv, lp) sv_pvutf8n_force(sv, &lp)
+#define SvPVutf8(sv, lp) sv_pvutf8n(sv, &lp)
+#define SvPVutf8_nolen(sv) sv_pvutf8(sv)
+
+#define SvPVbyte_force(sv, lp) sv_pvbyte_force(sv, &lp)
+#define SvPVbyte(sv, lp) sv_pvbyten(sv, &lp)
+#define SvPVbyte_nolen(sv) sv_pvbyte(sv)
+
+#define SvPVx(sv, lp) sv_pvn(sv, &lp)
+#define SvPVx_force(sv, lp) sv_pvn_force(sv, &lp)
+#define SvPVutf8x(sv, lp) sv_pvutf8n(sv, &lp)
+#define SvPVutf8x_force(sv, lp) sv_pvutf8n_force(sv, &lp)
+#define SvPVbytex(sv, lp) sv_pvbyten(sv, &lp)
+#define SvPVbytex_force(sv, lp) sv_pvbyten_force(sv, &lp)
+
#define SvIVx(sv) sv_iv(sv)
#define SvUVx(sv) sv_uv(sv)
#define SvNVx(sv) sv_nv(sv)
-#define SvPVx(sv, lp) sv_pvn(sv, &lp)
-#define SvPVx_force(sv, lp) sv_pvn_force(sv, &lp)
+
#define SvTRUEx(sv) sv_true(sv)
#define SvIV(sv) SvIVx(sv)
#undef SvPV
#define SvPV(sv, lp) \
- (SvPOK(sv) ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pv(sv, &lp))
+ ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
+ ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pv(sv, &lp))
+
#undef SvPV_force
#define SvPV_force(sv, lp) \
#undef SvPV_nolen
#define SvPV_nolen(sv) \
- (SvPOK(sv) ? SvPVX(sv) : sv_2pv_nolen(sv))
+ ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
+ ? SvPVX(sv) : sv_2pv_nolen(sv))
+
+#undef SvPVutf8
+#define SvPVutf8(sv, lp) \
+ ((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK|SVf_UTF8) \
+ ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pvutf8(sv, &lp))
+
+#undef SvPVutf8_force
+#define SvPVutf8_force(sv, lp) \
+ ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == (SVf_POK|SVf_UTF8) \
+ ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_pvutf8n_force(sv, &lp))
+
+#undef SvPVutf8_nolen
+#define SvPVutf8_nolen(sv) \
+ ((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK|SVf_UTF8)\
+ ? SvPVX(sv) : sv_2pvutf8_nolen(sv))
+
+#undef SvPVutf8
+#define SvPVutf8(sv, lp) \
+ ((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK|SVf_UTF8) \
+ ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pvutf8(sv, &lp))
+
+#undef SvPVutf8_force
+#define SvPVutf8_force(sv, lp) \
+ ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == (SVf_POK|SVf_UTF8) \
+ ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_pvutf8n_force(sv, &lp))
+
+#undef SvPVutf8_nolen
+#define SvPVutf8_nolen(sv) \
+ ((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK|SVf_UTF8)\
+ ? SvPVX(sv) : sv_2pvutf8_nolen(sv))
+
+#undef SvPVbyte
+#define SvPVbyte(sv, lp) \
+ ((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK) \
+ ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pvbyte(sv, &lp))
+
+#undef SvPVbyte_force
+#define SvPVbyte_force(sv, lp) \
+ ((SvFLAGS(sv) & (SVf_POK|SVf_UTF8|SVf_THINKFIRST)) == (SVf_POK) \
+ ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_pvbyte_force(sv, &lp))
+
+#undef SvPVbyte_nolen
+#define SvPVbyte_nolen(sv) \
+ ((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK)\
+ ? SvPVX(sv) : sv_2pvbyte_nolen(sv))
+
#ifdef __GNUC__
# undef SvIVx
# undef SvUVx
# undef SvNVx
# undef SvPVx
+# undef SvPVutf8x
+# undef SvPVbytex
# undef SvTRUE
# undef SvTRUEx
# define SvIVx(sv) ({SV *nsv = (SV*)(sv); SvIV(nsv); })
# define SvUVx(sv) ({SV *nsv = (SV*)(sv); SvUV(nsv); })
# define SvNVx(sv) ({SV *nsv = (SV*)(sv); SvNV(nsv); })
# define SvPVx(sv, lp) ({SV *nsv = (sv); SvPV(nsv, lp); })
+# define SvPVutf8x(sv, lp) ({SV *nsv = (sv); SvPVutf8(nsv, lp); })
+# define SvPVbytex(sv, lp) ({SV *nsv = (sv); SvPVbyte(nsv, lp); })
# define SvTRUE(sv) ( \
!sv \
? 0 \
# undef SvUVx
# undef SvNVx
# undef SvPVx
+# undef SvPVutf8x
+# undef SvPVbytex
# undef SvTRUE
# undef SvTRUEx
# define SvIVx(sv) ((PL_Sv = (sv)), SvIV(PL_Sv))
# define SvUVx(sv) ((PL_Sv = (sv)), SvUV(PL_Sv))
# define SvNVx(sv) ((PL_Sv = (sv)), SvNV(PL_Sv))
# define SvPVx(sv, lp) ((PL_Sv = (sv)), SvPV(PL_Sv, lp))
+# define SvPVutf8x(sv, lp) ((PL_Sv = (sv)), SvPVutf8(PL_Sv, lp))
+# define SvPVbytex(sv, lp) ((PL_Sv = (sv)), SvPVbyte(PL_Sv, lp))
# define SvTRUE(sv) ( \
!sv \
? 0 \
}
}
else {
- $pct = sprintf("%.2f", ($files - $bad) / $files * 100);
+ $pct = $files ? sprintf("%.2f", ($files - $bad) / $files * 100) : "0.00";
if ($bad == 1) {
warn "Failed 1 test script out of $files, $pct% okay.\n";
}
unshift @INC, '../lib';
}
-print "1..7\n";
+print "1..10\n";
my $i = 1;
defined &foo, &foo, &foo;
undef &foo, $bar;
uc $bar,$bar;
+ grep(not($bar), $bar);
+ grep(not($bar, $bar), $bar);
+ grep((not $bar, $bar, $bar), $bar);
];
# don't make this lexical
$i = 1;
-print "1..4\n";
+print "1..16\n";
sub do_require {
%INC = ();
close REQ;
}
+# new style version numbers
+
+eval { require v5.5.630; };
+print "# $@\nnot " if $@;
+print "ok ",$i++,"\n";
+
+eval { require v10.0.2; };
+print "# $@\nnot " unless $@ =~ /^Perl v10\.0\.2 required/;
+print "ok ",$i++,"\n";
+
+eval q{ use v5.5.630; };
+print "# $@\nnot " if $@;
+print "ok ",$i++,"\n";
+
+eval q{ use v10.0.2; };
+print "# $@\nnot " unless $@ =~ /^Perl v10\.0\.2 required/;
+print "ok ",$i++,"\n";
+
+my $ver = v5.5.630;
+eval { require $ver; };
+print "# $@\nnot " if $@;
+print "ok ",$i++,"\n";
+
+$ver = v10.0.2;
+eval { require $ver; };
+print "# $@\nnot " unless $@ =~ /^Perl v10\.0\.2 required/;
+print "ok ",$i++,"\n";
+
+print "not " unless v5.5.1 gt v5.5;
+print "ok ",$i++,"\n";
+
+print "not " unless 5.005_01 > v5.5;
+print "ok ",$i++,"\n";
+
+print "not " unless 5.005_64 - v5.5.640 < 0.0000001;
+print "ok ",$i++,"\n";
+
+{
+ use utf8;
+ print "not " unless v5.5.640 eq "\x{5}\x{5}\x{280}";
+ print "ok ",$i++,"\n";
+
+ print "not " unless v7.15 eq "\x{7}\x{f}";
+ print "ok ",$i++,"\n";
+
+ print "not "
+ unless v1.20.300.4000.50000.600000 eq "\x{1}\x{14}\x{12c}\x{fa0}\x{c350}\x{927c0}";
+ print "ok ",$i++,"\n";
+}
+
# interaction with pod (see the eof)
write_file('bleah.pm', "print 'ok $i\n'; 1;\n");
require "bleah.pm";
#!./perl
-# $RCSfile: term.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:24 $
-
# tests that aren't important enough for base.term
-print "1..22\n";
+print "1..23\n";
$x = "\\n";
print "#1\t:$x: eq " . ':\n:' . "\n";
$a = "+{ \$a=>'foo'}";
$a = eval $a;
if (ref($a) eq 'HASH') {print "ok 22\n";} else {print "not ok 22\n";}
+
+$a = "{ 0x01 => 'foo'}->{0x01}";
+$a = eval $a;
+if ($a eq 'foo') {print "ok 23\n";} else {print "not ok 23\n";}
#!./perl
-print "1..6\n";
+BEGIN {
+ chdir 't' if -d 't';
+ unshift @INC, '../lib';
+}
+
+print "1..20\n";
+
+use File::Spec;
+
+my $devnull = File::Spec->devnull;
-open(try, '>Io.argv.tmp') || (die "Can't open temp file: $!");
+open(try, '>Io_argv1.tmp') || (die "Can't open temp file: $!");
print try "a line\n";
close try;
if ($^O eq 'MSWin32') {
- $x = `.\\perl -e "while (<>) {print \$.,\$_;}" Io.argv.tmp Io.argv.tmp`;
+ $x = `.\\perl -e "while (<>) {print \$.,\$_;}" Io_argv1.tmp Io_argv1.tmp`;
}
else {
- $x = `./perl -e 'while (<>) {print \$.,\$_;}' Io.argv.tmp Io.argv.tmp`;
+ $x = `./perl -e 'while (<>) {print \$.,\$_;}' Io_argv1.tmp Io_argv1.tmp`;
}
if ($x eq "1a line\n2a line\n") {print "ok 1\n";} else {print "not ok 1\n";}
if ($^O eq 'MSWin32') {
- $x = `.\\perl -le "print 'foo'" | .\\perl -e "while (<>) {print \$_;}" Io.argv.tmp -`;
+ $x = `.\\perl -le "print 'foo'" | .\\perl -e "while (<>) {print \$_;}" Io_argv1.tmp -`;
}
else {
- $x = `echo foo|./perl -e 'while (<>) {print $_;}' Io.argv.tmp -`;
+ $x = `echo foo|./perl -e 'while (<>) {print $_;}' Io_argv1.tmp -`;
}
if ($x eq "a line\nfoo\n") {print "ok 2\n";} else {print "not ok 2\n";}
}
if ($x eq "foo\n") {print "ok 3\n";} else {print "not ok 3 :$x:\n";}
-@ARGV = ('Io.argv.tmp', 'Io.argv.tmp', '/dev/null', 'Io.argv.tmp');
+@ARGV = ('Io_argv1.tmp', 'Io_argv1.tmp', $devnull, 'Io_argv1.tmp');
while (<>) {
$y .= $. . $_;
if (eof()) {
else
{print "not ok 5\n";}
-open(try, '>Io.argv.tmp') or die "Can't open temp file: $!";
+open(try, '>Io_argv1.tmp') or die "Can't open temp file: $!";
close try;
-@ARGV = 'Io.argv.tmp';
+open(try, '>Io_argv2.tmp') or die "Can't open temp file: $!";
+close try;
+@ARGV = ('Io_argv1.tmp', 'Io_argv2.tmp');
$^I = '.bak';
$/ = undef;
+my $i = 6;
while (<>) {
- s/^/ok 6\n/;
+ s/^/ok $i\n/;
+ ++$i;
print;
}
-open(try, '<Io.argv.tmp') or die "Can't open temp file: $!";
+open(try, '<Io_argv1.tmp') or die "Can't open temp file: $!";
+print while <try>;
+open(try, '<Io_argv2.tmp') or die "Can't open temp file: $!";
print while <try>;
close try;
+undef $^I;
+
+eof try or print 'not ';
+print "ok 8\n";
+
+eof NEVEROPENED or print 'not ';
+print "ok 9\n";
+
+open STDIN, 'Io_argv1.tmp' or die $!;
+@ARGV = ();
+!eof() or print 'not ';
+print "ok 10\n";
+
+<> eq "ok 6\n" or print 'not ';
+print "ok 11\n";
+
+open STDIN, $devnull or die $!;
+@ARGV = ();
+eof() or print 'not ';
+print "ok 12\n";
+
+@ARGV = ('Io_argv1.tmp');
+!eof() or print 'not ';
+print "ok 13\n";
+
+@ARGV = ($devnull, $devnull);
+!eof() or print 'not ';
+print "ok 14\n";
+
+close ARGV or die $!;
+eof() or print 'not ';
+print "ok 15\n";
+
+{
+ local $/;
+ open F, 'Io_argv1.tmp' or die;
+ <F>; # set $. = 1
+ open F, $devnull or die;
+ print "not " unless defined(<F>);
+ print "ok 16\n";
+ print "not " if defined(<F>);
+ print "ok 17\n";
+ print "not " if defined(<F>);
+ print "ok 18\n";
+ open F, $devnull or die; # restart cycle again
+ print "not " unless defined(<F>);
+ print "ok 19\n";
+ print "not " if defined(<F>);
+ print "ok 20\n";
+ close F;
+}
-END { unlink 'Io.argv.tmp', 'Io.argv.tmp.bak' }
+END { unlink 'Io_argv1.tmp', 'Io_argv1.tmp.bak', 'Io_argv2.tmp', 'Io_argv2.tmp.bak' }
$Is_Dosish = ($^O eq 'MSWin32' or $^O eq 'dos' or
$^O eq 'os2' or $^O eq 'mint');
+if (defined &Win32::IsWinNT && Win32::IsWinNT()) {
+ $Is_Dosish = '' if Win32::FsType() eq 'NTFS';
+}
+
print "1..28\n";
$wd = (($^O eq 'MSWin32') ? `cd` : `pwd`);
{print "ok 5\n";}
else {print "not ok 5\n";}
-if ((chmod 0777,'a') == 1) {print "ok 6\n";} else {print "not ok 6\n";}
+$newmode = $^O eq 'MSWin32' ? 0444 : 0777;
+if ((chmod $newmode,'a') == 1) {print "ok 6\n";} else {print "not ok 6\n";}
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
$blksize,$blocks) = stat('c');
if ($Is_Dosish) {print "ok 7 # skipped: no link\n";}
-elsif (($mode & 0777) == 0777) {print "ok 7\n";}
+elsif (($mode & 0777) == $newmode) {print "ok 7\n";}
else {print "not ok 7\n";}
+$newmode = 0700;
+if ($^O eq 'MSWin32') {
+ chmod 0444, 'x';
+ $newmode = 0666;
+}
+
if ($Is_Dosish) {print "ok 8 # skipped: no link\n";}
-elsif ((chmod 0700,'c','x') == 2) {print "ok 8\n";}
+elsif ((chmod $newmode,'c','x') == 2) {print "ok 8\n";}
else {print "not ok 8\n";}
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
$blksize,$blocks) = stat('c');
if ($Is_Dosish) {print "ok 9 # skipped: no link\n";}
-elsif (($mode & 0777) == 0700) {print "ok 9\n";}
+elsif (($mode & 0777) == $newmode) {print "ok 9\n";}
else {print "not ok 9\n";}
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
$blksize,$blocks) = stat('x');
if ($Is_Dosish) {print "ok 10 # skipped: no link\n";}
-elsif (($mode & 0777) == 0700) {print "ok 10\n";}
+elsif (($mode & 0777) == $newmode) {print "ok 10\n";}
else {print "not ok 10\n";}
if ($Is_Dosish) {print "ok 11 # skipped: no link\n"; unlink 'b','x'; }
print FH "helloworld\n";
truncate FH, 5;
}
- if ($^O eq 'dos') {
+ if ($^O eq 'dos'
+ # Not needed on HPFS, but needed on HPFS386 ?!
+ or $^O eq 'os2')
+ {
close (FH); open (FH, ">>Iofs.tmp") or die "Can't reopen Iofs.tmp";
}
if (-s "Iofs.tmp" == 5) {print "ok 25\n"} else {print "not ok 25\n"}
truncate FH, 0;
- if ($^O eq 'dos') {
+ if ($^O eq 'dos'
+ # Not needed on HPFS, but needed on HPFS386 ?!
+ or $^O eq 'os2')
+ {
close (FH); open (FH, ">>Iofs.tmp") or die "Can't reopen Iofs.tmp";
}
if (-z "Iofs.tmp") {print "ok 26\n"} else {print "not ok 26\n"}
--- /dev/null
+#!./perl
+
+print "1..5\n";
+
+my $j = 1;
+for $i ( 1,2,5,4,3 ) {
+ $file = mkfiles($i);
+ open(FH, "> $file") || die "can't create $file: $!";
+ print FH "not ok " . $j++ . "\n";
+ close(FH) || die "Can't close $file: $!";
+}
+
+
+{
+ local *ARGV;
+ local $^I = '.bak';
+ local $_;
+ @ARGV = mkfiles(1..3);
+ $n = 0;
+ while (<>) {
+ print STDOUT "# initial \@ARGV: [@ARGV]\n";
+ if ($n++ == 2) {
+ other();
+ }
+ show();
+ }
+}
+
+$^I = undef;
+@ARGV = mkfiles(1..3);
+$n = 0;
+while (<>) {
+ print STDOUT "#final \@ARGV: [@ARGV]\n";
+ if ($n++ == 2) {
+ other();
+ }
+ show();
+}
+
+sub show {
+ #warn "$ARGV: $_";
+ s/^not //;
+ print;
+}
+
+sub other {
+ print STDOUT "# Calling other\n";
+ local *ARGV;
+ local *ARGVOUT;
+ local $_;
+ @ARGV = mkfiles(5, 4);
+ while (<>) {
+ print STDOUT "# inner \@ARGV: [@ARGV]\n";
+ show();
+ }
+}
+
+sub mkfiles {
+ my @files = map { "scratch$_" } @_;
+ return wantarray ? @files : $files[-1];
+}
+
+END { unlink map { ($_, "$_.bak") } mkfiles(1..5) }
$^W = 1;
$Is_VMS = $^O eq 'VMS';
-print "1..32\n";
+print "1..66\n";
+
+my $test = 1;
+
+sub ok { print "ok $test\n"; $test++ }
# my $file tests
+# 1..9
{
-unlink("afile") if -f "afile";
-print "$!\nnot " unless open(my $f,"+>afile");
-print "ok 1\n";
-binmode $f;
-print "not " unless -f "afile";
-print "ok 2\n";
-print "not " unless print $f "SomeData\n";
-print "ok 3\n";
-print "not " unless tell($f) == 9;
-print "ok 4\n";
-print "not " unless seek($f,0,0);
-print "ok 5\n";
-$b = <$f>;
-print "not " unless $b eq "SomeData\n";
-print "ok 6\n";
-print "not " unless -f $f;
-print "ok 7\n";
-eval { die "Message" };
-# warn $@;
-print "not " unless $@ =~ /<\$f> line 1/;
-print "ok 8\n";
-print "not " unless close($f);
-print "ok 9\n";
-unlink("afile");
+ unlink("afile") if -f "afile";
+ print "$!\nnot " unless open(my $f,"+>afile");
+ ok;
+ binmode $f;
+ print "not " unless -f "afile";
+ ok;
+ print "not " unless print $f "SomeData\n";
+ ok;
+ print "not " unless tell($f) == 9;
+ ok;
+ print "not " unless seek($f,0,0);
+ ok;
+ $b = <$f>;
+ print "not " unless $b eq "SomeData\n";
+ ok;
+ print "not " unless -f $f;
+ ok;
+ eval { die "Message" };
+ # warn $@;
+ print "not " unless $@ =~ /<\$f> line 1/;
+ ok;
+ print "not " unless close($f);
+ ok;
+ unlink("afile");
}
+
+# 10..12
{
-print "# \$!='$!'\nnot " unless open(my $f,'>', 'afile');
-print "ok 10\n";
-print $f "a row\n";
-print "not " unless close($f);
-print "ok 11\n";
-print "not " unless -s 'afile' < 10;
-print "ok 12\n";
+ print "# \$!='$!'\nnot " unless open(my $f,'>', 'afile');
+ ok;
+ print $f "a row\n";
+ print "not " unless close($f);
+ ok;
+ print "not " unless -s 'afile' < 10;
+ ok;
}
+
+# 13..15
{
-print "# \$!='$!'\nnot " unless open(my $f,'>>', 'afile');
-print "ok 13\n";
-print $f "a row\n";
-print "not " unless close($f);
-print "ok 14\n";
-print "not " unless -s 'afile' > 10;
-print "ok 15\n";
+ print "# \$!='$!'\nnot " unless open(my $f,'>>', 'afile');
+ ok;
+ print $f "a row\n";
+ print "not " unless close($f);
+ ok;
+ print "not " unless -s 'afile' > 10;
+ ok;
}
+
+# 16..18
{
-print "# \$!='$!'\nnot " unless open(my $f, '<', 'afile');
-print "ok 16\n";
-@rows = <$f>;
-print "not " unless @rows == 2;
-print "ok 17\n";
-print "not " unless close($f);
-print "ok 18\n";
+ print "# \$!='$!'\nnot " unless open(my $f, '<', 'afile');
+ ok;
+ @rows = <$f>;
+ print "not " unless @rows == 2;
+ ok;
+ print "not " unless close($f);
+ ok;
}
+
+# 19..23
{
-print "not " unless -s 'afile' < 20;
-print "ok 19\n";
-print "# \$!='$!'\nnot " unless open(my $f, '+<', 'afile');
-print "ok 20\n";
-@rows = <$f>;
-print "not " unless @rows == 2;
-print "ok 21\n";
-seek $f, 0, 1;
-print $f "yet another row\n";
-print "not " unless close($f);
-print "ok 22\n";
-print "not " unless -s 'afile' > 20;
-print "ok 23\n";
-
-unlink("afile");
-}
-if ($Is_VMS) { for (24..46) { print "ok $_ # skipped: not Unix fork\n"; } }
+ print "not " unless -s 'afile' < 20;
+ ok;
+ print "# \$!='$!'\nnot " unless open(my $f, '+<', 'afile');
+ ok;
+ @rows = <$f>;
+ print "not " unless @rows == 2;
+ ok;
+ seek $f, 0, 1;
+ print $f "yet another row\n";
+ print "not " unless close($f);
+ ok;
+ print "not " unless -s 'afile' > 20;
+ ok;
+
+ unlink("afile");
+}
+
+# 24..26
+if ($Is_VMS) {
+ for (24..26) { print "ok $_ # skipped: not Unix fork\n"; }
+}
else {
-print "# \$!='$!'\nnot " unless open(my $f, '-|', <<'EOC');
-./perl -e "print qq(a row\n); print qq(another row\n)"
+ print "# \$!='$!'\nnot " unless open(my $f, '-|', <<'EOC');
+ ./perl -e "print qq(a row\n); print qq(another row\n)"
EOC
-print "ok 24\n";
-@rows = <$f>;
-print "not " unless @rows == 2;
-print "ok 25\n";
-print "not " unless close($f);
-print "ok 26\n";
-}
-if ($Is_VMS) { for (27..30) { print "OK $_ # skipped: not Unix fork\n"; } }
+ ok;
+ @rows = <$f>;
+ print "not " unless @rows == 2;
+ ok;
+ print "not " unless close($f);
+ ok;
+}
+
+# 27..30
+if ($Is_VMS) {
+ for (27..30) { print "ok $_ # skipped: not Unix fork\n"; }
+}
else {
-print "# \$!='$!'\nnot " unless open(my $f, '|-', <<'EOC');
-./perl -pe "s/^not //"
+ print "# \$!='$!'\nnot " unless open(my $f, '|-', <<'EOC');
+ ./perl -pe "s/^not //"
EOC
-print "ok 27\n";
-@rows = <$f>;
-print $f "not ok 28\n";
-print $f "not ok 29\n";
-print "#\nnot " unless close($f);
-sleep 1;
-print "ok 30\n";
+ ok;
+ @rows = <$f>;
+ print $f "not ok $test\n"; $test++;
+ print $f "not ok $test\n"; $test++;
+ print "#\nnot " unless close($f);
+ sleep 1;
+ ok;
}
+# 31..32
eval <<'EOE' and print "not ";
open my $f, '<&', 'afile';
1;
EOE
-print "ok 31\n";
+ok;
+$@ =~ /Unknown open\(\) mode \'<&\'/ or print "not ";
+ok;
+
+# local $file tests
+
+# 33..41
+{
+ unlink("afile") if -f "afile";
+ print "$!\nnot " unless open(local $f,"+>afile");
+ ok;
+ binmode $f;
+ print "not " unless -f "afile";
+ ok;
+ print "not " unless print $f "SomeData\n";
+ ok;
+ print "not " unless tell($f) == 9;
+ ok;
+ print "not " unless seek($f,0,0);
+ ok;
+ $b = <$f>;
+ print "not " unless $b eq "SomeData\n";
+ ok;
+ print "not " unless -f $f;
+ ok;
+ eval { die "Message" };
+ # warn $@;
+ print "not " unless $@ =~ /<\$f> line 1/;
+ ok;
+ print "not " unless close($f);
+ ok;
+ unlink("afile");
+}
+
+# 42..44
+{
+ print "# \$!='$!'\nnot " unless open(local $f,'>', 'afile');
+ ok;
+ print $f "a row\n";
+ print "not " unless close($f);
+ ok;
+ print "not " unless -s 'afile' < 10;
+ ok;
+}
+
+# 45..47
+{
+ print "# \$!='$!'\nnot " unless open(local $f,'>>', 'afile');
+ ok;
+ print $f "a row\n";
+ print "not " unless close($f);
+ ok;
+ print "not " unless -s 'afile' > 10;
+ ok;
+}
+
+# 48..50
+{
+ print "# \$!='$!'\nnot " unless open(local $f, '<', 'afile');
+ ok;
+ @rows = <$f>;
+ print "not " unless @rows == 2;
+ ok;
+ print "not " unless close($f);
+ ok;
+}
+
+# 51..55
+{
+ print "not " unless -s 'afile' < 20;
+ ok;
+ print "# \$!='$!'\nnot " unless open(local $f, '+<', 'afile');
+ ok;
+ @rows = <$f>;
+ print "not " unless @rows == 2;
+ ok;
+ seek $f, 0, 1;
+ print $f "yet another row\n";
+ print "not " unless close($f);
+ ok;
+ print "not " unless -s 'afile' > 20;
+ ok;
+
+ unlink("afile");
+}
+
+# 56..58
+if ($Is_VMS) {
+ for (56..58) { print "ok $_ # skipped: not Unix fork\n"; }
+}
+else {
+ print "# \$!='$!'\nnot " unless open(local $f, '-|', <<'EOC');
+ ./perl -e "print qq(a row\n); print qq(another row\n)"
+EOC
+ ok;
+ @rows = <$f>;
+ print "not " unless @rows == 2;
+ ok;
+ print "not " unless close($f);
+ ok;
+}
+
+# 59..62
+if ($Is_VMS) {
+ for (59..62) { print "ok $_ # skipped: not Unix fork\n"; }
+}
+else {
+ print "# \$!='$!'\nnot " unless open(local $f, '|-', <<'EOC');
+ ./perl -pe "s/^not //"
+EOC
+ ok;
+ @rows = <$f>;
+ print $f "not ok $test\n"; $test++;
+ print $f "not ok $test\n"; $test++;
+ print "#\nnot " unless close($f);
+ sleep 1;
+ ok;
+}
+
+# 63..64
+eval <<'EOE' and print "not ";
+open local $f, '<&', 'afile';
+1;
+EOE
+ok;
$@ =~ /Unknown open\(\) mode \'<&\'/ or print "not ";
-print "ok 32\n";
+ok;
+
+# 65..66
+{
+ local *F;
+ for (1..2) {
+ open(F, "echo #foo|") or print "not ";
+ print <F>;
+ close F;
+ }
+ ok;
+ for (1..2) {
+ open(F, "-|", "echo #foo") or print "not ";
+ print <F>;
+ close F;
+ }
+ ok;
+}
#!./perl
-# $RCSfile: print.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:32 $
-
-print "1..16\n";
+print "1..18\n";
$foo = 'STDOUT';
print $foo "ok 1\n";
@x = ("ok","12\nok","13\nok");
@y = ("15\nok","16");
print @x,"14\nok",@y;
+{
+ local $\ = "ok 17\n# null =>[\000]\nok 18\n";
+ print "";
+}
$test = 0;
$| = 1;
-print "1..358\n";
+print "1..362\n";
while (<DATA>) {
chop;
if (s/^&//) {
$try .= "0+\$x->fsqrt;";
} else {
$try .= "\$y = new Math::BigFloat \"$args[1]\";";
- if ($f eq fcmp){
+ if ($f eq "fcmp") {
$try .= "\$x <=> \$y;";
- }elsif ($f eq fadd){
+ } elsif ($f eq "fadd") {
$try .= "\$x + \$y;";
- }elsif ($f eq fsub){
+ } elsif ($f eq "fsub") {
$try .= "\$x - \$y;";
- }elsif ($f eq fmul){
+ } elsif ($f eq "fmul") {
$try .= "\$x * \$y;";
- }elsif ($f eq fdiv){
+ } elsif ($f eq "fdiv") {
$try .= "\$x / \$y;";
} else { warn "Unknown op"; }
}
+1:-1:1
-1:-1:0
+1:+1:0
+-1.1:0:-1
++0:-1.1:1
++1.1:+0:1
++0:+1.1:-1
+123:+123:0
+123:+12:1
+12:+123:-1
use charnames ':full';
-print "not " unless "Here\N{EXCLAMATION MARK}?" eq 'Here!?';
+print "not " unless "Here\N{EXCLAMATION MARK}?" eq "Here\041?";
print "ok 1\n";
-print "# \$res=$res \$\@='$@'\nnot "
- if $res = eval <<'EOE'
+{
+ no utf8; # UTEST can switch it on
+
+ print "# \$res=$res \$\@='$@'\nnot "
+ if $res = eval <<'EOE'
use charnames ":full";
"Here: \N{CYRILLIC SMALL LETTER BE}!";
1
EOE
- or $@ !~ /above 0xFF/;
-print "ok 2\n";
-# print "# \$res=$res \$\@='$@'\n";
+ or $@ !~ /above 0xFF/;
+ print "ok 2\n";
+ # print "# \$res=$res \$\@='$@'\n";
-print "# \$res=$res \$\@='$@'\nnot "
- if $res = eval <<'EOE'
+ print "# \$res=$res \$\@='$@'\nnot "
+ if $res = eval <<'EOE'
use charnames 'cyrillic';
"Here: \N{Be}!";
1
EOE
- or $@ !~ /CYRILLIC CAPITAL LETTER BE.*above 0xFF/;
-print "ok 3\n";
+ or $@ !~ /CYRILLIC CAPITAL LETTER BE.*above 0xFF/;
+ print "ok 3\n";
+}
# If octal representation of unicode char is \0xyzt, then the utf8 is \3xy\2zt
$encoded_be = "\320\261";
}
use Data::Dumper;
+use Config;
+my $Is_ebcdic = defined($Config{'ebcdic'}) && $Config{'ebcdic'} eq 'define';
$Data::Dumper::Pad = "#";
my $TMAX;
++$TNUM;
$t =~ s/([A-Z]+)\(0x[0-9a-f]+\)/$1(0xdeadbeef)/g
if ($WANT =~ /deadbeef/);
+ if ($Is_ebcdic) {
+ # these data need massaging with non ascii character sets
+ # because of hashing order differences
+ $WANT = join("\n",sort(split(/\n/,$WANT)));
+ $WANT =~ s/\,$//mg;
+ $t = join("\n",sort(split(/\n/,$t)));
+ $t =~ s/\,$//mg;
+ }
print( ($t eq $WANT and not $@) ? "ok $TNUM\n"
: "not ok $TNUM\n--Expected--\n$WANT\n--Got--\n$@$t\n");
++$TNUM;
$t =~ s/([A-Z]+)\(0x[0-9a-f]+\)/$1(0xdeadbeef)/g
if ($WANT =~ /deadbeef/);
+ if ($Is_ebcdic) {
+ # here too there are hashing order differences
+ $WANT = join("\n",sort(split(/\n/,$WANT)));
+ $WANT =~ s/\,$//mg;
+ $t = join("\n",sort(split(/\n/,$t)));
+ $t =~ s/\,$//mg;
+ }
print( ($t eq $WANT and not $@) ? "ok $TNUM\n"
: "not ok $TNUM\n--Expected--\n$WANT\n--Got--\n$@$t\n");
}
BEGIN { unshift @INC, '../lib' }
use English;
use Config;
-my $threads = $Config{'usethreads'} || 0;
+my $threads = $Config{'use5005threads'} || 0;
print $PID == $$ ? "ok 1\n" : "not ok 1\n";
# We should get compile time failures field name typos
eval q(my D3 $obj3 = $obj2; $obj3->{notthere} = "");
-print "not " unless $@ && $@ =~ /^No such field "notthere"/;
+print "not " unless $@ && $@ =~ /^No such pseudo-hash field "notthere"/;
print "ok ", ++$testno, "\n";
#fields::_dump();
unshift @INC, '../lib';
}
-print "1..11\n";
-
$| = 1;
+my @pass = (0,1);
+my $tests = 11;
+printf "1..%d\n", $tests * scalar(@pass);
+
use File::Copy;
-# First we create a file
-open(F, ">file-$$") or die;
-binmode F; # for DOSISH platforms, because test 3 copies to stdout
-print F "ok 3\n";
-close F;
-
-copy "file-$$", "copy-$$";
-
-open(F, "copy-$$") or die;
-$foo = <F>;
-close(F);
-
-print "not " if -s "file-$$" != -s "copy-$$";
-print "ok 1\n";
-
-print "not " unless $foo eq "ok 3\n";
-print "ok 2\n";
-
-binmode STDOUT unless $^O eq 'VMS'; # Copy::copy works in binary mode
-copy "copy-$$", \*STDOUT;
-unlink "copy-$$" or die "unlink: $!";
-
-open(F,"file-$$");
-copy(*F, "copy-$$");
-open(R, "copy-$$") or die "open copy-$$: $!"; $foo = <R>; close(R);
-print "not " unless $foo eq "ok 3\n";
-print "ok 4\n";
-unlink "copy-$$" or die "unlink: $!";
-open(F,"file-$$");
-copy(\*F, "copy-$$");
-close(F) or die "close: $!";
-open(R, "copy-$$") or die; $foo = <R>; close(R) or die "close: $!";
-print "not " unless $foo eq "ok 3\n";
-print "ok 5\n";
-unlink "copy-$$" or die "unlink: $!";
-
-require IO::File;
-$fh = IO::File->new(">copy-$$") or die "Cannot open copy-$$:$!";
-binmode $fh or die;
-copy("file-$$",$fh);
-$fh->close or die "close: $!";
-open(R, "copy-$$") or die; $foo = <R>; close(R);
-print "# foo=`$foo'\nnot " unless $foo eq "ok 3\n";
-print "ok 6\n";
-unlink "copy-$$" or die "unlink: $!";
-require FileHandle;
-my $fh = FileHandle->new(">copy-$$") or die "Cannot open copy-$$:$!";
-binmode $fh or die;
-copy("file-$$",$fh);
-$fh->close;
-open(R, "copy-$$") or die; $foo = <R>; close(R);
-print "not " unless $foo eq "ok 3\n";
-print "ok 7\n";
-unlink "file-$$" or die "unlink: $!";
-
-print "# moved missing file.\nnot " if move("file-$$", "copy-$$");
-print "# target disappeared.\nnot " if not -e "copy-$$";
-print "ok 8\n";
-
-move "copy-$$", "file-$$" or print "# move did not succeed.\n";
-print "# not moved: $!\nnot " unless -e "file-$$" and not -e "copy-$$";
-open(R, "file-$$") or die; $foo = <R>; close(R);
-print "# foo=`$foo'\nnot " unless $foo eq "ok 3\n";
-print "ok 9\n";
-
-copy "file-$$", "lib";
-open(R, "lib/file-$$") or die; $foo = <R>; close(R);
-print "not " unless $foo eq "ok 3\n";
-print "ok 10\n";
-unlink "lib/file-$$" or die "unlink: $!";
-
-move "file-$$", "lib";
-open(R, "lib/file-$$") or die "open lib/file-$$: $!"; $foo = <R>; close(R);
-print "not " unless $foo eq "ok 3\n" and not -e "file-$$";;
-print "ok 11\n";
-unlink "lib/file-$$" or die "unlink: $!";
+for my $pass (@pass) {
+
+ require File::Copy;
+
+ my $loopconst = $pass*$tests;
+
+ # First we create a file
+ open(F, ">file-$$") or die;
+ binmode F; # for DOSISH platforms, because test 3 copies to stdout
+ printf F "ok %d\n", 3 + $loopconst;
+ close F;
+
+ copy "file-$$", "copy-$$";
+
+ open(F, "copy-$$") or die;
+ $foo = <F>;
+ close(F);
+
+ print "not " if -s "file-$$" != -s "copy-$$";
+ printf "ok %d\n", 1 + $loopconst;
+
+ print "not " unless $foo eq sprintf "ok %d\n", 3+$loopconst;
+ printf "ok %d\n", 2+$loopconst;
+
+ binmode STDOUT unless $^O eq 'VMS'; # Copy::copy works in binary mode
+ copy "copy-$$", \*STDOUT;
+ unlink "copy-$$" or die "unlink: $!";
+
+ open(F,"file-$$");
+ copy(*F, "copy-$$");
+ open(R, "copy-$$") or die "open copy-$$: $!"; $foo = <R>; close(R);
+ print "not " unless $foo eq sprintf "ok %d\n", 3+$loopconst;
+ printf "ok %d\n", 4+$loopconst;
+ unlink "copy-$$" or die "unlink: $!";
+ open(F,"file-$$");
+ copy(\*F, "copy-$$");
+ close(F) or die "close: $!";
+ open(R, "copy-$$") or die; $foo = <R>; close(R) or die "close: $!";
+ print "not " unless $foo eq sprintf "ok %d\n", 3+$loopconst;
+ printf "ok %d\n", 5+$loopconst;
+ unlink "copy-$$" or die "unlink: $!";
+
+ require IO::File;
+ $fh = IO::File->new(">copy-$$") or die "Cannot open copy-$$:$!";
+ binmode $fh or die;
+ copy("file-$$",$fh);
+ $fh->close or die "close: $!";
+ open(R, "copy-$$") or die; $foo = <R>; close(R);
+ print "# foo=`$foo'\nnot " unless $foo eq sprintf "ok %d\n", 3+$loopconst;
+ printf "ok %d\n", 6+$loopconst;
+ unlink "copy-$$" or die "unlink: $!";
+ require FileHandle;
+ my $fh = FileHandle->new(">copy-$$") or die "Cannot open copy-$$:$!";
+ binmode $fh or die;
+ copy("file-$$",$fh);
+ $fh->close;
+ open(R, "copy-$$") or die; $foo = <R>; close(R);
+ print "not " unless $foo eq sprintf "ok %d\n", 3+$loopconst;
+ printf "ok %d\n", 7+$loopconst;
+ unlink "file-$$" or die "unlink: $!";
+
+ print "# moved missing file.\nnot " if move("file-$$", "copy-$$");
+ print "# target disappeared.\nnot " if not -e "copy-$$";
+ printf "ok %d\n", 8+$loopconst;
+
+ move "copy-$$", "file-$$" or print "# move did not succeed.\n";
+ print "# not moved: $!\nnot " unless -e "file-$$" and not -e "copy-$$";
+ open(R, "file-$$") or die; $foo = <R>; close(R);
+ print "# foo=`$foo'\nnot " unless $foo eq sprintf "ok %d\n", 3+$loopconst;
+ printf "ok %d\n", 9+$loopconst;
+
+ copy "file-$$", "lib";
+ open(R, "lib/file-$$") or die; $foo = <R>; close(R);
+ print "not " unless $foo eq sprintf "ok %d\n", 3+$loopconst;
+ printf "ok %d\n", 10+$loopconst;
+ unlink "lib/file-$$" or die "unlink: $!";
+
+ move "file-$$", "lib";
+ open(R, "lib/file-$$") or die "open lib/file-$$: $!"; $foo = <R>; close(R);
+ print "not " unless $foo eq sprintf("ok %d\n", 3+$loopconst)
+ and not -e "file-$$";;
+ printf "ok %d\n", 11+$loopconst;
+ unlink "lib/file-$$" or die "unlink: $!";
+
+ # warn sprintf "INC->".$INC{"File/Copy.pm"};
+ delete $INC{"File/Copy.pm"};
+
+}
+
+END {
+ 1 while unlink "file-$$";
+ 1 while unlink "lib/file-$$";
+}
-#!./perl
+####!./perl
+
+
+my %Expect;
+my $symlink_exists = eval { symlink("",""); 1 };
BEGIN {
chdir 't' if -d 't';
unshift @INC, '../lib';
}
-print "1..2\n";
+if ( $symlink_exists ) { print "1..59\n"; }
+else { print "1..31\n"; }
use File::Find;
-# hope we will eventually find ourself
find(sub { print "ok 1\n" if $_ eq 'filefind.t'; }, ".");
finddepth(sub { print "ok 2\n" if $_ eq 'filefind.t'; }, ".");
+
+
+my $case = 2;
+
+END {
+ unlink 'FA/FA_ord','FA/FSL','FA/FAA/FAA_ord',
+ 'FA/FAB/FAB_ord','FA/FAB/FABA/FABA_ord','FB/FB_ord','FB/FBA/FBA_ord';
+ rmdir 'FA/FAA';
+ rmdir 'FA/FAB/FABA';
+ rmdir 'FA/FAB';
+ rmdir 'FA';
+ rmdir 'FB/FBA';
+ rmdir 'FB';
+}
+
+sub Check($) {
+ $case++;
+ if ($_[0]) { print "ok $case\n"; }
+ else { print "not ok $case\n"; }
+}
+
+sub CheckDie($) {
+ $case++;
+ if ($_[0]) { print "ok $case\n"; }
+ else { print "not ok $case\n $!\n"; exit 0; }
+}
+
+sub touch {
+ CheckDie( open(my $T,'>',$_[0]) );
+}
+
+sub MkDir($$) {
+ CheckDie( mkdir($_[0],$_[1]) );
+}
+
+sub wanted {
+ print "# '$_' => 1\n";
+ Check( $Expect{$_} );
+ delete $Expect{$_};
+ $File::Find::prune=1 if $_ eq 'FABA';
+}
+
+MkDir( 'FA',0770 );
+MkDir( 'FB',0770 );
+touch('FB/FB_ord');
+MkDir( 'FB/FBA',0770 );
+touch('FB/FBA/FBA_ord');
+CheckDie( symlink('../FB','FA/FSL') ) if $symlink_exists;
+touch('FA/FA_ord');
+
+MkDir( 'FA/FAA',0770 );
+touch('FA/FAA/FAA_ord');
+MkDir( 'FA/FAB',0770 );
+touch('FA/FAB/FAB_ord');
+MkDir( 'FA/FAB/FABA',0770 );
+touch('FA/FAB/FABA/FABA_ord');
+
+%Expect = ('.' => 1, 'FSL' => 1, 'FA_ord' => 1, 'FAB' => 1, 'FAB_ord' => 1,
+ 'FABA' => 1, 'FAA' => 1, 'FAA_ord' => 1);
+delete $Expect{'FSL'} unless $symlink_exists;
+File::Find::find( {wanted => \&wanted, },'FA' );
+Check( scalar(keys %Expect) == 0 );
+
+%Expect=('FA' => 1, 'FA/FSL' => 1, 'FA/FA_ord' => 1, 'FA/FAB' => 1,
+ 'FA/FAB/FAB_ord' => 1, 'FA/FAB/FABA' => 1,
+ 'FA/FAB/FABA/FABA_ord' => 1, 'FA/FAA' => 1, 'FA/FAA/FAA_ord' => 1);
+delete $Expect{'FA/FSL'} unless $symlink_exists;
+File::Find::find( {wanted => \&wanted, no_chdir => 1},'FA' );
+
+Check( scalar(keys %Expect) == 0 );
+
+if ( $symlink_exists ) {
+ %Expect=('.' => 1, 'FA_ord' => 1, 'FSL' => 1, 'FB_ord' => 1, 'FBA' => 1,
+ 'FBA_ord' => 1, 'FAB' => 1, 'FAB_ord' => 1, 'FABA' => 1, 'FAA' => 1,
+ 'FAA_ord' => 1);
+
+ File::Find::find( {wanted => \&wanted, follow_fast => 1},'FA' );
+ Check( scalar(keys %Expect) == 0 );
+ %Expect=('FA' => 1, 'FA/FA_ord' => 1, 'FA/FSL' => 1, 'FA/FSL/FB_ord' => 1,
+ 'FA/FSL/FBA' => 1, 'FA/FSL/FBA/FBA_ord' => 1, 'FA/FAB' => 1,
+ 'FA/FAB/FAB_ord' => 1, 'FA/FAB/FABA' => 1, 'FA/FAB/FABA/FABA_ord' => 1,
+ 'FA/FAA' => 1, 'FA/FAA/FAA_ord' => 1);
+ File::Find::find( {wanted => \&wanted, follow_fast => 1, no_chdir => 1},'FA' );
+ Check( scalar(keys %Expect) == 0 );
+}
+
+print "# of cases: $case\n";
--- /dev/null
+#!./perl
+
+BEGIN {
+ chdir 't' if -d 't';
+ unshift @INC, '../lib';
+
+ print "1..9\n";
+}
+END {
+ print "not ok 1\n" unless $loaded;
+}
+use File::Glob ':glob';
+$loaded = 1;
+print "ok 1\n";
+
+sub array {
+ return '(', join(", ", map {defined $_ ? "\"$_\"" : "undef"} @a), ")\n";
+}
+
+# look for the contents of the current directory
+$ENV{PATH} = "/bin";
+delete @ENV{BASH_ENV, CDPATH, ENV, IFS};
+@correct = ();
+if (opendir(D, ".")) {
+ @correct = grep { !/^\.\.?$/ } sort readdir(D);
+ closedir D;
+}
+@a = File::Glob::glob("*", 0);
+@a = sort @a;
+if ("@a" ne "@correct" || GLOB_ERROR) {
+ print "# |@a| ne |@correct|\nnot ";
+}
+print "ok 2\n";
+
+# look up the user's home directory
+# should return a list with one item, and not set ERROR
+if ($^O ne 'MSWin32') {
+ eval {
+ ($name, $home) = (getpwuid($>))[0,7];
+ 1;
+ } and do {
+ @a = File::Glob::glob("~$name", GLOB_TILDE);
+ if (scalar(@a) != 1 || $a[0] ne $home || GLOB_ERROR) {
+ print "not ";
+ }
+ };
+}
+print "ok 3\n";
+
+# check backslashing
+# should return a list with one item, and not set ERROR
+@a = File::Glob::glob('TEST', GLOB_QUOTE);
+if (scalar @a != 1 || $a[0] ne 'TEST' || GLOB_ERROR) {
+ local $/ = "][";
+ print "# [@a]\n";
+ print "not ";
+}
+print "ok 4\n";
+
+# check nonexistent checks
+# should return an empty list
+# XXX since errfunc is NULL on win32, this test is not valid there
+@a = File::Glob::glob("asdfasdf", 0);
+if ($^O ne 'MSWin32' and scalar @a != 0) {
+ print "# |@a|\nnot ";
+}
+print "ok 5\n";
+
+# check bad protections
+# should return an empty list, and set ERROR
+if ($^O eq 'MSWin32' or $^O eq 'os2' or not $>) {
+ print "ok 6 # skipped\n";
+}
+else {
+ $dir = "PtEeRsLt.dir";
+ mkdir $dir, 0;
+ @a = File::Glob::glob("$dir/*", GLOB_ERR);
+ #print "\@a = ", array(@a);
+ rmdir $dir;
+ if (scalar(@a) != 0 || GLOB_ERROR == 0) {
+ print "not ";
+ }
+ print "ok 6\n";
+}
+
+# check for csh style globbing
+@a = File::Glob::glob('{a,b}', GLOB_BRACE | GLOB_NOMAGIC);
+unless (@a == 2 and $a[0] eq 'a' and $a[1] eq 'b') {
+ print "not ";
+}
+print "ok 7\n";
+
+@a = File::Glob::glob(
+ '{TES*,doesntexist*,a,b}',
+ GLOB_BRACE | GLOB_NOMAGIC
+);
+unless (@a == 3
+ and $a[0] eq 'TEST'
+ and $a[1] eq 'a'
+ and $a[2] eq 'b')
+{
+ print "not ";
+}
+print "ok 8\n";
+
+# "~" should expand to $ENV{HOME}
+$ENV{HOME} = "sweet home";
+@a = File::Glob::glob('~', GLOB_TILDE | GLOB_NOMAGIC);
+unless (@a == 1 and $a[0] eq $ENV{HOME}) {
+ print "not ";
+}
+print "ok 9\n";
--- /dev/null
+#!./perl
+
+BEGIN {
+ chdir 't' if -d 't';
+ unshift @INC, '../lib';
+ print "1..7\n";
+}
+END {
+ print "not ok 1\n" unless $loaded;
+}
+use File::Glob qw(:glob csh_glob);
+$loaded = 1;
+print "ok 1\n";
+
+# Test the actual use of the case sensitivity tags, via csh_glob()
+import File::Glob ':nocase';
+@a = csh_glob("lib/G*.t"); # At least glob-basic.t glob-case.t glob-global.t
+print "not " unless @a >= 3;
+print "ok 2\n";
+
+# This may fail on systems which are not case-PRESERVING
+import File::Glob ':case';
+@a = csh_glob("lib/G*.t"); # None should be uppercase
+print "not " unless @a == 0;
+print "ok 3\n";
+
+# Test the explicit use of the GLOB_NOCASE flag
+@a = File::Glob::glob("lib/G*.t", GLOB_NOCASE);
+print "not " unless @a >= 3;
+print "ok 4\n";
+
+# Test Win32 backslash nastiness...
+if ($^O ne 'MSWin32') {
+ print "ok 5\nok 6\nok 7\n";
+}
+else {
+ @a = File::Glob::glob("lib\\g*.t");
+ print "not " unless @a >= 3;
+ print "ok 5\n";
+ mkdir "[]", 0;
+ @a = File::Glob::glob("\\[\\]", GLOB_QUOTE);
+ rmdir "[]";
+ print "# returned @a\nnot " unless @a == 1;
+ print "ok 6\n";
+ @a = File::Glob::glob("lib\\*", GLOB_QUOTE);
+ print "not " if @a == 0;
+ print "ok 7\n";
+}
--- /dev/null
+#!./perl
+
+BEGIN {
+ chdir 't' if -d 't';
+ unshift @INC, '../lib';
+
+ print "1..10\n";
+}
+END {
+ print "not ok 1\n" unless $loaded;
+}
+
+BEGIN {
+ *CORE::GLOBAL::glob = sub { "Just another Perl hacker," };
+}
+
+BEGIN {
+ if ("Just another Perl hacker," ne (<*>)[0]) {
+ die <<EOMessage;
+Your version of perl ($]) doesn't seem to allow extensions to override
+the core glob operator.
+EOMessage
+ }
+}
+
+use File::Glob ':globally';
+$loaded = 1;
+print "ok 1\n";
+
+$_ = "lib/*.t";
+my @r = glob;
+print "not " if $_ ne 'lib/*.t';
+print "ok 2\n";
+
+# we should have at least basic.t, global.t, taint.t
+print "# |@r|\nnot " if @r < 3;
+print "ok 3\n";
+
+# check if <*/*> works
+@r = <*/*.t>;
+# at least t/global.t t/basic.t, t/taint.t
+print "not " if @r < 3;
+print "ok 4\n";
+my $r = scalar @r;
+
+# check if scalar context works
+@r = ();
+while (defined($_ = <*/*.t>)) {
+ #print "# $_\n";
+ push @r, $_;
+}
+print "not " if @r != $r;
+print "ok 5\n";
+
+# check if array context works
+@r = ();
+for (<*/*.t>) {
+ #print "# $_\n";
+ push @r, $_;
+}
+print "not " if @r != $r;
+print "ok 6\n";
+
+# test if implicit assign to $_ in while() works
+@r = ();
+while (<*/*.t>) {
+ #print "# $_\n";
+ push @r, $_;
+}
+print "not " if @r != $r;
+print "ok 7\n";
+
+# test if explicit glob() gets assign magic too
+my @s = ();
+while (glob '*/*.t') {
+ #print "# $_\n";
+ push @s, $_;
+}
+print "not " if "@r" ne "@s";
+print "ok 8\n";
+
+# how about in a different package, like?
+package Foo;
+use File::Glob ':globally';
+@s = ();
+while (glob '*/*.t') {
+ #print "# $_\n";
+ push @s, $_;
+}
+print "not " if "@r" ne "@s";
+print "ok 9\n";
+
+# test if different glob ops maintain independent contexts
+@s = ();
+my $i = 0;
+while (<*/*.t>) {
+ #print "# $_ <";
+ push @s, $_;
+ while (<bas*/*.t>) {
+ #print " $_";
+ $i++;
+ }
+ #print " >\n";
+}
+print "not " if "@r" ne "@s" or not $i;
+print "ok 10\n";
--- /dev/null
+#!./perl -T
+
+BEGIN {
+ chdir 't' if -d 't';
+ unshift @INC, '../lib';
+ print "1..2\n";
+}
+END {
+ print "not ok 1\n" unless $loaded;
+}
+use File::Glob;
+$loaded = 1;
+print "ok 1\n";
+
+# all filenames should be tainted
+@a = File::Glob::glob("*");
+eval { $a = join("",@a), kill 0; 1 };
+unless ($@ =~ /Insecure dependency/) {
+ print "not ";
+}
+print "ok 2\n";
chdir 't' if -d 't';
unshift @INC, '../lib' if -d '../lib';
}
+ # ``use IO::Socket'' executes too early below in the os2 block
+ if ($^O eq 'dos') {
+ print "1..0 # Skip: no fork\n";
+ }
}
use Config;
my $msgtype = 1;
my $msgtext = "hello";
- msgsnd($msg,pack("L a*",$msgtype,$msgtext),0) or print "not ";
+ my $test2bad;
+ my $test5bad;
+ my $test6bad;
+
+ unless (msgsnd($msg,pack("L a*",$msgtype,$msgtext),IPC_NOWAIT)) {
+ print "not ";
+ $test2bad = 1;
+ }
print "ok 2\n";
+ if ($test2bad) {
+ print <<EOM;
+#
+# The failure of the subtest #2 may indicate that the message queue
+# resource limits either of the system or of the testing account
+# have been reached. Error message "Operating would block" is
+# usually indicative of this situation. The error message was now:
+# "$!"
+#
+# You can check the message queues with the 'ipcs' command and
+# you can remove unneeded queues with the 'ipcrm -q id' command.
+# You may also consider configuring your system or account
+# to have more message queue resources.
+#
+# Because of the subtest #2 failing also the substests #5 and #6 will
+# very probably also fail.
+#
+EOM
+ }
my $data;
msgctl($msg,IPC_STAT,$data) or print "not ";
print "ok 4\n";
my $msgbuf;
- msgrcv($msg,$msgbuf,256,0,IPC_NOWAIT) or print "not ";
+ unless (msgrcv($msg,$msgbuf,256,0,IPC_NOWAIT)) {
+ print "not ";
+ $test5bad = 1;
+ }
print "ok 5\n";
+ if ($test5bad && $test2bad) {
+ print <<EOM;
+#
+# This failure was to be expected because the subtest #2 failed.
+#
+EOM
+ }
my($rmsgtype,$rmsgtext) = unpack("L a*",$msgbuf);
- print "not " unless($rmsgtype == $msgtype && $rmsgtext eq $msgtext);
+ unless($rmsgtype == $msgtype && $rmsgtext eq $msgtext) {
+ print "not ";
+ $test6bad = 1;
+ }
print "ok 6\n";
+ if ($test6bad && $test2bad) {
+ print <<EOM;
+#
+# This failure was to be expected because the subtest #2 failed.
+#
+EOM
+ }
} else {
for (1..6) {
print "ok $_\n"; # fake it
if ($Config{d_strtod}) {
$lc = &POSIX::setlocale(&POSIX::LC_NUMERIC, 'C') if $Config{d_setlocale};
($n, $x) = &POSIX::strtod('3.14159_OR_SO');
+# Using long double NVs may introduce greater accuracy than wanted.
+ $n =~ s/^3.14158999\d*$/3.14159/
+ if $Config{uselongdouble} eq 'define';
print (($n == 3.14159) && ($x == 6) ? "ok 14\n" : "not ok 14\n");
&POSIX::setlocale(&POSIX::LC_NUMERIC, $lc) if $Config{d_setlocale};
} else { print "# strtod not present\n", "ok 14\n"; }
sub sayok { print "ok @_\n" }
$cpt->share(qw($foo %bar @baz *glob sayok));
-$cpt->share('$"') unless $Config{archname} =~ /-thread$/;
+$cpt->share('$"') unless $Config{use5005threads};
$cpt->reval(q{
package other;
my $t = 30;
$cpt->rdo('/non/existant/file.name');
# The regexp is getting rather baroque.
-print $! =~ /No such file|file specification syntax error|A file or directory in the path name does not exist|Invalid argument|Device not configured|file not found/i ? "ok $t\n" : "not ok $t # $!\n"; $t++;
+print $! =~ /No such file|file specification syntax error|A file or directory in the path name does not exist|Invalid argument|Device not configured|file not found|File or directory doesn't exist/i ? "ok $t\n" : "not ok $t # $!\n"; $t++;
# test #31 is gone.
print 1 ? "ok $t\n" : "not ok $t\n#$@/$!\n"; $t++;
# If you modify/add tests here, remember to update also t/op/lfs.t.
BEGIN {
- # Don't bother if there are no quads.
- eval { my $q = pack "q", 0 };
- if ($@) {
- print "1..0\n# no 64-bit types\n";
- exit(0);
- }
chdir 't' if -d 't';
unshift @INC, '../lib';
require Config; import Config;
EOM
}
+print "# checking whether we have sparse files...\n";
+
# Known have-nots.
if ($^O eq 'win32' || $^O eq 'vms') {
- print "1..0\n# no sparse files\n";
+ print "1..0\n# no sparse files (because this is $^O) \n";
bye();
}
# Known haves that have problems running this test
# (for example because they do not support sparse files, like UNICOS)
if ($^O eq 'unicos') {
- print "1..0\n# large files known to work but unable to test them here\n";
+ print "1..0\n# large files known to work but unable to test them here ($^O)\n";
bye();
}
-# Then try to deduce whether we have sparse files.
+# Then try heuristically to deduce whether we have sparse files.
# We'll start off by creating a one megabyte file which has
# only three "true" bytes. If we have sparseness, we should
bye();
}
+print "# we seem to have sparse files...\n";
+
# By now we better be sure that we do have sparse files:
# if we are not, the following will hog 5 gigabytes of disk. Ooops.
$ENV{LC_ALL} = "C";
sysopen(BIG, "big", O_WRONLY|O_CREAT|O_TRUNC) or
- do { warn "sysopen failed: $!\n"; bye };
-sysseek(BIG, 5_000_000_000, SEEK_SET);
+ do { warn "sysopen 'big' failed: $!\n"; bye };
+my $sysseek = sysseek(BIG, 5_000_000_000, SEEK_SET);
+unless (defined $sysseek && $sysseek == 5_000_000_000) {
+ print "1..0\n# seeking past 2GB failed: $! (sysseek returned ",
+ defined $sysseek ? $sysseek : 'undef', ")\n";
+ explain();
+ bye();
+}
# The syswrite will fail if there are are filesize limitations (process or fs).
-my $syswrite = syswrite(BIG, "big") == 3;
-my $close = close BIG if $syswrite;
+my $syswrite = syswrite(BIG, "big");
+print "# syswrite failed: $! (syswrite returned ",
+ defined $syswrite ? $syswrite : 'undef', ")\n"
+ unless defined $syswrite && $syswrite == 3;
+my $close = close BIG;
+print "# close failed: $!\n" unless $close;
unless($syswrite && $close) {
- unless ($syswrite) {
- print "# syswrite failed: $!\n"
- } else {
- print "# close failed: $!\n"
- }
if ($! =~/too large/i) {
print "1..0\n# writing past 2GB failed: process limits?\n";
} elsif ($! =~ /quota/i) {
print "# @s\n";
+unless ($s[7] == 5_000_000_003) {
+ print "1..0\n# not configured to use large files?\n";
+ explain();
+ bye();
+}
+
sub fail () {
print "not ";
$fail++;
chdir 't' if -d 't';
unshift @INC, '../lib';
require Config; import Config;
- if (! $Config{'usethreads'}) {
- print "1..0 # Skip: this perl is not threaded\n";
+ if (! $Config{'use5005threads'}) {
+ print "1..0 # Skip: not use5005threads\n";
exit 0;
}
$ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3;
}
$| = 1;
-print "1..18\n";
-use Thread;
+print "1..21\n";
+use Thread 'yield';
print "ok 1\n";
sub content
print "ok 12\n";
$t->join;
-sub islocked
-{
- use attrs 'locked';
+sub islocked : locked {
my $val = shift;
my $ret;
print $val;
{
package Loch::Ness;
sub new { bless [], shift }
- sub monster {
- use attrs qw(locked method);
+ sub monster : locked, method {
my($s, $m) = @_;
print "ok $m\n";
}
Loch::Ness->new->monster(16);
Loch::Ness->gollum(17);
Loch::Ness->new->gollum(18);
+
+my $short = "This is a long string that goes on and on.";
+my $shorte = " a long string that goes on and on.";
+my $long = "This is short.";
+my $longe = " short.";
+my $thr1 = new Thread \&threaded, $short, $shorte, "19";
+my $thr2 = new Thread \&threaded, $long, $longe, "20";
+
+sub threaded {
+ my ($string, $string_end, $testno) = @_;
+
+ # Do the match, saving the output in appropriate variables
+ $string =~ /(.*)(is)(.*)/;
+ # Yield control, allowing the other thread to fill in the match variables
+ yield();
+ # Examine the match variable contents; on broken perls this fails
+ if ($3 eq $string_end) {
+ print "ok $testno\n";
+ }
+ else {
+ warn <<EOT;
+
+#
+# This is a KNOWN FAILURE, and one of the reasons why threading
+# is still an experimental feature. It is here to stop people
+# from deploying threads in production. ;-)
+#
+EOT
+ print "not ok $testno # other thread filled in match variables\n";
+ }
+}
+$thr1->join;
+$thr2->join;
+print "ok 21\n";
#!./perl
-print "1..65\n";
+print "1..66\n";
#
# @foo, @bar, and @ary are also used from tie-stdarray after tie-ing them
sub reify { $_[1] = ++$t; print "@_\n"; }
reify('ok');
reify('ok');
+
+# qw() is no more a runtime split, it's compiletime.
+print "not " unless qw(foo bar snorfle)[2] eq 'snorfle';
+print "ok 66\n";
+
package main;
-print "1..12\n";
+print "1..20\n";
$sch = {
'abc' => 1,
print "not " unless $a->[1] eq 'b';
print "ok 12\n";
+# check if exists() is behaving properly
+$avhv = [{foo=>1,bar=>2,pants=>3}];
+print "not " if exists $avhv->{bar};
+print "ok 13\n";
+
+$avhv->{pants} = undef;
+print "not " unless exists $avhv->{pants};
+print "ok 14\n";
+print "not " if exists $avhv->{bar};
+print "ok 15\n";
+
+$avhv->{bar} = 10;
+print "not " unless exists $avhv->{bar} and $avhv->{bar} == 10;
+print "ok 16\n";
+
+$v = delete $avhv->{bar};
+print "not " unless $v == 10;
+print "ok 17\n";
+
+print "not " if exists $avhv->{bar};
+print "ok 18\n";
+
+$avhv->{foo} = 'xxx';
+$avhv->{bar} = 'yyy';
+$avhv->{pants} = 'zzz';
+@x = delete @{$avhv}{'foo','pants'};
+print "# @x\nnot " unless "@x" eq "xxx zzz";
+print "ok 19\n";
+
+print "not " unless "$avhv->{bar}" eq "yyy";
+print "ok 20\n";
#!./perl
-# $RCSfile: delete.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:44 $
+print "1..36\n";
-print "1..16\n";
+# delete() on hash elements
$foo{1} = 'a';
$foo{2} = 'b';
$foo = delete $foo{2};
if ($foo eq 'b') {print "ok 1\n";} else {print "not ok 1 $foo\n";}
-if ($foo{2} eq '') {print "ok 2\n";} else {print "not ok 2 $foo{2}\n";}
+unless (exists $foo{2}) {print "ok 2\n";} else {print "not ok 2 $foo{2}\n";}
if ($foo{1} eq 'a') {print "ok 3\n";} else {print "not ok 3\n";}
if ($foo{3} eq 'c') {print "ok 4\n";} else {print "not ok 4\n";}
if ($foo{4} eq 'd') {print "ok 5\n";} else {print "not ok 5\n";}
if (@foo == 2) {print "ok 7\n";} else {print "not ok 7 ", @foo+0, "\n";}
if ($foo[0] eq 'd') {print "ok 8\n";} else {print "not ok 8 ", $foo[0], "\n";}
if ($foo[1] eq 'e') {print "ok 9\n";} else {print "not ok 9 ", $foo[1], "\n";}
-if ($foo{4} eq '') {print "ok 10\n";} else {print "not ok 10 $foo{4}\n";}
-if ($foo{5} eq '') {print "ok 11\n";} else {print "not ok 11 $foo{5}\n";}
+unless (exists $foo{4}) {print "ok 10\n";} else {print "not ok 10 $foo{4}\n";}
+unless (exists $foo{5}) {print "ok 11\n";} else {print "not ok 11 $foo{5}\n";}
if ($foo{1} eq 'a') {print "ok 12\n";} else {print "not ok 12\n";}
if ($foo{3} eq 'c') {print "ok 13\n";} else {print "not ok 13\n";}
@list = keys %{$refhash{"top"}};
print "@list" eq "foo" ? "ok 16\n" : "not ok 16 @list\n";
+
+{
+ my %a = ('bar', 33);
+ my($a) = \(values %a);
+ my $b = \$a{bar};
+ my $c = \delete $a{bar};
+
+ print "not " unless $a == $b && $b == $c;
+ print "ok 17\n";
+}
+
+# delete() on array elements
+
+@foo = ();
+$foo[1] = 'a';
+$foo[2] = 'b';
+$foo[3] = 'c';
+$foo[4] = 'd';
+$foo[5] = 'e';
+
+$foo = delete $foo[2];
+
+if ($foo eq 'b') {print "ok 18\n";} else {print "not ok 18 $foo\n";}
+unless (exists $foo[2]) {print "ok 19\n";} else {print "not ok 19 $foo[2]\n";}
+if ($foo[1] eq 'a') {print "ok 20\n";} else {print "not ok 20\n";}
+if ($foo[3] eq 'c') {print "ok 21\n";} else {print "not ok 21\n";}
+if ($foo[4] eq 'd') {print "ok 22\n";} else {print "not ok 22\n";}
+if ($foo[5] eq 'e') {print "ok 23\n";} else {print "not ok 23\n";}
+
+@bar = delete @foo[4,5];
+
+if (@bar == 2) {print "ok 24\n";} else {print "not ok 24 ", @bar+0, "\n";}
+if ($bar[0] eq 'd') {print "ok 25\n";} else {print "not ok 25 ", $bar[0], "\n";}
+if ($bar[1] eq 'e') {print "ok 26\n";} else {print "not ok 26 ", $bar[1], "\n";}
+unless (exists $foo[4]) {print "ok 27\n";} else {print "not ok 27 $foo[4]\n";}
+unless (exists $foo[5]) {print "ok 28\n";} else {print "not ok 28 $foo[5]\n";}
+if ($foo[1] eq 'a') {print "ok 29\n";} else {print "not ok 29\n";}
+if ($foo[3] eq 'c') {print "ok 30\n";} else {print "not ok 30\n";}
+
+$foo = join('',@foo);
+if ($foo eq 'ac') {print "ok 31\n";} else {print "not ok 31\n";}
+
+if (@foo == 4) {print "ok 32\n";} else {print "not ok 32\n";}
+
+foreach $key (0 .. $#foo) {
+ delete $foo[$key];
+}
+
+if (@foo == 0) {print "ok 33\n";} else {print "not ok 33\n";}
+
+$foo[0] = 'x';
+$foo[1] = 'y';
+
+$foo = "@foo";
+print +($foo eq 'x y') ? "ok 34\n" : "not ok 34\n";
+
+$refary[0]->[0] = "FOO";
+$refary[0]->[3] = "BAR";
+
+delete $refary[0]->[3];
+
+print @{$refary[0]} == 1 ? "ok 35\n" : "not ok 35 @list\n";
+
+{
+ my @a = 33;
+ my($a) = \(@a);
+ my $b = \$a[0];
+ my $c = \delete $a[bar];
+
+ print "not " unless $a == $b && $b == $c;
+ print "ok 36\n";
+}
#!./perl
-print "1..37\n";
+print "1..38\n";
eval 'print "ok 1\n";';
eval { die "ok ".$x++,"\n" };
print $@;
+# does scalar eval"" pop stack correctly?
+{
+ my $c = eval "(1,2)x10";
+ print $c eq '2222222222' ? "ok $x\n" : "# $c\nnot ok $x\n";
+ $x++;
+}
#!./perl
-# $RCSfile: fork.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:53 $
+# tests for both real and emulated fork()
BEGIN {
chdir 't' if -d 't';
unshift @INC, '../lib';
require Config; import Config;
- unless ($Config{'d_fork'}) {
+ unless ($Config{'d_fork'} || ($^O eq 'MSWin32' && $Config{'useithreads'})) {
print "1..0 # Skip: no fork\n";
exit 0;
}
+ $ENV{PERL5LIB} = "../lib";
}
-$| = 1;
-print "1..2\n";
+$|=1;
+
+undef $/;
+@prgs = split "\n########\n", <DATA>;
+print "1..", scalar @prgs, "\n";
+
+$tmpfile = "forktmp000";
+1 while -f ++$tmpfile;
+END { unlink $tmpfile if $tmpfile; }
+
+$CAT = (($^O eq 'MSWin32') ? '.\perl -e "print <>"' : 'cat');
+for (@prgs){
+ my $switch;
+ if (s/^\s*(-\w.*)//){
+ $switch = $1;
+ }
+ my($prog,$expected) = split(/\nEXPECT\n/, $_);
+ $expected =~ s/\n+$//;
+ # results can be in any order, so sort 'em
+ my @expected = sort split /\n/, $expected;
+ open TEST, ">$tmpfile" or die "Cannot open $tmpfile: $!";
+ print TEST $prog, "\n";
+ close TEST or die "Cannot close $tmpfile: $!";
+ my $results;
+ if ($^O eq 'MSWin32') {
+ $results = `.\\perl -I../lib $switch $tmpfile 2>&1`;
+ }
+ else {
+ $results = `./perl $switch $tmpfile 2>&1`;
+ }
+ $status = $?;
+ $results =~ s/\n+$//;
+ $results =~ s/at\s+forktmp\d+\s+line/at - line/g;
+ $results =~ s/of\s+forktmp\d+\s+aborted/of - aborted/g;
+# bison says 'parse error' instead of 'syntax error',
+# various yaccs may or may not capitalize 'syntax'.
+ $results =~ s/^(syntax|parse) error/syntax error/mig;
+ my @results = sort split /\n/, $results;
+ if ( "@results" ne "@expected" ) {
+ print STDERR "PROG: $switch\n$prog\n";
+ print STDERR "EXPECTED:\n$expected\n";
+ print STDERR "GOT:\n$results\n";
+ print "not ";
+ }
+ print "ok ", ++$i, "\n";
+}
+
+__END__
+$| = 1;
if ($cid = fork) {
- sleep 2;
- if ($result = (kill 9, $cid)) {print "ok 2\n";} else {print "not ok 2 $result\n";}
+ sleep 1;
+ if ($result = (kill 9, $cid)) {
+ print "ok 2\n";
+ }
+ else {
+ print "not ok 2 $result\n";
+ }
+ sleep 1 if $^O eq 'MSWin32'; # avoid WinNT race bug
}
else {
- $| = 1;
print "ok 1\n";
sleep 10;
}
+EXPECT
+ok 1
+ok 2
+########
+$| = 1;
+sub forkit {
+ print "iteration $i start\n";
+ my $x = fork;
+ if (defined $x) {
+ if ($x) {
+ print "iteration $i parent\n";
+ }
+ else {
+ print "iteration $i child\n";
+ }
+ }
+ else {
+ print "pid $$ failed to fork\n";
+ }
+}
+while ($i++ < 3) { do { forkit(); }; }
+EXPECT
+iteration 1 start
+iteration 1 parent
+iteration 1 child
+iteration 2 start
+iteration 2 parent
+iteration 2 child
+iteration 2 start
+iteration 2 parent
+iteration 2 child
+iteration 3 start
+iteration 3 parent
+iteration 3 child
+iteration 3 start
+iteration 3 parent
+iteration 3 child
+iteration 3 start
+iteration 3 parent
+iteration 3 child
+iteration 3 start
+iteration 3 parent
+iteration 3 child
+########
+$| = 1;
+fork()
+ ? (print("parent\n"),sleep(1))
+ : (print("child\n"),exit) ;
+EXPECT
+parent
+child
+########
+$| = 1;
+fork()
+ ? (print("parent\n"),exit)
+ : (print("child\n"),sleep(1)) ;
+EXPECT
+parent
+child
+########
+$| = 1;
+@a = (1..3);
+for (@a) {
+ if (fork) {
+ print "parent $_\n";
+ $_ = "[$_]";
+ }
+ else {
+ print "child $_\n";
+ $_ = "-$_-";
+ }
+}
+print "@a\n";
+EXPECT
+parent 1
+child 1
+parent 2
+child 2
+parent 2
+child 2
+parent 3
+child 3
+parent 3
+child 3
+parent 3
+child 3
+parent 3
+child 3
+[1] [2] [3]
+-1- [2] [3]
+[1] -2- [3]
+[1] [2] -3-
+-1- -2- [3]
+-1- [2] -3-
+[1] -2- -3-
+-1- -2- -3-
+########
+use Config;
+$| = 1;
+$\ = "\n";
+fork()
+ ? print($Config{osname} eq $^O)
+ : print($Config{osname} eq $^O) ;
+EXPECT
+1
+1
+########
+$| = 1;
+$\ = "\n";
+fork()
+ ? do { require Config; print($Config::Config{osname} eq $^O); }
+ : do { require Config; print($Config::Config{osname} eq $^O); }
+EXPECT
+1
+1
+########
+$| = 1;
+use Cwd;
+$\ = "\n";
+my $dir;
+if (fork) {
+ $dir = "f$$.tst";
+ mkdir $dir, 0755;
+ chdir $dir;
+ print cwd() =~ /\Q$dir/i ? "ok 1 parent" : "not ok 1 parent";
+ chdir "..";
+ rmdir $dir;
+}
+else {
+ sleep 2;
+ $dir = "f$$.tst";
+ mkdir $dir, 0755;
+ chdir $dir;
+ print cwd() =~ /\Q$dir/i ? "ok 1 child" : "not ok 1 child";
+ chdir "..";
+ rmdir $dir;
+}
+EXPECT
+ok 1 parent
+ok 1 child
+########
+$| = 1;
+$\ = "\n";
+my $getenv;
+if ($^O eq 'MSWin32') {
+ $getenv = qq[$^X -e "print \$ENV{TST}"];
+}
+else {
+ $getenv = qq[$^X -e 'print \$ENV{TST}'];
+}
+$ENV{TST} = 'foo';
+if (fork) {
+ sleep 1;
+ print "parent before: " . `$getenv`;
+ $ENV{TST} = 'bar';
+ print "parent after: " . `$getenv`;
+}
+else {
+ print "child before: " . `$getenv`;
+ $ENV{TST} = 'baz';
+ print "child after: " . `$getenv`;
+}
+EXPECT
+child before: foo
+child after: baz
+parent before: foo
+parent after: bar
+########
+$| = 1;
+$\ = "\n";
+if ($pid = fork) {
+ waitpid($pid,0);
+ print "parent got $?"
+}
+else {
+ exit(42);
+}
+EXPECT
+parent got 10752
+########
+$| = 1;
+$\ = "\n";
+my $echo = 'echo';
+if ($pid = fork) {
+ waitpid($pid,0);
+ print "parent got $?"
+}
+else {
+ exec("$echo foo");
+}
+EXPECT
+foo
+parent got 0
+########
+if (fork) {
+ die "parent died";
+}
+else {
+ die "child died";
+}
+EXPECT
+parent died at - line 2.
+child died at - line 5.
+########
+if ($pid = fork) {
+ eval { die "parent died" };
+ print $@;
+}
+else {
+ eval { die "child died" };
+ print $@;
+}
+EXPECT
+parent died at - line 2.
+child died at - line 6.
+########
+if (eval q{$pid = fork}) {
+ eval q{ die "parent died" };
+ print $@;
+}
+else {
+ eval q{ die "child died" };
+ print $@;
+}
+EXPECT
+parent died at (eval 2) line 1.
+child died at (eval 2) line 1.
+########
+BEGIN {
+ $| = 1;
+ fork and exit;
+ print "inner\n";
+}
+# XXX In emulated fork(), the child will not execute anything after
+# the BEGIN block, due to difficulties in recreating the parse stacks
+# and restarting yyparse() midstream in the child. This can potentially
+# be overcome by treating what's after the BEGIN{} as a brand new parse.
+#print "outer\n"
+EXPECT
+inner
#!./perl
-# $RCSfile: glob.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:55 $
+BEGIN {
+ chdir 't' if -d 't';
+ unshift @INC, '../lib';
+}
print "1..6\n";
exit 0;
}
-quit() if $^O eq 'MSWin32';
+quit() if $^O eq 'MSWin32' or $^O =~ /lynxos/i;
# We have to find a command that prints all (effective
# and real) group names (not ids). The known commands are:
#!./perl
-# $RCSfile: int.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:00 $
+BEGIN {
+ chdir 't' if -d 't';
+ unshift @INC, '../lib';
+}
-print "1..4\n";
+print "1..6\n";
# compile time evaluation
$x = 1.234;
if (int($x) == 1) {print "ok 3\n";} else {print "not ok 3\n";}
if (int(-$x) == -1) {print "ok 4\n";} else {print "not ok 4\n";}
+
+$x = length("abc") % -10;
+print $x == -7 ? "ok 5\n" : "# expected -7, got $x\nnot ok 5\n";
+
+{
+ use integer;
+ $x = length("abc") % -10;
+ $y = (3/-10)*-10;
+ print $x+$y == 3 && abs($x) < 10 ? "ok 6\n" : "not ok 6\n";
+}
chdir 't' if -d 't';
unshift @INC, '../lib';
}
+$ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3;
umask 0;
$xref = \ "";
@INPUT = <DATA>;
@simple_input = grep /^\s*\w+\s*\$\w+\s*[#\n]/, @INPUT;
-print "1..", (8 + @INPUT + @simple_input), "\n";
+print "1..", (9 + @INPUT + @simple_input), "\n";
$ord = 0;
sub wrn {"@_"}
print "not " unless $dc == 1;
print "ok $ord\n";
+$ord++;
+my $xxx = 'b';
+$xxx = 'c' . ($xxx || 'e');
+print "not " unless $xxx eq 'cb';
+print "ok $ord\n";
+
{ # Check calling STORE
my $sc = 0;
sub B::TIESCALAR {bless [11], 'B'}
# If you modify/add tests here, remember to update also t/lib/syslfs.t.
BEGIN {
- # Don't bother if there are no quads.
- eval { my $q = pack "q", 0 };
- if ($@) {
- print "1..0\n# no 64-bit types\n";
- exit(0);
- }
chdir 't' if -d 't';
unshift @INC, '../lib';
# Don't bother if there are no quad offsets.
EOM
}
+print "# checking whether we have sparse files...\n";
+
# Known have-nots.
if ($^O eq 'win32' || $^O eq 'vms') {
- print "1..0\n# no sparse files\n";
+ print "1..0\n# no sparse files (because this is $^O) \n";
bye();
}
# Known haves that have problems running this test
# (for example because they do not support sparse files, like UNICOS)
if ($^O eq 'unicos') {
- print "1..0\n# large files known to work but unable to test them here\n";
+ print "1..0\n# large files known to work but unable to test them here ($^O)\n";
bye();
}
-# Then try to deduce whether we have sparse files.
+# Then try to heuristically deduce whether we have sparse files.
# Let's not depend on Fcntl or any other extension.
bye();
}
+print "# we seem to have sparse files...\n";
+
# By now we better be sure that we do have sparse files:
# if we are not, the following will hog 5 gigabytes of disk. Ooops.
open(BIG, ">big") or do { warn "open failed: $!\n"; bye };
binmode BIG;
-seek(BIG, 5_000_000_000, $SEEK_SET);
+unless (seek(BIG, 5_000_000_000, $SEEK_SET)) {
+ print "1..0\n# seeking past 2GB failed: $!\n";
+ explain();
+ bye();
+}
# Either the print or (more likely, thanks to buffering) the close will
# fail if there are are filesize limitations (process or fs).
my $print = print BIG "big";
-my $close = close BIG if $print;
+print "# print failed: $!\n" unless $print;
+my $close = close BIG;
+print "# close failed: $!\n" unless $close;
unless ($print && $close) {
- unless ($print) {
- print "# print failed: $!\n"
- } else {
- print "# close failed: $!\n"
- }
if ($! =~/too large/i) {
print "1..0\n# writing past 2GB failed: process limits?\n";
} elsif ($! =~ /quota/i) {
print "# @s\n";
+unless ($s[7] == 5_000_000_003) {
+ print "1..0\n# not configured to use large files?\n";
+ explain();
+ bye();
+}
+
sub fail () {
print "not ";
$fail++;
$Is_MSWin32 = $^O eq 'MSWin32';
$Is_VMS = $^O eq 'VMS';
$Is_Dos = $^O eq 'dos';
-$Is_Cygwin = $^O =~ /cygwin/;
+$Is_os2 = $^O eq 'os2';
+$Is_Cygwin = $^O eq 'cygwin';
$PERL = ($Is_MSWin32 ? '.\perl' : './perl');
print "1..35\n";
chomp($wd = `pwd`);
$wd =~ s#/t$##;
}
+ elsif($Is_os2) {
+ $wd = Cwd::sys_cwd();
+ }
else {
$wd = '.';
}
:endofperl
EOT
}
+ elsif ($Is_os2) {
+ $script = "./show-shebang";
+ }
if ($^O eq 'os390' or $^O eq 'posix-bc' or $^O eq 'vmesa') { # no shebang
$headmaybe = <<EOH ;
eval 'exec ./perl -S \$0 \${1+"\$\@"}'
ok 21, close(SCRIPT), $!;
ok 22, chmod(0755, $script), $!;
$_ = `$script`;
- s/\.exe//i if $Is_Dos or $Is_Cygwin;
+ s/\.exe//i if $Is_Dos or $Is_Cygwin or $Is_os2;
s{\bminiperl\b}{perl}; # so that test doesn't fail with miniperl
s{is perl}{is $perl}; # for systems where $^X is only a basename
s{\\}{/}g;
- ok 23, ($Is_MSWin32 ? uc($_) eq uc($s1) : $_ eq $s1), ":$_:!=:$s1:";
+ ok 23, (($Is_MSWin32 || $Is_os2) ? uc($_) eq uc($s1) : $_ eq $s1), " :$_:!=:$s1:";
$_ = `$perl $script`;
- s/\.exe//i if $Is_Dos;
+ s/\.exe//i if $Is_Dos or $Is_os2;
s{\\}{/}g;
- ok 24, ($Is_MSWin32 ? uc($_) eq uc($s1) : $_ eq $s1), ":$_:!=:$s1: after `$perl $script`";
+ ok 24, (($Is_MSWin32 || $Is_os2) ? uc($_) eq uc($s1) : $_ eq $s1), " :$_:!=:$s1: after `$perl $script`";
ok 25, unlink($script), $!;
}
ok 35, (scalar(keys(%ENV)) == 0);
}
else {
- ok "32 # skipped",1;
- ok "33 # skipped",1;
- ok "34 # skipped",1;
- ok "35 # skipped",1;
+ ok "32 # skipped: no caseless %ENV support",1;
+ ok "33 # skipped: no caseless %ENV support",1;
+ ok "34 # skipped: no caseless %ENV support",1;
+ ok "35 # skipped: no caseless %ENV support",1;
}
syntax error at (re_eval 1) line 1, near ""{"}"
Compilation failed in regexp at - line 1.
########
-BEGIN { @ARGV = qw(a b c) }
+BEGIN { @ARGV = qw(a b c d e) }
BEGIN { print "argv <@ARGV>\nbegin <",shift,">\n" }
END { print "end <",shift,">\nargv <@ARGV>\n" }
INIT { print "init <",shift,">\n" }
+STOP { print "stop <",shift,">\n" }
EXPECT
-argv <a b c>
+argv <a b c d e>
begin <a>
-init <b>
-end <c>
-argv <>
+stop <b>
+init <c>
+end <d>
+argv <e>
########
-l
# fdopen from a system descriptor to a system descriptor used to close
if ($x == 0) { print "" } else { print $x }
}
EXPECT
-Use of uninitialized value at - line 4.
+Use of uninitialized value in numeric eq (==) at - line 4.
unshift @INC, "../lib";
require Config;
import Config;
- if ($Config{'usethreads'})
+ if ($Config{'use5005threads'})
{
print "1..0 # Skip: this perl is threaded\n";
exit 0;
require Config; import Config;
}
-print "1..152\n";
+print "1..156\n";
$format = "c2 x5 C C x s d i l a6";
# Need the expression in here to force ary[5] to be numeric. This avoids
$out1=join(':',@ary);
$out2=join(':',@ary2);
-print ($out1 eq $out2 ? "ok 2\n" : "not ok 2\n");
+# Using long double NVs may introduce greater accuracy than wanted.
+$out2 =~ s/:9\.87654321097999\d*:/:9.87654321098:/
+ if $Config{uselongdouble} eq 'define';
+print ($out1 eq $out2? "ok 2\n" : "not ok 2\n");
print ($foo =~ /def/ ? "ok 3\n" : "not ok 3\n");
print "not " unless unpack('u', $uu) eq $in;
print "ok ", $test++, "\n";
-# 61..72: test the ascii template types (A, a, Z)
+# 61..73: test the ascii template types (A, a, Z)
print "not " unless pack('A*', "foo\0bar\0 ") eq "foo\0bar\0 ";
print "ok ", $test++, "\n";
print "not " unless unpack('a8', "foo\0bar \0") eq "foo\0bar ";
print "ok ", $test++, "\n";
-print "not " unless pack('Z*', "foo\0bar\0 ") eq "foo\0bar\0 ";
+print "not " unless pack('Z*', "foo\0bar\0 ") eq "foo\0bar\0 \0";
print "ok ", $test++, "\n";
print "not " unless pack('Z11', "foo\0bar\0 ") eq "foo\0bar\0 \0\0";
print "ok ", $test++, "\n";
+print "not " unless pack('Z3', "foo") eq "fo\0";
+print "ok ", $test++, "\n";
+
print "not " unless unpack('Z*', "foo\0bar \0") eq "foo";
print "ok ", $test++, "\n";
print "not " unless unpack('Z8', "foo\0bar \0") eq "foo";
print "ok ", $test++, "\n";
-# 73..78: packing native shorts/ints/longs
+# 74..79: packing native shorts/ints/longs
print "not " unless length(pack("s!", 0)) == $Config{shortsize};
print "ok ", $test++, "\n";
print "not " unless length(pack("i!", 0)) == length(pack("i", 0));
print "ok ", $test++, "\n";
-# 79..138: pack <-> unpack bijectionism
+# 80..139: pack <-> unpack bijectionism
-# 79.. 83 c
+# 80.. 84 c
foreach my $c (-128, -1, 0, 1, 127) {
print "not " unless unpack("c", pack("c", $c)) == $c;
print "ok ", $test++, "\n";
}
-# 84.. 88: C
+# 85.. 89: C
foreach my $C (0, 1, 127, 128, 255) {
print "not " unless unpack("C", pack("C", $C)) == $C;
print "ok ", $test++, "\n";
}
-# 89.. 93: s
+# 90.. 94: s
foreach my $s (-32768, -1, 0, 1, 32767) {
print "not " unless unpack("s", pack("s", $s)) == $s;
print "ok ", $test++, "\n";
}
-# 94.. 98: S
+# 95.. 99: S
foreach my $S (0, 1, 32767, 32768, 65535) {
print "not " unless unpack("S", pack("S", $S)) == $S;
print "ok ", $test++, "\n";
}
-# 99..103: i
+# 100..104: i
foreach my $i (-2147483648, -1, 0, 1, 2147483647) {
print "not " unless unpack("i", pack("i", $i)) == $i;
print "ok ", $test++, "\n";
}
-# 104..108: I
+# 105..109: I
foreach my $I (0, 1, 2147483647, 2147483648, 4294967295) {
print "not " unless unpack("I", pack("I", $I)) == $I;
print "ok ", $test++, "\n";
}
-# 109..113: l
+# 110..114: l
foreach my $l (-2147483648, -1, 0, 1, 2147483647) {
print "not " unless unpack("l", pack("l", $l)) == $l;
print "ok ", $test++, "\n";
}
-# 114..118: L
+# 115..119: L
foreach my $L (0, 1, 2147483647, 2147483648, 4294967295) {
print "not " unless unpack("L", pack("L", $L)) == $L;
print "ok ", $test++, "\n";
}
-# 119..123: n
+# 120..124: n
foreach my $n (0, 1, 32767, 32768, 65535) {
print "not " unless unpack("n", pack("n", $n)) == $n;
print "ok ", $test++, "\n";
}
-# 124..128: v
+# 125..129: v
foreach my $v (0, 1, 32767, 32768, 65535) {
print "not " unless unpack("v", pack("v", $v)) == $v;
print "ok ", $test++, "\n";
}
-# 129..133: N
+# 130..134: N
foreach my $N (0, 1, 2147483647, 2147483648, 4294967295) {
print "not " unless unpack("N", pack("N", $N)) == $N;
print "ok ", $test++, "\n";
}
-# 134..138: V
+# 135..139: V
foreach my $V (0, 1, 2147483647, 2147483648, 4294967295) {
print "not " unless unpack("V", pack("V", $V)) == $V;
print "ok ", $test++, "\n";
}
-# 139..142: pack nvNV byteorders
+# 140..143: pack nvNV byteorders
print "not " unless pack("n", 0xdead) eq "\xde\xad";
print "ok ", $test++, "\n";
print "not " unless pack("V", 0xdeadbeef) eq "\xef\xbe\xad\xde";
print "ok ", $test++, "\n";
-# 143..148: /
+# 144..152: /
my $z;
eval { ($x) = unpack '/a*','hello' };
$z = pack 'n/a* w/A*','string','etc';
print 'not ' unless $z eq "\000\006string\003etc"; print "ok $test\n"; $test++;
-# 149..152: / with #
+eval { ($x) = unpack 'a/a*/a*', '212ab345678901234567' };
+print $@ eq '' && $x eq 'ab3456789012' ? "ok $test\n" : "#$x,$@\nnot ok $test\n";
+$test++;
+
+eval { ($x) = unpack 'a/a*/a*', '3012ab345678901234567' };
+print $@ eq '' && $x eq 'ab3456789012' ? "ok $test\n" : "not ok $test\n";
+$test++;
+
+eval { ($x) = unpack 'a/a*/b*', '212ab' };
+my $expected_x = '100001100100';
+if ($Config{ebcdic} eq 'define') { $expected_x = '100000010100'; }
+print $@ eq '' && $x eq $expected_x ? "ok $test\n" : "#$x,$@\nnot ok $test\n";
+$test++;
+
+# 153..156: / with #
eval { ($z,$x,$y) = unpack <<EOU, "003ok \003yes\004z\000abc" };
a3/A # Count in ASCII
# the format supported by op/regexp.t. If you want to add a test
# that does fit that format, add it to op/re_tests, not here.
-print "1..192\n";
+print "1..195\n";
BEGIN {
chdir 't' if -d 't';
m/^-.*bb/mg and print "not ";
print "ok $test\n";
$test++;
+
+$text = "aaXbXcc";
+pos($text)=0;
+$text =~ /\GXb*X/g and print 'not ';
+print "ok $test\n";
+$test++;
+
+$text = "xA\n" x 500;
+$text =~ /^\s*A/m and print 'not ';
+print "ok $test\n";
+$test++;
+
+$text = "abc dbf";
+@res = ($text =~ /.*?(b).*?\b/g);
+"@res" eq 'b b' or print 'not ';
+print "ok $test\n";
+$test++;
+
#!./perl
-print "1..13\n";
+print "1..15\n";
print join(':',1..5) eq '1:2:3:4:5' ? "ok 1\n" : "not ok 1\n";
$bad = 1 unless $x eq 'a:b:c:d:e';
print $bad ? "not ok 13\n" : "ok 13\n";
}
+
+# Should use magical autoinc only when both are strings
+print "not " unless 0 == (() = "0"..-1);
+print "ok 14\n";
+
+for my $x ("0"..-1) {
+ print "not ";
+}
+print "ok 15\n";
a[b-d] aac y $& ac
a[-b] a- y $& a-
a[b-] a- y $& a-
-a[b-a] - c - /a[b-a]/: invalid [] range in regexp
+a[b-a] - c - /a[b-a]/: invalid [] range "b-a" in regexp
a[]b - c - /a[]b/: unmatched [] in regexp
a[ - c - /a[/: unmatched [] in regexp
a] a] y $& a]
'a[b-d]'i AAC y $& AC
'a[-b]'i A- y $& A-
'a[b-]'i A- y $& A-
-'a[b-a]'i - c - /a[b-a]/: invalid [] range in regexp
+'a[b-a]'i - c - /a[b-a]/: invalid [] range "b-a" in regexp
'a[]b'i - c - /a[]b/: unmatched [] in regexp
'a['i - c - /a[/: unmatched [] in regexp
'a]'i A] y $& A]
.[X](.+)+[X][X] bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
.[X][X](.+)+[X] bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
tt+$ xxxtt y - -
-[a-\w] - c - /[a-\w]/: invalid [] range in regexp
-[\w-z] - c - /[\w-z]/: invalid [] range in regexp
-[0-[:digit:]] - c - /[0-[:digit:]]/: invalid [] range in regexp
-[[:digit:]-9] - c - /[[:digit:]-9]/: invalid [] range in regexp
+([a-\d]+) za-9z y $1 a-9
+([\d-z]+) a0-za y $1 0-z
+([\d-\s]+) a0- z y $1 0-
+([a-[:digit:]]+) za-9z y $1 a-9
+([[:digit:]-z]+) =0-z= y $1 0-z
+([[:digit:]-[:alpha:]]+) =0-z= y $1 0-z
+\GX.*X aaaXbX n - -
+(\d+\.\d+) 3.1415926 y $1 3.1415926
+(\ba.{0,10}br) have a web browser y $1 a web br
+'\.c(pp|xx|c)?$'i Changes n - -
+'\.c(pp|xx|c)?$'i IO.c y - -
+'(\.c(pp|xx|c)?$)'i IO.c y $1 .c
+^([a-z]:) C:/ n - -
+'^\S\s+aa$'m \nx aa y - -
+(^|a)b ab y - -
#!./perl
+BEGIN {
+ chdir 't' if -d 't';
+ unshift @INC, '../lib';
+}
+
eval 'opendir(NOSUCH, "no/such/directory");';
if ($@) { print "1..0\n"; exit; }
##
## Many of these tests are originally from Michael Schroeder
## <Michael.Schroeder@informatik.uni-erlangen.de>
-## Adapted and expanded by Gurusamy Sarathy <gsar@umich.edu>
+## Adapted and expanded by Gurusamy Sarathy <gsar@activestate.com>
##
chdir 't' if -d 't';
@a = sort { last ; } @a;
}
EXPECT
-Can't "last" outside a block at - line 3.
+Can't "last" outside a loop block at - line 3.
########
package TEST;
bar:
print "bar reached\n";
EXPECT
-Can't "goto" outside a block at - line 2.
+Can't "goto" out of a pseudo block at - line 2.
########
sub sortfn {
(split(/./, 'x'x10000))[0];
}
print "OK\n";
EXPECT
-Can't "next" outside a block at - line 8.
+Can't "next" outside a loop block at - line 8.
########
package TEST;
tie $bar, TEST;
}
EXPECT
-Can't "next" outside a block at - line 4.
+Can't "next" outside a loop block at - line 4.
########
@a = (1, 2, 3);
foo:
print join('|', @bar[0..3]), "\n";
EXPECT
foo|fee|fie|foe
+########
+package TH;
+sub TIEHASH { bless {}, TH }
+sub STORE { eval { print "@_[1,2]\n" }; die "bar\n" }
+tie %h, TH;
+eval { $h{A} = 1; print "never\n"; };
+print $@;
+eval { $h{B} = 2; };
+print $@;
+EXPECT
+A 1
+bar
+B 2
+bar
chdir 't' if -d 't';
unshift @INC, '../lib';
}
-print "1..38\n";
+print "1..49\n";
# XXX known to leak scalars
$ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3;
sub backwards { $a lt $b ? 1 : $a gt $b ? -1 : 0 }
+sub backwards_stacked($$) { my($a,$b) = @_; $a lt $b ? 1 : $a gt $b ? -1 : 0 }
my $upperfirst = 'A' lt 'a';
print "# 2: x = '$x', expected = '$expected'\n";
print ($x eq $expected ? "ok 2\n" : "not ok 2\n");
+$x = join('', sort( backwards_stacked @harry));
+$expected = $upperfirst ? 'xdogcatCainAbel' : 'CainAbelxdogcat';
+print "# 3: x = '$x', expected = '$expected'\n";
+print ($x eq $expected ? "ok 3\n" : "not ok 3\n");
+
$x = join('', sort @george, 'to', @harry);
$expected = $upperfirst ?
'AbelAxedCaincatchaseddoggonepunishedtoxyz' :
'catchaseddoggonepunishedtoxyzAbelAxedCain' ;
-print "# 3: x = '$x', expected = '$expected'\n";
-print ($x eq $expected ?"ok 3\n":"not ok 3\n");
+print "# 4: x = '$x', expected = '$expected'\n";
+print ($x eq $expected ?"ok 4\n":"not ok 4\n");
@a = ();
@b = reverse @a;
-print ("@b" eq "" ? "ok 4\n" : "not ok 4 (@b)\n");
+print ("@b" eq "" ? "ok 5\n" : "not ok 5 (@b)\n");
@a = (1);
@b = reverse @a;
-print ("@b" eq "1" ? "ok 5\n" : "not ok 5 (@b)\n");
+print ("@b" eq "1" ? "ok 6\n" : "not ok 6 (@b)\n");
@a = (1,2);
@b = reverse @a;
-print ("@b" eq "2 1" ? "ok 6\n" : "not ok 6 (@b)\n");
+print ("@b" eq "2 1" ? "ok 7\n" : "not ok 7 (@b)\n");
@a = (1,2,3);
@b = reverse @a;
-print ("@b" eq "3 2 1" ? "ok 7\n" : "not ok 7 (@b)\n");
+print ("@b" eq "3 2 1" ? "ok 8\n" : "not ok 8 (@b)\n");
@a = (1,2,3,4);
@b = reverse @a;
-print ("@b" eq "4 3 2 1" ? "ok 8\n" : "not ok 8 (@b)\n");
+print ("@b" eq "4 3 2 1" ? "ok 9\n" : "not ok 9 (@b)\n");
@a = (10,2,3,4);
@b = sort {$a <=> $b;} @a;
-print ("@b" eq "2 3 4 10" ? "ok 9\n" : "not ok 9 (@b)\n");
+print ("@b" eq "2 3 4 10" ? "ok 10\n" : "not ok 10 (@b)\n");
$sub = 'backwards';
$x = join('', sort $sub @harry);
$expected = $upperfirst ? 'xdogcatCainAbel' : 'CainAbelxdogcat';
-print "# 10: x = $x, expected = '$expected'\n";
-print ($x eq $expected ? "ok 10\n" : "not ok 10\n");
+print "# 11: x = $x, expected = '$expected'\n";
+print ($x eq $expected ? "ok 11\n" : "not ok 11\n");
+
+$sub = 'backwards_stacked';
+$x = join('', sort $sub @harry);
+$expected = $upperfirst ? 'xdogcatCainAbel' : 'CainAbelxdogcat';
+print "# 12: x = $x, expected = '$expected'\n";
+print ($x eq $expected ? "ok 12\n" : "not ok 12\n");
# literals, combinations
@b = sort (4,1,3,2);
-print ("@b" eq '1 2 3 4' ? "ok 11\n" : "not ok 11\n");
+print ("@b" eq '1 2 3 4' ? "ok 13\n" : "not ok 13\n");
print "# x = '@b'\n";
@b = sort grep { $_ } (4,1,3,2);
-print ("@b" eq '1 2 3 4' ? "ok 12\n" : "not ok 12\n");
+print ("@b" eq '1 2 3 4' ? "ok 14\n" : "not ok 14\n");
print "# x = '@b'\n";
@b = sort map { $_ } (4,1,3,2);
-print ("@b" eq '1 2 3 4' ? "ok 13\n" : "not ok 13\n");
+print ("@b" eq '1 2 3 4' ? "ok 15\n" : "not ok 15\n");
print "# x = '@b'\n";
@b = sort reverse (4,1,3,2);
-print ("@b" eq '1 2 3 4' ? "ok 14\n" : "not ok 14\n");
+print ("@b" eq '1 2 3 4' ? "ok 16\n" : "not ok 16\n");
print "# x = '@b'\n";
$^W = 0;
# redefining sort sub inside the sort sub should fail
sub twoface { *twoface = sub { $a <=> $b }; &twoface }
eval { @b = sort twoface 4,1,3,2 };
-print ($@ =~ /redefine active sort/ ? "ok 15\n" : "not ok 15\n");
+print ($@ =~ /redefine active sort/ ? "ok 17\n" : "not ok 17\n");
# redefining sort subs outside the sort should not fail
eval { *twoface = sub { &backwards } };
-print $@ ? "not ok 16\n" : "ok 16\n";
+print $@ ? "not ok 18\n" : "ok 18\n";
eval { @b = sort twoface 4,1,3,2 };
-print ("@b" eq '4 3 2 1' ? "ok 17\n" : "not ok 17 |@b|\n");
+print ("@b" eq '4 3 2 1' ? "ok 19\n" : "not ok 19 |@b|\n");
*twoface = sub { *twoface = *backwards; $a <=> $b };
eval { @b = sort twoface 4,1 };
-print ($@ =~ /redefine active sort/ ? "ok 18\n" : "not ok 18\n");
+print ($@ =~ /redefine active sort/ ? "ok 20\n" : "not ok 20\n");
*twoface = sub {
eval 'sub twoface { $a <=> $b }';
- die($@ =~ /redefine active sort/ ? "ok 19\n" : "not ok 19\n");
+ die($@ =~ /redefine active sort/ ? "ok 21\n" : "not ok 21\n");
$a <=> $b;
};
eval { @b = sort twoface 4,1 };
-print $@ ? "$@" : "not ok 19\n";
+print $@ ? "$@" : "not ok 21\n";
eval <<'CODE';
my @result = sort main'backwards 'one', 'two';
CODE
-print $@ ? "not ok 20\n# $@" : "ok 20\n";
+print $@ ? "not ok 22\n# $@" : "ok 22\n";
eval <<'CODE';
# "sort 'one', 'two'" should not try to parse "'one" as a sort sub
my @result = sort 'one', 'two';
CODE
-print $@ ? "not ok 21\n# $@" : "ok 21\n";
+print $@ ? "not ok 23\n# $@" : "ok 23\n";
{
my $sortsub = \&backwards;
my $sortglobr = \*backwards;
my $sortname = 'backwards';
@b = sort $sortsub 4,1,3,2;
- print ("@b" eq '4 3 2 1' ? "ok 22\n" : "not ok 22 |@b|\n");
+ print ("@b" eq '4 3 2 1' ? "ok 24\n" : "not ok 24 |@b|\n");
@b = sort $sortglob 4,1,3,2;
- print ("@b" eq '4 3 2 1' ? "ok 23\n" : "not ok 23 |@b|\n");
+ print ("@b" eq '4 3 2 1' ? "ok 25\n" : "not ok 25 |@b|\n");
@b = sort $sortname 4,1,3,2;
- print ("@b" eq '4 3 2 1' ? "ok 24\n" : "not ok 24 |@b|\n");
+ print ("@b" eq '4 3 2 1' ? "ok 26\n" : "not ok 26 |@b|\n");
@b = sort $sortglobr 4,1,3,2;
- print ("@b" eq '4 3 2 1' ? "ok 25\n" : "not ok 25 |@b|\n");
+ print ("@b" eq '4 3 2 1' ? "ok 27\n" : "not ok 27 |@b|\n");
+}
+
+{
+ my $sortsub = \&backwards_stacked;
+ my $sortglob = *backwards_stacked;
+ my $sortglobr = \*backwards_stacked;
+ my $sortname = 'backwards_stacked';
+ @b = sort $sortsub 4,1,3,2;
+ print ("@b" eq '4 3 2 1' ? "ok 28\n" : "not ok 28 |@b|\n");
+ @b = sort $sortglob 4,1,3,2;
+ print ("@b" eq '4 3 2 1' ? "ok 29\n" : "not ok 29 |@b|\n");
+ @b = sort $sortname 4,1,3,2;
+ print ("@b" eq '4 3 2 1' ? "ok 30\n" : "not ok 30 |@b|\n");
+ @b = sort $sortglobr 4,1,3,2;
+ print ("@b" eq '4 3 2 1' ? "ok 31\n" : "not ok 31 |@b|\n");
}
{
local $sortglobr = \*backwards;
local $sortname = 'backwards';
@b = sort $sortsub 4,1,3,2;
- print ("@b" eq '4 3 2 1' ? "ok 26\n" : "not ok 26 |@b|\n");
+ print ("@b" eq '4 3 2 1' ? "ok 32\n" : "not ok 32 |@b|\n");
@b = sort $sortglob 4,1,3,2;
- print ("@b" eq '4 3 2 1' ? "ok 27\n" : "not ok 27 |@b|\n");
+ print ("@b" eq '4 3 2 1' ? "ok 33\n" : "not ok 33 |@b|\n");
@b = sort $sortname 4,1,3,2;
- print ("@b" eq '4 3 2 1' ? "ok 28\n" : "not ok 28 |@b|\n");
+ print ("@b" eq '4 3 2 1' ? "ok 34\n" : "not ok 34 |@b|\n");
@b = sort $sortglobr 4,1,3,2;
- print ("@b" eq '4 3 2 1' ? "ok 29\n" : "not ok 29 |@b|\n");
+ print ("@b" eq '4 3 2 1' ? "ok 35\n" : "not ok 35 |@b|\n");
+}
+
+{
+ local $sortsub = \&backwards_stacked;
+ local $sortglob = *backwards_stacked;
+ local $sortglobr = \*backwards_stacked;
+ local $sortname = 'backwards_stacked';
+ @b = sort $sortsub 4,1,3,2;
+ print ("@b" eq '4 3 2 1' ? "ok 36\n" : "not ok 36 |@b|\n");
+ @b = sort $sortglob 4,1,3,2;
+ print ("@b" eq '4 3 2 1' ? "ok 37\n" : "not ok 37 |@b|\n");
+ @b = sort $sortname 4,1,3,2;
+ print ("@b" eq '4 3 2 1' ? "ok 38\n" : "not ok 38 |@b|\n");
+ @b = sort $sortglobr 4,1,3,2;
+ print ("@b" eq '4 3 2 1' ? "ok 39\n" : "not ok 39 |@b|\n");
}
## exercise sort builtins... ($a <=> $b already tested)
@a = ( 5, 19, 1996, 255, 90 );
-@b = sort { $b <=> $a } @a;
-print ("@b" eq '1996 255 90 19 5' ? "ok 30\n" : "not ok 30\n");
+@b = sort {
+ my $dummy; # force blockness
+ return $b <=> $a
+} @a;
+print ("@b" eq '1996 255 90 19 5' ? "ok 40\n" : "not ok 40\n");
print "# x = '@b'\n";
$x = join('', sort { $a cmp $b } @harry);
$expected = $upperfirst ? 'AbelCaincatdogx' : 'catdogxAbelCain';
-print ($x eq $expected ? "ok 31\n" : "not ok 31\n");
+print ($x eq $expected ? "ok 41\n" : "not ok 41\n");
print "# x = '$x'; expected = '$expected'\n";
$x = join('', sort { $b cmp $a } @harry);
$expected = $upperfirst ? 'xdogcatCainAbel' : 'CainAbelxdogcat';
-print ($x eq $expected ? "ok 32\n" : "not ok 32\n");
+print ($x eq $expected ? "ok 42\n" : "not ok 42\n");
print "# x = '$x'; expected = '$expected'\n";
{
use integer;
@b = sort { $a <=> $b } @a;
- print ("@b" eq '5 19 90 255 1996' ? "ok 33\n" : "not ok 33\n");
+ print ("@b" eq '5 19 90 255 1996' ? "ok 43\n" : "not ok 43\n");
print "# x = '@b'\n";
@b = sort { $b <=> $a } @a;
- print ("@b" eq '1996 255 90 19 5' ? "ok 34\n" : "not ok 34\n");
+ print ("@b" eq '1996 255 90 19 5' ? "ok 44\n" : "not ok 44\n");
print "# x = '@b'\n";
$x = join('', sort { $a cmp $b } @harry);
$expected = $upperfirst ? 'AbelCaincatdogx' : 'catdogxAbelCain';
- print ($x eq $expected ? "ok 35\n" : "not ok 35\n");
+ print ($x eq $expected ? "ok 45\n" : "not ok 45\n");
print "# x = '$x'; expected = '$expected'\n";
$x = join('', sort { $b cmp $a } @harry);
$expected = $upperfirst ? 'xdogcatCainAbel' : 'CainAbelxdogcat';
- print ($x eq $expected ? "ok 36\n" : "not ok 36\n");
+ print ($x eq $expected ? "ok 46\n" : "not ok 46\n");
print "# x = '$x'; expected = '$expected'\n";
}
# test that an optimized-away comparison block doesn't take any other
# arguments away with it
$x = join('', sort { $a <=> $b } 3, 1, 2);
-print $x eq "123" ? "ok 37\n" : "not ok 37\n";
+print $x eq "123" ? "ok 47\n" : "not ok 47\n";
# test sorting in non-main package
package Foo;
@a = ( 5, 19, 1996, 255, 90 );
@b = sort { $b <=> $a } @a;
-print ("@b" eq '1996 255 90 19 5' ? "ok 38\n" : "not ok 38\n");
+print ("@b" eq '1996 255 90 19 5' ? "ok 48\n" : "not ok 48\n");
+print "# x = '@b'\n";
+
+@b = sort main::backwards_stacked @a;
+print ("@b" eq '90 5 255 1996 19' ? "ok 49\n" : "not ok 49\n");
print "# x = '@b'\n";
$Is_MSWin32 = $^O eq 'MSWin32';
$Is_Dos = $^O eq 'dos';
$Is_Dosish = $Is_Dos || $^O eq 'os2' || $Is_MSWin32;
+$Is_Cygwin = $^O eq 'cygwin';
chop($cwd = ($Is_MSWin32 ? `cd` : `pwd`));
-$DEV = `ls -l /dev` unless $Is_Dosish;
+$DEV = `ls -l /dev` unless $Is_Dosish or $Is_Cygwin;
unlink "Op.stat.tmp";
if (open(FOO, ">Op.stat.tmp")) {
{print "not ok 33\n";}
if (! -b '.') {print "ok 34\n";} else {print "not ok 34\n";}
-if ($^O eq 'amigaos' or $Is_Dosish) {
+if ($^O eq 'amigaos' or $Is_Dosish or $Is_Cygwin) {
print "ok 35 # skipped: no -u\n"; goto tty_test;
}
require Config; import Config;
}
-print "1..83\n";
+print "1..84\n";
$x = 'foo';
$_ = "x";
eval q% ($_ = "x") =~ s/x(($x)*)/"$1"/e %;
print +($_ eq '' and !length $@) ? "ok 83\n" : "not ok 83\n# \$_ eq $_, $@\n";
+$_ = "C:/";
+s/^([a-z]:)/\u$1/ and print "not ";
+print "ok 84\n";
#!./perl
-print "1..106\n";
+print "1..108\n";
#P = start of string Q = start of substr R = end of substr S = end of string
eval 'substr($a,0,0,"") = "abc"';
print "not " unless $@ && $@ =~ /Can't modify substr/ && $a eq "foo";
print "ok 106\n";
+
+$a = "abcdefgh";
+print "not " unless sub { shift }->(substr($a, 0, 4, "xxxx")) eq 'abcd';
+print "ok 107\n";
+print "not " unless $a eq 'xxxxefgh';
+print "ok 108\n";
# Globs should be forbidden, except under VMS,
# which doesn't spawn an external program.
-if ($Is_VMS) {
+if (1 # built-in glob
+ or $Is_VMS) {
for (35..36) { print "ok $_\n"; }
}
else {
{print "not ok 5\n";}
# This could be stricter.
-if (gmtime() =~ /^(Sun|Mon|Tue|Wed|Thu|Fri|Sat) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Nov|Dec) ([ \d]\d) (\d\d):(\d\d):(\d\d) (\d\d\d\d)$/)
+if (gmtime() =~ /^(Sun|Mon|Tue|Wed|Thu|Fri|Sat) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ([ \d]\d) (\d\d):(\d\d):(\d\d) (\d\d\d\d)$/)
{print "ok 6\n";}
else
{print "not ok 6\n";}
+#!./perl
BEGIN {
- use File::Basename;
- my $THISDIR = dirname $0;
- unshift @INC, $THISDIR;
+ chdir 't' if -d 't';
+ unshift @INC, './pod', '../lib';
require "testp2pt.pl";
import TestPodIncPlainText;
}
+#!./perl
BEGIN {
- use File::Basename;
- my $THISDIR = dirname $0;
- unshift @INC, $THISDIR;
+ chdir 't' if -d 't';
+ unshift @INC, './pod', '../lib';
require "testp2pt.pl";
import TestPodIncPlainText;
}
This is a test
- pod2text should see this and this and this
+ pod2text should see this
+ and this
+ and this
and everything should see this!
- Similarly, this line ...
+Similarly, this line ...
- and this one ...
+and this one ...
- as well this one,
+as well this one,
- should all be in pod2text output
+should all be in pod2text output
- Tweedley-deedley-dee, Im as happy as can be! Tweedley-deedley-
- dum, cuz youre my honey sugar plum!
+ Tweedley-deedley-dee, Im as happy as can be! Tweedley-deedley-dum, cuz
+ youre my honey sugar plum!
The rest of this should show up in everything.
+#!./perl
BEGIN {
- use File::Basename;
- my $THISDIR = dirname $0;
- unshift @INC, $THISDIR;
+ chdir 't' if -d 't';
+ unshift @INC, './pod', '../lib';
require "testp2pt.pl";
import TestPodIncPlainText;
}
rdb2pg [*param*=*value* ...]
PARAMETERS
- rdb2pg uses an IRAF-compatible parameter interface. A template
- parameter file is in /proj/axaf/simul/lib/uparm/rdb2pg.par.
+ rdb2pg uses an IRAF-compatible parameter interface. A template parameter
+ file is in /proj/axaf/simul/lib/uparm/rdb2pg.par.
input *file*
- The RDB file to insert into the database. If the given name
- is the string `stdin', it reads from the UNIX standard input
- stream.
-
+ The RDB file to insert into the database. If the given name is the
+ string `stdin', it reads from the UNIX standard input stream.
DESCRIPTION
- rdb2pg will enter the data from an RDB database into a
- PostgreSQL database table, optionally creating the database and
- the table if they do not exist. It automatically determines the
- PostgreSQL data type from the column definition in the RDB file,
- but may be overriden via a series of definition files or
- directly via one of its parameters.
+ rdb2pg will enter the data from an RDB database into a PostgreSQL
+ database table, optionally creating the database and the table if they
+ do not exist. It automatically determines the PostgreSQL data type from
+ the column definition in the RDB file, but may be overriden via a series
+ of definition files or directly via one of its parameters.
- The target database and table are specified by the `db' and
- `table' parameters. If they do not exist, and the `createdb'
- parameter is set, they will be created. Table field definitions
- are determined in the following order:
+ The target database and table are specified by the `db' and `table'
+ parameters. If they do not exist, and the `createdb' parameter is set,
+ they will be created. Table field definitions are determined in the
+ following order:
+#!./perl
BEGIN {
- use File::Basename;
- my $THISDIR = dirname $0;
- unshift @INC, $THISDIR;
+ chdir 't' if -d 't';
+ unshift @INC, './pod', '../lib';
require "testp2pt.pl";
import TestPodIncPlainText;
}
- This file tries to demonstrate a simple =include directive for
- pods. It is used as follows:
+ This file tries to demonstrate a simple =include directive for pods. It
+ is used as follows:
=include filename
- where "filename" is expected to be an absolute pathname, or else
- reside be relative to the directory in which the current
- processed podfile resides, or be relative to the current
- directory.
+ where "filename" is expected to be an absolute pathname, or else reside
+ be relative to the directory in which the current processed podfile
+ resides, or be relative to the current directory.
Lets try it out with the file "included.t" shall we.
***THIS TEXT IS IMMEDIATELY BEFORE THE INCLUDE***
###### begin =include included.t #####
- This is the text of the included file named "included.t". It
- should appear in the final pod document from pod2xxx
+ This is the text of the included file named "included.t". It should
+ appear in the final pod document from pod2xxx
###### end =include included.t #####
***THIS TEXT IS IMMEDIATELY AFTER THE INCLUDE***
+#!./perl
BEGIN {
- use File::Basename;
- my $THISDIR = dirname $0;
- unshift @INC, $THISDIR;
+ chdir 't' if -d 't';
+ unshift @INC, './pod', '../lib';
require "testp2pt.pl";
import TestPodIncPlainText;
}
- This is the text of the included file named "included.t". It
- should appear in the final pod document from pod2xxx
+ This is the text of the included file named "included.t". It should
+ appear in the final pod document from pod2xxx
+#!./perl
BEGIN {
- use File::Basename;
- my $THISDIR = dirname $0;
- unshift @INC, $THISDIR;
+ chdir 't' if -d 't';
+ unshift @INC, './pod', '../lib';
require "testp2pt.pl";
import TestPodIncPlainText;
}
Try out *LOTS* of different ways of specifying references:
- Reference the the "section" entry in the manpage manpage
+ Reference the the section entry in the manpage manpage
- Reference the the "section" entry in the manpage manpage
+ Reference the the section entry in the manpage manpage
- Reference the the "section" entry in the manpage manpage
+ Reference the the section entry in the manpage manpage
- Reference the the "section" entry in the manpage manpage
+ Reference the the section entry in the manpage manpage
Reference the the section on "manpage/section"
- Reference the the "section" entry in the "manpage" manpage
+ Reference the the section entry in the "manpage" manpage
Reference the the section on "section" in the manpage manpage
- Reference the the "section" entry in the manpage manpage
+ Reference the the section entry in the manpage manpage
- Reference the the "section" entry in the manpage manpage
+ Reference the the section entry in the manpage manpage
Now try it using the new "|" stuff ...
--- /dev/null
+#!./perl
+BEGIN {
+ chdir 't' if -d 't';
+ unshift @INC, './pod', '../lib';
+ require "testp2pt.pl";
+ import TestPodIncPlainText;
+}
+
+my %options = map { $_ => 1 } @ARGV; ## convert cmdline to options-hash
+my $passed = testpodplaintext \%options, $0;
+exit( ($passed == 1) ? 0 : -1 ) unless $ENV{HARNESS_ACTIVE};
+
+
+__END__
+
+
+=head1 Test multiline item lists
+
+This is a test to ensure that multiline =item paragraphs
+get indented appropriately.
+
+=over 4
+
+=item This
+is
+a
+test.
+
+=back
+
+=cut
--- /dev/null
+Test multiline item lists
+ This is a test to ensure that multiline =item paragraphs get indented
+ appropriately.
+
+ This is a test.
+#!./perl
BEGIN {
- use File::Basename;
- my $THISDIR = dirname $0;
- unshift @INC, $THISDIR;
+ chdir 't' if -d 't';
+ unshift @INC, './pod', '../lib';
require "testp2pt.pl";
import TestPodIncPlainText;
}
Test nested item lists
- This is a test to ensure the nested =item paragraphs get
- indented appropriately.
+ This is a test to ensure the nested =item paragraphs get indented
+ appropriately.
1 First section.
+#!./perl
BEGIN {
- use File::Basename;
- my $THISDIR = dirname $0;
- unshift @INC, $THISDIR;
+ chdir 't' if -d 't';
+ unshift @INC, './pod', '../lib';
require "testp2pt.pl";
import TestPodIncPlainText;
}
- The statement: `This is dog kind's *finest* hour!' is a parody
- of a quotation from Winston Churchill.
+ The statement: `This is dog kind's *finest* hour!' is a parody of a
+ quotation from Winston Churchill.
+#!./perl
BEGIN {
- use File::Basename;
- my $THISDIR = dirname $0;
- unshift @INC, $THISDIR;
+ chdir 't' if -d 't';
+ unshift @INC, './pod', '../lib';
require "testp2pt.pl";
import TestPodIncPlainText;
}
rdb2pg [*param*=*value* ...]
PARAMETERS
- rdb2pg uses an IRAF-compatible parameter interface. A template
- parameter file is in /proj/axaf/simul/lib/uparm/rdb2pg.par.
+ rdb2pg uses an IRAF-compatible parameter interface. A template parameter
+ file is in /proj/axaf/simul/lib/uparm/rdb2pg.par.
input *file*
- The RDB file to insert into the database. If the given name
- is the string `stdin', it reads from the UNIX standard input
- stream.
-
+ The RDB file to insert into the database. If the given name is the
+ string `stdin', it reads from the UNIX standard input stream.
DESCRIPTION
- rdb2pg will enter the data from an RDB database into a
- PostgreSQL database table, optionally creating the database and
- the table if they do not exist. It automatically determines the
- PostgreSQL data type from the column definition in the RDB file,
- but may be overriden via a series of definition files or
- directly via one of its parameters.
+ rdb2pg will enter the data from an RDB database into a PostgreSQL
+ database table, optionally creating the database and the table if they
+ do not exist. It automatically determines the PostgreSQL data type from
+ the column definition in the RDB file, but may be overriden via a series
+ of definition files or directly via one of its parameters.
- The target database and table are specified by the `db' and
- `table' parameters. If they do not exist, and the `createdb'
- parameter is set, they will be created. Table field definitions
- are determined in the following order:
+ The target database and table are specified by the `db' and `table'
+ parameters. If they do not exist, and the `createdb' parameter is set,
+ they will be created. Table field definitions are determined in the
+ following order:
--- /dev/null
+#!./perl
+BEGIN {
+ chdir 't' if -d 't';
+ unshift @INC, './pod', '../lib';
+ require "testp2pt.pl";
+ import TestPodIncPlainText;
+}
+
+my %options = map { $_ => 1 } @ARGV; ## convert cmdline to options-hash
+my $passed = testpodplaintext \%options, $0;
+exit( ($passed == 1) ? 0 : -1 ) unless $ENV{HARNESS_ACTIVE};
+
+
+__END__
+
+=include pod2usage.PL
+
+
--- /dev/null
+###### begin =include pod2usage.PL #####
+NAME
+ pod2usage - print usage messages from embedded pod docs in files
+
+SYNOPSIS
+ pod2usage [-help] [-man] [-exit *exitval*] [-output *outfile*]
+ [-verbose *level*] [-pathlist *dirlist*] *file*
+
+OPTIONS AND ARGUMENTS
+ -help Print a brief help message and exit.
+
+ -man Print this command's manual page and exit.
+
+ -exit *exitval*
+ The exit status value to return.
+
+ -output *outfile*
+ The output file to print to. If the special names "-" or ">&1"
+ or ">&STDOUT" are used then standard output is used. If ">&2" or
+ ">&STDERR" is used then standard error is used.
+
+ -verbose *level*
+ The desired level of verbosity to use:
+
+ 1 : print SYNOPSIS only
+ 2 : print SYNOPSIS sections and any OPTIONS/ARGUMENTS sections
+ 3 : print the entire manpage (similar to running pod2text)
+
+ -pathlist *dirlist*
+ Specifies one or more directories to search for the input file
+ if it was not supplied with an absolute path. Each directory
+ path in the given list should be separated by a ':' on Unix (';'
+ on MSWin32 and DOS).
+
+ *file* The pathname of a file containing pod documentation to be output
+ in usage mesage format (defaults to standard input).
+
+DESCRIPTION
+ pod2usage will read the given input file looking for pod documentation
+ and will print the corresponding usage message. If no input file is
+ specifed than standard input is read.
+
+ pod2usage invokes the pod2usage() function in the Pod::Usage module.
+ Please see the pod2usage() entry in the Pod::Usage manpage.
+
+SEE ALSO
+ the Pod::Usage manpage, the pod2text(1) manpage
+
+AUTHOR
+ Brad Appleton <bradapp@enteract.com>
+
+ Based on code for pod2text(1) written by Tom Christiansen
+ <tchrist@mox.perl.com>
+
+###### end =include pod2usage.PL #####
+#!./perl
BEGIN {
- use File::Basename;
- my $THISDIR = dirname $0;
- unshift @INC, $THISDIR;
+ chdir 't' if -d 't';
+ unshift @INC, './pod', '../lib';
require "testpchk.pl";
import TestPodChecker;
}
entertaining.
And they say we'll have some fun if it stops raining!
+=head1 Additional tests
+
+=head2 item without over
+
+=item oops
+
+=head2 back without over
+
+=back
+
+=head2 over without back
+
+=over 4
+
+=item oops
+
+=head2 end without begin
+
+=end
+
+=head2 begin and begin
+
+=begin html
+
+=begin text
+
+=end
+
+=end
+
+=head2 Nested sequences of the same type
+
+C<code I<italic C<code again!>>>
+
+=head2 Garbled entities
+
+E<alea iacta est>
+E<C<auml>>
+E<abcI<bla>>
+
+=head2 Unresolved internal links
+
+L</"begin or begin">
+L<"end with begin">
+L</OoPs>
+
+=head2 Garbled (almost) links
+
+L<s s / s s / ss>
+L<".".":">
+L<"h"/"hh">
+L<a|b|c>
+
+=head2 Warnings
+
+L<passwd(5)>
+L< some text|page/"section" >
+
+=over 4
+
+=item bla
+
+=back 200
+
+=begin html
+
+What?
+
+=end xml
+
+=over 4
+
+=back
+
+see these unescaped < and > in the text?
+
=cut
+
-*** ERROR: Unknown command "unknown1" at line 21 of file t/poderrs.t
-*** ERROR: Unknown interior-sequence "N" at line 21 of file t/poderrs.t
-*** ERROR: Unknown interior-sequence "D" at line 22 of file t/poderrs.t
-*** ERROR: Unknown interior-sequence "Q" at line 25 of file t/poderrs.t
-*** ERROR: Unknown interior-sequence "A" at line 26 of file t/poderrs.t
-*** ERROR: Unknown interior-sequence "V" at line 27 of file t/poderrs.t
-*** ERROR: Unknown interior-sequence "Y" at line 27 of file t/poderrs.t
-** Unterminated B<...> at t/poderrs.t line 31
-** Unterminated I<...> at t/poderrs.t line 30
-** Unterminated C<...> at t/poderrs.t line 33
-t/poderrs.t has 10 pod syntax errors.
+*** ERROR: Unknown command "unknown1" at line 21 in file pod/poderrs.t
+*** ERROR: Unknown interior-sequence "N" at line 21 in file pod/poderrs.t
+*** ERROR: Unknown interior-sequence "D" at line 22 in file pod/poderrs.t
+*** ERROR: Unknown interior-sequence "Q" at line 25 in file pod/poderrs.t
+*** ERROR: Unknown interior-sequence "A" at line 26 in file pod/poderrs.t
+*** ERROR: Unknown interior-sequence "Y" at line 27 in file pod/poderrs.t
+*** ERROR: Unknown interior-sequence "V" at line 27 in file pod/poderrs.t
+** Unterminated B<...> at pod/poderrs.t line 31
+** Unterminated I<...> at pod/poderrs.t line 30
+** Unterminated C<...> at pod/poderrs.t line 33
+*** ERROR: =item without previous =over at line 43 in file pod/poderrs.t
+*** ERROR: =back without previous =over at line 47 in file pod/poderrs.t
+*** ERROR: unclosed =over (line 51) at head2 at line 55 in file pod/poderrs.t
+*** WARNING: =end without =begin at line 57 in file pod/poderrs.t
+*** ERROR: Nested =begin's (first at line 61:html) at line 63 in file pod/poderrs.t
+*** WARNING: =end without =begin at line 67 in file pod/poderrs.t
+*** ERROR: nested commands C<...C<...>...> at line 71 in file pod/poderrs.t
+*** ERROR: garbled entity E<alea iacta est> at line 75 in file pod/poderrs.t
+*** ERROR: garbled entity E<C<auml>> at line 76 in file pod/poderrs.t
+*** ERROR: garbled entity E<abcI<bla>> at line 77 in file pod/poderrs.t
+*** ERROR: malformed link L<>: garbled entry (spurious characters `s s / s s / ss') at line 87 in file pod/poderrs.t
+*** ERROR: malformed link L<>: garbled entry (spurious characters `".".":"') at line 88 in file pod/poderrs.t
+*** ERROR: malformed link L<>: garbled entry (spurious characters `"h"/"hh"') at line 89 in file pod/poderrs.t
+*** WARNING: brackets in `passwd(5)' at line 94 in file pod/poderrs.t
+*** WARNING: ignoring leading whitespace in link at line 95 in file pod/poderrs.t
+*** WARNING: ignoring trailing whitespace in link at line 95 in file pod/poderrs.t
+*** WARNING: Spurious character(s) after =back at line 101 in file pod/poderrs.t
+*** WARNING: Spurious character(s) after =end at line 107 in file pod/poderrs.t
+*** WARNING: No items in =over (at line 109) / =back list at line 111 in file pod/poderrs.t
+*** WARNING: 2 unescaped <> at line 113 in file pod/poderrs.t
+*** ERROR: unresolved internal link `begin or begin' at line 81 in file pod/poderrs.t
+*** ERROR: unresolved internal link `end with begin' at line 82 in file pod/poderrs.t
+*** ERROR: unresolved internal link `OoPs' at line 83 in file pod/poderrs.t
+*** ERROR: unresolved internal link `b|c' at line 90 in file pod/poderrs.t
+pod/poderrs.t has 25 pod syntax errors.
--- /dev/null
+#!./perl
+BEGIN {
+ chdir 't' if -d 't';
+ unshift @INC, './pod', '../lib';
+ require "testp2pt.pl";
+ import TestPodIncPlainText;
+}
+
+my %options = map { $_ => 1 } @ARGV; ## convert cmdline to options-hash
+my $passed = testpodplaintext \%options, $0;
+exit( ($passed == 1) ? 0 : -1 ) unless $ENV{HARNESS_ACTIVE};
+
+
+__END__
+
+=include podselect.PL
+
+
--- /dev/null
+###### begin =include podselect.PL #####
+NAME
+ podselect - print selected sections of pod documentation on standard
+ output
+
+SYNOPSIS
+ podselect [-help] [-man] [-section *section-spec*] [*file* ...]
+
+OPTIONS AND ARGUMENTS
+ -help Print a brief help message and exit.
+
+ -man Print the manual page and exit.
+
+ -section *section-spec*
+ Specify a section to include in the output. See the section on
+ "SECTION SPECIFICATIONS" in the Pod::Parser manpage for the
+ format to use for *section-spec*. This option may be given
+ multiple times on the command line.
+
+ *file* The pathname of a file from which to select sections of pod
+ documentation (defaults to standard input).
+
+DESCRIPTION
+ podselect will read the given input files looking for pod documentation
+ and will print out (in raw pod format) all sections that match one ore
+ more of the given section specifications. If no section specifications
+ are given than all pod sections encountered are output.
+
+ podselect invokes the podselect() function exported by Pod::Select
+ Please see the podselect() entry in the Pod::Select manpage for more
+ details.
+
+SEE ALSO
+ the Pod::Parser manpage and the Pod::Select manpage
+
+AUTHOR
+ Brad Appleton <bradapp@enteract.com>
+
+ Based on code for Pod::Text::pod2text(1) written by Tom Christiansen
+ <tchrist@mox.perl.com>
+
+###### end =include podselect.PL #####
+#!./perl
BEGIN {
- use File::Basename;
- my $THISDIR = dirname $0;
- unshift @INC, $THISDIR;
+ chdir 't' if -d 't';
+ unshift @INC, './pod', '../lib';
require "testp2pt.pl";
import TestPodIncPlainText;
}
- This is a test to see if I can do not only `$self' and
- `method()', but also `$self->method()' and `$self->{FIELDNAME}'
- and `{FOO=>BAR}' without resorting to escape sequences.
+ This is a test to see if I can do not only `$self' and `method()', but
+ also `$self->method()' and `$self->{FIELDNAME}' and `{FOO=>BAR}' without
+ resorting to escape sequences.
- Now for the grand finale of `$self->method()->{FIELDNAME} =
- {FOO=>BAR}'.
+ Now for the grand finale of `$self->method()->{FIELDNAME} = {FOO=>BAR}'.
- Of course I should still be able to do all this *with* escape
- sequences too: `$self->method()' and `$self->{FIELDNAME}' and
- `{FOO=>BAR}'.
+ Of course I should still be able to do all this *with* escape sequences
+ too: `$self->method()' and `$self->{FIELDNAME}' and `{FOO=>BAR}'.
Dont forget `$self->method()->{FIELDNAME} = {FOO=>BAR}'.
use Exporter;
use File::Basename;
use File::Spec;
+use FileHandle;
@ISA = qw(Exporter);
@EXPORT = qw(&testcmp);
push @INC, map { File::Spec->catfile($_, 'lib') } ($PARENTDIR, $THISDIR);
}
-use Pod::PlainText;
-use vars qw(@ISA @EXPORT $MYPKG);
#use strict;
#use diagnostics;
use Carp;
#use File::Compare;
#use Cwd qw(abs_path);
-@ISA = qw(Pod::PlainText);
-@EXPORT = qw(&testpodplaintext);
+use vars qw($MYPKG @EXPORT @ISA);
$MYPKG = eval { (caller)[0] };
+@EXPORT = qw(&testpodplaintext);
+BEGIN {
+ if ( $] >= 5.005_58 ) {
+ require Pod::Text;
+ @ISA = qw( Pod::Text );
+ }
+ else {
+ require Pod::PlainText;
+ @ISA = qw( Pod::PlainText );
+ }
+}
## Hardcode settings for TERMCAP and COLUMNS so we can try to get
## reproducible results between environments
-@ENV{qw(TERMCAP COLUMNS)} = ('co=72:do=^J', 72);
+@ENV{qw(TERMCAP COLUMNS)} = ('co=76:do=^J', 76);
sub catfile(@) { File::Spec->catfile(@_); }
$INSTDIR = (dirname $INSTDIR) if (basename($INSTDIR) eq 'pod');
$INSTDIR = (dirname $INSTDIR) if (basename($INSTDIR) eq 't');
my @PODINCDIRS = ( catfile($INSTDIR, 'lib', 'Pod'),
- catfile($INSTDIR, 'scripts'),
+ catfile($INSTDIR, 'pod'),
catfile($INSTDIR, 't', 'pod'),
catfile($INSTDIR, 't', 'pod', 'xtra')
);
return $msg;
}
- print "+ Running testpodinc2plaintext for '$testname'...\n";
+ print "# Running testpodinc2plaintext for '$testname'...\n";
## Compare the output against the expected result
podinc2plaintext($infile, $outfile);
if ( testcmp($outfile, $cmpfile) ) {
if ($opts{'-xrgen'}) {
if ($opts{'-force'} or ! -e $cmpfile) {
## Create the comparison file
- print "+ Creating expected result for \"$testname\"" .
+ print "# Creating expected result for \"$testname\"" .
" pod2plaintext test ...\n";
podinc2plaintext($podfile, $cmpfile);
}
else {
- print "+ File $cmpfile already exists" .
+ print "# File $cmpfile already exists" .
" (use '-force' to regenerate it).\n";
}
next;
-Cmp => $cmpfile;
if ($failmsg) {
++$failed;
- print "+\tFAILED. ($failmsg)\n";
+ print "#\tFAILED. ($failmsg)\n";
print "not ok ", $failed+$passes, "\n";
}
else {
++$passes;
unlink($outfile);
- print "+\tPASSED.\n";
+ print "#\tPASSED.\n";
print "ok ", $failed+$passes, "\n";
}
}
}
sub msgcmp( $ $ ) {
- ## filter out platform-dependent aspects of error messages
my ($line1, $line2) = @_;
- for ($line1, $line2) {
- if ( /^#*\s*(\S.*?)\s+(?:has \d+\s*)?pod syntax (?:error|OK)/ ) {
- my $fname = $1;
- s/^#*\s*// if ($^O eq 'MacOS');
- s/^\s*\Q$fname\E/stripname($fname)/e;
- }
- elsif ( /^#*\s*\*+\s*(?:ERROR|Unterminated)/ ) {
- s/^#*\s*// if ($^O eq 'MacOS');
- s/of file\s+(\S.*?)\s*$/"of file ".stripname($1)/e;
- s/at\s+(\S.*?)\s+line/"at ".stripname($1)." line"/e;
- }
- }
return $line1 ne $line2;
}
return $msg;
}
- print "+ Running podchecker for '$testname'...\n";
+ print "# Running podchecker for '$testname'...\n";
## Compare the output against the expected result
podchecker($infile, $outfile);
if ( testcmp({'-cmplines' => \&msgcmp}, $outfile, $cmpfile) ) {
if ($opts{'-xrgen'}) {
if ($opts{'-force'} or ! -e $cmpfile) {
## Create the comparison file
- print "+ Creating expected result for \"$testname\"" .
+ print "# Creating expected result for \"$testname\"" .
" podchecker test ...\n";
podchecker($podfile, $cmpfile);
}
else {
- print "+ File $cmpfile already exists" .
+ print "# File $cmpfile already exists" .
" (use '-force' to regenerate it).\n";
}
next;
-Cmp => $cmpfile;
if ($failmsg) {
++$failed;
- print "+\tFAILED. ($failmsg)\n";
+ print "#\tFAILED. ($failmsg)\n";
print "not ok ", $failed+$passes, "\n";
}
else {
++$passes;
unlink($outfile);
- print "+\tPASSED.\n";
+ print "#\tPASSED.\n";
print "ok ", $failed+$passes, "\n";
}
}
######################### We start with some black magic to print on failure.
-BEGIN { $| = 1; print "1..46\n"; }
+BEGIN { $| = 1; print "1..58\n"; }
END {print "not ok 1\n" unless $loaded;}
-use constant;
+use constant 1.01;
$loaded = 1;
#print "# Version: $constant::VERSION\n";
print "ok 1\n";
print CARRAY->[1];
print CPHASH->{foo};
eval q{ CPHASH->{bar} };
-test 44, scalar($@ =~ /^No such array/);
+test 44, scalar($@ =~ /^No such pseudo-hash field/);
print CCODE->(45);
eval q{ CCODE->{foo} };
test 46, scalar($@ =~ /^Constant is not a HASH/);
+
+# Allow leading underscore
+use constant _PRIVATE => 47;
+test 47, _PRIVATE == 47;
+
+# Disallow doubled leading underscore
+eval q{
+ use constant __DISALLOWED => "Oops";
+};
+test 48, $@ =~ /begins with '__'/;
+
+# Check on declared() and %declared. This sub should be EXACTLY the
+# same as the one quoted in the docs!
+sub declared ($) {
+ use constant 1.01; # don't omit this!
+ my $name = shift;
+ $name =~ s/^::/main::/;
+ my $pkg = caller;
+ my $full_name = $name =~ /::/ ? $name : "${pkg}::$name";
+ $constant::declared{$full_name};
+}
+
+test 49, declared 'PI';
+test 50, $constant::declared{'main::PI'};
+
+test 51, !declared 'PIE';
+test 52, !$constant::declared{'main::PIE'};
+
+{
+ package Other;
+ use constant IN_OTHER_PACK => 42;
+ ::test 53, ::declared 'IN_OTHER_PACK';
+ ::test 54, $constant::declared{'Other::IN_OTHER_PACK'};
+ ::test 55, ::declared 'main::PI';
+ ::test 56, $constant::declared{'main::PI'};
+}
+
+test 57, declared 'Other::IN_OTHER_PACK';
+test 58, $constant::declared{'Other::IN_OTHER_PACK'};
Yiddish:::1 15
EOF
+if ($^O eq 'os390') {
+ $locales =~ s/Svenska Swedish:sv:fi se:1 15\n//;
+ $locales =~ s/Thai:th:th:11 tis620\n//;
+}
+
sub in_utf8 () { $^H & 0x08 }
if (in_utf8) {
push @enc, $_;
}
}
+ if ($^O eq 'os390') {
+ push @enc, qw(IBM-037 IBM-819 IBM-1047);
+ }
return @enc;
}
sub new { my ($p, $v) = @_; bless \$v, $p }
sub iter { my ($x) = @_; return undef if $$x < 0; return $$x--; }
}
-{
+
+# XXX iterator overload not intended to work with CORE::GLOBAL?
+if (defined &CORE::GLOBAL::glob) {
+ test '1', '1'; # 175
+ test '1', '1'; # 176
+ test '1', '1'; # 177
+}
+else {
my $iter = iterator->new(5);
my $acc = '';
my $out;
}, 'deref';
# Hash:
my @cont = sort %$deref;
- test "@cont", '23 5 fake foo'; # 178
+ if ("\t" eq "\011") { # ascii
+ test "@cont", '23 5 fake foo'; # 178
+ }
+ else { # ebcdic alpha-numeric sort order
+ test "@cont", 'fake foo 23 5'; # 178
+ }
my @keys = sort keys %$deref;
test "@keys", 'fake foo'; # 179
my @val = sort values %$deref;
########
# strict subs - error
+use strict 'subs' ;
+my @a = (A..Z);
+EXPECT
+Bareword "Z" not allowed while "strict subs" in use at - line 4.
+Bareword "A" not allowed while "strict subs" in use at - line 4.
+Execution of - aborted due to compilation errors.
+########
+
+# strict subs - error
+use strict 'subs' ;
+my $a = (B..Y);
+EXPECT
+Bareword "Y" not allowed while "strict subs" in use at - line 4.
+Bareword "B" not allowed while "strict subs" in use at - line 4.
+Execution of - aborted due to compilation errors.
+########
+
+# strict subs - error
use strict ;
Fred ;
EXPECT
EXPECT
2
1
+########
+
+# "nailed" our declaration visibility across package boundaries
+use strict 'vars';
+our $foo;
+$foo = 20;
+package Foo;
+print $foo, "\n";
+EXPECT
+20
+########
+
+# multiple our declarations in same scope, different packages, no warning
+use strict 'vars';
+use warnings;
+our $foo;
+${foo} = 10;
+package Foo;
+our $foo = 20;
+print $foo, "\n";
+EXPECT
+20
+########
+
+# multiple our declarations in same scope, same package, warning
+use strict 'vars';
+use warnings;
+our $foo;
+${foo} = 10;
+our $foo;
+EXPECT
+"our" variable $foo masks earlier declaration in same scope at - line 7.
unshift @INC, '../lib';
}
-sub a {use attrs 'lvalue'; my $a = 34; bless \$a} # Return a temporary
-sub b {use attrs 'lvalue'; shift}
+sub a : lvalue { my $a = 34; bless \$a } # Return a temporary
+sub b : lvalue { shift }
my $out = a(b()); # Check that temporaries are allowed.
print "# `$out'\nnot " unless ref $out eq 'main'; # Not reached if error.
# Check that we can return localized values from subroutines:
-sub in {use attrs 'lvalue'; $in = shift;}
-sub neg {use attrs 'lvalue'; #(num_str) return num_str
+sub in : lvalue { $in = shift; }
+sub neg : lvalue { #(num_str) return num_str
local $_ = shift;
s/^\+/-/;
$_;
print "# `$in'\nnot " unless $in eq '-2';
print "ok 3\n";
-sub get_lex {use attrs 'lvalue'; $in}
-sub get_st {use attrs 'lvalue'; $blah}
-sub id {use attrs 'lvalue'; shift}
-sub id1 {use attrs 'lvalue'; $_[0]}
-sub inc {use attrs 'lvalue'; ++$_[0]}
+sub get_lex : lvalue { $in }
+sub get_st : lvalue { $blah }
+sub id : lvalue { shift }
+sub id1 : lvalue { $_[0] }
+sub inc : lvalue { ++$_[0] }
$in = 5;
$blah = 3;
=for disabled constructs
-sub a3 {use attrs 'lvalue'; @a}
-sub b2 {use attrs 'lvalue'; @b}
-sub c4 {use attrs 'lvalue'; @c}
+sub a3 :lvalue {@a}
+sub b2 : lvalue {@b}
+sub c4: lvalue {@c}
$_ = '';
my $var;
-sub a::var {use attrs 'lvalue'; $var}
+sub a::var : lvalue { $var }
"a"->var = 45;
print "# `$var' ne 47\nnot " unless $var eq 47;
print "ok 24\n";
-sub o {use attrs 'lvalue'; $o}
+sub o : lvalue { $o }
o->var = 49;
unless /Can\'t modify non-lvalue subroutine call/;
print "ok 30\n";
-sub lv0 {use attrs 'lvalue';} # Converted to lv10 in scalar context
+sub lv0 : lvalue { } # Converted to lv10 in scalar context
$_ = undef;
eval <<'EOE' or $_ = $@;
unless /Can\'t return a readonly value from lvalue subroutine/;
print "ok 31\n";
-sub lv10 {use attrs 'lvalue';}
+sub lv10 : lvalue {}
$_ = undef;
eval <<'EOE' or $_ = $@;
print "# '$_'.\nnot " if defined $_;
print "ok 32\n";
-sub lv1u {use attrs 'lvalue'; undef }
+sub lv1u :lvalue { undef }
$_ = undef;
eval <<'EOE' or $_ = $@;
print "ok 34\n";
$x = '1234567';
-sub lv1t {use attrs 'lvalue'; index $x, 2 }
+sub lv1t : lvalue { index $x, 2 }
$_ = undef;
eval <<'EOE' or $_ = $@;
$xxx = 'xxx';
sub xxx () { $xxx } # Not lvalue
-sub lv1tmp {use attrs 'lvalue'; xxx } # is it a TEMP?
+sub lv1tmp : lvalue { xxx } # is it a TEMP?
$_ = undef;
eval <<'EOE' or $_ = $@;
print "ok 38\n";
sub xxx () { 'xxx' } # Not lvalue
-sub lv1tmpr {use attrs 'lvalue'; xxx } # is it a TEMP?
+sub lv1tmpr : lvalue { xxx } # is it a TEMP?
$_ = undef;
eval <<'EOE' or $_ = $@;
=for disabled constructs
-sub lva {use attrs 'lvalue';@a}
+sub lva : lvalue {@a}
$_ = undef;
@a = ();
print "ok $_\n" for 41..43;
-sub lv1n {use attrs 'lvalue'; $newvar }
+sub lv1n : lvalue { $newvar }
$_ = undef;
eval <<'EOE' or $_ = $@;
print "# '$_', '$newvar'.\nnot " unless "'$newvar' $_" eq "'4' ";
print "ok 44\n";
-sub lv1nn {use attrs 'lvalue'; $nnewvar }
+sub lv1nn : lvalue { $nnewvar }
$_ = undef;
eval <<'EOE' or $_ = $@;
chdir 't' if -d 't';
unshift @INC, '../lib';
$ENV{PERL5LIB} = '../lib';
+ if ( ord("\t") != 9 ) { # skip on ebcdic platforms
+ print "1..0 # Skip utf8 tests on ebcdic platform.\n";
+ exit;
+ }
}
print "1..12\n";
$^W = 1 ;
my $b ; chop $b ;
EXPECT
-Use of uninitialized value at - line 4.
+Use of uninitialized value in scalar chop at - line 4.
########
# warnings enabled at compile time, disabled at run time
$^W = 1 ;
my $b ; chop $b ;
EXPECT
-Use of uninitialized value at - line 5.
+Use of uninitialized value in scalar chop at - line 5.
########
-w
--FILE-- abcd
--FILE--
require "./abcd";
EXPECT
-Use of uninitialized value at ./abcd line 1.
+Use of uninitialized value in scalar chop at ./abcd line 1.
########
--FILE-- abcd
#! perl -w
require "./abcd";
EXPECT
-Use of uninitialized value at ./abcd line 1.
+Use of uninitialized value in scalar chop at ./abcd line 1.
########
--FILE-- abcd
$^W =1 ;
require "./abcd";
EXPECT
-Use of uninitialized value at ./abcd line 1.
+Use of uninitialized value in scalar chop at ./abcd line 1.
########
--FILE-- abcd
require "./abcd";
my $b ; chop $b ;
EXPECT
-Use of uninitialized value at - line 3.
+Use of uninitialized value in scalar chop at - line 3.
########
$^W = 1;
eval 'my $b ; chop $b ;' ;
print $@ ;
EXPECT
-Use of uninitialized value at (eval 1) line 1.
+Use of uninitialized value in scalar chop at (eval 1) line 1.
########
eval '$^W = 1;' ;
print $@ ;
my $b ; chop $b ;
EXPECT
-Use of uninitialized value at - line 4.
+Use of uninitialized value in scalar chop at - line 4.
########
eval {$^W = 1;} ;
print $@ ;
my $b ; chop $b ;
EXPECT
-Use of uninitialized value at - line 4.
+Use of uninitialized value in scalar chop at - line 4.
########
{
}
my $c ; chop $c ;
EXPECT
-Use of uninitialized value at - line 5.
+Use of uninitialized value in scalar chop at - line 5.
########
-w
-e undef
EXPECT
-Use of uninitialized value at - line 2.
+Use of uninitialized value in -e at - line 2.
########
$^W = 1 + 2 ;
fred() ;
}
EXPECT
-Use of uninitialized value at - line 2.
+Use of uninitialized value in scalar chop at - line 2.
}
my $b ; chop $b ;
EXPECT
-Use of uninitialized value at - line 8.
+Use of uninitialized value in scalar chop at - line 8.
########
# Check runtime scope of pragma
}
my $b ; chop $b ;
EXPECT
-Use of uninitialized value at - line 6.
+Use of uninitialized value in scalar chop at - line 6.
########
# Check runtime scope of pragma
}
&$a ;
EXPECT
-Use of uninitialized value at - line 6.
+Use of uninitialized value in scalar chop at - line 6.
########
use warnings 'deprecated' ;
my $a ; chop $a ;
EXPECT
Use of EQ is deprecated at ./abc line 2.
-Use of uninitialized value at - line 3.
+Use of uninitialized value in scalar chop at - line 3.
########
--FILE-- abc.pm
my $a ; chop $a ;
EXPECT
Use of EQ is deprecated at abc.pm line 2.
-Use of uninitialized value at - line 3.
+Use of uninitialized value in scalar chop at - line 3.
########
# Check scope of pragma with eval
}; print STDERR $@ ;
my $b ; chop $b ;
EXPECT
-Use of uninitialized value at - line 6.
+Use of uninitialized value in scalar chop at - line 6.
########
# Check scope of pragma with eval
}; print STDERR $@ ;
my $b ; chop $b ;
EXPECT
-Use of uninitialized value at - line 5.
-Use of uninitialized value at - line 7.
+Use of uninitialized value in scalar chop at - line 5.
+Use of uninitialized value in scalar chop at - line 7.
########
# Check scope of pragma with eval
}; print STDERR $@ ;
my $b ; chop $b ;
EXPECT
-Use of uninitialized value at - line 8.
+Use of uninitialized value in scalar chop at - line 8.
########
# Check scope of pragma with eval
]; print STDERR $@;
my $b ; chop $b ;
EXPECT
-Use of uninitialized value at (eval 1) line 3.
+Use of uninitialized value in scalar chop at (eval 1) line 3.
########
# Check scope of pragma with eval
'; print STDERR $@ ;
my $b ; chop $b ;
EXPECT
-Use of uninitialized value at (eval 1) line 2.
-Use of uninitialized value at - line 7.
+Use of uninitialized value in scalar chop at (eval 1) line 2.
+Use of uninitialized value in scalar chop at - line 7.
########
# Check scope of pragma with eval
'; print STDERR $@ ;
my $b ; chop $b ;
EXPECT
-Use of uninitialized value at - line 8.
+Use of uninitialized value in scalar chop at - line 8.
########
# Check scope of pragma with eval
1 if $a EQ $b ;
EXPECT
Use of EQ is deprecated at - line 6.
-Use of uninitialized value at - line 9.
-Use of uninitialized value at - line 11.
-Use of uninitialized value at - line 11.
+Use of uninitialized value in scalar chop at - line 9.
+Use of uninitialized value in string eq at - line 11.
+Use of uninitialized value in string eq at - line 11.
}
EXPECT
-Use of uninitialized value at - line 6.
+Use of uninitialized value in scalar chop at - line 6.
########
# Check interaction of $^W and use warnings
}
EXPECT
-Use of uninitialized value at - line 6.
+Use of uninitialized value in scalar chop at - line 6.
########
# Check interaction of $^W and use warnings
my $b ;
chop $b ;
EXPECT
-Use of uninitialized value at - line 6.
+Use of uninitialized value in scalar chop at - line 6.
########
# Check interaction of $^W and use warnings
my $b ;
chop $b ;
EXPECT
-Use of uninitialized value at - line 6.
+Use of uninitialized value in scalar chop at - line 6.
########
# Check interaction of $^W and use warnings
my $b ;
chop $b ;
EXPECT
-Use of uninitialized value at - line 5.
+Use of uninitialized value in scalar chop at - line 5.
########
# Check interaction of $^W and use warnings
BEGIN { $^W = 0 }
fred() ;
EXPECT
-Use of uninitialized value at - line 6.
+Use of uninitialized value in scalar chop at - line 6.
########
# Check interaction of $^W and use warnings
my $b ;
chop $b ;
EXPECT
-Use of uninitialized value at - line 6.
+Use of uninitialized value in scalar chop at - line 6.
########
# Check interaction of $^W and use warnings
my $b ;
chop $b ;
EXPECT
-Use of uninitialized value at - line 6.
+Use of uninitialized value in scalar chop at - line 6.
########
# Check interaction of $^W and use warnings
my $b ;
chop $b ;
EXPECT
-Use of uninitialized value at - line 10.
+Use of uninitialized value in scalar chop at - line 10.
########
# Check interaction of $^W and use warnings
my $b ;
chop $b ;
EXPECT
-Use of uninitialized value at - line 7.
+Use of uninitialized value in scalar chop at - line 7.
close STDIN ; print STDIN "abc" ;
EXPECT
Use of EQ is deprecated at - line 5.
-print on closed filehandle main::STDIN at - line 6.
+print() on closed filehandle main::STDIN at - line 6.
########
-W
# lint: check runtime $^W is zapped
$^W = 0 ;
close STDIN ; print STDIN "abc" ;
EXPECT
-print on closed filehandle main::STDIN at - line 4.
+print() on closed filehandle main::STDIN at - line 4.
########
-W
# lint: check runtime $^W is zapped
close STDIN ; print STDIN "abc" ;
}
EXPECT
-print on closed filehandle main::STDIN at - line 5.
+print() on closed filehandle main::STDIN at - line 5.
########
-W
# lint: check "no warnings" is zapped
close STDIN ; print STDIN "abc" ;
EXPECT
Use of EQ is deprecated at - line 5.
-print on closed filehandle main::STDIN at - line 6.
+print() on closed filehandle main::STDIN at - line 6.
########
-W
# lint: check "no warnings" is zapped
close STDIN ; print STDIN "abc" ;
}
EXPECT
-print on closed filehandle main::STDIN at - line 5.
+print() on closed filehandle main::STDIN at - line 5.
########
-Ww
# lint: check combination of -w and -W
close STDIN ; print STDIN "abc" ;
}
EXPECT
-print on closed filehandle main::STDIN at - line 5.
+print() on closed filehandle main::STDIN at - line 5.
########
-W
--FILE-- abc.pm
my $a ; chop $a ;
EXPECT
Use of EQ is deprecated at abc.pm line 3.
-Use of uninitialized value at - line 3.
+Use of uninitialized value in scalar chop at - line 3.
########
-W
--FILE-- abc
my $a ; chop $a ;
EXPECT
Use of EQ is deprecated at ./abc line 3.
-Use of uninitialized value at - line 3.
+Use of uninitialized value in scalar chop at - line 3.
########
-W
--FILE-- abc.pm
my $a ; chop $a ;
EXPECT
Use of EQ is deprecated at abc.pm line 3.
-Use of uninitialized value at - line 3.
+Use of uninitialized value in scalar chop at - line 3.
########
-W
--FILE-- abc
my $a ; chop $a ;
EXPECT
Use of EQ is deprecated at ./abc line 3.
-Use of uninitialized value at - line 3.
+Use of uninitialized value in scalar chop at - line 3.
my $b ; chop $b ;
print STDERR "The End.\n" ;
EXPECT
-Use of uninitialized value at - line 8.
+Use of uninitialized value in scalar chop at - line 8.
########
# Check runtime scope of pragma
&$a ;
print STDERR "The End.\n" ;
EXPECT
-Use of uninitialized value at - line 6.
+Use of uninitialized value in scalar chop at - line 6.
########
--FILE-- abc
print STDERR "The End.\n" ;
EXPECT
Use of EQ is deprecated at ./abc line 2.
-Use of uninitialized value at - line 3.
+Use of uninitialized value in scalar chop at - line 3.
########
--FILE-- abc.pm
print STDERR "The End.\n" ;
EXPECT
Use of EQ is deprecated at abc.pm line 2.
-Use of uninitialized value at - line 3.
+Use of uninitialized value in scalar chop at - line 3.
########
# Check scope of pragma with eval
my $b ; chop $b ;
print STDERR "The End.\n" ;
EXPECT
--- Use of uninitialized value at - line 6.
+-- Use of uninitialized value in scalar chop at - line 6.
The End.
########
my $b ; chop $b ;
print STDERR "The End.\n" ;
EXPECT
--- Use of uninitialized value at - line 5.
-Use of uninitialized value at - line 7.
+-- Use of uninitialized value in scalar chop at - line 5.
+Use of uninitialized value in scalar chop at - line 7.
########
# Check scope of pragma with eval
my $b ; chop $b ;
print STDERR "The End.\n" ;
EXPECT
-Use of uninitialized value at - line 8.
+Use of uninitialized value in scalar chop at - line 8.
########
# Check scope of pragma with eval
my $b ; chop $b ;
print STDERR "The End.\n" ;
EXPECT
--- Use of uninitialized value at (eval 1) line 3.
+-- Use of uninitialized value in scalar chop at (eval 1) line 3.
The End.
########
my $b ; chop $b ;
print STDERR "The End.\n" ;
EXPECT
--- Use of uninitialized value at (eval 1) line 2.
-Use of uninitialized value at - line 7.
+-- Use of uninitialized value in scalar chop at (eval 1) line 2.
+Use of uninitialized value in scalar chop at - line 7.
########
# Check scope of pragma with eval
my $b ; chop $b ;
print STDERR "The End.\n" ;
EXPECT
-Use of uninitialized value at - line 8.
+Use of uninitialized value in scalar chop at - line 8.
########
# Check scope of pragma with eval
doio.c
- Can't do bidirectional pipe [Perl_do_open9]
+ Can't open bidirectional pipe [Perl_do_open9]
open(F, "| true |");
Missing command in piped open [Perl_do_open9]
open(G, '|'.($^O eq 'VMS' ? 'mcr ':'')."$^X -e 1|");
close(G);
EXPECT
-Can't do bidirectional pipe at - line 3.
+Can't open bidirectional pipe at - line 3.
########
# doio.c [Perl_do_open9]
use warnings 'io' ;
no warnings 'uninitialized' ;
print $b ;
EXPECT
-Use of uninitialized value at - line 3.
+Use of uninitialized value in print at - line 3.
########
# doio.c [Perl_my_stat Perl_my_lstat]
use warnings 'io' ;
Malformed UTF-8 character at - line 4.
########
# doop.c
+BEGIN {
+ if (ord("\t") == 5) {
+ print "SKIPPED\n# Character codes differ on ebcdic machines.";
+ exit 0;
+ }
+}
use warnings 'utf8' ;
use utf8 ;
$_ = "\x80 \xff" ;
$_ = "\x80 \xff" ;
chop ;
EXPECT
-\x80 will produce malformed UTF-8 character; use \x{80} for that at - line 4.
-\xff will produce malformed UTF-8 character; use \x{ff} for that at - line 4.
-Malformed UTF-8 character at - line 5.
+\x80 will produce malformed UTF-8 character; use \x{80} for that at - line 10.
+\xff will produce malformed UTF-8 character; use \x{ff} for that at - line 10.
+Malformed UTF-8 character at - line 11.
Useless use of a constant in void context at - line 4.
########
# op.c
-$ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3; # known scalar leak
+BEGIN{ $ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3; } # known scalar leak
use warnings 'unsafe' ;
my $a ; my @a = () ; my %a = () ; my $b = \@a ; my $c = \%a ;
@a =~ /abc/ ;
no warnings 'uninitialized' ;
my $c = $$a;
EXPECT
-Use of uninitialized value at - line 4.
+Use of uninitialized value in scalar dereference at - line 4.
########
# pp.c
use warnings 'unsafe' ;
Malformed UTF-8 character at - line 4.
########
# pp.c
+BEGIN {
+ if (ord("\t") == 5) {
+ print "SKIPPED\n# Character codes differ on ebcdic machines.";
+ exit 0;
+ }
+}
use warnings 'utf8' ;
use utf8 ;
$_ = "\x80 \xff" ;
$_ = "\x80 \xff" ;
reverse ;
EXPECT
-\x80 will produce malformed UTF-8 character; use \x{80} for that at - line 4.
-\xff will produce malformed UTF-8 character; use \x{ff} for that at - line 4.
-Malformed UTF-8 character at - line 5.
+\x80 will produce malformed UTF-8 character; use \x{80} for that at - line 10.
+\xff will produce malformed UTF-8 character; use \x{ff} for that at - line 10.
+Malformed UTF-8 character at - line 11.
@b = sort { last } @a ;
EXPECT
Exiting pseudo-block via last at - line 4.
-Can't "last" outside a block at - line 4.
+Can't "last" outside a loop block at - line 4.
########
# pp_ctl.c
use warnings 'unsafe' ;
Filehandle %s opened only for output [pp_print]
print <STDOUT> ;
- print on closed filehandle %s [pp_print]
+ print() on closed filehandle %s [pp_print]
close STDIN ; print STDIN "abc" ;
uninitialized [pp_rv2av]
glob failed (can't start child: %s) [Perl_do_readline] <<TODO
- Read on closed filehandle %s [Perl_do_readline]
+ readline() on closed filehandle %s [Perl_do_readline]
close STDIN ; $a = <STDIN>;
glob failed (child exited with status %d%s) [Perl_do_readline] <<TODO
no warnings 'closed' ;
print STDIN "anc";
EXPECT
-print on closed filehandle main::STDIN at - line 4.
+print() on closed filehandle main::STDIN at - line 4.
########
# pp_hot.c [pp_rv2av]
use warnings 'uninitialized' ;
no warnings 'uninitialized' ;
my @c = @$a;
EXPECT
-Use of uninitialized value at - line 4.
+Use of uninitialized value in array dereference at - line 4.
########
# pp_hot.c [pp_rv2hv]
use warnings 'uninitialized' ;
no warnings 'uninitialized' ;
my %c = %$a;
EXPECT
-Use of uninitialized value at - line 4.
+Use of uninitialized value in hash dereference at - line 4.
########
# pp_hot.c [pp_aassign]
use warnings 'unsafe' ;
no warnings 'closed' ;
$a = <STDIN> ;
EXPECT
-Read on closed filehandle main::STDIN at - line 3.
+readline() on closed filehandle main::STDIN at - line 3.
########
# pp_hot.c [Perl_do_readline]
use warnings 'io' ;
.
write STDIN;
- Write on closed filehandle %s [pp_leavewrite]
+ write() on closed filehandle %s [pp_leavewrite]
format STDIN =
.
close STDIN;
$a = "abc";
printf $a "fred"
- printf on closed filehandle %s [pp_prtf]
+ printf() on closed filehandle %s [pp_prtf]
close STDIN ;
printf STDIN "fred"
- Syswrite on closed filehandle [pp_send]
+ syswrite() on closed filehandle [pp_send]
close STDIN;
syswrite STDIN, "fred", 1;
- Send on closed socket [pp_send]
+ send() on closed socket [pp_send]
close STDIN;
send STDIN, "fred", 1
- bind() on closed fd [pp_bind]
+ bind() on closed socket [pp_bind]
close STDIN;
bind STDIN, "fred" ;
- connect() on closed fd [pp_connect]
+ connect() on closed socket [pp_connect]
close STDIN;
connect STDIN, "fred" ;
- listen() on closed fd [pp_listen]
+ listen() on closed socket [pp_listen]
close STDIN;
listen STDIN, 2;
- accept() on closed fd [pp_accept]
+ accept() on closed socket [pp_accept]
close STDIN;
accept STDIN, "fred" ;
- shutdown() on closed fd [pp_shutdown]
+ shutdown() on closed socket [pp_shutdown]
close STDIN;
shutdown STDIN, 0;
- [gs]etsockopt() on closed fd [pp_ssockopt]
+ setsockopt() on closed socket [pp_ssockopt]
+ getsockopt() on closed socket [pp_ssockopt]
close STDIN;
setsockopt STDIN, 1,2,3;
getsockopt STDIN, 1,2;
- get{sock, peer}name() on closed fd [pp_getpeername]
+ getsockname() on closed socket [pp_getpeername]
+ getpeername() on closed socket [pp_getpeername]
close STDIN;
getsockname STDIN;
getpeername STDIN;
no warnings 'closed' ;
write STDIN;
EXPECT
-Write on closed filehandle main::STDIN at - line 6.
+write() on closed filehandle main::STDIN at - line 6.
########
# pp_sys.c [pp_leavewrite]
use warnings 'io' ;
no warnings 'closed' ;
printf STDIN "fred";
EXPECT
-printf on closed filehandle main::STDIN at - line 4.
+printf() on closed filehandle main::STDIN at - line 4.
########
# pp_sys.c [pp_prtf]
use warnings 'io' ;
no warnings 'closed' ;
syswrite STDIN, "fred", 1;
EXPECT
-Syswrite on closed filehandle at - line 4.
+syswrite() on closed filehandle at - line 4.
########
# pp_sys.c [pp_prtf pp_send pp_bind pp_connect pp_listen pp_accept pp_shutdown pp_ssockopt ppp_getpeername]
use warnings 'io' ;
getsockname STDIN;
getpeername STDIN;
EXPECT
-Send on closed socket at - line 22.
-bind() on closed fd at - line 23.
-connect() on closed fd at - line 24.
-listen() on closed fd at - line 25.
-accept() on closed fd at - line 26.
-shutdown() on closed fd at - line 27.
-[gs]etsockopt() on closed fd at - line 28.
-[gs]etsockopt() on closed fd at - line 29.
-get{sock, peer}name() on closed fd at - line 30.
-get{sock, peer}name() on closed fd at - line 31.
+send() on closed socket at - line 22.
+bind() on closed socket at - line 23.
+connect() on closed socket at - line 24.
+listen() on closed socket at - line 25.
+accept() on closed socket at - line 26.
+shutdown() on closed socket at - line 27.
+setsockopt() on closed socket at - line 28.
+getsockopt() on closed socket at - line 29.
+getsockname() on closed socket at - line 30.
+getpeername() on closed socket at - line 31.
########
# pp_sys.c [pp_stat]
use warnings 'newline' ;
Character class syntax [%c %c] belongs inside character classes [S_checkposixcc]
+ /%.127s/: false [] range \"%*.*s\" in regexp [S_regclass]
-
+ /%.127s/: false [] range \"%*.*s\" in regexp [S_regclassutf8]
+
+ /%.127s/: Unrecognized escape \\%c in character class passed through" [S_regclass]
+
+ /%.127s/: Unrecognized escape \\%c in character class passed through" [S_regclassutf8]
__END__
# regcomp.c [S_regpiece]
########
# regcomp.c [S_regatom]
use warnings 'unsafe' ;
-$a =~ /\m/ ;
+$a =~ /a\mb\b/ ;
no warnings 'unsafe' ;
+$a =~ /a\mb\b/ ;
EXPECT
Unrecognized escape \m passed through at - line 3.
########
/[[.foo.]]/;
/[[=bar=]]/;
/[:zog:]/;
+BEGIN { $ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3 }
/[[:zog:]]/;
EXPECT
Character class syntax [: :] belongs inside character classes at - line 4.
Character class syntax [. .] is reserved for future extensions at - line 8.
Character class syntax [= =] is reserved for future extensions at - line 9.
Character class syntax [: :] belongs inside character classes at - line 10.
-Character class [:zog:] unknown at - line 19.
+Character class [:zog:] unknown at - line 20.
+########
+# regcomp.c [S_regclass]
+$_ = "";
+use warnings 'unsafe' ;
+/[a-b]/;
+/[a-\d]/;
+/[\d-b]/;
+/[\s-\d]/;
+/[\d-\s]/;
+/[a-[:digit:]]/;
+/[[:digit:]-b]/;
+/[[:alpha:]-[:digit:]]/;
+/[[:digit:]-[:alpha:]]/;
+no warnings 'unsafe' ;
+/[a-b]/;
+/[a-\d]/;
+/[\d-b]/;
+/[\s-\d]/;
+/[\d-\s]/;
+/[a-[:digit:]]/;
+/[[:digit:]-b]/;
+/[[:alpha:]-[:digit:]]/;
+/[[:digit:]-[:alpha:]]/;
+EXPECT
+/[a-\d]/: false [] range "a-\d" in regexp at - line 5.
+/[\d-b]/: false [] range "\d-" in regexp at - line 6.
+/[\s-\d]/: false [] range "\s-" in regexp at - line 7.
+/[\d-\s]/: false [] range "\d-" in regexp at - line 8.
+/[a-[:digit:]]/: false [] range "a-[:digit:]" in regexp at - line 9.
+/[[:digit:]-b]/: false [] range "[:digit:]-" in regexp at - line 10.
+/[[:alpha:]-[:digit:]]/: false [] range "[:alpha:]-" in regexp at - line 11.
+/[[:digit:]-[:alpha:]]/: false [] range "[:digit:]-" in regexp at - line 12.
+########
+# regcomp.c [S_regclassutf8]
+BEGIN {
+ if (ord("\t") == 5) {
+ print "SKIPPED\n# ebcdic regular expression ranges differ.";
+ exit 0;
+ }
+}
+use utf8;
+$_ = "";
+use warnings 'unsafe' ;
+/[a-b]/;
+/[a-\d]/;
+/[\d-b]/;
+/[\s-\d]/;
+/[\d-\s]/;
+/[a-[:digit:]]/;
+/[[:digit:]-b]/;
+/[[:alpha:]-[:digit:]]/;
+/[[:digit:]-[:alpha:]]/;
+no warnings 'unsafe' ;
+/[a-b]/;
+/[a-\d]/;
+/[\d-b]/;
+/[\s-\d]/;
+/[\d-\s]/;
+/[a-[:digit:]]/;
+/[[:digit:]-b]/;
+/[[:alpha:]-[:digit:]]/;
+/[[:digit:]-[:alpha:]]/;
+EXPECT
+/[a-\d]/: false [] range "a-\d" in regexp at - line 12.
+/[\d-b]/: false [] range "\d-" in regexp at - line 13.
+/[\s-\d]/: false [] range "\s-" in regexp at - line 14.
+/[\d-\s]/: false [] range "\d-" in regexp at - line 15.
+/[a-[:digit:]]/: false [] range "a-[:digit:]" in regexp at - line 16.
+/[[:digit:]-b]/: false [] range "[:digit:]-" in regexp at - line 17.
+/[[:alpha:]-[:digit:]]/: false [] range "[:alpha:]-" in regexp at - line 18.
+/[[:digit:]-[:alpha:]]/: false [] range "[:digit:]-" in regexp at - line 19.
+########
+# regcomp.c [S_regclass S_regclassutf8]
+use warnings 'unsafe' ;
+$a =~ /[a\zb]/ ;
+no warnings 'unsafe' ;
+$a =~ /[a\zb]/ ;
+EXPECT
+/[a\zb]/: Unrecognized escape \z in character class passed through at - line 3.
no warnings 'uninitialized' ;
$x = 1 + $b[0] ; # a
EXPECT
-Use of uninitialized value at - line 4.
+Use of uninitialized value in integer addition (+) at - line 4.
########
# sv.c (sv_2iv)
package fred ;
no warnings 'uninitialized' ;
$A *= 2 ;
EXPECT
-Use of uninitialized value at - line 10.
+Use of uninitialized value in integer multiplication (*) at - line 10.
########
# sv.c
use integer ;
no warnings 'uninitialized' ;
my $y *= 2 ; #b
EXPECT
-Use of uninitialized value at - line 4.
+Use of uninitialized value in integer multiplication (*) at - line 4.
########
# sv.c (sv_2uv)
package fred ;
$B = 0 ;
$B |= $A ;
EXPECT
-Use of uninitialized value at - line 10.
+Use of uninitialized value in bitwise or (|) at - line 10.
########
# sv.c
use warnings 'uninitialized' ;
my $Y = 1 ;
$x = 1 | $b[$Y] ;
EXPECT
-Use of uninitialized value at - line 4.
+Use of uninitialized value in bitwise or (|) at - line 4.
########
# sv.c
use warnings 'uninitialized' ;
no warnings 'uninitialized' ;
my $y *= 1 ; # d
EXPECT
-Use of uninitialized value at - line 3.
+Use of uninitialized value in multiplication (*) at - line 3.
########
# sv.c
use warnings 'uninitialized' ;
no warnings 'uninitialized' ;
$x = 1 + $b[0] ; # e
EXPECT
-Use of uninitialized value at - line 3.
+Use of uninitialized value in addition (+) at - line 3.
########
# sv.c (sv_2nv)
package fred ;
no warnings 'uninitialized' ;
$A *= 2 ;
EXPECT
-Use of uninitialized value at - line 9.
+Use of uninitialized value in multiplication (*) at - line 9.
########
# sv.c
use warnings 'uninitialized' ;
no warnings 'uninitialized' ;
$x = $z + 1 ; # f
EXPECT
-Use of uninitialized value at - line 3.
+Use of uninitialized value in addition (+) at - line 3.
########
# sv.c
use warnings 'uninitialized' ;
no warnings 'uninitialized' ;
$x = chop $z ; # h
EXPECT
-Use of uninitialized value at - line 3.
+Use of uninitialized value in scalar chop at - line 3.
########
# sv.c (sv_2pv)
package fred ;
$C = "" ;
$C .= $A ;
EXPECT
-Use of uninitialized value at - line 10.
+Use of uninitialized value in concatenation (.) at - line 10.
########
# sv.c
use warnings 'numeric' ;
Undefined value assigned to typeglob at - line 3.
########
# sv.c
+BEGIN {
+ if (ord("\t") == 5) {
+ print "SKIPPED\n# ebcdic \\x characters differ.";
+ exit 0;
+ }
+}
use utf8 ;
$^W =0 ;
{
}
my $a = rindex "a\xff bc ", "bc" ;
EXPECT
-\xff will produce malformed UTF-8 character; use \x{ff} for that at - line 6.
-Malformed UTF-8 character at - line 6.
-Malformed UTF-8 character at - line 10.
+\xff will produce malformed UTF-8 character; use \x{ff} for that at - line 12.
+Malformed UTF-8 character at - line 12.
+Malformed UTF-8 character at - line 16.
########
# sv.c
use warnings 'misc';
########
# toke.c
+BEGIN {
+ if (ord("\t") == 5) {
+ print "SKIPPED\n# Ebcdic platforms have different \\x constructs.";
+ exit 0;
+ }
+}
use warnings 'utf8' ;
use utf8 ;
$_ = " \xffe " ;
no warnings 'utf8' ;
$_ = " \xffe " ;
EXPECT
-\xff will produce malformed UTF-8 character; use \x{ff} for that at - line 4.
+\xff will produce malformed UTF-8 character; use \x{ff} for that at - line 10.
########
# toke.c
my $a = rand + 4 ;
Malformed UTF-8 character at - line 3.
########
# utf8.c [utf8_to_uv]
+BEGIN {
+ if (ord("\t") == 5) {
+ print "SKIPPED\n# Ebcdic platforms have different \\x constructs.";
+ exit 0;
+ }
+}
use utf8 ;
my $a = ord "\x80" ;
{
my $a = ord "\x80" ;
}
EXPECT
-Malformed UTF-8 character at - line 3.
-\x80 will produce malformed UTF-8 character; use \x{80} for that at - line 6.
-Malformed UTF-8 character at - line 6.
+Malformed UTF-8 character at - line 9.
+\x80 will produce malformed UTF-8 character; use \x{80} for that at - line 12.
+Malformed UTF-8 character at - line 12.
########
# utf8.c [utf8_to_uv]
use utf8 ;
Malformed UTF-8 character at - line 3.
########
# utf8.c [utf8_to_uv]
+BEGIN {
+ if (ord("\t") == 5) {
+ print "SKIPPED\n# Ebcdic platforms have different \\x constructs.";
+ exit 0;
+ }
+}
use utf8 ;
my $a = ord "\xf080" ;
{
my $a = ord "\xf080" ;
}
EXPECT
-Malformed UTF-8 character at - line 3.
-\xf0 will produce malformed UTF-8 character; use \x{f0} for that at - line 6.
-Malformed UTF-8 character at - line 6.
+Malformed UTF-8 character at - line 9.
+\xf0 will produce malformed UTF-8 character; use \x{f0} for that at - line 12.
+Malformed UTF-8 character at - line 12.
#include "perl.h"
void
-Perl_taint_proper(pTHX_ const char *f, char *s)
+Perl_taint_proper(pTHX_ const char *f, const char *s)
{
dTHR; /* just for taint */
char *ug;
-#ifdef IV_IS_QUAD
+#ifdef HAS_SETEUID
DEBUG_u(PerlIO_printf(Perl_debug_log,
- "%s %d %" PERL_PRId64 " %" PERL_PRId64 "\n", s, PL_tainted, (IV)PL_uid, (IV)PL_euid));
-#else
- DEBUG_u(PerlIO_printf(Perl_debug_log,
- "%s %d %lu %lu\n", s, PL_tainted, (unsigned long)PL_uid, (unsigned long)PL_euid));
+ "%s %d %"Uid_t_f" %"Uid_t_f"\n", s, PL_tainted, PL_uid, PL_euid));
#endif
if (PL_tainted) {
PERLVAR(threadsvp, SV **) /* AvARRAY(threadsv) */
PERLVAR(specific, AV *) /* Thread-specific user data */
PERLVAR(errsv, SV *) /* Backing SV for $@ */
-PERLVAR(errhv, HV *) /* HV for what was %@ in pp_ctl.c */
PERLVAR(mutex, perl_mutex) /* For the fields others can change */
PERLVAR(tid, U32)
PERLVAR(prev, struct perl_thread *)
-#ifdef USE_THREADS
+#if defined(USE_THREADS) || defined(USE_ITHREADS)
#ifdef WIN32
# include <win32thread.h>
} STMT_END
#define MUTEX_LOCK(m) mutex_lock(*m)
+#define MUTEX_LOCK_NOCONTEXT(m) mutex_lock(*m)
#define MUTEX_UNLOCK(m) mutex_unlock(*m)
+#define MUTEX_UNLOCK_NOCONTEXT(m) mutex_unlock(*m)
#define MUTEX_DESTROY(m) \
STMT_START { \
mutex_free(*m); \
#define JOIN(t, avp) (*(avp) = (AV *)cthread_join(t->self))
#define SET_THR(thr) cthread_set_data(cthread_self(), thr)
-#define THR cthread_data(cthread_self())
+#define THR ((struct perl_thread *)cthread_data(cthread_self()))
#define INIT_THREADS cthread_init()
#define YIELD cthread_yield()
} STMT_END
#endif /* SET_THR */
-#ifndef THR
-#define THR ((struct perl_thread *) pthread_getspecific(PL_thr_key))
+#ifndef INIT_THREADS
+# ifdef NEED_PTHREAD_INIT
+# define INIT_THREADS pthread_init()
+# endif
#endif
+#ifndef THREAD_RET_TYPE
+# define THREAD_RET_TYPE void *
+# define THREAD_RET_CAST(p) ((void *)(p))
+#endif /* THREAD_RET */
+
+#if defined(USE_THREADS)
+
/*
* dTHR is performance-critical. Here, we only do the pthread_get_specific
* if there may be more than one thread in existence, otherwise we get thr
*
* The use of PL_threadnum should be safe here.
*/
-#ifndef dTHR
-# define dTHR \
- struct perl_thread *thr = PL_threadnum? THR : (struct perl_thread*)SvPVX(PL_thrsv)
-#endif /* dTHR */
+# if !defined(dTHR)
+# define dTHR \
+ struct perl_thread *thr = PL_threadnum ? THR : (struct perl_thread*)SvPVX(PL_thrsv)
+# endif /* dTHR */
-#ifndef INIT_THREADS
-# ifdef NEED_PTHREAD_INIT
-# define INIT_THREADS pthread_init()
-# else
-# define INIT_THREADS NOOP
+# if !defined(THR)
+# define THR ((struct perl_thread *) pthread_getspecific(PL_thr_key))
# endif
-#endif
+
/* Accessor for per-thread SVs */
-#define THREADSV(i) (thr->threadsvp[i])
+# define THREADSV(i) (thr->threadsvp[i])
/*
* LOCK_SV_MUTEX and UNLOCK_SV_MUTEX are performance-critical. Here, we
* remove the "if (threadnum) ..." test.
* XXX do NOT use C<if (PL_threadnum) ...> -- it sets up race conditions!
*/
-#define LOCK_SV_MUTEX \
- STMT_START { \
- MUTEX_LOCK(&PL_sv_mutex); \
- } STMT_END
-
-#define UNLOCK_SV_MUTEX \
- STMT_START { \
- MUTEX_UNLOCK(&PL_sv_mutex); \
- } STMT_END
-
-/* Likewise for strtab_mutex */
-#define LOCK_STRTAB_MUTEX \
- STMT_START { \
- MUTEX_LOCK(&PL_strtab_mutex); \
- } STMT_END
-
-#define UNLOCK_STRTAB_MUTEX \
- STMT_START { \
- MUTEX_UNLOCK(&PL_strtab_mutex); \
- } STMT_END
-
-#ifndef THREAD_RET_TYPE
-# define THREAD_RET_TYPE void *
-# define THREAD_RET_CAST(p) ((void *)(p))
-#endif /* THREAD_RET */
+# define LOCK_SV_MUTEX MUTEX_LOCK(&PL_sv_mutex)
+# define UNLOCK_SV_MUTEX MUTEX_UNLOCK(&PL_sv_mutex)
+# define LOCK_STRTAB_MUTEX MUTEX_LOCK(&PL_strtab_mutex)
+# define UNLOCK_STRTAB_MUTEX MUTEX_UNLOCK(&PL_strtab_mutex)
+# define LOCK_CRED_MUTEX MUTEX_LOCK(&PL_cred_mutex)
+# define UNLOCK_CRED_MUTEX MUTEX_UNLOCK(&PL_cred_mutex)
/* Values and macros for thr->flags */
#define ThrSETSTATE(t, s) STMT_START { \
(t)->flags &= ~THRf_STATE_MASK; \
(t)->flags |= (s); \
- DEBUG_S(PerlIO_printf(PerlIO_stderr(), \
+ DEBUG_S(PerlIO_printf(Perl_debug_log, \
"thread %p set to state %d\n", (t), (s))); \
} STMT_END
#define MgCONDP(mg) (&((condpair_t *)(mg->mg_ptr))->cond)
#define MgOWNER(mg) ((condpair_t *)(mg->mg_ptr))->owner
-#else
-/* USE_THREADS is not defined */
-#define MUTEX_LOCK(m)
-#define MUTEX_LOCK_NOCONTEXT(m)
-#define MUTEX_UNLOCK(m)
-#define MUTEX_UNLOCK_NOCONTEXT(m)
-#define MUTEX_INIT(m)
-#define MUTEX_DESTROY(m)
-#define COND_INIT(c)
-#define COND_SIGNAL(c)
-#define COND_BROADCAST(c)
-#define COND_WAIT(c, m)
-#define COND_DESTROY(c)
-#define LOCK_SV_MUTEX
-#define UNLOCK_SV_MUTEX
-#define LOCK_STRTAB_MUTEX
-#define UNLOCK_STRTAB_MUTEX
-
-#define THR
-#define dTHR dNOOP
#endif /* USE_THREADS */
+#endif /* USE_THREADS || USE_ITHREADS */
+
+#ifndef MUTEX_LOCK
+# define MUTEX_LOCK(m)
+#endif
+
+#ifndef MUTEX_LOCK_NOCONTEXT
+# define MUTEX_LOCK_NOCONTEXT(m)
+#endif
+
+#ifndef MUTEX_UNLOCK
+# define MUTEX_UNLOCK(m)
+#endif
+
+#ifndef MUTEX_UNLOCK_NOCONTEXT
+# define MUTEX_UNLOCK_NOCONTEXT(m)
+#endif
+
+#ifndef MUTEX_INIT
+# define MUTEX_INIT(m)
+#endif
+
+#ifndef MUTEX_DESTROY
+# define MUTEX_DESTROY(m)
+#endif
+
+#ifndef COND_INIT
+# define COND_INIT(c)
+#endif
+
+#ifndef COND_SIGNAL
+# define COND_SIGNAL(c)
+#endif
+
+#ifndef COND_BROADCAST
+# define COND_BROADCAST(c)
+#endif
+
+#ifndef COND_WAIT
+# define COND_WAIT(c, m)
+#endif
+
+#ifndef COND_DESTROY
+# define COND_DESTROY(c)
+#endif
+
+#ifndef LOCK_SV_MUTEX
+# define LOCK_SV_MUTEX
+#endif
+
+#ifndef UNLOCK_SV_MUTEX
+# define UNLOCK_SV_MUTEX
+#endif
+
+#ifndef LOCK_STRTAB_MUTEX
+# define LOCK_STRTAB_MUTEX
+#endif
+
+#ifndef UNLOCK_STRTAB_MUTEX
+# define UNLOCK_STRTAB_MUTEX
+#endif
+
+#ifndef LOCK_CRED_MUTEX
+# define LOCK_CRED_MUTEX
+#endif
+
+#ifndef UNLOCK_CRED_MUTEX
+# define UNLOCK_CRED_MUTEX
+#endif
+
+#ifndef THR
+# define THR
+#endif
+
+#ifndef dTHR
+# define dTHR dNOOP
+#endif
+
+#ifndef INIT_THREADS
+# define INIT_THREADS NOOP
+#endif
static char ident_too_long[] = "Identifier too long";
static void restore_rsfp(pTHXo_ void *f);
-static void restore_expect(pTHXo_ void *e);
-static void restore_lex_expect(pTHXo_ void *e);
+
+#define XFAKEBRACK 128
+#define XENUMMASK 127
#define UTF (PL_hints & HINT_UTF8)
/*
#ifdef CLINE
#undef CLINE
#endif
-#define CLINE (PL_copline = (PL_curcop->cop_line < PL_copline ? PL_curcop->cop_line : PL_copline))
+#define CLINE (PL_copline = (CopLINE(PL_curcop) < PL_copline ? CopLINE(PL_curcop) : PL_copline))
/*
* Convenience functions to return different tokens and prime the
* LOOPX : loop exiting command (goto, last, dump, etc)
* FTST : file test operator
* FUN0 : zero-argument function
- * FUN1 : not used
+ * FUN1 : not used, except for not, which isn't a UNIOP
* BOop : bitwise or or xor
* BAop : bitwise and
* SHop : shift operator
* utf16-to-utf8-reversed.
*/
-#ifdef WIN32
+#ifdef PERL_CR_FILTER
+static void
+strip_return(SV *sv)
+{
+ register char *s = SvPVX(sv);
+ register char *e = s + SvCUR(sv);
+ /* outer loop optimized to do nothing if there are no CR-LFs */
+ while (s < e) {
+ if (*s++ == '\r' && *s == '\n') {
+ /* hit a CR-LF, need to copy the rest */
+ register char *d = s - 1;
+ *d++ = *s++;
+ while (s < e) {
+ if (*s == '\r' && s[1] == '\n')
+ s++;
+ *d++ = *s++;
+ }
+ SvCUR(sv) -= s - d;
+ return;
+ }
+ }
+}
STATIC I32
-S_win32_textfilter(pTHX_ int idx, SV *sv, int maxlen)
+S_cr_textfilter(pTHX_ int idx, SV *sv, int maxlen)
{
- I32 count = FILTER_READ(idx+1, sv, maxlen);
- if (count > 0 && !maxlen)
- win32_strip_return(sv);
- return count;
+ I32 count = FILTER_READ(idx+1, sv, maxlen);
+ if (count > 0 && !maxlen)
+ strip_return(sv);
+ return count;
}
#endif
SAVEI32(PL_lex_dojoin);
SAVEI32(PL_lex_brackets);
- SAVEI32(PL_lex_fakebrack);
SAVEI32(PL_lex_casemods);
SAVEI32(PL_lex_starts);
SAVEI32(PL_lex_state);
- SAVESPTR(PL_lex_inpat);
+ SAVEVPTR(PL_lex_inpat);
SAVEI32(PL_lex_inwhat);
- SAVEI16(PL_curcop->cop_line);
+ SAVECOPLINE(PL_curcop);
SAVEPPTR(PL_bufptr);
SAVEPPTR(PL_bufend);
SAVEPPTR(PL_oldbufptr);
SAVESPTR(PL_linestr);
SAVEPPTR(PL_lex_brackstack);
SAVEPPTR(PL_lex_casestack);
- SAVEDESTRUCTOR(restore_rsfp, PL_rsfp);
+ SAVEDESTRUCTOR_X(restore_rsfp, PL_rsfp);
SAVESPTR(PL_lex_stuff);
SAVEI32(PL_lex_defer);
SAVEI32(PL_sublex_info.sub_inwhat);
SAVESPTR(PL_lex_repl);
- SAVEDESTRUCTOR(restore_expect, PL_tokenbuf + PL_expect); /* encode as pointer */
- SAVEDESTRUCTOR(restore_lex_expect, PL_tokenbuf + PL_expect);
+ SAVEINT(PL_expect);
+ SAVEINT(PL_lex_expect);
PL_lex_state = LEX_NORMAL;
PL_lex_defer = 0;
PL_expect = XSTATE;
PL_lex_brackets = 0;
- PL_lex_fakebrack = 0;
New(899, PL_lex_brackstack, 120, char);
New(899, PL_lex_casestack, 12, char);
SAVEFREEPV(PL_lex_brackstack);
* S_incline
* This subroutine has nothing to do with tilting, whether at windmills
* or pinball tables. Its name is short for "increment line". It
- * increments the current line number in PL_curcop->cop_line and checks
+ * increments the current line number in CopLINE(PL_curcop) and checks
* to see whether the line starts with a comment of the form
* # line 500 "foo.pm"
* If so, it sets the current line number and file to the values in the comment.
char ch;
int sawline = 0;
- PL_curcop->cop_line++;
+ CopLINE_inc(PL_curcop);
if (*s++ != '#')
return;
while (*s == ' ' || *s == '\t') s++;
ch = *t;
*t = '\0';
if (t - s > 0)
- PL_curcop->cop_filegv = gv_fetchfile(s);
+ CopFILE_set(PL_curcop, s);
else
- PL_curcop->cop_filegv = gv_fetchfile(PL_origfilename);
+ CopFILE_set(PL_curcop, PL_origfilename);
*t = ch;
- PL_curcop->cop_line = atoi(n)-1;
+ CopLINE_set(PL_curcop, atoi(n)-1);
}
/*
sv_upgrade(sv, SVt_PVMG);
sv_setpvn(sv,PL_bufptr,PL_bufend-PL_bufptr);
- av_store(GvAV(PL_curcop->cop_filegv),(I32)PL_curcop->cop_line,sv);
+ av_store(CopFILEAV(PL_curcop),(I32)CopLINE(PL_curcop),sv);
}
}
}
*/
STATIC I32
-S_lop(pTHX_ I32 f, expectation x, char *s)
+S_lop(pTHX_ I32 f, int x, char *s)
{
dTHR;
yylval.ival = f;
s = skipspace(s);
- /* default VERSION number -- GBARR */
-
- if(isDIGIT(*s)) {
- char *d;
- int c;
- for( d=s, c = 1; isDIGIT(*d) || *d == '_' || (*d == '.' && c--); d++);
- if((*d == ';' || isSPACE(*d)) && *(skipspace(d)) != ',') {
+ if (isDIGIT(*s) || (*s == 'v' && isDIGIT(s[1]))) {
+ char *d = s;
+ if (*d == 'v')
+ d++;
+ for (; isDIGIT(*d) || *d == '_' || *d == '.'; d++);
+ if ((*d == ';' || isSPACE(*d)) && *(skipspace(d)) != ',') {
s = scan_num(s);
/* real VERSION number -- GBARR */
version = yylval.opval;
PL_lex_state = PL_sublex_info.super_state;
SAVEI32(PL_lex_dojoin);
SAVEI32(PL_lex_brackets);
- SAVEI32(PL_lex_fakebrack);
SAVEI32(PL_lex_casemods);
SAVEI32(PL_lex_starts);
SAVEI32(PL_lex_state);
- SAVESPTR(PL_lex_inpat);
+ SAVEVPTR(PL_lex_inpat);
SAVEI32(PL_lex_inwhat);
- SAVEI16(PL_curcop->cop_line);
+ SAVECOPLINE(PL_curcop);
SAVEPPTR(PL_bufptr);
SAVEPPTR(PL_oldbufptr);
SAVEPPTR(PL_oldoldbufptr);
PL_lex_dojoin = FALSE;
PL_lex_brackets = 0;
- PL_lex_fakebrack = 0;
New(899, PL_lex_brackstack, 120, char);
New(899, PL_lex_casestack, 12, char);
SAVEFREEPV(PL_lex_brackstack);
*PL_lex_casestack = '\0';
PL_lex_starts = 0;
PL_lex_state = LEX_INTERPCONCAT;
- PL_curcop->cop_line = PL_multi_start;
+ CopLINE_set(PL_curcop, PL_multi_start);
PL_lex_inwhat = PL_sublex_info.sub_inwhat;
if (PL_lex_inwhat == OP_MATCH || PL_lex_inwhat == OP_QR || PL_lex_inwhat == OP_SUBST)
SAVEFREESV(PL_linestr);
PL_lex_dojoin = FALSE;
PL_lex_brackets = 0;
- PL_lex_fakebrack = 0;
PL_lex_casemods = 0;
*PL_lex_casestack = '\0';
PL_lex_starts = 0;
? (PL_sublex_info.sub_op->op_private & (PL_lex_repl ?
OPpTRANS_FROM_UTF : OPpTRANS_TO_UTF))
: UTF;
- char *leaveit = /* set of acceptably-backslashed characters */
+ const char *leaveit = /* set of acceptably-backslashed characters */
PL_lex_inpat
? "\\.^$@AGZdDwWsSbBpPXC+*?|()-nrtfeaxcz0123456789[{]} \t\n\r\f\v#"
: "";
/* \132 indicates an octal constant */
case '0': case '1': case '2': case '3':
case '4': case '5': case '6': case '7':
- *d++ = scan_oct(s, 3, &len);
+ *d++ = (char)scan_oct(s, 3, &len);
s += len;
continue;
}
/* note: utf always shorter than hex */
d = (char*)uv_to_utf8((U8*)d,
- scan_hex(s + 1, e - s - 1, &len));
+ (UV)scan_hex(s + 1, e - s - 1, &len));
s = e + 1;
}
else {
* store private buffers and state information.
*
* The supplied datasv parameter is upgraded to a PVIO type
- * and the IoDIRP field is used to store the function pointer.
+ * and the IoDIRP field is used to store the function pointer,
+ * and IOf_FAKE_DIRP is enabled on datasv to mark this as such.
* Note that IoTOP_NAME, IoFMT_NAME, IoBOTTOM_NAME, if set for
* private use must be set using malloc'd pointers.
*/
SV *
Perl_filter_add(pTHX_ filter_t funcp, SV *datasv)
{
- if (!funcp){ /* temporary handy debugging hack to be deleted */
- PL_filter_debug = atoi((char*)datasv);
- return NULL;
- }
+ if (!funcp)
+ return Nullsv;
+
if (!PL_rsfp_filters)
PL_rsfp_filters = newAV();
if (!datasv)
if (!SvUPGRADE(datasv, SVt_PVIO))
Perl_die(aTHX_ "Can't upgrade filter_add data to SVt_PVIO");
IoDIRP(datasv) = (DIR*)funcp; /* stash funcp into spare field */
-#ifdef DEBUGGING
- if (PL_filter_debug) {
- STRLEN n_a;
- Perl_warn(aTHX_ "filter_add func %p (%s)", funcp, SvPV(datasv, n_a));
- }
-#endif /* DEBUGGING */
+ IoFLAGS(datasv) |= IOf_FAKE_DIRP;
+ DEBUG_P(PerlIO_printf(Perl_debug_log, "filter_add func %p (%s)\n",
+ funcp, SvPV_nolen(datasv)));
av_unshift(PL_rsfp_filters, 1);
av_store(PL_rsfp_filters, 0, datasv) ;
return(datasv);
void
Perl_filter_del(pTHX_ filter_t funcp)
{
-#ifdef DEBUGGING
- if (PL_filter_debug)
- Perl_warn(aTHX_ "filter_del func %p", funcp);
-#endif /* DEBUGGING */
+ SV *datasv;
+ DEBUG_P(PerlIO_printf(Perl_debug_log, "filter_del func %p", funcp));
if (!PL_rsfp_filters || AvFILLp(PL_rsfp_filters)<0)
return;
/* if filter is on top of stack (usual case) just pop it off */
- if (IoDIRP(FILTER_DATA(AvFILLp(PL_rsfp_filters))) == (DIR*)funcp){
- IoDIRP(FILTER_DATA(AvFILLp(PL_rsfp_filters))) = NULL;
+ datasv = FILTER_DATA(AvFILLp(PL_rsfp_filters));
+ if (IoDIRP(datasv) == (DIR*)funcp) {
+ IoFLAGS(datasv) &= ~IOf_FAKE_DIRP;
+ IoDIRP(datasv) = (DIR*)NULL;
sv_free(av_pop(PL_rsfp_filters));
return;
if (idx > AvFILLp(PL_rsfp_filters)){ /* Any more filters? */
/* Provide a default input filter to make life easy. */
/* Note that we append to the line. This is handy. */
-#ifdef DEBUGGING
- if (PL_filter_debug)
- Perl_warn(aTHX_ "filter_read %d: from rsfp\n", idx);
-#endif /* DEBUGGING */
+ DEBUG_P(PerlIO_printf(Perl_debug_log,
+ "filter_read %d: from rsfp\n", idx));
if (maxlen) {
/* Want a block */
int len ;
}
/* Skip this filter slot if filter has been deleted */
if ( (datasv = FILTER_DATA(idx)) == &PL_sv_undef){
-#ifdef DEBUGGING
- if (PL_filter_debug)
- Perl_warn(aTHX_ "filter_read %d: skipped (filter deleted)\n", idx);
-#endif /* DEBUGGING */
+ DEBUG_P(PerlIO_printf(Perl_debug_log,
+ "filter_read %d: skipped (filter deleted)\n",
+ idx));
return FILTER_READ(idx+1, buf_sv, maxlen); /* recurse */
}
/* Get function pointer hidden within datasv */
funcp = (filter_t)IoDIRP(datasv);
-#ifdef DEBUGGING
- if (PL_filter_debug) {
- STRLEN n_a;
- Perl_warn(aTHX_ "filter_read %d: via function %p (%s)\n",
- idx, funcp, SvPV(datasv,n_a));
- }
-#endif /* DEBUGGING */
+ DEBUG_P(PerlIO_printf(Perl_debug_log,
+ "filter_read %d: via function %p (%s)\n",
+ idx, funcp, SvPV_nolen(datasv)));
/* Call function. The function is expected to */
/* call "FILTER_READ(idx+1, buf_sv)" first. */
/* Return: <0:error, =0:eof, >0:not eof */
STATIC char *
S_filter_gets(pTHX_ register SV *sv, register PerlIO *fp, STRLEN append)
{
-#ifdef WIN32FILTER
+#ifdef PERL_CR_FILTER
if (!PL_rsfp_filters) {
- filter_add(win32_textfilter,NULL);
+ filter_add(S_cr_textfilter,NULL);
}
#endif
if (PL_rsfp_filters) {
}
#endif /* USE_THREADS */
if ((tmp = pad_findmy(PL_tokenbuf)) != NOT_IN_PAD) {
+ SV *namesv = AvARRAY(PL_comppad_name)[tmp];
/* might be an "our" variable" */
- if (SvFLAGS(AvARRAY(PL_comppad_name)[tmp]) & SVpad_OUR) {
+ if (SvFLAGS(namesv) & SVpad_OUR) {
/* build ops for a bareword */
- yylval.opval = (OP*)newSVOP(OP_CONST, 0, newSVpv(PL_tokenbuf+1, 0));
+ SV *sym = newSVpv(HvNAME(GvSTASH(namesv)),0);
+ sv_catpvn(sym, "::", 2);
+ sv_catpv(sym, PL_tokenbuf+1);
+ yylval.opval = (OP*)newSVOP(OP_CONST, 0, sym);
yylval.opval->op_private = OPpCONST_ENTERED;
- gv_fetchpv(PL_tokenbuf+1,
+ gv_fetchpv(SvPVX(sym),
(PL_in_eval
- ? (GV_ADDMULTI | GV_ADDINEVAL | GV_ADDOUR)
- : GV_ADDOUR
+ ? (GV_ADDMULTI | GV_ADDINEVAL)
+ : TRUE
),
((PL_tokenbuf[0] == '$') ? SVt_PV
: (PL_tokenbuf[0] == '@') ? SVt_PVAV
PL_oldoldbufptr = PL_oldbufptr;
PL_oldbufptr = s;
DEBUG_p( {
- PerlIO_printf(PerlIO_stderr(), "### Tokener expecting %s at %s\n", exp_name[PL_expect], s);
+ PerlIO_printf(Perl_debug_log, "### Tokener expecting %s at %s\n",
+ exp_name[PL_expect], s);
} )
retry:
sv_upgrade(sv, SVt_PVMG);
sv_setsv(sv,PL_linestr);
- av_store(GvAV(PL_curcop->cop_filegv),(I32)PL_curcop->cop_line,sv);
+ av_store(CopFILEAV(PL_curcop),(I32)CopLINE(PL_curcop),sv);
}
goto retry;
}
sv_upgrade(sv, SVt_PVMG);
sv_setsv(sv,PL_linestr);
- av_store(GvAV(PL_curcop->cop_filegv),(I32)PL_curcop->cop_line,sv);
+ av_store(CopFILEAV(PL_curcop),(I32)CopLINE(PL_curcop),sv);
}
PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr);
- if (PL_curcop->cop_line == 1) {
+ if (CopLINE(PL_curcop) == 1) {
while (s < PL_bufend && isSPACE(*s))
s++;
if (*s == ':' && s[1] != ':') /* for csh execing sh scripts */
*/
SV *x = GvSV(gv_fetchpv("\030", TRUE, SVt_PV));
assert(SvPOK(x) || SvGMAGICAL(x));
- if (sv_eq(x, GvSV(PL_curcop->cop_filegv))) {
+ if (sv_eq(x, CopFILESV(PL_curcop))) {
sv_setpvn(x, ipath, ipathend - ipath);
SvSETMAGIC(x);
}
PL_expect = XTERM;
TOKEN('(');
case ';':
- if (PL_curcop->cop_line < PL_copline)
- PL_copline = PL_curcop->cop_line;
+ if (CopLINE(PL_curcop) < PL_copline)
+ PL_copline = CopLINE(PL_curcop);
tmp = *s++;
OPERATOR(tmp);
case ')':
if (++t < PL_bufend
&& (!isALNUM(*t)
|| ((*t == 'q' || *t == 'x') && ++t < PL_bufend
- && !isALNUM(*t)))) {
+ && !isALNUM(*t))))
+ {
char *tmps;
char open, close, term;
I32 brackets = 1;
}
t++;
}
- else if (isIDFIRST_lazy(s)) {
- for (t++; t < PL_bufend && isALNUM_lazy(t); t++) ;
+ else if (isALNUM_lazy(t)) {
+ t += UTF8SKIP(t);
+ while (t < PL_bufend && isALNUM_lazy(t))
+ t += UTF8SKIP(t);
}
while (t < PL_bufend && isSPACE(*t))
t++;
}
break;
}
- yylval.ival = PL_curcop->cop_line;
+ yylval.ival = CopLINE(PL_curcop);
if (isSPACE(*s) || *s == '#')
PL_copline = NOLINE; /* invalidate current command line number */
TOKEN('{');
PL_lex_formbrack = 0;
if (PL_lex_state == LEX_INTERPNORMAL) {
if (PL_lex_brackets == 0) {
- if (PL_lex_fakebrack) {
+ if (PL_expect & XFAKEBRACK) {
+ PL_expect &= XENUMMASK;
PL_lex_state = LEX_INTERPEND;
PL_bufptr = s;
return yylex(); /* ignore fake brackets */
PL_lex_state = LEX_INTERPEND;
}
}
- if (PL_lex_brackets < PL_lex_fakebrack) {
+ if (PL_expect & XFAKEBRACK) {
+ PL_expect &= XENUMMASK;
PL_bufptr = s;
- PL_lex_fakebrack = 0;
return yylex(); /* ignore fake brackets */
}
force_next('}');
s--;
if (PL_expect == XOPERATOR) {
if (ckWARN(WARN_SEMICOLON) && isIDFIRST_lazy(s) && PL_bufptr == PL_linestart) {
- PL_curcop->cop_line--;
+ CopLINE_dec(PL_curcop);
Perl_warner(aTHX_ WARN_SEMICOLON, PL_warn_nosemi);
- PL_curcop->cop_line++;
+ CopLINE_inc(PL_curcop);
}
BAop(OP_BIT_AND);
}
no_op("Backslash",s);
OPERATOR(REFGEN);
+ case 'v':
+ if (isDIGIT(s[1]) && PL_expect == XTERM) {
+ char *start = s;
+ start++;
+ start++;
+ while (isDIGIT(*start))
+ start++;
+ if (*start == '.' && isDIGIT(start[1])) {
+ s = scan_num(s);
+ TERM(THING);
+ }
+ }
+ goto keylookup;
case 'x':
if (isDIGIT(s[1]) && PL_expect == XOPERATOR) {
s++;
case 's': case 'S':
case 't': case 'T':
case 'u': case 'U':
- case 'v': case 'V':
+ case 'V':
case 'w': case 'W':
case 'X':
case 'y': case 'Y':
}
else if (gv && !gvp
&& -tmp==KEY_lock /* XXX generalizable kludge */
+ && GvCVu(gv)
&& !hv_fetch(GvHVn(PL_incgv), "Thread.pm", 9, FALSE))
{
tmp = 0; /* any sub overrides "weak" keyword */
if (PL_expect == XOPERATOR) {
if (PL_bufptr == PL_linestart) {
- PL_curcop->cop_line--;
+ CopLINE_dec(PL_curcop);
Perl_warner(aTHX_ WARN_SEMICOLON, PL_warn_nosemi);
- PL_curcop->cop_line++;
+ CopLINE_inc(PL_curcop);
}
else
no_op("Bareword",s);
if (PL_oldoldbufptr &&
PL_oldoldbufptr < PL_bufptr &&
- (PL_oldoldbufptr == PL_last_lop || PL_oldoldbufptr == PL_last_uni) &&
+ (PL_oldoldbufptr == PL_last_lop
+ || PL_oldoldbufptr == PL_last_uni) &&
/* NO SKIPSPACE BEFORE HERE! */
(PL_expect == XREF ||
((PL_opargs[PL_last_lop_op] >> OASHIFT)& 7) == OA_FILEREF))
case KEY___FILE__:
yylval.opval = (OP*)newSVOP(OP_CONST, 0,
- newSVsv(GvSV(PL_curcop->cop_filegv)));
+ newSVpv(CopFILE(PL_curcop),0));
TERM(THING);
case KEY___LINE__:
-#ifdef IV_IS_QUAD
- yylval.opval = (OP*)newSVOP(OP_CONST, 0,
- Perl_newSVpvf(aTHX_ "%" PERL_PRId64, (IV)PL_curcop->cop_line));
-#else
yylval.opval = (OP*)newSVOP(OP_CONST, 0,
- Perl_newSVpvf(aTHX_ "%ld", (long)PL_curcop->cop_line));
-#endif
+ Perl_newSVpvf(aTHX_ "%"IVdf, (IV)CopLINE(PL_curcop)));
TERM(THING);
case KEY___PACKAGE__:
IoTYPE(GvIOp(gv)) = '-';
else
IoTYPE(GvIOp(gv)) = '<';
+#if defined(WIN32) && !defined(PERL_TEXTMODE_SCRIPTS)
+ /* if the script was opened in binmode, we need to revert
+ * it to text mode for compatibility; but only iff it has CRs
+ * XXX this is a questionable hack at best. */
+ if (PL_bufend-PL_bufptr > 2
+ && PL_bufend[-1] == '\n' && PL_bufend[-2] == '\r')
+ {
+ Off_t loc = 0;
+ if (IoTYPE(GvIOp(gv)) == '<') {
+ loc = PerlIO_tell(PL_rsfp);
+ (void)PerlIO_seek(PL_rsfp, 0L, 0);
+ }
+ if (PerlLIO_setmode(PerlIO_fileno(PL_rsfp), O_TEXT) != -1) {
+#if defined(__BORLANDC__)
+ /* XXX see note in do_binmode() */
+ ((FILE*)PL_rsfp)->flags |= _F_BIN;
+#endif
+ if (loc > 0)
+ PerlIO_seek(PL_rsfp, loc, 0);
+ }
+ }
+#endif
PL_rsfp = Nullfp;
}
goto fake_eof;
case KEY_DESTROY:
case KEY_BEGIN:
case KEY_END:
+ case KEY_STOP:
case KEY_INIT:
if (PL_expect == XSTATE) {
s = PL_bufptr;
case KEY_crypt:
#ifdef FCRYPT
- if (!PL_cryptseen++)
+ if (!PL_cryptseen) {
+ PL_cryptseen = TRUE;
init_des();
+ }
#endif
LOP(OP_CRYPT,XTERM);
PREBLOCK(ELSE);
case KEY_elsif:
- yylval.ival = PL_curcop->cop_line;
+ yylval.ival = CopLINE(PL_curcop);
OPERATOR(ELSIF);
case KEY_eq:
case KEY_for:
case KEY_foreach:
- yylval.ival = PL_curcop->cop_line;
+ yylval.ival = CopLINE(PL_curcop);
s = skipspace(s);
if (PL_expect == XSTATE && isIDFIRST_lazy(s)) {
char *p = s;
UNI(OP_HEX);
case KEY_if:
- yylval.ival = PL_curcop->cop_line;
+ yylval.ival = CopLINE(PL_curcop);
OPERATOR(IF);
case KEY_index:
OPERATOR(USE);
case KEY_not:
- OPERATOR(NOTOP);
+ if (*s == '(' || (s = skipspace(s), *s == '('))
+ FUN1(OP_NOT);
+ else
+ OPERATOR(NOTOP);
case KEY_open:
s = skipspace(s);
OLDLOP(OP_RETURN);
case KEY_require:
- *PL_tokenbuf = '\0';
- s = force_word(s,WORD,TRUE,TRUE,FALSE);
- if (isIDFIRST_lazy(PL_tokenbuf))
- gv_stashpvn(PL_tokenbuf, strlen(PL_tokenbuf), TRUE);
- else if (*s == '<')
- yyerror("<> should be quotes");
+ s = skipspace(s);
+ if (isDIGIT(*s) || (*s == 'v' && isDIGIT(s[1]))) {
+ s = force_version(s);
+ }
+ else {
+ *PL_tokenbuf = '\0';
+ s = force_word(s,WORD,TRUE,TRUE,FALSE);
+ if (isIDFIRST_lazy(PL_tokenbuf))
+ gv_stashpvn(PL_tokenbuf, strlen(PL_tokenbuf), TRUE);
+ else if (*s == '<')
+ yyerror("<> should be quotes");
+ }
UNI(OP_REQUIRE);
case KEY_reset:
UNI(OP_STAT);
case KEY_study:
- PL_sawstudy++;
UNI(OP_STUDY);
case KEY_substr:
UNI(OP_UNTIE);
case KEY_until:
- yylval.ival = PL_curcop->cop_line;
+ yylval.ival = CopLINE(PL_curcop);
OPERATOR(UNTIL);
case KEY_unless:
- yylval.ival = PL_curcop->cop_line;
+ yylval.ival = CopLINE(PL_curcop);
OPERATOR(UNLESS);
case KEY_unlink:
if (PL_expect != XSTATE)
yyerror("\"use\" not allowed in expression");
s = skipspace(s);
- if(isDIGIT(*s)) {
+ if (isDIGIT(*s) || (*s == 'v' && isDIGIT(s[1]))) {
s = force_version(s);
- if(*s == ';' || (s = skipspace(s), *s == ';')) {
+ if (*s == ';' || (s = skipspace(s), *s == ';')) {
PL_nextval[PL_nexttoke].opval = Nullop;
force_next(WORD);
}
UNI(OP_VALUES);
case KEY_vec:
- PL_sawvec = TRUE;
LOP(OP_VEC,XTERM);
case KEY_while:
- yylval.ival = PL_curcop->cop_line;
+ yylval.ival = CopLINE(PL_curcop);
OPERATOR(WHILE);
case KEY_warn:
break;
}
break;
+ case 'S':
+ if (strEQ(d,"STOP")) return KEY_STOP;
+ break;
case 's':
switch (d[1]) {
case 0: return KEY_s;
if (*w)
for (; *w && isSPACE(*w); w++) ;
if (!*w || !strchr(";|})]oaiuw!=", *w)) /* an advisory hack only... */
- Perl_warner(aTHX_ WARN_SYNTAX, "%s (...) interpreted as function",name);
+ Perl_warner(aTHX_ WARN_SYNTAX,
+ "%s (...) interpreted as function",name);
}
}
while (s < PL_bufend && isSPACE(*s))
and type is used with error messages only. */
STATIC SV *
-S_new_constant(pTHX_ char *s, STRLEN len, char *key, SV *sv, SV *pv, char *type)
+S_new_constant(pTHX_ char *s, STRLEN len, const char *key, SV *sv, SV *pv,
+ const char *type)
{
dSP;
HV *table = GvHV(PL_hintgv); /* ^H */
SV *res;
SV **cvp;
SV *cv, *typesv;
- char *why, *why1, *why2;
+ const char *why, *why1, *why2;
if (!(PL_hints & HINT_LOCALIZE_HH)) {
SV *msg;
STRLEN n_a;
sv_catpv(ERRSV, "Propagated");
yyerror(SvPV(ERRSV, n_a)); /* Duplicates the message inside eval */
- POPs ;
+ (void)POPs;
res = SvREFCNT_inc(sv);
}
else {
res = POPs;
- SvREFCNT_inc(res);
+ (void)SvREFCNT_inc(res);
}
PUTBACK ;
char *bracket = 0;
char funny = *s++;
- if (PL_lex_brackets == 0)
- PL_lex_fakebrack = 0;
if (isSPACE(*s))
s = skipspace(s);
d = dest;
if ((*s == '[' || (*s == '{' && strNE(dest, "sub")))) {
dTHR; /* only for ckWARN */
if (ckWARN(WARN_AMBIGUOUS) && keyword(dest, d - dest)) {
- char *brack = *s == '[' ? "[...]" : "{...}";
+ const char *brack = *s == '[' ? "[...]" : "{...}";
Perl_warner(aTHX_ WARN_AMBIGUOUS,
"Ambiguous use of %c{%s%s} resolved to %c%s%s",
funny, dest, brack, funny, dest, brack);
}
- PL_lex_fakebrack = PL_lex_brackets+1;
bracket++;
- PL_lex_brackstack[PL_lex_brackets++] = XOPERATOR;
+ PL_lex_brackstack[PL_lex_brackets++] = (char)(XOPERATOR | XFAKEBRACK);
return s;
}
}
}
CLINE;
- PL_multi_start = PL_curcop->cop_line;
+ PL_multi_start = CopLINE(PL_curcop);
PL_multi_open = PL_multi_close = '<';
term = *PL_tokenbuf;
if (PL_lex_inwhat == OP_SUBST && PL_in_eval && !PL_rsfp) {
while (s < bufend &&
(*s != term || memNE(s,PL_tokenbuf,len)) ) {
if (*s++ == '\n')
- PL_curcop->cop_line++;
+ CopLINE_inc(PL_curcop);
}
if (s >= bufend) {
- PL_curcop->cop_line = PL_multi_start;
+ CopLINE_set(PL_curcop, PL_multi_start);
missingterm(PL_tokenbuf);
}
sv_setpvn(herewas,bufptr,d-bufptr+1);
while (s < PL_bufend &&
(*s != term || memNE(s,PL_tokenbuf,len)) ) {
if (*s++ == '\n')
- PL_curcop->cop_line++;
+ CopLINE_inc(PL_curcop);
}
if (s >= PL_bufend) {
- PL_curcop->cop_line = PL_multi_start;
+ CopLINE_set(PL_curcop, PL_multi_start);
missingterm(PL_tokenbuf);
}
sv_setpvn(tmpstr,d+1,s-d);
s += len - 1;
- PL_curcop->cop_line++; /* the preceding stmt passes a newline */
+ CopLINE_inc(PL_curcop); /* the preceding stmt passes a newline */
sv_catpvn(herewas,s,PL_bufend-s);
sv_setsv(PL_linestr,herewas);
while (s >= PL_bufend) { /* multiple line string? */
if (!outer ||
!(PL_oldoldbufptr = PL_oldbufptr = s = PL_linestart = filter_gets(PL_linestr, PL_rsfp, 0))) {
- PL_curcop->cop_line = PL_multi_start;
+ CopLINE_set(PL_curcop, PL_multi_start);
missingterm(PL_tokenbuf);
}
- PL_curcop->cop_line++;
+ CopLINE_inc(PL_curcop);
PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr);
#ifndef PERL_STRICT_CR
if (PL_bufend - PL_linestart >= 2) {
sv_upgrade(sv, SVt_PVMG);
sv_setsv(sv,PL_linestr);
- av_store(GvAV(PL_curcop->cop_filegv),
- (I32)PL_curcop->cop_line,sv);
+ av_store(CopFILEAV(PL_curcop), (I32)CopLINE(PL_curcop),sv);
}
if (*s == term && memEQ(s,PL_tokenbuf,len)) {
s = PL_bufend - 1;
}
s++;
retval:
- PL_multi_end = PL_curcop->cop_line;
+ PL_multi_end = CopLINE(PL_curcop);
if (SvCUR(tmpstr) + 5 < SvLEN(tmpstr)) {
SvLEN_set(tmpstr, SvCUR(tmpstr) + 1);
Renew(SvPVX(tmpstr), SvLEN(tmpstr), char);
/* after skipping whitespace, the next character is the terminator */
term = *s;
/* mark where we are */
- PL_multi_start = PL_curcop->cop_line;
+ PL_multi_start = CopLINE(PL_curcop);
PL_multi_open = term;
/* find corresponding closing delimiter */
for (; s < PL_bufend; s++,to++) {
/* embedded newlines increment the current line number */
if (*s == '\n' && !PL_rsfp)
- PL_curcop->cop_line++;
+ CopLINE_inc(PL_curcop);
/* handle quoted delimiters */
if (*s == '\\' && s+1 < PL_bufend && term != '\\') {
if (!keep_quoted && s[1] == term)
for (; s < PL_bufend; s++,to++) {
/* embedded newlines increment the line count */
if (*s == '\n' && !PL_rsfp)
- PL_curcop->cop_line++;
+ CopLINE_inc(PL_curcop);
/* backslashes can escape the open or closing characters */
if (*s == '\\' && s+1 < PL_bufend) {
if (!keep_quoted &&
if (!PL_rsfp ||
!(PL_oldoldbufptr = PL_oldbufptr = s = PL_linestart = filter_gets(PL_linestr, PL_rsfp, 0))) {
sv_free(sv);
- PL_curcop->cop_line = PL_multi_start;
+ CopLINE_set(PL_curcop, PL_multi_start);
return Nullch;
}
/* we read a line, so increment our line counter */
- PL_curcop->cop_line++;
+ CopLINE_inc(PL_curcop);
/* update debugger info */
if (PERLDB_LINE && PL_curstash != PL_debstash) {
sv_upgrade(sv, SVt_PVMG);
sv_setsv(sv,PL_linestr);
- av_store(GvAV(PL_curcop->cop_filegv),
- (I32)PL_curcop->cop_line, sv);
+ av_store(CopFILEAV(PL_curcop), (I32)CopLINE(PL_curcop), sv);
}
/* having changed the buffer, we must update PL_bufend */
if (keep_delims)
sv_catpvn(sv, s, 1);
- PL_multi_end = PL_curcop->cop_line;
+ PL_multi_end = CopLINE(PL_curcop);
s++;
/* if we allocated too much space, give some back */
register char *e; /* end of temp buffer */
IV tryiv; /* used to see if it can be an IV */
NV value; /* number read, as a double */
- SV *sv; /* place to put the converted number */
+ SV *sv = Nullsv; /* place to put the converted number */
bool floatit; /* boolean: int or float? */
char *lastub = 0; /* position of last underbar */
static char number_too_long[] = "Number too long";
Perl_croak(aTHX_ "panic: scan_num");
/* if it starts with a 0, it could be an octal number, a decimal in
- 0.13 disguise, or a hexadecimal number, or a binary number.
- */
+ 0.13 disguise, or a hexadecimal number, or a binary number. */
case '0':
{
/* variables:
(floatit ? "float" : "integer"),
sv, Nullsv, NULL);
break;
+ /* if it starts with a v, it could be a version number */
+ case 'v':
+ {
+ char *pos = s;
+ pos++;
+ while (isDIGIT(*pos))
+ pos++;
+ if (*pos == '.' && isDIGIT(pos[1])) {
+ UV rev;
+ U8 tmpbuf[10];
+ U8 *tmpend;
+ NV nshift = 1.0;
+ s++; /* get past 'v' */
+
+ sv = NEWSV(92,5);
+ SvUPGRADE(sv, SVt_PVNV);
+ sv_setpvn(sv, "", 0);
+
+ do {
+ rev = atoi(s);
+ s = ++pos;
+ while (isDIGIT(*pos))
+ pos++;
+
+ tmpend = uv_to_utf8(tmpbuf, rev);
+ *tmpend = '\0';
+ sv_catpvn(sv, (const char*)tmpbuf, tmpend - tmpbuf);
+ if (rev > 0)
+ SvNVX(sv) += (NV)rev/nshift;
+ nshift *= 1000;
+ } while (*pos == '.' && isDIGIT(pos[1]));
+
+ rev = atoi(s);
+ s = pos;
+ tmpend = uv_to_utf8(tmpbuf, rev);
+ *tmpend = '\0';
+ sv_catpvn(sv, (const char*)tmpbuf, tmpend - tmpbuf);
+ if (rev > 0)
+ SvNVX(sv) += (NV)rev/nshift;
+
+ SvPOK_on(sv);
+ SvNOK_on(sv);
+ SvREADONLY_on(sv);
+ SvUTF8_on(sv);
+ }
+ }
+ break;
}
/* make the op for the constant and return */
- yylval.opval = newSVOP(OP_CONST, 0, sv);
+ if (sv)
+ yylval.opval = newSVOP(OP_CONST, 0, sv);
+ else
+ yylval.opval = Nullop;
return s;
}
needargs = TRUE;
}
sv_catpvn(stuff, s, eol-s);
+#ifndef PERL_STRICT_CR
+ if (eol-s > 1 && eol[-2] == '\r' && eol[-1] == '\n') {
+ char *end = SvPVX(stuff) + SvCUR(stuff);
+ end[-2] = '\n';
+ end[-1] = '\0';
+ SvCUR(stuff)--;
+ }
+#endif
}
s = eol;
if (PL_rsfp) {
if (PL_compcv) {
assert(SvTYPE(PL_compcv) == SVt_PVCV);
}
- save_I32(&PL_subline);
+ SAVEI32(PL_subline);
save_item(PL_subname);
SAVEI32(PL_padix);
- SAVESPTR(PL_curpad);
+ SAVEVPTR(PL_curpad);
SAVESPTR(PL_comppad);
SAVESPTR(PL_comppad_name);
SAVESPTR(PL_compcv);
PL_comppad_name_fill = 0;
PL_min_intro_pending = 0;
PL_padix = 0;
- PL_subline = PL_curcop->cop_line;
+ PL_subline = CopLINE(PL_curcop);
#ifdef USE_THREADS
av_store(PL_comppad_name, 0, newSVpvn("@_", 2));
PL_curpad[0] = (SV*)newAV();
where = SvPVX(where_sv);
}
msg = sv_2mortal(newSVpv(s, 0));
-#ifdef IV_IS_QUAD
- Perl_sv_catpvf(aTHX_ msg, " at %_ line %" PERL_PRId64 ", ",
- GvSV(PL_curcop->cop_filegv), (IV)PL_curcop->cop_line);
-#else
- Perl_sv_catpvf(aTHX_ msg, " at %_ line %ld, ",
- GvSV(PL_curcop->cop_filegv), (long)PL_curcop->cop_line);
-#endif
+ Perl_sv_catpvf(aTHX_ msg, " at %s line %"IVdf", ",
+ CopFILE(PL_curcop), (IV)CopLINE(PL_curcop));
if (context)
Perl_sv_catpvf(aTHX_ msg, "near \"%.*s\"\n", contlen, context);
else
Perl_sv_catpvf(aTHX_ msg, "%s\n", where);
- if (PL_multi_start < PL_multi_end && (U32)(PL_curcop->cop_line - PL_multi_end) <= 1) {
-#ifdef IV_IS_QUAD
+ if (PL_multi_start < PL_multi_end && (U32)(CopLINE(PL_curcop) - PL_multi_end) <= 1) {
Perl_sv_catpvf(aTHX_ msg,
- " (Might be a runaway multi-line %c%c string starting on line %" PERL_\
-PRId64 ")\n",
+ " (Might be a runaway multi-line %c%c string starting on line %"IVdf")\n",
(int)PL_multi_open,(int)PL_multi_close,(IV)PL_multi_start);
-#else
- Perl_sv_catpvf(aTHX_ msg,
- " (Might be a runaway multi-line %c%c string starting on line %ld)\n",
- (int)PL_multi_open,(int)PL_multi_close,(long)PL_multi_start);
-#endif
PL_multi_end = 0;
}
if (PL_in_eval & EVAL_WARNONLY)
else
qerror(msg);
if (PL_error_count >= 10)
- Perl_croak(aTHX_ "%_ has too many errors.\n", GvSV(PL_curcop->cop_filegv));
+ Perl_croak(aTHX_ "%s has too many errors.\n", CopFILE(PL_curcop));
PL_in_my = 0;
PL_in_my_stash = Nullhv;
return 0;
#ifdef PERL_OBJECT
-#define NO_XSLOCKS
#include "XSUB.h"
#endif
PerlIO_close(PL_rsfp);
PL_rsfp = fp;
}
-
-/*
- * restore_expect
- * Restores the state of PL_expect when the lexing that begun with a
- * start_lex() call has ended.
- */
-
-static void
-restore_expect(pTHXo_ void *e)
-{
- /* a safe way to store a small integer in a pointer */
- PL_expect = (expectation)((char *)e - PL_tokenbuf);
-}
-
-/*
- * restore_lex_expect
- * Restores the state of PL_lex_expect when the lexing that begun with a
- * start_lex() call has ended.
- */
-
-static void
-restore_lex_expect(pTHXo_ void *e)
-{
- /* a safe way to store a small integer in a pointer */
- PL_lex_expect = (expectation)((char *)e - PL_tokenbuf);
-}
newXS("UNIVERSAL::VERSION", XS_UNIVERSAL_VERSION, file);
}
-#ifdef PERL_OBJECT
-#define NO_XSLOCKS
-#endif /* PERL_OBJECT */
-
#include "XSUB.h"
XS(XS_UNIVERSAL_isa)
#ifndef SIGILL
# define SIGILL 6 /* blech */
#endif
-#define ABORT() kill(getpid(),SIGABRT);
+#define ABORT() kill(PerlProc_getpid(),SIGABRT);
/*
* fwrite1() should be a routine with the same calling sequence as fwrite(),
*d++ = (( uv & 0x3f) | 0x80);
return d;
}
-#ifdef Quad_t
- if (uv < 0x2000000000)
+#ifdef HAS_QUAD
+ if (uv < 0x1000000000LL)
#endif
{
*d++ = 0xfe; /* Can't match U+FEFF! */
*d++ = (( uv & 0x3f) | 0x80);
return d;
}
-#ifdef Quad_t
+#ifdef HAS_QUAD
{
*d++ = 0xff; /* Can't match U+FFFE! */
*d++ = (((uv >> 36) & 0x3f) | 0x80);
END_EXTERN_C
#define IN_UTF8 (PL_curcop->op_private & HINT_UTF8)
+#define IN_BYTE (PL_curcop->op_private & HINT_BYTE)
#define UTF8SKIP(s) PL_utf8skip[*(U8*)s]
Malloc_t ptr;
#ifdef HAS_64K_LIMIT
if (size > 0xffff) {
- PerlIO_printf(PerlIO_stderr(),
+ PerlIO_printf(Perl_error_log,
"Allocation too large: %lx\n", size) FLUSH;
my_exit(1);
}
Perl_croak_nocontext("panic: malloc");
#endif
ptr = PerlMem_malloc(size?size:1); /* malloc(0) is NASTY on our system */
- DEBUG_m(PerlIO_printf(Perl_debug_log, "0x%lx: (%05d) malloc %ld bytes\n",ptr,PL_an++,(long)size));
+ PERL_ALLOC_CHECK(ptr);
+ DEBUG_m(PerlIO_printf(Perl_debug_log, "0x%"UVxf": (%05ld) malloc %ld bytes\n",PTR2UV(ptr),(long)PL_an++,(long)size));
if (ptr != Nullch)
return ptr;
else if (PL_nomemok)
return Nullch;
else {
- PerlIO_puts(PerlIO_stderr(),PL_no_mem) FLUSH;
+ PerlIO_puts(Perl_error_log,PL_no_mem) FLUSH;
my_exit(1);
return Nullch;
}
#ifdef HAS_64K_LIMIT
if (size > 0xffff) {
- PerlIO_printf(PerlIO_stderr(),
+ PerlIO_printf(Perl_error_log,
"Reallocation too large: %lx\n", size) FLUSH;
my_exit(1);
}
Perl_croak_nocontext("panic: realloc");
#endif
ptr = PerlMem_realloc(where,size);
-
- DEBUG_m(PerlIO_printf(Perl_debug_log, "0x%lx: (%05d) rfree\n",where,PL_an++));
- DEBUG_m(PerlIO_printf(Perl_debug_log, "0x%lx: (%05d) realloc %ld bytes\n",ptr,PL_an++,(long)size));
+ PERL_ALLOC_CHECK(ptr);
+
+ DEBUG_m(PerlIO_printf(Perl_debug_log, "0x%"UVxf": (%05ld) rfree\n",PTR2UV(where),(long)PL_an++));
+ DEBUG_m(PerlIO_printf(Perl_debug_log, "0x%"UVxf": (%05ld) realloc %ld bytes\n",PTR2UV(ptr),(long)PL_an++,(long)size));
if (ptr != Nullch)
return ptr;
else if (PL_nomemok)
return Nullch;
else {
- PerlIO_puts(PerlIO_stderr(),PL_no_mem) FLUSH;
+ PerlIO_puts(Perl_error_log,PL_no_mem) FLUSH;
my_exit(1);
return Nullch;
}
Perl_safesysfree(Malloc_t where)
{
dTHX;
- DEBUG_m( PerlIO_printf(Perl_debug_log, "0x%lx: (%05d) free\n",(char *) where,PL_an++));
+ DEBUG_m( PerlIO_printf(Perl_debug_log, "0x%"UVxf": (%05ld) free\n",PTR2UV(where),(long)PL_an++));
if (where) {
/*SUPPRESS 701*/
PerlMem_free(where);
#ifdef HAS_64K_LIMIT
if (size * count > 0xffff) {
- PerlIO_printf(PerlIO_stderr(),
+ PerlIO_printf(Perl_error_log,
"Allocation too large: %lx\n", size * count) FLUSH;
my_exit(1);
}
#endif
size *= count;
ptr = PerlMem_malloc(size?size:1); /* malloc(0) is NASTY on our system */
- DEBUG_m(PerlIO_printf(Perl_debug_log, "0x%lx: (%05d) calloc %ld x %ld bytes\n",ptr,PL_an++,(long)count,(long)size));
+ PERL_ALLOC_CHECK(ptr);
+ DEBUG_m(PerlIO_printf(Perl_debug_log, "0x%"UVxf": (%05ld) calloc %ld x %ld bytes\n",PTR2UV(ptr),(long)PL_an++,(long)count,(long)size));
if (ptr != Nullch) {
memset((void*)ptr, 0, size);
return ptr;
else if (PL_nomemok)
return Nullch;
else {
- PerlIO_puts(PerlIO_stderr(),PL_no_mem) FLUSH;
+ PerlIO_puts(Perl_error_log,PL_no_mem) FLUSH;
my_exit(1);
return Nullch;
}
subtot[j] = 0;
}
- PerlIO_printf(PerlIO_stderr(), " Id subtot 4 8 12 16 20 24 28 32 36 40 48 56 64 72 80 80+\n", total);
+ PerlIO_printf(Perl_debug_log, " Id subtot 4 8 12 16 20 24 28 32 36 40 48 56 64 72 80 80+\n", total);
for (i = 0; i < MAXXCOUNT; i++) {
total += xcount[i];
for (j = 0; j < MAXYCOUNT; j++) {
: (flag == 2
? xcount[i] != lastxcount[i] /* Changed */
: xcount[i] > lastxcount[i])) { /* Growed */
- PerlIO_printf(PerlIO_stderr(),"%2d %02d %7ld ", i / 100, i % 100,
+ PerlIO_printf(Perl_debug_log,"%2d %02d %7ld ", i / 100, i % 100,
flag == 2 ? xcount[i] - lastxcount[i] : xcount[i]);
lastxcount[i] = xcount[i];
for (j = 0; j < MAXYCOUNT; j++) {
: (flag == 2
? xycount[i][j] != lastxycount[i][j] /* Changed */
: xycount[i][j] > lastxycount[i][j])) { /* Growed */
- PerlIO_printf(PerlIO_stderr(),"%3ld ",
+ PerlIO_printf(Perl_debug_log,"%3ld ",
flag == 2
? xycount[i][j] - lastxycount[i][j]
: xycount[i][j]);
lastxycount[i][j] = xycount[i][j];
} else {
- PerlIO_printf(PerlIO_stderr(), " . ", xycount[i][j]);
+ PerlIO_printf(Perl_debug_log, " . ", xycount[i][j]);
}
}
- PerlIO_printf(PerlIO_stderr(), "\n");
+ PerlIO_printf(Perl_debug_log, "\n");
}
}
if (flag != 2) {
- PerlIO_printf(PerlIO_stderr(), "Total %7ld ", total);
+ PerlIO_printf(Perl_debug_log, "Total %7ld ", total);
for (j = 0; j < MAXYCOUNT; j++) {
if (subtot[j]) {
- PerlIO_printf(PerlIO_stderr(), "%3ld ", subtot[j]);
+ PerlIO_printf(Perl_debug_log, "%3ld ", subtot[j]);
} else {
- PerlIO_printf(PerlIO_stderr(), " . ");
+ PerlIO_printf(Perl_debug_log, " . ");
}
}
- PerlIO_printf(PerlIO_stderr(), "\n");
+ PerlIO_printf(Perl_debug_log, "\n");
}
}
else
PL_numeric_radix = 0;
# endif /* HAS_LOCALECONV */
-#else
- PL_numeric_radix = 0;
#endif /* USE_LOCALE_NUMERIC */
}
if (locwarn) {
#ifdef LC_ALL
- PerlIO_printf(PerlIO_stderr(),
+ PerlIO_printf(Perl_error_log,
"perl: warning: Setting locale failed.\n");
#else /* !LC_ALL */
- PerlIO_printf(PerlIO_stderr(),
+ PerlIO_printf(Perl_error_log,
"perl: warning: Setting locale failed for the categories:\n\t");
#ifdef USE_LOCALE_CTYPE
if (! curctype)
- PerlIO_printf(PerlIO_stderr(), "LC_CTYPE ");
+ PerlIO_printf(Perl_error_log, "LC_CTYPE ");
#endif /* USE_LOCALE_CTYPE */
#ifdef USE_LOCALE_COLLATE
if (! curcoll)
- PerlIO_printf(PerlIO_stderr(), "LC_COLLATE ");
+ PerlIO_printf(Perl_error_log, "LC_COLLATE ");
#endif /* USE_LOCALE_COLLATE */
#ifdef USE_LOCALE_NUMERIC
if (! curnum)
- PerlIO_printf(PerlIO_stderr(), "LC_NUMERIC ");
+ PerlIO_printf(Perl_error_log, "LC_NUMERIC ");
#endif /* USE_LOCALE_NUMERIC */
- PerlIO_printf(PerlIO_stderr(), "\n");
+ PerlIO_printf(Perl_error_log, "\n");
#endif /* LC_ALL */
- PerlIO_printf(PerlIO_stderr(),
+ PerlIO_printf(Perl_error_log,
"perl: warning: Please check that your locale settings:\n");
#ifdef __GLIBC__
- PerlIO_printf(PerlIO_stderr(),
+ PerlIO_printf(Perl_error_log,
"\tLANGUAGE = %c%s%c,\n",
language ? '"' : '(',
language ? language : "unset",
language ? '"' : ')');
#endif
- PerlIO_printf(PerlIO_stderr(),
+ PerlIO_printf(Perl_error_log,
"\tLC_ALL = %c%s%c,\n",
lc_all ? '"' : '(',
lc_all ? lc_all : "unset",
if (strnEQ(*e, "LC_", 3)
&& strnNE(*e, "LC_ALL=", 7)
&& (p = strchr(*e, '=')))
- PerlIO_printf(PerlIO_stderr(), "\t%.*s = \"%s\",\n",
+ PerlIO_printf(Perl_error_log, "\t%.*s = \"%s\",\n",
(int)(p - *e), *e, p + 1);
}
}
- PerlIO_printf(PerlIO_stderr(),
+ PerlIO_printf(Perl_error_log,
"\tLANG = %c%s%c\n",
lang ? '"' : '(',
lang ? lang : "unset",
lang ? '"' : ')');
- PerlIO_printf(PerlIO_stderr(),
+ PerlIO_printf(Perl_error_log,
" are supported and installed on your system.\n");
}
if (setlocale(LC_ALL, "C")) {
if (locwarn)
- PerlIO_printf(PerlIO_stderr(),
+ PerlIO_printf(Perl_error_log,
"perl: warning: Falling back to the standard locale (\"C\").\n");
ok = 0;
}
else {
if (locwarn)
- PerlIO_printf(PerlIO_stderr(),
+ PerlIO_printf(Perl_error_log,
"perl: warning: Failed to fall back to the standard locale (\"C\").\n");
ok = -1;
}
)
{
if (locwarn)
- PerlIO_printf(PerlIO_stderr(),
+ PerlIO_printf(Perl_error_log,
"perl: warning: Cannot fall back to the standard locale (\"C\").\n");
ok = -1;
}
If FBMcf_TAIL, the table is created as if the string has a trailing \n. */
void
-Perl_fbm_compile(pTHX_ SV *sv, U32 flags /* not used yet */)
+Perl_fbm_compile(pTHX_ SV *sv, U32 flags)
{
register U8 *s;
register U8 *table;
if (len == 0) /* TAIL might be on on a zero-length string. */
return;
if (len > 2) {
- I32 mlen = len;
+ U8 mlen;
unsigned char *sb;
- if (mlen > 255)
+ if (len > 255)
mlen = 255;
- Sv_Grow(sv,len + 256 + FBM_TABLE_OFFSET);
+ else
+ mlen = (U8)len;
+ Sv_Grow(sv, len + 256 + FBM_TABLE_OFFSET);
table = (unsigned char*)(SvPVX(sv) + len + FBM_TABLE_OFFSET);
- s = table - 1 - FBM_TABLE_OFFSET; /* Last char */
- for (i = 0; i < 256; i++) {
- table[i] = mlen;
- }
- table[-1] = flags; /* Not used yet */
+ s = table - 1 - FBM_TABLE_OFFSET; /* last char */
+ memset((void*)table, mlen, 256);
+ table[-1] = (U8)flags;
i = 0;
- sb = s - mlen;
+ sb = s - mlen + 1; /* first char (maybe) */
while (s >= sb) {
if (table[*s] == mlen)
- table[*s] = i;
+ table[*s] = (U8)i;
s--, i++;
}
}
BmUSEFUL(sv) = 100; /* Initial value */
if (flags & FBMcf_TAIL)
SvTAIL_on(sv);
- DEBUG_r(PerlIO_printf(Perl_debug_log, "rarest char %c at %d\n",BmRARE(sv),BmPREVIOUS(sv)));
+ DEBUG_r(PerlIO_printf(Perl_debug_log, "rarest char %c at %d\n",
+ BmRARE(sv),BmPREVIOUS(sv)));
}
/* If SvTAIL(littlestr), it has a fake '\n' at end. */
}
if (SvTAIL(littlestr) && !multiline) { /* tail anchored? */
s = bigend - littlelen;
- if (s >= big
- && bigend[-1] == '\n'
- && *s == *little
+ if (s >= big && bigend[-1] == '\n' && *s == *little
/* Automatically of length > 2 */
&& memEQ((char*)s + 1, (char*)little + 1, littlelen - 2))
+ {
return (char*)s; /* how sweet it is */
- if (s[1] == *little && memEQ((char*)s + 2,(char*)little + 1,
- littlelen - 2))
+ }
+ if (s[1] == *little
+ && memEQ((char*)s + 2, (char*)little + 1, littlelen - 2))
+ {
return (char*)s + 1; /* how sweet it is */
+ }
return Nullch;
}
if (SvTYPE(littlestr) != SVt_PVBM || !SvVALID(littlestr)) {
if (!b && SvTAIL(littlestr)) { /* Automatically multiline! */
/* Chop \n from littlestr: */
s = bigend - littlelen + 1;
- if (*s == *little && memEQ((char*)s + 1, (char*)little + 1,
- littlelen - 2))
+ if (*s == *little
+ && memEQ((char*)s + 1, (char*)little + 1, littlelen - 2))
+ {
return (char*)s;
+ }
return Nullch;
}
return b;
top2:
/*SUPPRESS 560*/
- if (tmp = table[*s]) {
+ if ((tmp = table[*s])) {
#ifdef POINTERRIGOR
if (bigend - s > tmp) {
s += tmp;
sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));
if (!SvCUR(sv) || *(SvEND(sv) - 1) != '\n') {
dTHR;
-#ifdef IV_IS_QUAD
- if (PL_curcop->cop_line)
- Perl_sv_catpvf(aTHX_ sv, " at %_ line %" PERL_PRId64,
- GvSV(PL_curcop->cop_filegv), (IV)PL_curcop->cop_line);
-#else
- if (PL_curcop->cop_line)
- Perl_sv_catpvf(aTHX_ sv, " at %_ line %ld",
- GvSV(PL_curcop->cop_filegv), (long)PL_curcop->cop_line);
-#endif
+ if (CopLINE(PL_curcop))
+ Perl_sv_catpvf(aTHX_ sv, " at %s line %"IVdf,
+ CopFILE(PL_curcop), (IV)CopLINE(PL_curcop));
if (GvIO(PL_last_in_gv) && IoLINES(GvIOp(PL_last_in_gv))) {
bool line_mode = (RsSIMPLE(PL_rs) &&
SvCUR(PL_rs) == 1 && *SvPVX(PL_rs) == '\n');
-#ifdef IV_IS_QUAD
- Perl_sv_catpvf(aTHX_ sv, ", <%s> %s %" PERL_PRId64,
+ Perl_sv_catpvf(aTHX_ sv, ", <%s> %s %"IVdf,
PL_last_in_gv == PL_argvgv ? "" : GvNAME(PL_last_in_gv),
line_mode ? "line" : "chunk",
(IV)IoLINES(GvIOp(PL_last_in_gv)));
-#else
- Perl_sv_catpvf(aTHX_ sv, ", <%s> %s %ld",
- PL_last_in_gv == PL_argvgv ? "" : GvNAME(PL_last_in_gv),
- line_mode ? "line" : "chunk",
- (long)IoLINES(GvIOp(PL_last_in_gv)));
-#endif
}
#ifdef USE_THREADS
if (thr->tid)
SV *msv;
STRLEN msglen;
- DEBUG_S(PerlIO_printf(PerlIO_stderr(),
+ DEBUG_S(PerlIO_printf(Perl_debug_log,
"%p: die: curstack = %p, mainstack = %p\n",
thr, PL_curstack, PL_mainstack));
message = Nullch;
}
- DEBUG_S(PerlIO_printf(PerlIO_stderr(),
+ DEBUG_S(PerlIO_printf(Perl_debug_log,
"%p: die: message = %s\ndiehook = %p\n",
thr, message, PL_diehook));
if (PL_diehook) {
PUSHMARK(SP);
XPUSHs(msg);
PUTBACK;
- /* HACK - REVISIT - avoid CATCH_SET(TRUE) in call_sv()
- or we come back here due to a JMPENV_JMP() and do
- a POPSTACK - but die_where() will have already done
- one as it unwound - NI-S 1999/08/14 */
- call_sv((SV*)cv, G_DISCARD|G_NOCATCH);
+ call_sv((SV*)cv, G_DISCARD);
POPSTACK;
LEAVE;
}
}
PL_restartop = die_where(message, msglen);
- DEBUG_S(PerlIO_printf(PerlIO_stderr(),
+ DEBUG_S(PerlIO_printf(Perl_debug_log,
"%p: die: restartop = %p, was_in_eval = %d, top_env = %p\n",
thr, PL_restartop, was_in_eval, PL_top_env));
if ((!PL_restartop && was_in_eval) || PL_top_env->je_prev)
else
message = SvPV(msv,msglen);
- DEBUG_S(PerlIO_printf(PerlIO_stderr(), "croak: 0x%lx %s",
- (unsigned long) thr, message));
+ DEBUG_S(PerlIO_printf(Perl_debug_log, "croak: 0x%"UVxf" %s",
+ PTR2UV(thr), message));
if (PL_diehook) {
/* sv_2cv might call Perl_croak() */
/* SFIO can really mess with your errno */
int e = errno;
#endif
- PerlIO_write(PerlIO_stderr(), message, msglen);
- (void)PerlIO_flush(PerlIO_stderr());
+ PerlIO *serr = Perl_error_log;
+
+ PerlIO_write(serr, message, msglen);
+ (void)PerlIO_flush(serr);
#ifdef USE_SFIO
errno = e;
#endif
return;
}
}
- PerlIO_write(PerlIO_stderr(), message, msglen);
+ {
+ PerlIO *serr = Perl_error_log;
+
+ PerlIO_write(serr, message, msglen);
#ifdef LEAKTEST
- DEBUG_L(*message == '!'
- ? (xstat(message[1]=='!'
- ? (message[2]=='!' ? 2 : 1)
- : 0)
- , 0)
- : 0);
+ DEBUG_L(*message == '!'
+ ? (xstat(message[1]=='!'
+ ? (message[2]=='!' ? 2 : 1)
+ : 0)
+ , 0)
+ : 0);
#endif
- (void)PerlIO_flush(PerlIO_stderr());
+ (void)PerlIO_flush(serr);
+ }
}
#if defined(PERL_IMPLICIT_CONTEXT)
if (ckDEAD(err)) {
#ifdef USE_THREADS
- DEBUG_S(PerlIO_printf(PerlIO_stderr(), "croak: 0x%lx %s", (unsigned long) thr, message));
+ DEBUG_S(PerlIO_printf(Perl_debug_log, "croak: 0x%"UVxf" %s", PTR2UV(thr), message));
#endif /* USE_THREADS */
if (PL_diehook) {
/* sv_2cv might call Perl_croak() */
PL_restartop = die_where(message, msglen);
JMPENV_JUMP(3);
}
- PerlIO_write(PerlIO_stderr(), message, msglen);
- (void)PerlIO_flush(PerlIO_stderr());
+ {
+ PerlIO *serr = Perl_error_log;
+ PerlIO_write(serr, message, msglen);
+ (void)PerlIO_flush(serr);
+ }
my_failure_exit();
}
return;
}
}
- PerlIO_write(PerlIO_stderr(), message, msglen);
+ {
+ PerlIO *serr = Perl_error_log;
+ PerlIO_write(serr, message, msglen);
#ifdef LEAKTEST
- DEBUG_L(xstat());
+ DEBUG_L(xstat());
#endif
- (void)PerlIO_flush(PerlIO_stderr());
+ (void)PerlIO_flush(serr);
+ }
}
}
}
void
-my_setenv(char *nam, char *val)
+Perl_my_setenv(pTHX_ char *nam, char *val)
{
/* You can not directly manipulate the environ[] array because
* the routines do some additional work that syncs the Cygwin
if (!oldstr)
return;
unsetenv(nam);
- Safefree(oldstr);
+ safesysfree(oldstr);
return;
}
setenv(nam, val, 1);
environ = *Perl_main_environ; /* environ realloc can occur in setenv */
if(oldstr && environ[setenv_getix(nam)] != oldstr)
- Safefree(oldstr);
+ safesysfree(oldstr);
}
#else /* if WIN32 */
}
#endif
+/* this is a drop-in replacement for bcopy() */
#if !defined(HAS_BCOPY) || !defined(HAS_SAFE_BCOPY)
char *
-Perl_my_bcopy(pTHX_ register const char *from,register char *to,register I32 len)
+Perl_my_bcopy(register const char *from,register char *to,register I32 len)
{
char *retval = to;
}
#endif
+/* this is a drop-in replacement for memset() */
#ifndef HAS_MEMSET
void *
-Perl_my_memset(pTHX_ register char *loc, register I32 ch, register I32 len)
+Perl_my_memset(register char *loc, register I32 ch, register I32 len)
{
char *retval = loc;
}
#endif
+/* this is a drop-in replacement for bzero() */
#if !defined(HAS_BZERO) && !defined(HAS_MEMSET)
char *
-Perl_my_bzero(pTHX_ register char *loc, register I32 len)
+Perl_my_bzero(register char *loc, register I32 len)
{
char *retval = loc;
}
#endif
+/* this is a drop-in replacement for memcmp() */
#if !defined(HAS_MEMCMP) || !defined(HAS_SANE_MEMCMP)
I32
-Perl_my_memcmp(pTHX_ const char *s1, const char *s2, register I32 len)
+Perl_my_memcmp(const char *s1, const char *s2, register I32 len)
{
register U8 *a = (U8 *)s1;
register U8 *b = (U8 *)s2;
#endif
/* VMS' my_popen() is in VMS.c, same with OS/2. */
-#if (!defined(DOSISH) || defined(HAS_FORK) || defined(AMIGAOS)) && !defined(VMS) && !defined(__OPEN_VM) && !defined(EPOC)
+#if (!defined(DOSISH) || defined(HAS_FORK) || defined(AMIGAOS)) && !defined(VMS) && !defined(__OPEN_VM) && !defined(EPOC) && !defined(MACOS_TRADITIONAL)
PerlIO *
Perl_my_popen(pTHX_ char *cmd, char *mode)
{
#endif /* defined OS2 */
/*SUPPRESS 560*/
if (tmpgv = gv_fetchpv("$",TRUE, SVt_PV))
- sv_setiv(GvSV(tmpgv), getpid());
+ sv_setiv(GvSV(tmpgv), PerlProc_getpid());
PL_forkprocess = 0;
hv_clear(PL_pidstatus); /* we have no children */
return Nullfp;
int fd;
struct stat tmpstatbuf;
- PerlIO_printf(PerlIO_stderr(),"%s", s);
+ PerlIO_printf(Perl_debug_log,"%s", s);
for (fd = 0; fd < 32; fd++) {
if (PerlLIO_fstat(fd,&tmpstatbuf) >= 0)
- PerlIO_printf(PerlIO_stderr()," %d",fd);
+ PerlIO_printf(Perl_debug_log," %d",fd);
}
- PerlIO_printf(PerlIO_stderr(),"\n");
+ PerlIO_printf(Perl_debug_log,"\n");
}
#endif /* DUMP_FDS */
oldsig = PerlProc_signal(signo, sig_trap);
PerlProc_signal(signo, oldsig);
if (sig_trapped)
- PerlProc_kill(getpid(), signo);
+ PerlProc_kill(PerlProc_getpid(), signo);
return oldsig;
}
#endif /* !HAS_SIGACTION */
/* VMS' my_pclose() is in VMS.c; same with OS/2 */
-#if (!defined(DOSISH) || defined(HAS_FORK) || defined(AMIGAOS)) && !defined(VMS) && !defined(__OPEN_VM) && !defined(EPOC)
+#if (!defined(DOSISH) || defined(HAS_FORK) || defined(AMIGAOS)) && !defined(VMS) && !defined(__OPEN_VM) && !defined(EPOC) && !defined(MACOS_TRADITIONAL)
I32
Perl_my_pclose(pTHX_ PerlIO *ptr)
{
}
#endif /* !DOSISH */
-#if !defined(DOSISH) || defined(OS2) || defined(WIN32)
+#if (!defined(DOSISH) || defined(OS2) || defined(WIN32)) && !defined(MACOS_TRADITIONAL)
I32
Perl_wait4pid(pTHX_ Pid_t pid, int *statusp, int flags)
{
if (!pid)
return -1;
if (pid > 0) {
- sprintf(spid, "%d", pid);
+ sprintf(spid, "%"IVdf, (IV)pid);
svp = hv_fetch(PL_pidstatus,spid,strlen(spid),FALSE);
if (svp && *svp != &PL_sv_undef) {
*statusp = SvIVX(*svp);
pid = atoi(hv_iterkey(entry,(I32*)statusp));
sv = hv_iterval(PL_pidstatus,entry);
*statusp = SvIVX(sv);
- sprintf(spid, "%d", pid);
+ sprintf(spid, "%"IVdf, (IV)pid);
(void)hv_delete(PL_pidstatus,spid,strlen(spid),G_DISCARD);
return pid;
}
register SV *sv;
char spid[TYPE_CHARS(int)];
- sprintf(spid, "%d", pid);
+ sprintf(spid, "%"IVdf, (IV)pid);
sv = *hv_fetch(PL_pidstatus,spid,strlen(spid),TRUE);
(void)SvUPGRADE(sv,SVt_IV);
SvIVX(sv) = status;
}
#endif
+#ifdef MACOS_TRADITIONAL
+ if (dosearch && !strchr(scriptname, ':') &&
+ (s = PerlEnv_getenv("Commands")))
+#else
if (dosearch && !strchr(scriptname, '/')
#ifdef DOSISH
&& !strchr(scriptname, '\\')
#endif
- && (s = PerlEnv_getenv("PATH"))) {
+ && (s = PerlEnv_getenv("PATH")))
+#endif
+ {
bool seen_dot = 0;
PL_bufend = s + strlen(s);
while (s < PL_bufend) {
+#ifdef MACOS_TRADITIONAL
+ s = delimcpy(tmpbuf, tmpbuf + sizeof tmpbuf, s, PL_bufend,
+ ',',
+ &len);
+#else
#if defined(atarist) || defined(DOSISH)
for (len = 0; *s
# ifdef atarist
':',
&len);
#endif /* ! (atarist || DOSISH) */
+#endif /* MACOS_TRADITIONAL */
if (s < PL_bufend)
s++;
if (len + 1 + strlen(scriptname) + MAX_EXT_LEN >= sizeof tmpbuf)
continue; /* don't search dir with too-long name */
+#ifdef MACOS_TRADITIONAL
+ if (len && tmpbuf[len - 1] != ':')
+ tmpbuf[len++] = ':';
+#else
if (len
#if defined(atarist) || defined(__MINT__) || defined(DOSISH)
&& tmpbuf[len - 1] != '/'
tmpbuf[len++] = '/';
if (len == 2 && tmpbuf[0] == '.')
seen_dot = 1;
+#endif
(void)strcpy(tmpbuf + len, scriptname);
#endif /* !VMS */
continue;
if (S_ISREG(PL_statbuf.st_mode)
&& cando(S_IRUSR,TRUE,&PL_statbuf)
-#ifndef DOSISH
+#if !defined(DOSISH) && !defined(MACOS_TRADITIONAL)
&& cando(S_IXUSR,TRUE,&PL_statbuf)
#endif
)
COND_INIT(&cp->owner_cond);
COND_INIT(&cp->cond);
cp->owner = 0;
- MUTEX_LOCK(&PL_cred_mutex); /* XXX need separate mutex? */
+ LOCK_CRED_MUTEX; /* XXX need separate mutex? */
mg = mg_find(sv, 'm');
if (mg) {
/* someone else beat us to initialising it */
- MUTEX_UNLOCK(&PL_cred_mutex); /* XXX need separate mutex? */
+ UNLOCK_CRED_MUTEX; /* XXX need separate mutex? */
MUTEX_DESTROY(&cp->mutex);
COND_DESTROY(&cp->owner_cond);
COND_DESTROY(&cp->cond);
mg = SvMAGIC(sv);
mg->mg_ptr = (char *)cp;
mg->mg_len = sizeof(cp);
- MUTEX_UNLOCK(&PL_cred_mutex); /* XXX need separate mutex? */
- DEBUG_S(WITH_THR(PerlIO_printf(PerlIO_stderr(),
+ UNLOCK_CRED_MUTEX; /* XXX need separate mutex? */
+ DEBUG_S(WITH_THR(PerlIO_printf(Perl_debug_log,
"%p: condpair_magic %p\n", thr, sv));)
}
}
Zero(thr, 1, struct perl_thread);
#endif
- PL_protect = MEMBER_TO_FPTR(Perl_default_protect);
-
thr->oursv = sv;
init_stacks();
thr->threadsv = newAV();
thr->specific = newAV();
thr->errsv = newSVpvn("", 0);
- thr->errhv = newHV();
thr->flags = THRf_R_JOINABLE;
MUTEX_INIT(&thr->mutex);
- /* top_env needs to be non-zero. It points to an area
- in which longjmp() stuff is stored, as C callstack
- info there at least is thread specific this has to
- be per-thread. Otherwise a 'die' in a thread gives
- that thread the C stack of last thread to do an eval {}!
- See comments in scope.h
- Initialize top entry (as in perl.c for main thread)
- */
- PL_start_env.je_prev = NULL;
- PL_start_env.je_ret = -1;
- PL_start_env.je_mustcatch = TRUE;
- PL_top_env = &PL_start_env;
+ JMPENV_BOOTSTRAP;
PL_in_eval = EVAL_NULL; /* ~(EVAL_INEVAL|EVAL_WARNONLY|EVAL_KEEPERR) */
PL_restartop = 0;
PL_ofs = savepvn(t->Tofs, PL_ofslen);
PL_defoutgv = (GV*)SvREFCNT_inc(t->Tdefoutgv);
PL_chopset = t->Tchopset;
- PL_formtarget = newSVsv(t->Tformtarget);
PL_bodytarget = newSVsv(t->Tbodytarget);
PL_toptarget = newSVsv(t->Ttoptarget);
+ if (t->Tformtarget == t->Ttoptarget)
+ PL_formtarget = PL_toptarget;
+ else
+ PL_formtarget = PL_bodytarget;
/* Initialise all per-thread SVs that the template thread used */
svp = AvARRAY(t->threadsv);
SV *sv = newSVsv(*svp);
av_store(thr->threadsv, i, sv);
sv_magic(sv, 0, 0, &PL_threadsv_names[i], 1);
- DEBUG_S(PerlIO_printf(PerlIO_stderr(),
- "new_struct_thread: copied threadsv %d %p->%p\n",i, t, thr));
+ DEBUG_S(PerlIO_printf(Perl_debug_log,
+ "new_struct_thread: copied threadsv %"IVdf" %p->%p\n",
+ (IV)i, t, thr));
}
}
thr->threadsvp = AvARRAY(thr->threadsv);
* License or the Artistic License, as specified in the README file.
*
*/
+
+#ifdef VMS
+# define PERL_FILE_IS_ABSOLUTE(f) \
+ (*(f) == '/' \
+ || (strchr(f,':') \
+ || ((*(f) == '[' || *(f) == '<') \
+ && (isALNUM((f)[1]) || strchr("$-_]>",(f)[1])))))
+
+#else /* !VMS */
+# ifdef WIN32
+# define PERL_FILE_IS_ABSOLUTE(f) \
+ (*(f) == '/' \
+ || ((f)[0] && (f)[1] == ':') /* drive name */ \
+ || ((f)[0] == '\\' && (f)[1] == '\\')) /* UNC path */
+# else /* !WIN32 */
+# ifdef DOSISH
+# define PERL_FILE_IS_ABSOLUTE(f) \
+ (*(f) == '/' \
+ || ((f)[0] && (f)[1] == ':')) /* drive name */
+# else /* !DOSISH */
+# define PERL_FILE_IS_ABSOLUTE(f) (*(f) == '/')
+# endif /* DOSISH */
+# endif /* WIN32 */
+#endif /* VMS */
=item B<-F>
Additional flags to specify to C preprocessor when scanning header for
-function declarations. Should not be used without B<-x>.
+function declarations. Should not be used without B<-x>.
+
+=item B<-M> I<regular expression>
+
+selects functions/macros to process.
=item B<-O>
=item B<-f>
Allows an extension to be created for a header even if that header is
-not found in /usr/include.
+not found in standard include directories.
=item B<-h>
Specifies a name to be used for the extension, e.g., S<-n RPC::DCE>
+=item B<-o> I<regular expression>
+
+Use "opaque" data type for the C types matched by the regular
+expression, even if these types are C<typedef>-equivalent to types
+from typemaps. Should not be used without B<-x>.
+
+This may be useful since, say, types which are C<typedef>-equivalent
+to integers may represent OS-related handles, and one may want to work
+with these handles in OO-way, as in C<$handle-E<gt>do_something()>.
+Use C<-o .> if you want to handle all the C<typedef>ed types as opaque types.
+
+The type-to-match is whitewashed (except for commas, which have no
+whitespace before them, and multiple C<*> which have no whitespace
+between them).
+
=item B<-p> I<prefix>
Specify a prefix which should be removed from the Perl function names, e.g., S<-p sec_rgy_>
Note that some types of arguments/return-values for functions may
result in XSUB-declarations/typemap-entries which need
hand-editing. Such may be objects which cannot be converted from/to a
-pointer (like C<long long>), pointers to functions, or arrays.
+pointer (like C<long long>), pointers to functions, or arrays. See
+also the section on L<LIMITATIONS of B<-x>>.
=back
# Same with function declaration in proto.h as visible from perl.h.
h2xs -xAn perl2 perl.h,proto.h
+ # Same but select only functions which match /^av_/
+ h2xs -M '^av_' -xAn perl2 perl.h,proto.h
+
+ # Same but treat SV* etc as "opaque" types
+ h2xs -o '^[S]V \*$' -M '^av_' -xAn perl2 perl.h,proto.h
+
=head1 ENVIRONMENT
No environment variables are used.
The usual warnings if it cannot read or write the files involved.
+=head1 LIMITATIONS of B<-x>
+
+F<h2xs> would not distinguish whether an argument to a C function
+which is of the form, say, C<int *>, is an input, output, or
+input/output parameter. In particular, argument declarations of the
+form
+
+ int
+ foo(n)
+ int *n
+
+should be better rewritten as
+
+ int
+ foo(n)
+ int &n
+
+if C<n> is an input parameter.
+
+Additionally, F<h2xs> has no facilities to intuit that a function
+
+ int
+ foo(addr,l)
+ char *addr
+ int l
+
+takes a pair of address and length of data at this address, so it is better
+to rewrite this function as
+
+ int
+ foo(sv)
+ SV *addr
+ PREINIT:
+ STRLEN len;
+ char *s;
+ CODE:
+ s = SvPV(sv,len);
+ RETVAL = foo(s, len);
+ OUTPUT:
+ RETVAL
+
+or alternately
+
+ static int
+ my_foo(SV *sv)
+ {
+ STRLEN len;
+ char *s = SvPV(sv,len);
+
+ return foo(s, len);
+ }
+
+ MODULE = foo PACKAGE = foo PREFIX = my_
+
+ int
+ foo(sv)
+ SV *sv
+
+See L<perlxs> and L<perlxstut> for additional details.
+
=cut
-my( $H2XS_VERSION ) = ' $Revision: 1.19 $ ' =~ /\$Revision:\s+([^\s]+)/;
+use strict;
+
+
+my( $H2XS_VERSION ) = ' $Revision: 1.20 $ ' =~ /\$Revision:\s+([^\s]+)/;
my $TEMPLATE_VERSION = '0.01';
+my @ARGS = @ARGV;
use Getopt::Std;
-A Omit all autoloading facilities (implies -c).
-C Omit creating the Changes file, add HISTORY heading to stub POD.
-F Additional flags for C preprocessor (used with -x).
+ -M Mask to select C functions/macros (default is select all).
-O Allow overwriting of a pre-existing extension directory.
-P Omit the stub POD section.
-X Omit the XS portion (implies both -c and -f).
-f Force creation of the extension even if the C header does not exist.
-h Display this help message
-n Specify a name to use for the extension (recommended).
+ -o Regular expression for \"opaque\" types.
-p Specify a prefix which should be removed from the Perl function names.
-s Create subroutines for specified macros.
-v Specify a version number for this extension.
}
-getopts("ACF:OPXcdfhn:p:s:v:x") || usage;
+getopts("ACF:M:OPXcdfhn:o:p:s:v:x") || usage;
+use vars qw($opt_A $opt_C $opt_F $opt_M $opt_O $opt_P $opt_X $opt_c
+ $opt_d $opt_f $opt_h $opt_n $opt_o $opt_p $opt_s $opt_v $opt_x);
usage if $opt_h;
# -X implies -c and -f
$opt_c = $opt_f = 1 if $opt_X;
-%const_xsub = map { $_,1 } split(/,+/, $opt_s) if $opt_s;
+my %const_xsub = map { $_,1 } split(/,+/, $opt_s) if $opt_s;
+my $extralibs;
+my @path_h;
while (my $arg = shift) {
if ($arg =~ /^-l/i) {
usage "Must supply header file or module name\n"
unless (@path_h or $opt_n);
+my $fmask;
+my $tmask;
+
+$fmask = qr{$opt_M} if defined $opt_M;
+$tmask = qr{$opt_o} if defined $opt_o;
+my $tmask_all = $tmask && $opt_o eq '.';
+
+if ($opt_x) {
+ eval {require C::Scan; 1}
+ or die <<EOD;
+C::Scan required if you use -x option.
+To install C::Scan, execute
+ perl -MCPAN -e "install C::Scan"
+EOD
+ unless ($tmask_all) {
+ $C::Scan::VERSION >= 0.70
+ or die <<EOD;
+C::Scan v. 0.70 or later required unless you use -o . option.
+You have version $C::Scan::VERSION installed as $INC{'C/Scan.pm'}.
+To install C::Scan, execute
+ perl -MCPAN -e "install C::Scan"
+EOD
+ }
+}
+elsif ($opt_o or $opt_F) {
+ warn <<EOD;
+Options -o and -F do not make sense without -x.
+EOD
+}
+
+my @path_h_ini = @path_h;
+my ($name, %fullpath, %prefix, %seen_define, %prefixless, %const_names);
if( @path_h ){
+ use Config;
+ use File::Spec;
+ my @paths;
+ if ($^O eq 'VMS') { # Consider overrides of default location
+ # XXXX This is not equivalent to what the older version did:
+ # it was looking at $hadsys header-file per header-file...
+ my($hadsys) = grep s!^sys/!!i , @path_h;
+ @paths = qw( Sys$Library VAXC$Include );
+ push @paths, ($hadsys ? 'GNU_CC_Include[vms]' : 'GNU_CC_Include[000000]');
+ push @paths, qw( DECC$Library_Include DECC$System_Include );
+ }
+ else {
+ @paths = (File::Spec->curdir(), $Config{usrinc},
+ (split ' ', $Config{locincpth}), '/usr/include');
+ }
foreach my $path_h (@path_h) {
$name ||= $path_h;
if( $path_h =~ s#::#/#g && $opt_n ){
warn "Nesting of headerfile ignored with -n\n";
}
$path_h .= ".h" unless $path_h =~ /\.h$/;
- $fullpath = $path_h;
+ my $fullpath = $path_h;
$path_h =~ s/,.*$// if $opt_x;
- if ($^O eq 'VMS') { # Consider overrides of default location
- if ($path_h !~ m![:>\[]!) {
- my($hadsys) = ($path_h =~ s!^sys/!!i);
- if ($ENV{'DECC$System_Include'}) { $path_h = "DECC\$System_Include:$path_h"; }
- elsif ($ENV{'DECC$Library_Include'}) { $path_h = "DECC\$Library_Include:$path_h"; }
- elsif ($ENV{'GNU_CC_Include'}) { $path_h = 'GNU_CC_Include:' .
- ($hadsys ? '[vms]' : '[000000]') . $path_h; }
- elsif ($ENV{'VAXC$Include'}) { $path_h = "VAXC\$_Include:$path_h"; }
- else { $path_h = "Sys\$Library:$path_h"; }
- }
- }
- elsif ($^O eq 'os2') {
- $path_h = "/usr/include/$path_h"
- if $path_h !~ m#^([a-z]:)?[./]#i and -r "/usr/include/$path_h";
- }
- else {
- $path_h = "/usr/include/$path_h"
- if $path_h !~ m#^[./]# and -r "/usr/include/$path_h";
+ $fullpath{$path_h} = $fullpath;
+
+ if (not -f $path_h) {
+ my $tmp_path_h = $path_h;
+ for my $dir (@paths) {
+ last if -f ($path_h = File::Spec->catfile($dir, $tmp_path_h));
+ }
}
if (!$opt_c) {
# Record the names of simple #define constants into const_names
# Function prototypes are processed below.
open(CH, "<$path_h") || die "Can't open $path_h: $!\n";
+ defines:
while (<CH>) {
- if (/^#[ \t]*define\s+([\$\w]+)\b\s*[^("]/) {
- print "Matched $_ ($1)\n" if $opt_d;
- $_ = $1;
+ if (/^[ \t]*#[ \t]*define\s+([\$\w]+)\b(?!\()\s*(?=[^" \t])(.*)/) {
+ my $def = $1;
+ my $rest = $2;
+ $rest =~ s!/\*.*?(\*/|\n)|//.*!!g; # Remove comments
+ $rest =~ s/^\s+//;
+ $rest =~ s/\s+$//;
+ # Cannot do: (-1) and ((LHANDLE)3) are OK:
+ #print("Skip non-wordy $def => $rest\n"),
+ # next defines if $rest =~ /[^\w\$]/;
+ if ($rest =~ /"/) {
+ print("Skip stringy $def => $rest\n") if $opt_d;
+ next defines;
+ }
+ print "Matched $_ ($def)\n" if $opt_d;
+ $seen_define{$def} = $rest;
+ $_ = $def;
next if /^_.*_h_*$/i; # special case, but for what?
if (defined $opt_p) {
if (!/^$opt_p(\d)/) {
warn "can't remove $opt_p prefix from '$_'!\n";
}
}
- $const_names{$_}++;
+ $prefixless{$def} = $_;
+ if (!$fmask or /$fmask/) {
+ print "... Passes mask of -M.\n" if $opt_d and $fmask;
+ $const_names{$_}++;
+ }
}
}
close(CH);
}
}
- @const_names = sort keys %const_names;
}
-$module = $opt_n || do {
+my $module = $opt_n || do {
$name =~ s/\.h$//;
if( $name !~ /::/ ){
$name =~ s#^.*/##;
$name;
};
+my ($ext, $nested, @modparts, $modfname, $modpname);
(chdir 'ext', $ext = 'ext/') if -d 'ext';
if( $module =~ /::/ ){
if ($opt_O) {
warn "Overwriting existing $ext$modpname!!!\n" if -e $modpname;
-} else {
+}
+else {
die "Won't overwrite existing $ext$modpname\n" if -e $modpname;
}
if( $nested ){
- $modpath = "";
+ my $modpath = "";
foreach (@modparts){
mkdir("$modpath$_", 0777);
$modpath .= "$_/";
my %std_types;
my $fdecls = [];
my $fdecls_parsed = [];
+my $typedef_rex;
+my %typedefs_pre;
+my %known_fnames;
+
+my @fnames;
+my @fnames_no_prefix;
if( ! $opt_X ){ # use XS, unless it was disabled
open(XS, ">$modfname.xs") || die "Can't create $ext$modpname/$modfname.xs: $!\n";
if ($opt_x) {
- require C::Scan; # Run-time directive
require Config; # Run-time directive
warn "Scanning typemaps...\n";
get_typemap();
- my $c;
- my $filter;
+ my @td;
+ my @good_td;
+ my $addflags = $opt_F || '';
+
foreach my $filename (@path_h) {
- my $addflags = $opt_F || '';
- if ($fullpath =~ /,/) {
+ my $c;
+ my $filter;
+
+ if ($fullpath{$filename} =~ /,/) {
$filename = $`;
$filter = $';
}
$c = new C::Scan 'filename' => $filename, 'filename_filter' => $filter,
'add_cppflags' => $addflags;
$c->set('includeDirs' => ["$Config::Config{archlib}/CORE"]);
-
+
push @$fdecls_parsed, @{ $c->get('parsed_fdecls') };
push(@$fdecls, @{$c->get('fdecls')});
+
+ push @td, @{$c->get('typedefs_maybe')};
+
+ unless ($tmask_all) {
+ warn "Scanning $filename for typedefs...\n";
+ my $td = $c->get('typedef_hash');
+ # eval {require 'dumpvar.pl'; ::dumpValue($td)} or warn $@ if $opt_d;
+ my @f_good_td = grep $td->{$_}[1] eq '', keys %$td;
+ push @good_td, @f_good_td;
+ @typedefs_pre{@f_good_td} = map $_->[0], @$td{@f_good_td};
+ }
+ }
+ { local $" = '|';
+ $typedef_rex = qr(\b(?<!struct )(?:@good_td)\b);
+ }
+ %known_fnames = map @$_[1,3], @$fdecls_parsed; # [1,3] is NAME, FULLTEXT
+ if ($fmask) {
+ my @good;
+ for my $i (0..$#$fdecls_parsed) {
+ next unless $fdecls_parsed->[$i][1] =~ /$fmask/; # [1] is NAME
+ push @good, $i;
+ print "... Function $fdecls_parsed->[$i][1] passes -M mask.\n"
+ if $opt_d;
+ }
+ $fdecls = [@$fdecls[@good]];
+ $fdecls_parsed = [@$fdecls_parsed[@good]];
+ }
+ @fnames = sort map $_->[1], @$fdecls_parsed; # 1 is NAME
+ # Sort declarations:
+ {
+ my %h = map( ($_->[1], $_), @$fdecls_parsed);
+ $fdecls_parsed = [ @h{@fnames} ];
+ }
+ @fnames_no_prefix = @fnames;
+ @fnames_no_prefix
+ = sort map { ++$prefix{$_} if s/^$opt_p(?!\d)//; $_ } @fnames_no_prefix;
+ # Remove macros which expand to typedefs
+ print "Typedefs are @td.\n" if $opt_d;
+ my %td = map {($_, $_)} @td;
+ # Add some other possible but meaningless values for macros
+ for my $k (qw(char double float int long short unsigned signed void)) {
+ $td{"$_$k"} = "$_$k" for ('', 'signed ', 'unsigned ');
+ }
+ # eval {require 'dumpvar.pl'; ::dumpValue( [\@td, \%td] ); 1} or warn $@;
+ my $n = 0;
+ my %bad_macs;
+ while (keys %td > $n) {
+ $n = keys %td;
+ my ($k, $v);
+ while (($k, $v) = each %seen_define) {
+ # print("found '$k'=>'$v'\n"),
+ $bad_macs{$k} = $td{$k} = $td{$v} if exists $td{$v};
+ }
+ }
+ # Now %bad_macs contains names of bad macros
+ for my $k (keys %bad_macs) {
+ delete $const_names{$prefixless{$k}};
+ print "Ignoring macro $k which expands to a typedef name '$bad_macs{$k}'\n" if $opt_d;
}
}
}
+my @const_names = sort keys %const_names;
open(PM, ">$modfname.pm") || die "Can't create $ext$modpname/$modfname.pm: $!\n";
print PM <<"END";
package $module;
+require 5.005_62;
use strict;
END
$myISA .= ');';
print PM "\n$myISA\n\n";
+my @exported_names = (@const_names, @fnames_no_prefix);
+
print PM<<"END";
# Items to export into callers namespace by default. Note: do not export
# names by default without a very good reason. Use EXPORT_OK instead.
# Do not simply export all your public functions/methods/constants.
+
+# This allows declaration use $module ':all';
+# If you do not need this, moving things directly into \@EXPORT or \@EXPORT_OK
+# will save memory.
+our %EXPORT_TAGS = ( 'all' => [ qw(
+ @exported_names
+) ] );
+
+our \@EXPORT_OK = ( \@{ \$EXPORT_TAGS{'all'} } );
+
our \@EXPORT = qw(
@const_names
);
# to the AUTOLOAD in AutoLoader.
my \$constname;
- our $AUTOLOAD;
+ our \$AUTOLOAD;
(\$constname = \$AUTOLOAD) =~ s/.*:://;
croak "&$module::constant not defined" if \$constname eq 'constant';
my \$val = constant(\$constname, \@_ ? \$_[0] : 0);
goto &AutoLoader::AUTOLOAD;
}
else {
- croak "Your vendor has not defined $module macro \$constname";
+ croak "Your vendor has not defined $module macro \$constname";
+ }
+ }
+ {
+ no strict 'refs';
+ # Fixed between 5.005_53 and 5.005_61
+ if (\$] >= 5.00561) {
+ *\$AUTOLOAD = sub () { \$val };
+ }
+ else {
+ *\$AUTOLOAD = sub { \$val };
}
}
- no strict 'refs';
- *\$AUTOLOAD = sub () { \$val };
goto &\$AUTOLOAD;
}
END
}
+my $after;
if( $opt_P ){ # if POD is disabled
$after = '__END__';
}
__END__
END
-$author = "A. U. Thor";
-$email = 'a.u.thor@a.galaxy.far.far.away';
+my $author = "A. U. Thor";
+my $email = 'a.u.thor@a.galaxy.far.far.away';
my $revhist = '';
$revhist = <<EOT if $opt_C;
=item $TEMPLATE_VERSION
-Original version; created by h2xs $H2XS_VERSION
+Original version; created by h2xs $H2XS_VERSION with options
+
+ @ARGS
=back
EOT
-my $const_doc = '';
-my $fdecl_doc = '';
+my $exp_doc = <<EOD;
+
+=head2 EXPORT
+
+None by default.
+
+EOD
if (@const_names and not $opt_P) {
- $const_doc = <<EOD;
-\n=head2 Exported constants
+ $exp_doc .= <<EOD;
+=head2 Exportable constants
@{[join "\n ", @const_names]}
EOD
}
if (defined $fdecls and @$fdecls and not $opt_P) {
- $fdecl_doc = <<EOD;
-\n=head2 Exported functions
+ $exp_doc .= <<EOD;
+=head2 Exportable functions
+
+EOD
+ $exp_doc .= <<EOD if $opt_p;
+When accessing these functions from Perl, prefix C<$opt_p> should be removed.
- @{[join "\n ", @$fdecls]}
+EOD
+ $exp_doc .= <<EOD;
+ @{[join "\n ", @known_fnames{@fnames}]}
EOD
}
-$pod = <<"END" unless $opt_P;
-## Below is the stub of documentation for your module. You better edit it!
+my $pod = <<"END" unless $opt_P;
+## Below is stub documentation for your module. You better edit it!
#
#=head1 NAME
#
#
#=head1 DESCRIPTION
#
-#Stub documentation for $module was created by h2xs. It looks like the
+#Stub documentation for $module, created by h2xs. It looks like the
#author of the extension was negligent enough to leave the stub
#unedited.
#
#Blah blah blah.
-#$const_doc$fdecl_doc$revhist
+#$exp_doc$revhist
#=head1 AUTHOR
#
#$author, $email
END
if( @path_h ){
- foreach my $path_h (@path_h) {
+ foreach my $path_h (@path_h_ini) {
my($h) = $path_h;
$h =~ s#^/usr/include/##;
if ($^O eq 'VMS') { $h =~ s#.*vms\]#sys/# or $h =~ s#.*[:>\]]##; }
print XS "\n";
}
-if( ! $opt_c ){
-print XS <<"END";
-static int
-not_here(char *s)
+my %pointer_typedefs;
+my %struct_typedefs;
+
+sub td_is_pointer {
+ my $type = shift;
+ my $out = $pointer_typedefs{$type};
+ return $out if defined $out;
+ my $otype = $type;
+ $out = ($type =~ /\*$/);
+ # This converts only the guys which do not have trailing part in the typedef
+ if (not $out
+ and $typedef_rex and $type =~ s/($typedef_rex)/$typedefs_pre{$1}/go) {
+ $type = normalize_type($type);
+ print "Is-Pointer: Type mutation via typedefs: $otype ==> $type\n"
+ if $opt_d;
+ $out = td_is_pointer($type);
+ }
+ return ($pointer_typedefs{$otype} = $out);
+}
+
+sub td_is_struct {
+ my $type = shift;
+ my $out = $struct_typedefs{$type};
+ return $out if defined $out;
+ my $otype = $type;
+ $out = ($type =~ /^struct\b/) && !td_is_pointer($type);
+ # This converts only the guys which do not have trailing part in the typedef
+ if (not $out
+ and $typedef_rex and $type =~ s/($typedef_rex)/$typedefs_pre{$1}/go) {
+ $type = normalize_type($type);
+ print "Is-Struct: Type mutation via typedefs: $otype ==> $type\n"
+ if $opt_d;
+ $out = td_is_struct($type);
+ }
+ return ($struct_typedefs{$otype} = $out);
+}
+
+# Some macros will bomb if you try to return them from a double-returning func.
+# Say, ((char *)0), or strlen (if somebody #define STRLEN strlen).
+# Fortunately, we can detect both these cases...
+sub protect_convert_to_double {
+ my $in = shift;
+ my $val;
+ return '' unless defined ($val = $seen_define{$in});
+ return '(IV)' if $known_fnames{$val};
+ # OUT_t of ((OUT_t)-1):
+ return '' unless $val =~ /^\s*(\(\s*)?\(\s*([^()]*?)\s*\)/;
+ td_is_pointer($2) ? '(IV)' : '';
+}
+
+# For each of the generated functions, length($pref) leading
+# letters are already checked. Moreover, it is recommended that
+# the generated functions uses switch on letter at offset at least
+# $off + length($pref).
+#
+# The given list has length($pref) chars removed at front, it is
+# guarantied that $off leading chars in the rest are the same for all
+# elts of the list.
+#
+# Returns: how at which offset it was decided to make a switch, or -1 if none.
+
+sub write_const;
+
+sub write_const {
+ my ($fh, $pref, $off, $list) = (shift,shift,shift,shift);
+ my %leading;
+ my $offarg = length $pref;
+
+ if (@$list == 0) { # Can happen on the initial iteration only
+ print $fh <<"END";
+static double
+constant(char *name, int len, int arg)
{
- croak("$module::%s not implemented on this architecture", s);
+ errno = EINVAL;
+ return 0;
+}
+END
return -1;
+ }
+
+ if (@$list == 1) { # Can happen on the initial iteration only
+ my $protect = protect_convert_to_double("$pref$list->[0]");
+
+ print $fh <<"END";
+static double
+constant(char *name, int len, int arg)
+{
+ if (strEQ(name + $offarg, "$list->[0]")) { /* $pref removed */
+#ifdef $pref$list->[0]
+ return $protect$pref$list->[0];
+#else
+ errno = ENOENT;
+ return 0;
+#endif
+ }
+ errno = EINVAL;
+ return 0;
}
+END
+ return -1;
+ }
+
+ for my $n (@$list) {
+ my $c = substr $n, $off, 1;
+ $leading{$c} = [] unless exists $leading{$c};
+ push @{$leading{$c}}, substr $n, $off + 1;
+ }
+
+ if (keys(%leading) == 1) {
+ return 1 + write_const $fh, $pref, $off + 1, $list;
+ }
+ my $leader = substr $list->[0], 0, $off;
+ foreach my $letter (keys %leading) {
+ write_const $fh, "$pref$leader$letter", 0, $leading{$letter}
+ if @{$leading{$letter}} > 1;
+ }
+
+ my $npref = "_$pref";
+ $npref = '' if $pref eq '';
+
+ print $fh <<"END";
static double
-constant(char *name, int arg)
+constant$npref(char *name, int len, int arg)
{
errno = 0;
- switch (*name) {
END
-my(@AZ, @az, @under);
-
-foreach(@const_names){
- @AZ = 'A' .. 'Z' if !@AZ && /^[A-Z]/;
- @az = 'a' .. 'z' if !@az && /^[a-z]/;
- @under = '_' if !@under && /^_/;
-}
+ print $fh <<"END" if $off;
+ if ($offarg + $off >= len ) {
+ errno = EINVAL;
+ return 0;
+ }
+END
-foreach $letter (@AZ, @az, @under) {
+ print $fh <<"END";
+ switch (name[$offarg + $off]) {
+END
- last if $letter eq 'a' && !@const_names;
+ foreach my $letter (sort keys %leading) {
+ my $let = $letter;
+ $let = '\0' if $letter eq '';
- print XS " case '$letter':\n";
- my($name);
- while (substr($const_names[0],0,1) eq $letter) {
- $name = shift(@const_names);
- $macro = $prefix{$name} ? "$opt_p$name" : $name;
- next if $const_xsub{$macro};
- print XS <<"END";
- if (strEQ(name, "$name"))
-#ifdef $macro
- return $macro;
+ print $fh <<EOP;
+ case '$let':
+EOP
+ if (@{$leading{$letter}} > 1) {
+ # It makes sense to call a function
+ if ($off) {
+ print $fh <<EOP;
+ if (!strnEQ(name + $offarg,"$leader", $off))
+ break;
+EOP
+ }
+ print $fh <<EOP;
+ return constant_$pref$leader$letter(name, len, arg);
+EOP
+ }
+ else {
+ # Do it ourselves
+ my $protect
+ = protect_convert_to_double("$pref$leader$letter$leading{$letter}[0]");
+
+ print $fh <<EOP;
+ if (strEQ(name + $offarg, "$leader$letter$leading{$letter}[0]")) { /* $pref removed */
+#ifdef $pref$leader$letter$leading{$letter}[0]
+ return $protect$pref$leader$letter$leading{$letter}[0];
#else
goto not_there;
#endif
-END
+ }
+EOP
}
- print XS <<"END";
- break;
-END
-}
-print XS <<"END";
+ }
+ print $fh <<"END";
}
errno = EINVAL;
return 0;
}
END
+
}
+if( ! $opt_c ) {
+ print XS <<"END";
+static int
+not_here(char *s)
+{
+ croak("$module::%s not implemented on this architecture", s);
+ return -1;
+}
+
+END
+
+ write_const(\*XS, '', 0, \@const_names);
+}
+
+my $prefix;
$prefix = "PREFIX = $opt_p" if defined $opt_p;
+
# Now switch from C to XS by issuing the first MODULE declaration:
print XS <<"END";
CODE:
#ifdef $_
- RETVAL = $_;
+ RETVAL = $_;
#else
- croak("Your vendor has not defined the $module macro $_");
+ croak("Your vendor has not defined the $module macro $_");
#endif
OUTPUT:
- RETVAL
+ RETVAL
END
}
print XS <<"END" unless $opt_c;
double
-constant(name,arg)
- char * name
+constant(sv,arg)
+ PREINIT:
+ STRLEN len;
+ INPUT:
+ SV * sv
+ char * s = SvPV(sv, len);
int arg
+ CODE:
+ RETVAL = constant(s,len,arg);
+ OUTPUT:
+ RETVAL
END
my %seen_decl;
-
+my %typemap;
sub print_decl {
my $fh = shift;
return if $seen_decl{$name}++; # Need to do the same for docs as well?
my @argnames = map {$_->[1]} @$args;
- my @argtypes = map { normalize_type( $_->[0] ) } @$args;
+ my @argtypes = map { normalize_type( $_->[0], 1 ) } @$args;
my @argarrays = map { $_->[4] || '' } @$args;
my $numargs = @$args;
if ($numargs and $argtypes[-1] eq '...') {
$argnames[-1] = '...';
}
local $" = ', ';
- $type = normalize_type($type);
-
+ $type = normalize_type($type, 1);
+
print $fh <<"EOP";
$type
$name(@argnames)
EOP
- for $arg (0 .. $numargs - 1) {
+ for my $arg (0 .. $numargs - 1) {
print $fh <<"EOP";
$argtypes[$arg] $argnames[$arg]$argarrays[$arg]
EOP
my $stdtypemap = "$Config::Config{privlib}/ExtUtils/typemap";
unshift @tm, $stdtypemap;
my $proto_re = "[" . quotemeta('\$%&*@;') . "]" ;
- my $image;
-
- foreach $typemap (@tm) {
+
+ # Start with useful default values
+ $typemap{float} = 'T_DOUBLE';
+
+ foreach my $typemap (@tm) {
next unless -e $typemap ;
# skip directories, binary files etc.
warn " Scanning $typemap\n";
elsif (/^TYPEMAP\s*$/) { $mode = 'Typemap'; next; }
elsif ($mode eq 'Typemap') {
next if /^\s*($|\#)/ ;
- if ( ($type, $image) =
+ my ($type, $image);
+ if ( ($type, $image) =
/^\s*(.*?\S)\s+(\S+)\s*($proto_re*)\s*$/o
# This may reference undefined functions:
and not ($image eq 'T_PACKED' and $typemap eq $stdtypemap)) {
- normalize_type($type);
+ $typemap{normalize_type($type)} = $image;
}
}
}
}
-sub normalize_type {
- my $ignore_mods = '(?:\b(?:__const__|static|inline|__inline__)\b\s*)*';
+sub normalize_type { # Second arg: do not strip const's before \*
my $type = shift;
- $type =~ s/$ignore_mods//go;
- $type =~ s/([\]\[()])/ \1 /g;
- $type =~ s/\s+/ /g;
+ my $do_keep_deep_const = shift;
+ # If $do_keep_deep_const this is heuristical only
+ my $keep_deep_const = ($do_keep_deep_const ? '\b(?![^(,)]*\*)' : '');
+ my $ignore_mods
+ = "(?:\\b(?:(?:__const__|const)$keep_deep_const|static|inline|__inline__)\\b\\s*)*";
+ if ($do_keep_deep_const) { # Keep different compiled /RExen/o separately!
+ $type =~ s/$ignore_mods//go;
+ }
+ else {
+ $type =~ s/$ignore_mods//go;
+ }
+ $type =~ s/([^\s\w])/ \1 /g;
$type =~ s/\s+$//;
$type =~ s/^\s+//;
- $type =~ s/\b\*/ */g;
- $type =~ s/\*\b/* /g;
- $type =~ s/\*\s+(?=\*)/*/g;
+ $type =~ s/\s+/ /g;
+ $type =~ s/\* (?=\*)/*/g;
+ $type =~ s/\. \. \./.../g;
+ $type =~ s/ ,/,/g;
$types_seen{$type}++
unless $type eq '...' or $type eq 'void' or $std_types{$type};
$type;
}
+my $need_opaque;
+
+sub assign_typemap_entry {
+ my $type = shift;
+ my $otype = $type;
+ my $entry;
+ if ($tmask and $type =~ /$tmask/) {
+ print "Type $type matches -o mask\n" if $opt_d;
+ $entry = (td_is_struct($type) ? "T_OPAQUE_STRUCT" : "T_PTROBJ");
+ }
+ elsif ($typedef_rex and $type =~ s/($typedef_rex)/$typedefs_pre{$1}/go) {
+ $type = normalize_type $type;
+ print "Type mutation via typedefs: $otype ==> $type\n" if $opt_d;
+ $entry = assign_typemap_entry($type);
+ }
+ $entry ||= $typemap{$otype}
+ || (td_is_struct($type) ? "T_OPAQUE_STRUCT" : "T_PTROBJ");
+ $typemap{$otype} = $entry;
+ $need_opaque = 1 if $entry eq "T_OPAQUE_STRUCT";
+ return $entry;
+}
+
if ($opt_x) {
- for $decl (@$fdecls_parsed) { print_decl(\*XS, $decl) }
+ for my $decl (@$fdecls_parsed) { print_decl(\*XS, $decl) }
}
close XS;
warn "Writing $ext$modpname/typemap\n";
open TM, ">typemap" or die "Cannot open typemap file for write: $!";
- for $type (keys %types_seen) {
- print TM $type, "\t" x (6 - int((length $type)/8)), "T_PTROBJ\n"
+ for $type (sort keys %types_seen) {
+ my $entry = assign_typemap_entry $type;
+ print TM $type, "\t" x (5 - int((length $type)/8)), "\t$entry\n"
}
+ print TM <<'EOP' if $need_opaque; # Older Perls do not have correct entry
+#############################################################################
+INPUT
+T_OPAQUE_STRUCT
+ if (sv_derived_from($arg, \"${ntype}\")) {
+ STRLEN len;
+ char *s = SvPV((SV*)SvRV($arg), len);
+
+ if (len != sizeof($var))
+ croak(\"Size %d of packed data != expected %d\",
+ len, sizeof($var));
+ $var = *($type *)s;
+ }
+ else
+ croak(\"$var is not of type ${ntype}\")
+#############################################################################
+OUTPUT
+T_OPAQUE_STRUCT
+ sv_setref_pvn($arg, \"${ntype}\", (char *)&$var, sizeof($var));
+EOP
+
close TM or die "Cannot close typemap file for write: $!";
}
print PL " 'NAME' => '$module',\n";
print PL " 'VERSION_FROM' => '$modfname.pm', # finds \$VERSION\n";
if( ! $opt_X ){ # print C stuff, unless XS is disabled
+ $opt_F = '' unless defined $opt_F;
print PL " 'LIBS' => ['$extralibs'], # e.g., '-lm' \n";
- print PL " 'DEFINE' => '', # e.g., '-DHAVE_SOMETHING' \n";
+ print PL " 'DEFINE' => '$opt_F', # e.g., '-DHAVE_SOMETHING' \n";
print PL " 'INC' => '', # e.g., '-I/usr/include/other' \n";
}
print PL ");\n";
close(EX) || die "Can't close $ext$modpname/test.pl: $!\n";
unless ($opt_C) {
- warn "Writing $ext$modpname/Changes\n";
- open(EX, ">Changes") || die "Can't create $ext$modpname/Changes: $!\n";
- print EX "Revision history for Perl extension $module.\n\n";
- print EX "$TEMPLATE_VERSION ",scalar localtime,"\n";
- print EX "\t- original version; created by h2xs $H2XS_VERSION\n\n";
- close(EX) || die "Can't close $ext$modpname/Changes: $!\n";
+ warn "Writing $ext$modpname/Changes\n";
+ $" = ' ';
+ open(EX, ">Changes") || die "Can't create $ext$modpname/Changes: $!\n";
+ @ARGS = map {/[\s\"\'\`\$*?^|&<>\[\]\{\}\(\)]/ ? "'$_'" : $_} @ARGS;
+ print EX <<EOP;
+Revision history for Perl extension $module.
+
+$TEMPLATE_VERSION @{[scalar localtime]}
+\t- original version; created by h2xs $H2XS_VERSION with options
+\t\t@ARGS
+
+EOP
+ close(EX) || die "Can't close $ext$modpname/Changes: $!\n";
}
warn "Writing $ext$modpname/MANIFEST\n";
open(MANI,'>MANIFEST') or die "Can't create MANIFEST: $!";
-@files = <*>;
+my @files = <*>;
if (!@files) {
eval {opendir(D,'.');};
unless ($@) { @files = readdir(D); closedir(D); }
=head1 AUTHORS
Kenneth Albanowski (E<lt>kjahds@kjahds.comE<gt>), subsequently I<doc>tored
-by Gurusamy Sarathy (E<lt>gsar@umich.eduE<gt>), Tom Christiansen
+by Gurusamy Sarathy (E<lt>gsar@activestate.comE<gt>), Tom Christiansen
(E<lt>tchrist@perl.comE<gt>), Nathan Torkington (E<lt>gnat@frii.comE<gt>),
Charles F. Randall (E<lt>cfr@pobox.comE<gt>), Mike Guy
(E<lt>mjtg@cam.a.ukE<gt>), Dominic Dunlop (E<lt>domo@computer.orgE<gt>),
{
my ( $backend, $generated_file, $file, $final_output ) = @_;
my $return;
+ my $output_switch = "o";
local($") = " -I";
- open(GENFILE, "> $generated_file") || die "Can't open $generated_file: $!";
-
if ($backend eq "Bytecode")
{
require ByteLoader;
+ open(GENFILE, "> $generated_file") || die "Can't open $generated_file: $!";
+ binmode GENFILE;
print GENFILE "#!$^X\n" if @_ == 3;
print GENFILE "use ByteLoader $ByteLoader::VERSION;\n";
- }
+ close(GENFILE);
- close(GENFILE);
+ $output_switch ="a";
+ }
if (@_ == 3) # compiling a program
{
chomp $stash;
_print( "$^X -I@INC -MO=$backend,$stash $file\n", 36);
- $return = _run("$^X -I@INC -MO=$backend,$stash,-o$generated_file $file", 9);
+ $return = _run("$^X -I@INC -MO=$backend,$stash,-$output_switch$generated_file $file", 9);
$return;
}
else # compiling a shared object
_print(
"$^X -I@INC -MO=$backend,-m$final_output $file\n", 36);
$return =
- _run("$^X -I@INC -MO=$backend,-m$final_output,-o$generated_file $file ", 9);
+ _run("$^X -I@INC -MO=$backend,-m$final_output,-$output_switch$generated_file $file ", 9);
$return;
}
}
my $lperl = $^O eq 'os2' ? '-llibperl'
: $^O eq 'MSWin32' ? "$Config{archlibexp}\\CORE\\perl.lib"
: '-lperl';
+ ($lperl = $Config{libperl}) =~ s/lib(.*)\Q$Config{_a}\E/-l$1/
+ if($^O eq 'cygwin');
$optimize = $Config{'optimize'} =~ /-O\d/ ? '' : $Config{'optimize'};
}
my $libs = _getSharedObjects($sourceprog);
+ @$libs = grep { !(/DynaLoader\.a$/ && ($dynaloader = $_)) } @$libs
+ if($^O eq 'cygwin');
my $ccflags = $Config{ccflags};
- $ccflags .= ' -DUSEIMPORTLIB' if $Config{osname} =~ /cygwin/i;
+ $ccflags .= ' -DUSEIMPORTLIB' if $^O eq 'cygwin';
my $cccmd = "$Config{cc} $ccflags $optimize $incdir "
."@args $dynaloader $linkargs @$libs";
my $me = $0; # Editing $0 is unportable
$me =~ s,.*/,,;
die <<EOF;
-Usage: $me [-h] [-r] [-i] [-v] [-t] [-u] [-m] [-l] [-F] [-X] PageName|ModuleName|ProgramName
+Usage: $me [-h] [-r] [-i] [-v] [-t] [-u] [-m] [-n program] [-l] [-F] [-X] PageName|ModuleName|ProgramName
$me -f PerlFunc
$me -q FAQKeywords
(-t is the default on win32)
-u Display unformatted pod text
-m Display module's file in its entirety
+ -n Specify replacement for nroff
-l Display the module's file name
-F Arguments are file names, not modules
-v Verbosely describe what's going on
}
!NO!SUBS!
-my $getopts = "mhtluvriFf:Xq:";
+my $getopts = "mhtluvriFf:Xq:n:";
print OUT <<"!GET!OPTS!";
use vars qw( @{[map "\$opt_$_", ($getopts =~ /\w/g)]} );
print OUT <<'!NO!SUBS!';
usage if $opt_h;
+$opt_n = "nroff" if !$opt_n;
my $podidx;
if ($opt_X) {
sub check_file {
my($dir,$file) = @_;
+ return "" if length $dir and not -d $dir;
if ($opt_m) {
return minus_f_nocase($dir,$file);
}
$ret = check_file $dir,"$s.bat")
or ( $ret = check_file "$dir/pod","$s.pod")
or ( $ret = check_file "$dir/pod",$s)
+ or ( $ret = check_file "$dir/pods","$s.pod")
+ or ( $ret = check_file "$dir/pods",$s)
) {
return $ret;
}
close OUT;
}
elsif (not $opt_u) {
- my $cmd = "pod2man --lax $file | nroff -man";
+ my $cmd = "pod2man --lax $_ | $opt_n -man";
$cmd .= " | col -x" if $^O =~ /hpux/;
my $rslt = `$cmd`;
$rslt = filter_nroff($rslt) if $filter;
=cut
#
+# Version 1.15: Tue Aug 24 01:50:20 EST 1999
+# Charles Wilson <cwilson@ece.gatech.edu>
+# changed /pod/ directory to /pods/ for cygwin
+# to support cygwin/win32
# Version 1.14: Wed Jul 15 01:50:20 EST 1998
# Robin Barker <rmb1@cise.npl.co.uk>
# -strict, -w cleanups
# Version 1.13: Fri Feb 27 16:20:50 EST 1997
-# Gurusamy Sarathy <gsar@umich.edu>
+# Gurusamy Sarathy <gsar@activestate.com>
# -doc tweaks for -F and -X options
# Version 1.12: Sat Apr 12 22:41:09 EST 1997
-# Gurusamy Sarathy <gsar@umich.edu>
+# Gurusamy Sarathy <gsar@activestate.com>
# -various fixes for win32
# Version 1.11: Tue Dec 26 09:54:33 EST 1995
# Kenneth Albanowski <kjahds@kjahds.com>
!GROK!THIS!
# Descrip.MMS for perl5 on VMS
-# Last revised 18-Oct-1998 by Charles Bailey bailey@newman.upenn.edu
+# Last revised 8-Nov-1999 by Craig Berry craig.berry@metamor.com
+# Revised 18-Oct-1998 by Charles Bailey bailey@newman.upenn.edu
#
#: This file uses MMS syntax, and can be processed using DEC's MMS product,
#: or the free MMK clone (available by ftp at ftp.spc.edu). If you want to
obj1 = globals$(O) gv$(O) hv$(O) mg$(O) miniperlmain$(O) op$(O) perl$(O)
obj2 = perlio$(O) perly$(O) pp$(O) pp_ctl$(O) pp_hot$(O) pp_sys$(O)
obj3 = regcomp$(O) regexec$(O) run$(O) scope$(O) sockadapt$(O) sv$(O)
-obj4 = taint$(O) toke$(O) universal$(O) utf8$(O) util$(O) vms$(O)
+obj4 = taint$(O) toke$(O) universal$(O) utf8$(O) util$(O) vms$(O) xsutils$(O)
obj = $(obj0) $(obj1) $(obj2) $(obj3) $(obj4)
-h0 = $(SOCKH) av.h cc_runtime.h config.h cop.h cv.h embed.h embedvar.h
-h1 = extern.h $(THREADH) form.h gv.h handy.h hv.h intern.h intrpvar.h
-h2 = iperlsys.h keywords.h mg.h nostdio.h op.h opcode.h patchlevel.h perl.h
-h3 = perlio.h perlsdio.h perlvars.h perly.h pp.h pp_proto.h proto.h
-h4 = regcomp.h regexp.h regnodes.h scope.h sv.h thrdvar.h
-h5 = thread.h utf8.h util.h vmsish.h warnings.h xsub.h opnames.h
+h0 = $(SOCKH) $(THREADH) av.h cc_runtime.h config.h cop.h cv.h embed.h
+h1 = embedvar.h extern.h form.h gv.h handy.h hv.h intern.h intrpvar.h
+h2 = iperlsys.h mg.h nostdio.h objxsub.h op.h opcode.h opnames.h
+h3 = patchlevel.h perl.h perlio.h perlsdio.h perlvars.h perly.h pp.h
+h4 = pp_proto.h proto.h regexp.h scope.h sv.h thrdvar.h thread.h utf8.h
+h5 = util.h vmsish.h warnings.h xsub.h
+h6 = regcomp.h regcomp.h
+h7 = keywords.h
h = $(h0) $(h1) $(h2) $(h3) $(h4) $(h5)
+allh = $(h) $(h6) $(h7)
ac0 = $(SOCKARCH) $(ARCHCORE)av.h $(ARCHCORE)cc_runtime.h
ac1 = $(ARCHCORE)config.h $(ARCHCORE)cop.h $(ARCHCORE)cv.h $(ARCHCORE)embed.h
perlpods : $(pod1) $(pod2) $(pod3) $(pod4) $(pod5) $(pod6) $(pod7) $(pod8) [.lib.pod]perlvms.pod
@ $(NOOP)
-archcorefiles : $(ac1) $(ac2) $(ac3) $(ac4) $(ac5) $(ac6) $(ac7) $(ac8) $(ac9) $(ac10) $(acs) $(acth) $(ARCHAUTO)time.stamp
+archcorefiles : $(ac) $(acth) $(ARCHAUTO)time.stamp
@ $(NOOP)
miniperl : $(DBG)miniperl$(E)
$(DBG)libperl$(OLB) : $(obj)
@ If F$Search("$(MMS$TARGET)").eqs."" Then Library/Object/Create $(MMS$TARGET)
- Library/Object/Replace $(MMS$TARGET) $(obj1)
- Library/Object/Replace $(MMS$TARGET) $(obj2)
- Library/Object/Replace $(MMS$TARGET) $(obj3)
+ Library/Object/Replace $(MMS$TARGET) $(MMS$SOURCE_LIST)
perlmain.c : miniperlmain.c $(MINIPERL_EXE) [.vms]writemain.pl
$(MINIPERL) [.VMS]Writemain.pl "$(EXT)"
# The following files are built in one go by gen_shrfls.pl:
# perlshr_attr.opt, $(DBG)perlshr_bld.opt - VAX and AXP
# perlshr_gbl*.mar, perlshr_gbl*$(O) - VAX only
-# The song and dance with gen_shrfls.opt accomodates DCL's 255 character
+# The song and dance with gen_shrfls.opt accommodates DCL's 255 character
# line length limit.
.ifdef PIPES_BROKEN
# This is a backup target used only with older versions of the DECCRTL which
@ If F$Search("hash$(O)").nes."" Then Rename/NoLog hash$(O),str$(O),util$(O),walk$(O) [.x2p]
Link $(LINKFLAGS) /Exe=$(MMS$TARGET) $(MMS$SOURCE_LIST) $(CRTLOPTS)
-# Accomodate buggy cpp in some version of DECC, which chokes on illegal
+# Accommodate buggy cpp in some version of DECC, which chokes on illegal
# filespec "y.tab.c", and broken gcc cpp, which doesn't start #include ""
# search in same dir as source file
[.x2p]a2p$(O) : [.x2p]a2p.c [.x2p]a2py.c [.x2p]INTERN.h [.x2p]a2p.h [.x2p]hash.h [.x2p]str.h config.h handy.h vmsish.h $(SOCKH) $(MINIPERL_EXE)
.ifdef LINK_ONLY
.else
-perly$(O) : perly.c, perly.h, $(h)
+perly$(O) : perly.c, perly.h, $(allh)
.endif
[.t.lib]vmsfspec.t : [.vms.ext]filespec.t
# $(CC) $(CORECFLAGS) $(MMS$SOURCE)
# AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
.ifdef SOCKET
-$(SOCKOBJ) : $(SOCKC) extern.h perl.h config.h embed.h handy.h vmsish.h $(SOCKH) iperlsys.h perlsdio.h regexp.h sv.h util.h form.h gv.h cv.h op.h cop.h av.h hv.h mg.h scope.h warnings.h utf8.h perly.h thread.h pp.h proto.h pp_proto.h opcode.h opnames.h embedvar.h intrpvar.h thrdvar.h perlvars.h patchlevel.h
+$(SOCKOBJ) : $(SOCKC) $(h)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
.endif
-av$(O) : av.c extern.h perl.h config.h embed.h handy.h vmsish.h $(SOCKH) iperlsys.h perlsdio.h regexp.h sv.h util.h form.h gv.h cv.h op.h cop.h av.h hv.h mg.h scope.h warnings.h utf8.h perly.h thread.h pp.h proto.h pp_proto.h opcode.h opnames.h embedvar.h intrpvar.h thrdvar.h perlvars.h patchlevel.h
+av$(O) : av.c $(h)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
-deb$(O) : deb.c extern.h perl.h config.h embed.h handy.h vmsish.h $(SOCKH) iperlsys.h perlsdio.h regexp.h sv.h util.h form.h gv.h cv.h op.h cop.h av.h hv.h mg.h scope.h warnings.h utf8.h perly.h thread.h pp.h proto.h pp_proto.h opcode.h opnames.h embedvar.h intrpvar.h thrdvar.h perlvars.h patchlevel.h
+deb$(O) : deb.c $(h)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
-doio$(O) : doio.c extern.h perl.h config.h embed.h handy.h vmsish.h $(SOCKH) iperlsys.h perlsdio.h regexp.h sv.h util.h form.h gv.h cv.h op.h cop.h av.h hv.h mg.h scope.h warnings.h utf8.h perly.h thread.h pp.h proto.h pp_proto.h opcode.h opnames.h embedvar.h intrpvar.h thrdvar.h perlvars.h patchlevel.h
+doio$(O) : doio.c $(h)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
-doop$(O) : doop.c extern.h perl.h config.h embed.h handy.h vmsish.h $(SOCKH) iperlsys.h perlsdio.h regexp.h sv.h util.h form.h gv.h cv.h op.h cop.h av.h hv.h mg.h scope.h warnings.h utf8.h perly.h thread.h pp.h proto.h pp_proto.h opcode.h opnames.h embedvar.h intrpvar.h thrdvar.h perlvars.h patchlevel.h
+doop$(O) : doop.c $(h)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
-dump$(O) : dump.c extern.h perl.h config.h embed.h handy.h vmsish.h $(SOCKH) iperlsys.h perlsdio.h regexp.h sv.h util.h form.h gv.h cv.h op.h cop.h av.h hv.h mg.h scope.h warnings.h utf8.h perly.h thread.h pp.h proto.h pp_proto.h opcode.h opnames.h embedvar.h intrpvar.h thrdvar.h perlvars.h patchlevel.h regcomp.h regnodes.h
+dump$(O) : dump.c $(h) $(h6)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
-globals$(O) : globals.c intern.h perl.h config.h embed.h handy.h vmsish.h $(SOCKH) iperlsys.h perlsdio.h regexp.h sv.h util.h form.h gv.h cv.h op.h cop.h av.h hv.h mg.h scope.h warnings.h utf8.h perly.h thread.h pp.h proto.h pp_proto.h opcode.h opnames.h embedvar.h intrpvar.h thrdvar.h perlvars.h patchlevel.h
+globals$(O) : globals.c $(h)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
-gv$(O) : gv.c extern.h perl.h config.h embed.h handy.h vmsish.h $(SOCKH) iperlsys.h perlsdio.h regexp.h sv.h util.h form.h gv.h cv.h op.h cop.h av.h hv.h mg.h scope.h warnings.h utf8.h perly.h thread.h pp.h proto.h pp_proto.h opcode.h opnames.h embedvar.h intrpvar.h thrdvar.h perlvars.h patchlevel.h
+gv$(O) : gv.c $(h)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
-hv$(O) : hv.c extern.h perl.h config.h embed.h handy.h vmsish.h $(SOCKH) iperlsys.h perlsdio.h regexp.h sv.h util.h form.h gv.h cv.h op.h cop.h av.h hv.h mg.h scope.h warnings.h utf8.h perly.h thread.h pp.h proto.h pp_proto.h opcode.h opnames.h embedvar.h intrpvar.h thrdvar.h perlvars.h patchlevel.h
+hv$(O) : hv.c $(h)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
-mg$(O) : mg.c extern.h perl.h config.h embed.h handy.h vmsish.h $(SOCKH) iperlsys.h perlsdio.h regexp.h sv.h util.h form.h gv.h cv.h op.h cop.h av.h hv.h mg.h scope.h warnings.h utf8.h perly.h thread.h pp.h proto.h pp_proto.h opcode.h opnames.h embedvar.h intrpvar.h thrdvar.h perlvars.h patchlevel.h
+mg$(O) : mg.c $(h)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
-miniperlmain$(O) : miniperlmain.c extern.h perl.h config.h embed.h handy.h vmsish.h $(SOCKH) iperlsys.h perlsdio.h regexp.h sv.h util.h form.h gv.h cv.h op.h cop.h av.h hv.h mg.h scope.h warnings.h utf8.h perly.h thread.h pp.h proto.h pp_proto.h opcode.h opnames.h embedvar.h intrpvar.h thrdvar.h perlvars.h patchlevel.h
+miniperlmain$(O) : miniperlmain.c $(h)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
-op$(O) : op.c extern.h perl.h config.h embed.h handy.h vmsish.h $(SOCKH) iperlsys.h perlsdio.h regexp.h sv.h util.h form.h gv.h cv.h op.h cop.h av.h hv.h mg.h scope.h warnings.h utf8.h perly.h thread.h pp.h proto.h pp_proto.h opcode.h opnames.h embedvar.h intrpvar.h thrdvar.h perlvars.h patchlevel.h
+op$(O) : op.c $(h)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
-perl$(O) : perl.c extern.h perl.h config.h embed.h handy.h vmsish.h $(SOCKH) iperlsys.h perlsdio.h regexp.h sv.h util.h form.h gv.h cv.h op.h cop.h av.h hv.h mg.h scope.h warnings.h utf8.h perly.h thread.h pp.h proto.h pp_proto.h opcode.h opnames.h embedvar.h intrpvar.h thrdvar.h perlvars.h patchlevel.h intrpvar.h thrdvar.h
+perl$(O) : perl.c $(h)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
-perlio$(O) : perlio.c config.h extern.h perl.h config.h embed.h handy.h vmsish.h $(SOCKH) iperlsys.h perlsdio.h regexp.h sv.h util.h form.h gv.h cv.h op.h cop.h av.h hv.h mg.h scope.h warnings.h utf8.h perly.h thread.h pp.h proto.h pp_proto.h opcode.h opnames.h embedvar.h intrpvar.h thrdvar.h perlvars.h patchlevel.h
+perlio$(O) : perlio.c $(h)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
-perlmain$(O) : perlmain.c extern.h perl.h config.h embed.h handy.h vmsish.h $(SOCKH) iperlsys.h perlsdio.h regexp.h sv.h util.h form.h gv.h cv.h op.h cop.h av.h hv.h mg.h scope.h warnings.h utf8.h perly.h thread.h pp.h proto.h pp_proto.h opcode.h opnames.h embedvar.h intrpvar.h thrdvar.h perlvars.h patchlevel.h
+perlmain$(O) : perlmain.c $(h)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
-perly$(O) : perly.c extern.h perl.h config.h embed.h handy.h vmsish.h $(SOCKH) iperlsys.h perlsdio.h regexp.h sv.h util.h form.h gv.h cv.h op.h cop.h av.h hv.h mg.h scope.h warnings.h utf8.h perly.h thread.h pp.h proto.h pp_proto.h opcode.h opnames.h embedvar.h intrpvar.h thrdvar.h perlvars.h patchlevel.h
+perly$(O) : perly.c $(h)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
-pp$(O) : pp.c extern.h perl.h config.h embed.h handy.h vmsish.h $(SOCKH) iperlsys.h perlsdio.h regexp.h sv.h util.h form.h gv.h cv.h op.h cop.h av.h hv.h mg.h scope.h warnings.h utf8.h perly.h thread.h pp.h proto.h pp_proto.h opcode.h opnames.h embedvar.h intrpvar.h thrdvar.h perlvars.h patchlevel.h
+pp$(O) : pp.c $(h)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
-pp_ctl$(O) : pp_ctl.c extern.h perl.h config.h embed.h handy.h vmsish.h $(SOCKH) iperlsys.h perlsdio.h regexp.h sv.h util.h form.h gv.h cv.h op.h cop.h av.h hv.h mg.h scope.h warnings.h utf8.h perly.h thread.h pp.h proto.h pp_proto.h opcode.h opnames.h embedvar.h intrpvar.h thrdvar.h perlvars.h patchlevel.h
+pp_ctl$(O) : pp_ctl.c $(h)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
-pp_hot$(O) : pp_hot.c extern.h perl.h config.h embed.h handy.h vmsish.h $(SOCKH) iperlsys.h perlsdio.h regexp.h sv.h util.h form.h gv.h cv.h op.h cop.h av.h hv.h mg.h scope.h warnings.h utf8.h perly.h thread.h pp.h proto.h pp_proto.h opcode.h opnames.h embedvar.h intrpvar.h thrdvar.h perlvars.h patchlevel.h
+pp_hot$(O) : pp_hot.c $(h)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
-pp_sys$(O) : pp_sys.c extern.h perl.h config.h embed.h handy.h vmsish.h $(SOCKH) iperlsys.h perlsdio.h regexp.h sv.h util.h form.h gv.h cv.h op.h cop.h av.h hv.h mg.h scope.h warnings.h utf8.h perly.h thread.h pp.h proto.h pp_proto.h opcode.h opnames.h embedvar.h intrpvar.h thrdvar.h perlvars.h patchlevel.h
+pp_sys$(O) : pp_sys.c $(h)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
-regcomp$(O) : regcomp.c extern.h perl.h config.h embed.h handy.h vmsish.h $(SOCKH) iperlsys.h perlsdio.h regexp.h sv.h util.h form.h gv.h cv.h op.h cop.h av.h hv.h mg.h scope.h warnings.h utf8.h perly.h thread.h pp.h proto.h pp_proto.h opcode.h opnames.h embedvar.h intrpvar.h thrdvar.h perlvars.h patchlevel.h intern.h regcomp.h regnodes.h
+regcomp$(O) : regcomp.c $(h) $(h6)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
-regexec$(O) : regexec.c extern.h perl.h config.h embed.h handy.h vmsish.h $(SOCKH) iperlsys.h perlsdio.h regexp.h sv.h util.h form.h gv.h cv.h op.h cop.h av.h hv.h mg.h scope.h warnings.h utf8.h perly.h thread.h pp.h proto.h pp_proto.h opcode.h opnames.h embedvar.h intrpvar.h thrdvar.h perlvars.h patchlevel.h regcomp.h regnodes.h
+regexec$(O) : regexec.c $(h) $(h6)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
-run$(O) : run.c extern.h perl.h config.h embed.h handy.h vmsish.h $(SOCKH) iperlsys.h perlsdio.h regexp.h sv.h util.h form.h gv.h cv.h op.h cop.h av.h hv.h mg.h scope.h warnings.h utf8.h perly.h thread.h pp.h proto.h pp_proto.h opcode.h opnames.h embedvar.h intrpvar.h thrdvar.h perlvars.h patchlevel.h
+run$(O) : run.c $(h)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
-scope$(O) : scope.c extern.h perl.h config.h embed.h handy.h vmsish.h $(SOCKH) iperlsys.h perlsdio.h regexp.h sv.h util.h form.h gv.h cv.h op.h cop.h av.h hv.h mg.h scope.h warnings.h utf8.h perly.h thread.h pp.h proto.h pp_proto.h opcode.h opnames.h embedvar.h intrpvar.h thrdvar.h perlvars.h patchlevel.h
+scope$(O) : scope.c $(h)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
-sv$(O) : sv.c extern.h perl.h config.h embed.h handy.h vmsish.h $(SOCKH) iperlsys.h perlsdio.h regexp.h sv.h util.h form.h gv.h cv.h op.h cop.h av.h hv.h mg.h scope.h warnings.h utf8.h perly.h thread.h pp.h proto.h pp_proto.h opcode.h opnames.h embedvar.h intrpvar.h thrdvar.h perlvars.h patchlevel.h
+sv$(O) : sv.c $(h)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
-taint$(O) : taint.c extern.h perl.h config.h embed.h handy.h vmsish.h $(SOCKH) iperlsys.h perlsdio.h regexp.h sv.h util.h form.h gv.h cv.h op.h cop.h av.h hv.h mg.h scope.h warnings.h utf8.h perly.h thread.h pp.h proto.h pp_proto.h opcode.h opnames.h embedvar.h intrpvar.h thrdvar.h perlvars.h patchlevel.h
+taint$(O) : taint.c $(h)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
-toke$(O) : toke.c extern.h perl.h config.h embed.h handy.h vmsish.h $(SOCKH) iperlsys.h perlsdio.h regexp.h sv.h util.h form.h gv.h cv.h op.h cop.h av.h hv.h mg.h scope.h warnings.h utf8.h perly.h thread.h pp.h proto.h pp_proto.h opcode.h opnames.h embedvar.h intrpvar.h thrdvar.h perlvars.h patchlevel.h keywords.h
+toke$(O) : toke.c $(h) $(h7)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
-universal$(O) : universal.c extern.h perl.h config.h embed.h handy.h vmsish.h $(SOCKH) iperlsys.h perlsdio.h regexp.h sv.h util.h form.h gv.h cv.h op.h cop.h av.h hv.h mg.h scope.h warnings.h utf8.h perly.h thread.h pp.h proto.h pp_proto.h opcode.h opnames.h embedvar.h intrpvar.h thrdvar.h perlvars.h patchlevel.h xsub.h
+universal$(O) : universal.c $(h)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
-utf8$(O) : utf8.c extern.h perl.h config.h embed.h handy.h vmsish.h $(SOCKH) iperlsys.h perlsdio.h regexp.h sv.h util.h form.h gv.h cv.h op.h cop.h av.h hv.h mg.h scope.h warnings.h utf8.h perly.h thread.h pp.h proto.h pp_proto.h opcode.h opnames.h embedvar.h intrpvar.h thrdvar.h perlvars.h patchlevel.h
+utf8$(O) : utf8.c $(h)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
-util$(O) : util.c extern.h perl.h config.h embed.h handy.h vmsish.h $(SOCKH) iperlsys.h perlsdio.h regexp.h sv.h util.h form.h gv.h cv.h op.h cop.h av.h hv.h mg.h scope.h warnings.h utf8.h perly.h thread.h pp.h proto.h pp_proto.h opcode.h opnames.h embedvar.h intrpvar.h thrdvar.h perlvars.h patchlevel.h
+util$(O) : util.c $(h)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
-vms$(O) : vms.c extern.h perl.h config.h embed.h handy.h vmsish.h $(SOCKH) iperlsys.h perlsdio.h regexp.h sv.h util.h form.h gv.h cv.h op.h cop.h av.h hv.h mg.h scope.h warnings.h utf8.h perly.h thread.h pp.h proto.h pp_proto.h opcode.h opnames.h embedvar.h intrpvar.h thrdvar.h perlvars.h patchlevel.h xsub.h
+vms$(O) : vms.c $(h)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
[.x2p]hash$(O) : [.x2p]hash.c [.x2p]EXTERN.h [.x2p]a2p.h [.x2p]hash.h [.x2p]str.h [.x2p]util.h config.h handy.h vmsish.h $(SOCKH)
struct ysv *ysave;
New(73, ysave, 1, struct ysv);
- SAVEDESTRUCTOR(yydestruct, ysave);
+ SAVEDESTRUCTOR_X(yydestruct, ysave);
ysave->oldyydebug = yydebug;
ysave->oldyynerrs = yynerrs;
ysave->oldyyerrflag = yyerrflag;
break;
case 22:
#line 203 "perly.y"
-{ yyval.opval = scope(yyvsp[0].opval); }
+{ (yyvsp[0].opval)->op_flags |= OPf_PARENS; yyval.opval = scope(yyvsp[0].opval); }
break;
case 23:
#line 205 "perly.y"
#line 338 "perly.y"
{ STRLEN n_a; char *name = SvPV(((SVOP*)yyvsp[0].opval)->op_sv,n_a);
if (strEQ(name, "BEGIN") || strEQ(name, "END")
- || strEQ(name, "INIT"))
+ || strEQ(name, "STOP") || strEQ(name, "INIT"))
CvSPECIAL_on(PL_compcv);
yyval.opval = yyvsp[0].opval; }
break;
}
#ifdef PERL_OBJECT
-#define NO_XSLOCKS
#include "XSUB.h"
#endif
$ if "''myname'" .eqs. "" THEN myname = f$trnlnm("SYS$NODE")
$!
$! ##ADD NEW CONSTANTS HERE##
+$ perl_d_fs_data_s = "undef"
+$ perl_d_getmnt = "undef"
+$ perl_d_sqrtl = "define"
+$ perl_d_statfs_f_flags = "undef"
+$ perl_d_statfs_s = "undef"
+$ perl_d_ustat = "undef"
+$ perl_i_sysstatfs = "undef"
+$ perl_i_sysvfs = "undef"
+$ perl_i_ustat = "undef"
$ perl_d_llseek="undef"
$ perl_d_madvise="undef"
$ perl_selectminbits=32
$ IF use_64bit .eqs. "Y"
$ THEN
$ perl_use64bits = "define"
+$ perl_uselargefiles = "define"
+$ perl_uselongdouble = "define"
+$ perl_usemorebits = "define"
$ ELSE
$ perl_use64bits = "undef"
+$ perl_uselargefiles = "undef"
+$ perl_uselongdouble = "undef"
+$ perl_usemorebits = "undef"
$ ENDIF
$ perl_d_drand48proto = "define"
$ perl_libpth="/sys$share /sys$library"
$ perl_d_union_semun="undef"
$ perl_d_semctl_semun="undef"
$ perl_d_semctl_semid_ds="undef"
-$ IF (sharedperl.EQS."Y")
+$ IF (sharedperl.EQS."Y" .AND. F$GETSYI("HW_MODEL").GE.1024)
$ THEN
$ perl_obj_ext=".abj"
$ perl_so="axe"
$ perl_sPRIu64 = """Lu"""
$ perl_sPRIo64 = """Lo"""
$ perl_sPRIx64 = """Lx"""
+$ perl_d_quad = "define"
+$ perl_quadtype = "long long"
+$ perl_uquadtype = "unsigned long long"
$ ELSE
$ perl_d_PRIfldbl = "undef"
$ perl_d_PRIgldbl = "undef"
$ perl_sPRIu64 = ""
$ perl_sPRIo64 = ""
$ perl_sPRIx64 = ""
+$ perl_d_quad = "undef"
$ ENDIF
$!
-$!
$! Now some that we build up
$!
$ LocalTime = f$time()
$ OPEN/READ TEMPOUT [-.uu]tempout.lis
$ READ TEMPOUT line
$ CLOSE TEMPOUT
+$ DELETE/NOLOG [-.uu]tempout.lis;
$
$ perl_cpp_stuff=line
$ WRITE_RESULT "cpp_stuff is ''perl_cpp_stuff'"
$ else
$ link temp.obj
$ endif
-$! link temp.obj
$ OPEN/WRITE TEMPOUT [-.uu]tempout.lis
$ DEASSIGN SYS$OUTPUT
$ DEASSIGN SYS$ERROR
$ OPEN/READ TEMPOUT [-.uu]tempout.lis
$ READ TEMPOUT line
$ CLOSE TEMPOUT
+$ DELETE/NOLOG [-.uu]tempout.lis;
$
$ perl_doublesize=line
$ WRITE_RESULT "doublesize is ''perl_doublesize'"
$ OPEN/READ TEMPOUT [-.uu]tempout.lis
$ READ TEMPOUT line
$ CLOSE TEMPOUT
+$ DELETE/NOLOG [-.uu]tempout.lis;
$
$ perl_longdblsize=line
$ perl_d_longdbl="define"
$ OPEN/READ TEMPOUT [-.uu]tempout.lis
$ READ TEMPOUT line
$ CLOSE TEMPOUT
-$
+$ DELETE/NOLOG [-.uu]tempout.lis;
$ perl_longlongsize=line
$ perl_d_longlong="define"
$ ENDIF
$ WRITE_RESULT "longlongsize is ''perl_longlongsize'"
$ WRITE_RESULT "d_longlong is ''perl_d_longlong'"
$!
-$! Check for int size
-$!
-$ OS
-$ WS "#ifdef __DECC
-$ WS "#include <stdlib.h>
-$ WS "#endif
-$ WS "#include <stdio.h>
-$ WS "int main()
-$ WS "{"
-$ WS "printf(""%d\n"", sizeof(int));
-$ WS "exit(0);
-$ WS "}"
-$ CS
-$ DEFINE SYS$ERROR _NLA0:
-$ DEFINE SYS$OUTPUT _NLA0:
-$ on error then continue
-$ on warning then continue
-$ 'Checkcc' temp.c
-$ If (Needs_Opt.eqs."Yes")
-$ THEN
-$ link temp.obj,temp.opt/opt
-$ else
-$ link temp.obj
-$ endif
-$ If (Needs_Opt.eqs."Yes")
-$ THEN
-$ link temp.obj,temp.opt/opt
-$ else
-$ link temp.obj
-$ endif
-$ OPEN/WRITE TEMPOUT [-.uu]tempout.lis
-$ DEASSIGN SYS$OUTPUT
-$ DEASSIGN SYS$ERROR
-$ DEFINE SYS$ERROR TEMPOUT
-$ DEFINE SYS$OUTPUT TEMPOUT
-$ mcr []temp
-$ CLOSE TEMPOUT
-$ DEASSIGN SYS$OUTPUT
-$ DEASSIGN SYS$ERROR
-$ OPEN/READ TEMPOUT [-.uu]tempout.lis
-$ READ TEMPOUT line
-$ CLOSE TEMPOUT
-$
-$ perl_intsize=line
-$ WRITE_RESULT "intsize is ''perl_intsize'"
-$!
-$! Check for short size
-$!
-$ OS
-$ WS "#ifdef __DECC
-$ WS "#include <stdlib.h>
-$ WS "#endif
-$ WS "#include <stdio.h>
-$ WS "int main()
-$ WS "{"
-$ WS "printf(""%d\n"", sizeof(short));
-$ WS "exit(0);
-$ WS "}"
-$ CS
-$ DEFINE SYS$ERROR _NLA0:
-$ DEFINE SYS$OUTPUT _NLA0:
-$ on error then continue
-$ on warning then continue
-$ 'Checkcc' temp.c
-$ If (Needs_Opt.eqs."Yes")
-$ THEN
-$ link temp.obj,temp.opt/opt
-$ else
-$ link temp.obj
-$ endif
-$ OPEN/WRITE TEMPOUT [-.uu]tempout.lis
-$ DEASSIGN SYS$OUTPUT
-$ DEASSIGN SYS$ERROR
-$ DEFINE SYS$ERROR TEMPOUT
-$ DEFINE SYS$OUTPUT TEMPOUT
-$ mcr []temp
-$ CLOSE TEMPOUT
-$ DEASSIGN SYS$OUTPUT
-$ DEASSIGN SYS$ERROR
-$ OPEN/READ TEMPOUT [-.uu]tempout.lis
-$ READ TEMPOUT line
-$ CLOSE TEMPOUT
-$
-$ perl_shortsize=line
-$ WRITE_RESULT "shortsize is ''perl_shortsize'"
-$!
-$! Check for long size
-$!
-$ OS
-$ WS "#ifdef __DECC
-$ WS "#include <stdlib.h>
-$ WS "#endif
-$ WS "#include <stdio.h>
-$ WS "int main()
-$ WS "{"
-$ WS "int foo;
-$ WS "foo = sizeof(long);
-$ WS "printf(""%d\n"", foo);
-$ WS "exit(0);
-$ WS "}"
-$ CS
-$ DEFINE SYS$ERROR _NLA0:
-$ DEFINE SYS$OUTPUT _NLA0:
-$ on error then continue
-$ on warning then continue
-$ 'Checkcc' temp.c
-$ If (Needs_Opt.eqs."Yes")
-$ THEN
-$ link temp.obj,temp.opt/opt
-$ else
-$ link temp.obj
-$ endif
-$ OPEN/WRITE TEMPOUT [-.uu]tempout.lis
-$ DEASSIGN SYS$OUTPUT
-$ DEASSIGN SYS$ERROR
-$ DEFINE SYS$ERROR TEMPOUT
-$ DEFINE SYS$OUTPUT TEMPOUT
-$ mcr []temp
-$ CLOSE TEMPOUT
-$ DEASSIGN SYS$OUTPUT
-$ DEASSIGN SYS$ERROR
-$ OPEN/READ TEMPOUT [-.uu]tempout.lis
-$ READ TEMPOUT line
-$ CLOSE TEMPOUT
-$
-$ perl_longsize=line
-$ WRITE_RESULT "longsize is ''perl_longsize'"
-$!
$! Check the prototype for getgid
$!
$ OS
$ WS "exit(0);
$ WS "}"
$ CS
-$! copy temp.c sys$output
-$!
-$ DEFINE SYS$ERROR _NLA0:
-$ DEFINE SYS$OUTPUT _NLA0:
-$ ON ERROR THEN CONTINUE
-$ ON WARNING THEN CONTINUE
-$ 'Checkcc' temp.c
-$ If (Needs_Opt.eqs."Yes")
-$ THEN
-$ link temp.obj,temp.opt/opt
-$ else
-$ link temp.obj
-$ endif
-$ OPEN/WRITE TEMPOUT [-.uu]tempout.lis
-$ DEASSIGN SYS$OUTPUT
-$ DEASSIGN SYS$ERROR
-$ DEFINE SYS$ERROR TEMPOUT
-$ DEFINE SYS$OUTPUT TEMPOUT
-$ mcr []temp
-$ CLOSE TEMPOUT
-$ DEASSIGN SYS$OUTPUT
-$ DEASSIGN SYS$ERROR
-$ OPEN/READ TEMPOUT [-.uu]tempout.lis
-$ READ TEMPOUT line
-$ CLOSE TEMPOUT
+$ DEFINE SYS$ERROR _NLA0:
+$ DEFINE SYS$OUTPUT _NLA0:
+$ ON ERROR THEN CONTINUE
+$ ON WARNING THEN CONTINUE
+$ 'Checkcc' temp.c
+$ If (Needs_Opt.eqs."Yes")
+$ THEN
+$ link temp.obj,temp.opt/opt
+$ ELSE
+$ link temp.obj
+$ ENDIF
+$ OPEN/WRITE TEMPOUT [-.uu]tempout.lis
+$ DEASSIGN SYS$OUTPUT
+$ DEASSIGN SYS$ERROR
+$ DEFINE SYS$ERROR TEMPOUT
+$ DEFINE SYS$OUTPUT TEMPOUT
+$ mcr []temp.exe
+$ CLOSE TEMPOUT
+$ DEASSIGN SYS$OUTPUT
+$ DEASSIGN SYS$ERROR
+$ OPEN/READ TEMPOUT [-.uu]tempout.lis
+$ READ TEMPOUT line
+$ CLOSE TEMPOUT
+$ DELETE/NOLOG [-.uu]tempout.lis;
$
$ perl_ptrsize=line
$ WRITE_RESULT "ptrsize is ''perl_ptrsize'"
$!
-$!
$! Check rand48 and its ilk
$!
$ OS
$ WS "exit(0);
$ WS "}"
$ CS
-$! copy temp.c sys$output
$!
$ DEFINE SYS$ERROR _NLA0:
$ DEFINE SYS$OUTPUT _NLA0:
$ perl_vms_cc_type="vaxc"
$ ENDIF
$!
-$!
$! Sockets?
$ if ("''Has_Socketshr'".EQS."T").OR.("''Has_Dec_C_Sockets'".EQS."T")
$ THEN
$ perl_d_pthreads_created_joinable="undef"
$ ENDIF
$!
+$! new (5.005_62++) typedefs for primitives
+$!
+$ perl_ivtype="long"
+$ perl_uvtype="unsigned long"
+$ perl_i8type="char"
+$ perl_u8type="unsigned char"
+$ perl_i16type="short"
+$ perl_u16type="unsigned short"
+$ perl_i32type="int"
+$ perl_u32type="unsigned int"
+$ perl_i64type="long"
+$ perl_u64type="unsigned long"
+$ perl_nvtype="double"
+$!
+$ GOTO beyond_type_size_check
+$!
+$type_size_check:
+$!
+$! Check for type sizes
+$!
+$ OS
+$ WS "#ifdef __DECC
+$ WS "#include <stdlib.h>
+$ WS "#endif
+$ WS "#include <stdio.h>
+$ WS "int main()
+$ WS "{"
+$ WS "printf(""%d\n"", sizeof(''type'));"
+$ WS "exit(0);
+$ WS "}"
+$ CS
+$ DEFINE SYS$ERROR _NLA0:
+$ DEFINE SYS$OUTPUT _NLA0:
+$ ON ERROR THEN CONTINUE
+$ ON WARNING THEN CONTINUE
+$ 'Checkcc' temp.c
+$ If (Needs_Opt.eqs."Yes")
+$ THEN
+$ link temp.obj,temp.opt/opt
+$ ELSE
+$ link temp.obj
+$ ENDIF
+$ OPEN/WRITE TEMPOUT [-.uu]tempout.lis
+$ DEASSIGN SYS$OUTPUT
+$ DEASSIGN SYS$ERROR
+$ DEFINE SYS$ERROR TEMPOUT
+$ DEFINE SYS$OUTPUT TEMPOUT
+$ mcr []temp.exe
+$ CLOSE TEMPOUT
+$ DEASSIGN SYS$OUTPUT
+$ DEASSIGN SYS$ERROR
+$ OPEN/READ TEMPOUT [-.uu]tempout.lis
+$ READ TEMPOUT line
+$ CLOSE TEMPOUT
+$ DELETE/NOLOG [-.uu]tempout.lis;
+$ WRITE_RESULT "''size_name' is ''line'"
+$ DS
+$ RETURN
+$!
+$beyond_type_size_check:
+$!
+$ line = ""
+$ type = "''perl_ivtype'"
+$ size_name = "ivsize"
+$ gosub type_size_check
+$ perl_ivsize="''line'"
+$ IF type .eqs. "long"
+$ THEN perl_longsize = "''line'"
+$ ELSE
+$ type = "long"
+$ size_name = "longsize"
+$ gosub type_size_check
+$ perl_longsize="''line'"
+$ ENDIF
+$
+$ type = "''perl_uvtype'"
+$ size_name = "uvsize"
+$ gosub type_size_check
+$ perl_uvsize="''line'"
+$
+$ type = "''perl_i8type'"
+$ size_name = "i8size"
+$ gosub type_size_check
+$ perl_i8size="''line'"
+$
+$ type = "''perl_u8type'"
+$ size_name = "u8size"
+$ gosub type_size_check
+$ perl_u8size="''line'"
+$
+$ type = "''perl_i16type'"
+$ size_name = "i16size"
+$ gosub type_size_check
+$ perl_i16size="''line'"
+$ IF type .eqs. "short"
+$ THEN perl_shortsize="''line'"
+$ ELSE
+$ type = "''perl_i16type'"
+$ size_name = "shortsize"
+$ gosub type_size_check
+$ perl_shortsize="''line'"
+$ ENDIF
+$
+$ type = "''perl_u16type'"
+$ size_name = "u16size"
+$ gosub type_size_check
+$ perl_u16size="''line'"
+$
+$ type = "''perl_i32type'"
+$ size_name = "i32size"
+$ gosub type_size_check
+$ perl_i32size="''line'"
+$ IF type .eqs. "int"
+$ THEN perl_intsize="''perl_i32size'"
+$ ELSE
+$ type = "int"
+$ size_name = "intsize"
+$ gosub type_size_check
+$ perl_intsize="''line'"
+$ ENDIF
+$
+$ type = "''perl_u32type'"
+$ size_name = "u32size"
+$ gosub type_size_check
+$ perl_u32size="''line'"
+$
+$ type = "''perl_i64type'"
+$ size_name = "i64size"
+$ gosub type_size_check
+$ perl_i64size="''line'"
+$
+$ type = "''perl_u64type'"
+$ size_name = "u64size"
+$ gosub type_size_check
+$ perl_u64size="''line'"
+$!
+$ perl_ivdformat="""ld"""
+$ perl_uvuformat="""lu"""
+$ perl_uvoformat="""lo"""
+$ perl_uvxformat="""lx"""
$!
$! Finally the composite ones. All config
$ perl_installarchlib="''perl_prefix':[lib.''perl_arch'.''localperlver']"
$ WC "d_longdbl='" + perl_d_longdbl + "'"
$ WC "longdblsize='" + perl_longdblsize + "'"
$ WC "d_longlong='" + perl_d_longlong + "'"
+$ WC "uselonglong='" + perl_d_longlong + "'"
$ WC "longlongsize='" + perl_longlongsize + "'"
$ WC "d_mkstemp='" + perl_d_mkstemp + "'"
$ WC "d_setvbuf='" + perl_d_setvbuf + "'"
$ WC "sPRIo64='" + perl_sPRIo64 + "'"
$ WC "sPRIx64='" + perl_sPRIx64 + "'"
$ WC "d_llseek='" + perl_d_llseek + "'"
+$ WC "uselargefiles='" + perl_uselargefiles + "'"
+$ WC "uselongdouble='" + perl_uselongdouble + "'"
+$ WC "usemorebits='" + perl_usemorebits + "'"
+$ WC "d_quad='" + perl_d_quad + "'"
+$ if (use_64bit .eqs. "Y")
+$ THEN
+$ WC "quadtype='" + perl_quadtype + "'"
+$ WC "uquadtype='" + perl_uquadtype + "'"
+$ ENDIF
+$ WC "d_fs_data_s='" + perl_d_fs_data_s + "'"
+$ WC "d_getmnt='" + perl_d_getmnt + "'"
+$ WC "d_sqrtl='" + perl_d_sqrtl + "'"
+$ WC "d_statfs_f_flags='" + perl_d_statfs_f_flags + "'"
+$ WC "d_statfs_s='" + perl_d_statfs_s + "'"
+$ WC "d_ustat='" + perl_d_ustat + "'"
+$ WC "i_sysstatfs='" + perl_i_sysstatfs + "'"
+$ WC "i_sysvfs='" + perl_i_sysvfs + "'"
+$ WC "i_ustat='" + perl_i_ustat + "'"
+$ WC "ivtype='" + perl_ivtype + "'"
+$ WC "uvtype='" + perl_uvtype + "'"
+$ WC "i8type='" + perl_i8type + "'"
+$ WC "i16type='" + perl_i16type + "'"
+$ WC "u8type='" + perl_u8type + "'"
+$ WC "u16type='" + perl_u16type + "'"
+$ WC "i32type='" + perl_i32type + "'"
+$ WC "u32type='" + perl_u32type + "'"
+$ WC "i64type='" + perl_i64type + "'"
+$ WC "u64type='" + perl_u64type + "'"
+$ WC "nvtype='" + perl_nvtype + "'"
+$ WC "ivsize='" + perl_ivsize + "'"
+$ WC "uvsize='" + perl_uvsize + "'"
+$ WC "i8size='" + perl_i8size + "'"
+$ WC "u8size='" + perl_u8size + "'"
+$ WC "i16size='" + perl_i16size + "'"
+$ WC "u16size='" + perl_u16size + "'"
+$ WC "i32size='" + perl_i32size + "'"
+$ WC "u32size='" + perl_u32size + "'"
+$ WC "i64size='" + perl_i64size + "'"
+$ WC "u64size='" + perl_u64size + "'"
+$ WC "ivdformat='" + perl_ivdformat + "'"
+$ WC "uvuformat='" + perl_uvuformat + "'"
+$ WC "uvoformat='" + perl_uvoformat + "'"
+$ WC "uvxformat='" + perl_uvxformat + "'"
$!
$! ##WRITE NEW CONSTANTS HERE##
$!
$ WRITE CONFIG "#define USE_LONG_DOUBLE"
$ ENDIF
$ WRITE CONFIG "#define HAS_ENVGETENV"
+$ WRITE CONFIG "#define PERL_EXTERNAL_GLOB"
$ CLOSE CONFIG
$!
$! Now build the normal config.h
$ Create Sys$Disk:[-]Build_Ext.Com
$ Deck/Dollar="$EndOfTpl$"
$!++ Build_Ext.Com
-$! NOTE: This files is extracted as part of the VMS configuration process.
+$! NOTE: This file is extracted as part of the VMS configuration process.
$! Any changes made to it directly will be lost. If you need to make any
$! changes, please edit the template in [.vms]SubConfigure.Com instead.
$ def = F$Environment("Default")
/* Do this via $Check_Access on VMS, since the CRTL stat() returns only a
* subset of the applicable information.
*/
-/*{{{I32 cando(I32 bit, I32 effective, struct stat *statbufp)*/
-I32
-Perl_cando(pTHX_ I32 bit, I32 effective, Stat_t *statbufp)
+bool
+Perl_cando(pTHX_ Mode_t bit, Uid_t effective, Stat_t *statbufp)
{
if (statbufp == &PL_statcache) return cando_by_name(bit,effective,namecache);
else {
/*}}}*/
-/*{{{I32 cando_by_name(I32 bit, I32 effective, char *fname)*/
+/*{{{I32 cando_by_name(I32 bit, Uid_t effective, char *fname)*/
I32
-cando_by_name(I32 bit, I32 effective, char *fname)
+cando_by_name(I32 bit, Uid_t effective, char *fname)
{
static char usrname[L_cuserid];
static struct dsc$descriptor_s usrdsc =
#define HAS_KILL
#define HAS_WAIT
+#define PERL_FS_VER_FMT "%d_%d_%d"
+
/* VMS:
* This symbol, if defined, indicates that the program is running under
* VMS. It's a symbol automagically defined by all VMS C compilers I've seen.
int my_sigismember (sigset_t *, int);
int my_sigprocmask (int, sigset_t *, sigset_t *);
#endif
-I32 cando_by_name (I32, I32, char *);
+I32 cando_by_name (I32, Uid_t, char *);
int flex_fstat (int, Stat_t *);
int flex_stat (const char *, Stat_t *);
int trim_unixpath (char *, char*, int);
#undef HAS_NTOHL
#endif
-#define TMPPATH "sys$scratch:perl-eXXXXXX"
-
#endif /* __vmsish_h_included */
#ifndef SIGILL
# define SIGILL 6 /* blech */
#endif
-#define ABORT() kill(getpid(),SIGABRT);
+#define ABORT() kill(PerlProc_getpid(),SIGABRT);
/*
* fwrite1() should be a routine with the same calling sequence as fwrite(),
+++ /dev/null
-/* !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
- This file is built by warning.pl
- Any changes made here will be lost!
-*/
-
-
-#define Off(x) ((x) / 8)
-#define Bit(x) (1 << ((x) % 8))
-#define IsSet(a, x) ((a)[Off(x)] & Bit(x))
-
-
-#define G_WARN_OFF 0 /* $^W == 0 */
-#define G_WARN_ON 1 /* -w flag and $^W != 0 */
-#define G_WARN_ALL_ON 2 /* -W flag */
-#define G_WARN_ALL_OFF 4 /* -X flag */
-#define G_WARN_ONCE 8 /* set if 'once' ever enabled */
-#define G_WARN_ALL_MASK (G_WARN_ALL_ON|G_WARN_ALL_OFF)
-
-#define WARN_STD Nullsv
-#define WARN_ALL (&PL_sv_yes) /* use warning 'all' */
-#define WARN_NONE (&PL_sv_no) /* no warning 'all' */
-
-#define specialWARN(x) ((x) == WARN_STD || (x) == WARN_ALL || \
- (x) == WARN_NONE)
-
-#define ckDEAD(x) \
- ( ! specialWARN(PL_curcop->cop_warnings) && \
- IsSet(SvPVX(PL_curcop->cop_warnings), 2*x+1))
-
-#define ckWARN(x) \
- ( (PL_curcop->cop_warnings != WARN_STD && \
- PL_curcop->cop_warnings != WARN_NONE && \
- (PL_curcop->cop_warnings == WARN_ALL || \
- IsSet(SvPVX(PL_curcop->cop_warnings), 2*x) ) ) \
- || (PL_curcop->cop_warnings == WARN_STD && PL_dowarn & G_WARN_ON) )
-
-#define ckWARN2(x,y) \
- ( (PL_curcop->cop_warnings != WARN_STD && \
- PL_curcop->cop_warnings != WARN_NONE && \
- (PL_curcop->cop_warnings == WARN_ALL || \
- IsSet(SvPVX(PL_curcop->cop_warnings), 2*x) || \
- IsSet(SvPVX(PL_curcop->cop_warnings), 2*y) ) ) \
- || (PL_curcop->cop_warnings == WARN_STD && PL_dowarn & G_WARN_ON) )
-
-#define ckWARN_d(x) \
- (PL_curcop->cop_warnings == WARN_STD || \
- PL_curcop->cop_warnings == WARN_ALL || \
- (PL_curcop->cop_warnings != WARN_NONE && \
- IsSet(SvPVX(PL_curcop->cop_warnings), 2*x) ) )
-
-#define ckWARN2_d(x,y) \
- (PL_curcop->cop_warnings == WARN_STD || \
- PL_curcop->cop_warnings == WARN_ALL || \
- (PL_curcop->cop_warnings != WARN_NONE && \
- (IsSet(SvPVX(PL_curcop->cop_warnings), 2*x) || \
- IsSet(SvPVX(PL_curcop->cop_warnings), 2*y) ) ) )
-
-
-#define isLEXWARN_on (PL_curcop->cop_warnings != WARN_STD)
-#define isLEXWARN_off (PL_curcop->cop_warnings == WARN_STD)
-#define isWARN_ONCE (PL_dowarn & (G_WARN_ON|G_WARN_ONCE))
-#define isWARN_on(c,x) (IsSet(SvPVX(c), 2*(x)))
-
-#define WARN_IO 0
-#define WARN_CLOSED 1
-#define WARN_EXEC 2
-#define WARN_NEWLINE 3
-#define WARN_PIPE 4
-#define WARN_UNOPENED 5
-#define WARN_MISC 6
-#define WARN_NUMERIC 7
-#define WARN_ONCE 8
-#define WARN_RECURSION 9
-#define WARN_REDEFINE 10
-#define WARN_SEVERE 11
-#define WARN_DEBUGGING 12
-#define WARN_INPLACE 13
-#define WARN_INTERNAL 14
-#define WARN_SYNTAX 15
-#define WARN_AMBIGUOUS 16
-#define WARN_DEPRECATED 17
-#define WARN_OCTAL 18
-#define WARN_PARENTHESIS 19
-#define WARN_PRECEDENCE 20
-#define WARN_PRINTF 21
-#define WARN_RESERVED 22
-#define WARN_SEMICOLON 23
-#define WARN_UNINITIALIZED 24
-#define WARN_UNSAFE 25
-#define WARN_CLOSURE 26
-#define WARN_SIGNAL 27
-#define WARN_SUBSTR 28
-#define WARN_TAINT 29
-#define WARN_UNTIE 30
-#define WARN_UTF8 31
-#define WARN_VOID 32
-
-#define WARNsize 9
-#define WARN_ALLstring "\125\125\125\125\125\125\125\125\125"
-#define WARN_NONEstring "\0\0\0\0\0\0\0\0\0"
-
-/* end of file warning.h */
-
#define G_WARN_ALL_MASK (G_WARN_ALL_ON|G_WARN_ALL_OFF)
#define WARN_STD Nullsv
-#define WARN_ALL (&PL_sv_yes) /* use warnings 'all' */
-#define WARN_NONE (&PL_sv_no) /* no warnings 'all' */
+#define WARN_ALL (Nullsv+1) /* use warnings 'all' */
+#define WARN_NONE (Nullsv+2) /* no warnings 'all' */
#define specialWARN(x) ((x) == WARN_STD || (x) == WARN_ALL || \
(x) == WARN_NONE)
#define G_WARN_ALL_MASK (G_WARN_ALL_ON|G_WARN_ALL_OFF)
#define WARN_STD Nullsv
-#define WARN_ALL (&PL_sv_yes) /* use warnings 'all' */
-#define WARN_NONE (&PL_sv_no) /* no warnings 'all' */
+#define WARN_ALL (Nullsv+1) /* use warnings 'all' */
+#define WARN_NONE (Nullsv+2) /* no warnings 'all' */
#define specialWARN(x) ((x) == WARN_STD || (x) == WARN_ALL || \
(x) == WARN_NONE)
# versioned installation can be obtained by setting INST_TOP above to a
# path that includes an arbitrary version string.
#
-INST_VER = \5.00561
+INST_VER = \5.5.640
#
# Comment this out if you DON'T want your perl installation to have
#
# uncomment to enable threads-capabilities
#
-#USE_THREADS = define
+#USE_5005THREADS= define
#
# XXX WARNING! This option currently undergoing changes. May be broken.
#USE_OBJECT = define
#
+# XXX WARNING! This option currently undergoing changes. May be broken.
+#
+# Beginnings of interpreter cloning/threads: still rather rough, fails
+# tests. This should be enabled to get the fork() emulation. Do not
+# enable unless you know what you're doing!
+#
+#USE_ITHREADS = define
+
+#
+# uncomment to enable the implicit "host" layer for all system calls
+# made by perl. This is needed and auto-enabled by USE_OBJECT above.
+# This is also needed to get fork().
+#
+#USE_IMP_SYS = define
+
+#
# uncomment one of the following lines if you are using either
# Visual C++ 2.x or Visual C++ 6.x (aka Visual Studio 98)
#
#
# uncomment to enable use of PerlCRT.DLL when using the Visual C compiler.
-# Highly recommended. It has patches that fix known bugs in MSVCRT.DLL.
+# It has patches that fix known bugs in older versions of MSVCRT.DLL.
# This currently requires VC 5.0 with Service Pack 3 or later.
# Get it from CPAN at http://www.perl.com/CPAN/authors/id/D/DO/DOUGL/
# and follow the directions in the package to install.
#
+# Not recommended if you have VC 6.x and you're not running Windows 9x.
+#
#USE_PERLCRT = define
+#BUILD_FOR_WIN95 = define
#
# uncomment to enable linking with setargv.obj under the Visual C
CCLIBDIR = $(CCHOME)\lib
#
-# additional compiler flags can be specified here.
+# Additional compiler flags can be specified here.
#
-# Adding -DPERL_POLLUTE enables support for old symbols, at the expense of
-# extreme pollution. You most probably want this if you're compiling modules
-# from CPAN, or other such serious uses of this experimental perl release.
-# We don't enable this by default because we want the modules to get fixed
-# instead of clinging to shortcuts like this one.
+
+#
+# This should normally be disabled. Adding -DPERL_POLLUTE enables support
+# for old symbols by default, at the expense of extreme pollution. You most
+# probably just want to build modules that won't compile with
+# perl Makefile.PL POLLUTE=1
+# instead of enabling this. Please report such modules to the respective
+# authors.
#
#BUILDOPT = $(BUILDOPT) -DPERL_POLLUTE
#
+# This should normally be disabled. Enabling it will disable the File::Glob
+# implementation of CORE::glob.
+#
+#BUILDOPT = $(BUILDOPT) -DPERL_EXTERNAL_GLOB
+
+#
+# This should normally be disabled. Enabling it causes perl to read scripts
+# in text mode (which is the 5.005 behavior) and will break ByteLoader.
+#BUILDOPT = $(BUILDOPT) -DPERL_TEXTMODE_SCRIPTS
+
+#
+# This should normally be disabled. Enabling it runs a cloned toplevel
+# interpreter (*EXPERIMENTAL*, fails tests)
+#BUILDOPT = $(BUILDOPT) -DTOP_CLONE
+
+#
# specify semicolon-separated list of extra directories that modules will
# look for libraries (spaces in path names need not be quoted)
#
# set this to your email address (perl will guess a value from
# from your loginname and your hostname, which may not be right)
#
-#EMAIL =
+#EMAIL =
##
## Build configuration ends.
!IF "$(USE_OBJECT)" == "define"
PERL_MALLOC = undef
-USE_THREADS = undef
+USE_5005THREADS = undef
USE_MULTI = undef
+USE_IMP_SYS = define
!ENDIF
!IF "$(PERL_MALLOC)" == ""
PERL_MALLOC = undef
!ENDIF
-!IF "$(USE_THREADS)" == ""
-USE_THREADS = undef
+!IF "$(USE_5005THREADS)" == ""
+USE_5005THREADS = undef
+!ENDIF
+
+!IF "$(USE_5005THREADS)" == "define"
+USE_ITHREADS = undef
!ENDIF
!IF "$(USE_MULTI)" == ""
USE_OBJECT = undef
!ENDIF
-!IF "$(USE_MULTI)$(USE_THREADS)$(USE_OBJECT)" != "undefundefundef"
+!IF "$(USE_ITHREADS)" == ""
+USE_ITHREADS = undef
+!ENDIF
+
+!IF "$(USE_IMP_SYS)" == ""
+USE_IMP_SYS = undef
+!ENDIF
+
+!IF "$(USE_PERLCRT)" == ""
+USE_PERLCRT = undef
+!ENDIF
+
+!IF "$(USE_MULTI)$(USE_5005THREADS)$(USE_OBJECT)" != "undefundefundef"
BUILDOPT = $(BUILDOPT) -DPERL_IMPLICIT_CONTEXT
!ENDIF
+!IF "$(USE_IMP_SYS)" != "undef"
+BUILDOPT = $(BUILDOPT) -DPERL_IMPLICIT_SYS
+!ENDIF
+
!IF "$(PROCESSOR_ARCHITECTURE)" == ""
PROCESSOR_ARCHITECTURE = x86
!ENDIF
!IF "$(USE_OBJECT)" == "define"
ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-object
!ELSE
-!IF "$(USE_THREADS)" == "define"
+!IF "$(USE_5005THREADS)" == "define"
ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-thread
!ELSE
!IF "$(USE_MULTI)" == "define"
!ENDIF
!ENDIF
+!IF "$(USE_ITHREADS)" == "define"
+ARCHNAME = $(ARCHNAME)-thread
+!ENDIF
+
# Visual Studio 98 specific
!IF "$(CCTYPE)" == "MSVC60"
CC = cl
LINK32 = link
LIB32 = $(LINK32) -lib
+RSC = rc
#
# Options
SUBSYS = console
CXX_FLAG = -TP -GX
-!IF "$(USE_PERLCRT)" == ""
+!IF "$(USE_PERLCRT)" != "define"
! IF "$(CFG)" == "Debug"
PERLCRTLIBC = msvcrtd.lib
! ELSE
! ENDIF
!ENDIF
+PERLEXE_RES =
+PERLDLL_RES =
+
!IF "$(RUNTIME)" == "-MD"
LIBC = $(PERLCRTLIBC)
!ELSE
BUILDOPT = $(BUILDOPT) -DPERL_OBJECT
!ENDIF
+!IF "$(USE_PERLCRT)" != "define"
+BUILDOPT = $(BUILDOPT) -DPERL_MSVCRT_READFIX
+!ENDIF
+
LIBBASEFILES = $(DELAYLOAD) $(CRYPT_LIB) \
- oldnames.lib kernel32.lib user32.lib gdi32.lib \
- winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib \
- oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib \
+ oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib \
+ comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \
+ netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib \
version.lib odbc32.lib odbccp32.lib
# we add LIBC here, since we may be using PerlCRT.dll
# Rules
#
-.SUFFIXES : .c $(o) .dll .lib .exe
+.SUFFIXES : .c $(o) .dll .lib .exe .rc .res
.c$(o):
$(CC) -c -I$(<D) $(CFLAGS_O) $(OBJOUT_FLAG)$@ $<
$(LINK32) -dll -subsystem:windows -implib:$(*B).lib -def:$(*B).def \
-out:$@ $(LINK_FLAGS) $(LIBFILES) $< $(LIBPERL)
+.rc.res:
+ $(RSC) $<
+
#
# various targets
!IF "$(USE_OBJECT)" == "define"
MINIPERL = ..\miniperl.exe
MINIDIR = .\mini
PERLEXE = ..\perl.exe
+WPERLEXE = ..\wperl.exe
GLOBEXE = ..\perlglob.exe
CONFIGPM = ..\lib\Config.pm
MINIMOD = ..\lib\ExtUtils\Miniperl.pm
..\utils\c2ph \
..\utils\h2xs \
..\utils\perldoc \
- ..\utils\pstruct \
..\utils\perlcc \
..\pod\checkpods \
..\pod\pod2html \
CFGSH_TMPL = config.vc
CFGH_TMPL = config_H.vc
-!IF "$(USE_PERLCRT)" == ""
+!IF "$(BUILD_FOR_WIN95)" == "define"
PERL95EXE = ..\perl95.exe
!ENDIF
.\win32.c \
.\win32sck.c
-!IF "$(USE_THREADS)" == "define"
+!IF "$(USE_5005THREADS)" == "define"
WIN32_SRC = $(WIN32_SRC) .\win32thread.c
!ENDIF
.\include\dirent.h \
.\include\netdb.h \
.\include\sys\socket.h \
- .\win32.h
+ .\win32.h \
+ .\perlhost.h \
+ .\vdir.h \
+ .\vmem.h
CORE_H = $(CORE_NOCFG_H) .\config.h
!ENDIF
DYNAMIC_EXT = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B re \
- Data/Dumper Devel/Peek ByteLoader Devel/DProf
+ Data/Dumper Devel/Peek ByteLoader Devel/DProf File/Glob
STATIC_EXT = DynaLoader
NONXS_EXT = Errno
PEEK = $(EXTDIR)\Devel\Peek\Peek
BYTELOADER = $(EXTDIR)\ByteLoader\ByteLoader
DPROF = $(EXTDIR)\Devel\DProf\DProf
+GLOB = $(EXTDIR)\File\Glob\Glob
SOCKET_DLL = $(AUTODIR)\Socket\Socket.dll
FCNTL_DLL = $(AUTODIR)\Fcntl\Fcntl.dll
RE_DLL = $(AUTODIR)\re\re.dll
BYTELOADER_DLL = $(AUTODIR)\ByteLoader\ByteLoader.dll
DPROF_DLL = $(AUTODIR)\Devel\DProf\DProf.dll
+GLOB_DLL = $(AUTODIR)\File\Glob\Glob.dll
ERRNO_PM = $(LIBDIR)\Errno.pm
$(PEEK).c \
$(B).c \
$(BYTELOADER).c \
- $(DPROF).c
+ $(DPROF).c \
+ $(GLOB).c
EXTENSION_DLL = \
$(SOCKET_DLL) \
$(RE_DLL) \
$(THREAD_DLL) \
$(BYTELOADER_DLL) \
- $(DPROF_DLL)
+ $(DPROF_DLL) \
+ $(GLOB_DLL)
EXTENSION_PM = \
$(ERRNO_PM)
"static_ext=$(STATIC_EXT)" \
"dynamic_ext=$(DYNAMIC_EXT)" \
"nonxs_ext=$(NONXS_EXT)" \
- "usethreads=$(USE_THREADS)" \
+ "use5005threads=$(USE_5005THREADS)" \
+ "useithreads=$(USE_ITHREADS)" \
+ "usethreads=$(USE_5005THREADS)" \
"usemultiplicity=$(USE_MULTI)" \
"LINK_FLAGS=$(LINK_FLAGS:"=\")" \
"optimize=$(OPTIMIZE:"=\")"
if not exist "$(MINIDIR)" mkdir "$(MINIDIR)"
$(MINICORE_OBJ) : $(CORE_NOCFG_H)
- $(CC) -c $(CFLAGS) $(OBJOUT_FLAG)$@ ..\$(*F).c
+ $(CC) -c $(CFLAGS) -DPERL_EXTERNAL_GLOB $(OBJOUT_FLAG)$@ ..\$(*F).c
$(MINIWIN32_OBJ) : $(CORE_NOCFG_H)
$(CC) -c $(CFLAGS) $(OBJOUT_FLAG)$@ $(*F).c
+# -DPERL_IMPLICIT_SYS needs C++ for perllib.c
+!IF "$(USE_IMP_SYS)$(USE_OBJECT)" == "defineundef"
+perllib$(o) : perllib.c
+ $(CC) -c -I. $(CFLAGS_O) $(CXX_FLAG) $(OBJOUT_FLAG)$@ perllib.c
+!ENDIF
+
# 1. we don't want to rebuild miniperl.exe when config.h changes
# 2. we don't want to rebuild miniperl.exe with non-default config.h
$(MINI_OBJ) : $(CORE_NOCFG_H)
$(MINIPERL) -w ..\makedef.pl PLATFORM=win32 $(OPTIMIZE) $(DEFINES) $(BUILDOPT) \
CCTYPE=$(CCTYPE) > perldll.def
-$(PERLDLL): perldll.def $(PERLDLL_OBJ)
+$(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES)
$(LINK32) -dll -def:perldll.def -out:$@ @<<
- $(LINK_FLAGS) $(LIBFILES) $(PERLDLL_OBJ)
+ $(LINK_FLAGS) $(LIBFILES) $(PERLDLL_OBJ) $(PERLDLL_RES)
<<
$(XCOPY) $(PERLIMPLIB) $(COREDIR)
perlmain$(o) : perlmain.c
$(CC) $(CFLAGS_O) -UPERLDLL $(OBJOUT_FLAG)$@ -c perlmain.c
-$(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ)
+$(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES)
$(LINK32) -subsystem:console -out:$@ $(LINK_FLAGS) $(LIBFILES) \
- $(PERLEXE_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB)
+ $(PERLEXE_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) $(PERLEXE_RES)
+ copy $(PERLEXE) $(WPERLEXE)
+ editbin /subsystem:windows $(WPERLEXE)
copy splittree.pl ..
$(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
-!IF "$(USE_PERLCRT)" == ""
+!IF "$(BUILD_FOR_WIN95)" == "define"
perl95.c : runperl.c
copy runperl.c perl95.c
if not exist $(AUTODIR) mkdir $(AUTODIR)
cd $(EXTDIR)\$(*B)
..\$(MINIPERL) -I..\..\lib $(*B)_pm.PL
+ ..\$(MINIPERL) -I..\..\lib XSLoader_pm.PL
cd ..\..\win32
$(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL)
+ $(XCOPY) $(EXTDIR)\$(*B)\XSLoader.pm $(LIBDIR)\$(NULL)
cd $(EXTDIR)\$(*B)
$(XSUBPP) dl_win32.xs > $(*B).c
cd ..\..\win32
$(MAKE)
cd ..\..\..\win32
+$(GLOB_DLL): $(PERLEXE) $(GLOB).xs
+ cd $(EXTDIR)\File\$(*B)
+ ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
+ $(MAKE)
+ cd ..\..\..\win32
+
$(PEEK_DLL): $(PERLEXE) $(PEEK).xs
cd $(EXTDIR)\Devel\$(*B)
..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
-del /f $(EXTENSION_C) $(DYNALOADER).c $(ERRNO).pm
-del /f $(EXTDIR)\DynaLoader\dl_win32.xs
-del /f $(LIBDIR)\.exists $(LIBDIR)\attrs.pm $(LIBDIR)\DynaLoader.pm
+ -del /f $(LIBDIR)\XSLoader.pm
-del /f $(LIBDIR)\Fcntl.pm $(LIBDIR)\IO.pm $(LIBDIR)\Opcode.pm
-del /f $(LIBDIR)\ops.pm $(LIBDIR)\Safe.pm $(LIBDIR)\Thread.pm
-del /f $(LIBDIR)\SDBM_File.pm $(LIBDIR)\Socket.pm $(LIBDIR)\POSIX.pm
-del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm $(LIBDIR)\re.pm
-del /f $(LIBDIR)\Data\Dumper.pm $(LIBDIR)\ByteLoader.pm
-del /f $(LIBDIR)\Devel\Peek.pm $(LIBDIR)\Devel\DProf.pm
+ -del /f $(LIBDIR)\File\Glob.pm
-rmdir /s /q $(LIBDIR)\IO || rmdir /s $(LIBDIR)\IO
-rmdir /s /q $(LIBDIR)\Thread || rmdir /s $(LIBDIR)\Thread
-rmdir /s /q $(LIBDIR)\B || rmdir /s $(LIBDIR)\B
-del /f $(PODDIR)\*.html
-del /f $(PODDIR)\*.bat
cd ..\utils
- -del /f h2ph splain perlbug pl2pm c2ph h2xs perldoc pstruct dprofpp
+ -del /f h2ph splain perlbug pl2pm c2ph h2xs perldoc dprofpp
-del /f *.bat
cd ..\win32
cd ..\x2p
installbare : utils
$(PERLEXE) ..\installperl
-!IF "$(USE_PERLCRT)" == ""
+!IF "$(BUILD_FOR_WIN95)" == "define"
$(XCOPY) $(PERL95EXE) $(INST_BIN)\*.*
!ENDIF
+ if exist $(WPERLEXE) $(XCOPY) $(WPERLEXE) $(INST_BIN)\*.*
$(XCOPY) $(GLOBEXE) $(INST_BIN)\*.*
$(XCOPY) bin\*.bat $(INST_SCRIPT)\*.*
-@erase /f config.h
-@erase $(GLOBEXE)
-@erase $(PERLEXE)
+ -@erase $(WPERLEXE)
-@erase $(PERLDLL)
-@erase $(CORE_OBJ)
-rmdir /s /q $(MINIDIR) || rmdir /s $(MINIDIR)
=head1 AUTHOR
-Gurusamy Sarathy <gsar@umich.edu>
+Gurusamy Sarathy <gsar@activestate.com>
=head1 SEE ALSO
Locker=''
Log='$Log'
Mcc='Mcc'
-PERL_VERSION='~PERL_VERSION~'
-PERL_SUBVERSION='~PERL_SUBVERSION~'
-PATCHLEVEL='~PERL_VERSION~'
RCSfile='$RCSfile'
Revision='$Revision'
-SUBVERSION='~PERL_SUBVERSION~'
Source=''
State=''
_a='.lib'
alignbytes='8'
ansi2knr=''
aphostname=''
-apiversion='5.005'
+api_revision='~PERL_API_REVISION~'
+api_subversion='~PERL_API_SUBVERSION~'
+api_version='~PERL_API_VERSION~'
+api_versionstring='~PERL_API_REVISION~.~PERL_API_VERSION~.~PERL_API_SUBVERSION~'
ar='tlib /P128'
archlib='~INST_TOP~~INST_VER~\lib~INST_ARCH~'
archlibexp='~INST_TOP~~INST_VER~\lib~INST_ARCH~'
archname='MSWin32'
archobjs=''
awk='awk'
-baserev='5.0'
+baserev='5'
bash=''
bin='~INST_TOP~~INST_VER~\bin~INST_ARCH~'
+bincompat5005='undef'
binexp='~INST_TOP~~INST_VER~\bin~INST_ARCH~'
bison=''
byacc='byacc'
cf_by='nobody'
cf_email='nobody@no.where.net'
cf_time=''
+charsize='1'
chgrp=''
chmod=''
chown=''
cryptlib=''
csh='undef'
d_Gconvert='gcvt((x),(n),(b))'
+d_PRIEldbl='undef'
+d_PRIFldbl='undef'
+d_PRIGldbl='undef'
+d_PRIX64='undef'
+d_PRId64='undef'
+d_PRIeldbl='undef'
+d_PRIfldbl='undef'
+d_PRIgldbl='undef'
+d_PRIi64='undef'
+d_PRIo64='undef'
+d_PRIu64='undef'
+d_PRIx64='undef'
d_access='define'
d_accessx='undef'
d_alarm='undef'
d_archlib='define'
+d_atolf='undef'
+d_atoll='undef'
d_attribut='undef'
d_bcmp='undef'
d_bcopy='undef'
+d_bincompat5005='undef'
d_bsd='define'
d_bsdgetpgrp='undef'
d_bsdsetpgrp='undef'
d_chroot='undef'
d_chsize='define'
d_closedir='define'
-d_cmsghdr_s='undef'
d_const='define'
d_crypt='undef'
d_csh='undef'
d_cuserid='undef'
d_dbl_dig='define'
-d_dbmclose64='undef'
-d_dbminit64='undef'
-d_delete64='undef'
d_difftime='define'
-d_dirent64_s='undef'
d_dirnamlen='define'
d_dlerror='define'
d_dlopen='define'
d_endpent='undef'
d_endpwent='undef'
d_endsent='undef'
+d_endspent='undef'
d_eofnblk='define'
d_eunice='undef'
d_fchmod='undef'
d_fd_macros='define'
d_fd_set='define'
d_fds_bits='define'
-d_fetch64='undef'
d_fgetpos='define'
-d_fgetpos64='undef'
-d_firstkey64='undef'
d_flexfnam='define'
d_flock='define'
-d_flock64_s='undef'
-d_fopen64='undef'
d_fork='undef'
d_fpathconf='undef'
-d_freopen64='undef'
-d_fseek64='undef'
+d_fpos64_t='undef'
+d_fs_data_s='undef'
d_fseeko='undef'
-d_fseeko64='undef'
d_fsetpos='define'
-d_fsetpos64='undef'
-d_fstat64='undef'
d_fstatfs='undef'
d_fstatvfs='undef'
-d_ftell64='undef'
d_ftello='undef'
-d_ftello64='undef'
d_ftime='define'
-d_ftruncate64='undef'
d_getgrent='undef'
d_getgrps='undef'
d_gethbyaddr='define'
d_gethname='define'
d_gethostprotos='define'
d_getlogin='define'
+d_getmnt='undef'
+d_getmntent='undef'
d_getnbyaddr='undef'
d_getnbyname='undef'
d_getnent='undef'
d_getsbyport='define'
d_getsent='undef'
d_getservprotos='define'
+d_getspent='undef'
+d_getspnam='undef'
d_gettimeod='undef'
d_grpasswd='undef'
+d_hasmntopt='undef'
d_gnulibc='undef'
d_htonl='define'
d_index='undef'
d_inetaton='undef'
-d_ino64t='undef'
d_int64t='undef'
-d_iovec_s='undef'
d_isascii='define'
d_killpg='undef'
d_ldbl_dig='define'
d_lchown='undef'
-d_link='undef'
+d_link='define'
d_locconv='define'
d_lockf='undef'
-d_lockf64='undef'
d_longdbl='define'
d_longlong='undef'
-d_lseek64='undef'
d_lstat='undef'
-d_lstat64='undef'
-d_madvise='undef'
d_mblen='define'
d_mbstowcs='define'
d_mbtowc='define'
+d_memchr='define'
d_memcmp='define'
d_memcpy='define'
d_memmove='define'
d_mkdir='define'
d_mkfifo='undef'
d_mktime='define'
-d_mmap='undef'
-d_mprotect='undef'
d_msg='undef'
d_msg_ctrunc='undef'
d_msg_dontroute='undef'
d_msg_proxy='undef'
d_msgctl='undef'
d_msgget='undef'
-d_msghdr_s='undef'
d_msgrcv='undef'
d_msgsnd='undef'
-d_msync='undef'
-d_munmap='undef'
d_mymalloc='undef'
-d_nextkey64='undef'
d_nice='undef'
-d_off64t='undef'
+d_off64_t='undef'
d_old_pthread_create_joinable='undef'
d_oldpthreads='undef'
d_oldsock='undef'
d_open3='undef'
-d_open64='undef'
-d_opendir64='undef'
d_pathconf='undef'
d_pause='define'
d_phostname='undef'
d_pwcomment='undef'
d_pwexpire='undef'
d_pwgecos='undef'
-d_pwquota='undef'
d_pwpasswd='undef'
+d_pwquota='undef'
+d_quad='undef'
d_readdir='define'
-d_readdir64='undef'
d_readlink='undef'
-d_readv='undef'
-d_recvmesg='undef'
d_rename='define'
d_rewinddir='define'
d_rmdir='define'
d_sched_yield='undef'
d_scm_rights='undef'
d_seekdir='define'
-d_seekdir64='undef'
d_select='define'
d_sem='undef'
d_semctl='undef'
d_semctl_semun='undef'
d_semget='undef'
d_semop='undef'
-d_sendmsg='undef'
d_setegid='undef'
d_seteuid='undef'
d_setgrent='undef'
d_setruid='undef'
d_setsent='undef'
d_setsid='undef'
+d_setspent='undef'
d_setvbuf='define'
d_sfio='undef'
d_shm='undef'
d_sigsetjmp='undef'
d_socket='define'
d_sockpair='undef'
-d_stat64='undef'
+d_sqrtl='undef'
d_statblks='undef'
-d_statfs='undef'
-d_statfsflags='undef'
+d_statfs_f_flags='undef'
+d_statfs_s='undef'
d_statvfs='undef'
d_stdio_cnt_lval='define'
d_stdio_ptr_lval='define'
+d_stdio_stream_array='undef'
d_stdiobase='define'
d_stdstdio='define'
-d_store64='undef'
d_strchr='define'
d_strcoll='define'
d_strctcpy='define'
d_strerror='define'
d_strtod='define'
d_strtol='define'
+d_strtold='undef'
+d_strtoll='undef'
d_strtoul='define'
+d_strtoull='undef'
+d_strtouq='undef'
d_strxfrm='define'
d_suidsafe='undef'
d_symlink='undef'
d_tcgetpgrp='undef'
d_tcsetpgrp='undef'
d_telldir='define'
-d_telldir64='undef'
d_telldirproto='define'
d_time='define'
d_times='define'
-d_tmpfile64='undef'
d_truncate='undef'
-d_truncate64='undef'
d_tzname='define'
d_umask='define'
d_uname='define'
d_union_semun='define'
+d_ustat='undef'
+d_vendorbin='undef'
+d_vendorlib='undef'
d_vfork='undef'
d_void_closedir='undef'
d_voidsig='define'
d_waitpid='define'
d_wcstombs='define'
d_wctomb='define'
-d_writev='undef'
d_xenix='undef'
date='date'
db_hashtype='int'
find='find'
firstmakefile='makefile'
flex=''
+fpossize='4'
fpostype='fpos_t'
freetype='void'
+full_ar=''
full_csh=''
full_sed=''
gccversion=''
+gidformat='"d"'
+gidsign='-1'
+gidsize='4'
gidtype='gid_t'
glibpth='/usr/shlib /lib/pa1.1 /usr/lib/large /lib /usr/lib /usr/lib/386 /lib/386 /lib/large /usr/lib/small /lib/small /usr/ccs/lib /usr/ucblib /usr/shlib '
grep='grep'
hint='recommended'
hostcat='ypcat hosts'
huge=''
+i16size='2'
+i16type='short'
+i32size='4'
+i32type='long'
+i64size='8'
+i64type='__int64'
+i8size='1'
+i8type='char'
i_arpainet='define'
i_bsdioctl=''
i_db='undef'
i_ndbm='undef'
i_netdb='undef'
i_neterrno='undef'
+i_netinettcp='undef'
i_niin='undef'
i_poll='undef'
+i_pthread='undef'
i_pwd='undef'
i_rpcsvcdbm='define'
i_sfio='undef'
i_sgtty='undef'
+i_shadow='undef'
+i_socks='undef'
i_stdarg='define'
i_stddef='define'
i_stdlib='define'
i_sysfilio='define'
i_sysin='undef'
i_sysioctl='undef'
-i_sysmman='undef'
i_sysmount='undef'
i_sysndir='undef'
i_sysparam='undef'
i_syssecrt='undef'
i_sysselct='undef'
i_syssockio=''
+i_sysstatfs='undef'
i_sysstatvfs='undef'
i_sysstat='define'
i_systime='undef'
i_systypes='define'
i_sysuio='undef'
i_sysun='undef'
+i_sysvfs='undef'
i_syswait='undef'
i_termio='undef'
i_termios='undef'
i_time='define'
i_unistd='undef'
+i_ustat='undef'
i_utime='define'
i_values='undef'
i_varargs='undef'
i_varhdr='varargs.h'
i_vfork='undef'
ignore_versioned_solibs=''
+inc_version_list=''
incpath=''
inews=''
installarchlib='~INST_TOP~~INST_VER~\lib~INST_ARCH~'
installbin='~INST_TOP~~INST_VER~\bin~INST_ARCH~'
installman1dir='~INST_TOP~~INST_VER~\man\man1'
installman3dir='~INST_TOP~~INST_VER~\man\man3'
+installprefix='~INST_TOP~~INST_VER~'
+installprefixexp='~INST_TOP~~INST_VER~'
installhtmldir='~INST_TOP~~INST_VER~\html'
installhtmlhelpdir='~INST_TOP~~INST_VER~\htmlhelp'
installprivlib='~INST_TOP~~INST_VER~\lib'
installscript='~INST_TOP~~INST_VER~\bin'
installsitearch='~INST_TOP~\site~INST_VER~\lib~INST_ARCH~'
installsitelib='~INST_TOP~\site~INST_VER~\lib'
+installstyle='lib'
installusrbinperl='undef'
+installvendorbin=''
+installvendorlib=''
intsize='4'
-known_extensions='DB_File Fcntl GDBM_File NDBM_File ODBM_File Opcode POSIX SDBM_File Socket IO attrs Thread'
+ivdformat='"ld"'
+ivsize='4'
+ivtype='long'
+known_extensions='~static_ext~ ~dynamic_ext~ ~nonxs_ext~'
ksh=''
large=''
ld='tlink32'
lddlflags='-Tpd ~LINK_FLAGS~'
ldflags='~LINK_FLAGS~'
+ldlibpthname=''
less='less'
lib_ext='.lib'
libc='cw32mti.lib'
man3direxp='~INST_TOP~~INST_VER~\man\man3'
man3ext='3'
medium=''
-mips=''
mips_type=''
mkdir='mkdir'
-mmaptype='void *'
models='none'
modetype='mode_t'
more='more /e'
nm_so_opt=''
nonxs_ext='Errno'
nroff=''
+nvsize='8'
+nvtype='double'
o_nonblock='O_NONBLOCK'
obj_ext='.obj'
old_pthread_create_joinable=''
privlibexp='~INST_TOP~~INST_VER~\lib'
prototype='define'
ptrsize='4'
+quadcase='5'
+quadtype='__int64'
randbits='15'
randfunc='rand'
randseedtype='unsigned'
rm='del'
rmail=''
runnm='true'
+sPRIEldbl='"E"'
+sPRIFldbl='"F"'
+sPRIGldbl='"G"'
+sPRIX64='"lX"'
+sPRId64='"ld"'
+sPRIeldbl='"e"'
+sPRIfldbl='"f"'
+sPRIgldbl='"g"'
+sPRIi64='"li"'
+sPRIo64='"lo"'
+sPRIu64='"lu"'
+sPRIx64='"lx"'
sched_yield=''
scriptdir='~INST_TOP~~INST_VER~\bin'
scriptdirexp='~INST_TOP~~INST_VER~\bin'
shortsize='2'
shrpenv=''
shsharp='true'
+sig_count='26'
sig_name='ZERO NUM01 INT QUIT ILL NUM05 NUM06 NUM07 FPE KILL NUM10 SEGV NUM12 PIPE ALRM TERM USR1 USR2 CHLD NUM19 USR3 BREAK ABRT STOP NUM24 CONT CLD'
sig_name_init='"ZERO", "NUM01", "INT", "QUIT", "ILL", "NUM05", "NUM06", "NUM07", "FPE", "KILL", "NUM10", "SEGV", "NUM12", "PIPE", "ALRM", "TERM", "USR1", "USR2", "CHLD", "NUM19", "USR3", "BREAK", "ABRT", "STOP", "NUM24", "CONT", "CLD", 0'
sig_num='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 18 0'
signal_t='void'
sitearch='~INST_TOP~\site~INST_VER~\lib~INST_ARCH~'
sitearchexp='~INST_TOP~\site~INST_VER~\lib~INST_ARCH~'
+sitebin='~INST_TOP~\site~INST_VER~\bin~INST_ARCH~'
+sitebinexp='~INST_TOP~\site~INST_VER~\bin~INST_ARCH~'
sitelib='~INST_TOP~\site~INST_VER~\lib'
sitelibexp='~INST_TOP~\site~INST_VER~\lib'
+siteprefix='~INST_TOP~\site~INST_VER~'
+siteprefixexp='~INST_TOP~\site~INST_VER~'
sizetype='size_t'
sleep=''
smail=''
stdio_cnt='((fp)->level)'
stdio_filbuf=''
stdio_ptr='((fp)->curp)'
+stdio_stream_array=''
strings='/usr/include/string.h'
submit=''
subversion='~SUBVERSION~'
tr=''
trnl='\012'
troff=''
+u16size='2'
+u16type='unsigned short'
+u32size='4'
+u32type='unsigned long'
+u64size='8'
+u64type='unsigned __int64'
+u8size='1'
+u8type='unsigned char'
+uidformat='"d"'
+uidsign='-1'
+uidsize='4'
uidtype='uid_t'
uname='uname'
uniq='uniq'
+uquadtype='unsigned __int64'
+use5005threads='undef'
use64bits='undef'
usedl='define'
+useithreads='undef'
+uselargefiles='undef'
+uselongdouble='undef'
+uselonglong='undef'
+usemorebits='undef'
usemultiplicity='undef'
usemymalloc='n'
usenm='false'
useposix='true'
usesfio='false'
useshrplib='yes'
+usesocks='undef'
usethreads='undef'
+usevendorprefix='undef'
usevfork='false'
usrinc='/usr/include'
uuname=''
+uvoformat='"lo"'
+uvsize='4'
+uvtype='unsigned long'
+uvuformat='"lu"'
+uvxformat='"lx"'
+vendorbin=''
+vendorbinexp=''
+vendorlib=''
+vendorlibexp=''
+vendorprefix=''
+vendorprefixexp=''
version='~VERSION~'
vi=''
voidflags='15'
xlibpth='/usr/lib/386 /lib/386'
zcat=''
zip='zip'
+PERL_REVISION='~PERL_REVISION~'
+PERL_SUBVERSION='~PERL_SUBVERSION~'
+PERL_VERSION='~PERL_VERSION~'
+PERL_API_REVISION='~PERL_API_REVISION~'
+PERL_API_SUBVERSION='~PERL_API_SUBVERSION~'
+PERL_API_VERSION='~PERL_API_VERSION~'
+PATCHLEVEL='~PERL_VERSION~'
+SUBVERSION='~PERL_SUBVERSION~'
Locker=''
Log='$Log'
Mcc='Mcc'
-PERL_VERSION='~PERL_VERSION~'
-PERL_SUBVERSION='~PERL_SUBVERSION~'
-PATCHLEVEL='~PERL_VERSION~'
RCSfile='$RCSfile'
Revision='$Revision'
-SUBVERSION='~PERL_SUBVERSION~'
Source=''
State=''
_a='.a'
alignbytes='8'
ansi2knr=''
aphostname=''
-apiversion='5.005'
+api_revision='~PERL_API_REVISION~'
+api_subversion='~PERL_API_SUBVERSION~'
+api_version='~PERL_API_VERSION~'
+api_versionstring='~PERL_API_REVISION~.~PERL_API_VERSION~.~PERL_API_SUBVERSION~'
ar='ar'
archlib='~INST_TOP~~INST_VER~\lib~INST_ARCH~'
archlibexp='~INST_TOP~~INST_VER~\lib~INST_ARCH~'
archname='MSWin32'
archobjs=''
awk='awk'
-baserev='5.0'
+baserev='5'
bash=''
bin='~INST_TOP~~INST_VER~\bin~INST_ARCH~'
+bincompat5005='undef'
binexp='~INST_TOP~~INST_VER~\bin~INST_ARCH~'
bison=''
byacc='byacc'
cf_by='nobody'
cf_email='nobody@no.where.net'
cf_time=''
+charsize='1'
chgrp=''
chmod=''
chown=''
cryptlib=''
csh='undef'
d_Gconvert='sprintf((b),"%.*g",(n),(x))'
+d_PRIEldbl='undef'
+d_PRIFldbl='undef'
+d_PRIGldbl='undef'
+d_PRIX64='undef'
+d_PRId64='undef'
+d_PRIeldbl='undef'
+d_PRIfldbl='undef'
+d_PRIgldbl='undef'
+d_PRIi64='undef'
+d_PRIo64='undef'
+d_PRIu64='undef'
+d_PRIx64='undef'
d_access='define'
d_accessx='undef'
d_alarm='undef'
d_archlib='define'
+d_atolf='undef'
+d_atoll='undef'
d_attribut='define'
d_bcmp='undef'
d_bcopy='undef'
+d_bincompat5005='undef'
d_bsd='define'
d_bsdgetpgrp='undef'
d_bsdsetpgrp='undef'
d_chroot='undef'
d_chsize='define'
d_closedir='define'
-d_cmsghdr_s='undef'
d_const='define'
d_crypt='undef'
d_csh='undef'
d_cuserid='undef'
d_dbl_dig='define'
-d_dbmclose64='undef'
-d_dbminit64='undef'
-d_delete64='undef'
d_difftime='define'
-d_dirent64_s='undef'
d_dirnamlen='define'
d_dlerror='define'
d_dlopen='define'
d_endpent='undef'
d_endpwent='undef'
d_endsent='undef'
+d_endspent='undef'
d_eofnblk='define'
d_eunice='undef'
d_fchmod='undef'
d_fd_macros='define'
d_fd_set='define'
d_fds_bits='define'
-d_fetch64='undef'
d_fgetpos='define'
-d_fgetpos64='undef'
-d_firstkey64='undef'
d_flexfnam='define'
d_flock='define'
-d_flock64_s='undef'
-d_fopen64='undef'
d_fork='undef'
d_fpathconf='undef'
-d_freopen64='undef'
-d_fseek64='undef'
+d_fpos64_t='undef'
+d_fs_data_s='undef'
d_fseeko='undef'
-d_fseeko64='undef'
d_fsetpos='define'
-d_fsetpos64='undef'
-d_fstat64='undef'
d_fstatfs='undef'
d_fstatvfs='undef'
-d_ftell64='undef'
d_ftello='undef'
-d_ftello64='undef'
d_ftime='define'
-d_ftruncate64='undef'
d_getgrent='undef'
d_getgrps='undef'
d_gethbyaddr='define'
d_gethname='define'
d_gethostprotos='define'
d_getlogin='define'
+d_getmnt='undef'
+d_getmntent='undef'
d_getnbyaddr='undef'
d_getnbyname='undef'
d_getnent='undef'
d_getsbyport='define'
d_getsent='undef'
d_getservprotos='define'
+d_getspent='undef'
+d_getspnam='undef'
d_gettimeod='undef'
d_grpasswd='undef'
+d_hasmntopt='undef'
d_gnulibc='undef'
d_htonl='define'
d_index='undef'
d_inetaton='undef'
-d_ino64t='undef'
d_int64t='undef'
-d_iovec_s='undef'
d_isascii='define'
d_killpg='undef'
d_ldbl_dig='define'
d_lchown='undef'
-d_link='undef'
+d_link='define'
d_locconv='define'
d_lockf='undef'
-d_lockf64='undef'
d_longdbl='define'
d_longlong='undef'
-d_lseek64='undef'
d_lstat='undef'
-d_lstat64='undef'
-d_madvise='undef'
d_mblen='define'
d_mbstowcs='define'
d_mbtowc='define'
+d_memchr='define'
d_memcmp='define'
d_memcpy='define'
d_memmove='define'
d_mkdir='define'
d_mkfifo='undef'
d_mktime='define'
-d_mmap='undef'
-d_mprotect='undef'
d_msg='undef'
d_msg_ctrunc='undef'
d_msg_dontroute='undef'
d_msg_proxy='undef'
d_msgctl='undef'
d_msgget='undef'
-d_msghdr_s='undef'
d_msgrcv='undef'
d_msgsnd='undef'
-d_msync='undef'
-d_munmap='undef'
d_mymalloc='undef'
-d_nextkey64='undef'
d_nice='undef'
-d_off64t='undef'
+d_off64_t='undef'
d_old_pthread_create_joinable='undef'
d_oldpthreads='undef'
d_oldsock='undef'
d_open3='undef'
-d_open64='undef'
-d_opendir64='undef'
d_pathconf='undef'
d_pause='define'
d_phostname='undef'
d_pwcomment='undef'
d_pwexpire='undef'
d_pwgecos='undef'
-d_pwquota='undef'
d_pwpasswd='undef'
+d_pwquota='undef'
+d_quad='undef'
d_readdir='define'
-d_readdir64='undef'
d_readlink='undef'
-d_readv='undef'
-d_recvmesg='undef'
d_rename='define'
d_rewinddir='define'
d_rmdir='define'
d_sched_yield='undef'
d_scm_rights='undef'
d_seekdir='define'
-d_seekdir64='undef'
d_select='define'
d_sem='undef'
d_semctl='undef'
d_semctl_semun='undef'
d_semget='undef'
d_semop='undef'
-d_sendmsg='undef'
d_setegid='undef'
d_seteuid='undef'
d_setgrent='undef'
d_setruid='undef'
d_setsent='undef'
d_setsid='undef'
+d_setspent='undef'
d_setvbuf='define'
d_sfio='undef'
d_shm='undef'
d_sigsetjmp='undef'
d_socket='define'
d_sockpair='undef'
-d_stat64='undef'
+d_sqrtl='undef'
d_statblks='undef'
-d_statfs='undef'
-d_statfsflags='undef'
+d_statfs_f_flags='undef'
+d_statfs_s='undef'
d_statvfs='undef'
d_stdio_cnt_lval='define'
d_stdio_ptr_lval='define'
-d_stdiobase='undef'
-d_stdstdio='undef'
-d_store64='undef'
+d_stdio_stream_array='undef'
+d_stdiobase='define'
+d_stdstdio='define'
d_strchr='define'
d_strcoll='define'
d_strctcpy='define'
d_strerror='define'
d_strtod='define'
d_strtol='define'
+d_strtold='undef'
+d_strtoll='undef'
d_strtoul='define'
+d_strtoull='undef'
+d_strtouq='undef'
d_strxfrm='define'
d_suidsafe='undef'
d_symlink='undef'
d_tcgetpgrp='undef'
d_tcsetpgrp='undef'
d_telldir='define'
-d_telldir64='undef'
d_telldirproto='define'
d_time='define'
d_times='define'
-d_tmpfile64='undef'
d_truncate='undef'
-d_truncate64='undef'
-d_tzname='undef'
+d_tzname='define'
d_umask='define'
d_uname='define'
d_union_semun='define'
+d_ustat='undef'
+d_vendorbin='undef'
+d_vendorlib='undef'
d_vfork='undef'
d_void_closedir='undef'
d_voidsig='define'
d_waitpid='define'
d_wcstombs='define'
d_wctomb='define'
-d_writev='undef'
d_xenix='undef'
date='date'
db_hashtype='int'
find='find'
firstmakefile='makefile'
flex=''
+fpossize='4'
fpostype='fpos_t'
freetype='void'
+full_ar=''
full_csh=''
full_sed=''
gccversion=''
+gidformat='"ld"'
+gidsign='-1'
+gidsize='4'
gidtype='gid_t'
glibpth='/usr/shlib /lib/pa1.1 /usr/lib/large /lib /usr/lib /usr/lib/386 /lib/386 /lib/large /usr/lib/small /lib/small /usr/ccs/lib /usr/ucblib /usr/shlib '
grep='grep'
hint='recommended'
hostcat='ypcat hosts'
huge=''
+i16size='2'
+i16type='short'
+i32size='4'
+i32type='long'
+i64size='8'
+i64type='long long'
+i8size='1'
+i8type='char'
i_arpainet='define'
i_bsdioctl=''
i_db='undef'
i_ndbm='undef'
i_netdb='undef'
i_neterrno='undef'
+i_netinettcp='undef'
i_niin='undef'
i_poll='undef'
+i_pthread='undef'
i_pwd='undef'
i_rpcsvcdbm='define'
i_sfio='undef'
i_sgtty='undef'
+i_shadow='undef'
+i_socks='undef'
i_stdarg='define'
i_stddef='define'
i_stdlib='define'
i_sysfilio='define'
i_sysin='undef'
i_sysioctl='undef'
-i_sysmman='undef'
i_sysmount='undef'
i_sysndir='undef'
i_sysparam='undef'
i_syssecrt='undef'
i_sysselct='undef'
i_syssockio=''
+i_sysstatfs='undef'
i_sysstatvfs='undef'
i_sysstat='define'
i_systime='undef'
i_systypes='define'
i_sysuio='undef'
i_sysun='undef'
+i_sysvfs='undef'
i_syswait='undef'
i_termio='undef'
i_termios='undef'
i_time='define'
i_unistd='undef'
+i_ustat='undef'
i_utime='define'
i_values='undef'
i_varargs='undef'
i_varhdr='varargs.h'
i_vfork='undef'
ignore_versioned_solibs=''
+inc_version_list=''
incpath=''
inews=''
installarchlib='~INST_TOP~~INST_VER~\lib~INST_ARCH~'
installbin='~INST_TOP~~INST_VER~\bin~INST_ARCH~'
installman1dir='~INST_TOP~~INST_VER~\man\man1'
installman3dir='~INST_TOP~~INST_VER~\man\man3'
+installprefix='~INST_TOP~~INST_VER~'
+installprefixexp='~INST_TOP~~INST_VER~'
installhtmldir='~INST_TOP~~INST_VER~\html'
installhtmlhelpdir='~INST_TOP~~INST_VER~\htmlhelp'
installprivlib='~INST_TOP~~INST_VER~\lib'
installscript='~INST_TOP~~INST_VER~\bin'
installsitearch='~INST_TOP~\site~INST_VER~\lib~INST_ARCH~'
installsitelib='~INST_TOP~\site~INST_VER~\lib'
+installstyle='lib'
installusrbinperl='undef'
+installvendorbin=''
+installvendorlib=''
intsize='4'
-known_extensions='DB_File Fcntl GDBM_File NDBM_File ODBM_File Opcode POSIX SDBM_File Socket IO attrs Thread'
+ivdformat='"ld"'
+ivsize='4'
+ivtype='long'
+known_extensions='~static_ext~ ~dynamic_ext~ ~nonxs_ext~'
ksh=''
large=''
ld='gcc'
lddlflags='-mdll ~LINK_FLAGS~'
ldflags='~LINK_FLAGS~'
+ldlibpthname=''
less='less'
lib_ext='.a'
-libc='libcrtdll.a'
+libc='libmsvcrt.a'
libperl='libperl.a'
libpth=''
libs=''
man3direxp='~INST_TOP~~INST_VER~\man\man3'
man3ext='3'
medium=''
-mips=''
mips_type=''
mkdir='mkdir'
-mmaptype='void *'
models='none'
modetype='mode_t'
more='more /e'
nm_so_opt=''
nonxs_ext='Errno'
nroff=''
+nvsize='8'
+nvtype='double'
o_nonblock='O_NONBLOCK'
obj_ext='.o'
old_pthread_create_joinable=''
privlibexp='~INST_TOP~~INST_VER~\lib'
prototype='define'
ptrsize='4'
+quadcase='5'
+quadtype='long long'
randbits='15'
randfunc='rand'
randseedtype='unsigned'
rm='del'
rmail=''
runnm='true'
+sPRIEldbl='"E"'
+sPRIFldbl='"F"'
+sPRIGldbl='"G"'
+sPRIX64='"lX"'
+sPRId64='"ld"'
+sPRIeldbl='"e"'
+sPRIfldbl='"f"'
+sPRIgldbl='"g"'
+sPRIi64='"li"'
+sPRIo64='"lo"'
+sPRIu64='"lu"'
+sPRIx64='"lx"'
sched_yield=''
scriptdir='~INST_TOP~~INST_VER~\bin'
scriptdirexp='~INST_TOP~~INST_VER~\bin'
shortsize='2'
shrpenv=''
shsharp='true'
+sig_count='26'
sig_name='ZERO NUM01 INT QUIT ILL NUM05 NUM06 NUM07 FPE KILL NUM10 SEGV NUM12 PIPE ALRM TERM NUM16 NUM17 NUM18 NUM19 CHLD BREAK ABRT STOP NUM24 CONT CLD'
sig_name_init='"ZERO", "NUM01", "INT", "QUIT", "ILL", "NUM05", "NUM06", "NUM07", "FPE", "KILL", "NUM10", "SEGV", "NUM12", "PIPE", "ALRM", "TERM", "NUM16", "NUM17", "NUM18", "NUM19", "CHLD", "BREAK", "ABRT", "STOP", "NUM24", "CONT", "CLD", 0'
sig_num='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 20 0'
signal_t='void'
sitearch='~INST_TOP~\site~INST_VER~\lib~INST_ARCH~'
sitearchexp='~INST_TOP~\site~INST_VER~\lib~INST_ARCH~'
+sitebin='~INST_TOP~\site~INST_VER~\bin~INST_ARCH~'
+sitebinexp='~INST_TOP~\site~INST_VER~\bin~INST_ARCH~'
sitelib='~INST_TOP~\site~INST_VER~\lib'
sitelibexp='~INST_TOP~\site~INST_VER~\lib'
+siteprefix='~INST_TOP~\site~INST_VER~'
+siteprefixexp='~INST_TOP~\site~INST_VER~'
sizetype='size_t'
sleep=''
smail=''
stdio_cnt='((fp)->_cnt)'
stdio_filbuf=''
stdio_ptr='((fp)->_ptr)'
+stdio_stream_array=''
strings='/usr/include/string.h'
submit=''
subversion='~SUBVERSION~'
tr=''
trnl='\012'
troff=''
+u16size='2'
+u16type='unsigned short'
+u32size='4'
+u32type='unsigned long'
+u64size='8'
+u64type='unsigned long long'
+u8size='1'
+u8type='unsigned char'
+uidformat='"ld"'
+uidsign='-1'
+uidsize='4'
uidtype='uid_t'
uname='uname'
uniq='uniq'
+uquadtype='unsigned long long'
+use5005threads='undef'
use64bits='undef'
usedl='define'
-usemultiplicity='define'
+useithreads='undef'
+uselargefiles='undef'
+uselongdouble='undef'
+uselonglong='undef'
+usemorebits='undef'
+usemultiplicity='undef'
usemymalloc='n'
usenm='false'
useopcode='true'
useposix='true'
usesfio='false'
useshrplib='yes'
+usesocks='undef'
usethreads='undef'
+usevendorprefix='undef'
usevfork='false'
usrinc='/usr/include'
uuname=''
+uvoformat='"lo"'
+uvsize='4'
+uvtype='unsigned long'
+uvuformat='"lu"'
+uvxformat='"lx"'
+vendorbin=''
+vendorbinexp=''
+vendorlib=''
+vendorlibexp=''
+vendorprefix=''
+vendorprefixexp=''
version='~VERSION~'
vi=''
voidflags='15'
xlibpth='/usr/lib/386 /lib/386'
zcat=''
zip='zip'
+PERL_REVISION='~PERL_REVISION~'
+PERL_SUBVERSION='~PERL_SUBVERSION~'
+PERL_VERSION='~PERL_VERSION~'
+PERL_API_REVISION='~PERL_API_REVISION~'
+PERL_API_SUBVERSION='~PERL_API_SUBVERSION~'
+PERL_API_VERSION='~PERL_API_VERSION~'
+PATCHLEVEL='~PERL_VERSION~'
+SUBVERSION='~PERL_SUBVERSION~'
Locker=''
Log='$Log'
Mcc='Mcc'
-PERL_VERSION='~PERL_VERSION~'
-PERL_SUBVERSION='~PERL_SUBVERSION~'
-PATCHLEVEL='~PERL_VERSION~'
RCSfile='$RCSfile'
Revision='$Revision'
-SUBVERSION='~PERL_SUBVERSION~'
Source=''
State=''
_a='.lib'
alignbytes='8'
ansi2knr=''
aphostname=''
-apiversion='5.005'
+api_revision='~PERL_API_REVISION~'
+api_subversion='~PERL_API_SUBVERSION~'
+api_version='~PERL_API_VERSION~'
+api_versionstring='~PERL_API_REVISION~.~PERL_API_VERSION~.~PERL_API_SUBVERSION~'
ar='lib'
archlib='~INST_TOP~~INST_VER~\lib~INST_ARCH~'
archlibexp='~INST_TOP~~INST_VER~\lib~INST_ARCH~'
archname='MSWin32'
archobjs=''
awk='awk'
-baserev='5.0'
+baserev='5'
bash=''
bin='~INST_TOP~~INST_VER~\bin~INST_ARCH~'
+bincompat5005='undef'
binexp='~INST_TOP~~INST_VER~\bin~INST_ARCH~'
bison=''
byacc='byacc'
cf_by='nobody'
cf_email='nobody@no.where.net'
cf_time=''
+charsize='1'
chgrp=''
chmod=''
chown=''
cryptlib=''
csh='undef'
d_Gconvert='sprintf((b),"%.*g",(n),(x))'
+d_PRIEldbl='undef'
+d_PRIFldbl='undef'
+d_PRIGldbl='undef'
+d_PRIX64='undef'
+d_PRId64='undef'
+d_PRIeldbl='undef'
+d_PRIfldbl='undef'
+d_PRIgldbl='undef'
+d_PRIi64='undef'
+d_PRIo64='undef'
+d_PRIu64='undef'
+d_PRIx64='undef'
d_access='define'
d_accessx='undef'
d_alarm='undef'
d_archlib='define'
+d_atolf='undef'
+d_atoll='undef'
d_attribut='undef'
d_bcmp='undef'
d_bcopy='undef'
+d_bincompat5005='undef'
d_bsd='define'
d_bsdgetpgrp='undef'
d_bsdsetpgrp='undef'
d_chroot='undef'
d_chsize='define'
d_closedir='define'
-d_cmsghdr_s='undef'
d_const='define'
d_crypt='undef'
d_csh='undef'
d_cuserid='undef'
d_dbl_dig='define'
-d_dbmclose64='undef'
-d_dbminit64='undef'
-d_delete64='undef'
d_difftime='define'
-d_dirent64_s='undef'
d_dirnamlen='define'
d_dlerror='define'
d_dlopen='define'
d_endpent='undef'
d_endpwent='undef'
d_endsent='undef'
+d_endspent='undef'
d_eofnblk='define'
d_eunice='undef'
d_fchmod='undef'
d_fd_macros='define'
d_fd_set='define'
d_fds_bits='define'
-d_fetch64='undef'
d_fgetpos='define'
-d_fgetpos64='undef'
-d_firstkey64='undef'
d_flexfnam='define'
d_flock='define'
-d_flock64_s='undef'
-d_fopen64='undef'
d_fork='undef'
d_fpathconf='undef'
-d_freopen64='undef'
-d_fseek64='undef'
+d_fpos64_t='undef'
+d_fs_data_s='undef'
d_fseeko='undef'
-d_fseeko64='undef'
d_fsetpos='define'
-d_fsetpos64='undef'
-d_fstat64='undef'
d_fstatfs='undef'
d_fstatvfs='undef'
-d_ftell64='undef'
d_ftello='undef'
-d_ftello64='undef'
d_ftime='define'
-d_ftruncate64='undef'
d_getgrent='undef'
d_getgrps='undef'
d_gethbyaddr='define'
d_gethname='define'
d_gethostprotos='define'
d_getlogin='define'
+d_getmnt='undef'
+d_getmntent='undef'
d_getnbyaddr='undef'
d_getnbyname='undef'
d_getnent='undef'
d_getsbyport='define'
d_getsent='undef'
d_getservprotos='define'
+d_getspent='undef'
+d_getspnam='undef'
d_gettimeod='undef'
d_grpasswd='undef'
+d_hasmntopt='undef'
d_gnulibc='undef'
d_htonl='define'
d_index='undef'
d_inetaton='undef'
-d_ino64t='undef'
d_int64t='undef'
-d_iovec_s='undef'
d_isascii='define'
d_killpg='undef'
d_ldbl_dig='define'
d_lchown='undef'
-d_link='undef'
+d_link='define'
d_locconv='define'
d_lockf='undef'
-d_lockf64='undef'
d_longdbl='define'
d_longlong='undef'
-d_lseek64='undef'
d_lstat='undef'
-d_lstat64='undef'
-d_madvise='undef'
d_mblen='define'
d_mbstowcs='define'
d_mbtowc='define'
+d_memchr='define'
d_memcmp='define'
d_memcpy='define'
d_memmove='define'
d_mkdir='define'
d_mkfifo='undef'
d_mktime='define'
-d_mmap='undef'
-d_mprotect='undef'
d_msg='undef'
d_msg_ctrunc='undef'
d_msg_dontroute='undef'
d_msg_proxy='undef'
d_msgctl='undef'
d_msgget='undef'
-d_msghdr_s='undef'
d_msgrcv='undef'
d_msgsnd='undef'
-d_msync='undef'
-d_munmap='undef'
d_mymalloc='undef'
-d_nextkey64='undef'
d_nice='undef'
-d_off64t='undef'
+d_off64_t='undef'
d_old_pthread_create_joinable='undef'
d_oldpthreads='undef'
d_oldsock='undef'
d_open3='undef'
-d_open64='undef'
-d_opendir64='undef'
d_pathconf='undef'
d_pause='define'
d_phostname='undef'
d_pwcomment='undef'
d_pwexpire='undef'
d_pwgecos='undef'
-d_pwquota='undef'
d_pwpasswd='undef'
+d_pwquota='undef'
+d_quad='undef'
d_readdir='define'
-d_readdir64='undef'
d_readlink='undef'
-d_readv='undef'
-d_recvmesg='undef'
d_rename='define'
d_rewinddir='define'
d_rmdir='define'
d_sched_yield='undef'
d_scm_rights='undef'
d_seekdir='define'
-d_seekdir64='undef'
d_select='define'
d_sem='undef'
d_semctl='undef'
d_semctl_semun='undef'
d_semget='undef'
d_semop='undef'
-d_sendmsg='undef'
d_setegid='undef'
d_seteuid='undef'
d_setgrent='undef'
d_setruid='undef'
d_setsent='undef'
d_setsid='undef'
+d_setspent='undef'
d_setvbuf='define'
d_sfio='undef'
d_shm='undef'
d_sigsetjmp='undef'
d_socket='define'
d_sockpair='undef'
-d_stat64='undef'
+d_sqrtl='undef'
d_statblks='undef'
-d_statfs='undef'
-d_statfsflags='undef'
+d_statfs_f_flags='undef'
+d_statfs_s='undef'
d_statvfs='undef'
d_stdio_cnt_lval='define'
d_stdio_ptr_lval='define'
+d_stdio_stream_array='undef'
d_stdiobase='define'
d_stdstdio='define'
-d_store64='undef'
d_strchr='define'
d_strcoll='define'
d_strctcpy='define'
d_strerror='define'
d_strtod='define'
d_strtol='define'
+d_strtold='undef'
+d_strtoll='undef'
d_strtoul='define'
+d_strtoull='undef'
+d_strtouq='undef'
d_strxfrm='define'
d_suidsafe='undef'
d_symlink='undef'
d_tcgetpgrp='undef'
d_tcsetpgrp='undef'
d_telldir='define'
-d_telldir64='undef'
d_telldirproto='define'
d_time='define'
d_times='define'
-d_tmpfile64='undef'
d_truncate='undef'
-d_truncate64='undef'
d_tzname='define'
d_umask='define'
d_uname='define'
d_union_semun='define'
+d_ustat='undef'
+d_vendorbin='undef'
+d_vendorlib='undef'
d_vfork='undef'
d_void_closedir='undef'
d_voidsig='define'
d_waitpid='define'
d_wcstombs='define'
d_wctomb='define'
-d_writev='undef'
d_xenix='undef'
date='date'
db_hashtype='int'
find='find'
firstmakefile='makefile'
flex=''
+fpossize='4'
fpostype='fpos_t'
freetype='void'
+full_ar=''
full_csh=''
full_sed=''
gccversion=''
+gidformat='"ld"'
+gidsign='-1'
+gidsize='4'
gidtype='gid_t'
glibpth='/usr/shlib /lib/pa1.1 /usr/lib/large /lib /usr/lib /usr/lib/386 /lib/386 /lib/large /usr/lib/small /lib/small /usr/ccs/lib /usr/ucblib /usr/shlib '
grep='grep'
hint='recommended'
hostcat='ypcat hosts'
huge=''
+i16size='2'
+i16type='short'
+i32size='4'
+i32type='long'
+i64size='8'
+i64type='__int64'
+i8size='1'
+i8type='char'
i_arpainet='define'
i_bsdioctl=''
i_db='undef'
i_ndbm='undef'
i_netdb='undef'
i_neterrno='undef'
+i_netinettcp='undef'
i_niin='undef'
i_poll='undef'
+i_pthread='undef'
i_pwd='undef'
i_rpcsvcdbm='define'
i_sfio='undef'
i_sgtty='undef'
+i_shadow='undef'
+i_socks='undef'
i_stdarg='define'
i_stddef='define'
i_stdlib='define'
i_sysfilio='define'
i_sysin='undef'
i_sysioctl='undef'
-i_sysmman='undef'
i_sysmount='undef'
i_sysndir='undef'
i_sysparam='undef'
i_syssecrt='undef'
i_sysselct='undef'
i_syssockio=''
+i_sysstatfs='undef'
i_sysstatvfs='undef'
i_sysstat='define'
i_systime='undef'
i_systypes='define'
i_sysuio='undef'
i_sysun='undef'
+i_sysvfs='undef'
i_syswait='undef'
i_termio='undef'
i_termios='undef'
i_time='define'
i_unistd='undef'
+i_ustat='undef'
i_utime='define'
i_values='undef'
i_varargs='undef'
i_varhdr='varargs.h'
i_vfork='undef'
ignore_versioned_solibs=''
+inc_version_list=''
incpath=''
inews=''
installarchlib='~INST_TOP~~INST_VER~\lib~INST_ARCH~'
installbin='~INST_TOP~~INST_VER~\bin~INST_ARCH~'
installman1dir='~INST_TOP~~INST_VER~\man\man1'
installman3dir='~INST_TOP~~INST_VER~\man\man3'
+installprefix='~INST_TOP~~INST_VER~'
+installprefixexp='~INST_TOP~~INST_VER~'
installhtmldir='~INST_TOP~~INST_VER~\html'
installhtmlhelpdir='~INST_TOP~~INST_VER~\htmlhelp'
installprivlib='~INST_TOP~~INST_VER~\lib'
installscript='~INST_TOP~~INST_VER~\bin'
installsitearch='~INST_TOP~\site~INST_VER~\lib~INST_ARCH~'
installsitelib='~INST_TOP~\site~INST_VER~\lib'
+installstyle='lib'
installusrbinperl='undef'
+installvendorbin=''
+installvendorlib=''
intsize='4'
-known_extensions='DB_File Fcntl GDBM_File NDBM_File ODBM_File Opcode POSIX SDBM_File Socket IO attrs Thread'
+ivdformat='"ld"'
+ivsize='4'
+ivtype='long'
+known_extensions='~static_ext~ ~dynamic_ext~ ~nonxs_ext~'
ksh=''
large=''
ld='link'
lddlflags='-dll ~LINK_FLAGS~'
ldflags='~LINK_FLAGS~'
+ldlibpthname=''
less='less'
lib_ext='.lib'
libc='msvcrt.lib'
man3direxp='~INST_TOP~~INST_VER~\man\man3'
man3ext='3'
medium=''
-mips=''
mips_type=''
mkdir='mkdir'
-mmaptype='void *'
models='none'
modetype='mode_t'
more='more /e'
nm_so_opt=''
nonxs_ext='Errno'
nroff=''
+nvsize='8'
+nvtype='double'
o_nonblock='O_NONBLOCK'
obj_ext='.obj'
old_pthread_create_joinable=''
privlibexp='~INST_TOP~~INST_VER~\lib'
prototype='define'
ptrsize='4'
+quadcase='5'
+quadtype='__int64'
randbits='15'
randfunc='rand'
randseedtype='unsigned'
rm='del'
rmail=''
runnm='true'
+sPRIEldbl='"E"'
+sPRIFldbl='"F"'
+sPRIGldbl='"G"'
+sPRIX64='"lX"'
+sPRId64='"ld"'
+sPRIeldbl='"e"'
+sPRIfldbl='"f"'
+sPRIgldbl='"g"'
+sPRIi64='"li"'
+sPRIo64='"lo"'
+sPRIu64='"lu"'
+sPRIx64='"lx"'
sched_yield=''
scriptdir='~INST_TOP~~INST_VER~\bin'
scriptdirexp='~INST_TOP~~INST_VER~\bin'
shortsize='2'
shrpenv=''
shsharp='true'
+sig_count='26'
sig_name='ZERO NUM01 INT QUIT ILL NUM05 NUM06 NUM07 FPE KILL NUM10 SEGV NUM12 PIPE ALRM TERM NUM16 NUM17 NUM18 NUM19 CHLD BREAK ABRT STOP NUM24 CONT CLD'
sig_name_init='"ZERO", "NUM01", "INT", "QUIT", "ILL", "NUM05", "NUM06", "NUM07", "FPE", "KILL", "NUM10", "SEGV", "NUM12", "PIPE", "ALRM", "TERM", "NUM16", "NUM17", "NUM18", "NUM19", "CHLD", "BREAK", "ABRT", "STOP", "NUM24", "CONT", "CLD", 0'
sig_num='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 20 0'
signal_t='void'
sitearch='~INST_TOP~\site~INST_VER~\lib~INST_ARCH~'
sitearchexp='~INST_TOP~\site~INST_VER~\lib~INST_ARCH~'
+sitebin='~INST_TOP~\site~INST_VER~\bin~INST_ARCH~'
+sitebinexp='~INST_TOP~\site~INST_VER~\bin~INST_ARCH~'
sitelib='~INST_TOP~\site~INST_VER~\lib'
sitelibexp='~INST_TOP~\site~INST_VER~\lib'
+siteprefix='~INST_TOP~\site~INST_VER~'
+siteprefixexp='~INST_TOP~\site~INST_VER~'
sizetype='size_t'
sleep=''
smail=''
stdio_cnt='((fp)->_cnt)'
stdio_filbuf=''
stdio_ptr='((fp)->_ptr)'
+stdio_stream_array=''
strings='/usr/include/string.h'
submit=''
subversion='~SUBVERSION~'
tr=''
trnl='\012'
troff=''
+u16size='2'
+u16type='unsigned short'
+u32size='4'
+u32type='unsigned long'
+u64size='8'
+u64type='unsigned __int64'
+u8size='1'
+u8type='unsigned char'
+uidformat='"ld"'
+uidsign='-1'
+uidsize='4'
uidtype='uid_t'
uname='uname'
uniq='uniq'
+uquadtype='unsigned __int64'
+use5005threads='undef'
use64bits='undef'
usedl='define'
+useithreads='undef'
+uselargefiles='undef'
+uselongdouble='undef'
+uselonglong='undef'
+usemorebits='undef'
usemultiplicity='undef'
usemymalloc='n'
usenm='false'
useposix='true'
usesfio='false'
useshrplib='yes'
+usesocks='undef'
usethreads='undef'
+usevendorprefix='undef'
usevfork='false'
usrinc='/usr/include'
uuname=''
+uvoformat='"lo"'
+uvsize='4'
+uvtype='unsigned long'
+uvuformat='"lu"'
+uvxformat='"lx"'
+vendorbin=''
+vendorbinexp=''
+vendorlib=''
+vendorlibexp=''
+vendorprefix=''
+vendorprefixexp=''
version='~VERSION~'
vi=''
voidflags='15'
xlibpth='/usr/lib/386 /lib/386'
zcat=''
zip='zip'
+PERL_REVISION='~PERL_REVISION~'
+PERL_VERSION='~PERL_VERSION~'
+PERL_SUBVERSION='~PERL_SUBVERSION~'
+PERL_API_REVISION='~PERL_API_REVISION~'
+PERL_API_SUBVERSION='~PERL_API_SUBVERSION~'
+PERL_API_VERSION='~PERL_API_VERSION~'
+PATCHLEVEL='~PERL_VERSION~'
+SUBVERSION='~PERL_SUBVERSION~'
/*
* Package name : perl5
* Source directory :
- * Configuration time: undef
+ * Configuration time: Tue Jan 18 21:01:00 2000
* Configured by : gsar
* Target system :
*/
* This symbol, if defined, indicates that the link routine is
* available to create hard links.
*/
-/*#define HAS_LINK /**/
+#define HAS_LINK /**/
/* HAS_LOCALECONV:
* This symbol, if defined, indicates that the localeconv routine is
*/
#define HAS_MKTIME /**/
-/* HAS_MSYNC:
- * This symbol, if defined, indicates that the msync system call is
- * available to synchronize a mapped file.
- */
-/*#define HAS_MSYNC /**/
-
-/* HAS_MUNMAP:
- * This symbol, if defined, indicates that the munmap system call is
- * available to unmap a region, usually mapped by mmap().
- */
-/*#define HAS_MUNMAP /**/
-
/* HAS_NICE:
* This symbol, if defined, indicates that the nice routine is
* available.
*/
#define STDCHAR unsigned char /**/
-/* HAS_ACCESSX:
- * This symbol, if defined, indicates that the accessx routine is
- * available to do extended access checks.
- */
-/*#define HAS_ACCESSX /**/
-
-/* HAS_EACCESS:
- * This symbol, if defined, indicates that the eaccess routine is
- * available to do extended access checks.
- */
-/*#define HAS_EACCESS /**/
-
-/* I_SYS_ACCESS:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/access.h>.
- */
-/*#define I_SYS_ACCESS /**/
-
-/* I_SYS_SECURITY:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/security.h>.
- */
-/*#define I_SYS_SECURITY /**/
-
/* CROSSCOMPILE:
* This symbol, if defined, signifies that we our
* build process is a cross-compilation.
*/
/*#define MULTIARCH /**/
+/* HAS_QUAD:
+ * This symbol, if defined, tells that there's a 64-bit integer type,
+ * Quad_t, and its unsigned counterpar, Uquad_t. QUADKIND will be one
+ * of QUAD_IS_INT, QUAD_IS_LONG, QUAD_IS_LONG_LONG, or QUAD_IS_INT64_T.
+ */
+/*#define HAS_QUAD /**/
+#ifdef HAS_QUAD
+# define Quad_t __int64 /**/
+# define Uquad_t unsigned __int64 /**/
+# define QUADKIND undef /**/
+# define QUAD_IS_INT 1
+# define QUAD_IS_LONG 2
+# define QUAD_IS_LONG_LONG 3
+# define QUAD_IS_INT64_T 4
+#endif
+
+/* HAS_ACCESSX:
+ * This symbol, if defined, indicates that the accessx routine is
+ * available to do extended access checks.
+ */
+/*#define HAS_ACCESSX /**/
+
+/* HAS_EACCESS:
+ * This symbol, if defined, indicates that the eaccess routine is
+ * available to do extended access checks.
+ */
+/*#define HAS_EACCESS /**/
+
+/* I_SYS_ACCESS:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <sys/access.h>.
+ */
+/*#define I_SYS_ACCESS /**/
+
+/* I_SYS_SECURITY:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <sys/security.h>.
+ */
+/*#define I_SYS_SECURITY /**/
+
+/* OSNAME:
+ * This symbol contains the name of the operating system, as determined
+ * by Configure. You shouldn't rely on it too much; the specific
+ * feature tests from Configure are generally more reliable.
+ */
+#define OSNAME "MSWin32" /**/
+
/* MEM_ALIGNBYTES:
* This symbol contains the number of bytes required to align a
* double. Usual values are 2, 4 and 8. The default is eight,
#define MEM_ALIGNBYTES 8
#endif
+/* ARCHLIB:
+ * This variable, if defined, holds the name of the directory in
+ * which the user wants to put architecture-dependent public
+ * library files for perl5. It is most often a local directory
+ * such as /usr/local/lib. Programs using this variable must be
+ * prepared to deal with filename expansion. If ARCHLIB is the
+ * same as PRIVLIB, it is not defined, since presumably the
+ * program already searches PRIVLIB.
+ */
+/* ARCHLIB_EXP:
+ * This symbol contains the ~name expanded version of ARCHLIB, to be used
+ * in programs that are not prepared to deal with ~ expansion at run-time.
+ */
+#define ARCHLIB "c:\\perl\\5.5.640\\lib\\MSWin32-x86" /**/
+/*#define ARCHLIB_EXP "" /**/
+
+/* ARCHNAME:
+ * This symbol holds a string representing the architecture name.
+ * It may be used to construct an architecture-dependant pathname
+ * where library files may be held under a private library, for
+ * instance.
+ */
+#define ARCHNAME "MSWin32-x86" /**/
+
+/* HAS_ATOLF:
+ * This symbol, if defined, indicates that the atolf routine is
+ * available to convert strings into long doubles.
+ */
+/*#define HAS_ATOLF /**/
+
+/* HAS_ATOLL:
+ * This symbol, if defined, indicates that the atoll routine is
+ * available to convert strings into long longs.
+ */
+/*#define HAS_ATOLL /**/
+
+/* BIN:
+ * This symbol holds the path of the bin directory where the package will
+ * be installed. Program must be prepared to deal with ~name substitution.
+ */
+/* BIN_EXP:
+ * This symbol is the filename expanded version of the BIN symbol, for
+ * programs that do not want to deal with that at run-time.
+ */
+#define BIN "c:\\perl\\5.5.640\\bin\\MSWin32-x86" /**/
+#define BIN_EXP "c:\\perl\\5.5.640\\bin\\MSWin32-x86" /**/
+
+/* PERL_BINCOMPAT_5005:
+ * This symbol, if defined, indicates that Perl 5.006 should be
+ * binary-compatible with Perl 5.005. This is impossible for builds
+ * that use features like threads and multiplicity it is always undef
+ * for those versions.
+ */
+/*#define PERL_BINCOMPAT_5005 /**/
+
/* BYTEORDER:
* This symbol holds the hexadecimal constant defined in byteorder,
* i.e. 0x1234 or 0x4321, etc...
#define BYTEORDER 0x1234 /* large digits for MSB */
#endif /* NeXT */
+/* CAT2:
+ * This macro catenates 2 tokens together.
+ */
+/* STRINGIFY:
+ * This macro surrounds its token with double quotes.
+ */
+#if 42 == 1
+#define CAT2(a,b)a/**/b
+#define STRINGIFY(a)"a"
+ /* If you can get stringification with catify, tell me how! */
+#endif
+#if 42 == 42
+#define CAT2(a,b)a ## b
+#define StGiFy(a)# a
+#define STRINGIFY(a)StGiFy(a)
+#endif
+#if 42 != 1 && 42 != 42
+#include "Bletch: How does this C preprocessor catenate tokens?"
+#endif
+
+/* CPPSTDIN:
+ * This symbol contains the first part of the string which will invoke
+ * the C preprocessor on the standard input and produce to standard
+ * output. Typical value of "cc -E" or "/lib/cpp", but it can also
+ * call a wrapper. See CPPRUN.
+ */
+/* CPPMINUS:
+ * This symbol contains the second part of the string which will invoke
+ * the C preprocessor on the standard input and produce to standard
+ * output. This symbol will have the value "-" if CPPSTDIN needs a minus
+ * to specify standard input, otherwise the value is "".
+ */
+/* CPPRUN:
+ * This symbol contains the string which will invoke a C preprocessor on
+ * the standard input and produce to standard output. It needs to end
+ * with CPPLAST, after all other preprocessor flags have been specified.
+ * The main difference with CPPSTDIN is that this program will never be a
+ * pointer to a shell wrapper, i.e. it will be empty if no preprocessor is
+ * available directly to the user. Note that it may well be different from
+ * the preprocessor used to compile the C program.
+ */
+#define CPPSTDIN "cpp32 -oCON"
+#define CPPMINUS ""
+#define CPPRUN "cpp32 -oCON"
+
+/* HAS_ACCESS:
+ * This manifest constant lets the C program know that the access()
+ * system call is available to check for accessibility using real UID/GID.
+ * (always present on UNIX.)
+ */
+#define HAS_ACCESS /**/
+
/* CASTI32:
* This symbol is defined if the C compiler can cast negative
* or large floating point numbers to 32-bit ints.
*/
/*#define VOID_CLOSEDIR /**/
+/* HAS_CSH:
+ * This symbol, if defined, indicates that the C-shell exists.
+ */
+/* CSH:
+ * This symbol, if defined, contains the full pathname of csh.
+ */
+/*#define HAS_CSH /**/
+#ifdef HAS_CSH
+#define CSH "" /**/
+#endif
+
+/* DLSYM_NEEDS_UNDERSCORE:
+ * This symbol, if defined, indicates that we need to prepend an
+ * underscore to the symbol name before calling dlsym(). This only
+ * makes sense if you *have* dlsym, which we will presume is the
+ * case if you're using dl_dlopen.xs.
+ */
+/*#define DLSYM_NEEDS_UNDERSCORE /**/
+
+/* HAS_DRAND48_PROTO:
+ * This symbol, if defined, indicates that the system provides
+ * a prototype for the drand48() function. Otherwise, it is up
+ * to the program to supply one. A good guess is
+ * extern double drand48 _((void));
+ */
+/*#define HAS_DRAND48_PROTO /**/
+
+/* HAS_ENDGRENT:
+ * This symbol, if defined, indicates that the getgrent routine is
+ * available for finalizing sequential access of the group database.
+ */
+/*#define HAS_ENDGRENT /**/
+
+/* HAS_ENDHOSTENT:
+ * This symbol, if defined, indicates that the endhostent() routine is
+ * available to close whatever was being used for host queries.
+ */
+/*#define HAS_ENDHOSTENT /**/
+
+/* HAS_ENDNETENT:
+ * This symbol, if defined, indicates that the endnetent() routine is
+ * available to close whatever was being used for network queries.
+ */
+/*#define HAS_ENDNETENT /**/
+
+/* HAS_ENDPROTOENT:
+ * This symbol, if defined, indicates that the endprotoent() routine is
+ * available to close whatever was being used for protocol queries.
+ */
+/*#define HAS_ENDPROTOENT /**/
+
+/* HAS_ENDPWENT:
+ * This symbol, if defined, indicates that the getgrent routine is
+ * available for finalizing sequential access of the passwd database.
+ */
+/*#define HAS_ENDPWENT /**/
+
+/* HAS_ENDSERVENT:
+ * This symbol, if defined, indicates that the endservent() routine is
+ * available to close whatever was being used for service queries.
+ */
+/*#define HAS_ENDSERVENT /**/
+
+/* HAS_ENDSPENT:
+ * This symbol, if defined, indicates that the endspent system call is
+ * available to finalize the scan of SysV shadow password entries.
+ */
+/*#define HAS_ENDSPENT /**/
+
/* HAS_FD_SET:
* This symbol, when defined, indicates presence of the fd_set typedef
* in <sys/types.h>
*/
#define HAS_FD_SET /**/
+/* HAS_STRUCT_FS_DATA:
+ * This symbol, if defined, indicates that the struct fs_data
+ * to do statfs() is supported.
+ */
+/*#define HAS_STRUCT_FS_DATA /**/
+
+/* HAS_FSEEKO:
+ * This symbol, if defined, indicates that the fseeko routine is
+ * available to fseek beyond 32 bits (useful for ILP32 hosts).
+ */
+/*#define HAS_FSEEKO /**/
+
+/* HAS_FSTATFS:
+ * This symbol, if defined, indicates that the fstatfs routine is
+ * available to stat filesystems by file descriptors.
+ */
+/*#define HAS_FSTATFS /**/
+/* HAS_FTELLO:
+ * This symbol, if defined, indicates that the ftello routine is
+ * available to ftell beyond 32 bits (useful for ILP32 hosts).
+ */
+/*#define HAS_FTELLO /**/
+
/* Gconvert:
* This preprocessor macro is defined to convert a floating point
* number to a string without a trailing decimal point. This
*/
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
-/* HAS_GNULIBC:
- * This symbol, if defined, indicates to the C program that
- * the GNU C library is being used.
- */
-/*#define HAS_GNULIBC /**/
-/* HAS_ISASCII:
- * This manifest constant lets the C program know that isascii
- * is available.
- */
-#define HAS_ISASCII /**/
-
-/* HAS_LCHOWN:
- * This symbol, if defined, indicates that the lchown routine is
- * available to operate on a symbolic link (instead of following the
- * link).
- */
-/*#define HAS_LCHOWN /**/
-
-/* HAS_OPEN3:
- * This manifest constant lets the C program know that the three
- * argument form of open(2) is available.
- */
-/*#define HAS_OPEN3 /**/
-
-/* HAS_SAFE_BCOPY:
- * This symbol, if defined, indicates that the bcopy routine is available
- * to copy potentially overlapping memory blocks. Otherwise you should
- * probably use memmove() or memcpy(). If neither is defined, roll your
- * own version.
- */
-/*#define HAS_SAFE_BCOPY /**/
-
-/* HAS_SAFE_MEMCPY:
- * This symbol, if defined, indicates that the memcpy routine is available
- * to copy potentially overlapping memory blocks. Otherwise you should
- * probably use memmove() or memcpy(). If neither is defined, roll your
- * own version.
- */
-/*#define HAS_SAFE_MEMCPY /**/
-
-/* HAS_SANE_MEMCMP:
- * This symbol, if defined, indicates that the memcmp routine is available
- * and can be used to compare relative magnitudes of chars with their high
- * bits set. If it is not defined, roll your own version.
- */
-#define HAS_SANE_MEMCMP /**/
-
-/* HAS_SIGACTION:
- * This symbol, if defined, indicates that Vr4's sigaction() routine
- * is available.
- */
-/*#define HAS_SIGACTION /**/
-
-/* HAS_SIGSETJMP:
- * This variable indicates to the C program that the sigsetjmp()
- * routine is available to save the calling process's registers
- * and stack environment for later use by siglongjmp(), and
- * to optionally save the process's signal mask. See
- * Sigjmp_buf, Sigsetjmp, and Siglongjmp.
- */
-/* Sigjmp_buf:
- * This is the buffer type to be used with Sigsetjmp and Siglongjmp.
- */
-/* Sigsetjmp:
- * This macro is used in the same way as sigsetjmp(), but will invoke
- * traditional setjmp() if sigsetjmp isn't available.
- * See HAS_SIGSETJMP.
- */
-/* Siglongjmp:
- * This macro is used in the same way as siglongjmp(), but will invoke
- * traditional longjmp() if siglongjmp isn't available.
- * See HAS_SIGSETJMP.
- */
-/*#define HAS_SIGSETJMP /**/
-#ifdef HAS_SIGSETJMP
-#define Sigjmp_buf sigjmp_buf
-#define Sigsetjmp(buf,save_mask) sigsetjmp((buf),(save_mask))
-#define Siglongjmp(buf,retval) siglongjmp((buf),(retval))
-#else
-#define Sigjmp_buf jmp_buf
-#define Sigsetjmp(buf,save_mask) setjmp((buf))
-#define Siglongjmp(buf,retval) longjmp((buf),(retval))
-#endif
-
-/* USE_STDIO_PTR:
- * This symbol is defined if the _ptr and _cnt fields (or similar)
- * of the stdio FILE structure can be used to access the stdio buffer
- * for a file handle. If this is defined, then the FILE_ptr(fp)
- * and FILE_cnt(fp) macros will also be defined and should be used
- * to access these fields.
- */
-/* FILE_ptr:
- * This macro is used to access the _ptr field (or equivalent) of the
- * FILE structure pointed to by its argument. This macro will always be
- * defined if USE_STDIO_PTR is defined.
- */
-/* STDIO_PTR_LVALUE:
- * This symbol is defined if the FILE_ptr macro can be used as an
- * lvalue.
- */
-/* FILE_cnt:
- * This macro is used to access the _cnt field (or equivalent) of the
- * FILE structure pointed to by its argument. This macro will always be
- * defined if USE_STDIO_PTR is defined.
- */
-/* STDIO_CNT_LVALUE:
- * This symbol is defined if the FILE_cnt macro can be used as an
- * lvalue.
- */
-#define USE_STDIO_PTR /**/
-#ifdef USE_STDIO_PTR
-#define FILE_ptr(fp) ((fp)->curp)
-#define STDIO_PTR_LVALUE /**/
-#define FILE_cnt(fp) ((fp)->level)
-#define STDIO_CNT_LVALUE /**/
-#endif
-
-/* USE_STDIO_BASE:
- * This symbol is defined if the _base field (or similar) of the
- * stdio FILE structure can be used to access the stdio buffer for
- * a file handle. If this is defined, then the FILE_base(fp) macro
- * will also be defined and should be used to access this field.
- * Also, the FILE_bufsiz(fp) macro will be defined and should be used
- * to determine the number of bytes in the buffer. USE_STDIO_BASE
- * will never be defined unless USE_STDIO_PTR is.
- */
-/* FILE_base:
- * This macro is used to access the _base field (or equivalent) of the
- * FILE structure pointed to by its argument. This macro will always be
- * defined if USE_STDIO_BASE is defined.
- */
-/* FILE_bufsiz:
- * This macro is used to determine the number of bytes in the I/O
- * buffer pointed to by _base field (or equivalent) of the FILE
- * structure pointed to its argument. This macro will always be defined
- * if USE_STDIO_BASE is defined.
- */
-#define USE_STDIO_BASE /**/
-#ifdef USE_STDIO_BASE
-#define FILE_base(fp) ((fp)->buffer)
-#define FILE_bufsiz(fp) ((fp)->level + (fp)->curp - (fp)->buffer)
-#endif
-
-/* HAS_VPRINTF:
- * This symbol, if defined, indicates that the vprintf routine is available
- * to printf with a pointer to an argument list. If unavailable, you
- * may need to write your own, probably in terms of _doprnt().
- */
-/* USE_CHAR_VSPRINTF:
- * This symbol is defined if this system has vsprintf() returning type
- * (char*). The trend seems to be to declare it as "int vsprintf()". It
- * is up to the package author to declare vsprintf correctly based on the
- * symbol.
- */
-#define HAS_VPRINTF /**/
-/*#define USE_CHAR_VSPRINTF /**/
-
-/* DOUBLESIZE:
- * This symbol contains the size of a double, so that the C preprocessor
- * can make decisions based on it.
- */
-#define DOUBLESIZE 8 /**/
-
-/* I_TIME:
- * This symbol, if defined, indicates to the C program that it should
- * include <time.h>.
- */
-/* I_SYS_TIME:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/time.h>.
- */
-/* I_SYS_TIME_KERNEL:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/time.h> with KERNEL defined.
- */
-#define I_TIME /**/
-/*#define I_SYS_TIME /**/
-/*#define I_SYS_TIME_KERNEL /**/
-
-/* VAL_O_NONBLOCK:
- * This symbol is to be used during open() or fcntl(F_SETFL) to turn on
- * non-blocking I/O for the file descriptor. Note that there is no way
- * back, i.e. you cannot turn it blocking again this way. If you wish to
- * alternatively switch between blocking and non-blocking, use the
- * ioctl(FIOSNBIO) call instead, but that is not supported by all devices.
- */
-/* VAL_EAGAIN:
- * This symbol holds the errno error code set by read() when no data was
- * present on the non-blocking file descriptor.
- */
-/* RD_NODATA:
- * This symbol holds the return code from read() when no data is present
- * on the non-blocking file descriptor. Be careful! If EOF_NONBLOCK is
- * not defined, then you can't distinguish between no data and EOF by
- * issuing a read(). You'll have to find another way to tell for sure!
- */
-/* EOF_NONBLOCK:
- * This symbol, if defined, indicates to the C program that a read() on
- * a non-blocking file descriptor will return 0 on EOF, and not the value
- * held in RD_NODATA (-1 usually, in that case!).
- */
-#define VAL_O_NONBLOCK O_NONBLOCK
-#define VAL_EAGAIN EAGAIN
-#define RD_NODATA -1
-#define EOF_NONBLOCK
-
-/* PTRSIZE:
- * This symbol contains the size of a pointer, so that the C preprocessor
- * can make decisions based on it. It will be sizeof(void *) if
- * the compiler supports (void *); otherwise it will be
- * sizeof(char *).
- */
-#define PTRSIZE 4 /**/
-
-/* Drand01:
- * This macro is to be used to generate uniformly distributed
- * random numbers over the range [0., 1.[. You may have to supply
- * an 'extern double drand48();' in your program since SunOS 4.1.3
- * doesn't provide you with anything relevant in it's headers.
- * See HAS_DRAND48_PROTO.
- */
-/* Rand_seed_t:
- * This symbol defines the type of the argument of the
- * random seed function.
- */
-/* seedDrand01:
- * This symbol defines the macro to be used in seeding the
- * random number generator (see Drand01).
- */
-/* RANDBITS:
- * This symbol indicates how many bits are produced by the
- * function used to generate normalized random numbers.
- * Values include 15, 16, 31, and 48.
- */
-#define Drand01() (rand()/(double)((unsigned)1<<RANDBITS)) /**/
-#define Rand_seed_t unsigned /**/
-#define seedDrand01(x) srand((Rand_seed_t)x) /**/
-#define RANDBITS 15 /**/
-
-/* SSize_t:
- * This symbol holds the type used by functions that return
- * a count of bytes or an error condition. It must be a signed type.
- * It is usually ssize_t, but may be long or int, etc.
- * It may be necessary to include <sys/types.h> or <unistd.h>
- * to get any typedef'ed information.
- * We will pick a type such that sizeof(SSize_t) == sizeof(Size_t).
- */
-#define SSize_t int /* signed count of bytes */
-
-/* EBCDIC:
- * This symbol, if defined, indicates that this system uses
- * EBCDIC encoding.
- */
-/*#define EBCDIC /**/
-
-/* ARCHLIB:
- * This variable, if defined, holds the name of the directory in
- * which the user wants to put architecture-dependent public
- * library files for perl5. It is most often a local directory
- * such as /usr/local/lib. Programs using this variable must be
- * prepared to deal with filename expansion. If ARCHLIB is the
- * same as PRIVLIB, it is not defined, since presumably the
- * program already searches PRIVLIB.
- */
-/* ARCHLIB_EXP:
- * This symbol contains the ~name expanded version of ARCHLIB, to be used
- * in programs that are not prepared to deal with ~ expansion at run-time.
- */
-#define ARCHLIB "c:\\perl\\5.00561\\lib\\MSWin32-x86" /**/
-/*#define ARCHLIB_EXP "" /**/
-
-/* BIN:
- * This symbol holds the path of the bin directory where the package will
- * be installed. Program must be prepared to deal with ~name substitution.
- */
-/* BIN_EXP:
- * This symbol is the filename expanded version of the BIN symbol, for
- * programs that do not want to deal with that at run-time.
- */
-#define BIN "c:\\perl\\5.00561\\bin\\MSWin32-x86" /**/
-#define BIN_EXP "c:\\perl\\5.00561\\bin\\MSWin32-x86" /**/
-
-/* INSTALL_USR_BIN_PERL:
- * This symbol, if defined, indicates that Perl is to be installed
- * also as /usr/bin/perl.
- */
-/*#define INSTALL_USR_BIN_PERL /**/
-
-/* PRIVLIB:
- * This symbol contains the name of the private library for this package.
- * The library is private in the sense that it needn't be in anyone's
- * execution path, but it should be accessible by the world. The program
- * should be prepared to do ~ expansion.
- */
-/* PRIVLIB_EXP:
- * This symbol contains the ~name expanded version of PRIVLIB, to be used
- * in programs that are not prepared to deal with ~ expansion at run-time.
- */
-#define PRIVLIB "c:\\perl\\5.00561\\lib" /**/
-#define PRIVLIB_EXP (win32_get_privlib("5.00561")) /**/
-
-/* SITEARCH:
- * This symbol contains the name of the private library for this package.
- * The library is private in the sense that it needn't be in anyone's
- * execution path, but it should be accessible by the world. The program
- * should be prepared to do ~ expansion.
- * The standard distribution will put nothing in this directory.
- * Individual sites may place their own extensions and modules in
- * this directory.
- */
-/* SITEARCH_EXP:
- * This symbol contains the ~name expanded version of SITEARCH, to be used
- * in programs that are not prepared to deal with ~ expansion at run-time.
- */
-#define SITEARCH "c:\\perl\\site\\5.00561\\lib\\MSWin32-x86" /**/
-/*#define SITEARCH_EXP "" /**/
-
-/* SITELIB:
- * This symbol contains the name of the private library for this package.
- * The library is private in the sense that it needn't be in anyone's
- * execution path, but it should be accessible by the world. The program
- * should be prepared to do ~ expansion.
- * The standard distribution will put nothing in this directory.
- * Individual sites may place their own extensions and modules in
- * this directory.
- */
-/* SITELIB_EXP:
- * This symbol contains the ~name expanded version of SITELIB, to be used
- * in programs that are not prepared to deal with ~ expansion at run-time.
- */
-#define SITELIB "c:\\perl\\site\\5.00561\\lib" /**/
-#define SITELIB_EXP (win32_get_sitelib("5.00561")) /**/
-
-/* PERL_VENDORLIB_EXP:
- * This symbol contains the ~name expanded version of VENDORLIB, to be used
- * in programs that are not prepared to deal with ~ expansion at run-time.
- */
-/*#define PERL_VENDORLIB_EXP "undef" /**/
-
-/* OSNAME:
- * This symbol contains the name of the operating system, as determined
- * by Configure. You shouldn't rely on it too much; the specific
- * feature tests from Configure are generally more reliable.
- */
-#define OSNAME "MSWin32" /**/
-
-/* CAT2:
- * This macro catenates 2 tokens together.
- */
-/* STRINGIFY:
- * This macro surrounds its token with double quotes.
- */
-#if 42 == 1
-#define CAT2(a,b)a/**/b
-#define STRINGIFY(a)"a"
- /* If you can get stringification with catify, tell me how! */
-#endif
-#if 42 == 42
-#define CAT2(a,b)a ## b
-#define StGiFy(a)# a
-#define STRINGIFY(a)StGiFy(a)
-#endif
-#if 42 != 1 && 42 != 42
-#include "Bletch: How does this C preprocessor catenate tokens?"
-#endif
-
-/* CPPSTDIN:
- * This symbol contains the first part of the string which will invoke
- * the C preprocessor on the standard input and produce to standard
- * output. Typical value of "cc -E" or "/lib/cpp", but it can also
- * call a wrapper. See CPPRUN.
- */
-/* CPPMINUS:
- * This symbol contains the second part of the string which will invoke
- * the C preprocessor on the standard input and produce to standard
- * output. This symbol will have the value "-" if CPPSTDIN needs a minus
- * to specify standard input, otherwise the value is "".
- */
-/* CPPRUN:
- * This symbol contains the string which will invoke a C preprocessor on
- * the standard input and produce to standard output. It needs to end
- * with CPPLAST, after all other preprocessor flags have been specified.
- * The main difference with CPPSTDIN is that this program will never be a
- * pointer to a shell wrapper, i.e. it will be empty if no preprocessor is
- * available directly to the user. Note that it may well be different from
- * the preprocessor used to compile the C program.
- */
-#define CPPSTDIN "cpp32 -oCON"
-#define CPPMINUS ""
-#define CPPRUN "cpp32 -oCON"
-
-/* HAS_ACCESS:
- * This manifest constant lets the C program know that the access()
- * system call is available to check for accessibility using real UID/GID.
- * (always present on UNIX.)
- */
-#define HAS_ACCESS /**/
-
-/* HAS_CSH:
- * This symbol, if defined, indicates that the C-shell exists.
- */
-/* CSH:
- * This symbol, if defined, contains the full pathname of csh.
- */
-/*#define HAS_CSH /**/
-#ifdef HAS_CSH
-#define CSH "" /**/
-#endif
-
-/* HAS_ENDGRENT:
- * This symbol, if defined, indicates that the getgrent routine is
- * available for finalizing sequential access of the group database.
- */
-/*#define HAS_ENDGRENT /**/
-
-/* HAS_ENDHOSTENT:
- * This symbol, if defined, indicates that the endhostent() routine is
- * available to close whatever was being used for host queries.
- */
-/*#define HAS_ENDHOSTENT /**/
-
-/* HAS_ENDNETENT:
- * This symbol, if defined, indicates that the endnetent() routine is
- * available to close whatever was being used for network queries.
- */
-/*#define HAS_ENDNETENT /**/
-
-/* HAS_ENDPROTOENT:
- * This symbol, if defined, indicates that the endprotoent() routine is
- * available to close whatever was being used for protocol queries.
- */
-/*#define HAS_ENDPROTOENT /**/
-
-/* HAS_ENDPWENT:
- * This symbol, if defined, indicates that the getgrent routine is
- * available for finalizing sequential access of the passwd database.
- */
-/*#define HAS_ENDPWENT /**/
-
-/* HAS_ENDSERVENT:
- * This symbol, if defined, indicates that the endservent() routine is
- * available to close whatever was being used for service queries.
- */
-/*#define HAS_ENDSERVENT /**/
-
/* HAS_GETGRENT:
* This symbol, if defined, indicates that the getgrent routine is
* available for sequential access of the group database.
#define PHOSTNAME "" /* How to get the host name */
#endif
+/* HAS_GETHOST_PROTOS:
+ * This symbol, if defined, indicates that <netdb.h> includes
+ * prototypes for gethostent(), gethostbyname(), and
+ * gethostbyaddr(). Otherwise, it is up to the program to guess
+ * them. See netdbtype.U for probing for various Netdb_xxx_t types.
+ */
+#define HAS_GETHOST_PROTOS /**/
+
+/* HAS_GETMNT:
+ * This symbol, if defined, indicates that the getmnt routine is
+ * available to get filesystem mount info by filename.
+ */
+/*#define HAS_GETMNT /**/
+
+/* HAS_GETMNTENT:
+ * This symbol, if defined, indicates that the getmntent routine is
+ * available to iterate through mounted file systems to get their info.
+ */
+/*#define HAS_GETMNTENT /**/
+
/* HAS_GETNETBYADDR:
* This symbol, if defined, indicates that the getnetbyaddr() routine is
* available to look up networks by their IP addresses.
*/
/*#define HAS_GETNETENT /**/
+/* HAS_GETNET_PROTOS:
+ * This symbol, if defined, indicates that <netdb.h> includes
+ * prototypes for getnetent(), getnetbyname(), and
+ * getnetbyaddr(). Otherwise, it is up to the program to guess
+ * them. See netdbtype.U for probing for various Netdb_xxx_t types.
+ */
+/*#define HAS_GETNET_PROTOS /**/
+
/* HAS_GETPROTOENT:
* This symbol, if defined, indicates that the getprotoent() routine is
* available to look up protocols in some data base or another.
#define HAS_GETPROTOBYNAME /**/
#define HAS_GETPROTOBYNUMBER /**/
+/* HAS_GETPROTO_PROTOS:
+ * This symbol, if defined, indicates that <netdb.h> includes
+ * prototypes for getprotoent(), getprotobyname(), and
+ * getprotobyaddr(). Otherwise, it is up to the program to guess
+ * them. See netdbtype.U for probing for various Netdb_xxx_t types.
+ */
+#define HAS_GETPROTO_PROTOS /**/
+
/* HAS_GETPWENT:
* This symbol, if defined, indicates that the getpwent routine is
* available for sequential access of the passwd database.
*/
/*#define HAS_GETSERVENT /**/
+/* HAS_GETSERV_PROTOS:
+ * This symbol, if defined, indicates that <netdb.h> includes
+ * prototypes for getservent(), getservbyname(), and
+ * getservbyaddr(). Otherwise, it is up to the program to guess
+ * them. See netdbtype.U for probing for various Netdb_xxx_t types.
+ */
+#define HAS_GETSERV_PROTOS /**/
+
+/* HAS_GETSPENT:
+ * This symbol, if defined, indicates that the getspent system call is
+ * available to retrieve SysV shadow password entries sequentially.
+ */
+/*#define HAS_GETSPENT /**/
+
+/* HAS_GETSPNAM:
+ * This symbol, if defined, indicates that the getspnam system call is
+ * available to retrieve SysV shadow password entries by name.
+ */
+/*#define HAS_GETSPNAM /**/
+
/* HAS_GETSERVBYNAME:
* This symbol, if defined, indicates that the getservbyname()
* routine is available to look up services by their name.
#define HAS_GETSERVBYNAME /**/
#define HAS_GETSERVBYPORT /**/
+/* HAS_GNULIBC:
+ * This symbol, if defined, indicates to the C program that
+ * the GNU C library is being used.
+ */
+/*#define HAS_GNULIBC /**/
+/* HAS_HASMNTOPT:
+ * This symbol, if defined, indicates that the hasmntopt routine is
+ * available to query the mount options of file systems.
+ */
+/*#define HAS_HASMNTOPT /**/
+
/* HAS_HTONL:
* This symbol, if defined, indicates that the htonl() routine (and
* friends htons() ntohl() ntohs()) are available to do network
#define HAS_NTOHL /**/
#define HAS_NTOHS /**/
+/* HAS_ISASCII:
+ * This manifest constant lets the C program know that isascii
+ * is available.
+ */
+#define HAS_ISASCII /**/
+
+/* HAS_LCHOWN:
+ * This symbol, if defined, indicates that the lchown routine is
+ * available to operate on a symbolic link (instead of following the
+ * link).
+ */
+/*#define HAS_LCHOWN /**/
+
+/* HAS_LDBL_DIG:
+ * This symbol, if defined, indicates that this system's <float.h>
+ * or <limits.h> defines the symbol LDBL_DIG, which is the number
+ * of significant digits in a long double precision number. Unlike
+ * for DBL_DIG, there's no good guess for LDBL_DIG if it is undefined.
+ */
+#define HAS_LDBL_DIG /**/
+
/* HAS_LONG_DOUBLE:
* This symbol will be defined if the C compiler supports long
* doubles.
* C preprocessor can make decisions based on it. It is only
* defined if the system supports long long.
*/
-/*#define HAS_LONG_LONG /**/
-#ifdef HAS_LONG_LONG
-#define LONGLONGSIZE 8 /**/
-#endif
-
-/* HAS_MEMCHR:
- * This symbol, if defined, indicates that the memchr routine is available
- * to locate characters within a C string.
+/*#define HAS_LONG_LONG /**/
+#ifdef HAS_LONG_LONG
+#define LONGLONGSIZE 8 /**/
+#endif
+
+/* HAS_MEMCHR:
+ * This symbol, if defined, indicates that the memchr routine is available
+ * to locate characters within a C string.
+ */
+#define HAS_MEMCHR /**/
+
+/* HAS_MSG:
+ * This symbol, if defined, indicates that the entire msg*(2) library is
+ * supported (IPC mechanism based on message queues).
+ */
+/*#define HAS_MSG /**/
+
+/* HAS_OPEN3:
+ * This manifest constant lets the C program know that the three
+ * argument form of open(2) is available.
+ */
+/*#define HAS_OPEN3 /**/
+
+/* OLD_PTHREAD_CREATE_JOINABLE:
+ * This symbol, if defined, indicates how to create pthread
+ * in joinable (aka undetached) state. NOTE: not defined
+ * if pthread.h already has defined PTHREAD_CREATE_JOINABLE
+ * (the new version of the constant).
+ * If defined, known values are PTHREAD_CREATE_UNDETACHED
+ * and __UNDETACHED.
+ */
+/*#define OLD_PTHREAD_CREATE_JOINABLE /**/
+
+/* HAS_PTHREAD_YIELD:
+ * This symbol, if defined, indicates that the pthread_yield
+ * routine is available to yield the execution of the current
+ * thread. sched_yield is preferable to pthread_yield.
+ */
+/* SCHED_YIELD:
+ * This symbol defines the way to yield the execution of
+ * the current thread. Known ways are sched_yield,
+ * pthread_yield, and pthread_yield with NULL.
+ */
+/* HAS_SCHED_YIELD:
+ * This symbol, if defined, indicates that the sched_yield
+ * routine is available to yield the execution of the current
+ * thread. sched_yield is preferable to pthread_yield.
*/
-/*#define HAS_MEMCHR /**/
+/*#define HAS_PTHREAD_YIELD /**/
+#define SCHED_YIELD /**/
+/*#define HAS_SCHED_YIELD /**/
-/* HAS_MMAP:
- * This symbol, if defined, indicates that the mmap system call is
- * available to map a file into memory.
+/* HAS_SAFE_BCOPY:
+ * This symbol, if defined, indicates that the bcopy routine is available
+ * to copy potentially overlapping memory blocks. Otherwise you should
+ * probably use memmove() or memcpy(). If neither is defined, roll your
+ * own version.
*/
-/* Mmap_t:
- * This symbol holds the return type of the mmap() system call
- * (and simultaneously the type of the first argument).
- * Usually set to 'void *' or 'cadd_t'.
+/*#define HAS_SAFE_BCOPY /**/
+
+/* HAS_SAFE_MEMCPY:
+ * This symbol, if defined, indicates that the memcpy routine is available
+ * to copy potentially overlapping memory blocks. Otherwise you should
+ * probably use memmove() or memcpy(). If neither is defined, roll your
+ * own version.
*/
-/*#define HAS_MMAP /**/
-#define Mmap_t void * /**/
+/*#define HAS_SAFE_MEMCPY /**/
-/* HAS_MSG:
- * This symbol, if defined, indicates that the entire msg*(2) library is
- * supported (IPC mechanism based on message queues).
+/* HAS_SANE_MEMCMP:
+ * This symbol, if defined, indicates that the memcmp routine is available
+ * and can be used to compare relative magnitudes of chars with their high
+ * bits set. If it is not defined, roll your own version.
*/
-/*#define HAS_MSG /**/
+#define HAS_SANE_MEMCMP /**/
/* HAS_SEM:
* This symbol, if defined, indicates that the entire sem*(2) library is
*/
/*#define HAS_SETSERVENT /**/
+/* HAS_SETSPENT:
+ * This symbol, if defined, indicates that the setspent system call is
+ * available to initialize the scan of SysV shadow password entries.
+ */
+/*#define HAS_SETSPENT /**/
+
/* HAS_SETVBUF:
* This symbol, if defined, indicates that the setvbuf routine is
* available to change buffering on an open stdio stream.
*/
#define HAS_SETVBUF /**/
+/* USE_SFIO:
+ * This symbol, if defined, indicates that sfio should
+ * be used.
+ */
+/*#define USE_SFIO /**/
+
/* HAS_SHM:
* This symbol, if defined, indicates that the entire shm*(2) library is
* supported.
*/
/*#define HAS_SHM /**/
+/* HAS_SIGACTION:
+ * This symbol, if defined, indicates that Vr4's sigaction() routine
+ * is available.
+ */
+/*#define HAS_SIGACTION /**/
+
+/* HAS_SIGSETJMP:
+ * This variable indicates to the C program that the sigsetjmp()
+ * routine is available to save the calling process's registers
+ * and stack environment for later use by siglongjmp(), and
+ * to optionally save the process's signal mask. See
+ * Sigjmp_buf, Sigsetjmp, and Siglongjmp.
+ */
+/* Sigjmp_buf:
+ * This is the buffer type to be used with Sigsetjmp and Siglongjmp.
+ */
+/* Sigsetjmp:
+ * This macro is used in the same way as sigsetjmp(), but will invoke
+ * traditional setjmp() if sigsetjmp isn't available.
+ * See HAS_SIGSETJMP.
+ */
+/* Siglongjmp:
+ * This macro is used in the same way as siglongjmp(), but will invoke
+ * traditional longjmp() if siglongjmp isn't available.
+ * See HAS_SIGSETJMP.
+ */
+/*#define HAS_SIGSETJMP /**/
+#ifdef HAS_SIGSETJMP
+#define Sigjmp_buf sigjmp_buf
+#define Sigsetjmp(buf,save_mask) sigsetjmp((buf),(save_mask))
+#define Siglongjmp(buf,retval) siglongjmp((buf),(retval))
+#else
+#define Sigjmp_buf jmp_buf
+#define Sigsetjmp(buf,save_mask) setjmp((buf))
+#define Siglongjmp(buf,retval) longjmp((buf),(retval))
+#endif
+
/* HAS_SOCKET:
* This symbol, if defined, indicates that the BSD socket interface is
* supported.
* Checking just with #ifdef might not be enough because this symbol
* has been known to be an enum.
*/
-/* HAS_SENDMSG:
- * This symbol, if defined, indicates that the sendmsg is supported
- * to send messages between sockets. You will also need struct
- * iovec from <sys/uio.h>, HAS_STRUCT_IOVEC and I_SYSUIO.
- */
-/* HAS_RECVMSG:
- * This symbol, if defined, indicates that the recvmsg is supported
- * to send messages between sockets. You will also need struct
- * iovec from <sys/uio.h>, HAS_STRUCT_IOVEC and I_SYSUIO.
- */
-/* HAS_STRUCT_MSGHDR:
- * This symbol, if defined, indicates that the struct msghdr
- * (BSD 4.3 or 4.4) is supported. You will also need struct
- * iovec from <sys/uio.h>, HAS_STRUCT_IOVEC and I_SYSUIO.
- */
-/* HAS_STRUCT_CMSGHDR:
- * This symbol, if defined, indicates that the struct cmsghdr
- * (BSD 4.4) is supported. You will also need struct
- * iovec from <sys/uio.h>, HAS_STRUCT_IOVEC and I_SYSUIO.
- */
#define HAS_SOCKET /**/
/*#define HAS_SOCKETPAIR /**/
/*#define HAS_MSG_CTRUNC /**/
/*#define HAS_MSG_PEEK /**/
/*#define HAS_MSG_PROXY /**/
/*#define HAS_SCM_RIGHTS /**/
-/*#define HAS_SENDMSG /**/
-/*#define HAS_RECVMSG /**/
-/*#define HAS_STRUCT_MSGHDR /**/
-/*#define HAS_STRUCT_CMSGHDR /**/
+
+/* HAS_SQRTL:
+ * This symbol, if defined, indicates that the sqrtl routine is
+ * available to do long double square roots.
+ */
+/*#define HAS_SQRTL /**/
/* USE_STAT_BLOCKS:
* This symbol is defined if this system has a stat structure declaring
* st_blksize and st_blocks.
*/
+#ifndef USE_STAT_BLOCKS
/*#define USE_STAT_BLOCKS /**/
+#endif
+
+/* HAS_STRUCT_STATFS_F_FLAGS:
+ * This symbol, if defined, indicates that the struct statfs
+ * does have the f_flags member containing the mount flags of
+ * the filesystem containing the file.
+ * This kind of struct statfs is coming from <sys/mount.h> (BSD 4.3),
+ * not from <sys/statfs.h> (SYSV). Older BSDs (like Ultrix) do not
+ * have statfs() and struct statfs, they have ustat() and getmnt()
+ * with struct ustat and struct fs_data.
+ */
+/*#define HAS_STRUCT_STATFS_F_FLAGS /**/
+
+/* HAS_STRUCT_STATFS:
+ * This symbol, if defined, indicates that the struct statfs
+ * to do statfs() is supported.
+ */
+/*#define HAS_STRUCT_STATFS /**/
+
+/* HAS_FSTATVFS:
+ * This symbol, if defined, indicates that the fstatvfs routine is
+ * available to stat filesystems by file descriptors.
+ */
+/*#define HAS_FSTATVFS /**/
+
+/* USE_STDIO_PTR:
+ * This symbol is defined if the _ptr and _cnt fields (or similar)
+ * of the stdio FILE structure can be used to access the stdio buffer
+ * for a file handle. If this is defined, then the FILE_ptr(fp)
+ * and FILE_cnt(fp) macros will also be defined and should be used
+ * to access these fields.
+ */
+/* FILE_ptr:
+ * This macro is used to access the _ptr field (or equivalent) of the
+ * FILE structure pointed to by its argument. This macro will always be
+ * defined if USE_STDIO_PTR is defined.
+ */
+/* STDIO_PTR_LVALUE:
+ * This symbol is defined if the FILE_ptr macro can be used as an
+ * lvalue.
+ */
+/* FILE_cnt:
+ * This macro is used to access the _cnt field (or equivalent) of the
+ * FILE structure pointed to by its argument. This macro will always be
+ * defined if USE_STDIO_PTR is defined.
+ */
+/* STDIO_CNT_LVALUE:
+ * This symbol is defined if the FILE_cnt macro can be used as an
+ * lvalue.
+ */
+#define USE_STDIO_PTR /**/
+#ifdef USE_STDIO_PTR
+#define FILE_ptr(fp) ((fp)->curp)
+#define STDIO_PTR_LVALUE /**/
+#define FILE_cnt(fp) ((fp)->level)
+#define STDIO_CNT_LVALUE /**/
+#endif
+
+/* USE_STDIO_BASE:
+ * This symbol is defined if the _base field (or similar) of the
+ * stdio FILE structure can be used to access the stdio buffer for
+ * a file handle. If this is defined, then the FILE_base(fp) macro
+ * will also be defined and should be used to access this field.
+ * Also, the FILE_bufsiz(fp) macro will be defined and should be used
+ * to determine the number of bytes in the buffer. USE_STDIO_BASE
+ * will never be defined unless USE_STDIO_PTR is.
+ */
+/* FILE_base:
+ * This macro is used to access the _base field (or equivalent) of the
+ * FILE structure pointed to by its argument. This macro will always be
+ * defined if USE_STDIO_BASE is defined.
+ */
+/* FILE_bufsiz:
+ * This macro is used to determine the number of bytes in the I/O
+ * buffer pointed to by _base field (or equivalent) of the FILE
+ * structure pointed to its argument. This macro will always be defined
+ * if USE_STDIO_BASE is defined.
+ */
+#define USE_STDIO_BASE /**/
+#ifdef USE_STDIO_BASE
+#define FILE_base(fp) ((fp)->buffer)
+#define FILE_bufsiz(fp) ((fp)->level + (fp)->curp - (fp)->buffer)
+#endif
/* HAS_STRERROR:
* This symbol, if defined, indicates that the strerror routine is
#define HAS_SYS_ERRLIST /**/
#define Strerror(e) strerror(e)
+/* HAS_STRTOLD:
+ * This symbol, if defined, indicates that the strtold routine is
+ * available to convert strings to long doubles.
+ */
+/*#define HAS_STRTOLD /**/
+
+/* HAS_STRTOLL:
+ * This symbol, if defined, indicates that the strtoll routine is
+ * available to convert strings to long longs.
+ */
+/*#define HAS_STRTOLL /**/
+
+/* HAS_STRTOULL:
+ * This symbol, if defined, indicates that the strtoull routine is
+ * available to convert strings to unsigned long longs.
+ */
+/*#define HAS_STRTOULL /**/
+
+/* HAS_STRTOUQ:
+ * This symbol, if defined, indicates that the strtouq routine is
+ * available to convert strings to unsigned long longs (quads).
+ */
+/*#define HAS_STRTOUQ /**/
+
+/* HAS_TELLDIR_PROTO:
+ * This symbol, if defined, indicates that the system provides
+ * a prototype for the telldir() function. Otherwise, it is up
+ * to the program to supply one. A good guess is
+ * extern long telldir _((DIR*));
+ */
+#define HAS_TELLDIR_PROTO /**/
+
+/* Time_t:
+ * This symbol holds the type returned by time(). It can be long,
+ * or time_t on BSD sites (in which case <sys/types.h> should be
+ * included).
+ */
+#define Time_t time_t /* Time type */
+
+/* HAS_TIMES:
+ * This symbol, if defined, indicates that the times() routine exists.
+ * Note that this became obsolete on some systems (SUNOS), which now
+ * use getrusage(). It may be necessary to include <sys/times.h>.
+ */
+#define HAS_TIMES /**/
+
/* HAS_UNION_SEMUN:
* This symbol, if defined, indicates that the union semun is
* defined by including <sys/sem.h>. If not, the user code
/*#define USE_SEMCTL_SEMUN /**/
/*#define USE_SEMCTL_SEMID_DS /**/
+/* HAS_USTAT:
+ * This symbol, if defined, indicates that the ustat system call is
+ * available to query file system statistics by dev_t.
+ */
+/*#define HAS_USTAT /**/
+
/* HAS_VFORK:
* This symbol, if defined, indicates that vfork() exists.
*/
* a signal handler using "Signal_t (*handler)()", and define the
* handler using "Signal_t handler(sig)".
*/
-#define Signal_t void /* Signal handler's return type */
+#define Signal_t void /* Signal handler's return type */
+
+/* HAS_VPRINTF:
+ * This symbol, if defined, indicates that the vprintf routine is available
+ * to printf with a pointer to an argument list. If unavailable, you
+ * may need to write your own, probably in terms of _doprnt().
+ */
+/* USE_CHAR_VSPRINTF:
+ * This symbol is defined if this system has vsprintf() returning type
+ * (char*). The trend seems to be to declare it as "int vsprintf()". It
+ * is up to the package author to declare vsprintf correctly based on the
+ * symbol.
+ */
+#define HAS_VPRINTF /**/
+/*#define USE_CHAR_VSPRINTF /**/
+
+/* USE_DYNAMIC_LOADING:
+ * This symbol, if defined, indicates that dynamic loading of
+ * some sort is available.
+ */
+#define USE_DYNAMIC_LOADING /**/
+
+/* DOUBLESIZE:
+ * This symbol contains the size of a double, so that the C preprocessor
+ * can make decisions based on it.
+ */
+#define DOUBLESIZE 8 /**/
+
+/* EBCDIC:
+ * This symbol, if defined, indicates that this system uses
+ * EBCDIC encoding.
+ */
+/*#define EBCDIC /**/
+
+/* FFLUSH_NULL:
+ * This symbol, if defined, tells that fflush(NULL) does flush
+ * all pending stdio output.
+ */
+/* FFLUSH_ALL:
+ * This symbol, if defined, tells that to flush
+ * all pending stdio output one must loop through all
+ * the stdio file handles stored in an array and fflush them.
+ * Note that if fflushNULL is defined, fflushall will not
+ * even be probed for and will be left undefined.
+ */
+#define FFLUSH_NULL /**/
+/*#define FFLUSH_ALL /**/
+
+/* Fpos_t:
+ * This symbol holds the type used to declare file positions in libc.
+ * It can be fpos_t, long, uint, etc... It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
+ */
+#define Fpos_t fpos_t /* File position type */
+
+/* Gid_t_f:
+ * This symbol defines the format string used for printing a Gid_t.
+ */
+#define Gid_t_f "d" /**/
+
+/* Gid_t_size:
+ * This symbol holds the size of a Gid_t in bytes.
+ */
+#define Gid_t_size 4 /* GID size */
+
+/* Gid_t:
+ * This symbol holds the return type of getgid() and the type of
+ * argument to setrgid() and related functions. Typically,
+ * it is the type of group ids in the kernel. It can be int, ushort,
+ * uid_t, etc... It may be necessary to include <sys/types.h> to get
+ * any typedef'ed information.
+ */
+#define Gid_t gid_t /* Type for getgid(), etc... */
/* Groups_t:
* This symbol holds the type used for the second argument to
#define Groups_t gid_t /* Type for 2nd arg to [sg]etgroups() */
#endif
+/* DB_Prefix_t:
+ * This symbol contains the type of the prefix structure element
+ * in the <db.h> header file. In older versions of DB, it was
+ * int, while in newer ones it is u_int32_t.
+ */
+/* DB_Hash_t:
+ * This symbol contains the type of the prefix structure element
+ * in the <db.h> header file. In older versions of DB, it was
+ * int, while in newer ones it is size_t.
+ */
+#define DB_Hash_t int /**/
+#define DB_Prefix_t int /**/
+
/* I_GRP:
* This symbol, if defined, indicates to the C program that it should
* include <grp.h>.
/*#define I_GRP /**/
/*#define GRPASSWD /**/
+/* I_INTTYPES:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <inttypes.h>.
+ */
+/*#define I_INTTYPES /**/
+
+/* I_MACH_CTHREADS:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <mach/cthreads.h>.
+ */
+/*#define I_MACH_CTHREADS /**/
+
+/* I_MNTENT:
+ * This symbol, if defined, indicates that <mntent.h> exists and
+ * should be included.
+ */
+/*#define I_MNTENT /**/
+
/* I_NETDB:
* This symbol, if defined, indicates that <netdb.h> exists and
* should be included.
*/
/*#define I_NETDB /**/
+/* I_NETINET_TCP:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <netinet/tcp.h>.
+ */
+/*#define I_NETINET_TCP /**/
+
+/* I_POLL:
+ * This symbol, if defined, indicates that <poll.h> exists and
+ * should be included.
+ */
+/*#define I_POLL /**/
+
+/* I_PTHREAD:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <pthread.h>.
+ */
+/*#define I_PTHREAD /**/
+
/* I_PWD:
* This symbol, if defined, indicates to the C program that it should
* include <pwd.h>.
/*#define PWGECOS /**/
/*#define PWPASSWD /**/
+/* I_SHADOW:
+ * This symbol, if defined, indicates that <shadow.h> exists and
+ * should be included.
+ */
+/*#define I_SHADOW /**/
+
+/* I_SOCKS:
+ * This symbol, if defined, indicates that <socks.h> exists and
+ * should be included.
+ */
+/*#define I_SOCKS /**/
+
+/* I_SYS_MOUNT:
+ * This symbol, if defined, indicates that <sys/mount.h> exists and
+ * should be included.
+ */
+/*#define I_SYS_MOUNT /**/
+
+/* I_SYS_STATFS:
+ * This symbol, if defined, indicates that <sys/statfs.h> exists.
+ */
+/*#define I_SYS_STATFS /**/
+
+/* I_SYS_STATVFS:
+ * This symbol, if defined, indicates that <sys/statvfs.h> exists and
+ * should be included.
+ */
+/*#define I_SYS_STATVFS /**/
+
/* I_SYSUIO:
* This symbol, if defined, indicates that <sys/uio.h> exists and
* should be included.
*/
/*#define I_SYSUIO /**/
+/* I_SYS_VFS:
+ * This symbol, if defined, indicates that <sys/vfs.h> exists and
+ * should be included.
+ */
+/*#define I_SYS_VFS /**/
+
+/* I_TIME:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <time.h>.
+ */
+/* I_SYS_TIME:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <sys/time.h>.
+ */
+/* I_SYS_TIME_KERNEL:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <sys/time.h> with KERNEL defined.
+ */
+#define I_TIME /**/
+/*#define I_SYS_TIME /**/
+/*#define I_SYS_TIME_KERNEL /**/
+
+/* I_USTAT:
+ * This symbol, if defined, indicates that <ustat.h> exists and
+ * should be included.
+ */
+/*#define I_USTAT /**/
+
+/* PERL_INC_VERSION_LIST:
+ * This variable specifies the list of subdirectories in over
+ * which perl.c:incpush() and lib/lib.pm will automatically
+ * search when adding directories to @INC, in a format suitable
+ * for a C initialization string. See the inc_version_list entry
+ * in Porting/Glossary for more details.
+ */
+#define PERL_INC_VERSION_LIST /**/
+
+/* HAS_OFF64_T:
+ * This symbol will be defined if the C compiler supports off64_t.
+ */
+/* HAS_FPOS64_T:
+ * This symbol will be defined if the C compiler supports fpos64_t.
+ */
+/*#define HAS_OFF64_T /**/
+/*#define HAS_FPOS64_T /**/
+
+/* PERL_PRIfldbl:
+ * This symbol, if defined, contains the string used by stdio to
+ * format long doubles (format 'f') for output.
+ */
+/* PERL_PRIgldbl:
+ * This symbol, if defined, contains the string used by stdio to
+ * format long doubles (format 'g') for output.
+ */
+/*#define PERL_PRIfldbl "f" /**/
+/*#define PERL_PRIgldbl "g" /**/
+
+/* Off_t:
+ * This symbol holds the type used to declare offsets in the kernel.
+ * It can be int, long, off_t, etc... It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
+ */
+/* LSEEKSIZE:
+ * This symbol holds the number of bytes used by the Off_t.
+ */
+/* Off_t_size:
+ * This symbol holds the number of bytes used by the Off_t.
+ */
+#define Off_t off_t /* <offset> type */
+#define LSEEKSIZE 4 /* <offset> size */
+#define Off_t_size 4 /* <offset> size */
+
/* Free_t:
* This variable contains the return type of free(). It is usually
* void, but occasionally int.
*/
/*#define MYMALLOC /**/
-/* SIG_NAME:
- * This symbol contains a list of signal names in order of
- * signal number. This is intended
- * to be used as a static array initialization, like this:
- * char *sig_name[] = { SIG_NAME };
- * The signals in the list are separated with commas, and each signal
- * is surrounded by double quotes. There is no leading SIG in the signal
- * name, i.e. SIGQUIT is known as "QUIT".
- * Gaps in the signal numbers (up to NSIG) are filled in with NUMnn,
- * etc., where nn is the actual signal number (e.g. NUM37).
- * The signal number for sig_name[i] is stored in sig_num[i].
- * The last element is 0 to terminate the list with a NULL. This
- * corresponds to the 0 at the end of the sig_num list.
- */
-/* SIG_NUM:
- * This symbol contains a list of signal numbers, in the same order as the
- * SIG_NAME list. It is suitable for static array initialization, as in:
- * int sig_num[] = { SIG_NUM };
- * The signals in the list are separated with commas, and the indices
- * within that list and the SIG_NAME list match, so it's easy to compute
- * the signal name from a number or vice versa at the price of a small
- * dynamic linear lookup.
- * Duplicates are allowed, but are moved to the end of the list.
- * The signal number corresponding to sig_name[i] is sig_number[i].
- * if (i < NSIG) then sig_number[i] == i.
- * The last element is 0, corresponding to the 0 at the end of
- * the sig_name list.
+/* Mode_t:
+ * This symbol holds the type used to declare file modes
+ * for systems calls. It is usually mode_t, but may be
+ * int or unsigned short. It may be necessary to include <sys/types.h>
+ * to get any typedef'ed information.
*/
-#define SIG_NAME "ZERO", "NUM01", "INT", "QUIT", "ILL", "NUM05", "NUM06", "NUM07", "FPE", "KILL", "NUM10", "SEGV", "NUM12", "PIPE", "ALRM", "TERM", "USR1", "USR2", "CHLD", "NUM19", "USR3", "BREAK", "ABRT", "STOP", "NUM24", "CONT", "CLD", 0 /**/
-#define SIG_NUM 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 18, 0 /**/
+#define Mode_t mode_t /* file mode parameter for system calls */
-/* VOIDFLAGS:
- * This symbol indicates how much support of the void type is given by this
- * compiler. What various bits mean:
- *
- * 1 = supports declaration of void
- * 2 = supports arrays of pointers to functions returning void
- * 4 = supports comparisons between pointers to void functions and
- * addresses of void functions
- * 8 = suports declaration of generic void pointers
- *
- * The package designer should define VOIDUSED to indicate the requirements
- * of the package. This can be done either by #defining VOIDUSED before
- * including config.h, or by defining defvoidused in Myinit.U. If the
- * latter approach is taken, only those flags will be tested. If the
- * level of void support necessary is not present, defines void to int.
+/* VAL_O_NONBLOCK:
+ * This symbol is to be used during open() or fcntl(F_SETFL) to turn on
+ * non-blocking I/O for the file descriptor. Note that there is no way
+ * back, i.e. you cannot turn it blocking again this way. If you wish to
+ * alternatively switch between blocking and non-blocking, use the
+ * ioctl(FIOSNBIO) call instead, but that is not supported by all devices.
*/
-#ifndef VOIDUSED
-#define VOIDUSED 15
-#endif
-#define VOIDFLAGS 15
-#if (VOIDFLAGS & VOIDUSED) != VOIDUSED
-#define void int /* is void to be avoided? */
-#define M_VOID /* Xenix strikes again */
-#endif
-
-/* HAS_ATOLF:
- * This symbol, if defined, indicates that the atolf routine is
- * available to convert strings into long doubles.
+/* VAL_EAGAIN:
+ * This symbol holds the errno error code set by read() when no data was
+ * present on the non-blocking file descriptor.
*/
-/*#define HAS_ATOLF /**/
-
-/* HAS_ATOLL:
- * This symbol, if defined, indicates that the atoll routine is
- * available to convert strings into long longs.
+/* RD_NODATA:
+ * This symbol holds the return code from read() when no data is present
+ * on the non-blocking file descriptor. Be careful! If EOF_NONBLOCK is
+ * not defined, then you can't distinguish between no data and EOF by
+ * issuing a read(). You'll have to find another way to tell for sure!
*/
-/*#define HAS_ATOLL /**/
-
-/* PERL_BINCOMPAT_5005:
- * This symbol, if defined, indicates that Perl 5.006 should be
- * binary-compatible with Perl 5.005. This is impossible for builds
- * that use features like threads and multiplicity it is always undef
- * for those versions.
+/* EOF_NONBLOCK:
+ * This symbol, if defined, indicates to the C program that a read() on
+ * a non-blocking file descriptor will return 0 on EOF, and not the value
+ * held in RD_NODATA (-1 usually, in that case!).
*/
-/*#define PERL_BINCOMPAT_5005 /**/
+#define VAL_O_NONBLOCK O_NONBLOCK
+#define VAL_EAGAIN EAGAIN
+#define RD_NODATA -1
+#define EOF_NONBLOCK
-/* DLSYM_NEEDS_UNDERSCORE:
- * This symbol, if defined, indicates that we need to prepend an
- * underscore to the symbol name before calling dlsym(). This only
- * makes sense if you *have* dlsym, which we will presume is the
- * case if you're using dl_dlopen.xs.
+/* Netdb_host_t:
+ * This symbol holds the type used for the 1st argument
+ * to gethostbyaddr().
*/
-/*#define DLSYM_NEEDS_UNDERSCORE /**/
-
-/* HAS_ENDSPENT:
- * This symbol, if defined, indicates that the endspent system call is
- * available to finalize the scan of SysV shadow password entries.
+/* Netdb_hlen_t:
+ * This symbol holds the type used for the 2nd argument
+ * to gethostbyaddr().
+ */
+/* Netdb_name_t:
+ * This symbol holds the type used for the argument to
+ * gethostbyname().
+ */
+/* Netdb_net_t:
+ * This symbol holds the type used for the 1st argument to
+ * getnetbyaddr().
*/
-/*#define HAS_ENDSPENT /**/
+#define Netdb_host_t char * /**/
+#define Netdb_hlen_t int /**/
+#define Netdb_name_t char * /**/
+#define Netdb_net_t long /**/
-/* HAS_FSEEKO:
- * This symbol, if defined, indicates that the fseeko routine is
- * available to fseek beyond 32 bits (useful for ILP32 hosts).
+/* IVTYPE:
+ * This symbol defines the C type used for Perl's IV.
*/
-/*#define HAS_FSEEKO /**/
-
-/* HAS_FTELLO:
- * This symbol, if defined, indicates that the ftello routine is
- * available to ftell beyond 32 bits (useful for ILP32 hosts).
+/* UVTYPE:
+ * This symbol defines the C type used for Perl's UV.
*/
-/*#define HAS_FTELLO /**/
-
-/* HAS_GETMNTENT:
- * This symbol, if defined, indicates that the getmntent routine is
- * available to iterate through mounted file systems.
+/* I8TYPE:
+ * This symbol defines the C type used for Perl's I8.
*/
-/*#define HAS_GETMNTENT /**/
-
-/* HAS_GETSPENT:
- * This symbol, if defined, indicates that the getspent system call is
- * available to retrieve SysV shadow password entries sequentially.
+/* U8TYPE:
+ * This symbol defines the C type used for Perl's U8.
*/
-/*#define HAS_GETSPENT /**/
-
-/* HAS_GETSPNAM:
- * This symbol, if defined, indicates that the getspnam system call is
- * available to retrieve SysV shadow password entries by name.
+/* I16TYPE:
+ * This symbol defines the C type used for Perl's I16.
*/
-/*#define HAS_GETSPNAM /**/
-
-/* HAS_HASMNTOPT:
- * This symbol, if defined, indicates that the hasmntopt routine is
- * available to query the mount options of file systems.
+/* U16TYPE:
+ * This symbol defines the C type used for Perl's U16.
*/
-/*#define HAS_HASMNTOPT /**/
-
-/* HAS_LDBL_DIG:
- * This symbol, if defined, indicates that this system's <float.h>
- * or <limits.h> defines the symbol LDBL_DIG, which is the number
- * of significant digits in a long double precision number. Unlike
- * for DBL_DIG, there's no good guess for LDBL_DIG if it is undefined.
+/* I32TYPE:
+ * This symbol defines the C type used for Perl's I32.
*/
-#define HAS_LDBL_DIG /**/
-
-/* HAS_MADVISE:
- * This symbol, if defined, indicates that the madvise system call is
- * available to map a file into memory.
+/* U32TYPE:
+ * This symbol defines the C type used for Perl's U32.
*/
-/*#define HAS_MADVISE /**/
-
-/* HAS_MPROTECT:
- * This symbol, if defined, indicates that the mprotect system call is
- * available to modify the access protection of a memory mapped file.
+/* I64TYPE:
+ * This symbol defines the C type used for Perl's I64.
*/
-/*#define HAS_MPROTECT /**/
-
-/* HAS_READV:
- * This symbol, if defined, indicates that the readv routine is
- * available to do gather reads. You will also need <sys/uio.h>
- * and there I_SYSUIO.
+/* U64TYPE:
+ * This symbol defines the C type used for Perl's U64.
*/
-/*#define HAS_READV /**/
-
-/* HAS_SETSPENT:
- * This symbol, if defined, indicates that the setspent system call is
- * available to initialize the scan of SysV shadow password entries.
+/* NVTYPE:
+ * This symbol defines the C type used for Perl's NV.
*/
-/*#define HAS_SETSPENT /**/
-
-/* USE_SFIO:
- * This symbol, if defined, indicates that sfio should
- * be used.
+/* IVSIZE:
+ * This symbol contains the sizeof(IV).
*/
-/*#define USE_SFIO /**/
-
-/* HAS_FSTATFS:
- * This symbol, if defined, indicates that the fstatfs routine is
- * available to stat filesystems of file descriptors.
+/* UVSIZE:
+ * This symbol contains the sizeof(UV).
*/
-/* HAS_STRUCT_STATFS_FLAGS:
- * This symbol, if defined, indicates that the struct statfs
- * does have the f_flags member containing the mount flags of
- * the filesystem holding the file.
- * This kind of struct statfs is coming from sys/mount.h (BSD),
- * not from sys/statfs.h (SYSV).
+/* I8SIZE:
+ * This symbol contains the sizeof(I8).
*/
-/*#define HAS_FSTATFS /**/
-/*#define HAS_STRUCT_STATFS_FLAGS /**/
-
-/* HAS_FSTATVFS:
- * This symbol, if defined, indicates that the fstatvfs routine is
- * available to stat filesystems of file descriptors.
+/* U8SIZE:
+ * This symbol contains the sizeof(U8).
*/
-/*#define HAS_FSTATVFS /**/
-
-/* HAS_TELLDIR_PROTO:
- * This symbol, if defined, indicates that the system provides
- * a prototype for the telldir() function. Otherwise, it is up
- * to the program to supply one. A good guess is
- * extern long telldir _((DIR*));
+/* I16SIZE:
+ * This symbol contains the sizeof(I16).
*/
-#define HAS_TELLDIR_PROTO /**/
-
-/* HAS_WRITEV:
- * This symbol, if defined, indicates that the writev routine is
- * available to do scatter writes.
+/* U16SIZE:
+ * This symbol contains the sizeof(U16).
*/
-/*#define HAS_WRITEV /**/
-
-/* USE_DYNAMIC_LOADING:
- * This symbol, if defined, indicates that dynamic loading of
- * some sort is available.
+/* I32SIZE:
+ * This symbol contains the sizeof(I32).
*/
-#define USE_DYNAMIC_LOADING /**/
-
-/* FFLUSH_NULL:
- * This symbol, if defined, tells that fflush(NULL) does flush
- * all pending stdio output.
+/* U32SIZE:
+ * This symbol contains the sizeof(U32).
*/
-/* FFLUSH_ALL:
- * This symbol, if defined, tells that to flush
- * all pending stdio output one must loop through all
- * the stdio file handles stored in an array and fflush them.
- * Note that if fflushNULL is defined, fflushall will not
- * even be probed for and will be left undefined.
+/* I64SIZE:
+ * This symbol contains the sizeof(I64).
*/
-#define FFLUSH_NULL /**/
-/*#define FFLUSH_ALL /**/
+/* U64SIZE:
+ * This symbol contains the sizeof(U64).
+ */
+#define IVTYPE long /**/
+#define UVTYPE unsigned long /**/
+#define I8TYPE char /**/
+#define U8TYPE unsigned char /**/
+#define I16TYPE short /**/
+#define U16TYPE unsigned short /**/
+#define I32TYPE long /**/
+#define U32TYPE unsigned long /**/
+#ifdef HAS_QUAD
+#define I64TYPE __int64 /**/
+#define U64TYPE unsigned __int64 /**/
+#endif
+#define NVTYPE double /**/
+#define IVSIZE 4 /**/
+#define UVSIZE 4 /**/
+#define I8SIZE 1 /**/
+#define U8SIZE 1 /**/
+#define I16SIZE 2 /**/
+#define U16SIZE 2 /**/
+#define I32SIZE 4 /**/
+#define U32SIZE 4 /**/
+#ifdef HAS_QUAD
+#define I64SIZE 8 /**/
+#define U64SIZE 8 /**/
+#endif
-/* DB_Prefix_t:
- * This symbol contains the type of the prefix structure element
- * in the <db.h> header file. In older versions of DB, it was
- * int, while in newer ones it is u_int32_t.
+/* IVdf:
+ * This symbol defines the format string used for printing a Perl IV
+ * as a signed decimal integer.
*/
-/* DB_Hash_t:
- * This symbol contains the type of the prefix structure element
- * in the <db.h> header file. In older versions of DB, it was
- * int, while in newer ones it is size_t.
+/* UVuf:
+ * This symbol defines the format string used for printing a Perl UV
+ * as an unsigned decimal integer.
*/
-#define DB_Hash_t int /**/
-#define DB_Prefix_t int /**/
-
-/* I_INTTYPES:
- * This symbol, if defined, indicates to the C program that it should
- * include <inttypes.h>.
+/* UVof:
+ * This symbol defines the format string used for printing a Perl UV
+ * as an unsigned octal integer.
*/
-/* HAS_INT64_T:
- * This symbol will defined if the C compiler supports int64_t.
- * Usually the <inttypes.h> needs to be included, but sometimes
- * <sys/types.h> is enough.
+/* UVxf:
+ * This symbol defines the format string used for printing a Perl UV
+ * as an unsigned hexadecimal integer.
*/
-/*#define I_INTTYPES /**/
-/*#define HAS_INT64_T /**/
+#define IVdf "ld" /**/
+#define UVuf "lu" /**/
+#define UVof "lo" /**/
+#define UVxf "lx" /**/
-/* I_MNTENT:
- * This symbol, if defined, indicates that <mntent.h> exists and
- * should be included.
+/* Pid_t:
+ * This symbol holds the type used to declare process ids in the kernel.
+ * It can be int, uint, pid_t, etc... It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
*/
-/*#define I_MNTENT /**/
+#define Pid_t int /* PID type */
-/* I_NETINET_TCP:
- * This symbol, if defined, indicates to the C program that it should
- * include <netinet/tcp.h>.
+/* PRIVLIB:
+ * This symbol contains the name of the private library for this package.
+ * The library is private in the sense that it needn't be in anyone's
+ * execution path, but it should be accessible by the world. The program
+ * should be prepared to do ~ expansion.
*/
-/*#define I_NETINET_TCP /**/
-
-/* I_POLL:
- * This symbol, if defined, indicates that <poll.h> exists and
- * should be included.
+/* PRIVLIB_EXP:
+ * This symbol contains the ~name expanded version of PRIVLIB, to be used
+ * in programs that are not prepared to deal with ~ expansion at run-time.
*/
-/*#define I_POLL /**/
+#define PRIVLIB "c:\\perl\\5.5.640\\lib" /**/
+#define PRIVLIB_EXP (win32_get_privlib("5.5.640")) /**/
-/* I_SHADOW:
- * This symbol, if defined, indicates that <shadow.h> exists and
- * should be included.
+/* PTRSIZE:
+ * This symbol contains the size of a pointer, so that the C preprocessor
+ * can make decisions based on it. It will be sizeof(void *) if
+ * the compiler supports (void *); otherwise it will be
+ * sizeof(char *).
*/
-/*#define I_SHADOW /**/
+#define PTRSIZE 4 /**/
-/* I_SOCKS:
- * This symbol, if defined, indicates that <socks.h> exists and
- * should be included.
+/* Drand01:
+ * This macro is to be used to generate uniformly distributed
+ * random numbers over the range [0., 1.[. You may have to supply
+ * an 'extern double drand48();' in your program since SunOS 4.1.3
+ * doesn't provide you with anything relevant in it's headers.
+ * See HAS_DRAND48_PROTO.
*/
-/*#define I_SOCKS /**/
-
-/* I_SYS_MMAN:
- * This symbol, if defined, indicates that <sys/mman.h> exists and
- * should be included.
+/* Rand_seed_t:
+ * This symbol defines the type of the argument of the
+ * random seed function.
*/
-/*#define I_SYS_MMAN /**/
+/* seedDrand01:
+ * This symbol defines the macro to be used in seeding the
+ * random number generator (see Drand01).
+ */
+/* RANDBITS:
+ * This symbol indicates how many bits are produced by the
+ * function used to generate normalized random numbers.
+ * Values include 15, 16, 31, and 48.
+ */
+#define Drand01() (rand()/(double)((unsigned)1<<RANDBITS)) /**/
+#define Rand_seed_t unsigned /**/
+#define seedDrand01(x) srand((Rand_seed_t)x) /**/
+#define RANDBITS 15 /**/
-/* I_SYS_MOUNT:
- * This symbol, if defined, indicates that <sys/mount.h> exists and
- * should be included.
+/* SELECT_MIN_BITS:
+ * This symbol holds the minimum number of bits operated by select.
+ * That is, if you do select(n, ...), how many bits at least will be
+ * cleared in the masks if some activity is detected. Usually this
+ * is either n or 32*ceil(n/32), especially many little-endians do
+ * the latter. This is only useful if you have select(), naturally.
*/
-/*#define I_SYS_MOUNT /**/
+#define SELECT_MIN_BITS 32 /**/
-/* I_SYS_STATVFS:
- * This symbol, if defined, indicates that <sys/statvfs.h> exists and
- * should be included.
+/* Select_fd_set_t:
+ * This symbol holds the type used for the 2nd, 3rd, and 4th
+ * arguments to select. Usually, this is 'fd_set *', if HAS_FD_SET
+ * is defined, and 'int *' otherwise. This is only useful if you
+ * have select(), of course.
*/
-/*#define I_SYS_STATVFS /**/
+#define Select_fd_set_t Perl_fd_set * /**/
-/* HAS_OFF64_T:
- * This symbol will be defined if the C compiler supports off64_t.
+/* SIG_NAME:
+ * This symbol contains a list of signal names in order of
+ * signal number. This is intended
+ * to be used as a static array initialization, like this:
+ * char *sig_name[] = { SIG_NAME };
+ * The signals in the list are separated with commas, and each signal
+ * is surrounded by double quotes. There is no leading SIG in the signal
+ * name, i.e. SIGQUIT is known as "QUIT".
+ * Gaps in the signal numbers (up to NSIG) are filled in with NUMnn,
+ * etc., where nn is the actual signal number (e.g. NUM37).
+ * The signal number for sig_name[i] is stored in sig_num[i].
+ * The last element is 0 to terminate the list with a NULL. This
+ * corresponds to the 0 at the end of the sig_num list.
*/
-/* HAS_FPOS64_T:
- * This symbol will be defined if the C compiler supports fpos64_t.
+/* SIG_NUM:
+ * This symbol contains a list of signal numbers, in the same order as the
+ * SIG_NAME list. It is suitable for static array initialization, as in:
+ * int sig_num[] = { SIG_NUM };
+ * The signals in the list are separated with commas, and the indices
+ * within that list and the SIG_NAME list match, so it's easy to compute
+ * the signal name from a number or vice versa at the price of a small
+ * dynamic linear lookup.
+ * Duplicates are allowed, but are moved to the end of the list.
+ * The signal number corresponding to sig_name[i] is sig_number[i].
+ * if (i < NSIG) then sig_number[i] == i.
+ * The last element is 0, corresponding to the 0 at the end of
+ * the sig_name list.
*/
-/*#define HAS_OFF64_T /**/
-/*#define HAS_FPOS64_T /**/
+#define SIG_NAME "ZERO", "NUM01", "INT", "QUIT", "ILL", "NUM05", "NUM06", "NUM07", "FPE", "KILL", "NUM10", "SEGV", "NUM12", "PIPE", "ALRM", "TERM", "USR1", "USR2", "CHLD", "NUM19", "USR3", "BREAK", "ABRT", "STOP", "NUM24", "CONT", "CLD", 0 /**/
+#define SIG_NUM 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 18, 0 /**/
-/* PERL_PRIfldbl:
- * This symbol, if defined, contains the string used by stdio to
- * format long doubles (format 'f') for output.
+/* SITEARCH:
+ * This symbol contains the name of the private library for this package.
+ * The library is private in the sense that it needn't be in anyone's
+ * execution path, but it should be accessible by the world. The program
+ * should be prepared to do ~ expansion.
+ * The standard distribution will put nothing in this directory.
+ * After perl has been installed, users may install their own local
+ * architecture-dependent modules in this directory with
+ * MakeMaker Makefile.PL
+ * or equivalent. See INSTALL for details.
*/
-/* PERL_PRIgldbl:
- * This symbol, if defined, contains the string used by stdio to
- * format long doubles (format 'g') for output.
+/* SITEARCH_EXP:
+ * This symbol contains the ~name expanded version of SITEARCH, to be used
+ * in programs that are not prepared to deal with ~ expansion at run-time.
*/
-/*#define PERL_PRIfldbl undef /**/
-/*#define PERL_PRIgldbl undef /**/
+#define SITEARCH "c:\\perl\\site\\5.5.640\\lib\\MSWin32-x86" /**/
+/*#define SITEARCH_EXP "" /**/
-/* PERL_PRId64:
- * This symbol, if defined, contains the string used by stdio to
- * format 64-bit decimal numbers (format 'd') for output.
- */
-/* PERL_PRIu64:
- * This symbol, if defined, contains the string used by stdio to
- * format 64-bit unsigned decimal numbers (format 'u') for output.
+/* SITELIB:
+ * This symbol contains the name of the private library for this package.
+ * The library is private in the sense that it needn't be in anyone's
+ * execution path, but it should be accessible by the world. The program
+ * should be prepared to do ~ expansion.
+ * The standard distribution will put nothing in this directory.
+ * After perl has been installed, users may install their own local
+ * architecture-independent modules in this directory with
+ * MakeMaker Makefile.PL
+ * or equivalent. See INSTALL for details.
*/
-/* PERL_PRIo64:
- * This symbol, if defined, contains the string used by stdio to
- * format 64-bit octal numbers (format 'o') for output.
+/* SITELIB_EXP:
+ * This symbol contains the ~name expanded version of SITELIB, to be used
+ * in programs that are not prepared to deal with ~ expansion at run-time.
*/
-/* PERL_PRIx64:
- * This symbol, if defined, contains the string used by stdio to
- * format 64-bit hexadecimal numbers (format 'x') for output.
+#define SITELIB "c:\\perl\\site\\5.5.640\\lib" /**/
+#define SITELIB_EXP (win32_get_sitelib("5.5.640")) /**/
+
+/* Size_t:
+ * This symbol holds the type used to declare length parameters
+ * for string functions. It is usually size_t, but may be
+ * unsigned long, int, etc. It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
*/
-/*#define PERL_PRId64 undef /**/
-/*#define PERL_PRIu64 undef /**/
-/*#define PERL_PRIo64 undef /**/
-/*#define PERL_PRIx64 undef /**/
+#define Size_t size_t /* length paramater for string functions */
-/* SELECT_MIN_BITS:
- * This symbol holds the minimum number of bits operated by select.
- * That is, if you do select(n, ...), how many bits at least will be
- * cleared in the masks if some activity is detected. Usually this
- * is either n or 32*ceil(n/32), especially many little-endians do
- * the latter. This is only useful if you have select(), naturally.
+/* SSize_t:
+ * This symbol holds the type used by functions that return
+ * a count of bytes or an error condition. It must be a signed type.
+ * It is usually ssize_t, but may be long or int, etc.
+ * It may be necessary to include <sys/types.h> or <unistd.h>
+ * to get any typedef'ed information.
+ * We will pick a type such that sizeof(SSize_t) == sizeof(Size_t).
*/
-#define SELECT_MIN_BITS 32 /**/
+#define SSize_t int /* signed count of bytes */
/* STARTPERL:
* This variable contains the string to put in front of a perl
* Usual values include _iob, __iob, and __sF.
*/
/*#define HAS_STDIO_STREAM_ARRAY /**/
-#define STDIO_STREAM_ARRAY undef
+#define STDIO_STREAM_ARRAY
-/* HAS_STRTOULL:
- * This symbol, if defined, indicates that the strtoull routine is
- * available to convert strings into unsigned long longs.
+/* Uid_t_f:
+ * This symbol defines the format string used for printing a Uid_t.
*/
-/*#define HAS_STRTOULL /**/
+#define Uid_t_f "d" /**/
+
+/* Uid_t_size:
+ * This symbol holds the size of a Uid_t in bytes.
+ */
+#define Uid_t_size 4 /* UID size */
+
+/* Uid_t:
+ * This symbol holds the type used to declare user ids in the kernel.
+ * It can be int, ushort, uid_t, etc... It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
+ */
+#define Uid_t uid_t /* UID type */
/* USE_64_BITS:
- * This symbol, if defined, indicates that 64-bit interfaces should
- * be used when available. If not defined, the native default interfaces
+ * This symbol, if defined, indicates that 64-bit integers should
+ * be used when available. If not defined, the native integers
* will be used (be they 32 or 64 bits).
*/
+#ifndef USE_64_BITS
/*#define USE_64_BITS /**/
+#endif
+
+/* USE_LARGE_FILES:
+ * This symbol, if defined, indicates that large file support
+ * should be used when available. The USE_64_BITS symbol will
+ * also be turned on if necessary.
+ */
+#ifndef USE_LARGE_FILES
+/*#define USE_LARGE_FILES /**/
+#endif
/* USE_LONG_DOUBLE:
* This symbol, if defined, indicates that long doubles should
* be used when available.
*/
+#ifndef USE_LONG_DOUBLE
/*#define USE_LONG_DOUBLE /**/
+#endif
+
+/* USE_LONG_LONG:
+ * This symbol, if defined, indicates that long longs should
+ * be used when available.
+ */
+#ifndef USE_LONG_LONG
+/*#define USE_LONG_LONG /**/
+#endif
+
+#ifndef USE_MORE_BITS
+/*#define USE_MORE_BITS /**/
+#endif
/* MULTIPLICITY:
* This symbol, if defined, indicates that Perl should
* be built to use multiplicity.
*/
+#ifndef MULTIPLICTY
/*#define MULTIPLICITY /**/
+#endif
/* USE_PERLIO:
* This symbol, if defined, indicates that the PerlIO abstraction should
* be used throughout. If not defined, stdio should be
* used in a fully backward compatible manner.
*/
+#ifndef USE_PERLIO
/*#define USE_PERLIO /**/
+#endif
/* USE_SOCKS:
* This symbol, if defined, indicates that Perl should
* be built to use socks.
*/
+#ifndef USE_SOCKS
/*#define USE_SOCKS /**/
+#endif
-/* HAS_DRAND48_PROTO:
- * This symbol, if defined, indicates that the system provides
- * a prototype for the drand48() function. Otherwise, it is up
- * to the program to supply one. A good guess is
- * extern double drand48 _((void));
- */
-/*#define HAS_DRAND48_PROTO /**/
-
-/* HAS_GETHOST_PROTOS:
- * This symbol, if defined, indicates that <netdb.h> includes
- * prototypes for gethostent(), gethostbyname(), and
- * gethostbyaddr(). Otherwise, it is up to the program to guess
- * them. See netdbtype.U for probing for various Netdb_xxx_t types.
- */
-#define HAS_GETHOST_PROTOS /**/
-
-/* HAS_GETNET_PROTOS:
- * This symbol, if defined, indicates that <netdb.h> includes
- * prototypes for getnetent(), getnetbyname(), and
- * getnetbyaddr(). Otherwise, it is up to the program to guess
- * them. See netdbtype.U for probing for various Netdb_xxx_t types.
- */
-/*#define HAS_GETNET_PROTOS /**/
-
-/* HAS_GETPROTO_PROTOS:
- * This symbol, if defined, indicates that <netdb.h> includes
- * prototypes for getprotoent(), getprotobyname(), and
- * getprotobyaddr(). Otherwise, it is up to the program to guess
- * them. See netdbtype.U for probing for various Netdb_xxx_t types.
- */
-#define HAS_GETPROTO_PROTOS /**/
-
-/* HAS_GETSERV_PROTOS:
- * This symbol, if defined, indicates that <netdb.h> includes
- * prototypes for getservent(), getservbyname(), and
- * getservbyaddr(). Otherwise, it is up to the program to guess
- * them. See netdbtype.U for probing for various Netdb_xxx_t types.
- */
-#define HAS_GETSERV_PROTOS /**/
-
-/* Netdb_host_t:
- * This symbol holds the type used for the 1st argument
- * to gethostbyaddr().
- */
-/* Netdb_hlen_t:
- * This symbol holds the type used for the 2nd argument
- * to gethostbyaddr().
- */
-/* Netdb_name_t:
- * This symbol holds the type used for the argument to
- * gethostbyname().
- */
-/* Netdb_net_t:
- * This symbol holds the type used for the 1st argument to
- * getnetbyaddr().
- */
-#define Netdb_host_t char * /**/
-#define Netdb_hlen_t int /**/
-#define Netdb_name_t char * /**/
-#define Netdb_net_t long /**/
-
-/* Select_fd_set_t:
- * This symbol holds the type used for the 2nd, 3rd, and 4th
- * arguments to select. Usually, this is 'fd_set *', if HAS_FD_SET
- * is defined, and 'int *' otherwise. This is only useful if you
- * have select(), of course.
- */
-#define Select_fd_set_t Perl_fd_set * /**/
-
-/* ARCHNAME:
- * This symbol holds a string representing the architecture name.
- * It may be used to construct an architecture-dependant pathname
- * where library files may be held under a private library, for
- * instance.
- */
-#define ARCHNAME "MSWin32-x86" /**/
-
-/* OLD_PTHREAD_CREATE_JOINABLE:
- * This symbol, if defined, indicates how to create pthread
- * in joinable (aka undetached) state. NOTE: not defined
- * if pthread.h already has defined PTHREAD_CREATE_JOINABLE
- * (the new version of the constant).
- * If defined, known values are PTHREAD_CREATE_UNDETACHED
- * and __UNDETACHED.
- */
-/*#define OLD_PTHREAD_CREATE_JOINABLE /**/
-
-/* HAS_PTHREAD_YIELD:
- * This symbol, if defined, indicates that the pthread_yield
- * routine is available to yield the execution of the current
- * thread. sched_yield is preferable to pthread_yield.
- */
-/* SCHED_YIELD:
- * This symbol defines the way to yield the execution of
- * the current thread. Known ways are sched_yield,
- * pthread_yield, and pthread_yield with NULL.
- */
-/* HAS_SCHED_YIELD:
- * This symbol, if defined, indicates that the sched_yield
- * routine is available to yield the execution of the current
- * thread. sched_yield is preferable to pthread_yield.
- */
-/*#define HAS_PTHREAD_YIELD /**/
-#define SCHED_YIELD /**/
-/*#define HAS_SCHED_YIELD /**/
-
-/* I_MACH_CTHREADS:
- * This symbol, if defined, indicates to the C program that it should
- * include <mach/cthreads.h>.
+/* USE_ITHREADS:
+ * This symbol, if defined, indicates that Perl should be built to
+ * use the interpreter-based threading implementation.
*/
-/*#define I_MACH_CTHREADS /**/
-
-/* USE_THREADS:
- * This symbol, if defined, indicates that Perl should
- * be built to use threads.
+/* USE_5005THREADS:
+ * This symbol, if defined, indicates that Perl should be built to
+ * use the 5.005-based threading implementation.
*/
/* OLD_PTHREADS_API:
* This symbol, if defined, indicates that Perl should
* be built to use the old draft POSIX threads API.
*/
-/*#define USE_THREADS /**/
+/*#define USE_5005THREADS /**/
+/*#define USE_ITHREADS /**/
+#if defined(USE_5005THREADS) && !defined(USE_ITHREADS)
+#define USE_THREADS /* until src is revised*/
+#endif
/*#define OLD_PTHREADS_API /**/
-/* Time_t:
- * This symbol holds the type returned by time(). It can be long,
- * or time_t on BSD sites (in which case <sys/types.h> should be
- * included).
- */
-#define Time_t time_t /* Time type */
-
-/* HAS_TIMES:
- * This symbol, if defined, indicates that the times() routine exists.
- * Note that this became obsolete on some systems (SUNOS), which now
- * use getrusage(). It may be necessary to include <sys/times.h>.
- */
-#define HAS_TIMES /**/
-
-/* Fpos_t:
- * This symbol holds the type used to declare file positions in libc.
- * It can be fpos_t, long, uint, etc... It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
- */
-#define Fpos_t fpos_t /* File position type */
-
-/* Gid_t:
- * This symbol holds the return type of getgid() and the type of
- * argument to setrgid() and related functions. Typically,
- * it is the type of group ids in the kernel. It can be int, ushort,
- * uid_t, etc... It may be necessary to include <sys/types.h> to get
- * any typedef'ed information.
- */
-#define Gid_t gid_t /* Type for getgid(), etc... */
-
-/* Off_t:
- * This symbol holds the type used to declare offsets in the kernel.
- * It can be int, long, off_t, etc... It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
- */
-/* LSEEKSIZE:
- * This symbol holds the number of bytes used by the Off_t.
- */
-#define Off_t off_t /* <offset> type */
-#define LSEEKSIZE 4 /* <offset> size */
-
-/* Mode_t:
- * This symbol holds the type used to declare file modes
- * for systems calls. It is usually mode_t, but may be
- * int or unsigned short. It may be necessary to include <sys/types.h>
- * to get any typedef'ed information.
- */
-#define Mode_t mode_t /* file mode parameter for system calls */
-
-/* Pid_t:
- * This symbol holds the type used to declare process ids in the kernel.
- * It can be int, uint, pid_t, etc... It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
- */
-#define Pid_t int /* PID type */
-
-/* Size_t:
- * This symbol holds the type used to declare length parameters
- * for string functions. It is usually size_t, but may be
- * unsigned long, int, etc. It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
+/* PERL_VENDORLIB_EXP:
+ * This symbol contains the ~name expanded version of VENDORLIB, to be used
+ * in programs that are not prepared to deal with ~ expansion at run-time.
*/
-#define Size_t size_t /* length paramater for string functions */
+/*#define PERL_VENDORLIB_EXP "" /**/
-/* Uid_t:
- * This symbol holds the type used to declare user ids in the kernel.
- * It can be int, ushort, uid_t, etc... It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
+/* VOIDFLAGS:
+ * This symbol indicates how much support of the void type is given by this
+ * compiler. What various bits mean:
+ *
+ * 1 = supports declaration of void
+ * 2 = supports arrays of pointers to functions returning void
+ * 4 = supports comparisons between pointers to void functions and
+ * addresses of void functions
+ * 8 = suports declaration of generic void pointers
+ *
+ * The package designer should define VOIDUSED to indicate the requirements
+ * of the package. This can be done either by #defining VOIDUSED before
+ * including config.h, or by defining defvoidused in Myinit.U. If the
+ * latter approach is taken, only those flags will be tested. If the
+ * level of void support necessary is not present, defines void to int.
*/
-#define Uid_t uid_t /* UID type */
+#ifndef VOIDUSED
+#define VOIDUSED 15
+#endif
+#define VOIDFLAGS 15
+#if (VOIDFLAGS & VOIDUSED) != VOIDUSED
+#define void int /* is void to be avoided? */
+#define M_VOID /* Xenix strikes again */
+#endif
#endif
/*
* Package name : perl5
* Source directory :
- * Configuration time: undef
+ * Configuration time: Tue Jan 18 21:02:23 2000
* Configured by : gsar
* Target system :
*/
* This symbol, if defined, indicates that the link routine is
* available to create hard links.
*/
-/*#define HAS_LINK /**/
+#define HAS_LINK /**/
/* HAS_LOCALECONV:
* This symbol, if defined, indicates that the localeconv routine is
*/
#define HAS_MKTIME /**/
-/* HAS_MSYNC:
- * This symbol, if defined, indicates that the msync system call is
- * available to synchronize a mapped file.
- */
-/*#define HAS_MSYNC /**/
-
-/* HAS_MUNMAP:
- * This symbol, if defined, indicates that the munmap system call is
- * available to unmap a region, usually mapped by mmap().
- */
-/*#define HAS_MUNMAP /**/
-
/* HAS_NICE:
* This symbol, if defined, indicates that the nice routine is
* available.
* This symbol, if defined, indicates that the tzname[] array is
* available to access timezone names.
*/
-/*#define HAS_TZNAME /**/
+#define HAS_TZNAME /**/
/* HAS_UMASK:
* This symbol, if defined, indicates that the umask routine is
*/
#define STDCHAR char /**/
-/* HAS_ACCESSX:
- * This symbol, if defined, indicates that the accessx routine is
- * available to do extended access checks.
- */
-/*#define HAS_ACCESSX /**/
-
-/* HAS_EACCESS:
- * This symbol, if defined, indicates that the eaccess routine is
- * available to do extended access checks.
- */
-/*#define HAS_EACCESS /**/
-
-/* I_SYS_ACCESS:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/access.h>.
- */
-/*#define I_SYS_ACCESS /**/
-
-/* I_SYS_SECURITY:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/security.h>.
- */
-/*#define I_SYS_SECURITY /**/
-
/* CROSSCOMPILE:
* This symbol, if defined, signifies that we our
* build process is a cross-compilation.
*/
/*#define MULTIARCH /**/
+/* HAS_QUAD:
+ * This symbol, if defined, tells that there's a 64-bit integer type,
+ * Quad_t, and its unsigned counterpar, Uquad_t. QUADKIND will be one
+ * of QUAD_IS_INT, QUAD_IS_LONG, QUAD_IS_LONG_LONG, or QUAD_IS_INT64_T.
+ */
+/*#define HAS_QUAD /**/
+#ifdef HAS_QUAD
+# define Quad_t long long /**/
+# define Uquad_t unsigned long long /**/
+# define QUADKIND undef /**/
+# define QUAD_IS_INT 1
+# define QUAD_IS_LONG 2
+# define QUAD_IS_LONG_LONG 3
+# define QUAD_IS_INT64_T 4
+#endif
+
+/* HAS_ACCESSX:
+ * This symbol, if defined, indicates that the accessx routine is
+ * available to do extended access checks.
+ */
+/*#define HAS_ACCESSX /**/
+
+/* HAS_EACCESS:
+ * This symbol, if defined, indicates that the eaccess routine is
+ * available to do extended access checks.
+ */
+/*#define HAS_EACCESS /**/
+
+/* I_SYS_ACCESS:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <sys/access.h>.
+ */
+/*#define I_SYS_ACCESS /**/
+
+/* I_SYS_SECURITY:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <sys/security.h>.
+ */
+/*#define I_SYS_SECURITY /**/
+
+/* OSNAME:
+ * This symbol contains the name of the operating system, as determined
+ * by Configure. You shouldn't rely on it too much; the specific
+ * feature tests from Configure are generally more reliable.
+ */
+#define OSNAME "MSWin32" /**/
+
/* MEM_ALIGNBYTES:
* This symbol contains the number of bytes required to align a
* double. Usual values are 2, 4 and 8. The default is eight,
#define MEM_ALIGNBYTES 8
#endif
+/* ARCHLIB:
+ * This variable, if defined, holds the name of the directory in
+ * which the user wants to put architecture-dependent public
+ * library files for perl5. It is most often a local directory
+ * such as /usr/local/lib. Programs using this variable must be
+ * prepared to deal with filename expansion. If ARCHLIB is the
+ * same as PRIVLIB, it is not defined, since presumably the
+ * program already searches PRIVLIB.
+ */
+/* ARCHLIB_EXP:
+ * This symbol contains the ~name expanded version of ARCHLIB, to be used
+ * in programs that are not prepared to deal with ~ expansion at run-time.
+ */
+#define ARCHLIB "c:\\perl\\5.5.640\\lib\\MSWin32-x86" /**/
+/*#define ARCHLIB_EXP "" /**/
+
+/* ARCHNAME:
+ * This symbol holds a string representing the architecture name.
+ * It may be used to construct an architecture-dependant pathname
+ * where library files may be held under a private library, for
+ * instance.
+ */
+#define ARCHNAME "MSWin32-x86" /**/
+
+/* HAS_ATOLF:
+ * This symbol, if defined, indicates that the atolf routine is
+ * available to convert strings into long doubles.
+ */
+/*#define HAS_ATOLF /**/
+
+/* HAS_ATOLL:
+ * This symbol, if defined, indicates that the atoll routine is
+ * available to convert strings into long longs.
+ */
+/*#define HAS_ATOLL /**/
+
+/* BIN:
+ * This symbol holds the path of the bin directory where the package will
+ * be installed. Program must be prepared to deal with ~name substitution.
+ */
+/* BIN_EXP:
+ * This symbol is the filename expanded version of the BIN symbol, for
+ * programs that do not want to deal with that at run-time.
+ */
+#define BIN "c:\\perl\\5.5.640\\bin\\MSWin32-x86" /**/
+#define BIN_EXP "c:\\perl\\5.5.640\\bin\\MSWin32-x86" /**/
+
+/* PERL_BINCOMPAT_5005:
+ * This symbol, if defined, indicates that Perl 5.006 should be
+ * binary-compatible with Perl 5.005. This is impossible for builds
+ * that use features like threads and multiplicity it is always undef
+ * for those versions.
+ */
+/*#define PERL_BINCOMPAT_5005 /**/
+
/* BYTEORDER:
* This symbol holds the hexadecimal constant defined in byteorder,
* i.e. 0x1234 or 0x4321, etc...
#define BYTEORDER 0x1234 /* large digits for MSB */
#endif /* NeXT */
+/* CAT2:
+ * This macro catenates 2 tokens together.
+ */
+/* STRINGIFY:
+ * This macro surrounds its token with double quotes.
+ */
+#if 42 == 1
+#define CAT2(a,b)a/**/b
+#define STRINGIFY(a)"a"
+ /* If you can get stringification with catify, tell me how! */
+#endif
+#if 42 == 42
+#define CAT2(a,b)a ## b
+#define StGiFy(a)# a
+#define STRINGIFY(a)StGiFy(a)
+#endif
+#if 42 != 1 && 42 != 42
+#include "Bletch: How does this C preprocessor catenate tokens?"
+#endif
+
+/* CPPSTDIN:
+ * This symbol contains the first part of the string which will invoke
+ * the C preprocessor on the standard input and produce to standard
+ * output. Typical value of "cc -E" or "/lib/cpp", but it can also
+ * call a wrapper. See CPPRUN.
+ */
+/* CPPMINUS:
+ * This symbol contains the second part of the string which will invoke
+ * the C preprocessor on the standard input and produce to standard
+ * output. This symbol will have the value "-" if CPPSTDIN needs a minus
+ * to specify standard input, otherwise the value is "".
+ */
+/* CPPRUN:
+ * This symbol contains the string which will invoke a C preprocessor on
+ * the standard input and produce to standard output. It needs to end
+ * with CPPLAST, after all other preprocessor flags have been specified.
+ * The main difference with CPPSTDIN is that this program will never be a
+ * pointer to a shell wrapper, i.e. it will be empty if no preprocessor is
+ * available directly to the user. Note that it may well be different from
+ * the preprocessor used to compile the C program.
+ */
+#define CPPSTDIN "gcc -E"
+#define CPPMINUS "-"
+#define CPPRUN "gcc -E"
+
+/* HAS_ACCESS:
+ * This manifest constant lets the C program know that the access()
+ * system call is available to check for accessibility using real UID/GID.
+ * (always present on UNIX.)
+ */
+#define HAS_ACCESS /**/
+
/* CASTI32:
* This symbol is defined if the C compiler can cast negative
* or large floating point numbers to 32-bit ints.
*/
/*#define VOID_CLOSEDIR /**/
+/* HAS_CSH:
+ * This symbol, if defined, indicates that the C-shell exists.
+ */
+/* CSH:
+ * This symbol, if defined, contains the full pathname of csh.
+ */
+/*#define HAS_CSH /**/
+#ifdef HAS_CSH
+#define CSH "" /**/
+#endif
+
+/* DLSYM_NEEDS_UNDERSCORE:
+ * This symbol, if defined, indicates that we need to prepend an
+ * underscore to the symbol name before calling dlsym(). This only
+ * makes sense if you *have* dlsym, which we will presume is the
+ * case if you're using dl_dlopen.xs.
+ */
+/*#define DLSYM_NEEDS_UNDERSCORE /**/
+
+/* HAS_DRAND48_PROTO:
+ * This symbol, if defined, indicates that the system provides
+ * a prototype for the drand48() function. Otherwise, it is up
+ * to the program to supply one. A good guess is
+ * extern double drand48 _((void));
+ */
+/*#define HAS_DRAND48_PROTO /**/
+
+/* HAS_ENDGRENT:
+ * This symbol, if defined, indicates that the getgrent routine is
+ * available for finalizing sequential access of the group database.
+ */
+/*#define HAS_ENDGRENT /**/
+
+/* HAS_ENDHOSTENT:
+ * This symbol, if defined, indicates that the endhostent() routine is
+ * available to close whatever was being used for host queries.
+ */
+/*#define HAS_ENDHOSTENT /**/
+
+/* HAS_ENDNETENT:
+ * This symbol, if defined, indicates that the endnetent() routine is
+ * available to close whatever was being used for network queries.
+ */
+/*#define HAS_ENDNETENT /**/
+
+/* HAS_ENDPROTOENT:
+ * This symbol, if defined, indicates that the endprotoent() routine is
+ * available to close whatever was being used for protocol queries.
+ */
+/*#define HAS_ENDPROTOENT /**/
+
+/* HAS_ENDPWENT:
+ * This symbol, if defined, indicates that the getgrent routine is
+ * available for finalizing sequential access of the passwd database.
+ */
+/*#define HAS_ENDPWENT /**/
+
+/* HAS_ENDSERVENT:
+ * This symbol, if defined, indicates that the endservent() routine is
+ * available to close whatever was being used for service queries.
+ */
+/*#define HAS_ENDSERVENT /**/
+
+/* HAS_ENDSPENT:
+ * This symbol, if defined, indicates that the endspent system call is
+ * available to finalize the scan of SysV shadow password entries.
+ */
+/*#define HAS_ENDSPENT /**/
+
/* HAS_FD_SET:
* This symbol, when defined, indicates presence of the fd_set typedef
* in <sys/types.h>
*/
#define HAS_FD_SET /**/
+/* HAS_STRUCT_FS_DATA:
+ * This symbol, if defined, indicates that the struct fs_data
+ * to do statfs() is supported.
+ */
+/*#define HAS_STRUCT_FS_DATA /**/
+
+/* HAS_FSEEKO:
+ * This symbol, if defined, indicates that the fseeko routine is
+ * available to fseek beyond 32 bits (useful for ILP32 hosts).
+ */
+/*#define HAS_FSEEKO /**/
+
+/* HAS_FSTATFS:
+ * This symbol, if defined, indicates that the fstatfs routine is
+ * available to stat filesystems by file descriptors.
+ */
+/*#define HAS_FSTATFS /**/
+/* HAS_FTELLO:
+ * This symbol, if defined, indicates that the ftello routine is
+ * available to ftell beyond 32 bits (useful for ILP32 hosts).
+ */
+/*#define HAS_FTELLO /**/
+
/* Gconvert:
* This preprocessor macro is defined to convert a floating point
* number to a string without a trailing decimal point. This
*/
#define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
-/* HAS_GNULIBC:
- * This symbol, if defined, indicates to the C program that
- * the GNU C library is being used.
- */
-/*#define HAS_GNULIBC /**/
-/* HAS_ISASCII:
- * This manifest constant lets the C program know that isascii
- * is available.
- */
-#define HAS_ISASCII /**/
-
-/* HAS_LCHOWN:
- * This symbol, if defined, indicates that the lchown routine is
- * available to operate on a symbolic link (instead of following the
- * link).
- */
-/*#define HAS_LCHOWN /**/
-
-/* HAS_OPEN3:
- * This manifest constant lets the C program know that the three
- * argument form of open(2) is available.
- */
-/*#define HAS_OPEN3 /**/
-
-/* HAS_SAFE_BCOPY:
- * This symbol, if defined, indicates that the bcopy routine is available
- * to copy potentially overlapping memory blocks. Otherwise you should
- * probably use memmove() or memcpy(). If neither is defined, roll your
- * own version.
- */
-/*#define HAS_SAFE_BCOPY /**/
-
-/* HAS_SAFE_MEMCPY:
- * This symbol, if defined, indicates that the memcpy routine is available
- * to copy potentially overlapping memory blocks. Otherwise you should
- * probably use memmove() or memcpy(). If neither is defined, roll your
- * own version.
- */
-/*#define HAS_SAFE_MEMCPY /**/
-
-/* HAS_SANE_MEMCMP:
- * This symbol, if defined, indicates that the memcmp routine is available
- * and can be used to compare relative magnitudes of chars with their high
- * bits set. If it is not defined, roll your own version.
- */
-#define HAS_SANE_MEMCMP /**/
-
-/* HAS_SIGACTION:
- * This symbol, if defined, indicates that Vr4's sigaction() routine
- * is available.
- */
-/*#define HAS_SIGACTION /**/
-
-/* HAS_SIGSETJMP:
- * This variable indicates to the C program that the sigsetjmp()
- * routine is available to save the calling process's registers
- * and stack environment for later use by siglongjmp(), and
- * to optionally save the process's signal mask. See
- * Sigjmp_buf, Sigsetjmp, and Siglongjmp.
- */
-/* Sigjmp_buf:
- * This is the buffer type to be used with Sigsetjmp and Siglongjmp.
- */
-/* Sigsetjmp:
- * This macro is used in the same way as sigsetjmp(), but will invoke
- * traditional setjmp() if sigsetjmp isn't available.
- * See HAS_SIGSETJMP.
- */
-/* Siglongjmp:
- * This macro is used in the same way as siglongjmp(), but will invoke
- * traditional longjmp() if siglongjmp isn't available.
- * See HAS_SIGSETJMP.
- */
-/*#define HAS_SIGSETJMP /**/
-#ifdef HAS_SIGSETJMP
-#define Sigjmp_buf sigjmp_buf
-#define Sigsetjmp(buf,save_mask) sigsetjmp((buf),(save_mask))
-#define Siglongjmp(buf,retval) siglongjmp((buf),(retval))
-#else
-#define Sigjmp_buf jmp_buf
-#define Sigsetjmp(buf,save_mask) setjmp((buf))
-#define Siglongjmp(buf,retval) longjmp((buf),(retval))
-#endif
-
-/* USE_STDIO_PTR:
- * This symbol is defined if the _ptr and _cnt fields (or similar)
- * of the stdio FILE structure can be used to access the stdio buffer
- * for a file handle. If this is defined, then the FILE_ptr(fp)
- * and FILE_cnt(fp) macros will also be defined and should be used
- * to access these fields.
- */
-/* FILE_ptr:
- * This macro is used to access the _ptr field (or equivalent) of the
- * FILE structure pointed to by its argument. This macro will always be
- * defined if USE_STDIO_PTR is defined.
- */
-/* STDIO_PTR_LVALUE:
- * This symbol is defined if the FILE_ptr macro can be used as an
- * lvalue.
- */
-/* FILE_cnt:
- * This macro is used to access the _cnt field (or equivalent) of the
- * FILE structure pointed to by its argument. This macro will always be
- * defined if USE_STDIO_PTR is defined.
- */
-/* STDIO_CNT_LVALUE:
- * This symbol is defined if the FILE_cnt macro can be used as an
- * lvalue.
- */
-/*#define USE_STDIO_PTR /**/
-#ifdef USE_STDIO_PTR
-#define FILE_ptr(fp) ((fp)->_ptr)
-#define STDIO_PTR_LVALUE /**/
-#define FILE_cnt(fp) ((fp)->_cnt)
-#define STDIO_CNT_LVALUE /**/
-#endif
-
-/* USE_STDIO_BASE:
- * This symbol is defined if the _base field (or similar) of the
- * stdio FILE structure can be used to access the stdio buffer for
- * a file handle. If this is defined, then the FILE_base(fp) macro
- * will also be defined and should be used to access this field.
- * Also, the FILE_bufsiz(fp) macro will be defined and should be used
- * to determine the number of bytes in the buffer. USE_STDIO_BASE
- * will never be defined unless USE_STDIO_PTR is.
- */
-/* FILE_base:
- * This macro is used to access the _base field (or equivalent) of the
- * FILE structure pointed to by its argument. This macro will always be
- * defined if USE_STDIO_BASE is defined.
- */
-/* FILE_bufsiz:
- * This macro is used to determine the number of bytes in the I/O
- * buffer pointed to by _base field (or equivalent) of the FILE
- * structure pointed to its argument. This macro will always be defined
- * if USE_STDIO_BASE is defined.
- */
-/*#define USE_STDIO_BASE /**/
-#ifdef USE_STDIO_BASE
-#define FILE_base(fp) ((fp)->_base)
-#define FILE_bufsiz(fp) ((fp)->_cnt + (fp)->_ptr - (fp)->_base)
-#endif
-
-/* HAS_VPRINTF:
- * This symbol, if defined, indicates that the vprintf routine is available
- * to printf with a pointer to an argument list. If unavailable, you
- * may need to write your own, probably in terms of _doprnt().
- */
-/* USE_CHAR_VSPRINTF:
- * This symbol is defined if this system has vsprintf() returning type
- * (char*). The trend seems to be to declare it as "int vsprintf()". It
- * is up to the package author to declare vsprintf correctly based on the
- * symbol.
- */
-#define HAS_VPRINTF /**/
-/*#define USE_CHAR_VSPRINTF /**/
-
-/* DOUBLESIZE:
- * This symbol contains the size of a double, so that the C preprocessor
- * can make decisions based on it.
- */
-#define DOUBLESIZE 8 /**/
-
-/* I_TIME:
- * This symbol, if defined, indicates to the C program that it should
- * include <time.h>.
- */
-/* I_SYS_TIME:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/time.h>.
- */
-/* I_SYS_TIME_KERNEL:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/time.h> with KERNEL defined.
- */
-#define I_TIME /**/
-/*#define I_SYS_TIME /**/
-/*#define I_SYS_TIME_KERNEL /**/
-
-/* VAL_O_NONBLOCK:
- * This symbol is to be used during open() or fcntl(F_SETFL) to turn on
- * non-blocking I/O for the file descriptor. Note that there is no way
- * back, i.e. you cannot turn it blocking again this way. If you wish to
- * alternatively switch between blocking and non-blocking, use the
- * ioctl(FIOSNBIO) call instead, but that is not supported by all devices.
- */
-/* VAL_EAGAIN:
- * This symbol holds the errno error code set by read() when no data was
- * present on the non-blocking file descriptor.
- */
-/* RD_NODATA:
- * This symbol holds the return code from read() when no data is present
- * on the non-blocking file descriptor. Be careful! If EOF_NONBLOCK is
- * not defined, then you can't distinguish between no data and EOF by
- * issuing a read(). You'll have to find another way to tell for sure!
- */
-/* EOF_NONBLOCK:
- * This symbol, if defined, indicates to the C program that a read() on
- * a non-blocking file descriptor will return 0 on EOF, and not the value
- * held in RD_NODATA (-1 usually, in that case!).
- */
-#define VAL_O_NONBLOCK O_NONBLOCK
-#define VAL_EAGAIN EAGAIN
-#define RD_NODATA -1
-#define EOF_NONBLOCK
-
-/* PTRSIZE:
- * This symbol contains the size of a pointer, so that the C preprocessor
- * can make decisions based on it. It will be sizeof(void *) if
- * the compiler supports (void *); otherwise it will be
- * sizeof(char *).
- */
-#define PTRSIZE 4 /**/
-
-/* Drand01:
- * This macro is to be used to generate uniformly distributed
- * random numbers over the range [0., 1.[. You may have to supply
- * an 'extern double drand48();' in your program since SunOS 4.1.3
- * doesn't provide you with anything relevant in it's headers.
- * See HAS_DRAND48_PROTO.
- */
-/* Rand_seed_t:
- * This symbol defines the type of the argument of the
- * random seed function.
- */
-/* seedDrand01:
- * This symbol defines the macro to be used in seeding the
- * random number generator (see Drand01).
- */
-/* RANDBITS:
- * This symbol indicates how many bits are produced by the
- * function used to generate normalized random numbers.
- * Values include 15, 16, 31, and 48.
- */
-#define Drand01() (rand()/(double)((unsigned)1<<RANDBITS)) /**/
-#define Rand_seed_t unsigned /**/
-#define seedDrand01(x) srand((Rand_seed_t)x) /**/
-#define RANDBITS 15 /**/
-
-/* SSize_t:
- * This symbol holds the type used by functions that return
- * a count of bytes or an error condition. It must be a signed type.
- * It is usually ssize_t, but may be long or int, etc.
- * It may be necessary to include <sys/types.h> or <unistd.h>
- * to get any typedef'ed information.
- * We will pick a type such that sizeof(SSize_t) == sizeof(Size_t).
- */
-#define SSize_t int /* signed count of bytes */
-
-/* EBCDIC:
- * This symbol, if defined, indicates that this system uses
- * EBCDIC encoding.
- */
-/*#define EBCDIC /**/
-
-/* ARCHLIB:
- * This variable, if defined, holds the name of the directory in
- * which the user wants to put architecture-dependent public
- * library files for perl5. It is most often a local directory
- * such as /usr/local/lib. Programs using this variable must be
- * prepared to deal with filename expansion. If ARCHLIB is the
- * same as PRIVLIB, it is not defined, since presumably the
- * program already searches PRIVLIB.
- */
-/* ARCHLIB_EXP:
- * This symbol contains the ~name expanded version of ARCHLIB, to be used
- * in programs that are not prepared to deal with ~ expansion at run-time.
- */
-#define ARCHLIB "c:\\perl\\5.00561\\lib\\MSWin32-x86" /**/
-/*#define ARCHLIB_EXP "" /**/
-
-/* BIN:
- * This symbol holds the path of the bin directory where the package will
- * be installed. Program must be prepared to deal with ~name substitution.
- */
-/* BIN_EXP:
- * This symbol is the filename expanded version of the BIN symbol, for
- * programs that do not want to deal with that at run-time.
- */
-#define BIN "c:\\perl\\5.00561\\bin\\MSWin32-x86" /**/
-#define BIN_EXP "c:\\perl\\5.00561\\bin\\MSWin32-x86" /**/
-
-/* INSTALL_USR_BIN_PERL:
- * This symbol, if defined, indicates that Perl is to be installed
- * also as /usr/bin/perl.
- */
-/*#define INSTALL_USR_BIN_PERL /**/
-
-/* PRIVLIB:
- * This symbol contains the name of the private library for this package.
- * The library is private in the sense that it needn't be in anyone's
- * execution path, but it should be accessible by the world. The program
- * should be prepared to do ~ expansion.
- */
-/* PRIVLIB_EXP:
- * This symbol contains the ~name expanded version of PRIVLIB, to be used
- * in programs that are not prepared to deal with ~ expansion at run-time.
- */
-#define PRIVLIB "c:\\perl\\5.00561\\lib" /**/
-#define PRIVLIB_EXP (win32_get_privlib("5.00561")) /**/
-
-/* SITEARCH:
- * This symbol contains the name of the private library for this package.
- * The library is private in the sense that it needn't be in anyone's
- * execution path, but it should be accessible by the world. The program
- * should be prepared to do ~ expansion.
- * The standard distribution will put nothing in this directory.
- * Individual sites may place their own extensions and modules in
- * this directory.
- */
-/* SITEARCH_EXP:
- * This symbol contains the ~name expanded version of SITEARCH, to be used
- * in programs that are not prepared to deal with ~ expansion at run-time.
- */
-#define SITEARCH "c:\\perl\\site\\5.00561\\lib\\MSWin32-x86" /**/
-/*#define SITEARCH_EXP "" /**/
-
-/* SITELIB:
- * This symbol contains the name of the private library for this package.
- * The library is private in the sense that it needn't be in anyone's
- * execution path, but it should be accessible by the world. The program
- * should be prepared to do ~ expansion.
- * The standard distribution will put nothing in this directory.
- * Individual sites may place their own extensions and modules in
- * this directory.
- */
-/* SITELIB_EXP:
- * This symbol contains the ~name expanded version of SITELIB, to be used
- * in programs that are not prepared to deal with ~ expansion at run-time.
- */
-#define SITELIB "c:\\perl\\site\\5.00561\\lib" /**/
-#define SITELIB_EXP (win32_get_sitelib("5.00561")) /**/
-
-/* PERL_VENDORLIB_EXP:
- * This symbol contains the ~name expanded version of VENDORLIB, to be used
- * in programs that are not prepared to deal with ~ expansion at run-time.
- */
-/*#define PERL_VENDORLIB_EXP "undef" /**/
-
-/* OSNAME:
- * This symbol contains the name of the operating system, as determined
- * by Configure. You shouldn't rely on it too much; the specific
- * feature tests from Configure are generally more reliable.
- */
-#define OSNAME "MSWin32" /**/
-
-/* CAT2:
- * This macro catenates 2 tokens together.
- */
-/* STRINGIFY:
- * This macro surrounds its token with double quotes.
- */
-#if 42 == 1
-#define CAT2(a,b)a/**/b
-#define STRINGIFY(a)"a"
- /* If you can get stringification with catify, tell me how! */
-#endif
-#if 42 == 42
-#define CAT2(a,b)a ## b
-#define StGiFy(a)# a
-#define STRINGIFY(a)StGiFy(a)
-#endif
-#if 42 != 1 && 42 != 42
-#include "Bletch: How does this C preprocessor catenate tokens?"
-#endif
-
-/* CPPSTDIN:
- * This symbol contains the first part of the string which will invoke
- * the C preprocessor on the standard input and produce to standard
- * output. Typical value of "cc -E" or "/lib/cpp", but it can also
- * call a wrapper. See CPPRUN.
- */
-/* CPPMINUS:
- * This symbol contains the second part of the string which will invoke
- * the C preprocessor on the standard input and produce to standard
- * output. This symbol will have the value "-" if CPPSTDIN needs a minus
- * to specify standard input, otherwise the value is "".
- */
-/* CPPRUN:
- * This symbol contains the string which will invoke a C preprocessor on
- * the standard input and produce to standard output. It needs to end
- * with CPPLAST, after all other preprocessor flags have been specified.
- * The main difference with CPPSTDIN is that this program will never be a
- * pointer to a shell wrapper, i.e. it will be empty if no preprocessor is
- * available directly to the user. Note that it may well be different from
- * the preprocessor used to compile the C program.
- */
-#define CPPSTDIN "gcc -E"
-#define CPPMINUS "-"
-#define CPPRUN "gcc -E"
-
-/* HAS_ACCESS:
- * This manifest constant lets the C program know that the access()
- * system call is available to check for accessibility using real UID/GID.
- * (always present on UNIX.)
- */
-#define HAS_ACCESS /**/
-
-/* HAS_CSH:
- * This symbol, if defined, indicates that the C-shell exists.
- */
-/* CSH:
- * This symbol, if defined, contains the full pathname of csh.
- */
-/*#define HAS_CSH /**/
-#ifdef HAS_CSH
-#define CSH "" /**/
-#endif
-
-/* HAS_ENDGRENT:
- * This symbol, if defined, indicates that the getgrent routine is
- * available for finalizing sequential access of the group database.
- */
-/*#define HAS_ENDGRENT /**/
-
-/* HAS_ENDHOSTENT:
- * This symbol, if defined, indicates that the endhostent() routine is
- * available to close whatever was being used for host queries.
- */
-/*#define HAS_ENDHOSTENT /**/
-
-/* HAS_ENDNETENT:
- * This symbol, if defined, indicates that the endnetent() routine is
- * available to close whatever was being used for network queries.
- */
-/*#define HAS_ENDNETENT /**/
-
-/* HAS_ENDPROTOENT:
- * This symbol, if defined, indicates that the endprotoent() routine is
- * available to close whatever was being used for protocol queries.
- */
-/*#define HAS_ENDPROTOENT /**/
-
-/* HAS_ENDPWENT:
- * This symbol, if defined, indicates that the getgrent routine is
- * available for finalizing sequential access of the passwd database.
- */
-/*#define HAS_ENDPWENT /**/
-
-/* HAS_ENDSERVENT:
- * This symbol, if defined, indicates that the endservent() routine is
- * available to close whatever was being used for service queries.
- */
-/*#define HAS_ENDSERVENT /**/
-
/* HAS_GETGRENT:
* This symbol, if defined, indicates that the getgrent routine is
* available for sequential access of the group database.
#define PHOSTNAME "" /* How to get the host name */
#endif
+/* HAS_GETHOST_PROTOS:
+ * This symbol, if defined, indicates that <netdb.h> includes
+ * prototypes for gethostent(), gethostbyname(), and
+ * gethostbyaddr(). Otherwise, it is up to the program to guess
+ * them. See netdbtype.U for probing for various Netdb_xxx_t types.
+ */
+#define HAS_GETHOST_PROTOS /**/
+
+/* HAS_GETMNT:
+ * This symbol, if defined, indicates that the getmnt routine is
+ * available to get filesystem mount info by filename.
+ */
+/*#define HAS_GETMNT /**/
+
+/* HAS_GETMNTENT:
+ * This symbol, if defined, indicates that the getmntent routine is
+ * available to iterate through mounted file systems to get their info.
+ */
+/*#define HAS_GETMNTENT /**/
+
/* HAS_GETNETBYADDR:
* This symbol, if defined, indicates that the getnetbyaddr() routine is
* available to look up networks by their IP addresses.
*/
/*#define HAS_GETNETENT /**/
+/* HAS_GETNET_PROTOS:
+ * This symbol, if defined, indicates that <netdb.h> includes
+ * prototypes for getnetent(), getnetbyname(), and
+ * getnetbyaddr(). Otherwise, it is up to the program to guess
+ * them. See netdbtype.U for probing for various Netdb_xxx_t types.
+ */
+/*#define HAS_GETNET_PROTOS /**/
+
/* HAS_GETPROTOENT:
* This symbol, if defined, indicates that the getprotoent() routine is
* available to look up protocols in some data base or another.
#define HAS_GETPROTOBYNAME /**/
#define HAS_GETPROTOBYNUMBER /**/
+/* HAS_GETPROTO_PROTOS:
+ * This symbol, if defined, indicates that <netdb.h> includes
+ * prototypes for getprotoent(), getprotobyname(), and
+ * getprotobyaddr(). Otherwise, it is up to the program to guess
+ * them. See netdbtype.U for probing for various Netdb_xxx_t types.
+ */
+#define HAS_GETPROTO_PROTOS /**/
+
/* HAS_GETPWENT:
* This symbol, if defined, indicates that the getpwent routine is
* available for sequential access of the passwd database.
*/
/*#define HAS_GETSERVENT /**/
+/* HAS_GETSERV_PROTOS:
+ * This symbol, if defined, indicates that <netdb.h> includes
+ * prototypes for getservent(), getservbyname(), and
+ * getservbyaddr(). Otherwise, it is up to the program to guess
+ * them. See netdbtype.U for probing for various Netdb_xxx_t types.
+ */
+#define HAS_GETSERV_PROTOS /**/
+
+/* HAS_GETSPENT:
+ * This symbol, if defined, indicates that the getspent system call is
+ * available to retrieve SysV shadow password entries sequentially.
+ */
+/*#define HAS_GETSPENT /**/
+
+/* HAS_GETSPNAM:
+ * This symbol, if defined, indicates that the getspnam system call is
+ * available to retrieve SysV shadow password entries by name.
+ */
+/*#define HAS_GETSPNAM /**/
+
/* HAS_GETSERVBYNAME:
* This symbol, if defined, indicates that the getservbyname()
* routine is available to look up services by their name.
#define HAS_GETSERVBYNAME /**/
#define HAS_GETSERVBYPORT /**/
+/* HAS_GNULIBC:
+ * This symbol, if defined, indicates to the C program that
+ * the GNU C library is being used.
+ */
+/*#define HAS_GNULIBC /**/
+/* HAS_HASMNTOPT:
+ * This symbol, if defined, indicates that the hasmntopt routine is
+ * available to query the mount options of file systems.
+ */
+/*#define HAS_HASMNTOPT /**/
+
/* HAS_HTONL:
* This symbol, if defined, indicates that the htonl() routine (and
* friends htons() ntohl() ntohs()) are available to do network
#define HAS_NTOHL /**/
#define HAS_NTOHS /**/
+/* HAS_ISASCII:
+ * This manifest constant lets the C program know that isascii
+ * is available.
+ */
+#define HAS_ISASCII /**/
+
+/* HAS_LCHOWN:
+ * This symbol, if defined, indicates that the lchown routine is
+ * available to operate on a symbolic link (instead of following the
+ * link).
+ */
+/*#define HAS_LCHOWN /**/
+
+/* HAS_LDBL_DIG:
+ * This symbol, if defined, indicates that this system's <float.h>
+ * or <limits.h> defines the symbol LDBL_DIG, which is the number
+ * of significant digits in a long double precision number. Unlike
+ * for DBL_DIG, there's no good guess for LDBL_DIG if it is undefined.
+ */
+#define HAS_LDBL_DIG /**/
+
/* HAS_LONG_DOUBLE:
* This symbol will be defined if the C compiler supports long
* doubles.
* C preprocessor can make decisions based on it. It is only
* defined if the system supports long long.
*/
-/*#define HAS_LONG_LONG /**/
-#ifdef HAS_LONG_LONG
-#define LONGLONGSIZE 8 /**/
-#endif
-
-/* HAS_MEMCHR:
- * This symbol, if defined, indicates that the memchr routine is available
- * to locate characters within a C string.
+/*#define HAS_LONG_LONG /**/
+#ifdef HAS_LONG_LONG
+#define LONGLONGSIZE 8 /**/
+#endif
+
+/* HAS_MEMCHR:
+ * This symbol, if defined, indicates that the memchr routine is available
+ * to locate characters within a C string.
+ */
+#define HAS_MEMCHR /**/
+
+/* HAS_MSG:
+ * This symbol, if defined, indicates that the entire msg*(2) library is
+ * supported (IPC mechanism based on message queues).
+ */
+/*#define HAS_MSG /**/
+
+/* HAS_OPEN3:
+ * This manifest constant lets the C program know that the three
+ * argument form of open(2) is available.
+ */
+/*#define HAS_OPEN3 /**/
+
+/* OLD_PTHREAD_CREATE_JOINABLE:
+ * This symbol, if defined, indicates how to create pthread
+ * in joinable (aka undetached) state. NOTE: not defined
+ * if pthread.h already has defined PTHREAD_CREATE_JOINABLE
+ * (the new version of the constant).
+ * If defined, known values are PTHREAD_CREATE_UNDETACHED
+ * and __UNDETACHED.
+ */
+/*#define OLD_PTHREAD_CREATE_JOINABLE /**/
+
+/* HAS_PTHREAD_YIELD:
+ * This symbol, if defined, indicates that the pthread_yield
+ * routine is available to yield the execution of the current
+ * thread. sched_yield is preferable to pthread_yield.
+ */
+/* SCHED_YIELD:
+ * This symbol defines the way to yield the execution of
+ * the current thread. Known ways are sched_yield,
+ * pthread_yield, and pthread_yield with NULL.
+ */
+/* HAS_SCHED_YIELD:
+ * This symbol, if defined, indicates that the sched_yield
+ * routine is available to yield the execution of the current
+ * thread. sched_yield is preferable to pthread_yield.
*/
-/*#define HAS_MEMCHR /**/
+/*#define HAS_PTHREAD_YIELD /**/
+#define SCHED_YIELD /**/
+/*#define HAS_SCHED_YIELD /**/
-/* HAS_MMAP:
- * This symbol, if defined, indicates that the mmap system call is
- * available to map a file into memory.
+/* HAS_SAFE_BCOPY:
+ * This symbol, if defined, indicates that the bcopy routine is available
+ * to copy potentially overlapping memory blocks. Otherwise you should
+ * probably use memmove() or memcpy(). If neither is defined, roll your
+ * own version.
*/
-/* Mmap_t:
- * This symbol holds the return type of the mmap() system call
- * (and simultaneously the type of the first argument).
- * Usually set to 'void *' or 'cadd_t'.
+/*#define HAS_SAFE_BCOPY /**/
+
+/* HAS_SAFE_MEMCPY:
+ * This symbol, if defined, indicates that the memcpy routine is available
+ * to copy potentially overlapping memory blocks. Otherwise you should
+ * probably use memmove() or memcpy(). If neither is defined, roll your
+ * own version.
*/
-/*#define HAS_MMAP /**/
-#define Mmap_t void * /**/
+/*#define HAS_SAFE_MEMCPY /**/
-/* HAS_MSG:
- * This symbol, if defined, indicates that the entire msg*(2) library is
- * supported (IPC mechanism based on message queues).
+/* HAS_SANE_MEMCMP:
+ * This symbol, if defined, indicates that the memcmp routine is available
+ * and can be used to compare relative magnitudes of chars with their high
+ * bits set. If it is not defined, roll your own version.
*/
-/*#define HAS_MSG /**/
+#define HAS_SANE_MEMCMP /**/
/* HAS_SEM:
* This symbol, if defined, indicates that the entire sem*(2) library is
*/
/*#define HAS_SETSERVENT /**/
+/* HAS_SETSPENT:
+ * This symbol, if defined, indicates that the setspent system call is
+ * available to initialize the scan of SysV shadow password entries.
+ */
+/*#define HAS_SETSPENT /**/
+
/* HAS_SETVBUF:
* This symbol, if defined, indicates that the setvbuf routine is
* available to change buffering on an open stdio stream.
*/
#define HAS_SETVBUF /**/
+/* USE_SFIO:
+ * This symbol, if defined, indicates that sfio should
+ * be used.
+ */
+/*#define USE_SFIO /**/
+
/* HAS_SHM:
* This symbol, if defined, indicates that the entire shm*(2) library is
* supported.
*/
/*#define HAS_SHM /**/
+/* HAS_SIGACTION:
+ * This symbol, if defined, indicates that Vr4's sigaction() routine
+ * is available.
+ */
+/*#define HAS_SIGACTION /**/
+
+/* HAS_SIGSETJMP:
+ * This variable indicates to the C program that the sigsetjmp()
+ * routine is available to save the calling process's registers
+ * and stack environment for later use by siglongjmp(), and
+ * to optionally save the process's signal mask. See
+ * Sigjmp_buf, Sigsetjmp, and Siglongjmp.
+ */
+/* Sigjmp_buf:
+ * This is the buffer type to be used with Sigsetjmp and Siglongjmp.
+ */
+/* Sigsetjmp:
+ * This macro is used in the same way as sigsetjmp(), but will invoke
+ * traditional setjmp() if sigsetjmp isn't available.
+ * See HAS_SIGSETJMP.
+ */
+/* Siglongjmp:
+ * This macro is used in the same way as siglongjmp(), but will invoke
+ * traditional longjmp() if siglongjmp isn't available.
+ * See HAS_SIGSETJMP.
+ */
+/*#define HAS_SIGSETJMP /**/
+#ifdef HAS_SIGSETJMP
+#define Sigjmp_buf sigjmp_buf
+#define Sigsetjmp(buf,save_mask) sigsetjmp((buf),(save_mask))
+#define Siglongjmp(buf,retval) siglongjmp((buf),(retval))
+#else
+#define Sigjmp_buf jmp_buf
+#define Sigsetjmp(buf,save_mask) setjmp((buf))
+#define Siglongjmp(buf,retval) longjmp((buf),(retval))
+#endif
+
/* HAS_SOCKET:
* This symbol, if defined, indicates that the BSD socket interface is
* supported.
* Checking just with #ifdef might not be enough because this symbol
* has been known to be an enum.
*/
-/* HAS_SENDMSG:
- * This symbol, if defined, indicates that the sendmsg is supported
- * to send messages between sockets. You will also need struct
- * iovec from <sys/uio.h>, HAS_STRUCT_IOVEC and I_SYSUIO.
- */
-/* HAS_RECVMSG:
- * This symbol, if defined, indicates that the recvmsg is supported
- * to send messages between sockets. You will also need struct
- * iovec from <sys/uio.h>, HAS_STRUCT_IOVEC and I_SYSUIO.
- */
-/* HAS_STRUCT_MSGHDR:
- * This symbol, if defined, indicates that the struct msghdr
- * (BSD 4.3 or 4.4) is supported. You will also need struct
- * iovec from <sys/uio.h>, HAS_STRUCT_IOVEC and I_SYSUIO.
- */
-/* HAS_STRUCT_CMSGHDR:
- * This symbol, if defined, indicates that the struct cmsghdr
- * (BSD 4.4) is supported. You will also need struct
- * iovec from <sys/uio.h>, HAS_STRUCT_IOVEC and I_SYSUIO.
- */
#define HAS_SOCKET /**/
/*#define HAS_SOCKETPAIR /**/
/*#define HAS_MSG_CTRUNC /**/
/*#define HAS_MSG_PEEK /**/
/*#define HAS_MSG_PROXY /**/
/*#define HAS_SCM_RIGHTS /**/
-/*#define HAS_SENDMSG /**/
-/*#define HAS_RECVMSG /**/
-/*#define HAS_STRUCT_MSGHDR /**/
-/*#define HAS_STRUCT_CMSGHDR /**/
+
+/* HAS_SQRTL:
+ * This symbol, if defined, indicates that the sqrtl routine is
+ * available to do long double square roots.
+ */
+/*#define HAS_SQRTL /**/
/* USE_STAT_BLOCKS:
* This symbol is defined if this system has a stat structure declaring
* st_blksize and st_blocks.
*/
+#ifndef USE_STAT_BLOCKS
/*#define USE_STAT_BLOCKS /**/
+#endif
+
+/* HAS_STRUCT_STATFS_F_FLAGS:
+ * This symbol, if defined, indicates that the struct statfs
+ * does have the f_flags member containing the mount flags of
+ * the filesystem containing the file.
+ * This kind of struct statfs is coming from <sys/mount.h> (BSD 4.3),
+ * not from <sys/statfs.h> (SYSV). Older BSDs (like Ultrix) do not
+ * have statfs() and struct statfs, they have ustat() and getmnt()
+ * with struct ustat and struct fs_data.
+ */
+/*#define HAS_STRUCT_STATFS_F_FLAGS /**/
+
+/* HAS_STRUCT_STATFS:
+ * This symbol, if defined, indicates that the struct statfs
+ * to do statfs() is supported.
+ */
+/*#define HAS_STRUCT_STATFS /**/
+
+/* HAS_FSTATVFS:
+ * This symbol, if defined, indicates that the fstatvfs routine is
+ * available to stat filesystems by file descriptors.
+ */
+/*#define HAS_FSTATVFS /**/
+
+/* USE_STDIO_PTR:
+ * This symbol is defined if the _ptr and _cnt fields (or similar)
+ * of the stdio FILE structure can be used to access the stdio buffer
+ * for a file handle. If this is defined, then the FILE_ptr(fp)
+ * and FILE_cnt(fp) macros will also be defined and should be used
+ * to access these fields.
+ */
+/* FILE_ptr:
+ * This macro is used to access the _ptr field (or equivalent) of the
+ * FILE structure pointed to by its argument. This macro will always be
+ * defined if USE_STDIO_PTR is defined.
+ */
+/* STDIO_PTR_LVALUE:
+ * This symbol is defined if the FILE_ptr macro can be used as an
+ * lvalue.
+ */
+/* FILE_cnt:
+ * This macro is used to access the _cnt field (or equivalent) of the
+ * FILE structure pointed to by its argument. This macro will always be
+ * defined if USE_STDIO_PTR is defined.
+ */
+/* STDIO_CNT_LVALUE:
+ * This symbol is defined if the FILE_cnt macro can be used as an
+ * lvalue.
+ */
+#define USE_STDIO_PTR /**/
+#ifdef USE_STDIO_PTR
+#define FILE_ptr(fp) ((fp)->_ptr)
+#define STDIO_PTR_LVALUE /**/
+#define FILE_cnt(fp) ((fp)->_cnt)
+#define STDIO_CNT_LVALUE /**/
+#endif
+
+/* USE_STDIO_BASE:
+ * This symbol is defined if the _base field (or similar) of the
+ * stdio FILE structure can be used to access the stdio buffer for
+ * a file handle. If this is defined, then the FILE_base(fp) macro
+ * will also be defined and should be used to access this field.
+ * Also, the FILE_bufsiz(fp) macro will be defined and should be used
+ * to determine the number of bytes in the buffer. USE_STDIO_BASE
+ * will never be defined unless USE_STDIO_PTR is.
+ */
+/* FILE_base:
+ * This macro is used to access the _base field (or equivalent) of the
+ * FILE structure pointed to by its argument. This macro will always be
+ * defined if USE_STDIO_BASE is defined.
+ */
+/* FILE_bufsiz:
+ * This macro is used to determine the number of bytes in the I/O
+ * buffer pointed to by _base field (or equivalent) of the FILE
+ * structure pointed to its argument. This macro will always be defined
+ * if USE_STDIO_BASE is defined.
+ */
+#define USE_STDIO_BASE /**/
+#ifdef USE_STDIO_BASE
+#define FILE_base(fp) ((fp)->_base)
+#define FILE_bufsiz(fp) ((fp)->_cnt + (fp)->_ptr - (fp)->_base)
+#endif
/* HAS_STRERROR:
* This symbol, if defined, indicates that the strerror routine is
#define HAS_SYS_ERRLIST /**/
#define Strerror(e) strerror(e)
+/* HAS_STRTOLD:
+ * This symbol, if defined, indicates that the strtold routine is
+ * available to convert strings to long doubles.
+ */
+/*#define HAS_STRTOLD /**/
+
+/* HAS_STRTOLL:
+ * This symbol, if defined, indicates that the strtoll routine is
+ * available to convert strings to long longs.
+ */
+/*#define HAS_STRTOLL /**/
+
+/* HAS_STRTOULL:
+ * This symbol, if defined, indicates that the strtoull routine is
+ * available to convert strings to unsigned long longs.
+ */
+/*#define HAS_STRTOULL /**/
+
+/* HAS_STRTOUQ:
+ * This symbol, if defined, indicates that the strtouq routine is
+ * available to convert strings to unsigned long longs (quads).
+ */
+/*#define HAS_STRTOUQ /**/
+
+/* HAS_TELLDIR_PROTO:
+ * This symbol, if defined, indicates that the system provides
+ * a prototype for the telldir() function. Otherwise, it is up
+ * to the program to supply one. A good guess is
+ * extern long telldir _((DIR*));
+ */
+#define HAS_TELLDIR_PROTO /**/
+
+/* Time_t:
+ * This symbol holds the type returned by time(). It can be long,
+ * or time_t on BSD sites (in which case <sys/types.h> should be
+ * included).
+ */
+#define Time_t time_t /* Time type */
+
+/* HAS_TIMES:
+ * This symbol, if defined, indicates that the times() routine exists.
+ * Note that this became obsolete on some systems (SUNOS), which now
+ * use getrusage(). It may be necessary to include <sys/times.h>.
+ */
+#define HAS_TIMES /**/
+
/* HAS_UNION_SEMUN:
* This symbol, if defined, indicates that the union semun is
* defined by including <sys/sem.h>. If not, the user code
/*#define USE_SEMCTL_SEMUN /**/
/*#define USE_SEMCTL_SEMID_DS /**/
+/* HAS_USTAT:
+ * This symbol, if defined, indicates that the ustat system call is
+ * available to query file system statistics by dev_t.
+ */
+/*#define HAS_USTAT /**/
+
/* HAS_VFORK:
* This symbol, if defined, indicates that vfork() exists.
*/
* a signal handler using "Signal_t (*handler)()", and define the
* handler using "Signal_t handler(sig)".
*/
-#define Signal_t void /* Signal handler's return type */
+#define Signal_t void /* Signal handler's return type */
+
+/* HAS_VPRINTF:
+ * This symbol, if defined, indicates that the vprintf routine is available
+ * to printf with a pointer to an argument list. If unavailable, you
+ * may need to write your own, probably in terms of _doprnt().
+ */
+/* USE_CHAR_VSPRINTF:
+ * This symbol is defined if this system has vsprintf() returning type
+ * (char*). The trend seems to be to declare it as "int vsprintf()". It
+ * is up to the package author to declare vsprintf correctly based on the
+ * symbol.
+ */
+#define HAS_VPRINTF /**/
+/*#define USE_CHAR_VSPRINTF /**/
+
+/* USE_DYNAMIC_LOADING:
+ * This symbol, if defined, indicates that dynamic loading of
+ * some sort is available.
+ */
+#define USE_DYNAMIC_LOADING /**/
+
+/* DOUBLESIZE:
+ * This symbol contains the size of a double, so that the C preprocessor
+ * can make decisions based on it.
+ */
+#define DOUBLESIZE 8 /**/
+
+/* EBCDIC:
+ * This symbol, if defined, indicates that this system uses
+ * EBCDIC encoding.
+ */
+/*#define EBCDIC /**/
+
+/* FFLUSH_NULL:
+ * This symbol, if defined, tells that fflush(NULL) does flush
+ * all pending stdio output.
+ */
+/* FFLUSH_ALL:
+ * This symbol, if defined, tells that to flush
+ * all pending stdio output one must loop through all
+ * the stdio file handles stored in an array and fflush them.
+ * Note that if fflushNULL is defined, fflushall will not
+ * even be probed for and will be left undefined.
+ */
+#define FFLUSH_NULL /**/
+/*#define FFLUSH_ALL /**/
+
+/* Fpos_t:
+ * This symbol holds the type used to declare file positions in libc.
+ * It can be fpos_t, long, uint, etc... It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
+ */
+#define Fpos_t fpos_t /* File position type */
+
+/* Gid_t_f:
+ * This symbol defines the format string used for printing a Gid_t.
+ */
+#define Gid_t_f "ld" /**/
+
+/* Gid_t_size:
+ * This symbol holds the size of a Gid_t in bytes.
+ */
+#define Gid_t_size 4 /* GID size */
+
+/* Gid_t:
+ * This symbol holds the return type of getgid() and the type of
+ * argument to setrgid() and related functions. Typically,
+ * it is the type of group ids in the kernel. It can be int, ushort,
+ * uid_t, etc... It may be necessary to include <sys/types.h> to get
+ * any typedef'ed information.
+ */
+#define Gid_t gid_t /* Type for getgid(), etc... */
/* Groups_t:
* This symbol holds the type used for the second argument to
#define Groups_t gid_t /* Type for 2nd arg to [sg]etgroups() */
#endif
+/* DB_Prefix_t:
+ * This symbol contains the type of the prefix structure element
+ * in the <db.h> header file. In older versions of DB, it was
+ * int, while in newer ones it is u_int32_t.
+ */
+/* DB_Hash_t:
+ * This symbol contains the type of the prefix structure element
+ * in the <db.h> header file. In older versions of DB, it was
+ * int, while in newer ones it is size_t.
+ */
+#define DB_Hash_t int /**/
+#define DB_Prefix_t int /**/
+
/* I_GRP:
* This symbol, if defined, indicates to the C program that it should
* include <grp.h>.
/*#define I_GRP /**/
/*#define GRPASSWD /**/
+/* I_INTTYPES:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <inttypes.h>.
+ */
+/*#define I_INTTYPES /**/
+
+/* I_MACH_CTHREADS:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <mach/cthreads.h>.
+ */
+/*#define I_MACH_CTHREADS /**/
+
+/* I_MNTENT:
+ * This symbol, if defined, indicates that <mntent.h> exists and
+ * should be included.
+ */
+/*#define I_MNTENT /**/
+
/* I_NETDB:
* This symbol, if defined, indicates that <netdb.h> exists and
* should be included.
*/
/*#define I_NETDB /**/
+/* I_NETINET_TCP:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <netinet/tcp.h>.
+ */
+/*#define I_NETINET_TCP /**/
+
+/* I_POLL:
+ * This symbol, if defined, indicates that <poll.h> exists and
+ * should be included.
+ */
+/*#define I_POLL /**/
+
+/* I_PTHREAD:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <pthread.h>.
+ */
+/*#define I_PTHREAD /**/
+
/* I_PWD:
* This symbol, if defined, indicates to the C program that it should
* include <pwd.h>.
/*#define PWGECOS /**/
/*#define PWPASSWD /**/
+/* I_SHADOW:
+ * This symbol, if defined, indicates that <shadow.h> exists and
+ * should be included.
+ */
+/*#define I_SHADOW /**/
+
+/* I_SOCKS:
+ * This symbol, if defined, indicates that <socks.h> exists and
+ * should be included.
+ */
+/*#define I_SOCKS /**/
+
+/* I_SYS_MOUNT:
+ * This symbol, if defined, indicates that <sys/mount.h> exists and
+ * should be included.
+ */
+/*#define I_SYS_MOUNT /**/
+
+/* I_SYS_STATFS:
+ * This symbol, if defined, indicates that <sys/statfs.h> exists.
+ */
+/*#define I_SYS_STATFS /**/
+
+/* I_SYS_STATVFS:
+ * This symbol, if defined, indicates that <sys/statvfs.h> exists and
+ * should be included.
+ */
+/*#define I_SYS_STATVFS /**/
+
/* I_SYSUIO:
* This symbol, if defined, indicates that <sys/uio.h> exists and
* should be included.
*/
/*#define I_SYSUIO /**/
+/* I_SYS_VFS:
+ * This symbol, if defined, indicates that <sys/vfs.h> exists and
+ * should be included.
+ */
+/*#define I_SYS_VFS /**/
+
+/* I_TIME:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <time.h>.
+ */
+/* I_SYS_TIME:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <sys/time.h>.
+ */
+/* I_SYS_TIME_KERNEL:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <sys/time.h> with KERNEL defined.
+ */
+#define I_TIME /**/
+/*#define I_SYS_TIME /**/
+/*#define I_SYS_TIME_KERNEL /**/
+
+/* I_USTAT:
+ * This symbol, if defined, indicates that <ustat.h> exists and
+ * should be included.
+ */
+/*#define I_USTAT /**/
+
+/* PERL_INC_VERSION_LIST:
+ * This variable specifies the list of subdirectories in over
+ * which perl.c:incpush() and lib/lib.pm will automatically
+ * search when adding directories to @INC, in a format suitable
+ * for a C initialization string. See the inc_version_list entry
+ * in Porting/Glossary for more details.
+ */
+#define PERL_INC_VERSION_LIST /**/
+
+/* HAS_OFF64_T:
+ * This symbol will be defined if the C compiler supports off64_t.
+ */
+/* HAS_FPOS64_T:
+ * This symbol will be defined if the C compiler supports fpos64_t.
+ */
+/*#define HAS_OFF64_T /**/
+/*#define HAS_FPOS64_T /**/
+
+/* PERL_PRIfldbl:
+ * This symbol, if defined, contains the string used by stdio to
+ * format long doubles (format 'f') for output.
+ */
+/* PERL_PRIgldbl:
+ * This symbol, if defined, contains the string used by stdio to
+ * format long doubles (format 'g') for output.
+ */
+/*#define PERL_PRIfldbl "f" /**/
+/*#define PERL_PRIgldbl "g" /**/
+
+/* Off_t:
+ * This symbol holds the type used to declare offsets in the kernel.
+ * It can be int, long, off_t, etc... It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
+ */
+/* LSEEKSIZE:
+ * This symbol holds the number of bytes used by the Off_t.
+ */
+/* Off_t_size:
+ * This symbol holds the number of bytes used by the Off_t.
+ */
+#define Off_t off_t /* <offset> type */
+#define LSEEKSIZE 4 /* <offset> size */
+#define Off_t_size 4 /* <offset> size */
+
/* Free_t:
* This variable contains the return type of free(). It is usually
* void, but occasionally int.
*/
/*#define MYMALLOC /**/
-/* SIG_NAME:
- * This symbol contains a list of signal names in order of
- * signal number. This is intended
- * to be used as a static array initialization, like this:
- * char *sig_name[] = { SIG_NAME };
- * The signals in the list are separated with commas, and each signal
- * is surrounded by double quotes. There is no leading SIG in the signal
- * name, i.e. SIGQUIT is known as "QUIT".
- * Gaps in the signal numbers (up to NSIG) are filled in with NUMnn,
- * etc., where nn is the actual signal number (e.g. NUM37).
- * The signal number for sig_name[i] is stored in sig_num[i].
- * The last element is 0 to terminate the list with a NULL. This
- * corresponds to the 0 at the end of the sig_num list.
- */
-/* SIG_NUM:
- * This symbol contains a list of signal numbers, in the same order as the
- * SIG_NAME list. It is suitable for static array initialization, as in:
- * int sig_num[] = { SIG_NUM };
- * The signals in the list are separated with commas, and the indices
- * within that list and the SIG_NAME list match, so it's easy to compute
- * the signal name from a number or vice versa at the price of a small
- * dynamic linear lookup.
- * Duplicates are allowed, but are moved to the end of the list.
- * The signal number corresponding to sig_name[i] is sig_number[i].
- * if (i < NSIG) then sig_number[i] == i.
- * The last element is 0, corresponding to the 0 at the end of
- * the sig_name list.
+/* Mode_t:
+ * This symbol holds the type used to declare file modes
+ * for systems calls. It is usually mode_t, but may be
+ * int or unsigned short. It may be necessary to include <sys/types.h>
+ * to get any typedef'ed information.
*/
-#define SIG_NAME "ZERO", "NUM01", "INT", "QUIT", "ILL", "NUM05", "NUM06", "NUM07", "FPE", "KILL", "NUM10", "SEGV", "NUM12", "PIPE", "ALRM", "TERM", "NUM16", "NUM17", "NUM18", "NUM19", "CHLD", "BREAK", "ABRT", "STOP", "NUM24", "CONT", "CLD", 0 /**/
-#define SIG_NUM 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 20, 0 /**/
+#define Mode_t mode_t /* file mode parameter for system calls */
-/* VOIDFLAGS:
- * This symbol indicates how much support of the void type is given by this
- * compiler. What various bits mean:
- *
- * 1 = supports declaration of void
- * 2 = supports arrays of pointers to functions returning void
- * 4 = supports comparisons between pointers to void functions and
- * addresses of void functions
- * 8 = suports declaration of generic void pointers
- *
- * The package designer should define VOIDUSED to indicate the requirements
- * of the package. This can be done either by #defining VOIDUSED before
- * including config.h, or by defining defvoidused in Myinit.U. If the
- * latter approach is taken, only those flags will be tested. If the
- * level of void support necessary is not present, defines void to int.
+/* VAL_O_NONBLOCK:
+ * This symbol is to be used during open() or fcntl(F_SETFL) to turn on
+ * non-blocking I/O for the file descriptor. Note that there is no way
+ * back, i.e. you cannot turn it blocking again this way. If you wish to
+ * alternatively switch between blocking and non-blocking, use the
+ * ioctl(FIOSNBIO) call instead, but that is not supported by all devices.
*/
-#ifndef VOIDUSED
-#define VOIDUSED 15
-#endif
-#define VOIDFLAGS 15
-#if (VOIDFLAGS & VOIDUSED) != VOIDUSED
-#define void int /* is void to be avoided? */
-#define M_VOID /* Xenix strikes again */
-#endif
-
-/* HAS_ATOLF:
- * This symbol, if defined, indicates that the atolf routine is
- * available to convert strings into long doubles.
+/* VAL_EAGAIN:
+ * This symbol holds the errno error code set by read() when no data was
+ * present on the non-blocking file descriptor.
*/
-/*#define HAS_ATOLF /**/
-
-/* HAS_ATOLL:
- * This symbol, if defined, indicates that the atoll routine is
- * available to convert strings into long longs.
+/* RD_NODATA:
+ * This symbol holds the return code from read() when no data is present
+ * on the non-blocking file descriptor. Be careful! If EOF_NONBLOCK is
+ * not defined, then you can't distinguish between no data and EOF by
+ * issuing a read(). You'll have to find another way to tell for sure!
*/
-/*#define HAS_ATOLL /**/
-
-/* PERL_BINCOMPAT_5005:
- * This symbol, if defined, indicates that Perl 5.006 should be
- * binary-compatible with Perl 5.005. This is impossible for builds
- * that use features like threads and multiplicity it is always undef
- * for those versions.
+/* EOF_NONBLOCK:
+ * This symbol, if defined, indicates to the C program that a read() on
+ * a non-blocking file descriptor will return 0 on EOF, and not the value
+ * held in RD_NODATA (-1 usually, in that case!).
*/
-/*#define PERL_BINCOMPAT_5005 /**/
+#define VAL_O_NONBLOCK O_NONBLOCK
+#define VAL_EAGAIN EAGAIN
+#define RD_NODATA -1
+#define EOF_NONBLOCK
-/* DLSYM_NEEDS_UNDERSCORE:
- * This symbol, if defined, indicates that we need to prepend an
- * underscore to the symbol name before calling dlsym(). This only
- * makes sense if you *have* dlsym, which we will presume is the
- * case if you're using dl_dlopen.xs.
+/* Netdb_host_t:
+ * This symbol holds the type used for the 1st argument
+ * to gethostbyaddr().
*/
-/*#define DLSYM_NEEDS_UNDERSCORE /**/
-
-/* HAS_ENDSPENT:
- * This symbol, if defined, indicates that the endspent system call is
- * available to finalize the scan of SysV shadow password entries.
+/* Netdb_hlen_t:
+ * This symbol holds the type used for the 2nd argument
+ * to gethostbyaddr().
+ */
+/* Netdb_name_t:
+ * This symbol holds the type used for the argument to
+ * gethostbyname().
+ */
+/* Netdb_net_t:
+ * This symbol holds the type used for the 1st argument to
+ * getnetbyaddr().
*/
-/*#define HAS_ENDSPENT /**/
+#define Netdb_host_t char * /**/
+#define Netdb_hlen_t int /**/
+#define Netdb_name_t char * /**/
+#define Netdb_net_t long /**/
-/* HAS_FSEEKO:
- * This symbol, if defined, indicates that the fseeko routine is
- * available to fseek beyond 32 bits (useful for ILP32 hosts).
+/* IVTYPE:
+ * This symbol defines the C type used for Perl's IV.
*/
-/*#define HAS_FSEEKO /**/
-
-/* HAS_FTELLO:
- * This symbol, if defined, indicates that the ftello routine is
- * available to ftell beyond 32 bits (useful for ILP32 hosts).
+/* UVTYPE:
+ * This symbol defines the C type used for Perl's UV.
*/
-/*#define HAS_FTELLO /**/
-
-/* HAS_GETMNTENT:
- * This symbol, if defined, indicates that the getmntent routine is
- * available to iterate through mounted file systems.
+/* I8TYPE:
+ * This symbol defines the C type used for Perl's I8.
*/
-/*#define HAS_GETMNTENT /**/
-
-/* HAS_GETSPENT:
- * This symbol, if defined, indicates that the getspent system call is
- * available to retrieve SysV shadow password entries sequentially.
+/* U8TYPE:
+ * This symbol defines the C type used for Perl's U8.
*/
-/*#define HAS_GETSPENT /**/
-
-/* HAS_GETSPNAM:
- * This symbol, if defined, indicates that the getspnam system call is
- * available to retrieve SysV shadow password entries by name.
+/* I16TYPE:
+ * This symbol defines the C type used for Perl's I16.
*/
-/*#define HAS_GETSPNAM /**/
-
-/* HAS_HASMNTOPT:
- * This symbol, if defined, indicates that the hasmntopt routine is
- * available to query the mount options of file systems.
+/* U16TYPE:
+ * This symbol defines the C type used for Perl's U16.
*/
-/*#define HAS_HASMNTOPT /**/
-
-/* HAS_LDBL_DIG:
- * This symbol, if defined, indicates that this system's <float.h>
- * or <limits.h> defines the symbol LDBL_DIG, which is the number
- * of significant digits in a long double precision number. Unlike
- * for DBL_DIG, there's no good guess for LDBL_DIG if it is undefined.
+/* I32TYPE:
+ * This symbol defines the C type used for Perl's I32.
*/
-#define HAS_LDBL_DIG /**/
-
-/* HAS_MADVISE:
- * This symbol, if defined, indicates that the madvise system call is
- * available to map a file into memory.
+/* U32TYPE:
+ * This symbol defines the C type used for Perl's U32.
*/
-/*#define HAS_MADVISE /**/
-
-/* HAS_MPROTECT:
- * This symbol, if defined, indicates that the mprotect system call is
- * available to modify the access protection of a memory mapped file.
+/* I64TYPE:
+ * This symbol defines the C type used for Perl's I64.
*/
-/*#define HAS_MPROTECT /**/
-
-/* HAS_READV:
- * This symbol, if defined, indicates that the readv routine is
- * available to do gather reads. You will also need <sys/uio.h>
- * and there I_SYSUIO.
+/* U64TYPE:
+ * This symbol defines the C type used for Perl's U64.
*/
-/*#define HAS_READV /**/
-
-/* HAS_SETSPENT:
- * This symbol, if defined, indicates that the setspent system call is
- * available to initialize the scan of SysV shadow password entries.
+/* NVTYPE:
+ * This symbol defines the C type used for Perl's NV.
*/
-/*#define HAS_SETSPENT /**/
-
-/* USE_SFIO:
- * This symbol, if defined, indicates that sfio should
- * be used.
+/* IVSIZE:
+ * This symbol contains the sizeof(IV).
*/
-/*#define USE_SFIO /**/
-
-/* HAS_FSTATFS:
- * This symbol, if defined, indicates that the fstatfs routine is
- * available to stat filesystems of file descriptors.
+/* UVSIZE:
+ * This symbol contains the sizeof(UV).
*/
-/* HAS_STRUCT_STATFS_FLAGS:
- * This symbol, if defined, indicates that the struct statfs
- * does have the f_flags member containing the mount flags of
- * the filesystem holding the file.
- * This kind of struct statfs is coming from sys/mount.h (BSD),
- * not from sys/statfs.h (SYSV).
+/* I8SIZE:
+ * This symbol contains the sizeof(I8).
*/
-/*#define HAS_FSTATFS /**/
-/*#define HAS_STRUCT_STATFS_FLAGS /**/
-
-/* HAS_FSTATVFS:
- * This symbol, if defined, indicates that the fstatvfs routine is
- * available to stat filesystems of file descriptors.
+/* U8SIZE:
+ * This symbol contains the sizeof(U8).
*/
-/*#define HAS_FSTATVFS /**/
-
-/* HAS_TELLDIR_PROTO:
- * This symbol, if defined, indicates that the system provides
- * a prototype for the telldir() function. Otherwise, it is up
- * to the program to supply one. A good guess is
- * extern long telldir _((DIR*));
+/* I16SIZE:
+ * This symbol contains the sizeof(I16).
*/
-#define HAS_TELLDIR_PROTO /**/
-
-/* HAS_WRITEV:
- * This symbol, if defined, indicates that the writev routine is
- * available to do scatter writes.
+/* U16SIZE:
+ * This symbol contains the sizeof(U16).
*/
-/*#define HAS_WRITEV /**/
-
-/* USE_DYNAMIC_LOADING:
- * This symbol, if defined, indicates that dynamic loading of
- * some sort is available.
+/* I32SIZE:
+ * This symbol contains the sizeof(I32).
*/
-#define USE_DYNAMIC_LOADING /**/
-
-/* FFLUSH_NULL:
- * This symbol, if defined, tells that fflush(NULL) does flush
- * all pending stdio output.
+/* U32SIZE:
+ * This symbol contains the sizeof(U32).
*/
-/* FFLUSH_ALL:
- * This symbol, if defined, tells that to flush
- * all pending stdio output one must loop through all
- * the stdio file handles stored in an array and fflush them.
- * Note that if fflushNULL is defined, fflushall will not
- * even be probed for and will be left undefined.
+/* I64SIZE:
+ * This symbol contains the sizeof(I64).
*/
-#define FFLUSH_NULL /**/
-/*#define FFLUSH_ALL /**/
+/* U64SIZE:
+ * This symbol contains the sizeof(U64).
+ */
+#define IVTYPE long /**/
+#define UVTYPE unsigned long /**/
+#define I8TYPE char /**/
+#define U8TYPE unsigned char /**/
+#define I16TYPE short /**/
+#define U16TYPE unsigned short /**/
+#define I32TYPE long /**/
+#define U32TYPE unsigned long /**/
+#ifdef HAS_QUAD
+#define I64TYPE long long /**/
+#define U64TYPE unsigned long long /**/
+#endif
+#define NVTYPE double /**/
+#define IVSIZE 4 /**/
+#define UVSIZE 4 /**/
+#define I8SIZE 1 /**/
+#define U8SIZE 1 /**/
+#define I16SIZE 2 /**/
+#define U16SIZE 2 /**/
+#define I32SIZE 4 /**/
+#define U32SIZE 4 /**/
+#ifdef HAS_QUAD
+#define I64SIZE 8 /**/
+#define U64SIZE 8 /**/
+#endif
-/* DB_Prefix_t:
- * This symbol contains the type of the prefix structure element
- * in the <db.h> header file. In older versions of DB, it was
- * int, while in newer ones it is u_int32_t.
+/* IVdf:
+ * This symbol defines the format string used for printing a Perl IV
+ * as a signed decimal integer.
*/
-/* DB_Hash_t:
- * This symbol contains the type of the prefix structure element
- * in the <db.h> header file. In older versions of DB, it was
- * int, while in newer ones it is size_t.
+/* UVuf:
+ * This symbol defines the format string used for printing a Perl UV
+ * as an unsigned decimal integer.
*/
-#define DB_Hash_t int /**/
-#define DB_Prefix_t int /**/
-
-/* I_INTTYPES:
- * This symbol, if defined, indicates to the C program that it should
- * include <inttypes.h>.
+/* UVof:
+ * This symbol defines the format string used for printing a Perl UV
+ * as an unsigned octal integer.
*/
-/* HAS_INT64_T:
- * This symbol will defined if the C compiler supports int64_t.
- * Usually the <inttypes.h> needs to be included, but sometimes
- * <sys/types.h> is enough.
+/* UVxf:
+ * This symbol defines the format string used for printing a Perl UV
+ * as an unsigned hexadecimal integer.
*/
-/*#define I_INTTYPES /**/
-/*#define HAS_INT64_T /**/
+#define IVdf "ld" /**/
+#define UVuf "lu" /**/
+#define UVof "lo" /**/
+#define UVxf "lx" /**/
-/* I_MNTENT:
- * This symbol, if defined, indicates that <mntent.h> exists and
- * should be included.
+/* Pid_t:
+ * This symbol holds the type used to declare process ids in the kernel.
+ * It can be int, uint, pid_t, etc... It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
*/
-/*#define I_MNTENT /**/
+#define Pid_t int /* PID type */
-/* I_NETINET_TCP:
- * This symbol, if defined, indicates to the C program that it should
- * include <netinet/tcp.h>.
+/* PRIVLIB:
+ * This symbol contains the name of the private library for this package.
+ * The library is private in the sense that it needn't be in anyone's
+ * execution path, but it should be accessible by the world. The program
+ * should be prepared to do ~ expansion.
*/
-/*#define I_NETINET_TCP /**/
-
-/* I_POLL:
- * This symbol, if defined, indicates that <poll.h> exists and
- * should be included.
+/* PRIVLIB_EXP:
+ * This symbol contains the ~name expanded version of PRIVLIB, to be used
+ * in programs that are not prepared to deal with ~ expansion at run-time.
*/
-/*#define I_POLL /**/
+#define PRIVLIB "c:\\perl\\5.5.640\\lib" /**/
+#define PRIVLIB_EXP (win32_get_privlib("5.5.640")) /**/
-/* I_SHADOW:
- * This symbol, if defined, indicates that <shadow.h> exists and
- * should be included.
+/* PTRSIZE:
+ * This symbol contains the size of a pointer, so that the C preprocessor
+ * can make decisions based on it. It will be sizeof(void *) if
+ * the compiler supports (void *); otherwise it will be
+ * sizeof(char *).
*/
-/*#define I_SHADOW /**/
+#define PTRSIZE 4 /**/
-/* I_SOCKS:
- * This symbol, if defined, indicates that <socks.h> exists and
- * should be included.
+/* Drand01:
+ * This macro is to be used to generate uniformly distributed
+ * random numbers over the range [0., 1.[. You may have to supply
+ * an 'extern double drand48();' in your program since SunOS 4.1.3
+ * doesn't provide you with anything relevant in it's headers.
+ * See HAS_DRAND48_PROTO.
*/
-/*#define I_SOCKS /**/
-
-/* I_SYS_MMAN:
- * This symbol, if defined, indicates that <sys/mman.h> exists and
- * should be included.
+/* Rand_seed_t:
+ * This symbol defines the type of the argument of the
+ * random seed function.
*/
-/*#define I_SYS_MMAN /**/
+/* seedDrand01:
+ * This symbol defines the macro to be used in seeding the
+ * random number generator (see Drand01).
+ */
+/* RANDBITS:
+ * This symbol indicates how many bits are produced by the
+ * function used to generate normalized random numbers.
+ * Values include 15, 16, 31, and 48.
+ */
+#define Drand01() (rand()/(double)((unsigned)1<<RANDBITS)) /**/
+#define Rand_seed_t unsigned /**/
+#define seedDrand01(x) srand((Rand_seed_t)x) /**/
+#define RANDBITS 15 /**/
-/* I_SYS_MOUNT:
- * This symbol, if defined, indicates that <sys/mount.h> exists and
- * should be included.
+/* SELECT_MIN_BITS:
+ * This symbol holds the minimum number of bits operated by select.
+ * That is, if you do select(n, ...), how many bits at least will be
+ * cleared in the masks if some activity is detected. Usually this
+ * is either n or 32*ceil(n/32), especially many little-endians do
+ * the latter. This is only useful if you have select(), naturally.
*/
-/*#define I_SYS_MOUNT /**/
+#define SELECT_MIN_BITS 32 /**/
-/* I_SYS_STATVFS:
- * This symbol, if defined, indicates that <sys/statvfs.h> exists and
- * should be included.
+/* Select_fd_set_t:
+ * This symbol holds the type used for the 2nd, 3rd, and 4th
+ * arguments to select. Usually, this is 'fd_set *', if HAS_FD_SET
+ * is defined, and 'int *' otherwise. This is only useful if you
+ * have select(), of course.
*/
-/*#define I_SYS_STATVFS /**/
+#define Select_fd_set_t Perl_fd_set * /**/
-/* HAS_OFF64_T:
- * This symbol will be defined if the C compiler supports off64_t.
+/* SIG_NAME:
+ * This symbol contains a list of signal names in order of
+ * signal number. This is intended
+ * to be used as a static array initialization, like this:
+ * char *sig_name[] = { SIG_NAME };
+ * The signals in the list are separated with commas, and each signal
+ * is surrounded by double quotes. There is no leading SIG in the signal
+ * name, i.e. SIGQUIT is known as "QUIT".
+ * Gaps in the signal numbers (up to NSIG) are filled in with NUMnn,
+ * etc., where nn is the actual signal number (e.g. NUM37).
+ * The signal number for sig_name[i] is stored in sig_num[i].
+ * The last element is 0 to terminate the list with a NULL. This
+ * corresponds to the 0 at the end of the sig_num list.
*/
-/* HAS_FPOS64_T:
- * This symbol will be defined if the C compiler supports fpos64_t.
+/* SIG_NUM:
+ * This symbol contains a list of signal numbers, in the same order as the
+ * SIG_NAME list. It is suitable for static array initialization, as in:
+ * int sig_num[] = { SIG_NUM };
+ * The signals in the list are separated with commas, and the indices
+ * within that list and the SIG_NAME list match, so it's easy to compute
+ * the signal name from a number or vice versa at the price of a small
+ * dynamic linear lookup.
+ * Duplicates are allowed, but are moved to the end of the list.
+ * The signal number corresponding to sig_name[i] is sig_number[i].
+ * if (i < NSIG) then sig_number[i] == i.
+ * The last element is 0, corresponding to the 0 at the end of
+ * the sig_name list.
*/
-/*#define HAS_OFF64_T /**/
-/*#define HAS_FPOS64_T /**/
+#define SIG_NAME "ZERO", "NUM01", "INT", "QUIT", "ILL", "NUM05", "NUM06", "NUM07", "FPE", "KILL", "NUM10", "SEGV", "NUM12", "PIPE", "ALRM", "TERM", "NUM16", "NUM17", "NUM18", "NUM19", "CHLD", "BREAK", "ABRT", "STOP", "NUM24", "CONT", "CLD", 0 /**/
+#define SIG_NUM 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 20, 0 /**/
-/* PERL_PRIfldbl:
- * This symbol, if defined, contains the string used by stdio to
- * format long doubles (format 'f') for output.
+/* SITEARCH:
+ * This symbol contains the name of the private library for this package.
+ * The library is private in the sense that it needn't be in anyone's
+ * execution path, but it should be accessible by the world. The program
+ * should be prepared to do ~ expansion.
+ * The standard distribution will put nothing in this directory.
+ * After perl has been installed, users may install their own local
+ * architecture-dependent modules in this directory with
+ * MakeMaker Makefile.PL
+ * or equivalent. See INSTALL for details.
*/
-/* PERL_PRIgldbl:
- * This symbol, if defined, contains the string used by stdio to
- * format long doubles (format 'g') for output.
+/* SITEARCH_EXP:
+ * This symbol contains the ~name expanded version of SITEARCH, to be used
+ * in programs that are not prepared to deal with ~ expansion at run-time.
*/
-/*#define PERL_PRIfldbl undef /**/
-/*#define PERL_PRIgldbl undef /**/
+#define SITEARCH "c:\\perl\\site\\5.5.640\\lib\\MSWin32-x86" /**/
+/*#define SITEARCH_EXP "" /**/
-/* PERL_PRId64:
- * This symbol, if defined, contains the string used by stdio to
- * format 64-bit decimal numbers (format 'd') for output.
- */
-/* PERL_PRIu64:
- * This symbol, if defined, contains the string used by stdio to
- * format 64-bit unsigned decimal numbers (format 'u') for output.
+/* SITELIB:
+ * This symbol contains the name of the private library for this package.
+ * The library is private in the sense that it needn't be in anyone's
+ * execution path, but it should be accessible by the world. The program
+ * should be prepared to do ~ expansion.
+ * The standard distribution will put nothing in this directory.
+ * After perl has been installed, users may install their own local
+ * architecture-independent modules in this directory with
+ * MakeMaker Makefile.PL
+ * or equivalent. See INSTALL for details.
*/
-/* PERL_PRIo64:
- * This symbol, if defined, contains the string used by stdio to
- * format 64-bit octal numbers (format 'o') for output.
+/* SITELIB_EXP:
+ * This symbol contains the ~name expanded version of SITELIB, to be used
+ * in programs that are not prepared to deal with ~ expansion at run-time.
*/
-/* PERL_PRIx64:
- * This symbol, if defined, contains the string used by stdio to
- * format 64-bit hexadecimal numbers (format 'x') for output.
+#define SITELIB "c:\\perl\\site\\5.5.640\\lib" /**/
+#define SITELIB_EXP (win32_get_sitelib("5.5.640")) /**/
+
+/* Size_t:
+ * This symbol holds the type used to declare length parameters
+ * for string functions. It is usually size_t, but may be
+ * unsigned long, int, etc. It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
*/
-/*#define PERL_PRId64 undef /**/
-/*#define PERL_PRIu64 undef /**/
-/*#define PERL_PRIo64 undef /**/
-/*#define PERL_PRIx64 undef /**/
+#define Size_t size_t /* length paramater for string functions */
-/* SELECT_MIN_BITS:
- * This symbol holds the minimum number of bits operated by select.
- * That is, if you do select(n, ...), how many bits at least will be
- * cleared in the masks if some activity is detected. Usually this
- * is either n or 32*ceil(n/32), especially many little-endians do
- * the latter. This is only useful if you have select(), naturally.
+/* SSize_t:
+ * This symbol holds the type used by functions that return
+ * a count of bytes or an error condition. It must be a signed type.
+ * It is usually ssize_t, but may be long or int, etc.
+ * It may be necessary to include <sys/types.h> or <unistd.h>
+ * to get any typedef'ed information.
+ * We will pick a type such that sizeof(SSize_t) == sizeof(Size_t).
*/
-#define SELECT_MIN_BITS 32 /**/
+#define SSize_t int /* signed count of bytes */
/* STARTPERL:
* This variable contains the string to put in front of a perl
* Usual values include _iob, __iob, and __sF.
*/
/*#define HAS_STDIO_STREAM_ARRAY /**/
-#define STDIO_STREAM_ARRAY undef
+#define STDIO_STREAM_ARRAY
-/* HAS_STRTOULL:
- * This symbol, if defined, indicates that the strtoull routine is
- * available to convert strings into unsigned long longs.
+/* Uid_t_f:
+ * This symbol defines the format string used for printing a Uid_t.
*/
-/*#define HAS_STRTOULL /**/
+#define Uid_t_f "ld" /**/
+
+/* Uid_t_size:
+ * This symbol holds the size of a Uid_t in bytes.
+ */
+#define Uid_t_size 4 /* UID size */
+
+/* Uid_t:
+ * This symbol holds the type used to declare user ids in the kernel.
+ * It can be int, ushort, uid_t, etc... It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
+ */
+#define Uid_t uid_t /* UID type */
/* USE_64_BITS:
- * This symbol, if defined, indicates that 64-bit interfaces should
- * be used when available. If not defined, the native default interfaces
+ * This symbol, if defined, indicates that 64-bit integers should
+ * be used when available. If not defined, the native integers
* will be used (be they 32 or 64 bits).
*/
+#ifndef USE_64_BITS
/*#define USE_64_BITS /**/
+#endif
+
+/* USE_LARGE_FILES:
+ * This symbol, if defined, indicates that large file support
+ * should be used when available. The USE_64_BITS symbol will
+ * also be turned on if necessary.
+ */
+#ifndef USE_LARGE_FILES
+/*#define USE_LARGE_FILES /**/
+#endif
/* USE_LONG_DOUBLE:
* This symbol, if defined, indicates that long doubles should
* be used when available.
*/
+#ifndef USE_LONG_DOUBLE
/*#define USE_LONG_DOUBLE /**/
+#endif
+
+/* USE_LONG_LONG:
+ * This symbol, if defined, indicates that long longs should
+ * be used when available.
+ */
+#ifndef USE_LONG_LONG
+/*#define USE_LONG_LONG /**/
+#endif
+
+#ifndef USE_MORE_BITS
+/*#define USE_MORE_BITS /**/
+#endif
/* MULTIPLICITY:
* This symbol, if defined, indicates that Perl should
* be built to use multiplicity.
*/
+#ifndef MULTIPLICTY
/*#define MULTIPLICITY /**/
+#endif
/* USE_PERLIO:
* This symbol, if defined, indicates that the PerlIO abstraction should
* be used throughout. If not defined, stdio should be
* used in a fully backward compatible manner.
*/
+#ifndef USE_PERLIO
/*#define USE_PERLIO /**/
+#endif
/* USE_SOCKS:
* This symbol, if defined, indicates that Perl should
* be built to use socks.
*/
+#ifndef USE_SOCKS
/*#define USE_SOCKS /**/
+#endif
-/* HAS_DRAND48_PROTO:
- * This symbol, if defined, indicates that the system provides
- * a prototype for the drand48() function. Otherwise, it is up
- * to the program to supply one. A good guess is
- * extern double drand48 _((void));
- */
-/*#define HAS_DRAND48_PROTO /**/
-
-/* HAS_GETHOST_PROTOS:
- * This symbol, if defined, indicates that <netdb.h> includes
- * prototypes for gethostent(), gethostbyname(), and
- * gethostbyaddr(). Otherwise, it is up to the program to guess
- * them. See netdbtype.U for probing for various Netdb_xxx_t types.
- */
-#define HAS_GETHOST_PROTOS /**/
-
-/* HAS_GETNET_PROTOS:
- * This symbol, if defined, indicates that <netdb.h> includes
- * prototypes for getnetent(), getnetbyname(), and
- * getnetbyaddr(). Otherwise, it is up to the program to guess
- * them. See netdbtype.U for probing for various Netdb_xxx_t types.
- */
-/*#define HAS_GETNET_PROTOS /**/
-
-/* HAS_GETPROTO_PROTOS:
- * This symbol, if defined, indicates that <netdb.h> includes
- * prototypes for getprotoent(), getprotobyname(), and
- * getprotobyaddr(). Otherwise, it is up to the program to guess
- * them. See netdbtype.U for probing for various Netdb_xxx_t types.
- */
-#define HAS_GETPROTO_PROTOS /**/
-
-/* HAS_GETSERV_PROTOS:
- * This symbol, if defined, indicates that <netdb.h> includes
- * prototypes for getservent(), getservbyname(), and
- * getservbyaddr(). Otherwise, it is up to the program to guess
- * them. See netdbtype.U for probing for various Netdb_xxx_t types.
- */
-#define HAS_GETSERV_PROTOS /**/
-
-/* Netdb_host_t:
- * This symbol holds the type used for the 1st argument
- * to gethostbyaddr().
- */
-/* Netdb_hlen_t:
- * This symbol holds the type used for the 2nd argument
- * to gethostbyaddr().
- */
-/* Netdb_name_t:
- * This symbol holds the type used for the argument to
- * gethostbyname().
- */
-/* Netdb_net_t:
- * This symbol holds the type used for the 1st argument to
- * getnetbyaddr().
- */
-#define Netdb_host_t char * /**/
-#define Netdb_hlen_t int /**/
-#define Netdb_name_t char * /**/
-#define Netdb_net_t long /**/
-
-/* Select_fd_set_t:
- * This symbol holds the type used for the 2nd, 3rd, and 4th
- * arguments to select. Usually, this is 'fd_set *', if HAS_FD_SET
- * is defined, and 'int *' otherwise. This is only useful if you
- * have select(), of course.
- */
-#define Select_fd_set_t Perl_fd_set * /**/
-
-/* ARCHNAME:
- * This symbol holds a string representing the architecture name.
- * It may be used to construct an architecture-dependant pathname
- * where library files may be held under a private library, for
- * instance.
- */
-#define ARCHNAME "MSWin32-x86" /**/
-
-/* OLD_PTHREAD_CREATE_JOINABLE:
- * This symbol, if defined, indicates how to create pthread
- * in joinable (aka undetached) state. NOTE: not defined
- * if pthread.h already has defined PTHREAD_CREATE_JOINABLE
- * (the new version of the constant).
- * If defined, known values are PTHREAD_CREATE_UNDETACHED
- * and __UNDETACHED.
- */
-/*#define OLD_PTHREAD_CREATE_JOINABLE /**/
-
-/* HAS_PTHREAD_YIELD:
- * This symbol, if defined, indicates that the pthread_yield
- * routine is available to yield the execution of the current
- * thread. sched_yield is preferable to pthread_yield.
- */
-/* SCHED_YIELD:
- * This symbol defines the way to yield the execution of
- * the current thread. Known ways are sched_yield,
- * pthread_yield, and pthread_yield with NULL.
- */
-/* HAS_SCHED_YIELD:
- * This symbol, if defined, indicates that the sched_yield
- * routine is available to yield the execution of the current
- * thread. sched_yield is preferable to pthread_yield.
- */
-/*#define HAS_PTHREAD_YIELD /**/
-#define SCHED_YIELD /**/
-/*#define HAS_SCHED_YIELD /**/
-
-/* I_MACH_CTHREADS:
- * This symbol, if defined, indicates to the C program that it should
- * include <mach/cthreads.h>.
+/* USE_ITHREADS:
+ * This symbol, if defined, indicates that Perl should be built to
+ * use the interpreter-based threading implementation.
*/
-/*#define I_MACH_CTHREADS /**/
-
-/* USE_THREADS:
- * This symbol, if defined, indicates that Perl should
- * be built to use threads.
+/* USE_5005THREADS:
+ * This symbol, if defined, indicates that Perl should be built to
+ * use the 5.005-based threading implementation.
*/
/* OLD_PTHREADS_API:
* This symbol, if defined, indicates that Perl should
* be built to use the old draft POSIX threads API.
*/
-/*#define USE_THREADS /**/
+/*#define USE_5005THREADS /**/
+/*#define USE_ITHREADS /**/
+#if defined(USE_5005THREADS) && !defined(USE_ITHREADS)
+#define USE_THREADS /* until src is revised*/
+#endif
/*#define OLD_PTHREADS_API /**/
-/* Time_t:
- * This symbol holds the type returned by time(). It can be long,
- * or time_t on BSD sites (in which case <sys/types.h> should be
- * included).
- */
-#define Time_t time_t /* Time type */
-
-/* HAS_TIMES:
- * This symbol, if defined, indicates that the times() routine exists.
- * Note that this became obsolete on some systems (SUNOS), which now
- * use getrusage(). It may be necessary to include <sys/times.h>.
- */
-#define HAS_TIMES /**/
-
-/* Fpos_t:
- * This symbol holds the type used to declare file positions in libc.
- * It can be fpos_t, long, uint, etc... It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
- */
-#define Fpos_t fpos_t /* File position type */
-
-/* Gid_t:
- * This symbol holds the return type of getgid() and the type of
- * argument to setrgid() and related functions. Typically,
- * it is the type of group ids in the kernel. It can be int, ushort,
- * uid_t, etc... It may be necessary to include <sys/types.h> to get
- * any typedef'ed information.
- */
-#define Gid_t gid_t /* Type for getgid(), etc... */
-
-/* Off_t:
- * This symbol holds the type used to declare offsets in the kernel.
- * It can be int, long, off_t, etc... It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
- */
-/* LSEEKSIZE:
- * This symbol holds the number of bytes used by the Off_t.
- */
-#define Off_t off_t /* <offset> type */
-#define LSEEKSIZE 4 /* <offset> size */
-
-/* Mode_t:
- * This symbol holds the type used to declare file modes
- * for systems calls. It is usually mode_t, but may be
- * int or unsigned short. It may be necessary to include <sys/types.h>
- * to get any typedef'ed information.
- */
-#define Mode_t mode_t /* file mode parameter for system calls */
-
-/* Pid_t:
- * This symbol holds the type used to declare process ids in the kernel.
- * It can be int, uint, pid_t, etc... It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
- */
-#define Pid_t int /* PID type */
-
-/* Size_t:
- * This symbol holds the type used to declare length parameters
- * for string functions. It is usually size_t, but may be
- * unsigned long, int, etc. It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
+/* PERL_VENDORLIB_EXP:
+ * This symbol contains the ~name expanded version of VENDORLIB, to be used
+ * in programs that are not prepared to deal with ~ expansion at run-time.
*/
-#define Size_t size_t /* length paramater for string functions */
+/*#define PERL_VENDORLIB_EXP "" /**/
-/* Uid_t:
- * This symbol holds the type used to declare user ids in the kernel.
- * It can be int, ushort, uid_t, etc... It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
+/* VOIDFLAGS:
+ * This symbol indicates how much support of the void type is given by this
+ * compiler. What various bits mean:
+ *
+ * 1 = supports declaration of void
+ * 2 = supports arrays of pointers to functions returning void
+ * 4 = supports comparisons between pointers to void functions and
+ * addresses of void functions
+ * 8 = suports declaration of generic void pointers
+ *
+ * The package designer should define VOIDUSED to indicate the requirements
+ * of the package. This can be done either by #defining VOIDUSED before
+ * including config.h, or by defining defvoidused in Myinit.U. If the
+ * latter approach is taken, only those flags will be tested. If the
+ * level of void support necessary is not present, defines void to int.
*/
-#define Uid_t uid_t /* UID type */
+#ifndef VOIDUSED
+#define VOIDUSED 15
+#endif
+#define VOIDFLAGS 15
+#if (VOIDFLAGS & VOIDUSED) != VOIDUSED
+#define void int /* is void to be avoided? */
+#define M_VOID /* Xenix strikes again */
+#endif
#endif
/*
* Package name : perl5
* Source directory :
- * Configuration time: undef
+ * Configuration time: Tue Jan 18 21:02:27 2000
* Configured by : gsar
* Target system :
*/
* This symbol, if defined, indicates that the link routine is
* available to create hard links.
*/
-/*#define HAS_LINK /**/
+#define HAS_LINK /**/
/* HAS_LOCALECONV:
* This symbol, if defined, indicates that the localeconv routine is
*/
#define HAS_MKTIME /**/
-/* HAS_MSYNC:
- * This symbol, if defined, indicates that the msync system call is
- * available to synchronize a mapped file.
- */
-/*#define HAS_MSYNC /**/
-
-/* HAS_MUNMAP:
- * This symbol, if defined, indicates that the munmap system call is
- * available to unmap a region, usually mapped by mmap().
- */
-/*#define HAS_MUNMAP /**/
-
/* HAS_NICE:
* This symbol, if defined, indicates that the nice routine is
* available.
*/
#define STDCHAR char /**/
-/* HAS_ACCESSX:
- * This symbol, if defined, indicates that the accessx routine is
- * available to do extended access checks.
- */
-/*#define HAS_ACCESSX /**/
-
-/* HAS_EACCESS:
- * This symbol, if defined, indicates that the eaccess routine is
- * available to do extended access checks.
- */
-/*#define HAS_EACCESS /**/
-
-/* I_SYS_ACCESS:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/access.h>.
- */
-/*#define I_SYS_ACCESS /**/
-
-/* I_SYS_SECURITY:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/security.h>.
- */
-/*#define I_SYS_SECURITY /**/
-
/* CROSSCOMPILE:
* This symbol, if defined, signifies that we our
* build process is a cross-compilation.
*/
/*#define MULTIARCH /**/
+/* HAS_QUAD:
+ * This symbol, if defined, tells that there's a 64-bit integer type,
+ * Quad_t, and its unsigned counterpar, Uquad_t. QUADKIND will be one
+ * of QUAD_IS_INT, QUAD_IS_LONG, QUAD_IS_LONG_LONG, or QUAD_IS_INT64_T.
+ */
+/*#define HAS_QUAD /**/
+#ifdef HAS_QUAD
+# define Quad_t __int64 /**/
+# define Uquad_t unsigned __int64 /**/
+# define QUADKIND undef /**/
+# define QUAD_IS_INT 1
+# define QUAD_IS_LONG 2
+# define QUAD_IS_LONG_LONG 3
+# define QUAD_IS_INT64_T 4
+#endif
+
+/* HAS_ACCESSX:
+ * This symbol, if defined, indicates that the accessx routine is
+ * available to do extended access checks.
+ */
+/*#define HAS_ACCESSX /**/
+
+/* HAS_EACCESS:
+ * This symbol, if defined, indicates that the eaccess routine is
+ * available to do extended access checks.
+ */
+/*#define HAS_EACCESS /**/
+
+/* I_SYS_ACCESS:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <sys/access.h>.
+ */
+/*#define I_SYS_ACCESS /**/
+
+/* I_SYS_SECURITY:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <sys/security.h>.
+ */
+/*#define I_SYS_SECURITY /**/
+
+/* OSNAME:
+ * This symbol contains the name of the operating system, as determined
+ * by Configure. You shouldn't rely on it too much; the specific
+ * feature tests from Configure are generally more reliable.
+ */
+#define OSNAME "MSWin32" /**/
+
/* MEM_ALIGNBYTES:
* This symbol contains the number of bytes required to align a
* double. Usual values are 2, 4 and 8. The default is eight,
#define MEM_ALIGNBYTES 8
#endif
+/* ARCHLIB:
+ * This variable, if defined, holds the name of the directory in
+ * which the user wants to put architecture-dependent public
+ * library files for perl5. It is most often a local directory
+ * such as /usr/local/lib. Programs using this variable must be
+ * prepared to deal with filename expansion. If ARCHLIB is the
+ * same as PRIVLIB, it is not defined, since presumably the
+ * program already searches PRIVLIB.
+ */
+/* ARCHLIB_EXP:
+ * This symbol contains the ~name expanded version of ARCHLIB, to be used
+ * in programs that are not prepared to deal with ~ expansion at run-time.
+ */
+#define ARCHLIB "c:\\perl\\5.5.640\\lib\\MSWin32-x86" /**/
+/*#define ARCHLIB_EXP "" /**/
+
+/* ARCHNAME:
+ * This symbol holds a string representing the architecture name.
+ * It may be used to construct an architecture-dependant pathname
+ * where library files may be held under a private library, for
+ * instance.
+ */
+#define ARCHNAME "MSWin32-x86" /**/
+
+/* HAS_ATOLF:
+ * This symbol, if defined, indicates that the atolf routine is
+ * available to convert strings into long doubles.
+ */
+/*#define HAS_ATOLF /**/
+
+/* HAS_ATOLL:
+ * This symbol, if defined, indicates that the atoll routine is
+ * available to convert strings into long longs.
+ */
+/*#define HAS_ATOLL /**/
+
+/* BIN:
+ * This symbol holds the path of the bin directory where the package will
+ * be installed. Program must be prepared to deal with ~name substitution.
+ */
+/* BIN_EXP:
+ * This symbol is the filename expanded version of the BIN symbol, for
+ * programs that do not want to deal with that at run-time.
+ */
+#define BIN "c:\\perl\\5.5.640\\bin\\MSWin32-x86" /**/
+#define BIN_EXP "c:\\perl\\5.5.640\\bin\\MSWin32-x86" /**/
+
+/* PERL_BINCOMPAT_5005:
+ * This symbol, if defined, indicates that Perl 5.006 should be
+ * binary-compatible with Perl 5.005. This is impossible for builds
+ * that use features like threads and multiplicity it is always undef
+ * for those versions.
+ */
+/*#define PERL_BINCOMPAT_5005 /**/
+
/* BYTEORDER:
* This symbol holds the hexadecimal constant defined in byteorder,
* i.e. 0x1234 or 0x4321, etc...
#define BYTEORDER 0x1234 /* large digits for MSB */
#endif /* NeXT */
+/* CAT2:
+ * This macro catenates 2 tokens together.
+ */
+/* STRINGIFY:
+ * This macro surrounds its token with double quotes.
+ */
+#if 42 == 1
+#define CAT2(a,b)a/**/b
+#define STRINGIFY(a)"a"
+ /* If you can get stringification with catify, tell me how! */
+#endif
+#if 42 == 42
+#define CAT2(a,b)a ## b
+#define StGiFy(a)# a
+#define STRINGIFY(a)StGiFy(a)
+#endif
+#if 42 != 1 && 42 != 42
+#include "Bletch: How does this C preprocessor catenate tokens?"
+#endif
+
+/* CPPSTDIN:
+ * This symbol contains the first part of the string which will invoke
+ * the C preprocessor on the standard input and produce to standard
+ * output. Typical value of "cc -E" or "/lib/cpp", but it can also
+ * call a wrapper. See CPPRUN.
+ */
+/* CPPMINUS:
+ * This symbol contains the second part of the string which will invoke
+ * the C preprocessor on the standard input and produce to standard
+ * output. This symbol will have the value "-" if CPPSTDIN needs a minus
+ * to specify standard input, otherwise the value is "".
+ */
+/* CPPRUN:
+ * This symbol contains the string which will invoke a C preprocessor on
+ * the standard input and produce to standard output. It needs to end
+ * with CPPLAST, after all other preprocessor flags have been specified.
+ * The main difference with CPPSTDIN is that this program will never be a
+ * pointer to a shell wrapper, i.e. it will be empty if no preprocessor is
+ * available directly to the user. Note that it may well be different from
+ * the preprocessor used to compile the C program.
+ */
+#define CPPSTDIN "cl -nologo -E"
+#define CPPMINUS ""
+#define CPPRUN "cl -nologo -E"
+
+/* HAS_ACCESS:
+ * This manifest constant lets the C program know that the access()
+ * system call is available to check for accessibility using real UID/GID.
+ * (always present on UNIX.)
+ */
+#define HAS_ACCESS /**/
+
/* CASTI32:
* This symbol is defined if the C compiler can cast negative
* or large floating point numbers to 32-bit ints.
*/
/*#define VOID_CLOSEDIR /**/
+/* HAS_CSH:
+ * This symbol, if defined, indicates that the C-shell exists.
+ */
+/* CSH:
+ * This symbol, if defined, contains the full pathname of csh.
+ */
+/*#define HAS_CSH /**/
+#ifdef HAS_CSH
+#define CSH "" /**/
+#endif
+
+/* DLSYM_NEEDS_UNDERSCORE:
+ * This symbol, if defined, indicates that we need to prepend an
+ * underscore to the symbol name before calling dlsym(). This only
+ * makes sense if you *have* dlsym, which we will presume is the
+ * case if you're using dl_dlopen.xs.
+ */
+/*#define DLSYM_NEEDS_UNDERSCORE /**/
+
+/* HAS_DRAND48_PROTO:
+ * This symbol, if defined, indicates that the system provides
+ * a prototype for the drand48() function. Otherwise, it is up
+ * to the program to supply one. A good guess is
+ * extern double drand48 _((void));
+ */
+/*#define HAS_DRAND48_PROTO /**/
+
+/* HAS_ENDGRENT:
+ * This symbol, if defined, indicates that the getgrent routine is
+ * available for finalizing sequential access of the group database.
+ */
+/*#define HAS_ENDGRENT /**/
+
+/* HAS_ENDHOSTENT:
+ * This symbol, if defined, indicates that the endhostent() routine is
+ * available to close whatever was being used for host queries.
+ */
+/*#define HAS_ENDHOSTENT /**/
+
+/* HAS_ENDNETENT:
+ * This symbol, if defined, indicates that the endnetent() routine is
+ * available to close whatever was being used for network queries.
+ */
+/*#define HAS_ENDNETENT /**/
+
+/* HAS_ENDPROTOENT:
+ * This symbol, if defined, indicates that the endprotoent() routine is
+ * available to close whatever was being used for protocol queries.
+ */
+/*#define HAS_ENDPROTOENT /**/
+
+/* HAS_ENDPWENT:
+ * This symbol, if defined, indicates that the getgrent routine is
+ * available for finalizing sequential access of the passwd database.
+ */
+/*#define HAS_ENDPWENT /**/
+
+/* HAS_ENDSERVENT:
+ * This symbol, if defined, indicates that the endservent() routine is
+ * available to close whatever was being used for service queries.
+ */
+/*#define HAS_ENDSERVENT /**/
+
+/* HAS_ENDSPENT:
+ * This symbol, if defined, indicates that the endspent system call is
+ * available to finalize the scan of SysV shadow password entries.
+ */
+/*#define HAS_ENDSPENT /**/
+
/* HAS_FD_SET:
* This symbol, when defined, indicates presence of the fd_set typedef
* in <sys/types.h>
*/
#define HAS_FD_SET /**/
+/* HAS_STRUCT_FS_DATA:
+ * This symbol, if defined, indicates that the struct fs_data
+ * to do statfs() is supported.
+ */
+/*#define HAS_STRUCT_FS_DATA /**/
+
+/* HAS_FSEEKO:
+ * This symbol, if defined, indicates that the fseeko routine is
+ * available to fseek beyond 32 bits (useful for ILP32 hosts).
+ */
+/*#define HAS_FSEEKO /**/
+
+/* HAS_FSTATFS:
+ * This symbol, if defined, indicates that the fstatfs routine is
+ * available to stat filesystems by file descriptors.
+ */
+/*#define HAS_FSTATFS /**/
+/* HAS_FTELLO:
+ * This symbol, if defined, indicates that the ftello routine is
+ * available to ftell beyond 32 bits (useful for ILP32 hosts).
+ */
+/*#define HAS_FTELLO /**/
+
/* Gconvert:
* This preprocessor macro is defined to convert a floating point
* number to a string without a trailing decimal point. This
*/
#define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
-/* HAS_GNULIBC:
- * This symbol, if defined, indicates to the C program that
- * the GNU C library is being used.
- */
-/*#define HAS_GNULIBC /**/
-/* HAS_ISASCII:
- * This manifest constant lets the C program know that isascii
- * is available.
- */
-#define HAS_ISASCII /**/
-
-/* HAS_LCHOWN:
- * This symbol, if defined, indicates that the lchown routine is
- * available to operate on a symbolic link (instead of following the
- * link).
- */
-/*#define HAS_LCHOWN /**/
-
-/* HAS_OPEN3:
- * This manifest constant lets the C program know that the three
- * argument form of open(2) is available.
- */
-/*#define HAS_OPEN3 /**/
-
-/* HAS_SAFE_BCOPY:
- * This symbol, if defined, indicates that the bcopy routine is available
- * to copy potentially overlapping memory blocks. Otherwise you should
- * probably use memmove() or memcpy(). If neither is defined, roll your
- * own version.
- */
-/*#define HAS_SAFE_BCOPY /**/
-
-/* HAS_SAFE_MEMCPY:
- * This symbol, if defined, indicates that the memcpy routine is available
- * to copy potentially overlapping memory blocks. Otherwise you should
- * probably use memmove() or memcpy(). If neither is defined, roll your
- * own version.
- */
-/*#define HAS_SAFE_MEMCPY /**/
-
-/* HAS_SANE_MEMCMP:
- * This symbol, if defined, indicates that the memcmp routine is available
- * and can be used to compare relative magnitudes of chars with their high
- * bits set. If it is not defined, roll your own version.
- */
-#define HAS_SANE_MEMCMP /**/
-
-/* HAS_SIGACTION:
- * This symbol, if defined, indicates that Vr4's sigaction() routine
- * is available.
- */
-/*#define HAS_SIGACTION /**/
-
-/* HAS_SIGSETJMP:
- * This variable indicates to the C program that the sigsetjmp()
- * routine is available to save the calling process's registers
- * and stack environment for later use by siglongjmp(), and
- * to optionally save the process's signal mask. See
- * Sigjmp_buf, Sigsetjmp, and Siglongjmp.
- */
-/* Sigjmp_buf:
- * This is the buffer type to be used with Sigsetjmp and Siglongjmp.
- */
-/* Sigsetjmp:
- * This macro is used in the same way as sigsetjmp(), but will invoke
- * traditional setjmp() if sigsetjmp isn't available.
- * See HAS_SIGSETJMP.
- */
-/* Siglongjmp:
- * This macro is used in the same way as siglongjmp(), but will invoke
- * traditional longjmp() if siglongjmp isn't available.
- * See HAS_SIGSETJMP.
- */
-/*#define HAS_SIGSETJMP /**/
-#ifdef HAS_SIGSETJMP
-#define Sigjmp_buf sigjmp_buf
-#define Sigsetjmp(buf,save_mask) sigsetjmp((buf),(save_mask))
-#define Siglongjmp(buf,retval) siglongjmp((buf),(retval))
-#else
-#define Sigjmp_buf jmp_buf
-#define Sigsetjmp(buf,save_mask) setjmp((buf))
-#define Siglongjmp(buf,retval) longjmp((buf),(retval))
-#endif
-
-/* USE_STDIO_PTR:
- * This symbol is defined if the _ptr and _cnt fields (or similar)
- * of the stdio FILE structure can be used to access the stdio buffer
- * for a file handle. If this is defined, then the FILE_ptr(fp)
- * and FILE_cnt(fp) macros will also be defined and should be used
- * to access these fields.
- */
-/* FILE_ptr:
- * This macro is used to access the _ptr field (or equivalent) of the
- * FILE structure pointed to by its argument. This macro will always be
- * defined if USE_STDIO_PTR is defined.
- */
-/* STDIO_PTR_LVALUE:
- * This symbol is defined if the FILE_ptr macro can be used as an
- * lvalue.
- */
-/* FILE_cnt:
- * This macro is used to access the _cnt field (or equivalent) of the
- * FILE structure pointed to by its argument. This macro will always be
- * defined if USE_STDIO_PTR is defined.
- */
-/* STDIO_CNT_LVALUE:
- * This symbol is defined if the FILE_cnt macro can be used as an
- * lvalue.
- */
-#define USE_STDIO_PTR /**/
-#ifdef USE_STDIO_PTR
-#define FILE_ptr(fp) ((fp)->_ptr)
-#define STDIO_PTR_LVALUE /**/
-#define FILE_cnt(fp) ((fp)->_cnt)
-#define STDIO_CNT_LVALUE /**/
-#endif
-
-/* USE_STDIO_BASE:
- * This symbol is defined if the _base field (or similar) of the
- * stdio FILE structure can be used to access the stdio buffer for
- * a file handle. If this is defined, then the FILE_base(fp) macro
- * will also be defined and should be used to access this field.
- * Also, the FILE_bufsiz(fp) macro will be defined and should be used
- * to determine the number of bytes in the buffer. USE_STDIO_BASE
- * will never be defined unless USE_STDIO_PTR is.
- */
-/* FILE_base:
- * This macro is used to access the _base field (or equivalent) of the
- * FILE structure pointed to by its argument. This macro will always be
- * defined if USE_STDIO_BASE is defined.
- */
-/* FILE_bufsiz:
- * This macro is used to determine the number of bytes in the I/O
- * buffer pointed to by _base field (or equivalent) of the FILE
- * structure pointed to its argument. This macro will always be defined
- * if USE_STDIO_BASE is defined.
- */
-#define USE_STDIO_BASE /**/
-#ifdef USE_STDIO_BASE
-#define FILE_base(fp) ((fp)->_base)
-#define FILE_bufsiz(fp) ((fp)->_cnt + (fp)->_ptr - (fp)->_base)
-#endif
-
-/* HAS_VPRINTF:
- * This symbol, if defined, indicates that the vprintf routine is available
- * to printf with a pointer to an argument list. If unavailable, you
- * may need to write your own, probably in terms of _doprnt().
- */
-/* USE_CHAR_VSPRINTF:
- * This symbol is defined if this system has vsprintf() returning type
- * (char*). The trend seems to be to declare it as "int vsprintf()". It
- * is up to the package author to declare vsprintf correctly based on the
- * symbol.
- */
-#define HAS_VPRINTF /**/
-/*#define USE_CHAR_VSPRINTF /**/
-
-/* DOUBLESIZE:
- * This symbol contains the size of a double, so that the C preprocessor
- * can make decisions based on it.
- */
-#define DOUBLESIZE 8 /**/
-
-/* I_TIME:
- * This symbol, if defined, indicates to the C program that it should
- * include <time.h>.
- */
-/* I_SYS_TIME:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/time.h>.
- */
-/* I_SYS_TIME_KERNEL:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/time.h> with KERNEL defined.
- */
-#define I_TIME /**/
-/*#define I_SYS_TIME /**/
-/*#define I_SYS_TIME_KERNEL /**/
-
-/* VAL_O_NONBLOCK:
- * This symbol is to be used during open() or fcntl(F_SETFL) to turn on
- * non-blocking I/O for the file descriptor. Note that there is no way
- * back, i.e. you cannot turn it blocking again this way. If you wish to
- * alternatively switch between blocking and non-blocking, use the
- * ioctl(FIOSNBIO) call instead, but that is not supported by all devices.
- */
-/* VAL_EAGAIN:
- * This symbol holds the errno error code set by read() when no data was
- * present on the non-blocking file descriptor.
- */
-/* RD_NODATA:
- * This symbol holds the return code from read() when no data is present
- * on the non-blocking file descriptor. Be careful! If EOF_NONBLOCK is
- * not defined, then you can't distinguish between no data and EOF by
- * issuing a read(). You'll have to find another way to tell for sure!
- */
-/* EOF_NONBLOCK:
- * This symbol, if defined, indicates to the C program that a read() on
- * a non-blocking file descriptor will return 0 on EOF, and not the value
- * held in RD_NODATA (-1 usually, in that case!).
- */
-#define VAL_O_NONBLOCK O_NONBLOCK
-#define VAL_EAGAIN EAGAIN
-#define RD_NODATA -1
-#define EOF_NONBLOCK
-
-/* PTRSIZE:
- * This symbol contains the size of a pointer, so that the C preprocessor
- * can make decisions based on it. It will be sizeof(void *) if
- * the compiler supports (void *); otherwise it will be
- * sizeof(char *).
- */
-#define PTRSIZE 4 /**/
-
-/* Drand01:
- * This macro is to be used to generate uniformly distributed
- * random numbers over the range [0., 1.[. You may have to supply
- * an 'extern double drand48();' in your program since SunOS 4.1.3
- * doesn't provide you with anything relevant in it's headers.
- * See HAS_DRAND48_PROTO.
- */
-/* Rand_seed_t:
- * This symbol defines the type of the argument of the
- * random seed function.
- */
-/* seedDrand01:
- * This symbol defines the macro to be used in seeding the
- * random number generator (see Drand01).
- */
-/* RANDBITS:
- * This symbol indicates how many bits are produced by the
- * function used to generate normalized random numbers.
- * Values include 15, 16, 31, and 48.
- */
-#define Drand01() (rand()/(double)((unsigned)1<<RANDBITS)) /**/
-#define Rand_seed_t unsigned /**/
-#define seedDrand01(x) srand((Rand_seed_t)x) /**/
-#define RANDBITS 15 /**/
-
-/* SSize_t:
- * This symbol holds the type used by functions that return
- * a count of bytes or an error condition. It must be a signed type.
- * It is usually ssize_t, but may be long or int, etc.
- * It may be necessary to include <sys/types.h> or <unistd.h>
- * to get any typedef'ed information.
- * We will pick a type such that sizeof(SSize_t) == sizeof(Size_t).
- */
-#define SSize_t int /* signed count of bytes */
-
-/* EBCDIC:
- * This symbol, if defined, indicates that this system uses
- * EBCDIC encoding.
- */
-/*#define EBCDIC /**/
-
-/* ARCHLIB:
- * This variable, if defined, holds the name of the directory in
- * which the user wants to put architecture-dependent public
- * library files for perl5. It is most often a local directory
- * such as /usr/local/lib. Programs using this variable must be
- * prepared to deal with filename expansion. If ARCHLIB is the
- * same as PRIVLIB, it is not defined, since presumably the
- * program already searches PRIVLIB.
- */
-/* ARCHLIB_EXP:
- * This symbol contains the ~name expanded version of ARCHLIB, to be used
- * in programs that are not prepared to deal with ~ expansion at run-time.
- */
-#define ARCHLIB "c:\\perl\\5.00561\\lib\\MSWin32-x86" /**/
-/*#define ARCHLIB_EXP "" /**/
-
-/* BIN:
- * This symbol holds the path of the bin directory where the package will
- * be installed. Program must be prepared to deal with ~name substitution.
- */
-/* BIN_EXP:
- * This symbol is the filename expanded version of the BIN symbol, for
- * programs that do not want to deal with that at run-time.
- */
-#define BIN "c:\\perl\\5.00561\\bin\\MSWin32-x86" /**/
-#define BIN_EXP "c:\\perl\\5.00561\\bin\\MSWin32-x86" /**/
-
-/* INSTALL_USR_BIN_PERL:
- * This symbol, if defined, indicates that Perl is to be installed
- * also as /usr/bin/perl.
- */
-/*#define INSTALL_USR_BIN_PERL /**/
-
-/* PRIVLIB:
- * This symbol contains the name of the private library for this package.
- * The library is private in the sense that it needn't be in anyone's
- * execution path, but it should be accessible by the world. The program
- * should be prepared to do ~ expansion.
- */
-/* PRIVLIB_EXP:
- * This symbol contains the ~name expanded version of PRIVLIB, to be used
- * in programs that are not prepared to deal with ~ expansion at run-time.
- */
-#define PRIVLIB "c:\\perl\\5.00561\\lib" /**/
-#define PRIVLIB_EXP (win32_get_privlib("5.00561")) /**/
-
-/* SITEARCH:
- * This symbol contains the name of the private library for this package.
- * The library is private in the sense that it needn't be in anyone's
- * execution path, but it should be accessible by the world. The program
- * should be prepared to do ~ expansion.
- * The standard distribution will put nothing in this directory.
- * Individual sites may place their own extensions and modules in
- * this directory.
- */
-/* SITEARCH_EXP:
- * This symbol contains the ~name expanded version of SITEARCH, to be used
- * in programs that are not prepared to deal with ~ expansion at run-time.
- */
-#define SITEARCH "c:\\perl\\site\\5.00561\\lib\\MSWin32-x86" /**/
-/*#define SITEARCH_EXP "" /**/
-
-/* SITELIB:
- * This symbol contains the name of the private library for this package.
- * The library is private in the sense that it needn't be in anyone's
- * execution path, but it should be accessible by the world. The program
- * should be prepared to do ~ expansion.
- * The standard distribution will put nothing in this directory.
- * Individual sites may place their own extensions and modules in
- * this directory.
- */
-/* SITELIB_EXP:
- * This symbol contains the ~name expanded version of SITELIB, to be used
- * in programs that are not prepared to deal with ~ expansion at run-time.
- */
-#define SITELIB "c:\\perl\\site\\5.00561\\lib" /**/
-#define SITELIB_EXP (win32_get_sitelib("5.00561")) /**/
-
-/* PERL_VENDORLIB_EXP:
- * This symbol contains the ~name expanded version of VENDORLIB, to be used
- * in programs that are not prepared to deal with ~ expansion at run-time.
- */
-/*#define PERL_VENDORLIB_EXP "undef" /**/
-
-/* OSNAME:
- * This symbol contains the name of the operating system, as determined
- * by Configure. You shouldn't rely on it too much; the specific
- * feature tests from Configure are generally more reliable.
- */
-#define OSNAME "MSWin32" /**/
-
-/* CAT2:
- * This macro catenates 2 tokens together.
- */
-/* STRINGIFY:
- * This macro surrounds its token with double quotes.
- */
-#if 42 == 1
-#define CAT2(a,b)a/**/b
-#define STRINGIFY(a)"a"
- /* If you can get stringification with catify, tell me how! */
-#endif
-#if 42 == 42
-#define CAT2(a,b)a ## b
-#define StGiFy(a)# a
-#define STRINGIFY(a)StGiFy(a)
-#endif
-#if 42 != 1 && 42 != 42
-#include "Bletch: How does this C preprocessor catenate tokens?"
-#endif
-
-/* CPPSTDIN:
- * This symbol contains the first part of the string which will invoke
- * the C preprocessor on the standard input and produce to standard
- * output. Typical value of "cc -E" or "/lib/cpp", but it can also
- * call a wrapper. See CPPRUN.
- */
-/* CPPMINUS:
- * This symbol contains the second part of the string which will invoke
- * the C preprocessor on the standard input and produce to standard
- * output. This symbol will have the value "-" if CPPSTDIN needs a minus
- * to specify standard input, otherwise the value is "".
- */
-/* CPPRUN:
- * This symbol contains the string which will invoke a C preprocessor on
- * the standard input and produce to standard output. It needs to end
- * with CPPLAST, after all other preprocessor flags have been specified.
- * The main difference with CPPSTDIN is that this program will never be a
- * pointer to a shell wrapper, i.e. it will be empty if no preprocessor is
- * available directly to the user. Note that it may well be different from
- * the preprocessor used to compile the C program.
- */
-#define CPPSTDIN "cl -nologo -E"
-#define CPPMINUS ""
-#define CPPRUN "cl -nologo -E"
-
-/* HAS_ACCESS:
- * This manifest constant lets the C program know that the access()
- * system call is available to check for accessibility using real UID/GID.
- * (always present on UNIX.)
- */
-#define HAS_ACCESS /**/
-
-/* HAS_CSH:
- * This symbol, if defined, indicates that the C-shell exists.
- */
-/* CSH:
- * This symbol, if defined, contains the full pathname of csh.
- */
-/*#define HAS_CSH /**/
-#ifdef HAS_CSH
-#define CSH "" /**/
-#endif
-
-/* HAS_ENDGRENT:
- * This symbol, if defined, indicates that the getgrent routine is
- * available for finalizing sequential access of the group database.
- */
-/*#define HAS_ENDGRENT /**/
-
-/* HAS_ENDHOSTENT:
- * This symbol, if defined, indicates that the endhostent() routine is
- * available to close whatever was being used for host queries.
- */
-/*#define HAS_ENDHOSTENT /**/
-
-/* HAS_ENDNETENT:
- * This symbol, if defined, indicates that the endnetent() routine is
- * available to close whatever was being used for network queries.
- */
-/*#define HAS_ENDNETENT /**/
-
-/* HAS_ENDPROTOENT:
- * This symbol, if defined, indicates that the endprotoent() routine is
- * available to close whatever was being used for protocol queries.
- */
-/*#define HAS_ENDPROTOENT /**/
-
-/* HAS_ENDPWENT:
- * This symbol, if defined, indicates that the getgrent routine is
- * available for finalizing sequential access of the passwd database.
- */
-/*#define HAS_ENDPWENT /**/
-
-/* HAS_ENDSERVENT:
- * This symbol, if defined, indicates that the endservent() routine is
- * available to close whatever was being used for service queries.
- */
-/*#define HAS_ENDSERVENT /**/
-
/* HAS_GETGRENT:
* This symbol, if defined, indicates that the getgrent routine is
* available for sequential access of the group database.
#define PHOSTNAME "" /* How to get the host name */
#endif
+/* HAS_GETHOST_PROTOS:
+ * This symbol, if defined, indicates that <netdb.h> includes
+ * prototypes for gethostent(), gethostbyname(), and
+ * gethostbyaddr(). Otherwise, it is up to the program to guess
+ * them. See netdbtype.U for probing for various Netdb_xxx_t types.
+ */
+#define HAS_GETHOST_PROTOS /**/
+
+/* HAS_GETMNT:
+ * This symbol, if defined, indicates that the getmnt routine is
+ * available to get filesystem mount info by filename.
+ */
+/*#define HAS_GETMNT /**/
+
+/* HAS_GETMNTENT:
+ * This symbol, if defined, indicates that the getmntent routine is
+ * available to iterate through mounted file systems to get their info.
+ */
+/*#define HAS_GETMNTENT /**/
+
/* HAS_GETNETBYADDR:
* This symbol, if defined, indicates that the getnetbyaddr() routine is
* available to look up networks by their IP addresses.
*/
/*#define HAS_GETNETENT /**/
+/* HAS_GETNET_PROTOS:
+ * This symbol, if defined, indicates that <netdb.h> includes
+ * prototypes for getnetent(), getnetbyname(), and
+ * getnetbyaddr(). Otherwise, it is up to the program to guess
+ * them. See netdbtype.U for probing for various Netdb_xxx_t types.
+ */
+/*#define HAS_GETNET_PROTOS /**/
+
/* HAS_GETPROTOENT:
* This symbol, if defined, indicates that the getprotoent() routine is
* available to look up protocols in some data base or another.
#define HAS_GETPROTOBYNAME /**/
#define HAS_GETPROTOBYNUMBER /**/
+/* HAS_GETPROTO_PROTOS:
+ * This symbol, if defined, indicates that <netdb.h> includes
+ * prototypes for getprotoent(), getprotobyname(), and
+ * getprotobyaddr(). Otherwise, it is up to the program to guess
+ * them. See netdbtype.U for probing for various Netdb_xxx_t types.
+ */
+#define HAS_GETPROTO_PROTOS /**/
+
/* HAS_GETPWENT:
* This symbol, if defined, indicates that the getpwent routine is
* available for sequential access of the passwd database.
*/
/*#define HAS_GETSERVENT /**/
+/* HAS_GETSERV_PROTOS:
+ * This symbol, if defined, indicates that <netdb.h> includes
+ * prototypes for getservent(), getservbyname(), and
+ * getservbyaddr(). Otherwise, it is up to the program to guess
+ * them. See netdbtype.U for probing for various Netdb_xxx_t types.
+ */
+#define HAS_GETSERV_PROTOS /**/
+
+/* HAS_GETSPENT:
+ * This symbol, if defined, indicates that the getspent system call is
+ * available to retrieve SysV shadow password entries sequentially.
+ */
+/*#define HAS_GETSPENT /**/
+
+/* HAS_GETSPNAM:
+ * This symbol, if defined, indicates that the getspnam system call is
+ * available to retrieve SysV shadow password entries by name.
+ */
+/*#define HAS_GETSPNAM /**/
+
/* HAS_GETSERVBYNAME:
* This symbol, if defined, indicates that the getservbyname()
* routine is available to look up services by their name.
#define HAS_GETSERVBYNAME /**/
#define HAS_GETSERVBYPORT /**/
+/* HAS_GNULIBC:
+ * This symbol, if defined, indicates to the C program that
+ * the GNU C library is being used.
+ */
+/*#define HAS_GNULIBC /**/
+/* HAS_HASMNTOPT:
+ * This symbol, if defined, indicates that the hasmntopt routine is
+ * available to query the mount options of file systems.
+ */
+/*#define HAS_HASMNTOPT /**/
+
/* HAS_HTONL:
* This symbol, if defined, indicates that the htonl() routine (and
* friends htons() ntohl() ntohs()) are available to do network
#define HAS_NTOHL /**/
#define HAS_NTOHS /**/
+/* HAS_ISASCII:
+ * This manifest constant lets the C program know that isascii
+ * is available.
+ */
+#define HAS_ISASCII /**/
+
+/* HAS_LCHOWN:
+ * This symbol, if defined, indicates that the lchown routine is
+ * available to operate on a symbolic link (instead of following the
+ * link).
+ */
+/*#define HAS_LCHOWN /**/
+
+/* HAS_LDBL_DIG:
+ * This symbol, if defined, indicates that this system's <float.h>
+ * or <limits.h> defines the symbol LDBL_DIG, which is the number
+ * of significant digits in a long double precision number. Unlike
+ * for DBL_DIG, there's no good guess for LDBL_DIG if it is undefined.
+ */
+#define HAS_LDBL_DIG /**/
+
/* HAS_LONG_DOUBLE:
* This symbol will be defined if the C compiler supports long
* doubles.
* C preprocessor can make decisions based on it. It is only
* defined if the system supports long long.
*/
-/*#define HAS_LONG_LONG /**/
-#ifdef HAS_LONG_LONG
-#define LONGLONGSIZE 8 /**/
-#endif
-
-/* HAS_MEMCHR:
- * This symbol, if defined, indicates that the memchr routine is available
- * to locate characters within a C string.
+/*#define HAS_LONG_LONG /**/
+#ifdef HAS_LONG_LONG
+#define LONGLONGSIZE 8 /**/
+#endif
+
+/* HAS_MEMCHR:
+ * This symbol, if defined, indicates that the memchr routine is available
+ * to locate characters within a C string.
+ */
+#define HAS_MEMCHR /**/
+
+/* HAS_MSG:
+ * This symbol, if defined, indicates that the entire msg*(2) library is
+ * supported (IPC mechanism based on message queues).
+ */
+/*#define HAS_MSG /**/
+
+/* HAS_OPEN3:
+ * This manifest constant lets the C program know that the three
+ * argument form of open(2) is available.
+ */
+/*#define HAS_OPEN3 /**/
+
+/* OLD_PTHREAD_CREATE_JOINABLE:
+ * This symbol, if defined, indicates how to create pthread
+ * in joinable (aka undetached) state. NOTE: not defined
+ * if pthread.h already has defined PTHREAD_CREATE_JOINABLE
+ * (the new version of the constant).
+ * If defined, known values are PTHREAD_CREATE_UNDETACHED
+ * and __UNDETACHED.
+ */
+/*#define OLD_PTHREAD_CREATE_JOINABLE /**/
+
+/* HAS_PTHREAD_YIELD:
+ * This symbol, if defined, indicates that the pthread_yield
+ * routine is available to yield the execution of the current
+ * thread. sched_yield is preferable to pthread_yield.
+ */
+/* SCHED_YIELD:
+ * This symbol defines the way to yield the execution of
+ * the current thread. Known ways are sched_yield,
+ * pthread_yield, and pthread_yield with NULL.
+ */
+/* HAS_SCHED_YIELD:
+ * This symbol, if defined, indicates that the sched_yield
+ * routine is available to yield the execution of the current
+ * thread. sched_yield is preferable to pthread_yield.
*/
-/*#define HAS_MEMCHR /**/
+/*#define HAS_PTHREAD_YIELD /**/
+#define SCHED_YIELD /**/
+/*#define HAS_SCHED_YIELD /**/
-/* HAS_MMAP:
- * This symbol, if defined, indicates that the mmap system call is
- * available to map a file into memory.
+/* HAS_SAFE_BCOPY:
+ * This symbol, if defined, indicates that the bcopy routine is available
+ * to copy potentially overlapping memory blocks. Otherwise you should
+ * probably use memmove() or memcpy(). If neither is defined, roll your
+ * own version.
*/
-/* Mmap_t:
- * This symbol holds the return type of the mmap() system call
- * (and simultaneously the type of the first argument).
- * Usually set to 'void *' or 'cadd_t'.
+/*#define HAS_SAFE_BCOPY /**/
+
+/* HAS_SAFE_MEMCPY:
+ * This symbol, if defined, indicates that the memcpy routine is available
+ * to copy potentially overlapping memory blocks. Otherwise you should
+ * probably use memmove() or memcpy(). If neither is defined, roll your
+ * own version.
*/
-/*#define HAS_MMAP /**/
-#define Mmap_t void * /**/
+/*#define HAS_SAFE_MEMCPY /**/
-/* HAS_MSG:
- * This symbol, if defined, indicates that the entire msg*(2) library is
- * supported (IPC mechanism based on message queues).
+/* HAS_SANE_MEMCMP:
+ * This symbol, if defined, indicates that the memcmp routine is available
+ * and can be used to compare relative magnitudes of chars with their high
+ * bits set. If it is not defined, roll your own version.
*/
-/*#define HAS_MSG /**/
+#define HAS_SANE_MEMCMP /**/
/* HAS_SEM:
* This symbol, if defined, indicates that the entire sem*(2) library is
*/
/*#define HAS_SETSERVENT /**/
+/* HAS_SETSPENT:
+ * This symbol, if defined, indicates that the setspent system call is
+ * available to initialize the scan of SysV shadow password entries.
+ */
+/*#define HAS_SETSPENT /**/
+
/* HAS_SETVBUF:
* This symbol, if defined, indicates that the setvbuf routine is
* available to change buffering on an open stdio stream.
*/
#define HAS_SETVBUF /**/
+/* USE_SFIO:
+ * This symbol, if defined, indicates that sfio should
+ * be used.
+ */
+/*#define USE_SFIO /**/
+
/* HAS_SHM:
* This symbol, if defined, indicates that the entire shm*(2) library is
* supported.
*/
/*#define HAS_SHM /**/
+/* HAS_SIGACTION:
+ * This symbol, if defined, indicates that Vr4's sigaction() routine
+ * is available.
+ */
+/*#define HAS_SIGACTION /**/
+
+/* HAS_SIGSETJMP:
+ * This variable indicates to the C program that the sigsetjmp()
+ * routine is available to save the calling process's registers
+ * and stack environment for later use by siglongjmp(), and
+ * to optionally save the process's signal mask. See
+ * Sigjmp_buf, Sigsetjmp, and Siglongjmp.
+ */
+/* Sigjmp_buf:
+ * This is the buffer type to be used with Sigsetjmp and Siglongjmp.
+ */
+/* Sigsetjmp:
+ * This macro is used in the same way as sigsetjmp(), but will invoke
+ * traditional setjmp() if sigsetjmp isn't available.
+ * See HAS_SIGSETJMP.
+ */
+/* Siglongjmp:
+ * This macro is used in the same way as siglongjmp(), but will invoke
+ * traditional longjmp() if siglongjmp isn't available.
+ * See HAS_SIGSETJMP.
+ */
+/*#define HAS_SIGSETJMP /**/
+#ifdef HAS_SIGSETJMP
+#define Sigjmp_buf sigjmp_buf
+#define Sigsetjmp(buf,save_mask) sigsetjmp((buf),(save_mask))
+#define Siglongjmp(buf,retval) siglongjmp((buf),(retval))
+#else
+#define Sigjmp_buf jmp_buf
+#define Sigsetjmp(buf,save_mask) setjmp((buf))
+#define Siglongjmp(buf,retval) longjmp((buf),(retval))
+#endif
+
/* HAS_SOCKET:
* This symbol, if defined, indicates that the BSD socket interface is
* supported.
* Checking just with #ifdef might not be enough because this symbol
* has been known to be an enum.
*/
-/* HAS_SENDMSG:
- * This symbol, if defined, indicates that the sendmsg is supported
- * to send messages between sockets. You will also need struct
- * iovec from <sys/uio.h>, HAS_STRUCT_IOVEC and I_SYSUIO.
- */
-/* HAS_RECVMSG:
- * This symbol, if defined, indicates that the recvmsg is supported
- * to send messages between sockets. You will also need struct
- * iovec from <sys/uio.h>, HAS_STRUCT_IOVEC and I_SYSUIO.
- */
-/* HAS_STRUCT_MSGHDR:
- * This symbol, if defined, indicates that the struct msghdr
- * (BSD 4.3 or 4.4) is supported. You will also need struct
- * iovec from <sys/uio.h>, HAS_STRUCT_IOVEC and I_SYSUIO.
- */
-/* HAS_STRUCT_CMSGHDR:
- * This symbol, if defined, indicates that the struct cmsghdr
- * (BSD 4.4) is supported. You will also need struct
- * iovec from <sys/uio.h>, HAS_STRUCT_IOVEC and I_SYSUIO.
- */
#define HAS_SOCKET /**/
/*#define HAS_SOCKETPAIR /**/
/*#define HAS_MSG_CTRUNC /**/
/*#define HAS_MSG_PEEK /**/
/*#define HAS_MSG_PROXY /**/
/*#define HAS_SCM_RIGHTS /**/
-/*#define HAS_SENDMSG /**/
-/*#define HAS_RECVMSG /**/
-/*#define HAS_STRUCT_MSGHDR /**/
-/*#define HAS_STRUCT_CMSGHDR /**/
+
+/* HAS_SQRTL:
+ * This symbol, if defined, indicates that the sqrtl routine is
+ * available to do long double square roots.
+ */
+/*#define HAS_SQRTL /**/
/* USE_STAT_BLOCKS:
* This symbol is defined if this system has a stat structure declaring
* st_blksize and st_blocks.
*/
+#ifndef USE_STAT_BLOCKS
/*#define USE_STAT_BLOCKS /**/
+#endif
+
+/* HAS_STRUCT_STATFS_F_FLAGS:
+ * This symbol, if defined, indicates that the struct statfs
+ * does have the f_flags member containing the mount flags of
+ * the filesystem containing the file.
+ * This kind of struct statfs is coming from <sys/mount.h> (BSD 4.3),
+ * not from <sys/statfs.h> (SYSV). Older BSDs (like Ultrix) do not
+ * have statfs() and struct statfs, they have ustat() and getmnt()
+ * with struct ustat and struct fs_data.
+ */
+/*#define HAS_STRUCT_STATFS_F_FLAGS /**/
+
+/* HAS_STRUCT_STATFS:
+ * This symbol, if defined, indicates that the struct statfs
+ * to do statfs() is supported.
+ */
+/*#define HAS_STRUCT_STATFS /**/
+
+/* HAS_FSTATVFS:
+ * This symbol, if defined, indicates that the fstatvfs routine is
+ * available to stat filesystems by file descriptors.
+ */
+/*#define HAS_FSTATVFS /**/
+
+/* USE_STDIO_PTR:
+ * This symbol is defined if the _ptr and _cnt fields (or similar)
+ * of the stdio FILE structure can be used to access the stdio buffer
+ * for a file handle. If this is defined, then the FILE_ptr(fp)
+ * and FILE_cnt(fp) macros will also be defined and should be used
+ * to access these fields.
+ */
+/* FILE_ptr:
+ * This macro is used to access the _ptr field (or equivalent) of the
+ * FILE structure pointed to by its argument. This macro will always be
+ * defined if USE_STDIO_PTR is defined.
+ */
+/* STDIO_PTR_LVALUE:
+ * This symbol is defined if the FILE_ptr macro can be used as an
+ * lvalue.
+ */
+/* FILE_cnt:
+ * This macro is used to access the _cnt field (or equivalent) of the
+ * FILE structure pointed to by its argument. This macro will always be
+ * defined if USE_STDIO_PTR is defined.
+ */
+/* STDIO_CNT_LVALUE:
+ * This symbol is defined if the FILE_cnt macro can be used as an
+ * lvalue.
+ */
+#define USE_STDIO_PTR /**/
+#ifdef USE_STDIO_PTR
+#define FILE_ptr(fp) ((fp)->_ptr)
+#define STDIO_PTR_LVALUE /**/
+#define FILE_cnt(fp) ((fp)->_cnt)
+#define STDIO_CNT_LVALUE /**/
+#endif
+
+/* USE_STDIO_BASE:
+ * This symbol is defined if the _base field (or similar) of the
+ * stdio FILE structure can be used to access the stdio buffer for
+ * a file handle. If this is defined, then the FILE_base(fp) macro
+ * will also be defined and should be used to access this field.
+ * Also, the FILE_bufsiz(fp) macro will be defined and should be used
+ * to determine the number of bytes in the buffer. USE_STDIO_BASE
+ * will never be defined unless USE_STDIO_PTR is.
+ */
+/* FILE_base:
+ * This macro is used to access the _base field (or equivalent) of the
+ * FILE structure pointed to by its argument. This macro will always be
+ * defined if USE_STDIO_BASE is defined.
+ */
+/* FILE_bufsiz:
+ * This macro is used to determine the number of bytes in the I/O
+ * buffer pointed to by _base field (or equivalent) of the FILE
+ * structure pointed to its argument. This macro will always be defined
+ * if USE_STDIO_BASE is defined.
+ */
+#define USE_STDIO_BASE /**/
+#ifdef USE_STDIO_BASE
+#define FILE_base(fp) ((fp)->_base)
+#define FILE_bufsiz(fp) ((fp)->_cnt + (fp)->_ptr - (fp)->_base)
+#endif
/* HAS_STRERROR:
* This symbol, if defined, indicates that the strerror routine is
#define HAS_SYS_ERRLIST /**/
#define Strerror(e) strerror(e)
+/* HAS_STRTOLD:
+ * This symbol, if defined, indicates that the strtold routine is
+ * available to convert strings to long doubles.
+ */
+/*#define HAS_STRTOLD /**/
+
+/* HAS_STRTOLL:
+ * This symbol, if defined, indicates that the strtoll routine is
+ * available to convert strings to long longs.
+ */
+/*#define HAS_STRTOLL /**/
+
+/* HAS_STRTOULL:
+ * This symbol, if defined, indicates that the strtoull routine is
+ * available to convert strings to unsigned long longs.
+ */
+/*#define HAS_STRTOULL /**/
+
+/* HAS_STRTOUQ:
+ * This symbol, if defined, indicates that the strtouq routine is
+ * available to convert strings to unsigned long longs (quads).
+ */
+/*#define HAS_STRTOUQ /**/
+
+/* HAS_TELLDIR_PROTO:
+ * This symbol, if defined, indicates that the system provides
+ * a prototype for the telldir() function. Otherwise, it is up
+ * to the program to supply one. A good guess is
+ * extern long telldir _((DIR*));
+ */
+#define HAS_TELLDIR_PROTO /**/
+
+/* Time_t:
+ * This symbol holds the type returned by time(). It can be long,
+ * or time_t on BSD sites (in which case <sys/types.h> should be
+ * included).
+ */
+#define Time_t time_t /* Time type */
+
+/* HAS_TIMES:
+ * This symbol, if defined, indicates that the times() routine exists.
+ * Note that this became obsolete on some systems (SUNOS), which now
+ * use getrusage(). It may be necessary to include <sys/times.h>.
+ */
+#define HAS_TIMES /**/
+
/* HAS_UNION_SEMUN:
* This symbol, if defined, indicates that the union semun is
* defined by including <sys/sem.h>. If not, the user code
/*#define USE_SEMCTL_SEMUN /**/
/*#define USE_SEMCTL_SEMID_DS /**/
+/* HAS_USTAT:
+ * This symbol, if defined, indicates that the ustat system call is
+ * available to query file system statistics by dev_t.
+ */
+/*#define HAS_USTAT /**/
+
/* HAS_VFORK:
* This symbol, if defined, indicates that vfork() exists.
*/
* a signal handler using "Signal_t (*handler)()", and define the
* handler using "Signal_t handler(sig)".
*/
-#define Signal_t void /* Signal handler's return type */
+#define Signal_t void /* Signal handler's return type */
+
+/* HAS_VPRINTF:
+ * This symbol, if defined, indicates that the vprintf routine is available
+ * to printf with a pointer to an argument list. If unavailable, you
+ * may need to write your own, probably in terms of _doprnt().
+ */
+/* USE_CHAR_VSPRINTF:
+ * This symbol is defined if this system has vsprintf() returning type
+ * (char*). The trend seems to be to declare it as "int vsprintf()". It
+ * is up to the package author to declare vsprintf correctly based on the
+ * symbol.
+ */
+#define HAS_VPRINTF /**/
+/*#define USE_CHAR_VSPRINTF /**/
+
+/* USE_DYNAMIC_LOADING:
+ * This symbol, if defined, indicates that dynamic loading of
+ * some sort is available.
+ */
+#define USE_DYNAMIC_LOADING /**/
+
+/* DOUBLESIZE:
+ * This symbol contains the size of a double, so that the C preprocessor
+ * can make decisions based on it.
+ */
+#define DOUBLESIZE 8 /**/
+
+/* EBCDIC:
+ * This symbol, if defined, indicates that this system uses
+ * EBCDIC encoding.
+ */
+/*#define EBCDIC /**/
+
+/* FFLUSH_NULL:
+ * This symbol, if defined, tells that fflush(NULL) does flush
+ * all pending stdio output.
+ */
+/* FFLUSH_ALL:
+ * This symbol, if defined, tells that to flush
+ * all pending stdio output one must loop through all
+ * the stdio file handles stored in an array and fflush them.
+ * Note that if fflushNULL is defined, fflushall will not
+ * even be probed for and will be left undefined.
+ */
+#define FFLUSH_NULL /**/
+/*#define FFLUSH_ALL /**/
+
+/* Fpos_t:
+ * This symbol holds the type used to declare file positions in libc.
+ * It can be fpos_t, long, uint, etc... It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
+ */
+#define Fpos_t fpos_t /* File position type */
+
+/* Gid_t_f:
+ * This symbol defines the format string used for printing a Gid_t.
+ */
+#define Gid_t_f "ld" /**/
+
+/* Gid_t_size:
+ * This symbol holds the size of a Gid_t in bytes.
+ */
+#define Gid_t_size 4 /* GID size */
+
+/* Gid_t:
+ * This symbol holds the return type of getgid() and the type of
+ * argument to setrgid() and related functions. Typically,
+ * it is the type of group ids in the kernel. It can be int, ushort,
+ * uid_t, etc... It may be necessary to include <sys/types.h> to get
+ * any typedef'ed information.
+ */
+#define Gid_t gid_t /* Type for getgid(), etc... */
/* Groups_t:
* This symbol holds the type used for the second argument to
#define Groups_t gid_t /* Type for 2nd arg to [sg]etgroups() */
#endif
+/* DB_Prefix_t:
+ * This symbol contains the type of the prefix structure element
+ * in the <db.h> header file. In older versions of DB, it was
+ * int, while in newer ones it is u_int32_t.
+ */
+/* DB_Hash_t:
+ * This symbol contains the type of the prefix structure element
+ * in the <db.h> header file. In older versions of DB, it was
+ * int, while in newer ones it is size_t.
+ */
+#define DB_Hash_t int /**/
+#define DB_Prefix_t int /**/
+
/* I_GRP:
* This symbol, if defined, indicates to the C program that it should
* include <grp.h>.
/*#define I_GRP /**/
/*#define GRPASSWD /**/
+/* I_INTTYPES:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <inttypes.h>.
+ */
+/*#define I_INTTYPES /**/
+
+/* I_MACH_CTHREADS:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <mach/cthreads.h>.
+ */
+/*#define I_MACH_CTHREADS /**/
+
+/* I_MNTENT:
+ * This symbol, if defined, indicates that <mntent.h> exists and
+ * should be included.
+ */
+/*#define I_MNTENT /**/
+
/* I_NETDB:
* This symbol, if defined, indicates that <netdb.h> exists and
* should be included.
*/
/*#define I_NETDB /**/
+/* I_NETINET_TCP:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <netinet/tcp.h>.
+ */
+/*#define I_NETINET_TCP /**/
+
+/* I_POLL:
+ * This symbol, if defined, indicates that <poll.h> exists and
+ * should be included.
+ */
+/*#define I_POLL /**/
+
+/* I_PTHREAD:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <pthread.h>.
+ */
+/*#define I_PTHREAD /**/
+
/* I_PWD:
* This symbol, if defined, indicates to the C program that it should
* include <pwd.h>.
/*#define PWGECOS /**/
/*#define PWPASSWD /**/
+/* I_SHADOW:
+ * This symbol, if defined, indicates that <shadow.h> exists and
+ * should be included.
+ */
+/*#define I_SHADOW /**/
+
+/* I_SOCKS:
+ * This symbol, if defined, indicates that <socks.h> exists and
+ * should be included.
+ */
+/*#define I_SOCKS /**/
+
+/* I_SYS_MOUNT:
+ * This symbol, if defined, indicates that <sys/mount.h> exists and
+ * should be included.
+ */
+/*#define I_SYS_MOUNT /**/
+
+/* I_SYS_STATFS:
+ * This symbol, if defined, indicates that <sys/statfs.h> exists.
+ */
+/*#define I_SYS_STATFS /**/
+
+/* I_SYS_STATVFS:
+ * This symbol, if defined, indicates that <sys/statvfs.h> exists and
+ * should be included.
+ */
+/*#define I_SYS_STATVFS /**/
+
/* I_SYSUIO:
* This symbol, if defined, indicates that <sys/uio.h> exists and
* should be included.
*/
/*#define I_SYSUIO /**/
+/* I_SYS_VFS:
+ * This symbol, if defined, indicates that <sys/vfs.h> exists and
+ * should be included.
+ */
+/*#define I_SYS_VFS /**/
+
+/* I_TIME:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <time.h>.
+ */
+/* I_SYS_TIME:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <sys/time.h>.
+ */
+/* I_SYS_TIME_KERNEL:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <sys/time.h> with KERNEL defined.
+ */
+#define I_TIME /**/
+/*#define I_SYS_TIME /**/
+/*#define I_SYS_TIME_KERNEL /**/
+
+/* I_USTAT:
+ * This symbol, if defined, indicates that <ustat.h> exists and
+ * should be included.
+ */
+/*#define I_USTAT /**/
+
+/* PERL_INC_VERSION_LIST:
+ * This variable specifies the list of subdirectories in over
+ * which perl.c:incpush() and lib/lib.pm will automatically
+ * search when adding directories to @INC, in a format suitable
+ * for a C initialization string. See the inc_version_list entry
+ * in Porting/Glossary for more details.
+ */
+#define PERL_INC_VERSION_LIST /**/
+
+/* HAS_OFF64_T:
+ * This symbol will be defined if the C compiler supports off64_t.
+ */
+/* HAS_FPOS64_T:
+ * This symbol will be defined if the C compiler supports fpos64_t.
+ */
+/*#define HAS_OFF64_T /**/
+/*#define HAS_FPOS64_T /**/
+
+/* PERL_PRIfldbl:
+ * This symbol, if defined, contains the string used by stdio to
+ * format long doubles (format 'f') for output.
+ */
+/* PERL_PRIgldbl:
+ * This symbol, if defined, contains the string used by stdio to
+ * format long doubles (format 'g') for output.
+ */
+/*#define PERL_PRIfldbl "f" /**/
+/*#define PERL_PRIgldbl "g" /**/
+
+/* Off_t:
+ * This symbol holds the type used to declare offsets in the kernel.
+ * It can be int, long, off_t, etc... It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
+ */
+/* LSEEKSIZE:
+ * This symbol holds the number of bytes used by the Off_t.
+ */
+/* Off_t_size:
+ * This symbol holds the number of bytes used by the Off_t.
+ */
+#define Off_t off_t /* <offset> type */
+#define LSEEKSIZE 4 /* <offset> size */
+#define Off_t_size 4 /* <offset> size */
+
/* Free_t:
* This variable contains the return type of free(). It is usually
* void, but occasionally int.
*/
/*#define MYMALLOC /**/
-/* SIG_NAME:
- * This symbol contains a list of signal names in order of
- * signal number. This is intended
- * to be used as a static array initialization, like this:
- * char *sig_name[] = { SIG_NAME };
- * The signals in the list are separated with commas, and each signal
- * is surrounded by double quotes. There is no leading SIG in the signal
- * name, i.e. SIGQUIT is known as "QUIT".
- * Gaps in the signal numbers (up to NSIG) are filled in with NUMnn,
- * etc., where nn is the actual signal number (e.g. NUM37).
- * The signal number for sig_name[i] is stored in sig_num[i].
- * The last element is 0 to terminate the list with a NULL. This
- * corresponds to the 0 at the end of the sig_num list.
- */
-/* SIG_NUM:
- * This symbol contains a list of signal numbers, in the same order as the
- * SIG_NAME list. It is suitable for static array initialization, as in:
- * int sig_num[] = { SIG_NUM };
- * The signals in the list are separated with commas, and the indices
- * within that list and the SIG_NAME list match, so it's easy to compute
- * the signal name from a number or vice versa at the price of a small
- * dynamic linear lookup.
- * Duplicates are allowed, but are moved to the end of the list.
- * The signal number corresponding to sig_name[i] is sig_number[i].
- * if (i < NSIG) then sig_number[i] == i.
- * The last element is 0, corresponding to the 0 at the end of
- * the sig_name list.
+/* Mode_t:
+ * This symbol holds the type used to declare file modes
+ * for systems calls. It is usually mode_t, but may be
+ * int or unsigned short. It may be necessary to include <sys/types.h>
+ * to get any typedef'ed information.
*/
-#define SIG_NAME "ZERO", "NUM01", "INT", "QUIT", "ILL", "NUM05", "NUM06", "NUM07", "FPE", "KILL", "NUM10", "SEGV", "NUM12", "PIPE", "ALRM", "TERM", "NUM16", "NUM17", "NUM18", "NUM19", "CHLD", "BREAK", "ABRT", "STOP", "NUM24", "CONT", "CLD", 0 /**/
-#define SIG_NUM 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 20, 0 /**/
+#define Mode_t mode_t /* file mode parameter for system calls */
-/* VOIDFLAGS:
- * This symbol indicates how much support of the void type is given by this
- * compiler. What various bits mean:
- *
- * 1 = supports declaration of void
- * 2 = supports arrays of pointers to functions returning void
- * 4 = supports comparisons between pointers to void functions and
- * addresses of void functions
- * 8 = suports declaration of generic void pointers
- *
- * The package designer should define VOIDUSED to indicate the requirements
- * of the package. This can be done either by #defining VOIDUSED before
- * including config.h, or by defining defvoidused in Myinit.U. If the
- * latter approach is taken, only those flags will be tested. If the
- * level of void support necessary is not present, defines void to int.
+/* VAL_O_NONBLOCK:
+ * This symbol is to be used during open() or fcntl(F_SETFL) to turn on
+ * non-blocking I/O for the file descriptor. Note that there is no way
+ * back, i.e. you cannot turn it blocking again this way. If you wish to
+ * alternatively switch between blocking and non-blocking, use the
+ * ioctl(FIOSNBIO) call instead, but that is not supported by all devices.
*/
-#ifndef VOIDUSED
-#define VOIDUSED 15
-#endif
-#define VOIDFLAGS 15
-#if (VOIDFLAGS & VOIDUSED) != VOIDUSED
-#define void int /* is void to be avoided? */
-#define M_VOID /* Xenix strikes again */
-#endif
-
-/* HAS_ATOLF:
- * This symbol, if defined, indicates that the atolf routine is
- * available to convert strings into long doubles.
+/* VAL_EAGAIN:
+ * This symbol holds the errno error code set by read() when no data was
+ * present on the non-blocking file descriptor.
*/
-/*#define HAS_ATOLF /**/
-
-/* HAS_ATOLL:
- * This symbol, if defined, indicates that the atoll routine is
- * available to convert strings into long longs.
+/* RD_NODATA:
+ * This symbol holds the return code from read() when no data is present
+ * on the non-blocking file descriptor. Be careful! If EOF_NONBLOCK is
+ * not defined, then you can't distinguish between no data and EOF by
+ * issuing a read(). You'll have to find another way to tell for sure!
*/
-/*#define HAS_ATOLL /**/
-
-/* PERL_BINCOMPAT_5005:
- * This symbol, if defined, indicates that Perl 5.006 should be
- * binary-compatible with Perl 5.005. This is impossible for builds
- * that use features like threads and multiplicity it is always undef
- * for those versions.
+/* EOF_NONBLOCK:
+ * This symbol, if defined, indicates to the C program that a read() on
+ * a non-blocking file descriptor will return 0 on EOF, and not the value
+ * held in RD_NODATA (-1 usually, in that case!).
*/
-/*#define PERL_BINCOMPAT_5005 /**/
+#define VAL_O_NONBLOCK O_NONBLOCK
+#define VAL_EAGAIN EAGAIN
+#define RD_NODATA -1
+#define EOF_NONBLOCK
-/* DLSYM_NEEDS_UNDERSCORE:
- * This symbol, if defined, indicates that we need to prepend an
- * underscore to the symbol name before calling dlsym(). This only
- * makes sense if you *have* dlsym, which we will presume is the
- * case if you're using dl_dlopen.xs.
+/* Netdb_host_t:
+ * This symbol holds the type used for the 1st argument
+ * to gethostbyaddr().
*/
-/*#define DLSYM_NEEDS_UNDERSCORE /**/
-
-/* HAS_ENDSPENT:
- * This symbol, if defined, indicates that the endspent system call is
- * available to finalize the scan of SysV shadow password entries.
+/* Netdb_hlen_t:
+ * This symbol holds the type used for the 2nd argument
+ * to gethostbyaddr().
+ */
+/* Netdb_name_t:
+ * This symbol holds the type used for the argument to
+ * gethostbyname().
+ */
+/* Netdb_net_t:
+ * This symbol holds the type used for the 1st argument to
+ * getnetbyaddr().
*/
-/*#define HAS_ENDSPENT /**/
+#define Netdb_host_t char * /**/
+#define Netdb_hlen_t int /**/
+#define Netdb_name_t char * /**/
+#define Netdb_net_t long /**/
-/* HAS_FSEEKO:
- * This symbol, if defined, indicates that the fseeko routine is
- * available to fseek beyond 32 bits (useful for ILP32 hosts).
+/* IVTYPE:
+ * This symbol defines the C type used for Perl's IV.
*/
-/*#define HAS_FSEEKO /**/
-
-/* HAS_FTELLO:
- * This symbol, if defined, indicates that the ftello routine is
- * available to ftell beyond 32 bits (useful for ILP32 hosts).
+/* UVTYPE:
+ * This symbol defines the C type used for Perl's UV.
*/
-/*#define HAS_FTELLO /**/
-
-/* HAS_GETMNTENT:
- * This symbol, if defined, indicates that the getmntent routine is
- * available to iterate through mounted file systems.
+/* I8TYPE:
+ * This symbol defines the C type used for Perl's I8.
*/
-/*#define HAS_GETMNTENT /**/
-
-/* HAS_GETSPENT:
- * This symbol, if defined, indicates that the getspent system call is
- * available to retrieve SysV shadow password entries sequentially.
+/* U8TYPE:
+ * This symbol defines the C type used for Perl's U8.
*/
-/*#define HAS_GETSPENT /**/
-
-/* HAS_GETSPNAM:
- * This symbol, if defined, indicates that the getspnam system call is
- * available to retrieve SysV shadow password entries by name.
+/* I16TYPE:
+ * This symbol defines the C type used for Perl's I16.
*/
-/*#define HAS_GETSPNAM /**/
-
-/* HAS_HASMNTOPT:
- * This symbol, if defined, indicates that the hasmntopt routine is
- * available to query the mount options of file systems.
+/* U16TYPE:
+ * This symbol defines the C type used for Perl's U16.
*/
-/*#define HAS_HASMNTOPT /**/
-
-/* HAS_LDBL_DIG:
- * This symbol, if defined, indicates that this system's <float.h>
- * or <limits.h> defines the symbol LDBL_DIG, which is the number
- * of significant digits in a long double precision number. Unlike
- * for DBL_DIG, there's no good guess for LDBL_DIG if it is undefined.
+/* I32TYPE:
+ * This symbol defines the C type used for Perl's I32.
*/
-#define HAS_LDBL_DIG /**/
-
-/* HAS_MADVISE:
- * This symbol, if defined, indicates that the madvise system call is
- * available to map a file into memory.
+/* U32TYPE:
+ * This symbol defines the C type used for Perl's U32.
*/
-/*#define HAS_MADVISE /**/
-
-/* HAS_MPROTECT:
- * This symbol, if defined, indicates that the mprotect system call is
- * available to modify the access protection of a memory mapped file.
+/* I64TYPE:
+ * This symbol defines the C type used for Perl's I64.
*/
-/*#define HAS_MPROTECT /**/
-
-/* HAS_READV:
- * This symbol, if defined, indicates that the readv routine is
- * available to do gather reads. You will also need <sys/uio.h>
- * and there I_SYSUIO.
+/* U64TYPE:
+ * This symbol defines the C type used for Perl's U64.
*/
-/*#define HAS_READV /**/
-
-/* HAS_SETSPENT:
- * This symbol, if defined, indicates that the setspent system call is
- * available to initialize the scan of SysV shadow password entries.
+/* NVTYPE:
+ * This symbol defines the C type used for Perl's NV.
*/
-/*#define HAS_SETSPENT /**/
-
-/* USE_SFIO:
- * This symbol, if defined, indicates that sfio should
- * be used.
+/* IVSIZE:
+ * This symbol contains the sizeof(IV).
*/
-/*#define USE_SFIO /**/
-
-/* HAS_FSTATFS:
- * This symbol, if defined, indicates that the fstatfs routine is
- * available to stat filesystems of file descriptors.
+/* UVSIZE:
+ * This symbol contains the sizeof(UV).
*/
-/* HAS_STRUCT_STATFS_FLAGS:
- * This symbol, if defined, indicates that the struct statfs
- * does have the f_flags member containing the mount flags of
- * the filesystem holding the file.
- * This kind of struct statfs is coming from sys/mount.h (BSD),
- * not from sys/statfs.h (SYSV).
+/* I8SIZE:
+ * This symbol contains the sizeof(I8).
*/
-/*#define HAS_FSTATFS /**/
-/*#define HAS_STRUCT_STATFS_FLAGS /**/
-
-/* HAS_FSTATVFS:
- * This symbol, if defined, indicates that the fstatvfs routine is
- * available to stat filesystems of file descriptors.
+/* U8SIZE:
+ * This symbol contains the sizeof(U8).
*/
-/*#define HAS_FSTATVFS /**/
-
-/* HAS_TELLDIR_PROTO:
- * This symbol, if defined, indicates that the system provides
- * a prototype for the telldir() function. Otherwise, it is up
- * to the program to supply one. A good guess is
- * extern long telldir _((DIR*));
+/* I16SIZE:
+ * This symbol contains the sizeof(I16).
*/
-#define HAS_TELLDIR_PROTO /**/
-
-/* HAS_WRITEV:
- * This symbol, if defined, indicates that the writev routine is
- * available to do scatter writes.
+/* U16SIZE:
+ * This symbol contains the sizeof(U16).
*/
-/*#define HAS_WRITEV /**/
-
-/* USE_DYNAMIC_LOADING:
- * This symbol, if defined, indicates that dynamic loading of
- * some sort is available.
+/* I32SIZE:
+ * This symbol contains the sizeof(I32).
*/
-#define USE_DYNAMIC_LOADING /**/
-
-/* FFLUSH_NULL:
- * This symbol, if defined, tells that fflush(NULL) does flush
- * all pending stdio output.
+/* U32SIZE:
+ * This symbol contains the sizeof(U32).
*/
-/* FFLUSH_ALL:
- * This symbol, if defined, tells that to flush
- * all pending stdio output one must loop through all
- * the stdio file handles stored in an array and fflush them.
- * Note that if fflushNULL is defined, fflushall will not
- * even be probed for and will be left undefined.
+/* I64SIZE:
+ * This symbol contains the sizeof(I64).
*/
-#define FFLUSH_NULL /**/
-/*#define FFLUSH_ALL /**/
+/* U64SIZE:
+ * This symbol contains the sizeof(U64).
+ */
+#define IVTYPE long /**/
+#define UVTYPE unsigned long /**/
+#define I8TYPE char /**/
+#define U8TYPE unsigned char /**/
+#define I16TYPE short /**/
+#define U16TYPE unsigned short /**/
+#define I32TYPE long /**/
+#define U32TYPE unsigned long /**/
+#ifdef HAS_QUAD
+#define I64TYPE __int64 /**/
+#define U64TYPE unsigned __int64 /**/
+#endif
+#define NVTYPE double /**/
+#define IVSIZE 4 /**/
+#define UVSIZE 4 /**/
+#define I8SIZE 1 /**/
+#define U8SIZE 1 /**/
+#define I16SIZE 2 /**/
+#define U16SIZE 2 /**/
+#define I32SIZE 4 /**/
+#define U32SIZE 4 /**/
+#ifdef HAS_QUAD
+#define I64SIZE 8 /**/
+#define U64SIZE 8 /**/
+#endif
-/* DB_Prefix_t:
- * This symbol contains the type of the prefix structure element
- * in the <db.h> header file. In older versions of DB, it was
- * int, while in newer ones it is u_int32_t.
+/* IVdf:
+ * This symbol defines the format string used for printing a Perl IV
+ * as a signed decimal integer.
*/
-/* DB_Hash_t:
- * This symbol contains the type of the prefix structure element
- * in the <db.h> header file. In older versions of DB, it was
- * int, while in newer ones it is size_t.
+/* UVuf:
+ * This symbol defines the format string used for printing a Perl UV
+ * as an unsigned decimal integer.
*/
-#define DB_Hash_t int /**/
-#define DB_Prefix_t int /**/
-
-/* I_INTTYPES:
- * This symbol, if defined, indicates to the C program that it should
- * include <inttypes.h>.
+/* UVof:
+ * This symbol defines the format string used for printing a Perl UV
+ * as an unsigned octal integer.
*/
-/* HAS_INT64_T:
- * This symbol will defined if the C compiler supports int64_t.
- * Usually the <inttypes.h> needs to be included, but sometimes
- * <sys/types.h> is enough.
+/* UVxf:
+ * This symbol defines the format string used for printing a Perl UV
+ * as an unsigned hexadecimal integer.
*/
-/*#define I_INTTYPES /**/
-/*#define HAS_INT64_T /**/
+#define IVdf "ld" /**/
+#define UVuf "lu" /**/
+#define UVof "lo" /**/
+#define UVxf "lx" /**/
-/* I_MNTENT:
- * This symbol, if defined, indicates that <mntent.h> exists and
- * should be included.
+/* Pid_t:
+ * This symbol holds the type used to declare process ids in the kernel.
+ * It can be int, uint, pid_t, etc... It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
*/
-/*#define I_MNTENT /**/
+#define Pid_t int /* PID type */
-/* I_NETINET_TCP:
- * This symbol, if defined, indicates to the C program that it should
- * include <netinet/tcp.h>.
+/* PRIVLIB:
+ * This symbol contains the name of the private library for this package.
+ * The library is private in the sense that it needn't be in anyone's
+ * execution path, but it should be accessible by the world. The program
+ * should be prepared to do ~ expansion.
*/
-/*#define I_NETINET_TCP /**/
-
-/* I_POLL:
- * This symbol, if defined, indicates that <poll.h> exists and
- * should be included.
+/* PRIVLIB_EXP:
+ * This symbol contains the ~name expanded version of PRIVLIB, to be used
+ * in programs that are not prepared to deal with ~ expansion at run-time.
*/
-/*#define I_POLL /**/
+#define PRIVLIB "c:\\perl\\5.5.640\\lib" /**/
+#define PRIVLIB_EXP (win32_get_privlib("5.5.640")) /**/
-/* I_SHADOW:
- * This symbol, if defined, indicates that <shadow.h> exists and
- * should be included.
+/* PTRSIZE:
+ * This symbol contains the size of a pointer, so that the C preprocessor
+ * can make decisions based on it. It will be sizeof(void *) if
+ * the compiler supports (void *); otherwise it will be
+ * sizeof(char *).
*/
-/*#define I_SHADOW /**/
+#define PTRSIZE 4 /**/
-/* I_SOCKS:
- * This symbol, if defined, indicates that <socks.h> exists and
- * should be included.
+/* Drand01:
+ * This macro is to be used to generate uniformly distributed
+ * random numbers over the range [0., 1.[. You may have to supply
+ * an 'extern double drand48();' in your program since SunOS 4.1.3
+ * doesn't provide you with anything relevant in it's headers.
+ * See HAS_DRAND48_PROTO.
*/
-/*#define I_SOCKS /**/
-
-/* I_SYS_MMAN:
- * This symbol, if defined, indicates that <sys/mman.h> exists and
- * should be included.
+/* Rand_seed_t:
+ * This symbol defines the type of the argument of the
+ * random seed function.
*/
-/*#define I_SYS_MMAN /**/
+/* seedDrand01:
+ * This symbol defines the macro to be used in seeding the
+ * random number generator (see Drand01).
+ */
+/* RANDBITS:
+ * This symbol indicates how many bits are produced by the
+ * function used to generate normalized random numbers.
+ * Values include 15, 16, 31, and 48.
+ */
+#define Drand01() (rand()/(double)((unsigned)1<<RANDBITS)) /**/
+#define Rand_seed_t unsigned /**/
+#define seedDrand01(x) srand((Rand_seed_t)x) /**/
+#define RANDBITS 15 /**/
-/* I_SYS_MOUNT:
- * This symbol, if defined, indicates that <sys/mount.h> exists and
- * should be included.
+/* SELECT_MIN_BITS:
+ * This symbol holds the minimum number of bits operated by select.
+ * That is, if you do select(n, ...), how many bits at least will be
+ * cleared in the masks if some activity is detected. Usually this
+ * is either n or 32*ceil(n/32), especially many little-endians do
+ * the latter. This is only useful if you have select(), naturally.
*/
-/*#define I_SYS_MOUNT /**/
+#define SELECT_MIN_BITS 32 /**/
-/* I_SYS_STATVFS:
- * This symbol, if defined, indicates that <sys/statvfs.h> exists and
- * should be included.
+/* Select_fd_set_t:
+ * This symbol holds the type used for the 2nd, 3rd, and 4th
+ * arguments to select. Usually, this is 'fd_set *', if HAS_FD_SET
+ * is defined, and 'int *' otherwise. This is only useful if you
+ * have select(), of course.
*/
-/*#define I_SYS_STATVFS /**/
+#define Select_fd_set_t Perl_fd_set * /**/
-/* HAS_OFF64_T:
- * This symbol will be defined if the C compiler supports off64_t.
+/* SIG_NAME:
+ * This symbol contains a list of signal names in order of
+ * signal number. This is intended
+ * to be used as a static array initialization, like this:
+ * char *sig_name[] = { SIG_NAME };
+ * The signals in the list are separated with commas, and each signal
+ * is surrounded by double quotes. There is no leading SIG in the signal
+ * name, i.e. SIGQUIT is known as "QUIT".
+ * Gaps in the signal numbers (up to NSIG) are filled in with NUMnn,
+ * etc., where nn is the actual signal number (e.g. NUM37).
+ * The signal number for sig_name[i] is stored in sig_num[i].
+ * The last element is 0 to terminate the list with a NULL. This
+ * corresponds to the 0 at the end of the sig_num list.
*/
-/* HAS_FPOS64_T:
- * This symbol will be defined if the C compiler supports fpos64_t.
+/* SIG_NUM:
+ * This symbol contains a list of signal numbers, in the same order as the
+ * SIG_NAME list. It is suitable for static array initialization, as in:
+ * int sig_num[] = { SIG_NUM };
+ * The signals in the list are separated with commas, and the indices
+ * within that list and the SIG_NAME list match, so it's easy to compute
+ * the signal name from a number or vice versa at the price of a small
+ * dynamic linear lookup.
+ * Duplicates are allowed, but are moved to the end of the list.
+ * The signal number corresponding to sig_name[i] is sig_number[i].
+ * if (i < NSIG) then sig_number[i] == i.
+ * The last element is 0, corresponding to the 0 at the end of
+ * the sig_name list.
*/
-/*#define HAS_OFF64_T /**/
-/*#define HAS_FPOS64_T /**/
+#define SIG_NAME "ZERO", "NUM01", "INT", "QUIT", "ILL", "NUM05", "NUM06", "NUM07", "FPE", "KILL", "NUM10", "SEGV", "NUM12", "PIPE", "ALRM", "TERM", "NUM16", "NUM17", "NUM18", "NUM19", "CHLD", "BREAK", "ABRT", "STOP", "NUM24", "CONT", "CLD", 0 /**/
+#define SIG_NUM 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 20, 0 /**/
-/* PERL_PRIfldbl:
- * This symbol, if defined, contains the string used by stdio to
- * format long doubles (format 'f') for output.
+/* SITEARCH:
+ * This symbol contains the name of the private library for this package.
+ * The library is private in the sense that it needn't be in anyone's
+ * execution path, but it should be accessible by the world. The program
+ * should be prepared to do ~ expansion.
+ * The standard distribution will put nothing in this directory.
+ * After perl has been installed, users may install their own local
+ * architecture-dependent modules in this directory with
+ * MakeMaker Makefile.PL
+ * or equivalent. See INSTALL for details.
*/
-/* PERL_PRIgldbl:
- * This symbol, if defined, contains the string used by stdio to
- * format long doubles (format 'g') for output.
+/* SITEARCH_EXP:
+ * This symbol contains the ~name expanded version of SITEARCH, to be used
+ * in programs that are not prepared to deal with ~ expansion at run-time.
*/
-/*#define PERL_PRIfldbl undef /**/
-/*#define PERL_PRIgldbl undef /**/
+#define SITEARCH "c:\\perl\\site\\5.5.640\\lib\\MSWin32-x86" /**/
+/*#define SITEARCH_EXP "" /**/
-/* PERL_PRId64:
- * This symbol, if defined, contains the string used by stdio to
- * format 64-bit decimal numbers (format 'd') for output.
- */
-/* PERL_PRIu64:
- * This symbol, if defined, contains the string used by stdio to
- * format 64-bit unsigned decimal numbers (format 'u') for output.
+/* SITELIB:
+ * This symbol contains the name of the private library for this package.
+ * The library is private in the sense that it needn't be in anyone's
+ * execution path, but it should be accessible by the world. The program
+ * should be prepared to do ~ expansion.
+ * The standard distribution will put nothing in this directory.
+ * After perl has been installed, users may install their own local
+ * architecture-independent modules in this directory with
+ * MakeMaker Makefile.PL
+ * or equivalent. See INSTALL for details.
*/
-/* PERL_PRIo64:
- * This symbol, if defined, contains the string used by stdio to
- * format 64-bit octal numbers (format 'o') for output.
+/* SITELIB_EXP:
+ * This symbol contains the ~name expanded version of SITELIB, to be used
+ * in programs that are not prepared to deal with ~ expansion at run-time.
*/
-/* PERL_PRIx64:
- * This symbol, if defined, contains the string used by stdio to
- * format 64-bit hexadecimal numbers (format 'x') for output.
+#define SITELIB "c:\\perl\\site\\5.5.640\\lib" /**/
+#define SITELIB_EXP (win32_get_sitelib("5.5.640")) /**/
+
+/* Size_t:
+ * This symbol holds the type used to declare length parameters
+ * for string functions. It is usually size_t, but may be
+ * unsigned long, int, etc. It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
*/
-/*#define PERL_PRId64 undef /**/
-/*#define PERL_PRIu64 undef /**/
-/*#define PERL_PRIo64 undef /**/
-/*#define PERL_PRIx64 undef /**/
+#define Size_t size_t /* length paramater for string functions */
-/* SELECT_MIN_BITS:
- * This symbol holds the minimum number of bits operated by select.
- * That is, if you do select(n, ...), how many bits at least will be
- * cleared in the masks if some activity is detected. Usually this
- * is either n or 32*ceil(n/32), especially many little-endians do
- * the latter. This is only useful if you have select(), naturally.
+/* SSize_t:
+ * This symbol holds the type used by functions that return
+ * a count of bytes or an error condition. It must be a signed type.
+ * It is usually ssize_t, but may be long or int, etc.
+ * It may be necessary to include <sys/types.h> or <unistd.h>
+ * to get any typedef'ed information.
+ * We will pick a type such that sizeof(SSize_t) == sizeof(Size_t).
*/
-#define SELECT_MIN_BITS 32 /**/
+#define SSize_t int /* signed count of bytes */
/* STARTPERL:
* This variable contains the string to put in front of a perl
* Usual values include _iob, __iob, and __sF.
*/
/*#define HAS_STDIO_STREAM_ARRAY /**/
-#define STDIO_STREAM_ARRAY undef
+#define STDIO_STREAM_ARRAY
-/* HAS_STRTOULL:
- * This symbol, if defined, indicates that the strtoull routine is
- * available to convert strings into unsigned long longs.
+/* Uid_t_f:
+ * This symbol defines the format string used for printing a Uid_t.
*/
-/*#define HAS_STRTOULL /**/
+#define Uid_t_f "ld" /**/
+
+/* Uid_t_size:
+ * This symbol holds the size of a Uid_t in bytes.
+ */
+#define Uid_t_size 4 /* UID size */
+
+/* Uid_t:
+ * This symbol holds the type used to declare user ids in the kernel.
+ * It can be int, ushort, uid_t, etc... It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
+ */
+#define Uid_t uid_t /* UID type */
/* USE_64_BITS:
- * This symbol, if defined, indicates that 64-bit interfaces should
- * be used when available. If not defined, the native default interfaces
+ * This symbol, if defined, indicates that 64-bit integers should
+ * be used when available. If not defined, the native integers
* will be used (be they 32 or 64 bits).
*/
+#ifndef USE_64_BITS
/*#define USE_64_BITS /**/
+#endif
+
+/* USE_LARGE_FILES:
+ * This symbol, if defined, indicates that large file support
+ * should be used when available. The USE_64_BITS symbol will
+ * also be turned on if necessary.
+ */
+#ifndef USE_LARGE_FILES
+/*#define USE_LARGE_FILES /**/
+#endif
/* USE_LONG_DOUBLE:
* This symbol, if defined, indicates that long doubles should
* be used when available.
*/
+#ifndef USE_LONG_DOUBLE
/*#define USE_LONG_DOUBLE /**/
+#endif
+
+/* USE_LONG_LONG:
+ * This symbol, if defined, indicates that long longs should
+ * be used when available.
+ */
+#ifndef USE_LONG_LONG
+/*#define USE_LONG_LONG /**/
+#endif
+
+#ifndef USE_MORE_BITS
+/*#define USE_MORE_BITS /**/
+#endif
/* MULTIPLICITY:
* This symbol, if defined, indicates that Perl should
* be built to use multiplicity.
*/
+#ifndef MULTIPLICTY
/*#define MULTIPLICITY /**/
+#endif
/* USE_PERLIO:
* This symbol, if defined, indicates that the PerlIO abstraction should
* be used throughout. If not defined, stdio should be
* used in a fully backward compatible manner.
*/
+#ifndef USE_PERLIO
/*#define USE_PERLIO /**/
+#endif
/* USE_SOCKS:
* This symbol, if defined, indicates that Perl should
* be built to use socks.
*/
+#ifndef USE_SOCKS
/*#define USE_SOCKS /**/
+#endif
-/* HAS_DRAND48_PROTO:
- * This symbol, if defined, indicates that the system provides
- * a prototype for the drand48() function. Otherwise, it is up
- * to the program to supply one. A good guess is
- * extern double drand48 _((void));
- */
-/*#define HAS_DRAND48_PROTO /**/
-
-/* HAS_GETHOST_PROTOS:
- * This symbol, if defined, indicates that <netdb.h> includes
- * prototypes for gethostent(), gethostbyname(), and
- * gethostbyaddr(). Otherwise, it is up to the program to guess
- * them. See netdbtype.U for probing for various Netdb_xxx_t types.
- */
-#define HAS_GETHOST_PROTOS /**/
-
-/* HAS_GETNET_PROTOS:
- * This symbol, if defined, indicates that <netdb.h> includes
- * prototypes for getnetent(), getnetbyname(), and
- * getnetbyaddr(). Otherwise, it is up to the program to guess
- * them. See netdbtype.U for probing for various Netdb_xxx_t types.
- */
-/*#define HAS_GETNET_PROTOS /**/
-
-/* HAS_GETPROTO_PROTOS:
- * This symbol, if defined, indicates that <netdb.h> includes
- * prototypes for getprotoent(), getprotobyname(), and
- * getprotobyaddr(). Otherwise, it is up to the program to guess
- * them. See netdbtype.U for probing for various Netdb_xxx_t types.
- */
-#define HAS_GETPROTO_PROTOS /**/
-
-/* HAS_GETSERV_PROTOS:
- * This symbol, if defined, indicates that <netdb.h> includes
- * prototypes for getservent(), getservbyname(), and
- * getservbyaddr(). Otherwise, it is up to the program to guess
- * them. See netdbtype.U for probing for various Netdb_xxx_t types.
- */
-#define HAS_GETSERV_PROTOS /**/
-
-/* Netdb_host_t:
- * This symbol holds the type used for the 1st argument
- * to gethostbyaddr().
- */
-/* Netdb_hlen_t:
- * This symbol holds the type used for the 2nd argument
- * to gethostbyaddr().
- */
-/* Netdb_name_t:
- * This symbol holds the type used for the argument to
- * gethostbyname().
- */
-/* Netdb_net_t:
- * This symbol holds the type used for the 1st argument to
- * getnetbyaddr().
- */
-#define Netdb_host_t char * /**/
-#define Netdb_hlen_t int /**/
-#define Netdb_name_t char * /**/
-#define Netdb_net_t long /**/
-
-/* Select_fd_set_t:
- * This symbol holds the type used for the 2nd, 3rd, and 4th
- * arguments to select. Usually, this is 'fd_set *', if HAS_FD_SET
- * is defined, and 'int *' otherwise. This is only useful if you
- * have select(), of course.
- */
-#define Select_fd_set_t Perl_fd_set * /**/
-
-/* ARCHNAME:
- * This symbol holds a string representing the architecture name.
- * It may be used to construct an architecture-dependant pathname
- * where library files may be held under a private library, for
- * instance.
- */
-#define ARCHNAME "MSWin32-x86" /**/
-
-/* OLD_PTHREAD_CREATE_JOINABLE:
- * This symbol, if defined, indicates how to create pthread
- * in joinable (aka undetached) state. NOTE: not defined
- * if pthread.h already has defined PTHREAD_CREATE_JOINABLE
- * (the new version of the constant).
- * If defined, known values are PTHREAD_CREATE_UNDETACHED
- * and __UNDETACHED.
- */
-/*#define OLD_PTHREAD_CREATE_JOINABLE /**/
-
-/* HAS_PTHREAD_YIELD:
- * This symbol, if defined, indicates that the pthread_yield
- * routine is available to yield the execution of the current
- * thread. sched_yield is preferable to pthread_yield.
- */
-/* SCHED_YIELD:
- * This symbol defines the way to yield the execution of
- * the current thread. Known ways are sched_yield,
- * pthread_yield, and pthread_yield with NULL.
- */
-/* HAS_SCHED_YIELD:
- * This symbol, if defined, indicates that the sched_yield
- * routine is available to yield the execution of the current
- * thread. sched_yield is preferable to pthread_yield.
- */
-/*#define HAS_PTHREAD_YIELD /**/
-#define SCHED_YIELD /**/
-/*#define HAS_SCHED_YIELD /**/
-
-/* I_MACH_CTHREADS:
- * This symbol, if defined, indicates to the C program that it should
- * include <mach/cthreads.h>.
+/* USE_ITHREADS:
+ * This symbol, if defined, indicates that Perl should be built to
+ * use the interpreter-based threading implementation.
*/
-/*#define I_MACH_CTHREADS /**/
-
-/* USE_THREADS:
- * This symbol, if defined, indicates that Perl should
- * be built to use threads.
+/* USE_5005THREADS:
+ * This symbol, if defined, indicates that Perl should be built to
+ * use the 5.005-based threading implementation.
*/
/* OLD_PTHREADS_API:
* This symbol, if defined, indicates that Perl should
* be built to use the old draft POSIX threads API.
*/
-/*#define USE_THREADS /**/
+/*#define USE_5005THREADS /**/
+/*#define USE_ITHREADS /**/
+#if defined(USE_5005THREADS) && !defined(USE_ITHREADS)
+#define USE_THREADS /* until src is revised*/
+#endif
/*#define OLD_PTHREADS_API /**/
-/* Time_t:
- * This symbol holds the type returned by time(). It can be long,
- * or time_t on BSD sites (in which case <sys/types.h> should be
- * included).
- */
-#define Time_t time_t /* Time type */
-
-/* HAS_TIMES:
- * This symbol, if defined, indicates that the times() routine exists.
- * Note that this became obsolete on some systems (SUNOS), which now
- * use getrusage(). It may be necessary to include <sys/times.h>.
- */
-#define HAS_TIMES /**/
-
-/* Fpos_t:
- * This symbol holds the type used to declare file positions in libc.
- * It can be fpos_t, long, uint, etc... It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
- */
-#define Fpos_t fpos_t /* File position type */
-
-/* Gid_t:
- * This symbol holds the return type of getgid() and the type of
- * argument to setrgid() and related functions. Typically,
- * it is the type of group ids in the kernel. It can be int, ushort,
- * uid_t, etc... It may be necessary to include <sys/types.h> to get
- * any typedef'ed information.
- */
-#define Gid_t gid_t /* Type for getgid(), etc... */
-
-/* Off_t:
- * This symbol holds the type used to declare offsets in the kernel.
- * It can be int, long, off_t, etc... It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
- */
-/* LSEEKSIZE:
- * This symbol holds the number of bytes used by the Off_t.
- */
-#define Off_t off_t /* <offset> type */
-#define LSEEKSIZE 4 /* <offset> size */
-
-/* Mode_t:
- * This symbol holds the type used to declare file modes
- * for systems calls. It is usually mode_t, but may be
- * int or unsigned short. It may be necessary to include <sys/types.h>
- * to get any typedef'ed information.
- */
-#define Mode_t mode_t /* file mode parameter for system calls */
-
-/* Pid_t:
- * This symbol holds the type used to declare process ids in the kernel.
- * It can be int, uint, pid_t, etc... It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
- */
-#define Pid_t int /* PID type */
-
-/* Size_t:
- * This symbol holds the type used to declare length parameters
- * for string functions. It is usually size_t, but may be
- * unsigned long, int, etc. It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
+/* PERL_VENDORLIB_EXP:
+ * This symbol contains the ~name expanded version of VENDORLIB, to be used
+ * in programs that are not prepared to deal with ~ expansion at run-time.
*/
-#define Size_t size_t /* length paramater for string functions */
+/*#define PERL_VENDORLIB_EXP "" /**/
-/* Uid_t:
- * This symbol holds the type used to declare user ids in the kernel.
- * It can be int, ushort, uid_t, etc... It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
+/* VOIDFLAGS:
+ * This symbol indicates how much support of the void type is given by this
+ * compiler. What various bits mean:
+ *
+ * 1 = supports declaration of void
+ * 2 = supports arrays of pointers to functions returning void
+ * 4 = supports comparisons between pointers to void functions and
+ * addresses of void functions
+ * 8 = suports declaration of generic void pointers
+ *
+ * The package designer should define VOIDUSED to indicate the requirements
+ * of the package. This can be done either by #defining VOIDUSED before
+ * including config.h, or by defining defvoidused in Myinit.U. If the
+ * latter approach is taken, only those flags will be tested. If the
+ * level of void support necessary is not present, defines void to int.
*/
-#define Uid_t uid_t /* UID type */
+#ifndef VOIDUSED
+#define VOIDUSED 15
+#endif
+#define VOIDFLAGS 15
+#if (VOIDFLAGS & VOIDUSED) != VOIDUSED
+#define void int /* is void to be avoided? */
+#define M_VOID /* Xenix strikes again */
+#endif
#endif
}
my $patchlevel = $opt{INST_VER};
$patchlevel =~ s|^[\\/]||;
-$patchlevel =~ s|~VERSION~|$]|g;
-$patchlevel ||= $];
+$patchlevel =~ s|~VERSION~|$Config{version}|g;
+$patchlevel ||= $Config{version};
$patchlevel = qq["$patchlevel"];
open(SH,"<$name") || die "Cannot open $name:$!";
return join(' ', @p);
}
+# generate an array of option strings from command-line args
+# or an option file
+# -- added by BKS, 10-17-1999 to fix command-line overflow problems
+sub loadopts {
+ if ($ARGV[0] =~ /--cfgsh-option-file/) {
+ shift @ARGV;
+ my $optfile = shift @ARGV;
+ local (*F);
+ open OPTF, $optfile or die "Can't open $optfile: $!\n";
+ my @opts;
+ chomp(my $line = <OPTF>);
+ my @vars = split(/\t+~\t+/, $line);
+ for (@vars) {
+ push(@opts, $_) unless (/^\s*$/);
+ }
+ close OPTF;
+ return \@opts;
+ }
+ else {
+ return \@ARGV;
+ }
+}
+
my %opt;
-while (@ARGV && $ARGV[0] =~ /^([\w_]+)=(.*)$/)
- {
- $opt{$1}=$2;
- shift(@ARGV);
- }
-
-$opt{VERSION} = $];
-$opt{INST_VER} =~ s|~VERSION~|$]|g;
-if ($] =~ /\.(\d\d\d)?(\d\d)?$/) { # should always be true
- $opt{PERL_VERSION} = int($1 || 0);
- $opt{PERL_SUBVERSION} = $2 || '00';
+my $optref = loadopts();
+while (@{$optref} && $optref->[0] =~ /^([\w_]+)=(.*)$/) {
+ $opt{$1}=$2;
+ shift(@{$optref});
}
+my $pl_h = '../patchlevel.h';
+
+if (-e $pl_h) {
+ open PL, "<$pl_h" or die "Can't open $pl_h: $!";
+ while (<PL>) {
+ if (/^#\s*define\s+(PERL_\w+)\s+([\d.]+)/) {
+ $opt{$1} = $2;
+ }
+ }
+ close PL;
+}
+else {
+ die "Can't find $pl_h: $!";
+}
+$opt{VERSION} = "$opt{PERL_REVISION}.$opt{PERL_VERSION}.$opt{PERL_SUBVERSION}";
+$opt{INST_VER} =~ s|~VERSION~|$opt{VERSION}|g;
+
$opt{'cf_by'} = $ENV{USERNAME} unless $opt{'cf_by'};
$opt{'cf_email'} = $opt{'cf_by'} . '@' . (gethostbyname('localhost'))[0]
unless $opt{'cf_email'};
$opt{libpth} = mungepath($opt{libpth}) if exists $opt{libpth};
$opt{incpath} = mungepath($opt{incpath}) if exists $opt{incpath};
-while (<>)
- {
- s/~([\w_]+)~/$opt{$1}/g;
- if (/^([\w_]+)=(.*)$/) {
- my($k,$v) = ($1,$2);
- # this depends on cf_time being empty in the template (or we'll get a loop)
- if ($k eq 'cf_time') {
- $_ = "$k='" . localtime(time) . "'\n" if $v =~ /^\s*'\s*'/;
+while (<>) {
+ s/~([\w_]+)~/$opt{$1}/g;
+ if (/^([\w_]+)=(.*)$/) {
+ my($k,$v) = ($1,$2);
+ # this depends on cf_time being empty in the template (or we'll
+ # get a loop)
+ if ($k eq 'cf_time') {
+ $_ = "$k='" . localtime(time) . "'\n" if $v =~ /^\s*'\s*'/;
+ }
+ elsif (exists $opt{$k}) {
+ $_ = "$k='$opt{$k}'\n";
+ }
}
- elsif (exists $opt{$k}) {
- $_ = "$k='$opt{$k}'\n";
- }
- }
- print;
- }
+ print;
+}
PREINIT:
CODE:
{
- DLDEBUG(1,PerlIO_printf(PerlIO_stderr(),"dl_load_file(%s):\n", filename));
+ DLDEBUG(1,PerlIO_printf(Perl_debug_log,"dl_load_file(%s):\n", filename));
if (dl_static_linked(filename) == 0) {
RETVAL = PerlProc_DynaLoad(filename);
}
else
RETVAL = (void*) GetModuleHandle(NULL);
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr()," libref=%x\n", RETVAL));
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log," libref=%x\n", RETVAL));
ST(0) = sv_newmortal() ;
if (RETVAL == NULL)
SaveError(aTHXo_ "load_file:%s",
void * libhandle
char * symbolname
CODE:
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(),"dl_find_symbol(handle=%x, symbol=%s)\n",
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log,"dl_find_symbol(handle=%x, symbol=%s)\n",
libhandle, symbolname));
RETVAL = (void*) GetProcAddress((HINSTANCE) libhandle, symbolname);
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr()," symbolref = %x\n", RETVAL));
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log," symbolref = %x\n", RETVAL));
ST(0) = sv_newmortal() ;
if (RETVAL == NULL)
SaveError(aTHXo_ "find_symbol:%s",
void * symref
char * filename
CODE:
- DLDEBUG(2,PerlIO_printf(PerlIO_stderr(),"dl_install_xsub(name=%s, symref=%x)\n",
+ DLDEBUG(2,PerlIO_printf(Perl_debug_log,"dl_install_xsub(name=%s, symref=%x)\n",
perl_name, symref));
ST(0) = sv_2mortal(newRV((SV*)newXS(perl_name,
(void(*)(pTHXo_ CV *))symref,
--- /dev/null
+# genmk95.pl - uses miniperl to generate a makefile that command.com will
+# understand given one that cmd.exe will understand
+
+# Author: Benjamin K. Stuhl
+# Date: 10-16-1999
+
+# how it works:
+# dmake supports an alternative form for its recipes, called "group
+# recipes", in which all elements of a recipe are run with only one shell.
+# This program converts the standard dmake makefile.mk to one using group
+# recipes. This is done so that lines using && or || (which command.com
+# doesn't understand) may be split into two lines that will still be run
+# with one shell.
+
+my ($filein, $fileout) = @ARGV;
+
+open my $in, $filein or die "Error opening input file: $!\n";
+open my $out, "> $fileout" or die "Error opening output file: $!\n";
+
+print $out <<_EOH_;
+# *** Warning: this file is autogenerated from $filein by $0 ***
+# *** Do not edit this file - edit $filein instead ***
+
+_HOME_DIR := \$(PWD)
+
+_EOH_
+
+my $inrec = 0;
+
+while (<$in>)
+{
+ chomp;
+ if (/^[^#.\t][^#=]*?:(?:[^=]|$)/)
+ {
+ if (! $inrec)
+ {
+ print $out "$_\n";
+ while (/\\\s*$/)
+ {
+ chomp($_ = <$in>);
+ print $out "$_\n";
+ }
+ print $out "@[\n";
+ $inrec = 1;
+ next;
+ }
+ else {
+ if (!/^\t/) {
+ seek ($out, -4, 2); # no recipe, so back up and undo grouping
+ # should be -3, but MS has its CR/LF thing...
+ $inrec = 0;
+ }
+ print $out "$_\n";
+ next;
+ }
+ }
+ if ((/^\s*$/ || /^[^#.\t][^#=]*?:/) && $inrec)
+ {
+ print $out "]\n";
+ print $out "$_\n";
+ $inrec = 0;
+ next;
+ }
+ if (/^(.*?)(&&|\|\|)(.*)$/) # two commands separated by && or ||
+ {
+ my ($one, $sep, $two) = ($1, $2, $3);
+LINE_CONT:
+ if ($two =~ /\\\s*$/)
+ {
+ chomp ($two .= "\n" . scalar <$in>);
+ goto LINE_CONT;
+ }
+ s/^\s*// for ($one, $two);
+ print $out "\t$one\n\t$two\n" if ($sep eq "&&");
+ print $out "\t$one\n\tif errorlevel 1 $two\n" if ($sep eq "||");
+ print $out "\tcd \$(_HOME_DIR)\n";
+ next;
+ }
+ # fall through - no need for special handling
+ print $out "$_\n";
+}
+print $out "]\n" if ($inrec);
+
+close $in or warn "Error closing \$in: $!\n";
+close $out or warn "Error closing \$out: $!\n";
-// dirent.h
+/* dirent.h */
-// djl
-// Provide UNIX compatibility
+/* djl
+ * Provide UNIX compatibility
+ */
#ifndef _INC_DIRENT
#define _INC_DIRENT
-//
-// NT versions of readdir(), etc
-// From the MSDOS implementation
-//
+/*
+ * NT versions of readdir(), etc
+ * From the MSDOS implementation
+ */
-// Directory entry size
+/* Directory entry size */
#ifdef DIRSIZ
#undef DIRSIZ
#endif
#define DIRSIZ(rp) (sizeof(struct direct))
-// needed to compile directory stuff
+/* needed to compile directory stuff */
#define DIRENT direct
-// structure of a directory entry
+/* structure of a directory entry */
typedef struct direct
{
- long d_ino; // inode number (not used by MS-DOS)
- int d_namlen; // Name length
- char d_name[257]; // file name
+ long d_ino; /* inode number (not used by MS-DOS) */
+ long d_namlen; /* name length */
+ char d_name[257]; /* file name */
} _DIRECT;
-// structure for dir operations
+/* structure for dir operations */
typedef struct _dir_struc
{
- char *start; // Starting position
- char *curr; // Current position
- long size; // Size of string table
- long nfiles; // number if filenames in table
- struct direct dirstr; // Directory structure to return
+ char *start; /* starting position */
+ char *curr; /* current position */
+ long size; /* allocated size of string table */
+ long nfiles; /* number of filenames in table */
+ struct direct dirstr; /* directory structure to return */
+ void* handle; /* system handle */
+ char *end; /* position after last filename */
} DIR;
#if 0 /* these have moved to win32iop.h */
int win32_closedir(DIR *dirp);
#endif
-#endif //_INC_DIRENT
+#endif /* _INC_DIRENT */
#
# Makefile to build perl on Windows NT using DMAKE.
# Supported compilers:
-# Visual C++ 2.0 thro 5.0
+# Visual C++ 2.0 thro 6.0
# Borland C++ 5.02
-# Mingw32 with gcc-2.8.1 or egcs-1.0.2 **experimental**
+# Mingw32 with gcc-2.95.2 or better **experimental**
#
# This is set up to build a perl.exe that runs off a shared library
# (perl.dll). Also makes individual DLLs for the XS extensions.
##
#
-# Set these to wherever you want "nmake install" to put your
+# Set these to wherever you want "dmake install" to put your
# newly built perl.
#
INST_DRV *= c:
# versioned installation can be obtained by setting INST_TOP above to a
# path that includes an arbitrary version string.
#
-INST_VER *= \5.00561
+INST_VER *= \5.5.640
#
# Comment this out if you DON'T want your perl installation to have
#
# uncomment to enable threads-capabilities
#
-#USE_THREADS *= define
+#USE_5005THREADS *= define
#
# XXX WARNING! This option currently undergoing changes. May be broken.
#USE_OBJECT *= define
#
+# XXX WARNING! This option currently undergoing changes. May be broken.
+#
+# Beginnings of interpreter cloning/threads: still rather rough, fails
+# tests. This should be enabled to get the fork() emulation. Do not
+# enable unless you know what you're doing!
+#
+#USE_ITHREADS *= define
+
+#
+# uncomment to enable the implicit "host" layer for all system calls
+# made by perl. This is needed and auto-enabled by USE_OBJECT above.
+# This is also needed to get fork().
+#
+#USE_IMP_SYS *= define
+
+#
# uncomment exactly one of the following
#
# Visual C++ 2.x
#CCTYPE *= MSVC60
# Borland 5.02 or later
CCTYPE *= BORLAND
-# mingw32/egcs or mingw32/gcc
+# mingw32/gcc-2.95.2 or better
#CCTYPE *= GCC
#
+# uncomment this if you are compiling under Windows 95/98 and command.com
+# (not needed if you're running under 4DOS/NT 6.01 or later)
+#IS_WIN95 *= define
+
+#
# uncomment next line if you want debug version of perl (big,slow)
# If not enabled, we automatically try to use maximum optimization
# with all compilers that are known to have a working optimizer.
#
# uncomment to enable use of PerlCRT.DLL when using the Visual C compiler.
-# Highly recommended. It has patches that fix known bugs in MSVCRT.DLL.
+# It has patches that fix known bugs in older versions of MSVCRT.DLL.
# This currently requires VC 5.0 with Service Pack 3 or later.
# Get it from CPAN at http://www.perl.com/CPAN/authors/id/D/DO/DOUGL/
# and follow the directions in the package to install.
#
+# Not recommended if you have VC 6.x and you're not running Windows 9x.
+#
#USE_PERLCRT *= define
#
# so you may have to set CCHOME explicitly (spaces in the path name should
# not be quoted)
#
-CCHOME *= d:\bc5
+CCHOME *= c:\bc5
#CCHOME *= $(MSVCDIR)
#CCHOME *= D:\packages\mingw32
CCINCDIR *= $(CCHOME)\include
CCLIBDIR *= $(CCHOME)\lib
#
-# additional compiler flags can be specified here.
+# Additional compiler flags can be specified here.
+#
+
#
-# Adding -DPERL_POLLUTE enables support for old symbols, at the expense of
-# extreme pollution. You most probably want this if you're compiling modules
-# from CPAN, or other such serious uses of this experimental perl release.
-# We don't enable this by default because we want the modules to get fixed
-# instead of clinging to shortcuts like this one.
+# This should normally be disabled. Adding -DPERL_POLLUTE enables support
+# for old symbols by default, at the expense of extreme pollution. You most
+# probably just want to build modules that won't compile with
+# perl Makefile.PL POLLUTE=1
+# instead of enabling this. Please report such modules to the respective
+# authors.
#
#BUILDOPT += -DPERL_POLLUTE
#
+# This should normally be disabled. Enabling it will disable the File::Glob
+# implementation of CORE::glob.
+#
+#BUILDOPT += -DPERL_EXTERNAL_GLOB
+
+#
+# This should normally be disabled. Enabling it causes perl to read scripts
+# in text mode (which is the 5.005 behavior) and will break ByteLoader.
+#BUILDOPT += -DPERL_TEXTMODE_SCRIPTS
+
+#
+# This should normally be disabled. Enabling it runs a cloned toplevel
+# interpreter (*EXPERIMENTAL*, fails tests)
+#BUILDOPT += -DTOP_CLONE
+
+#
# specify semicolon-separated list of extra directories that modules will
# look for libraries (spaces in path names need not be quoted)
#
.IF "$(USE_OBJECT)" == "define"
PERL_MALLOC != undef
-USE_THREADS != undef
+USE_5005THREADS != undef
USE_MULTI != undef
+USE_IMP_SYS != define
.ENDIF
PERL_MALLOC *= undef
-USE_THREADS *= undef
+USE_5005THREADS *= undef
+
+.IF "$(USE_5005THREADS)" == "define"
+USE_ITHREADS != undef
+.ENDIF
+
USE_MULTI *= undef
USE_OBJECT *= undef
+USE_ITHREADS *= undef
+USE_IMP_SYS *= undef
+USE_PERLCRT *= undef
-.IF "$(USE_MULTI)$(USE_THREADS)$(USE_OBJECT)" != "undefundefundef"
+.IF "$(USE_MULTI)$(USE_5005THREADS)$(USE_OBJECT)" != "undefundefundef"
BUILDOPT += -DPERL_IMPLICIT_CONTEXT
.ENDIF
+.IF "$(USE_IMP_SYS)" != "undef"
+BUILDOPT += -DPERL_IMPLICIT_SYS
+.ENDIF
.IMPORT .IGNORE : PROCESSOR_ARCHITECTURE
.IF "$(USE_OBJECT)" == "define"
ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-object
-.ELIF "$(USE_THREADS)" == "define"
+.ELIF "$(USE_5005THREADS)" == "define"
ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-thread
.ELIF "$(USE_MULTI)" == "define"
ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-multi
ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)
.ENDIF
+.IF "$(USE_OBJECT)" == "define"
+ARCHNAME = $(ARCHNAME)-thread
+.ENDIF
+
# Visual Studio 98 specific
.IF "$(CCTYPE)" == "MSVC60"
LINK32 = tlink32
LIB32 = tlib /P128
IMPLIB = implib -c
+RSC = rc
#
# Options
LINK32 = gcc
LIB32 = ar rc
IMPLIB = dlltool
+RSC = rc
o = .o
a = .a
#
# Options
#
+
RUNTIME =
INCLUDES = -I$(COREDIR) -I.\include -I. -I..
DEFINES = -DWIN32 $(CRYPT_FLAG)
SUBSYS = console
CXX_FLAG = -xc++
-LIBC = -lcrtdll
-LIBFILES = $(CRYPT_LIB) -ladvapi32 -luser32 -lnetapi32 -lwsock32 \
- -lmingw32 -lgcc -lmoldname $(LIBC) -lkernel32
+LIBC = -lmsvcrt
+
+# same libs as MSVC
+LIBFILES = $(CRYPT_LIB) $(LIBC) \
+ -lmoldname -lkernel32 -luser32 -lgdi32 \
+ -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 \
+ -loleaut32 -lnetapi32 -luuid -lwsock32 -lmpr \
+ -lwinmm -lversion -lodbc32
.IF "$(CFG)" == "Debug"
-OPTIMIZE = -g -O2 $(RUNTIME) -DDEBUGGING
+OPTIMIZE = -g $(RUNTIME) -DDEBUGGING
LINK_DBG = -g
.ELSE
OPTIMIZE = -g -O2 $(RUNTIME)
CC = cl
LINK32 = link
LIB32 = $(LINK32) -lib
+RSC = rc
#
# Options
SUBSYS = console
CXX_FLAG = -TP -GX
-.IF "$(USE_PERLCRT)" == ""
+.IF "$(USE_PERLCRT)" != "define"
.IF "$(CFG)" == "Debug"
PERLCRTLIBC = msvcrtd.lib
.ELSE
.ENDIF
.ENDIF
+PERLEXE_RES =
+PERLDLL_RES =
+
.IF "$(RUNTIME)" == "-MD"
LIBC = $(PERLCRTLIBC)
.ELSE
.ENDIF
LIBBASEFILES = $(DELAYLOAD) $(CRYPT_LIB) \
- oldnames.lib kernel32.lib user32.lib gdi32.lib \
- winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib \
- oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib \
+ oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib \
+ comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \
+ netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib \
version.lib odbc32.lib odbccp32.lib
# we add LIBC here, since we may be using PerlCRT.dll
EXEOUT_FLAG = -Fe
LIBOUT_FLAG = /out:
+.IF "$(USE_PERLCRT)" != "define"
+BUILDOPT += -DPERL_MSVCRT_READFIX
+.ENDIF
+
.ENDIF
.IF "$(USE_OBJECT)" == "define"
CFLAGS_O = $(CFLAGS) $(BUILDOPT)
+# used to allow local linking flags that are not propogated into Config.pm,
+# currently unused
+# -- BKS, 12-12-1999
+PRIV_LINK_FLAGS *=
+BLINK_FLAGS = $(PRIV_LINK_FLAGS) $(LINK_FLAGS)
+
#################### do not edit below this line #######################
############# NO USER-SERVICEABLE PARTS BEYOND THIS POINT ##############
# Rules
#
-.SUFFIXES : .c $(o) .dll $(a) .exe
+.SUFFIXES : .c $(o) .dll $(a) .exe .rc .res
.c$(o):
$(CC) -c $(null,$(<:d) $(NULL) -I$(<:d)) $(CFLAGS_O) $(OBJOUT_FLAG)$@ $<
$(o).dll:
.IF "$(CCTYPE)" == "BORLAND"
- $(LINK32) -Tpd -ap $(LINK_FLAGS) c0d32$(o) $<,$@,,$(LIBFILES),$(*B).def
+ $(LINK32) -Tpd -ap $(BLINK_FLAGS) c0d32$(o) $<,$@,,$(LIBFILES),$(*B).def
$(IMPLIB) $(*B).lib $@
.ELIF "$(CCTYPE)" == "GCC"
- $(LINK32) -o $@ $(LINK_FLAGS) $< $(LIBFILES)
- $(IMPLIB) -def $(*B).def $(*B).a $@
+ $(LINK32) -o $@ $(BLINK_FLAGS) $< $(LIBFILES)
+ $(IMPLIB) --input-def $(*B).def --output-lib $(*B).a $@
.ELSE
$(LINK32) -dll -subsystem:windows -implib:$(*B).lib -def:$(*B).def \
- -out:$@ $(LINK_FLAGS) $(LIBFILES) $< $(LIBPERL)
+ -out:$@ $(BLINK_FLAGS) $(LIBFILES) $< $(LIBPERL)
.ENDIF
+.rc.res:
+ $(RSC) $<
+
#
# various targets
MINIPERL = ..\miniperl.exe
MINIDIR = .\mini
PERLEXE = ..\perl.exe
+WPERLEXE = ..\wperl.exe
GLOBEXE = ..\perlglob.exe
CONFIGPM = ..\lib\Config.pm
MINIMOD = ..\lib\ExtUtils\Miniperl.pm
..\utils\c2ph \
..\utils\h2xs \
..\utils\perldoc \
- ..\utils\pstruct \
..\utils\perlcc \
..\pod\checkpods \
..\pod\pod2html \
CFGSH_TMPL = config.vc
CFGH_TMPL = config_H.vc
-.IF "$(USE_PERLCRT)" == ""
+.IF "$(USE_PERLCRT)" != "define"
PERL95EXE = ..\perl95.exe
.ENDIF
.\win32.c \
.\win32sck.c
-.IF "$(USE_THREADS)" == "define"
+.IF "$(USE_5005THREADS)" == "define"
WIN32_SRC += .\win32thread.c
.ENDIF
.\include\dirent.h \
.\include\netdb.h \
.\include\sys\socket.h \
- .\win32.h
+ .\win32.h \
+ .\perlhost.h \
+ .\vdir.h \
+ .\vmem.h
CORE_H = $(CORE_NOCFG_H) .\config.h
.ENDIF
DYNAMIC_EXT = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B re \
- Data/Dumper Devel/Peek ByteLoader Devel/DProf
+ Data/Dumper Devel/Peek ByteLoader Devel/DProf File/Glob
STATIC_EXT = DynaLoader
NONXS_EXT = Errno
PEEK = $(EXTDIR)\Devel\Peek\Peek
BYTELOADER = $(EXTDIR)\ByteLoader\ByteLoader
DPROF = $(EXTDIR)\Devel\DProf\DProf
+GLOB = $(EXTDIR)\File\Glob\Glob
SOCKET_DLL = $(AUTODIR)\Socket\Socket.dll
FCNTL_DLL = $(AUTODIR)\Fcntl\Fcntl.dll
RE_DLL = $(AUTODIR)\re\re.dll
BYTELOADER_DLL = $(AUTODIR)\ByteLoader\ByteLoader.dll
DPROF_DLL = $(AUTODIR)\Devel\DProf\DProf.dll
+GLOB_DLL = $(AUTODIR)\File\Glob\Glob.dll
ERRNO_PM = $(LIBDIR)\Errno.pm
$(PEEK).c \
$(B).c \
$(BYTELOADER).c \
- $(DPROF).c
+ $(DPROF).c \
+ $(GLOB).c
EXTENSION_DLL = \
$(SOCKET_DLL) \
$(RE_DLL) \
$(THREAD_DLL) \
$(BYTELOADER_DLL) \
- $(DPROF_DLL)
+ $(DPROF_DLL) \
+ $(GLOB_DLL)
EXTENSION_PM = \
$(ERRNO_PM)
POD2LATEX = $(PODDIR)\pod2latex
POD2TEXT = $(PODDIR)\pod2text
+# vars must be separated by "\t+~\t+", since we're using the tempfile
+# version of config_sh.pl (we were overflowing someone's buffer by
+# trying to fit them all on the command line)
+# -- BKS 10-17-1999
CFG_VARS = \
- "INST_DRV=$(INST_DRV)" \
- "INST_TOP=$(INST_TOP)" \
- "INST_VER=$(INST_VER)" \
- "INST_ARCH=$(INST_ARCH)" \
- "archname=$(ARCHNAME)" \
- "cc=$(CC)" \
- "ccflags=$(OPTIMIZE:s/"/\"/) $(DEFINES) $(BUILDOPT)" \
- "cf_email=$(EMAIL)" \
- "d_crypt=$(D_CRYPT)" \
- "d_mymalloc=$(PERL_MALLOC)" \
- "libs=$(LIBFILES:f)" \
- "incpath=$(CCINCDIR:s/"/\"/)" \
- "libperl=$(PERLIMPLIB:f)" \
- "libpth=$(CCLIBDIR:s/"/\"/);$(EXTRALIBDIRS:s/"/\"/)" \
- "libc=$(LIBC)" \
- "make=dmake" \
- "_o=$(o)" "obj_ext=$(o)" \
- "_a=$(a)" "lib_ext=$(a)" \
- "static_ext=$(STATIC_EXT)" \
- "dynamic_ext=$(DYNAMIC_EXT)" \
- "nonxs_ext=$(NONXS_EXT)" \
- "usethreads=$(USE_THREADS)" \
- "usemultiplicity=$(USE_MULTI)" \
- "LINK_FLAGS=$(LINK_FLAGS:s/"/\"/)" \
- "optimize=$(OPTIMIZE:s/"/\"/)"
+ INST_DRV=$(INST_DRV) ~ \
+ INST_TOP=$(INST_TOP) ~ \
+ INST_VER=$(INST_VER:s/\/\\/) ~ \
+ INST_ARCH=$(INST_ARCH) ~ \
+ archname=$(ARCHNAME) ~ \
+ cc=$(CC) ~ \
+ ccflags=$(OPTIMIZE) $(DEFINES) $(BUILDOPT) ~ \
+ cf_email=$(EMAIL) ~ \
+ d_crypt=$(D_CRYPT) ~ \
+ d_mymalloc=$(PERL_MALLOC) ~ \
+ libs=$(LIBFILES:f) ~ \
+ incpath=$(CCINCDIR) ~ \
+ libperl=$(PERLIMPLIB:f) ~ \
+ libpth=$(CCLIBDIR);$(EXTRALIBDIRS) ~ \
+ libc=$(LIBC) ~ \
+ make=dmake ~ \
+ _o=$(o) obj_ext=$(o) ~ \
+ _a=$(a) lib_ext=$(a) ~ \
+ static_ext=$(STATIC_EXT) ~ \
+ dynamic_ext=$(DYNAMIC_EXT) ~ \
+ nonxs_ext=$(NONXS_EXT) ~ \
+ use5005threads=$(USE_5005THREADS) ~ \
+ useithreads=$(USE_ITHREADS) ~ \
+ usethreads=$(USE_5005THREADS) ~ \
+ usemultiplicity=$(USE_MULTI) ~ \
+ LINK_FLAGS=$(LINK_FLAGS:s/\/\\/) ~ \
+ optimize=$(OPTIMIZE)
+
+#
+# set up targets varying between Win95 and WinNT builds
+#
+
+.IF "$(IS_WIN95)" == "define"
+MK2 = .\makefile.95
+RIGHTMAKE = __switch_makefiles
+NOOP = @rem
+.ELSE
+MK2 = __not_needed
+RIGHTMAKE = __not_needed
+.ENDIF
#
# Top targets
#
-all : .\config.h $(GLOBEXE) $(MINIMOD) $(CONFIGPM) $(PERLEXE) $(PERL95EXE) \
+all : .\config.h $(GLOBEXE) $(MINIPERL) $(MK2) \
+ $(RIGHTMAKE) $(MINIMOD) $(CONFIGPM) $(PERLEXE) $(PERL95EXE) \
$(X2P) $(EXTENSION_DLL) $(EXTENSION_PM)
$(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c
-#------------------------------------------------------------
+#----------------------------------------------------------------
+
+#-------------------- BEGIN Win95 SPECIFIC ----------------------
+
+# this target is a jump-off point for Win95
+# 1. it switches to the Win95-specific makefile if it exists
+# (__do_switch_makefiles)
+# 2. it prints a message when the Win95-specific one finishes (__done)
+# 3. it then kills this makefile by trying to make __no_such_target
+
+__switch_makefiles: __do_switch_makefiles __done __no_such_target
+
+__do_switch_makefiles:
+.IF "$(NOTFIRST)" != "true"
+ if exist $(MK2) $(MAKE:s/-S//) -f $(MK2) $(MAKETARGETS) NOTFIRST=true
+.ELSE
+ $(NOOP)
+.ENDIF
+
+.IF "$(NOTFIRST)" != "true"
+__done:
+ @echo Build process complete. Ignore any errors after this message.
+ @echo Run "dmake test" to test and "dmake install" to install
+
+.ELSE
+# dummy targets for Win95-specific makefile
+
+__done:
+ $(NOOP)
+
+__no_such_target:
+ $(NOOP)
+
+.ENDIF
+
+# This target is used to generate the new makefile (.\makefile.95) for Win95
+
+.\makefile.95: .\makefile.mk
+ $(MINIPERL) genmk95.pl makefile.mk $(MK2)
+
+#--------------------- END Win95 SPECIFIC ---------------------
+
+# a blank target for when builds don't need to do certain things
+# this target added for Win95 port but used to keep the WinNT port able to
+# use this file
+__not_needed:
+ $(NOOP)
$(GLOBEXE) : perlglob$(o)
.IF "$(CCTYPE)" == "BORLAND"
$(CC) -c -w -v -tWM -I"$(CCINCDIR)" perlglob.c
- $(LINK32) -Tpe -ap $(LINK_FLAGS) c0x32$(o) perlglob$(o) \
+ $(LINK32) -Tpe -ap $(BLINK_FLAGS) c0x32$(o) perlglob$(o) \
"$(CCLIBDIR)\32BIT\wildargs$(o)",$@,,import32.lib cw32mt.lib,
.ELIF "$(CCTYPE)" == "GCC"
- $(LINK32) $(LINK_FLAGS) -o $@ perlglob$(o) $(LIBFILES)
+ $(LINK32) $(BLINK_FLAGS) -mconsole -o $@ perlglob$(o) $(LIBFILES)
.ELSE
- $(LINK32) $(LINK_FLAGS) $(LIBFILES) -out:$@ -subsystem:$(SUBSYS) \
+ $(LINK32) $(BLINK_FLAGS) $(LIBFILES) -out:$@ -subsystem:$(SUBSYS) \
perlglob$(o) setargv$(o)
.ENDIF
copy $(CFGH_TMPL) config.h
..\config.sh : config.w32 $(MINIPERL) config_sh.PL
- $(MINIPERL) -I..\lib config_sh.PL $(CFG_VARS) config.w32 > ..\config.sh
+ $(MINIPERL) -I..\lib config_sh.PL --cfgsh-option-file \
+ $(mktmp $(CFG_VARS)) config.w32 > ..\config.sh
# this target is for when changes to the main config.sh happen
# edit config.{b,v,g}c and make this target once for each supported
# compiler (e.g. `dmake CCTYPE=BORLAND regen_config_h`)
regen_config_h:
- perl config_sh.PL $(CFG_VARS) $(CFGSH_TMPL) > ..\config.sh
+ perl config_sh.PL --cfgsh-option-file $(mktmp $(CFG_VARS)) \
+ $(CFGSH_TMPL) > ..\config.sh
-cd .. && del /f perl.exe
cd .. && perl configpm
-del /f $(CFGH_TMPL)
$(XCOPY) ..\ext\re\re.pm $(LIBDIR)\*.*
$(RCOPY) include $(COREDIR)\*.*
$(MINIPERL) -I..\lib config_h.PL "INST_VER=$(INST_VER)" \
- || $(MAKE) $(MAKEMACROS) $(CONFIGPM)
+ || $(MAKE) $(MAKEMACROS) $(CONFIGPM) $(MAKEFILE)
-$(MINIPERL) : $(MINIDIR) $(MINI_OBJ)
+$(MINIPERL) : $(MINIDIR) $(MINI_OBJ) $(CRTIPMLIBS)
.IF "$(CCTYPE)" == "BORLAND"
- $(LINK32) -Tpe -ap $(LINK_FLAGS) \
+ $(LINK32) -Tpe -ap $(BLINK_FLAGS) \
@$(mktmp c0x32$(o) $(MINI_OBJ:s,\,\\),$(@:s,\,\\),,$(LIBFILES),)
.ELIF "$(CCTYPE)" == "GCC"
- $(LINK32) -v -o $@ $(LINK_FLAGS) \
- $(mktmp $(LKPRE) $(MINI_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
+ $(LINK32) -v -mconsole -o $@ $(BLINK_FLAGS) \
+ $(mktmp $(LKPRE) $(MINI_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
.ELSE
$(LINK32) -subsystem:console -out:$@ \
- @$(mktmp $(LINK_FLAGS) $(LIBFILES) $(MINI_OBJ:s,\,\\))
+ @$(mktmp $(BLINK_FLAGS) $(LIBFILES) $(MINI_OBJ:s,\,\\))
.ENDIF
$(MINIDIR) :
if not exist "$(MINIDIR)" mkdir "$(MINIDIR)"
$(MINICORE_OBJ) : $(CORE_NOCFG_H)
- $(CC) -c $(CFLAGS) $(OBJOUT_FLAG)$@ ..\$(*B).c
+ $(CC) -c $(CFLAGS) -DPERL_EXTERNAL_GLOB $(OBJOUT_FLAG)$@ ..\$(*B).c
$(MINIWIN32_OBJ) : $(CORE_NOCFG_H)
$(CC) -c $(CFLAGS) $(OBJOUT_FLAG)$@ $(*B).c
+# -DPERL_IMPLICIT_SYS needs C++ for perllib.c
+# rules wrapped in .IFs break Win9X build (we end up with unbalanced []s unless
+# unless the .IF is true), so instead we use a .ELSE with the default
+perllib$(o) : perllib.c
+.IF "$(USE_IMP_SYS)$(USE_OBJECT)" == "defineundef"
+ $(CC) -c -I. $(CFLAGS_O) $(CXX_FLAG) $(OBJOUT_FLAG)$@ perllib.c
+.ELSE
+ $(CC) -c -I. $(CFLAGS_O) $(OBJOUT_FLAG)$@ perllib.c
+.ENDIF
+
# 1. we don't want to rebuild miniperl.exe when config.h changes
# 2. we don't want to rebuild miniperl.exe with non-default config.h
$(MINI_OBJ) : $(CORE_NOCFG_H)
$(X2P_OBJ) : $(CORE_H)
perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym ..\pp.sym ..\makedef.pl
- $(MINIPERL) -w ..\makedef.pl PLATFORM=win32 $(OPTIMIZE) $(DEFINES) $(BUILDOPT) \
- CCTYPE=$(CCTYPE) > perldll.def
+ $(MINIPERL) -w ..\makedef.pl PLATFORM=win32 $(OPTIMIZE) $(DEFINES) \
+ $(BUILDOPT) CCTYPE=$(CCTYPE) > perldll.def
-$(PERLDLL): perldll.def $(PERLDLL_OBJ)
+$(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES)
.IF "$(CCTYPE)" == "BORLAND"
- $(LINK32) -Tpd -ap $(LINK_FLAGS) \
+ $(LINK32) -Tpd -ap $(BLINK_FLAGS) \
@$(mktmp c0d32$(o) $(PERLDLL_OBJ:s,\,\\)\n \
$@,\n \
$(LIBFILES)\n \
perldll.def\n)
$(IMPLIB) $*.lib $@
.ELIF "$(CCTYPE)" == "GCC"
- $(LINK32) -mdll -o $@ -Wl,--base-file -Wl,perl.base $(LINK_FLAGS) \
+ $(LINK32) -mdll -o $@ -Wl,--base-file -Wl,perl.base $(BLINK_FLAGS) \
$(mktmp $(LKPRE) $(PERLDLL_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
dlltool --output-lib $(PERLIMPLIB) \
- --dllname perl.dll \
- --def perldll.def \
- --base-file perl.base \
- --output-exp perl.exp
- $(LINK32) -mdll -o $@ $(LINK_FLAGS) \
+ --dllname $(PERLDLL:b).dll \
+ --def perldll.def \
+ --base-file perl.base \
+ --output-exp perl.exp
+ $(LINK32) -mdll -o $@ $(BLINK_FLAGS) \
$(mktmp $(LKPRE) $(PERLDLL_OBJ:s,\,\\) $(LIBFILES) \
perl.exp $(LKPOST))
.ELSE
$(LINK32) -dll -def:perldll.def -out:$@ \
- @$(mktmp $(LINK_FLAGS) $(LIBFILES) $(PERLDLL_OBJ:s,\,\\))
+ @$(mktmp $(BLINK_FLAGS) $(LIBFILES) $(PERLDLL_RES) $(PERLDLL_OBJ:s,\,\\))
.ENDIF
$(XCOPY) $(PERLIMPLIB) $(COREDIR)
$(MINIPERL) ..\x2p\find2perl.PL
$(MINIPERL) ..\x2p\s2p.PL
.IF "$(CCTYPE)" == "BORLAND"
- $(LINK32) -Tpe -ap $(LINK_FLAGS) \
+ $(LINK32) -Tpe -ap $(BLINK_FLAGS) \
@$(mktmp c0x32$(o) $(X2P_OBJ:s,\,\\),$(@:s,\,\\),,$(LIBFILES),)
.ELIF "$(CCTYPE)" == "GCC"
- $(LINK32) -v -o $@ $(LINK_FLAGS) \
+ $(LINK32) -v -o $@ $(BLINK_FLAGS) \
$(mktmp $(LKPRE) $(X2P_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
.ELSE
$(LINK32) -subsystem:console -out:$@ \
- @$(mktmp $(LINK_FLAGS) $(LIBFILES) $(X2P_OBJ:s,\,\\))
+ @$(mktmp $(BLINK_FLAGS) $(LIBFILES) $(X2P_OBJ:s,\,\\))
.ENDIF
perlmain.c : runperl.c
perlmain$(o) : perlmain.c
$(CC) $(CFLAGS_O) -UPERLDLL $(OBJOUT_FLAG)$@ -c perlmain.c
-$(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ)
+$(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES)
.IF "$(CCTYPE)" == "BORLAND"
- $(LINK32) -Tpe -ap $(LINK_FLAGS) \
+ $(LINK32) -Tpe -ap $(BLINK_FLAGS) \
@$(mktmp c0x32$(o) $(PERLEXE_OBJ:s,\,\\)\n \
$(@:s,\,\\),\n \
$(PERLIMPLIB) $(LIBFILES)\n)
.ELIF "$(CCTYPE)" == "GCC"
- $(LINK32) -o $@ $(LINK_FLAGS) \
+ $(LINK32) -mconsole -o $@ $(BLINK_FLAGS) \
$(PERLEXE_OBJ) $(PERLIMPLIB) $(LIBFILES)
.ELSE
- $(LINK32) -subsystem:console -out:$@ $(LINK_FLAGS) $(LIBFILES) \
- $(PERLEXE_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB)
+ $(LINK32) -subsystem:console -out:$@ $(BLINK_FLAGS) $(LIBFILES) \
+ $(PERLEXE_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) $(PERLEXE_RES)
+ copy $(PERLEXE) $(WPERLEXE)
+ editbin /subsystem:windows $(WPERLEXE)
.ENDIF
copy splittree.pl ..
$(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
.IF "$(CCTYPE)" != "BORLAND"
.IF "$(CCTYPE)" != "GCC"
-.IF "$(USE_PERLCRT)" == ""
+.IF "$(USE_PERLCRT)" != "define"
perl95.c : runperl.c
copy runperl.c perl95.c
$(OBJOUT_FLAG)DynaLoadmt$(o) $(DYNALOADER).c
$(PERL95EXE): $(PERLDLL) $(CONFIGPM) $(PERL95_OBJ)
- $(LINK32) -subsystem:console -nodefaultlib -out:$@ $(LINK_FLAGS) \
+ $(LINK32) -subsystem:console -nodefaultlib -out:$@ $(BLINK_FLAGS) \
$(LIBBASEFILES) $(PERL95_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) \
libcmt.lib
$(DYNALOADER).c: $(MINIPERL) $(EXTDIR)\DynaLoader\dl_win32.xs $(CONFIGPM)
if not exist $(AUTODIR) mkdir $(AUTODIR)
cd $(EXTDIR)\$(*B) && ..\$(MINIPERL) -I..\..\lib $(*B)_pm.PL
+ cd $(EXTDIR)\$(*B) && ..\$(MINIPERL) -I..\..\lib XSLoader_pm.PL
$(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL)
+ $(XCOPY) $(EXTDIR)\$(*B)\XSLoader.pm $(LIBDIR)\$(NULL)
cd $(EXTDIR)\$(*B) && $(XSUBPP) dl_win32.xs > $(*B).c
$(XCOPY) $(EXTDIR)\$(*B)\dlutils.c .
..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
cd $(EXTDIR)\Devel\$(*B) && $(MAKE)
+$(GLOB_DLL): $(PERLEXE) $(GLOB).xs
+ cd $(EXTDIR)\File\$(*B) && \
+ ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
+ cd $(EXTDIR)\File\$(*B) && $(MAKE)
+
$(PEEK_DLL): $(PERLEXE) $(PEEK).xs
cd $(EXTDIR)\Devel\$(*B) && \
..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
-del /f $(EXTENSION_C) $(DYNALOADER).c $(ERRNO).pm
-del /f $(EXTDIR)\DynaLoader\dl_win32.xs
-del /f $(LIBDIR)\.exists $(LIBDIR)\attrs.pm $(LIBDIR)\DynaLoader.pm
+ -del /f $(LIBDIR)\XSLoader.pm
-del /f $(LIBDIR)\Fcntl.pm $(LIBDIR)\IO.pm $(LIBDIR)\Opcode.pm
-del /f $(LIBDIR)\ops.pm $(LIBDIR)\Safe.pm $(LIBDIR)\Thread.pm
-del /f $(LIBDIR)\SDBM_File.pm $(LIBDIR)\Socket.pm $(LIBDIR)\POSIX.pm
-del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm $(LIBDIR)\re.pm
-del /f $(LIBDIR)\Data\Dumper.pm $(LIBDIR)\ByteLoader.pm
-del /f $(LIBDIR)\Devel\Peek.pm $(LIBDIR)\Devel\DProf.pm
+ -del /f $(LIBDIR)\File\Glob.pm
-rmdir /s /q $(LIBDIR)\IO || rmdir /s $(LIBDIR)\IO
-rmdir /s /q $(LIBDIR)\Thread || rmdir /s $(LIBDIR)\Thread
-rmdir /s /q $(LIBDIR)\B || rmdir /s $(LIBDIR)\B
-del /f $(PODDIR)\*.html
-del /f $(PODDIR)\*.bat
-cd ..\utils && del /f h2ph splain perlbug pl2pm c2ph h2xs perldoc \
- dprofpp pstruct *.bat
+ dprofpp *.bat
-cd ..\x2p && del /f find2perl s2p *.bat
-del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new
-del /f $(CONFIGPM)
install : all installbare installhtml
-installbare : utils
+installbare : $(RIGHTMAKE) utils
$(PERLEXE) ..\installperl
.IF "$(PERL95EXE)" != ""
$(XCOPY) $(PERL95EXE) $(INST_BIN)\*.*
.ENDIF
+ if exist $(WPERLEXE) $(XCOPY) $(WPERLEXE) $(INST_BIN)\*.*
$(XCOPY) $(GLOBEXE) $(INST_BIN)\*.*
$(XCOPY) bin\*.bat $(INST_SCRIPT)\*.*
$(XCOPY) $(GLOBEXE) ..\t\$(NULL)
.ENDIF
-test : test-prep
+test : $(RIGHTMAKE) test-prep
cd ..\t && $(PERLEXE) -I..\lib harness
test-notty : test-prep
-@erase /f config.h
-@erase $(GLOBEXE)
-@erase $(PERLEXE)
+ -@erase $(WPERLEXE)
-@erase $(PERLDLL)
-@erase $(CORE_OBJ)
-rmdir /s /q $(MINIDIR) || rmdir /s $(MINIDIR)
--- /dev/null
+/* perlhost.h
+ *
+ * (c) 1999 Microsoft Corporation. All rights reserved.
+ * Portions (c) 1999 ActiveState Tool Corp, http://www.ActiveState.com/
+ *
+ * You may distribute under the terms of either the GNU General Public
+ * License or the Artistic License, as specified in the README file.
+ */
+
+#ifndef ___PerlHost_H___
+#define ___PerlHost_H___
+
+#include "iperlsys.h"
+#include "vmem.h"
+#include "vdir.h"
+
+#if !defined(PERL_OBJECT)
+START_EXTERN_C
+#endif
+extern char * g_win32_get_privlib(char *pl);
+extern char * g_win32_get_sitelib(char *pl);
+extern char * g_getlogin(void);
+extern int do_spawn2(char *cmd, int exectype);
+#if !defined(PERL_OBJECT)
+END_EXTERN_C
+#endif
+
+#ifdef PERL_OBJECT
+extern int g_do_aspawn(void *vreally, void **vmark, void **vsp);
+#define do_aspawn g_do_aspawn
+#endif
+
+class CPerlHost
+{
+public:
+ CPerlHost(void);
+ CPerlHost(struct IPerlMem** ppMem, struct IPerlMem** ppMemShared,
+ struct IPerlMem** ppMemParse, struct IPerlEnv** ppEnv,
+ struct IPerlStdIO** ppStdIO, struct IPerlLIO** ppLIO,
+ struct IPerlDir** ppDir, struct IPerlSock** ppSock,
+ struct IPerlProc** ppProc);
+ CPerlHost(CPerlHost& host);
+ ~CPerlHost(void);
+
+ static CPerlHost* IPerlMem2Host(struct IPerlMem* piPerl);
+ static CPerlHost* IPerlMemShared2Host(struct IPerlMem* piPerl);
+ static CPerlHost* IPerlMemParse2Host(struct IPerlMem* piPerl);
+ static CPerlHost* IPerlEnv2Host(struct IPerlEnv* piPerl);
+ static CPerlHost* IPerlStdIO2Host(struct IPerlStdIO* piPerl);
+ static CPerlHost* IPerlLIO2Host(struct IPerlLIO* piPerl);
+ static CPerlHost* IPerlDir2Host(struct IPerlDir* piPerl);
+ static CPerlHost* IPerlSock2Host(struct IPerlSock* piPerl);
+ static CPerlHost* IPerlProc2Host(struct IPerlProc* piPerl);
+
+ BOOL PerlCreate(void);
+ int PerlParse(int argc, char** argv, char** env);
+ int PerlRun(void);
+ void PerlDestroy(void);
+
+/* IPerlMem */
+ inline void* Malloc(size_t size) { return m_pVMem->Malloc(size); };
+ inline void* Realloc(void* ptr, size_t size) { return m_pVMem->Realloc(ptr, size); };
+ inline void Free(void* ptr) { m_pVMem->Free(ptr); };
+ inline void* Calloc(size_t num, size_t size)
+ {
+ size_t count = num*size;
+ void* lpVoid = Malloc(count);
+ if (lpVoid)
+ ZeroMemory(lpVoid, count);
+ return lpVoid;
+ };
+ inline void GetLock(void) { m_pVMem->GetLock(); };
+ inline void FreeLock(void) { m_pVMem->FreeLock(); };
+ inline int IsLocked(void) { return m_pVMem->IsLocked(); };
+
+/* IPerlMemShared */
+ inline void* MallocShared(size_t size)
+ {
+ return m_pVMemShared->Malloc(size);
+ };
+ inline void* ReallocShared(void* ptr, size_t size) { return m_pVMemShared->Realloc(ptr, size); };
+ inline void FreeShared(void* ptr) { m_pVMemShared->Free(ptr); };
+ inline void* CallocShared(size_t num, size_t size)
+ {
+ size_t count = num*size;
+ void* lpVoid = MallocShared(count);
+ if (lpVoid)
+ ZeroMemory(lpVoid, count);
+ return lpVoid;
+ };
+ inline void GetLockShared(void) { m_pVMem->GetLock(); };
+ inline void FreeLockShared(void) { m_pVMem->FreeLock(); };
+ inline int IsLockedShared(void) { return m_pVMem->IsLocked(); };
+
+/* IPerlMemParse */
+ inline void* MallocParse(size_t size) { return m_pVMemParse->Malloc(size); };
+ inline void* ReallocParse(void* ptr, size_t size) { return m_pVMemParse->Realloc(ptr, size); };
+ inline void FreeParse(void* ptr) { m_pVMemParse->Free(ptr); };
+ inline void* CallocParse(size_t num, size_t size)
+ {
+ size_t count = num*size;
+ void* lpVoid = MallocParse(count);
+ if (lpVoid)
+ ZeroMemory(lpVoid, count);
+ return lpVoid;
+ };
+ inline void GetLockParse(void) { m_pVMem->GetLock(); };
+ inline void FreeLockParse(void) { m_pVMem->FreeLock(); };
+ inline int IsLockedParse(void) { return m_pVMem->IsLocked(); };
+
+/* IPerlEnv */
+ char *Getenv(const char *varname);
+ int Putenv(const char *envstring);
+ inline char *Getenv(const char *varname, unsigned long *len)
+ {
+ *len = 0;
+ char *e = Getenv(varname);
+ if (e)
+ *len = strlen(e);
+ return e;
+ }
+ void* CreateChildEnv(void) { return CreateLocalEnvironmentStrings(*m_pvDir); };
+ void FreeChildEnv(void* pStr) { FreeLocalEnvironmentStrings((char*)pStr); };
+ char* GetChildDir(void);
+ void FreeChildDir(char* pStr);
+ void Reset(void);
+ void Clearenv(void);
+
+ inline LPSTR GetIndex(DWORD &dwIndex)
+ {
+ if(dwIndex < m_dwEnvCount)
+ {
+ ++dwIndex;
+ return m_lppEnvList[dwIndex-1];
+ }
+ return NULL;
+ };
+
+protected:
+ LPSTR Find(LPCSTR lpStr);
+ void Add(LPCSTR lpStr);
+
+ LPSTR CreateLocalEnvironmentStrings(VDir &vDir);
+ void FreeLocalEnvironmentStrings(LPSTR lpStr);
+ LPSTR* Lookup(LPCSTR lpStr);
+ DWORD CalculateEnvironmentSpace(void);
+
+public:
+
+/* IPerlDIR */
+ virtual int Chdir(const char *dirname);
+
+/* IPerllProc */
+ void Abort(void);
+ void Exit(int status);
+ void _Exit(int status);
+ int Execl(const char *cmdname, const char *arg0, const char *arg1, const char *arg2, const char *arg3);
+ int Execv(const char *cmdname, const char *const *argv);
+ int Execvp(const char *cmdname, const char *const *argv);
+
+ inline VMem* GetMemShared(void) { m_pVMemShared->AddRef(); return m_pVMemShared; };
+ inline VMem* GetMemParse(void) { m_pVMemParse->AddRef(); return m_pVMemParse; };
+ inline VDir* GetDir(void) { return m_pvDir; };
+
+public:
+
+ struct IPerlMem m_hostperlMem;
+ struct IPerlMem m_hostperlMemShared;
+ struct IPerlMem m_hostperlMemParse;
+ struct IPerlEnv m_hostperlEnv;
+ struct IPerlStdIO m_hostperlStdIO;
+ struct IPerlLIO m_hostperlLIO;
+ struct IPerlDir m_hostperlDir;
+ struct IPerlSock m_hostperlSock;
+ struct IPerlProc m_hostperlProc;
+
+ struct IPerlMem* m_pHostperlMem;
+ struct IPerlMem* m_pHostperlMemShared;
+ struct IPerlMem* m_pHostperlMemParse;
+ struct IPerlEnv* m_pHostperlEnv;
+ struct IPerlStdIO* m_pHostperlStdIO;
+ struct IPerlLIO* m_pHostperlLIO;
+ struct IPerlDir* m_pHostperlDir;
+ struct IPerlSock* m_pHostperlSock;
+ struct IPerlProc* m_pHostperlProc;
+
+ inline char* MapPathA(const char *pInName) { return m_pvDir->MapPathA(pInName); };
+ inline WCHAR* MapPathW(const WCHAR *pInName) { return m_pvDir->MapPathW(pInName); };
+protected:
+
+ VDir* m_pvDir;
+ VMem* m_pVMem;
+ VMem* m_pVMemShared;
+ VMem* m_pVMemParse;
+
+ DWORD m_dwEnvCount;
+ LPSTR* m_lppEnvList;
+};
+
+
+#define STRUCT2PTR(x, y) (CPerlHost*)(((LPBYTE)x)-offsetof(CPerlHost, y))
+
+inline CPerlHost* IPerlMem2Host(struct IPerlMem* piPerl)
+{
+ return STRUCT2PTR(piPerl, m_hostperlMem);
+}
+
+inline CPerlHost* IPerlMemShared2Host(struct IPerlMem* piPerl)
+{
+ return STRUCT2PTR(piPerl, m_hostperlMemShared);
+}
+
+inline CPerlHost* IPerlMemParse2Host(struct IPerlMem* piPerl)
+{
+ return STRUCT2PTR(piPerl, m_hostperlMemParse);
+}
+
+inline CPerlHost* IPerlEnv2Host(struct IPerlEnv* piPerl)
+{
+ return STRUCT2PTR(piPerl, m_hostperlEnv);
+}
+
+inline CPerlHost* IPerlStdIO2Host(struct IPerlStdIO* piPerl)
+{
+ return STRUCT2PTR(piPerl, m_hostperlStdIO);
+}
+
+inline CPerlHost* IPerlLIO2Host(struct IPerlLIO* piPerl)
+{
+ return STRUCT2PTR(piPerl, m_hostperlLIO);
+}
+
+inline CPerlHost* IPerlDir2Host(struct IPerlDir* piPerl)
+{
+ return STRUCT2PTR(piPerl, m_hostperlDir);
+}
+
+inline CPerlHost* IPerlSock2Host(struct IPerlSock* piPerl)
+{
+ return STRUCT2PTR(piPerl, m_hostperlSock);
+}
+
+inline CPerlHost* IPerlProc2Host(struct IPerlProc* piPerl)
+{
+ return STRUCT2PTR(piPerl, m_hostperlProc);
+}
+
+
+
+#undef IPERL2HOST
+#define IPERL2HOST(x) IPerlMem2Host(x)
+
+/* IPerlMem */
+void*
+PerlMemMalloc(struct IPerlMem* piPerl, size_t size)
+{
+ return IPERL2HOST(piPerl)->Malloc(size);
+}
+void*
+PerlMemRealloc(struct IPerlMem* piPerl, void* ptr, size_t size)
+{
+ return IPERL2HOST(piPerl)->Realloc(ptr, size);
+}
+void
+PerlMemFree(struct IPerlMem* piPerl, void* ptr)
+{
+ IPERL2HOST(piPerl)->Free(ptr);
+}
+void*
+PerlMemCalloc(struct IPerlMem* piPerl, size_t num, size_t size)
+{
+ return IPERL2HOST(piPerl)->Calloc(num, size);
+}
+
+void
+PerlMemGetLock(struct IPerlMem* piPerl)
+{
+ IPERL2HOST(piPerl)->GetLock();
+}
+
+void
+PerlMemFreeLock(struct IPerlMem* piPerl)
+{
+ IPERL2HOST(piPerl)->FreeLock();
+}
+
+int
+PerlMemIsLocked(struct IPerlMem* piPerl)
+{
+ return IPERL2HOST(piPerl)->IsLocked();
+}
+
+struct IPerlMem perlMem =
+{
+ PerlMemMalloc,
+ PerlMemRealloc,
+ PerlMemFree,
+ PerlMemCalloc,
+ PerlMemGetLock,
+ PerlMemFreeLock,
+ PerlMemIsLocked,
+};
+
+#undef IPERL2HOST
+#define IPERL2HOST(x) IPerlMemShared2Host(x)
+
+/* IPerlMemShared */
+void*
+PerlMemSharedMalloc(struct IPerlMem* piPerl, size_t size)
+{
+ return IPERL2HOST(piPerl)->MallocShared(size);
+}
+void*
+PerlMemSharedRealloc(struct IPerlMem* piPerl, void* ptr, size_t size)
+{
+ return IPERL2HOST(piPerl)->ReallocShared(ptr, size);
+}
+void
+PerlMemSharedFree(struct IPerlMem* piPerl, void* ptr)
+{
+ IPERL2HOST(piPerl)->FreeShared(ptr);
+}
+void*
+PerlMemSharedCalloc(struct IPerlMem* piPerl, size_t num, size_t size)
+{
+ return IPERL2HOST(piPerl)->CallocShared(num, size);
+}
+
+void
+PerlMemSharedGetLock(struct IPerlMem* piPerl)
+{
+ IPERL2HOST(piPerl)->GetLockShared();
+}
+
+void
+PerlMemSharedFreeLock(struct IPerlMem* piPerl)
+{
+ IPERL2HOST(piPerl)->FreeLockShared();
+}
+
+int
+PerlMemSharedIsLocked(struct IPerlMem* piPerl)
+{
+ return IPERL2HOST(piPerl)->IsLockedShared();
+}
+
+struct IPerlMem perlMemShared =
+{
+ PerlMemSharedMalloc,
+ PerlMemSharedRealloc,
+ PerlMemSharedFree,
+ PerlMemSharedCalloc,
+ PerlMemSharedGetLock,
+ PerlMemSharedFreeLock,
+ PerlMemSharedIsLocked,
+};
+
+#undef IPERL2HOST
+#define IPERL2HOST(x) IPerlMemParse2Host(x)
+
+/* IPerlMemParse */
+void*
+PerlMemParseMalloc(struct IPerlMem* piPerl, size_t size)
+{
+ return IPERL2HOST(piPerl)->MallocParse(size);
+}
+void*
+PerlMemParseRealloc(struct IPerlMem* piPerl, void* ptr, size_t size)
+{
+ return IPERL2HOST(piPerl)->ReallocParse(ptr, size);
+}
+void
+PerlMemParseFree(struct IPerlMem* piPerl, void* ptr)
+{
+ IPERL2HOST(piPerl)->FreeParse(ptr);
+}
+void*
+PerlMemParseCalloc(struct IPerlMem* piPerl, size_t num, size_t size)
+{
+ return IPERL2HOST(piPerl)->CallocParse(num, size);
+}
+
+void
+PerlMemParseGetLock(struct IPerlMem* piPerl)
+{
+ IPERL2HOST(piPerl)->GetLockParse();
+}
+
+void
+PerlMemParseFreeLock(struct IPerlMem* piPerl)
+{
+ IPERL2HOST(piPerl)->FreeLockParse();
+}
+
+int
+PerlMemParseIsLocked(struct IPerlMem* piPerl)
+{
+ return IPERL2HOST(piPerl)->IsLockedParse();
+}
+
+struct IPerlMem perlMemParse =
+{
+ PerlMemParseMalloc,
+ PerlMemParseRealloc,
+ PerlMemParseFree,
+ PerlMemParseCalloc,
+ PerlMemParseGetLock,
+ PerlMemParseFreeLock,
+ PerlMemParseIsLocked,
+};
+
+
+#undef IPERL2HOST
+#define IPERL2HOST(x) IPerlEnv2Host(x)
+
+/* IPerlEnv */
+char*
+PerlEnvGetenv(struct IPerlEnv* piPerl, const char *varname)
+{
+ return IPERL2HOST(piPerl)->Getenv(varname);
+};
+
+int
+PerlEnvPutenv(struct IPerlEnv* piPerl, const char *envstring)
+{
+ return IPERL2HOST(piPerl)->Putenv(envstring);
+};
+
+char*
+PerlEnvGetenv_len(struct IPerlEnv* piPerl, const char* varname, unsigned long* len)
+{
+ return IPERL2HOST(piPerl)->Getenv(varname, len);
+}
+
+int
+PerlEnvUname(struct IPerlEnv* piPerl, struct utsname *name)
+{
+ return win32_uname(name);
+}
+
+void
+PerlEnvClearenv(struct IPerlEnv* piPerl)
+{
+ IPERL2HOST(piPerl)->Clearenv();
+}
+
+void*
+PerlEnvGetChildenv(struct IPerlEnv* piPerl)
+{
+ return IPERL2HOST(piPerl)->CreateChildEnv();
+}
+
+void
+PerlEnvFreeChildenv(struct IPerlEnv* piPerl, void* childEnv)
+{
+ IPERL2HOST(piPerl)->FreeChildEnv(childEnv);
+}
+
+char*
+PerlEnvGetChilddir(struct IPerlEnv* piPerl)
+{
+ return IPERL2HOST(piPerl)->GetChildDir();
+}
+
+void
+PerlEnvFreeChilddir(struct IPerlEnv* piPerl, char* childDir)
+{
+ IPERL2HOST(piPerl)->FreeChildDir(childDir);
+}
+
+unsigned long
+PerlEnvOsId(struct IPerlEnv* piPerl)
+{
+ return win32_os_id();
+}
+
+char*
+PerlEnvLibPath(struct IPerlEnv* piPerl, char *pl)
+{
+ return g_win32_get_privlib(pl);
+}
+
+char*
+PerlEnvSiteLibPath(struct IPerlEnv* piPerl, char *pl)
+{
+ return g_win32_get_sitelib(pl);
+}
+
+struct IPerlEnv perlEnv =
+{
+ PerlEnvGetenv,
+ PerlEnvPutenv,
+ PerlEnvGetenv_len,
+ PerlEnvUname,
+ PerlEnvClearenv,
+ PerlEnvGetChildenv,
+ PerlEnvFreeChildenv,
+ PerlEnvGetChilddir,
+ PerlEnvFreeChilddir,
+ PerlEnvOsId,
+ PerlEnvLibPath,
+ PerlEnvSiteLibPath,
+};
+
+#undef IPERL2HOST
+#define IPERL2HOST(x) IPerlStdIO2Host(x)
+
+/* PerlStdIO */
+PerlIO*
+PerlStdIOStdin(struct IPerlStdIO* piPerl)
+{
+ return (PerlIO*)win32_stdin();
+}
+
+PerlIO*
+PerlStdIOStdout(struct IPerlStdIO* piPerl)
+{
+ return (PerlIO*)win32_stdout();
+}
+
+PerlIO*
+PerlStdIOStderr(struct IPerlStdIO* piPerl)
+{
+ return (PerlIO*)win32_stderr();
+}
+
+PerlIO*
+PerlStdIOOpen(struct IPerlStdIO* piPerl, const char *path, const char *mode)
+{
+ return (PerlIO*)win32_fopen(path, mode);
+}
+
+int
+PerlStdIOClose(struct IPerlStdIO* piPerl, PerlIO* pf)
+{
+ return win32_fclose(((FILE*)pf));
+}
+
+int
+PerlStdIOEof(struct IPerlStdIO* piPerl, PerlIO* pf)
+{
+ return win32_feof((FILE*)pf);
+}
+
+int
+PerlStdIOError(struct IPerlStdIO* piPerl, PerlIO* pf)
+{
+ return win32_ferror((FILE*)pf);
+}
+
+void
+PerlStdIOClearerr(struct IPerlStdIO* piPerl, PerlIO* pf)
+{
+ win32_clearerr((FILE*)pf);
+}
+
+int
+PerlStdIOGetc(struct IPerlStdIO* piPerl, PerlIO* pf)
+{
+ return win32_getc((FILE*)pf);
+}
+
+char*
+PerlStdIOGetBase(struct IPerlStdIO* piPerl, PerlIO* pf)
+{
+#ifdef FILE_base
+ FILE *f = (FILE*)pf;
+ return FILE_base(f);
+#else
+ return Nullch;
+#endif
+}
+
+int
+PerlStdIOGetBufsiz(struct IPerlStdIO* piPerl, PerlIO* pf)
+{
+#ifdef FILE_bufsiz
+ FILE *f = (FILE*)pf;
+ return FILE_bufsiz(f);
+#else
+ return (-1);
+#endif
+}
+
+int
+PerlStdIOGetCnt(struct IPerlStdIO* piPerl, PerlIO* pf)
+{
+#ifdef USE_STDIO_PTR
+ FILE *f = (FILE*)pf;
+ return FILE_cnt(f);
+#else
+ return (-1);
+#endif
+}
+
+char*
+PerlStdIOGetPtr(struct IPerlStdIO* piPerl, PerlIO* pf)
+{
+#ifdef USE_STDIO_PTR
+ FILE *f = (FILE*)pf;
+ return FILE_ptr(f);
+#else
+ return Nullch;
+#endif
+}
+
+char*
+PerlStdIOGets(struct IPerlStdIO* piPerl, PerlIO* pf, char* s, int n)
+{
+ return win32_fgets(s, n, (FILE*)pf);
+}
+
+int
+PerlStdIOPutc(struct IPerlStdIO* piPerl, PerlIO* pf, int c)
+{
+ return win32_fputc(c, (FILE*)pf);
+}
+
+int
+PerlStdIOPuts(struct IPerlStdIO* piPerl, PerlIO* pf, const char *s)
+{
+ return win32_fputs(s, (FILE*)pf);
+}
+
+int
+PerlStdIOFlush(struct IPerlStdIO* piPerl, PerlIO* pf)
+{
+ return win32_fflush((FILE*)pf);
+}
+
+int
+PerlStdIOUngetc(struct IPerlStdIO* piPerl, PerlIO* pf,int c)
+{
+ return win32_ungetc(c, (FILE*)pf);
+}
+
+int
+PerlStdIOFileno(struct IPerlStdIO* piPerl, PerlIO* pf)
+{
+ return win32_fileno((FILE*)pf);
+}
+
+PerlIO*
+PerlStdIOFdopen(struct IPerlStdIO* piPerl, int fd, const char *mode)
+{
+ return (PerlIO*)win32_fdopen(fd, mode);
+}
+
+PerlIO*
+PerlStdIOReopen(struct IPerlStdIO* piPerl, const char*path, const char*mode, PerlIO* pf)
+{
+ return (PerlIO*)win32_freopen(path, mode, (FILE*)pf);
+}
+
+SSize_t
+PerlStdIORead(struct IPerlStdIO* piPerl, PerlIO* pf, void *buffer, Size_t size)
+{
+ return win32_fread(buffer, 1, size, (FILE*)pf);
+}
+
+SSize_t
+PerlStdIOWrite(struct IPerlStdIO* piPerl, PerlIO* pf, const void *buffer, Size_t size)
+{
+ return win32_fwrite(buffer, 1, size, (FILE*)pf);
+}
+
+void
+PerlStdIOSetBuf(struct IPerlStdIO* piPerl, PerlIO* pf, char* buffer)
+{
+ win32_setbuf((FILE*)pf, buffer);
+}
+
+int
+PerlStdIOSetVBuf(struct IPerlStdIO* piPerl, PerlIO* pf, char* buffer, int type, Size_t size)
+{
+ return win32_setvbuf((FILE*)pf, buffer, type, size);
+}
+
+void
+PerlStdIOSetCnt(struct IPerlStdIO* piPerl, PerlIO* pf, int n)
+{
+#ifdef STDIO_CNT_LVALUE
+ FILE *f = (FILE*)pf;
+ FILE_cnt(f) = n;
+#endif
+}
+
+void
+PerlStdIOSetPtrCnt(struct IPerlStdIO* piPerl, PerlIO* pf, char * ptr, int n)
+{
+#ifdef STDIO_PTR_LVALUE
+ FILE *f = (FILE*)pf;
+ FILE_ptr(f) = ptr;
+ FILE_cnt(f) = n;
+#endif
+}
+
+void
+PerlStdIOSetlinebuf(struct IPerlStdIO* piPerl, PerlIO* pf)
+{
+ win32_setvbuf((FILE*)pf, NULL, _IOLBF, 0);
+}
+
+int
+PerlStdIOPrintf(struct IPerlStdIO* piPerl, PerlIO* pf, const char *format,...)
+{
+ va_list(arglist);
+ va_start(arglist, format);
+ return win32_vfprintf((FILE*)pf, format, arglist);
+}
+
+int
+PerlStdIOVprintf(struct IPerlStdIO* piPerl, PerlIO* pf, const char *format, va_list arglist)
+{
+ return win32_vfprintf((FILE*)pf, format, arglist);
+}
+
+long
+PerlStdIOTell(struct IPerlStdIO* piPerl, PerlIO* pf)
+{
+ return win32_ftell((FILE*)pf);
+}
+
+int
+PerlStdIOSeek(struct IPerlStdIO* piPerl, PerlIO* pf, off_t offset, int origin)
+{
+ return win32_fseek((FILE*)pf, offset, origin);
+}
+
+void
+PerlStdIORewind(struct IPerlStdIO* piPerl, PerlIO* pf)
+{
+ win32_rewind((FILE*)pf);
+}
+
+PerlIO*
+PerlStdIOTmpfile(struct IPerlStdIO* piPerl)
+{
+ return (PerlIO*)win32_tmpfile();
+}
+
+int
+PerlStdIOGetpos(struct IPerlStdIO* piPerl, PerlIO* pf, Fpos_t *p)
+{
+ return win32_fgetpos((FILE*)pf, p);
+}
+
+int
+PerlStdIOSetpos(struct IPerlStdIO* piPerl, PerlIO* pf, const Fpos_t *p)
+{
+ return win32_fsetpos((FILE*)pf, p);
+}
+void
+PerlStdIOInit(struct IPerlStdIO* piPerl)
+{
+}
+
+void
+PerlStdIOInitOSExtras(struct IPerlStdIO* piPerl)
+{
+ Perl_init_os_extras();
+}
+
+int
+PerlStdIOOpenOSfhandle(struct IPerlStdIO* piPerl, long osfhandle, int flags)
+{
+ return win32_open_osfhandle(osfhandle, flags);
+}
+
+int
+PerlStdIOGetOSfhandle(struct IPerlStdIO* piPerl, int filenum)
+{
+ return win32_get_osfhandle(filenum);
+}
+
+PerlIO*
+PerlStdIOFdupopen(struct IPerlStdIO* piPerl, PerlIO* pf)
+{
+ PerlIO* pfdup;
+ fpos_t pos;
+ char mode[3];
+ int fileno = win32_dup(win32_fileno((FILE*)pf));
+
+ /* open the file in the same mode */
+#ifdef __BORLANDC__
+ if(((FILE*)pf)->flags & _F_READ) {
+ mode[0] = 'r';
+ mode[1] = 0;
+ }
+ else if(((FILE*)pf)->flags & _F_WRIT) {
+ mode[0] = 'a';
+ mode[1] = 0;
+ }
+ else if(((FILE*)pf)->flags & _F_RDWR) {
+ mode[0] = 'r';
+ mode[1] = '+';
+ mode[2] = 0;
+ }
+#else
+ if(((FILE*)pf)->_flag & _IOREAD) {
+ mode[0] = 'r';
+ mode[1] = 0;
+ }
+ else if(((FILE*)pf)->_flag & _IOWRT) {
+ mode[0] = 'a';
+ mode[1] = 0;
+ }
+ else if(((FILE*)pf)->_flag & _IORW) {
+ mode[0] = 'r';
+ mode[1] = '+';
+ mode[2] = 0;
+ }
+#endif
+
+ /* it appears that the binmode is attached to the
+ * file descriptor so binmode files will be handled
+ * correctly
+ */
+ pfdup = (PerlIO*)win32_fdopen(fileno, mode);
+
+ /* move the file pointer to the same position */
+ if (!fgetpos((FILE*)pf, &pos)) {
+ fsetpos((FILE*)pfdup, &pos);
+ }
+ return pfdup;
+}
+
+struct IPerlStdIO perlStdIO =
+{
+ PerlStdIOStdin,
+ PerlStdIOStdout,
+ PerlStdIOStderr,
+ PerlStdIOOpen,
+ PerlStdIOClose,
+ PerlStdIOEof,
+ PerlStdIOError,
+ PerlStdIOClearerr,
+ PerlStdIOGetc,
+ PerlStdIOGetBase,
+ PerlStdIOGetBufsiz,
+ PerlStdIOGetCnt,
+ PerlStdIOGetPtr,
+ PerlStdIOGets,
+ PerlStdIOPutc,
+ PerlStdIOPuts,
+ PerlStdIOFlush,
+ PerlStdIOUngetc,
+ PerlStdIOFileno,
+ PerlStdIOFdopen,
+ PerlStdIOReopen,
+ PerlStdIORead,
+ PerlStdIOWrite,
+ PerlStdIOSetBuf,
+ PerlStdIOSetVBuf,
+ PerlStdIOSetCnt,
+ PerlStdIOSetPtrCnt,
+ PerlStdIOSetlinebuf,
+ PerlStdIOPrintf,
+ PerlStdIOVprintf,
+ PerlStdIOTell,
+ PerlStdIOSeek,
+ PerlStdIORewind,
+ PerlStdIOTmpfile,
+ PerlStdIOGetpos,
+ PerlStdIOSetpos,
+ PerlStdIOInit,
+ PerlStdIOInitOSExtras,
+ PerlStdIOFdupopen,
+};
+
+
+#undef IPERL2HOST
+#define IPERL2HOST(x) IPerlLIO2Host(x)
+
+/* IPerlLIO */
+int
+PerlLIOAccess(struct IPerlLIO* piPerl, const char *path, int mode)
+{
+ return win32_access(path, mode);
+}
+
+int
+PerlLIOChmod(struct IPerlLIO* piPerl, const char *filename, int pmode)
+{
+ return win32_chmod(filename, pmode);
+}
+
+int
+PerlLIOChown(struct IPerlLIO* piPerl, const char *filename, uid_t owner, gid_t group)
+{
+ return chown(filename, owner, group);
+}
+
+int
+PerlLIOChsize(struct IPerlLIO* piPerl, int handle, long size)
+{
+ return chsize(handle, size);
+}
+
+int
+PerlLIOClose(struct IPerlLIO* piPerl, int handle)
+{
+ return win32_close(handle);
+}
+
+int
+PerlLIODup(struct IPerlLIO* piPerl, int handle)
+{
+ return win32_dup(handle);
+}
+
+int
+PerlLIODup2(struct IPerlLIO* piPerl, int handle1, int handle2)
+{
+ return win32_dup2(handle1, handle2);
+}
+
+int
+PerlLIOFlock(struct IPerlLIO* piPerl, int fd, int oper)
+{
+ return win32_flock(fd, oper);
+}
+
+int
+PerlLIOFileStat(struct IPerlLIO* piPerl, int handle, struct stat *buffer)
+{
+ return fstat(handle, buffer);
+}
+
+int
+PerlLIOIOCtl(struct IPerlLIO* piPerl, int i, unsigned int u, char *data)
+{
+ return win32_ioctlsocket((SOCKET)i, (long)u, (u_long*)data);
+}
+
+int
+PerlLIOIsatty(struct IPerlLIO* piPerl, int fd)
+{
+ return isatty(fd);
+}
+
+int
+PerlLIOLink(struct IPerlLIO* piPerl, const char*oldname, const char *newname)
+{
+ return win32_link(oldname, newname);
+}
+
+long
+PerlLIOLseek(struct IPerlLIO* piPerl, int handle, long offset, int origin)
+{
+ return win32_lseek(handle, offset, origin);
+}
+
+int
+PerlLIOLstat(struct IPerlLIO* piPerl, const char *path, struct stat *buffer)
+{
+ return win32_stat(path, buffer);
+}
+
+char*
+PerlLIOMktemp(struct IPerlLIO* piPerl, char *Template)
+{
+ return mktemp(Template);
+}
+
+int
+PerlLIOOpen(struct IPerlLIO* piPerl, const char *filename, int oflag)
+{
+ return win32_open(filename, oflag);
+}
+
+int
+PerlLIOOpen3(struct IPerlLIO* piPerl, const char *filename, int oflag, int pmode)
+{
+ return win32_open(filename, oflag, pmode);
+}
+
+int
+PerlLIORead(struct IPerlLIO* piPerl, int handle, void *buffer, unsigned int count)
+{
+ return win32_read(handle, buffer, count);
+}
+
+int
+PerlLIORename(struct IPerlLIO* piPerl, const char *OldFileName, const char *newname)
+{
+ return win32_rename(OldFileName, newname);
+}
+
+int
+PerlLIOSetmode(struct IPerlLIO* piPerl, int handle, int mode)
+{
+ return win32_setmode(handle, mode);
+}
+
+int
+PerlLIONameStat(struct IPerlLIO* piPerl, const char *path, struct stat *buffer)
+{
+ return win32_stat(path, buffer);
+}
+
+char*
+PerlLIOTmpnam(struct IPerlLIO* piPerl, char *string)
+{
+ return tmpnam(string);
+}
+
+int
+PerlLIOUmask(struct IPerlLIO* piPerl, int pmode)
+{
+ return umask(pmode);
+}
+
+int
+PerlLIOUnlink(struct IPerlLIO* piPerl, const char *filename)
+{
+ return win32_unlink(filename);
+}
+
+int
+PerlLIOUtime(struct IPerlLIO* piPerl, char *filename, struct utimbuf *times)
+{
+ return win32_utime(filename, times);
+}
+
+int
+PerlLIOWrite(struct IPerlLIO* piPerl, int handle, const void *buffer, unsigned int count)
+{
+ return win32_write(handle, buffer, count);
+}
+
+struct IPerlLIO perlLIO =
+{
+ PerlLIOAccess,
+ PerlLIOChmod,
+ PerlLIOChown,
+ PerlLIOChsize,
+ PerlLIOClose,
+ PerlLIODup,
+ PerlLIODup2,
+ PerlLIOFlock,
+ PerlLIOFileStat,
+ PerlLIOIOCtl,
+ PerlLIOIsatty,
+ PerlLIOLink,
+ PerlLIOLseek,
+ PerlLIOLstat,
+ PerlLIOMktemp,
+ PerlLIOOpen,
+ PerlLIOOpen3,
+ PerlLIORead,
+ PerlLIORename,
+ PerlLIOSetmode,
+ PerlLIONameStat,
+ PerlLIOTmpnam,
+ PerlLIOUmask,
+ PerlLIOUnlink,
+ PerlLIOUtime,
+ PerlLIOWrite,
+};
+
+
+#undef IPERL2HOST
+#define IPERL2HOST(x) IPerlDir2Host(x)
+
+/* IPerlDIR */
+int
+PerlDirMakedir(struct IPerlDir* piPerl, const char *dirname, int mode)
+{
+ return win32_mkdir(dirname, mode);
+}
+
+int
+PerlDirChdir(struct IPerlDir* piPerl, const char *dirname)
+{
+ return IPERL2HOST(piPerl)->Chdir(dirname);
+}
+
+int
+PerlDirRmdir(struct IPerlDir* piPerl, const char *dirname)
+{
+ return win32_rmdir(dirname);
+}
+
+int
+PerlDirClose(struct IPerlDir* piPerl, DIR *dirp)
+{
+ return win32_closedir(dirp);
+}
+
+DIR*
+PerlDirOpen(struct IPerlDir* piPerl, char *filename)
+{
+ return win32_opendir(filename);
+}
+
+struct direct *
+PerlDirRead(struct IPerlDir* piPerl, DIR *dirp)
+{
+ return win32_readdir(dirp);
+}
+
+void
+PerlDirRewind(struct IPerlDir* piPerl, DIR *dirp)
+{
+ win32_rewinddir(dirp);
+}
+
+void
+PerlDirSeek(struct IPerlDir* piPerl, DIR *dirp, long loc)
+{
+ win32_seekdir(dirp, loc);
+}
+
+long
+PerlDirTell(struct IPerlDir* piPerl, DIR *dirp)
+{
+ return win32_telldir(dirp);
+}
+
+char*
+PerlDirMapPathA(struct IPerlDir* piPerl, const char* path)
+{
+ return IPERL2HOST(piPerl)->MapPathA(path);
+}
+
+WCHAR*
+PerlDirMapPathW(struct IPerlDir* piPerl, const WCHAR* path)
+{
+ return IPERL2HOST(piPerl)->MapPathW(path);
+}
+
+struct IPerlDir perlDir =
+{
+ PerlDirMakedir,
+ PerlDirChdir,
+ PerlDirRmdir,
+ PerlDirClose,
+ PerlDirOpen,
+ PerlDirRead,
+ PerlDirRewind,
+ PerlDirSeek,
+ PerlDirTell,
+ PerlDirMapPathA,
+ PerlDirMapPathW,
+};
+
+
+/* IPerlSock */
+u_long
+PerlSockHtonl(struct IPerlSock* piPerl, u_long hostlong)
+{
+ return win32_htonl(hostlong);
+}
+
+u_short
+PerlSockHtons(struct IPerlSock* piPerl, u_short hostshort)
+{
+ return win32_htons(hostshort);
+}
+
+u_long
+PerlSockNtohl(struct IPerlSock* piPerl, u_long netlong)
+{
+ return win32_ntohl(netlong);
+}
+
+u_short
+PerlSockNtohs(struct IPerlSock* piPerl, u_short netshort)
+{
+ return win32_ntohs(netshort);
+}
+
+SOCKET PerlSockAccept(struct IPerlSock* piPerl, SOCKET s, struct sockaddr* addr, int* addrlen)
+{
+ return win32_accept(s, addr, addrlen);
+}
+
+int
+PerlSockBind(struct IPerlSock* piPerl, SOCKET s, const struct sockaddr* name, int namelen)
+{
+ return win32_bind(s, name, namelen);
+}
+
+int
+PerlSockConnect(struct IPerlSock* piPerl, SOCKET s, const struct sockaddr* name, int namelen)
+{
+ return win32_connect(s, name, namelen);
+}
+
+void
+PerlSockEndhostent(struct IPerlSock* piPerl)
+{
+ win32_endhostent();
+}
+
+void
+PerlSockEndnetent(struct IPerlSock* piPerl)
+{
+ win32_endnetent();
+}
+
+void
+PerlSockEndprotoent(struct IPerlSock* piPerl)
+{
+ win32_endprotoent();
+}
+
+void
+PerlSockEndservent(struct IPerlSock* piPerl)
+{
+ win32_endservent();
+}
+
+struct hostent*
+PerlSockGethostbyaddr(struct IPerlSock* piPerl, const char* addr, int len, int type)
+{
+ return win32_gethostbyaddr(addr, len, type);
+}
+
+struct hostent*
+PerlSockGethostbyname(struct IPerlSock* piPerl, const char* name)
+{
+ return win32_gethostbyname(name);
+}
+
+struct hostent*
+PerlSockGethostent(struct IPerlSock* piPerl)
+{
+ dTHXo;
+ Perl_croak(aTHX_ "gethostent not implemented!\n");
+ return NULL;
+}
+
+int
+PerlSockGethostname(struct IPerlSock* piPerl, char* name, int namelen)
+{
+ return win32_gethostname(name, namelen);
+}
+
+struct netent *
+PerlSockGetnetbyaddr(struct IPerlSock* piPerl, long net, int type)
+{
+ return win32_getnetbyaddr(net, type);
+}
+
+struct netent *
+PerlSockGetnetbyname(struct IPerlSock* piPerl, const char *name)
+{
+ return win32_getnetbyname((char*)name);
+}
+
+struct netent *
+PerlSockGetnetent(struct IPerlSock* piPerl)
+{
+ return win32_getnetent();
+}
+
+int PerlSockGetpeername(struct IPerlSock* piPerl, SOCKET s, struct sockaddr* name, int* namelen)
+{
+ return win32_getpeername(s, name, namelen);
+}
+
+struct protoent*
+PerlSockGetprotobyname(struct IPerlSock* piPerl, const char* name)
+{
+ return win32_getprotobyname(name);
+}
+
+struct protoent*
+PerlSockGetprotobynumber(struct IPerlSock* piPerl, int number)
+{
+ return win32_getprotobynumber(number);
+}
+
+struct protoent*
+PerlSockGetprotoent(struct IPerlSock* piPerl)
+{
+ return win32_getprotoent();
+}
+
+struct servent*
+PerlSockGetservbyname(struct IPerlSock* piPerl, const char* name, const char* proto)
+{
+ return win32_getservbyname(name, proto);
+}
+
+struct servent*
+PerlSockGetservbyport(struct IPerlSock* piPerl, int port, const char* proto)
+{
+ return win32_getservbyport(port, proto);
+}
+
+struct servent*
+PerlSockGetservent(struct IPerlSock* piPerl)
+{
+ return win32_getservent();
+}
+
+int
+PerlSockGetsockname(struct IPerlSock* piPerl, SOCKET s, struct sockaddr* name, int* namelen)
+{
+ return win32_getsockname(s, name, namelen);
+}
+
+int
+PerlSockGetsockopt(struct IPerlSock* piPerl, SOCKET s, int level, int optname, char* optval, int* optlen)
+{
+ return win32_getsockopt(s, level, optname, optval, optlen);
+}
+
+unsigned long
+PerlSockInetAddr(struct IPerlSock* piPerl, const char* cp)
+{
+ return win32_inet_addr(cp);
+}
+
+char*
+PerlSockInetNtoa(struct IPerlSock* piPerl, struct in_addr in)
+{
+ return win32_inet_ntoa(in);
+}
+
+int
+PerlSockListen(struct IPerlSock* piPerl, SOCKET s, int backlog)
+{
+ return win32_listen(s, backlog);
+}
+
+int
+PerlSockRecv(struct IPerlSock* piPerl, SOCKET s, char* buffer, int len, int flags)
+{
+ return win32_recv(s, buffer, len, flags);
+}
+
+int
+PerlSockRecvfrom(struct IPerlSock* piPerl, SOCKET s, char* buffer, int len, int flags, struct sockaddr* from, int* fromlen)
+{
+ return win32_recvfrom(s, buffer, len, flags, from, fromlen);
+}
+
+int
+PerlSockSelect(struct IPerlSock* piPerl, int nfds, char* readfds, char* writefds, char* exceptfds, const struct timeval* timeout)
+{
+ return win32_select(nfds, (Perl_fd_set*)readfds, (Perl_fd_set*)writefds, (Perl_fd_set*)exceptfds, timeout);
+}
+
+int
+PerlSockSend(struct IPerlSock* piPerl, SOCKET s, const char* buffer, int len, int flags)
+{
+ return win32_send(s, buffer, len, flags);
+}
+
+int
+PerlSockSendto(struct IPerlSock* piPerl, SOCKET s, const char* buffer, int len, int flags, const struct sockaddr* to, int tolen)
+{
+ return win32_sendto(s, buffer, len, flags, to, tolen);
+}
+
+void
+PerlSockSethostent(struct IPerlSock* piPerl, int stayopen)
+{
+ win32_sethostent(stayopen);
+}
+
+void
+PerlSockSetnetent(struct IPerlSock* piPerl, int stayopen)
+{
+ win32_setnetent(stayopen);
+}
+
+void
+PerlSockSetprotoent(struct IPerlSock* piPerl, int stayopen)
+{
+ win32_setprotoent(stayopen);
+}
+
+void
+PerlSockSetservent(struct IPerlSock* piPerl, int stayopen)
+{
+ win32_setservent(stayopen);
+}
+
+int
+PerlSockSetsockopt(struct IPerlSock* piPerl, SOCKET s, int level, int optname, const char* optval, int optlen)
+{
+ return win32_setsockopt(s, level, optname, optval, optlen);
+}
+
+int
+PerlSockShutdown(struct IPerlSock* piPerl, SOCKET s, int how)
+{
+ return win32_shutdown(s, how);
+}
+
+SOCKET
+PerlSockSocket(struct IPerlSock* piPerl, int af, int type, int protocol)
+{
+ return win32_socket(af, type, protocol);
+}
+
+int
+PerlSockSocketpair(struct IPerlSock* piPerl, int domain, int type, int protocol, int* fds)
+{
+ dTHXo;
+ Perl_croak(aTHX_ "socketpair not implemented!\n");
+ return 0;
+}
+
+int
+PerlSockClosesocket(struct IPerlSock* piPerl, SOCKET s)
+{
+ return win32_closesocket(s);
+}
+
+int
+PerlSockIoctlsocket(struct IPerlSock* piPerl, SOCKET s, long cmd, u_long *argp)
+{
+ return win32_ioctlsocket(s, cmd, argp);
+}
+
+struct IPerlSock perlSock =
+{
+ PerlSockHtonl,
+ PerlSockHtons,
+ PerlSockNtohl,
+ PerlSockNtohs,
+ PerlSockAccept,
+ PerlSockBind,
+ PerlSockConnect,
+ PerlSockEndhostent,
+ PerlSockEndnetent,
+ PerlSockEndprotoent,
+ PerlSockEndservent,
+ PerlSockGethostname,
+ PerlSockGetpeername,
+ PerlSockGethostbyaddr,
+ PerlSockGethostbyname,
+ PerlSockGethostent,
+ PerlSockGetnetbyaddr,
+ PerlSockGetnetbyname,
+ PerlSockGetnetent,
+ PerlSockGetprotobyname,
+ PerlSockGetprotobynumber,
+ PerlSockGetprotoent,
+ PerlSockGetservbyname,
+ PerlSockGetservbyport,
+ PerlSockGetservent,
+ PerlSockGetsockname,
+ PerlSockGetsockopt,
+ PerlSockInetAddr,
+ PerlSockInetNtoa,
+ PerlSockListen,
+ PerlSockRecv,
+ PerlSockRecvfrom,
+ PerlSockSelect,
+ PerlSockSend,
+ PerlSockSendto,
+ PerlSockSethostent,
+ PerlSockSetnetent,
+ PerlSockSetprotoent,
+ PerlSockSetservent,
+ PerlSockSetsockopt,
+ PerlSockShutdown,
+ PerlSockSocket,
+ PerlSockSocketpair,
+ PerlSockClosesocket,
+};
+
+
+/* IPerlProc */
+
+#define EXECF_EXEC 1
+#define EXECF_SPAWN 2
+
+void
+PerlProcAbort(struct IPerlProc* piPerl)
+{
+ win32_abort();
+}
+
+char *
+PerlProcCrypt(struct IPerlProc* piPerl, const char* clear, const char* salt)
+{
+ return win32_crypt(clear, salt);
+}
+
+void
+PerlProcExit(struct IPerlProc* piPerl, int status)
+{
+ exit(status);
+}
+
+void
+PerlProc_Exit(struct IPerlProc* piPerl, int status)
+{
+ _exit(status);
+}
+
+int
+PerlProcExecl(struct IPerlProc* piPerl, const char *cmdname, const char *arg0, const char *arg1, const char *arg2, const char *arg3)
+{
+ return execl(cmdname, arg0, arg1, arg2, arg3);
+}
+
+int
+PerlProcExecv(struct IPerlProc* piPerl, const char *cmdname, const char *const *argv)
+{
+ return win32_execvp(cmdname, argv);
+}
+
+int
+PerlProcExecvp(struct IPerlProc* piPerl, const char *cmdname, const char *const *argv)
+{
+ return win32_execvp(cmdname, argv);
+}
+
+uid_t
+PerlProcGetuid(struct IPerlProc* piPerl)
+{
+ return getuid();
+}
+
+uid_t
+PerlProcGeteuid(struct IPerlProc* piPerl)
+{
+ return geteuid();
+}
+
+gid_t
+PerlProcGetgid(struct IPerlProc* piPerl)
+{
+ return getgid();
+}
+
+gid_t
+PerlProcGetegid(struct IPerlProc* piPerl)
+{
+ return getegid();
+}
+
+char *
+PerlProcGetlogin(struct IPerlProc* piPerl)
+{
+ return g_getlogin();
+}
+
+int
+PerlProcKill(struct IPerlProc* piPerl, int pid, int sig)
+{
+ return win32_kill(pid, sig);
+}
+
+int
+PerlProcKillpg(struct IPerlProc* piPerl, int pid, int sig)
+{
+ dTHXo;
+ Perl_croak(aTHX_ "killpg not implemented!\n");
+ return 0;
+}
+
+int
+PerlProcPauseProc(struct IPerlProc* piPerl)
+{
+ return win32_sleep((32767L << 16) + 32767);
+}
+
+PerlIO*
+PerlProcPopen(struct IPerlProc* piPerl, const char *command, const char *mode)
+{
+ dTHXo;
+ PERL_FLUSHALL_FOR_CHILD;
+ return (PerlIO*)win32_popen(command, mode);
+}
+
+int
+PerlProcPclose(struct IPerlProc* piPerl, PerlIO *stream)
+{
+ return win32_pclose((FILE*)stream);
+}
+
+int
+PerlProcPipe(struct IPerlProc* piPerl, int *phandles)
+{
+ return win32_pipe(phandles, 512, O_BINARY);
+}
+
+int
+PerlProcSetuid(struct IPerlProc* piPerl, uid_t u)
+{
+ return setuid(u);
+}
+
+int
+PerlProcSetgid(struct IPerlProc* piPerl, gid_t g)
+{
+ return setgid(g);
+}
+
+int
+PerlProcSleep(struct IPerlProc* piPerl, unsigned int s)
+{
+ return win32_sleep(s);
+}
+
+int
+PerlProcTimes(struct IPerlProc* piPerl, struct tms *timebuf)
+{
+ return win32_times(timebuf);
+}
+
+int
+PerlProcWait(struct IPerlProc* piPerl, int *status)
+{
+ return win32_wait(status);
+}
+
+int
+PerlProcWaitpid(struct IPerlProc* piPerl, int pid, int *status, int flags)
+{
+ return win32_waitpid(pid, status, flags);
+}
+
+Sighandler_t
+PerlProcSignal(struct IPerlProc* piPerl, int sig, Sighandler_t subcode)
+{
+ return 0;
+}
+
+#ifdef USE_ITHREADS
+static DWORD WINAPI
+win32_start_child(LPVOID arg)
+{
+ PerlInterpreter *my_perl = (PerlInterpreter*)arg;
+ GV *tmpgv;
+ int status;
+#ifdef PERL_OBJECT
+ CPerlObj *pPerl = (CPerlObj*)my_perl;
+#endif
+#ifdef PERL_SYNC_FORK
+ static long sync_fork_id = 0;
+ long id = ++sync_fork_id;
+#endif
+
+
+ PERL_SET_INTERP(my_perl);
+
+ /* set $$ to pseudo id */
+#ifdef PERL_SYNC_FORK
+ w32_pseudo_id = id;
+#else
+ w32_pseudo_id = GetCurrentThreadId();
+#endif
+ if (tmpgv = gv_fetchpv("$", TRUE, SVt_PV))
+ sv_setiv(GvSV(tmpgv), -(IV)w32_pseudo_id);
+ hv_clear(PL_pidstatus);
+
+ /* push a zero on the stack (we are the child) */
+ {
+ djSP;
+ dTARGET;
+ PUSHi(0);
+ PUTBACK;
+ }
+
+ /* continue from next op */
+ PL_op = PL_op->op_next;
+
+ {
+ dJMPENV;
+ volatile int oldscope = PL_scopestack_ix;
+
+restart:
+ JMPENV_PUSH(status);
+ switch (status) {
+ case 0:
+ CALLRUNOPS(aTHX);
+ status = 0;
+ break;
+ case 2:
+ while (PL_scopestack_ix > oldscope)
+ LEAVE;
+ FREETMPS;
+ PL_curstash = PL_defstash;
+ if (PL_endav && !PL_minus_c)
+ call_list(oldscope, PL_endav);
+ status = STATUS_NATIVE_EXPORT;
+ break;
+ case 3:
+ if (PL_restartop) {
+ POPSTACK_TO(PL_mainstack);
+ PL_op = PL_restartop;
+ PL_restartop = Nullop;
+ goto restart;
+ }
+ PerlIO_printf(Perl_error_log, "panic: restartop\n");
+ FREETMPS;
+ status = 1;
+ break;
+ }
+ JMPENV_POP;
+
+ /* XXX hack to avoid perl_destruct() freeing optree */
+ PL_main_root = Nullop;
+ }
+
+ /* destroy everything (waits for any pseudo-forked children) */
+ perl_destruct(my_perl);
+ perl_free(my_perl);
+
+#ifdef PERL_SYNC_FORK
+ return id;
+#else
+ return (DWORD)status;
+#endif
+}
+#endif /* USE_ITHREADS */
+
+int
+PerlProcFork(struct IPerlProc* piPerl)
+{
+ dTHXo;
+#ifdef USE_ITHREADS
+ DWORD id;
+ HANDLE handle;
+ CPerlHost *h = new CPerlHost(*(CPerlHost*)w32_internal_host);
+ PerlInterpreter *new_perl = perl_clone_using((PerlInterpreter*)aTHXo, 1,
+ h->m_pHostperlMem,
+ h->m_pHostperlMemShared,
+ h->m_pHostperlMemParse,
+ h->m_pHostperlEnv,
+ h->m_pHostperlStdIO,
+ h->m_pHostperlLIO,
+ h->m_pHostperlDir,
+ h->m_pHostperlSock,
+ h->m_pHostperlProc
+ );
+ new_perl->Isys_intern.internal_host = h;
+# ifdef PERL_SYNC_FORK
+ id = win32_start_child((LPVOID)new_perl);
+ PERL_SET_INTERP(aTHXo);
+# else
+ handle = CreateThread(NULL, 0, win32_start_child,
+ (LPVOID)new_perl, 0, &id);
+ PERL_SET_INTERP(aTHXo);
+ if (!handle)
+ Perl_croak(aTHX_ "panic: pseudo fork() failed");
+ w32_pseudo_child_handles[w32_num_pseudo_children] = handle;
+ w32_pseudo_child_pids[w32_num_pseudo_children] = id;
+ ++w32_num_pseudo_children;
+# endif
+ return -(int)id;
+#else
+ Perl_croak(aTHX_ "fork() not implemented!\n");
+ return -1;
+#endif /* USE_ITHREADS */
+}
+
+int
+PerlProcGetpid(struct IPerlProc* piPerl)
+{
+ return win32_getpid();
+}
+
+void*
+PerlProcDynaLoader(struct IPerlProc* piPerl, const char* filename)
+{
+ return win32_dynaload(filename);
+}
+
+void
+PerlProcGetOSError(struct IPerlProc* piPerl, SV* sv, DWORD dwErr)
+{
+ win32_str_os_error(sv, dwErr);
+}
+
+BOOL
+PerlProcDoCmd(struct IPerlProc* piPerl, char *cmd)
+{
+ do_spawn2(cmd, EXECF_EXEC);
+ return FALSE;
+}
+
+int
+PerlProcSpawn(struct IPerlProc* piPerl, char* cmds)
+{
+ return do_spawn2(cmds, EXECF_SPAWN);
+}
+
+int
+PerlProcSpawnvp(struct IPerlProc* piPerl, int mode, const char *cmdname, const char *const *argv)
+{
+ return win32_spawnvp(mode, cmdname, argv);
+}
+
+int
+PerlProcASpawn(struct IPerlProc* piPerl, void *vreally, void **vmark, void **vsp)
+{
+ return do_aspawn(vreally, vmark, vsp);
+}
+
+struct IPerlProc perlProc =
+{
+ PerlProcAbort,
+ PerlProcCrypt,
+ PerlProcExit,
+ PerlProc_Exit,
+ PerlProcExecl,
+ PerlProcExecv,
+ PerlProcExecvp,
+ PerlProcGetuid,
+ PerlProcGeteuid,
+ PerlProcGetgid,
+ PerlProcGetegid,
+ PerlProcGetlogin,
+ PerlProcKill,
+ PerlProcKillpg,
+ PerlProcPauseProc,
+ PerlProcPopen,
+ PerlProcPclose,
+ PerlProcPipe,
+ PerlProcSetuid,
+ PerlProcSetgid,
+ PerlProcSleep,
+ PerlProcTimes,
+ PerlProcWait,
+ PerlProcWaitpid,
+ PerlProcSignal,
+ PerlProcFork,
+ PerlProcGetpid,
+ PerlProcDynaLoader,
+ PerlProcGetOSError,
+ PerlProcDoCmd,
+ PerlProcSpawn,
+ PerlProcSpawnvp,
+ PerlProcASpawn,
+};
+
+
+/*
+ * CPerlHost
+ */
+
+CPerlHost::CPerlHost(void)
+{
+ m_pvDir = new VDir();
+ m_pVMem = new VMem();
+ m_pVMemShared = new VMem();
+ m_pVMemParse = new VMem();
+
+ m_pvDir->Init(NULL, m_pVMem);
+
+ m_dwEnvCount = 0;
+ m_lppEnvList = NULL;
+
+ CopyMemory(&m_hostperlMem, &perlMem, sizeof(perlMem));
+ CopyMemory(&m_hostperlMemShared, &perlMemShared, sizeof(perlMemShared));
+ CopyMemory(&m_hostperlMemParse, &perlMemParse, sizeof(perlMemParse));
+ CopyMemory(&m_hostperlEnv, &perlEnv, sizeof(perlEnv));
+ CopyMemory(&m_hostperlStdIO, &perlStdIO, sizeof(perlStdIO));
+ CopyMemory(&m_hostperlLIO, &perlLIO, sizeof(perlLIO));
+ CopyMemory(&m_hostperlDir, &perlDir, sizeof(perlDir));
+ CopyMemory(&m_hostperlSock, &perlSock, sizeof(perlSock));
+ CopyMemory(&m_hostperlProc, &perlProc, sizeof(perlProc));
+
+ m_pHostperlMem = &m_hostperlMem;
+ m_pHostperlMemShared = &m_hostperlMemShared;
+ m_pHostperlMemParse = &m_hostperlMemParse;
+ m_pHostperlEnv = &m_hostperlEnv;
+ m_pHostperlStdIO = &m_hostperlStdIO;
+ m_pHostperlLIO = &m_hostperlLIO;
+ m_pHostperlDir = &m_hostperlDir;
+ m_pHostperlSock = &m_hostperlSock;
+ m_pHostperlProc = &m_hostperlProc;
+}
+
+#define SETUPEXCHANGE(xptr, iptr, table) \
+ STMT_START { \
+ if (xptr) { \
+ iptr = *xptr; \
+ *xptr = &table; \
+ } \
+ else { \
+ iptr = &table; \
+ } \
+ } STMT_END
+
+CPerlHost::CPerlHost(struct IPerlMem** ppMem, struct IPerlMem** ppMemShared,
+ struct IPerlMem** ppMemParse, struct IPerlEnv** ppEnv,
+ struct IPerlStdIO** ppStdIO, struct IPerlLIO** ppLIO,
+ struct IPerlDir** ppDir, struct IPerlSock** ppSock,
+ struct IPerlProc** ppProc)
+{
+ m_pvDir = new VDir(0);
+ m_pVMem = new VMem();
+ m_pVMemShared = new VMem();
+ m_pVMemParse = new VMem();
+
+ m_pvDir->Init(NULL, m_pVMem);
+
+ m_dwEnvCount = 0;
+ m_lppEnvList = NULL;
+
+ CopyMemory(&m_hostperlMem, &perlMem, sizeof(perlMem));
+ CopyMemory(&m_hostperlMemShared, &perlMemShared, sizeof(perlMemShared));
+ CopyMemory(&m_hostperlMemParse, &perlMemParse, sizeof(perlMemParse));
+ CopyMemory(&m_hostperlEnv, &perlEnv, sizeof(perlEnv));
+ CopyMemory(&m_hostperlStdIO, &perlStdIO, sizeof(perlStdIO));
+ CopyMemory(&m_hostperlLIO, &perlLIO, sizeof(perlLIO));
+ CopyMemory(&m_hostperlDir, &perlDir, sizeof(perlDir));
+ CopyMemory(&m_hostperlSock, &perlSock, sizeof(perlSock));
+ CopyMemory(&m_hostperlProc, &perlProc, sizeof(perlProc));
+
+ SETUPEXCHANGE(ppMem, m_pHostperlMem, m_hostperlMem);
+ SETUPEXCHANGE(ppMemShared, m_pHostperlMemShared, m_hostperlMemShared);
+ SETUPEXCHANGE(ppMemParse, m_pHostperlMemParse, m_hostperlMemParse);
+ SETUPEXCHANGE(ppEnv, m_pHostperlEnv, m_hostperlEnv);
+ SETUPEXCHANGE(ppStdIO, m_pHostperlStdIO, m_hostperlStdIO);
+ SETUPEXCHANGE(ppLIO, m_pHostperlLIO, m_hostperlLIO);
+ SETUPEXCHANGE(ppDir, m_pHostperlDir, m_hostperlDir);
+ SETUPEXCHANGE(ppSock, m_pHostperlSock, m_hostperlSock);
+ SETUPEXCHANGE(ppProc, m_pHostperlProc, m_hostperlProc);
+}
+#undef SETUPEXCHANGE
+
+CPerlHost::CPerlHost(CPerlHost& host)
+{
+ m_pVMem = new VMem();
+ m_pVMemShared = host.GetMemShared();
+ m_pVMemParse = host.GetMemParse();
+
+ /* duplicate directory info */
+ m_pvDir = new VDir(0);
+ m_pvDir->Init(host.GetDir(), m_pVMem);
+
+ CopyMemory(&m_hostperlMem, &perlMem, sizeof(perlMem));
+ CopyMemory(&m_hostperlMemShared, &perlMemShared, sizeof(perlMemShared));
+ CopyMemory(&m_hostperlMemParse, &perlMemParse, sizeof(perlMemParse));
+ CopyMemory(&m_hostperlEnv, &perlEnv, sizeof(perlEnv));
+ CopyMemory(&m_hostperlStdIO, &perlStdIO, sizeof(perlStdIO));
+ CopyMemory(&m_hostperlLIO, &perlLIO, sizeof(perlLIO));
+ CopyMemory(&m_hostperlDir, &perlDir, sizeof(perlDir));
+ CopyMemory(&m_hostperlSock, &perlSock, sizeof(perlSock));
+ CopyMemory(&m_hostperlProc, &perlProc, sizeof(perlProc));
+ m_pHostperlMem = &m_hostperlMem;
+ m_pHostperlMemShared = &m_hostperlMemShared;
+ m_pHostperlMemParse = &m_hostperlMemParse;
+ m_pHostperlEnv = &m_hostperlEnv;
+ m_pHostperlStdIO = &m_hostperlStdIO;
+ m_pHostperlLIO = &m_hostperlLIO;
+ m_pHostperlDir = &m_hostperlDir;
+ m_pHostperlSock = &m_hostperlSock;
+ m_pHostperlProc = &m_hostperlProc;
+
+ m_dwEnvCount = 0;
+ m_lppEnvList = NULL;
+
+ /* duplicate environment info */
+ LPSTR lpPtr;
+ DWORD dwIndex = 0;
+ while(lpPtr = host.GetIndex(dwIndex))
+ Add(lpPtr);
+}
+
+CPerlHost::~CPerlHost(void)
+{
+// Reset();
+ delete m_pvDir;
+ m_pVMemParse->Release();
+ m_pVMemShared->Release();
+ m_pVMem->Release();
+}
+
+LPSTR
+CPerlHost::Find(LPCSTR lpStr)
+{
+ LPSTR lpPtr;
+ LPSTR* lppPtr = Lookup(lpStr);
+ if(lppPtr != NULL) {
+ for(lpPtr = *lppPtr; *lpPtr != '\0' && *lpPtr != '='; ++lpPtr)
+ ;
+
+ if(*lpPtr == '=')
+ ++lpPtr;
+
+ return lpPtr;
+ }
+ return NULL;
+}
+
+int
+lookup(const void *arg1, const void *arg2)
+{ // Compare strings
+ char*ptr1, *ptr2;
+ char c1,c2;
+
+ ptr1 = *(char**)arg1;
+ ptr2 = *(char**)arg2;
+ for(;;) {
+ c1 = *ptr1++;
+ c2 = *ptr2++;
+ if(c1 == '\0' || c1 == '=') {
+ if(c2 == '\0' || c2 == '=')
+ break;
+
+ return -1; // string 1 < string 2
+ }
+ else if(c2 == '\0' || c2 == '=')
+ return 1; // string 1 > string 2
+ else if(c1 != c2) {
+ c1 = toupper(c1);
+ c2 = toupper(c2);
+ if(c1 != c2) {
+ if(c1 < c2)
+ return -1; // string 1 < string 2
+
+ return 1; // string 1 > string 2
+ }
+ }
+ }
+ return 0;
+}
+
+LPSTR*
+CPerlHost::Lookup(LPCSTR lpStr)
+{
+ return (LPSTR*)bsearch(&lpStr, m_lppEnvList, m_dwEnvCount, sizeof(LPSTR), lookup);
+}
+
+int
+compare(const void *arg1, const void *arg2)
+{ // Compare strings
+ char*ptr1, *ptr2;
+ char c1,c2;
+
+ ptr1 = *(char**)arg1;
+ ptr2 = *(char**)arg2;
+ for(;;) {
+ c1 = *ptr1++;
+ c2 = *ptr2++;
+ if(c1 == '\0' || c1 == '=') {
+ if(c1 == c2)
+ break;
+
+ return -1; // string 1 < string 2
+ }
+ else if(c2 == '\0' || c2 == '=')
+ return 1; // string 1 > string 2
+ else if(c1 != c2) {
+ c1 = toupper(c1);
+ c2 = toupper(c2);
+ if(c1 != c2) {
+ if(c1 < c2)
+ return -1; // string 1 < string 2
+
+ return 1; // string 1 > string 2
+ }
+ }
+ }
+ return 0;
+}
+
+void
+CPerlHost::Add(LPCSTR lpStr)
+{
+ dTHXo;
+ char szBuffer[1024];
+ LPSTR *lpPtr;
+ int index, length = strlen(lpStr)+1;
+
+ for(index = 0; lpStr[index] != '\0' && lpStr[index] != '='; ++index)
+ szBuffer[index] = lpStr[index];
+
+ szBuffer[index] = '\0';
+
+ // replacing ?
+ lpPtr = Lookup(szBuffer);
+ if(lpPtr != NULL) {
+ Renew(*lpPtr, length, char);
+ strcpy(*lpPtr, lpStr);
+ }
+ else {
+ ++m_dwEnvCount;
+ Renew(m_lppEnvList, m_dwEnvCount, LPSTR);
+ New(1, m_lppEnvList[m_dwEnvCount-1], length, char);
+ if(m_lppEnvList[m_dwEnvCount-1] != NULL) {
+ strcpy(m_lppEnvList[m_dwEnvCount-1], lpStr);
+ qsort(m_lppEnvList, m_dwEnvCount, sizeof(LPSTR), compare);
+ }
+ else
+ --m_dwEnvCount;
+ }
+}
+
+DWORD
+CPerlHost::CalculateEnvironmentSpace(void)
+{
+ DWORD index;
+ DWORD dwSize = 0;
+ for(index = 0; index < m_dwEnvCount; ++index)
+ dwSize += strlen(m_lppEnvList[index]) + 1;
+
+ return dwSize;
+}
+
+void
+CPerlHost::FreeLocalEnvironmentStrings(LPSTR lpStr)
+{
+ dTHXo;
+ Safefree(lpStr);
+}
+
+char*
+CPerlHost::GetChildDir(void)
+{
+ dTHXo;
+ int length;
+ char* ptr;
+ New(0, ptr, MAX_PATH+1, char);
+ if(ptr) {
+ m_pvDir->GetCurrentDirectoryA(MAX_PATH+1, ptr);
+ length = strlen(ptr)-1;
+ if(length > 0) {
+ if((ptr[length] == '\\') || (ptr[length] == '/'))
+ ptr[length] = 0;
+ }
+ }
+ return ptr;
+}
+
+void
+CPerlHost::FreeChildDir(char* pStr)
+{
+ dTHXo;
+ Safefree(pStr);
+}
+
+LPSTR
+CPerlHost::CreateLocalEnvironmentStrings(VDir &vDir)
+{
+ dTHXo;
+ LPSTR lpStr, lpPtr, lpEnvPtr, lpTmp, lpLocalEnv, lpAllocPtr;
+ DWORD dwSize, dwEnvIndex;
+ int nLength, compVal;
+
+ // get the process environment strings
+ lpAllocPtr = lpTmp = (LPSTR)GetEnvironmentStrings();
+
+ // step over current directory stuff
+ while(*lpTmp == '=')
+ lpTmp += strlen(lpTmp) + 1;
+
+ // save the start of the environment strings
+ lpEnvPtr = lpTmp;
+ for(dwSize = 1; *lpTmp != '\0'; lpTmp += strlen(lpTmp) + 1) {
+ // calculate the size of the environment strings
+ dwSize += strlen(lpTmp) + 1;
+ }
+
+ // add the size of current directories
+ dwSize += vDir.CalculateEnvironmentSpace();
+
+ // add the additional space used by changes made to the environment
+ dwSize += CalculateEnvironmentSpace();
+
+ New(1, lpStr, dwSize, char);
+ lpPtr = lpStr;
+ if(lpStr != NULL) {
+ // build the local environment
+ lpStr = vDir.BuildEnvironmentSpace(lpStr);
+
+ dwEnvIndex = 0;
+ lpLocalEnv = GetIndex(dwEnvIndex);
+ while(*lpEnvPtr != '\0') {
+ if(lpLocalEnv == NULL) {
+ // all environment overrides have been added
+ // so copy string into place
+ strcpy(lpStr, lpEnvPtr);
+ nLength = strlen(lpEnvPtr) + 1;
+ lpStr += nLength;
+ lpEnvPtr += nLength;
+ }
+ else {
+ // determine which string to copy next
+ compVal = compare(&lpEnvPtr, &lpLocalEnv);
+ if(compVal < 0) {
+ strcpy(lpStr, lpEnvPtr);
+ nLength = strlen(lpEnvPtr) + 1;
+ lpStr += nLength;
+ lpEnvPtr += nLength;
+ }
+ else {
+ char *ptr = strchr(lpLocalEnv, '=');
+ if(ptr && ptr[1]) {
+ strcpy(lpStr, lpLocalEnv);
+ lpStr += strlen(lpLocalEnv) + 1;
+ }
+ lpLocalEnv = GetIndex(dwEnvIndex);
+ if(compVal == 0) {
+ // this string was replaced
+ lpEnvPtr += strlen(lpEnvPtr) + 1;
+ }
+ }
+ }
+ }
+
+ // add final NULL
+ *lpStr = '\0';
+ }
+
+ // release the process environment strings
+ FreeEnvironmentStrings(lpAllocPtr);
+
+ return lpPtr;
+}
+
+void
+CPerlHost::Reset(void)
+{
+ dTHXo;
+ if(m_lppEnvList != NULL) {
+ for(DWORD index = 0; index < m_dwEnvCount; ++index) {
+ Safefree(m_lppEnvList[index]);
+ m_lppEnvList[index] = NULL;
+ }
+ }
+ m_dwEnvCount = 0;
+}
+
+void
+CPerlHost::Clearenv(void)
+{
+ char ch;
+ LPSTR lpPtr, lpStr, lpEnvPtr;
+ if(m_lppEnvList != NULL) {
+ /* set every entry to an empty string */
+ for(DWORD index = 0; index < m_dwEnvCount; ++index) {
+ char* ptr = strchr(m_lppEnvList[index], '=');
+ if(ptr) {
+ *++ptr = 0;
+ }
+ }
+ }
+
+ /* get the process environment strings */
+ lpStr = lpEnvPtr = (LPSTR)GetEnvironmentStrings();
+
+ /* step over current directory stuff */
+ while(*lpStr == '=')
+ lpStr += strlen(lpStr) + 1;
+
+ while(*lpStr) {
+ lpPtr = strchr(lpStr, '=');
+ if(lpPtr) {
+ ch = *++lpPtr;
+ *lpPtr = 0;
+ Add(lpStr);
+ *lpPtr = ch;
+ }
+ lpStr += strlen(lpStr) + 1;
+ }
+
+ FreeEnvironmentStrings(lpEnvPtr);
+}
+
+
+char*
+CPerlHost::Getenv(const char *varname)
+{
+ char* pEnv = Find(varname);
+ if(pEnv == NULL) {
+ pEnv = win32_getenv(varname);
+ }
+ else {
+ if(!*pEnv)
+ pEnv = 0;
+ }
+
+ return pEnv;
+}
+
+int
+CPerlHost::Putenv(const char *envstring)
+{
+ Add(envstring);
+ return 0;
+}
+
+int
+CPerlHost::Chdir(const char *dirname)
+{
+ dTHXo;
+ int ret;
+ if (USING_WIDE()) {
+ WCHAR wBuffer[MAX_PATH];
+ A2WHELPER(dirname, wBuffer, sizeof(wBuffer));
+ ret = m_pvDir->SetCurrentDirectoryW(wBuffer);
+ }
+ else
+ ret = m_pvDir->SetCurrentDirectoryA((char*)dirname);
+ if(ret < 0) {
+ errno = ENOENT;
+ }
+ return ret;
+}
+
+#endif /* ___PerlHost_H___ */
#include "XSUB.h"
-#ifdef PERL_OBJECT
-#include "win32iop.h"
-#include <fcntl.h>
-#endif
-
-
-/* Register any extra external extensions */
-char *staticlinkmodules[] = {
- "DynaLoader",
- NULL,
-};
-
-EXTERN_C void boot_DynaLoader (pTHXo_ CV* cv);
-
-static void
-xs_init(pTHXo)
-{
- char *file = __FILE__;
- dXSUB_SYS;
- newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
-}
-
-#ifdef PERL_OBJECT
-// IPerlMem
-void*
-PerlMemMalloc(struct IPerlMem*, size_t size)
-{
- return win32_malloc(size);
-}
-void*
-PerlMemRealloc(struct IPerlMem*, void* ptr, size_t size)
-{
- return win32_realloc(ptr, size);
-}
-void
-PerlMemFree(struct IPerlMem*, void* ptr)
-{
- win32_free(ptr);
-}
-
-struct IPerlMem perlMem =
-{
- PerlMemMalloc,
- PerlMemRealloc,
- PerlMemFree,
-};
-
-
-// IPerlEnv
-extern char * g_win32_get_privlib(char *pl);
-extern char * g_win32_get_sitelib(char *pl);
-
-
-char*
-PerlEnvGetenv(struct IPerlEnv*, const char *varname)
-{
- return win32_getenv(varname);
-};
-int
-PerlEnvPutenv(struct IPerlEnv*, const char *envstring)
-{
- return win32_putenv(envstring);
-};
-
-char*
-PerlEnvGetenv_len(struct IPerlEnv*, const char* varname, unsigned long* len)
-{
- char *e = win32_getenv(varname);
- if (e)
- *len = strlen(e);
- return e;
-}
-
-int
-PerlEnvUname(struct IPerlEnv*, struct utsname *name)
-{
- return win32_uname(name);
-}
-
-void
-PerlEnvClearenv(struct IPerlEnv*)
-{
- dTHXo;
- char *envv = GetEnvironmentStrings();
- char *cur = envv;
- STRLEN len;
- while (*cur) {
- char *end = strchr(cur,'=');
- if (end && end != cur) {
- *end = '\0';
- my_setenv(cur,Nullch);
- *end = '=';
- cur = end + strlen(end+1)+2;
- }
- else if ((len = strlen(cur)))
- cur += len+1;
- }
- FreeEnvironmentStrings(envv);
-}
-
-void*
-PerlEnvGetChildEnv(struct IPerlEnv*)
-{
- return NULL;
-}
-
-void
-PerlEnvFreeChildEnv(struct IPerlEnv*, void* env)
-{
-}
-
-char*
-PerlEnvGetChildDir(struct IPerlEnv*)
-{
- return NULL;
-}
-
-void
-PerlEnvFreeChildDir(struct IPerlEnv*, char* dir)
-{
-}
-
-unsigned long
-PerlEnvOsId(struct IPerlEnv*)
-{
- return win32_os_id();
-}
-
-char*
-PerlEnvLibPath(struct IPerlEnv*, char *pl)
-{
- return g_win32_get_privlib(pl);
-}
-
-char*
-PerlEnvSiteLibPath(struct IPerlEnv*, char *pl)
-{
- return g_win32_get_sitelib(pl);
-}
-
-struct IPerlEnv perlEnv =
-{
- PerlEnvGetenv,
- PerlEnvPutenv,
- PerlEnvGetenv_len,
- PerlEnvUname,
- PerlEnvClearenv,
- PerlEnvGetChildEnv,
- PerlEnvFreeChildEnv,
- PerlEnvGetChildDir,
- PerlEnvFreeChildDir,
- PerlEnvOsId,
- PerlEnvLibPath,
- PerlEnvSiteLibPath,
-};
-
-
-// PerlStdIO
-PerlIO*
-PerlStdIOStdin(struct IPerlStdIO*)
-{
- return (PerlIO*)win32_stdin();
-}
-
-PerlIO*
-PerlStdIOStdout(struct IPerlStdIO*)
-{
- return (PerlIO*)win32_stdout();
-}
-
-PerlIO*
-PerlStdIOStderr(struct IPerlStdIO*)
-{
- return (PerlIO*)win32_stderr();
-}
-
-PerlIO*
-PerlStdIOOpen(struct IPerlStdIO*, const char *path, const char *mode)
-{
- return (PerlIO*)win32_fopen(path, mode);
-}
-
-int
-PerlStdIOClose(struct IPerlStdIO*, PerlIO* pf)
-{
- return win32_fclose(((FILE*)pf));
-}
-
-int
-PerlStdIOEof(struct IPerlStdIO*, PerlIO* pf)
-{
- return win32_feof((FILE*)pf);
-}
-
-int
-PerlStdIOError(struct IPerlStdIO*, PerlIO* pf)
-{
- return win32_ferror((FILE*)pf);
-}
-
-void
-PerlStdIOClearerr(struct IPerlStdIO*, PerlIO* pf)
-{
- win32_clearerr((FILE*)pf);
-}
-
-int
-PerlStdIOGetc(struct IPerlStdIO*, PerlIO* pf)
-{
- return win32_getc((FILE*)pf);
-}
-
-char*
-PerlStdIOGetBase(struct IPerlStdIO*, PerlIO* pf)
-{
-#ifdef FILE_base
- FILE *f = (FILE*)pf;
- return FILE_base(f);
-#else
- return Nullch;
-#endif
-}
-
-int
-PerlStdIOGetBufsiz(struct IPerlStdIO*, PerlIO* pf)
-{
-#ifdef FILE_bufsiz
- FILE *f = (FILE*)pf;
- return FILE_bufsiz(f);
-#else
- return (-1);
-#endif
-}
-
-int
-PerlStdIOGetCnt(struct IPerlStdIO*, PerlIO* pf)
-{
-#ifdef USE_STDIO_PTR
- FILE *f = (FILE*)pf;
- return FILE_cnt(f);
-#else
- return (-1);
-#endif
-}
-
-char*
-PerlStdIOGetPtr(struct IPerlStdIO*, PerlIO* pf)
-{
-#ifdef USE_STDIO_PTR
- FILE *f = (FILE*)pf;
- return FILE_ptr(f);
-#else
- return Nullch;
-#endif
-}
-
-char*
-PerlStdIOGets(struct IPerlStdIO*, PerlIO* pf, char* s, int n)
-{
- return win32_fgets(s, n, (FILE*)pf);
-}
-
-int
-PerlStdIOPutc(struct IPerlStdIO*, PerlIO* pf, int c)
-{
- return win32_fputc(c, (FILE*)pf);
-}
-
-int
-PerlStdIOPuts(struct IPerlStdIO*, PerlIO* pf, const char *s)
-{
- return win32_fputs(s, (FILE*)pf);
-}
-
-int
-PerlStdIOFlush(struct IPerlStdIO*, PerlIO* pf)
-{
- return win32_fflush((FILE*)pf);
-}
-
-int
-PerlStdIOUngetc(struct IPerlStdIO*, PerlIO* pf,int c)
-{
- return win32_ungetc(c, (FILE*)pf);
-}
-
-int
-PerlStdIOFileno(struct IPerlStdIO*, PerlIO* pf)
-{
- return win32_fileno((FILE*)pf);
-}
-
-PerlIO*
-PerlStdIOFdopen(struct IPerlStdIO*, int fd, const char *mode)
-{
- return (PerlIO*)win32_fdopen(fd, mode);
-}
-
-PerlIO*
-PerlStdIOReopen(struct IPerlStdIO*, const char*path, const char*mode, PerlIO* pf)
-{
- return (PerlIO*)win32_freopen(path, mode, (FILE*)pf);
-}
-
-SSize_t
-PerlStdIORead(struct IPerlStdIO*, PerlIO* pf, void *buffer, Size_t size)
-{
- return win32_fread(buffer, 1, size, (FILE*)pf);
-}
-
-SSize_t
-PerlStdIOWrite(struct IPerlStdIO*, PerlIO* pf, const void *buffer, Size_t size)
-{
- return win32_fwrite(buffer, 1, size, (FILE*)pf);
-}
-
-void
-PerlStdIOSetBuf(struct IPerlStdIO*, PerlIO* pf, char* buffer)
-{
- win32_setbuf((FILE*)pf, buffer);
-}
-
-int
-PerlStdIOSetVBuf(struct IPerlStdIO*, PerlIO* pf, char* buffer, int type, Size_t size)
-{
- return win32_setvbuf((FILE*)pf, buffer, type, size);
-}
-
-void
-PerlStdIOSetCnt(struct IPerlStdIO*, PerlIO* pf, int n)
-{
-#ifdef STDIO_CNT_LVALUE
- FILE *f = (FILE*)pf;
- FILE_cnt(f) = n;
-#endif
-}
-
-void
-PerlStdIOSetPtrCnt(struct IPerlStdIO*, PerlIO* pf, char * ptr, int n)
-{
-#ifdef STDIO_PTR_LVALUE
- FILE *f = (FILE*)pf;
- FILE_ptr(f) = ptr;
- FILE_cnt(f) = n;
-#endif
-}
-
-void
-PerlStdIOSetlinebuf(struct IPerlStdIO*, PerlIO* pf)
-{
- win32_setvbuf((FILE*)pf, NULL, _IOLBF, 0);
-}
-
-int
-PerlStdIOPrintf(struct IPerlStdIO*, PerlIO* pf, const char *format,...)
-{
- va_list(arglist);
- va_start(arglist, format);
- return win32_vfprintf((FILE*)pf, format, arglist);
-}
-
-int
-PerlStdIOVprintf(struct IPerlStdIO*, PerlIO* pf, const char *format, va_list arglist)
-{
- return win32_vfprintf((FILE*)pf, format, arglist);
-}
-
-long
-PerlStdIOTell(struct IPerlStdIO*, PerlIO* pf)
-{
- return win32_ftell((FILE*)pf);
-}
-
-int
-PerlStdIOSeek(struct IPerlStdIO*, PerlIO* pf, off_t offset, int origin)
-{
- return win32_fseek((FILE*)pf, offset, origin);
-}
-
-void
-PerlStdIORewind(struct IPerlStdIO*, PerlIO* pf)
-{
- win32_rewind((FILE*)pf);
-}
-
-PerlIO*
-PerlStdIOTmpfile(struct IPerlStdIO*)
-{
- return (PerlIO*)win32_tmpfile();
-}
-
-int
-PerlStdIOGetpos(struct IPerlStdIO*, PerlIO* pf, Fpos_t *p)
-{
- return win32_fgetpos((FILE*)pf, p);
-}
-
-int
-PerlStdIOSetpos(struct IPerlStdIO*, PerlIO* pf, const Fpos_t *p)
-{
- return win32_fsetpos((FILE*)pf, p);
-}
-void
-PerlStdIOInit(struct IPerlStdIO*)
-{
-}
-
-void
-PerlStdIOInitOSExtras(struct IPerlStdIO*)
-{
- dTHXo;
- xs_init(pPerl);
- Perl_init_os_extras();
-}
-
-int
-PerlStdIOOpenOSfhandle(struct IPerlStdIO*, long osfhandle, int flags)
-{
- return win32_open_osfhandle(osfhandle, flags);
-}
-
-int
-PerlStdIOGetOSfhandle(struct IPerlStdIO*, int filenum)
-{
- return win32_get_osfhandle(filenum);
-}
-
-
-struct IPerlStdIO perlStdIO =
-{
- PerlStdIOStdin,
- PerlStdIOStdout,
- PerlStdIOStderr,
- PerlStdIOOpen,
- PerlStdIOClose,
- PerlStdIOEof,
- PerlStdIOError,
- PerlStdIOClearerr,
- PerlStdIOGetc,
- PerlStdIOGetBase,
- PerlStdIOGetBufsiz,
- PerlStdIOGetCnt,
- PerlStdIOGetPtr,
- PerlStdIOGets,
- PerlStdIOPutc,
- PerlStdIOPuts,
- PerlStdIOFlush,
- PerlStdIOUngetc,
- PerlStdIOFileno,
- PerlStdIOFdopen,
- PerlStdIOReopen,
- PerlStdIORead,
- PerlStdIOWrite,
- PerlStdIOSetBuf,
- PerlStdIOSetVBuf,
- PerlStdIOSetCnt,
- PerlStdIOSetPtrCnt,
- PerlStdIOSetlinebuf,
- PerlStdIOPrintf,
- PerlStdIOVprintf,
- PerlStdIOTell,
- PerlStdIOSeek,
- PerlStdIORewind,
- PerlStdIOTmpfile,
- PerlStdIOGetpos,
- PerlStdIOSetpos,
- PerlStdIOInit,
- PerlStdIOInitOSExtras,
-};
-
-
-// IPerlLIO
-int
-PerlLIOAccess(struct IPerlLIO*, const char *path, int mode)
-{
- return access(path, mode);
-}
-
-int
-PerlLIOChmod(struct IPerlLIO*, const char *filename, int pmode)
-{
- return chmod(filename, pmode);
-}
-
-int
-PerlLIOChown(struct IPerlLIO*, const char *filename, uid_t owner, gid_t group)
-{
- return chown(filename, owner, group);
-}
-
-int
-PerlLIOChsize(struct IPerlLIO*, int handle, long size)
-{
- return chsize(handle, size);
-}
-
-int
-PerlLIOClose(struct IPerlLIO*, int handle)
-{
- return win32_close(handle);
-}
-
-int
-PerlLIODup(struct IPerlLIO*, int handle)
-{
- return win32_dup(handle);
-}
-
-int
-PerlLIODup2(struct IPerlLIO*, int handle1, int handle2)
-{
- return win32_dup2(handle1, handle2);
-}
-
-int
-PerlLIOFlock(struct IPerlLIO*, int fd, int oper)
-{
- return win32_flock(fd, oper);
-}
-
-int
-PerlLIOFileStat(struct IPerlLIO*, int handle, struct stat *buffer)
-{
- return fstat(handle, buffer);
-}
-
-int
-PerlLIOIOCtl(struct IPerlLIO*, int i, unsigned int u, char *data)
-{
- return win32_ioctlsocket((SOCKET)i, (long)u, (u_long*)data);
-}
-
-int
-PerlLIOIsatty(struct IPerlLIO*, int fd)
-{
- return isatty(fd);
-}
-
-long
-PerlLIOLseek(struct IPerlLIO*, int handle, long offset, int origin)
-{
- return win32_lseek(handle, offset, origin);
-}
-
-int
-PerlLIOLstat(struct IPerlLIO* p, const char *path, struct stat *buffer)
-{
- return win32_stat(path, buffer);
-}
-
-char*
-PerlLIOMktemp(struct IPerlLIO*, char *Template)
-{
- return mktemp(Template);
-}
-
-int
-PerlLIOOpen(struct IPerlLIO*, const char *filename, int oflag)
-{
- return win32_open(filename, oflag);
-}
-
-int
-PerlLIOOpen3(struct IPerlLIO*, const char *filename, int oflag, int pmode)
-{
- int ret;
- if(stricmp(filename, "/dev/null") == 0)
- ret = open("NUL", oflag, pmode);
- else
- ret = open(filename, oflag, pmode);
-
- return ret;
-}
-
-int
-PerlLIORead(struct IPerlLIO*, int handle, void *buffer, unsigned int count)
-{
- return win32_read(handle, buffer, count);
-}
-
-int
-PerlLIORename(struct IPerlLIO*, const char *OldFileName, const char *newname)
-{
- return win32_rename(OldFileName, newname);
-}
-
-int
-PerlLIOSetmode(struct IPerlLIO*, int handle, int mode)
-{
- return win32_setmode(handle, mode);
-}
-
-int
-PerlLIONameStat(struct IPerlLIO*, const char *path, struct stat *buffer)
-{
- return win32_stat(path, buffer);
-}
-
-char*
-PerlLIOTmpnam(struct IPerlLIO*, char *string)
-{
- return tmpnam(string);
-}
-
-int
-PerlLIOUmask(struct IPerlLIO*, int pmode)
-{
- return umask(pmode);
-}
-
-int
-PerlLIOUnlink(struct IPerlLIO*, const char *filename)
-{
- chmod(filename, S_IREAD | S_IWRITE);
- return unlink(filename);
-}
-
-int
-PerlLIOUtime(struct IPerlLIO*, char *filename, struct utimbuf *times)
-{
- return win32_utime(filename, times);
-}
-
-int
-PerlLIOWrite(struct IPerlLIO*, int handle, const void *buffer, unsigned int count)
-{
- return win32_write(handle, buffer, count);
-}
-
-struct IPerlLIO perlLIO =
-{
- PerlLIOAccess,
- PerlLIOChmod,
- PerlLIOChown,
- PerlLIOChsize,
- PerlLIOClose,
- PerlLIODup,
- PerlLIODup2,
- PerlLIOFlock,
- PerlLIOFileStat,
- PerlLIOIOCtl,
- PerlLIOIsatty,
- PerlLIOLseek,
- PerlLIOLstat,
- PerlLIOMktemp,
- PerlLIOOpen,
- PerlLIOOpen3,
- PerlLIORead,
- PerlLIORename,
- PerlLIOSetmode,
- PerlLIONameStat,
- PerlLIOTmpnam,
- PerlLIOUmask,
- PerlLIOUnlink,
- PerlLIOUtime,
- PerlLIOWrite,
-};
-
-// IPerlDIR
-int
-PerlDirMakedir(struct IPerlDir*, const char *dirname, int mode)
-{
- return win32_mkdir(dirname, mode);
-}
-
-int
-PerlDirChdir(struct IPerlDir*, const char *dirname)
-{
- return win32_chdir(dirname);
-}
-
-int
-PerlDirRmdir(struct IPerlDir*, const char *dirname)
-{
- return win32_rmdir(dirname);
-}
-
-int
-PerlDirClose(struct IPerlDir*, DIR *dirp)
-{
- return win32_closedir(dirp);
-}
-
-DIR*
-PerlDirOpen(struct IPerlDir*, char *filename)
-{
- return win32_opendir(filename);
-}
-
-struct direct *
-PerlDirRead(struct IPerlDir*, DIR *dirp)
-{
- return win32_readdir(dirp);
-}
-
-void
-PerlDirRewind(struct IPerlDir*, DIR *dirp)
-{
- win32_rewinddir(dirp);
-}
-
-void
-PerlDirSeek(struct IPerlDir*, DIR *dirp, long loc)
-{
- win32_seekdir(dirp, loc);
-}
-
-long
-PerlDirTell(struct IPerlDir*, DIR *dirp)
-{
- return win32_telldir(dirp);
-}
-
-struct IPerlDir perlDir =
-{
- PerlDirMakedir,
- PerlDirChdir,
- PerlDirRmdir,
- PerlDirClose,
- PerlDirOpen,
- PerlDirRead,
- PerlDirRewind,
- PerlDirSeek,
- PerlDirTell,
-};
-
-
-// IPerlSock
-u_long
-PerlSockHtonl(struct IPerlSock*, u_long hostlong)
-{
- return win32_htonl(hostlong);
-}
-
-u_short
-PerlSockHtons(struct IPerlSock*, u_short hostshort)
-{
- return win32_htons(hostshort);
-}
-
-u_long
-PerlSockNtohl(struct IPerlSock*, u_long netlong)
-{
- return win32_ntohl(netlong);
-}
-
-u_short
-PerlSockNtohs(struct IPerlSock*, u_short netshort)
-{
- return win32_ntohs(netshort);
-}
-
-SOCKET PerlSockAccept(struct IPerlSock*, SOCKET s, struct sockaddr* addr, int* addrlen)
-{
- return win32_accept(s, addr, addrlen);
-}
-
-int
-PerlSockBind(struct IPerlSock*, SOCKET s, const struct sockaddr* name, int namelen)
-{
- return win32_bind(s, name, namelen);
-}
-
-int
-PerlSockConnect(struct IPerlSock*, SOCKET s, const struct sockaddr* name, int namelen)
-{
- return win32_connect(s, name, namelen);
-}
-
-void
-PerlSockEndhostent(struct IPerlSock*)
-{
- win32_endhostent();
-}
-
-void
-PerlSockEndnetent(struct IPerlSock*)
-{
- win32_endnetent();
-}
-
-void
-PerlSockEndprotoent(struct IPerlSock*)
-{
- win32_endprotoent();
-}
-
-void
-PerlSockEndservent(struct IPerlSock*)
-{
- win32_endservent();
-}
-
-struct hostent*
-PerlSockGethostbyaddr(struct IPerlSock*, const char* addr, int len, int type)
-{
- return win32_gethostbyaddr(addr, len, type);
-}
-
-struct hostent*
-PerlSockGethostbyname(struct IPerlSock*, const char* name)
-{
- return win32_gethostbyname(name);
-}
-
-struct hostent*
-PerlSockGethostent(struct IPerlSock*)
-{
- dTHXo;
- croak("gethostent not implemented!\n");
- return NULL;
-}
-
-int
-PerlSockGethostname(struct IPerlSock*, char* name, int namelen)
-{
- return win32_gethostname(name, namelen);
-}
-
-struct netent *
-PerlSockGetnetbyaddr(struct IPerlSock*, long net, int type)
-{
- return win32_getnetbyaddr(net, type);
-}
-
-struct netent *
-PerlSockGetnetbyname(struct IPerlSock*, const char *name)
-{
- return win32_getnetbyname((char*)name);
-}
-
-struct netent *
-PerlSockGetnetent(struct IPerlSock*)
-{
- return win32_getnetent();
-}
-
-int PerlSockGetpeername(struct IPerlSock*, SOCKET s, struct sockaddr* name, int* namelen)
-{
- return win32_getpeername(s, name, namelen);
-}
-
-struct protoent*
-PerlSockGetprotobyname(struct IPerlSock*, const char* name)
-{
- return win32_getprotobyname(name);
-}
-
-struct protoent*
-PerlSockGetprotobynumber(struct IPerlSock*, int number)
-{
- return win32_getprotobynumber(number);
-}
-
-struct protoent*
-PerlSockGetprotoent(struct IPerlSock*)
-{
- return win32_getprotoent();
-}
-
-struct servent*
-PerlSockGetservbyname(struct IPerlSock*, const char* name, const char* proto)
-{
- return win32_getservbyname(name, proto);
-}
-
-struct servent*
-PerlSockGetservbyport(struct IPerlSock*, int port, const char* proto)
-{
- return win32_getservbyport(port, proto);
-}
-
-struct servent*
-PerlSockGetservent(struct IPerlSock*)
-{
- return win32_getservent();
-}
-
-int
-PerlSockGetsockname(struct IPerlSock*, SOCKET s, struct sockaddr* name, int* namelen)
-{
- return win32_getsockname(s, name, namelen);
-}
-
-int
-PerlSockGetsockopt(struct IPerlSock*, SOCKET s, int level, int optname, char* optval, int* optlen)
-{
- return win32_getsockopt(s, level, optname, optval, optlen);
-}
-
-unsigned long
-PerlSockInetAddr(struct IPerlSock*, const char* cp)
-{
- return win32_inet_addr(cp);
-}
-
-char*
-PerlSockInetNtoa(struct IPerlSock*, struct in_addr in)
-{
- return win32_inet_ntoa(in);
-}
-
-int
-PerlSockListen(struct IPerlSock*, SOCKET s, int backlog)
-{
- return win32_listen(s, backlog);
-}
-
-int
-PerlSockRecv(struct IPerlSock*, SOCKET s, char* buffer, int len, int flags)
-{
- return win32_recv(s, buffer, len, flags);
-}
-
-int
-PerlSockRecvfrom(struct IPerlSock*, SOCKET s, char* buffer, int len, int flags, struct sockaddr* from, int* fromlen)
-{
- return win32_recvfrom(s, buffer, len, flags, from, fromlen);
-}
-
-int
-PerlSockSelect(struct IPerlSock*, int nfds, char* readfds, char* writefds, char* exceptfds, const struct timeval* timeout)
-{
- return win32_select(nfds, (Perl_fd_set*)readfds, (Perl_fd_set*)writefds, (Perl_fd_set*)exceptfds, timeout);
-}
-
-int
-PerlSockSend(struct IPerlSock*, SOCKET s, const char* buffer, int len, int flags)
-{
- return win32_send(s, buffer, len, flags);
-}
-
-int
-PerlSockSendto(struct IPerlSock*, SOCKET s, const char* buffer, int len, int flags, const struct sockaddr* to, int tolen)
-{
- return win32_sendto(s, buffer, len, flags, to, tolen);
-}
-
-void
-PerlSockSethostent(struct IPerlSock*, int stayopen)
-{
- win32_sethostent(stayopen);
-}
-
-void
-PerlSockSetnetent(struct IPerlSock*, int stayopen)
-{
- win32_setnetent(stayopen);
-}
-
-void
-PerlSockSetprotoent(struct IPerlSock*, int stayopen)
-{
- win32_setprotoent(stayopen);
-}
-
-void
-PerlSockSetservent(struct IPerlSock*, int stayopen)
-{
- win32_setservent(stayopen);
-}
-
-int
-PerlSockSetsockopt(struct IPerlSock*, SOCKET s, int level, int optname, const char* optval, int optlen)
-{
- return win32_setsockopt(s, level, optname, optval, optlen);
-}
-
-int
-PerlSockShutdown(struct IPerlSock*, SOCKET s, int how)
-{
- return win32_shutdown(s, how);
-}
-
-SOCKET
-PerlSockSocket(struct IPerlSock*, int af, int type, int protocol)
-{
- return win32_socket(af, type, protocol);
-}
-
-int
-PerlSockSocketpair(struct IPerlSock*, int domain, int type, int protocol, int* fds)
-{
- dTHXo;
- croak("socketpair not implemented!\n");
- return 0;
-}
-
-int
-PerlSockClosesocket(struct IPerlSock*, SOCKET s)
-{
- return win32_closesocket(s);
-}
+#ifdef PERL_IMPLICIT_SYS
+#include "win32iop.h"
+#include <fcntl.h>
+#endif /* PERL_IMPLICIT_SYS */
-int
-PerlSockIoctlsocket(struct IPerlSock*, SOCKET s, long cmd, u_long *argp)
-{
- return win32_ioctlsocket(s, cmd, argp);
-}
-struct IPerlSock perlSock =
-{
- PerlSockHtonl,
- PerlSockHtons,
- PerlSockNtohl,
- PerlSockNtohs,
- PerlSockAccept,
- PerlSockBind,
- PerlSockConnect,
- PerlSockEndhostent,
- PerlSockEndnetent,
- PerlSockEndprotoent,
- PerlSockEndservent,
- PerlSockGethostname,
- PerlSockGetpeername,
- PerlSockGethostbyaddr,
- PerlSockGethostbyname,
- PerlSockGethostent,
- PerlSockGetnetbyaddr,
- PerlSockGetnetbyname,
- PerlSockGetnetent,
- PerlSockGetprotobyname,
- PerlSockGetprotobynumber,
- PerlSockGetprotoent,
- PerlSockGetservbyname,
- PerlSockGetservbyport,
- PerlSockGetservent,
- PerlSockGetsockname,
- PerlSockGetsockopt,
- PerlSockInetAddr,
- PerlSockInetNtoa,
- PerlSockListen,
- PerlSockRecv,
- PerlSockRecvfrom,
- PerlSockSelect,
- PerlSockSend,
- PerlSockSendto,
- PerlSockSethostent,
- PerlSockSetnetent,
- PerlSockSetprotoent,
- PerlSockSetservent,
- PerlSockSetsockopt,
- PerlSockShutdown,
- PerlSockSocket,
- PerlSockSocketpair,
- PerlSockClosesocket,
+/* Register any extra external extensions */
+char *staticlinkmodules[] = {
+ "DynaLoader",
+ NULL,
};
+EXTERN_C void boot_DynaLoader (pTHXo_ CV* cv);
-// IPerlProc
-
-#define EXECF_EXEC 1
-#define EXECF_SPAWN 2
-
-extern char * g_getlogin(void);
-extern int do_spawn2(char *cmd, int exectype);
-extern int g_do_aspawn(void *vreally, void **vmark, void **vsp);
-
-void
-PerlProcAbort(struct IPerlProc*)
-{
- win32_abort();
-}
-
-char *
-PerlProcCrypt(struct IPerlProc*, const char* clear, const char* salt)
-{
- return win32_crypt(clear, salt);
-}
-
-void
-PerlProcExit(struct IPerlProc*, int status)
-{
- exit(status);
-}
-
-void
-PerlProc_Exit(struct IPerlProc*, int status)
-{
- _exit(status);
-}
-
-int
-PerlProcExecl(struct IPerlProc*, const char *cmdname, const char *arg0, const char *arg1, const char *arg2, const char *arg3)
-{
- return execl(cmdname, arg0, arg1, arg2, arg3);
-}
-
-int
-PerlProcExecv(struct IPerlProc*, const char *cmdname, const char *const *argv)
-{
- return win32_execvp(cmdname, argv);
-}
-
-int
-PerlProcExecvp(struct IPerlProc*, const char *cmdname, const char *const *argv)
-{
- return win32_execvp(cmdname, argv);
-}
-
-uid_t
-PerlProcGetuid(struct IPerlProc*)
-{
- return getuid();
-}
-
-uid_t
-PerlProcGeteuid(struct IPerlProc*)
-{
- return geteuid();
-}
-
-gid_t
-PerlProcGetgid(struct IPerlProc*)
-{
- return getgid();
-}
-
-gid_t
-PerlProcGetegid(struct IPerlProc*)
-{
- return getegid();
-}
-
-char *
-PerlProcGetlogin(struct IPerlProc*)
-{
- return g_getlogin();
-}
-
-int
-PerlProcKill(struct IPerlProc*, int pid, int sig)
-{
- return win32_kill(pid, sig);
-}
-
-int
-PerlProcKillpg(struct IPerlProc*, int pid, int sig)
-{
- dTHXo;
- croak("killpg not implemented!\n");
- return 0;
-}
-
-int
-PerlProcPauseProc(struct IPerlProc*)
-{
- return win32_sleep((32767L << 16) + 32767);
-}
-
-PerlIO*
-PerlProcPopen(struct IPerlProc*, const char *command, const char *mode)
-{
- win32_fflush(stdout);
- win32_fflush(stderr);
- return (PerlIO*)win32_popen(command, mode);
-}
-
-int
-PerlProcPclose(struct IPerlProc*, PerlIO *stream)
-{
- return win32_pclose((FILE*)stream);
-}
-
-int
-PerlProcPipe(struct IPerlProc*, int *phandles)
-{
- return win32_pipe(phandles, 512, O_BINARY);
-}
-
-int
-PerlProcSetuid(struct IPerlProc*, uid_t u)
-{
- return setuid(u);
-}
-
-int
-PerlProcSetgid(struct IPerlProc*, gid_t g)
-{
- return setgid(g);
-}
-
-int
-PerlProcSleep(struct IPerlProc*, unsigned int s)
-{
- return win32_sleep(s);
-}
-
-int
-PerlProcTimes(struct IPerlProc*, struct tms *timebuf)
-{
- return win32_times(timebuf);
-}
-
-int
-PerlProcWait(struct IPerlProc*, int *status)
-{
- return win32_wait(status);
-}
-
-int
-PerlProcWaitpid(struct IPerlProc*, int pid, int *status, int flags)
-{
- return win32_waitpid(pid, status, flags);
-}
-
-Sighandler_t
-PerlProcSignal(struct IPerlProc*, int sig, Sighandler_t subcode)
-{
- return 0;
-}
-
-void*
-PerlProcDynaLoader(struct IPerlProc*, const char* filename)
-{
- return win32_dynaload(filename);
-}
-
-void
-PerlProcGetOSError(struct IPerlProc*, SV* sv, DWORD dwErr)
-{
- win32_str_os_error(aTHX_ sv, dwErr);
-}
-
-BOOL
-PerlProcDoCmd(struct IPerlProc*, char *cmd)
-{
- do_spawn2(cmd, EXECF_EXEC);
- return FALSE;
-}
-
-int
-PerlProcSpawn(struct IPerlProc*, char* cmds)
-{
- return do_spawn2(cmds, EXECF_SPAWN);
-}
-
-int
-PerlProcSpawnvp(struct IPerlProc*, int mode, const char *cmdname, const char *const *argv)
-{
- return win32_spawnvp(mode, cmdname, argv);
-}
-
-int
-PerlProcASpawn(struct IPerlProc*, void *vreally, void **vmark, void **vsp)
+static void
+xs_init(pTHXo)
{
- return g_do_aspawn(vreally, vmark, vsp);
+ char *file = __FILE__;
+ dXSUB_SYS;
+ newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
}
-struct IPerlProc perlProc =
-{
- PerlProcAbort,
- PerlProcCrypt,
- PerlProcExit,
- PerlProc_Exit,
- PerlProcExecl,
- PerlProcExecv,
- PerlProcExecvp,
- PerlProcGetuid,
- PerlProcGeteuid,
- PerlProcGetgid,
- PerlProcGetegid,
- PerlProcGetlogin,
- PerlProcKill,
- PerlProcKillpg,
- PerlProcPauseProc,
- PerlProcPopen,
- PerlProcPclose,
- PerlProcPipe,
- PerlProcSetuid,
- PerlProcSetgid,
- PerlProcSleep,
- PerlProcTimes,
- PerlProcWait,
- PerlProcWaitpid,
- PerlProcSignal,
- PerlProcDynaLoader,
- PerlProcGetOSError,
- PerlProcDoCmd,
- PerlProcSpawn,
- PerlProcSpawnvp,
- PerlProcASpawn,
-};
-
-//#include "perlhost.h"
+#ifdef PERL_IMPLICIT_SYS
+#include "perlhost.h"
-EXTERN_C void perl_get_host_info(IPerlMemInfo* perlMemInfo,
- IPerlEnvInfo* perlEnvInfo, IPerlStdIOInfo* perlStdIOInfo,
- IPerlLIOInfo* perlLIOInfo, IPerlDirInfo* perlDirInfo,
- IPerlSockInfo* perlSockInfo, IPerlProcInfo* perlProcInfo)
+EXTERN_C void
+perl_get_host_info(struct IPerlMemInfo* perlMemInfo,
+ struct IPerlMemInfo* perlMemSharedInfo,
+ struct IPerlMemInfo* perlMemParseInfo,
+ struct IPerlEnvInfo* perlEnvInfo,
+ struct IPerlStdIOInfo* perlStdIOInfo,
+ struct IPerlLIOInfo* perlLIOInfo,
+ struct IPerlDirInfo* perlDirInfo,
+ struct IPerlSockInfo* perlSockInfo,
+ struct IPerlProcInfo* perlProcInfo)
{
- if(perlMemInfo) {
+ if (perlMemInfo) {
Copy(&perlMem, &perlMemInfo->perlMemList, perlMemInfo->nCount, void*);
perlMemInfo->nCount = (sizeof(struct IPerlMem)/sizeof(void*));
}
- if(perlEnvInfo) {
+ if (perlMemSharedInfo) {
+ Copy(&perlMem, &perlMemSharedInfo->perlMemList, perlMemSharedInfo->nCount, void*);
+ perlMemSharedInfo->nCount = (sizeof(struct IPerlMem)/sizeof(void*));
+ }
+ if (perlMemParseInfo) {
+ Copy(&perlMem, &perlMemParseInfo->perlMemList, perlMemParseInfo->nCount, void*);
+ perlMemParseInfo->nCount = (sizeof(struct IPerlMem)/sizeof(void*));
+ }
+ if (perlEnvInfo) {
Copy(&perlEnv, &perlEnvInfo->perlEnvList, perlEnvInfo->nCount, void*);
perlEnvInfo->nCount = (sizeof(struct IPerlEnv)/sizeof(void*));
}
- if(perlStdIOInfo) {
+ if (perlStdIOInfo) {
Copy(&perlStdIO, &perlStdIOInfo->perlStdIOList, perlStdIOInfo->nCount, void*);
perlStdIOInfo->nCount = (sizeof(struct IPerlStdIO)/sizeof(void*));
}
- if(perlLIOInfo) {
+ if (perlLIOInfo) {
Copy(&perlLIO, &perlLIOInfo->perlLIOList, perlLIOInfo->nCount, void*);
perlLIOInfo->nCount = (sizeof(struct IPerlLIO)/sizeof(void*));
}
- if(perlDirInfo) {
+ if (perlDirInfo) {
Copy(&perlDir, &perlDirInfo->perlDirList, perlDirInfo->nCount, void*);
perlDirInfo->nCount = (sizeof(struct IPerlDir)/sizeof(void*));
}
- if(perlSockInfo) {
+ if (perlSockInfo) {
Copy(&perlSock, &perlSockInfo->perlSockList, perlSockInfo->nCount, void*);
perlSockInfo->nCount = (sizeof(struct IPerlSock)/sizeof(void*));
}
- if(perlProcInfo) {
+ if (perlProcInfo) {
Copy(&perlProc, &perlProcInfo->perlProcList, perlProcInfo->nCount, void*);
perlProcInfo->nCount = (sizeof(struct IPerlProc)/sizeof(void*));
}
}
-EXTERN_C PerlInterpreter* perl_alloc_using(IPerlMem* pMem,
- IPerlEnv* pEnv, IPerlStdIO* pStdIO,
- IPerlLIO* pLIO, IPerlDir* pDir,
- IPerlSock* pSock, IPerlProc* pProc)
+#ifdef PERL_OBJECT
+
+EXTERN_C PerlInterpreter*
+perl_alloc_override(struct IPerlMem** ppMem, struct IPerlMem** ppMemShared,
+ struct IPerlMem** ppMemParse, struct IPerlEnv** ppEnv,
+ struct IPerlStdIO** ppStdIO, struct IPerlLIO** ppLIO,
+ struct IPerlDir** ppDir, struct IPerlSock** ppSock,
+ struct IPerlProc** ppProc)
{
- CPerlObj* pPerl = NULL;
+ PerlInterpreter *my_perl = NULL;
try
{
- pPerl = Perl_alloc(pMem, pEnv, pStdIO, pLIO, pDir, pSock, pProc);
+ CPerlHost* pHost = new CPerlHost(ppMem, ppMemShared, ppMemParse, ppEnv,
+ ppStdIO, ppLIO, ppDir, ppSock, ppProc);
+
+ if (pHost) {
+ my_perl = perl_alloc_using(pHost->m_pHostperlMem,
+ pHost->m_pHostperlMemShared,
+ pHost->m_pHostperlMemParse,
+ pHost->m_pHostperlEnv,
+ pHost->m_pHostperlStdIO,
+ pHost->m_pHostperlLIO,
+ pHost->m_pHostperlDir,
+ pHost->m_pHostperlSock,
+ pHost->m_pHostperlProc);
+ if (my_perl) {
+ CPerlObj* pPerl = (CPerlObj*)my_perl;
+ w32_internal_host = pHost;
+ }
+ }
}
catch(...)
{
win32_fprintf(stderr, "%s\n", "Error: Unable to allocate memory");
- pPerl = NULL;
- }
- if(pPerl)
- {
- SetPerlInterpreter(pPerl);
- return (PerlInterpreter*)pPerl;
+ my_perl = NULL;
}
- SetPerlInterpreter(NULL);
- return NULL;
+
+ return my_perl;
}
-#undef perl_alloc
-#undef perl_construct
-#undef perl_destruct
-#undef perl_free
-#undef perl_run
-#undef perl_parse
-EXTERN_C PerlInterpreter* perl_alloc(void)
+EXTERN_C PerlInterpreter*
+perl_alloc(void)
{
- CPerlObj* pPerl = NULL;
+ PerlInterpreter* my_perl = NULL;
try
{
- pPerl = Perl_alloc(&perlMem, &perlEnv, &perlStdIO, &perlLIO,
- &perlDir, &perlSock, &perlProc);
+ CPerlHost* pHost = new CPerlHost();
+ if (pHost) {
+ my_perl = perl_alloc_using(pHost->m_pHostperlMem,
+ pHost->m_pHostperlMemShared,
+ pHost->m_pHostperlMemParse,
+ pHost->m_pHostperlEnv,
+ pHost->m_pHostperlStdIO,
+ pHost->m_pHostperlLIO,
+ pHost->m_pHostperlDir,
+ pHost->m_pHostperlSock,
+ pHost->m_pHostperlProc);
+ if (my_perl) {
+ CPerlObj* pPerl = (CPerlObj*)my_perl;
+ w32_internal_host = pHost;
+ }
+ }
}
catch(...)
{
win32_fprintf(stderr, "%s\n", "Error: Unable to allocate memory");
- pPerl = NULL;
+ my_perl = NULL;
}
- if(pPerl)
- {
- SetPerlInterpreter(pPerl);
- return (PerlInterpreter*)pPerl;
- }
- SetPerlInterpreter(NULL);
- return NULL;
+
+ return my_perl;
}
-EXTERN_C void perl_construct(PerlInterpreter* sv_interp)
+EXTERN_C void
+perl_construct(PerlInterpreter* my_perl)
{
- CPerlObj* pPerl = (CPerlObj*)sv_interp;
+ CPerlObj* pPerl = (CPerlObj*)my_perl;
try
{
- pPerl->perl_construct();
+ Perl_construct();
}
catch(...)
{
win32_fprintf(stderr, "%s\n",
"Error: Unable to construct data structures");
- pPerl->perl_free();
+ CPerlHost* pHost = (CPerlHost*)w32_internal_host;
+ Perl_free();
+ delete pHost;
SetPerlInterpreter(NULL);
}
}
-EXTERN_C void perl_destruct(PerlInterpreter* sv_interp)
+EXTERN_C void
+perl_destruct(PerlInterpreter* my_perl)
{
- CPerlObj* pPerl = (CPerlObj*)sv_interp;
+ CPerlObj* pPerl = (CPerlObj*)my_perl;
+#ifdef DEBUGGING
+ Perl_destruct();
+#else
try
{
- pPerl->perl_destruct();
+ Perl_destruct();
}
catch(...)
{
}
+#endif
}
-EXTERN_C void perl_free(PerlInterpreter* sv_interp)
+EXTERN_C void
+perl_free(PerlInterpreter* my_perl)
{
- CPerlObj* pPerl = (CPerlObj*)sv_interp;
+ CPerlObj* pPerl = (CPerlObj*)my_perl;
+#ifdef DEBUGGING
+ CPerlHost* pHost = (CPerlHost*)w32_internal_host;
+ Perl_free();
+ delete pHost;
+#else
try
{
- pPerl->perl_free();
+ CPerlHost* pHost = (CPerlHost*)w32_internal_host;
+ Perl_free();
+ delete pHost;
}
catch(...)
{
}
+#endif
SetPerlInterpreter(NULL);
}
-EXTERN_C int perl_run(PerlInterpreter* sv_interp)
+EXTERN_C int
+perl_run(PerlInterpreter* my_perl)
{
- CPerlObj* pPerl = (CPerlObj*)sv_interp;
+ CPerlObj* pPerl = (CPerlObj*)my_perl;
+#ifdef DEBUGGING
+ return Perl_run();
+#else
int retVal;
try
{
- retVal = pPerl->perl_run();
- }
-/*
- catch(int x)
- {
- // this is where exit() should arrive
- retVal = x;
+ retVal = Perl_run();
}
-*/
catch(...)
{
win32_fprintf(stderr, "Error: Runtime exception\n");
retVal = -1;
}
return retVal;
+#endif
}
-EXTERN_C int perl_parse(PerlInterpreter* sv_interp, void (*xsinit)(CPerlObj*), int argc, char** argv, char** env)
+EXTERN_C int
+perl_parse(PerlInterpreter* my_perl, void (*xsinit)(CPerlObj*), int argc, char** argv, char** env)
{
int retVal;
- CPerlObj* pPerl = (CPerlObj*)sv_interp;
+ CPerlObj* pPerl = (CPerlObj*)my_perl;
+#ifdef DEBUGGING
+ retVal = Perl_parse(xsinit, argc, argv, env);
+#else
try
{
- retVal = pPerl->perl_parse(xsinit, argc, argv, env);
- }
-/*
- catch(int x)
- {
- // this is where exit() should arrive
- retVal = x;
+ retVal = Perl_parse(xsinit, argc, argv, env);
}
-*/
catch(...)
{
win32_fprintf(stderr, "Error: Parse exception\n");
retVal = -1;
}
+#endif
*win32_errno() = 0;
return retVal;
}
#undef PL_perl_destruct_level
#define PL_perl_destruct_level int dummy
+
+#else /* !PERL_OBJECT */
+
+EXTERN_C PerlInterpreter*
+perl_alloc(void)
+{
+ PerlInterpreter *my_perl = NULL;
+ CPerlHost* pHost = new CPerlHost();
+ if (pHost) {
+ my_perl = perl_alloc_using(pHost->m_pHostperlMem,
+ pHost->m_pHostperlMemShared,
+ pHost->m_pHostperlMemParse,
+ pHost->m_pHostperlEnv,
+ pHost->m_pHostperlStdIO,
+ pHost->m_pHostperlLIO,
+ pHost->m_pHostperlDir,
+ pHost->m_pHostperlSock,
+ pHost->m_pHostperlProc);
+ if (my_perl) {
+ w32_internal_host = pHost;
+ }
+ }
+ return my_perl;
+}
+
#endif /* PERL_OBJECT */
+#endif /* PERL_IMPLICIT_SYS */
+
+EXTERN_C HANDLE w32_perldll_handle;
-extern HANDLE w32_perldll_handle;
static DWORD g_TlsAllocIndex;
EXTERN_C DllExport bool
RunPerl(int argc, char **argv, char **env)
{
int exitstatus;
- PerlInterpreter *my_perl;
+ PerlInterpreter *my_perl, *new_perl = NULL;
struct perl_thread *thr;
#ifndef __BORLANDC__
perl_construct( my_perl );
PL_perl_destruct_level = 0;
-#ifdef PERL_OBJECT
- /* PERL_OBJECT build sets Dynaloader in PerlStdIOInitOSExtras */
- exitstatus = perl_parse(my_perl, NULL, argc, argv, env);
-#else
exitstatus = perl_parse(my_perl, xs_init, argc, argv, env);
-#endif
if (!exitstatus) {
+#if defined(TOP_CLONE) && defined(USE_ITHREADS) /* XXXXXX testing */
+# ifdef PERL_OBJECT
+ CPerlHost *h = new CPerlHost();
+ new_perl = perl_clone_using(my_perl, 1,
+ h->m_pHostperlMem,
+ h->m_pHostperlMemShared,
+ h->m_pHostperlMemParse,
+ h->m_pHostperlEnv,
+ h->m_pHostperlStdIO,
+ h->m_pHostperlLIO,
+ h->m_pHostperlDir,
+ h->m_pHostperlSock,
+ h->m_pHostperlProc
+ );
+ CPerlObj *pPerl = (CPerlObj*)new_perl;
+# else
+ new_perl = perl_clone(my_perl, 1);
+# endif
+ exitstatus = perl_run( new_perl );
+ SetPerlInterpreter(my_perl);
+#else
exitstatus = perl_run( my_perl );
+#endif
}
perl_destruct( my_perl );
perl_free( my_perl );
+#ifdef USE_ITHREADS
+ if (new_perl) {
+ SetPerlInterpreter(new_perl);
+ perl_destruct(new_perl);
+ perl_free(new_perl);
+ }
+#endif
PERL_SYS_TERM();
_fmode = O_BINARY;
#endif
g_TlsAllocIndex = TlsAlloc();
- DisableThreadLibraryCalls(hModule);
+ DisableThreadLibraryCalls((HMODULE)hModule);
w32_perldll_handle = hModule;
break;
}
return TRUE;
}
-
#include "perl.h"
#ifdef __GNUC__
-/*
- * GNU C does not do __declspec()
- */
-#define __declspec(foo)
/* Mingw32 defaults to globing command line
* This is inconsistent with other Win32 ports and
--- /dev/null
+/* vdir.h
+ *
+ * (c) 1999 Microsoft Corporation. All rights reserved.
+ * Portions (c) 1999 ActiveState Tool Corp, http://www.ActiveState.com/
+ *
+ * You may distribute under the terms of either the GNU General Public
+ * License or the Artistic License, as specified in the README file.
+ */
+
+#ifndef ___VDir_H___
+#define ___VDir_H___
+
+const int driveCount = 30;
+
+class VDir
+{
+public:
+ VDir(int bManageDir = 1);
+ ~VDir() {};
+
+ void Init(VDir* pDir, VMem *pMem);
+ void SetDefaultA(char const *pDefault);
+ void SetDefaultW(WCHAR const *pDefault);
+ char* MapPathA(const char *pInName);
+ WCHAR* MapPathW(const WCHAR *pInName);
+ int SetCurrentDirectoryA(char *lpBuffer);
+ int SetCurrentDirectoryW(WCHAR *lpBuffer);
+ inline const char *GetDirA(int index)
+ {
+ return dirTableA[index];
+ };
+ inline const WCHAR *GetDirW(int index)
+ {
+ return dirTableW[index];
+ };
+ inline int GetDefault(void) { return nDefault; };
+
+ inline char* GetCurrentDirectoryA(int dwBufSize, char *lpBuffer)
+ {
+ char* ptr = dirTableA[nDefault];
+ while (dwBufSize--)
+ {
+ if ((*lpBuffer++ = *ptr++) == '\0')
+ break;
+ }
+ return lpBuffer;
+ };
+ inline WCHAR* GetCurrentDirectoryW(int dwBufSize, WCHAR *lpBuffer)
+ {
+ WCHAR* ptr = dirTableW[nDefault];
+ while (dwBufSize--)
+ {
+ if ((*lpBuffer++ = *ptr++) == '\0')
+ break;
+ }
+ return lpBuffer;
+ };
+
+
+ DWORD CalculateEnvironmentSpace(void);
+ LPSTR BuildEnvironmentSpace(LPSTR lpStr);
+
+protected:
+ int SetDirA(char const *pPath, int index);
+ void FromEnvA(char *pEnv, int index);
+ inline const char *GetDefaultDirA(void)
+ {
+ return dirTableA[nDefault];
+ };
+
+ inline void SetDefaultDirA(char const *pPath, int index)
+ {
+ SetDirA(pPath, index);
+ nDefault = index;
+ };
+ int SetDirW(WCHAR const *pPath, int index);
+ inline const WCHAR *GetDefaultDirW(void)
+ {
+ return dirTableW[nDefault];
+ };
+
+ inline void SetDefaultDirW(WCHAR const *pPath, int index)
+ {
+ SetDirW(pPath, index);
+ nDefault = index;
+ };
+
+ inline int DriveIndex(char chr)
+ {
+ return (chr | 0x20)-'a';
+ };
+
+ VMem *pMem;
+ int nDefault, bManageDirectory;
+ char *dirTableA[driveCount];
+ char szLocalBufferA[MAX_PATH+1];
+ WCHAR *dirTableW[driveCount];
+ WCHAR szLocalBufferW[MAX_PATH+1];
+};
+
+
+VDir::VDir(int bManageDir /* = 1 */)
+{
+ nDefault = 0;
+ bManageDirectory = bManageDir;
+ memset(dirTableA, 0, sizeof(dirTableA));
+ memset(dirTableW, 0, sizeof(dirTableW));
+}
+
+void VDir::Init(VDir* pDir, VMem *p)
+{
+ int index;
+ DWORD driveBits;
+ int nSave;
+ char szBuffer[MAX_PATH*driveCount];
+
+ pMem = p;
+ if (pDir) {
+ for (index = 0; index < driveCount; ++index) {
+ SetDirW(pDir->GetDirW(index), index);
+ }
+ nDefault = pDir->GetDefault();
+ }
+ else {
+ nSave = bManageDirectory;
+ bManageDirectory = 0;
+ driveBits = GetLogicalDrives();
+ if (GetLogicalDriveStrings(sizeof(szBuffer), szBuffer)) {
+ char* pEnv = GetEnvironmentStrings();
+ char* ptr = szBuffer;
+ for (index = 0; index < driveCount; ++index) {
+ if (driveBits & (1<<index)) {
+ ptr += SetDirA(ptr, index) + 1;
+ FromEnvA(pEnv, index);
+ }
+ }
+ FreeEnvironmentStrings(pEnv);
+ }
+ SetDefaultA(".");
+ bManageDirectory = nSave;
+ }
+}
+
+int VDir::SetDirA(char const *pPath, int index)
+{
+ char chr, *ptr;
+ int length = 0;
+ WCHAR wBuffer[MAX_PATH+1];
+ if (index < driveCount && pPath != NULL) {
+ length = strlen(pPath);
+ pMem->Free(dirTableA[index]);
+ ptr = dirTableA[index] = (char*)pMem->Malloc(length+2);
+ if (ptr != NULL) {
+ strcpy(ptr, pPath);
+ ptr += length-1;
+ chr = *ptr++;
+ if (chr != '\\' && chr != '/') {
+ *ptr++ = '\\';
+ *ptr = '\0';
+ }
+ MultiByteToWideChar(CP_ACP, 0, dirTableA[index], -1,
+ wBuffer, (sizeof(wBuffer)/sizeof(WCHAR)));
+ length = wcslen(wBuffer);
+ pMem->Free(dirTableW[index]);
+ dirTableW[index] = (WCHAR*)pMem->Malloc((length+1)*2);
+ if (dirTableW[index] != NULL) {
+ wcscpy(dirTableW[index], wBuffer);
+ }
+ }
+ }
+
+ if(bManageDirectory)
+ ::SetCurrentDirectoryA(pPath);
+
+ return length;
+}
+
+void VDir::FromEnvA(char *pEnv, int index)
+{ /* gets the directory for index from the environment variable. */
+ while (*pEnv != '\0') {
+ if ((pEnv[0] == '=') && (DriveIndex(pEnv[1]) == index)) {
+ SetDirA(&pEnv[4], index);
+ break;
+ }
+ else
+ pEnv += strlen(pEnv)+1;
+ }
+}
+
+void VDir::SetDefaultA(char const *pDefault)
+{
+ char szBuffer[MAX_PATH+1];
+ char *pPtr;
+
+ if (GetFullPathNameA(pDefault, sizeof(szBuffer), szBuffer, &pPtr)) {
+ if (*pDefault != '.' && pPtr != NULL)
+ *pPtr = '\0';
+
+ SetDefaultDirA(szBuffer, DriveIndex(szBuffer[0]));
+ }
+}
+
+int VDir::SetDirW(WCHAR const *pPath, int index)
+{
+ WCHAR chr, *ptr;
+ char szBuffer[MAX_PATH+1];
+ int length = 0;
+ if (index < driveCount && pPath != NULL) {
+ length = wcslen(pPath);
+ pMem->Free(dirTableW[index]);
+ ptr = dirTableW[index] = (WCHAR*)pMem->Malloc((length+2)*2);
+ if (ptr != NULL) {
+ wcscpy(ptr, pPath);
+ ptr += length-1;
+ chr = *ptr++;
+ if (chr != '\\' && chr != '/') {
+ *ptr++ = '\\';
+ *ptr = '\0';
+ }
+ WideCharToMultiByte(CP_ACP, 0, dirTableW[index], -1, szBuffer, sizeof(szBuffer), NULL, NULL);
+ length = strlen(szBuffer);
+ pMem->Free(dirTableA[index]);
+ dirTableA[index] = (char*)pMem->Malloc(length+1);
+ if (dirTableA[index] != NULL) {
+ strcpy(dirTableA[index], szBuffer);
+ }
+ }
+ }
+
+ if(bManageDirectory)
+ ::SetCurrentDirectoryW(pPath);
+
+ return length;
+}
+
+void VDir::SetDefaultW(WCHAR const *pDefault)
+{
+ WCHAR szBuffer[MAX_PATH+1];
+ WCHAR *pPtr;
+
+ if (GetFullPathNameW(pDefault, (sizeof(szBuffer)/sizeof(WCHAR)), szBuffer, &pPtr)) {
+ if (*pDefault != '.' && pPtr != NULL)
+ *pPtr = '\0';
+
+ SetDefaultDirW(szBuffer, DriveIndex((char)szBuffer[0]));
+ }
+}
+
+inline BOOL IsPathSep(char ch)
+{
+ return (ch == '\\' || ch == '/');
+}
+
+inline void DoGetFullPathNameA(char* lpBuffer, DWORD dwSize, char* Dest)
+{
+ char *pPtr;
+
+ /*
+ * On WinNT GetFullPathName does not fail, (or at least always
+ * succeeds when the drive is valid) WinNT does set *Dest to Nullch
+ * On Win98 GetFullPathName will set last error if it fails, but
+ * does not touch *Dest
+ */
+ *Dest = '\0';
+ GetFullPathNameA(lpBuffer, dwSize, Dest, &pPtr);
+}
+
+char *VDir::MapPathA(const char *pInName)
+{ /*
+ * possiblities -- relative path or absolute path with or without drive letter
+ * OR UNC name
+ */
+ char szBuffer[(MAX_PATH+1)*2];
+ char szlBuf[MAX_PATH+1];
+
+ if (strlen(pInName) > MAX_PATH) {
+ strncpy(szlBuf, pInName, MAX_PATH);
+ if (IsPathSep(pInName[0]) && !IsPathSep(pInName[1])) {
+ /* absolute path - reduce length by 2 for drive specifier */
+ szlBuf[MAX_PATH-2] = '\0';
+ }
+ else
+ szlBuf[MAX_PATH] = '\0';
+ pInName = szlBuf;
+ }
+ /* strlen(pInName) is now <= MAX_PATH */
+
+ if (pInName[1] == ':') {
+ /* has drive letter */
+ if (IsPathSep(pInName[2])) {
+ /* absolute with drive letter */
+ strcpy(szLocalBufferA, pInName);
+ }
+ else {
+ /* relative path with drive letter */
+ strcpy(szBuffer, GetDirA(DriveIndex(*pInName)));
+ strcat(szBuffer, &pInName[2]);
+ if(strlen(szBuffer) > MAX_PATH)
+ szBuffer[MAX_PATH] = '\0';
+
+ DoGetFullPathNameA(szBuffer, sizeof(szLocalBufferA), szLocalBufferA);
+ }
+ }
+ else {
+ /* no drive letter */
+ if (IsPathSep(pInName[1]) && IsPathSep(pInName[0])) {
+ /* UNC name */
+ strcpy(szLocalBufferA, pInName);
+ }
+ else {
+ strcpy(szBuffer, GetDefaultDirA());
+ if (IsPathSep(pInName[0])) {
+ /* absolute path */
+ szLocalBufferA[0] = szBuffer[0];
+ szLocalBufferA[1] = szBuffer[1];
+ strcpy(&szLocalBufferA[2], pInName);
+ }
+ else {
+ /* relative path */
+ strcat(szBuffer, pInName);
+ if (strlen(szBuffer) > MAX_PATH)
+ szBuffer[MAX_PATH] = '\0';
+
+ DoGetFullPathNameA(szBuffer, sizeof(szLocalBufferA), szLocalBufferA);
+ }
+ }
+ }
+
+ return szLocalBufferA;
+}
+
+int VDir::SetCurrentDirectoryA(char *lpBuffer)
+{
+ HANDLE hHandle;
+ WIN32_FIND_DATA win32FD;
+ char szBuffer[MAX_PATH+1], *pPtr;
+ int length, nRet = -1;
+
+ GetFullPathNameA(MapPathA(lpBuffer), sizeof(szBuffer), szBuffer, &pPtr);
+ /* if the last char is a '\\' or a '/' then add
+ * an '*' before calling FindFirstFile
+ */
+ length = strlen(szBuffer);
+ if(length > 0 && IsPathSep(szBuffer[length-1])) {
+ szBuffer[length] = '*';
+ szBuffer[length+1] = '\0';
+ }
+
+ hHandle = FindFirstFileA(szBuffer, &win32FD);
+ if (hHandle != INVALID_HANDLE_VALUE) {
+ FindClose(hHandle);
+
+ /* if an '*' was added remove it */
+ if(szBuffer[length] == '*')
+ szBuffer[length] = '\0';
+
+ SetDefaultDirA(szBuffer, DriveIndex(szBuffer[0]));
+ nRet = 0;
+ }
+ return nRet;
+}
+
+DWORD VDir::CalculateEnvironmentSpace(void)
+{ /* the current directory environment strings are stored as '=d=d:\path' */
+ int index;
+ DWORD dwSize = 0;
+ for (index = 0; index < driveCount; ++index) {
+ if (dirTableA[index] != NULL) {
+ dwSize += strlen(dirTableA[index]) + 4; /* add 1 for trailing NULL and 3 for '=d=' */
+ }
+ }
+ return dwSize;
+}
+
+LPSTR VDir::BuildEnvironmentSpace(LPSTR lpStr)
+{ /* store the current directory environment strings as '=d=d:\path' */
+ int index;
+ LPSTR lpDirStr;
+ for (index = 0; index < driveCount; ++index) {
+ lpDirStr = dirTableA[index];
+ if (lpDirStr != NULL) {
+ lpStr[0] = '=';
+ lpStr[1] = lpDirStr[0];
+ lpStr[2] = '=';
+ strcpy(&lpStr[3], lpDirStr);
+ lpStr += strlen(lpDirStr) + 4; /* add 1 for trailing NULL and 3 for '=d=' */
+ }
+ }
+ return lpStr;
+}
+
+inline BOOL IsPathSep(WCHAR ch)
+{
+ return (ch == '\\' || ch == '/');
+}
+
+inline void DoGetFullPathNameW(WCHAR* lpBuffer, DWORD dwSize, WCHAR* Dest)
+{
+ WCHAR *pPtr;
+
+ /*
+ * On WinNT GetFullPathName does not fail, (or at least always
+ * succeeds when the drive is valid) WinNT does set *Dest to Nullch
+ * On Win98 GetFullPathName will set last error if it fails, but
+ * does not touch *Dest
+ */
+ *Dest = '\0';
+ GetFullPathNameW(lpBuffer, dwSize, Dest, &pPtr);
+}
+
+WCHAR* VDir::MapPathW(const WCHAR *pInName)
+{ /*
+ * possiblities -- relative path or absolute path with or without drive letter
+ * OR UNC name
+ */
+ WCHAR szBuffer[(MAX_PATH+1)*2];
+ WCHAR szlBuf[MAX_PATH+1];
+
+ if (wcslen(pInName) > MAX_PATH) {
+ wcsncpy(szlBuf, pInName, MAX_PATH);
+ if (IsPathSep(pInName[0]) && !IsPathSep(pInName[1])) {
+ /* absolute path - reduce length by 2 for drive specifier */
+ szlBuf[MAX_PATH-2] = '\0';
+ }
+ else
+ szlBuf[MAX_PATH] = '\0';
+ pInName = szlBuf;
+ }
+ /* strlen(pInName) is now <= MAX_PATH */
+
+ if (pInName[1] == ':') {
+ /* has drive letter */
+ if (IsPathSep(pInName[2])) {
+ /* absolute with drive letter */
+ wcscpy(szLocalBufferW, pInName);
+ }
+ else {
+ /* relative path with drive letter */
+ wcscpy(szBuffer, GetDirW(DriveIndex((char)*pInName)));
+ wcscat(szBuffer, &pInName[2]);
+ if(wcslen(szBuffer) > MAX_PATH)
+ szBuffer[MAX_PATH] = '\0';
+
+ DoGetFullPathNameW(szBuffer, (sizeof(szLocalBufferW)/sizeof(WCHAR)), szLocalBufferW);
+ }
+ }
+ else {
+ /* no drive letter */
+ if (IsPathSep(pInName[1]) && IsPathSep(pInName[0])) {
+ /* UNC name */
+ wcscpy(szLocalBufferW, pInName);
+ }
+ else {
+ wcscpy(szBuffer, GetDefaultDirW());
+ if (IsPathSep(pInName[0])) {
+ /* absolute path */
+ szLocalBufferW[0] = szBuffer[0];
+ szLocalBufferW[1] = szBuffer[1];
+ wcscpy(&szLocalBufferW[2], pInName);
+ }
+ else {
+ /* relative path */
+ wcscat(szBuffer, pInName);
+ if (wcslen(szBuffer) > MAX_PATH)
+ szBuffer[MAX_PATH] = '\0';
+
+ DoGetFullPathNameW(szBuffer, (sizeof(szLocalBufferW)/sizeof(WCHAR)), szLocalBufferW);
+ }
+ }
+ }
+ return szLocalBufferW;
+}
+
+int VDir::SetCurrentDirectoryW(WCHAR *lpBuffer)
+{
+ HANDLE hHandle;
+ WIN32_FIND_DATAW win32FD;
+ WCHAR szBuffer[MAX_PATH+1], *pPtr;
+ int length, nRet = -1;
+
+ GetFullPathNameW(MapPathW(lpBuffer), (sizeof(szBuffer)/sizeof(WCHAR)), szBuffer, &pPtr);
+ /* if the last char is a '\\' or a '/' then add
+ * an '*' before calling FindFirstFile
+ */
+ length = wcslen(szBuffer);
+ if(length > 0 && IsPathSep(szBuffer[length-1])) {
+ szBuffer[length] = '*';
+ szBuffer[length+1] = '\0';
+ }
+
+ hHandle = FindFirstFileW(szBuffer, &win32FD);
+ if (hHandle != INVALID_HANDLE_VALUE) {
+ FindClose(hHandle);
+
+ /* if an '*' was added remove it */
+ if(szBuffer[length] == '*')
+ szBuffer[length] = '\0';
+
+ SetDefaultDirW(szBuffer, DriveIndex((char)szBuffer[0]));
+ nRet = 0;
+ }
+ return nRet;
+}
+
+#endif /* ___VDir_H___ */
--- /dev/null
+/* vmem.h
+ *
+ * (c) 1999 Microsoft Corporation. All rights reserved.
+ * Portions (c) 1999 ActiveState Tool Corp, http://www.ActiveState.com/
+ *
+ * You may distribute under the terms of either the GNU General Public
+ * License or the Artistic License, as specified in the README file.
+ *
+ *
+ * Knuth's boundary tag algorithm Vol #1, Page 440.
+ *
+ * Each block in the heap has tag words before and after it,
+ * TAG
+ * block
+ * TAG
+ * The size is stored in these tags as a long word, and includes the 8 bytes
+ * of overhead that the boundary tags consume. Blocks are allocated on long
+ * word boundaries, so the size is always multiples of long words. When the
+ * block is allocated, bit 0, (the tag bit), of the size is set to 1. When
+ * a block is freed, it is merged with adjacent free blocks, and the tag bit
+ * is set to 0.
+ *
+ * A linked list is used to manage the free list. The first two long words of
+ * the block contain double links. These links are only valid when the block
+ * is freed, therefore space needs to be reserved for them. Thus, the minimum
+ * block size (not counting the tags) is 8 bytes.
+ *
+ * Since memory allocation may occur on a single threaded, explict locks are
+ * provided.
+ *
+ */
+
+#ifndef ___VMEM_H_INC___
+#define ___VMEM_H_INC___
+
+const long lAllocStart = 0x00010000; /* start at 64K */
+const long minBlockSize = sizeof(void*)*2;
+const long sizeofTag = sizeof(long);
+const long blockOverhead = sizeofTag*2;
+const long minAllocSize = minBlockSize+blockOverhead;
+
+typedef BYTE* PBLOCK; /* pointer to a memory block */
+
+/*
+ * Macros for accessing hidden fields in a memory block:
+ *
+ * SIZE size of this block (tag bit 0 is 1 if block is allocated)
+ * PSIZE size of previous physical block
+ */
+
+#define SIZE(block) (*(ULONG*)(((PBLOCK)(block))-sizeofTag))
+#define PSIZE(block) (*(ULONG*)(((PBLOCK)(block))-(sizeofTag*2)))
+inline void SetTags(PBLOCK block, long size)
+{
+ SIZE(block) = size;
+ PSIZE(block+(size&~1)) = size;
+}
+
+/*
+ * Free list pointers
+ * PREV pointer to previous block
+ * NEXT pointer to next block
+ */
+
+#define PREV(block) (*(PBLOCK*)(block))
+#define NEXT(block) (*(PBLOCK*)((block)+sizeof(PBLOCK)))
+inline void SetLink(PBLOCK block, PBLOCK prev, PBLOCK next)
+{
+ PREV(block) = prev;
+ NEXT(block) = next;
+}
+inline void Unlink(PBLOCK p)
+{
+ PBLOCK next = NEXT(p);
+ PBLOCK prev = PREV(p);
+ NEXT(prev) = next;
+ PREV(next) = prev;
+}
+inline void AddToFreeList(PBLOCK block, PBLOCK pInList)
+{
+ PBLOCK next = NEXT(pInList);
+ NEXT(pInList) = block;
+ SetLink(block, pInList, next);
+ PREV(next) = block;
+}
+
+
+/* Macro for rounding up to the next sizeof(long) */
+#define ROUND_UP(n) (((ULONG)(n)+sizeof(long)-1)&~(sizeof(long)-1))
+#define ROUND_UP64K(n) (((ULONG)(n)+0x10000-1)&~(0x10000-1))
+#define ROUND_DOWN(n) ((ULONG)(n)&~(sizeof(long)-1))
+
+/*
+ * HeapRec - a list of all non-contiguous heap areas
+ *
+ * Each record in this array contains information about a non-contiguous heap area.
+ */
+
+const int maxHeaps = 64;
+const long lAllocMax = 0x80000000; /* max size of allocation */
+
+typedef struct _HeapRec
+{
+ PBLOCK base; /* base of heap area */
+ ULONG len; /* size of heap area */
+} HeapRec;
+
+
+class VMem
+{
+public:
+ VMem();
+ ~VMem();
+ virtual void* Malloc(size_t size);
+ virtual void* Realloc(void* pMem, size_t size);
+ virtual void Free(void* pMem);
+ virtual void GetLock(void);
+ virtual void FreeLock(void);
+ virtual int IsLocked(void);
+ virtual long Release(void);
+ virtual long AddRef(void);
+
+ inline BOOL CreateOk(void)
+ {
+ return m_hHeap != NULL;
+ };
+
+ void ReInit(void);
+
+protected:
+ void Init(void);
+ int Getmem(size_t size);
+ int HeapAdd(void* ptr, size_t size);
+ void* Expand(void* block, size_t size);
+ void WalkHeap(void);
+
+ HANDLE m_hHeap; // memory heap for this script
+ char m_FreeDummy[minAllocSize]; // dummy free block
+ PBLOCK m_pFreeList; // pointer to first block on free list
+ PBLOCK m_pRover; // roving pointer into the free list
+ HeapRec m_heaps[maxHeaps]; // list of all non-contiguous heap areas
+ int m_nHeaps; // no. of heaps in m_heaps
+ long m_lAllocSize; // current alloc size
+ long m_lRefCount; // number of current users
+ CRITICAL_SECTION m_cs; // access lock
+};
+
+// #define _DEBUG_MEM
+#ifdef _DEBUG_MEM
+#define ASSERT(f) if(!(f)) DebugBreak();
+
+inline void MEMODS(char *str)
+{
+ OutputDebugString(str);
+ OutputDebugString("\n");
+}
+
+inline void MEMODSlx(char *str, long x)
+{
+ char szBuffer[512];
+ sprintf(szBuffer, "%s %lx\n", str, x);
+ OutputDebugString(szBuffer);
+}
+
+#define WALKHEAP() WalkHeap()
+#define WALKHEAPTRACE() m_pRover = NULL; WalkHeap()
+
+#else
+
+#define ASSERT(f)
+#define MEMODS(x)
+#define MEMODSlx(x, y)
+#define WALKHEAP()
+#define WALKHEAPTRACE()
+
+#endif
+
+
+VMem::VMem()
+{
+ m_lRefCount = 1;
+ BOOL bRet = (NULL != (m_hHeap = HeapCreate(HEAP_NO_SERIALIZE,
+ lAllocStart, /* initial size of heap */
+ 0))); /* no upper limit on size of heap */
+ ASSERT(bRet);
+
+ InitializeCriticalSection(&m_cs);
+
+ Init();
+}
+
+VMem::~VMem(void)
+{
+ ASSERT(HeapValidate(m_hHeap, HEAP_NO_SERIALIZE, NULL));
+ WALKHEAPTRACE();
+ DeleteCriticalSection(&m_cs);
+ BOOL bRet = HeapDestroy(m_hHeap);
+ ASSERT(bRet);
+}
+
+void VMem::ReInit(void)
+{
+ for(int index = 0; index < m_nHeaps; ++index)
+ HeapFree(m_hHeap, HEAP_NO_SERIALIZE, m_heaps[index].base);
+
+ Init();
+}
+
+void VMem::Init(void)
+{ /*
+ * Initialize the free list by placing a dummy zero-length block on it.
+ * Set the number of non-contiguous heaps to zero.
+ */
+ m_pFreeList = m_pRover = (PBLOCK)(&m_FreeDummy[minBlockSize]);
+ PSIZE(m_pFreeList) = SIZE(m_pFreeList) = 0;
+ PREV(m_pFreeList) = NEXT(m_pFreeList) = m_pFreeList;
+
+ m_nHeaps = 0;
+ m_lAllocSize = lAllocStart;
+}
+
+void* VMem::Malloc(size_t size)
+{
+ WALKHEAP();
+
+ /*
+ * Adjust the real size of the block to be a multiple of sizeof(long), and add
+ * the overhead for the boundary tags. Disallow negative or zero sizes.
+ */
+ size_t realsize = (size < blockOverhead) ? minAllocSize : (size_t)ROUND_UP(size) + minBlockSize;
+ if((int)realsize < minAllocSize || size == 0)
+ return NULL;
+
+ /*
+ * Start searching the free list at the rover. If we arrive back at rover without
+ * finding anything, allocate some memory from the heap and try again.
+ */
+ PBLOCK ptr = m_pRover; /* start searching at rover */
+ int loops = 2; /* allow two times through the loop */
+ for(;;) {
+ size_t lsize = SIZE(ptr);
+ ASSERT((lsize&1)==0);
+ /* is block big enough? */
+ if(lsize >= realsize) {
+ /* if the remainder is too small, don't bother splitting the block. */
+ size_t rem = lsize - realsize;
+ if(rem < minAllocSize) {
+ if(m_pRover == ptr)
+ m_pRover = NEXT(ptr);
+
+ /* Unlink the block from the free list. */
+ Unlink(ptr);
+ }
+ else {
+ /*
+ * split the block
+ * The remainder is big enough to split off into a new block.
+ * Use the end of the block, resize the beginning of the block
+ * no need to change the free list.
+ */
+ SetTags(ptr, rem);
+ ptr += SIZE(ptr);
+ lsize = realsize;
+ }
+ /* Set the boundary tags to mark it as allocated. */
+ SetTags(ptr, lsize | 1);
+ return ((void *)ptr);
+ }
+
+ /*
+ * This block was unsuitable. If we've gone through this list once already without
+ * finding anything, allocate some new memory from the heap and try again.
+ */
+ ptr = NEXT(ptr);
+ if(ptr == m_pRover) {
+ if(!(loops-- && Getmem(realsize))) {
+ return NULL;
+ }
+ ptr = m_pRover;
+ }
+ }
+}
+
+void* VMem::Realloc(void* block, size_t size)
+{
+ WALKHEAP();
+
+ /* if size is zero, free the block. */
+ if(size == 0) {
+ Free(block);
+ return (NULL);
+ }
+
+ /* if block pointer is NULL, do a Malloc(). */
+ if(block == NULL)
+ return Malloc(size);
+
+ /*
+ * Grow or shrink the block in place.
+ * if the block grows then the next block will be used if free
+ */
+ if(Expand(block, size) != NULL)
+ return block;
+
+ /*
+ * adjust the real size of the block to be a multiple of sizeof(long), and add the
+ * overhead for the boundary tags. Disallow negative or zero sizes.
+ */
+ size_t realsize = (size < blockOverhead) ? minAllocSize : (size_t)ROUND_UP(size) + minBlockSize;
+ if((int)realsize < minAllocSize)
+ return NULL;
+
+ /*
+ * see if the previous block is free, and is it big enough to cover the new size
+ * if merged with the current block.
+ */
+ PBLOCK ptr = (PBLOCK)block;
+ size_t cursize = SIZE(ptr) & ~1;
+ size_t psize = PSIZE(ptr);
+ if((psize&1) == 0 && (psize + cursize) >= realsize) {
+ PBLOCK prev = ptr - psize;
+ if(m_pRover == prev)
+ m_pRover = NEXT(prev);
+
+ /* Unlink the next block from the free list. */
+ Unlink(prev);
+
+ /* Copy contents of old block to new location, make it the current block. */
+ memmove(prev, ptr, cursize);
+ cursize += psize; /* combine sizes */
+ ptr = prev;
+
+ size_t rem = cursize - realsize;
+ if(rem >= minAllocSize) {
+ /*
+ * The remainder is big enough to be a new block. Set boundary
+ * tags for the resized block and the new block.
+ */
+ prev = ptr + realsize;
+ /*
+ * add the new block to the free list.
+ * next block cannot be free
+ */
+ SetTags(prev, rem);
+ AddToFreeList(prev, m_pFreeList);
+ cursize = realsize;
+ }
+ /* Set the boundary tags to mark it as allocated. */
+ SetTags(ptr, cursize | 1);
+ return ((void *)ptr);
+ }
+
+ /* Allocate a new block, copy the old to the new, and free the old. */
+ if((ptr = (PBLOCK)Malloc(size)) != NULL) {
+ memmove(ptr, block, cursize-minBlockSize);
+ Free(block);
+ }
+ return ((void *)ptr);
+}
+
+void VMem::Free(void* p)
+{
+ WALKHEAP();
+
+ /* Ignore null pointer. */
+ if(p == NULL)
+ return;
+
+ PBLOCK ptr = (PBLOCK)p;
+
+ /* Check for attempt to free a block that's already free. */
+ size_t size = SIZE(ptr);
+ if((size&1) == 0) {
+ MEMODSlx("Attempt to free previously freed block", (long)p);
+ return;
+ }
+ size &= ~1; /* remove allocated tag */
+
+ /* if previous block is free, add this block to it. */
+ int linked = FALSE;
+ size_t psize = PSIZE(ptr);
+ if((psize&1) == 0) {
+ ptr -= psize; /* point to previous block */
+ size += psize; /* merge the sizes of the two blocks */
+ linked = TRUE; /* it's already on the free list */
+ }
+
+ /* if the next physical block is free, merge it with this block. */
+ PBLOCK next = ptr + size; /* point to next physical block */
+ size_t nsize = SIZE(next);
+ if((nsize&1) == 0) {
+ /* block is free move rover if needed */
+ if(m_pRover == next)
+ m_pRover = NEXT(next);
+
+ /* unlink the next block from the free list. */
+ Unlink(next);
+
+ /* merge the sizes of this block and the next block. */
+ size += nsize;
+ }
+
+ /* Set the boundary tags for the block; */
+ SetTags(ptr, size);
+
+ /* Link the block to the head of the free list. */
+ if(!linked) {
+ AddToFreeList(ptr, m_pFreeList);
+ }
+}
+
+void VMem::GetLock(void)
+{
+ EnterCriticalSection(&m_cs);
+}
+
+void VMem::FreeLock(void)
+{
+ LeaveCriticalSection(&m_cs);
+}
+
+int VMem::IsLocked(void)
+{
+ BOOL bAccessed = TryEnterCriticalSection(&m_cs);
+ if(bAccessed) {
+ LeaveCriticalSection(&m_cs);
+ }
+ return !bAccessed;
+}
+
+
+long VMem::Release(void)
+{
+ long lCount = InterlockedDecrement(&m_lRefCount);
+ if(!lCount)
+ delete this;
+ return lCount;
+}
+
+long VMem::AddRef(void)
+{
+ long lCount = InterlockedIncrement(&m_lRefCount);
+ return lCount;
+}
+
+
+int VMem::Getmem(size_t requestSize)
+{ /* returns -1 is successful 0 if not */
+ void *ptr;
+
+ /* Round up size to next multiple of 64K. */
+ size_t size = (size_t)ROUND_UP64K(requestSize);
+
+ /*
+ * if the size requested is smaller than our current allocation size
+ * adjust up
+ */
+ if(size < (unsigned long)m_lAllocSize)
+ size = m_lAllocSize;
+
+ /* Update the size to allocate on the next request */
+ if(m_lAllocSize != lAllocMax)
+ m_lAllocSize <<= 1;
+
+ if(m_nHeaps != 0) {
+ /* Expand the last allocated heap */
+ ptr = HeapReAlloc(m_hHeap, HEAP_REALLOC_IN_PLACE_ONLY|HEAP_ZERO_MEMORY|HEAP_NO_SERIALIZE,
+ m_heaps[m_nHeaps-1].base,
+ m_heaps[m_nHeaps-1].len + size);
+ if(ptr != 0) {
+ HeapAdd(((char*)ptr) + m_heaps[m_nHeaps-1].len, size);
+ return -1;
+ }
+ }
+
+ /*
+ * if we didn't expand a block to cover the requested size
+ * allocate a new Heap
+ * the size of this block must include the additional dummy tags at either end
+ * the above ROUND_UP64K may not have added any memory to include this.
+ */
+ if(size == requestSize)
+ size = (size_t)ROUND_UP64K(requestSize+(sizeofTag*2));
+
+ ptr = HeapAlloc(m_hHeap, HEAP_ZERO_MEMORY|HEAP_NO_SERIALIZE, size);
+ if(ptr == 0) {
+ MEMODSlx("HeapAlloc failed on size!!!", size);
+ return 0;
+ }
+
+ HeapAdd(ptr, size);
+ return -1;
+}
+
+int VMem::HeapAdd(void *p, size_t size)
+{ /* if the block can be succesfully added to the heap, returns 0; otherwise -1. */
+ int index;
+
+ /* Check size, then round size down to next long word boundary. */
+ if(size < minAllocSize)
+ return -1;
+
+ size = (size_t)ROUND_DOWN(size);
+ PBLOCK ptr = (PBLOCK)p;
+
+ /*
+ * Search for another heap area that's contiguous with the bottom of this new area.
+ * (It should be extremely unusual to find one that's contiguous with the top).
+ */
+ for(index = 0; index < m_nHeaps; ++index) {
+ if(ptr == m_heaps[index].base + (int)m_heaps[index].len) {
+ /*
+ * The new block is contiguous with a previously allocated heap area. Add its
+ * length to that of the previous heap. Merge it with the the dummy end-of-heap
+ * area marker of the previous heap.
+ */
+ m_heaps[index].len += size;
+ break;
+ }
+ }
+
+ if(index == m_nHeaps) {
+ /* The new block is not contiguous. Add it to the heap list. */
+ if(m_nHeaps == maxHeaps) {
+ return -1; /* too many non-contiguous heaps */
+ }
+ m_heaps[m_nHeaps].base = ptr;
+ m_heaps[m_nHeaps].len = size;
+ m_nHeaps++;
+
+ /*
+ * Reserve the first LONG in the block for the ending boundary tag of a dummy
+ * block at the start of the heap area.
+ */
+ size -= minBlockSize;
+ ptr += minBlockSize;
+ PSIZE(ptr) = 1; /* mark the dummy previous block as allocated */
+ }
+
+ /*
+ * Convert the heap to one large block. Set up its boundary tags, and those of
+ * marker block after it. The marker block before the heap will already have
+ * been set up if this heap is not contiguous with the end of another heap.
+ */
+ SetTags(ptr, size | 1);
+ PBLOCK next = ptr + size; /* point to dummy end block */
+ SIZE(next) = 1; /* mark the dummy end block as allocated */
+
+ /*
+ * Link the block to the start of the free list by calling free().
+ * This will merge the block with any adjacent free blocks.
+ */
+ Free(ptr);
+ return 0;
+}
+
+
+void* VMem::Expand(void* block, size_t size)
+{
+ /*
+ * Adjust the size of the block to be a multiple of sizeof(long), and add the
+ * overhead for the boundary tags. Disallow negative or zero sizes.
+ */
+ size_t realsize = (size < blockOverhead) ? minAllocSize : (size_t)ROUND_UP(size) + minBlockSize;
+ if((int)realsize < minAllocSize || size == 0)
+ return NULL;
+
+ PBLOCK ptr = (PBLOCK)block;
+
+ /* if the current size is the same as requested, do nothing. */
+ size_t cursize = SIZE(ptr) & ~1;
+ if(cursize == realsize) {
+ return block;
+ }
+
+ /* if the block is being shrunk, convert the remainder of the block into a new free block. */
+ if(realsize <= cursize) {
+ size_t nextsize = cursize - realsize; /* size of new remainder block */
+ if(nextsize >= minAllocSize) {
+ /*
+ * Split the block
+ * Set boundary tags for the resized block and the new block.
+ */
+ SetTags(ptr, realsize | 1);
+ ptr += realsize;
+
+ /*
+ * add the new block to the free list.
+ * call Free to merge this block with next block if free
+ */
+ SetTags(ptr, nextsize | 1);
+ Free(ptr);
+ }
+
+ return block;
+ }
+
+ PBLOCK next = ptr + cursize;
+ size_t nextsize = SIZE(next);
+
+ /* Check the next block for consistency.*/
+ if((nextsize&1) == 0 && (nextsize + cursize) >= realsize) {
+ /*
+ * The next block is free and big enough. Add the part that's needed
+ * to our block, and split the remainder off into a new block.
+ */
+ if(m_pRover == next)
+ m_pRover = NEXT(next);
+
+ /* Unlink the next block from the free list. */
+ Unlink(next);
+ cursize += nextsize; /* combine sizes */
+
+ size_t rem = cursize - realsize; /* size of remainder */
+ if(rem >= minAllocSize) {
+ /*
+ * The remainder is big enough to be a new block.
+ * Set boundary tags for the resized block and the new block.
+ */
+ next = ptr + realsize;
+ /*
+ * add the new block to the free list.
+ * next block cannot be free
+ */
+ SetTags(next, rem);
+ AddToFreeList(next, m_pFreeList);
+ cursize = realsize;
+ }
+ /* Set the boundary tags to mark it as allocated. */
+ SetTags(ptr, cursize | 1);
+ return ((void *)ptr);
+ }
+ return NULL;
+}
+
+#ifdef _DEBUG_MEM
+#define LOG_FILENAME "P:\\Apps\\Perl\\Result.txt"
+
+void MemoryUsageMessage(char *str, long x, long y, int c)
+{
+ static FILE* fp = NULL;
+ char szBuffer[512];
+ if(str) {
+ if(!fp)
+ fp = fopen(LOG_FILENAME, "w");
+ sprintf(szBuffer, str, x, y, c);
+ fputs(szBuffer, fp);
+ }
+ else {
+ fflush(fp);
+ fclose(fp);
+ }
+}
+
+void VMem::WalkHeap(void)
+{
+ if(!m_pRover) {
+ MemoryUsageMessage("VMem heaps used %d\n", m_nHeaps, 0, 0);
+ }
+
+ /* Walk all the heaps - verify structures */
+ for(int index = 0; index < m_nHeaps; ++index) {
+ PBLOCK ptr = m_heaps[index].base;
+ size_t size = m_heaps[index].len;
+ ASSERT(HeapValidate(m_hHeap, HEAP_NO_SERIALIZE, p));
+
+ /* set over reserved header block */
+ size -= minBlockSize;
+ ptr += minBlockSize;
+ PBLOCK pLast = ptr + size;
+ ASSERT(PSIZE(ptr) == 1); /* dummy previous block is allocated */
+ ASSERT(SIZE(pLast) == 1); /* dummy next block is allocated */
+ while(ptr < pLast) {
+ ASSERT(ptr > m_heaps[index].base);
+ size_t cursize = SIZE(ptr) & ~1;
+ ASSERT((PSIZE(ptr+cursize) & ~1) == cursize);
+ if(!m_pRover) {
+ MemoryUsageMessage("Memory Block %08x: Size %08x %c\n", (long)ptr, cursize, (SIZE(p)&1) ? 'x' : ' ');
+ }
+ if(!(SIZE(ptr)&1)) {
+ /* this block is on the free list */
+ PBLOCK tmp = NEXT(ptr);
+ while(tmp != ptr) {
+ ASSERT((SIZE(tmp)&1)==0);
+ if(tmp == m_pFreeList)
+ break;
+ ASSERT(NEXT(tmp));
+ tmp = NEXT(tmp);
+ }
+ if(tmp == ptr) {
+ MemoryUsageMessage("Memory Block %08x: Size %08x free but not in free list\n", (long)ptr, cursize, 0);
+ }
+ }
+ ptr += cursize;
+ }
+ }
+ if(!m_pRover) {
+ MemoryUsageMessage(NULL, 0, 0, 0);
+ }
+}
+#endif
+
+#endif /* ___VMEM_H_INC___ */
#define Win32_Winsock
#endif
#include <windows.h>
-
-#ifndef __MINGW32__
-#include <lmcons.h>
-#include <lmerr.h>
-/* ugliness to work around a buggy struct definition in lmwksta.h */
-#undef LPTSTR
-#define LPTSTR LPWSTR
-#include <lmwksta.h>
-#undef LPTSTR
-#define LPTSTR LPSTR
-#include <lmapibuf.h>
-#endif /* __MINGW32__ */
+#include <winnt.h>
+#include <io.h>
/* #include "config.h" */
int _CRT_glob = 0;
#endif
-#ifdef __BORLANDC__
+#if defined(__MINGW32__)
+# define _stat stat
+#endif
+
+#if defined(__BORLANDC__)
# define _stat stat
# define _utimbuf utimbuf
#endif
#define EXECF_SPAWN 2
#define EXECF_SPAWN_NOWAIT 3
+#if defined(PERL_IMPLICIT_SYS)
+# undef win32_get_privlib
+# define win32_get_privlib g_win32_get_privlib
+# undef win32_get_sitelib
+# define win32_get_sitelib g_win32_get_sitelib
+# undef do_spawn
+# define do_spawn g_do_spawn
+# undef getlogin
+# define getlogin g_getlogin
+#endif
+
#if defined(PERL_OBJECT)
-#undef win32_get_privlib
-#define win32_get_privlib g_win32_get_privlib
-#undef win32_get_sitelib
-#define win32_get_sitelib g_win32_get_sitelib
-#undef do_aspawn
-#define do_aspawn g_do_aspawn
-#undef do_spawn
-#define do_spawn g_do_spawn
-#undef Perl_do_exec
-#define Perl_do_exec g_do_exec
-#undef getlogin
-#define getlogin g_getlogin
+# undef do_aspawn
+# define do_aspawn g_do_aspawn
+# undef Perl_do_exec
+# define Perl_do_exec g_do_exec
#endif
static void get_shell(void);
-static long tokenize(char *str, char **dest, char ***destv);
+static long tokenize(const char *str, char **dest, char ***destv);
int do_spawn2(char *cmd, int exectype);
static BOOL has_shell_metachars(char *ptr);
static long filetime_to_clock(PFILETIME ft);
static void remove_dead_process(long deceased);
static long find_pid(int pid);
static char * qualified_path(const char *cmd);
+#ifdef USE_ITHREADS
+static void remove_dead_pseudo_process(long child);
+static long find_pseudo_pid(int pid);
+#endif
+START_EXTERN_C
HANDLE w32_perldll_handle = INVALID_HANDLE_VALUE;
char w32_module_name[MAX_PATH+1];
+END_EXTERN_C
+
static DWORD w32_platform = (DWORD)-1;
-#ifdef USE_THREADS
-# ifdef USE_DECLSPEC_THREAD
-__declspec(thread) char strerror_buffer[512];
-__declspec(thread) char getlogin_buffer[128];
-__declspec(thread) char w32_perllib_root[MAX_PATH+1];
-# ifdef HAVE_DES_FCRYPT
-__declspec(thread) char crypt_buffer[30];
-# endif
-# else
-# define strerror_buffer (thr->i.Wstrerror_buffer)
-# define getlogin_buffer (thr->i.Wgetlogin_buffer)
-# define w32_perllib_root (thr->i.Ww32_perllib_root)
-# define crypt_buffer (thr->i.Wcrypt_buffer)
-# endif
-#else
-static char strerror_buffer[512];
-static char getlogin_buffer[128];
-static char w32_perllib_root[MAX_PATH+1];
-# ifdef HAVE_DES_FCRYPT
-static char crypt_buffer[30];
-# endif
-#endif
+#define ONE_K_BUFSIZE 1024
int
IsWin95(void)
char *optr;
char *strip;
int oldsize, newsize;
+ STRLEN baselen;
va_start(ap, trailing_path);
strip = va_arg(ap, char *);
- sprintf(base, "%5.3f",
- (double)PERL_REVISION + ((double)PERL_VERSION / (double)1000));
+ sprintf(base, "%d.%d", (int)PERL_REVISION, (int)PERL_VERSION);
+ baselen = strlen(base);
if (!*w32_module_name) {
GetModuleFileName((HMODULE)((w32_perldll_handle == INVALID_HANDLE_VALUE)
/* try to get full path to binary (which may be mangled when perl is
* run from a 16-bit app) */
- /*PerlIO_printf(PerlIO_stderr(), "Before %s\n", w32_module_name);*/
+ /*PerlIO_printf(Perl_debug_log, "Before %s\n", w32_module_name);*/
(void)win32_longpath(w32_module_name);
- /*PerlIO_printf(PerlIO_stderr(), "After %s\n", w32_module_name);*/
+ /*PerlIO_printf(Perl_debug_log, "After %s\n", w32_module_name);*/
/* normalize to forward slashes */
ptr = w32_module_name;
/* avoid stripping component if there is no slash,
* or it doesn't match ... */
if (!ptr || stricmp(ptr+1, strip) != 0) {
- /* ... but not if component matches 5.00X* */
+ /* ... but not if component matches m|5\.$patchlevel.*| */
if (!ptr || !(*strip == '5' && *(ptr+1) == '5'
- && strncmp(strip, base, 5) == 0
- && strncmp(ptr+1, base, 5) == 0))
+ && strncmp(strip, base, baselen) == 0
+ && strncmp(ptr+1, base, baselen) == 0))
{
*optr = '/';
ptr = optr;
* ";$EMD/" . ((-d $EMD/../../../$]) ? "../../.." : "../.."). "/site/$]/lib"; */
sprintf(pathstr, "site/%s/lib", pl);
(void)get_emd_part(&sv1, pathstr, ARCHNAME, "bin", pl, Nullch);
- if (!sv1 && strlen(pl) == 7) {
- /* pl may have been SUBVERSION-specific; try again without
- * SUBVERSION */
- sprintf(pathstr, "site/%.5s/lib", pl);
- (void)get_emd_part(&sv1, pathstr, ARCHNAME, "bin", pl, Nullch);
- }
/* $HKCU{'sitelib'} || $HKLM{'sitelib'} . ---; */
(void)get_regstr(sitelib, &sv2);
return FALSE;
}
-#if !defined(PERL_OBJECT)
+#if !defined(PERL_IMPLICIT_SYS)
/* since the current process environment is being updated in util.c
* the library functions will get the correct environment
*/
Perl_my_popen(pTHX_ char *cmd, char *mode)
{
#ifdef FIXCMD
-#define fixcmd(x) { \
- char *pspace = strchr((x),' '); \
- if (pspace) { \
- char *p = (x); \
- while (p < pspace) { \
- if (*p == '/') \
- *p = '\\'; \
- p++; \
- } \
- } \
- }
+#define fixcmd(x) { \
+ char *pspace = strchr((x),' '); \
+ if (pspace) { \
+ char *p = (x); \
+ while (p < pspace) { \
+ if (*p == '/') \
+ *p = '\\'; \
+ p++; \
+ } \
+ } \
+ }
#else
#define fixcmd(x)
#endif
return (unsigned long)w32_platform;
}
+DllExport int
+win32_getpid(void)
+{
+#ifdef USE_ITHREADS
+ dTHXo;
+ if (w32_pseudo_id)
+ return -((int)w32_pseudo_id);
+#endif
+ return _getpid();
+}
+
/* Tokenize a string. Words are null-separated, and the list
* ends with a doubled null. Any character (except null and
* including backslash) may be escaped by preceding it with a
* Returns number of words in result buffer.
*/
static long
-tokenize(char *str, char **dest, char ***destv)
+tokenize(const char *str, char **dest, char ***destv)
{
char *retstart = Nullch;
char **retvstart = 0;
* interactive use (which is what most programs look in COMSPEC
* for).
*/
- char* defaultshell = (IsWinNT() ? "cmd.exe /x/c" : "command.com /c");
- char *usershell = getenv("PERL5SHELL");
+ const char* defaultshell = (IsWinNT()
+ ? "cmd.exe /x/c" : "command.com /c");
+ const char *usershell = getenv("PERL5SHELL");
w32_perlshell_items = tokenize(usershell ? usershell : defaultshell,
&w32_perlshell_tokens,
&w32_perlshell_vec);
win32_opendir(char *filename)
{
dTHXo;
- DIR *p;
+ DIR *dirp;
long len;
long idx;
char scanname[MAX_PATH+3];
HANDLE fh;
char buffer[MAX_PATH*2];
WCHAR wbuffer[MAX_PATH];
- char* ptr;
+ char* ptr;
len = strlen(filename);
if (len > MAX_PATH)
return NULL;
/* Get us a DIR structure */
- Newz(1303, p, 1, DIR);
- if (p == NULL)
- return NULL;
+ Newz(1303, dirp, 1, DIR);
/* Create the search pattern */
strcpy(scanname, filename);
/* do the FindFirstFile call */
if (USING_WIDE()) {
A2WHELPER(scanname, wbuffer, sizeof(wbuffer));
- fh = FindFirstFileW(wbuffer, &wFindData);
+ fh = FindFirstFileW(PerlDir_mapW(wbuffer), &wFindData);
}
else {
- fh = FindFirstFileA(scanname, &aFindData);
+ fh = FindFirstFileA(PerlDir_mapA(scanname), &aFindData);
}
+ dirp->handle = fh;
if (fh == INVALID_HANDLE_VALUE) {
+ DWORD err = GetLastError();
/* FindFirstFile() fails on empty drives! */
- if (GetLastError() == ERROR_FILE_NOT_FOUND)
- return p;
- Safefree( p);
+ switch (err) {
+ case ERROR_FILE_NOT_FOUND:
+ return dirp;
+ case ERROR_NO_MORE_FILES:
+ case ERROR_PATH_NOT_FOUND:
+ errno = ENOENT;
+ break;
+ case ERROR_NOT_ENOUGH_MEMORY:
+ errno = ENOMEM;
+ break;
+ default:
+ errno = EINVAL;
+ break;
+ }
+ Safefree(dirp);
return NULL;
}
ptr = aFindData.cFileName;
}
idx = strlen(ptr)+1;
- New(1304, p->start, idx, char);
- if (p->start == NULL)
- Perl_croak_nocontext("opendir: malloc failed!\n");
- strcpy(p->start, ptr);
- p->nfiles++;
-
- /* loop finding all the files that match the wildcard
- * (which should be all of them in this directory!).
- * the variable idx should point one past the null terminator
- * of the previous string found.
- */
- while (USING_WIDE()
- ? FindNextFileW(fh, &wFindData)
- : FindNextFileA(fh, &aFindData)) {
- if (USING_WIDE()) {
- W2AHELPER(wFindData.cFileName, buffer, sizeof(buffer));
- }
- /* ptr is set above to the correct area */
- len = strlen(ptr);
- /* bump the string table size by enough for the
- * new name and it's null terminator
- */
- Renew(p->start, idx+len+1, char);
- if (p->start == NULL)
- Perl_croak_nocontext("opendir: malloc failed!\n");
- strcpy(&p->start[idx], ptr);
- p->nfiles++;
- idx += len+1;
- }
- FindClose(fh);
- p->size = idx;
- p->curr = p->start;
- return p;
+ if (idx < 256)
+ dirp->size = 128;
+ else
+ dirp->size = idx;
+ New(1304, dirp->start, dirp->size, char);
+ strcpy(dirp->start, ptr);
+ dirp->nfiles++;
+ dirp->end = dirp->curr = dirp->start;
+ dirp->end += idx;
+ return dirp;
}
DllExport struct direct *
win32_readdir(DIR *dirp)
{
- int len;
- static int dummy = 0;
+ long len;
if (dirp->curr) {
/* first set up the structure to return */
dirp->dirstr.d_namlen = len;
/* Fake an inode */
- dirp->dirstr.d_ino = dummy++;
+ dirp->dirstr.d_ino = dirp->curr - dirp->start;
- /* Now set up for the nDllExport call to readdir */
+ /* Now set up for the next call to readdir */
dirp->curr += len + 1;
- if (dirp->curr >= (dirp->start + dirp->size)) {
- dirp->curr = NULL;
+ if (dirp->curr >= dirp->end) {
+ dTHXo;
+ char* ptr;
+ BOOL res;
+ WIN32_FIND_DATAW wFindData;
+ WIN32_FIND_DATAA aFindData;
+ char buffer[MAX_PATH*2];
+
+ /* finding the next file that matches the wildcard
+ * (which should be all of them in this directory!).
+ */
+ if (USING_WIDE()) {
+ res = FindNextFileW(dirp->handle, &wFindData);
+ if (res) {
+ W2AHELPER(wFindData.cFileName, buffer, sizeof(buffer));
+ ptr = buffer;
+ }
+ }
+ else {
+ res = FindNextFileA(dirp->handle, &aFindData);
+ if (res)
+ ptr = aFindData.cFileName;
+ }
+ if (res) {
+ long endpos = dirp->end - dirp->start;
+ long newsize = endpos + strlen(ptr) + 1;
+ /* bump the string table size by enough for the
+ * new name and it's null terminator */
+ while (newsize > dirp->size) {
+ long curpos = dirp->curr - dirp->start;
+ dirp->size *= 2;
+ Renew(dirp->start, dirp->size, char);
+ dirp->curr = dirp->start + curpos;
+ }
+ strcpy(dirp->start + endpos, ptr);
+ dirp->end = dirp->start + newsize;
+ dirp->nfiles++;
+ }
+ else
+ dirp->curr = NULL;
}
-
return &(dirp->dirstr);
}
else
DllExport long
win32_telldir(DIR *dirp)
{
- return (long) dirp->curr;
+ return (dirp->curr - dirp->start);
}
/* Seekdir moves the string pointer to a previously saved position
- *(Saved by telldir).
+ * (returned by telldir).
*/
DllExport void
win32_seekdir(DIR *dirp, long loc)
{
- dirp->curr = (char *)loc;
+ dirp->curr = dirp->start + loc;
}
/* Rewinddir resets the string pointer to the start */
win32_closedir(DIR *dirp)
{
dTHXo;
+ if (dirp->handle != INVALID_HANDLE_VALUE)
+ FindClose(dirp->handle);
Safefree(dirp->start);
Safefree(dirp);
return 1;
getlogin(void)
{
dTHXo;
- char *buf = getlogin_buffer;
- DWORD size = sizeof(getlogin_buffer);
+ char *buf = w32_getlogin_buffer;
+ DWORD size = sizeof(w32_getlogin_buffer);
if (GetUserName(buf,&size))
return buf;
return (char*)NULL;
find_pid(int pid)
{
dTHXo;
- long child;
- for (child = 0 ; child < w32_num_children ; ++child) {
+ long child = w32_num_children;
+ while (--child >= 0) {
if (w32_child_pids[child] == pid)
return child;
}
}
}
+#ifdef USE_ITHREADS
+static long
+find_pseudo_pid(int pid)
+{
+ dTHXo;
+ long child = w32_num_pseudo_children;
+ while (--child >= 0) {
+ if (w32_pseudo_child_pids[child] == pid)
+ return child;
+ }
+ return -1;
+}
+
+static void
+remove_dead_pseudo_process(long child)
+{
+ if (child >= 0) {
+ dTHXo;
+ CloseHandle(w32_pseudo_child_handles[child]);
+ Copy(&w32_pseudo_child_handles[child+1], &w32_pseudo_child_handles[child],
+ (w32_num_pseudo_children-child-1), HANDLE);
+ Copy(&w32_pseudo_child_pids[child+1], &w32_pseudo_child_pids[child],
+ (w32_num_pseudo_children-child-1), DWORD);
+ w32_num_pseudo_children--;
+ }
+}
+#endif
+
DllExport int
win32_kill(int pid, int sig)
{
+ dTHXo;
HANDLE hProcess;
- hProcess = OpenProcess(PROCESS_ALL_ACCESS, TRUE, pid);
- if (hProcess && TerminateProcess(hProcess, sig))
- CloseHandle(hProcess);
- else {
- errno = EINVAL;
- return -1;
+#ifdef USE_ITHREADS
+ if (pid < 0) {
+ /* it is a pseudo-forked child */
+ long child = find_pseudo_pid(-pid);
+ if (child >= 0) {
+ hProcess = w32_pseudo_child_handles[child];
+ if (TerminateThread(hProcess, sig)) {
+ remove_dead_pseudo_process(child);
+ return 0;
+ }
+ }
}
- return 0;
+ else
+#endif
+ {
+ long child = find_pid(pid);
+ if (child >= 0) {
+ hProcess = w32_child_handles[child];
+ if (TerminateProcess(hProcess, sig)) {
+ remove_dead_process(child);
+ return 0;
+ }
+ }
+ else {
+ hProcess = OpenProcess(PROCESS_ALL_ACCESS, TRUE, pid);
+ if (hProcess && TerminateProcess(hProcess, sig)) {
+ CloseHandle(hProcess);
+ return 0;
+ }
+ }
+ }
+ errno = EINVAL;
+ return -1;
}
/*
int l = strlen(path);
int res;
WCHAR wbuffer[MAX_PATH];
+ HANDLE handle;
+ int nlink = 1;
if (l > 1) {
switch(path[l - 1]) {
break;
}
}
+
+ /* We *must* open & close the file once; otherwise file attribute changes */
+ /* might not yet have propagated to "other" hard links of the same file. */
+ /* This also gives us an opportunity to determine the number of links. */
if (USING_WIDE()) {
A2WHELPER(path, wbuffer, sizeof(wbuffer));
+ wcscpy(wbuffer, PerlDir_mapW(wbuffer));
+ handle = CreateFileW(wbuffer, 0, 0, NULL, OPEN_EXISTING, 0, NULL);
+ }
+ else {
+ path = PerlDir_mapA(path);
+ handle = CreateFileA(path, 0, 0, NULL, OPEN_EXISTING, 0, NULL);
+ }
+ if (handle != INVALID_HANDLE_VALUE) {
+ BY_HANDLE_FILE_INFORMATION bhi;
+ if (GetFileInformationByHandle(handle, &bhi))
+ nlink = bhi.nNumberOfLinks;
+ CloseHandle(handle);
+ }
+
+ /* wbuffer or path will be mapped correctly above */
+ if (USING_WIDE()) {
res = _wstat(wbuffer, (struct _stat *)buffer);
}
else {
res = stat(path, buffer);
}
+ buffer->st_nlink = nlink;
+
if (res < 0) {
/* CRT is buggy on sharenames, so make sure it really isn't.
* XXX using GetFileAttributesEx() will enable us to set
}
else {
/* failed a step, just return without side effects */
- /*PerlIO_printf(PerlIO_stderr(), "Failed to find %s\n", path);*/
+ /*PerlIO_printf(Perl_debug_log, "Failed to find %s\n", path);*/
*start = sep;
return Nullch;
}
New(1309,wCuritem,length,WCHAR);
A2WHELPER(name, wCuritem, length*sizeof(WCHAR));
wVal = wcschr(wCuritem, '=');
- if(wVal) {
+ if (wVal) {
*wVal++ = '\0';
- if(SetEnvironmentVariableW(wCuritem, *wVal ? wVal : NULL))
+ if (SetEnvironmentVariableW(wCuritem, *wVal ? wVal : NULL))
relval = 0;
}
Safefree(wCuritem);
New(1309,curitem,strlen(name)+1,char);
strcpy(curitem, name);
val = strchr(curitem, '=');
- if(val) {
+ if (val) {
/* The sane way to deal with the environment.
* Has these advantages over putenv() & co.:
* * enables us to store a truly empty value in the
* GSAR 97-06-07
*/
*val++ = '\0';
- if(SetEnvironmentVariableA(curitem, *val ? val : NULL))
+ if (SetEnvironmentVariableA(curitem, *val ? val : NULL))
relval = 0;
}
Safefree(curitem);
static long
filetime_to_clock(PFILETIME ft)
{
- __int64 qw = ft->dwHighDateTime;
- qw <<= 32;
- qw |= ft->dwLowDateTime;
- qw /= 10000; /* File time ticks at 0.1uS, clock at 1mS */
- return (long) qw;
+ __int64 qw = ft->dwHighDateTime;
+ qw <<= 32;
+ qw |= ft->dwLowDateTime;
+ qw /= 10000; /* File time ticks at 0.1uS, clock at 1mS */
+ return (long) qw;
}
DllExport int
return 0;
}
-/* fix utime() so it works on directories in NT
- * thanks to Jan Dubois <jan.dubois@ibm.net>
- */
+/* fix utime() so it works on directories in NT */
static BOOL
filetime_from_time(PFILETIME pFileTime, time_t Time)
{
- struct tm *pTM = gmtime(&Time);
+ struct tm *pTM = localtime(&Time);
SYSTEMTIME SystemTime;
+ FILETIME LocalTime;
if (pTM == NULL)
return FALSE;
SystemTime.wSecond = pTM->tm_sec;
SystemTime.wMilliseconds = 0;
- return SystemTimeToFileTime(&SystemTime, pFileTime);
+ return SystemTimeToFileTime(&SystemTime, &LocalTime) &&
+ LocalFileTimeToFileTime(&LocalTime, pFileTime);
+}
+
+DllExport int
+win32_unlink(const char *filename)
+{
+ dTHXo;
+ int ret;
+ DWORD attrs;
+
+ if (USING_WIDE()) {
+ WCHAR wBuffer[MAX_PATH];
+
+ A2WHELPER(filename, wBuffer, sizeof(wBuffer));
+ wcscpy(wBuffer, PerlDir_mapW(wBuffer));
+ attrs = GetFileAttributesW(wBuffer);
+ if (attrs & FILE_ATTRIBUTE_READONLY) {
+ (void)SetFileAttributesW(wBuffer, attrs & ~FILE_ATTRIBUTE_READONLY);
+ ret = _wunlink(wBuffer);
+ if (ret == -1)
+ (void)SetFileAttributesW(wBuffer, attrs);
+ }
+ else
+ ret = _wunlink(wBuffer);
+ }
+ else {
+ filename = PerlDir_mapA(filename);
+ attrs = GetFileAttributesA(filename);
+ if (attrs & FILE_ATTRIBUTE_READONLY) {
+ (void)SetFileAttributesA(filename, attrs & ~FILE_ATTRIBUTE_READONLY);
+ ret = unlink(filename);
+ if (ret == -1)
+ (void)SetFileAttributesA(filename, attrs);
+ }
+ else
+ ret = unlink(filename);
+ }
+ return ret;
}
DllExport int
int rc;
if (USING_WIDE()) {
A2WHELPER(filename, wbuffer, sizeof(wbuffer));
+ wcscpy(wbuffer, PerlDir_mapW(wbuffer));
rc = _wutime(wbuffer, (struct _utimbuf*)times);
}
else {
+ filename = PerlDir_mapA(filename);
rc = utime(filename, times);
}
/* EACCES: path specifies directory or readonly file */
{
dTHXo;
int retval = -1;
- if (pid == -1)
+ if (pid == -1) /* XXX threadid == 1 ? */
return win32_wait(status);
+#ifdef USE_ITHREADS
+ else if (pid < 0) {
+ long child = find_pseudo_pid(-pid);
+ if (child >= 0) {
+ HANDLE hThread = w32_pseudo_child_handles[child];
+ DWORD waitcode = WaitForSingleObject(hThread, INFINITE);
+ if (waitcode != WAIT_FAILED) {
+ if (GetExitCodeThread(hThread, &waitcode)) {
+ *status = (int)((waitcode & 0xff) << 8);
+ retval = (int)w32_pseudo_child_pids[child];
+ remove_dead_pseudo_process(child);
+ return retval;
+ }
+ }
+ else
+ errno = ECHILD;
+ }
+ }
+#endif
else {
long child = find_pid(pid);
if (child >= 0) {
int i, retval;
DWORD exitcode, waitcode;
+#ifdef USE_ITHREADS
+ if (w32_num_pseudo_children) {
+ waitcode = WaitForMultipleObjects(w32_num_pseudo_children,
+ w32_pseudo_child_handles,
+ FALSE,
+ INFINITE);
+ if (waitcode != WAIT_FAILED) {
+ if (waitcode >= WAIT_ABANDONED_0
+ && waitcode < WAIT_ABANDONED_0 + w32_num_pseudo_children)
+ i = waitcode - WAIT_ABANDONED_0;
+ else
+ i = waitcode - WAIT_OBJECT_0;
+ if (GetExitCodeThread(w32_pseudo_child_handles[i], &exitcode)) {
+ *status = (int)((exitcode & 0xff) << 8);
+ retval = (int)w32_pseudo_child_pids[i];
+ remove_dead_pseudo_process(i);
+ return retval;
+ }
+ }
+ }
+#endif
+
if (!w32_num_children) {
errno = ECHILD;
return -1;
return 0;
}
-#if defined(HAVE_DES_FCRYPT) || defined(PERL_OBJECT)
#ifdef HAVE_DES_FCRYPT
extern char * des_fcrypt(const char *txt, const char *salt, char *cbuf);
#endif
dTHXo;
#ifdef HAVE_DES_FCRYPT
dTHR;
- return des_fcrypt(txt, salt, crypt_buffer);
+ return des_fcrypt(txt, salt, w32_crypt_buffer);
#else
- die("The crypt() function is unimplemented due to excessive paranoia.");
+ Perl_croak(aTHX_ "The crypt() function is unimplemented due to excessive paranoia.");
return Nullch;
#endif
}
-#endif
#ifdef USE_FIXED_OSFHANDLE
e = GetLastError();
if (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, &source, e, 0,
- strerror_buffer, sizeof(strerror_buffer), NULL) == 0)
- strcpy(strerror_buffer, "Unknown Error");
+ w32_strerror_buffer,
+ sizeof(w32_strerror_buffer), NULL) == 0)
+ strcpy(w32_strerror_buffer, "Unknown Error");
- return strerror_buffer;
+ return w32_strerror_buffer;
}
return strerror(e);
}
if (USING_WIDE()) {
A2WHELPER(mode, wMode, sizeof(wMode));
A2WHELPER(filename, wBuffer, sizeof(wBuffer));
- return _wfopen(wBuffer, wMode);
+ return _wfopen(PerlDir_mapW(wBuffer), wMode);
}
- return fopen(filename, mode);
+ return fopen(PerlDir_mapA(filename), mode);
}
#ifndef USE_SOCKETS_AS_HANDLES
if (USING_WIDE()) {
A2WHELPER(mode, wMode, sizeof(wMode));
A2WHELPER(path, wBuffer, sizeof(wBuffer));
- return _wfreopen(wBuffer, wMode, stream);
+ return _wfreopen(PerlDir_mapW(wBuffer), wMode, stream);
}
- return freopen(path, mode, stream);
+ return freopen(PerlDir_mapA(path), mode, stream);
}
DllExport int
#endif /* USE_RTL_POPEN */
}
+static BOOL WINAPI
+Nt4CreateHardLinkW(
+ LPCWSTR lpFileName,
+ LPCWSTR lpExistingFileName,
+ LPSECURITY_ATTRIBUTES lpSecurityAttributes)
+{
+ HANDLE handle;
+ WCHAR wFullName[MAX_PATH+1];
+ LPVOID lpContext = NULL;
+ WIN32_STREAM_ID StreamId;
+ DWORD dwSize = (char*)&StreamId.cStreamName - (char*)&StreamId;
+ DWORD dwWritten;
+ DWORD dwLen;
+ BOOL bSuccess;
+
+ BOOL (__stdcall *pfnBackupWrite)(HANDLE, LPBYTE, DWORD, LPDWORD,
+ BOOL, BOOL, LPVOID*) =
+ (BOOL (__stdcall *)(HANDLE, LPBYTE, DWORD, LPDWORD,
+ BOOL, BOOL, LPVOID*))
+ GetProcAddress(GetModuleHandle("kernel32.dll"), "BackupWrite");
+ if (pfnBackupWrite == NULL)
+ return 0;
+
+ dwLen = GetFullPathNameW(lpFileName, MAX_PATH, wFullName, NULL);
+ if (dwLen == 0)
+ return 0;
+ dwLen = (dwLen+1)*sizeof(WCHAR);
+
+ handle = CreateFileW(lpExistingFileName, FILE_WRITE_ATTRIBUTES,
+ FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+ NULL, OPEN_EXISTING, 0, NULL);
+ if (handle == INVALID_HANDLE_VALUE)
+ return 0;
+
+ StreamId.dwStreamId = BACKUP_LINK;
+ StreamId.dwStreamAttributes = 0;
+ StreamId.dwStreamNameSize = 0;
+#if defined(__BORLANDC__) || defined(__MINGW32__)
+ StreamId.Size.u.HighPart = 0;
+ StreamId.Size.u.LowPart = dwLen;
+#else
+ StreamId.Size.HighPart = 0;
+ StreamId.Size.LowPart = dwLen;
+#endif
+
+ bSuccess = pfnBackupWrite(handle, (LPBYTE)&StreamId, dwSize, &dwWritten,
+ FALSE, FALSE, &lpContext);
+ if (bSuccess) {
+ bSuccess = pfnBackupWrite(handle, (LPBYTE)wFullName, dwLen, &dwWritten,
+ FALSE, FALSE, &lpContext);
+ pfnBackupWrite(handle, NULL, 0, &dwWritten, TRUE, FALSE, &lpContext);
+ }
+
+ CloseHandle(handle);
+ return bSuccess;
+}
+
+DllExport int
+win32_link(const char *oldname, const char *newname)
+{
+ dTHXo;
+ BOOL (__stdcall *pfnCreateHardLinkW)(LPCWSTR,LPCWSTR,LPSECURITY_ATTRIBUTES);
+ WCHAR wOldName[MAX_PATH];
+ WCHAR wNewName[MAX_PATH];
+
+ if (IsWin95())
+ Perl_die(aTHX_ PL_no_func, "link");
+
+ pfnCreateHardLinkW =
+ (BOOL (__stdcall *)(LPCWSTR, LPCWSTR, LPSECURITY_ATTRIBUTES))
+ GetProcAddress(GetModuleHandle("kernel32.dll"), "CreateHardLinkW");
+ if (pfnCreateHardLinkW == NULL)
+ pfnCreateHardLinkW = Nt4CreateHardLinkW;
+
+ if ((A2WHELPER(oldname, wOldName, sizeof(wOldName))) &&
+ (A2WHELPER(newname, wNewName, sizeof(wNewName))) &&
+ (wcscpy(wOldName, PerlDir_mapW(wOldName)),
+ pfnCreateHardLinkW(PerlDir_mapW(wNewName), wOldName, NULL)))
+ {
+ return 0;
+ }
+ errno = (GetLastError() == ERROR_FILE_NOT_FOUND) ? ENOENT : EINVAL;
+ return -1;
+}
+
DllExport int
win32_rename(const char *oname, const char *newname)
{
WCHAR wOldName[MAX_PATH];
WCHAR wNewName[MAX_PATH];
+ char szOldName[MAX_PATH];
BOOL bResult;
/* XXX despite what the documentation says about MoveFileEx(),
* it doesn't work under Windows95!
if (USING_WIDE()) {
A2WHELPER(oname, wOldName, sizeof(wOldName));
A2WHELPER(newname, wNewName, sizeof(wNewName));
- bResult = MoveFileExW(wOldName,wNewName,
+ wcscpy(wOldName, PerlDir_mapW(wOldName));
+ bResult = MoveFileExW(wOldName,PerlDir_mapW(wNewName),
MOVEFILE_COPY_ALLOWED|MOVEFILE_REPLACE_EXISTING);
}
else {
- bResult = MoveFileExA(oname,newname,
+ strcpy(szOldName, PerlDir_mapA(szOldName));
+ bResult = MoveFileExA(szOldName,PerlDir_mapA(newname),
MOVEFILE_COPY_ALLOWED|MOVEFILE_REPLACE_EXISTING);
}
if (!bResult) {
if (USING_WIDE()) {
A2WHELPER(path, wBuffer, sizeof(wBuffer));
- return _wopen(wBuffer, flag, pmode);
+ return _wopen(PerlDir_mapW(wBuffer), flag, pmode);
}
- return open(path,flag,pmode);
+ return open(PerlDir_mapA(path), flag, pmode);
}
DllExport int
return dup2(fd1,fd2);
}
+#ifdef PERL_MSVCRT_READFIX
+
+#define LF 10 /* line feed */
+#define CR 13 /* carriage return */
+#define CTRLZ 26 /* ctrl-z means eof for text */
+#define FOPEN 0x01 /* file handle open */
+#define FEOFLAG 0x02 /* end of file has been encountered */
+#define FCRLF 0x04 /* CR-LF across read buffer (in text mode) */
+#define FPIPE 0x08 /* file handle refers to a pipe */
+#define FAPPEND 0x20 /* file handle opened O_APPEND */
+#define FDEV 0x40 /* file handle refers to device */
+#define FTEXT 0x80 /* file handle is in text mode */
+#define MAX_DESCRIPTOR_COUNT (64*32) /* this is the maximun that MSVCRT can handle */
+
+/*
+ * Control structure for lowio file handles
+ */
+typedef struct {
+ long osfhnd; /* underlying OS file HANDLE */
+ char osfile; /* attributes of file (e.g., open in text mode?) */
+ char pipech; /* one char buffer for handles opened on pipes */
+ int lockinitflag;
+ CRITICAL_SECTION lock;
+} ioinfo;
+
+
+/*
+ * Array of arrays of control structures for lowio files.
+ */
+EXTERN_C _CRTIMP ioinfo* __pioinfo[];
+
+/*
+ * Definition of IOINFO_L2E, the log base 2 of the number of elements in each
+ * array of ioinfo structs.
+ */
+#define IOINFO_L2E 5
+
+/*
+ * Definition of IOINFO_ARRAY_ELTS, the number of elements in ioinfo array
+ */
+#define IOINFO_ARRAY_ELTS (1 << IOINFO_L2E)
+
+/*
+ * Access macros for getting at an ioinfo struct and its fields from a
+ * file handle
+ */
+#define _pioinfo(i) (__pioinfo[(i) >> IOINFO_L2E] + ((i) & (IOINFO_ARRAY_ELTS - 1)))
+#define _osfhnd(i) (_pioinfo(i)->osfhnd)
+#define _osfile(i) (_pioinfo(i)->osfile)
+#define _pipech(i) (_pioinfo(i)->pipech)
+
+int __cdecl _fixed_read(int fh, void *buf, unsigned cnt)
+{
+ int bytes_read; /* number of bytes read */
+ char *buffer; /* buffer to read to */
+ int os_read; /* bytes read on OS call */
+ char *p, *q; /* pointers into buffer */
+ char peekchr; /* peek-ahead character */
+ ULONG filepos; /* file position after seek */
+ ULONG dosretval; /* o.s. return value */
+
+ /* validate handle */
+ if (((unsigned)fh >= (unsigned)MAX_DESCRIPTOR_COUNT) ||
+ !(_osfile(fh) & FOPEN))
+ {
+ /* out of range -- return error */
+ errno = EBADF;
+ _doserrno = 0; /* not o.s. error */
+ return -1;
+ }
+
+ EnterCriticalSection(&(_pioinfo(fh)->lock)); /* lock file */
+
+ bytes_read = 0; /* nothing read yet */
+ buffer = (char*)buf;
+
+ if (cnt == 0 || (_osfile(fh) & FEOFLAG)) {
+ /* nothing to read or at EOF, so return 0 read */
+ goto functionexit;
+ }
+
+ if ((_osfile(fh) & (FPIPE|FDEV)) && _pipech(fh) != LF) {
+ /* a pipe/device and pipe lookahead non-empty: read the lookahead
+ * char */
+ *buffer++ = _pipech(fh);
+ ++bytes_read;
+ --cnt;
+ _pipech(fh) = LF; /* mark as empty */
+ }
+
+ /* read the data */
+
+ if (!ReadFile((HANDLE)_osfhnd(fh), buffer, cnt, (LPDWORD)&os_read, NULL))
+ {
+ /* ReadFile has reported an error. recognize two special cases.
+ *
+ * 1. map ERROR_ACCESS_DENIED to EBADF
+ *
+ * 2. just return 0 if ERROR_BROKEN_PIPE has occurred. it
+ * means the handle is a read-handle on a pipe for which
+ * all write-handles have been closed and all data has been
+ * read. */
+
+ if ((dosretval = GetLastError()) == ERROR_ACCESS_DENIED) {
+ /* wrong read/write mode should return EBADF, not EACCES */
+ errno = EBADF;
+ _doserrno = dosretval;
+ bytes_read = -1;
+ goto functionexit;
+ }
+ else if (dosretval == ERROR_BROKEN_PIPE) {
+ bytes_read = 0;
+ goto functionexit;
+ }
+ else {
+ bytes_read = -1;
+ goto functionexit;
+ }
+ }
+
+ bytes_read += os_read; /* update bytes read */
+
+ if (_osfile(fh) & FTEXT) {
+ /* now must translate CR-LFs to LFs in the buffer */
+
+ /* set CRLF flag to indicate LF at beginning of buffer */
+ /* if ((os_read != 0) && (*(char *)buf == LF)) */
+ /* _osfile(fh) |= FCRLF; */
+ /* else */
+ /* _osfile(fh) &= ~FCRLF; */
+
+ _osfile(fh) &= ~FCRLF;
+
+ /* convert chars in the buffer: p is src, q is dest */
+ p = q = (char*)buf;
+ while (p < (char *)buf + bytes_read) {
+ if (*p == CTRLZ) {
+ /* if fh is not a device, set ctrl-z flag */
+ if (!(_osfile(fh) & FDEV))
+ _osfile(fh) |= FEOFLAG;
+ break; /* stop translating */
+ }
+ else if (*p != CR)
+ *q++ = *p++;
+ else {
+ /* *p is CR, so must check next char for LF */
+ if (p < (char *)buf + bytes_read - 1) {
+ if (*(p+1) == LF) {
+ p += 2;
+ *q++ = LF; /* convert CR-LF to LF */
+ }
+ else
+ *q++ = *p++; /* store char normally */
+ }
+ else {
+ /* This is the hard part. We found a CR at end of
+ buffer. We must peek ahead to see if next char
+ is an LF. */
+ ++p;
+
+ dosretval = 0;
+ if (!ReadFile((HANDLE)_osfhnd(fh), &peekchr, 1,
+ (LPDWORD)&os_read, NULL))
+ dosretval = GetLastError();
+
+ if (dosretval != 0 || os_read == 0) {
+ /* couldn't read ahead, store CR */
+ *q++ = CR;
+ }
+ else {
+ /* peekchr now has the extra character -- we now
+ have several possibilities:
+ 1. disk file and char is not LF; just seek back
+ and copy CR
+ 2. disk file and char is LF; store LF, don't seek back
+ 3. pipe/device and char is LF; store LF.
+ 4. pipe/device and char isn't LF, store CR and
+ put char in pipe lookahead buffer. */
+ if (_osfile(fh) & (FDEV|FPIPE)) {
+ /* non-seekable device */
+ if (peekchr == LF)
+ *q++ = LF;
+ else {
+ *q++ = CR;
+ _pipech(fh) = peekchr;
+ }
+ }
+ else {
+ /* disk file */
+ if (peekchr == LF) {
+ /* nothing read yet; must make some
+ progress */
+ *q++ = LF;
+ /* turn on this flag for tell routine */
+ _osfile(fh) |= FCRLF;
+ }
+ else {
+ HANDLE osHandle; /* o.s. handle value */
+ /* seek back */
+ if ((osHandle = (HANDLE)_get_osfhandle(fh)) != (HANDLE)-1)
+ {
+ if ((filepos = SetFilePointer(osHandle, -1, NULL, FILE_CURRENT)) == -1)
+ dosretval = GetLastError();
+ }
+ if (peekchr != LF)
+ *q++ = CR;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /* we now change bytes_read to reflect the true number of chars
+ in the buffer */
+ bytes_read = q - (char *)buf;
+ }
+
+functionexit:
+ LeaveCriticalSection(&(_pioinfo(fh)->lock)); /* unlock file */
+
+ return bytes_read;
+}
+
+#endif /* PERL_MSVCRT_READFIX */
+
DllExport int
win32_read(int fd, void *buf, unsigned int cnt)
{
+#ifdef PERL_MSVCRT_READFIX
+ return _fixed_read(fd, buf, cnt);
+#else
return read(fd, buf, cnt);
+#endif
}
DllExport int
DllExport int
win32_mkdir(const char *dir, int mode)
{
- return mkdir(dir); /* just ignore mode */
+ dTHXo;
+ if (USING_WIDE()) {
+ WCHAR wBuffer[MAX_PATH];
+ A2WHELPER(dir, wBuffer, sizeof(wBuffer));
+ return _wmkdir(PerlDir_mapW(wBuffer));
+ }
+ return mkdir(PerlDir_mapA(dir)); /* just ignore mode */
}
DllExport int
win32_rmdir(const char *dir)
{
- return rmdir(dir);
+ dTHXo;
+ if (USING_WIDE()) {
+ WCHAR wBuffer[MAX_PATH];
+ A2WHELPER(dir, wBuffer, sizeof(wBuffer));
+ return _wrmdir(PerlDir_mapW(wBuffer));
+ }
+ return rmdir(PerlDir_mapA(dir));
}
DllExport int
win32_chdir(const char *dir)
{
+ dTHXo;
+ if (USING_WIDE()) {
+ WCHAR wBuffer[MAX_PATH];
+ A2WHELPER(dir, wBuffer, sizeof(wBuffer));
+ return _wchdir(wBuffer);
+ }
return chdir(dir);
}
+DllExport int
+win32_access(const char *path, int mode)
+{
+ dTHXo;
+ if (USING_WIDE()) {
+ WCHAR wBuffer[MAX_PATH];
+ A2WHELPER(path, wBuffer, sizeof(wBuffer));
+ return _waccess(PerlDir_mapW(wBuffer), mode);
+ }
+ return access(PerlDir_mapA(path), mode);
+}
+
+DllExport int
+win32_chmod(const char *path, int mode)
+{
+ dTHXo;
+ if (USING_WIDE()) {
+ WCHAR wBuffer[MAX_PATH];
+ A2WHELPER(path, wBuffer, sizeof(wBuffer));
+ return _wchmod(PerlDir_mapW(wBuffer), mode);
+ }
+ return chmod(PerlDir_mapA(path), mode);
+}
+
+
static char *
create_command_line(const char* command, const char * const *args)
{
char*
get_childdir(void)
{
- return NULL;
+ dTHXo;
+ char* ptr;
+ char szfilename[(MAX_PATH+1)*2];
+ if (USING_WIDE()) {
+ WCHAR wfilename[MAX_PATH+1];
+ GetCurrentDirectoryW(MAX_PATH+1, wfilename);
+ W2AHELPER(wfilename, szfilename, sizeof(szfilename));
+ }
+ else {
+ GetCurrentDirectoryA(MAX_PATH+1, szfilename);
+ }
+
+ New(0, ptr, strlen(szfilename)+1, char);
+ strcpy(ptr, szfilename);
+ return ptr;
}
void
free_childdir(char* d)
{
+ dTHXo;
+ Safefree(d);
}
return spawnvp(mode, cmdname, (char * const *)argv);
#else
dTHXo;
- DWORD ret;
+ int ret;
void* env;
char* dir;
STARTUPINFO StartupInfo;
if (mode == P_NOWAIT) {
/* asynchronous spawn -- store handle, return PID */
w32_child_handles[w32_num_children] = ProcessInformation.hProcess;
- ret = w32_child_pids[w32_num_children] = ProcessInformation.dwProcessId;
+ w32_child_pids[w32_num_children] = ProcessInformation.dwProcessId;
+ ret = (int)ProcessInformation.dwProcessId;
++w32_num_children;
}
else {
+ DWORD status;
WaitForSingleObject(ProcessInformation.hProcess, INFINITE);
- GetExitCodeProcess(ProcessInformation.hProcess, &ret);
+ GetExitCodeProcess(ProcessInformation.hProcess, &status);
+ ret = (int)status;
CloseHandle(ProcessInformation.hProcess);
}
PerlEnv_free_childdir(dir);
Safefree(cmd);
Safefree(fullcmd);
- return (int)ret;
+ return ret;
#endif
}
DllExport int
win32_execv(const char *cmdname, const char *const *argv)
{
+#ifdef USE_ITHREADS
+ dTHXo;
+ /* if this is a pseudo-forked child, we just want to spawn
+ * the new program, and return */
+ if (w32_pseudo_id)
+ return spawnv(P_WAIT, cmdname, (char *const *)argv);
+#endif
return execv(cmdname, (char *const *)argv);
}
DllExport int
win32_execvp(const char *cmdname, const char *const *argv)
{
+#ifdef USE_ITHREADS
+ dTHXo;
+ /* if this is a pseudo-forked child, we just want to spawn
+ * the new program, and return */
+ if (w32_pseudo_id)
+ return win32_spawnvp(P_WAIT, cmdname, (char *const *)argv);
+#endif
return execvp(cmdname, (char *const *)argv);
}
if (USING_WIDE()) {
WCHAR wfilename[MAX_PATH];
A2WHELPER(filename, wfilename, sizeof(wfilename));
- hModule = LoadLibraryExW(wfilename, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
+ hModule = LoadLibraryExW(PerlDir_mapW(wfilename), NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
}
else {
- hModule = LoadLibraryExA(filename, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
+ hModule = LoadLibraryExA(PerlDir_mapA(filename), NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
}
return hModule;
}
-DllExport int
-win32_add_host(char *nameId, void *data)
-{
- /*
- * This must be called before the script is parsed,
- * therefore no locking of threads is needed
- */
- dTHXo;
- struct host_link *link;
- New(1314, link, 1, struct host_link);
- link->host_data = data;
- link->nameId = nameId;
- link->next = w32_host_link;
- w32_host_link = link;
- return 1;
-}
-
-DllExport void *
-win32_get_host_data(char *nameId)
-{
- dTHXo;
- struct host_link *link = w32_host_link;
- while(link) {
- if(strEQ(link->nameId, nameId))
- return link->host_data;
- link = link->next;
- }
- return Nullch;
-}
-
/*
* Extras.
*/
XS(w32_GetCwd)
{
dXSARGS;
- SV *sv = sv_newmortal();
- /* Make one call with zero size - return value is required size */
- DWORD len = GetCurrentDirectory((DWORD)0,NULL);
- SvUPGRADE(sv,SVt_PV);
- SvGROW(sv,len);
- SvCUR(sv) = GetCurrentDirectory((DWORD) SvLEN(sv), SvPVX(sv));
+ /* Make the host for current directory */
+ char* ptr = PerlEnv_get_childdir();
/*
- * If result != 0
+ * If ptr != Nullch
* then it worked, set PV valid,
- * else leave it 'undef'
+ * else return 'undef'
*/
- EXTEND(SP,1);
- if (SvCUR(sv)) {
+ if (ptr) {
+ SV *sv = sv_newmortal();
+ sv_setpv(sv, ptr);
+ PerlEnv_free_childdir(ptr);
+
+ EXTEND(SP,1);
SvPOK_on(sv);
ST(0) = sv;
XSRETURN(1);
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "usage: Win32::SetCurrentDirectory($cwd)");
- if (SetCurrentDirectory(SvPV_nolen(ST(0))))
+ if (!PerlDir_chdir(SvPV_nolen(ST(0))))
XSRETURN_YES;
XSRETURN_NO;
XS(w32_LoginName)
{
dXSARGS;
- char *name = getlogin_buffer;
- DWORD size = sizeof(getlogin_buffer);
+ char *name = w32_getlogin_buffer;
+ DWORD size = sizeof(w32_getlogin_buffer);
EXTEND(SP,1);
if (GetUserName(name,&size)) {
/* size includes NULL */
XS(w32_DomainName)
{
dXSARGS;
-#ifndef HAS_NETWKSTAGETINFO
- /* mingw32 (and Win95) don't have NetWksta*(), so do it the old way */
- char name[256];
- DWORD size = sizeof(name);
+ HINSTANCE hNetApi32 = LoadLibrary("netapi32.dll");
+ DWORD (__stdcall *pfnNetApiBufferFree)(LPVOID Buffer);
+ DWORD (__stdcall *pfnNetWkstaGetInfo)(LPWSTR servername, DWORD level,
+ void *bufptr);
+
+ if (hNetApi32) {
+ pfnNetApiBufferFree = (DWORD (__stdcall *)(void *))
+ GetProcAddress(hNetApi32, "NetApiBufferFree");
+ pfnNetWkstaGetInfo = (DWORD (__stdcall *)(LPWSTR, DWORD, void *))
+ GetProcAddress(hNetApi32, "NetWkstaGetInfo");
+ }
EXTEND(SP,1);
- if (GetUserName(name,&size)) {
- char sid[1024];
- DWORD sidlen = sizeof(sid);
+ if (hNetApi32 && pfnNetWkstaGetInfo && pfnNetApiBufferFree) {
+ /* this way is more reliable, in case user has a local account. */
char dname[256];
DWORD dnamelen = sizeof(dname);
- SID_NAME_USE snu;
- if (LookupAccountName(NULL, name, (PSID)&sid, &sidlen,
- dname, &dnamelen, &snu)) {
- XSRETURN_PV(dname); /* all that for this */
+ struct {
+ DWORD wki100_platform_id;
+ LPWSTR wki100_computername;
+ LPWSTR wki100_langroup;
+ DWORD wki100_ver_major;
+ DWORD wki100_ver_minor;
+ } *pwi;
+ /* NERR_Success *is* 0*/
+ if (0 == pfnNetWkstaGetInfo(NULL, 100, &pwi)) {
+ if (pwi->wki100_langroup && *(pwi->wki100_langroup)) {
+ WideCharToMultiByte(CP_ACP, NULL, pwi->wki100_langroup,
+ -1, (LPSTR)dname, dnamelen, NULL, NULL);
+ }
+ else {
+ WideCharToMultiByte(CP_ACP, NULL, pwi->wki100_computername,
+ -1, (LPSTR)dname, dnamelen, NULL, NULL);
+ }
+ pfnNetApiBufferFree(pwi);
+ FreeLibrary(hNetApi32);
+ XSRETURN_PV(dname);
}
+ FreeLibrary(hNetApi32);
}
-#else
- /* this way is more reliable, in case user has a local account.
- * XXX need dynamic binding of netapi32.dll symbols or this will fail on
- * Win95. Probably makes more sense to move it into libwin32. */
- char dname[256];
- DWORD dnamelen = sizeof(dname);
- PWKSTA_INFO_100 pwi;
- EXTEND(SP,1);
- if (NERR_Success == NetWkstaGetInfo(NULL, 100, (LPBYTE*)&pwi)) {
- if (pwi->wki100_langroup && *(pwi->wki100_langroup)) {
- WideCharToMultiByte(CP_ACP, NULL, pwi->wki100_langroup,
- -1, (LPSTR)dname, dnamelen, NULL, NULL);
- }
- else {
- WideCharToMultiByte(CP_ACP, NULL, pwi->wki100_computername,
- -1, (LPSTR)dname, dnamelen, NULL, NULL);
+ else {
+ /* Win95 doesn't have NetWksta*(), so do it the old way */
+ char name[256];
+ DWORD size = sizeof(name);
+ if (hNetApi32)
+ FreeLibrary(hNetApi32);
+ if (GetUserName(name,&size)) {
+ char sid[ONE_K_BUFSIZE];
+ DWORD sidlen = sizeof(sid);
+ char dname[256];
+ DWORD dnamelen = sizeof(dname);
+ SID_NAME_USE snu;
+ if (LookupAccountName(NULL, name, (PSID)&sid, &sidlen,
+ dname, &dnamelen, &snu)) {
+ XSRETURN_PV(dname); /* all that for this */
+ }
}
- NetApiBufferFree(pwi);
- XSRETURN_PV(dname);
}
-#endif
XSRETURN_UNDEF;
}
XS(w32_GetOSVersion)
{
dXSARGS;
- OSVERSIONINFO osver;
+ OSVERSIONINFOA osver;
- osver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- if (GetVersionEx(&osver)) {
+ if (USING_WIDE()) {
+ OSVERSIONINFOW osverw;
+ char szCSDVersion[sizeof(osverw.szCSDVersion)];
+ osverw.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW);
+ if (!GetVersionExW(&osverw)) {
+ XSRETURN_EMPTY;
+ }
+ W2AHELPER(osverw.szCSDVersion, szCSDVersion, sizeof(szCSDVersion));
+ XPUSHs(newSVpvn(szCSDVersion, strlen(szCSDVersion)));
+ osver.dwMajorVersion = osverw.dwMajorVersion;
+ osver.dwMinorVersion = osverw.dwMinorVersion;
+ osver.dwBuildNumber = osverw.dwBuildNumber;
+ osver.dwPlatformId = osverw.dwPlatformId;
+ }
+ else {
+ osver.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA);
+ if (!GetVersionExA(&osver)) {
+ XSRETURN_EMPTY;
+ }
XPUSHs(newSVpvn(osver.szCSDVersion, strlen(osver.szCSDVersion)));
- XPUSHs(newSViv(osver.dwMajorVersion));
- XPUSHs(newSViv(osver.dwMinorVersion));
- XPUSHs(newSViv(osver.dwBuildNumber));
- XPUSHs(newSViv(osver.dwPlatformId));
- PUTBACK;
- return;
}
- XSRETURN_EMPTY;
+ XPUSHs(newSViv(osver.dwMajorVersion));
+ XPUSHs(newSViv(osver.dwMinorVersion));
+ XPUSHs(newSViv(osver.dwBuildNumber));
+ XPUSHs(newSViv(osver.dwPlatformId));
+ PUTBACK;
}
static
{
dXSARGS;
DWORD source = 0;
- char msgbuf[1024];
+ char msgbuf[ONE_K_BUFSIZE];
if (items != 1)
Perl_croak(aTHX_ "usage: Win32::FormatMessage($errno)");
- if (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
- &source, SvIV(ST(0)), 0,
- msgbuf, sizeof(msgbuf)-1, NULL))
- XSRETURN_PV(msgbuf);
+ if (USING_WIDE()) {
+ WCHAR wmsgbuf[ONE_K_BUFSIZE];
+ if (FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM,
+ &source, SvIV(ST(0)), 0,
+ wmsgbuf, ONE_K_BUFSIZE-1, NULL))
+ {
+ W2AHELPER(wmsgbuf, msgbuf, sizeof(msgbuf));
+ XSRETURN_PV(msgbuf);
+ }
+ }
+ else {
+ if (FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM,
+ &source, SvIV(ST(0)), 0,
+ msgbuf, sizeof(msgbuf)-1, NULL))
+ XSRETURN_PV(msgbuf);
+ }
XSRETURN_UNDEF;
}
XS(w32_CopyFile)
{
dXSARGS;
+ BOOL bResult;
if (items != 3)
Perl_croak(aTHX_ "usage: Win32::CopyFile($from, $to, $overwrite)");
- if (CopyFile(SvPV_nolen(ST(0)), SvPV_nolen(ST(1)), !SvTRUE(ST(2))))
+ if (USING_WIDE()) {
+ WCHAR wSourceFile[MAX_PATH];
+ WCHAR wDestFile[MAX_PATH];
+ A2WHELPER(SvPV_nolen(ST(0)), wSourceFile, sizeof(wSourceFile));
+ wcscpy(wSourceFile, PerlDir_mapW(wSourceFile));
+ A2WHELPER(SvPV_nolen(ST(1)), wDestFile, sizeof(wDestFile));
+ bResult = CopyFileW(wSourceFile, PerlDir_mapW(wDestFile), !SvTRUE(ST(2)));
+ }
+ else {
+ char szSourceFile[MAX_PATH];
+ strcpy(szSourceFile, PerlDir_mapA(SvPV_nolen(ST(0))));
+ bResult = CopyFileA(szSourceFile, PerlDir_mapA(SvPV_nolen(ST(1))), !SvTRUE(ST(2)));
+ }
+
+ if (bResult)
XSRETURN_YES;
XSRETURN_NO;
}
w32_fdpid = newAV(); /* XXX needs to be in Perl_win32_init()? */
New(1313, w32_children, 1, child_tab);
w32_num_children = 0;
+ w32_init_socktype = 0;
+#ifdef USE_ITHREADS
+ w32_pseudo_id = 0;
+ New(1313, w32_pseudo_children, 1, child_tab);
+ w32_num_pseudo_children = 0;
+#endif
/* these names are Activeware compatible */
newXS("Win32::GetCwd", w32_GetCwd, file);
MALLOC_INIT;
}
-#ifdef USE_BINMODE_SCRIPTS
+#ifdef USE_ITHREADS
+
+# ifdef PERL_OBJECT
+# undef Perl_sys_intern_dup
+# define Perl_sys_intern_dup CPerlObj::Perl_sys_intern_dup
+# define pPerl this
+# endif
void
-win32_strip_return(SV *sv)
-{
- char *s = SvPVX(sv);
- char *e = s+SvCUR(sv);
- char *d = s;
- while (s < e)
- {
- if (*s == '\r' && s[1] == '\n')
- {
- *d++ = '\n';
- s += 2;
- }
- else
- {
- *d++ = *s++;
- }
- }
- SvCUR_set(sv,d-SvPVX(sv));
+Perl_sys_intern_dup(pTHX_ struct interp_intern *src, struct interp_intern *dst)
+{
+ dst->perlshell_tokens = Nullch;
+ dst->perlshell_vec = (char**)NULL;
+ dst->perlshell_items = 0;
+ dst->fdpid = newAV();
+ Newz(1313, dst->children, 1, child_tab);
+ Newz(1313, dst->pseudo_children, 1, child_tab);
+ dst->pseudo_id = 0;
+ dst->children->num = 0;
+ dst->thr_intern.Winit_socktype = src->thr_intern.Winit_socktype;
}
-
#endif
#ifndef _INC_WIN32_PERL5
#define _INC_WIN32_PERL5
-#if defined(PERL_OBJECT) || defined(PERL_CAPI)
+#ifndef _WIN32_WINNT
+# define _WIN32_WINNT 0x0400 /* needed for TryEnterCriticalSection() etc. */
+#endif
+
+#if defined(PERL_OBJECT) || defined(PERL_IMPLICIT_SYS) || defined(PERL_CAPI)
# define DYNAMIC_ENV_FETCH
# define ENV_HV_NAME "___ENV_HV_NAME___"
# define HAS_GETENV_LEN
# define WIN32IO_IS_STDIO /* don't pull in custom stdio layer */
# define WIN32SCK_IS_STDSCK /* don't pull in custom wsock layer */
# ifdef PERL_GLOBAL_STRUCT
-# error PERL_GLOBAL_STRUCT cannot be defined with PERL_OBJECT
+# error PERL_GLOBAL_STRUCT cannot be defined with PERL_IMPLICIT_SYS
# endif
# define win32_get_privlib PerlEnv_lib_path
# define win32_get_sitelib PerlEnv_sitelib_path
#endif
#ifdef __GNUC__
-typedef long long __int64;
-# define Win32_Winsock
-/* GCC does not do __declspec() - render it a nop
- * and turn on options to avoid importing data
- */
-#ifndef __declspec
-# define __declspec(x)
-#endif
-# ifndef PERL_OBJECT
-# define PERL_GLOBAL_STRUCT
-# ifndef MULTIPLICITY
-# define MULTIPLICITY
-# endif
+# ifndef __int64 /* some versions seem to #define it already */
+# define __int64 long long
# endif
+# define Win32_Winsock
#endif
/* Define DllExport akin to perl's EXT,
* otherwise import it.
*/
+/* now even GCC supports __declspec() */
+
#if defined(PERL_OBJECT)
#define DllExport
#else
#define _access access
#define _chdir chdir
+#define _getpid getpid
#include <sys/types.h>
#ifndef DllMain
# define MEMBER_TO_FPTR(name) &(name)
#endif
+/* Borland C thinks that a pointer to a member variable is 12 bytes in size. */
+#define PERL_MEMBER_PTR_SIZE 12
+
#endif
#ifdef _MSC_VER /* Microsoft Visual C++ */
typedef unsigned short mode_t;
#pragma warning(disable: 4018 4035 4101 4102 4244 4245 4761)
-#ifndef PERL_OBJECT
-
/* Visual C thinks that a pointer to a member variable is 16 bytes in size. */
-#define STRUCT_MGVTBL_DEFINITION \
-struct mgvtbl { \
- union { \
- int (CPERLscope(*svt_get))(pTHX_ SV *sv, MAGIC* mg); \
- char handle_VC_problem1[16]; \
- }; \
- union { \
- int (CPERLscope(*svt_set))(pTHX_ SV *sv, MAGIC* mg); \
- char handle_VC_problem2[16]; \
- }; \
- union { \
- U32 (CPERLscope(*svt_len))(pTHX_ SV *sv, MAGIC* mg); \
- char handle_VC_problem3[16]; \
- }; \
- union { \
- int (CPERLscope(*svt_clear))(pTHX_ SV *sv, MAGIC* mg); \
- char handle_VC_problem4[16]; \
- }; \
- union { \
- int (CPERLscope(*svt_free))(pTHX_ SV *sv, MAGIC* mg); \
- char handle_VC_problem5[16]; \
- }; \
-}
-
-#define BASEOP_DEFINITION \
- OP* op_next; \
- OP* op_sibling; \
- OP* (CPERLscope(*op_ppaddr))(pTHX); \
- char handle_VC_problem[12]; \
- PADOFFSET op_targ; \
- OPCODE op_type; \
- U16 op_seq; \
- U8 op_flags; \
- U8 op_private;
-
-#endif /* PERL_OBJECT */
+#define PERL_MEMBER_PTR_SIZE 16
#endif /* _MSC_VER */
#define flushall _flushall
#define fcloseall _fcloseall
-#ifdef PERL_OBJECT
-# define MEMBER_TO_FPTR(name) &(name)
+#ifndef CP_UTF8
+# define CP_UTF8 65001
#endif
-#ifndef _O_NOINHERIT
-# define _O_NOINHERIT 0x0080
-# ifndef _NO_OLDNAMES
-# define O_NOINHERIT _O_NOINHERIT
-# endif
+#ifdef PERL_OBJECT
+# define MEMBER_TO_FPTR(name) &(name)
#endif
#ifndef _O_NOINHERIT
/* compatibility stuff for other compilers goes here */
+#if !defined(PERL_OBJECT) && defined(PERL_MEMBER_PTR_SIZE)
+# define STRUCT_MGVTBL_DEFINITION \
+struct mgvtbl { \
+ union { \
+ int (CPERLscope(*svt_get))(pTHX_ SV *sv, MAGIC* mg); \
+ char handle_VC_problem1[PERL_MEMBER_PTR_SIZE]; \
+ }; \
+ union { \
+ int (CPERLscope(*svt_set))(pTHX_ SV *sv, MAGIC* mg); \
+ char handle_VC_problem2[PERL_MEMBER_PTR_SIZE]; \
+ }; \
+ union { \
+ U32 (CPERLscope(*svt_len))(pTHX_ SV *sv, MAGIC* mg); \
+ char handle_VC_problem3[PERL_MEMBER_PTR_SIZE]; \
+ }; \
+ union { \
+ int (CPERLscope(*svt_clear))(pTHX_ SV *sv, MAGIC* mg); \
+ char handle_VC_problem4[PERL_MEMBER_PTR_SIZE]; \
+ }; \
+ union { \
+ int (CPERLscope(*svt_free))(pTHX_ SV *sv, MAGIC* mg); \
+ char handle_VC_problem5[PERL_MEMBER_PTR_SIZE]; \
+ }; \
+}
+
+# define BASEOP_DEFINITION \
+ OP* op_next; \
+ OP* op_sibling; \
+ OP* (CPERLscope(*op_ppaddr))(pTHX); \
+ char handle_VC_problem[PERL_MEMBER_PTR_SIZE-sizeof(OP*)]; \
+ PADOFFSET op_targ; \
+ OPCODE op_type; \
+ U16 op_seq; \
+ U8 op_flags; \
+ U8 op_private;
+
+#endif /* !PERL_OBJECT && PERL_MEMBER_PTR_SIZE */
+
+
START_EXTERN_C
/* For UNIX compatibility. */
#define PERL_CORE
#endif
-#ifdef USE_BINMODE_SCRIPTS
-#define PERL_SCRIPT_MODE "rb"
-EXT void win32_strip_return(struct sv *sv);
+#ifdef PERL_TEXTMODE_SCRIPTS
+# define PERL_SCRIPT_MODE "r"
#else
-#define PERL_SCRIPT_MODE "r"
-#define win32_strip_return(sv) NOOP
+# define PERL_SCRIPT_MODE "rb"
#endif
+/*
+ * Now Win32 specific per-thread data stuff
+ */
+
+struct thread_intern {
+ /* XXX can probably use one buffer instead of several */
+ char Wstrerror_buffer[512];
+ struct servent Wservent;
+ char Wgetlogin_buffer[128];
+# ifdef USE_SOCKETS_AS_HANDLES
+ int Winit_socktype;
+# endif
+# ifdef HAVE_DES_FCRYPT
+ char Wcrypt_buffer[30];
+# endif
+# ifdef USE_RTL_THREAD_API
+ void * retv; /* slot for thread return value */
+# endif
+};
+
+#ifdef USE_THREADS
+# ifndef USE_DECLSPEC_THREAD
+# define HAVE_THREAD_INTERN
+# endif /* !USE_DECLSPEC_THREAD */
+#endif /* USE_THREADS */
+
#define HAVE_INTERP_INTERN
typedef struct {
long num;
DWORD pids[MAXIMUM_WAIT_OBJECTS];
+ HANDLE handles[MAXIMUM_WAIT_OBJECTS];
} child_tab;
-struct host_link {
- char * nameId;
- void * host_data;
- struct host_link * next;
-};
-
struct interp_intern {
char * perlshell_tokens;
char ** perlshell_vec;
long perlshell_items;
struct av * fdpid;
child_tab * children;
- HANDLE child_handles[MAXIMUM_WAIT_OBJECTS];
- struct host_link * hostlist;
+#ifdef USE_ITHREADS
+ DWORD pseudo_id;
+ child_tab * pseudo_children;
+#endif
+ void * internal_host;
+#ifndef USE_THREADS
+ struct thread_intern thr_intern;
+#endif
};
#define w32_children (PL_sys_intern.children)
#define w32_num_children (w32_children->num)
#define w32_child_pids (w32_children->pids)
-#define w32_child_handles (PL_sys_intern.child_handles)
-#define w32_host_link (PL_sys_intern.hostlist)
-
-/*
- * Now Win32 specific per-thread data stuff
- */
-
+#define w32_child_handles (w32_children->handles)
+#define w32_pseudo_id (PL_sys_intern.pseudo_id)
+#define w32_pseudo_children (PL_sys_intern.pseudo_children)
+#define w32_num_pseudo_children (w32_pseudo_children->num)
+#define w32_pseudo_child_pids (w32_pseudo_children->pids)
+#define w32_pseudo_child_handles (w32_pseudo_children->handles)
+#define w32_internal_host (PL_sys_intern.internal_host)
#ifdef USE_THREADS
-# ifndef USE_DECLSPEC_THREAD
-# define HAVE_THREAD_INTERN
-
-struct thread_intern {
- /* XXX can probably use one buffer instead of several */
- char Wstrerror_buffer[512];
- struct servent Wservent;
- char Wgetlogin_buffer[128];
- char Ww32_perllib_root[MAX_PATH+1];
-# ifdef USE_SOCKETS_AS_HANDLES
- int Winit_socktype;
-# endif
-# ifdef HAVE_DES_FCRYPT
- char Wcrypt_buffer[30];
-# endif
-# ifdef USE_RTL_THREAD_API
- void * retv; /* slot for thread return value */
-# endif
-};
-# endif /* !USE_DECLSPEC_THREAD */
+# define w32_strerror_buffer (thr->i.Wstrerror_buffer)
+# define w32_getlogin_buffer (thr->i.Wgetlogin_buffer)
+# define w32_crypt_buffer (thr->i.Wcrypt_buffer)
+# define w32_servent (thr->i.Wservent)
+# define w32_init_socktype (thr->i.Winit_socktype)
+#else
+# define w32_strerror_buffer (PL_sys_intern.thr_intern.Wstrerror_buffer)
+# define w32_getlogin_buffer (PL_sys_intern.thr_intern.Wgetlogin_buffer)
+# define w32_crypt_buffer (PL_sys_intern.thr_intern.Wcrypt_buffer)
+# define w32_servent (PL_sys_intern.thr_intern.Wservent)
+# define w32_init_socktype (PL_sys_intern.thr_intern.Winit_socktype)
#endif /* USE_THREADS */
/* UNICODE<>ANSI translation helpers */
#define USING_WIDE() (PerlEnv_os_id() == VER_PLATFORM_WIN32_NT)
+#ifdef USE_ITHREADS
+# define PERL_WAIT_FOR_CHILDREN \
+ STMT_START { \
+ if (w32_pseudo_children && w32_num_pseudo_children) { \
+ long children = w32_num_pseudo_children; \
+ WaitForMultipleObjects(children, \
+ w32_pseudo_child_handles, \
+ TRUE, INFINITE); \
+ while (children) \
+ CloseHandle(w32_pseudo_child_handles[--children]); \
+ } \
+ } STMT_END
+#endif
+
/*
* This provides a layer of functions and macros to ensure extensions will
* get to use the same RTL functions as the core.
DllExport int win32_stat(const char *path, struct stat *buf);
DllExport char* win32_longpath(char *path);
DllExport int win32_ioctl(int i, unsigned int u, char *data);
+DllExport int win32_link(const char *oldname, const char *newname);
+DllExport int win32_unlink(const char *f);
DllExport int win32_utime(const char *f, struct utimbuf *t);
DllExport int win32_uname(struct utsname *n);
DllExport int win32_wait(int *status);
DllExport int win32_kill(int pid, int sig);
DllExport unsigned long win32_os_id(void);
DllExport void* win32_dynaload(const char*filename);
+DllExport int win32_access(const char *path, int mode);
+DllExport int win32_chmod(const char *path, int mode);
+DllExport int win32_getpid(void);
-#if defined(HAVE_DES_FCRYPT) || defined(PERL_OBJECT)
DllExport char * win32_crypt(const char *txt, const char *salt);
-#endif
END_EXTERN_C
#undef times
#undef alarm
#undef ioctl
+#undef unlink
#undef utime
#undef uname
#undef wait
#define getchar win32_getchar
#undef putchar
#define putchar win32_putchar
+#define access(p,m) win32_access(p,m)
+#define chmod(p,m) win32_chmod(p,m)
+
#if !defined(MYMALLOC) || !defined(PERL_CORE)
#undef malloc
#define times win32_times
#define alarm win32_alarm
#define ioctl win32_ioctl
+#define link win32_link
+#define unlink win32_unlink
#define utime win32_utime
#define uname win32_uname
#define wait win32_wait
#define rewinddir win32_rewinddir
#define closedir win32_closedir
#define os_id win32_os_id
+#define getpid win32_getpid
-#ifdef HAVE_DES_FCRYPT
#undef crypt
-#define crypt win32_crypt
-#endif
+#define crypt(t,s) win32_crypt(t,s)
#ifndef USE_WIN32_RTL_ENV
#undef getenv
struct servent*s,
const char *proto);
-#ifdef USE_THREADS
-#ifdef USE_DECLSPEC_THREAD
-__declspec(thread) struct servent myservent;
-__declspec(thread) int init_socktype;
-#else
-#define myservent (thr->i.Wservent)
-#define init_socktype (thr->i.Winit_socktype)
-#endif
-#else
-static struct servent myservent;
-#endif
-
static int wsock_started = 0;
void
#ifdef USE_SOCKETS_AS_HANDLES
#ifdef USE_THREADS
dTHX;
- if(!init_socktype) {
+ if (!w32_init_socktype) {
#endif
- int iSockOpt = SO_SYNCHRONOUS_NONALERT;
- /*
- * Enable the use of sockets as filehandles
- */
- setsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE,
- (char *)&iSockOpt, sizeof(iSockOpt));
+ int iSockOpt = SO_SYNCHRONOUS_NONALERT;
+ /*
+ * Enable the use of sockets as filehandles
+ */
+ setsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE,
+ (char *)&iSockOpt, sizeof(iSockOpt));
#ifdef USE_THREADS
- init_socktype = 1;
+ w32_init_socktype = 1;
}
#endif
#endif /* USE_SOCKETS_AS_HANDLES */
SOCKET_TEST(r = getservbyname(name, proto), NULL);
if (r) {
- r = win32_savecopyservent(&myservent, r, proto);
+ r = win32_savecopyservent(&w32_servent, r, proto);
}
return r;
}
SOCKET_TEST(r = getservbyport(port, proto), NULL);
if (r) {
- r = win32_savecopyservent(&myservent, r, proto);
+ r = win32_savecopyservent(&w32_servent, r, proto);
}
return r;
}
DWORD junk;
unsigned long th;
- DEBUG_S(PerlIO_printf(PerlIO_stderr(),
+ DEBUG_S(PerlIO_printf(Perl_debug_log,
"%p: create OS thread\n", thr));
#ifdef USE_RTL_THREAD_API
/* See comment about USE_RTL_THREAD_API in win32thread.h */
#else /* !USE_RTL_THREAD_API */
thr->self = CreateThread(NULL, 0, fn, (void*)thr, 0, &junk);
#endif /* !USE_RTL_THREAD_API */
- DEBUG_S(PerlIO_printf(PerlIO_stderr(),
+ DEBUG_S(PerlIO_printf(Perl_debug_log,
"%p: OS thread = %p, id=%ld\n", thr, thr->self, junk));
return thr->self ? 0 : -1;
}
#ifndef _WIN32THREAD_H
#define _WIN32THREAD_H
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
+#include "win32.h"
typedef struct win32_cond { LONG waiters; HANDLE sem; } perl_cond;
typedef DWORD perl_key;
if ((WaitForSingleObject((t)->self,INFINITE) == WAIT_FAILED) \
|| (GetExitCodeThread((t)->self,(LPDWORD)(avp)) == 0) \
|| (CloseHandle((t)->self) == 0)) \
- Perl_croak(aTHX_ "panic: JOIN"); \
+ Perl_croak(aTHX_ "panic: JOIN"); \
} STMT_END
#endif /* !USE_RTL_THREAD_API || _MSC_VER */
str_scat(tmp3str,tmp2str);
str_cat(tmp3str,").'\"') =~ s/&/\\$&/g, ");
str_set(tmp2str,"eval $s_");
- s = (*s == 'g' ? "ge" : "e");
+ s = (char*)(*s == 'g' ? "ge" : "e");
i++;
}
type = ops[ops[node+1].ival].ival;
}
tmpstr = walk(1+(type==OPRINT),level,ops[node+1].ival,&numarg,P_MIN);
if (!*tmpstr->str_ptr && lval_field) {
- t = saw_OFS ? "$," : "' '";
+ t = (char*)(saw_OFS ? "$," : "' '");
if (split_to_array) {
sprintf(tokenbuf,"join(%s,@Fld)",t);
str_cat(tmpstr,tokenbuf);
tmpstr = str_new(0);
if (!tmpstr->str_ptr || !*tmpstr->str_ptr) {
if (lval_field) {
- t = saw_OFS ? "$," : "' '";
+ t = (char*)(saw_OFS ? "$," : "' '");
if (split_to_array) {
sprintf(tokenbuf,"join(%s,@Fld)",t);
str_cat(tmpstr,tokenbuf);
newXS("attributes::bootstrap", XS_attributes_bootstrap, file);
}
-#ifdef PERL_OBJECT
-#define NO_XSLOCKS
-#endif /* PERL_OBJECT */
-
#include "XSUB.h"
static int