diff options
375 files changed, 21221 insertions, 12025 deletions
@@ -17,7 +17,7 @@ here are some of the more common names in the Changes file, and their current addresses (as of July 1998): Gisle Aas <gisle@aas.no> - Abigail <abigail@fnx.com> + Abigail <abigail@delanet.com> Kenneth Albanowski <kjahds@kjahds.com> Russ Allbery <rra@stanford.edu> Spider Boardman <spider@orb.nashua.nh.us> @@ -75,10 +75,1457 @@ indicator: ---------------- -Version v5.5.640 Development release working toward 5.6 +Version v5.5.650 Development release working toward v5.6 ---------------- ____________________________________________________________________________ +[ 5040] By: gsar on 2000/02/08 07:51:20 + Log: documentation patches (from Michael Schwern and Yitzchak + Scott-Thoennes) + Branch: perl + ! av.c hv.c lib/UNIVERSAL.pm pod/perlapi.pod +____________________________________________________________________________ +[ 5039] By: gsar on 2000/02/08 07:22:46 + Log: alias to $^V to $PERL_VERSION_TUPLE + Branch: perl + ! lib/English.pm pod/perlvar.pod +____________________________________________________________________________ +[ 5038] By: gsar on 2000/02/08 07:03:34 + Log: update Changes + Branch: perl + ! Changes pod/perlhist.pod +____________________________________________________________________________ +[ 5037] By: gsar on 2000/02/08 06:59:55 + Log: Windows has a somewhat different sitelib layout, and needs + $sitelib/archname added as well + Branch: perl + ! perl.c +____________________________________________________________________________ +[ 5036] By: gsar on 2000/02/08 06:59:03 + Log: change#4987 appears to have broken libs scan for platforms that + don't set ignore_versioned_solibs (Solaris is one of them); add + derivative fix from the older logic for skipping versioned .so + libs + Branch: perl + ! Configure +____________________________________________________________________________ +[ 5035] By: gsar on 2000/02/07 21:21:44 + Log: sprintf("%v"...) buffer resizing busted + Branch: perl + ! sv.c +____________________________________________________________________________ +[ 5034] By: gsar on 2000/02/07 19:16:21 + Log: update Changes + Branch: perl + ! Changes pod/perlhist.pod +____________________________________________________________________________ +[ 5033] By: gsar on 2000/02/07 19:01:08 + Log: stringify "\x{FFF}" to utf8 correctly; set SvUTF8 on "\x{XX}" + only when XX > 127 + Branch: perl + ! pp_hot.c toke.c +____________________________________________________________________________ +[ 5032] By: gsar on 2000/02/07 18:25:31 + Log: add note about printf("%v",...) + Branch: perl + ! pod/perldelta.pod +____________________________________________________________________________ +[ 5031] By: gsar on 2000/02/07 18:18:43 + Log: update Changes + Branch: perl + ! Changes Todo-5.6 +____________________________________________________________________________ +[ 5030] By: gsar on 2000/02/07 18:17:49 + Log: thinko in change#5029 + Branch: perl + ! gv.c +____________________________________________________________________________ +[ 5029] By: gsar on 2000/02/07 17:49:58 + Log: change $^U to $^WIDE_SYSTEM_CALLS; s/PL_bigchar/PL_widesyscalls/; + introduce -C switch (sets $^WIDE_SYSTEM_CALLS) + Branch: perl + ! embedvar.h gv.c intrpvar.h mg.c perl.c perlapi.h + ! pod/perlrun.pod pod/perlunicode.pod pod/perlvar.pod + ! win32/win32.h +____________________________________________________________________________ +[ 5028] By: gsar on 2000/02/07 17:10:03 + Log: perlport updates (from Peter Prymmer) + Branch: perl + ! pod/perlport.pod +____________________________________________________________________________ +[ 5027] By: gsar on 2000/02/07 16:53:47 + Log: fix up Todo-5.6 + Branch: perl + ! Todo-5.6 +____________________________________________________________________________ +[ 5026] By: gsar on 2000/02/07 16:32:31 + Log: rename Todo-5.005 to Todo-5.6 + Branch: perl + +> Todo-5.6 + - Todo-5.005 + ! MANIFEST +____________________________________________________________________________ +[ 5025] By: gsar on 2000/02/07 16:09:54 + Log: ${^Warnings} renamed to ${^WARNING_BITS} + Branch: perl + ! gv.c lib/warnings.pm mg.c pod/perltoc.pod pod/perlvar.pod + ! toke.c warnings.pl +____________________________________________________________________________ +[ 5024] By: gsar on 2000/02/07 11:47:06 + Log: various Windows tweaks: make $^E a little less buggy by saving + and restoring system error across TLS fetch; avoid needless + copying of buffers + Branch: perl + ! win32/Makefile win32/makefile.mk win32/perllib.c win32/win32.c + ! win32/win32.h +____________________________________________________________________________ +[ 5023] By: gsar on 2000/02/07 11:44:19 + Log: avoid MakeMaker setting $^W=1 + Branch: perl + ! lib/ExtUtils/MakeMaker.pm +____________________________________________________________________________ +[ 5022] By: gsar on 2000/02/07 10:38:56 + Log: up to v5.5.650 + Branch: perl + ! Changes patchlevel.h win32/Makefile win32/config_H.bc + ! win32/config_H.gc win32/config_H.vc win32/makefile.mk +____________________________________________________________________________ +[ 5021] By: gsar on 2000/02/07 10:10:31 + Log: mention threads status in pod + Branch: perl + ! ext/Thread/Thread.pm +____________________________________________________________________________ +[ 5020] By: gsar on 2000/02/07 09:57:46 + Log: tolerate NULL SITELIB_EXP + Branch: perl + ! perl.c +____________________________________________________________________________ +[ 5019] By: gsar on 2000/02/07 09:46:11 + Log: NULL-terminate PERL_INC_VERSION_LIST + Branch: perl + ! Configure perl.c win32/config.bc win32/config.gc + ! win32/config.vc win32/config_H.bc win32/config_H.gc + ! win32/config_H.vc +____________________________________________________________________________ +[ 5018] By: gsar on 2000/02/07 09:13:10 + Log: add compatible versions from $Config{inc_ver_list} to search + paths automatically (from Tom Hughes <tom@compton.nu>) + Branch: perl + ! lib/lib.pm perl.c +____________________________________________________________________________ +[ 5017] By: gsar on 2000/02/07 08:58:56 + Log: makefiles now use exetype.pl to make wperl.exe + Branch: perl + ! sv.c win32/Makefile win32/makefile.mk +____________________________________________________________________________ +[ 5016] By: gsar on 2000/02/07 08:38:25 + Log: add exetype.pl (from Jan Dubois) + Branch: perl + + win32/bin/exetype.pl + ! MANIFEST +____________________________________________________________________________ +[ 5015] By: gsar on 2000/02/07 08:29:28 + Log: pod fixes (from Abigail and M J T Guy) + Branch: perl + ! Changes README.os2 gv.c pod/perlapi.pod pod/perldebug.pod + ! pod/perldelta.pod pod/perldiag.pod pod/perlopentut.pod + ! pod/perlport.pod pod/perlvar.pod +____________________________________________________________________________ +[ 5014] By: gsar on 2000/02/07 07:09:08 + Log: clarify behavior of vec() when arguments are off the end of the + string (from M J T Guy) + Branch: perl + ! pod/perlfunc.pod +____________________________________________________________________________ +[ 5013] By: gsar on 2000/02/07 07:08:15 + Log: remove $^U dependent behaviors in runtime; chr() and sprintf('%c',...) + now return bytes all the way to 255, they will be transparently + coerced (in future) to UTF-8 when they are used in operations + involving other UTF-8 strings; C<use utf8> doesn't set $^U anymore + Branch: perl + ! lib/byte.pm lib/utf8.pm pod/perlunicode.pod pod/perlvar.pod + ! pp.c sv.c +____________________________________________________________________________ +[ 5012] By: gsar on 2000/02/07 06:36:33 + Log: partly revert change#4851, apparently POSIX::uname() may not be correct + per strict reading of standard (says Tom Christiansen) + Branch: perl + ! lib/Sys/Hostname.pm +____________________________________________________________________________ +[ 5011] By: gsar on 2000/02/07 06:26:30 + Log: allow 64-bit utf8-encoded integers (from Ilya Zakharevich) + Branch: perl + ! utf8.c utf8.h +____________________________________________________________________________ +[ 5010] By: gsar on 2000/02/06 21:27:03 + Log: fix debug code in Perl_malloc() (from Ilya Zakharevich) + Branch: perl + ! malloc.c +____________________________________________________________________________ +[ 5009] By: gsar on 2000/02/06 20:45:30 + Log: set SvUTF8 on vectors only if there are chars > 127; update copyright + years (from Gisle Aas) + Branch: perl + ! EXTERN.h INTERN.h README av.c av.h cop.h cv.h deb.c doio.c + ! doop.c dump.c form.h gv.c gv.h handy.h hv.c hv.h mg.c mg.h + ! op.c op.h perl.c perl.h perlio.c perly.y pp.c pp.h pp_ctl.c + ! pp_hot.c pp_sys.c regcomp.c regexec.c run.c scope.c sv.c sv.h + ! toke.c utf8.c utf8.h util.c util.h +____________________________________________________________________________ +[ 5008] By: gsar on 2000/02/06 19:28:31 + Log: use builtin __CYGWIN__ rather than -DCYGWIN (from Eric Fifer + <EFifer@sanwaint.com>) + Branch: perl + ! EXTERN.h XSUB.h doio.c ext/POSIX/POSIX.xs + ! ext/SDBM_File/sdbm/pair.c ext/SDBM_File/sdbm/sdbm.c + ! hints/cygwin.sh lib/ExtUtils/MM_Cygwin.pm mg.c perl.h + ! unixish.h util.c +____________________________________________________________________________ +[ 5007] By: gsar on 2000/02/06 17:47:01 + Log: reduce memory consumption of POSIX.pm (from Ilya Zakharevich) + Branch: perl + ! ext/POSIX/POSIX.pm +____________________________________________________________________________ +[ 5006] By: gsar on 2000/02/06 17:28:35 + Log: integrate cfgperl contents into mainline + Branch: perl + !> Configure config_h.SH ext/Sys/Syslog/Syslog.xs hints/hpux.sh + !> perl.h pp_sys.c +____________________________________________________________________________ +[ 5005] By: gsar on 2000/02/06 17:18:39 + Log: VOS port updates (from Paul Green <Paul_Green@stratus.com>) + Branch: perl + ! README.vos pod/perlport.pod vos/Changes vos/build.cm + ! vos/compile_perl.cm vos/config.def vos/config.h vos/config.pl + ! vos/config_h.SH_orig vos/perl.bind vos/test_vos_dummies.c + ! vos/vos_dummies.c vos/vosish.h +____________________________________________________________________________ +[ 5004] By: gsar on 2000/02/06 17:00:49 + Log: fix parse error on C<{ use strict }> and other constructs that + make the parser reenter while LEX_KNOWNEXT is active + Branch: perl + ! t/comp/use.t toke.c +____________________________________________________________________________ +[ 5003] By: gsar on 2000/02/06 14:57:30 + Log: avoid -Bforcearchive on netbsd too + Branch: perl + ! Changes hints/netbsd.sh +____________________________________________________________________________ +[ 5002] By: gsar on 2000/02/06 14:45:17 + Log: revised notes about Pod::Parser & Co. + Branch: perl + ! lib/Pod/Usage.pm pod/perldelta.pod +____________________________________________________________________________ +[ 5001] By: gsar on 2000/02/06 14:02:43 + Log: fix description of obsolete diagnostic + Branch: perl + ! pod/perldiag.pod +____________________________________________________________________________ +[ 5000] By: gsar on 2000/02/06 13:59:58 + Log: allow "\x{12ab}" even without C<use utf8> + Branch: perl + ! t/pragma/warn/toke toke.c +____________________________________________________________________________ +[ 4999] By: gsar on 2000/02/06 13:58:31 + Log: make perlbug use new-style version numbers; improve compatibility + (runs with perl 5.005); fix swapped old vs new version reporting + Branch: perl + ! utils/perlbug.PL +____________________________________________________________________________ +[ 4998] By: gsar on 2000/02/06 13:56:45 + Log: support sprintf("v%v", v1.2.3) (works on any string argument, in + fact); add tests for version tuples + Branch: perl + + t/op/ver.t + ! MANIFEST perl.c pod/perldiag.pod pod/perlfunc.pod + ! pod/perlop.pod sv.c toke.c +____________________________________________________________________________ +[ 4997] By: gsar on 2000/02/04 21:40:08 + Log: change#4970 fallout for useithreads + Branch: perl + ! sv.c +____________________________________________________________________________ +[ 4996] By: jhi on 2000/02/04 20:09:00 + Log: Largefilify offsets of tied handles. + Branch: cfgperl + ! pp_sys.c +____________________________________________________________________________ +[ 4995] By: jhi on 2000/02/04 19:54:25 + Log: Sanity check for libraries scan. + Branch: cfgperl + ! Configure config_h.SH + Branch: metaconfig + ! U/modified/libs.U +____________________________________________________________________________ +[ 4994] By: jhi on 2000/02/04 19:48:42 + Log: HP-UX largefileness doesn't like lseek being redeclared; + no more USE_LONG_LONG. + Branch: cfgperl + ! perl.h +____________________________________________________________________________ +[ 4993] By: jhi on 2000/02/04 19:18:59 + Log: fix the description as much as possible; the whole + separation into three different symbols lists is + pretty broken now. + Branch: metaconfig + ! U/modified/Cppsym.U +____________________________________________________________________________ +[ 4992] By: jhi on 2000/02/04 19:13:10 + Log: Use <syslog.h>, not <sys/syslog.h>. + Branch: cfgperl + ! Configure config_h.SH ext/Sys/Syslog/Syslog.xs +____________________________________________________________________________ +[ 4991] By: gsar on 2000/02/04 19:11:07 + Log: dmake is on CPAN now + Branch: perl + ! README.win32 +____________________________________________________________________________ +[ 4990] By: jhi on 2000/02/04 19:04:01 + Log: Re-introduce #4817 and #4964 wiped out by #4987. + Branch: cfgperl + ! Configure config_h.SH + Branch: metaconfig + ! U/threads/usethreads.U + Branch: metaconfig/U/perl + ! patchlevel.U +____________________________________________________________________________ +[ 4989] By: jhi on 2000/02/04 18:54:00 + Log: typo fix + Branch: cfgperl + ! Configure config_h.SH + Branch: metaconfig + ! U/modified/libs.U +____________________________________________________________________________ +[ 4988] By: jhi on 2000/02/04 18:34:06 + Log: Integrate with Sarathy. + Branch: cfgperl + +> ext/Sys/Syslog/Makefile.PL ext/Sys/Syslog/Syslog.pm + +> ext/Sys/Syslog/Syslog.xs + - lib/Sys/Syslog.pm + !> (integrate 37 files) +____________________________________________________________________________ +[ 4987] By: jhi on 2000/02/04 18:31:05 + Log: Configure megamaintenance. Cppsym (hopefully) final spasms; + default is to use long long if available; various nits + here and there; fixed to hpux 64-bitnes and largefileness. + Branch: cfgperl + ! Configure config_h.SH hints/hpux.sh perl.h + Branch: metaconfig + ! U/a_dvisory/quadtype.U U/modified/Cppsym.U + ! U/modified/d_gethname.U U/modified/libpth.U U/modified/libs.U + Branch: metaconfig/U/perl + ! d_fseeko.U d_ftello.U dlsrc.U uselongdbl.U uselonglong.U + ! usemultiplicity.U xs_apiversion.U +____________________________________________________________________________ +[ 4986] By: gsar on 2000/02/04 17:26:37 + Log: avoid bad cast warnings (from Robin Barker <rmb1@cise.npl.co.uk>) + Branch: perl + ! sv.c +____________________________________________________________________________ +[ 4985] By: gsar on 2000/02/04 16:43:49 + Log: avoid 'na' (spotted by Yitzchak Scott-Thoennes <sthoenna@efn.org>) + Branch: perl + ! ext/Devel/DProf/DProf.xs +____________________________________________________________________________ +[ 4984] By: gsar on 2000/02/04 08:20:05 + Log: CPAN.pm updated to v1.52 (from Andreas Koenig) + Branch: perl + ! lib/CPAN.pm lib/CPAN/FirstTime.pm lib/CPAN/Nox.pm +____________________________________________________________________________ +[ 4983] By: gsar on 2000/02/04 08:00:38 + Log: updated OpenBSD hints (From Todd C. Miller <Todd.Miller@courtesan.com>) + Branch: perl + ! hints/openbsd.sh +____________________________________________________________________________ +[ 4982] By: gsar on 2000/02/04 07:54:04 + Log: pod typos (from Gregor N. Purdy <gregor@focusresearch.com>) + Branch: perl + ! lib/Pod/Parser.pm +____________________________________________________________________________ +[ 4981] By: gsar on 2000/02/04 07:34:38 + Log: avoid assuming cc accepts -o switch (from Tom Hughes) + Branch: perl + ! Makefile.SH +____________________________________________________________________________ +[ 4980] By: gsar on 2000/02/04 07:29:59 + Log: Sys::Syslog goes the XS way (from Tom Hughes <tom@compton.nu>) + Branch: perl + + ext/Sys/Syslog/Makefile.PL ext/Sys/Syslog/Syslog.pm + + ext/Sys/Syslog/Syslog.xs + - lib/Sys/Syslog.pm + ! MANIFEST pod/perldelta.pod +____________________________________________________________________________ +[ 4979] By: gsar on 2000/02/04 07:13:19 + Log: pod updates (from David Adler, M J T Guy) + Branch: perl + ! pod/perlfaq2.pod pod/perlop.pod pod/perlsyn.pod +____________________________________________________________________________ +[ 4978] By: gsar on 2000/02/04 07:08:14 + Log: typos in config_h.SH (from Paul_Green@vos.stratus.com) + Branch: perl + ! config_h.SH +____________________________________________________________________________ +[ 4977] By: gsar on 2000/02/04 07:06:10 + Log: avoid adding null components to LD_LIBRARY_PATH, OpenBSD has trouble + with them (from Todd C. Miller <Todd.Miller@courtesan.com>) + Branch: perl + ! Makefile.SH +____________________________________________________________________________ +[ 4976] By: gsar on 2000/02/04 06:33:43 + Log: VMS update (from Dan Sugalski and Peter Prymmer) + Branch: perl + ! configure.com vms/descrip_mms.template vms/subconfigure.com +____________________________________________________________________________ +[ 4975] By: gsar on 2000/02/04 05:51:14 + Log: patch to provide more informative names for evals and anonymous + subroutines (from Ilya Zakharevich) + Branch: perl + ! ext/Devel/Peek/Peek.pm ext/Devel/Peek/Peek.xs lib/Dumpvalue.pm + ! lib/dumpvar.pl lib/perl5db.pl op.c perl.h pod/perldebug.pod + ! pod/perlvar.pod pp_ctl.c +____________________________________________________________________________ +[ 4974] By: gsar on 2000/02/04 05:05:57 + Log: off-by-one in malloc.c (from Ilya Zakharevich) + Branch: perl + ! malloc.c +____________________________________________________________________________ +[ 4973] By: gsar on 2000/02/04 05:03:00 + Log: OS/2 build fixups from Ilya Zakharevich + Branch: perl + ! ext/Devel/DProf/DProf.xs os2/Makefile.SHs t/op/fork.t +____________________________________________________________________________ +[ 4972] By: gsar on 2000/02/04 04:58:57 + Log: avoid /* within comment + Branch: perl + ! xsutils.c +____________________________________________________________________________ +[ 4971] By: gsar on 2000/02/04 04:56:09 + Log: another HINT_BYTE victim + Branch: perl + ! lib/charnames.pm +____________________________________________________________________________ +[ 4970] By: gsar on 2000/02/04 04:45:13 + Log: fix pad_alloc panic from C<my $w; sub { my($i) = @_; sub { $w } }> + Branch: perl + ! op.c scope.c scope.h t/op/closure.t toke.c +____________________________________________________________________________ +[ 4969] By: gsar on 2000/02/04 01:09:37 + Log: byte.pm and HINT_BYTE don't match (0x8, not 0x10!) + Branch: perl + ! lib/byte.pm +____________________________________________________________________________ +[ 4968] By: jhi on 2000/02/02 13:17:25 + Log: Integrate with Sarathy. + Branch: cfgperl + +> lib/Pod/Find.pm lib/Pod/ParseUtils.pm + ! Configure + !> (integrate 29 files) + +---------------- +Version v5.5.640 +---------------- + +____________________________________________________________________________ +[ 4967] By: gsar on 2000/02/02 12:22:29 + Log: update makerel for new version format + Branch: perl + ! Changes Porting/makerel +____________________________________________________________________________ +[ 4966] By: gsar on 2000/02/02 11:42:03 + Log: workaround for undefined symbol + Branch: perl + ! win32/win32.h +____________________________________________________________________________ +[ 4965] By: gsar on 2000/02/02 11:19:19 + Log: on cygwin, h_errno is now "__declspec(dllimport) int h_errno" + (from Eric Fifer <EFifer@sanwaint.com>) + Branch: perl + ! pp_sys.c +____________________________________________________________________________ +[ 4964] By: gsar on 2000/02/02 11:11:15 + Log: adjust notes on use5005threads + Branch: perl + ! Configure INSTALL README.threads +____________________________________________________________________________ +[ 4963] By: gsar on 2000/02/02 10:14:30 + Log: fix typo + Branch: perl + ! Configure +____________________________________________________________________________ +[ 4962] By: gsar on 2000/02/02 10:13:10 + Log: integrate selected changes from cfgperl (#4899,4900,4904,4918) + Branch: perl + !> Configure Porting/Glossary Porting/config.sh Porting/config_H + !> config_h.SH ext/IO/IO.xs lib/Benchmark.pm +____________________________________________________________________________ +[ 4961] By: gsar on 2000/02/02 09:55:45 + Log: PodParser-1.092 update via CPAN (from Brad Appleton) + Branch: perl + + lib/Pod/Find.pm lib/Pod/ParseUtils.pm + ! MANIFEST lib/Pod/Checker.pm t/pod/poderrs.t t/pod/poderrs.xr +____________________________________________________________________________ +[ 4960] By: gsar on 2000/02/02 08:22:31 + Log: replace misleading docs with a BUGS section + Branch: perl + ! lib/English.pm +____________________________________________________________________________ +[ 4959] By: gsar on 2000/02/02 08:16:17 + Log: remove FUD from perlfunc/use (from M J T Guy) + Branch: perl + ! pod/perlfunc.pod +____________________________________________________________________________ +[ 4958] By: gsar on 2000/02/02 08:13:04 + Log: Benchmark displays bogus CPU stats (suggested by Cedric Auzanne + <cedric.auzanne@nist.gov>) + Branch: perl + ! Changes lib/Benchmark.pm +____________________________________________________________________________ +[ 4957] By: gsar on 2000/02/02 08:04:52 + Log: fix coredump on C<"x" =~ /x/; print @-> (from Ilya Zakharevich) + Branch: perl + ! pp_hot.c +____________________________________________________________________________ +[ 4956] By: gsar on 2000/02/02 08:02:57 + Log: flock() pod talks about "adding" in the sense of "or-ing" + Branch: perl + ! pod/perlfunc.pod +____________________________________________________________________________ +[ 4955] By: gsar on 2000/02/02 07:58:35 + Log: fixes for switching files in the debugger (from Ilya Zakharevich) + Branch: perl + ! lib/perl5db.pl pod/perldebug.pod +____________________________________________________________________________ +[ 4954] By: gsar on 2000/02/02 07:53:51 + Log: use warnings rather than fiddling with $^W (from Paul Marquess) + Branch: perl + ! lib/Cwd.pm lib/English.pm lib/ExtUtils/MM_Unix.pm + ! lib/ExtUtils/MM_Win32.pm lib/ExtUtils/Manifest.pm lib/Fatal.pm + ! lib/File/Spec/Win32.pm lib/Math/BigFloat.pm + ! lib/Text/ParseWords.pm lib/utf8_heavy.pl +____________________________________________________________________________ +[ 4953] By: gsar on 2000/02/02 07:40:33 + Log: dynixptx hints tweak (from Martin J. Bligh <mbligh@sequent.com>) + Branch: perl + ! hints/dynixptx.sh +____________________________________________________________________________ +[ 4952] By: gsar on 2000/02/02 07:36:39 + Log: deltanotes on weakrefs and Pod::Parser (from Tuomas Lukka and + Brad Appleton) + Branch: perl + ! pod/perldelta.pod +____________________________________________________________________________ +[ 4951] By: gsar on 2000/02/02 06:54:22 + Log: avoid mismatched type warnings + Branch: perl + ! embed.pl perlapi.h +____________________________________________________________________________ +[ 4950] By: jhi on 2000/02/02 06:49:10 + Log: Integrate with Sarathy. + Branch: cfgperl + +> pod/perlunicode.pod + !> MANIFEST Makefile.SH lib/File/Spec/Win32.pm lib/Text/Tabs.pm + !> lib/byte.pm lib/byte_heavy.pl lib/utf8.pm lib/warnings.pm + !> makedef.pl op.c perl.h pod/perldelta.pod pp_ctl.c regcomp.c + !> regexec.c t/pragma/warn/2use utf8.h utils/perldoc.PL + !> vms/descrip_mms.template warnings.pl +____________________________________________________________________________ +[ 4949] By: gsar on 2000/02/02 06:41:17 + Log: fix broken abs2rel() (from François Allard <franka@host.ott.igs.net>) + Branch: perl + ! lib/File/Spec/Win32.pm +____________________________________________________________________________ +[ 4948] By: gsar on 2000/02/02 06:30:41 + Log: makefile tweak + Branch: perl + ! Makefile.SH +____________________________________________________________________________ +[ 4947] By: gsar on 2000/02/02 06:27:43 + Log: future-proof unknown warning categories (from Greg Bacon + <gbacon@cs.uah.edu>) + Branch: perl + ! lib/warnings.pm t/pragma/warn/2use warnings.pl +____________________________________________________________________________ +[ 4946] By: gsar on 2000/02/02 06:21:34 + Log: doc tweak (from Michael G Schwern <schwern@pobox.com>) + Branch: perl + ! lib/Text/Tabs.pm +____________________________________________________________________________ +[ 4945] By: gsar on 2000/02/02 06:03:04 + Log: more meaningful message on invalid pattern argument (from + Kevin Meltzer <KMeltzer@USCO.com>) + Branch: perl + ! utils/perldoc.PL +____________________________________________________________________________ +[ 4944] By: gsar on 2000/02/02 05:43:49 + Log: XSLoader build patch for VMS (from Craig A. Berry + <craig.berry@metamorgs.com>) + Branch: perl + ! vms/descrip_mms.template +____________________________________________________________________________ +[ 4943] By: gsar on 2000/02/02 03:40:49 + Log: reword some sections of perlunicode.pod + Branch: perl + ! pod/perlunicode.pod +____________________________________________________________________________ +[ 4942] By: gsar on 2000/02/01 21:02:01 + Log: AIX warning on undefined symbol + Branch: perl + ! makedef.pl +____________________________________________________________________________ +[ 4941] By: gsar on 2000/02/01 20:29:30 + Log: HINT_UTF8 is not propagated to the op tree anymore; add a + perlunicode.pod that reflects changes to unicode support so far + Branch: perl + + pod/perlunicode.pod + ! MANIFEST lib/byte.pm lib/byte_heavy.pl lib/utf8.pm op.c perl.h + ! pod/perldelta.pod pp_ctl.c regcomp.c regexec.c utf8.h +____________________________________________________________________________ +[ 4940] By: jhi on 2000/02/01 12:22:30 + Log: Integrate with Sarathy. + Branch: cfgperl + !> embed.pl embedvar.h global.sym gv.c intrpvar.h + !> lib/charnames.pm lib/utf8.pm mg.c objXSUB.h op.c op.h + !> perlapi.c perlapi.h pod/perlvar.pod pp.c sv.c sv.h + !> t/lib/charnames.t toke.c win32/win32.c win32/win32.h +____________________________________________________________________________ +[ 4939] By: gsar on 2000/02/01 08:52:16 + Log: export pregexec(), Tk uses it + Branch: perl + ! embed.pl global.sym objXSUB.h perlapi.c +____________________________________________________________________________ +[ 4938] By: gsar on 2000/02/01 04:00:09 + Log: mark literal utf8 in string literals properly + Branch: perl + ! toke.c +____________________________________________________________________________ +[ 4937] By: gsar on 2000/01/31 20:19:34 + Log: introduce $^U, a global bit to indicate whether system + calls should using widechar APIs; chr and sprintf "%c" also + follow this flag in the absense of "use byte"; "use utf8" + sets $^U=1 (this appears kludgey) + Branch: perl + ! embedvar.h gv.c intrpvar.h lib/charnames.pm lib/utf8.pm mg.c + ! op.c op.h perlapi.h pod/perlvar.pod pp.c sv.c sv.h + ! t/lib/charnames.t win32/win32.h +____________________________________________________________________________ +[ 4936] By: jhi on 2000/01/31 20:17:44 + Log: HP-UX (induced) fixes. + Branch: cfgperl + ! Configure config_h.SH hints/hpux.sh + Branch: metaconfig + ! U/modified/Oldconfig.U U/modified/libs.U + Branch: metaconfig/U/perl + ! quadfio.U +____________________________________________________________________________ +[ 4935] By: jhi on 2000/01/31 19:15:43 + Log: Cosmetics. + Branch: metaconfig + ! U/compline/d_gconvert.U +____________________________________________________________________________ +[ 4934] By: jhi on 2000/01/31 19:15:22 + Log: Cppsym saga continues. + Branch: cfgperl + ! Configure config_h.SH + Branch: metaconfig + ! U/modified/Cppsym.U +____________________________________________________________________________ +[ 4933] By: gsar on 2000/01/31 18:45:07 + Log: !USING_WIDE() branch is busted in win32_stat() + Branch: perl + ! win32/win32.c +____________________________________________________________________________ +[ 4932] By: jhi on 2000/01/31 06:41:47 + Log: Reveal even more symbols. + Branch: cfgperl + ! Configure config_h.SH + Branch: metaconfig + ! U/modified/Cppsym.U +____________________________________________________________________________ +[ 4931] By: jhi on 2000/01/31 06:21:41 + Log: Integrate with Sarathy. + Branch: cfgperl + - lib/caller.pm + !> (integrate 29 files) +____________________________________________________________________________ +[ 4930] By: gsar on 2000/01/31 04:57:42 + Log: runtime now looks at the SVf_UTF8 bit on the SV to decide + whether to use widechar semantics; lexer and RE engine continue + to need "use utf8" to enable unicode awareness in literals + and patterns (TODO: this needs to be fixed); $1 et al are marked + SvUTF8 if the pattern was compiled for utf8 (TODO: propagating + it from the data is probably better) + Branch: perl + ! doop.c gv.c mg.c op.c op.h pp.c pp_ctl.c pp_hot.c regcomp.c + ! sv.c t/pragma/warn/doop t/pragma/warn/pp t/pragma/warn/sv + ! t/pragma/warn/toke t/pragma/warn/utf8 toke.c utf8.h +____________________________________________________________________________ +[ 4929] By: gsar on 2000/01/31 04:17:09 + Log: remove caller.pm from change#3534 (flawed idea) + Branch: perl + - lib/caller.pm + ! MANIFEST pod/perldelta.pod pod/perlfunc.pod +____________________________________________________________________________ +[ 4928] By: gsar on 2000/01/31 04:16:01 + Log: fix factual regression (-e doesn't create temporary files anymore) + Branch: perl + ! pod/perlfilter.pod +____________________________________________________________________________ +[ 4927] By: gsar on 2000/01/30 21:27:12 + Log: introduce $^V (eq chr($revision) . chr($version) . chr($subversion)); + document version tuples + Branch: perl + ! gv.c pod/perldelta.pod pod/perlfunc.pod pod/perlop.pod + ! pod/perlvar.pod +____________________________________________________________________________ +[ 4926] By: gsar on 2000/01/28 18:10:12 + Log: implement -follow option in find2perl (from Helmut Jarausch + <jarausch@igpm.rwth-aachen.de>) + Branch: perl + ! lib/File/Find.pm x2p/find2perl.PL +____________________________________________________________________________ +[ 4925] By: gsar on 2000/01/28 18:03:28 + Log: document what chdir() without an argument does (from Mark-Jason + Dominus <mjd@plover.com>) + Branch: perl + ! pod/perlfunc.pod +____________________________________________________________________________ +[ 4924] By: gsar on 2000/01/28 17:49:34 + Log: README.cygwin update (from Eric Fifer <EFifer@sanwaint.com>) + Branch: perl + ! README.cygwin +____________________________________________________________________________ +[ 4923] By: gsar on 2000/01/28 17:10:08 + Log: avoid leaking lexicals into program being debugged (from Ilya + Zakharevich) + Branch: perl + ! lib/perl5db.pl +____________________________________________________________________________ +[ 4922] By: gsar on 2000/01/28 16:36:13 + Log: perldelta note about export list changes + Branch: perl + ! Changes pod/perldelta.pod +____________________________________________________________________________ +[ 4921] By: gsar on 2000/01/28 15:49:04 + Log: alias realpath() to abs_path() (from Tom Christiansen) + Branch: perl + ! lib/Cwd.pm +____________________________________________________________________________ +[ 4920] By: jhi on 2000/01/28 09:52:47 + Log: Cppsym fixup from Andy. + Branch: cfgperl + ! Configure config_h.SH + Branch: metaconfig + ! U/modified/Cppsym.U +____________________________________________________________________________ +[ 4919] By: jhi on 2000/01/28 09:52:22 + Log: In HP-UX no largefiles if no 64 bits. + Branch: cfgperl + ! hints/hpux.sh +____________________________________________________________________________ +[ 4918] By: jhi on 2000/01/28 09:03:37 + Log: The #4880 was too eager, the $n test is useful too. + Branch: cfgperl + ! lib/Benchmark.pm +____________________________________________________________________________ +[ 4917] By: jhi on 2000/01/28 06:27:50 + Log: Integrate with Sarathy. + Branch: cfgperl + +> pod/perlapi.pod pod/perlintern.pod + !> (integrate 39 files) +____________________________________________________________________________ +[ 4916] By: gsar on 2000/01/28 05:29:37 + Log: more exported symbols needed for build on windows + Branch: perl + ! embed.pl global.sym objXSUB.h perlapi.c pod/perlapi.pod + ! pod/perlintern.pod t/lib/thread.t win32/win32.c +____________________________________________________________________________ +[ 4915] By: gsar on 2000/01/28 03:43:52 + Log: autogenerate API listing from comments in the source (from Benjamin + Stuhl <sho_pi@hotmail.com>); fix the markup format to be more + flexible for better readability; add missing docs in sv.c; regenerate + perltoc + Branch: perl + + pod/perlapi.pod pod/perlintern.pod + ! MANIFEST XSUB.h av.c av.h cop.h cv.h embed.pl global.sym gv.c + ! gv.h handy.h hv.c hv.h intrpvar.h makedef.pl mg.c objXSUB.h + ! op.c op.h perl.c perlapi.c pod/Makefile pod/buildtoc + ! pod/perl.pod pod/perldelta.pod pod/perlguts.pod + ! pod/perltoc.pod pod/roffitall pp.h scope.h sv.c sv.h thrdvar.h + ! universal.c util.c +____________________________________________________________________________ +[ 4914] By: gsar on 2000/01/27 19:43:35 + Log: document unimplemented status of forking pipe open() on windows + Branch: perl + ! pod/perlfork.pod t/op/fork.t +____________________________________________________________________________ +[ 4913] By: jhi on 2000/01/27 11:18:51 + Log: Integrate with Sarathy. + Branch: cfgperl + !> (integrate 51 files) +____________________________________________________________________________ +[ 4912] By: jhi on 2000/01/27 10:35:48 + Log: Cppsym update continues. + Branch: cfgperl + ! Configure config_h.SH + Branch: metaconfig + ! U/modified/Cppsym.U +____________________________________________________________________________ +[ 4911] By: gsar on 2000/01/27 08:04:17 + Log: add missing flag in change#4892 + Branch: perl + ! win32/win32.c +____________________________________________________________________________ +[ 4910] By: gsar on 2000/01/27 03:56:48 + Log: various pod nits identified by installhtml (all fixed except + unresolved links) + Branch: perl + ! ext/B/B/C.pm ext/Devel/Peek/Peek.pm ext/File/Glob/Glob.pm + ! ext/IO/lib/IO/Socket/INET.pm ext/IPC/SysV/SysV.pm + ! ext/Thread/Thread.pm lib/Class/Struct.pm lib/File/Find.pm + ! lib/File/Spec/VMS.pm lib/Pod/Html.pm lib/UNIVERSAL.pm + ! pod/buildtoc pod/perlcompile.pod pod/perlfork.pod + ! pod/perlre.pod pod/perltoc.pod pod/perltodo.pod +____________________________________________________________________________ +[ 4909] By: gsar on 2000/01/26 22:45:28 + Log: typo + Branch: perl + ! Porting/p4desc +____________________________________________________________________________ +[ 4908] By: gsar on 2000/01/26 22:41:18 + Log: update p4 tool + Branch: perl + ! Porting/p4desc +____________________________________________________________________________ +[ 4907] By: gsar on 2000/01/26 21:45:41 + Log: revised attribute syntax: C<my $foo :a :b :c>, C<my $foo : a b c> + and C<my $foo : a : b : c> are all valid (from Spider Boardman) + Branch: perl + ! lib/AutoSplit.pm lib/SelfLoader.pm lib/attributes.pm + ! pod/perldelta.pod pod/perldiag.pod pod/perlsub.pod + ! t/op/attrs.t toke.c +____________________________________________________________________________ +[ 4906] By: gsar on 2000/01/26 20:16:39 + Log: pod typos and warnings (from Abigail <abigail@delanet.com>) + Branch: perl + ! README.win32 ext/B/B/Deparse.pm lib/Class/Struct.pm +____________________________________________________________________________ +[ 4905] By: gsar on 2000/01/26 19:10:26 + Log: s/STOP/CHECK/ blocks + Branch: perl + ! embedvar.h ext/B/B/Stash.pm ext/B/NOTES ext/B/O.pm intrpvar.h + ! keywords.h keywords.pl lib/constant.pm op.c perl.c perlapi.h + ! perly.c perly.y pod/perldelta.pod pod/perldiag.pod + ! pod/perlfunc.pod pod/perlmod.pod pod/perlrun.pod + ! pod/perlsub.pod pod/perltodo.pod sv.c t/op/misc.t toke.c + ! vms/perly_c.vms +____________________________________________________________________________ +[ 4904] By: jhi on 2000/01/26 13:58:18 + Log: In UNICOS and UNICOS/mk after a successful fcntl F_SETFL + of O_NONBLOCK a subsequent fcntl F_GETFL will return O_NDELAY. + Branch: cfgperl + ! ext/IO/IO.xs +____________________________________________________________________________ +[ 4903] By: jhi on 2000/01/26 11:16:34 + Log: Continue cpp symbol update. + Branch: cfgperl + ! Configure config_h.SH + Branch: metaconfig + ! U/modified/Cppsym.U +____________________________________________________________________________ +[ 4902] By: gsar on 2000/01/26 09:28:37 + Log: tweak exports list on Windows + Branch: perl + ! makedef.pl t/op/fork.t win32/win32.h +____________________________________________________________________________ +[ 4901] By: jhi on 2000/01/26 08:05:57 + Log: Integrate with Sarathy. + Branch: cfgperl + !> Changes README.win32 lib/File/Path.pm lib/Getopt/Std.pm op.c + !> pod/perldelta.pod pod/perldiag.pod t/op/grep.t + !> t/pragma/strict-vars toke.c win32/Makefile win32/makefile.mk + !> win32/win32.c win32/win32.h +____________________________________________________________________________ +[ 4900] By: jhi on 2000/01/26 07:59:05 + Log: s/d_nvpresuv/d_nv_preserves_uv/; + plus cosmetic change for #4899. + Branch: cfgperl + ! Configure Porting/Glossary Porting/config.sh Porting/config_H + ! config_h.SH + Branch: metaconfig + ! U/modified/Cppsym.U + Branch: metaconfig/U/perl + ! perlxv.U +____________________________________________________________________________ +[ 4899] By: jhi on 2000/01/26 07:46:56 + Log: Update the scan of the cpp symbols. + Branch: cfgperl + ! Configure config_h.SH + Branch: metaconfig + ! U/modified/Cppsym.U +____________________________________________________________________________ +[ 4898] By: gsar on 2000/01/26 04:49:45 + Log: allow '--' to terminate argument processing (suggested by + Marc Espie <espie@schutzenberger.liafa.jussieu.fr>) + Branch: perl + ! lib/Getopt/Std.pm +____________________________________________________________________________ +[ 4897] By: gsar on 2000/01/26 02:42:38 + Log: change#3744 should have made grep more like map instead of the + other way around + Branch: perl + ! t/op/grep.t toke.c +____________________________________________________________________________ +[ 4896] By: gsar on 2000/01/26 00:56:14 + Log: integrate cfgperl contents into mainline + Branch: perl + +> vos/config.def vos/config.pl + ! Changes + !> Configure MANIFEST config_h.SH hints/unicosmk.sh + !> lib/Benchmark.pm pod/perldelta.pod pod/perlhist.pod pp.c + !> vos/config.h vos/config_h.SH_orig +____________________________________________________________________________ +[ 4895] By: gsar on 2000/01/26 00:45:45 + Log: fix parse failure of (my $foo : bar) and similar (from Spider + Boardman) + Branch: perl + ! toke.c +____________________________________________________________________________ +[ 4894] By: gsar on 2000/01/26 00:33:53 + Log: avoid failure if directories already read by rmtree() are + deleted by another process + Branch: perl + ! lib/File/Path.pm +____________________________________________________________________________ +[ 4893] By: gsar on 2000/01/25 23:19:18 + Log: typo in change#4892 + Branch: perl + ! win32/win32.c +____________________________________________________________________________ +[ 4892] By: gsar on 2000/01/25 22:16:19 + Log: eliminate need for perl95.exe on Windows 9x by working around CRT + bug internally (from Benjamin Stuhl <sho_pi@hotmail.com>); modified + to call the fixed version of open_osfhandle() only on Windows 9x; + updated the makefiles and README.win32 to suit + Branch: perl + ! README.win32 win32/Makefile win32/makefile.mk win32/win32.c + ! win32/win32.h +____________________________________________________________________________ +[ 4891] By: gsar on 2000/01/25 20:22:01 + Log: produce redeclaration warning on C<our $foo; { our $foo; ... }> + Branch: perl + ! op.c pod/perldelta.pod pod/perldiag.pod t/pragma/strict-vars +____________________________________________________________________________ +[ 4890] By: gsar on 2000/01/25 19:21:17 + Log: update Makefile notes on the now deprecated USE_5005THREADS and + USE_OBJECT + Branch: perl + ! win32/Makefile win32/makefile.mk +____________________________________________________________________________ +[ 4889] By: jhi on 2000/01/25 14:44:55 + Log: Misedit in #4888. + Branch: cfgperl + ! pp.c +____________________________________________________________________________ +[ 4888] By: jhi on 2000/01/25 14:38:59 + Log: UNICOS/mk patches. Removing the _CRAYMPP test may be + rash but it's the best move I can think of right now. + UNICOS/mk doesn't anymore (2.0.4.82) define _CRAYMPP, + but I think it did in the past. + Removing the _CRAYMPP test fixes a legion of pack/unpack + failures (hint: SHORTSIZE=4,INTSIZE=8,LONGSIZE=8). + One subtest, t/lib/io_sock.t #14, is still failing. + Branch: cfgperl + ! Configure config_h.SH hints/unicosmk.sh pp.c + Branch: metaconfig + ! U/modified/Oldconfig.U +____________________________________________________________________________ +[ 4887] By: jhi on 2000/01/25 06:13:14 + Log: Integrate with Sarathy. + Branch: cfgperl + !> Changes Makefile.SH XSUB.h cflags.SH embed.pl globals.c + !> installperl lib/Pod/Html.pm makedef.pl mg.c objXSUB.h perl.h + !> perlapi.c perlapi.h pod/perldelta.pod pod/perldiag.pod + !> t/io/fs.t win32/Makefile win32/makefile.mk win32/perlhost.h + !> win32/perllib.c win32/win32.c win32/win32.h +____________________________________________________________________________ +[ 4886] By: gsar on 2000/01/25 02:54:00 + Log: consistently use MAX_PATH+1 buffer sizes + Branch: perl + ! win32/win32.c +____________________________________________________________________________ +[ 4885] By: gsar on 2000/01/25 02:51:35 + Log: workaround for rename('x','X') bug in Windows NT + Branch: perl + ! t/io/fs.t win32/win32.c +____________________________________________________________________________ +[ 4884] By: gsar on 2000/01/25 01:32:57 + Log: windows build fixups from uniform DLL name change to perl56.dll + Branch: perl + ! installperl makedef.pl win32/perllib.c +____________________________________________________________________________ +[ 4883] By: gsar on 2000/01/25 01:31:27 + Log: more fixes for warnings from change#4840 + Branch: perl + ! lib/Pod/Html.pm +____________________________________________________________________________ +[ 4882] By: gsar on 2000/01/24 15:35:12 + Log: assorted little nits + Branch: perl + ! mg.c win32/Makefile win32/makefile.mk win32/perlhost.h + ! win32/win32.c +____________________________________________________________________________ +[ 4881] By: gsar on 2000/01/24 14:32:31 + Log: add new warnings to perldelta + Branch: perl + ! Changes pod/perldelta.pod pod/perldiag.pod +____________________________________________________________________________ +[ 4880] By: jhi on 2000/01/24 14:14:23 + Log: From: Stephane Payrard <properler@freesurf.fr> + To: Gurusamy Sarathy <gsar@ActiveState.com> + Cc: perl5-porters@perl.org + Subject: <patch> avoid division by 0 in Benchmark.pm + Date: Mon, 24 Jan 2000 16:15:38 +0100 + Message-ID: <20000124161538.A995@freesurf.fr> + Branch: cfgperl + ! lib/Benchmark.pm +____________________________________________________________________________ +[ 4879] By: gsar on 2000/01/24 14:14:20 + Log: force linkage of the function wrappers for globals in change#4878 + Branch: perl + ! embed.pl globals.c perlapi.h win32/win32.h +____________________________________________________________________________ +[ 4878] By: gsar on 2000/01/24 13:04:45 + Log: enable function wrappers for access to globals under MULTIPLICITY + (provides binary compatibility in the face of changes in interpreter + structure) + Branch: perl + ! Makefile.SH XSUB.h cflags.SH embed.pl makedef.pl objXSUB.h + ! perl.h perlapi.c perlapi.h win32/Makefile win32/makefile.mk +____________________________________________________________________________ +[ 4877] By: jhi on 2000/01/24 11:41:57 + Log: perlhist update. + Branch: cfgperl + ! pod/perlhist.pod +____________________________________________________________________________ +[ 4876] By: jhi on 2000/01/24 11:32:07 + Log: Updates on the large file support status. + Branch: cfgperl + ! pod/perldelta.pod +____________________________________________________________________________ +[ 4875] By: jhi on 2000/01/24 11:23:16 + Log: Integrate with Sarathy. + Branch: cfgperl + !> ext/DB_File/Makefile.PL ext/NDBM_File/NDBM_File.pm + !> ext/ODBM_File/ODBM_File.pm lib/AutoSplit.pm + !> lib/Math/Complex.pm lib/Math/Trig.pm lib/Shell.pm +____________________________________________________________________________ +[ 4874] By: gsar on 2000/01/24 10:43:03 + Log: fix typos; avoid use constant for lowercase constants (produces + warnings now) + Branch: perl + ! ext/DB_File/Makefile.PL lib/Math/Complex.pm lib/Math/Trig.pm + ! lib/Shell.pm +____________________________________________________________________________ +[ 4873] By: gsar on 2000/01/24 09:40:24 + Log: avoid warnings when there's no subs to autosplit + Branch: perl + ! lib/AutoSplit.pm +____________________________________________________________________________ +[ 4872] By: jhi on 2000/01/24 09:39:01 + Log: Create a tool for converting a config_h.SH into a VOS config.h. + Branch: cfgperl + + vos/config.def vos/config.pl + ! MANIFEST vos/config.h vos/config_h.SH_orig +____________________________________________________________________________ +[ 4871] By: gsar on 2000/01/24 09:15:20 + Log: typos in change#4623 + Branch: perl + ! ext/NDBM_File/NDBM_File.pm ext/ODBM_File/ODBM_File.pm +____________________________________________________________________________ +[ 4870] By: jhi on 2000/01/24 06:43:19 + Log: Sync metaconfig units to comply with the typo fixes of #4869. + Branch: cfgperl + ! Configure config_h.SH + Branch: metaconfig + + U/modified/cf_email.U U/modified/so.U + Branch: metaconfig/U/perl + ! dlsrc.U +____________________________________________________________________________ +[ 4869] By: jhi on 2000/01/24 06:04:31 + Log: Integrate with Sarathy. + Branch: cfgperl + +> t/pragma/diagnostics.t + !> (integrate 120 files) +____________________________________________________________________________ +[ 4868] By: gsar on 2000/01/23 21:49:28 + Log: on windows, set seek position to end for files opened in append mode + (improves compatibility with Unix, avoids buffering issues) + Branch: perl + ! win32/win32.c +____________________________________________________________________________ +[ 4867] By: gsar on 2000/01/23 21:19:31 + Log: change#4866 was flawed; revert and add better fix for warning + Branch: perl + ! op.c op.h +____________________________________________________________________________ +[ 4866] By: gsar on 2000/01/23 20:43:56 + Log: optimize away runtime code for our($foo) (also avoid warnings) + Branch: perl + ! op.c +____________________________________________________________________________ +[ 4865] By: gsar on 2000/01/23 13:17:18 + Log: DB_File 1.72 update from Paul Marquess <paul.marquess@bt.com> + Branch: perl + ! ext/DB_File/Changes ext/DB_File/DB_File.pm + ! ext/DB_File/DB_File.xs ext/DB_File/version.c +____________________________________________________________________________ +[ 4864] By: gsar on 2000/01/23 13:12:31 + Log: system('VAR123=foo cmd') wasn't invoking shell (de-locale-ized patch + suggested by Dominic Dunlop <domo@computer.org>) + Branch: perl + ! doio.c +____________________________________________________________________________ +[ 4863] By: gsar on 2000/01/23 13:01:35 + Log: fix misclassified warnings + Branch: perl + ! pod/perldiag.pod +____________________________________________________________________________ +[ 4862] By: gsar on 2000/01/23 12:52:12 + Log: document bareword prototype incompatibility + Branch: perl + ! pod/perldelta.pod pod/perlsub.pod +____________________________________________________________________________ +[ 4861] By: gsar on 2000/01/23 12:32:25 + Log: faulty edit + Branch: perl + ! lib/File/stat.pm +____________________________________________________________________________ +[ 4860] By: gsar on 2000/01/23 12:23:48 + Log: s/use vars/our/g modules that aren't independently maintained on CPAN + Branch: perl + ! ext/B/B/Asmdata.pm ext/Data/Dumper/Dumper.pm + ! ext/Devel/DProf/DProf.pm ext/Fcntl/Fcntl.pm + ! ext/File/Glob/Glob.pm ext/GDBM_File/GDBM_File.pm + ! ext/IO/lib/IO/Dir.pm ext/IO/lib/IO/File.pm + ! ext/IO/lib/IO/Handle.pm ext/IO/lib/IO/Pipe.pm + ! ext/IO/lib/IO/Poll.pm ext/IO/lib/IO/Seekable.pm + ! ext/IO/lib/IO/Socket.pm ext/IO/lib/IO/Socket/INET.pm + ! ext/IO/lib/IO/Socket/UNIX.pm ext/NDBM_File/NDBM_File.pm + ! ext/ODBM_File/ODBM_File.pm ext/Opcode/Opcode.pm + ! ext/Opcode/Safe.pm ext/POSIX/POSIX.pm + ! ext/SDBM_File/SDBM_File.pm ext/Socket/Socket.pm + ! ext/Thread/Thread.pm lib/AnyDBM_File.pm lib/AutoLoader.pm + ! lib/AutoSplit.pm lib/Class/Struct.pm lib/Dumpvalue.pm + ! lib/ExtUtils/Command.pm lib/ExtUtils/Install.pm + ! lib/ExtUtils/Installed.pm lib/ExtUtils/Liblist.pm + ! lib/ExtUtils/MM_VMS.pm lib/ExtUtils/Mksymlists.pm + ! lib/ExtUtils/Packlist.pm lib/Fatal.pm lib/File/Basename.pm + ! lib/File/Compare.pm lib/File/Copy.pm lib/File/Find.pm + ! lib/File/Path.pm lib/File/stat.pm lib/FileHandle.pm + ! lib/Math/Complex.pm lib/Math/Trig.pm lib/Net/Ping.pm + ! lib/Net/hostent.pm lib/Net/netent.pm lib/Net/protoent.pm + ! lib/Net/servent.pm lib/Shell.pm lib/Test.pm + ! lib/Test/Harness.pm lib/Tie/Array.pm lib/Tie/Handle.pm + ! lib/Time/gmtime.pm lib/Time/localtime.pm lib/User/grent.pm + ! lib/User/pwent.pm lib/base.pm lib/caller.pm lib/constant.pm + ! lib/diagnostics.pm lib/fields.pm lib/lib.pm lib/strict.pm +____________________________________________________________________________ +[ 4859] By: gsar on 2000/01/23 11:29:22 + Log: fix diagnostics to report "our" vs "my" correctly + Branch: perl + ! op.c pod/perldiag.pod +____________________________________________________________________________ +[ 4858] By: gsar on 2000/01/23 10:14:46 + Log: set api_version to 5.5.0 (binary compatibility needs to get tested + more widely) + Branch: perl + ! patchlevel.h +____________________________________________________________________________ +[ 4857] By: gsar on 2000/01/23 10:04:03 + Log: disallow our($foo::bar) + Branch: perl + ! pod/perldiag.pod toke.c +____________________________________________________________________________ +[ 4856] By: gsar on 2000/01/23 09:50:54 + Log: dprofpp can't find Devel::DProf::VERSION due to change#4852 + Branch: perl + ! utils/dprofpp.PL +____________________________________________________________________________ +[ 4855] By: gsar on 2000/01/23 09:36:51 + Log: new test (from Michael G Schwern <schwern@pobox.com>) + Branch: perl + + t/pragma/diagnostics.t + ! MANIFEST +____________________________________________________________________________ +[ 4854] By: gsar on 2000/01/23 09:24:40 + Log: add PREREQ_PM to default template (suggested by Michael G Schwern + <schwern@pobox.com>) + Branch: perl + ! utils/h2xs.PL +____________________________________________________________________________ +[ 4853] By: gsar on 2000/01/23 09:08:30 + Log: cygwin update (from Eric Fifer <EFifer@sanwaint.com>) + Branch: perl + ! cygwin/Makefile.SHs hints/cygwin.sh t/io/tell.t +____________________________________________________________________________ +[ 4852] By: gsar on 2000/01/23 08:52:44 + Log: mark some extensions as "special versions" to avoid CPAN indexer + confusion (from Ilya Zakharevich) + Branch: perl + ! ext/Devel/DProf/DProf.pm ext/Devel/Peek/Peek.pm +____________________________________________________________________________ +[ 4851] By: gsar on 2000/01/23 08:48:46 + Log: prefer POSIX::uname() rather than syscalls, which require attempting + to load syscall.ph (from David Huggins-Daines <dhd@eradicator.org>) + Branch: perl + ! lib/Sys/Hostname.pm +____________________________________________________________________________ +[ 4850] By: gsar on 2000/01/23 08:36:43 + Log: integrate cfgperl contents into mainline + Branch: perl + !> Configure Policy_sh.SH Porting/Glossary Porting/config.sh + !> Porting/config_H config_h.SH perl.h +____________________________________________________________________________ +[ 4849] By: gsar on 2000/01/23 08:17:30 + Log: fix localization in while BLOCK when there is a continue BLOCK + by introducing an explicit scope (c.f. change#4848) + Branch: perl + ! op.c pp_ctl.c t/cmd/while.t +____________________________________________________________________________ +[ 4848] By: gsar on 2000/01/23 06:43:51 + Log: fix scope cleanup when next jumps to a continue block; this is rather + in the nature of a kludge; it doesn't fix the longstanding bug that + makes C<while (!$x++) { local $x = 7 } continue { print $x }> print "7" + instead of "1") + Branch: perl + ! pp_ctl.c t/cmd/while.t +____________________________________________________________________________ +[ 4847] By: gsar on 2000/01/23 04:47:25 + Log: don't warn about masked lexical in C<if (my $x = 1) { my $x; }>, + C<while (my $x = foo()) { my $x = bar(); }> etc. + Branch: perl + ! op.c +____________________________________________________________________________ +[ 4846] By: gsar on 2000/01/23 04:44:17 + Log: avoid warnings in change#4839 + Branch: perl + ! lib/Carp/Heavy.pm +____________________________________________________________________________ +[ 4845] By: gsar on 2000/01/22 13:12:38 + Log: Configure typos (from Ray Phillips <r.phillips@mailbox.uq.edu.au>) + Branch: perl + ! Changes Configure +____________________________________________________________________________ +[ 4844] By: gsar on 2000/01/22 12:46:26 + Log: wrong category for exec() warning + Branch: perl + ! op.c pod/perlop.pod +____________________________________________________________________________ +[ 4843] By: gsar on 2000/01/22 12:42:40 + Log: fix line continuations in argument lists (from Helmut Jarausch) + Branch: perl + ! lib/ExtUtils/xsubpp +____________________________________________________________________________ +[ 4842] By: gsar on 2000/01/22 12:34:39 + Log: CGI.pm upgraded to v2.56 from CPAN + Branch: perl + ! eg/cgi/index.html lib/CGI.pm lib/CGI/Apache.pm + ! lib/CGI/Cookie.pm lib/CGI/Pretty.pm lib/CGI/Switch.pm + ! t/lib/cgi-html.t +____________________________________________________________________________ +[ 4841] By: gsar on 2000/01/22 12:07:23 + Log: avoid warnings due to lack of forward declarations + Branch: perl + ! lib/Pod/Html.pm +____________________________________________________________________________ +[ 4840] By: gsar on 2000/01/22 12:04:30 + Log: heavy cleanup of Pod::Html bug fixes (from Wolfgang Laun + <wolfgang.laun@alcatel.at>) + Branch: perl + ! lib/Pod/Html.pm +____________________________________________________________________________ +[ 4839] By: gsar on 2000/01/22 11:57:24 + Log: better Carp reporting within subclassed modules (from Wolfgang Laun + <wolfgang.laun@alcatel.at>) + Branch: perl + ! lib/Carp/Heavy.pm pod/perldelta.pod +____________________________________________________________________________ +[ 4838] By: gsar on 2000/01/22 10:53:06 + Log: truncate(FH) flushes FH before truncating it + Branch: perl + ! pp_sys.c t/io/fs.t +____________________________________________________________________________ +[ 4837] By: gsar on 2000/01/22 10:37:16 + Log: #line directives without a filename leave the file name as it was + instead of setting it to the script name (from Andrew Pimlott + <andrew@pimlott.ne.mediaone.net>) + Branch: perl + ! toke.c +____________________________________________________________________________ +[ 4836] By: gsar on 2000/01/22 10:06:53 + Log: add patch for printf-style format typechecks (from Robin Barker + <rmb1@cise.npl.co.uk>); fixes for problems so identified + Branch: perl + ! XSUB.h doio.c dump.c embed.pl gv.c op.c perl.c perl.h pp_ctl.c + ! pp_hot.c pp_sys.c proto.h regcomp.c sv.c toke.c +____________________________________________________________________________ +[ 4835] By: gsar on 2000/01/22 08:42:52 + Log: From: John Tobey <jtobey@isay.com> + Date: Thu, 16 Dec 1999 20:20:38 -0500 + Message-Id: <E11ym4U-0000c7-00@einstein.localnet> + Subject: [ID 19991216.006] [PATCH 5.005_63] Reloading modules that use 'fields' + Branch: perl + ! lib/base.pm lib/fields.pm t/lib/fields.t +____________________________________________________________________________ +[ 4834] By: gsar on 2000/01/22 08:08:08 + Log: fix deeply nested closures that have no references to lexical in + intervening subs + Branch: perl + ! embed.h embed.pl op.c proto.h t/op/closure.t +____________________________________________________________________________ +[ 4833] By: gsar on 2000/01/21 17:04:21 + Log: add $VERSION + Branch: perl + ! lib/Text/Soundex.pm lib/Tie/Handle.pm +____________________________________________________________________________ +[ 4832] By: gsar on 2000/01/21 16:49:09 + Log: fix bug in dumping self-referential scalars + Branch: perl + ! ext/Data/Dumper/Dumper.pm ext/Data/Dumper/Dumper.xs + ! t/lib/dumper.t +____________________________________________________________________________ +[ 4831] By: jhi on 2000/01/21 09:16:07 + Log: Integrate with Sarathy. + Branch: cfgperl + +> t/op/exists_sub.t + !> INSTALL MANIFEST embed.h embed.pl global.sym objXSUB.h op.c + !> op.h perlapi.c pod/perldelta.pod pod/perldiag.pod + !> pod/perlfunc.pod pod/perlop.pod pod/perlvar.pod pp.c pp_hot.c + !> pp_sys.c proto.h sv.c sv.h t/pragma/warn/pp_hot + !> t/pragma/warn/pp_sys util.c utils/h2xs.PL +____________________________________________________________________________ +[ 4830] By: gsar on 2000/01/21 04:28:08 + Log: patch to report warnings on bogus filehandles passed to flock(), + more consistent warnings, from Greg Bacon <gbacon@itsc.uah.edu> + (slightly modified) + Branch: perl + ! embed.h embed.pl global.sym objXSUB.h perlapi.c + ! pod/perldiag.pod pp_hot.c pp_sys.c proto.h + ! t/pragma/warn/pp_hot t/pragma/warn/pp_sys util.c +____________________________________________________________________________ +[ 4829] By: gsar on 2000/01/21 03:43:46 + Log: typo fix + Branch: perl + ! pod/perlop.pod +____________________________________________________________________________ +[ 4828] By: gsar on 2000/01/21 03:32:31 + Log: notes about $^H and %^H from Ilya Zakharevich; substantial + fixups of faulty facts and prose + Branch: perl + ! pod/perlvar.pod +____________________________________________________________________________ +[ 4827] By: gsar on 2000/01/21 01:45:51 + Log: support for C<exists &func> (from Spider Boardman) + Branch: perl + + t/op/exists_sub.t + ! MANIFEST op.c op.h pod/perldelta.pod pod/perldiag.pod + ! pod/perlfunc.pod pp.c +____________________________________________________________________________ +[ 4826] By: gsar on 2000/01/21 01:35:46 + Log: mention the fact that open(my $foo, ...) covers all handle + constructors + Branch: perl + ! pod/perldelta.pod +____________________________________________________________________________ +[ 4825] By: gsar on 2000/01/21 01:03:34 + Log: From: Ilya Zakharevich <ilya@math.ohio-state.edu> + Date: Wed, 19 Jan 2000 15:05:11 -0500 + Message-ID: <20000119150511.A22859@monk.mps.ohio-state.edu> + Subject: [PATCH 5.005_63] h2xs goof and a depessimization + Branch: perl + ! utils/h2xs.PL +____________________________________________________________________________ +[ 4824] By: gsar on 2000/01/20 19:14:26 + Log: INSTALL updates from Andy Dougherty + Branch: perl + ! INSTALL +____________________________________________________________________________ +[ 4823] By: gsar on 2000/01/20 08:40:13 + Log: sv_true() has a superfluous test + Branch: perl + ! sv.c sv.h +____________________________________________________________________________ +[ 4822] By: bailey on 2000/01/20 02:03:35 + Log: Minor cosmetic updates + Branch: vmsperl + ! configure.com +____________________________________________________________________________ +[ 4821] By: bailey on 2000/01/20 00:25:30 + Log: Quick integration of mainline changes to date + Branch: vmsperl + +> (branch 74 files) + - eg/cgi/dna.small.gif.uu eg/cgi/wilogo.gif.uu epoc/config.h + - epoc/perl.mmp epoc/perl.pkg ext/DynaLoader/dl_cygwin.xs + - lib/Pod/PlainText.pm lib/unicode/Eq/Latin1 + - lib/unicode/Eq/Unicode lib/unicode/Jamo-2.txt + - lib/unicode/Unicode.html lib/unicode/UnicodeData-Latest.txt + - lib/warning.pm os2/POSIX.mkfifo warning.h + !> (integrate 462 files) +____________________________________________________________________________ +[ 4820] By: jhi on 2000/01/19 22:46:42 + Log: More robust inc_version_list from Andy. + Branch: cfgperl + ! Configure Porting/Glossary Porting/config.sh Porting/config_H + ! config_h.SH + Branch: metaconfig + ! U/installdirs/inc_version_list.U +____________________________________________________________________________ +[ 4819] By: jhi on 2000/01/19 17:36:56 + Log: Add NV_PRESERVES_UV. + Branch: cfgperl + ! Configure Porting/Glossary Porting/config.sh Porting/config_H + ! config_h.SH perl.h + Branch: metaconfig + ! U/protos/selecttype.U + Branch: metaconfig/U/perl + - nvpresuv.U + ! perlxv.U +____________________________________________________________________________ +[ 4818] By: jhi on 2000/01/19 08:13:05 + Log: Integrate with Sarathy. + Branch: cfgperl + !> Changes Configure win32/config.bc win32/config.gc + !> win32/config.vc win32/config_H.bc win32/config_H.gc + !> win32/config_H.vc +____________________________________________________________________________ +[ 4817] By: gsar on 2000/01/19 05:25:43 + Log: regen win32/config* + Branch: perl + ! Configure win32/config.bc win32/config.gc win32/config.vc + ! win32/config_H.bc win32/config_H.gc win32/config_H.vc +____________________________________________________________________________ +[ 4816] By: jhi on 2000/01/18 21:19:10 + Log: Policy patch from Andy for installation directories, + removing the $apiversion. + Branch: cfgperl + ! Policy_sh.SH +____________________________________________________________________________ +[ 4815] By: jhi on 2000/01/18 21:11:03 + Log: Move _GNU_SOURCE into config_h.SH awaay from Configure + as suggested by Andy. + Branch: cfgperl + ! Configure config_h.SH + Branch: metaconfig + ! U/compline/d_gnulibc.U U/modified/cc.U +____________________________________________________________________________ +[ 4814] By: gsar on 2000/01/18 20:48:10 + Log: integrate cfgperl changes into mainline + Branch: perl + ! Changes + !> Configure Porting/Glossary Porting/config.sh Porting/config_H + !> Porting/pumpkin.pod config_h.SH doop.c patchlevel.h perl.c + !> perl.h t/lib/posix.t t/op/pack.t utf8.c +____________________________________________________________________________ [ 4813] By: jhi on 2000/01/18 19:41:33 Log: metaconfig todo note from Andy. Branch: cfgperl @@ -256,256 +1703,6 @@ ____________________________________________________________________________ ! 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 @@ -20,7 +20,7 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Tue Jan 18 21:42:31 EET 2000 [metaconfig 3.0 PL70] +# Generated on Fri Feb 4 21:57:24 EET 2000 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.com) cat >/tmp/c1$$ <<EOF @@ -399,6 +399,7 @@ d_getsbyport='' d_gnulibc='' d_hasmntopt='' d_htonl='' +d_iconv='' d_inetaton='' d_int64t='' d_isascii='' @@ -600,6 +601,7 @@ i_float='' i_gdbm='' d_grpasswd='' i_grp='' +i_iconv='' i_inttypes='' i_limits='' i_locale='' @@ -671,6 +673,7 @@ i_varargs='' i_varhdr='' i_vfork='' inc_version_list='' +inc_version_list_init='' installprefix='' installprefixexp='' installstyle='' @@ -692,6 +695,9 @@ plibpth='' xlibpth='' ignore_versioned_solibs='' libs='' +libsdirs='' +libsfiles='' +libsfound='' lns='' d_PRIEldbl='' d_PRIFldbl='' @@ -760,6 +766,7 @@ subversion='' version='' perladmin='' perlpath='' +d_nv_preserves_uv='' i16size='' i16type='' i32size='' @@ -905,71 +912,6 @@ if test -f /etc/unixtovms.exe; then fi i_whoami='' -: 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 MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS" -al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM" -al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX" -al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX" -al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4 SVR5" -al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300" -al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek" -al="$al VMS Xenix286" -al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI" -al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER" -al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3" -al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000" -al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4" -al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS" -al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__" -al="$al __DGUX__ __DPX2__ __H3050R __H3050RX" -al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__" -al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__" -al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__" -al="$al __SVR4_2__ __UMAXV__" -al="$al ____386BSD____ __alpha __alpha__ __amiga" -al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__" -al="$al __host_mips__" -al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500" -al="$al __hp9000s500 __hp9000s700 __hp9000s800" -al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__" -al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__" -al="$al __m68k __m68k__ __m88100__ __m88k __m88k__" -al="$al __mc68000 __mc68000__ __mc68020 __mc68020__" -al="$al __mc68030 __mc68030__ __mc68040 __mc68040__" -al="$al __mc88100 __mc88100__ __mips __mips__" -al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__" -al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__" -al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__" -al="$al _host_mips _mips _unix" -al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent" -al="$al apollo ardent att386 att3b" -al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull" -al="$al cadmus clipper concurrent convex cray ctix" -al="$al dmert encore gcos gcx gimpel gould" -al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800" -al="$al hp9000 hp9000s300 hp9000s400 hp9000s500" -al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux" -al="$al i186 i286 i386 i486 i8086" -al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k" -al="$al ksr1 linux luna luna88k m68k m88100 m88k" -al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030" -al="$al mc68040 mc68060 mc68k mc68k32 mc700" -al="$al mc88000 mc88100 merlin mert mips mvs n16" -al="$al ncl_el ncl_mr" -al="$al news1500 news1700 news1800 news1900 news3700" -al="$al news700 news800 news900 ns16000 ns32000" -al="$al ns32016 ns32332 ns32k nsc32000 os osf" -al="$al parisc pc532 pdp11 plexus posix pyr" -al="$al riscix riscos scs sequent sgi sinix sony sony_news" -al="$al sonyrisc sparc sparclite spectrum stardent stratos" -al="$al sun sun3 sun386 svr4 sysV68 sysV88" -al="$al titan tower tower32 tower32_200 tower32_600 tower32_700" -al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200" -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. @@ -2128,7 +2070,8 @@ $eunicefix tr : Try to determine whether config.sh was made on this system case "$config_sh" in '') -myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1` +myuname=`$uname -a 2>/dev/null` +$test -z "$myuname" && myuname=`hostname 2>/dev/null` # tr '[A-Z]' '[a-z]' would not work in EBCDIC # because the A-Z/a-z are not consecutive. myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \ @@ -2194,6 +2137,7 @@ EOM $test -f /dnix && osname=dnix $test -f /lynx.os && osname=lynxos $test -f /unicos && osname=unicos && osvers=`$uname -r` + $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r` $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r` $test -f /bin/mips && /bin/mips && osname=mips $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \ @@ -2654,7 +2598,7 @@ esac' cat <<EOM -Perl can be built to take advantage of threads, on some systems. +Perl can be built to take advantage of threads on some systems. To do so, Configure must be run with -Dusethreads. Note that threading is a highly experimental feature, and @@ -2685,6 +2629,10 @@ 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. + +If you're a casual user, you probably don't want interpreter-threads +at this time. There doesn't yet exist a way to create threads from +within Perl in this model, i.e., "use Thread;" will NOT work. EOM : Default to ithreads unless overridden on command line or with : old config.sh @@ -3100,8 +3048,6 @@ if $cc -o gccvers gccvers.c; then case "$gccversion" in '') echo "You are not using GNU cc." ;; *) echo "You are using GNU cc $gccversion." - echo "Adding -D_GNU_SOURCE to ccflags." - ccflags="$ccflags -D_GNU_SOURCE" # expose glibc interfaces ;; esac else @@ -3651,7 +3597,7 @@ 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 +you want to suppress searching of shared libraries for the remainder of this configuration. EOM @@ -3739,42 +3685,43 @@ $define) esac for thislib in $libswanted; do + libname="$thislib" 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 + libstyle=shared 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 + libstyle=shared 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 + libstyle=static 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 + libstyle=static 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 + libstyle=static + libname=${thislib}_s elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then - echo "Found -l$thislib." + libstyle="static" + fi + if $test -f "$xxx"; then + eval $libscheck + fi + if $test -f "$xxx"; then + case "$libstyle" in + shared) echo "Found -l$libname (shared)." ;; + static) echo "Found -l$libname." ;; + *) echo "Found -l$libname ($libstyle)." ;; + esac case " $dflt " in *"-l$thislib "*);; - *) dflt="$dflt -l$thislib";; + *) dflt="$dflt -l$libname" + libsfound="$libsfound $xxx" + yyy=`basename $xxx` + libsfiles="$libsfiles $yyy" + yyy=`echo $xxx|sed "s@/$yyy\\$@@"` + case " $libsdirs " in + *" $yyy "*) ;; + *) libsdirs="$libsdirs $yyy" ;; + esac + ;; esac else echo "No -l$thislib." @@ -5379,9 +5326,7 @@ foreach $d (@candidates) { } if (@inc_version_list) { - print '"'; - print join('", "', @inc_version_list); - print '"'; + print join(' ', @inc_version_list); } else { # Blank space to preserve value for next Configure run. @@ -5393,9 +5338,10 @@ case "$inc_version_list" in '') if test -x $perl; then dflt=`$perl getverlist` else - dflt='' + dflt='none' fi ;; +$undef) dflt='none' ;; *) dflt="$inc_version_list" ;; esac $cat <<'EOM' @@ -5405,15 +5351,26 @@ 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. +$prefix, then the list will be empty. Answer 'none' to tell perl +to not search earlier versions. 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?' +rp='List of earlier versions to include in @INC?' . ./myread -inc_version_list="$ans" +case "$ans" in +[Nn]one) inc_version_list=' ' ;; +*) inc_version_list="$ans" ;; +esac +case "$inc_version_list" in +''|' ') + inc_version_list_init='0';; +*) inc_version_list_init=`echo $inc_version_list | + $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'` + ;; +esac $rm -f getverlist : determine whether to install perl also as /usr/bin/perl @@ -6108,7 +6065,7 @@ EOM ' ') dflt='none' ;; *) dflt="$ccdlflags" ;; esac - rp="Any special flags to pass to $cc to use dynamic loading?" + rp="Any special flags to pass to $cc to use dynamic linking?" . ./myread case "$ans" in none) ccdlflags=' ' ;; @@ -6812,7 +6769,7 @@ $cat <<EOM I need to get your e-mail address in Internet format if possible, i.e. something like user@host.domain. Please answer accurately since I have no easy means to double check it. The default value provided below -is most probably close to the reality but may not be valid from outside +is most probably close to reality but may not be valid from outside your organization... EOM @@ -7013,6 +6970,10 @@ else installsitebin="$sitebinexp" fi +: see if sqrtl exists +set sqrtl d_sqrtl +eval $inlibc + cat <<EOM Perl can be built to take advantage of long doubles which @@ -7058,6 +7019,18 @@ EOM ;; esac +case "$uselongdouble:$d_sqrtl" in +$define:$undef) + $cat <<EOM >&4 + +You requested the use of long doubles but you do not seem to have +the mathematic functions for long doubles. I'm disabling the use +of long doubles. +EOM + uselongdouble=$undef + ;; +esac + cat <<EOM Perl can be built to take advantage of long longs which @@ -7071,8 +7044,7 @@ case "$ccflags" in esac case "$uselonglong" in -$define|true|[yY]*) dflt='y';; -*) dflt='n';; +'') dflt='y';; esac rp='Try to use long longs if available?' . ./myread @@ -7260,6 +7232,7 @@ char *myname = "sprintf"; #include <stdio.h> +#define I_STDLIB $i_stdlib #ifdef I_STDLIB #include <stdlib.h> #endif @@ -8928,7 +8901,7 @@ esac set fseeko d_fseeko eval $inlibc case "$longsize" in -8) echo "(Your long is 64 bits, so in a pinch you could use fseek.)" ;; +8) echo "(Your long is 64 bits, so you could use fseek.)" ;; esac : see if fsetpos exists @@ -8954,7 +8927,7 @@ eval $inlibc set ftello d_ftello eval $inlibc case "$longsize" in -8) echo "(Your long is 64 bits, so in a pinch you could use ftell.)" ;; +8) echo "(Your long is 64 bits, so you could use ftell.)" ;; esac : see if getgrent exists @@ -9254,6 +9227,10 @@ esac set d_htonl eval $setvar +: see if iconv exists +set iconv d_iconv +eval $inlibc + : index or strchr echo " " if set index val -f; eval $csym; $val; then @@ -9543,6 +9520,356 @@ eval $setvar set nice d_nice eval $inlibc +: 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 "$d_longlong:$longlongsize" in + 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 + +: check for length of character +echo " " +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() +{ + printf("%d\n", (int)sizeof(char)); + exit(0); +} +EOCP + set try + if eval $compile_ok; then + dflt=`./try` + else + dflt='1' + echo "(I can't seem to compile the test program. Guessing...)" + fi + ;; +*) + dflt="$charsize" + ;; +esac +rp="What is the size of a character (in bytes)?" +. ./myread +charsize="$ans" +$rm -f try.c try + + +echo " " +$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 + +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() { +#ifdef INT8 + int8_t i = INT8_MAX; + uint8_t u = UINT8_MAX; + printf("int8_t\n"); +#endif +#ifdef INT16 + int16_t i = INT16_MAX; + uint16_t i = UINT16_MAX; + printf("int16_t\n"); +#endif +#ifdef INT32 + int32_t i = INT32_MAX; + uint32_t u = UINT32_MAX; + printf("int32_t\n"); +#endif +} +EOCP + +case "$i8type" in +'') case "$charsize" in + 1) i8type=char + u8type="unsigned char" + i8size=$charsize + u8size=$charsize + ;; + esac + ;; +esac +case "$i8type" in +'') set try -DINT8 + if eval $compile; then + case "`./try$exe_ext`" in + int8_t) i8type=int8_t + u8type=uint8_t + i8size=1 + u8size=1 + ;; + esac + fi + ;; +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 + ;; + 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 + ;; + *) case "$intsize" in + 4) i32type=int + u32type="unsigned int" + i32size=$intsize + u32size=$intsize + ;; + esac + ;; + esac + ;; +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 + ;; +esac +case "$i32type" in +'') if $test $intsize -ge 4; then + i32type=int + u32type="unsigned int" + i32size=$intsize + u32size=$intsize + fi + ;; +esac + +case "$i64type" in +'') case "$d_quad:$quadtype" in + define:?*) + i64type="$quadtype" + u64type="$uquadtype" + i64size=8 + u64size=8 + ;; + esac + ;; +esac + +$echo "Checking whether your NVs can preserve your UVs..." >&4 +$cat <<EOP >try.c +#include <stdio.h> +int main() { + $uvtype k = ($uvtype)~0, l; + $nvtype d; + l = k; + d = ($nvtype)l; + l = ($uvtype)d; + if (l == k) + printf("preserve\n"); + exit(0); +} +EOP +set try +if eval $compile; then + case "`./try$exe_ext`" in + preserve) d_nv_preserves_uv="$define" ;; + esac +fi +case "$d_nv_preserves_uv" in +$define) $echo "Yes, they can." 2>&1 ;; +*) $echo "No, they can't." 2>&1 + d_nv_preserves_uv="$undef" + ;; +esac + +$rm -f try.* try + : see if POSIX threads are available set pthread.h i_pthread eval $inhdr @@ -9778,119 +10105,6 @@ $define) ;; 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 @@ -10676,10 +10890,6 @@ set d_sigsetjmp 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 @@ -12113,216 +12323,6 @@ else fi -: check for length of character -echo " " -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() -{ - printf("%d\n", (int)sizeof(char)); - exit(0); -} -EOCP - set try - if eval $compile_ok; then - dflt=`./try` - else - dflt='1' - echo "(I can't seem to compile the test program. Guessing...)" - fi - ;; -*) - dflt="$charsize" - ;; -esac -rp="What is the size of a character (in bytes)?" -. ./myread -charsize="$ans" -$rm -f try.c try - - -echo " " -$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 - -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() { -#ifdef INT8 - int8_t i = INT8_MAX; - uint8_t u = UINT8_MAX; - printf("int8_t\n"); -#endif -#ifdef INT16 - int16_t i = INT16_MAX; - uint16_t i = UINT16_MAX; - printf("int16_t\n"); -#endif -#ifdef INT32 - int32_t i = INT32_MAX; - uint32_t u = UINT32_MAX; - printf("int32_t\n"); -#endif -} -EOCP - -case "$i8type" in -'') case "$charsize" in - 1) i8type=char - u8type="unsigned char" - i8size=$charsize - u8size=$charsize - ;; - esac - ;; -esac -case "$i8type" in -'') set try -DINT8 - if eval $compile; then - case "`./try$exe_ext`" in - int8_t) i8type=int8_t - u8type=uint8_t - i8size=1 - u8size=1 - ;; - esac - fi - ;; -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 - ;; - 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 - ;; - *) case "$intsize" in - 4) i32type=int - u32type="unsigned int" - i32size=$intsize - u32size=$intsize - ;; - esac - ;; - esac - ;; -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 - ;; -esac -case "$i32type" in -'') if $test $intsize -ge 4; then - i32type=int - u32type="unsigned int" - i32size=$intsize - u32size=$intsize - fi - ;; -esac - -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 @@ -12373,7 +12373,7 @@ EOCP fi fi -if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$quadtype" = Xint64_t; then +if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then $cat >try.c <<'EOCP' #include <sys/types.h> #include <inttypes.h> @@ -12894,6 +12894,7 @@ $rm -f foo* bar* case "$selecttype" in '') case "$d_select" in $define) + echo " " $cat <<EOM Checking to see what type of arguments are accepted by select(). EOM @@ -13580,6 +13581,10 @@ esac set i_fcntl eval $setvar +: see if this is a iconv.h system +set iconv.h i_iconv +eval $inhdr + : see if locale.h is available set locale.h i_locale eval $inhdr @@ -13659,57 +13664,122 @@ eval $inhdr set poll.h i_poll eval $inhdr -: get C preprocessor symbols handy echo " " -$echo $n "Hmm... $c" -echo $al | $tr ' ' $trnl >Cppsym.know -$cat <<EOSS >Cppsym +$echo "Guessing which symbols your C compiler and preprocessor define..." >&4 +$cat <<'EOSH' > Cppsym.know +a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370 +AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE +alliant alpha am29000 AM29000 amiga AMIGAOS AMIX +ansi ANSI_C_SOURCE apollo ardent atarist att386 att3b BeOS +BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4 +BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi +bull c cadmus clipper CMU COFF COMPILER_VERSION +concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX +CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO +Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS +FreeBSD GCC_NEW_VARARGS gcos gcx gimpel +GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN +H3050R H3050RX hbullx20 hcx host_mips +hp200 hp300 hp700 HP700 hp800 hp9000 +hp9000s200 hp9000s300 hp9000s400 hp9000s500 +hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE +i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 +iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64 +INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1 +LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE +LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE +Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG +LONGDOUBLE LONGLONG LP64 luna luna88k Lynx +M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF +M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3 +M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen +MATH_HAS_NO_SIDE_EFFECTS +mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040 +mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin +mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT +MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola +mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr +NetBSD news1500 news1700 news1800 news1900 news3700 +news700 news800 news900 NeXT NLS ns16000 ns32000 +ns32016 ns32332 ns32k nsc32000 +OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE +pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc +pc532 pdp11 PGC PIC plexus PORTAR posix +POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE +POSIX_C_SOURCE POSIX_SOURCE POWER +PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000 +riscix riscos RT scs SCO sequent sgi SGI_SOURCE sinix +SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE +sony sony_news sonyrisc sparc sparclite spectrum +stardent stdc STDC_EXT stratos sun sun3 sun386 +Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5 +SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44 +SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5 +sysV68 sysV88 Tek4132 Tek4300 titan +tower tower32 tower32_200 tower32_600 tower32_700 +tower32_800 tower32_850 tss +u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 +ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK +unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2 +Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286 +XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED +XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED +z8000 +EOSH +# Maybe put other stuff here too. +cat <<EOSH >>Cppsym.know +$osname +EOSH +./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a +./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b +$cat Cppsym.a Cppsym.b | $tr ' ' $trnl | sort | uniq > Cppsym.know +$rm -f Cppsym.a Cppsym.b +cat <<EOSH > Cppsym $startsh -case "\$1" in --l) list=true - shift - ;; -esac -unknown='' -case "\$list\$#" in -1|2) - for sym do - if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then - exit 0 - elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then - : - else - unknown="\$unknown \$sym" - fi - done - set X \$unknown - shift - ;; -esac -case \$# in -0) exit 1;; -esac -echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\ -#ifdef \1\\ -exit 0; _ _ _ _\1\\ \1\\ -#endif\\ -/' >Cppsym\$\$ -echo "exit 1; _ _ _" >>Cppsym\$\$ -$cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$ -case "\$list" in -true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;; -*) - sh Cppsym2\$\$ - status=\$? - ;; -esac -$rm -f Cppsym\$\$ Cppsym2\$\$ -exit \$status -EOSS +if $test \$# -gt 0; then + echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got + if $test -s Cppsym.got; then + $rm -f Cppsym.got + exit 0 + fi + $rm -f Cppsym.got + exit 1 +else + $tr " " "$trnl" | ./Cppsym.try + exit 0 +fi +EOSH chmod +x Cppsym $eunicefix Cppsym -./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true - +cat <<EOSH > Cppsym.try +$startsh +cat <<'EOCP' > try.c +#include <stdio.h> +int main() { +EOCP +$awk \\ +EOSH +cat <<'EOSH' >> Cppsym.try +'length($1) > 0 { + printf "#ifdef %s\n#if %s+0\nprintf(\"%s=%%ld\\n\", %s);\n#else\nprintf(\"%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1 + printf "#ifdef _%s\n#if _%s+0\nprintf(\"_%s=%%ld\\n\", _%s);\n#else\nprintf(\"_%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1 + printf "#ifdef __%s\n#if __%s+0\nprintf(\"__%s=%%ld\\n\", __%s);\n#else\nprintf(\"__%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1 + printf "#ifdef __%s__\n#if __%s__+0\nprintf(\"__%s__=%%ld\\n\", __%s__);\n#else\nprintf(\"__%s__\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1 +}' >> try.c +echo '}' >> try.c +EOSH +cat <<EOSH >> Cppsym.try +cc="$cc" +optimize="$optimize" +ccflags="$ccflags" +ldflags="$ldflags" +libs="$libs" +exe_ext="$exe_ext" +$cc $optimize $ccflags $ldflags -o try$exe_ext try.c $libs && ./try$exe_ext +EOSH +chmod +x Cppsym.try +$eunicefix Cppsym.try +./Cppsym < Cppsym.know > Cppsym.true : now check the C compiler for additional symbols postprocess_cc_v='' case "$osname" in @@ -13741,7 +13811,8 @@ fi $awk '/\=/ { print $0; next } { print $0"=1" }' ccsym.raw >ccsym.list -$awk '{ print $0"=1" }' Cppsym.true >ccsym.true +$awk '/\=/ { print $0; next } + { print $0"=1" }' Cppsym.true >ccsym.true $comm -13 ccsym.true ccsym.list >ccsym.own $comm -12 ccsym.true ccsym.list >ccsym.com $comm -23 ccsym.true ccsym.list >ccsym.cpp @@ -14523,6 +14594,7 @@ d_gnulibc='$d_gnulibc' d_grpasswd='$d_grpasswd' d_hasmntopt='$d_hasmntopt' d_htonl='$d_htonl' +d_iconv='$d_iconv' d_index='$d_index' d_inetaton='$d_inetaton' d_int64t='$d_int64t' @@ -14559,6 +14631,7 @@ d_msgrcv='$d_msgrcv' d_msgsnd='$d_msgsnd' d_mymalloc='$d_mymalloc' d_nice='$d_nice' +d_nv_preserves_uv='$d_nv_preserves_uv' d_off64_t='$d_off64_t' d_old_pthread_create_joinable='$d_old_pthread_create_joinable' d_oldpthreads='$d_oldpthreads' @@ -14752,6 +14825,7 @@ i_fcntl='$i_fcntl' i_float='$i_float' i_gdbm='$i_gdbm' i_grp='$i_grp' +i_iconv='$i_iconv' i_inttypes='$i_inttypes' i_limits='$i_limits' i_locale='$i_locale' @@ -14813,6 +14887,7 @@ i_varhdr='$i_varhdr' i_vfork='$i_vfork' ignore_versioned_solibs='$ignore_versioned_solibs' inc_version_list='$inc_version_list' +inc_version_list_init='$inc_version_list_init' incpath='$incpath' inews='$inews' installarchlib='$installarchlib' @@ -14847,6 +14922,9 @@ libc='$libc' libperl='$libperl' libpth='$libpth' libs='$libs' +libsdirs='$libsdirs' +libsfiles='$libsfiles' +libsfound='$libsfound' libswanted='$libswanted' line='$line' lint='$lint' @@ -1,6 +1,6 @@ /* EXTERN.h * - * Copyright (c) 1991-1999, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -40,7 +40,7 @@ # define dEXTCONST const # endif # else -# if defined(CYGWIN) && defined(USEIMPORTLIB) +# if defined(__CYGWIN__) && defined(USEIMPORTLIB) # define EXT extern __declspec(dllimport) # define dEXT # define EXTCONST extern __declspec(dllimport) const @@ -8,7 +8,8 @@ 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: +The basic steps to build and install perl5 on a Unix system +with all the defaults are: rm -f config.sh Policy.sh sh Configure -de @@ -42,20 +43,6 @@ For information on what's new in this release, see the pod/perldelta.pod file. For more detailed information about specific changes, see the Changes file. -IMPORTANT NOTE: 5.005_53 and later releases do not export unadorned -global symbols anymore. This means you may need to build older -extensions that have not been updated for the new naming convention -with: - - perl Makefile.PL POLLUTE=1 - -Alternatively, you can enable CPP symbol pollution wholesale by -building perl itself with: - - sh Configure -Accflags=-DPERL_POLLUTE - -pod/perldelta.pod contains more details about this. - =head1 DESCRIPTION This document is written in pod format as an easy way to indicate its @@ -67,7 +54,8 @@ by lines beginning with '='. The other mark-up used is C<code> literal code L<name> A link (cross reference) to name -You should probably at least skim through this entire document before +Although most of the defaults are probably fine for most users, +you should probably at least skim through this entire document before proceeding. If you're building Perl on a non-Unix system, you should also read @@ -80,6 +68,22 @@ system. (Unixware users should use the svr4.sh hint file.) If there is a README file for your platform, then you should read that too. Additional information is in the Porting/ directory. +=head1 WARNING: This version requires an extra step to build old extensions. + +5.005_53 and later releases do not export unadorned +global symbols anymore. This means you may need to build older +extensions that have not been updated for the new naming convention +with: + + perl Makefile.PL POLLUTE=1 + +Alternatively, you can enable CPP symbol pollution wholesale by +building perl itself with: + + sh Configure -Accflags=-DPERL_POLLUTE + +pod/perldelta.pod contains more details about this. + =head1 WARNING: This version may not be binary compatible with Perl 5.005. Using the default Configure options for building perl should get you @@ -102,7 +106,7 @@ The standard extensions supplied with Perl will be handled automatically. On a related issue, old modules may possibly be affected by the changes in the Perl language in the current release. Please see pod/perldelta.pod (and pod/perl500Xdelta.pod) for a description of -what's changed. See also your installed copy of the perllocal.pod +what's changed. See your installed copy of the perllocal.pod file for a (possibly incomplete) list of locally installed modules. Also see CPAN::autobundle for one way to make a "bundle" of your currently installed modules. @@ -126,10 +130,10 @@ followed. This will enable us to officially support this option. =head1 Space Requirements -The complete perl5 source tree takes up about 15 MB of disk space. -After completing make, it takes up roughly 20 MB, though the actual +The complete perl5 source tree takes up about 20 MB of disk space. +After completing make, it takes up roughly 30 MB, though the actual total is likely to be quite system-dependent. The installation -directories need something on the order of 15 MB, though again that +directories need something on the order of 20 MB, though again that value is system-dependent. =head1 Start with a Fresh Distribution @@ -333,7 +337,7 @@ The directories set up by Configure fall into three broad categories. =item Directories for the perl distribution -By default, Configure will use the following directories for 5.6. +By default, Configure will use the following directories for 5.6.0. $version is the full perl version number, including subversion, e.g. 5.6.0 or 5.6.1, and $archname is a string like sun4-sunos, determined by Configure. The full definitions of all Configure @@ -360,8 +364,7 @@ the common style is shown here. 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. $version -is the perl version number, e.g. 5.6.0. +be used for installing those add-on modules and scripts. Configure variable Default value $siteprefix $prefix @@ -582,7 +585,7 @@ If the generated Policy.sh file is unsuitable, you may freely edit it to contain any valid shell commands. It will be run just after the platform-specific hints files. -Note: Since the directory hierarchy for 5.6 contains a number of +Note: Since the directory hierarchy for 5.6.0 contains a number of new vendor* and site* entries, your Policy.sh file will probably not set them to your desired values. I encourage you to run Configure interactively to be sure it puts things where you want them. @@ -881,7 +884,17 @@ the Configure command line. Similarly, the Opcode extension is always built by default, but you can skip it by setting the Configure variable useopcode=false either in a hint file for from the command line. -You can learn more about each of these extensions by consulting the +If you unpack any additional extensions in the ext/ directory before +running Configure, then Configure will offer to build those additional +extensions as well. Most users probably shouldn't have to do this -- +it is usually easier to build additional extensions later after perl +has been installed. However, if you wish to have those additional +extensions statically linked into the perl binary, then this offers a +convenient way to do that in one step. (It is not necessary, however; +you can build and install extensions just fine even if you don't have +dynamic loading. See lib/ExtUtils/MakeMaker.pm for more details.) + +You can learn more about each of the supplied extensions by consulting the documentation in the individual .pm modules, located under the ext/ subdirectory. @@ -904,7 +917,7 @@ to turn off each extension: SDBM_File (Always included by default) Opcode useopcode Socket d_socket - Threads usethreads + Threads use5005threads attrs (Always included by default) Thus to skip the NDBM_File extension, you can use @@ -1133,8 +1146,9 @@ $ccflags or $optimize, and then re-run =item No sh -If you don't have sh, you'll have to copy the sample file Porting/config_H -to config.h and edit the config.h to reflect your system's peculiarities. +If you don't have sh, you'll have to copy the sample file +Porting/config.sh to config.sh and edit your config.sh to reflect your +system's peculiarities. See Porting/pumpkin.pod for more information. You'll probably also have to extensively modify the extension building mechanism. @@ -1179,7 +1193,7 @@ libgdbm under HP-UX 11. Specific information for the OS/2, Plan9, VMS and Win32 ports is in the corresponding README files and subdirectories. Additional information, including a glossary of all those config.sh variables, is in the Porting -subdirectory. Especially Porting/Glossary should come in handy. +subdirectory. Especially Porting/Glossary should come in handy. Ports for other systems may also be available. You should check out http://www.perl.com/CPAN/ports for current information on ports to @@ -1704,8 +1718,9 @@ searched by version 5.6.0 will be /usr/local/lib/perl5/site_perl/5.005/$archname /usr/local/lib/perl5/site_perl/5.005 + /usr/local/lib/perl5/site_perl/ -Notice the last two entries -- Perl understands the default structure +Notice the last three 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.0. Further, @@ -1714,11 +1729,8 @@ 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.0 will look in - - /usr/local/lib/perl5/site_perl/ - -for 5.004-era pure perl modules. +The last entry, /usr/local/lib/perl5/site_perl/, is there so that +5.6.0 will look for 5.004-era pure perl modules. 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 @@ -1775,15 +1787,15 @@ yet. =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.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 -for installed module information. +Most extensions built and installed with versions of perl +prior to 5.005_50 will not need to be recompiled to be used with +5.6.0. If you find you do need to rebuild an extension with 5.6.0, +you may safely do so without disturbing the 5.005 installation. +(See L<"Coexistence with earlier versions of perl5"> above.) + +See 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 for installed module information. =head1 Coexistence with perl4 @@ -1,6 +1,6 @@ /* INTERN.h * - * Copyright (c) 1991-1999, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -53,7 +53,7 @@ README.vms Notes about VMS port README.vos Notes about Stratus VOS port README.win32 Notes about Win32 port Todo The Wishlist -Todo-5.005 What needs doing before 5.005 release +Todo-5.6 What needs doing before/during the 5.6.x release cycle XSUB.h Include file for extension subroutines apollo/netinet/in.h Apollo DomainOS port: C header file frontend av.c Array value code @@ -364,6 +364,9 @@ ext/SDBM_File/typemap SDBM extension interface types ext/Socket/Makefile.PL Socket extension makefile writer ext/Socket/Socket.pm Socket extension Perl module ext/Socket/Socket.xs Socket extension external subroutines +ext/Sys/Syslog/Makefile.PL Sys::Syslog extension makefile writer +ext/Sys/Syslog/Syslog.pm Sys::Syslog extension Perl module +ext/Sys/Syslog/Syslog.xs Sys::Syslog extension external subroutines ext/Thread/Makefile.PL Thread extension makefile writer ext/Thread/Notes Thread notes ext/Thread/README Thread README @@ -626,10 +629,12 @@ lib/Net/netent.pm By-name interface to Perl's builtin getnet* lib/Net/protoent.pm By-name interface to Perl's builtin getproto* lib/Net/servent.pm By-name interface to Perl's builtin getserv* lib/Pod/Checker.pm Pod-Parser - check POD documents for syntax errors +lib/Pod/Find.pm used by pod/splitpod 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/ParseUtils.pm Pod-Parser - pod utility functions lib/Pod/Parser.pm Pod-Parser - define base class for parsing POD lib/Pod/Select.pm Pod-Parser - select portions of POD docs lib/Pod/Text.pm Pod-Parser - convert POD data to formatted ASCII text @@ -642,7 +647,6 @@ lib/SelfLoader.pm Load functions only on demand lib/Shell.pm Make AUTOLOADed system() calls lib/Symbol.pm Symbol table manipulation routines lib/Sys/Hostname.pm Hostname methods -lib/Sys/Syslog.pm Perl module supporting syslogging lib/Term/Cap.pm Perl module supporting termcap usage lib/Term/Complete.pm A command completion subroutine lib/Term/ReadLine.pm Stub readline library @@ -678,7 +682,6 @@ 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/chat2.pl Obsolete ipc library (use Comm.pm etc instead) lib/complete.pl A command completion subroutine @@ -1047,6 +1050,7 @@ pod/checkpods.PL Tool to check for common errors in pods pod/perl.pod Top level perl man page pod/perl5004delta.pod Changes from 5.003 to 5.004 pod/perl5005delta.pod Changes from 5.004 to 5.005 +pod/perlapi.pod Perl API documentation (autogenerated) pod/perlapio.pod IO API info pod/perlbook.pod Book info pod/perlbot.pod Object-oriented Bag o' Tricks @@ -1076,6 +1080,7 @@ pod/perlfunc.pod Function info pod/perlguts.pod Internals info pod/perlhack.pod Perl hackers guide pod/perlhist.pod Perl history info +pod/perlintern.pod Perl internal function docs (autogenrated) pod/perlipc.pod IPC info pod/perllexwarn.pod Lexical Warnings info pod/perllocale.pod Locale support info @@ -1103,6 +1108,7 @@ pod/perltodo.pod Todo list explained pod/perltoot.pod Tom's object-oriented tutorial pod/perltootc.pod Tom's object-oriented tutorial (more on class data) pod/perltrap.pod Trap info +pod/perlunicode.pod Unicode support info pod/perlvar.pod Variable info pod/perlxs.pod XS api info pod/perlxstut.pod XS tutorial @@ -1311,6 +1317,7 @@ t/op/do.t See if subroutines work t/op/each.t See if hash iterators work t/op/eval.t See if eval operator works t/op/exec.t See if exec and system work +t/op/exists_sub.t See if exists(&sub) works t/op/exp.t See if math functions work t/op/fh.t See if filehandles work t/op/filetest.t See if file tests work @@ -1381,6 +1388,7 @@ t/op/undef.t See if undef works t/op/universal.t See if UNIVERSAL class works t/op/unshift.t See if unshift works t/op/vec.t See if vectors work +t/op/ver.t See if version tuples work t/op/wantarray.t See if wantarray works t/op/write.t See if write works t/pod/emptycmd.t Test empty pod directives @@ -1415,6 +1423,7 @@ t/pod/testcmp.pl Module to compare output against expected results t/pod/testp2pt.pl Module to test Pod::PlainText for a given file t/pod/testpchk.pl Module to test Pod::Checker for a given file t/pragma/constant.t See if compile-time constants work +t/pragma/diagnostics.t See if diagnostics.pm works t/pragma/locale.t See if locale support works t/pragma/locale/latin1 Part of locale.t in Latin 1 t/pragma/locale/utf8 Part of locale.t in UTF8 @@ -1519,8 +1528,10 @@ vms/vmsish.h VMS-specific C header for Perl core vms/writemain.pl Generate perlmain.c from miniperlmain.c+extensions vos/Changes Changes made to port Perl to the VOS operating system vos/build.cm VOS command macro to build Perl -vos/compile_perl.cm VOS commnad macro to build multiple version of Perl +vos/compile_perl.cm VOS command macro to build multiple version of Perl +vos/config.def input for config.pl vos/config.h config.h for VOS +vos/config.pl script to convert a config_h.SH to a config.h vos/config_h.SH_orig config_h.SH at the time config.h was created vos/perl.bind VOS bind control file vos/test_vos_dummies.c Test program for "vos_dummies.c" @@ -1529,6 +1540,7 @@ vos/vosish.h VOS-specific header file warnings.h The warning numbers warnings.pl Program to write warnings.h and lib/warnings.pm win32/Makefile Win32 makefile for NMAKE (Visual C++ build) +win32/bin/exetype.pl Set executable type to CONSOLE or WINDOWS win32/bin/perlglob.pl Win32 globbing win32/bin/pl2bat.pl wrap perl scripts into batch files win32/bin/runperl.pl run perl script via batch file namesake diff --git a/Makefile.SH b/Makefile.SH index 347ee7e2cb..c3e5c851cd 100644 --- a/Makefile.SH +++ b/Makefile.SH @@ -30,7 +30,12 @@ case "$useshrplib" in true) # Prefix all runs of 'miniperl' and 'perl' with # $ldlibpth so that ./perl finds *this* shared libperl. - ldlibpth="LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH" + case "$LD_LIBRARY_PATH" in + '') + ldlibpth="LD_LIBRARY_PATH=`pwd`";; + *) + ldlibpth="LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}";; + esac pldlflags="$cccdlflags" case "${osname}${osvers}" in @@ -78,6 +83,8 @@ true) eval "ldlibpth=\"$ldlibpthname=`pwd`:\$$ldlibpthname\"" ;; esac + # Strip off any trailing :'s + ldlibpth=`echo $ldlibpth | sed 's/:*$//'` ;; esac ;; @@ -228,7 +235,7 @@ addedbyconf = UU $(shextract) $(plextract) pstruct h1 = EXTERN.h INTERN.h XSUB.h av.h config.h cop.h cv.h dosish.h h2 = embed.h form.h gv.h handy.h hv.h keywords.h mg.h op.h -h3 = opcode.h patchlevel.h perl.h perly.h pp.h proto.h regcomp.h +h3 = opcode.h patchlevel.h perl.h perlapi.h perly.h pp.h proto.h regcomp.h h4 = regexp.h scope.h sv.h unixish.h util.h iperlsys.h thread.h h5 = utf8.h warnings.h h = $(h1) $(h2) $(h3) $(h4) $(h5) @@ -236,13 +243,13 @@ h = $(h1) $(h2) $(h3) $(h4) $(h5) c1 = $(mallocsrc) av.c scope.c op.c doop.c doio.c dump.c hv.c mg.c c2 = perl.c perly.c pp.c pp_hot.c pp_ctl.c pp_sys.c regcomp.c regexec.c utf8.c c3 = gv.c sv.c taint.c toke.c util.c deb.c run.c universal.c xsutils.c -c4 = globals.c perlio.c +c4 = globals.c perlio.c perlapi.c c = $(c1) $(c2) $(c3) $(c4) miniperlmain.c perlmain.c obj1 = $(mallocobj) gv$(OBJ_EXT) toke$(OBJ_EXT) perly$(OBJ_EXT) op$(OBJ_EXT) regcomp$(OBJ_EXT) dump$(OBJ_EXT) util$(OBJ_EXT) mg$(OBJ_EXT) obj2 = hv$(OBJ_EXT) av$(OBJ_EXT) run$(OBJ_EXT) pp_hot$(OBJ_EXT) sv$(OBJ_EXT) pp$(OBJ_EXT) scope$(OBJ_EXT) pp_ctl$(OBJ_EXT) pp_sys$(OBJ_EXT) -obj3 = doop$(OBJ_EXT) doio$(OBJ_EXT) regexec$(OBJ_EXT) utf8$(OBJ_EXT) taint$(OBJ_EXT) deb$(OBJ_EXT) universal$(OBJ_EXT) xsutils$(OBJ_EXT) globals$(OBJ_EXT) perlio$(OBJ_EXT) +obj3 = doop$(OBJ_EXT) doio$(OBJ_EXT) regexec$(OBJ_EXT) utf8$(OBJ_EXT) taint$(OBJ_EXT) deb$(OBJ_EXT) universal$(OBJ_EXT) xsutils$(OBJ_EXT) globals$(OBJ_EXT) perlio$(OBJ_EXT) perlapi$(OBJ_EXT) obj = $(obj1) $(obj2) $(obj3) $(ARCHOBJS) @@ -287,7 +294,10 @@ FORCE: @sh -c true opmini$(OBJ_EXT): op.c - $(CCCMD) $(PLDLFLAGS) -DPERL_EXTERNAL_GLOB -o opmini$(OBJ_EXT) op.c + $(RMS) opmini.c + $(LNS) op.c opmini.c + $(CCCMD) $(PLDLFLAGS) -DPERL_EXTERNAL_GLOB opmini.c + $(RMS) opmini.c miniperlmain$(OBJ_EXT): miniperlmain.c $(CCCMD) $(PLDLFLAGS) $*.c @@ -551,7 +561,7 @@ install.html: all installhtml run_byacc: FORCE $(BYACC) -d perly.y - chmod 664 perly.c + -chmod 664 perly.c sh $(shellflags) ./perly.fixer y.tab.c perly.c sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \ -e 's/y\.tab/perly/g' perly.c >perly.tmp && mv perly.tmp perly.c diff --git a/Policy_sh.SH b/Policy_sh.SH index cb8536c454..b953046f9d 100644 --- a/Policy_sh.SH +++ b/Policy_sh.SH @@ -134,11 +134,11 @@ do ;; sitelib) case "$siteprefix" in - *perl*) dflt=$prefix/lib/site_perl ;; - *) dflt=$prefix/lib/$package/site_perl ;; + *perl*) dflt=$prefix/lib/site_perl/$version ;; + *) dflt=$prefix/lib/$package/site_perl/$version ;; esac ;; - sitearch) dflt="$sitelib/$apiversion/$archname" ;; + sitearch) dflt="$sitelib/$archname" ;; siteman1dir) dflt="$siteprefix/man/man1" ;; siteman3dir) dflt="$siteprefix/man/man3" ;; @@ -166,11 +166,11 @@ do ;; vendorlib) case "$vendorprefix" in - *perl*) dflt=$prefix/lib/vendor_perl ;; - *) dflt=$prefix/lib/$package/vendor_perl ;; + *perl*) dflt=$prefix/lib/vendor_perl/$version ;; + *) dflt=$prefix/lib/$package/vendor_perl/$version ;; esac ;; - vendorarch) dflt="$vendorlib/$apiversion/$archname" ;; + vendorarch) dflt="$vendorlib/$archname" ;; vendorman1dir) dflt="$vendorprefix/man/man1" ;; vendorman3dir) dflt="$vendorprefix/man/man3" ;; diff --git a/Porting/Glossary b/Porting/Glossary index bde26b736a..17b408de2e 100644 --- a/Porting/Glossary +++ b/Porting/Glossary @@ -942,6 +942,10 @@ d_nice (d_nice.U): This variable conditionally defines the HAS_NICE symbol, which indicates to the C program that the nice() routine is available. +d_nv_preserves_uv (perlxv.U): + This variable indicates whether a variable of type nvtype + can preserve all the bits a variable of type uvtype. + d_off64_t (io64.U): This symbol will be defined if the C compiler supports off64_t. @@ -2121,12 +2125,18 @@ ignore_versioned_solibs (libs.U): 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 + search when adding directories to @INC. The elements in + the list are separated by spaces. 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. +inc_version_list_init (inc_version_list.U): + This variable holds the same list as inc_version_list, but + each item is enclosed in double quotes and separated by commas, + suitable for use in the PERL_INC_VERSION_LIST initialization. + 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". diff --git a/Porting/config.sh b/Porting/config.sh index eebf57fe62..c91d1d16a6 100644 --- a/Porting/config.sh +++ b/Porting/config.sh @@ -8,7 +8,7 @@ # Package name : perl5 # Source directory : . -# Configuration time: Sun Jan 16 21:10:53 EET 2000 +# Configuration time: Wed Jan 26 09:55:17 EET 2000 # Configured by : jhi # Target system : osf1 alpha.hut.fi v4.0 878 alpha @@ -31,9 +31,9 @@ alignbytes='8' ansi2knr='' aphostname='' api_revision='5' -api_subversion='640' +api_subversion='0' api_version='5' -api_versionstring='5.5.640' +api_versionstring='5.005' ar='ar' archlib='/opt/perl/lib/5.5.640/alpha-dec_osf-thread-multi' archlibexp='/opt/perl/lib/5.5.640/alpha-dec_osf-thread-multi' @@ -56,10 +56,10 @@ cc='cc' cccdlflags=' ' 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' +ccsymbols='__alpha=1 __LANGUAGE_C__=1 __osf__=1 __unix__=1 _LONGLONG=1 _SYSTYPE_BSD=1 SYSTYPE_BSD=1' cf_by='jhi' cf_email='yourname@yourhost.yourplace.com' -cf_time='Sun Jan 16 21:10:53 EET 2000' +cf_time='Wed Jan 26 09:55:17 EET 2000' charsize='1' chgrp='' chmod='' @@ -72,7 +72,7 @@ cp='cp' cpio='' cpp='cpp' cpp_stuff='42' -cppccsymbols='__alpha=1 __osf__=1 __unix__=1 _SYSTYPE_BSD=1 unix=1' +cppccsymbols='LANGUAGE_C=1 unix=1' cppflags='-pthread -std -DLANGUAGE_C' cpplast='' cppminus='' @@ -229,6 +229,7 @@ d_msgrcv='define' d_msgsnd='define' d_mymalloc='undef' d_nice='define' +d_nv_preserves_uv='undef' d_off64_t='undef' d_old_pthread_create_joinable='undef' d_oldpthreads='undef' @@ -483,6 +484,7 @@ i_varhdr='stdarg.h' i_vfork='undef' ignore_versioned_solibs='' inc_version_list=' ' +inc_version_list_init='""' incpath='' inews='' installarchlib='/opt/perl/lib/5.5.640/alpha-dec_osf-thread-multi' @@ -760,7 +762,7 @@ PERL_VERSION=5 PERL_SUBVERSION=640 PERL_API_REVISION=5 PERL_API_VERSION=5 -PERL_API_SUBVERSION=640 +PERL_API_SUBVERSION=0 CONFIGDOTSH=true # Variables propagated from previous config.sh file. pp_sys_cflags='ccflags="$ccflags -DNO_EFF_ONLY_OK"' diff --git a/Porting/config_H b/Porting/config_H index 94007e9e3c..03aafe7f9e 100644 --- a/Porting/config_H +++ b/Porting/config_H @@ -17,7 +17,7 @@ /* * Package name : perl5 * Source directory : . - * Configuration time: Sun Jan 16 21:10:53 EET 2000 + * Configuration time: Wed Jan 26 09:55:17 EET 2000 * Configured by : jhi * Target system : osf1 alpha.hut.fi v4.0 878 alpha */ @@ -1212,9 +1212,14 @@ * 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() @@ -1406,6 +1411,11 @@ * 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 @@ -1533,6 +1543,9 @@ * the GNU C library is being used. */ /*#define HAS_GNULIBC / **/ +#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE) +# define _GNU_SOURCE +#endif /* HAS_HASMNTOPT: * This symbol, if defined, indicates that the hasmntopt routine is * available to query the mount options of file systems. @@ -2309,7 +2322,7 @@ * for a C initialization string. See the inc_version_list entry * in Porting/Glossary for more details. */ -#define PERL_INC_VERSION_LIST /**/ +#define PERL_INC_VERSION_LIST "" /**/ /* HAS_OFF64_T: * This symbol will be defined if the C compiler supports off64_t. @@ -2480,6 +2493,10 @@ /* U64SIZE: * This symbol contains the sizeof(U64). */ +/* NV_PRESERVES_UV: + * This symbol, if defined, indicates that a variable of type NVTYPE + * can preserve all the bit of a variable of type UVSIZE. + */ #define IVTYPE long /**/ #define UVTYPE unsigned long /**/ #define I8TYPE char /**/ @@ -2505,6 +2522,7 @@ #define I64SIZE 8 /**/ #define U64SIZE 8 /**/ #endif +#undef NV_PRESERVES_UV /* IVdf: * This symbol defines the format string used for printing a Perl IV @@ -2751,6 +2769,10 @@ /*#define USE_LONG_LONG / **/ #endif +/* USE_MORE_BITS: + * This symbol, if defined, indicates that 64-bit interfaces and + * long doubles should be used when available. + */ #ifndef USE_MORE_BITS /*#define USE_MORE_BITS / **/ #endif diff --git a/Porting/makerel b/Porting/makerel index f51b4a5478..2052fc85f7 100644 --- a/Porting/makerel +++ b/Porting/makerel @@ -22,17 +22,12 @@ my @patchlevel_h = <PATCHLEVEL>; close PATCHLEVEL; my $patchlevel_h = join "", grep { /^#\s*define/ } @patchlevel_h; print $patchlevel_h; +$revision = $1 if $patchlevel_h =~ /PERL_REVISION\s+(\d+)/; $patchlevel = $1 if $patchlevel_h =~ /PERL_VERSION\s+(\d+)/; $subversion = $1 if $patchlevel_h =~ /PERL_SUBVERSION\s+(\d+)/; die "Unable to parse patchlevel.h" unless $subversion >= 0; -$vers = sprintf("5.%03d", $patchlevel); -$vms_vers = sprintf("5_%03d", $patchlevel); -if ($subversion) { - $vers.= sprintf( "_%02d", $subversion); - $vms_vers.= sprintf( "%02d", $subversion); -} else { - $vms_vers.= " "; -} +$vers = sprintf("%d.%d.%d", $revision, $patchlevel, $subversion); +$vms_vers = sprintf("%d_%d_%d", $revision, $patchlevel, $subversion); # fetch list of local patches my (@local_patches, @lpatch_tags, $lpatch_tags); diff --git a/Porting/p4desc b/Porting/p4desc index b6b412d517..0bf79da2e0 100755 --- a/Porting/p4desc +++ b/Porting/p4desc @@ -65,7 +65,7 @@ my $cur = m|^Affected files| ... m|^Differences|; # while we are within range if ($cur) { - if (m|^\.\.\. (//depot/.+?#\d+) add$|) { + if (m{^\.\.\. (//depot/.+?#\d+) (add|branch)$}) { my $newfile = $1; push @addfiles, $newfile; warn "$newfile add, revision != 1!\n" unless $newfile =~ /#1$/; @@ -90,9 +90,9 @@ sub newfiles { my $addfile; my $ret = ""; for $addfile (@addfiles) { - my $type = `p4 -p $p4port files $addfile`; + my $type = `p4 -p $p4port files '$addfile'`; if ($?) { - warn "$0: `p4 -p $p4port print $addfile` failed, status[$?]\n"; + warn "$0: `p4 -p $p4port print '$addfile'` failed, status[$?]\n"; next; } $type =~ m|^//.*\((.+)\)$| or next; @@ -101,9 +101,9 @@ sub newfiles { $ret .= "\n==== $addfile ($type) ====\n\n"; next; } - my @new = `p4 -p $p4port print $addfile`; + my @new = `p4 -p $p4port print '$addfile'`; if ($?) { - die "$0: `p4 -p $p4port print $addfile` failed, status[$?]\n"; + die "$0: `p4 -p $p4port print '$addfile'` failed, status[$?]\n"; } my $desc = shift @new; # discard initial description $ret .= "\n==== $addfile ($type) ====\n\n"; @@ -111,6 +111,7 @@ sub newfiles { $lines = "" if @new < 2; $ret .= "\@\@ -0,0 +1$lines \@\@\n"; $ret .= join("+","",@new); + $ret .= "\n\\ No newline at end of file\n" if $ret !~ /\n$/; } @addfiles = (); return $ret; @@ -1,7 +1,7 @@ Perl Kit, Version 5.0 - Copyright 1989-1999, Larry Wall + Copyright 1989-2000, Larry Wall All rights reserved. This program is free software; you can redistribute it and/or modify diff --git a/README.cygwin b/README.cygwin index fb93ac5157..ab60a58a0a 100644 --- a/README.cygwin +++ b/README.cygwin @@ -4,502 +4,587 @@ specially designed to be readable as is. =head1 NAME -README.cygwin - notes about porting Perl to Cygwin +README.cygwin - Perl for Cygwin =head1 SYNOPSIS -=over +This document will help you configure, make, test and install Perl +on Cygwin. This document also describes features of Cygwin that will +affect how Perl behaves at runtime. -=item Cygwin +B<NOTE:> There are pre-built Perl packages available for Cygwin and a +version of Perl is provided on the Cygwin CD. If you have no need to +customize the configuration, consider using one of these packages: -The Cygwin tools are ports of the popular GNU development tools for -Windows NT, 95, and 98. They run thanks to the Cygwin library which -provides the UNIX system calls and environment these programs expect. -More info about this project can be found at its home page -http://sourceware.cygnus.com/cygwin/ + http://cygutils.netpedia.net/ -=item libperl.dll +=head1 PREREQUISITES -These instructions and the default cygwin hints build a shared -libperl.dll Perl library and enables dynamically loaded extensions. +=head2 Cygwin = GNU+Cygnus+Windows (Don't leave UNIX without it) -=back +The Cygwin tools are ports of the popular GNU development tools for Win32 +platforms. They run thanks to the Cygwin library which provides the UNIX +system calls and environment these programs expect. More information +about this project can be found at: -=head1 BUILDING - -=head2 Prerequisites - -=over - -=item Cygwin b20.1 - -The latest stable Cygwin suite is beta20.1. It may be -downloaded from ftp://go.cygnus.com/pub/sourceware.cygnus.com/cygwin/latest/ -or many mirror sites around the world. - -=item egcs-1.1.2 - -This port was built with egcs-1.1.2 downloaded from -ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/cygwin/egcs-1.1.2/ - -=item install executable - -To make life easier, you should download -ftp://ftp.franken.de/pub/win32/develop/gnuwin32/cygwin/porters/Humblet_Pierre_A/install-cygwin-b20.sh, -and use it as your install "executable." Just follow the instructions -that are embedded as comments in the .sh file. - -=item Windows NT notes - -You should execute a 'chmod -R +w *' on the entire perl source directory. -The configuration process creates new files (and thus needs write access -to the directory) and sometimes, especially if you make repeated builds -in the same directory, overwrites old files. If you do not enable write -access, you're just asking for trouble. Reminder for B20.1: unless 'ntea' -is included in the CYGWIN environment variable settings, chmod has no -effect. See "environment," below. - -It is best if you build, test, and install as a normal user, not as -Administrator or as any member of the Administrators group. There is -a well-known NT-ism that affects Cygwin: all files that are created -by any member of the Administrators B<group> are B<NOT> owned by -that member. The ownership of those files is assigned to the -Administrators group, instead. If the default access mode for new files -is -rw-r--r--, then the original creator of the file cannot overwrite -it: he no longer owns the file, no B<user> does. It is owned by the -group, but group members don't have write access to it. This causes -any number of problems, including make test / perl harness failures, -installation failures, etc. - -In some cases, however, it is necessary to install as Administrator. For -instance, if normal users are not allowed write access to the install -directory. My solution, in this case, was to transfer ownership of the -install directory tree (/usr/local) to a single, normal user, and -set permissions to -rw-r--r-- (drwxr-xr-x for directories, of course). -If you read the preceeding paragraph carefully, you might suspect that -changing the permissions on the entire tree to -rw-rw-r--, but allowing -the Administrators group to keep ownership should solve the problem. -However, newly created directories (and the perl install creates a lot -of them) will not allow group write access. Setting umask will not -fix this problem, because umask is a B<negation> operator; it only -specifies the types of accesses that will NOT be allowed on new files. -For instance, umask u=rwx,g=rwx,o=rx means that world ('B<o>thers') will -never be allowed write access, but owner ('B<u>ser') and B<g>roup B<might> -be allowed write access. Everybody (u, g, and o) B<might>be allowed -read access. - -In any case, Corinna Vinschen's ntsec patches B<may> eventually -alleviate this whole mess, and are included in the development -snapshots as of 24 May 1999. You will need to include 'ntsec' as -one of the items in the CYGWIN variable setting. However, initial -tests indicate some incompatibility the 0524 snapshot and this perl -build. - -=item environment - -I (csw) found the following steps necessary for a successful build: - -=over - -=item path - -I set my path so that none of the windows directories showed up - -otherwise Configure found the wrong executables (find, grep, etc). -It is, however, important that '.' be in the path, because otherwise -the build process can't execute the ld2 script that is created. - -=item mounts - -I had to unmount my f: drive. I have cygwin installed under -F:\cygnus\cygwin-b20\, which is mounted as \. I also ordinarily -have F:\ mounted as /f (i.e. mounted onto the empty directory -F:\cygnus\cygwin-b20\f\ ). However, this causes Configure to -"locate" the awk, tr, sed, etc. programs at -/f/cygnus/cygwin-b20/usr/bin instead of /usr/bin. -This ended up causing problems. - -I built and tested perl using all binary mounts. However, Eric Fifer -has built and tested it using text mounts, but reported more failures -during make test and perl harness. Based on his findings, and experiments -performed by Sebastien Barre with the static build of perl, I can -report that these test failures are B<not> due to any differences in -the perl executable. Most of the failures encountered during a make test -on text mounts can be eliminated by remounting as binary, and re-running -the tests using the same executable. These test failures are due to -problems in the test scripts, not the executable. See Appendix. - -One observation from experience with the static build of perl is that -it's a bad idea to a mix a perl executable that was compiled using binary -mounts with modules compiled using text mounts, and vice versa. Make -sure your mount environment matches. This observation has not been -confirmed with respect to the dynamically linked build of perl. - -=item environment variables - -For NT users, the CYGWIN variable should include the 'ntea' setting. -However, if you have FAT drives on your system, as opposed to NTFS, -please read the Cygwin FAQ concerning ntea before including it in -your system settings. If you do not use ntea, you will encounter a -few extra make test and/or perl harness failures. These are not -indicative of a faulty perl executable, but only that your system -settings do not allow the types of file access and ownership checking -that the test scripts are attempting to verify. See Appendix. - -I unset INCLUDE and LIB (these two variables are set by MSVC5, and -inherited from my Windows environment by cygwin). I'm not sure this made -a difference, but it has caused problems in the past... + http://sourceware.cygnus.com/cygwin/ -=back +A recent net or commercial release of Cygwin is required. -=item crypt library +At the time this document was written, the port required recent +development snapshots that were expected to stabilize early in 2000 and +be released to the net as B21 and commercially as v1.1. -http://miracle.geol.msu.ru/sos/ points to two different crypt -libraries ported to cygwin. This has been tested with the libcrypt.tgz -by Andy Piper. His home page can be found at -http://www.xemacs.freeserve.co.uk/ +B<NOTE:> At this point, minimal effort has been made to provide +compatibility with old (beta) Cygwin releases. The focus has been to +provide a high quality release and not worry about working around old +Cygwin bugs. If you wish to use Perl with Cygwin B20.1 or earlier, +consider using either perl5.005_03 or perl5.005_62, which are available +in source and binary form at C<http://cygutils.netpedia.net/> or on the +Cygwin CD. If there is significant demand, a patch kit can be developed +to port back to earlier Cygwin versions. -=item hacks that should be revisited after the next cygwin release +=head2 Compiler -Some of the failures we encountered when running make test and/or perl harness -are due to bugs in the cygwin b20.1 distribution. We sometimes found it -necessary to use dirty little hacks to persuade make test and perl harness -to play nicely. Since cygwin is in active development, many of these hacks -may not be necessary in the future. These include: +A recent net or commercial release of I<gcc> is required. -=over +At the time this document was written, I<gcc-2.95.2> was current and +could be downloaded from: -=item fix for pragma/locale + ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/cygwin/gcc-2.95.2/ -the line '#undef MB_CUR_MAX' was added to ex/POSIX/POSIX.xs. This fixes -a failure in the pragma/locale.t test, which before this fix resulted in a -coredump. It appears that MB_CUR_MAX is #defined __mb_cur_max, and __mb_cur_max -is declared 'extern' in Cygwin b20.1's stdlib.c, but is never defined. Thus, -the error. +=head2 Cygwin Configuration -=item fix for lib/io_sock +While building Perl some changes may be necessary to your Cygwin setup so +that Perl builds cleanly. These changes are B<not> required for normal +Perl usage. -there is a rather extensive patch to t/lib/io_sock.t which works around -a failure related to fork() in the cygwin environment. Cygwin b20.1 does not -properly remap manually loaded DLLs in the child after a fork. +B<NOTE:> The binaries that are built will run on all Win32 versions. +They do not depend on your host system (Win9x, WinNT) or your Cygwin +configuration (I<ntea>, I<ntsec>, binary/text mounts). The only +dependencies come from hardcoded pathnames like C</usr/local>. However, +your host system and Cygwin configuration will affect Perl's runtime +behavior (see L</"TEST">). Some regression tests may fail in different +ways depending on your setup. For now, the test suite does not skip +tests that do not make sense given a particular setup. If a test can +pass in some Cygwin setup, it is left in and explainable test failures +are documented. -=item fix for lib/filehand +=over 4 -during the make test/perl harness steps, a win32 popup complains about -a "perl.exe Application Error - illegal memory access." This is due to to -a test in t/lib/filehand.t, and is related to the fork + dll problem. +=item * C<PATH> -=item fix for environ +Set the C<PATH> environment variable so that Configure finds the Cygwin +versions of programs. Any Windows directories should be removed or +moved to the end of your C<PATH>. -there are a number of changes to miniperlmain.c, util.c, and mg.c that -are there to work around a Cygwin problem relating to environ. +=item * F</bin/cat.exe> -=item fix for lib/posix +There should be an instance of I<cat> in F</bin> (or F</usr/bin>). +Configure tests C<#!/bin/cat> and if it is not found, you will see +the error: -the following line was added to t/lib/posix.t to work around a Cygwin bug. + Configure: ./try: No such file or directory -=begin text +=item * F</usr/bin> -kill 'CONT', $$ if($^O =~ /cygwin/); # XXX: Cygwin bug INT signal gets stuck +If you do not have a F</usr/bin> directory, Configure will B<not> prompt +you to install I<perl> into F</usr/bin>. -=end text +=item * I<nroff> -=back +If you do not have I<nroff> (which is part of the I<groff> package), +Configure will B<not> prompt you to install man pages. + +=item * Permissions + +On WinNT with either the I<ntea> or I<ntsec> C<CYGWIN> settings, directory +and file permissions may not be set correctly. Since the build process +creates files and directories, to be safe you may want to run a `C<chmod +-R +w *>' on the entire Perl source tree. + +Also, it is a well known WinNT "feature" that files created by a login +that is a member of the I<Administrators> group will be owned by the +I<Administrators> group. Depending on your umask, you may find that you +can not write to files that you just created (because you are no longer +the owner). When using the I<ntsec> C<CYGWIN> setting, this is not an +issue because it "corrects" the ownership to what you would expect on +a UNIX system. =back -=head2 Configure +=head1 CONFIGURE -Check hints/cygwin.sh for any system specific settings. In -particular change libpth to point to the correct location of -...../i586-cygwin32/lib. +The default options gathered by Configure with the assistance of +F<hints/cygwin.sh> will build a Perl that supports dynamic loading +(which requires a shared F<libperl.dll>). -run "sh Configure". +This will run Configure and keep a record: -When confronted with this prompt: + ./Configure 2>&1 | tee log.configure -=begin text +If you are willing to accept all the defaults add a B<-d> option. +However, several useful customizations are available. - First time through, eh? I have some defaults handy for the - following systems: - . - . - . - Which of these apply, if any? +=head2 Strip Binaries -=end text +It is possible to strip the EXEs and DLLs created by the build process. +The resulting binaries will be significantly smaller. If you want the +binaries to be stripped, you can either add a B<-s> option when Configure +prompts you, -select "cygwin". + Any additional ld flags (NOT including libraries)? [none] -s + Any special flags to pass to gcc to use dynamic loading? [none] -s + Any special flags to pass to ld2 to create a dynamically loaded library? + [none] -s -Do not use the malloc that comes with perl--using the perl malloc -collides with some cygwin startup routines. +or you can edit F<hints/cygwin.sh> and uncomment the relevant variables +near the end of the file. -=head2 make +=head2 Optional Libraries -Run "make". If you're really feeling adventurous, type -"make 2>&1 | tee make-log.txt". +Several Perl functions and modules depend on the existence of +some optional libraries. Configure will find them if they are +installed in one of the directories listed as being used for library +searches. Pre-built packages for most of these are available at +C<http://cygutils.netpedia.net/>. -=over +=over 4 -=item ld2 +=item * C<-lcrypt> -The make script will install ld2 into your $installbin directory (i.e. -wherever you said to put the perl.exe) during the *make* process. It -does not wait until the *make install* process to install the ld2 script. -This is because the remainder of the make refers to ld2 without fully -specifying its path, and does this from multiple subdirectories (so ./ld2 -won't work.) The assumption here is that $installbin is in your current -$PATH. If this is not the case, or if you do not have an install -executable, the make will fail at some point. Don't panic. Just manually -copy ld2 from the source directory to someplace in your path. +The crypt libraries in GNU libc have been ported to Cygwin. -This cannot be done prior to make, because ld2 is created during the -make process. +The DES based Ultra Fast Crypt port was done by Alexey Truhan -=back + http://dome.weeg.uiowa.edu/pub/domestic/sos/cw32crypt-dist-0.tgz + +NOTE: There are various export restrictions on DES implementations, +see the glibc README for more details. -=head2 make test +The MD5 port was done by Andy Piper: -Run "make test" to see how stable your system is. I (csw) got the -following errors/warnings: + http://dome.weeg.uiowa.edu/pub/domestic/sos/libcrypt.tgz -=over +More information can also be found at: -=item op/taint + http://miracle.geol.msu.ru/sos/ -Got two "missing cygwin1.dll" warning popups. This is because -op/taint wants cygwin1.dll to be somewhere in the system path -(\WINDOWS\SYSTEM, etc) or in the build directory. Can be ignored. +=item * C<-lgdbm> (C<use GDBM_File>) -=item lib/filehand +GDBM is available for Cygwin. GDBM's ndbm/dbm compatibility feature +also makes C<NDBM_File> and C<ODBM_File> possible (although they add +little extra value). -Got an "Application Error - memory could not be read" popup. While -this looks alarming, it can be ignored - just click OK. It is -because Cygwin B20.1 doesn't properly remap manually loaded DLLs -in the child after a fork. +=item * C<-ldb> (C<use DB_File>) -=item lib/io_sock +BerkeleyDB is available for Cygwin. Some details can be found in +F<ext/DB_File/DB_File.pm>. -Got an "Application Error - memory could not be read" popup. Again, -just click OK and ignore it. +=item * C<-lcygipc> (C<use IPC::SysV>) + +A port of SysV IPC is available for Cygwin: + + http://www.multione.capgemini.fr/tools/pack_ipc/ + +The 1.3 release does not include ftok(), but code for ftok() can be +borrowed from glibc. =back -=head2 perl harness +=head2 Configure-time Options + +The F<INSTALL> document describes several Configure-time options. +Some of these will work with Cygwin, others are not yet possible. Also, +some of these are experimental. + +=over 4 + +=item * C<-Uusedl> + +If you want to force Perl to be compiled statically, you can either +choose this when Configure prompts you or you can use the Configure +command line option. + +=item * C<-Uusemymalloc> -Once you've run make test, then cd into the t/ subdirectory and -execute './perl harness'. I (csw) got the following results: +By default Perl uses the malloc() included with the Perl source. If you +want to force Perl to build with the system malloc(), you can either +choose this when Configure prompts you or you can use the Configure +command line option. -=over +=item * C<-Dusemultiplicty> -=item op/taint +Multiplicity is required when embedding Perl in a C program and using +more than one interpreter instance. This works with the Cygwin port. -Got four "missing cygwin1.dll" warning popups. Click OK and -ignore. +=item * C<-Duseperlio> -=item lib/filehand +The PerlIO abstraction works with the Cygwin port. -Got an "Application Error - memory could not be read" popup. Again, -click OK and ignore. +=item * C<-Duse64bits -Duselonglong> -=item lib/io_sock +I<gcc> supports 64-bit integers. However, several additional long long +functions are necessary to use them within Perl (I<{atol,strtoul}l>). +These are B<not> yet available with Cygwin. -Got an "Application Error - memory could not be read" popup. Again, -clock OK and ignore. +=item * C<-Duselongdouble> -=item final results +I<gcc> supports long doubles (12 bytes). However, several additional +long double math functions are necessary to use them within Perl +(I<{sqrt,pow,atan2,exp,fmod,log,cos,frexp,sin,floor,modf,atof}l>). +These are B<not> yet available with Cygwin. -After the ./perl harness, I got the following results summary. +=item * C<-Dusethreads> - Failed Test Status Wstat Total Fail Failed List of failed - ------------------------------------------------------------------------------- - op/taint.t 149 3 2.01% 1, 3, 31 - 9 tests skipped, plus 35 subtests skipped. - Failed 1/190 test scripts, 99.47% okay. 3/6452 subtests failed, 99.95% okay. +POSIX threads are B<not> yet implemented in Cygwin. + +=item * C<-Duselargefiles> + +Although Win32 supports large files, Cygwin currently uses 32-bit ints +for internal size and positional calculations. =back -=head2 make install +=head2 Suspicious Warnings -Finally, run "make install". In my case, the install process was unable -to copy the files from <SRCDIR>/pod/* to /usr/local/lib/perl5/5.00503/pod/. -I (csw) just copied them by hand after the install finished. I believe -this is because I'm using Sergey Okhapkin's coolview version of the -cygwin1.dll, which provides case sensitivity. The directory is created -as "/usr/local/lib/perl5/5.00503/Pod" but the copy is done into -"/usr/local/lib/perl5/5.00503/pod". This fails -- but probably won't -fail if you're using the default cygwin1.dll. +You may see some messages during Configure that seem suspicious. -=head1 BUGS +=over 4 -A lot of warnings about incompatible pointer types and comparison -lacking a cast. This is because of __declspec(dllimport). +=item * Whoa There -Upon each start, make warns that a rule for perlmain.o is overrided. -Yes, it is. In order to use libperl.dll, perlmain needs to import -symbols from there. According to alex smishlajev, there seems to be -no better solution than adding an explicit define to the rule. +Cygwin does not yet implement chroot(), setegid() or seteuid() +functionality, but has stub functions that return C<ENOSYS>. You will +see a message when Configure detects that its guess conflicts with the +hint file. -make clean does not remove library .def and .exe.core files. + *** WHOA THERE!!! *** + The recommended value for $d_chroot on this machine was "undef"! + Keep the recommended value? [y] -ld2 script is installed with reference to source directory. You should -change this to /usr/local/bin (or whatever) after install. +You should keep the recommended value. -.bat wrappers for installed utility scripts are not made during installation. +=item * Checking how std your stdio is... -=head1 AUTHOR +Configure reports: -alexander smishlajev <als@turnhere.com> + Your stdio doesn't appear very std. -=head1 DISCLAIMER +This is correct. -I (alex) am not going to maintain this document or this port. I only wanted -to make perl porting a bit easier. If failed, I can't be helpful for you. -Contact one of the others listed in the history section. +=head1 MAKE -=head1 HISTORY +Simply run make and wait: + + make 2>&1 | tee log.make + +=head2 Warnings + +Warnings like these are normal: + + warning: overriding commands for target <file> + warning: ignoring old commands for target <file> + + Warning: no export definition file provided + dllwrap will create one, but may not be what you want + +=head2 ld2 + +During `C<make>', I<ld2> will be created and installed in your $installbin +directory (where you said to put public executables). It does not +wait until the `C<make install>' process to install the I<ld2> script, +this is because the remainder of the `C<make>' refers to I<ld2> without +fully specifying its path and does this from multiple subdirectories. +The assumption is that $installbin is in your current C<PATH>. If this +is not the case or if you do not have an I<install> program, `C<make>' +will fail at some point. If this happens, just manually copy I<ld2> +from the source directory to someplace in your C<PATH>. + +=head1 TEST + +There are two steps to running the test suite: + + make test 2>&1 | tee log.make-test + + cd t;./perl harness 2>&1 | tee ../log.harness + +The same tests are run both times, but more information is provided when +running as `C<./perl harness>'. -=over +Test results vary depending on your host system and your Cygwin +configuration. It is possible that Cygwin will pass all the tests, but it +is more likely that some tests will fail for one of the the reasons below. -=item Release 1.4.1: 28-May-1999 +=head2 File Permissions -Charles Wilson - cwilson@ece.gatech.edu +UNIX file permissions are based on sets of mode bits for +{read,write,execute} for each {user,group,other}. By default Cygwin only +tracks the Win32 readonly attribute represented as the UNIX file user +write bit (files are always readable, files are executable if they have +a F<.{com,bat,exe}> extension or begin with C<#!>, directories are always +readable and executable). On WinNT with the I<ntea> C<CYGWIN> setting, +the remaining mode bits are stored as extended attributes. On WinNT +with the I<ntsec> C<CYGWIN> setting, permissions use the standard WinNT +security descriptors and access control lists. Without one of these +options, these tests will fail: - Configure minor fix for spaces in $PATH - documentation updates + Failed Test List of failed + ------------------------------------ + io/fs.t 5, 7, 9-10 + lib/anydbm.t 2 + lib/db-btree.t 20 + lib/db-hash.t 16 + lib/db-recno.t 18 + lib/gdbm.t 2 + lib/glob-basic.t 9 (directory always readable) + lib/ndbm.t 2 + lib/odbm.t 2 + lib/sdbm.t 2 + op/stat.t 9, 20 (.tmp not an executable extension) -=item Release 1.4: 26-May-1999 +=head2 Hard Links -Charles Wilson - cwilson@ece.gatech.edu +FAT partitions do not support hard links (whereas NTFS does), in which +case Cygwin implements link() by copying the file. These tests will fail: - From Eric Fifer: - hints/cygwin32.sh -L. and --export-dynamic not needed - cygwin32/Makefile.SHs no value needed for -DUSEIMPORTLIB - t/lib/io_sock.t -I../lib so "make test" works - t/lib/posix.t workaround a Cygwin bug so test works - doio.c/perl.h cleanup gcc warning "doio.c:789: warning: - pointer/integer type mismatch in - conditional expression" - From Charles Wilson: - Configure changes to findhdr script - documentation updates - built binary kit for release + Failed Test List of failed + ------------------------------------ + io/fs.t 4 + op/stat.t 3 -=item Release 1.3: 26-May-1999 +=head2 Filetime Granularity -Charles Wilson - cwilson@ece.gatech.edu +On FAT partitions the filetime granularity is 2 seconds. The following +test will fail: - Changes to Cwd.pm to correct lib/findbin.t test failure from Eric Fifer - Changes to t/op/magic.t to correct a test failure from Eric Fifer - Changes to miniperlmain.c, util.c, and mg.c to correct t/op/magic.t #29 - test failure, from Eric Fifer - more documentatino updates, patch merging, and a change to - cygwin/Makefile.SHs -- cw. - 99.95% okay!!! + Failed Test List of failed + ------------------------------------ + io/fs.t 18 -=item Release 1.2: 25-May-1999 +=head2 Tainting Checks -Charles Wilson - cwilson@ece.gatech.edu +When Perl is running in taint mode, C<$ENV{PATH}> is considered tainted +and not used, so DLLs not in the default system directories will not +be found. While the tests are running you will see warnings popup from +the system with messages like: - fixes for lib/io_sock and pragma/locale from Eric Fifer - fixes for Configure, Makefile.SH, and cygwin32/Makefile.SHs from - alex smishlajev - documentation updates, and other fixes to the fixes from cw. - 99.91% okay!!! + Win9x + Error Starting Program + A required .DLL file, CYGWIN1.DLL, was not found -=item Release 1.1: 21-May-1999 + WinNT + perl.exe or sh.exe - Unable to Locate DLL + The dynamic link library cygwin1.dll could not be found in the + specified path ... -Charles Wilson - cwilson@ece.gatech.edu +Just click OK and ignore them. When running `C<make test>', 2 popups +occur. During `C<./perl harness>', 4 popups occur. Also, these tests +will fail: -minor change to Configure script, reversed a few changes made by -alexander's patch (made DOSISH #undefined again) and moved code -by alexander from dosish.h to perl.h. Reversed a change in -pp_hot.c + Failed Test List of failed + ------------------------------------ + op/taint.t 1, 3, 31, 37 -=item Release 1.0: 16-May-1999 +Alternatively, you can copy F<cygwin1.dll> into one of the Windows system +directories (although, this is B<not> recommended). -Charles Wilson - cwilson@ece.gatech.edu +=head2 /etc/group -Merged alexander's patch and Eric's patch into a single -monolithic patch. Minor cleanup. Built binary for distribution. -perl5.005_03-dynamic-patch-v1.0 +Cygwin does not need F</etc/group>, in which case the F<op/grent.t> +test will be skipped. The check performed by F<op/grent.t> expects to +see entries that use the members field, otherwise this test will fail: -=item Pre-release 3: 12-May-1999 + Failed Test List of failed + ------------------------------------ + op/grent.t 1 -Eric Fifer - efifer@sanwaint.com +=head2 Unexplained Failures -Removed all references to the impure_ptr hack since it is no longer -needed. Some minor cleanup of alexander smishlajev's work and a few -bug fixes. +Any additional tests that fail are likely due to bugs in Cygwin. It is +expected that by the time of the next net release most of these will +be solved so they are not described here. None of the current bugs are +serious enough that workarounds are needed. -=item Pre-release 2 (initial dynamic build): 17..25-apr-1999 +=head2 Script Portability -alexander smishlajev - als@turnher.com +Cygwin does an outstanding job of providing UNIX-like semantics on top +of Win32 systems. However, in addition to the items noted above, there +are some differences that you should know about. This is only a very +brief guide to portability, more information about Cygwin can be found +in the Cygwin documentation. -perl 5.005_03. cygwin b20.1 egcs 1.1.2. far 1.60. nescafe classic. +=over 4 -=item Pre-release 1 (static build): 5-Mar-1999 +=item * Pathnames -Charles Wilson - cwilson@ece.gatech.edu +Cygwin pathnames can be separated by forward (F</>) or backward (F<\>) +slashes. They may also begin with drive letters (F<C:>) or Universal +Naming Codes (F<//UNC>). DOS device names (F<aux>, F<con>, F<prn>, +F<com*>, F<lpt?>) are invalid as base filenames. However, they can be +used in extensions (e.g., F<hello.aux>). Names may not contain these +characters: -Collected various patches that had been floating around the net, along -with build instructions. Original authorship credit for those patches -goes to: + : * ? " < > | - Steven Morlock - newspost@morlock.net - Sebastien Barre - Sebastien.Barre@utc.fr - Teun Burgers - burgers@ecn.nl +File names are case insensitive, but case preserving. With the I<mixed> +C<CYGWIN> setting, file names are mixed-case (although, directory names +remain case insensitive). -Created a monolithic patchkit (perl5.005_03-static-patch) and build -instructions for cygwin (beta 20.1). Also created a binary distribution -of the resulting static perl build. +The I<mixed> setting is only available with the "coolview" version of +F<cygwin1.dll> provided by Sergey Okhapkin at: + + ftp://ftp.franken.de/pub/win32/develop/gnuwin32/cygwin/porters/Okhapkin_Sergey/ + +=item * Text/Binary + +When a file is opened it is in either text or binary mode. In text mode +it is subject to CR/LF/Ctrl-Z translations. Perl provides a binmode() +function to force binary mode on files that otherwise would be treated +as text. With Cygwin, the default mode for an open() is determined by the +mode of the mount that underlies a file. For binmode() to be effective, +the underlying mount must be text. There is no way to force text mode +on a file underneath a binary mount. The text/binary issue is covered +at length in the Cygwin documentation. + +lseek() only works with files opened in binary mode. + +=item * F<.exe> + +The Cygwin stat() makes the F<.exe> extension transparent by looking for +a F<foo.exe> when you ask for F<foo> (unless a F<foo> also exists). +Cygwin does not require a F<.exe> extension, but I<gcc> adds it +automatically when building a program. However, when accessing an +executable as a normal file (e.g., I<install> or I<cp> in a makefile) +the F<.exe> is not transparent. + +NOTE: There is a version of I<install> that understands F<.exe>, it can +be found at: + + ftp://ftp.franken.de/pub/win32/develop/gnuwin32/cygwin/porters/Humblet_Pierre_A/ + +=item * chown() + +On WinNT with the I<ntsec> C<CYGWIN> setting, chown() can change a file's +user and group IDs. In all other configurations chown() is a no-op, +although this is appropriate on Win9x since there is no security model. + +=item * Miscellaneous + +File locking using the C<F_GETLK> command to fcntl() is a stub that +returns C<ENOSYS>. + +Win32 can not unlink() an open file (but this is emulated by Cygwin). + +Win9x can not rename() an open file (although WinNT can). =back -=head1 APPENDIX +=head1 INSTALL + +This will install Perl, including man pages. + + make install 2>&1 | tee log.make-install -Perl harness results from Eric Fifer, under various environments. The same -executable was used in all cases. The last item is a different executable -on a different machine, built by Charles Wilson. +You may need to be I<Administrator> to run `C<make install>'. If you +are not, you must have write access to the directories in question. -There are a number of very good questions one could ask about anomalies -in the test results presented below. "Why do the last two show different -results?" "Why did op/stat.t #18 pass in the first two tests and fail in -the third?" Short answer: I don't know. Long answer: I really have no -idea. +Information on installing the Perl documentation in HTML format can be +found in the F<INSTALL> document. -=over +=head1 MANIFEST -=item text mounts, no 'ntea' +These are the files in the Perl release that contain references to Cygwin. +These very brief notes attempt to explain the reason for all conditional +code. Hopefully, keeping this up to date will allow the Cygwin port to +be kept as clean as possible. - Failed Test Status Wstat Total Fail Failed List of failed - ------------------------------------------------------------ - lib/anydbm.t 2 512 12 8 66.67% 5-12 - lib/sdbm.t 2 512 18 15 83.33% 2, 5-18 - op/split.t 25 1 4.00% 11 - op/stat.t 58 3 5.17% 9, 19, 26 - op/taint.t 149 3 2.01% 1, 3, 31 +=over 4 -=item binary mounts, no 'ntea' +=item Documentation - Failed Test Status Wstat Total Fail Failed List of failed - ------------------------------------------------------------ - lib/sdbm.t 18 1 5.56% 2 - op/stat.t 58 3 5.17% 9, 19, 26 - op/taint.t 149 3 2.01% 1, 3, 31 + INSTALL + Changes Changes5.005 Changes5.004 + AUTHORS MAINTAIN MANIFEST + README.cygwin README.win32 + pod/perl.pod pod/perlfaq3.pod pod/perlhist.pod pod/perlmodlib.pod + pod/perlport.pod pod/perltoc.pod pod/perl5004delta.pod -=item binary mounts, 'ntea' +=item Build, Configure, Make, Install - Failed Test Status Wstat Total Fail Failed List of failed - ------------------------------------------------------------ - op/stat.t 58 3 5.17% 18-19, 26 - op/taint.t 149 3 2.01% 1, 3, 31 + cygwin/Makefile.SHs + cygwin/ld2.in + cygwin/perlld.in + ext/IPC/SysV/hints/cygwin.pl + ext/NDBM_File/hints/cygwin.pl + ext/ODBM_File/hints/cygwin.pl + hints/cygwin.sh + Porting/patchls - cygwin in port list + Makefile.SH - linklibperl, cygwin/Makefile.SHs + makedepend.SH - uwinfix + Configure - help finding hints from uname, + shared libperl required for dynamic loading + installman - man pages with :: translated to . + installperl - install dll, install to pods -=item binary mounts, ntea (csw build) +=item Tests - Failed Test Status Wstat Total Fail Failed List of failed - ------------------------------------------------------------------------------- - op/taint.t 149 3 2.01% 1, 3, 31 + t/io/tell.t - binmode + t/op/magic.t - $^X WORKAROUND, s/.exe// + t/op/stat.t - no /dev, no -u (setuid) + +=item Compiled Perl Source + + doio.c - win9x can not rename a file when it is open + EXTERN.h - __declspec(dllimport) + XSUB.h - __declspec(dllexport) + perl.h - binmode + mg.c - environ WORKAROUND + util.c - environ WORKAROUND + unixish.h - environ WORKAROUND + +=item Compiled Module Source + + ext/POSIX/POSIX.xs - tzname defined externally + ext/SDBM_File/sdbm/pair.c + - EXTCONST needs to be redefined from EXTERN.h + ext/SDBM_File/sdbm/sdbm.c + - binary open + +=item Perl Modules/Scripts + + lib/perl5db.pl - use stdin not /dev/tty + utils/perlcc.PL - DynaLoader.a in compile, -DUSEIMPORTLIB + utils/perldoc.PL - version comment + lib/File/Spec/Unix.pm - preserve //unc + lib/ExtUtils/MakeMaker.pm + - require MM_Cygwin.pm + lib/ExtUtils/MM_Cygwin.pm + - canonpath, cflags, manifypods, perl_archive + lib/Cwd.pm - `pwd` =back -=cut +=head1 BUGS + +Upon each start, I<make> warns that a rule for F<perlmain.o> is overridden +(but there seems to be no better solution than adding an explicit define). + +`C<make clean>' does not remove library F<.def> and F<.exe.stackdump> +files. + +The I<ld2> script contains references to the source directory. You should +change these to C</usr/local/bin> (or whatever) after install. + +=head1 AUTHORS + +Charles Wilson E<lt>cwilson@ece.gatech.eduE<gt>, +Eric Fifer E<lt>efifer@sanwaint.comE<gt>, +alexander smishlajev E<lt>als@turnhere.comE<gt>, +Steven Morlock E<lt>newspost@morlock.netE<gt>, +Sebastien Barre E<lt>Sebastien.Barre@utc.frE<gt>, +Teun Burgers E<lt>burgers@ecn.nlE<gt>. + +=head1 HISTORY + +Last updated: 28 January 2000 diff --git a/README.os2 b/README.os2 index cd07ca19b6..46f032a7ff 100644 --- a/README.os2 +++ b/README.os2 @@ -1136,7 +1136,7 @@ Really really odious function to implement. Returns absolute name of file which would have C<name> if CWD were C<dir>. C<Dir> defaults to the current dir. -=item C<Cwd::extLibpath([type]) +=item C<Cwd::extLibpath([type])> Get current value of extended library search path. If C<type> is present and I<true>, works with END_LIBPATH, otherwise with diff --git a/README.threads b/README.threads index b02e607d2b..1f5f7ea070 100644 --- a/README.threads +++ b/README.threads @@ -1,7 +1,20 @@ -NOTE +NOTE: This documentation describes the style of threading that was +available in 5.005. Perl v5.6 also has the early beginnings of +interpreter-based threads support (which is what will be enabled by +default when you simply ask for -Dusethreads). However, be advised +that interpreter threads cannot as yet be created from the Perl level +yet. If you're looking to create threads from within Perl, chances +are you _don't_ want interpreter threads, but want the older support +for threads described below, enabled with: + + sh Configure -Dusethreads -Duse5005threads + +The rest of this document only applies to the use5005threads style of +threads. +--------------------------------------------------------------------------- -Threading is a highly experimental feature. There are still a -few race conditions that show up under high contention on SMP +Support for threading is still in the highly experimental stages. There +are known race conditions that show up under high contention on SMP machines. Internal implementation is still subject to changes. It is not recommended for production use at this time. @@ -11,7 +24,7 @@ Building If your system is in the following list you should be able to just: - ./Configure -Dusethreads -des + ./Configure -Dusethreads -Duse5005threads -des make and ignore the rest of this "Building" section. If not, continue @@ -58,7 +71,7 @@ subdirectory. On platforms that use Configure to build perl, omit the -d from your ./Configure arguments. For example, use: - ./Configure -Dusethreads + ./Configure -Dusethreads -Duse5005threads When Configure prompts you for ccflags, insert any other arguments in there that your compiler needs to use POSIX threads (-D_REENTRANT, @@ -168,8 +181,8 @@ has this fixed but the following patch can be applied to 0.5 for now: Building the Thread extension The Thread extension is now part of the main perl distribution tree. -If you did Configure -Dusethreads then it will have been added to -the list of extensions automatically. +If you did Configure -Dusethreads -Duse5005threads then it will have been +added to the list of extensions automatically. You can try some of the tests with cd ext/Thread diff --git a/README.vos b/README.vos index ab9d99d07b..99abf0d6c5 100644 --- a/README.vos +++ b/README.vos @@ -1,10 +1,11 @@ Perl 5 README file for the Stratus VOS operating system. Paul Green (Paul_Green@stratus.com) -August 12, 1998 +February 3, 2000 + Introduction ------------ -This is a port of Perl version 5, revision 005-02, to VOS. Perl +This is a port of Perl version 5, revision 005-63, to VOS. Perl is a scripting or macro language that is popular on many systems. See your local computer bookstore for a number of good books on Perl. @@ -12,8 +13,12 @@ books on Perl. Most of the Perl features should work on VOS. However, any attempt by perl.pm to call the following unimplemented POSIX functions will result in an error message and an immediate and -fatal call to the VOS debugger. They are "dup", "execlp", -"execl", "execvp", "fork", and "waitpid". +fatal call to the VOS debugger. They are "dup", "fork", and +"waitpid". The lack of these functions pretty much prevents you +from starting VOS commands and grabbing their output in perl. +The workaround is to run the commands outside of perl, then have +perl process the output file. + Compiling Perl 5 on VOS ----------------------- @@ -23,65 +28,124 @@ following additional items. 1. The VOS Standard C Compiler and Runtime, or the VOS Standard C Cross-Compiler. This is a standard Stratus product. -2. The VOS OS TCP/IP product set. While the necessary header files - are included in this distribution, you still need the appropriate - object files in order to bind perl.pm. This is a standard - Stratus product. +2. The VOS OS TCP/IP product set. While the necessary header + files are included with VOS POSIX.1, you still need the + appropriate object files in order to bind perl.pm. This is + a standard Stratus product. 3. The VOS POSIX.1 environment. As of this writing, this is - available on the VOS FTP site. Login to ftp.stratus.com - anonymously and get the file /pub/vos/alpha/posix.save.evf.gz in - binary file-transfer mode. Or use the Uniform Resource Locator - (URL) ftp://ftp.stratus.com/pub/vos/alpha/posix.save.evf.gz from + available on the VOS FTP site. Login anonymously to + ftp.stratus.com and get the file + /pub/vos/alpha/posix.save.evf.gz in binary file-transfer + mode. Or use the Uniform Resource Locator (URL) + ftp://ftp.stratus.com/pub/vos/alpha/posix.save.evf.gz from your web browser. This is not a standard Stratus product. -To build build 5, change to one of the VOS object directories -(e.g., perl5.005_02>vos>obj), and give the command "<build". If -you have the cross-compilers and wish to build for a specific -architecture, say "<build -processor pa7100" (for example). You -can also customize the "compile_perl.cm" command macro for your -system. + Instructions for unbundling this file are at + ftp://ftp.stratus.com/pub/vos/utility/utility.html. + +4. You must compile this version of Perl 5 on VOS Release + 14.1.0 or higher because some of the perl source files + contain more than 32,767 source lines. Due to VOS + release-compatibility rules, this port of perl may not + execute on VOS Release 12 or earlier. + +To build perl 5, change to the "vos" subdirectory and type the +command "compile_perl -processor X", where X is the processor +type (mc68020, i80860, pa7100, pa8000) that you wish to use. +Note that code compiled for the pa7100 processor type can +execute on the PA7100, PA8000, and PA8500 processors, and that +code compiled for the pa8000 processor type can execute on the +PA8000 and PA8500 processors. + + +Installing Perl 5 on VOS +------------------------ +1. Create the directory >system>ported>command_library. + +2. Copy the appropriate version of the perl program module to + this directory. For example, with your current directory + set to the top-level directory of Perl 5, to install the + executable program module for the Motorola 68K + architecture, enter: + + !copy_file vos>obj>perl.pm >system>ported>command_library>* + + (If you wish to use both Perl version 4 and Perl version 5, + you must give them different names; for example, perl.pm + and perl5.pm). + +3. Create the directory >system>ported>perl>lib. + +4. Copy all of the files and subdirectories from the lib + subdirectory into this new directory. For example, with + the current directory set to the top-level directory of the + perl distribution, enter: + + !copy_dir lib >system>ported>perl>lib>5.005 + +5. While there are currently no architecture-specific + extensions or modules distributed with perl, the following + directories can be used to hold such files: + + >system>ported>perl>lib>5.005.68k + >system>ported>perl>lib>5.005.860 + >system>ported>perl>lib>5.005.7100 + >system>ported>perl>lib>5.005.8000 + +6. Site-specific perl extensions and modules can be installed + in one of two places. Put architecture-independent files + into: + + >system>ported>perl>lib>site>5.005 + + Put architecture-dependent files into one of the following + directories: + + >system>ported>perl>lib>site>5.005.68k + >system>ported>perl>lib>site>5.005.860 + >system>ported>perl>lib>site>5.005.7100 + >system>ported>perl>lib>site>5.005.8000 + +7. You can examine the @INC variable from within a perl program + to see the order in which Perl searches these directories. -Changes to Perl for VOS ------------------------ -1. The header perl.h was changed to include vosish.h instead - of unixish.h. This change is necessary because VOS POSIX.1 - does not (yet) implement the getgrname() or getgrgid() - functions. Unimplemented Features ---------------------- -If Perl 5 attempts to call an unimplemented VOS POSIX.1 -function, it will print a fatal error message and enter the VOS -debugger. This error is not recoverable. See vos_dummies.c for -a list of the unimplemented POSIX.1 functions. To see what the -error message looks like, compile and execute -"test_vos_dummies.c". +If Perl 5 attempts to call an unimplemented VOS POSIX.1 function, +it will print a fatal error message and enter the VOS debugger. +This error is not recoverable. See vos_dummies.c for a list of +the unimplemented POSIX.1 functions. To see what functions are +unimplemented and what the error message looks like, compile and +execute "test_vos_dummies.c". + Restrictions ------------ -This port of Perl version 5 to VOS uses Unix-style, -slash-separated pathnames, not VOS-style greater-than-separated -pathnames. If you wish to have it use VOS-style pathnames, try -setting the external variable s$c_options to 4 with the -following command line. Note that this way of configuring Perl -5 has not been tested; I don't know if Perl can handle the -presence of the greater-thans, and the absence of the slashes. +This port of Perl version 5 to VOS prefers Unix-style, +slash-separated pathnames over VOS-style greater-than-separated +pathnames. VOS-style pathnames should work in most contexts, but +if you have trouble, replace all greater-than characters by slash +characters. Because the slash character is used as a pathname +delimiter, Perl cannot process VOS pathnames containing a slash +character in a directory or file name; these must be renamed. - set_external_variable s$c_options -in perl.pm -type integer -to 4 +This port of Perl also uses Unix-epoch date values internally. +As long as you are dealing with ASCII character string +representations of dates, this should not be an issue. The +supported epoch is January 1, 1980 to January 17, 2038. -The following command can be used to check the value: +See the file pod/perlport.pod for more information about the VOS +port of Perl. - get_external_variable s$c_options -in perl.pm -type integer - -See the documentation for VOS POSIX.1 for the full set of option -values. 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 itself; I'm still learning that. +about Perl itself; I'm still learning that. There are some +excellent books available on the Perl language; consult a book +seller. (end) - diff --git a/README.win32 b/README.win32 index 1623acf20f..6889ab7c59 100644 --- a/README.win32 +++ b/README.win32 @@ -90,7 +90,7 @@ work for MakeMaker builds.) A port of dmake for win32 platforms is available from: - ftp://ftp.linux.activestate.com/pub/staff/gsar/dmake-4.1-win32.zip + http://cpan.perl.org/authors/id/GSAR/dmake-4.1pl1-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 @@ -177,7 +177,7 @@ If you have either the source or a library that contains des_fcrypt(), enable the appropriate option in the makefile. des_fcrypt() is not bundled with the distribution due to US Government restrictions on the export of cryptographic software. Nevertheless, this routine -is part of the "libdes" library (written by Ed Young) which is widely +is part of the "libdes" library (written by Eric Young) which is widely available worldwide, usually along with SSLeay (for example: "ftp://fractal.mta.ca/pub/crypto/SSLeay/DES/"). Set CRYPT_SRC to the name of the file that implements des_fcrypt(). Alternatively, if @@ -215,21 +215,6 @@ The build process may produce "harmless" compiler warnings (more or less copiously, depending on how picky your compiler gets). The maintainers are aware of these warnings, thankyouverymuch. :) -When building using Visual C++, a perl95.exe will also get built. This -executable is only needed on Windows95, and should be used instead of -perl.exe, and then only if you want sockets to work properly on Windows95. -This is necessitated by a bug in the Microsoft C Runtime that cannot be -worked around in the "normal" perl.exe. perl95.exe gets built with its -own private copy of the C Runtime that is not accessible to extensions -(which see the DLL version of the CRT). Be aware, therefore, that this -perl95.exe will have esoteric problems with extensions like perl/Tk that -themselves use the C Runtime heavily, or want to free() pointers -malloc()-ed by perl. - -You can avoid the perl95.exe problems completely if you either enable -USE_PERLCRT with Visual C++, or use Borland C++ for building perl. In -those cases, perl95.exe is not needed and will not be built. - =back =head2 Testing @@ -1,10 +1,26 @@ +Unicode support + finish byte <-> utf8 and localencoding <-> utf8 conversions + make "$bytestr$charstr" do the right conversion + add Unicode::Map equivivalent to core + add support for I/O disciplines + - open(F, "<!crlf!utf16", $file) + - binmode(STDIN, "<!crlf!utf16")? + - a way to set the "system" discipline (binmode("!crlf!utf16") maybe?) + - nice IO::Filter module to push/pop disciplines + eliminate need for "use utf8;" + support C<print v1.2.3> + make C<v123> mean C<chr(123)> (if !exists(&v123)) + autoload utf8_heavy.pl's swash routines in swash_init() + Multi-threading - $AUTOLOAD. Hmm. - consistent semantics for exit/die in threads - SvREFCNT_dec(curstack) in threadstart() in Thread.xs - better support for externally created threads - Thread::Pool - spot-check globals like statcache and global GVs for thread-safety + support "use Thread;" under useithreads + add mechanism to: + - create new interpreter in a different thread + - exchange data between interpreters/threads + - share namespaces between interpreters/threads + work out consistent semantics for exit/die in threads + support for externally created threads? + Thread::Pool? Compiler auto-produce executable @@ -16,13 +32,9 @@ Compiler from where newASSIGNOP steals the field) Namespace cleanup - CPP-space: restrict what we export from headers - header-space: move into CORE/perl/ - API-space: begin list of things that constitute public api - -MULTIPLICITY support - complete work on safe recursive interpreters, C<Perl->new()> - revisit extra implicit arg that provides curthread/curinterp context + CPP-space: restrict what we export from headers when !PERL_CORE + header-space: move into CORE/perl/? + API-space: complete the list of things that constitute public api Configure make configuring+building away from source directory work (VPATH et al) @@ -31,9 +43,12 @@ Configure POSIX 1003.1 1996 Edition support Locales + deprecate traditional/legacy locales? + figure out how to support Unicode locales locales across packages? Regexen + make RE engine thread-safe POSIX [=bar=] and [.zap.] would nice too but there's no API for them (=bar= could be done with Unicode, though) approximate matching @@ -42,22 +57,16 @@ Reliable Signals custom opcodes alternate runops() for signal despatch figure out how to die() in delayed sighandler - add tests for Thread::Signal + make Thread::Signal work under useithreads Win32 stuff - get PERL_OBJECT building under gcc - get PERL_OBJECT building on non-win32 - automate generation of 'protected' prototypes for CPerlObj - rename new headers to be consistent with the rest - sort out the spawnvp() mess + sort out the spawnvp() mess for system('a','b','c') compatibility work out DLL versioning - style-check Miscellaneous - rename and alter ISA.pm magic_setisa should be made to update %FIELDS [???] add new modules (Archive::Tar, Compress::Zlib, CPAN::FTP?) - fix pod2html to generate relative URLs (replace with new PodtoHtml?) + replace pod2html with new PodtoHtml? (requires other modules from CPAN) automate testing with large parts of CPAN Ongoing @@ -1,9 +1,53 @@ #ifndef _INC_PERL_XSUB_H #define _INC_PERL_XSUB_H 1 +/* first, some documentation for xsubpp-generated items */ + +/* +=for apidoc Amn|char*|CLASS +Variable which is setup by C<xsubpp> to indicate the +class name for a C++ XS constructor. This is always a C<char*>. See C<THIS>. + +=for apidoc Amn|(whatever)|RETVAL +Variable which is setup by C<xsubpp> to hold the return value for an +XSUB. This is always the proper type for the XSUB. See +L<perlxs/"The RETVAL Variable">. + +=for apidoc Amn|(whatever)|THIS +Variable which is setup by C<xsubpp> to designate the object in a C++ +XSUB. This is always the proper type for the C++ object. See C<CLASS> and +L<perlxs/"Using XS With C++">. + +=for apidoc Amn|I32|items +Variable which is setup by C<xsubpp> to indicate the number of +items on the stack. See L<perlxs/"Variable-length Parameter Lists">. + +=for apidoc Amn|I32|ix +Variable which is setup by C<xsubpp> to indicate which of an +XSUB's aliases was used to invoke it. See L<perlxs/"The ALIAS: Keyword">. + +=for apidoc Am|SV*|ST|int ix +Used to access elements on the XSUB's stack. + +=for apidoc AmU||XS +Macro to declare an XSUB and its C parameter list. This is handled by +C<xsubpp>. + +=for apidoc Ams||dXSARGS +Sets up stack and mark pointers for an XSUB, calling dSP and dMARK. This +is usually handled automatically by C<xsubpp>. Declares the C<items> +variable to indicate the number of items on the stack. + +=for apidoc Ams||dXSI32 +Sets up the C<ix> variable for an XSUB which has aliases. This is usually +handled automatically by C<xsubpp>. + +=cut +*/ + #define ST(off) PL_stack_base[ax + (off)] -#if defined(CYGWIN) && defined(USE_DYNAMIC_LOADING) +#if defined(__CYGWIN__) && defined(USE_DYNAMIC_LOADING) # define XS(name) __declspec(dllexport) void name(pTHXo_ CV* cv) #else # define XS(name) void name(pTHXo_ CV* cv) @@ -34,14 +78,75 @@ #define XSINTERFACE_FUNC_SET(cv,f) \ CvXSUBANY(cv).any_dptr = (void (*) (pTHXo_ void*))(f) -#define XSRETURN(off) \ - STMT_START { \ - PL_stack_sp = PL_stack_base + ax + ((off) - 1); \ - return; \ - } STMT_END - /* Simple macros to put new mortal values onto the stack. */ /* Typically used to return values from XS functions. */ + +/* +=for apidoc Am|void|XST_mIV|int pos|IV iv +Place an integer into the specified position C<pos> on the stack. The +value is stored in a new mortal SV. + +=for apidoc Am|void|XST_mNV|int pos|NV nv +Place a double into the specified position C<pos> on the stack. The value +is stored in a new mortal SV. + +=for apidoc Am|void|XST_mPV|int pos|char* str +Place a copy of a string into the specified position C<pos> on the stack. +The value is stored in a new mortal SV. + +=for apidoc Am|void|XST_mNO|int pos +Place C<&PL_sv_no> into the specified position C<pos> on the +stack. + +=for apidoc Am|void|XST_mYES|int pos +Place C<&PL_sv_yes> into the specified position C<pos> on the +stack. + +=for apidoc Am|void|XST_mUNDEF|int pos +Place C<&PL_sv_undef> into the specified position C<pos> on the +stack. + +=for apidoc Am|void|XSRETURN|int nitems +Return from XSUB, indicating number of items on the stack. This is usually +handled by C<xsubpp>. + +=for apidoc Am|void|XSRETURN_IV|IV iv +Return an integer from an XSUB immediately. Uses C<XST_mIV>. + +=for apidoc Am|void|XSRETURN_NV|NV nv +Return an double from an XSUB immediately. Uses C<XST_mNV>. + +=for apidoc Am|void|XSRETURN_PV|char* str +Return a copy of a string from an XSUB immediately. Uses C<XST_mPV>. + +=for apidoc Ams||XSRETURN_NO +Return C<&PL_sv_no> from an XSUB immediately. Uses C<XST_mNO>. + +=for apidoc Ams||XSRETURN_YES +Return C<&PL_sv_yes> from an XSUB immediately. Uses C<XST_mYES>. + +=for apidoc Ams||XSRETURN_UNDEF +Return C<&PL_sv_undef> from an XSUB immediately. Uses C<XST_mUNDEF>. + +=for apidoc Ams||XSRETURN_EMPTY +Return an empty list from an XSUB immediately. + +=for apidoc AmU||newXSproto +Used by C<xsubpp> to hook up XSUBs as Perl subs. Adds Perl prototypes to +the subs. + +=for apidoc AmU||XS_VERSION +The version identifier for an XS module. This is usually +handled automatically by C<ExtUtils::MakeMaker>. See C<XS_VERSION_BOOTCHECK>. + +=for apidoc Ams||XS_VERSION_BOOTCHECK +Macro to verify that a PM module's $VERSION variable matches the XS +module's C<XS_VERSION> variable. This is usually handled automatically by +C<xsubpp>. See L<perlxs/"The VERSIONCHECK: Keyword">. + +=cut +*/ + #define XST_mIV(i,v) (ST(i) = sv_2mortal(newSViv(v)) ) #define XST_mNV(i,v) (ST(i) = sv_2mortal(newSVnv(v)) ) #define XST_mPV(i,v) (ST(i) = sv_2mortal(newSVpv(v,0))) @@ -49,11 +154,17 @@ #define XST_mNO(i) (ST(i) = &PL_sv_no ) #define XST_mYES(i) (ST(i) = &PL_sv_yes ) #define XST_mUNDEF(i) (ST(i) = &PL_sv_undef) - + +#define XSRETURN(off) \ + STMT_START { \ + PL_stack_sp = PL_stack_base + ax + ((off) - 1); \ + return; \ + } STMT_END + #define XSRETURN_IV(v) STMT_START { XST_mIV(0,v); XSRETURN(1); } STMT_END #define XSRETURN_NV(v) STMT_START { XST_mNV(0,v); XSRETURN(1); } STMT_END #define XSRETURN_PV(v) STMT_START { XST_mPV(0,v); XSRETURN(1); } STMT_END -#define XSRETURN_PVN(v) STMT_START { XST_mPVN(0,v,n); XSRETURN(1); } STMT_END +#define XSRETURN_PVN(v,n) STMT_START { XST_mPVN(0,v,n); XSRETURN(1); } STMT_END #define XSRETURN_NO STMT_START { XST_mNO(0); XSRETURN(1); } STMT_END #define XSRETURN_YES STMT_START { XST_mYES(0); XSRETURN(1); } STMT_END #define XSRETURN_UNDEF STMT_START { XST_mUNDEF(0); XSRETURN(1); } STMT_END @@ -77,7 +188,7 @@ vn = "VERSION"), FALSE); \ } \ if (tmpsv && (!SvOK(tmpsv) || strNE(XS_VERSION, SvPV(tmpsv, n_a)))) \ - Perl_croak(aTHX_ "%s object version %s does not match %s%s%s%s %_", \ + Perl_croak(aTHX_ "%s object version %s does not match %s%s%s%s %"SVf,\ module, XS_VERSION, \ vn ? "$" : "", vn ? module : "", vn ? "::" : "", \ vn ? vn : "bootstrap parameter", tmpsv); \ @@ -119,10 +230,8 @@ # define VTBL_amagicelem &PL_vtbl_amagicelem #endif -#if defined(PERL_OBJECT) || defined(PERL_CAPI) -# include "perlapi.h" -# include "objXSUB.h" -#endif /* PERL_OBJECT || PERL_CAPI */ +#include "perlapi.h" +#include "objXSUB.h" #if defined(PERL_IMPLICIT_CONTEXT) && !defined(PERL_NO_GET_CONTEXT) && !defined(PERL_CORE) # undef aTHX @@ -1,6 +1,6 @@ /* av.c * - * Copyright (c) 1991-1999, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -46,6 +46,15 @@ Perl_av_reify(pTHX_ AV *av) AvREAL_on(av); } +/* +=for apidoc av_extend + +Pre-extend an array. The C<key> is the index to which the array should be +extended. + +=cut +*/ + void Perl_av_extend(pTHX_ AV *av, I32 key) { @@ -151,6 +160,19 @@ Perl_av_extend(pTHX_ AV *av, I32 key) } } +/* +=for apidoc av_fetch + +Returns the SV at the specified index in the array. The C<key> is the +index. If C<lval> is set then the fetch will be part of a store. Check +that the return value is non-null before dereferencing it to a C<SV*>. + +See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for +more information on how to use this function on tied arrays. + +=cut +*/ + SV** Perl_av_fetch(pTHX_ register AV *av, I32 key, I32 lval) { @@ -198,6 +220,23 @@ Perl_av_fetch(pTHX_ register AV *av, I32 key, I32 lval) return &AvARRAY(av)[key]; } +/* +=for apidoc av_store + +Stores an SV in an array. The array index is specified as C<key>. The +return value will be NULL if the operation failed or if the value did not +need to be actually stored within the array (as in the case of tied +arrays). Otherwise it can be dereferenced to get the original C<SV*>. Note +that the caller is responsible for suitably incrementing the reference +count of C<val> before the call, and decrementing it if the function +returned NULL. + +See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for +more information on how to use this function on tied arrays. + +=cut +*/ + SV** Perl_av_store(pTHX_ register AV *av, I32 key, SV *val) { @@ -257,6 +296,14 @@ Perl_av_store(pTHX_ register AV *av, I32 key, SV *val) return &ary[key]; } +/* +=for apidoc newAV + +Creates a new AV. The reference count is set to 1. + +=cut +*/ + AV * Perl_newAV(pTHX) { @@ -271,6 +318,16 @@ Perl_newAV(pTHX) return av; } +/* +=for apidoc av_make + +Creates a new AV and populates it with a list of SVs. The SVs are copied +into the array, so they may be freed after the call to av_make. The new AV +will have a reference count of 1. + +=cut +*/ + AV * Perl_av_make(pTHX_ register I32 size, register SV **strp) { @@ -320,6 +377,15 @@ Perl_av_fake(pTHX_ register I32 size, register SV **strp) return av; } +/* +=for apidoc av_clear + +Clears an array, making it empty. Does not free the memory used by the +array itself. + +=cut +*/ + void Perl_av_clear(pTHX_ register AV *av) { @@ -361,6 +427,14 @@ Perl_av_clear(pTHX_ register AV *av) } +/* +=for apidoc av_undef + +Undefines the array. Frees the memory used by the array itself. + +=cut +*/ + void Perl_av_undef(pTHX_ register AV *av) { @@ -389,6 +463,15 @@ Perl_av_undef(pTHX_ register AV *av) } } +/* +=for apidoc av_push + +Pushes an SV onto the end of the array. The array will grow automatically +to accommodate the addition. + +=cut +*/ + void Perl_av_push(pTHX_ register AV *av, SV *val) { @@ -415,6 +498,15 @@ Perl_av_push(pTHX_ register AV *av, SV *val) av_store(av,AvFILLp(av)+1,val); } +/* +=for apidoc av_pop + +Pops an SV off the end of the array. Returns C<&PL_sv_undef> if the array +is empty. + +=cut +*/ + SV * Perl_av_pop(pTHX_ register AV *av) { @@ -448,6 +540,16 @@ Perl_av_pop(pTHX_ register AV *av) return retval; } +/* +=for apidoc av_unshift + +Unshift the given number of C<undef> values onto the beginning of the +array. The array will grow automatically to accommodate the addition. You +must then use C<av_store> to assign values to these new elements. + +=cut +*/ + void Perl_av_unshift(pTHX_ register AV *av, register I32 num) { @@ -501,6 +603,14 @@ Perl_av_unshift(pTHX_ register AV *av, register I32 num) } } +/* +=for apidoc av_shift + +Shifts an SV off the beginning of the array. + +=cut +*/ + SV * Perl_av_shift(pTHX_ register AV *av) { @@ -538,6 +648,15 @@ Perl_av_shift(pTHX_ register AV *av) return retval; } +/* +=for apidoc av_len + +Returns the highest index in the array. Returns -1 if the array is +empty. + +=cut +*/ + I32 Perl_av_len(pTHX_ register AV *av) { @@ -1,6 +1,6 @@ /* av.h * - * Copyright (c) 1991-1999, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -45,6 +45,16 @@ struct xpvav { /* XXX this is not used anywhere */ #define AVf_REUSED 4 /* got undeffed--don't turn old memory into SVs now */ +/* +=for apidoc AmU||Nullav +Null AV pointer. + +=for apidoc Am|int|AvFILL|AV* av +Same as C<av_len()>. Deprecated, use C<av_len()> instead. + +=cut +*/ + #define Nullav Null(AV*) #define AvARRAY(av) ((SV**)((XPVAV*) SvANY(av))->xav_array) @@ -105,6 +105,7 @@ for file do miniperlmain) ;; op) ;; perl) ;; + perlapi) ;; perlmain) ;; perly) ;; pp) ;; diff --git a/config_h.SH b/config_h.SH index 712b38e73c..8dfb5db1ec 100644 --- a/config_h.SH +++ b/config_h.SH @@ -1226,9 +1226,14 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- * 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() @@ -1420,9 +1425,14 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- * 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 +#$d_phostname HAS_PHOSTNAME /**/ #ifdef HAS_PHOSTNAME #define PHOSTNAME "$aphostname" /* How to get the host name */ #endif @@ -1547,6 +1557,9 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- * the GNU C library is being used. */ #$d_gnulibc HAS_GNULIBC /**/ +#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE) +# define _GNU_SOURCE +#endif /* HAS_HASMNTOPT: * This symbol, if defined, indicates that the hasmntopt routine is * available to query the mount options of file systems. @@ -1578,6 +1591,12 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- #$d_htonl HAS_NTOHL /**/ #$d_htonl HAS_NTOHS /**/ +/* HAS_ICONV: + * This symbol, if defined, indicates that the iconv routine is + * available to do character set conversions. + */ +#$d_iconv HAS_ICONV /**/ + /* HAS_ISASCII: * This manifest constant lets the C program know that isascii * is available. @@ -2165,6 +2184,12 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- #$i_grp I_GRP /**/ #$d_grpasswd GRPASSWD /**/ +/* I_ICONV: + * This symbol, if defined, indicates that <iconv.h> exists and + * should be included. + */ +#$i_iconv I_ICONV /**/ + /* I_INTTYPES: * This symbol, if defined, indicates to the C program that it should * include <inttypes.h>. @@ -2323,7 +2348,7 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- * 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 /**/ +#define PERL_INC_VERSION_LIST $inc_version_list_init /**/ /* HAS_OFF64_T: * This symbol will be defined if the C compiler supports off64_t. @@ -2494,6 +2519,10 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- /* U64SIZE: * This symbol contains the sizeof(U64). */ +/* NV_PRESERVES_UV: + * This symbol, if defined, indicates that a variable of type NVTYPE + * can preserve all the bit of a variable of type UVSIZE. + */ #define IVTYPE $ivtype /**/ #define UVTYPE $uvtype /**/ #define I8TYPE $i8type /**/ @@ -2519,6 +2548,7 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- #define I64SIZE $i64size /**/ #define U64SIZE $u64size /**/ #endif +#$d_nv_preserves_uv NV_PRESERVES_UV /* IVdf: * This symbol defines the format string used for printing a Perl IV @@ -2765,6 +2795,10 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- #$uselonglong USE_LONG_LONG /**/ #endif +/* USE_MORE_BITS: + * This symbol, if defined, indicates that 64-bit interfaces and + * long doubles should be used when available. + */ #ifndef USE_MORE_BITS #$usemorebits USE_MORE_BITS /**/ #endif @@ -2773,7 +2807,7 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- * This symbol, if defined, indicates that Perl should * be built to use multiplicity. */ -#ifndef MULTIPLICTY +#ifndef MULTIPLICITY #$usemultiplicity MULTIPLICITY /**/ #endif diff --git a/configure.com b/configure.com index 3c121e025b..27253b398d 100644 --- a/configure.com +++ b/configure.com @@ -1876,11 +1876,13 @@ $ echo "" $ echo "It's time to specify which modules you want to build into $ echo "perl. Most of these are standard and should be chosen, though $ echo "you might, for example, want to build GDBM_File instead of -$ echo "SDBM_File if you have the GDBM library built on your machine +$ echo "SDBM_File if you have the GDBM library built on your machine. +$ echo "Whatever you do, make sure the re module is first or things will +$ echo "break badly" $ echo " $ echo "Which modules do you want to build into perl?" $! 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" +$ dflt = "re Fcntl Errno File::Glob IO Opcode Devel::Peek Devel::DProf Data::Dumper attrs VMS::Stdio VMS::DCLsym B SDBM_File" $ if Using_Dec_C.eqs."Yes" $ THEN $ dflt = dflt + " POSIX" @@ -1,6 +1,6 @@ /* cop.h * - * Copyright (c) 1991-1999, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -373,6 +373,36 @@ struct context { #define CXINC (cxstack_ix < cxstack_max ? ++cxstack_ix : (cxstack_ix = cxinc())) /* "gimme" values */ + +/* +=for apidoc AmU||G_SCALAR +Used to indicate scalar context. See C<GIMME_V>, C<GIMME>, and +L<perlcall>. + +=for apidoc AmU||G_ARRAY +Used to indicate array context. See C<GIMME_V>, C<GIMME> and +L<perlcall>. + +=for apidoc AmU||G_VOID +Used to indicate void context. See C<GIMME_V> and L<perlcall>. + +=for apidoc AmU||G_DISCARD +Indicates that arguments returned from a callback should be discarded. See +L<perlcall>. + +=for apidoc AmU||G_EVAL + +Used to force a Perl C<eval> wrapper around a callback. See +L<perlcall>. + +=for apidoc AmU||G_NOARGS + +Indicates that no arguments are being sent to a callback. See +L<perlcall>. + +=cut +*/ + #define G_SCALAR 0 #define G_ARRAY 1 #define G_VOID 128 /* skip this bit when adding flags below */ @@ -1,6 +1,6 @@ /* cv.h * - * Copyright (c) 1991-1999, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -36,6 +36,16 @@ struct xpvcv { cv_flags_t xcv_flags; }; +/* +=for apidoc AmU||Nullcv +Null CV pointer. + +=for apidoc Am|HV*|CvSTASH|CV* cv +Returns the stash of the CV. + +=cut +*/ + #define Nullcv Null(CV*) #define CvSTASH(sv) ((XPVCV*)SvANY(sv))->xcv_stash diff --git a/cygwin/Makefile.SHs b/cygwin/Makefile.SHs index d466bdea52..8d777788ba 100644 --- a/cygwin/Makefile.SHs +++ b/cygwin/Makefile.SHs @@ -33,12 +33,9 @@ ld2: $& Makefile perlld ${src}/cygwin/ld2.in # install is included in Cygwin distributions, and we make a note of th # requirement in the README.cygwin file. However, let's give them # a warning. - @if test -n "`type $1 2>&1 | sed -n -e '/'$1'$/p'`" ; then \ - install -c -m 755 ld2 ${installbin}/ld2 ; \ - else \ + @install -c -m 755 ld2 ${installbin}/ld2 + @if test ! -f ${installbin}/ld2; then \ echo "*************************************************" ; \ - echo "Oh, no! You didn't read the README.cygwin" ; \ - echo "file, which stated that \"install\" was required." ; \ echo "Make will probably fail in a few more steps." ; \ echo "When it does, copy \"ld2\" to a directory in" ; \ echo "your path, other than \".\"." ; \ @@ -1,6 +1,6 @@ /* deb.c * - * Copyright (c) 1991-1999, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -1,6 +1,6 @@ /* doio.c * - * Copyright (c) 1991-1999, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -217,7 +217,7 @@ Perl_do_open9(pTHX_ GV *gv, register char *name, I32 len, int as_raw, if (*type == '|') { if (num_svs && (tlen != 2 || type[1] != '-')) { unknown_desr: - Perl_croak(aTHX_ "Unknown open() mode '%.*s'", olen, oname); + Perl_croak(aTHX_ "Unknown open() mode '%.*s'", (int)olen, oname); } /*SUPPRESS 530*/ for (type++, tlen--; isSPACE(*type); type++, tlen--) ; @@ -573,7 +573,7 @@ Perl_nextargv(pTHX_ register GV *gv) } #endif #ifdef HAS_RENAME -#if !defined(DOSISH) && !defined(CYGWIN) +#if !defined(DOSISH) && !defined(__CYGWIN__) if (PerlLIO_rename(PL_oldname,SvPVX(sv)) < 0) { if (ckWARN_d(WARN_INPLACE)) Perl_warner(aTHX_ WARN_INPLACE, @@ -1257,7 +1257,7 @@ Perl_do_exec3(pTHX_ char *cmd, int fd, int do_report) if (strnEQ(cmd,"exec",4) && isSPACE(cmd[4])) goto doshell; - for (s = cmd; *s && isALPHA(*s); s++) ; /* catch VAR=val gizmo */ + for (s = cmd; *s && isALNUM(*s); s++) ; /* catch VAR=val gizmo */ if (*s == '=') goto doshell; @@ -1,6 +1,6 @@ /* doop.c * - * Copyright (c) 1991-1999, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -933,7 +933,7 @@ Perl_do_chop(pTHX_ register SV *astr, register SV *sv) s = SvPV(sv, len); if (len && !SvPOK(sv)) s = SvPV_force(sv, len); - if (IN_UTF8) { + if (DO_UTF8(sv)) { if (s && len) { char *send = s + len; char *start = s; @@ -946,12 +946,12 @@ Perl_do_chop(pTHX_ register SV *astr, register SV *sv) *s = '\0'; SvCUR_set(sv, s - start); SvNIOK_off(sv); + SvUTF8_on(astr); } else sv_setpvn(astr, "", 0); } - else - if (s && len) { + else if (s && len) { s += --len; sv_setpvn(astr, s, 1); *s = '\0'; @@ -961,7 +961,7 @@ Perl_do_chop(pTHX_ register SV *astr, register SV *sv) else sv_setpvn(astr, "", 0); SvSETMAGIC(sv); -} +} I32 Perl_do_chomp(pTHX_ register SV *sv) @@ -1,6 +1,6 @@ /* dump.c * - * Copyright (c) 1991-1999, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -78,9 +78,9 @@ Perl_dump_sub(pTHX_ GV *gv) gv_fullname3(sv, gv, Nullch); Perl_dump_indent(aTHX_ 0, Perl_debug_log, "\nSUB %s = ", SvPVX(sv)); if (CvXSUB(GvCV(gv))) - Perl_dump_indent(aTHX_ 0, Perl_debug_log, "(xsub 0x%x %d)\n", + Perl_dump_indent(aTHX_ 0, Perl_debug_log, "(xsub 0x%lx %d)\n", (long)CvXSUB(GvCV(gv)), - CvXSUBANY(GvCV(gv)).any_i32); + (int)CvXSUBANY(GvCV(gv)).any_i32); else if (CvROOT(GvCV(gv))) op_dump(CvROOT(GvCV(gv))); else @@ -131,9 +131,9 @@ Perl_pv_display(pTHX_ SV *sv, char *pv, STRLEN cur, STRLEN len, STRLEN pvlim) } else { if (cur && isDIGIT(*(pv+1))) - Perl_sv_catpvf(aTHX_ sv, "\\%03o", *pv); + Perl_sv_catpvf(aTHX_ sv, "\\%03o", (U8)*pv); else - Perl_sv_catpvf(aTHX_ sv, "\\%o", *pv); + Perl_sv_catpvf(aTHX_ sv, "\\%o", (U8)*pv); } } sv_catpvn(sv, "\"", 1); @@ -392,7 +392,7 @@ Perl_do_op_dump(pTHX_ I32 level, PerlIO *file, OP *o) if (o->op_type == OP_NULL) Perl_dump_indent(aTHX_ level, file, " (was %s)\n", PL_op_name[o->op_targ]); else - Perl_dump_indent(aTHX_ level, file, "TARG = %d\n", o->op_targ); + Perl_dump_indent(aTHX_ level, file, "TARG = %ld\n", (long)o->op_targ); } #ifdef DUMPADDR Perl_dump_indent(aTHX_ level, file, "ADDR = 0x%"UVxf" => 0x%"UVxf"\n", (UV)o, (UV)o->op_next); @@ -701,7 +701,7 @@ Perl_do_magic_dump(pTHX_ I32 level, PerlIO *file, MAGIC *mg, I32 nest, I32 maxne 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); + Perl_dump_indent(aTHX_ level, file, " MG_LEN = %ld\n", (long)mg->mg_len); if (mg->mg_ptr) { Perl_dump_indent(aTHX_ level, file, " MG_PTR = 0x%"UVxf, PTR2UV(mg->mg_ptr)); if (mg->mg_len >= 0) { @@ -782,8 +782,8 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo Perl_sv_setpvf(aTHX_ d, "(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, ""); + (int)(PL_dumpindent*level), "", (IV)SvREFCNT(sv), + (int)(PL_dumpindent*level), ""); if (flags & SVs_PADBUSY) sv_catpv(d, "PADBUSY,"); if (flags & SVs_PADTMP) sv_catpv(d, "PADTMP,"); @@ -846,6 +846,7 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo default: if (SvEVALED(sv)) sv_catpv(d, "EVALED,"); if (SvIsUV(sv)) sv_catpv(d, "IsUV,"); + if (SvUTF8(sv)) sv_catpv(d, "UTF8"); break; case SVt_PVBM: if (SvTAIL(sv)) sv_catpv(d, "TAIL,"); @@ -1089,7 +1090,7 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo 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 */ - Perl_dump_indent(aTHX_ level, file, " FLAGS = 0x%"UVxf"\n", CvFLAGS(sv)); + Perl_dump_indent(aTHX_ level, file, " FLAGS = 0x%"UVxf"\n", (UV)CvFLAGS(sv)); if (type == SVt_PVFM) 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))); @@ -1107,7 +1108,7 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo /* %5d below is enough whitespace. */ file, "%5d. 0x%"UVxf" (%s\"%s\" %"IVdf"-%"IVdf")\n", - ix, PTR2UV(ppad[ix]), + (int)ix, PTR2UV(ppad[ix]), SvFAKE(pname[ix]) ? "FAKE " : "", SvPVX(pname[ix]), (IV)SvNVX(pname[ix]), diff --git a/eg/cgi/index.html b/eg/cgi/index.html index 4125b28920..133ecc4a16 100644 --- a/eg/cgi/index.html +++ b/eg/cgi/index.html @@ -108,12 +108,12 @@ or Internet Explorer 3.0 and higher</EM> <HR> <MENU> <LI> <A HREF="../cgi_docs.html">CGI.pm documentation</A> - <LI> <A HREF="../../CGI.pm.tar.gz">Download the CGI.pm distribution</A> + <LI> <A HREF="../CGI.pm.tar.gz">Download the CGI.pm distribution</A> </MENU> <HR> <ADDRESS>Lincoln D. Stein, lstein@genome.wi.mit.edu<br> <a href="/">Whitehead Institute/MIT Center for Genome Research</a></ADDRESS> <!-- hhmts start --> -Last modified: Tue Nov 24 18:07:15 MET 1998 +Last modified: Wed Jun 23 15:31:47 EDT 1999 <!-- hhmts end --> </BODY> </HTML> @@ -712,6 +712,7 @@ #define vivify_defelem Perl_vivify_defelem #define vivify_ref Perl_vivify_ref #define wait4pid Perl_wait4pid +#define report_closed_fh Perl_report_closed_fh #define report_uninit Perl_report_uninit #define warn Perl_warn #define vwarn Perl_vwarn @@ -857,6 +858,7 @@ #define too_many_arguments S_too_many_arguments #define op_clear S_op_clear #define null S_null +#define pad_addlex S_pad_addlex #define pad_findlex S_pad_findlex #define newDEFSVOP S_newDEFSVOP #define new_logop S_new_logop @@ -2129,6 +2131,7 @@ #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_closed_fh(a,b,c,d) Perl_report_closed_fh(aTHX_ a,b,c,d) #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) @@ -2268,6 +2271,7 @@ #define too_many_arguments(a,b) S_too_many_arguments(aTHX_ a,b) #define op_clear(a) S_op_clear(aTHX_ a) #define null(a) S_null(aTHX_ a) +#define pad_addlex(a) S_pad_addlex(aTHX_ a) #define pad_findlex(a,b,c,d,e,f,g) S_pad_findlex(aTHX_ a,b,c,d,e,f,g) #define newDEFSVOP() S_newDEFSVOP(aTHX) #define new_logop(a,b,c,d) S_new_logop(aTHX_ a,b,c,d) @@ -4172,6 +4176,8 @@ #define vivify_ref Perl_vivify_ref #define Perl_wait4pid CPerlObj::Perl_wait4pid #define wait4pid Perl_wait4pid +#define Perl_report_closed_fh CPerlObj::Perl_report_closed_fh +#define report_closed_fh Perl_report_closed_fh #define Perl_report_uninit CPerlObj::Perl_report_uninit #define report_uninit Perl_report_uninit #define Perl_warn CPerlObj::Perl_warn @@ -4435,6 +4441,8 @@ #define op_clear S_op_clear #define S_null CPerlObj::S_null #define null S_null +#define S_pad_addlex CPerlObj::S_pad_addlex +#define pad_addlex S_pad_addlex #define S_pad_findlex CPerlObj::S_pad_findlex #define pad_findlex S_pad_findlex #define S_newDEFSVOP CPerlObj::S_newDEFSVOP @@ -1,6 +1,7 @@ #!/usr/bin/perl -w -require 5.003; +require 5.003; # keep this compatible, an old perl is all we may have before + # we build the new one # # See database of global and static function prototypes at the __END__. @@ -134,17 +135,25 @@ sub write_protos { } $ret .= ")"; $ret .= " __attribute__((noreturn))" if $flags =~ /r/; + if( $flags =~ /f/ ) { + my $prefix = $flags =~ /n/ ? '' : 'pTHX_'; + my $args = scalar @args; + $ret .= "\n#ifdef CHECK_FORMAT\n"; + $ret .= sprintf " __attribute__((format(printf,%s%d,%s%d)))", + $prefix, $args - 1, $prefix, $args; + $ret .= "\n#endif\n"; + } $ret .= ";\n"; } $ret; } -# generates global.sym, and populates %global with global symbols +# generates global.sym (API export list), and populates %global with global symbols sub write_global_sym { my $ret = ""; if (@_ > 1) { my ($flags,$retval,$func,@args) = @_; - unless ($flags =~ /[sx]/) { + if ($flags =~ /A/ && $flags !~ /x/) { # public API, so export $func = "Perl_$func" if $flags =~ /p/; $ret = "$func\n"; } @@ -251,7 +260,7 @@ sub hide ($$) { "#define $from" . "\t" x ($t < 3 ? 3 - $t : 1) . "$to\n"; } -sub objxsub_var ($$) { +sub bincompat_var ($$) { my ($pfx, $sym) = @_; my $arg = ($pfx eq 'G' ? 'NULL' : 'aTHXo'); undefine("PL_$sym") . hide("PL_$sym", "(*Perl_${pfx}${sym}_ptr($arg))"); @@ -702,27 +711,9 @@ print OBX <<'EOT'; #ifndef __objXSUB_h__ #define __objXSUB_h__ -/* Variables */ - -EOT +/* method calls via pPerl (static functions without a "this" pointer need these) */ -foreach my $sym (sort keys %intrp) { - print OBX objxsub_var('I',$sym); -} - -foreach my $sym (sort keys %thread) { - print OBX objxsub_var('T',$sym); -} - -foreach my $sym (sort keys %globvar) { - print OBX objxsub_var('G',$sym); -} - -print OBX <<'EOT'; - -/* Functions */ - -#if defined(PERL_OBJECT) +#if defined(PERL_CORE) && defined(PERL_OBJECT) /* XXX soon to be eliminated, only a few things in PERLCORE need these now */ @@ -736,7 +727,7 @@ walk_table { } else { my ($flags,$retval,$func,@args) = @_; - unless ($flags =~ /[js]/) { + if ($flags =~ /A/ && $flags !~ /j/) { # API function needing macros if ($flags =~ /p/) { $ret .= undefine("Perl_$func") . hide("Perl_$func","pPerl->Perl_$func"); $ret .= undefine($func) . hide($func,"Perl_$func"); @@ -749,15 +740,16 @@ walk_table { $ret; } \*OBX; -for $sym (sort keys %ppsym) { - $sym =~ s/^Perl_//; - print OBX undefine("Perl_$sym") . hide("Perl_$sym", "pPerl->Perl_$sym"); - print OBX undefine($sym) . hide($sym, "Perl_$sym"); -} +# NOTE: not part of API +#for $sym (sort keys %ppsym) { +# $sym =~ s/^Perl_//; +# print OBX undefine("Perl_$sym") . hide("Perl_$sym", "pPerl->Perl_$sym"); +# print OBX undefine($sym) . hide($sym, "Perl_$sym"); +#} print OBX <<'EOT'; -#endif /* PERL_OBJECT */ +#endif /* PERL_CORE && PERL_OBJECT */ #endif /* __objXSUB_h__ */ EOT @@ -775,8 +767,10 @@ print CAPIH <<'EOT'; */ /* declare accessor functions for Perl variables */ +#ifndef __perlapi_h__ +#define __perlapi_h__ -#if defined(PERL_OBJECT) || defined (PERL_CAPI) +#if defined(PERL_OBJECT) || defined (MULTIPLICITY) #if defined(PERL_OBJECT) # undef aTHXo @@ -808,10 +802,69 @@ START_EXTERN_C END_EXTERN_C -#endif /* PERL_OBJECT || PERL_CAPI */ +#if defined(PERL_CORE) + +/* accessor functions for Perl variables (provide binary compatibility) */ + +/* these need to be mentioned here, or most linkers won't put them in + the perl executable */ + +#ifndef PERL_NO_FORCE_LINK + +START_EXTERN_C + +#ifndef DOINIT +EXT void *PL_force_link_funcs[]; +#else +EXT void *PL_force_link_funcs[] = { +#undef PERLVAR +#undef PERLVARA +#undef PERLVARI +#undef PERLVARIC +#define PERLVAR(v,t) (void*)Perl_##v##_ptr, +#define PERLVARA(v,n,t) PERLVAR(v,t) +#define PERLVARI(v,t,i) PERLVAR(v,t) +#define PERLVARIC(v,t,i) PERLVAR(v,t) + +#include "thrdvar.h" +#include "intrpvar.h" +#include "perlvars.h" + +#undef PERLVAR +#undef PERLVARA +#undef PERLVARI +#undef PERLVARIC +}; +#endif /* DOINIT */ + +START_EXTERN_C + +#endif /* PERL_NO_FORCE_LINK */ + +#else /* !PERL_CORE */ EOT +foreach my $sym (sort keys %intrp) { + print CAPIH bincompat_var('I',$sym); +} + +foreach my $sym (sort keys %thread) { + print CAPIH bincompat_var('T',$sym); +} + +foreach my $sym (sort keys %globvar) { + print CAPIH bincompat_var('G',$sym); +} + +print CAPIH <<'EOT'; + +#endif /* !PERL_CORE */ +#endif /* PERL_OBJECT || MULTIPLICITY */ + +#endif /* __perlapi_h__ */ + +EOT print CAPI <<'EOT'; /* !!!!!!! DO NOT EDIT THIS FILE !!!!!!! @@ -823,7 +876,7 @@ print CAPI <<'EOT'; #include "perl.h" #include "perlapi.h" -#if defined(PERL_OBJECT) +#if defined(PERL_OBJECT) || defined (MULTIPLICITY) /* accessor functions for Perl variables (provides binary compatibility) */ START_EXTERN_C @@ -832,10 +885,19 @@ START_EXTERN_C #undef PERLVARA #undef PERLVARI #undef PERLVARIC + +#if defined(PERL_OBJECT) #define PERLVAR(v,t) t* Perl_##v##_ptr(pTHXo) \ { return &(aTHXo->interp.v); } #define PERLVARA(v,n,t) PL_##v##_t* Perl_##v##_ptr(pTHXo) \ { return &(aTHXo->interp.v); } +#else /* MULTIPLICITY */ +#define PERLVAR(v,t) t* Perl_##v##_ptr(pTHX) \ + { return &(aTHX->v); } +#define PERLVARA(v,n,t) PL_##v##_t* Perl_##v##_ptr(pTHX) \ + { return &(aTHX->v); } +#endif + #define PERLVARI(v,t,i) PERLVAR(v,t) #define PERLVARIC(v,t,i) PERLVAR(v, const t) @@ -855,6 +917,10 @@ START_EXTERN_C #undef PERLVARI #undef PERLVARIC +#if defined(PERL_OBJECT) + +/* C-API layer for PERL_OBJECT */ + EOT # functions that take va_list* for implementing vararg functions @@ -879,7 +945,8 @@ my %vfuncs = qw( sub emit_func { my ($addcontext, $rettype,$func,@args) = @_; my @aargs = @args; - for my $a (@aargs) { $a =~ s/^.*\b(\w+)$/$1/ } + my $a; + for $a (@aargs) { $a =~ s/^.*\b(\w+)$/$1/ } my $ctxarg = ''; if (not $addcontext) { $ctxarg = 'pTHXo'; @@ -928,7 +995,8 @@ EOT } # XXXX temporary hack -for my $sym (qw( +my $sym; +for $sym (qw( perl_construct perl_destruct perl_free @@ -948,7 +1016,7 @@ walk_table { else { my ($flags,$retval,$func,@args) = @_; return $ret if exists $skipapi_funcs{$func}; - unless ($flags =~ /[js]/) { + if ($flags =~ /A/ && $flags !~ /j/) { # in public API, needed for XSUBS $ret .= "\n"; my $addctx = 1 if $flags =~ /n/; if ($flags =~ /p/) { @@ -964,17 +1032,18 @@ walk_table { $ret; } \*CAPI; -for $sym (sort keys %ppsym) { - $sym =~ s/^Perl_//; - print CAPI "\n"; - print CAPI undefine("Perl_$sym"); - if ($sym =~ /^ck_/) { - print CAPI emit_func(0, 'OP *',"Perl_$sym",'OP *o'); - } - else { # pp_foo - print CAPI emit_func(0, 'OP *',"Perl_$sym"); - } -} +# NOTE: not part of the API +#for $sym (sort keys %ppsym) { +# $sym =~ s/^Perl_//; +# print CAPI "\n"; +# print CAPI undefine("Perl_$sym"); +# if ($sym =~ /^ck_/) { +# print CAPI emit_func(0, 'OP *',"Perl_$sym",'OP *o'); +# } +# else { # pp_foo +# print CAPI emit_func(0, 'OP *',"Perl_$sym"); +# } +#} print CAPI <<'EOT'; @@ -991,8 +1060,204 @@ Perl_fprintf_nocontext(PerlIO *stream, const char *format, ...) END_EXTERN_C #endif /* PERL_OBJECT */ +#endif /* PERL_OBJECT || MULTIPLICITY */ EOT +close(CAPI); + +# autogenerate documentation from comments in source files + +my %apidocs; +my %gutsdocs; +my %docfuncs; + +sub autodoc ($) { # parse a file and extract documentation info + my($fh) = @_; + my($in, $doc); + +FUNC: + while (defined($in = <$fh>)) { + if ($in =~ /^=for\s+apidoc\s+(.*)\n/) { + my $proto = $1; + $proto = "||$proto" unless $proto =~ /\|/; + my($flags, $ret, $name, @args) = split /\|/, $proto; + my $docs = ""; +DOC: + while (defined($doc = <$fh>)) { + last DOC if $doc =~ /^=\w+/; + $docs .= $doc; + } + $docs = "\n$docs" if $docs and $docs !~ /^\n/; + if ($flags =~ /m/) { + if ($flags =~ /A/) { + $apidocs{$name} = [$flags, $docs, $ret, @args]; + } + else { + $gutsdocs{$name} = [$flags, $docs, $ret, @args]; + } + } + else { + $docfuncs{$name} = [$flags, $docs, $ret, @args]; + } + if ($doc =~ /^=for/) { + $in = $doc; + redo FUNC; + } + } + } +} + +sub docout ($$$) { # output the docs for one function + my($fh, $name, $docref) = @_; + my($flags, $docs, $ret, @args) = @$docref; + + $docs .= "NOTE: the perl_ form of this function is deprecated.\n\n" + if $flags =~ /p/; + + print $fh "=item $name\n$docs"; + + if ($flags =~ /U/) { # no usage + # nothing + } elsif ($flags =~ /s/) { # semicolon ("dTHR;") + print $fh "\t\t$name;\n\n"; + } elsif ($flags =~ /n/) { # no args + print $fh "\t$ret\t$name\n\n"; + } else { # full usage + print $fh "\t$ret\t$name"; + print $fh "(" . join(", ", @args) . ")"; + print $fh "\n\n"; + } +} + +my $file; +for $file (glob('*.c'), glob('*.h')) { + open F, "< $file" or die "Cannot open $file for docs: $!\n"; + autodoc(\*F); + close F or die "Error closing $file: $!\n"; +} + +unlink "pod/perlapi.pod"; +open (DOC, ">pod/perlapi.pod") or + die "Can't create pod/perlapi.pod: $!\n"; + +walk_table { # load documented functions into approriate hash + if (@_ > 1) { + my($flags, $retval, $func, @args) = @_; + return "" unless $flags =~ /d/; + $func =~ s/\t//g; $flags =~ s/p//; # clean up fields from embed.pl + $retval =~ s/\t//; + if ($flags =~ /A/) { + my $docref = delete $docfuncs{$func}; + warn "no docs for $func\n" unless $docref and @$docref; + $apidocs{$func} = [$docref->[0] . 'A', $docref->[1], $retval, @args]; + } else { + my $docref = delete $docfuncs{$func}; + $gutsdocs{$func} = [$docref->[0], $docref->[1], $retval, @args]; + } + } + return ""; +} \*DOC; + +for (sort keys %docfuncs) { + warn "Unable to place $_!\n"; +} + +print DOC <<'_EOB_'; +=head1 NAME + +perlapi - autogenerated documentation for the perl public API + +=head1 DESCRIPTION + +This file contains the documentation of the perl public API generated by +embed.pl, specifically a listing of functions, macros, flags, and variables +that may be used by extension writers. The interfaces of any functions that +are not listed here are subject to change without notice. For this reason, +blindly using functions listed in proto.h is to be avoided when writing +extensions. + +Note that all Perl API global variables must be referenced with the C<PL_> +prefix. Some macros are provided for compatibility with the older, +unadorned names, but this support may be disabled in a future release. + +The listing is alphabetical, case insensitive. + +=over 8 + +_EOB_ + +my $key; +for $key (sort { uc($a) cmp uc($b); } keys %apidocs) { # case insensitive sort + docout(\*DOC, $key, $apidocs{$key}); +} + +print DOC <<'_EOE_'; +=back + +=head1 AUTHORS + +Until May 1997, this document was maintained by Jeff Okamoto +<okamoto@corp.hp.com>. It is now maintained as part of Perl itself. + +With lots of help and suggestions from Dean Roehrich, Malcolm Beattie, +Andreas Koenig, Paul Hudson, Ilya Zakharevich, Paul Marquess, Neil +Bowers, Matthew Green, Tim Bunce, Spider Boardman, Ulrich Pfeifer, +Stephen McCamant, and Gurusamy Sarathy. + +API Listing originally by Dean Roehrich <roehrich@cray.com>. + +Updated to be autogenerated from comments in the source by Benjamin Stuhl. + +=head1 SEE ALSO + +perlguts(1), perlxs(1), perlxstut(1), perlintern(1) + +_EOE_ + + +close(DOC); + +open(GUTS, ">pod/perlintern.pod") or + die "Unable to create pod/perlintern.pod: $!\n"; +print GUTS <<'END'; +=head1 NAME + +perlintern - autogenerated documentation of purely B<internal> + Perl functions + +=head1 DESCRIPTION + +This file is the autogenerated documentation of functions in the +Perl intrepreter that are documented using Perl's internal documentation +format but are not marked as part of the Perl API. In other words, +B<they are not for use in extensions>! + +=over 8 + +END + +for $key (sort { uc($a) cmp uc($b); } keys %gutsdocs) { + docout(\*GUTS, $key, $gutsdocs{$key}); +} + +print GUTS <<'END'; +=back + +=head1 AUTHORS + +The autodocumentation system was orignally added to the Perl core by +Benjamin Stuhl. Documentation is by whoever was kind enough to +document their functions. + +=head1 SEE ALSO + +perlguts(1), perlapi(1) + +END + +close GUTS; + + __END__ : Lines are of the form: @@ -1002,10 +1267,13 @@ __END__ : Leading and trailing whitespace will be ignored in each component. : : flags are single letters with following meanings: +: A member of public API +: d function has documentation with its source : s static function, should have an S_ prefix in source -: file +: file : n has no implicit interpreter/thread context argument : p function has a Perl_ prefix +: f function takes printf style format string, varargs : r function never returns : o has no compatibility macro (#define foo Perl_foo) : j not a member of CPerlObj @@ -1015,33 +1283,30 @@ __END__ : : 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 \ +Ajno |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 +Ajnod |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 \ +Ajnod |void |perl_construct |PerlInterpreter* interp +Ajnod |void |perl_destruct |PerlInterpreter* interp +Ajnod |void |perl_free |PerlInterpreter* interp +Ajnod |int |perl_run |PerlInterpreter* interp +Ajnod |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 +: XXX: perl_clone needs docs +Ajno |PerlInterpreter*|perl_clone|PerlInterpreter* interp, UV flags # if defined(PERL_IMPLICIT_SYS) -jno |PerlInterpreter*|perl_clone_using|PerlInterpreter *interp|UV flags \ +Ajno |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 \ @@ -1051,10 +1316,10 @@ jno |PerlInterpreter*|perl_clone_using|PerlInterpreter *interp|UV flags \ #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 +Ajnop |Malloc_t|malloc |MEM_SIZE nbytes +Ajnop |Malloc_t|calloc |MEM_SIZE elements|MEM_SIZE size +Ajnop |Malloc_t|realloc |Malloc_t where|MEM_SIZE nbytes +Ajnop |Free_t |mfree |Malloc_t where jnp |MEM_SIZE|malloced_size |void *p #endif @@ -1079,99 +1344,99 @@ public: 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 +Ap |SV* |amagic_call |SV* left|SV* right|int method|int dir +Ap |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 -p |void |av_fill |AV* ar|I32 fill -p |I32 |av_len |AV* ar -p |AV* |av_make |I32 size|SV** svp -p |SV* |av_pop |AV* ar -p |void |av_push |AV* ar|SV* val -p |void |av_reify |AV* ar -p |SV* |av_shift |AV* ar -p |SV** |av_store |AV* ar|I32 key|SV* val -p |void |av_undef |AV* ar -p |void |av_unshift |AV* ar|I32 num +Ap |SV* |avhv_delete_ent|AV *ar|SV* keysv|I32 flags|U32 hash +Ap |bool |avhv_exists_ent|AV *ar|SV* keysv|U32 hash +Ap |SV** |avhv_fetch_ent |AV *ar|SV* keysv|I32 lval|U32 hash +Ap |HE* |avhv_iternext |AV *ar +Ap |SV* |avhv_iterval |AV *ar|HE* entry +Ap |HV* |avhv_keys |AV *ar +Apd |void |av_clear |AV* ar +Ap |SV* |av_delete |AV* ar|I32 key|I32 flags +Ap |bool |av_exists |AV* ar|I32 key +Apd |void |av_extend |AV* ar|I32 key +Ap |AV* |av_fake |I32 size|SV** svp +Apd |SV** |av_fetch |AV* ar|I32 key|I32 lval +Ap |void |av_fill |AV* ar|I32 fill +Apd |I32 |av_len |AV* ar +Apd |AV* |av_make |I32 size|SV** svp +Apd |SV* |av_pop |AV* ar +Apd |void |av_push |AV* ar|SV* val +Ap |void |av_reify |AV* ar +Apd |SV* |av_shift |AV* ar +Apd |SV** |av_store |AV* ar|I32 key|SV* val +Apd |void |av_undef |AV* ar +Apd |void |av_unshift |AV* ar|I32 num p |OP* |bind_match |I32 type|OP* left|OP* pat p |OP* |block_end |I32 floor|OP* seq -p |I32 |block_gimme +Ap |I32 |block_gimme p |int |block_start |int full p |void |boot_core_UNIVERSAL -p |void |call_list |I32 oldscope|AV* av_list +Ap |void |call_list |I32 oldscope|AV* av_list p |bool |cando |Mode_t mode|Uid_t effective|Stat_t* statbufp -p |U32 |cast_ulong |NV f -p |I32 |cast_i32 |NV f -p |IV |cast_iv |NV f -p |UV |cast_uv |NV f +Ap |U32 |cast_ulong |NV f +Ap |I32 |cast_i32 |NV f +Ap |IV |cast_iv |NV f +Ap |UV |cast_uv |NV f #if !defined(HAS_TRUNCATE) && !defined(HAS_CHSIZE) && defined(F_FREESP) -p |I32 |my_chsize |int fd|Off_t length +Ap |I32 |my_chsize |int fd|Off_t length #endif #if defined(USE_THREADS) -p |MAGIC* |condpair_magic |SV *sv +Ap |MAGIC* |condpair_magic |SV *sv #endif p |OP* |convert |I32 optype|I32 flags|OP* o -pr |void |croak |const char* pat|... -pr |void |vcroak |const char* pat|va_list* args +Afprd |void |croak |const char* pat|... +Apr |void |vcroak |const char* pat|va_list* args #if defined(PERL_IMPLICIT_CONTEXT) -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|... -np |SV* |mess_nocontext |const char* pat|... -np |void |warn_nocontext |const char* pat|... -np |void |warner_nocontext|U32 err|const char* pat|... -np |SV* |newSVpvf_nocontext|const char* pat|... -np |void |sv_catpvf_nocontext|SV* sv|const char* pat|... -np |void |sv_setpvf_nocontext|SV* sv|const char* pat|... -np |void |sv_catpvf_mg_nocontext|SV* sv|const char* pat|... -np |void |sv_setpvf_mg_nocontext|SV* sv|const char* pat|... -np |int |fprintf_nocontext|PerlIO* stream|const char* fmt|... +Afnrp |void |croak_nocontext|const char* pat|... +Afnp |OP* |die_nocontext |const char* pat|... +Afnp |void |deb_nocontext |const char* pat|... +Afnp |char* |form_nocontext |const char* pat|... +Afnp |SV* |mess_nocontext |const char* pat|... +Afnp |void |warn_nocontext |const char* pat|... +Afnp |void |warner_nocontext|U32 err|const char* pat|... +Afnp |SV* |newSVpvf_nocontext|const char* pat|... +Afnp |void |sv_catpvf_nocontext|SV* sv|const char* pat|... +Afnp |void |sv_setpvf_nocontext|SV* sv|const char* pat|... +Afnp |void |sv_catpvf_mg_nocontext|SV* sv|const char* pat|... +Afnp |void |sv_setpvf_mg_nocontext|SV* sv|const char* pat|... +Afnp |int |fprintf_nocontext|PerlIO* stream|const char* fmt|... #endif p |void |cv_ckproto |CV* cv|GV* gv|char* p p |CV* |cv_clone |CV* proto p |SV* |cv_const_sv |CV* cv p |SV* |op_const_sv |OP* o|CV* cv p |void |cv_undef |CV* cv -p |void |cx_dump |PERL_CONTEXT* cs -p |SV* |filter_add |filter_t funcp|SV* datasv -p |void |filter_del |filter_t funcp -p |I32 |filter_read |int idx|SV* buffer|int maxlen -p |char** |get_op_descs -p |char** |get_op_names +Ap |void |cx_dump |PERL_CONTEXT* cs +Ap |SV* |filter_add |filter_t funcp|SV* datasv +Ap |void |filter_del |filter_t funcp +Ap |I32 |filter_read |int idx|SV* buffer|int maxlen +Ap |char** |get_op_descs +Ap |char** |get_op_names p |char* |get_no_modify p |U32* |get_opargs -p |PPADDR_t*|get_ppaddr +Ap |PPADDR_t*|get_ppaddr p |I32 |cxinc -p |void |deb |const char* pat|... -p |void |vdeb |const char* pat|va_list* args -p |void |debprofdump -p |I32 |debop |OP* o -p |I32 |debstack -p |I32 |debstackptrs -p |char* |delimcpy |char* to|char* toend|char* from \ +Afp |void |deb |const char* pat|... +Ap |void |vdeb |const char* pat|va_list* args +Ap |void |debprofdump +Ap |I32 |debop |OP* o +Ap |I32 |debstack +Ap |I32 |debstackptrs +Ap |char* |delimcpy |char* to|char* toend|char* from \ |char* fromend|int delim|I32* retlen p |void |deprecate |char* s -p |OP* |die |const char* pat|... +Afp |OP* |die |const char* pat|... p |OP* |vdie |const char* pat|va_list* args p |OP* |die_where |char* message|STRLEN msglen -p |void |dounwind |I32 cxix +Ap |void |dounwind |I32 cxix p |bool |do_aexec |SV* really|SV** mark|SV** sp p |bool |do_aexec5 |SV* really|SV** mark|SV** sp|int fd|int flag -p |int |do_binmode |PerlIO *fp|int iotype|int flag +Ap |int |do_binmode |PerlIO *fp|int iotype|int flag p |void |do_chop |SV* asv|SV* sv p |bool |do_close |GV* gv|bool not_implicit p |bool |do_eof |GV* gv @@ -1190,9 +1455,9 @@ p |I32 |do_shmio |I32 optype|SV** mark|SV** sp #endif p |void |do_join |SV* sv|SV* del|SV** mark|SV** sp p |OP* |do_kv -p |bool |do_open |GV* gv|char* name|I32 len|int as_raw \ +Ap |bool |do_open |GV* gv|char* name|I32 len|int as_raw \ |int rawmode|int rawperm|PerlIO* supplied_fp -p |bool |do_open9 |GV *gv|char *name|I32 len|int as_raw \ +Ap |bool |do_open9 |GV *gv|char *name|I32 len|int as_raw \ |int rawmode|int rawperm|PerlIO *supplied_fp \ |SV *svs|I32 num p |void |do_pipe |SV* sv|GV* rgv|GV* wgv @@ -1208,20 +1473,20 @@ p |UV |do_vecget |SV* sv|I32 offset|I32 size p |void |do_vecset |SV* sv p |void |do_vop |I32 optype|SV* sv|SV* left|SV* right p |OP* |dofile |OP* term -p |I32 |dowantarray -p |void |dump_all -p |void |dump_eval +Ap |I32 |dowantarray +Ap |void |dump_all +Ap |void |dump_eval #if defined(DUMP_FDS) -p |void |dump_fds |char* s +Ap |void |dump_fds |char* s #endif -p |void |dump_form |GV* gv -p |void |gv_dump |GV* gv -p |void |op_dump |OP* arg -p |void |pmop_dump |PMOP* pm -p |void |dump_packsubs |HV* stash -p |void |dump_sub |GV* gv -p |void |fbm_compile |SV* sv|U32 flags -p |char* |fbm_instr |unsigned char* big|unsigned char* bigend \ +Ap |void |dump_form |GV* gv +Ap |void |gv_dump |GV* gv +Ap |void |op_dump |OP* arg +Ap |void |pmop_dump |PMOP* pm +Ap |void |dump_packsubs |HV* stash +Ap |void |dump_sub |GV* gv +Apd |void |fbm_compile |SV* sv|U32 flags +Apd |char* |fbm_instr |unsigned char* big|unsigned char* bigend \ |SV* littlesv|U32 flags p |char* |find_script |char *scriptname|bool dosearch \ |char **search_ext|I32 flags @@ -1230,126 +1495,126 @@ p |PADOFFSET|find_threadsv|const char *name #endif p |OP* |force_list |OP* arg p |OP* |fold_constants |OP* arg -p |char* |form |const char* pat|... -p |char* |vform |const char* pat|va_list* args -p |void |free_tmps +Afp |char* |form |const char* pat|... +Ap |char* |vform |const char* pat|va_list* args +Ap |void |free_tmps p |OP* |gen_constant_list|OP* o #if !defined(HAS_GETENV_LEN) p |char* |getenv_len |char* key|unsigned long *len #endif -p |void |gp_free |GV* gv -p |GP* |gp_ref |GP* gp -p |GV* |gv_AVadd |GV* gv -p |GV* |gv_HVadd |GV* gv -p |GV* |gv_IOadd |GV* gv -p |GV* |gv_autoload4 |HV* stash|const char* name|STRLEN len \ +Ap |void |gp_free |GV* gv +Ap |GP* |gp_ref |GP* gp +Ap |GV* |gv_AVadd |GV* gv +Ap |GV* |gv_HVadd |GV* gv +Ap |GV* |gv_IOadd |GV* gv +Ap |GV* |gv_autoload4 |HV* stash|const char* name|STRLEN len \ |I32 method -p |void |gv_check |HV* stash -p |void |gv_efullname |SV* sv|GV* gv -p |void |gv_efullname3 |SV* sv|GV* gv|const char* prefix -p |GV* |gv_fetchfile |const char* name -p |GV* |gv_fetchmeth |HV* stash|const char* name|STRLEN len \ +Ap |void |gv_check |HV* stash +Ap |void |gv_efullname |SV* sv|GV* gv +Ap |void |gv_efullname3 |SV* sv|GV* gv|const char* prefix +Ap |GV* |gv_fetchfile |const char* name +Apd |GV* |gv_fetchmeth |HV* stash|const char* name|STRLEN len \ |I32 level -p |GV* |gv_fetchmethod |HV* stash|const char* name -p |GV* |gv_fetchmethod_autoload|HV* stash|const char* name \ +Apd |GV* |gv_fetchmethod |HV* stash|const char* name +Apd |GV* |gv_fetchmethod_autoload|HV* stash|const char* name \ |I32 autoload -p |GV* |gv_fetchpv |const char* name|I32 add|I32 sv_type -p |void |gv_fullname |SV* sv|GV* gv -p |void |gv_fullname3 |SV* sv|GV* gv|const char* prefix -p |void |gv_init |GV* gv|HV* stash|const char* name \ +Ap |GV* |gv_fetchpv |const char* name|I32 add|I32 sv_type +Ap |void |gv_fullname |SV* sv|GV* gv +Ap |void |gv_fullname3 |SV* sv|GV* gv|const char* prefix +Ap |void |gv_init |GV* gv|HV* stash|const char* name \ |STRLEN len|int multi -p |HV* |gv_stashpv |const char* name|I32 create -p |HV* |gv_stashpvn |const char* name|U32 namelen|I32 create -p |HV* |gv_stashsv |SV* sv|I32 create -p |void |hv_clear |HV* tb -p |void |hv_delayfree_ent|HV* hv|HE* entry -p |SV* |hv_delete |HV* tb|const char* key|U32 klen|I32 flags -p |SV* |hv_delete_ent |HV* tb|SV* key|I32 flags|U32 hash -p |bool |hv_exists |HV* tb|const char* key|U32 klen -p |bool |hv_exists_ent |HV* tb|SV* key|U32 hash -p |SV** |hv_fetch |HV* tb|const char* key|U32 klen|I32 lval -p |HE* |hv_fetch_ent |HV* tb|SV* key|I32 lval|U32 hash -p |void |hv_free_ent |HV* hv|HE* entry -p |I32 |hv_iterinit |HV* tb -p |char* |hv_iterkey |HE* entry|I32* retlen -p |SV* |hv_iterkeysv |HE* entry -p |HE* |hv_iternext |HV* tb -p |SV* |hv_iternextsv |HV* hv|char** key|I32* retlen -p |SV* |hv_iterval |HV* tb|HE* entry -p |void |hv_ksplit |HV* hv|IV newmax -p |void |hv_magic |HV* hv|GV* gv|int how -p |SV** |hv_store |HV* tb|const char* key|U32 klen|SV* val \ +Apd |HV* |gv_stashpv |const char* name|I32 create +Ap |HV* |gv_stashpvn |const char* name|U32 namelen|I32 create +Apd |HV* |gv_stashsv |SV* sv|I32 create +Apd |void |hv_clear |HV* tb +Ap |void |hv_delayfree_ent|HV* hv|HE* entry +Apd |SV* |hv_delete |HV* tb|const char* key|U32 klen|I32 flags +Apd |SV* |hv_delete_ent |HV* tb|SV* key|I32 flags|U32 hash +Apd |bool |hv_exists |HV* tb|const char* key|U32 klen +Apd |bool |hv_exists_ent |HV* tb|SV* key|U32 hash +Apd |SV** |hv_fetch |HV* tb|const char* key|U32 klen|I32 lval +Apd |HE* |hv_fetch_ent |HV* tb|SV* key|I32 lval|U32 hash +Ap |void |hv_free_ent |HV* hv|HE* entry +Apd |I32 |hv_iterinit |HV* tb +Apd |char* |hv_iterkey |HE* entry|I32* retlen +Apd |SV* |hv_iterkeysv |HE* entry +Apd |HE* |hv_iternext |HV* tb +Apd |SV* |hv_iternextsv |HV* hv|char** key|I32* retlen +Apd |SV* |hv_iterval |HV* tb|HE* entry +Ap |void |hv_ksplit |HV* hv|IV newmax +Apd |void |hv_magic |HV* hv|GV* gv|int how +Apd |SV** |hv_store |HV* tb|const char* key|U32 klen|SV* val \ |U32 hash -p |HE* |hv_store_ent |HV* tb|SV* key|SV* val|U32 hash -p |void |hv_undef |HV* tb -p |I32 |ibcmp |const char* a|const char* b|I32 len -p |I32 |ibcmp_locale |const char* a|const char* b|I32 len +Apd |HE* |hv_store_ent |HV* tb|SV* key|SV* val|U32 hash +Apd |void |hv_undef |HV* tb +Ap |I32 |ibcmp |const char* a|const char* b|I32 len +Ap |I32 |ibcmp_locale |const char* a|const char* b|I32 len p |bool |ingroup |Gid_t testgid|Uid_t effective p |void |init_debugger -p |void |init_stacks +Ap |void |init_stacks p |U32 |intro_my -p |char* |instr |const char* big|const char* little +Ap |char* |instr |const char* big|const char* little p |bool |io_close |IO* io|bool not_implicit p |OP* |invert |OP* cmd -p |bool |is_uni_alnum |U32 c -p |bool |is_uni_alnumc |U32 c -p |bool |is_uni_idfirst |U32 c -p |bool |is_uni_alpha |U32 c -p |bool |is_uni_ascii |U32 c -p |bool |is_uni_space |U32 c -p |bool |is_uni_cntrl |U32 c -p |bool |is_uni_graph |U32 c -p |bool |is_uni_digit |U32 c -p |bool |is_uni_upper |U32 c -p |bool |is_uni_lower |U32 c -p |bool |is_uni_print |U32 c -p |bool |is_uni_punct |U32 c -p |bool |is_uni_xdigit |U32 c -p |U32 |to_uni_upper |U32 c -p |U32 |to_uni_title |U32 c -p |U32 |to_uni_lower |U32 c -p |bool |is_uni_alnum_lc|U32 c -p |bool |is_uni_alnumc_lc|U32 c -p |bool |is_uni_idfirst_lc|U32 c -p |bool |is_uni_alpha_lc|U32 c -p |bool |is_uni_ascii_lc|U32 c -p |bool |is_uni_space_lc|U32 c -p |bool |is_uni_cntrl_lc|U32 c -p |bool |is_uni_graph_lc|U32 c -p |bool |is_uni_digit_lc|U32 c -p |bool |is_uni_upper_lc|U32 c -p |bool |is_uni_lower_lc|U32 c -p |bool |is_uni_print_lc|U32 c -p |bool |is_uni_punct_lc|U32 c -p |bool |is_uni_xdigit_lc|U32 c -p |U32 |to_uni_upper_lc|U32 c -p |U32 |to_uni_title_lc|U32 c -p |U32 |to_uni_lower_lc|U32 c -p |bool |is_utf8_alnum |U8 *p -p |bool |is_utf8_alnumc |U8 *p -p |bool |is_utf8_idfirst|U8 *p -p |bool |is_utf8_alpha |U8 *p -p |bool |is_utf8_ascii |U8 *p -p |bool |is_utf8_space |U8 *p -p |bool |is_utf8_cntrl |U8 *p -p |bool |is_utf8_digit |U8 *p -p |bool |is_utf8_graph |U8 *p -p |bool |is_utf8_upper |U8 *p -p |bool |is_utf8_lower |U8 *p -p |bool |is_utf8_print |U8 *p -p |bool |is_utf8_punct |U8 *p -p |bool |is_utf8_xdigit |U8 *p -p |bool |is_utf8_mark |U8 *p +Ap |bool |is_uni_alnum |U32 c +Ap |bool |is_uni_alnumc |U32 c +Ap |bool |is_uni_idfirst |U32 c +Ap |bool |is_uni_alpha |U32 c +Ap |bool |is_uni_ascii |U32 c +Ap |bool |is_uni_space |U32 c +Ap |bool |is_uni_cntrl |U32 c +Ap |bool |is_uni_graph |U32 c +Ap |bool |is_uni_digit |U32 c +Ap |bool |is_uni_upper |U32 c +Ap |bool |is_uni_lower |U32 c +Ap |bool |is_uni_print |U32 c +Ap |bool |is_uni_punct |U32 c +Ap |bool |is_uni_xdigit |U32 c +Ap |U32 |to_uni_upper |U32 c +Ap |U32 |to_uni_title |U32 c +Ap |U32 |to_uni_lower |U32 c +Ap |bool |is_uni_alnum_lc|U32 c +Ap |bool |is_uni_alnumc_lc|U32 c +Ap |bool |is_uni_idfirst_lc|U32 c +Ap |bool |is_uni_alpha_lc|U32 c +Ap |bool |is_uni_ascii_lc|U32 c +Ap |bool |is_uni_space_lc|U32 c +Ap |bool |is_uni_cntrl_lc|U32 c +Ap |bool |is_uni_graph_lc|U32 c +Ap |bool |is_uni_digit_lc|U32 c +Ap |bool |is_uni_upper_lc|U32 c +Ap |bool |is_uni_lower_lc|U32 c +Ap |bool |is_uni_print_lc|U32 c +Ap |bool |is_uni_punct_lc|U32 c +Ap |bool |is_uni_xdigit_lc|U32 c +Ap |U32 |to_uni_upper_lc|U32 c +Ap |U32 |to_uni_title_lc|U32 c +Ap |U32 |to_uni_lower_lc|U32 c +Ap |bool |is_utf8_alnum |U8 *p +Ap |bool |is_utf8_alnumc |U8 *p +Ap |bool |is_utf8_idfirst|U8 *p +Ap |bool |is_utf8_alpha |U8 *p +Ap |bool |is_utf8_ascii |U8 *p +Ap |bool |is_utf8_space |U8 *p +Ap |bool |is_utf8_cntrl |U8 *p +Ap |bool |is_utf8_digit |U8 *p +Ap |bool |is_utf8_graph |U8 *p +Ap |bool |is_utf8_upper |U8 *p +Ap |bool |is_utf8_lower |U8 *p +Ap |bool |is_utf8_print |U8 *p +Ap |bool |is_utf8_punct |U8 *p +Ap |bool |is_utf8_xdigit |U8 *p +Ap |bool |is_utf8_mark |U8 *p p |OP* |jmaybe |OP* arg p |I32 |keyword |char* d|I32 len -p |void |leave_scope |I32 base +Ap |void |leave_scope |I32 base p |void |lex_end p |void |lex_start |SV* line p |OP* |linklist |OP* o p |OP* |list |OP* o p |OP* |listkids |OP* o p |OP* |localize |OP* arg|I32 lexical -p |I32 |looks_like_number|SV* sv +Apd |I32 |looks_like_number|SV* sv p |int |magic_clearenv |SV* sv|MAGIC* mg p |int |magic_clear_all_env|SV* sv|MAGIC* mg p |int |magic_clearpack|SV* sv|MAGIC* mg @@ -1401,112 +1666,112 @@ p |int |magic_set_all_env|SV* sv|MAGIC* mg 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 -p |void |markstack_grow +Ap |void |markstack_grow #if defined(USE_LOCALE_COLLATE) p |char* |mem_collxfrm |const char* s|STRLEN len|STRLEN* xlen #endif -p |SV* |mess |const char* pat|... -p |SV* |vmess |const char* pat|va_list* args +Afp |SV* |mess |const char* pat|... +Ap |SV* |vmess |const char* pat|va_list* args p |void |qerror |SV* err -p |int |mg_clear |SV* sv -p |int |mg_copy |SV* sv|SV* nsv|const char* key|I32 klen -p |MAGIC* |mg_find |SV* sv|int type -p |int |mg_free |SV* sv -p |int |mg_get |SV* sv -p |U32 |mg_length |SV* sv -p |void |mg_magical |SV* sv -p |int |mg_set |SV* sv -p |I32 |mg_size |SV* sv +Apd |int |mg_clear |SV* sv +Apd |int |mg_copy |SV* sv|SV* nsv|const char* key|I32 klen +Apd |MAGIC* |mg_find |SV* sv|int type +Apd |int |mg_free |SV* sv +Apd |int |mg_get |SV* sv +Apd |U32 |mg_length |SV* sv +Apd |void |mg_magical |SV* sv +Apd |int |mg_set |SV* sv +Ap |I32 |mg_size |SV* sv p |OP* |mod |OP* o|I32 type -p |char* |moreswitches |char* s +Ap |char* |moreswitches |char* s p |OP* |my |OP* o -p |NV |my_atof |const char *s +Ap |NV |my_atof |const char *s #if !defined(HAS_BCOPY) || !defined(HAS_SAFE_BCOPY) -np |char* |my_bcopy |const char* from|char* to|I32 len +Anp |char* |my_bcopy |const char* from|char* to|I32 len #endif #if !defined(HAS_BZERO) && !defined(HAS_MEMSET) -np |char* |my_bzero |char* loc|I32 len +Anp |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 +Apr |void |my_exit |U32 status +Apr |void |my_failure_exit +Ap |I32 |my_fflush_all +Ap |I32 |my_lstat #if !defined(HAS_MEMCMP) || !defined(HAS_SANE_MEMCMP) -np |I32 |my_memcmp |const char* s1|const char* s2|I32 len +Anp |I32 |my_memcmp |const char* s1|const char* s2|I32 len #endif #if !defined(HAS_MEMSET) -np |void* |my_memset |char* loc|I32 ch|I32 len +Anp |void* |my_memset |char* loc|I32 ch|I32 len #endif #if !defined(PERL_OBJECT) -p |I32 |my_pclose |PerlIO* ptr -p |PerlIO*|my_popen |char* cmd|char* mode +Ap |I32 |my_pclose |PerlIO* ptr +Ap |PerlIO*|my_popen |char* cmd|char* mode #endif -p |void |my_setenv |char* nam|char* val -p |I32 |my_stat +Ap |void |my_setenv |char* nam|char* val +Ap |I32 |my_stat #if defined(MYSWAP) -p |short |my_swap |short s -p |long |my_htonl |long l -p |long |my_ntohl |long l +Ap |short |my_swap |short s +Ap |long |my_htonl |long l +Ap |long |my_ntohl |long l #endif p |void |my_unexec -p |OP* |newANONLIST |OP* o -p |OP* |newANONHASH |OP* o -p |OP* |newANONSUB |I32 floor|OP* proto|OP* block -p |OP* |newASSIGNOP |I32 flags|OP* left|I32 optype|OP* right -p |OP* |newCONDOP |I32 flags|OP* expr|OP* trueop|OP* falseop -p |void |newCONSTSUB |HV* stash|char* name|SV* sv -p |void |newFORM |I32 floor|OP* o|OP* block -p |OP* |newFOROP |I32 flags|char* label|line_t forline \ +Ap |OP* |newANONLIST |OP* o +Ap |OP* |newANONHASH |OP* o +Ap |OP* |newANONSUB |I32 floor|OP* proto|OP* block +Ap |OP* |newASSIGNOP |I32 flags|OP* left|I32 optype|OP* right +Ap |OP* |newCONDOP |I32 flags|OP* expr|OP* trueop|OP* falseop +Apd |void |newCONSTSUB |HV* stash|char* name|SV* sv +Ap |void |newFORM |I32 floor|OP* o|OP* block +Ap |OP* |newFOROP |I32 flags|char* label|line_t forline \ |OP* sclr|OP* expr|OP*block|OP*cont -p |OP* |newLOGOP |I32 optype|I32 flags|OP* left|OP* right -p |OP* |newLOOPEX |I32 type|OP* label -p |OP* |newLOOPOP |I32 flags|I32 debuggable|OP* expr|OP* block -p |OP* |newNULLLIST -p |OP* |newOP |I32 optype|I32 flags -p |void |newPROG |OP* o -p |OP* |newRANGE |I32 flags|OP* left|OP* right -p |OP* |newSLICEOP |I32 flags|OP* subscript|OP* listop -p |OP* |newSTATEOP |I32 flags|char* label|OP* o -p |CV* |newSUB |I32 floor|OP* o|OP* proto|OP* block -p |CV* |newXS |char* name|XSUBADDR_t f|char* filename -p |AV* |newAV -p |OP* |newAVREF |OP* o -p |OP* |newBINOP |I32 type|I32 flags|OP* first|OP* last -p |OP* |newCVREF |I32 flags|OP* o -p |OP* |newGVOP |I32 type|I32 flags|GV* gv -p |GV* |newGVgen |char* pack -p |OP* |newGVREF |I32 type|OP* o -p |OP* |newHVREF |OP* o -p |HV* |newHV -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 |SV* |newRV_noinc |SV *sv -p |SV* |newSV |STRLEN len -p |OP* |newSVREF |OP* o -p |OP* |newSVOP |I32 type|I32 flags|SV* sv -p |SV* |newSViv |IV i -p |SV* |newSVnv |NV n -p |SV* |newSVpv |const char* s|STRLEN len -p |SV* |newSVpvn |const char* s|STRLEN len -p |SV* |newSVpvf |const char* pat|... -p |SV* |vnewSVpvf |const char* pat|va_list* args -p |SV* |newSVrv |SV* rv|const char* classname -p |SV* |newSVsv |SV* old -p |OP* |newUNOP |I32 type|I32 flags|OP* first -p |OP* |newWHILEOP |I32 flags|I32 debuggable|LOOP* loop \ +Ap |OP* |newLOGOP |I32 optype|I32 flags|OP* left|OP* right +Ap |OP* |newLOOPEX |I32 type|OP* label +Ap |OP* |newLOOPOP |I32 flags|I32 debuggable|OP* expr|OP* block +Ap |OP* |newNULLLIST +Ap |OP* |newOP |I32 optype|I32 flags +Ap |void |newPROG |OP* o +Ap |OP* |newRANGE |I32 flags|OP* left|OP* right +Ap |OP* |newSLICEOP |I32 flags|OP* subscript|OP* listop +Ap |OP* |newSTATEOP |I32 flags|char* label|OP* o +Ap |CV* |newSUB |I32 floor|OP* o|OP* proto|OP* block +Apd |CV* |newXS |char* name|XSUBADDR_t f|char* filename +Apd |AV* |newAV +Ap |OP* |newAVREF |OP* o +Ap |OP* |newBINOP |I32 type|I32 flags|OP* first|OP* last +Ap |OP* |newCVREF |I32 flags|OP* o +Ap |OP* |newGVOP |I32 type|I32 flags|GV* gv +Ap |GV* |newGVgen |char* pack +Ap |OP* |newGVREF |I32 type|OP* o +Ap |OP* |newHVREF |OP* o +Apd |HV* |newHV +Ap |HV* |newHVhv |HV* hv +Ap |IO* |newIO +Ap |OP* |newLISTOP |I32 type|I32 flags|OP* first|OP* last +Ap |OP* |newPADOP |I32 type|I32 flags|SV* sv +Ap |OP* |newPMOP |I32 type|I32 flags +Ap |OP* |newPVOP |I32 type|I32 flags|char* pv +Ap |SV* |newRV |SV* pref +Apd |SV* |newRV_noinc |SV *sv +Ap |SV* |newSV |STRLEN len +Ap |OP* |newSVREF |OP* o +Ap |OP* |newSVOP |I32 type|I32 flags|SV* sv +Apd |SV* |newSViv |IV i +Apd |SV* |newSVnv |NV n +Apd |SV* |newSVpv |const char* s|STRLEN len +Apd |SV* |newSVpvn |const char* s|STRLEN len +Afpd |SV* |newSVpvf |const char* pat|... +Ap |SV* |vnewSVpvf |const char* pat|va_list* args +Apd |SV* |newSVrv |SV* rv|const char* classname +Apd |SV* |newSVsv |SV* old +Ap |OP* |newUNOP |I32 type|I32 flags|OP* first +Ap |OP* |newWHILEOP |I32 flags|I32 debuggable|LOOP* loop \ |I32 whileline|OP* expr|OP* block|OP* cont -p |PERL_SI*|new_stackinfo|I32 stitems|I32 cxitems +Ap |PERL_SI*|new_stackinfo|I32 stitems|I32 cxitems p |PerlIO*|nextargv |GV* gv -p |char* |ninstr |const char* big|const char* bigend \ +Ap |char* |ninstr |const char* big|const char* bigend \ |const char* little|const char* lend p |OP* |oopsCV |OP* o -p |void |op_free |OP* arg +Ap |void |op_free |OP* arg p |void |package |OP* o p |PADOFFSET|pad_alloc |I32 optype|U32 tmptype p |PADOFFSET|pad_allocmy |char* name @@ -1514,70 +1779,70 @@ p |PADOFFSET|pad_findmy |char* name p |OP* |oopsAV |OP* o p |OP* |oopsHV |OP* o p |void |pad_leavemy |I32 fill -p |SV* |pad_sv |PADOFFSET po +Ap |SV* |pad_sv |PADOFFSET po p |void |pad_free |PADOFFSET po p |void |pad_reset p |void |pad_swipe |PADOFFSET po p |void |peep |OP* o #if defined(PERL_OBJECT) -ox |void |Perl_construct -ox |void |Perl_destruct -ox |void |Perl_free -ox |int |Perl_run -ox |int |Perl_parse |XSINIT_t xsinit \ +Aox |void |Perl_construct +Aox |void |Perl_destruct +Aox |void |Perl_free +Aox |int |Perl_run +Aox |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 +Ap |struct perl_thread* |new_struct_thread|struct perl_thread *t #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 |I32 |call_pv |const char* sub_name|I32 flags -p |I32 |call_sv |SV* sv|I32 flags -p |SV* |eval_pv |const char* p|I32 croak_on_error -p |I32 |eval_sv |SV* sv|I32 flags -p |SV* |get_sv |const char* name|I32 create -p |AV* |get_av |const char* name|I32 create -p |HV* |get_hv |const char* name|I32 create -p |CV* |get_cv |const char* name|I32 create -p |int |init_i18nl10n |int printwarn -p |int |init_i18nl14n |int printwarn -p |void |new_collate |const char* newcoll -p |void |new_ctype |const char* newctype -p |void |new_numeric |const char* newcoll -p |void |set_numeric_local -p |void |set_numeric_radix -p |void |set_numeric_standard -p |void |require_pv |const char* pv +Ap |void |call_atexit |ATEXIT_t fn|void *ptr +Apd |I32 |call_argv |const char* sub_name|I32 flags|char** argv +Apd |I32 |call_method |const char* methname|I32 flags +Apd |I32 |call_pv |const char* sub_name|I32 flags +Apd |I32 |call_sv |SV* sv|I32 flags +Apd |SV* |eval_pv |const char* p|I32 croak_on_error +Apd |I32 |eval_sv |SV* sv|I32 flags +Apd |SV* |get_sv |const char* name|I32 create +Apd |AV* |get_av |const char* name|I32 create +Apd |HV* |get_hv |const char* name|I32 create +Apd |CV* |get_cv |const char* name|I32 create +Ap |int |init_i18nl10n |int printwarn +Ap |int |init_i18nl14n |int printwarn +Ap |void |new_collate |const char* newcoll +Ap |void |new_ctype |const char* newctype +Ap |void |new_numeric |const char* newcoll +Ap |void |set_numeric_local +Ap |void |set_numeric_radix +Ap |void |set_numeric_standard +Apd |void |require_pv |const char* pv p |void |pidgone |Pid_t pid|int status -p |void |pmflag |U16* pmfl|int ch +Ap |void |pmflag |U16* pmfl|int ch p |OP* |pmruntime |OP* pm|OP* expr|OP* repl p |OP* |pmtrans |OP* o|OP* expr|OP* repl p |OP* |pop_return -p |void |pop_scope +Ap |void |pop_scope p |OP* |prepend_elem |I32 optype|OP* head|OP* tail p |void |push_return |OP* o -p |void |push_scope +Ap |void |push_scope p |OP* |ref |OP* o|I32 type p |OP* |refkids |OP* o|I32 type -p |void |regdump |regexp* r -p |I32 |pregexec |regexp* prog|char* stringarg \ +Ap |void |regdump |regexp* r +Ap |I32 |pregexec |regexp* prog|char* stringarg \ |char* strend|char* strbeg|I32 minend \ |SV* screamer|U32 nosave -p |void |pregfree |struct regexp* r -p |regexp*|pregcomp |char* exp|char* xend|PMOP* pm -p |char* |re_intuit_start|regexp* prog|SV* sv|char* strpos \ +Ap |void |pregfree |struct regexp* r +Ap |regexp*|pregcomp |char* exp|char* xend|PMOP* pm +Ap |char* |re_intuit_start|regexp* prog|SV* sv|char* strpos \ |char* strend|U32 flags \ |struct re_scream_pos_data_s *data -p |SV* |re_intuit_string|regexp* prog -p |I32 |regexec_flags |regexp* prog|char* stringarg \ +Ap |SV* |re_intuit_string|regexp* prog +Ap |I32 |regexec_flags |regexp* prog|char* stringarg \ |char* strend|char* strbeg|I32 minend \ |SV* screamer|void* data|U32 flags -p |regnode*|regnext |regnode* p +Ap |regnode*|regnext |regnode* p p |void |regprop |SV* sv|regnode* o -p |void |repeatcpy |char* to|const char* from|I32 len|I32 count -p |char* |rninstr |const char* big|const char* bigend \ +Ap |void |repeatcpy |char* to|const char* from|I32 len|I32 count +Ap |char* |rninstr |const char* big|const char* bigend \ |const char* little|const char* lend p |Sighandler_t|rsignal |int i|Sighandler_t t p |int |rsignal_restore|int i|Sigsave_t* t @@ -1589,188 +1854,189 @@ p |void |rxres_save |void** rsp|REGEXP* prx #if !defined(HAS_RENAME) p |I32 |same_dirent |char* a|char* b #endif -p |char* |savepv |const char* sv -p |char* |savepvn |const char* sv|I32 len -p |void |savestack_grow -p |void |save_aelem |AV* av|I32 idx|SV **sptr -p |I32 |save_alloc |I32 size|I32 pad -p |void |save_aptr |AV** aptr -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_NOCONTEXT_t f|void* p -p |void |save_destructor_x|DESTRUCTORFUNC_t f|void* p -p |void |save_freesv |SV* sv +Apd |char* |savepv |const char* sv +Apd |char* |savepvn |const char* sv|I32 len +Ap |void |savestack_grow +Ap |void |save_aelem |AV* av|I32 idx|SV **sptr +Ap |I32 |save_alloc |I32 size|I32 pad +Ap |void |save_aptr |AV** aptr +Ap |AV* |save_ary |GV* gv +Ap |void |save_clearsv |SV** svp +Ap |void |save_delete |HV* hv|char* key|I32 klen +Ap |void |save_destructor|DESTRUCTORFUNC_NOCONTEXT_t f|void* p +Ap |void |save_destructor_x|DESTRUCTORFUNC_t f|void* p +Ap |void |save_freesv |SV* sv p |void |save_freeop |OP* o -p |void |save_freepv |char* pv -p |void |save_generic_svref|SV** sptr -p |void |save_gp |GV* gv|I32 empty -p |HV* |save_hash |GV* gv -p |void |save_helem |HV* hv|SV *key|SV **sptr -p |void |save_hints -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_list |SV** sarg|I32 maxsarg -p |void |save_long |long* longp -p |void |save_nogv |GV* gv +Ap |void |save_freepv |char* pv +Ap |void |save_generic_svref|SV** sptr +Ap |void |save_gp |GV* gv|I32 empty +Ap |HV* |save_hash |GV* gv +Ap |void |save_helem |HV* hv|SV *key|SV **sptr +Ap |void |save_hints +Ap |void |save_hptr |HV** hptr +Ap |void |save_I16 |I16* intp +Ap |void |save_I32 |I32* intp +Ap |void |save_I8 |I8* bytep +Ap |void |save_int |int* intp +Ap |void |save_item |SV* item +Ap |void |save_iv |IV* iv +Ap |void |save_list |SV** sarg|I32 maxsarg +Ap |void |save_long |long* longp +Ap |void |save_nogv |GV* gv 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** |save_threadsv |PADOFFSET i +Ap |SV* |save_scalar |GV* gv +Ap |void |save_pptr |char** pptr +Ap |void |save_vptr |void* pptr +Ap |void |save_re_context +Ap |void |save_sptr |SV** sptr +Ap |SV* |save_svref |SV** sptr +Ap |SV** |save_threadsv |PADOFFSET i p |OP* |sawparens |OP* o p |OP* |scalar |OP* o p |OP* |scalarkids |OP* o p |OP* |scalarseq |OP* o p |OP* |scalarvoid |OP* o -p |NV |scan_bin |char* start|I32 len|I32* retlen -p |NV |scan_hex |char* start|I32 len|I32* retlen -p |char* |scan_num |char* s -p |NV |scan_oct |char* start|I32 len|I32* retlen +Ap |NV |scan_bin |char* start|I32 len|I32* retlen +Ap |NV |scan_hex |char* start|I32 len|I32* retlen +Ap |char* |scan_num |char* s +Ap |NV |scan_oct |char* start|I32 len|I32* retlen p |OP* |scope |OP* o -p |char* |screaminstr |SV* bigsv|SV* littlesv|I32 start_shift \ +Ap |char* |screaminstr |SV* bigsv|SV* littlesv|I32 start_shift \ |I32 end_shift|I32 *state|I32 last #if !defined(VMS) p |I32 |setenv_getix |char* nam #endif p |void |setdefout |GV* gv -p |char* |sharepvn |const char* sv|I32 len|U32 hash +Ap |char* |sharepvn |const char* sv|I32 len|U32 hash p |HEK* |share_hek |const char* sv|I32 len|U32 hash np |Signal_t |sighandler |int sig -p |SV** |stack_grow |SV** sp|SV**p|int n -p |I32 |start_subparse |I32 is_format|U32 flags +Ap |SV** |stack_grow |SV** sp|SV**p|int n +Ap |I32 |start_subparse |I32 is_format|U32 flags p |void |sub_crush_depth|CV* cv -p |bool |sv_2bool |SV* sv -p |CV* |sv_2cv |SV* sv|HV** st|GV** gvp|I32 lref -p |IO* |sv_2io |SV* sv -p |IV |sv_2iv |SV* sv -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 +Ap |bool |sv_2bool |SV* sv +Ap |CV* |sv_2cv |SV* sv|HV** st|GV** gvp|I32 lref +Ap |IO* |sv_2io |SV* sv +Ap |IV |sv_2iv |SV* sv +Apd |SV* |sv_2mortal |SV* sv +Ap |NV |sv_2nv |SV* sv +Ap |char* |sv_2pv |SV* sv|STRLEN* lp +Ap |char* |sv_2pvutf8 |SV* sv|STRLEN* lp +Ap |char* |sv_2pvbyte |SV* sv|STRLEN* lp +Ap |UV |sv_2uv |SV* sv +Ap |IV |sv_iv |SV* sv +Ap |UV |sv_uv |SV* sv +Ap |NV |sv_nv |SV* sv +Ap |char* |sv_pvn |SV *sv|STRLEN *len +Ap |char* |sv_pvutf8n |SV *sv|STRLEN *len +Ap |char* |sv_pvbyten |SV *sv|STRLEN *len +Ap |I32 |sv_true |SV *sv p |void |sv_add_arena |char* ptr|U32 size|U32 flags -p |int |sv_backoff |SV* sv -p |SV* |sv_bless |SV* sv|HV* stash -p |void |sv_catpvf |SV* sv|const char* pat|... -p |void |sv_vcatpvf |SV* sv|const char* pat|va_list* args -p |void |sv_catpv |SV* sv|const char* ptr -p |void |sv_catpvn |SV* sv|const char* ptr|STRLEN len -p |void |sv_catsv |SV* dsv|SV* ssv -p |void |sv_chop |SV* sv|char* ptr +Ap |int |sv_backoff |SV* sv +Apd |SV* |sv_bless |SV* sv|HV* stash +Afpd |void |sv_catpvf |SV* sv|const char* pat|... +Ap |void |sv_vcatpvf |SV* sv|const char* pat|va_list* args +Apd |void |sv_catpv |SV* sv|const char* ptr +Apd |void |sv_catpvn |SV* sv|const char* ptr|STRLEN len +Apd |void |sv_catsv |SV* dsv|SV* ssv +Apd |void |sv_chop |SV* sv|char* ptr p |void |sv_clean_all p |void |sv_clean_objs -p |void |sv_clear |SV* sv -p |I32 |sv_cmp |SV* sv1|SV* sv2 -p |I32 |sv_cmp_locale |SV* sv1|SV* sv2 +Ap |void |sv_clear |SV* sv +Apd |I32 |sv_cmp |SV* sv1|SV* sv2 +Ap |I32 |sv_cmp_locale |SV* sv1|SV* sv2 #if defined(USE_LOCALE_COLLATE) -p |char* |sv_collxfrm |SV* sv|STRLEN* nxp +Ap |char* |sv_collxfrm |SV* sv|STRLEN* nxp #endif -p |OP* |sv_compile_2op |SV* sv|OP** startp|char* code|AV** avp -p |void |sv_dec |SV* sv -p |void |sv_dump |SV* sv -p |bool |sv_derived_from|SV* sv|const char* name -p |I32 |sv_eq |SV* sv1|SV* sv2 -p |void |sv_free |SV* sv +Ap |OP* |sv_compile_2op |SV* sv|OP** startp|char* code|AV** avp +Apd |void |sv_dec |SV* sv +Ap |void |sv_dump |SV* sv +Apd |bool |sv_derived_from|SV* sv|const char* name +Apd |I32 |sv_eq |SV* sv1|SV* sv2 +Ap |void |sv_free |SV* sv p |void |sv_free_arenas -p |char* |sv_gets |SV* sv|PerlIO* fp|I32 append -p |char* |sv_grow |SV* sv|STRLEN newlen -p |void |sv_inc |SV* sv -p |void |sv_insert |SV* bigsv|STRLEN offset|STRLEN len \ +Ap |char* |sv_gets |SV* sv|PerlIO* fp|I32 append +Apd |char* |sv_grow |SV* sv|STRLEN newlen +Apd |void |sv_inc |SV* sv +Apd |void |sv_insert |SV* bigsv|STRLEN offset|STRLEN len \ |char* little|STRLEN littlelen -p |int |sv_isa |SV* sv|const char* name -p |int |sv_isobject |SV* sv -p |STRLEN |sv_len |SV* sv -p |STRLEN |sv_len_utf8 |SV* sv -p |void |sv_magic |SV* sv|SV* obj|int how|const char* name \ +Apd |int |sv_isa |SV* sv|const char* name +Apd |int |sv_isobject |SV* sv +Apd |STRLEN |sv_len |SV* sv +Ap |STRLEN |sv_len_utf8 |SV* sv +Apd |void |sv_magic |SV* sv|SV* obj|int how|const char* name \ |I32 namlen -p |SV* |sv_mortalcopy |SV* oldsv -p |SV* |sv_newmortal -p |SV* |sv_newref |SV* sv -p |char* |sv_peek |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 -p |void |sv_reset |char* s|HV* stash -p |void |sv_setpvf |SV* sv|const char* pat|... -p |void |sv_vsetpvf |SV* sv|const char* pat|va_list* args -p |void |sv_setiv |SV* sv|IV num -p |void |sv_setpviv |SV* sv|IV num -p |void |sv_setuv |SV* sv|UV num -p |void |sv_setnv |SV* sv|NV num -p |SV* |sv_setref_iv |SV* rv|const char* classname|IV iv -p |SV* |sv_setref_nv |SV* rv|const char* classname|NV nv -p |SV* |sv_setref_pv |SV* rv|const char* classname|void* pv -p |SV* |sv_setref_pvn |SV* rv|const char* classname|char* pv \ +Apd |SV* |sv_mortalcopy |SV* oldsv +Apd |SV* |sv_newmortal +Ap |SV* |sv_newref |SV* sv +Ap |char* |sv_peek |SV* sv +Ap |void |sv_pos_u2b |SV* sv|I32* offsetp|I32* lenp +Ap |void |sv_pos_b2u |SV* sv|I32* offsetp +Ap |char* |sv_pvn_force |SV* sv|STRLEN* lp +Ap |char* |sv_pvutf8n_force|SV* sv|STRLEN* lp +Ap |char* |sv_pvbyten_force|SV* sv|STRLEN* lp +Ap |char* |sv_reftype |SV* sv|int ob +Ap |void |sv_replace |SV* sv|SV* nsv +Ap |void |sv_report_used +Ap |void |sv_reset |char* s|HV* stash +Afpd |void |sv_setpvf |SV* sv|const char* pat|... +Ap |void |sv_vsetpvf |SV* sv|const char* pat|va_list* args +Apd |void |sv_setiv |SV* sv|IV num +Apd |void |sv_setpviv |SV* sv|IV num +Apd |void |sv_setuv |SV* sv|UV num +Apd |void |sv_setnv |SV* sv|NV num +Apd |SV* |sv_setref_iv |SV* rv|const char* classname|IV iv +Apd |SV* |sv_setref_nv |SV* rv|const char* classname|NV nv +Apd |SV* |sv_setref_pv |SV* rv|const char* classname|void* pv +Apd |SV* |sv_setref_pvn |SV* rv|const char* classname|char* pv \ |STRLEN n -p |void |sv_setpv |SV* sv|const char* ptr -p |void |sv_setpvn |SV* sv|const char* ptr|STRLEN len -p |void |sv_setsv |SV* dsv|SV* ssv -p |void |sv_taint |SV* sv -p |bool |sv_tainted |SV* sv -p |int |sv_unmagic |SV* sv|int type -p |void |sv_unref |SV* sv -p |void |sv_untaint |SV* sv -p |bool |sv_upgrade |SV* sv|U32 mt -p |void |sv_usepvn |SV* sv|char* ptr|STRLEN len -p |void |sv_vcatpvfn |SV* sv|const char* pat|STRLEN patlen \ +Apd |void |sv_setpv |SV* sv|const char* ptr +Apd |void |sv_setpvn |SV* sv|const char* ptr|STRLEN len +Apd |void |sv_setsv |SV* dsv|SV* ssv +Ap |void |sv_taint |SV* sv +Ap |bool |sv_tainted |SV* sv +Ap |int |sv_unmagic |SV* sv|int type +Apd |void |sv_unref |SV* sv +Ap |void |sv_untaint |SV* sv +Apd |bool |sv_upgrade |SV* sv|U32 mt +Apd |void |sv_usepvn |SV* sv|char* ptr|STRLEN len +Apd |void |sv_vcatpvfn |SV* sv|const char* pat|STRLEN patlen \ |va_list* args|SV** svargs|I32 svmax \ |bool *maybe_tainted -p |void |sv_vsetpvfn |SV* sv|const char* pat|STRLEN patlen \ +Apd |void |sv_vsetpvfn |SV* sv|const char* pat|STRLEN patlen \ |va_list* args|SV** svargs|I32 svmax \ |bool *maybe_tainted -p |SV* |swash_init |char* pkg|char* name|SV* listsv \ +Ap |SV* |swash_init |char* pkg|char* name|SV* listsv \ |I32 minbits|I32 none -p |UV |swash_fetch |SV *sv|U8 *ptr -p |void |taint_env -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 +Ap |UV |swash_fetch |SV *sv|U8 *ptr +Ap |void |taint_env +Ap |void |taint_proper |const char* f|const char* s +Ap |UV |to_utf8_lower |U8 *p +Ap |UV |to_utf8_upper |U8 *p +Ap |UV |to_utf8_title |U8 *p #if defined(UNLINK_ALL_VERSIONS) -p |I32 |unlnk |char* f +Ap |I32 |unlnk |char* f #endif #if defined(USE_THREADS) -p |void |unlock_condpair|void* svv +Ap |void |unlock_condpair|void* svv #endif -p |void |unsharepvn |const char* sv|I32 len|U32 hash +Ap |void |unsharepvn |const char* sv|I32 len|U32 hash p |void |unshare_hek |HEK* hek p |void |utilize |int aver|I32 floor|OP* version|OP* id|OP* arg -p |U8* |utf16_to_utf8 |U16* p|U8 *d|I32 bytelen -p |U8* |utf16_to_utf8_reversed|U16* p|U8 *d|I32 bytelen -p |I32 |utf8_distance |U8 *a|U8 *b -p |U8* |utf8_hop |U8 *s|I32 off -p |UV |utf8_to_uv |U8 *s|I32* retlen -p |U8* |uv_to_utf8 |U8 *d|UV uv +Ap |U8* |utf16_to_utf8 |U16* p|U8 *d|I32 bytelen +Ap |U8* |utf16_to_utf8_reversed|U16* p|U8 *d|I32 bytelen +Ap |I32 |utf8_distance |U8 *a|U8 *b +Ap |U8* |utf8_hop |U8 *s|I32 off +Ap |UV |utf8_to_uv |U8 *s|I32* retlen +Ap |U8* |uv_to_utf8 |U8 *d|UV uv 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_closed_fh|GV *gv|IO *io|const char *func|const char *obj 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 |void |vwarner |U32 err|const char* pat|va_list* args +Afpd |void |warn |const char* pat|... +Ap |void |vwarn |const char* pat|va_list* args +Afp |void |warner |U32 err|const char* pat|... +Ap |void |vwarner |U32 err|const char* pat|va_list* args p |void |watch |char** addr p |I32 |whichsig |char* sig p |int |yyerror |char* s @@ -1782,94 +2048,94 @@ p |int |yylex p |int |yyparse p |int |yywarn |char* s #if defined(MYMALLOC) -p |void |dump_mstats |char* s +Ap |void |dump_mstats |char* s #endif -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 +Anp |Malloc_t|safesysmalloc |MEM_SIZE nbytes +Anp |Malloc_t|safesyscalloc |MEM_SIZE elements|MEM_SIZE size +Anp |Malloc_t|safesysrealloc|Malloc_t where|MEM_SIZE nbytes +Anp |Free_t |safesysfree |Malloc_t where #if defined(LEAKTEST) -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 +Anp |Malloc_t|safexmalloc |I32 x|MEM_SIZE size +Anp |Malloc_t|safexcalloc |I32 x|MEM_SIZE elements|MEM_SIZE size +Anp |Malloc_t|safexrealloc |Malloc_t where|MEM_SIZE size +Anp |void |safexfree |Malloc_t where #endif #if defined(PERL_GLOBAL_STRUCT) -p |struct perl_vars *|GetVars +Ap |struct perl_vars *|GetVars #endif -p |int |runops_standard -p |int |runops_debug -p |void |sv_catpvf_mg |SV *sv|const char* pat|... -p |void |sv_vcatpvf_mg |SV* sv|const char* pat|va_list* args -p |void |sv_catpv_mg |SV *sv|const char *ptr -p |void |sv_catpvn_mg |SV *sv|const char *ptr|STRLEN len -p |void |sv_catsv_mg |SV *dstr|SV *sstr -p |void |sv_setpvf_mg |SV *sv|const char* pat|... -p |void |sv_vsetpvf_mg |SV* sv|const char* pat|va_list* args -p |void |sv_setiv_mg |SV *sv|IV i -p |void |sv_setpviv_mg |SV *sv|IV iv -p |void |sv_setuv_mg |SV *sv|UV u -p |void |sv_setnv_mg |SV *sv|NV num -p |void |sv_setpv_mg |SV *sv|const char *ptr -p |void |sv_setpvn_mg |SV *sv|const char *ptr|STRLEN len -p |void |sv_setsv_mg |SV *dstr|SV *sstr -p |void |sv_usepvn_mg |SV *sv|char *ptr|STRLEN len -p |MGVTBL*|get_vtbl |int vtbl_id +Ap |int |runops_standard +Ap |int |runops_debug +Afpd |void |sv_catpvf_mg |SV *sv|const char* pat|... +Ap |void |sv_vcatpvf_mg |SV* sv|const char* pat|va_list* args +Apd |void |sv_catpv_mg |SV *sv|const char *ptr +Apd |void |sv_catpvn_mg |SV *sv|const char *ptr|STRLEN len +Apd |void |sv_catsv_mg |SV *dstr|SV *sstr +Afpd |void |sv_setpvf_mg |SV *sv|const char* pat|... +Ap |void |sv_vsetpvf_mg |SV* sv|const char* pat|va_list* args +Apd |void |sv_setiv_mg |SV *sv|IV i +Apd |void |sv_setpviv_mg |SV *sv|IV iv +Apd |void |sv_setuv_mg |SV *sv|UV u +Apd |void |sv_setnv_mg |SV *sv|NV num +Apd |void |sv_setpv_mg |SV *sv|const char *ptr +Apd |void |sv_setpvn_mg |SV *sv|const char *ptr|STRLEN len +Apd |void |sv_setsv_mg |SV *dstr|SV *sstr +Apd |void |sv_usepvn_mg |SV *sv|char *ptr|STRLEN len +Ap |MGVTBL*|get_vtbl |int vtbl_id p |char* |pv_display |SV *sv|char *pv|STRLEN cur|STRLEN len \ |STRLEN pvlim -p |void |dump_indent |I32 level|PerlIO *file|const char* pat|... -p |void |dump_vindent |I32 level|PerlIO *file|const char* pat \ +Afp |void |dump_indent |I32 level|PerlIO *file|const char* pat|... +Ap |void |dump_vindent |I32 level|PerlIO *file|const char* pat \ |va_list *args -p |void |do_gv_dump |I32 level|PerlIO *file|char *name|GV *sv -p |void |do_gvgv_dump |I32 level|PerlIO *file|char *name|GV *sv -p |void |do_hv_dump |I32 level|PerlIO *file|char *name|HV *sv -p |void |do_magic_dump |I32 level|PerlIO *file|MAGIC *mg|I32 nest \ +Ap |void |do_gv_dump |I32 level|PerlIO *file|char *name|GV *sv +Ap |void |do_gvgv_dump |I32 level|PerlIO *file|char *name|GV *sv +Ap |void |do_hv_dump |I32 level|PerlIO *file|char *name|HV *sv +Ap |void |do_magic_dump |I32 level|PerlIO *file|MAGIC *mg|I32 nest \ |I32 maxnest|bool dumpops|STRLEN pvlim -p |void |do_op_dump |I32 level|PerlIO *file|OP *o -p |void |do_pmop_dump |I32 level|PerlIO *file|PMOP *pm -p |void |do_sv_dump |I32 level|PerlIO *file|SV *sv|I32 nest \ +Ap |void |do_op_dump |I32 level|PerlIO *file|OP *o +Ap |void |do_pmop_dump |I32 level|PerlIO *file|PMOP *pm +Ap |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|volatile JMPENV *je|int *excpt \ +Ap |void |magic_dump |MAGIC *mg +Ap |void* |default_protect|volatile JMPENV *je|int *excpt \ |protect_body_t body|... -p |void* |vdefault_protect|volatile JMPENV *je|int *excpt \ +Ap |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 +Ap |void |reginitcolors +Ap |char* |sv_2pv_nolen |SV* sv +Ap |char* |sv_2pvutf8_nolen|SV* sv +Ap |char* |sv_2pvbyte_nolen|SV* sv +Ap |char* |sv_pv |SV *sv +Ap |char* |sv_pvutf8 |SV *sv +Ap |char* |sv_pvbyte |SV *sv +Ap |void |sv_force_normal|SV *sv +Ap |void |tmps_grow |I32 n +Ap |SV* |sv_rvweaken |SV *sv p |int |magic_killbackrefs|SV *sv|MAGIC *mg -p |OP* |newANONATTRSUB |I32 floor|OP *proto|OP *attrs|OP *block -p |CV* |newATTRSUB |I32 floor|OP *o|OP *proto|OP *attrs|OP *block -p |void |newMYSUB |I32 floor|OP *o|OP *proto|OP *attrs|OP *block +Ap |OP* |newANONATTRSUB |I32 floor|OP *proto|OP *attrs|OP *block +Ap |CV* |newATTRSUB |I32 floor|OP *o|OP *proto|OP *attrs|OP *block +Ap |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 +Ap |PERL_CONTEXT*|cx_dup |PERL_CONTEXT* cx|I32 ix|I32 max +Ap |PERL_SI*|si_dup |PERL_SI* si +Ap |ANY* |ss_dup |PerlInterpreter* proto_perl +Ap |void* |any_dup |void* v|PerlInterpreter* proto_perl +Ap |HE* |he_dup |HE* e|bool shared +Ap |REGEXP*|re_dup |REGEXP* r +Ap |PerlIO*|fp_dup |PerlIO* fp|char type +Ap |DIR* |dirp_dup |DIR* dp +Ap |GP* |gp_dup |GP* gp +Ap |MAGIC* |mg_dup |MAGIC* mg +Ap |SV* |sv_dup |SV* sstr #if defined(HAVE_INTERP_INTERN) -p |void |sys_intern_dup |struct interp_intern* src \ +Ap |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 +Ap |PTR_TBL_t*|ptr_table_new +Ap |void* |ptr_table_fetch|PTR_TBL_t *tbl|void *sv +Ap |void |ptr_table_store|PTR_TBL_t *tbl|void *oldsv|void *newsv +Ap |void |ptr_table_split|PTR_TBL_t *tbl #endif #if defined(PERL_OBJECT) @@ -1928,6 +2194,7 @@ s |OP* |too_few_arguments|OP *o|char* name s |OP* |too_many_arguments|OP *o|char* name s |void |op_clear |OP* o s |void |null |OP* o +s |PADOFFSET|pad_addlex |SV* name s |PADOFFSET|pad_findlex |char* name|PADOFFSET newoff|U32 seq \ |CV* startcv|I32 cx_ix|I32 saweval|U32 flags s |OP* |newDEFSVOP diff --git a/embedvar.h b/embedvar.h index 837c0308cf..e44a2cee2c 100644 --- a/embedvar.h +++ b/embedvar.h @@ -199,6 +199,7 @@ #define PL_bitcount (PERL_GET_INTERP->Ibitcount) #define PL_bufend (PERL_GET_INTERP->Ibufend) #define PL_bufptr (PERL_GET_INTERP->Ibufptr) +#define PL_checkav (PERL_GET_INTERP->Icheckav) #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) @@ -367,7 +368,6 @@ #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_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) @@ -412,6 +412,7 @@ #define PL_utf8_xdigit (PERL_GET_INTERP->Iutf8_xdigit) #define PL_uudmap (PERL_GET_INTERP->Iuudmap) #define PL_warnhook (PERL_GET_INTERP->Iwarnhook) +#define PL_widesyscalls (PERL_GET_INTERP->Iwidesyscalls) #define PL_xiv_arenaroot (PERL_GET_INTERP->Ixiv_arenaroot) #define PL_xiv_root (PERL_GET_INTERP->Ixiv_root) #define PL_xnv_root (PERL_GET_INTERP->Ixnv_root) @@ -463,6 +464,7 @@ #define PL_bitcount (vTHX->Ibitcount) #define PL_bufend (vTHX->Ibufend) #define PL_bufptr (vTHX->Ibufptr) +#define PL_checkav (vTHX->Icheckav) #define PL_collation_ix (vTHX->Icollation_ix) #define PL_collation_name (vTHX->Icollation_name) #define PL_collation_standard (vTHX->Icollation_standard) @@ -631,7 +633,6 @@ #define PL_statusvalue_vms (vTHX->Istatusvalue_vms) #define PL_stderrgv (vTHX->Istderrgv) #define PL_stdingv (vTHX->Istdingv) -#define PL_stopav (vTHX->Istopav) #define PL_strtab (vTHX->Istrtab) #define PL_strtab_mutex (vTHX->Istrtab_mutex) #define PL_sub_generation (vTHX->Isub_generation) @@ -676,6 +677,7 @@ #define PL_utf8_xdigit (vTHX->Iutf8_xdigit) #define PL_uudmap (vTHX->Iuudmap) #define PL_warnhook (vTHX->Iwarnhook) +#define PL_widesyscalls (vTHX->Iwidesyscalls) #define PL_xiv_arenaroot (vTHX->Ixiv_arenaroot) #define PL_xiv_root (vTHX->Ixiv_root) #define PL_xnv_root (vTHX->Ixnv_root) @@ -864,6 +866,7 @@ #define PL_bitcount (aTHXo->interp.Ibitcount) #define PL_bufend (aTHXo->interp.Ibufend) #define PL_bufptr (aTHXo->interp.Ibufptr) +#define PL_checkav (aTHXo->interp.Icheckav) #define PL_collation_ix (aTHXo->interp.Icollation_ix) #define PL_collation_name (aTHXo->interp.Icollation_name) #define PL_collation_standard (aTHXo->interp.Icollation_standard) @@ -1032,7 +1035,6 @@ #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) @@ -1077,6 +1079,7 @@ #define PL_utf8_xdigit (aTHXo->interp.Iutf8_xdigit) #define PL_uudmap (aTHXo->interp.Iuudmap) #define PL_warnhook (aTHXo->interp.Iwarnhook) +#define PL_widesyscalls (aTHXo->interp.Iwidesyscalls) #define PL_xiv_arenaroot (aTHXo->interp.Ixiv_arenaroot) #define PL_xiv_root (aTHXo->interp.Ixiv_root) #define PL_xnv_root (aTHXo->interp.Ixnv_root) @@ -1129,6 +1132,7 @@ #define PL_Ibitcount PL_bitcount #define PL_Ibufend PL_bufend #define PL_Ibufptr PL_bufptr +#define PL_Icheckav PL_checkav #define PL_Icollation_ix PL_collation_ix #define PL_Icollation_name PL_collation_name #define PL_Icollation_standard PL_collation_standard @@ -1297,7 +1301,6 @@ #define PL_Istatusvalue_vms PL_statusvalue_vms #define PL_Istderrgv PL_stderrgv #define PL_Istdingv PL_stdingv -#define PL_Istopav PL_stopav #define PL_Istrtab PL_strtab #define PL_Istrtab_mutex PL_strtab_mutex #define PL_Isub_generation PL_sub_generation @@ -1342,6 +1345,7 @@ #define PL_Iutf8_xdigit PL_utf8_xdigit #define PL_Iuudmap PL_uudmap #define PL_Iwarnhook PL_warnhook +#define PL_Iwidesyscalls PL_widesyscalls #define PL_Ixiv_arenaroot PL_xiv_arenaroot #define PL_Ixiv_root PL_xiv_root #define PL_Ixnv_root PL_xnv_root diff --git a/ext/B/B/Asmdata.pm b/ext/B/B/Asmdata.pm index a7dbbe2026..d62967fe12 100644 --- a/ext/B/B/Asmdata.pm +++ b/ext/B/B/Asmdata.pm @@ -12,7 +12,7 @@ package B::Asmdata; use Exporter; @ISA = qw(Exporter); @EXPORT_OK = qw(%insn_data @insn_name @optype @specialsv_name); -use vars qw(%insn_data @insn_name @optype @specialsv_name); +our(%insn_data, @insn_name, @optype, @specialsv_name); @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); diff --git a/ext/B/B/C.pm b/ext/B/B/C.pm index 6e3af0d5bc..fa1053f1e1 100644 --- a/ext/B/B/C.pm +++ b/ext/B/B/C.pm @@ -1576,6 +1576,8 @@ No copy-on-grow. Optimisation level (n = 0, 1, 2, ...). B<-O> means B<-O1>. Currently, B<-O1> and higher set B<-fcog>. +=back + =head1 EXAMPLES perl -MO=C,-ofoo.c foo.pl diff --git a/ext/B/B/Deparse.pm b/ext/B/B/Deparse.pm index be7088e768..f8bcc7c8df 100644 --- a/ext/B/B/Deparse.pm +++ b/ext/B/B/Deparse.pm @@ -1194,7 +1194,7 @@ BEGIN { sub deparse_binop_left { my $self = shift; my($op, $left, $prec) = @_; - if ($left{assoc_class($op)} + if ($left{assoc_class($op)} && $left{assoc_class($left)} and $left{assoc_class($op)} == $left{assoc_class($left)}) { return $self->deparse($left, $prec - .00001); @@ -1227,7 +1227,7 @@ BEGIN { sub deparse_binop_right { my $self = shift; my($op, $right, $prec) = @_; - if ($right{assoc_class($op)} + if ($right{assoc_class($op)} && $right{assoc_class($right)} and $right{assoc_class($op)} == $right{assoc_class($right)}) { return $self->deparse($right, $prec - .00001); diff --git a/ext/B/B/Stash.pm b/ext/B/B/Stash.pm index d992a89af8..fca3443c13 100644 --- a/ext/B/B/Stash.pm +++ b/ext/B/B/Stash.pm @@ -4,7 +4,7 @@ package B::Stash; BEGIN { %Seen = %INC } -STOP { +CHECK { my @arr=scan($main::{"main::"}); @arr=map{s/\:\:$//;$_;} @arr; print "-umain,-u", join (",-u",@arr) ,"\n"; diff --git a/ext/B/NOTES b/ext/B/NOTES index 8309892d80..89d03ba9a2 100644 --- a/ext/B/NOTES +++ b/ext/B/NOTES @@ -161,8 +161,8 @@ O module 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 a STOP block to call back the sub ref + end up running) and registers a CHECK 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 STOP block + doing so, assuming there are no parse-time errors, the CHECK block of O gets called and the actual backend compilation happens. Phew. diff --git a/ext/B/O.pm b/ext/B/O.pm index d07c4a5b0f..352f8d4206 100644 --- a/ext/B/O.pm +++ b/ext/B/O.pm @@ -11,7 +11,7 @@ sub import { my $compilesub = &{"B::${backend}::compile"}(@options); if (ref($compilesub) eq "CODE") { minus_c; - eval 'STOP { &$compilesub() }'; + eval 'CHECK { &$compilesub() }'; } else { die $compilesub; } @@ -59,7 +59,7 @@ C<B::Backend> module and calls the C<compile> function in that 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 a STOP block is registered which calls CALLBACK. Thus the main +and a CHECK 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 diff --git a/ext/DB_File/Changes b/ext/DB_File/Changes index 8f364564a5..95eb487e56 100644 --- a/ext/DB_File/Changes +++ b/ext/DB_File/Changes @@ -279,3 +279,15 @@ * Updated to support Berkeley DB 3.x * Updated dbinfo for Berkeley DB 3.x file formats. + +1.72 16th January 2000 + + * Added hints/sco.pl + + * The module will now use XSLoader when it is available. When it + isn't it will use DynaLoader. + + * The locking section in DB_File.pm has been discredited. Many thanks + to David Harris for spotting the underlying problem, contributing + the updates to the documentation and writing DB_File::Lock (available + on CPAN). diff --git a/ext/DB_File/DB_File.pm b/ext/DB_File/DB_File.pm index 661a523983..00b24b90e6 100644 --- a/ext/DB_File/DB_File.pm +++ b/ext/DB_File/DB_File.pm @@ -1,10 +1,10 @@ # DB_File.pm -- Perl 5 interface to Berkeley DB # # written by Paul Marquess (Paul.Marquess@btinternet.com) -# last modified 4th September 1999 -# version 1.71 +# last modified 16th January 2000 +# version 1.72 # -# Copyright (c) 1995-1999 Paul Marquess. All rights reserved. +# Copyright (c) 1995-2000 Paul Marquess. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. @@ -141,11 +141,13 @@ sub TIEHASH package DB_File ; use strict; -use vars qw($VERSION @ISA @EXPORT $AUTOLOAD $DB_BTREE $DB_HASH $DB_RECNO $db_version) ; +use vars qw($VERSION @ISA @EXPORT $AUTOLOAD $DB_BTREE $DB_HASH $DB_RECNO + $db_version $use_XSLoader + ) ; use Carp; -$VERSION = "1.71" ; +$VERSION = "1.72" ; #typedef enum { DB_BTREE, DB_HASH, DB_RECNO } DBTYPE; $DB_BTREE = new DB_File::BTREEINFO ; @@ -155,8 +157,18 @@ $DB_RECNO = new DB_File::RECNOINFO ; require Tie::Hash; require Exporter; use AutoLoader; -use XSLoader (); -@ISA = qw(Tie::Hash Exporter); +BEGIN { + $use_XSLoader = 1 ; + eval { require XSLoader } ; + + if ($@) { + $use_XSLoader = 0 ; + require DynaLoader; + @ISA = qw(DynaLoader); + } +} + +push @ISA, qw(Tie::Hash Exporter); @EXPORT = qw( $DB_BTREE $DB_HASH $DB_RECNO @@ -219,19 +231,10 @@ eval { push(@EXPORT, @O); }; -## import borrowed from IO::File -## exports Fcntl constants if available. -#sub import { -# my $pkg = shift; -# my $callpkg = caller; -# Exporter::export $pkg, $callpkg, @_; -# eval { -# require Fcntl; -# Exporter::export 'Fcntl', $callpkg, '/^O_/'; -# }; -#} - -XSLoader::load 'DB_File', $VERSION; +if ($use_XSLoader) + { XSLoader::load("DB_File", $VERSION)} +else + { bootstrap DB_File $VERSION } # Preloaded methods go here. Autoload methods go after __END__, and are # processed by the autosplit program. @@ -475,12 +478,7 @@ like version 1. This feature allows B<DB_File> scripts that were built with version 1 to be migrated to version 2 or 3 without any changes. If you want to make use of the new features available in Berkeley DB -2.x or 3.x, use the Perl module B<BerkeleyDB> instead. - -At the time of writing this document the B<BerkeleyDB> module is still -alpha quality (the version number is < 1.0), and so unsuitable for use -in any serious development work. Once its version number is >= 1.0, it -is considered stable enough for real work. +2.x or greater, use the Perl module B<BerkeleyDB> instead. B<Note:> The database file format has changed in both Berkeley DB version 2 and 3. If you cannot recreate your databases, you must dump @@ -953,7 +951,7 @@ and it will print: $status = $X->find_dup($key, $value) ; -This method checks for the existance of a specific key/value pair. If the +This method checks for the existence of a specific key/value pair. If the pair exists, the cursor is left pointing to the pair and the method returns 0. Otherwise the method returns a non-zero value. @@ -995,7 +993,7 @@ This method deletes a specific key/value pair. It returns 0 if they exist and have been deleted successfully. Otherwise the method returns a non-zero value. -Again assuming the existance of the C<tree> database +Again assuming the existence of the C<tree> database use strict ; use DB_File ; @@ -1491,8 +1489,8 @@ R_CURSOR is the only valid flag at present. Returns the file descriptor for the underlying database. -See L<Locking Databases> for an example of how to make use of the -C<fd> method to lock your database. +See L<Locking: The Trouble with fd> for an explanation for why you should +not use C<fd> to lock your database. =item B<$status = $X-E<gt>seq($key, $value, $flags) ;> @@ -1651,64 +1649,124 @@ filters. =head1 HINTS AND TIPS -=head2 Locking Databases +=head2 Locking: The Trouble with fd -Concurrent access of a read-write database by several parties requires -them all to use some kind of locking. Here's an example of Tom's that -uses the I<fd> method to get the file descriptor, and then a careful -open() to give something Perl will flock() for you. Run this repeatedly -in the background to watch the locks granted in proper order. +Until version 1.72 of this module, the recommended technique for locking +B<DB_File> databases was to flock the filehandle returned from the "fd" +function. Unfortunately this technique has been shown to be fundamentally +flawed (Kudos to David Harris for tracking this down). Use it at your own +peril! - use DB_File; +The locking technique went like this. - use strict; + $db = tie(%db, 'DB_File', '/tmp/foo.db', O_CREAT|O_RDWR, 0644) + || die "dbcreat /tmp/foo.db $!"; + $fd = $db->fd; + open(DB_FH, "+<&=$fd") || die "dup $!"; + flock (DB_FH, LOCK_EX) || die "flock: $!"; + ... + $db{"Tom"} = "Jerry" ; + ... + flock(DB_FH, LOCK_UN); + undef $db; + untie %db; + close(DB_FH); - sub LOCK_SH { 1 } - sub LOCK_EX { 2 } - sub LOCK_NB { 4 } - sub LOCK_UN { 8 } +In simple terms, this is what happens: - my($oldval, $fd, $db, %db, $value, $key); +=over 5 - $key = shift || 'default'; - $value = shift || 'magic'; +=item 1. - $value .= " $$"; +Use "tie" to open the database. - $db = tie(%db, 'DB_File', '/tmp/foo.db', O_CREAT|O_RDWR, 0644) - || die "dbcreat /tmp/foo.db $!"; - $fd = $db->fd; - print "$$: db fd is $fd\n"; - open(DB_FH, "+<&=$fd") || die "dup $!"; +=item 2. +Lock the database with fd & flock. - unless (flock (DB_FH, LOCK_SH | LOCK_NB)) { - print "$$: CONTENTION; can't read during write update! - Waiting for read lock ($!) ...."; - unless (flock (DB_FH, LOCK_SH)) { die "flock: $!" } - } - print "$$: Read lock granted\n"; +=item 3. - $oldval = $db{$key}; - print "$$: Old value was $oldval\n"; - flock(DB_FH, LOCK_UN); +Read & Write to the database. - unless (flock (DB_FH, LOCK_EX | LOCK_NB)) { - print "$$: CONTENTION; must have exclusive lock! - Waiting for write lock ($!) ...."; - unless (flock (DB_FH, LOCK_EX)) { die "flock: $!" } - } +=item 4. - print "$$: Write lock granted\n"; - $db{$key} = $value; - $db->sync; # to flush - sleep 10; +Unlock and close the database. - flock(DB_FH, LOCK_UN); - undef $db; - untie %db; - close(DB_FH); - print "$$: Updated db to $key=$value\n"; +=back + +Here is the crux of the problem. A side-effect of opening the B<DB_File> +database in step 2 is that an initial block from the database will get +read from disk and cached in memory. + +To see why this is a problem, consider what can happen when two processes, +say "A" and "B", both want to update the same B<DB_File> database +using the locking steps outlined above. Assume process "A" has already +opened the database and has a write lock, but it hasn't actually updated +the database yet (it has finished step 2, but not started step 3 yet). Now +process "B" tries to open the same database - step 1 will succeed, +but it will block on step 2 until process "A" releases the lock. The +important thing to notice here is that at this point in time both +processes will have cached identical initial blocks from the database. + +Now process "A" updates the database and happens to change some of the +data held in the initial buffer. Process "A" terminates, flushing +all cached data to disk and releasing the database lock. At this point +the database on disk will correctly reflect the changes made by process +"A". + +With the lock released, process "B" can now continue. It also updates the +database and unfortunately it too modifies the data that was in its +initial buffer. Once that data gets flushed to disk it will overwrite +some/all of the changes process "A" made to the database. + +The result of this scenario is at best a database that doesn't contain +what you expect. At worst the database will corrupt. + +The above won't happen every time competing process update the same +B<DB_File> database, but it does illustrate why the technique should +not be used. + +=head2 Safe ways to lock a database + +Starting with version 2.x, Berkeley DB has internal support for locking. +The companion module to this one, B<BerkeleyDB>, provides an interface +to this locking functionality. If you are serious about locking +Berkeley DB databases, I strongly recommend using B<BerkeleyDB>. + +If using B<BerkeleyDB> isn't an option, there are a number of modules +available on CPAN that can be used to implement locking. Each one +implements locking differently and has different goals in mind. It is +therefore worth knowing the difference, so that you can pick the right +one for your application. Here are the three locking wrappers: + +=over 5 + +=item B<Tie::DB_Lock> + +A B<DB_File> wrapper which creates copies of the database file for +read access, so that you have a kind of a multiversioning concurrent read +system. However, updates are still serial. Use for databases where reads +may be lengthy and consistency problems may occur. + +=item B<Tie::DB_LockFile> + +A B<DB_File> wrapper that has the ability to lock and unlock the database +while it is being used. Avoids the tie-before-flock problem by simply +re-tie-ing the database when you get or drop a lock. Because of the +flexibility in dropping and re-acquiring the lock in the middle of a +session, this can be massaged into a system that will work with long +updates and/or reads if the application follows the hints in the POD +documentation. + +=item B<DB_File::Lock> + +An extremely lightweight B<DB_File> wrapper that simply flocks a lockfile +before tie-ing the database and drops the lock after the untie. Allows +one to use the same lockfile for multiple databases to avoid deadlock +problems, if desired. Use for databases where updates are reads are +quick and simple flock locking semantics are enough. + +=back =head2 Sharing Databases With C Applications @@ -1814,7 +1872,7 @@ C<%x>, and C<$X> above hold a reference to the object. The call to untie() will destroy the first, but C<$X> still holds a valid reference, so the destructor will not get called and the database file F<tst.fil> will remain open. The fact that Berkeley DB then reports the -attempt to open a database that is alreday open via the catch-all +attempt to open a database that is already open via the catch-all "Invalid argument" doesn't help. If you run the script with the C<-w> flag the error message becomes: @@ -1966,7 +2024,7 @@ makes use of, namely Berkeley DB, is not. Berkeley DB has its own copyright and its own license. Please take the time to read it. Here are are few words taken from the Berkeley DB FAQ (at -http://www.sleepycat.com) regarding the license: +F<http://www.sleepycat.com>) regarding the license: Do I have to license DB to use it in Perl scripts? diff --git a/ext/DB_File/DB_File.xs b/ext/DB_File/DB_File.xs index ccb9b757fe..7bc2491cb4 100644 --- a/ext/DB_File/DB_File.xs +++ b/ext/DB_File/DB_File.xs @@ -3,12 +3,12 @@ DB_File.xs -- Perl 5 interface to Berkeley DB written by Paul Marquess <Paul.Marquess@btinternet.com> - last modified 7th September 1999 - version 1.71 + last modified 16th January 2000 + version 1.72 All comments/suggestions/problems are welcome - Copyright (c) 1995-9 Paul Marquess. All rights reserved. + Copyright (c) 1995-2000 Paul Marquess. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. @@ -81,6 +81,7 @@ 1.71 - Support for Berkeley DB version 3. Support for Berkeley DB 2/3's backward compatability mode. Rewrote push + 1.72 - No change to DB_File.xs */ diff --git a/ext/DB_File/Makefile.PL b/ext/DB_File/Makefile.PL index a247924ec8..cac6578bb3 100644 --- a/ext/DB_File/Makefile.PL +++ b/ext/DB_File/Makefile.PL @@ -16,7 +16,7 @@ WriteMakefile( VERSION_FROM => 'DB_File.pm', OBJECT => 'version$(OBJ_EXT) DB_File$(OBJ_EXT)', XSPROTOARG => '-noprototypes', - DEFINE => "$OS2", + DEFINE => $OS2 || "", ); sub MY::postamble { diff --git a/ext/DB_File/version.c b/ext/DB_File/version.c index 23c96a6804..f8c6cac9af 100644 --- a/ext/DB_File/version.c +++ b/ext/DB_File/version.c @@ -3,18 +3,19 @@ version.c -- Perl 5 interface to Berkeley DB written by Paul Marquess <Paul.Marquess@btinternet.com> - last modified 7th September 1999 - version 1.71 + last modified 16th January 2000 + version 1.72 All comments/suggestions/problems are welcome - Copyright (c) 1995-9 Paul Marquess. All rights reserved. + Copyright (c) 1995-2000 Paul Marquess. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Changes: 1.71 - Support for Berkeley DB version 3. Support for Berkeley DB 2/3's backward compatability mode. + 1.72 - No change. */ diff --git a/ext/Data/Dumper/Dumper.pm b/ext/Data/Dumper/Dumper.pm index a4aa3288a6..00f623d474 100644 --- a/ext/Data/Dumper/Dumper.pm +++ b/ext/Data/Dumper/Dumper.pm @@ -13,7 +13,7 @@ $VERSION = '2.101'; #$| = 1; -require 5.004_02; +require 5.005_64; require Exporter; use XSLoader (); require overload; @@ -230,7 +230,7 @@ sub _dump { if ($s->{purity} and $s->{level} > 0) { $out = ($realtype eq 'HASH') ? '{}' : ($realtype eq 'ARRAY') ? '[]' : - "''" ; + 'do{my $o}' ; push @post, $name . " = " . $s->{seen}{$id}[0]; } else { diff --git a/ext/Data/Dumper/Dumper.xs b/ext/Data/Dumper/Dumper.xs index 125375facc..6394a63b28 100644 --- a/ext/Data/Dumper/Dumper.xs +++ b/ext/Data/Dumper/Dumper.xs @@ -202,7 +202,7 @@ DD_dump(pTHX_ SV *val, char *name, STRLEN namelen, SV *retval, HV *seenhv, else if (realtype == SVt_PVAV) sv_catpvn(retval, "[]", 2); else - sv_catpvn(retval, "''", 2); + sv_catpvn(retval, "do{my $o}", 9); postentry = newSVpvn(name, namelen); sv_catpvn(postentry, " = ", 3); sv_catsv(postentry, othername); diff --git a/ext/Devel/DProf/DProf.pm b/ext/Devel/DProf/DProf.pm index e9372ff038..38082fce51 100644 --- a/ext/Devel/DProf/DProf.pm +++ b/ext/Devel/DProf/DProf.pm @@ -1,4 +1,4 @@ -require 5.003; +require 5.005_64; =head1 NAME @@ -187,7 +187,8 @@ sub DB { use XSLoader (); -$Devel::DProf::VERSION = '19990108'; # this version not authorized by +# Underscore to allow older Perls to access older version from CPAN +$Devel::DProf::VERSION = '20000000.00_00'; # this version not authorized by # Dean Roehrich. See "Changes" file. XSLoader::load 'Devel::DProf', $Devel::DProf::VERSION; diff --git a/ext/Devel/DProf/DProf.xs b/ext/Devel/DProf/DProf.xs index d59c9dfe11..31e984f929 100644 --- a/ext/Devel/DProf/DProf.xs +++ b/ext/Devel/DProf/DProf.xs @@ -143,20 +143,21 @@ dprof_times(pTHX_ struct tms *t) #ifdef OS2 ULONG rc; QWORD cnt; + STRLEN n_a; if (!g_frequ) { if (CheckOSError(DosTmrQueryFreq(&g_frequ))) - croak("DosTmrQueryFreq: %s", SvPV(perl_get_sv("!",TRUE),na)); + croak("DosTmrQueryFreq: %s", SvPV(perl_get_sv("!",TRUE),n_a)); else g_frequ = g_frequ/DPROF_HZ; /* count per tick */ if (CheckOSError(DosTmrQueryTime(&cnt))) croak("DosTmrQueryTime: %s", - SvPV(perl_get_sv("!",TRUE),na)); + SvPV(perl_get_sv("!",TRUE), n_a)); g_start_cnt = toLongLong(cnt); } if (CheckOSError(DosTmrQueryTime(&cnt))) - croak("DosTmrQueryTime: %s", SvPV(perl_get_sv("!",TRUE),na)); + croak("DosTmrQueryTime: %s", SvPV(perl_get_sv("!",TRUE), n_a)); t->tms_stime = 0; return (t->tms_utime = (toLongLong(cnt) - g_start_cnt)/g_frequ); #else /* !OS2 */ @@ -538,7 +539,7 @@ XS(XS_DB_sub) { HV *oldstash = PL_curstash; - DBG_SUB_NOTIFY("XS DBsub(%s)\n", SvPV(Sub, na)); + DBG_SUB_NOTIFY("XS DBsub(%s)\n", SvPV_nolen(Sub)); SAVEDESTRUCTOR_X(check_depth, (void*)g_depth); g_depth++; @@ -577,7 +578,7 @@ XS(XS_DB_goto) 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_nolen(Sub)); sv_setiv(PL_DBsingle, 0); /* disable DB single-stepping */ diff --git a/ext/Devel/Peek/Peek.pm b/ext/Devel/Peek/Peek.pm index 4b472ad8a8..080251bb5e 100644 --- a/ext/Devel/Peek/Peek.pm +++ b/ext/Devel/Peek/Peek.pm @@ -3,14 +3,15 @@ package Devel::Peek; -$VERSION = 0.95; +# Underscore to allow older Perls to access older version from CPAN +$VERSION = '1.00_01'; require Exporter; use XSLoader (); @ISA = qw(Exporter); @EXPORT = qw(Dump mstat DeadCode DumpArray DumpWithOP DumpProg); -@EXPORT_OK = qw(SvREFCNT SvREFCNT_inc SvREFCNT_dec); +@EXPORT_OK = qw(SvREFCNT SvREFCNT_inc SvREFCNT_dec CvGV); %EXPORT_TAGS = ('ALL' => [@EXPORT, @EXPORT_OK]); XSLoader::load 'Devel::Peek'; @@ -372,32 +373,32 @@ This shows that =over -=item +=item * the subroutine is not an XSUB (since C<START> and C<ROOT> are non-zero, and C<XSUB> is zero); -=item +=item * that it was compiled in the package C<main>; -=item +=item * under the name C<MY::top_targets>; -=item +=item * inside a 5th eval in the program; -=item +=item * it is not currently executed (see C<DEPTH>); -=item +=item * it has no prototype (C<PROTOTYPE> field is missing). -=over +=back =head1 EXPORTS diff --git a/ext/Devel/Peek/Peek.xs b/ext/Devel/Peek/Peek.xs index d2f66c40da..8af8847820 100644 --- a/ext/Devel/Peek/Peek.xs +++ b/ext/Devel/Peek/Peek.xs @@ -125,6 +125,10 @@ DeadCode(pTHX) PerlIO_printf(Perl_debug_log, "%s: perl not compiled with DEBUGGING_MSTATS\n",str); #endif +#define _CvGV(cv) \ + (SvROK(cv) && (SvTYPE(SvRV(cv))==SVt_PVCV) \ + ? (SV*)CvGV((CV*)SvRV(cv)) : &PL_sv_undef) + MODULE = Devel::Peek PACKAGE = Devel::Peek void @@ -206,3 +210,9 @@ CODE: RETVAL = DeadCode(aTHX); OUTPUT: RETVAL + +MODULE = Devel::Peek PACKAGE = Devel::Peek PREFIX = _ + +SV * +_CvGV(cv) + SV *cv diff --git a/ext/Fcntl/Fcntl.pm b/ext/Fcntl/Fcntl.pm index 1eb14e9eb2..43bec9903e 100644 --- a/ext/Fcntl/Fcntl.pm +++ b/ext/Fcntl/Fcntl.pm @@ -42,7 +42,7 @@ what constants are implemented in your system. =cut -use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $AUTOLOAD); +our($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS, $AUTOLOAD); require Exporter; use XSLoader (); diff --git a/ext/File/Glob/Glob.pm b/ext/File/Glob/Glob.pm index 6b5ff84f46..6026499a80 100644 --- a/ext/File/Glob/Glob.pm +++ b/ext/File/Glob/Glob.pm @@ -2,8 +2,8 @@ package File::Glob; use strict; use Carp; -use vars qw($VERSION @ISA @EXPORT_OK @EXPORT_FAIL - %EXPORT_TAGS $AUTOLOAD $DEFAULT_FLAGS); +our($VERSION, @ISA, @EXPORT_OK, @EXPORT_FAIL, %EXPORT_TAGS, + $AUTOLOAD, $DEFAULT_FLAGS); require Exporter; use XSLoader (); @@ -238,7 +238,7 @@ The FreeBSD extensions to the POSIX standard are the following flags: =item C<GLOB_BRACE> -Pre-process the string to expand C<{pat,pat,...} strings like csh(1). +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). @@ -331,6 +331,8 @@ 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. +=back + =head1 AUTHOR The Perl interface was written by Nathan Torkington E<lt>gnat@frii.comE<gt>, diff --git a/ext/GDBM_File/GDBM_File.pm b/ext/GDBM_File/GDBM_File.pm index 663a679a4d..ab866eecab 100644 --- a/ext/GDBM_File/GDBM_File.pm +++ b/ext/GDBM_File/GDBM_File.pm @@ -40,7 +40,7 @@ L<perl(1)>, L<DB_File(3)>, L<perldbmfilter>. package GDBM_File; use strict; -use vars qw($VERSION @ISA @EXPORT $AUTOLOAD); +our($VERSION, @ISA, @EXPORT, $AUTOLOAD); require Carp; require Tie::Hash; diff --git a/ext/IO/IO.xs b/ext/IO/IO.xs index e5ce83d948..be84f73268 100644 --- a/ext/IO/IO.xs +++ b/ext/IO/IO.xs @@ -62,23 +62,28 @@ io_blocking(InputStream f, int block) /* POSIX style */ #if defined(O_NDELAY) && O_NDELAY != O_NONBLOCK /* Ooops has O_NDELAY too - make sure we don't - * get SysV behaviour by mistake - */ - RETVAL = RETVAL & O_NONBLOCK ? 0 : 1; - - if ((mode & O_NDELAY) || ((block == 0) && !(mode & O_NONBLOCK))) { - int ret; - mode = (mode & ~O_NDELAY) | O_NONBLOCK; - ret = fcntl(PerlIO_fileno(f),F_SETFL,mode); - if(ret < 0) - RETVAL = ret; - } - else if ((mode & O_NDELAY) || ((block > 0) && (mode & O_NONBLOCK))) { - int ret; - mode &= ~(O_NONBLOCK | O_NDELAY); - ret = fcntl(PerlIO_fileno(f),F_SETFL,mode); - if(ret < 0) - RETVAL = ret; + * get SysV behaviour by mistake. */ + + /* E.g. In UNICOS and UNICOS/mk a F_GETFL returns an O_NDELAY + * after a successful F_SETFL of an O_NONBLOCK. */ + RETVAL = RETVAL & (O_NONBLOCK | O_NDELAY) ? 0 : 1; + + if (block >= 0) { + if ((mode & O_NDELAY) || ((block == 0) && !(mode & O_NONBLOCK))) { + int ret; + mode = (mode & ~O_NDELAY) | O_NONBLOCK; + ret = fcntl(PerlIO_fileno(f),F_SETFL,mode); + if(ret < 0) + RETVAL = ret; + } + else + if ((mode & O_NDELAY) || ((block > 0) && (mode & O_NONBLOCK))) { + int ret; + mode &= ~(O_NONBLOCK | O_NDELAY); + ret = fcntl(PerlIO_fileno(f),F_SETFL,mode); + if(ret < 0) + RETVAL = ret; + } } #else /* Standard POSIX */ diff --git a/ext/IO/lib/IO/Dir.pm b/ext/IO/lib/IO/Dir.pm index f505e794b8..1fa07ed6b8 100644 --- a/ext/IO/lib/IO/Dir.pm +++ b/ext/IO/lib/IO/Dir.pm @@ -13,7 +13,7 @@ use Carp; use Symbol; use Exporter; use IO::File; -use vars qw(@ISA $VERSION @EXPORT_OK); +our(@ISA, $VERSION, @EXPORT_OK); use Tie::Hash; use File::stat; diff --git a/ext/IO/lib/IO/File.pm b/ext/IO/lib/IO/File.pm index 47f43d1292..819b4b18e8 100644 --- a/ext/IO/lib/IO/File.pm +++ b/ext/IO/lib/IO/File.pm @@ -103,9 +103,9 @@ Derived from FileHandle.pm by Graham Barr E<lt>F<gbarr@pobox.com>E<gt>. =cut -require 5.000; +require 5.005_64; use strict; -use vars qw($VERSION @EXPORT @EXPORT_OK @ISA); +our($VERSION, @EXPORT, @EXPORT_OK, @ISA); use Carp; use Symbol; use SelectSaver; diff --git a/ext/IO/lib/IO/Handle.pm b/ext/IO/lib/IO/Handle.pm index 2205368e96..930df55fec 100644 --- a/ext/IO/lib/IO/Handle.pm +++ b/ext/IO/lib/IO/Handle.pm @@ -232,9 +232,9 @@ Derived from FileHandle.pm by Graham Barr E<lt>F<gbarr@pobox.com>E<gt> =cut -require 5.000; +require 5.005_64; use strict; -use vars qw($VERSION @EXPORT_OK @ISA); +our($VERSION, @EXPORT_OK, @ISA); use Carp; use Symbol; use SelectSaver; diff --git a/ext/IO/lib/IO/Pipe.pm b/ext/IO/lib/IO/Pipe.pm index daf6fe699b..27b5ad03e1 100644 --- a/ext/IO/lib/IO/Pipe.pm +++ b/ext/IO/lib/IO/Pipe.pm @@ -6,11 +6,11 @@ package IO::Pipe; -require 5.000; +require 5.005_64; use IO::Handle; use strict; -use vars qw($VERSION); +our($VERSION); use Carp; use Symbol; @@ -135,7 +135,7 @@ sub writer { package IO::Pipe::End; -use vars qw(@ISA); +our(@ISA); @ISA = qw(IO::Handle); diff --git a/ext/IO/lib/IO/Poll.pm b/ext/IO/lib/IO/Poll.pm index a984985d39..687664b9ab 100644 --- a/ext/IO/lib/IO/Poll.pm +++ b/ext/IO/lib/IO/Poll.pm @@ -9,7 +9,7 @@ package IO::Poll; use strict; use IO::Handle; use Exporter (); -use vars qw(@ISA @EXPORT_OK @EXPORT $VERSION); +our(@ISA, @EXPORT_OK, @EXPORT, $VERSION); @ISA = qw(Exporter); $VERSION = "0.01"; diff --git a/ext/IO/lib/IO/Seekable.pm b/ext/IO/lib/IO/Seekable.pm index 6c07e94ada..bfcfc139aa 100644 --- a/ext/IO/lib/IO/Seekable.pm +++ b/ext/IO/lib/IO/Seekable.pm @@ -44,10 +44,10 @@ Derived from FileHandle.pm by Graham Barr E<lt>gbarr@pobox.comE<gt> =cut -require 5.000; +require 5.005_64; use Carp; use strict; -use vars qw($VERSION @EXPORT @ISA); +our($VERSION, @EXPORT, @ISA); use IO::Handle qw(SEEK_SET SEEK_CUR SEEK_END); require Exporter; diff --git a/ext/IO/lib/IO/Socket.pm b/ext/IO/lib/IO/Socket.pm index b843999180..0e81c4b35e 100644 --- a/ext/IO/lib/IO/Socket.pm +++ b/ext/IO/lib/IO/Socket.pm @@ -6,13 +6,13 @@ package IO::Socket; -require 5.000; +require 5.005_64; use IO::Handle; use Socket 1.3; use Carp; use strict; -use vars qw(@ISA $VERSION); +our(@ISA, $VERSION); use Exporter; # legacy diff --git a/ext/IO/lib/IO/Socket/INET.pm b/ext/IO/lib/IO/Socket/INET.pm index c8e3a7694c..30a923034a 100644 --- a/ext/IO/lib/IO/Socket/INET.pm +++ b/ext/IO/lib/IO/Socket/INET.pm @@ -7,7 +7,7 @@ package IO::Socket::INET; use strict; -use vars qw(@ISA $VERSION); +our(@ISA, $VERSION); use IO::Socket; use Socket; use Carp; @@ -332,6 +332,8 @@ by default. This was not the case with earlier releases. NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE +=back + =head2 METHODS =over 4 diff --git a/ext/IO/lib/IO/Socket/UNIX.pm b/ext/IO/lib/IO/Socket/UNIX.pm index 8f3b31f42c..d083f48b78 100644 --- a/ext/IO/lib/IO/Socket/UNIX.pm +++ b/ext/IO/lib/IO/Socket/UNIX.pm @@ -7,7 +7,7 @@ package IO::Socket::UNIX; use strict; -use vars qw(@ISA $VERSION); +our(@ISA, $VERSION); use IO::Socket; use Socket; use Carp; diff --git a/ext/IPC/SysV/SysV.pm b/ext/IPC/SysV/SysV.pm index eb245937aa..bebb8fd81b 100644 --- a/ext/IPC/SysV/SysV.pm +++ b/ext/IPC/SysV/SysV.pm @@ -74,11 +74,15 @@ C<IPC::SysV> defines and conditionally exports all the constants defined in your system include files which are needed by the SysV IPC calls. +=over + =item ftok( PATH, ID ) Return a key based on PATH and ID, which can be used as a key for C<msgget>, C<semget> and C<shmget>. See L<ftok> +=back + =head1 SEE ALSO L<IPC::Msg>, L<IPC::Semaphore>, L<ftok> diff --git a/ext/NDBM_File/NDBM_File.pm b/ext/NDBM_File/NDBM_File.pm index 578148c56e..f98669f486 100644 --- a/ext/NDBM_File/NDBM_File.pm +++ b/ext/NDBM_File/NDBM_File.pm @@ -5,14 +5,12 @@ BEGIN { use strict; } } -use vars qw($VERSION @ISA); require Tie::Hash; -use DynaLoader (); +use XSLoader (); -@ISA = qw(Tie::Hash); - -$VERSION = "1.03"; +our @ISA = qw(Tie::Hash); +our $VERSION = "1.03"; XSLoader::load 'NDBM_File', $VERSION; diff --git a/ext/ODBM_File/ODBM_File.pm b/ext/ODBM_File/ODBM_File.pm index 6199443a32..57fe4c352d 100644 --- a/ext/ODBM_File/ODBM_File.pm +++ b/ext/ODBM_File/ODBM_File.pm @@ -1,14 +1,12 @@ package ODBM_File; use strict; -use vars qw($VERSION @ISA); require Tie::Hash; -use DynaLoader (); +use XSLoader (); -@ISA = qw(Tie::Hash); - -$VERSION = "1.02"; +our @ISA = qw(Tie::Hash); +our $VERSION = "1.02"; XSLoader::load 'ODBM_File', $VERSION; diff --git a/ext/Opcode/Opcode.pm b/ext/Opcode/Opcode.pm index 3915b40980..9338d392fa 100644 --- a/ext/Opcode/Opcode.pm +++ b/ext/Opcode/Opcode.pm @@ -1,8 +1,8 @@ package Opcode; -require 5.002; +require 5.005_64; -use vars qw($VERSION $XS_VERSION @ISA @EXPORT_OK); +our($VERSION, $XS_VERSION, @ISA, @EXPORT_OK); $VERSION = "1.04"; $XS_VERSION = "1.03"; diff --git a/ext/Opcode/Safe.pm b/ext/Opcode/Safe.pm index 00ee85dbeb..7e1d6a34a7 100644 --- a/ext/Opcode/Safe.pm +++ b/ext/Opcode/Safe.pm @@ -2,9 +2,8 @@ package Safe; use 5.003_11; use strict; -use vars qw($VERSION); -$VERSION = "2.06"; +our $VERSION = "2.06"; use Carp; diff --git a/ext/POSIX/POSIX.pm b/ext/POSIX/POSIX.pm index a38c74dcca..9416f70809 100644 --- a/ext/POSIX/POSIX.pm +++ b/ext/POSIX/POSIX.pm @@ -1,199 +1,25 @@ package POSIX; -# use vars qw($VERSION @ISA %EXPORT_TAGS @EXPORT_OK $AUTOLOAD); -(@ISA, %EXPORT_TAGS,@EXPORT_OK,$AUTOLOAD) = (); +our(@ISA, %EXPORT_TAGS, @EXPORT_OK, $AUTOLOAD) = (); -use Carp; use AutoLoader; -require Config; -use Symbol; -require Exporter; use XSLoader (); -@ISA = qw(Exporter); - -$VERSION = "1.03" ; - -%EXPORT_TAGS = ( - - assert_h => [qw(assert NDEBUG)], - - ctype_h => [qw(isalnum isalpha iscntrl isdigit isgraph islower - isprint ispunct isspace isupper isxdigit tolower toupper)], - - dirent_h => [qw()], - - errno_h => [qw(E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EAFNOSUPPORT - EAGAIN EALREADY EBADF EBUSY ECHILD ECONNABORTED - ECONNREFUSED ECONNRESET EDEADLK EDESTADDRREQ EDOM EDQUOT - EEXIST EFAULT EFBIG EHOSTDOWN EHOSTUNREACH EINPROGRESS - EINTR EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK - EMSGSIZE ENAMETOOLONG ENETDOWN ENETRESET ENETUNREACH - ENFILE ENOBUFS ENODEV ENOENT ENOEXEC ENOLCK ENOMEM - ENOPROTOOPT ENOSPC ENOSYS ENOTBLK ENOTCONN ENOTDIR - ENOTEMPTY ENOTSOCK ENOTTY ENXIO EOPNOTSUPP EPERM - EPFNOSUPPORT EPIPE EPROCLIM EPROTONOSUPPORT EPROTOTYPE - ERANGE EREMOTE ERESTART EROFS ESHUTDOWN ESOCKTNOSUPPORT - ESPIPE ESRCH ESTALE ETIMEDOUT ETOOMANYREFS ETXTBSY - EUSERS EWOULDBLOCK EXDEV errno)], - - fcntl_h => [qw(FD_CLOEXEC F_DUPFD F_GETFD F_GETFL F_GETLK F_RDLCK - F_SETFD F_SETFL F_SETLK F_SETLKW F_UNLCK F_WRLCK - O_ACCMODE O_APPEND O_CREAT O_EXCL O_NOCTTY O_NONBLOCK - O_RDONLY O_RDWR O_TRUNC O_WRONLY - creat - SEEK_CUR SEEK_END SEEK_SET - S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU - S_ISBLK S_ISCHR S_ISDIR S_ISFIFO S_ISGID S_ISREG S_ISUID - S_IWGRP S_IWOTH S_IWUSR)], - - float_h => [qw(DBL_DIG DBL_EPSILON DBL_MANT_DIG - DBL_MAX DBL_MAX_10_EXP DBL_MAX_EXP - DBL_MIN DBL_MIN_10_EXP DBL_MIN_EXP - FLT_DIG FLT_EPSILON FLT_MANT_DIG - FLT_MAX FLT_MAX_10_EXP FLT_MAX_EXP - FLT_MIN FLT_MIN_10_EXP FLT_MIN_EXP - FLT_RADIX FLT_ROUNDS - LDBL_DIG LDBL_EPSILON LDBL_MANT_DIG - LDBL_MAX LDBL_MAX_10_EXP LDBL_MAX_EXP - LDBL_MIN LDBL_MIN_10_EXP LDBL_MIN_EXP)], - - grp_h => [qw()], - - limits_h => [qw( ARG_MAX CHAR_BIT CHAR_MAX CHAR_MIN CHILD_MAX - INT_MAX INT_MIN LINK_MAX LONG_MAX LONG_MIN MAX_CANON - MAX_INPUT MB_LEN_MAX NAME_MAX NGROUPS_MAX OPEN_MAX - PATH_MAX PIPE_BUF SCHAR_MAX SCHAR_MIN SHRT_MAX SHRT_MIN - SSIZE_MAX STREAM_MAX TZNAME_MAX UCHAR_MAX UINT_MAX - ULONG_MAX USHRT_MAX _POSIX_ARG_MAX _POSIX_CHILD_MAX - _POSIX_LINK_MAX _POSIX_MAX_CANON _POSIX_MAX_INPUT - _POSIX_NAME_MAX _POSIX_NGROUPS_MAX _POSIX_OPEN_MAX - _POSIX_PATH_MAX _POSIX_PIPE_BUF _POSIX_SSIZE_MAX - _POSIX_STREAM_MAX _POSIX_TZNAME_MAX)], - - locale_h => [qw(LC_ALL LC_COLLATE LC_CTYPE LC_MONETARY LC_NUMERIC - LC_TIME NULL localeconv setlocale)], - - math_h => [qw(HUGE_VAL acos asin atan ceil cosh fabs floor fmod - frexp ldexp log10 modf pow sinh tan tanh)], - - pwd_h => [qw()], - - setjmp_h => [qw(longjmp setjmp siglongjmp sigsetjmp)], - - signal_h => [qw(SA_NOCLDSTOP SA_NOCLDWAIT SA_NODEFER SA_ONSTACK - SA_RESETHAND SA_RESTART SA_SIGINFO SIGABRT SIGALRM - SIGCHLD SIGCONT SIGFPE SIGHUP SIGILL SIGINT SIGKILL - SIGPIPE SIGQUIT SIGSEGV SIGSTOP SIGTERM SIGTSTP SIGTTIN - SIGTTOU SIGUSR1 SIGUSR2 SIG_BLOCK SIG_DFL SIG_ERR - SIG_IGN SIG_SETMASK SIG_UNBLOCK raise sigaction signal - sigpending sigprocmask sigsuspend)], - - stdarg_h => [qw()], - - stddef_h => [qw(NULL offsetof)], - - stdio_h => [qw(BUFSIZ EOF FILENAME_MAX L_ctermid L_cuserid - L_tmpname NULL SEEK_CUR SEEK_END SEEK_SET - STREAM_MAX TMP_MAX stderr stdin stdout - clearerr fclose fdopen feof ferror fflush fgetc fgetpos - fgets fopen fprintf fputc fputs fread freopen - fscanf fseek fsetpos ftell fwrite getchar gets - perror putc putchar puts remove rewind - scanf setbuf setvbuf sscanf tmpfile tmpnam - ungetc vfprintf vprintf vsprintf)], - - stdlib_h => [qw(EXIT_FAILURE EXIT_SUCCESS MB_CUR_MAX NULL RAND_MAX - abort atexit atof atoi atol bsearch calloc div - free getenv labs ldiv malloc mblen mbstowcs mbtowc - qsort realloc strtod strtol strtoul wcstombs wctomb)], - - string_h => [qw(NULL memchr memcmp memcpy memmove memset strcat - strchr strcmp strcoll strcpy strcspn strerror strlen - strncat strncmp strncpy strpbrk strrchr strspn strstr - strtok strxfrm)], - - sys_stat_h => [qw(S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU - S_ISBLK S_ISCHR S_ISDIR S_ISFIFO S_ISGID S_ISREG - S_ISUID S_IWGRP S_IWOTH S_IWUSR S_IXGRP S_IXOTH S_IXUSR - fstat mkfifo)], - - sys_times_h => [qw()], - - sys_types_h => [qw()], - - sys_utsname_h => [qw(uname)], - - sys_wait_h => [qw(WEXITSTATUS WIFEXITED WIFSIGNALED WIFSTOPPED - WNOHANG WSTOPSIG WTERMSIG WUNTRACED)], - - termios_h => [qw( B0 B110 B1200 B134 B150 B1800 B19200 B200 B2400 - B300 B38400 B4800 B50 B600 B75 B9600 BRKINT CLOCAL - CREAD CS5 CS6 CS7 CS8 CSIZE CSTOPB ECHO ECHOE ECHOK - ECHONL HUPCL ICANON ICRNL IEXTEN IGNBRK IGNCR IGNPAR - INLCR INPCK ISIG ISTRIP IXOFF IXON NCCS NOFLSH OPOST - PARENB PARMRK PARODD TCIFLUSH TCIOFF TCIOFLUSH TCION - TCOFLUSH TCOOFF TCOON TCSADRAIN TCSAFLUSH TCSANOW - TOSTOP VEOF VEOL VERASE VINTR VKILL VMIN VQUIT VSTART - VSTOP VSUSP VTIME - cfgetispeed cfgetospeed cfsetispeed cfsetospeed tcdrain - tcflow tcflush tcgetattr tcsendbreak tcsetattr )], - time_h => [qw(CLK_TCK CLOCKS_PER_SEC NULL asctime clock ctime - difftime mktime strftime tzset tzname)], - - unistd_h => [qw(F_OK NULL R_OK SEEK_CUR SEEK_END SEEK_SET - STRERR_FILENO STDIN_FILENO STDOUT_FILENO W_OK X_OK - _PC_CHOWN_RESTRICTED _PC_LINK_MAX _PC_MAX_CANON - _PC_MAX_INPUT _PC_NAME_MAX _PC_NO_TRUNC _PC_PATH_MAX - _PC_PIPE_BUF _PC_VDISABLE _POSIX_CHOWN_RESTRICTED - _POSIX_JOB_CONTROL _POSIX_NO_TRUNC _POSIX_SAVED_IDS - _POSIX_VDISABLE _POSIX_VERSION _SC_ARG_MAX - _SC_CHILD_MAX _SC_CLK_TCK _SC_JOB_CONTROL - _SC_NGROUPS_MAX _SC_OPEN_MAX _SC_SAVED_IDS - _SC_STREAM_MAX _SC_TZNAME_MAX _SC_VERSION - _exit access ctermid cuserid - dup2 dup execl execle execlp execv execve execvp - fpathconf getcwd getegid geteuid getgid getgroups - getpid getuid isatty lseek pathconf pause setgid setpgid - setsid setuid sysconf tcgetpgrp tcsetpgrp ttyname)], - - utime_h => [qw()], - -); - -# Exporter::export_tags(); -for (values %EXPORT_TAGS) { - push @EXPORT, @$_; -} - -@EXPORT_OK = qw( - closedir opendir readdir rewinddir - fcntl open - getgrgid getgrnam - atan2 cos exp log sin sqrt - getpwnam getpwuid - kill - fileno getc printf rename sprintf - abs exit rand srand system - chmod mkdir stat umask - times - wait waitpid - gmtime localtime time - alarm chdir chown close fork getlogin getppid getpgrp link - pipe read rmdir sleep unlink write - utime - nice -); +our $VERSION = "1.03" ; # Grandfather old foo_h form to new :foo_h form +my $loaded; + sub import { + load_imports() unless $loaded++; my $this = shift; my @list = map { m/^\w+_h$/ ? ":$_" : $_ } @_; local $Exporter::ExportLevel = 1; Exporter::import($this,@list); } +sub croak { require Carp; goto &Carp::croak } XSLoader::load 'POSIX', $VERSION; @@ -202,6 +28,7 @@ my $EAGAIN = constant("EAGAIN", 0); sub AUTOLOAD { if ($AUTOLOAD =~ /::(_?[a-z])/) { + # require AutoLoader; $AutoLoader::AUTOLOAD = $AUTOLOAD; goto &AutoLoader::AUTOLOAD } @@ -277,7 +104,7 @@ sub closedir { sub opendir { usage "opendir(directory)" if @_ != 1; - my $dirhandle = gensym; + my $dirhandle; CORE::opendir($dirhandle, $_[0]) ? $dirhandle : undef; @@ -936,3 +763,178 @@ sub utime { CORE::utime($_[1], $_[2], $_[0]); } +sub load_imports { +%EXPORT_TAGS = ( + + assert_h => [qw(assert NDEBUG)], + + ctype_h => [qw(isalnum isalpha iscntrl isdigit isgraph islower + isprint ispunct isspace isupper isxdigit tolower toupper)], + + dirent_h => [qw()], + + errno_h => [qw(E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EAFNOSUPPORT + EAGAIN EALREADY EBADF EBUSY ECHILD ECONNABORTED + ECONNREFUSED ECONNRESET EDEADLK EDESTADDRREQ EDOM EDQUOT + EEXIST EFAULT EFBIG EHOSTDOWN EHOSTUNREACH EINPROGRESS + EINTR EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK + EMSGSIZE ENAMETOOLONG ENETDOWN ENETRESET ENETUNREACH + ENFILE ENOBUFS ENODEV ENOENT ENOEXEC ENOLCK ENOMEM + ENOPROTOOPT ENOSPC ENOSYS ENOTBLK ENOTCONN ENOTDIR + ENOTEMPTY ENOTSOCK ENOTTY ENXIO EOPNOTSUPP EPERM + EPFNOSUPPORT EPIPE EPROCLIM EPROTONOSUPPORT EPROTOTYPE + ERANGE EREMOTE ERESTART EROFS ESHUTDOWN ESOCKTNOSUPPORT + ESPIPE ESRCH ESTALE ETIMEDOUT ETOOMANYREFS ETXTBSY + EUSERS EWOULDBLOCK EXDEV errno)], + + fcntl_h => [qw(FD_CLOEXEC F_DUPFD F_GETFD F_GETFL F_GETLK F_RDLCK + F_SETFD F_SETFL F_SETLK F_SETLKW F_UNLCK F_WRLCK + O_ACCMODE O_APPEND O_CREAT O_EXCL O_NOCTTY O_NONBLOCK + O_RDONLY O_RDWR O_TRUNC O_WRONLY + creat + SEEK_CUR SEEK_END SEEK_SET + S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU + S_ISBLK S_ISCHR S_ISDIR S_ISFIFO S_ISGID S_ISREG S_ISUID + S_IWGRP S_IWOTH S_IWUSR)], + + float_h => [qw(DBL_DIG DBL_EPSILON DBL_MANT_DIG + DBL_MAX DBL_MAX_10_EXP DBL_MAX_EXP + DBL_MIN DBL_MIN_10_EXP DBL_MIN_EXP + FLT_DIG FLT_EPSILON FLT_MANT_DIG + FLT_MAX FLT_MAX_10_EXP FLT_MAX_EXP + FLT_MIN FLT_MIN_10_EXP FLT_MIN_EXP + FLT_RADIX FLT_ROUNDS + LDBL_DIG LDBL_EPSILON LDBL_MANT_DIG + LDBL_MAX LDBL_MAX_10_EXP LDBL_MAX_EXP + LDBL_MIN LDBL_MIN_10_EXP LDBL_MIN_EXP)], + + grp_h => [qw()], + + limits_h => [qw( ARG_MAX CHAR_BIT CHAR_MAX CHAR_MIN CHILD_MAX + INT_MAX INT_MIN LINK_MAX LONG_MAX LONG_MIN MAX_CANON + MAX_INPUT MB_LEN_MAX NAME_MAX NGROUPS_MAX OPEN_MAX + PATH_MAX PIPE_BUF SCHAR_MAX SCHAR_MIN SHRT_MAX SHRT_MIN + SSIZE_MAX STREAM_MAX TZNAME_MAX UCHAR_MAX UINT_MAX + ULONG_MAX USHRT_MAX _POSIX_ARG_MAX _POSIX_CHILD_MAX + _POSIX_LINK_MAX _POSIX_MAX_CANON _POSIX_MAX_INPUT + _POSIX_NAME_MAX _POSIX_NGROUPS_MAX _POSIX_OPEN_MAX + _POSIX_PATH_MAX _POSIX_PIPE_BUF _POSIX_SSIZE_MAX + _POSIX_STREAM_MAX _POSIX_TZNAME_MAX)], + + locale_h => [qw(LC_ALL LC_COLLATE LC_CTYPE LC_MONETARY LC_NUMERIC + LC_TIME NULL localeconv setlocale)], + + math_h => [qw(HUGE_VAL acos asin atan ceil cosh fabs floor fmod + frexp ldexp log10 modf pow sinh tan tanh)], + + pwd_h => [qw()], + + setjmp_h => [qw(longjmp setjmp siglongjmp sigsetjmp)], + + signal_h => [qw(SA_NOCLDSTOP SA_NOCLDWAIT SA_NODEFER SA_ONSTACK + SA_RESETHAND SA_RESTART SA_SIGINFO SIGABRT SIGALRM + SIGCHLD SIGCONT SIGFPE SIGHUP SIGILL SIGINT SIGKILL + SIGPIPE SIGQUIT SIGSEGV SIGSTOP SIGTERM SIGTSTP SIGTTIN + SIGTTOU SIGUSR1 SIGUSR2 SIG_BLOCK SIG_DFL SIG_ERR + SIG_IGN SIG_SETMASK SIG_UNBLOCK raise sigaction signal + sigpending sigprocmask sigsuspend)], + + stdarg_h => [qw()], + + stddef_h => [qw(NULL offsetof)], + + stdio_h => [qw(BUFSIZ EOF FILENAME_MAX L_ctermid L_cuserid + L_tmpname NULL SEEK_CUR SEEK_END SEEK_SET + STREAM_MAX TMP_MAX stderr stdin stdout + clearerr fclose fdopen feof ferror fflush fgetc fgetpos + fgets fopen fprintf fputc fputs fread freopen + fscanf fseek fsetpos ftell fwrite getchar gets + perror putc putchar puts remove rewind + scanf setbuf setvbuf sscanf tmpfile tmpnam + ungetc vfprintf vprintf vsprintf)], + + stdlib_h => [qw(EXIT_FAILURE EXIT_SUCCESS MB_CUR_MAX NULL RAND_MAX + abort atexit atof atoi atol bsearch calloc div + free getenv labs ldiv malloc mblen mbstowcs mbtowc + qsort realloc strtod strtol strtoul wcstombs wctomb)], + + string_h => [qw(NULL memchr memcmp memcpy memmove memset strcat + strchr strcmp strcoll strcpy strcspn strerror strlen + strncat strncmp strncpy strpbrk strrchr strspn strstr + strtok strxfrm)], + + sys_stat_h => [qw(S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU + S_ISBLK S_ISCHR S_ISDIR S_ISFIFO S_ISGID S_ISREG + S_ISUID S_IWGRP S_IWOTH S_IWUSR S_IXGRP S_IXOTH S_IXUSR + fstat mkfifo)], + + sys_times_h => [qw()], + + sys_types_h => [qw()], + + sys_utsname_h => [qw(uname)], + + sys_wait_h => [qw(WEXITSTATUS WIFEXITED WIFSIGNALED WIFSTOPPED + WNOHANG WSTOPSIG WTERMSIG WUNTRACED)], + + termios_h => [qw( B0 B110 B1200 B134 B150 B1800 B19200 B200 B2400 + B300 B38400 B4800 B50 B600 B75 B9600 BRKINT CLOCAL + CREAD CS5 CS6 CS7 CS8 CSIZE CSTOPB ECHO ECHOE ECHOK + ECHONL HUPCL ICANON ICRNL IEXTEN IGNBRK IGNCR IGNPAR + INLCR INPCK ISIG ISTRIP IXOFF IXON NCCS NOFLSH OPOST + PARENB PARMRK PARODD TCIFLUSH TCIOFF TCIOFLUSH TCION + TCOFLUSH TCOOFF TCOON TCSADRAIN TCSAFLUSH TCSANOW + TOSTOP VEOF VEOL VERASE VINTR VKILL VMIN VQUIT VSTART + VSTOP VSUSP VTIME + cfgetispeed cfgetospeed cfsetispeed cfsetospeed tcdrain + tcflow tcflush tcgetattr tcsendbreak tcsetattr )], + + time_h => [qw(CLK_TCK CLOCKS_PER_SEC NULL asctime clock ctime + difftime mktime strftime tzset tzname)], + + unistd_h => [qw(F_OK NULL R_OK SEEK_CUR SEEK_END SEEK_SET + STRERR_FILENO STDIN_FILENO STDOUT_FILENO W_OK X_OK + _PC_CHOWN_RESTRICTED _PC_LINK_MAX _PC_MAX_CANON + _PC_MAX_INPUT _PC_NAME_MAX _PC_NO_TRUNC _PC_PATH_MAX + _PC_PIPE_BUF _PC_VDISABLE _POSIX_CHOWN_RESTRICTED + _POSIX_JOB_CONTROL _POSIX_NO_TRUNC _POSIX_SAVED_IDS + _POSIX_VDISABLE _POSIX_VERSION _SC_ARG_MAX + _SC_CHILD_MAX _SC_CLK_TCK _SC_JOB_CONTROL + _SC_NGROUPS_MAX _SC_OPEN_MAX _SC_SAVED_IDS + _SC_STREAM_MAX _SC_TZNAME_MAX _SC_VERSION + _exit access ctermid cuserid + dup2 dup execl execle execlp execv execve execvp + fpathconf getcwd getegid geteuid getgid getgroups + getpid getuid isatty lseek pathconf pause setgid setpgid + setsid setuid sysconf tcgetpgrp tcsetpgrp ttyname)], + + utime_h => [qw()], + +); + +# Exporter::export_tags(); +for (values %EXPORT_TAGS) { + push @EXPORT, @$_; +} + +@EXPORT_OK = qw( + closedir opendir readdir rewinddir + fcntl open + getgrgid getgrnam + atan2 cos exp log sin sqrt + getpwnam getpwuid + kill + fileno getc printf rename sprintf + abs exit rand srand system + chmod mkdir stat umask + times + wait waitpid + gmtime localtime time + alarm chdir chown close fork getlogin getppid getpgrp link + pipe read rmdir sleep unlink write + utime + nice +); + +require Exporter; +} diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index 4c96f12e4f..af43c40714 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -106,7 +106,7 @@ } # define times(t) vms_times(t) #else -#if defined (CYGWIN) +#if defined (__CYGWIN__) # define tzname _tzname #endif #if defined (WIN32) @@ -289,7 +289,7 @@ unsigned long strtoul (const char *, char **, int); #endif #ifdef HAS_TZNAME -# if !defined(WIN32) && !defined(CYGWIN) +# if !defined(WIN32) && !defined(__CYGWIN__) extern char *tzname[]; # endif #else diff --git a/ext/SDBM_File/SDBM_File.pm b/ext/SDBM_File/SDBM_File.pm index 1f3b4000e2..c5e26c8e04 100644 --- a/ext/SDBM_File/SDBM_File.pm +++ b/ext/SDBM_File/SDBM_File.pm @@ -1,14 +1,12 @@ package SDBM_File; use strict; -use vars qw($VERSION @ISA); require Tie::Hash; use XSLoader (); -@ISA = qw(Tie::Hash); - -$VERSION = "1.02" ; +our @ISA = qw(Tie::Hash); +our $VERSION = "1.02" ; XSLoader::load 'SDBM_File', $VERSION; diff --git a/ext/SDBM_File/sdbm/pair.c b/ext/SDBM_File/sdbm/pair.c index c2ed213036..4f0fde2302 100644 --- a/ext/SDBM_File/sdbm/pair.c +++ b/ext/SDBM_File/sdbm/pair.c @@ -8,7 +8,7 @@ */ #include "config.h" -#ifdef CYGWIN +#ifdef __CYGWIN__ # define EXTCONST extern const #else # include "EXTERN.h" diff --git a/ext/SDBM_File/sdbm/sdbm.c b/ext/SDBM_File/sdbm/sdbm.c index 5952d719e7..f58f4487c8 100644 --- a/ext/SDBM_File/sdbm/sdbm.c +++ b/ext/SDBM_File/sdbm/sdbm.c @@ -128,7 +128,7 @@ sdbm_prep(char *dirname, char *pagname, int flags, int mode) * open the files in sequence, and stat the dirfile. * If we fail anywhere, undo everything, return NULL. */ -#if defined(OS2) || defined(MSDOS) || defined(WIN32) || defined(CYGWIN) +#if defined(OS2) || defined(MSDOS) || defined(WIN32) || defined(__CYGWIN__) flags |= O_BINARY; # endif if ((db->pagf = open(pagname, flags, mode)) > -1) { diff --git a/ext/Socket/Socket.pm b/ext/Socket/Socket.pm index 1fa108fd72..cec13ac47f 100644 --- a/ext/Socket/Socket.pm +++ b/ext/Socket/Socket.pm @@ -1,6 +1,6 @@ package Socket; -use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); +our($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); $VERSION = "1.71"; =head1 NAME diff --git a/ext/Sys/Syslog/Makefile.PL b/ext/Sys/Syslog/Makefile.PL new file mode 100644 index 0000000000..253130a506 --- /dev/null +++ b/ext/Sys/Syslog/Makefile.PL @@ -0,0 +1,7 @@ +use ExtUtils::MakeMaker; + +WriteMakefile( + NAME => 'Sys::Syslog', + VERSION_FROM => 'Syslog.pm', + XSPROTOARG => '-noprototypes', +); diff --git a/lib/Sys/Syslog.pm b/ext/Sys/Syslog/Syslog.pm index f0cbb71924..b4473744c5 100644 --- a/lib/Sys/Syslog.pm +++ b/ext/Sys/Syslog/Syslog.pm @@ -1,11 +1,13 @@ package Sys::Syslog; require 5.000; require Exporter; +require DynaLoader; use Carp; -@ISA = qw(Exporter); +@ISA = qw(Exporter DynaLoader); @EXPORT = qw(openlog closelog setlogmask syslog); @EXPORT_OK = qw(setlogsock); +$VERSION = '0.01'; use Socket; use Sys::Hostname; @@ -17,6 +19,7 @@ use Sys::Hostname; # NOTE: openlog now takes three arguments, just like openlog(3) # Modified to add UNIX domain sockets by Sean Robinson <robinson_s@sc.maricopa.edu> # with support from Tim Bunce <Tim.Bunce@ig.co.uk> and the perl5-porters mailing list +# Modified to use an XS backend instead of syslog.ph by Tom Hughes <tom@compton.nu> # Todo: enable connect to try all three types before failing (auto setlogsock)? @@ -98,10 +101,6 @@ Note that C<openlog> now takes three arguments, just like C<openlog(3)>. $! = 55; syslog('info', 'problem was %m'); # %m == $! in syslog(3) -=head1 DEPENDENCIES - -B<Sys::Syslog> needs F<syslog.ph>, which can be created with C<h2ph>. - =head1 SEE ALSO L<syslog(3)> @@ -111,10 +110,27 @@ L<syslog(3)> Tom Christiansen E<lt>F<tchrist@perl.com>E<gt> and Larry Wall E<lt>F<larry@wall.org>E<gt>. UNIX domain sockets added by Sean Robinson E<lt>F<robinson_s@sc.maricopa.edu>E<gt> with support from Tim Bunce <Tim.Bunce@ig.co.uk> and the perl5-porters mailing list. +Dependency on F<syslog.ph> replaced with XS code bu Tom Hughes E<lt>F<tom@compton.nu>E<gt>. =cut -require 'syslog.ph'; +sub AUTOLOAD { + # This AUTOLOAD is used to 'autoload' constants from the constant() + # XS function. + + my $constname; + our $AUTOLOAD; + ($constname = $AUTOLOAD) =~ s/.*:://; + croak "& not defined" if $constname eq 'constant'; + my $val = constant($constname, @_ ? $_[0] : 0); + if ($! != 0) { + croak "Your vendor has not defined Sys::Syslog macro $constname"; + } + *$AUTOLOAD = sub { $val }; + goto &$AUTOLOAD; +} + +bootstrap Sys::Syslog $VERSION; $maskpri = &LOG_UPTO(&LOG_DEBUG); @@ -240,7 +256,7 @@ sub xlate { $name = uc $name; $name = "LOG_$name" unless $name =~ /^LOG_/; $name = "Sys::Syslog::$name"; - defined &$name ? &$name : -1; + eval { &$name } || -1; } sub connect { diff --git a/ext/Sys/Syslog/Syslog.xs b/ext/Sys/Syslog/Syslog.xs new file mode 100644 index 0000000000..d227343a1a --- /dev/null +++ b/ext/Sys/Syslog/Syslog.xs @@ -0,0 +1,637 @@ +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" + +#ifdef I_SYSLOG +#include <syslog.h> +#endif + +static double +constant_LOG_NO(char *name, int len, int arg) +{ + switch (name[6 + 0]) { + case 'T': + if (strEQ(name + 6, "TICE")) { /* LOG_NO removed */ +#ifdef LOG_NOTICE + return LOG_NOTICE; +#else + goto not_there; +#endif + } + case 'W': + if (strEQ(name + 6, "WAIT")) { /* LOG_NO removed */ +#ifdef LOG_NOWAIT + return LOG_NOWAIT; +#else + goto not_there; +#endif + } + } + errno = EINVAL; + return 0; + +not_there: + errno = ENOENT; + return 0; +} + +static double +constant_LOG_N(char *name, int len, int arg) +{ + switch (name[5 + 0]) { + case 'D': + if (strEQ(name + 5, "DELAY")) { /* LOG_N removed */ +#ifdef LOG_NDELAY + return LOG_NDELAY; +#else + goto not_there; +#endif + } + case 'E': + if (strEQ(name + 5, "EWS")) { /* LOG_N removed */ +#ifdef LOG_NEWS + return LOG_NEWS; +#else + goto not_there; +#endif + } + case 'F': + if (strEQ(name + 5, "FACILITIES")) { /* LOG_N removed */ +#ifdef LOG_NFACILITIES + return LOG_NFACILITIES; +#else + goto not_there; +#endif + } + case 'O': + return constant_LOG_NO(name, len, arg); + } + errno = EINVAL; + return 0; + +not_there: + errno = ENOENT; + return 0; +} + +static double +constant_LOG_P(char *name, int len, int arg) +{ + switch (name[5 + 0]) { + case 'I': + if (strEQ(name + 5, "ID")) { /* LOG_P removed */ +#ifdef LOG_PID + return LOG_PID; +#else + goto not_there; +#endif + } + case 'R': + if (strEQ(name + 5, "RIMASK")) { /* LOG_P removed */ +#ifdef LOG_PRIMASK + return LOG_PRIMASK; +#else + goto not_there; +#endif + } + } + errno = EINVAL; + return 0; + +not_there: + errno = ENOENT; + return 0; +} + +static double +constant_LOG_AU(char *name, int len, int arg) +{ + if (6 + 2 >= len ) { + errno = EINVAL; + return 0; + } + switch (name[6 + 2]) { + case '\0': + if (strEQ(name + 6, "TH")) { /* LOG_AU removed */ +#ifdef LOG_AUTH + return LOG_AUTH; +#else + goto not_there; +#endif + } + case 'P': + if (strEQ(name + 6, "THPRIV")) { /* LOG_AU removed */ +#ifdef LOG_AUTHPRIV + return LOG_AUTHPRIV; +#else + goto not_there; +#endif + } + } + errno = EINVAL; + return 0; + +not_there: + errno = ENOENT; + return 0; +} + +static double +constant_LOG_A(char *name, int len, int arg) +{ + switch (name[5 + 0]) { + case 'L': + if (strEQ(name + 5, "LERT")) { /* LOG_A removed */ +#ifdef LOG_ALERT + return LOG_ALERT; +#else + goto not_there; +#endif + } + case 'U': + return constant_LOG_AU(name, len, arg); + } + errno = EINVAL; + return 0; + +not_there: + errno = ENOENT; + return 0; +} + +static double +constant_LOG_CR(char *name, int len, int arg) +{ + switch (name[6 + 0]) { + case 'I': + if (strEQ(name + 6, "IT")) { /* LOG_CR removed */ +#ifdef LOG_CRIT + return LOG_CRIT; +#else + goto not_there; +#endif + } + case 'O': + if (strEQ(name + 6, "ON")) { /* LOG_CR removed */ +#ifdef LOG_CRON + return LOG_CRON; +#else + goto not_there; +#endif + } + } + errno = EINVAL; + return 0; + +not_there: + errno = ENOENT; + return 0; +} + +static double +constant_LOG_C(char *name, int len, int arg) +{ + switch (name[5 + 0]) { + case 'O': + if (strEQ(name + 5, "ONS")) { /* LOG_C removed */ +#ifdef LOG_CONS + return LOG_CONS; +#else + goto not_there; +#endif + } + case 'R': + return constant_LOG_CR(name, len, arg); + } + errno = EINVAL; + return 0; + +not_there: + errno = ENOENT; + return 0; +} + +static double +constant_LOG_D(char *name, int len, int arg) +{ + switch (name[5 + 0]) { + case 'A': + if (strEQ(name + 5, "AEMON")) { /* LOG_D removed */ +#ifdef LOG_DAEMON + return LOG_DAEMON; +#else + goto not_there; +#endif + } + case 'E': + if (strEQ(name + 5, "EBUG")) { /* LOG_D removed */ +#ifdef LOG_DEBUG + return LOG_DEBUG; +#else + goto not_there; +#endif + } + } + errno = EINVAL; + return 0; + +not_there: + errno = ENOENT; + return 0; +} + +static double +constant_LOG_U(char *name, int len, int arg) +{ + switch (name[5 + 0]) { + case 'S': + if (strEQ(name + 5, "SER")) { /* LOG_U removed */ +#ifdef LOG_USER + return LOG_USER; +#else + goto not_there; +#endif + } + case 'U': + if (strEQ(name + 5, "UCP")) { /* LOG_U removed */ +#ifdef LOG_UUCP + return LOG_UUCP; +#else + goto not_there; +#endif + } + } + errno = EINVAL; + return 0; + +not_there: + errno = ENOENT; + return 0; +} + +static double +constant_LOG_E(char *name, int len, int arg) +{ + switch (name[5 + 0]) { + case 'M': + if (strEQ(name + 5, "MERG")) { /* LOG_E removed */ +#ifdef LOG_EMERG + return LOG_EMERG; +#else + goto not_there; +#endif + } + case 'R': + if (strEQ(name + 5, "RR")) { /* LOG_E removed */ +#ifdef LOG_ERR + return LOG_ERR; +#else + goto not_there; +#endif + } + } + errno = EINVAL; + return 0; + +not_there: + errno = ENOENT; + return 0; +} + +static double +constant_LOG_F(char *name, int len, int arg) +{ + switch (name[5 + 0]) { + case 'A': + if (strEQ(name + 5, "ACMASK")) { /* LOG_F removed */ +#ifdef LOG_FACMASK + return LOG_FACMASK; +#else + goto not_there; +#endif + } + case 'T': + if (strEQ(name + 5, "TP")) { /* LOG_F removed */ +#ifdef LOG_FTP + return LOG_FTP; +#else + goto not_there; +#endif + } + } + errno = EINVAL; + return 0; + +not_there: + errno = ENOENT; + return 0; +} + +static double +constant_LOG_LO(char *name, int len, int arg) +{ + if (6 + 3 >= len ) { + errno = EINVAL; + return 0; + } + switch (name[6 + 3]) { + case '0': + if (strEQ(name + 6, "CAL0")) { /* LOG_LO removed */ +#ifdef LOG_LOCAL0 + return LOG_LOCAL0; +#else + goto not_there; +#endif + } + case '1': + if (strEQ(name + 6, "CAL1")) { /* LOG_LO removed */ +#ifdef LOG_LOCAL1 + return LOG_LOCAL1; +#else + goto not_there; +#endif + } + case '2': + if (strEQ(name + 6, "CAL2")) { /* LOG_LO removed */ +#ifdef LOG_LOCAL2 + return LOG_LOCAL2; +#else + goto not_there; +#endif + } + case '3': + if (strEQ(name + 6, "CAL3")) { /* LOG_LO removed */ +#ifdef LOG_LOCAL3 + return LOG_LOCAL3; +#else + goto not_there; +#endif + } + case '4': + if (strEQ(name + 6, "CAL4")) { /* LOG_LO removed */ +#ifdef LOG_LOCAL4 + return LOG_LOCAL4; +#else + goto not_there; +#endif + } + case '5': + if (strEQ(name + 6, "CAL5")) { /* LOG_LO removed */ +#ifdef LOG_LOCAL5 + return LOG_LOCAL5; +#else + goto not_there; +#endif + } + case '6': + if (strEQ(name + 6, "CAL6")) { /* LOG_LO removed */ +#ifdef LOG_LOCAL6 + return LOG_LOCAL6; +#else + goto not_there; +#endif + } + case '7': + if (strEQ(name + 6, "CAL7")) { /* LOG_LO removed */ +#ifdef LOG_LOCAL7 + return LOG_LOCAL7; +#else + goto not_there; +#endif + } + } + errno = EINVAL; + return 0; + +not_there: + errno = ENOENT; + return 0; +} + +static double +constant_LOG_L(char *name, int len, int arg) +{ + switch (name[5 + 0]) { + case 'F': + if (strEQ(name + 5, "FMT")) { /* LOG_L removed */ +#ifdef LOG_LFMT + return LOG_LFMT; +#else + goto not_there; +#endif + } + case 'O': + return constant_LOG_LO(name, len, arg); + case 'P': + if (strEQ(name + 5, "PR")) { /* LOG_L removed */ +#ifdef LOG_LPR + return LOG_LPR; +#else + goto not_there; +#endif + } + } + errno = EINVAL; + return 0; + +not_there: + errno = ENOENT; + return 0; +} + +static double +constant(char *name, int len, int arg) +{ + errno = 0; + if (0 + 4 >= len ) { + errno = EINVAL; + return 0; + } + switch (name[0 + 4]) { + case 'A': + if (!strnEQ(name + 0,"LOG_", 4)) + break; + return constant_LOG_A(name, len, arg); + case 'C': + if (!strnEQ(name + 0,"LOG_", 4)) + break; + return constant_LOG_C(name, len, arg); + case 'D': + if (!strnEQ(name + 0,"LOG_", 4)) + break; + return constant_LOG_D(name, len, arg); + case 'E': + if (!strnEQ(name + 0,"LOG_", 4)) + break; + return constant_LOG_E(name, len, arg); + case 'F': + if (!strnEQ(name + 0,"LOG_", 4)) + break; + return constant_LOG_F(name, len, arg); + case 'I': + if (strEQ(name + 0, "LOG_INFO")) { /* removed */ +#ifdef LOG_INFO + return LOG_INFO; +#else + goto not_there; +#endif + } + case 'K': + if (strEQ(name + 0, "LOG_KERN")) { /* removed */ +#ifdef LOG_KERN + return LOG_KERN; +#else + goto not_there; +#endif + } + case 'L': + if (!strnEQ(name + 0,"LOG_", 4)) + break; + return constant_LOG_L(name, len, arg); + case 'M': + if (strEQ(name + 0, "LOG_MAIL")) { /* removed */ +#ifdef LOG_MAIL + return LOG_MAIL; +#else + goto not_there; +#endif + } + case 'N': + if (!strnEQ(name + 0,"LOG_", 4)) + break; + return constant_LOG_N(name, len, arg); + case 'O': + if (strEQ(name + 0, "LOG_ODELAY")) { /* removed */ +#ifdef LOG_ODELAY + return LOG_ODELAY; +#else + goto not_there; +#endif + } + case 'P': + if (!strnEQ(name + 0,"LOG_", 4)) + break; + return constant_LOG_P(name, len, arg); + case 'S': + if (strEQ(name + 0, "LOG_SYSLOG")) { /* removed */ +#ifdef LOG_SYSLOG + return LOG_SYSLOG; +#else + goto not_there; +#endif + } + case 'U': + if (!strnEQ(name + 0,"LOG_", 4)) + break; + return constant_LOG_U(name, len, arg); + case 'W': + if (strEQ(name + 0, "LOG_WARNING")) { /* removed */ +#ifdef LOG_WARNING + return LOG_WARNING; +#else + goto not_there; +#endif + } + } + errno = EINVAL; + return 0; + +not_there: + errno = ENOENT; + return 0; +} + + +MODULE = Sys::Syslog PACKAGE = Sys::Syslog + +char * +_PATH_LOG() + CODE: +#ifdef _PATH_LOG + RETVAL = _PATH_LOG; +#else + croak("Your vendor has not defined the Sys::Syslog macro _PATH_LOG"); +#endif + OUTPUT: + RETVAL + +int +LOG_FAC(p) + INPUT: + int p + CODE: +#ifdef LOG_FAC + RETVAL = LOG_FAC(p); +#else + croak("Your vendor has not defined the Sys::Syslog macro LOG_FAC"); +#endif + OUTPUT: + RETVAL + +int +LOG_PRI(p) + INPUT: + int p + CODE: +#ifdef LOG_PRI + RETVAL = LOG_PRI(p); +#else + croak("Your vendor has not defined the Sys::Syslog macro LOG_PRI"); +#endif + OUTPUT: + RETVAL + +int +LOG_MAKEPRI(fac,pri) + INPUT: + int fac + int pri + CODE: +#ifdef LOG_MAKEPRI + RETVAL = LOG_MAKEPRI(fac,pri); +#else + croak("Your vendor has not defined the Sys::Syslog macro LOG_MAKEPRI"); +#endif + OUTPUT: + RETVAL + +int +LOG_MASK(pri) + INPUT: + int pri + CODE: +#ifdef LOG_MASK + RETVAL = LOG_MASK(pri); +#else + croak("Your vendor has not defined the Sys::Syslog macro LOG_MASK"); +#endif + OUTPUT: + RETVAL + +int +LOG_UPTO(pri) + INPUT: + int pri + CODE: +#ifdef LOG_UPTO + RETVAL = LOG_UPTO(pri); +#else + croak("Your vendor has not defined the Sys::Syslog macro LOG_UPTO"); +#endif + OUTPUT: + RETVAL + + +double +constant(sv,arg) + PREINIT: + STRLEN len; + INPUT: + SV * sv + char * s = SvPV(sv, len); + int arg + CODE: + RETVAL = constant(s,len,arg); + OUTPUT: + RETVAL + diff --git a/ext/Thread/Thread.pm b/ext/Thread/Thread.pm index f15883e029..3e50a99cd4 100644 --- a/ext/Thread/Thread.pm +++ b/ext/Thread/Thread.pm @@ -1,7 +1,7 @@ package Thread; require Exporter; use XSLoader (); -use vars qw($VERSION @ISA @EXPORT); +our($VERSION, @ISA, @EXPORT); $VERSION = "1.0"; @@ -10,7 +10,7 @@ $VERSION = "1.0"; =head1 NAME -Thread - multithreading +Thread - manipulate threads in Perl (EXPERIMENTAL, subject to change) =head1 SYNOPSIS @@ -41,6 +41,12 @@ The C<Thread> module provides multithreading support for perl. WARNING: Threading is an experimental feature. Both the interface and implementation are subject to change drastically. +In fact, this documentation describes the flavor of threads that was in +version 5.005. Perl v5.6 has the beginnings of support for interpreter +threads, which (when finished) is expected to be significantly different +from what is described here. The information contained here may therefore +soon be obsolete. Use at your own risk! + =head1 FUNCTIONS =over 8 @@ -176,6 +182,8 @@ increasing integer assigned when a thread is created. The main thread of a program will have a tid of zero, while subsequent threads will have tids assigned starting with one. +=back + =head1 LIMITATIONS The sequence number used to assign tids is a simple integer, and no @@ -1,6 +1,6 @@ /* form.h * - * Copyright (c) 1991-1999, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. diff --git a/global.sym b/global.sym index 0fc9739a73..2f750fa170 100644 --- a/global.sym +++ b/global.sym @@ -17,12 +17,8 @@ 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 @@ -45,20 +41,14 @@ Perl_av_shift Perl_av_store Perl_av_undef Perl_av_unshift -Perl_bind_match -Perl_block_end Perl_block_gimme -Perl_block_start -Perl_boot_core_UNIVERSAL Perl_call_list -Perl_cando Perl_cast_ulong Perl_cast_i32 Perl_cast_iv Perl_cast_uv Perl_my_chsize Perl_condpair_magic -Perl_convert Perl_croak Perl_vcroak Perl_croak_nocontext @@ -74,21 +64,13 @@ Perl_sv_setpvf_nocontext Perl_sv_catpvf_mg_nocontext Perl_sv_setpvf_mg_nocontext Perl_fprintf_nocontext -Perl_cv_ckproto -Perl_cv_clone -Perl_cv_const_sv -Perl_op_const_sv -Perl_cv_undef Perl_cx_dump Perl_filter_add Perl_filter_del Perl_filter_read Perl_get_op_descs Perl_get_op_names -Perl_get_no_modify -Perl_get_opargs Perl_get_ppaddr -Perl_cxinc Perl_deb Perl_vdeb Perl_debprofdump @@ -96,43 +78,11 @@ Perl_debop Perl_debstack Perl_debstackptrs Perl_delimcpy -Perl_deprecate Perl_die -Perl_vdie -Perl_die_where Perl_dounwind -Perl_do_aexec -Perl_do_aexec5 Perl_do_binmode -Perl_do_chop -Perl_do_close -Perl_do_eof -Perl_do_exec -Perl_do_exec3 -Perl_do_execfree -Perl_do_ipcctl -Perl_do_ipcget -Perl_do_msgrcv -Perl_do_msgsnd -Perl_do_semop -Perl_do_shmio -Perl_do_join -Perl_do_kv Perl_do_open Perl_do_open9 -Perl_do_pipe -Perl_do_print -Perl_do_readline -Perl_do_chomp -Perl_do_seek -Perl_do_sprintf -Perl_do_sysseek -Perl_do_tell -Perl_do_trans -Perl_do_vecget -Perl_do_vecset -Perl_do_vop -Perl_dofile Perl_dowantarray Perl_dump_all Perl_dump_eval @@ -145,15 +95,9 @@ Perl_dump_packsubs Perl_dump_sub Perl_fbm_compile Perl_fbm_instr -Perl_find_script -Perl_find_threadsv -Perl_force_list -Perl_fold_constants Perl_form Perl_vform Perl_free_tmps -Perl_gen_constant_list -Perl_getenv_len Perl_gp_free Perl_gp_ref Perl_gv_AVadd @@ -196,13 +140,8 @@ Perl_hv_store_ent Perl_hv_undef Perl_ibcmp Perl_ibcmp_locale -Perl_ingroup -Perl_init_debugger Perl_init_stacks -Perl_intro_my Perl_instr -Perl_io_close -Perl_invert Perl_is_uni_alnum Perl_is_uni_alnumc Perl_is_uni_idfirst @@ -252,68 +191,11 @@ Perl_is_utf8_print Perl_is_utf8_punct Perl_is_utf8_xdigit Perl_is_utf8_mark -Perl_jmaybe -Perl_keyword Perl_leave_scope -Perl_lex_end -Perl_lex_start -Perl_linklist -Perl_list -Perl_listkids -Perl_localize Perl_looks_like_number -Perl_magic_clearenv -Perl_magic_clear_all_env -Perl_magic_clearpack -Perl_magic_clearsig -Perl_magic_existspack -Perl_magic_freeregexp -Perl_magic_get -Perl_magic_getarylen -Perl_magic_getdefelem -Perl_magic_getglob -Perl_magic_getnkeys -Perl_magic_getpack -Perl_magic_getpos -Perl_magic_getsig -Perl_magic_getsubstr -Perl_magic_gettaint -Perl_magic_getuvar -Perl_magic_getvec -Perl_magic_len -Perl_magic_mutexfree -Perl_magic_nextpack -Perl_magic_regdata_cnt -Perl_magic_regdatum_get -Perl_magic_set -Perl_magic_setamagic -Perl_magic_setarylen -Perl_magic_setbm -Perl_magic_setdbline -Perl_magic_setcollxfrm -Perl_magic_setdefelem -Perl_magic_setenv -Perl_magic_setfm -Perl_magic_setisa -Perl_magic_setglob -Perl_magic_setmglob -Perl_magic_setnkeys -Perl_magic_setpack -Perl_magic_setpos -Perl_magic_setsig -Perl_magic_setsubstr -Perl_magic_settaint -Perl_magic_setuvar -Perl_magic_setvec -Perl_magic_set_all_env -Perl_magic_sizepack -Perl_magic_wipepack -Perl_magicname Perl_markstack_grow -Perl_mem_collxfrm Perl_mess Perl_vmess -Perl_qerror Perl_mg_clear Perl_mg_copy Perl_mg_find @@ -323,9 +205,7 @@ Perl_mg_length Perl_mg_magical Perl_mg_set Perl_mg_size -Perl_mod Perl_moreswitches -Perl_my Perl_my_atof Perl_my_bcopy Perl_my_bzero @@ -342,7 +222,6 @@ Perl_my_stat Perl_my_swap Perl_my_htonl Perl_my_ntohl -Perl_my_unexec Perl_newANONLIST Perl_newANONHASH Perl_newANONSUB @@ -393,22 +272,9 @@ Perl_newSVsv Perl_newUNOP Perl_newWHILEOP Perl_new_stackinfo -Perl_nextargv Perl_ninstr -Perl_oopsCV Perl_op_free -Perl_package -Perl_pad_alloc -Perl_pad_allocmy -Perl_pad_findmy -Perl_oopsAV -Perl_oopsHV -Perl_pad_leavemy Perl_pad_sv -Perl_pad_free -Perl_pad_reset -Perl_pad_swipe -Perl_peep Perl_new_struct_thread Perl_call_atexit Perl_call_argv @@ -430,17 +296,9 @@ Perl_set_numeric_local Perl_set_numeric_radix Perl_set_numeric_standard Perl_require_pv -Perl_pidgone Perl_pmflag -Perl_pmruntime -Perl_pmtrans -Perl_pop_return Perl_pop_scope -Perl_prepend_elem -Perl_push_return Perl_push_scope -Perl_ref -Perl_refkids Perl_regdump Perl_pregexec Perl_pregfree @@ -449,17 +307,8 @@ Perl_re_intuit_start Perl_re_intuit_string Perl_regexec_flags Perl_regnext -Perl_regprop Perl_repeatcpy Perl_rninstr -Perl_rsignal -Perl_rsignal_restore -Perl_rsignal_save -Perl_rsignal_state -Perl_rxres_free -Perl_rxres_restore -Perl_rxres_save -Perl_same_dirent Perl_savepv Perl_savepvn Perl_savestack_grow @@ -472,7 +321,6 @@ Perl_save_delete Perl_save_destructor Perl_save_destructor_x Perl_save_freesv -Perl_save_freeop Perl_save_freepv Perl_save_generic_svref Perl_save_gp @@ -489,7 +337,6 @@ Perl_save_iv Perl_save_list Perl_save_long Perl_save_nogv -Perl_save_op Perl_save_scalar Perl_save_pptr Perl_save_vptr @@ -497,25 +344,14 @@ Perl_save_re_context Perl_save_sptr Perl_save_svref Perl_save_threadsv -Perl_sawparens -Perl_scalar -Perl_scalarkids -Perl_scalarseq -Perl_scalarvoid Perl_scan_bin Perl_scan_hex Perl_scan_num Perl_scan_oct -Perl_scope Perl_screaminstr -Perl_setenv_getix -Perl_setdefout Perl_sharepvn -Perl_share_hek -Perl_sighandler Perl_stack_grow Perl_start_subparse -Perl_sub_crush_depth Perl_sv_2bool Perl_sv_2cv Perl_sv_2io @@ -533,7 +369,6 @@ Perl_sv_pvn Perl_sv_pvutf8n Perl_sv_pvbyten Perl_sv_true -Perl_sv_add_arena Perl_sv_backoff Perl_sv_bless Perl_sv_catpvf @@ -542,8 +377,6 @@ Perl_sv_catpv Perl_sv_catpvn Perl_sv_catsv Perl_sv_chop -Perl_sv_clean_all -Perl_sv_clean_objs Perl_sv_clear Perl_sv_cmp Perl_sv_cmp_locale @@ -554,7 +387,6 @@ Perl_sv_dump Perl_sv_derived_from Perl_sv_eq Perl_sv_free -Perl_sv_free_arenas Perl_sv_gets Perl_sv_grow Perl_sv_inc @@ -609,29 +441,16 @@ Perl_to_utf8_title Perl_unlnk Perl_unlock_condpair Perl_unsharepvn -Perl_unshare_hek -Perl_utilize Perl_utf16_to_utf8 Perl_utf16_to_utf8_reversed Perl_utf8_distance Perl_utf8_hop Perl_utf8_to_uv Perl_uv_to_utf8 -Perl_vivify_defelem -Perl_vivify_ref -Perl_wait4pid -Perl_report_uninit Perl_warn Perl_vwarn Perl_warner Perl_vwarner -Perl_watch -Perl_whichsig -Perl_yyerror -Perl_yylex -Perl_yylex -Perl_yyparse -Perl_yywarn Perl_dump_mstats Perl_safesysmalloc Perl_safesyscalloc @@ -660,7 +479,6 @@ Perl_sv_setpvn_mg Perl_sv_setsv_mg Perl_sv_usepvn_mg Perl_get_vtbl -Perl_pv_display Perl_dump_indent Perl_dump_vindent Perl_do_gv_dump @@ -683,12 +501,9 @@ Perl_sv_pvbyte Perl_sv_force_normal Perl_tmps_grow Perl_sv_rvweaken -Perl_magic_killbackrefs Perl_newANONATTRSUB Perl_newATTRSUB Perl_newMYSUB -Perl_my_attrs -Perl_boot_core_xsutils Perl_cx_dup Perl_si_dup Perl_ss_dup @@ -78,3 +78,5 @@ Perl_fprintf_nocontext(PerlIO *stream, const char *format, ...) va_start(arglist, format); return PerlIO_vprintf(stream, format, arglist); } + +#include "perlapi.h" /* bring in PL_force_link_funcs */ @@ -1,6 +1,6 @@ /* gv.c * - * Copyright (c) 1991-1999, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -154,6 +154,27 @@ S_gv_init_sv(pTHX_ GV *gv, I32 sv_type) } } +/* +=for apidoc gv_fetchmeth + +Returns the glob with the given C<name> and a defined subroutine or +C<NULL>. The glob lives in the given C<stash>, or in the stashes +accessible via @ISA and @UNIVERSAL. + +The argument C<level> should be either 0 or -1. If C<level==0>, as a +side-effect creates a glob with the given C<name> in the given C<stash> +which in the case of success contains an alias for the subroutine, and sets +up caching info for this glob. Similarly for all the searched stashes. + +This function grants C<"SUPER"> token as a postfix of the stash name. The +GV returned from C<gv_fetchmeth> may be a method cache entry, which is not +visible to Perl code. So when calling C<perl_call_sv>, you should not use +the GV directly; instead, you should use the method's CV, which can be +obtained from the GV with the C<GvCV> macro. + +=cut +*/ + GV * Perl_gv_fetchmeth(pTHX_ HV *stash, const char *name, STRLEN len, I32 level) { @@ -275,12 +296,48 @@ Perl_gv_fetchmeth(pTHX_ HV *stash, const char *name, STRLEN len, I32 level) return 0; } +/* +=for apidoc gv_fetchmethod + +See L<gv_fetchmethod_autoload>. + +=cut +*/ + GV * Perl_gv_fetchmethod(pTHX_ HV *stash, const char *name) { return gv_fetchmethod_autoload(stash, name, TRUE); } +/* +=for apidoc gv_fetchmethod_autoload + +Returns the glob which contains the subroutine to call to invoke the method +on the C<stash>. In fact in the presence of autoloading this may be the +glob for "AUTOLOAD". In this case the corresponding variable $AUTOLOAD is +already setup. + +The third parameter of C<gv_fetchmethod_autoload> determines whether +AUTOLOAD lookup is performed if the given method is not present: non-zero +means yes, look for AUTOLOAD; zero means no, don't look for AUTOLOAD. +Calling C<gv_fetchmethod> is equivalent to calling C<gv_fetchmethod_autoload> +with a non-zero C<autoload> parameter. + +These functions grant C<"SUPER"> token as a prefix of the method name. Note +that if you want to keep the returned glob for a long time, you need to +check for it being "AUTOLOAD", since at the later time the call may load a +different subroutine due to $AUTOLOAD changing its value. Use the glob +created via a side effect to do this. + +These functions have the same side-effects and as C<gv_fetchmeth> with +C<level==0>. C<name> should be writable if contains C<':'> or C<' +''>. The warning against passing the GV returned by C<gv_fetchmeth> to +C<perl_call_sv> apply equally to these functions. + +=cut +*/ + GV * Perl_gv_fetchmethod_autoload(pTHX_ HV *stash, const char *name, I32 autoload) { @@ -387,6 +444,17 @@ Perl_gv_autoload4(pTHX_ HV *stash, const char *name, STRLEN len, I32 method) return gv; } +/* +=for apidoc gv_stashpv + +Returns a pointer to the stash for a specified package. If C<create> is +set then the package will be created if it does not already exist. If +C<create> is not set and the package does not exist then NULL is +returned. + +=cut +*/ + HV* Perl_gv_stashpv(pTHX_ const char *name, I32 create) { @@ -422,6 +490,15 @@ Perl_gv_stashpvn(pTHX_ const char *name, U32 namelen, I32 create) return stash; } +/* +=for apidoc gv_stashsv + +Returns a pointer to the stash for a specified package. See +C<gv_stashpv>. + +=cut +*/ + HV* Perl_gv_stashsv(pTHX_ SV *sv, I32 create) { @@ -504,9 +581,7 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type) /* No stash in name, so see how we can default */ if (!stash) { - if (isIDFIRST(*name) - || (IN_UTF8 && ((*name & 0xc0) == 0xc0) && isIDFIRST_utf8((U8*)name))) - { + if (isIDFIRST_lazy(name)) { bool global = FALSE; if (isUPPER(*name)) { @@ -752,25 +827,26 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type) case '\\': case '/': case '|': - case '\001': - case '\003': - case '\004': - case '\005': - case '\006': - case '\010': - case '\011': /* NOT \t in EBCDIC */ - case '\017': - case '\020': - case '\024': + case '\001': /* $^A */ + case '\003': /* $^C */ + case '\004': /* $^D */ + case '\005': /* $^E */ + case '\006': /* $^F */ + case '\010': /* $^H */ + case '\011': /* $^I, NOT \t in EBCDIC */ + case '\017': /* $^O */ + case '\020': /* $^P */ + case '\024': /* $^T */ if (len > 1) break; goto magicalize; - case '\023': + case '\023': /* $^S */ if (len > 1) break; goto ro_magicalize; - case '\027': /* $^W & $^Warnings */ - if (len > 1 && strNE(name, "\027arnings")) + case '\027': /* $^W & $^WARNING_BITS */ + if (len > 1 && strNE(name, "\027ARNING_BITS") + && strNE(name, "\027IDE_SYSTEM_CALLS")) break; goto magicalize; @@ -797,7 +873,7 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type) sv_magic(GvSV(gv), (SV*)gv, 0, name, len); break; - case '\014': + case '\014': /* $^L */ if (len > 1) break; sv_setpv(GvSV(gv),"\f"); @@ -818,6 +894,13 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type) SvREADONLY_on(sv); } break; + case '\026': /* $^V */ + if (len == 1) { + SV *sv = GvSV(gv); + GvSV(gv) = SvREFCNT_inc(PL_patchlevel); + SvREFCNT_dec(sv); + } + break; } return gv; } @@ -1365,7 +1448,7 @@ Perl_amagic_call(pTHX_ SV *left, SV *right, int method, int flags) if (amtp && amtp->fallback >= AMGfallYES) { DEBUG_o( Perl_deb(aTHX_ "%s", SvPVX(msg)) ); } else { - Perl_croak(aTHX_ "%_", msg); + Perl_croak(aTHX_ "%"SVf, msg); } return NULL; } @@ -1,6 +1,6 @@ /* gv.h * - * Copyright (c) 1991-1999, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -34,6 +34,14 @@ struct gp { #define GvSTASH(gv) (GvXPVGV(gv)->xgv_stash) #define GvFLAGS(gv) (GvXPVGV(gv)->xgv_flags) +/* +=for apidoc Am|SV*|GvSV|GV* gv + +Return the SV from the GV. + +=cut +*/ + #define GvSV(gv) (GvGP(gv)->gp_sv) #define GvREFCNT(gv) (GvGP(gv)->gp_refcnt) #define GvIO(gv) ((gv) && SvTYPE((SV*)gv) == SVt_PVGV ? GvIOp(gv) : 0) @@ -1,6 +1,6 @@ /* handy.h * - * Copyright (c) 1991-1999, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -19,6 +19,17 @@ #endif #define Null(type) ((type)NULL) + +/* +=for apidoc AmU||Nullch +Null character pointer. + +=for apidoc AmU||Nullsv +Null SV pointer. + +=cut +*/ + #define Nullch Null(char*) #define Nullfp Null(PerlIO*) #define Nullsv Null(SV*) @@ -173,6 +184,43 @@ typedef U64TYPE U64; #define Ctl(ch) ((ch) & 037) +/* +=for apidoc Am|bool|strNE|char* s1|char* s2 +Test two strings to see if they are different. Returns true or +false. + +=for apidoc Am|bool|strEQ|char* s1|char* s2 +Test two strings to see if they are equal. Returns true or false. + +=for apidoc Am|bool|strLT|char* s1|char* s2 +Test two strings to see if the first, C<s1>, is less than the second, +C<s2>. Returns true or false. + +=for apidoc Am|bool|strLE|char* s1|char* s2 +Test two strings to see if the first, C<s1>, is less than or equal to the +second, C<s2>. Returns true or false. + +=for apidoc Am|bool|strGT|char* s1|char* s2 +Test two strings to see if the first, C<s1>, is greater than the second, +C<s2>. Returns true or false. + +=for apidoc Am|bool|strGE|char* s1|char* s2 +Test two strings to see if the first, C<s1>, is greater than or equal to +the second, C<s2>. Returns true or false. + +=for apidoc Am|bool|strnNE|char* s1|char* s2|STRLEN len +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>). + +=for apidoc Am|bool|strnEQ|char* s1|char* s2|STRLEN len +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>). + +=cut +*/ + #define strNE(s1,s2) (strcmp(s1,s2)) #define strEQ(s1,s2) (!strcmp(s1,s2)) #define strLT(s1,s2) (strcmp(s1,s2) < 0) @@ -209,6 +257,39 @@ typedef U64TYPE U64; # endif #endif +/* +=for apidoc Am|bool|isALNUM|char ch +Returns a boolean indicating whether the C C<char> is an ascii alphanumeric +character or digit. + +=for apidoc Am|bool|isALPHA|char ch +Returns a boolean indicating whether the C C<char> is an ascii alphabetic +character. + +=for apidoc Am|bool|isSPACE|char ch +Returns a boolean indicating whether the C C<char> is whitespace. + +=for apidoc Am|bool|isDIGIT|char ch +Returns a boolean indicating whether the C C<char> is an ascii +digit. + +=for apidoc Am|bool|isUPPER|char ch +Returns a boolean indicating whether the C C<char> is an uppercase +character. + +=for apidoc Am|bool|isLOWER|char ch +Returns a boolean indicating whether the C C<char> is a lowercase +character. + +=for apidoc Am|char|toUPPER|char ch +Converts the specified character to uppercase. + +=for apidoc Am|char|toLOWER|char ch +Converts the specified character to lowercase. + +=cut +*/ + #define isALNUM(c) (isALPHA(c) || isDIGIT(c) || (c) == '_') #define isIDFIRST(c) (isALPHA(c) || (c) == '_') #define isALPHA(c) (isUPPER(c) || isLOWER(c)) @@ -397,6 +478,56 @@ typedef U16 line_t; --Andy Dougherty August 1996 */ +/* +=for apidoc Am|SV*|NEWSV|int id|STRLEN len +Creates a new SV. A non-zero C<len> parameter indicates the number of +bytes of preallocated string space the SV should have. An extra byte for a +tailing NUL is also reserved. (SvPOK is not set for the SV even if string +space is allocated.) The reference count for the new SV is set to 1. +C<id> is an integer id between 0 and 1299 (used to identify leaks). + +=for apidoc Am|void|New|int id|void* ptr|int nitems|type +The XSUB-writer's interface to the C C<malloc> function. + +=for apidoc Am|void|Newc|int id|void* ptr|int nitems|type|cast +The XSUB-writer's interface to the C C<malloc> function, with +cast. + +=for apidoc Am|void|Newz|int id|void* ptr|int nitems|type +The XSUB-writer's interface to the C C<malloc> function. The allocated +memory is zeroed with C<memzero>. + +=for apidoc Am|void|Renew|void* ptr|int nitems|type +The XSUB-writer's interface to the C C<realloc> function. + +=for apidoc Am|void|Renewc|void* ptr|int nitems|type|cast +The XSUB-writer's interface to the C C<realloc> function, with +cast. + +=for apidoc Am|void|Safefree|void* src|void* dest|int nitems|type +The XSUB-writer's interface to the C C<free> function. + +=for apidoc Am|void|Move|void* src|void* dest|int nitems|type +The XSUB-writer's interface to the C C<memmove> function. The C<src> is the +source, C<dest> is the destination, C<nitems> is the number of items, and C<type> is +the type. Can do overlapping moves. See also C<Copy>. + +=for apidoc Am|void|Copy|void* src|void* dest|int nitems|type +The XSUB-writer's interface to the C C<memcpy> function. The C<src> is the +source, C<dest> is the destination, C<nitems> is the number of items, and C<type> is +the type. May fail on overlapping copies. See also C<Move>. + +=for apidoc Am|void|Zero|void* dest|int nitems|type + +The XSUB-writer's interface to the C C<memzero> function. The C<dest> is the +destination, C<nitems> is the number of items, and C<type> is the type. + +=for apidoc Am|void|StructCopy|type src|type dest|type +This is an architecture-independant macro to copy one structure to another. + +=cut +*/ + #ifndef lint #define NEWSV(x,len) newSV(len) diff --git a/hints/cygwin.sh b/hints/cygwin.sh index 71c9a8334e..4843200f85 100644 --- a/hints/cygwin.sh +++ b/hints/cygwin.sh @@ -21,7 +21,6 @@ so='dll' # - 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' @@ -34,6 +33,11 @@ cccdlflags=' ' # - perl malloc needs to be unpolluted bincompat5005='undef' +# stubs (ENOSYS, not implemented) +d_chroot='undef' +d_seteuid='undef' +d_setegid='undef' + # strip exe's and dll's #ldflags="$ldflags -s" #ccdlflags="$ccdlflags -s" diff --git a/hints/dynixptx.sh b/hints/dynixptx.sh index 5320030176..11c6b5b3b0 100644 --- a/hints/dynixptx.sh +++ b/hints/dynixptx.sh @@ -19,9 +19,8 @@ libswanted=`echo $libswanted | sed -e 's/ inet / /'` # Configure defaults to usenm='y', which doesn't work very well usenm='n' -# for performance, apparently this makes a huge difference (~krader) +# removed d_vfork='define'; we can't use it any more ... -d_vfork='define' case "$optimize" in '') optimize='-Wc,-O3 -W0,-xstring' ;; esac diff --git a/hints/hpux.sh b/hints/hpux.sh index 66fe7c4606..168c4bedcd 100644 --- a/hints/hpux.sh +++ b/hints/hpux.sh @@ -217,7 +217,6 @@ else 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 @@ -290,74 +289,62 @@ EOM 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 "$ccflags" in -*+DD64*) # Been here, done this (via uselfs.cbu, most likely.) - ;; -*) case "$use64bits" in +case "$use64bits" in $define|true|[yY]*) - if [ "$xxOsRevMajor" -lt 11 ]; then + if [ "$xxOsRevMajor" -lt 11 ]; then cat <<EOM >&4 64-bit compilation is not supported on HP-UX $xxOsRevMajor. You need at least HP-UX 11.0. Cannot continue, aborting. EOM exit 1 - fi - if [ ! -f /lib/pa20_64/libc.sl ]; then + fi + if [ ! -f /lib/pa20_64/libc.sl ]; then cat <<EOM >&4 You do not seem to have the 64-bit libraries in /lib/pa20_64. Most importantly, I cannot find /lib/pa20_64/libc.sl. Cannot continue, aborting. EOM exit 1 - fi - ccflags="$ccflags +DD64" - ldflags="$ldflags +DD64" - ld=/usr/bin/ld - set `echo " $libswanted " | sed -e 's@ dl @ @'` - libswanted="$*" - glibpth="/lib/pa20_64" - esac - ;; + fi + + ccflags="$ccflags +DD64" + ld=/usr/bin/ld + ar=/usr/bin/ar + loclibpth="/lib/pa20_64 $loclibpth" + + # The strict ANSI mode (-Aa) doesn't like the LL suffixes. + ccflags=`echo $ccflags|sed 's@ -Aa @ -Ae @'` + + set `echo " $libswanted " | sed -e 's@ dl @ @'` + libswanted="$*" + + libscheck=' +case "`/usr/bin/file $xxx`" in +*LP64*) ;; +*) xxx=/non/64/bit$xxx ;; +esac +' + ;; 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]*) + ccflags="$ccflags `getconf _CS_XBS5_ILP32_OFFBIG_CFLAGS 2>/dev/null`" + ldflags="$ldflags `getconf _CS_XBS5_ILP32_OFFBIG_LDFLAGS 2>/dev/null`" + + libswanted="$libswanted `getconf _CS_XBS5_ILP32_OFFBIG_LIBS 2>/dev/null|sed -e 's@^-l@@' -e 's@ -l@ @g`" + # The strict ANSI mode (-Aa) doesn't like large files. + ccflags=`echo $ccflags|sed 's@ -Aa @ -Ae @'` + ;; +esac +EOCBU diff --git a/hints/netbsd.sh b/hints/netbsd.sh index e359127dca..7bd0a25c1d 100644 --- a/hints/netbsd.sh +++ b/hints/netbsd.sh @@ -34,7 +34,7 @@ case "$osvers" in # we use -fPIC here because -fpic is *NOT* enough for some of the # extensions like Tk on some netbsd platforms (the sparc is one) cccdlflags="-DPIC -fPIC $cccdlflags" - lddlflags="-Bforcearchive -Bshareable $lddlflags" + lddlflags="-Bshareable $lddlflags" else d_dlopen=$undef fi diff --git a/hints/openbsd.sh b/hints/openbsd.sh index 4ae2611b07..7e68402088 100644 --- a/hints/openbsd.sh +++ b/hints/openbsd.sh @@ -5,14 +5,14 @@ # Andy Dougherty <doughera@lafcol.lafayette.edu> # # To build with distribution paths, use: -# ./Configure -des -Dopenbsd_distribution +# ./Configure -des -Dopenbsd_distribution=defined # # OpenBSD has a better malloc than perl... test "$usemymalloc" || usemymalloc='n' # Currently, vfork(2) is not a real win over fork(2) but this will -# change in a future release. +# change starting with OpenBSD 2.7. usevfork='true' # setre?[ug]id() have been replaced by the _POSIX_SAVED_IDS versions @@ -24,19 +24,20 @@ d_setrgid=$undef d_setruid=$undef # -# Not all platforms support shared libs... +# Not all platforms support dynamic loading... # -case `uname -m` in -alpha|mips|powerpc|vax) - d_dlopen=$undef +case `arch` in +OpenBSD.alpha|OpenBSD.mips|OpenBSD.powerpc|OpenBSD.vax) + usedl=$undef ;; *) + usedl=$define d_dlopen=$define d_dlerror=$define # we use -fPIC here because -fpic is *NOT* enough for some of the # extensions like Tk on some OpenBSD platforms (ie: sparc) cccdlflags="-DPIC -fPIC $cccdlflags" - lddlflags="-Bforcearchive -Bshareable $lddlflags" + lddlflags="-Bshareable $lddlflags" ;; esac @@ -74,17 +75,22 @@ EOCBU # When building in the OpenBSD tree we use different paths # This is only part of the story, the rest comes from config.over case "$openbsd_distribution" in -''|$undef|false|[nN]*) ;; +''|$undef|false) ;; *) # We put things in /usr, not /usr/local prefix='/usr' prefixexp='/usr' sysman='/usr/share/man/man1' - # Never look for things in /usr/local - glibpth='/usr/lib' libpth='/usr/lib' - locincpth='' - loclibpth='' + glibpth='/usr/lib' + # Ports installs non-std libs in /usr/local/lib so look there too + locincpth='/usr/local/include' + loclibpth='/usr/local/lib' + # Link perl with shared libperl + if [ "$usedl" = "$define" -a -r shlib_version ]; then + useshrplib=true + libperl=`. ./shlib_version; echo libperl.so.${major}.${minor}` + fi ;; esac diff --git a/hints/unicosmk.sh b/hints/unicosmk.sh index f0b63cb0eb..6113cc300b 100644 --- a/hints/unicosmk.sh +++ b/hints/unicosmk.sh @@ -8,3 +8,11 @@ case "$usemymalloc" in ccflags="$ccflags -DNO_RCHECK" ;; esac +# If somebody ignores the Cray PATH. +case ":$PATH:" in +*:/opt/ctl/bin:*) ;; +'') case "$cc" in + '') test -x /opt/ctl/bin/cc && cc=/opt/ctl/bin/cc ;; + esac + ;; +esac @@ -1,6 +1,6 @@ /* hv.c * - * Copyright (c) 1991-1999, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -105,6 +105,20 @@ Perl_he_dup(pTHX_ HE *e, bool shared) /* (klen == HEf_SVKEY) is special for MAGICAL hv entries, meaning key slot * contains an SV* */ +/* +=for apidoc hv_fetch + +Returns the SV which corresponds to the specified key in the hash. The +C<klen> is the length of the key. If C<lval> is set then the fetch will be +part of a store. Check that the return value is non-null before +dereferencing it to a C<SV*>. + +See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for more +information on how to use this function on tied hashes. + +=cut +*/ + SV** Perl_hv_fetch(pTHX_ HV *hv, const char *key, U32 klen, I32 lval) { @@ -184,6 +198,23 @@ Perl_hv_fetch(pTHX_ HV *hv, const char *key, U32 klen, I32 lval) /* returns a HE * structure with the all fields set */ /* note that hent_val will be a mortal sv for MAGICAL hashes */ +/* +=for apidoc hv_fetch_ent + +Returns the hash entry which corresponds to the specified key in the hash. +C<hash> must be a valid precomputed hash number for the given C<key>, or 0 +if you want the function to compute it. IF C<lval> is set then the fetch +will be part of a store. Make sure the return value is non-null before +accessing it. The return value when C<tb> is a tied hash is a pointer to a +static location, so be sure to make a copy of the structure if you need to +store it somewhere. + +See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for more +information on how to use this function on tied hashes. + +=cut +*/ + HE * Perl_hv_fetch_ent(pTHX_ HV *hv, SV *keysv, I32 lval, register U32 hash) { @@ -293,6 +324,24 @@ S_hv_magic_check(pTHX_ HV *hv, bool *needs_copy, bool *needs_store) } } +/* +=for apidoc hv_store + +Stores an SV in a hash. The hash key is specified as C<key> and C<klen> is +the length of the key. The C<hash> parameter is the precomputed hash +value; if it is zero then Perl will compute it. The return value will be +NULL if the operation failed or if the value did not need to be actually +stored within the hash (as in the case of tied hashes). Otherwise it can +be dereferenced to get the original C<SV*>. Note that the caller is +responsible for suitably incrementing the reference count of C<val> before +the call, and decrementing it if the function returned NULL. + +See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for more +information on how to use this function on tied hashes. + +=cut +*/ + SV** Perl_hv_store(pTHX_ HV *hv, const char *key, U32 klen, SV *val, register U32 hash) { @@ -363,6 +412,25 @@ Perl_hv_store(pTHX_ HV *hv, const char *key, U32 klen, SV *val, register U32 has return &HeVAL(entry); } +/* +=for apidoc hv_store_ent + +Stores C<val> in a hash. The hash key is specified as C<key>. The C<hash> +parameter is the precomputed hash value; if it is zero then Perl will +compute it. The return value is the new hash entry so created. It will be +NULL if the operation failed or if the value did not need to be actually +stored within the hash (as in the case of tied hashes). Otherwise the +contents of the return value can be accessed using the C<He???> macros +described here. Note that the caller is responsible for suitably +incrementing the reference count of C<val> before the call, and +decrementing it if the function returned NULL. + +See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for more +information on how to use this function on tied hashes. + +=cut +*/ + HE * Perl_hv_store_ent(pTHX_ HV *hv, SV *keysv, SV *val, register U32 hash) { @@ -445,6 +513,17 @@ Perl_hv_store_ent(pTHX_ HV *hv, SV *keysv, SV *val, register U32 hash) return entry; } +/* +=for apidoc hv_delete + +Deletes a key/value pair in the hash. The value SV is removed from the +hash and returned to the caller. The C<klen> is the length of the key. +The C<flags> value will normally be zero; if set to G_DISCARD then NULL +will be returned. + +=cut +*/ + SV * Perl_hv_delete(pTHX_ HV *hv, const char *key, U32 klen, I32 flags) { @@ -516,6 +595,17 @@ Perl_hv_delete(pTHX_ HV *hv, const char *key, U32 klen, I32 flags) return Nullsv; } +/* +=for apidoc hv_delete_ent + +Deletes a key/value pair in the hash. The value SV is removed from the +hash and returned to the caller. The C<flags> value will normally be zero; +if set to G_DISCARD then NULL will be returned. C<hash> can be a valid +precomputed hash value, or 0 to ask for it to be computed. + +=cut +*/ + SV * Perl_hv_delete_ent(pTHX_ HV *hv, SV *keysv, I32 flags, U32 hash) { @@ -592,6 +682,15 @@ Perl_hv_delete_ent(pTHX_ HV *hv, SV *keysv, I32 flags, U32 hash) return Nullsv; } +/* +=for apidoc hv_exists + +Returns a boolean indicating whether the specified hash key exists. The +C<klen> is the length of the key. + +=cut +*/ + bool Perl_hv_exists(pTHX_ HV *hv, const char *key, U32 klen) { @@ -657,6 +756,16 @@ Perl_hv_exists(pTHX_ HV *hv, const char *key, U32 klen) } +/* +=for apidoc hv_exists_ent + +Returns a boolean indicating whether the specified hash key exists. C<hash> +can be a valid precomputed hash value, or 0 to ask for it to be +computed. + +=cut +*/ + bool Perl_hv_exists_ent(pTHX_ HV *hv, SV *keysv, U32 hash) { @@ -867,6 +976,14 @@ Perl_hv_ksplit(pTHX_ HV *hv, IV newmax) } } +/* +=for apidoc newHV + +Creates a new HV. The reference count is set to 1. + +=cut +*/ + HV * Perl_newHV(pTHX) { @@ -967,6 +1084,14 @@ Perl_hv_delayfree_ent(pTHX_ HV *hv, register HE *entry) del_he(entry); } +/* +=for apidoc hv_clear + +Clears a hash, making it empty. + +=cut +*/ + void Perl_hv_clear(pTHX_ HV *hv) { @@ -1017,6 +1142,14 @@ S_hfreeentries(pTHX_ HV *hv) (void)hv_iterinit(hv); } +/* +=for apidoc hv_undef + +Undefines the hash. + +=cut +*/ + void Perl_hv_undef(pTHX_ HV *hv) { @@ -1039,6 +1172,20 @@ Perl_hv_undef(pTHX_ HV *hv) mg_clear((SV*)hv); } +/* +=for apidoc hv_iterinit + +Prepares a starting point to traverse a hash table. Returns the number of +keys in the hash (i.e. the same as C<HvKEYS(tb)>). The return value is +currently only meaningful for hashes without tie magic. + +NOTE: Before version 5.004_65, C<hv_iterinit> used to return the number of +hash buckets that happen to be in use. If you still need that esoteric +value, you can get it through the macro C<HvFILL(tb)>. + +=cut +*/ + I32 Perl_hv_iterinit(pTHX_ HV *hv) { @@ -1058,6 +1205,14 @@ Perl_hv_iterinit(pTHX_ HV *hv) return xhv->xhv_keys; /* used to be xhv->xhv_fill before 5.004_65 */ } +/* +=for apidoc hv_iternext + +Returns entries from a hash iterator. See C<hv_iterinit>. + +=cut +*/ + HE * Perl_hv_iternext(pTHX_ HV *hv) { @@ -1129,6 +1284,15 @@ Perl_hv_iternext(pTHX_ HV *hv) return entry; } +/* +=for apidoc hv_iterkey + +Returns the key from the current position of the hash iterator. See +C<hv_iterinit>. + +=cut +*/ + char * Perl_hv_iterkey(pTHX_ register HE *entry, I32 *retlen) { @@ -1145,6 +1309,16 @@ Perl_hv_iterkey(pTHX_ register HE *entry, I32 *retlen) } /* unlike hv_iterval(), this always returns a mortal copy of the key */ +/* +=for apidoc hv_iterkeysv + +Returns the key as an C<SV*> from the current position of the hash +iterator. The return value will always be a mortal copy of the key. Also +see C<hv_iterinit>. + +=cut +*/ + SV * Perl_hv_iterkeysv(pTHX_ register HE *entry) { @@ -1155,6 +1329,15 @@ Perl_hv_iterkeysv(pTHX_ register HE *entry) HeKLEN(entry))); } +/* +=for apidoc hv_iterval + +Returns the value from the current position of the hash iterator. See +C<hv_iterkey>. + +=cut +*/ + SV * Perl_hv_iterval(pTHX_ HV *hv, register HE *entry) { @@ -1170,6 +1353,15 @@ Perl_hv_iterval(pTHX_ HV *hv, register HE *entry) return HeVAL(entry); } +/* +=for apidoc hv_iternextsv + +Performs an C<hv_iternext>, C<hv_iterkey>, and C<hv_iterval> in one +operation. + +=cut +*/ + SV * Perl_hv_iternextsv(pTHX_ HV *hv, char **key, I32 *retlen) { @@ -1180,6 +1372,14 @@ Perl_hv_iternextsv(pTHX_ HV *hv, char **key, I32 *retlen) return hv_iterval(hv, he); } +/* +=for apidoc hv_magic + +Adds magic to a hash. See C<sv_magic>. + +=cut +*/ + void Perl_hv_magic(pTHX_ HV *hv, GV *gv, int how) { @@ -1,6 +1,6 @@ /* hv.h * - * Copyright (c) 1991-1999, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -48,6 +48,62 @@ struct xpvhv { (hash) = hash_PeRlHaSh + (hash_PeRlHaSh>>5); \ } STMT_END +/* +=for apidoc AmU||HEf_SVKEY +This flag, used in the length slot of hash entries and magic structures, +specifies the structure contains a C<SV*> pointer where a C<char*> pointer +is to be expected. (For information only--not to be used). + +=for apidoc AmU||Nullhv +Null HV pointer. + +=for apidoc Am|char*|HvNAME|HV* stash +Returns the package name of a stash. See C<SvSTASH>, C<CvSTASH>. + +=for apidoc Am|void*|HeKEY|HE* he +Returns the actual pointer stored in the key slot of the hash entry. The +pointer may be either C<char*> or C<SV*>, depending on the value of +C<HeKLEN()>. Can be assigned to. The C<HePV()> or C<HeSVKEY()> macros are +usually preferable for finding the value of a key. + +=for apidoc Am|STRLEN|HeKLEN|HE* he +If this is negative, and amounts to C<HEf_SVKEY>, it indicates the entry +holds an C<SV*> key. Otherwise, holds the actual length of the key. Can +be assigned to. The C<HePV()> macro is usually preferable for finding key +lengths. + +=for apidoc Am|SV*|HeVAL|HE* he +Returns the value slot (type C<SV*>) stored in the hash entry. + +=for apidoc Am|U32|HeHASH|HE* he +Returns the computed hash stored in the hash entry. + +=for apidoc Am|char*|HePV|HE* he|STRLEN len +Returns the key slot of the hash entry as a C<char*> value, doing any +necessary dereferencing of possibly C<SV*> keys. The length of the string +is placed in C<len> (this is a macro, so do I<not> use C<&len>). If you do +not care about what the length of the key is, you may use the global +variable C<PL_na>, though this is rather less efficient than using a local +variable. Remember though, that hash keys in perl are free to contain +embedded nulls, so using C<strlen()> or similar is not a good way to find +the length of hash keys. This is very similar to the C<SvPV()> macro +described elsewhere in this document. + +=for apidoc Am|SV*|HeSVKEY|HE* he +Returns the key as an C<SV*>, or C<Nullsv> if the hash entry does not +contain an C<SV*> key. + +=for apidoc Am|SV*|HeSVKEY_force|HE* he +Returns the key as an C<SV*>. Will create and return a temporary mortal +C<SV*> if the hash entry contains only a C<char*> key. + +=for apidoc Am|SV*|HeSVKEY_set|HE* he|SV* sv +Sets the key to a given C<SV*>, taking care to set the appropriate flags to +indicate the presence of an C<SV*> key, and returns the same +C<SV*>. + +=cut +*/ /* these hash entry flags ride on hent_klen (for use only in magic/tied HVs) */ #define HEf_SVKEY -2 /* hent_key is a SV* */ diff --git a/installperl b/installperl index dae86a5c0e..7c0bed7acf 100755 --- a/installperl +++ b/installperl @@ -156,8 +156,7 @@ if ($Is_Cygwin) { }; }; } else { - $perldll = 'perl.' . $dlext; - $perldll = 'perl56.' . $dlext if $Config{'ccflags'} =~ /PERL_OBJECT/i; + $perldll = 'perl56.' . $dlext; } if ($dlsrc ne "dl_none.xs") { diff --git a/intrpvar.h b/intrpvar.h index 606a892374..e578b1ab19 100644 --- a/intrpvar.h +++ b/intrpvar.h @@ -35,7 +35,17 @@ PERLVAR(Iminus_l, bool) PERLVAR(Iminus_a, bool) PERLVAR(Iminus_F, bool) PERLVAR(Idoswitches, bool) -PERLVAR(Idowarn, bool) + +/* +=for apidoc Amn|bool|PL_dowarn + +The C variable which corresponds to Perl's $^W warning variable. + +=cut +*/ + +PERLVAR(Idowarn, U8) +PERLVAR(Iwidesyscalls, bool) /* wide system calls */ PERLVAR(Idoextract, bool) PERLVAR(Isawampersand, bool) /* must save all match strings */ PERLVAR(Iunsafe, bool) @@ -80,6 +90,29 @@ PERLVAR(Ierrgv, GV *) /* shortcuts to debugging objects */ PERLVAR(IDBgv, GV *) PERLVAR(IDBline, GV *) + +/* +=for apidoc Amn|GV *|PL_DBsub +When Perl is run in debugging mode, with the B<-d> switch, this GV contains +the SV which holds the name of the sub being debugged. This is the C +variable which corresponds to Perl's $DB::sub variable. See +C<PL_DBsingle>. + +=for apidoc Amn|SV *|PL_DBsingle +When Perl is run in debugging mode, with the B<-d> switch, this SV is a +boolean which indicates whether subs are being single-stepped. +Single-stepping is automatically turned on after every step. This is the C +variable which corresponds to Perl's $DB::single variable. See +C<PL_DBsub>. + +=for apidoc Amn|SV *|PL_DBtrace +Trace variable used when Perl is run in debugging mode, with the B<-d> +switch. This is the C variable which corresponds to Perl's $DB::trace +variable. See C<PL_DBsingle>. + +=cut +*/ + PERLVAR(IDBsub, GV *) PERLVAR(IDBsingle, SV *) PERLVAR(IDBtrace, SV *) @@ -93,7 +126,7 @@ PERLVAR(Iglobalstash, HV *) /* global keyword overrides imported here */ 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(Icheckav, AV *) /* names of CHECK subroutines */ PERLVAR(Iinitav, AV *) /* names of INIT subroutines */ PERLVAR(Istrtab, HV *) /* shared string table */ PERLVARI(Isub_generation,U32,1) /* incr to invalidate method cache */ @@ -147,6 +180,19 @@ PERLVAR(Iofmt, char *) /* output format for numbers $# */ PERLVARI(Iexitlist, PerlExitListEntry *, NULL) /* list of exit functions */ PERLVARI(Iexitlistlen, I32, 0) /* length of same */ + +/* +=for apidoc Amn|HV*|PL_modglobal + +C<PL_modglobal> is a general purpose, interpreter global HV for use by +extensions that need to keep information on a per-interpreter basis. +In a pinch, it can also be used as a symbol table for extensions +to share data among each other. It is a good idea to use keys +prefixed by the package name of the extension that owns the data. + +=cut +*/ + PERLVAR(Imodglobal, HV *) /* per-interp module data */ /* these used to be in global before 5.004_68 */ @@ -222,6 +268,21 @@ PERLVARI(Irunops, runops_proc_t, MEMBER_TO_FPTR(RUNOPS_DEFAULT)) PERLVARA(Itokenbuf,256, char) +/* +=for apidoc Amn|SV|PL_sv_undef +This is the C<undef> SV. Always refer to this as C<&PL_sv_undef>. + +=for apidoc Amn|SV|PL_sv_no +This is the C<false> SV. See C<PL_sv_yes>. Always refer to this as +C<&PL_sv_no>. + +=for apidoc Amn|SV|PL_sv_yes +This is the C<true> SV. See C<PL_sv_no>. Always refer to this as +C<&PL_sv_yes>. + +=cut +*/ + PERLVAR(Isv_undef, SV) PERLVAR(Isv_no, SV) PERLVAR(Isv_yes, SV) diff --git a/keywords.h b/keywords.h index 972240f4f8..334304149f 100644 --- a/keywords.h +++ b/keywords.h @@ -16,7 +16,7 @@ #define KEY_LE 15 #define KEY_LT 16 #define KEY_NE 17 -#define KEY_STOP 18 +#define KEY_CHECK 18 #define KEY_abs 19 #define KEY_accept 20 #define KEY_alarm 21 diff --git a/keywords.pl b/keywords.pl index acdf807d43..46dd53d70e 100755 --- a/keywords.pl +++ b/keywords.pl @@ -42,7 +42,7 @@ INIT LE LT NE -STOP +CHECK abs accept alarm diff --git a/lib/AnyDBM_File.pm b/lib/AnyDBM_File.pm index 9cf9b31834..58ffda768e 100644 --- a/lib/AnyDBM_File.pm +++ b/lib/AnyDBM_File.pm @@ -1,7 +1,7 @@ package AnyDBM_File; -use vars qw(@ISA); -@ISA = qw(NDBM_File DB_File GDBM_File SDBM_File ODBM_File) unless @ISA; +use 5.005_64; +our @ISA = qw(NDBM_File DB_File GDBM_File SDBM_File ODBM_File) unless @ISA; my $mod; for $mod (@ISA) { diff --git a/lib/AutoLoader.pm b/lib/AutoLoader.pm index 4bbcb33e10..d62ceb0587 100644 --- a/lib/AutoLoader.pm +++ b/lib/AutoLoader.pm @@ -1,6 +1,7 @@ package AutoLoader; -# use vars qw(@EXPORT @EXPORT_OK $VERSION); +use 5.005_64; +our(@EXPORT, @EXPORT_OK, $VERSION); my $is_dosish; my $is_vms; diff --git a/lib/AutoSplit.pm b/lib/AutoSplit.pm index feecd58bf1..41d5489531 100644 --- a/lib/AutoSplit.pm +++ b/lib/AutoSplit.pm @@ -1,17 +1,16 @@ package AutoSplit; +use 5.005_64; use Exporter (); use Config qw(%Config); use Carp qw(carp); use File::Basename (); use File::Path qw(mkpath); use strict; -use vars qw( - $VERSION @ISA @EXPORT @EXPORT_OK - $Verbose $Keep $Maxlen $CheckForAutoloader $CheckModTime - ); +our($VERSION, @ISA, @EXPORT, @EXPORT_OK, $Verbose, $Keep, $Maxlen, + $CheckForAutoloader, $CheckModTime); -$VERSION = "1.0304"; +$VERSION = "1.0305"; @ISA = qw(Exporter); @EXPORT = qw(&autosplit &autosplit_lib_modules); @EXPORT_OK = qw($Verbose $Keep $Maxlen $CheckForAutoloader $CheckModTime); @@ -150,7 +149,7 @@ my $Is_VMS = ($^O eq 'VMS'); # allow checking for valid ': attrlist' attachments my $nested; $nested = qr{ \( (?: (?> [^()]+ ) | (?p{ $nested }) )* \) }x; -my $one_attr = qr{ (?> (?! \d) \w+ (?:$nested)? ) [\s,]* }x; +my $one_attr = qr{ (?> (?! \d) \w+ (?:$nested)? ) (?:\s*\:\s*|\s+(?!\:)) }x; my $attr_list = qr{ \s* : \s* (?: $one_attr )* }x; @@ -353,8 +352,10 @@ EOT } $last_package = $this_package if defined $this_package; } - print OUT @cache,"1;\n# end of $last_package\::$subname\n"; - close(OUT); + if ($subname) { + print OUT @cache,"1;\n# end of $last_package\::$subname\n"; + close(OUT); + } close(IN); if (!$keep){ # don't keep any obsolete *.al files in the directory @@ -467,5 +468,5 @@ package Yet::Another::AutoSplit; sub testtesttesttest4_1 ($) { "another test 4\n"; } sub testtesttesttest4_2 ($$) { "another duplicate test 4\n"; } package Yet::More::Attributes; -sub test_a1 ($) : locked { 1; } +sub test_a1 ($) : locked :locked { 1; } sub test_a2 : locked { 1; } diff --git a/lib/Benchmark.pm b/lib/Benchmark.pm index 487ddd5717..3c10a5bc52 100644 --- a/lib/Benchmark.pm +++ b/lib/Benchmark.pm @@ -423,19 +423,19 @@ sub timestr { my @t = @$tr; warn "bad time value (@t)" unless @t==6; my($r, $pu, $ps, $cu, $cs, $n) = @t; - my($pt, $ct, $t) = ($tr->cpu_p, $tr->cpu_c, $tr->cpu_a); + my($pt, $ct, $tt) = ($tr->cpu_p, $tr->cpu_c, $tr->cpu_a); $f = $defaultfmt unless defined $f; # format a time in the required style, other formats may be added here $style ||= $defaultstyle; $style = ($ct>0) ? 'all' : 'noc' if $style eq 'auto'; my $s = "@t $style"; # default for unknown style $s=sprintf("%2d wallclock secs (%$f usr %$f sys + %$f cusr %$f csys = %$f CPU)", - @t,$t) if $style eq 'all'; + $r,$pu,$ps,$cu,$cs,$tt) if $style eq 'all'; $s=sprintf("%2d wallclock secs (%$f usr + %$f sys = %$f CPU)", $r,$pu,$ps,$pt) if $style eq 'noc'; $s=sprintf("%2d wallclock secs (%$f cusr + %$f csys = %$f CPU)", $r,$cu,$cs,$ct) if $style eq 'nop'; - $s .= sprintf(" @ %$f/s (n=$n)", $n / ( $pu + $ps )) if $n; + $s .= sprintf(" @ %$f/s (n=$n)", $n / ( $pu + $ps )) if $n && $pu+$ps; $s; } diff --git a/lib/CGI.pm b/lib/CGI.pm index c0cb5fd518..ad7cd02552 100644 --- a/lib/CGI.pm +++ b/lib/CGI.pm @@ -17,8 +17,8 @@ require 5.004; # The most recent version and complete docs are available at: # http://stein.cshl.org/WWW/software/CGI/ -$CGI::revision = '$Id: CGI.pm,v 1.18 1999/06/09 14:52:45 lstein Exp $'; -$CGI::VERSION='2.53'; +$CGI::revision = '$Id: CGI.pm,v 1.19 1999/08/31 17:04:37 lstein Exp $'; +$CGI::VERSION='2.56'; # HARD-CODED LOCATION FOR FILE UPLOAD TEMPORARY FILES. # UNCOMMENT THIS ONLY IF YOU KNOW WHAT YOU'RE DOING. @@ -95,6 +95,8 @@ if ($OS=~/Win/i) { $OS = 'WINDOWS'; } elsif ($OS=~/vms/i) { $OS = 'VMS'; +} elsif ($OS=~/bsdos/i) { + $OS = 'UNIX'; } elsif ($OS=~/dos/i) { $OS = 'DOS'; } elsif ($OS=~/^MacOS$/i) { @@ -453,7 +455,7 @@ sub init { # We now have the query string in hand. We do slightly # different things for keyword lists and parameter lists. - if ($query_string ne '') { + if (defined $query_string && $query_string) { if ($query_string =~ /=/) { $self->parse_params($query_string); } else { @@ -518,7 +520,7 @@ sub cgi_error { # unescape URL-encoded data sub unescape { - shift() if ref($_[0]) || $_[0] eq $DefaultClass; + shift() if ref($_[0]) || (defined $_[1] && $_[0] eq $DefaultClass); my $todecode = shift; return undef unless defined($todecode); $todecode =~ tr/+/ /; # pluses become spaces @@ -532,12 +534,11 @@ sub unescape { # URL-encode data sub escape { - shift() if ref($_[0]) || $_[0] eq $DefaultClass; - my $toencode = shift; - return undef unless defined($toencode); - $toencode=~s/ /+/g; - $toencode=~s/([^a-zA-Z0-9_.+-])/uc sprintf("%%%02x",ord($1))/eg; - return $toencode; + shift() if ref($_[0]) || (defined $_[1] && $_[0] eq $DefaultClass); + my $toencode = shift; + return undef unless defined($toencode); + $toencode=~s/([^a-zA-Z0-9_.-])/uc sprintf("%%%02x",ord($1))/eg; + return $toencode; } sub save_request { @@ -851,8 +852,9 @@ END_OF_FUNC # with Steve Brenner's cgi-lib.pl routines 'Vars' => <<'END_OF_FUNC', sub Vars { + my $q = shift; my %in; - tie(%in,CGI); + tie(%in,CGI,$q); return %in if wantarray; return \%in; } @@ -917,7 +919,8 @@ END_OF_FUNC 'TIEHASH' => <<'END_OF_FUNC', sub TIEHASH { - return $Q || new CGI; + return $_[1] if defined $_[1]; + return $Q || new shift; } END_OF_FUNC @@ -1520,7 +1523,8 @@ END_OF_FUNC 'endform' => <<'END_OF_FUNC', sub endform { my($self,@p) = self_or_default(@_); - return ($self->get_fields,"</FORM>"); + return wantarray ? ($self->get_fields,"</FORM>") : + $self->get_fields ."\n</FORM>"; } END_OF_FUNC @@ -2126,7 +2130,7 @@ sub hidden { $name=$self->escapeHTML($name); foreach (@value) { - $_=$self->escapeHTML($_); + $_ = defined($_) ? $self->escapeHTML($_) : ''; push(@result,qq/<INPUT TYPE="hidden" NAME="$name" VALUE="$_">/); } return wantarray ? @result : join('',@result); @@ -2200,7 +2204,8 @@ sub url { # strip query string substr($script_name,$index) = '' if ($index = index($script_name,'?')) >= 0; # and path - substr($script_name,$index) = '' if $path and ($index = rindex($script_name,$path)) >= 0; + substr($script_name,$index) = '' if exists($ENV{PATH_INFO}) + and ($index = rindex($script_name,$ENV{PATH_INFO})) >= 0; } else { $script_name = $self->script_name; } @@ -2854,7 +2859,7 @@ sub read_multipart { # If no filename specified, then just read the data and assign it # to our parameter list. - unless ($filename) { + if ( !defined($filename) || $filename eq '' ) { my($value) = $buffer->readBody; push(@{$self->{$param}},$value); next; @@ -2877,7 +2882,7 @@ sub read_multipart { for (my $cnt=10;$cnt>0;$cnt--) { next unless $tmpfile = new TempFile($seqno); $tmp = $tmpfile->as_string; - last if $filehandle = Fh->new($filename,$tmp,$PRIVATE_TEMPFILES); + last if defined($filehandle = Fh->new($filename,$tmp,$PRIVATE_TEMPFILES)); $seqno += int rand(100); } die "CGI open of tmpfile: $!\n" unless $filehandle; @@ -2895,7 +2900,7 @@ sub read_multipart { # Save some information about the uploaded file where we can get # at it later. - $self->{'.tmpfiles'}->{$filename}= { + $self->{'.tmpfiles'}->{fileno($filehandle)}= { name => $tmpfile, info => {%header}, }; @@ -2918,8 +2923,8 @@ END_OF_FUNC 'tmpFileName' => <<'END_OF_FUNC', sub tmpFileName { my($self,$filename) = self_or_default(@_); - return $self->{'.tmpfiles'}->{$filename}->{name} ? - $self->{'.tmpfiles'}->{$filename}->{name}->as_string + return $self->{'.tmpfiles'}->{fileno($filename)}->{name} ? + $self->{'.tmpfiles'}->{fileno($filename)}->{name}->as_string : ''; } END_OF_FUNC @@ -2927,7 +2932,7 @@ END_OF_FUNC 'uploadInfo' => <<'END_OF_FUNC', sub uploadInfo { my($self,$filename) = self_or_default(@_); - return $self->{'.tmpfiles'}->{$filename}->{info}; + return $self->{'.tmpfiles'}->{fileno($filename)}->{info}; } END_OF_FUNC @@ -2979,7 +2984,7 @@ $AUTOLOADED_ROUTINES=<<'END_OF_AUTOLOAD'; sub asString { my $self = shift; # get rid of package name - (my $i = $$self) =~ s/^\*(\w+::)+//; + (my $i = $$self) =~ s/^\*(\w+::fh\d{5})+//; $i =~ s/\\(.)/$1/g; return $i; # BEGIN DEAD CODE @@ -3005,8 +3010,7 @@ END_OF_FUNC sub new { my($pack,$name,$file,$delete) = @_; require Fcntl unless defined &Fcntl::O_RDWR; - ++$FH; - my $ref = \*{'Fh::' . quotemeta($name)}; + my $ref = \*{'Fh::' . ++$FH . quotemeta($name)}; sysopen($ref,$file,Fcntl::O_RDWR()|Fcntl::O_CREAT()|Fcntl::O_EXCL(),0600) || return; unlink($file) if $delete; CORE::delete $Fh::{$FH}; @@ -5075,7 +5079,7 @@ Example: $file = $query->upload('uploaded_file'); if (!$file && $query->cgi_error) { - print $query->header(-status->$query->cgi_error); + print $query->header(-status=>$query->cgi_error); exit 0; } @@ -6429,7 +6433,7 @@ for suggestions and bug fixes. -rows=>10, -columns=>50); - print "<P>",$query->Reset; + print "<P>",$query->reset; print $query->submit('Action','Shout'); print $query->submit('Action','Scream'); print $query->endform; diff --git a/lib/CGI/Apache.pm b/lib/CGI/Apache.pm index 82a3669250..dced8664b4 100644 --- a/lib/CGI/Apache.pm +++ b/lib/CGI/Apache.pm @@ -1,103 +1,23 @@ -package CGI::Apache; -use Apache (); -use vars qw(@ISA $VERSION); -require CGI; -@ISA = qw(CGI); - -$VERSION = (qw$Revision: 1.1 $)[1]; -$CGI::DefaultClass = 'CGI::Apache'; -$CGI::Apache::AutoloadClass = 'CGI'; - -sub import { - my $self = shift; - my ($callpack, $callfile, $callline) = caller; - ${"${callpack}::AutoloadClass"} = 'CGI'; -} - -sub new { - my($class) = shift; - my($r) = Apache->request; - %ENV = $r->cgi_env unless defined $ENV{GATEWAY_INTERFACE}; #PerlSetupEnv On - my $self = $class->SUPER::new(@_); - $self->{'.req'} = $r; - $self; -} - -sub header { - my ($self,@rest) = CGI::self_or_default(@_); - my $r = $self->{'.req'}; - $r->basic_http_header; - return CGI::header($self,@rest); -} - -sub print { - my($self,@rest) = CGI::self_or_default(@_); - $self->{'.req'}->print(@rest); -} - -sub read_from_client { - my($self, $fh, $buff, $len, $offset) = @_; - my $r = $self->{'.req'} || Apache->request; - return $r->read($$buff, $len, $offset); -} - -sub new_MultipartBuffer { - my $self = shift; - my $new = CGI::Apache::MultipartBuffer->new($self, @_); - $new->{'.req'} = $self->{'.req'} || Apache->request; - return $new; -} - -package CGI::Apache::MultipartBuffer; -use vars qw(@ISA); -@ISA = qw(MultipartBuffer); - -$CGI::Apache::MultipartBuffer::AutoloadClass = 'MultipartBuffer'; -*CGI::Apache::MultipartBuffer::read_from_client = - \&CGI::Apache::read_from_client; - - +use CGI; 1; - __END__ =head1 NAME -CGI::Apache - Make things work with CGI.pm against Perl-Apache API +CGI::Apache - Backward compatibility module for CGI.pm =head1 SYNOPSIS - require CGI::Apache; - - my $q = new Apache::CGI; +Do not use this module. It is deprecated. - $q->print($q->header); - - #do things just like you do with CGI.pm +=head1 ABSTRACT =head1 DESCRIPTION -When using the Perl-Apache API, your applications are faster, but the -environment is different than CGI. -This module attempts to set-up that environment as best it can. - -=head1 NOTE 1 +=head1 AUTHOR INFORMATION -This module used to be named Apache::CGI. Sorry for the confusion. - -=head1 NOTE 2 - -If you're going to inherit from this class, make sure to "use" it -after your package declaration rather than "require" it. This is -because CGI.pm does a little magic during the import() step in order -to make autoloading work correctly. +=head1 BUGS =head1 SEE ALSO -perl(1), Apache(3), CGI(3) - -=head1 AUTHOR - -Doug MacEachern E<lt>dougm@osf.orgE<gt>, hacked over by Andreas KE<ouml>nig E<lt>a.koenig@mind.deE<gt>, modified by Lincoln Stein <lt>lstein@genome.wi.mit.edu<gt> - =cut diff --git a/lib/CGI/Cookie.pm b/lib/CGI/Cookie.pm index 433df496df..aac0fb0ddc 100644 --- a/lib/CGI/Cookie.pm +++ b/lib/CGI/Cookie.pm @@ -13,9 +13,9 @@ package CGI::Cookie; # wish, but if you redistribute a modified version, please attach a note # listing the modifications you have made. -$CGI::Cookie::VERSION='1.10'; +$CGI::Cookie::VERSION='1.12'; -use CGI; +use CGI qw(-no_debug); use overload '""' => \&as_string, 'cmp' => \&compare, 'fallback'=>1; @@ -97,10 +97,12 @@ sub new { },$class; # IE requires the path and domain to be present for some reason. - $path ||= CGI::url(-absolute=>1); - $domain ||= CGI::virtual_host(); + $path = CGI::url(-absolute=>1) unless defined $path; +# however, this breaks networks which use host tables without fully qualified +# names, so we comment it out. +# $domain = CGI::virtual_host() unless defined $domain; - $self->path($path) if defined $path; + $self->path($path) if defined $path; $self->domain($domain) if defined $domain; $self->secure($secure) if defined $secure; $self->expires($expires) if defined $expires; @@ -250,8 +252,8 @@ against your script's URL before returning the cookie. For example, if you specify the path "/cgi-bin", then the cookie will be returned to each of the scripts "/cgi-bin/tally.pl", "/cgi-bin/order.pl", and "/cgi-bin/customer_service/complain.pl", but not to the script -"/cgi-private/site_admin.pl". By default, the path is set to the -directory that contains your script. +"/cgi-private/site_admin.pl". By default, the path is set to your +script, so that only it will receive the cookie. =item B<4. secure flag> diff --git a/lib/CGI/Pretty.pm b/lib/CGI/Pretty.pm index f8931fb16e..4f2eed4ce9 100644 --- a/lib/CGI/Pretty.pm +++ b/lib/CGI/Pretty.pm @@ -7,28 +7,63 @@ package CGI::Pretty; # documentation in manual or html file format (these utilities are part of the # Perl 5 distribution). +use strict; use CGI (); -$VERSION = '1.0'; +$CGI::Pretty::VERSION = '1.03'; $CGI::DefaultClass = __PACKAGE__; -$AutoloadClass = 'CGI'; -@ISA = 'CGI'; +$CGI::Pretty::AutoloadClass = 'CGI'; +@CGI::Pretty::ISA = qw( CGI ); -# These tags should not be prettify'd. If we did prettify them, the -# browser would output text that would have extraneous spaces -@AS_IS = qw( A PRE ); -my $NON_PRETTIFY_ENDTAGS = join "", map { "</$_>" } @AS_IS; +initialize_globals(); + +sub _prettyPrint { + my $input = shift; + + foreach my $i ( @CGI::Pretty::AS_IS ) { + if ( $$input =~ /<\/$i>/si ) { + my ( $a, $b, $c, $d, $e ) = $$input =~ /(.*)<$i(\s?)(.*?)>(.*?)<\/$i>(.*)/si; + _prettyPrint( \$a ); + _prettyPrint( \$e ); + + $$input = "$a<$i$b$c>$d</$i>$e"; + return; + } + } + $$input =~ s/$CGI::Pretty::LINEBREAK/$CGI::Pretty::LINEBREAK$CGI::Pretty::INDENT/g; +} + +sub comment { + my($self,@p) = CGI::self_or_CGI(@_); + + my $s = "@p"; + $s =~ s/$CGI::Pretty::LINEBREAK/$CGI::Pretty::LINEBREAK$CGI::Pretty::INDENT/g; + + return $self->SUPER::comment( "$CGI::Pretty::LINEBREAK$CGI::Pretty::INDENT$s$CGI::Pretty::LINEBREAK" ) . $CGI::Pretty::LINEBREAK; +} sub _make_tag_func { my ($self,$tagname) = @_; return $self->SUPER::_make_tag_func($tagname) if $tagname=~/^(start|end)_/; + # As Lincoln as noted, the last else clause is VERY hairy, and it + # took me a while to figure out what I was trying to do. + # What it does is look for tags that shouldn't be indented (e.g. PRE) + # and makes sure that when we nest tags, those tags don't get + # indented. + # For an example, try print td( pre( "hello\nworld" ) ); + # If we didn't care about stuff like that, the code would be + # MUCH simpler. BTW: I won't claim to be a regular expression + # guru, so if anybody wants to contribute something that would + # be quicker, easier to read, etc, I would be more than + # willing to put it in - Brian + return qq{ sub $tagname { # handle various cases in which we're called # most of this bizarre stuff is to avoid -w errors shift if \$_[0] && -# (!ref(\$_[0]) && \$_[0] eq \$CGI::DefaultClass) || + (!ref(\$_[0]) && \$_[0] eq \$CGI::DefaultClass) || (ref(\$_[0]) && (substr(ref(\$_[0]),0,3) eq 'CGI' || UNIVERSAL::isa(\$_[0],'CGI'))); @@ -43,58 +78,64 @@ sub _make_tag_func { return \$tag unless \@_; my \@result; - if ( "$NON_PRETTIFY_ENDTAGS" =~ /\$untag/ ) { - \@result = map { "\$tag\$_\$untag\\n" } + my \$NON_PRETTIFY_ENDTAGS = join "", map { "</\$_>" } \@CGI::Pretty::AS_IS; + + if ( \$NON_PRETTIFY_ENDTAGS =~ /\$untag/ ) { + \@result = map { "\$tag\$_\$untag\$CGI::Pretty::LINEBREAK" } (ref(\$_[0]) eq 'ARRAY') ? \@{\$_[0]} : "\@_"; } else { \@result = map { chomp; if ( \$_ !~ /<\\// ) { - s/\\n/\\n /g; + s/\$CGI::Pretty::LINEBREAK/\$CGI::Pretty::LINEBREAK\$CGI::Pretty::INDENT/g; } else { - my \$text = ""; - my ( \$pretag, \$thistag, \$posttag ); - while ( /<\\/.*>/si ) { - if ( (\$pretag, \$thistag, \$posttag ) = - /(.*?)<(.*?)>(.*)/si ) { - \$pretag =~ s/\\n/\\n /g; - \$text .= "\$pretag<\$thistag>"; - - ( \$thistag ) = split ' ', \$thistag; - my \$endtag = "</" . uc(\$thistag) . ">"; - if ( "$NON_PRETTIFY_ENDTAGS" =~ /\$endtag/ ) { - if ( ( \$pretag, \$posttag ) = - \$posttag =~ /(.*?)\$endtag(.*)/si ) { - \$text .= "\$pretag\$endtag"; - } - } - - \$_ = \$posttag; - } - } - \$_ = \$text; - if ( defined \$posttag ) { - \$posttag =~ s/\\n/\\n /g; - \$_ .= \$posttag; - } + my \$tmp = \$_; + CGI::Pretty::_prettyPrint( \\\$tmp ); + \$_ = \$tmp; } - "\$tag\\n \$_\\n\$untag\\n" } + "\$tag\$CGI::Pretty::LINEBREAK\$CGI::Pretty::INDENT\$_\$CGI::Pretty::LINEBREAK\$untag\$CGI::Pretty::LINEBREAK" } (ref(\$_[0]) eq 'ARRAY') ? \@{\$_[0]} : "\@_"; } + local \$" = ""; return "\@result"; } }; } +sub start_html { + return CGI::start_html( @_ ) . $CGI::Pretty::LINEBREAK; +} + +sub end_html { + return CGI::end_html( @_ ) . $CGI::Pretty::LINEBREAK; +} + sub new { my $class = shift; my $this = $class->SUPER::new( @_ ); + Apache->request->register_cleanup(\&CGI::Pretty::_reset_globals) if ($CGI::MOD_PERL); + $class->_reset_globals if $CGI::PERLEX; + return bless $this, $class; } +sub initialize_globals { + # This is the string used for indentation of tags + $CGI::Pretty::INDENT = "\t"; + + # This is the string used for seperation between tags + $CGI::Pretty::LINEBREAK = "\n"; + + # These tags are not prettify'd. + @CGI::Pretty::AS_IS = qw( A PRE CODE SCRIPT TEXTAREA ); + + 1; +} +sub _reset_globals { initialize_globals(); } + 1; =head1 NAME @@ -148,22 +189,43 @@ the list of tags that are not to be touched, push them onto the C<@AS_IS> array: push @CGI::Pretty::AS_IS,qw(CODE XMP); +=head2 Customizing the Indenting + +If you wish to have your own personal style of indenting, you can change the +C<$INDENT> variable: + + $CGI::Pretty::INDENT = "\t\t"; + +would cause the indents to be two tabs. + +Similarly, if you wish to have more space between lines, you may change the +C<$LINEBREAK> variable: + + $CGI::Pretty::LINEBREAK = "\n\n"; + +would create two carriage returns between lines. + +If you decide you want to use the regular CGI indenting, you can easily do +the following: + + $CGI::Pretty::INDENT = $CGI::Pretty::LINEBREAK = ""; + =head1 BUGS This section intentionally left blank. =head1 AUTHOR -Brian Paulsen <bpaulsen@lehman.com>, with minor modifications by +Brian Paulsen <Brian@ThePaulsens.com>, with minor modifications by Lincoln Stein <lstein@cshl.org> for incorporation into the CGI.pm distribution. -Copyright 1998, Brian Paulsen. All rights reserved. +Copyright 1999, Brian Paulsen. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. -Bug reports and comments to bpaulsen@lehman.com. You can also write +Bug reports and comments to Brian@ThePaulsens.com. You can also write to lstein@cshl.org, but this code looks pretty hairy to me and I'm not sure I understand it! @@ -172,4 +234,3 @@ sure I understand it! L<CGI> =cut - diff --git a/lib/CGI/Switch.pm b/lib/CGI/Switch.pm index 8afc6a6cb3..b16b9c0658 100644 --- a/lib/CGI/Switch.pm +++ b/lib/CGI/Switch.pm @@ -1,71 +1,24 @@ -package CGI::Switch; -use Carp; -use strict; -use vars qw($VERSION @Pref); -$VERSION = '0.06'; -@Pref = qw(CGI::Apache CGI); #default - -sub import { - my($self,@arg) = @_; - @Pref = @arg if @arg; -} - -sub new { - shift; - my($file,$pack); - for $pack (@Pref) { - ($file = $pack) =~ s|::|/|g; - eval { require "$file.pm"; }; - if ($@) { -#XXX warn $@; - next; - } else { -#XXX warn "Going to try $pack\->new\n"; - my $obj; - eval {$obj = $pack->new(@_)}; - if ($@) { -#XXX warn $@; - } else { - return $obj; - } - } - } - Carp::croak "Couldn't load+construct any of @Pref\n"; -} - +use CGI; 1; + __END__ =head1 NAME -CGI::Switch - Try more than one constructors and return the first object available +CGI::Switch - Backward compatibility module for defunct CGI::Switch =head1 SYNOPSIS - - use CGISwitch; - - -or- +Do not use this module. It is deprecated. - use CGI::Switch This, That, CGI::XA, Foo, Bar, CGI; - - my $q = new CGI::Switch; +=head1 ABSTRACT =head1 DESCRIPTION -Per default the new() method tries to call new() in the three packages -Apache::CGI, CGI::XA, and CGI. It returns the first CGI object it -succeeds with. +=head1 AUTHOR INFORMATION -The import method allows you to set up the default order of the -modules to be tested. +=head1 BUGS =head1 SEE ALSO -perl(1), Apache(3), CGI(3), CGI::XA(3) - -=head1 AUTHOR - -Andreas KE<ouml>nig E<lt>a.koenig@mind.deE<gt> - =cut diff --git a/lib/CPAN.pm b/lib/CPAN.pm index 2f22b773c7..bbebf6fe81 100644 --- a/lib/CPAN.pm +++ b/lib/CPAN.pm @@ -6,13 +6,13 @@ use vars qw{$Try_autoload $Frontend $Defaultsite }; #}; -$VERSION = '1.50'; +$VERSION = '1.52'; -# $Id: CPAN.pm,v 1.264 1999/05/23 14:26:49 k Exp $ +# $Id: CPAN.pm,v 1.276 2000/01/08 15:29:46 k Exp $ # only used during development: $Revision = ""; -# $Revision = "[".substr(q$Revision: 1.264 $, 10)."]"; +# $Revision = "[".substr(q$Revision: 1.276 $, 10)."]"; use Carp (); use Config (); @@ -61,7 +61,7 @@ use strict qw(vars); @CPAN::ISA = qw(CPAN::Debug Exporter); @EXPORT = qw( - autobundle bundle expand force get + autobundle bundle expand force get cvs_import install make readme recompile shell test clean ); @@ -90,7 +90,7 @@ sub AUTOLOAD { #-> sub CPAN::shell ; sub shell { my($self) = @_; - $Suppress_readline ||= ! -t STDIN; + $Suppress_readline = ! -t STDIN unless defined $Suppress_readline; CPAN::Config->load unless $CPAN::Config_loaded++; my $prompt = "cpan> "; @@ -113,6 +113,12 @@ sub shell { $readline::rl_completion_function = $readline::rl_completion_function = 'CPAN::Complete::cpl'; } + # $term->OUT is autoflushed anyway + my $odef = select STDERR; + $| = 1; + select STDOUT; + $| = 1; + select $odef; } no strict; @@ -120,7 +126,8 @@ sub shell { my $getcwd; $getcwd = $CPAN::Config->{'getcwd'} || 'cwd'; my $cwd = CPAN->$getcwd(); - my $try_detect_readline = $term->ReadLine eq "Term::ReadLine::Stub"; + my $try_detect_readline; + $try_detect_readline = $term->ReadLine eq "Term::ReadLine::Stub" if $term; my $rl_avail = $Suppress_readline ? "suppressed" : ($term->ReadLine ne "Term::ReadLine::Stub") ? "enabled" : "available (try ``install Bundle::CPAN'')"; @@ -190,7 +197,8 @@ ReadLine support $rl_avail my $redef; local($SIG{__WARN__}) = CPAN::Shell::dotdot_onreload(\$redef); require Term::ReadLine; - $CPAN::Frontend->myprint("\n$redef subroutines in Term::ReadLine redefined\n"); + $CPAN::Frontend->myprint("\n$redef subroutines in ". + "Term::ReadLine redefined\n"); goto &shell; } } @@ -575,7 +583,7 @@ Please make sure the directory exists and is writable. } my $fh; unless ($fh = FileHandle->new(">$lockfile")) { - if ($! =~ /Permission/ || $!{EACCES}) { + if ($! =~ /Permission/) { my $incc = $INC{'CPAN/Config.pm'}; my $myincc = MM->catfile($ENV{HOME},'.cpan','CPAN','MyConfig.pm'); $CPAN::Frontend->myprint(qq{ @@ -613,6 +621,27 @@ or print "Caught SIGINT\n"; $Signal++; }; + +# From: Larry Wall <larry@wall.org> +# Subject: Re: deprecating SIGDIE +# To: perl5-porters@perl.org +# Date: Thu, 30 Sep 1999 14:58:40 -0700 (PDT) +# +# The original intent of __DIE__ was only to allow you to substitute one +# kind of death for another on an application-wide basis without respect +# to whether you were in an eval or not. As a global backstop, it should +# not be used any more lightly (or any more heavily :-) than class +# UNIVERSAL. Any attempt to build a general exception model on it should +# be politely squashed. Any bug that causes every eval {} to have to be +# modified should be not so politely squashed. +# +# Those are my current opinions. It is also my optinion that polite +# arguments degenerate to personal arguments far too frequently, and that +# when they do, it's because both people wanted it to, or at least didn't +# sufficiently want it not to. +# +# Larry + $SIG{'__DIE__'} = \&cleanup; $self->debug("Signal handler set.") if $CPAN::DEBUG; } @@ -817,7 +846,7 @@ sub disk_usage { if ($^O eq 'MacOS') { require Mac::Files; my $cat = Mac::Files::FSpGetCatInfo($_); - $Du += $cat->ioFlLgLen() + $cat->ioFlRLgLen(); + $Du += $cat->ioFlLgLen() + $cat->ioFlRLgLen() if $cat; } else { $Du += (-s _); } @@ -1136,7 +1165,8 @@ Known options: commit commit session changes to disk init go through a dialog to set all parameters -You may edit key values in the follow fashion: +You may edit key values in the follow fashion (the "o" is a literal +letter o): o conf build_cache 15 @@ -1182,29 +1212,29 @@ sub h { $CPAN::Frontend->myprint("Detailed help not yet implemented\n"); } else { $CPAN::Frontend->myprint(q{ -command arguments description -a string authors -b or display bundles -d /regex/ info distributions -m or about modules -i none anything of above - -r as reinstall recommendations -u above uninstalled distributions -See manpage for autobundle, recompile, force, look, etc. - -make make -test modules, make test (implies make) -install dists, bundles, make install (implies test) -clean "r" or "u" make clean -readme display the README file - -reload index|cpan load most recent indices/CPAN.pm -h or ? display this menu -o various set and query options -! perl-code eval a perl command -q quit the shell subroutine -}); +Display Information + a authors + b string display bundles + d or info distributions + m /regex/ about modules + i or anything of above + r none reinstall recommendations + u uninstalled distributions + +Download, Test, Make, Install... + get download + make make (implies get) + test modules, make test (implies make) + install dists, bundles make install (implies test) + clean make clean + look open subshell in these dists' directories + readme display these dists' README files + +Other + h,? display this menu ! perl-code eval a perl command + o conf [opt] set and query options q quit the cpan shell + reload cpan load CPAN.pm again reload index load newer indices + autobundle Snapshot force cmd unconditionally do cmd}); } } @@ -1326,10 +1356,13 @@ sub o { } } } else { - $CPAN::Frontend->myprint("Valid options for debug are ". - join(", ",sort(keys %CPAN::DEBUG), 'all'). - qq{ or a number. Completion works on the options. }. - qq{Case is ignored.\n\n}); + my $raw = "Valid options for debug are ". + join(", ",sort(keys %CPAN::DEBUG), 'all'). + qq{ or a number. Completion works on the options. }. + qq{Case is ignored.}; + require Text::Wrap; + $CPAN::Frontend->myprint(Text::Wrap::fill("","",$raw)); + $CPAN::Frontend->myprint("\n\n"); } if ($CPAN::DEBUG) { $CPAN::Frontend->myprint("Options set for debugging:\n"); @@ -1595,21 +1628,34 @@ sub expand { my $class = "CPAN::$type"; my $obj; if (defined $regex) { - for $obj ( sort {$a->id cmp $b->id} $CPAN::META->all_objects($class)) { - push @m, $obj - if - $obj->id =~ /$regex/i - or + for $obj ( + sort + {$a->id cmp $b->id} + $CPAN::META->all_objects($class) + ) { + unless ($obj->id){ + # BUG, we got an empty object somewhere + CPAN->debug(sprintf( + "Empty id on obj[%s]%%[%s]", + $obj, + join(":", %$obj) + )) if $CPAN::DEBUG; + next; + } + push @m, $obj + if $obj->id =~ /$regex/i + or ( ( - $] < 5.00303 ### provide sort of compatibility with 5.003 + $] < 5.00303 ### provide sort of + ### compatibility with 5.003 || $obj->can('name') ) && $obj->name =~ /$regex/i ); - } + } } else { my($xarg) = $arg; if ( $type eq 'Bundle' ) { @@ -1703,6 +1749,15 @@ sub mydie { die "\n"; } +sub setup_output { + return if -t STDOUT; + my $odef = select STDERR; + $| = 1; + select STDOUT; + $| = 1; + select $odef; +} + #-> sub CPAN::Shell::rematein ; # RE-adme||MA-ke||TE-st||IN-stall sub rematein { @@ -1713,6 +1768,7 @@ sub rematein { $pragma = $meth; $meth = shift @some; } + setup_output(); CPAN->debug("pragma[$pragma]meth[$meth] some[@some]") if $CPAN::DEBUG; my($s,@s); foreach $s (@some) { @@ -1789,6 +1845,8 @@ sub install { shift->rematein('install',@_); } sub clean { shift->rematein('clean',@_); } #-> sub CPAN::Shell::look ; sub look { shift->rematein('look',@_); } +#-> sub CPAN::Shell::cvs_import ; +sub cvs_import { shift->rematein('cvs_import',@_); } package CPAN::FTP; @@ -1965,6 +2023,9 @@ sub localize { my $ret = $self->$method(\@host_seq,$file,$aslocal); if ($ret) { $Themethod = $level; + my $now = time; + # utime $now, $now, $aslocal; # too bad, if we do that, we + # might alter a local mirror $self->debug("level[$level]") if $CPAN::DEBUG; return $ret; } else { @@ -2045,6 +2106,9 @@ sub hosteasy { my $res = $Ua->mirror($url, $aslocal); if ($res->is_success) { $Thesite = $i; + my $now = time; + utime $now, $now, $aslocal; # download time is more + # important than upload time return $aslocal; } elsif ($url !~ /\.gz$/) { my $gzurl = "$url.gz"; @@ -2119,8 +2183,8 @@ sub hosthard { HOSTHARD: for $i (@$host_seq) { my $url = $CPAN::Config->{urllist}[$i] || $CPAN::Defaultsite; unless ($self->is_reachable($url)) { - $CPAN::Frontend->myprint("Skipping $url (not reachable)\n"); - next; + $CPAN::Frontend->myprint("Skipping $url (not reachable)\n"); + next; } $url .= "/" unless substr($url,-1) eq "/"; $url .= $file; @@ -2130,90 +2194,107 @@ sub hosthard { # if ($url =~ m|^ftp://(.*?)/(.*)/(.*)|) { # to if ($url =~ m|^([^:]+)://(.*?)/(.*)/(.*)|) { - # proto not yet used - ($proto,$host,$dir,$getfile) = ($1,$2,$3,$4); + # proto not yet used + ($proto,$host,$dir,$getfile) = ($1,$2,$3,$4); } else { - next HOSTHARD; # who said, we could ftp anything except ftp? + next HOSTHARD; # who said, we could ftp anything except ftp? } + $self->debug("localizing funkyftpwise[$url]") if $CPAN::DEBUG; my($f,$funkyftp); for $f ('lynx','ncftpget','ncftp') { - next unless exists $CPAN::Config->{$f}; - $funkyftp = $CPAN::Config->{$f}; - next unless defined $funkyftp; - next if $funkyftp =~ /^\s*$/; - my($want_compressed); - my $aslocal_uncompressed; - ($aslocal_uncompressed = $aslocal) =~ s/\.gz//; - my($source_switch) = ""; - $source_switch = " -source" if $funkyftp =~ /\blynx$/; - $source_switch = " -c" if $funkyftp =~ /\bncftp$/; - $CPAN::Frontend->myprint( - qq[ + next unless exists $CPAN::Config->{$f}; + $funkyftp = $CPAN::Config->{$f}; + next unless defined $funkyftp; + next if $funkyftp =~ /^\s*$/; + my($want_compressed); + my $aslocal_uncompressed; + ($aslocal_uncompressed = $aslocal) =~ s/\.gz//; + my($source_switch) = ""; + if ($f eq "lynx"){ + $source_switch = " -source"; + } elsif ($f eq "ncftp"){ + $source_switch = " -c"; + } + my($chdir) = ""; + my($stdout_redir) = " > $aslocal_uncompressed"; + if ($f eq "ncftpget"){ + $chdir = "cd $aslocal_dir && "; + $stdout_redir = ""; + } + $CPAN::Frontend->myprint( + qq[ Trying with "$funkyftp$source_switch" to get $url ]); - my($system) = "$funkyftp$source_switch '$url' $devnull > ". - "$aslocal_uncompressed"; + my($system) = + "$chdir$funkyftp$source_switch '$url' $devnull$stdout_redir"; + $self->debug("system[$system]") if $CPAN::DEBUG; + my($wstatus); + if (($wstatus = system($system)) == 0 + && + ($f eq "lynx" ? + -s $aslocal_uncompressed # lynx returns 0 on my + # system even if it fails + : 1 + ) + ) { + if (-s $aslocal) { + # Looks good + } elsif ($aslocal_uncompressed ne $aslocal) { + # test gzip integrity + if ( + CPAN::Tarzip->gtest($aslocal_uncompressed) + ) { + rename $aslocal_uncompressed, $aslocal; + } else { + CPAN::Tarzip->gzip($aslocal_uncompressed, + "$aslocal_uncompressed.gz"); + } + } + $Thesite = $i; + return $aslocal; + } elsif ($url !~ /\.gz$/) { + unlink $aslocal_uncompressed if + -f $aslocal_uncompressed && -s _ == 0; + my $gz = "$aslocal.gz"; + my $gzurl = "$url.gz"; + $CPAN::Frontend->myprint( + qq[ +Trying with "$funkyftp$source_switch" to get + $url.gz +]); + my($system) = "$funkyftp$source_switch '$url.gz' $devnull > ". + "$aslocal_uncompressed.gz"; $self->debug("system[$system]") if $CPAN::DEBUG; my($wstatus); if (($wstatus = system($system)) == 0 && - -s $aslocal_uncompressed # lynx returns 0 on my - # system even if it fails + -s "$aslocal_uncompressed.gz" ) { - if ($aslocal_uncompressed ne $aslocal) { - # test gzip integrity - if ( - CPAN::Tarzip->gtest($aslocal_uncompressed) - ) { - rename $aslocal_uncompressed, $aslocal; - } else { - CPAN::Tarzip->gzip($aslocal_uncompressed, - "$aslocal_uncompressed.gz"); - } - } - $Thesite = $i; - return $aslocal; - } elsif ($url !~ /\.gz$/) { - unlink $aslocal_uncompressed if - -f $aslocal_uncompressed && -s _ == 0; - my $gz = "$aslocal.gz"; - my $gzurl = "$url.gz"; - $CPAN::Frontend->myprint( - qq[ -Trying with "$funkyftp$source_switch" to get - $url.gz -]); - my($system) = "$funkyftp$source_switch '$url.gz' $devnull > ". - "$aslocal_uncompressed.gz"; - $self->debug("system[$system]") if $CPAN::DEBUG; - my($wstatus); - if (($wstatus = system($system)) == 0 - && - -s "$aslocal_uncompressed.gz" - ) { - # test gzip integrity - if (CPAN::Tarzip->gtest("$aslocal_uncompressed.gz")) { - CPAN::Tarzip->gunzip("$aslocal_uncompressed.gz", - $aslocal); - } else { - rename $aslocal_uncompressed, $aslocal; - } - $Thesite = $i; - return $aslocal; + # test gzip integrity + if (CPAN::Tarzip->gtest("$aslocal_uncompressed.gz")) { + CPAN::Tarzip->gunzip("$aslocal_uncompressed.gz", + $aslocal); } else { - unlink "$aslocal_uncompressed.gz" if - -f "$aslocal_uncompressed.gz"; + rename $aslocal_uncompressed, $aslocal; } + $Thesite = $i; + return $aslocal; } else { - my $estatus = $wstatus >> 8; - my $size = -f $aslocal ? ", left\n$aslocal with size ".-s _ : ""; - $CPAN::Frontend->myprint(qq{ + unlink "$aslocal_uncompressed.gz" if + -f "$aslocal_uncompressed.gz"; + } + } else { + my $estatus = $wstatus >> 8; + my $size = -f $aslocal ? + ", left\n$aslocal with size ".-s _ : + "\nWarning: expected file [$aslocal] doesn't exist"; + $CPAN::Frontend->myprint(qq{ System call "$system" returned status $estatus (wstat $wstatus)$size }); - } + } } } } @@ -2241,12 +2322,12 @@ sub hosthardest { next; } my($host,$dir,$getfile) = ($1,$2,$3); - my($netrcfile,$fh); my $timestamp = 0; my($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime, $ctime,$blksize,$blocks) = stat($aslocal); $timestamp = $mtime ||= 0; my($netrc) = CPAN::FTP::netrc->new; + my($netrcfile) = $netrc->netrc; my($verbose) = $CPAN::DEBUG{'FTP'} & $CPAN::DEBUG ? " -v" : ""; my $targetfile = File::Basename::basename($aslocal); my(@dialog); @@ -2259,7 +2340,7 @@ sub hosthardest { "get $getfile $targetfile", "quit" ); - if (! $netrc->netrc) { + if (! $netrcfile) { CPAN->debug("No ~/.netrc file found") if $CPAN::DEBUG; } elsif ($netrc->hasdefault || $netrc->contains($host)) { CPAN->debug(sprintf("hasdef[%d]cont($host)[%d]", @@ -2496,10 +2577,10 @@ sub cpl { /^$word/, sort qw( ! a b d h i m o q r u autobundle clean - make test install force reload look + make test install force reload look cvs_import ) ); - } elsif ( $line !~ /^[\!abdhimorutl]/ ) { + } elsif ( $line !~ /^[\!abcdhimorutl]/ ) { @return = (); } elsif ($line =~ /^a\s/) { @return = cplx('CPAN::Author',$word); @@ -2507,7 +2588,7 @@ sub cpl { @return = cplx('CPAN::Bundle',$word); } elsif ($line =~ /^d\s/) { @return = cplx('CPAN::Distribution',$word); - } elsif ($line =~ /^([mru]|make|clean|test|install|readme|look)\s/ ) { + } elsif ($line =~ /^([mru]|make|clean|test|install|readme|look|cvs_import)\s/ ) { @return = (cplx('CPAN::Module',$word),cplx('CPAN::Bundle',$word)); } elsif ($line =~ /^i\s/) { @return = cpl_any($word); @@ -2589,6 +2670,11 @@ sub reload { } return if $last_time + $CPAN::Config->{index_expire}*86400 > $time and ! $force; + ## IFF we are developing, it helps to wipe out the memory between + ## reloads, otherwise it is not what a user expects. + + ## undef $CPAN::META; # Neue Gruendlichkeit since v1.52(r1.274) + ## $CPAN::META = CPAN->new; my($debug,$t2); $last_time = $time; @@ -2708,7 +2794,7 @@ sub rd_modpacks { my($mod,$version,$dist) = split; ### $version =~ s/^\+//; - # if it is a bundle, instatiate a bundle object + # if it is a bundle, instantiate a bundle object my($bundle,$id,$userid); if ($mod eq 'CPAN' && @@ -2721,6 +2807,7 @@ sub rd_modpacks { if ($version > $CPAN::VERSION){ $CPAN::Frontend->myprint(qq{ There\'s a new CPAN.pm version (v$version) available! + [Current version is v$CPAN::VERSION] You might want to try install Bundle::CPAN reload cpan @@ -2764,12 +2851,20 @@ sub rd_modpacks { } # instantiate a distribution object - unless ($CPAN::META->exists('CPAN::Distribution',$dist)) { - $CPAN::META->instance( - 'CPAN::Distribution' => $dist - )->set( - 'CPAN_USERID' => $userid - ); + if ($CPAN::META->exists('CPAN::Distribution',$dist)) { + # we do not need CONTAINSMODS unless we do something with + # this dist, so we better produce it on demand. + + ## my $obj = $CPAN::META->instance( + ## 'CPAN::Distribution' => $dist + ## ); + ## $obj->{CONTAINSMODS}{$mod} = undef; # experimental + } else { + $CPAN::META->instance( + 'CPAN::Distribution' => $dist + )->set( + 'CPAN_USERID' => $userid + ); } return if $CPAN::Signal; @@ -2862,9 +2957,15 @@ sub as_string { $extra .= ")"; } if (ref($self->{$_}) eq "ARRAY") { # language interface? XXX - push @m, sprintf " %-12s %s%s\n", $_, "@{$self->{$_}}", $extra; + push @m, sprintf " %-12s %s%s\n", $_, "@{$self->{$_}}", $extra; + } elsif (ref($self->{$_}) eq "HASH") { + push @m, sprintf( + " %-12s %s%s\n", + $_, + join(" ",keys %{$self->{$_}}), + $extra); } else { - push @m, sprintf " %-12s %s%s\n", $_, $self->{$_}, $extra; + push @m, sprintf " %-12s %s%s\n", $_, $self->{$_}, $extra; } } join "", @m, "\n"; @@ -2909,6 +3010,25 @@ sub email { shift->{'EMAIL'} } package CPAN::Distribution; +#-> sub CPAN::Distribution::as_string ; +sub as_string { + my $self = shift; + $self->containsmods; + $self->SUPER::as_string(@_); +} + +#-> sub CPAN::Distribution::containsmods ; +sub containsmods { + my $self = shift; + return if exists $self->{CONTAINSMODS}; + for my $mod ($CPAN::META->all_objects("CPAN::Module")) { + my $mod_file = $mod->{CPAN_FILE} or next; + my $dist_id = $self->{ID} or next; + my $mod_id = $mod->{ID} or next; + $self->{CONTAINSMODS}{$mod_id} = undef if $mod_file eq $dist_id; + } +} + #-> sub CPAN::Distribution::called_for ; sub called_for { my($self,$id) = @_; @@ -3114,6 +3234,44 @@ Please define it with "o conf shell <your shell>" chdir($pwd); } +sub cvs_import { + my($self) = @_; + $self->get; + my $dir = $self->dir; + + my $package = $self->called_for; + my $module = $CPAN::META->instance('CPAN::Module', $package); + my $version = $module->cpan_version; + + my $userid = $self->{CPAN_USERID}; + + my $cvs_dir = (split '/', $dir)[-1]; + $cvs_dir =~ s/-\d+[^-]+$//; + my $cvs_root = + $CPAN::Config->{cvsroot} || $ENV{CVSROOT}; + my $cvs_site_perl = + $CPAN::Config->{cvs_site_perl} || $ENV{CVS_SITE_PERL}; + if ($cvs_site_perl) { + $cvs_dir = "$cvs_site_perl/$cvs_dir"; + } + my $cvs_log = qq{"imported $package $version sources"}; + $version =~ s/\./_/g; + my @cmd = ('cvs', '-d', $cvs_root, 'import', '-m', $cvs_log, + "$cvs_dir", $userid, "v$version"); + + my $getcwd; + $getcwd = $CPAN::Config->{'getcwd'} || 'cwd'; + my $pwd = CPAN->$getcwd(); + chdir($dir); + + $CPAN::Frontend->myprint(qq{Working directory is $dir\n}); + + $CPAN::Frontend->myprint(qq{@cmd\n}); + system(@cmd) == 0 or + $CPAN::Frontend->mydie("cvs import failed"); + chdir($pwd); +} + #-> sub CPAN::Distribution::readme ; sub readme { my($self) = @_; @@ -3325,8 +3483,7 @@ sub perl { $perl ||= $candidate if MM->maybe_command($candidate); unless ($perl) { my ($component,$perl_name); - DIST_PERLNAME: - foreach $perl_name ($^X, 'perl', 'perl5', "perl$Config::Config{version}") { + DIST_PERLNAME: foreach $perl_name ($^X, 'perl', 'perl5', "perl$]") { PATH_COMPONENT: foreach $component (MM->path(), $Config::Config{'binexp'}) { next unless defined($component) && $component; @@ -3706,13 +3863,14 @@ sub contains { my $fh = FileHandle->new; local $/ = "\n"; open($fh,$parsefile) or die "Could not open '$parsefile': $!"; - my $inpod = 0; + my $in_cont = 0; $self->debug("parsefile[$parsefile]") if $CPAN::DEBUG; while (<$fh>) { - $inpod = m/^=(?!head1\s+CONTENTS)/ ? 0 : - m/^=head1\s+CONTENTS/ ? 1 : $inpod; - next unless $inpod; + $in_cont = m/^=(?!head1\s+CONTENTS)/ ? 0 : + m/^=head1\s+CONTENTS/ ? 1 : $in_cont; + next unless $in_cont; next if /^=/; + s/\#.*//; next if /^\s+$/; chomp; push @result, (split " ", $_, 2)[0]; @@ -3758,7 +3916,7 @@ sub find_bundle_file { $what2 =~ s/:Bundle://; $what2 =~ tr|:|/|; } else { - $what2 =~ s|Bundle/||; + $what2 =~ s|Bundle[/\\]||; } my $bu; while (<$fh>) { @@ -3824,13 +3982,19 @@ explicitly a file $s. # recap with less noise if ( $meth eq "install") { if (%fail) { - $CPAN::Frontend->myprint(qq{\nBundle summary: }. - qq{The following items seem to }. - qq{have had installation problems:\n}); + require Text::Wrap; + my $raw = sprintf(qq{Bundle summary: +The following items in bundle %s had installation problems:}, + $self->id + ); + $CPAN::Frontend->myprint(Text::Wrap::fill("","",$raw)); + $CPAN::Frontend->myprint("\n"); + my $paragraph = ""; for $s ($self->contains) { - $CPAN::Frontend->myprint( "$s " ) if $fail{$s}; + $paragraph .= "$s " if $fail{$s}; } - $CPAN::Frontend->myprint(qq{\n}); + $CPAN::Frontend->myprint(Text::Wrap::fill(" "," ",$paragraph)); + $CPAN::Frontend->myprint("\n"); } else { $self->{'install'} = 'YES'; } @@ -4060,6 +4224,8 @@ sub rematein { sub readme { shift->rematein('readme') } #-> sub CPAN::Module::look ; sub look { shift->rematein('look') } +#-> sub CPAN::Module::cvs_import ; +sub cvs_import { shift->rematein('cvs_import') } #-> sub CPAN::Module::get ; sub get { shift->rematein('get',@_); } #-> sub CPAN::Module::make ; @@ -4140,7 +4306,7 @@ sub inst_version { local($^W) = 0 if $] < 5.00303 && $ExtUtils::MakeMaker::VERSION < 5.38; # warn "HERE"; my $have = MM->parse_version($parsefile) || "undef"; - $have =~ s/\s+//g; + $have =~ s/\s*//g; # stringify to float around floating point issues $have; } @@ -4251,7 +4417,7 @@ sub DESTROY { $gz->gzclose(); } else { my $fh = $self->{FH}; - $fh->close; + $fh->close if defined $fh; } undef $self; } @@ -4262,29 +4428,30 @@ sub untar { if (MM->maybe_command($CPAN::Config->{'gzip'}) && MM->maybe_command($CPAN::Config->{'tar'})) { - if ($^O =~ /win/i) { # irgggh - # people find the most curious tar binaries that cannot handle - # pipes - my $system = "$CPAN::Config->{'gzip'} --decompress $file"; - if (system($system)==0) { - $CPAN::Frontend->myprint(qq{Uncompressed $file successfully\n}); - } else { - $CPAN::Frontend->mydie( - qq{Couldn\'t uncompress $file\n} - ); - } - $file =~ s/\.gz$//; - $system = "$CPAN::Config->{tar} xvf $file"; - if (system($system)==0) { - $CPAN::Frontend->myprint(qq{Untarred $file successfully\n}); - } else { - $CPAN::Frontend->mydie(qq{Couldn\'t untar $file\n}); - } - return 1; + my $system = "$CPAN::Config->{'gzip'} --decompress --stdout " . + "< $file | $CPAN::Config->{tar} xvf -"; + if (system($system) != 0) { + # people find the most curious tar binaries that cannot handle + # pipes + my $system = "$CPAN::Config->{'gzip'} --decompress $file"; + if (system($system)==0) { + $CPAN::Frontend->myprint(qq{Uncompressed $file successfully\n}); + } else { + $CPAN::Frontend->mydie( + qq{Couldn\'t uncompress $file\n} + ); + } + $file =~ s/\.gz$//; + $system = "$CPAN::Config->{tar} xvf $file"; + $CPAN::Frontend->myprint(qq{Using Tar:$system:\n}); + if (system($system)==0) { + $CPAN::Frontend->myprint(qq{Untarred $file successfully\n}); + } else { + $CPAN::Frontend->mydie(qq{Couldn\'t untar $file\n}); + } + return 1; } else { - my $system = "$CPAN::Config->{'gzip'} --decompress --stdout " . - "< $file | $CPAN::Config->{tar} xvf -"; - return system($system) == 0; + return 1; } } elsif ($CPAN::META->has_inst("Archive::Tar") && @@ -4340,8 +4507,8 @@ Modules are fetched from one or more of the mirrored CPAN directory. The CPAN module also supports the concept of named and versioned -'bundles' of modules. Bundles simplify the handling of sets of -related modules. See BUNDLES below. +I<bundles> of modules. Bundles simplify the handling of sets of +related modules. See Bundles below. The package contains a session manager and a cache manager. There is no status retained between sessions. The session manager keeps track @@ -4392,29 +4559,14 @@ objects. The parser recognizes a regular expression only if you enclose it between two slashes. The principle is that the number of found objects influences how an -item is displayed. If the search finds one item, the result is displayed -as object-E<gt>as_string, but if we find more than one, we display -each as object-E<gt>as_glimpse. E.g. - - cpan> a ANDK - Author id = ANDK - EMAIL a.koenig@franz.ww.TU-Berlin.DE - FULLNAME Andreas König - - - cpan> a /andk/ - Author id = ANDK - EMAIL a.koenig@franz.ww.TU-Berlin.DE - FULLNAME Andreas König - - - cpan> a /and.*rt/ - Author ANDYD (Andy Dougherty) - Author MERLYN (Randal L. Schwartz) +item is displayed. If the search finds one item, the result is +displayed with the rather verbose method C<as_string>, but if we find +more than one, we display each object with the terse method +<as_glimpse>. =item make, test, install, clean modules or distributions -These commands take any number of arguments and investigates what is +These commands take any number of arguments and investigate what is necessary to perform the action. If the argument is a distribution file name (recognized by embedded slashes), it is processed. If it is a module, CPAN determines the distribution file in which this module @@ -4456,12 +4608,11 @@ A C<clean> command results in a being executed within the distribution file's working directory. -=item readme, look module or distribution +=item get, readme, look module or distribution -These two commands take only one argument, be it a module or a -distribution file. C<readme> unconditionally runs, displaying the -README of the associated distribution file. C<Look> gets and -untars (if not yet done) the distribution file, changes to the +C<get> downloads a distribution file without further action. C<readme> +displays the README file of the associated distribution. C<Look> gets +and untars (if not yet done) the distribution file, changes to the appropriate directory and opens a subshell process in that directory. =item Signals @@ -4796,24 +4947,24 @@ shell with the command set defined within the C<o conf> command: =over 2 -=item o conf E<lt>scalar optionE<gt> +=item C<o conf E<lt>scalar optionE<gt>> prints the current value of the I<scalar option> -=item o conf E<lt>scalar optionE<gt> E<lt>valueE<gt> +=item C<o conf E<lt>scalar optionE<gt> E<lt>valueE<gt>> Sets the value of the I<scalar option> to I<value> -=item o conf E<lt>list optionE<gt> +=item C<o conf E<lt>list optionE<gt>> prints the current value of the I<list option> in MakeMaker's neatvalue format. -=item o conf E<lt>list optionE<gt> [shift|pop] +=item C<o conf E<lt>list optionE<gt> [shift|pop]> shifts or pops the array in the I<list option> variable -=item o conf E<lt>list optionE<gt> [unshift|push|splice] E<lt>listE<gt> +=item C<o conf E<lt>list optionE<gt> [unshift|push|splice] E<lt>listE<gt>> works like the corresponding perl commands. @@ -4916,10 +5067,10 @@ ftp) you will need to use LWP. =item ftp firewall -This where the firewall machine runs a ftp server. This kind of firewall will -only let you access ftp serves outside the firewall. This is usually done by -connecting to the firewall with ftp, then entering a username like -"user@outside.host.com" +This where the firewall machine runs a ftp server. This kind of +firewall will only let you access ftp servers outside the firewall. +This is usually done by connecting to the firewall with ftp, then +entering a username like "user@outside.host.com" To access servers outside these type of firewalls with perl you will need to use Net::FTP. @@ -4971,7 +5122,7 @@ traditional method of building a Perl module package from a shell. =head1 AUTHOR -Andreas König E<lt>a.koenig@kulturbox.deE<gt> +Andreas Koenig E<lt>andreas.koenig@anima.deE<gt> =head1 SEE ALSO diff --git a/lib/CPAN/FirstTime.pm b/lib/CPAN/FirstTime.pm index 289984956c..0e795da4fb 100644 --- a/lib/CPAN/FirstTime.pm +++ b/lib/CPAN/FirstTime.pm @@ -16,7 +16,7 @@ use FileHandle (); use File::Basename (); use File::Path (); use vars qw($VERSION); -$VERSION = substr q$Revision: 1.37 $, 10; +$VERSION = substr q$Revision: 1.38 $, 10; =head1 NAME @@ -360,17 +360,19 @@ sub conf_sites { require File::Copy; File::Copy::copy($m,$mby) or die "Could not update $mby: $!"; } + my $loopcount = 0; while () { if ( ! -f $mby ){ print qq{You have no $mby I\'m trying to fetch one }; $mby = CPAN::FTP->localize($m,$mby,3); - } elsif (-M $mby > 30 ) { - print qq{Your $mby is older than 30 days, + } elsif (-M $mby > 60 && $loopcount == 0) { + print qq{Your $mby is older than 60 days, I\'m trying to fetch one }; $mby = CPAN::FTP->localize($m,$mby,3); + $loopcount++; } elsif (-s $mby == 0) { print qq{You have an empty $mby, I\'m trying to fetch one diff --git a/lib/CPAN/Nox.pm b/lib/CPAN/Nox.pm index e9cb189f29..8b59ca07a1 100644 --- a/lib/CPAN/Nox.pm +++ b/lib/CPAN/Nox.pm @@ -1,7 +1,12 @@ package CPAN::Nox; +use strict; +use vars qw($VERSION @EXPORT); -BEGIN{$CPAN::Suppress_readline=1 unless defined $CPAN::term;} +BEGIN{ + $CPAN::Suppress_readline=1 unless defined $CPAN::term; +} +use base 'Exporter'; use CPAN; $VERSION = "1.00"; @@ -12,6 +17,8 @@ $CPAN::META->has_inst('Compress::Zlib','no'); *AUTOLOAD = \&CPAN::AUTOLOAD; +__END__ + =head1 NAME CPAN::Nox - Wrapper around CPAN.pm without using any XS module diff --git a/lib/Carp/Heavy.pm b/lib/Carp/Heavy.pm index 161e7fbe73..553a0edfcb 100644 --- a/lib/Carp/Heavy.pm +++ b/lib/Carp/Heavy.pm @@ -87,7 +87,7 @@ sub longmess_heavy { # set args to the string "undef" if undefined $_ = "undef", next unless defined $_; if (ref $_) { - # dunno what this is for... + # force reference to string representation $_ .= ''; s/'/\\'/g; } @@ -128,6 +128,30 @@ sub longmess_heavy { } +# ancestors() returns the complete set of ancestors of a module + +sub ancestors($$); + +sub ancestors($$){ + my( $pack, $href ) = @_; + if( @{"${pack}::ISA"} ){ + my $risa = \@{"${pack}::ISA"}; + my %tree = (); + @tree{@$risa} = (); + foreach my $mod ( @$risa ){ + # visit ancestors - if not already in the gallery + if( ! defined( $$href{$mod} ) ){ + my @ancs = ancestors( $mod, $href ); + @tree{@ancs} = (); + } + } + return ( keys( %tree ) ); + } else { + return (); + } +} + + # shortmess() is called by carp() and croak() to skip all the way up to # the top-level caller's package and report the error from there. confess() # and cluck() generate a full stack trace so they call longmess() to @@ -140,6 +164,8 @@ sub shortmess_heavy { # Short-circuit &longmess if called via multiple packages my $error = join '', @_; my ($prevpack) = caller(1); my $extra = $CarpLevel; + + my @Clans = ( $prevpack ); my $i = 2; my ($pack,$file,$line); # when reporting an error, we want to report it from the context of the @@ -150,33 +176,45 @@ sub shortmess_heavy { # Short-circuit &longmess if called via multiple packages # track of all the packages to which the calling package belongs. We # do this by examining its @ISA variable. Any call from a base class # method (one of our caller's @ISA packages) can be ignored - my %isa = ($prevpack,1); + my %isa; - # merge all the caller's @ISA packages into %isa. - @isa{@{"${prevpack}::ISA"}} = () - if(@{"${prevpack}::ISA"}); + # merge all the caller's @ISA packages and ancestors into %isa. + my @pars = ancestors( $prevpack, \%isa ); + @isa{@pars} = () if @pars; + $isa{$prevpack} = 1; # now we crawl up the calling stack and look at all the packages in # there. For each package, we look to see if it has an @ISA and then # we see if our caller features in that list. That would imply that # our caller is a derived class of that package and its calls can also # be ignored +CALLER: while (($pack,$file,$line) = caller($i++)) { - if(@{$pack . "::ISA"}) { - my @i = @{$pack . "::ISA"}; - my %i; - @i{@i} = (); - # merge any relevant packages into %isa - @isa{@i,$pack} = () - if(exists $i{$prevpack} || exists $isa{$pack}); - } - # and here's where we do the ignoring... if the package in - # question is one of our caller's base or derived packages then - # we can ignore it (skip it) and go onto the next (but note that - # the continue { } block below gets called every time) - next - if(exists $isa{$pack}); + # Chances are, the caller's caller (or its caller...) is already + # in the gallery - if so, ignore this caller. + next if exists( $isa{$pack} ); + + # no: collect this module's ancestors. + my @i = ancestors( $pack, \%isa ); + my %i; + if( @i ){ + @i{@i} = (); + # check whether our representative of one of the clans is + # in this family tree. + foreach my $cl (@Clans){ + if( exists( $i{$cl} ) ){ + # yes: merge all of the family tree into %isa + @isa{@i,$pack} = (); + # and here's where we do some more ignoring... + # if the package in question is one of our caller's + # base or derived packages then we can ignore it (skip it) + # and go onto the next. + next CALLER if exists( $isa{$pack} ); + last; + } + } + } # Hey! We've found a package that isn't one of our caller's # clan....but wait, $extra refers to the number of 'extra' levels @@ -184,9 +222,8 @@ sub shortmess_heavy { # Short-circuit &longmess if called via multiple packages # We must merge the package into the %isa hash (so we can ignore it # if it pops up again), decrement $extra, and continue. if ($extra-- > 0) { - %isa = ($pack,1); - @isa{@{$pack . "::ISA"}} = () - if(@{$pack . "::ISA"}); + push( @Clans, $pack ); + @isa{@i,$pack} = (); } else { # OK! We've got a candidate package. Time to construct the @@ -204,9 +241,6 @@ sub shortmess_heavy { # Short-circuit &longmess if called via multiple packages return $msg; } } - continue { - $prevpack = $pack; - } # uh-oh! It looks like we crawled all the way up the stack and # never found a candidate package. Oh well, let's call longmess diff --git a/lib/Class/Struct.pm b/lib/Class/Struct.pm index 3e08e801d0..b4f2117557 100644 --- a/lib/Class/Struct.pm +++ b/lib/Class/Struct.pm @@ -2,10 +2,10 @@ package Class::Struct; ## See POD after __END__ -require 5.002; +use 5.005_64; use strict; -use vars qw(@ISA @EXPORT $VERSION); +our(@ISA, @EXPORT, $VERSION); use Carp; @@ -355,7 +355,7 @@ The element is an array, initialized by default to C<()>. With no argument, the accessor returns a reference to the element's whole array (whether or not the element was -specified as C<'@'> or C<'*@'). +specified as C<'@'> or C<'*@'>). With one or two arguments, the first argument is an index specifying one element of the array; the second argument, if @@ -370,7 +370,7 @@ The element is a hash, initialized by default to C<()>. With no argument, the accessor returns a reference to the element's whole hash (whether or not the element was -specified as C<'%'> or C<'*%'). +specified as C<'%'> or C<'*%'>). With one or two arguments, the first argument is a key specifying one element of the hash; the second argument, if present, is @@ -520,6 +520,7 @@ struct's constructor. print "(which was a ", $cat->breed->name, ")\n"; print "had two kittens: ", join(' and ', @{$cat->kittens}), "\n"; +=back =head1 Author and Modification History diff --git a/lib/Cwd.pm b/lib/Cwd.pm index ee1bc28367..e3c45903c3 100644 --- a/lib/Cwd.pm +++ b/lib/Cwd.pm @@ -20,7 +20,7 @@ getcwd - get pathname of current working directory chdir "/tmp"; print $ENV{'PWD'}; - use Cwd 'abs_path'; + use Cwd 'abs_path'; # aka realpath() print abs_path($ENV{'PWD'}); use Cwd 'fast_abs_path'; @@ -32,8 +32,11 @@ The getcwd() function re-implements the getcwd(3) (or getwd(3)) functions in Perl. The abs_path() function takes a single argument and returns the -absolute pathname for that argument. It uses the same algorithm as -getcwd(). (actually getcwd() is abs_path(".")) +absolute pathname for that argument. It uses the same algorithm +as getcwd(). (Actually, getcwd() is abs_path(".")) Symbolic links +and relative-path components ("." and "..") are resolved to return +the canonical pathname, just like realpath(3). Also callable as +realpath(). The fastcwd() function looks the same as getcwd(), but runs faster. It's also more dangerous because it might conceivably chdir() you out @@ -67,12 +70,12 @@ kept up to date if all packages which use chdir import it from Cwd. use Carp; -$VERSION = '2.01'; +$VERSION = '2.02'; require Exporter; @ISA = qw(Exporter); @EXPORT = qw(cwd getcwd fastcwd fastgetcwd); -@EXPORT_OK = qw(chdir abs_path fast_abs_path); +@EXPORT_OK = qw(chdir abs_path fast_abs_path realpath fast_realpath); # The 'natural and safe form' for UNIX (pwd may be setuid root) @@ -257,6 +260,10 @@ sub abs_path $cwd; } +# added function alias for those of us more +# used to the libc function. --tchrist 27-Jan-00 +*realpath = \&abs_path; + sub fast_abs_path { my $cwd = getcwd(); my $path = shift || '.'; @@ -266,6 +273,10 @@ sub fast_abs_path { $realpath; } +# added function alias to follow principle of least surprise +# based on previous aliasing. --tchrist 27-Jan-00 +*fast_realpath = \&fast_abs_path; + # --- PORTING SECTION --- @@ -331,7 +342,7 @@ sub _qnx_abs_path { } { - local $^W = 0; # assignments trigger 'subroutine redefined' warning + no warnings; # assignments trigger 'subroutine redefined' warning if ($^O eq 'VMS') { *cwd = \&_vms_cwd; diff --git a/lib/Dumpvalue.pm b/lib/Dumpvalue.pm index 18a40eeb1f..94b6aa6e78 100644 --- a/lib/Dumpvalue.pm +++ b/lib/Dumpvalue.pm @@ -1,7 +1,7 @@ -require 5.005; # For (defined ref) and $#$v +use 5.005_64; # for (defined ref) and $#$v and our package Dumpvalue; use strict; -use vars qw(%address *stab %subs); +our(%address, $stab, @stab, %stab, %subs); # translate control chars to ^X - Randal Schwartz # Modifications to print types by Peter Gordon v1.0 @@ -347,16 +347,30 @@ sub dumpglob { } } +sub CvGV_name { + my $self = shift; + my $in = shift; + return if $self->{skipCvGV}; # Backdoor to avoid problems if XS broken... + $in = \&$in; # Hard reference... + eval {require Devel::Peek; 1} or return; + my $gv = Devel::Peek::CvGV($in) or return; + *$gv{PACKAGE} . '::' . *$gv{NAME}; +} + sub dumpsub { my $self = shift; my ($off,$sub) = @_; + my $ini = $sub; + my $s; $sub = $1 if $sub =~ /^\{\*(.*)\}$/; - my $subref = \&$sub; - my $place = $DB::sub{$sub} || (($sub = $subs{"$subref"}) && $DB::sub{$sub}) - || ($self->{subdump} && ($sub = $self->findsubs("$subref")) - && $DB::sub{$sub}); + my $subref = defined $1 ? \&$sub : \&$ini; + my $place = $DB::sub{$sub} || (($s = $subs{"$subref"}) && $DB::sub{$s}) + || (($s = $self->CvGV_name($subref)) && $DB::sub{$s}) + || ($self->{subdump} && ($s = $self->findsubs("$subref")) + && $DB::sub{$s}); + $s = $sub unless defined $s; $place = '???' unless defined $place; - print( (' ' x $off) . "&$sub in $place\n" ); + print( (' ' x $off) . "&$s in $place\n" ); } sub findsubs { diff --git a/lib/English.pm b/lib/English.pm index 9f29a487dc..4e3210b12c 100644 --- a/lib/English.pm +++ b/lib/English.pm @@ -15,14 +15,6 @@ English - use nice English (or awk) names for ugly punctuation variables =head1 DESCRIPTION -You should I<not> use this module in programs intended to be portable -among Perl versions, programs that must perform regular expression -matching operations efficiently, or libraries intended for use with -such programs. In a sense, this module is deprecated. The reasons -for this have to do with implementation details of the Perl -interpreter which are too thorny to go into here. Perhaps someday -they will be fixed to make "C<use English>" more practical. - This module provides aliases for the built-in variables whose names no one seems to like to read. Variables with side-effects which get triggered just by accessing them (like $0) will still @@ -35,9 +27,15 @@ $INPUT_RECORD_SEPARATOR if you are using the English module. See L<perlvar> for a complete list of these. +=head1 BUGS + +This module provokes sizeable inefficiencies for regular expressions, +due to unfortunate implementation details. If performance matters, +consider avoiding English. + =cut -local $^W = 0; +no warnings; # Grandfather $NAME import sub import { @@ -89,6 +87,7 @@ sub import { *EGID *PROGRAM_NAME *PERL_VERSION + *PERL_VERSION_TUPLE *ACCUMULATOR *DEBUGGING *SYSTEM_FD_MAX @@ -167,6 +166,7 @@ sub import { # Internals. *PERL_VERSION = *] ; + *PERL_VERSION_TUPLE = *^V ; *ACCUMULATOR = *^A ; *COMPILING = *^C ; *DEBUGGING = *^D ; diff --git a/lib/ExtUtils/Command.pm b/lib/ExtUtils/Command.pm index e900e51ffa..bccc76cc19 100644 --- a/lib/ExtUtils/Command.pm +++ b/lib/ExtUtils/Command.pm @@ -1,4 +1,6 @@ package ExtUtils::Command; + +use 5.005_64; use strict; # use AutoLoader; use Carp; @@ -7,7 +9,7 @@ use File::Compare; use File::Basename; use File::Path qw(rmtree); require Exporter; -use vars qw(@ISA @EXPORT $VERSION); +our(@ISA, @EXPORT, $VERSION); @ISA = qw(Exporter); @EXPORT = qw(cp rm_f rm_rf mv cat eqtime mkpath touch test_f); $VERSION = '1.01'; diff --git a/lib/ExtUtils/Install.pm b/lib/ExtUtils/Install.pm index d6b1375fb6..3c183a3174 100644 --- a/lib/ExtUtils/Install.pm +++ b/lib/ExtUtils/Install.pm @@ -1,12 +1,13 @@ package ExtUtils::Install; +use 5.005_64; +our(@ISA, @EXPORT, $VERSION); $VERSION = substr q$Revision: 1.28 $, 10; # $Date: 1998/01/25 07:08:24 $ use Exporter; use Carp (); use Config qw(%Config); -use vars qw(@ISA @EXPORT $VERSION); @ISA = ('Exporter'); @EXPORT = ('install','uninstall','pm_to_blib', 'install_default'); $Is_VMS = $^O eq 'VMS'; @@ -15,7 +16,7 @@ my $splitchar = $^O eq 'VMS' ? '|' : ($^O eq 'os2' || $^O eq 'dos') ? ';' : ':'; my @PERL_ENV_LIB = split $splitchar, defined $ENV{'PERL5LIB'} ? $ENV{'PERL5LIB'} : $ENV{'PERLLIB'} || ''; my $Inc_uninstall_warn_handler; -#use vars qw( @EXPORT @ISA $Is_VMS ); +#our(@EXPORT, @ISA, $Is_VMS); #use strict; sub forceunlink { diff --git a/lib/ExtUtils/Installed.pm b/lib/ExtUtils/Installed.pm index 41f3c9b3b8..da4a6536a0 100644 --- a/lib/ExtUtils/Installed.pm +++ b/lib/ExtUtils/Installed.pm @@ -1,4 +1,6 @@ package ExtUtils::Installed; + +use 5.005_64; use strict; use Carp qw(); use ExtUtils::Packlist; @@ -6,8 +8,7 @@ use ExtUtils::MakeMaker; use Config; use File::Find; use File::Basename; -use vars qw($VERSION); -$VERSION = '0.02'; +our $VERSION = '0.02'; sub _is_type($$$) { diff --git a/lib/ExtUtils/Liblist.pm b/lib/ExtUtils/Liblist.pm index b992ec0116..c858236593 100644 --- a/lib/ExtUtils/Liblist.pm +++ b/lib/ExtUtils/Liblist.pm @@ -1,8 +1,9 @@ package ExtUtils::Liblist; -use vars qw($VERSION); + +use 5.005_64; # Broken out of MakeMaker from version 4.11 -$VERSION = substr q$Revision: 1.25 $, 10; +our $VERSION = substr q$Revision: 1.25 $, 10; use Config; use Cwd 'cwd'; diff --git a/lib/ExtUtils/MM_Cygwin.pm b/lib/ExtUtils/MM_Cygwin.pm index 7a92290664..a5ba410fdc 100644 --- a/lib/ExtUtils/MM_Cygwin.pm +++ b/lib/ExtUtils/MM_Cygwin.pm @@ -24,7 +24,6 @@ sub cflags { / *= */ and $self->{$`} = $'; }; $self->{CCFLAGS} .= " -DUSEIMPORTLIB" if ($Config{useshrplib} eq 'true'); - $self->{CCFLAGS} .= " -DCYGWIN" unless ($self->{CCFLAGS} =~ /\-DCYGWIN/); return $self->{CFLAGS} = qq{ CCFLAGS = $self->{CCFLAGS} diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm index f4329e13d7..c5cf7066bf 100644 --- a/lib/ExtUtils/MM_Unix.pm +++ b/lib/ExtUtils/MM_Unix.pm @@ -2766,7 +2766,7 @@ sub parse_version { $_ }; \$$2 }; - local($^W) = 0; + no warnings; $result = eval($eval); warn "Could not eval '$eval' in $parsefile: $@" if $@; $result = "undef" unless defined $result; diff --git a/lib/ExtUtils/MM_VMS.pm b/lib/ExtUtils/MM_VMS.pm index f3de323e53..5eccf78b8e 100644 --- a/lib/ExtUtils/MM_VMS.pm +++ b/lib/ExtUtils/MM_VMS.pm @@ -13,7 +13,7 @@ require Exporter; use VMS::Filespec; use File::Basename; use File::Spec; -use vars qw($Revision @ISA); +our($Revision, @ISA); $Revision = '5.56 (27-Apr-1999)'; @ISA = qw( File::Spec ); diff --git a/lib/ExtUtils/MM_Win32.pm b/lib/ExtUtils/MM_Win32.pm index 534f26d823..e08c6791ee 100644 --- a/lib/ExtUtils/MM_Win32.pm +++ b/lib/ExtUtils/MM_Win32.pm @@ -388,7 +388,6 @@ PM_TO_BLIB = }.join(" \\\n\t", %{$self->{PM}}).q{ sub path { - local $^W = 1; my($self) = @_; my $path = $ENV{'PATH'} || $ENV{'Path'} || $ENV{'path'}; my @path = split(';',$path); diff --git a/lib/ExtUtils/MakeMaker.pm b/lib/ExtUtils/MakeMaker.pm index 0426575f87..c4b75539bf 100644 --- a/lib/ExtUtils/MakeMaker.pm +++ b/lib/ExtUtils/MakeMaker.pm @@ -180,7 +180,6 @@ sub eval_in_x { sub full_setup { $Verbose ||= 0; - $^W=1; # package name for the classes into which the first object will be blessed $PACKNAME = "PACK000"; diff --git a/lib/ExtUtils/Manifest.pm b/lib/ExtUtils/Manifest.pm index 58c91bc44b..8bb3fc8ebd 100644 --- a/lib/ExtUtils/Manifest.pm +++ b/lib/ExtUtils/Manifest.pm @@ -25,7 +25,7 @@ $MANIFEST = 'MANIFEST'; # Really cool fix from Ilya :) unless (defined $Config{d_link}) { - local $^W; + no warnings; *ln = \&cp; } diff --git a/lib/ExtUtils/Mksymlists.pm b/lib/ExtUtils/Mksymlists.pm index 9dcedbf35e..a0126cc3a0 100644 --- a/lib/ExtUtils/Mksymlists.pm +++ b/lib/ExtUtils/Mksymlists.pm @@ -1,10 +1,12 @@ package ExtUtils::Mksymlists; + +use 5.005_64; use strict qw[ subs refs ]; # no strict 'vars'; # until filehandles are exempted use Carp; use Exporter; -use vars qw( @ISA @EXPORT $VERSION ); +our(@ISA, @EXPORT, $VERSION); @ISA = 'Exporter'; @EXPORT = '&Mksymlists'; $VERSION = substr q$Revision: 1.17 $, 10; diff --git a/lib/ExtUtils/Packlist.pm b/lib/ExtUtils/Packlist.pm index eeb0a5b0c1..88ea206196 100644 --- a/lib/ExtUtils/Packlist.pm +++ b/lib/ExtUtils/Packlist.pm @@ -1,8 +1,9 @@ package ExtUtils::Packlist; + +use 5.005_64; use strict; use Carp qw(); -use vars qw($VERSION); -$VERSION = '0.03'; +our $VERSION = '0.03'; # Used for generating filehandle globs. IO::File might not be available! my $fhname = "FH1"; diff --git a/lib/ExtUtils/xsubpp b/lib/ExtUtils/xsubpp index ff9b452caf..4fedd3bb41 100755 --- a/lib/ExtUtils/xsubpp +++ b/lib/ExtUtils/xsubpp @@ -995,7 +995,9 @@ while (fetch_para()) { %XsubAliases = %XsubAliasValues = %Interfaces = (); $DoSetMagic = 1; - @args = split(/\s*,\s*/, $orig_args); + my $temp_args = $orig_args; + $temp_args =~ s/\\\s*//g; + @args = split(/\s*,\s*/, $temp_args); if (defined($class)) { my $arg0 = ((defined($static) or $func_name eq 'new') ? "CLASS" : "THIS"); diff --git a/lib/Fatal.pm b/lib/Fatal.pm index d1d95af884..5b832f6427 100644 --- a/lib/Fatal.pm +++ b/lib/Fatal.pm @@ -1,8 +1,9 @@ package Fatal; +use 5.005_64; use Carp; use strict; -use vars qw( $AUTOLOAD $Debug $VERSION); +our($AUTOLOAD, $Debug, $VERSION); $VERSION = 1.02; @@ -115,7 +116,7 @@ EOS no strict 'refs'; # to avoid: Can't use string (...) as a symbol ref ... $code = eval("package $pkg; use Carp; $code"); die if $@; - local($^W) = 0; # to avoid: Subroutine foo redefined ... + no warnings; # to avoid: Subroutine foo redefined ... *{$sub} = $code; } } diff --git a/lib/File/Basename.pm b/lib/File/Basename.pm index d1c8666bbb..da2caee849 100644 --- a/lib/File/Basename.pm +++ b/lib/File/Basename.pm @@ -135,11 +135,11 @@ BEGIN { - +use 5.005_64; +our(@ISA, @EXPORT, $VERSION, $Fileparse_fstype, $Fileparse_igncase); require Exporter; @ISA = qw(Exporter); @EXPORT = qw(fileparse fileparse_set_fstype basename dirname); -use vars qw($VERSION $Fileparse_fstype $Fileparse_igncase); $VERSION = "2.6"; diff --git a/lib/File/Compare.pm b/lib/File/Compare.pm index dce78e28ab..8a8afac05f 100644 --- a/lib/File/Compare.pm +++ b/lib/File/Compare.pm @@ -1,7 +1,8 @@ package File::Compare; +use 5.005_64; use strict; -use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $Too_Big *FROM *TO); +our($VERSION, @ISA, @EXPORT, @EXPORT_OK, $Too_Big); require Exporter; use Carp; @@ -115,6 +116,7 @@ sub compare { return -1; } +sub cmp; *cmp = \&compare; sub compare_text { diff --git a/lib/File/Copy.pm b/lib/File/Copy.pm index 8df54e55a8..8638bee210 100644 --- a/lib/File/Copy.pm +++ b/lib/File/Copy.pm @@ -7,10 +7,14 @@ package File::Copy; +use 5.005_64; use strict; use Carp; -use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION $Too_Big - © &syscopy &cp &mv $Syscopy_is_copy); +our(@ISA, @EXPORT, @EXPORT_OK, $VERSION, $Too_Big, $Syscopy_is_copy); +sub copy; +sub syscopy; +sub cp; +sub mv; # 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 diff --git a/lib/File/Find.pm b/lib/File/Find.pm index c674b2c5f6..42905dec80 100644 --- a/lib/File/Find.pm +++ b/lib/File/Find.pm @@ -1,5 +1,5 @@ package File::Find; -require 5.005; +use 5.005_64; require Exporter; require Cwd; @@ -53,12 +53,12 @@ If either I<follow> or I<follow_fast> is in effect: =over 6 -=item +=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 +=item * There is a variable C<$File::Find::fullname> which holds the absolute pathname of the file with all symbolic links resolved @@ -270,7 +270,7 @@ sub Follow_SymLink($) { return $AbsName; } -use vars qw/ $dir $name $fullname $prune /; +our($dir, $name, $fullname, $prune); sub _find_dir_symlnk($$$); sub _find_dir($$$); @@ -309,6 +309,8 @@ sub _find_opt { $top_item =~ s|/$|| unless $top_item eq '/'; $Is_Dir= 0; + ($topdev,$topino,$topmode,$topnlink) = stat $top_item; + if ($follow) { if (substr($top_item,0,1) eq '/') { $abs_dir = $top_item; @@ -331,7 +333,6 @@ sub _find_opt { } 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; diff --git a/lib/File/Path.pm b/lib/File/Path.pm index 634b2cd108..59b72baa45 100644 --- a/lib/File/Path.pm +++ b/lib/File/Path.pm @@ -91,16 +91,15 @@ Charles Bailey <F<bailey@newman.upenn.edu>> =cut +use 5.005_64; use Carp; use File::Basename (); -use DirHandle (); use Exporter (); use strict; -use vars qw( $VERSION @ISA @EXPORT ); -$VERSION = "1.0402"; -@ISA = qw( Exporter ); -@EXPORT = qw( mkpath rmtree ); +our $VERSION = "1.0403"; +our @ISA = qw( Exporter ); +our @EXPORT = qw( mkpath rmtree ); my $Is_VMS = $^O eq 'VMS'; @@ -170,10 +169,14 @@ sub rmtree { or carp "Can't make directory $root read+writeable: $!" unless $safe; - my $d = DirHandle->new($root) - or carp "Can't read $root: $!"; - @files = $d->read; - $d->close; + if (opendir my $d, $root) { + @files = readdir $d; + closedir $d; + } + else { + carp "Can't read $root: $!"; + @files = (); + } # Deleting large numbers of files from VMS Files-11 filesystems # is faster if done in reverse ASCIIbetical order diff --git a/lib/File/Spec/VMS.pm b/lib/File/Spec/VMS.pm index 00c068accb..79491463cd 100644 --- a/lib/File/Spec/VMS.pm +++ b/lib/File/Spec/VMS.pm @@ -22,6 +22,8 @@ See File::Spec::Unix for a documentation of the methods provided there. This package overrides the implementation of these methods, not the semantics. +=over + =item eliminate_macros Expands MM[KS]/Make macros in a text string, using the contents of @@ -111,6 +113,7 @@ sub fixpath { $fixedpath; } +=back =head2 Methods always loaded diff --git a/lib/File/Spec/Win32.pm b/lib/File/Spec/Win32.pm index 0ea4970b41..120b799cd2 100644 --- a/lib/File/Spec/Win32.pm +++ b/lib/File/Spec/Win32.pm @@ -81,7 +81,6 @@ sub catfile { } sub path { - local $^W = 1; my $path = $ENV{'PATH'} || $ENV{'Path'} || $ENV{'path'}; my @path = split(';',$path); foreach (@path) { $_ = '.' if $_ eq '' } @@ -309,14 +308,18 @@ sub abs2rel { $path_directories = CORE::join( '\\', @pathchunks ); $base_directories = CORE::join( '\\', @basechunks ); - # $base now contains the directories the resulting relative path - # must ascend out of before it can descend to $path_directory. So, + # $base_directories now contains the directories the resulting relative + # path must ascend out of before it can descend to $path_directory. So, # replace all names with $parentDir - $base_directories =~ s|[^/]+|..|g ; + + #FA Need to replace between backslashes... + $base_directories =~ s|[^\\]+|..|g ; # Glue the two together, using a separator if necessary, and preventing an # empty result. - if ( $path ne '' && $base ne '' ) { + + #FA Must check that new directories are not empty. + if ( $path_directories ne '' && $base_directories ne '' ) { $path_directories = "$base_directories\\$path_directories" ; } else { $path_directories = "$base_directories$path_directories" ; diff --git a/lib/File/stat.pm b/lib/File/stat.pm index f5d17f7da4..0cf7a0b7aa 100644 --- a/lib/File/stat.pm +++ b/lib/File/stat.pm @@ -1,9 +1,11 @@ package File::stat; use strict; +use 5.005_64; +our(@EXPORT, @EXPORT_OK, %EXPORT_TAGS); + BEGIN { use Exporter (); - use vars qw(@EXPORT @EXPORT_OK %EXPORT_TAGS); @EXPORT = qw(stat lstat); @EXPORT_OK = qw( $st_dev $st_ino $st_mode $st_nlink $st_uid $st_gid @@ -13,7 +15,7 @@ BEGIN { ); %EXPORT_TAGS = ( FIELDS => [ @EXPORT_OK, @EXPORT ] ); } -use vars @EXPORT_OK; +use vars @EXPORT_OK; # Class::Struct forbids use of @ISA sub import { goto &Exporter::import } diff --git a/lib/FileHandle.pm b/lib/FileHandle.pm index eec9b61f31..34c3475d9c 100644 --- a/lib/FileHandle.pm +++ b/lib/FileHandle.pm @@ -1,8 +1,8 @@ package FileHandle; -use 5.003_11; +use 5.005_64; use strict; -use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); +our($VERSION, @ISA, @EXPORT, @EXPORT_OK); $VERSION = "2.00"; diff --git a/lib/Getopt/Std.pm b/lib/Getopt/Std.pm index e027bad3d2..e5b369ceb5 100644 --- a/lib/Getopt/Std.pm +++ b/lib/Getopt/Std.pm @@ -28,21 +28,25 @@ which take an argument don't care whether there is a space between the switch and the argument. Note that, if your code is running under the recommended C<use strict -'vars'> pragma, it may be helpful to declare these package variables -via C<use vars> perhaps something like this: +'vars'> pragma, you will need to declare these package variables +with "our": - use vars qw/ $opt_foo $opt_bar /; + our($opt_foo, $opt_bar); -For those of you who don't like additional variables being created, getopt() +For those of you who don't like additional global variables being created, getopt() and getopts() will also accept a hash reference as an optional second argument. Hash keys will be x (where x is the switch name) with key values the value of the argument or 1 if no argument is specified. +To allow programs to process arguments that look like switches, but aren't, +both functions will stop processing switches when they see the argument +C<-->. The C<--> will be removed from @ARGV. + =cut @ISA = qw(Exporter); @EXPORT = qw(getopt getopts); -$VERSION = '1.01'; +$VERSION = '1.02'; # Process single-character switches with switch clustering. Pass one argument # which is a string containing all switches that take an argument. For each @@ -60,6 +64,10 @@ sub getopt ($;$) { while (@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) { ($first,$rest) = ($1,$2); + if (/^--$/) { # early exit if -- + shift @ARGV; + last; + } if (index($argumentative,$first) >= 0) { if ($rest ne '') { shift(@ARGV); @@ -68,22 +76,22 @@ sub getopt ($;$) { shift(@ARGV); $rest = shift(@ARGV); } - if (ref $hash) { - $$hash{$first} = $rest; - } - else { - ${"opt_$first"} = $rest; - push( @EXPORT, "\$opt_$first" ); - } + if (ref $hash) { + $$hash{$first} = $rest; + } + else { + ${"opt_$first"} = $rest; + push( @EXPORT, "\$opt_$first" ); + } } else { - if (ref $hash) { - $$hash{$first} = 1; - } - else { - ${"opt_$first"} = 1; - push( @EXPORT, "\$opt_$first" ); - } + if (ref $hash) { + $$hash{$first} = 1; + } + else { + ${"opt_$first"} = 1; + push( @EXPORT, "\$opt_$first" ); + } if ($rest ne '') { $ARGV[0] = "-$rest"; } @@ -111,31 +119,35 @@ sub getopts ($;$) { @args = split( / */, $argumentative ); while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) { ($first,$rest) = ($1,$2); + if (/^--$/) { # early exit if -- + shift @ARGV; + last; + } $pos = index($argumentative,$first); - if($pos >= 0) { - if(defined($args[$pos+1]) and ($args[$pos+1] eq ':')) { + if ($pos >= 0) { + if (defined($args[$pos+1]) and ($args[$pos+1] eq ':')) { shift(@ARGV); - if($rest eq '') { + if ($rest eq '') { ++$errs unless @ARGV; $rest = shift(@ARGV); } - if (ref $hash) { - $$hash{$first} = $rest; - } - else { - ${"opt_$first"} = $rest; - push( @EXPORT, "\$opt_$first" ); - } + if (ref $hash) { + $$hash{$first} = $rest; + } + else { + ${"opt_$first"} = $rest; + push( @EXPORT, "\$opt_$first" ); + } } else { - if (ref $hash) { - $$hash{$first} = 1; - } - else { - ${"opt_$first"} = 1; - push( @EXPORT, "\$opt_$first" ); - } - if($rest eq '') { + if (ref $hash) { + $$hash{$first} = 1; + } + else { + ${"opt_$first"} = 1; + push( @EXPORT, "\$opt_$first" ); + } + if ($rest eq '') { shift(@ARGV); } else { @@ -146,7 +158,7 @@ sub getopts ($;$) { else { warn "Unknown option: $first\n"; ++$errs; - if($rest ne '') { + if ($rest ne '') { $ARGV[0] = "-$rest"; } else { @@ -162,4 +174,3 @@ sub getopts ($;$) { } 1; - diff --git a/lib/Math/BigFloat.pm b/lib/Math/BigFloat.pm index 1a9195e185..d8d643ca3e 100644 --- a/lib/Math/BigFloat.pm +++ b/lib/Math/BigFloat.pm @@ -74,7 +74,7 @@ sub fnorm; sub fsqrt; sub fnorm { #(string) return fnum_str local($_) = @_; s/\s+//g; # strip white space - local $^W = 0; # $4 and $5 below might legitimately be undefined + no warnings; # $4 and $5 below might legitimately be undefined if (/^([+-]?)(\d*)(\.(\d*))?([Ee]([+-]?\d+))?$/ && "$2$4" ne '') { &norm(($1 ? "$1$2$4" : "+$2$4"),(($4 ne '') ? $6-length($4) : $6)); } else { diff --git a/lib/Math/Complex.pm b/lib/Math/Complex.pm index b339573bc9..5b7ddb6f2c 100644 --- a/lib/Math/Complex.pm +++ b/lib/Math/Complex.pm @@ -8,9 +8,10 @@ require Exporter; package Math::Complex; +use 5.005_64; use strict; -use vars qw($VERSION @ISA @EXPORT %EXPORT_TAGS); +our($VERSION, @ISA, @EXPORT, %EXPORT_TAGS); my ( $i, $ip2, %logn ); @@ -179,21 +180,21 @@ sub cplxe { # # The number defined as pi = 180 degrees # -use constant pi => 4 * CORE::atan2(1, 1); +sub pi () { 4 * CORE::atan2(1, 1) } # # pit2 # # The full circle # -use constant pit2 => 2 * pi; +sub pit2 () { 2 * pi } # # pip2 # # The quarter circle # -use constant pip2 => pi / 2; +sub pip2 () { pi / 2 } # # deg1 @@ -201,14 +202,14 @@ use constant pip2 => pi / 2; # One degree in radians, used in stringify_polar. # -use constant deg1 => pi / 180; +sub deg1 () { pi / 180 } # # uplog10 # # Used in log10(). # -use constant uplog10 => 1 / CORE::log(10); +sub uplog10 () { 1 / CORE::log(10) } # # i diff --git a/lib/Math/Trig.pm b/lib/Math/Trig.pm index c659137eba..68dcb94822 100644 --- a/lib/Math/Trig.pm +++ b/lib/Math/Trig.pm @@ -7,13 +7,12 @@ require Exporter; package Math::Trig; +use 5.005_64; use strict; use Math::Complex qw(:trig); -use vars qw($VERSION $PACKAGE - @ISA - @EXPORT @EXPORT_OK %EXPORT_TAGS); +our($VERSION, $PACKAGE, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); @ISA = qw(Exporter); @@ -37,8 +36,8 @@ my @rdlcnv = qw(cartesian_to_cylindrical %EXPORT_TAGS = ('radial' => [ @rdlcnv ]); -use constant pi2 => 2 * pi; -use constant pip2 => pi / 2; +sub pi2 () { 2 * pi } # use constant generates warning +sub pip2 () { pi / 2 } # use constant generates warning use constant DR => pi2/360; use constant RD => 360/pi2; use constant DG => 400/360; diff --git a/lib/Net/Ping.pm b/lib/Net/Ping.pm index 54540601d3..0c8622e220 100644 --- a/lib/Net/Ping.pm +++ b/lib/Net/Ping.pm @@ -10,12 +10,11 @@ package Net::Ping; # program is free software; you may redistribute it and/or modify it # under the same terms as Perl itself. -require 5.002; +use 5.005_64; require Exporter; use strict; -use vars qw(@ISA @EXPORT $VERSION - $def_timeout $def_proto $max_datasize); +our(@ISA, @EXPORT, $VERSION, $def_timeout, $def_proto, $max_datasize); use FileHandle; use Socket qw( SOCK_DGRAM SOCK_STREAM SOCK_RAW PF_INET inet_aton sockaddr_in ); diff --git a/lib/Net/hostent.pm b/lib/Net/hostent.pm index d586358f0a..6cfde7253c 100644 --- a/lib/Net/hostent.pm +++ b/lib/Net/hostent.pm @@ -1,9 +1,10 @@ package Net::hostent; use strict; +use 5.005_64; +our(@EXPORT, @EXPORT_OK, %EXPORT_TAGS); BEGIN { use Exporter (); - use vars qw(@EXPORT @EXPORT_OK %EXPORT_TAGS); @EXPORT = qw(gethostbyname gethostbyaddr gethost); @EXPORT_OK = qw( $h_name @h_aliases diff --git a/lib/Net/netent.pm b/lib/Net/netent.pm index fbc6d987fe..d8c094ae81 100644 --- a/lib/Net/netent.pm +++ b/lib/Net/netent.pm @@ -1,9 +1,10 @@ package Net::netent; use strict; +use 5.005_64; +our(@EXPORT, @EXPORT_OK, %EXPORT_TAGS); BEGIN { use Exporter (); - use vars qw(@EXPORT @EXPORT_OK %EXPORT_TAGS); @EXPORT = qw(getnetbyname getnetbyaddr getnet); @EXPORT_OK = qw( $n_name @n_aliases diff --git a/lib/Net/protoent.pm b/lib/Net/protoent.pm index 737ff5a33b..334af78914 100644 --- a/lib/Net/protoent.pm +++ b/lib/Net/protoent.pm @@ -1,9 +1,10 @@ package Net::protoent; use strict; +use 5.005_64; +our(@EXPORT, @EXPORT_OK, %EXPORT_TAGS); BEGIN { use Exporter (); - use vars qw(@EXPORT @EXPORT_OK %EXPORT_TAGS); @EXPORT = qw(getprotobyname getprotobynumber getprotoent); @EXPORT_OK = qw( $p_name @p_aliases $p_proto ); %EXPORT_TAGS = ( FIELDS => [ @EXPORT_OK, @EXPORT ] ); diff --git a/lib/Net/servent.pm b/lib/Net/servent.pm index fb85dd04bf..c892af0bbe 100644 --- a/lib/Net/servent.pm +++ b/lib/Net/servent.pm @@ -1,9 +1,10 @@ package Net::servent; use strict; +use 5.005_64; +our(@EXPORT, @EXPORT_OK, %EXPORT_TAGS); BEGIN { use Exporter (); - use vars qw(@EXPORT @EXPORT_OK %EXPORT_TAGS); @EXPORT = qw(getservbyname getservbyport getservent getserv); @EXPORT_OK = qw( $s_name @s_aliases $s_port $s_proto ); %EXPORT_TAGS = ( FIELDS => [ @EXPORT_OK, @EXPORT ] ); diff --git a/lib/Pod/Checker.pm b/lib/Pod/Checker.pm index aa5c5490ae..c661c7527e 100644 --- a/lib/Pod/Checker.pm +++ b/lib/Pod/Checker.pm @@ -10,9 +10,11 @@ package Pod::Checker; use vars qw($VERSION); -$VERSION = 1.090; ## Current version of this package +$VERSION = 1.096; ## Current version of this package require 5.004; ## requires this Perl version or later +use Pod::ParseUtils; ## for hyperlinks and lists + =head1 NAME Pod::Checker, podchecker() - check pod documents for syntax errors @@ -23,15 +25,19 @@ Pod::Checker, podchecker() - check pod documents for syntax errors $syntax_okay = podchecker($filepath, $outputpath, %options); + my $checker = new Pod::Checker %options; + =head1 OPTIONS/ARGUMENTS C<$filepath> is the input POD to read and C<$outputpath> is where to write POD syntax error messages. Either argument may be a scalar -indcating a file-path, or else a reference to an open filehandle. +indicating a file-path, or else a reference to an open filehandle. If unspecified, the input-file it defaults to C<\*STDIN>, and the output-file defaults to C<\*STDERR>. -=head2 Options +=head2 podchecker() + +This function can take a hash of options: =over 4 @@ -45,20 +51,25 @@ Turn warnings on/off. See L<"Warnings">. B<podchecker> will perform syntax checking of Perl5 POD format documentation. -I<NOTE THAT THIS MODULE IS CURRENTLY IN THE INITIAL DEVELOPMENT STAGE!> -As of this writing, all it does is check for unknown '=xxxx' commands, -unknown 'X<...>' interior-sequences, and unterminated interior sequences. +I<NOTE THAT THIS MODULE IS CURRENTLY IN THE BETA STAGE!> 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>. +additional features they wish to see in B<Pod::Checker> and B<podchecker> +and verify that the checks are consistent with L<perlpod>. -The following additional checks are preformed: +The following checks are preformed: =over 4 =item * -Check for proper balancing of C<=begin> and C<=end>. +Unknown '=xxxx' commands, unknown 'X<...>' interior-sequences, +and unterminated interior sequences. + +=item * + +Check for proper balancing of C<=begin> and C<=end>. The contents of such +a block are generally ignored, i.e. no syntax checks are performed. =item * @@ -66,55 +77,156 @@ 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>>). +Check for same nested interior-sequences (e.g. +C<LE<lt>...LE<lt>...E<gt>...E<gt>>). =item * -Check for malformed entities. +Check for malformed or nonexisting entities C<EE<lt>...E<gt>>. =item * -Check for correct syntax of hyperlinks C<LE<lt>E<gt>>. See L<perlpod> for -details. +Check for correct syntax of hyperlinks C<LE<lt>...E<gt>>. See L<perlpod> +for details. =item * -Check for unresolved document-internal links. +Check for unresolved document-internal links. This check may also reveal +misspelled links that seem to be internal links but should be links +to something else. =back -=head2 Warnings +=head2 Additional Features + +While checking, this module collects document properties, e.g. the nodes +for hyperlinks (C<=headX>, C<=item>). POD translators can use this feature +to syntax-check and get the nodes in a first pass before actually starting +to convert. This is expensive in terms of execution time, but allows for +very robust conversions. + +=head1 DIAGNOSTICS -The following warnings are printed. These may not necessarily cause trouble, -but indicate mediocre style. +=head2 Errors =over 4 -=item * +=item * =over on line I<N> without closing =back -Spurious characters after C<=back> and C<=end>. +The C<=over> command does not have a corresponding C<=back> before the +next heading (C<=head1> or C<=head2>) or the end of the file. -=item * +=item * =item without previous =over -Unescaped C<E<lt>> and C<E<gt>> in the text. +=item * =back without previous =over -=item * +An C<=item> or C<=back> command has been found outside a +C<=over>/C<=back> block. -Missing arguments for C<=begin> and C<=over>. +=item * No argument for =begin -=item * +A C<=begin> command was found that is not followed by the formatter +specification. -Empty C<=over> / C<=back> list. +=item * =end without =begin -=item * +A standalone C<=end> command was found. + +=item * Nested =begin's + +There were at least two concecutive C<=begin> commands without +the corresponding C<=end>. Only one C<=begin> may be active at +a time. + +=item * =for without formatter specification -Hyperlinks: leading/trailing whitespace, brackets C<()> in the page name. +There is no specification of the formatter after the C<=for> command. + +=item * unresolved internal link I<NAME> + +The given link to I<NAME> does not have a matching node in the current +POD. This also happend when a single word node name is not enclosed in +C<"">. + +=item * Unknown command "I<CMD>" + +An invalid POD command has been found. Valid are C<=head1>, C<=head2>, +C<=over>, C<=item>, C<=back>, C<=begin>, C<=end>, C<=for>, C<=pod>, +C<=cut> + +=item * Unknown interior-sequence "I<SEQ>" + +An invalid markup command has been encountered. Valid are: +C<BE<lt>E<gt>>, C<CE<lt>E<gt>>, C<EE<lt>E<gt>>, C<FE<lt>E<gt>>, +C<IE<lt>E<gt>>, C<LE<lt>E<gt>>, C<SE<lt>E<gt>>, C<XE<lt>E<gt>>, +C<ZE<lt>E<gt>> + +=item * nested commands I<CMD>E<lt>...I<CMD>E<lt>...E<gt>...E<gt> + +Two nested identical markup commands have been found. Generally this +does not make sense. + +=item * garbled entity I<STRING> + +The I<STRING> found cannot be interpreted as an character entity. + +=item * malformed link LE<lt>E<gt> + +The link found cannot be parsed because it does not conform to the +syntax described in L<perlpod>. =back -=head1 DIAGNOSTICS +=head2 Warnings -I<[T.B.D.]> +These may not necessarily cause trouble, but indicate mediocre style. + +=over 4 + +=item * No numeric argument for =over + +The C<=over> command is supposed to have a numeric argument (the +indentation). + +=item * Spurious character(s) after =back + +The C<=back> command does not take any arguments. + +=item * I<N> unescaped C<E<lt>E<gt>> in paragraph + +Angle brackets not written as C<E<lt>ltE<gt>> and C<E<lt>gtE<gt>> +can potentially cause errors as they could be misinterpreted as +markup commands. + +=item * Non-standard entity + +A character entity was found that does not belong to the standard +ISO set. + +=item * No items in =over + +The list does not contain any items. + +=item * No argument for =item + +C<=item> without any parameters is deprecated. It should either be followed +by C<*> to indicate an unordered list, by a number (optionally followed +by a dot) to indicate an ordered (numbered) list or simple text for a +definition list. + +=item * Verbatim paragraph in NAME section + +The NAME section (C<=head1 NAME>) should consist of a single paragraph +with the script/module name, followed by a dash `-' and a very short +description of what the thing is good for. + +=item * Hyperlinks + +There are some warnings wrt. hyperlinks: +Leading/trailing whitespace, newlines in hyperlinks, +brackets C<()>. + +=back =head1 RETURN VALUE @@ -174,6 +286,117 @@ my %VALID_SEQUENCES = ( 'E' => 1, ); +# stolen from HTML::Entities +my %ENTITIES = ( + # Some normal chars that have special meaning in SGML context + amp => '&', # ampersand +'gt' => '>', # greater than +'lt' => '<', # less than + quot => '"', # double quote + + # PUBLIC ISO 8879-1986//ENTITIES Added Latin 1//EN//HTML + AElig => 'Æ', # capital AE diphthong (ligature) + Aacute => 'Á', # capital A, acute accent + Acirc => 'Â', # capital A, circumflex accent + Agrave => 'À', # capital A, grave accent + Aring => 'Å', # capital A, ring + Atilde => 'Ã', # capital A, tilde + Auml => 'Ä', # capital A, dieresis or umlaut mark + Ccedil => 'Ç', # capital C, cedilla + ETH => 'Ð', # capital Eth, Icelandic + Eacute => 'É', # capital E, acute accent + Ecirc => 'Ê', # capital E, circumflex accent + Egrave => 'È', # capital E, grave accent + Euml => 'Ë', # capital E, dieresis or umlaut mark + Iacute => 'Í', # capital I, acute accent + Icirc => 'Î', # capital I, circumflex accent + Igrave => 'Ì', # capital I, grave accent + Iuml => 'Ï', # capital I, dieresis or umlaut mark + Ntilde => 'Ñ', # capital N, tilde + Oacute => 'Ó', # capital O, acute accent + Ocirc => 'Ô', # capital O, circumflex accent + Ograve => 'Ò', # capital O, grave accent + Oslash => 'Ø', # capital O, slash + Otilde => 'Õ', # capital O, tilde + Ouml => 'Ö', # capital O, dieresis or umlaut mark + THORN => 'Þ', # capital THORN, Icelandic + Uacute => 'Ú', # capital U, acute accent + Ucirc => 'Û', # capital U, circumflex accent + Ugrave => 'Ù', # capital U, grave accent + Uuml => 'Ü', # capital U, dieresis or umlaut mark + Yacute => 'Ý', # capital Y, acute accent + aacute => 'á', # small a, acute accent + acirc => 'â', # small a, circumflex accent + aelig => 'æ', # small ae diphthong (ligature) + agrave => 'à', # small a, grave accent + aring => 'å', # small a, ring + atilde => 'ã', # small a, tilde + auml => 'ä', # small a, dieresis or umlaut mark + ccedil => 'ç', # small c, cedilla + eacute => 'é', # small e, acute accent + ecirc => 'ê', # small e, circumflex accent + egrave => 'è', # small e, grave accent + eth => 'ð', # small eth, Icelandic + euml => 'ë', # small e, dieresis or umlaut mark + iacute => 'í', # small i, acute accent + icirc => 'î', # small i, circumflex accent + igrave => 'ì', # small i, grave accent + iuml => 'ï', # small i, dieresis or umlaut mark + ntilde => 'ñ', # small n, tilde + oacute => 'ó', # small o, acute accent + ocirc => 'ô', # small o, circumflex accent + ograve => 'ò', # small o, grave accent + oslash => 'ø', # small o, slash + otilde => 'õ', # small o, tilde + ouml => 'ö', # small o, dieresis or umlaut mark + szlig => 'ß', # small sharp s, German (sz ligature) + thorn => 'þ', # small thorn, Icelandic + uacute => 'ú', # small u, acute accent + ucirc => 'û', # small u, circumflex accent + ugrave => 'ù', # small u, grave accent + uuml => 'ü', # small u, dieresis or umlaut mark + yacute => 'ý', # small y, acute accent + yuml => 'ÿ', # small y, dieresis or umlaut mark + + # Some extra Latin 1 chars that are listed in the HTML3.2 draft (21-May-96) + copy => '©', # copyright sign + reg => '®', # registered sign + nbsp => "\240", # non breaking space + + # Additional ISO-8859/1 entities listed in rfc1866 (section 14) + iexcl => '¡', + cent => '¢', + pound => '£', + curren => '¤', + yen => '¥', + brvbar => '¦', + sect => '§', + uml => '¨', + ordf => 'ª', + laquo => '«', +'not' => '¬', # not is a keyword in perl + shy => '', + macr => '¯', + deg => '°', + plusmn => '±', + sup1 => '¹', + sup2 => '²', + sup3 => '³', + acute => '´', + micro => 'µ', + para => '¶', + middot => '·', + cedil => '¸', + ordm => 'º', + raquo => '»', + frac14 => '¼', + frac12 => '½', + frac34 => '¾', + iquest => '¿', +'times' => '×', # times is a keyword in perl + divide => '÷', +); + ##--------------------------------------------------------------------------- ##--------------------------------- @@ -219,16 +442,18 @@ sub initialize { ## 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->errorsub('poderror'); # set the error handling subroutine $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 + # print warnings? $self->{-warnings} = 1 unless(defined $self->{-warnings}); + $self->{_current_head1} = ''; # the current =head1 block } -## Invoked as $self->poderror( @args ), or $self->poderror( {%opts}, @args ) +# Invoked as $self->poderror( @args ), or $self->poderror( {%opts}, @args ) sub poderror { my $self = shift; my %opts = (ref $_[0]) ? %{shift()} : (); @@ -243,13 +468,43 @@ sub poderror { ++($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"); + print $out_fh ($severity, $msg, $line, $file, "\n") + if($self->{-warnings} || !%opts || $opts{-severity} ne 'WARNING'); } +# set/retrieve the number of errors found sub num_errors { return (@_ > 1) ? ($_[0]->{_NUM_ERRORS} = $_[1]) : $_[0]->{_NUM_ERRORS}; } +# set and/or retrieve canonical name of POD +sub name { + return (@_ > 1 && $_[1]) ? + ($_[0]->{-name} = $_[1]) : $_[0]->{-name}; +} + +# 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}}; +} + ## overrides for Pod::Parser sub end_pod { @@ -273,7 +528,6 @@ sub end_pod { # 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. @@ -282,7 +536,6 @@ sub end_pod { } } foreach($self->hyperlink()) { - #print "Seek node: +$_+\n"; my $line = ''; s/^(\d+):// && ($line = $1); if($_ && !$nodes{$_}) { @@ -307,6 +560,7 @@ sub end_pod { } } +# check a POD command directive sub command { my ($self, $cmd, $paragraph, $line_num, $pod_para) = @_; my ($file, $line) = $pod_para->file_line; @@ -320,32 +574,47 @@ sub command { $self->{_commands}++; # found a valid command ## check syntax of particular command if($cmd eq 'over') { + # check for argument + $arg = $self->interpolate_and_check($paragraph, $line,$file); + my $indent = 4; # default + if($arg && $arg =~ /^\s*(\d+)\s*$/) { + $indent = $1; + } else { + $self->poderror({ -line => $line, -file => $file, + -severity => 'WARNING', + -msg => "No numeric argument for =over"}); + } # start a new list - unshift(@{$self->{_list_stack}}, - Pod::List->new( - -indent => $paragraph, + unshift(@{$self->{_list_stack}}, Pod::List->new( + -indent => $indent, -start => $line, -file => $file)); } elsif($cmd eq 'item') { + # are we in a list? unless(@{$self->{_list_stack}}) { $self->poderror({ -line => $line, -file => $file, -severity => 'ERROR', -msg => "=item without previous =over" }); + # auto-open in case we encounter many more + unshift(@{$self->{_list_stack}}, + Pod::List->new( + -indent => 'auto', + -start => $line, + -file => $file)); } - 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); + # 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" }); + $arg = ' '; # empty } + # add this item + $self->{_list_stack}[0]->item($arg); + # remember this node + $self->node($arg); } elsif($cmd eq 'back') { # check if we have an open list @@ -356,7 +625,7 @@ sub command { } else { # check for spurious characters - $arg = $self->_interpolate_and_check($paragraph, $line,$file); + $arg = $self->interpolate_and_check($paragraph, $line,$file); if($arg && $arg =~ /\S/) { $self->poderror({ -line => $line, -file => $file, -severity => 'WARNING', @@ -380,13 +649,19 @@ sub command { while($list = shift(@{$self->{_list_stack}})) { $self->poderror({ -line => $line, -file => $file, -severity => 'ERROR', - -msg => "unclosed =over (line ". $list->start() . - ") at $cmd" }); + -msg => "=over on line ". $list->start() . + " without closing =back (at $cmd)" }); } } # remember this node - $arg = $self->_interpolate_and_check($paragraph, $line,$file); + $arg = $self->interpolate_and_check($paragraph, $line,$file); $self->node($arg) if($arg); + if($cmd eq 'head1') { + $arg =~ s/[\s\n]+$//; + $self->{_current_head1} = $arg; + } else { + $self->{_current_head1} = ''; + } } elsif($cmd eq 'begin') { if($self->{_have_begin}) { @@ -398,10 +673,10 @@ sub command { } else { # check for argument - $arg = $self->_interpolate_and_check($paragraph, $line,$file); + $arg = $self->interpolate_and_check($paragraph, $line,$file); unless($arg && $arg =~ /(\S+)/) { $self->poderror({ -line => $line, -file => $file, - -severity => 'WARNING', + -severity => 'ERROR', -msg => "No argument for =begin"}); } # remember the =begin @@ -413,27 +688,37 @@ sub command { # 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" }); - } + $arg = $self->interpolate_and_check($paragraph, $line,$file); + # the closing argument is optional + #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', + -severity => 'ERROR', -msg => "=end without =begin" }); } } - } + elsif($cmd eq 'for') { + unless($paragraph =~ /\s*(\S+)\s*/) { + $self->poderror({ -line => $line, -file => $file, + -severity => 'ERROR', + -msg => "=for without formatter specification" }); + } + $arg = ''; # do not expand paragraph below + } ## Check the interior sequences in the command-text - $self->_interpolate_and_check($paragraph, $line,$file) + $self->interpolate_and_check($paragraph, $line,$file) unless(defined $arg); + } } -sub _interpolate_and_check { +# process a block of some text +sub interpolate_and_check { my ($self, $paragraph, $line, $file) = @_; ## Check the interior sequences in the command-text # and return the text @@ -452,10 +737,11 @@ sub _check_ptree { my $count; # count the unescaped angle brackets my $i = $_; - if($count = $i =~ s/[<>]/$self->expand_unescaped_bracket($&)/ge) { + if($count = $i =~ tr/<>/<>/) { $self->poderror({ -line => $line, -file => $file, -severity => 'WARNING', - -msg => "$count unescaped <>" }); + -msg => "$count unescaped <> in paragraph" }) + if($self->{-warnings}); } $text .= $i; next; @@ -488,7 +774,21 @@ sub _check_ptree { -msg => "garbled entity " . $_->raw_text()}); next; } - $text .= $self->expand_entity($$contents[0]); + my $ent = $$contents[0]; + if($ent =~ /^\d+$/) { + # numeric entity + $text .= chr($ent); + } + elsif($ENTITIES{$ent}) { + # known ISO entity + $text .= $ENTITIES{$ent}; + } + else { + $self->poderror({ -line => $line, -file => $file, + -severity => 'WARNING', + -msg => "Non-standard entity " . $_->raw_text()}); + $text .= "E<$ent>"; + } } elsif($cmd eq 'L') { # try to parse the hyperlink @@ -496,7 +796,7 @@ sub _check_ptree { unless(defined $link) { $self->poderror({ -line => $line, -file => $file, -severity => 'ERROR', - -msg => "malformed link L<>: $@"}); + -msg => "malformed link " . $_->raw_text() ." : $@"}); next; } $link->line($line); # remember line @@ -511,13 +811,14 @@ sub _check_ptree { $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 + # remember 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()); + # e.g. in Tk::Pod : L<Tk::Pod/"DESCRIPTION"> + if($link->node() && !$link->page() && $link->type() ne 'hyperlink') { + $node = $self->_check_ptree($self->parse_text($link->node(), + $line), $line, $file, "$nestlist$cmd"); + $self->hyperlink("$line:$node") if($node); + } } elsif($cmd =~ /[BCFIS]/) { # add the guts @@ -531,397 +832,35 @@ sub _check_ptree { $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 +# _TODO_ overloadable methods for BC..Z<...> expansion? +# process a block of verbatim text sub verbatim { ## Nothing to check - ## my ($self, $paragraph, $line_num, $pod_para) = @_; + my ($self, $paragraph, $line_num, $pod_para) = @_; + if($self->{_current_head1} eq 'NAME') { + my ($file, $line) = $pod_para->file_line; + $self->poderror({ -line => $line, -file => $file, + -severity => 'WARNING', + -msg => 'Verbatim paragraph in NAME section' }); + } } +# process a block of regular text sub textblock { my ($self, $paragraph, $line_num, $pod_para) = @_; 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 { - return @{$self->{_items}}; - } -} - -#----------------------------------------------------------------------------- -# 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 + # skip this paragraph if in a =begin block + unless($self->{_have_begin}) { + my $block = $self->interpolate_and_check($paragraph, $line,$file); + if($self->{_current_head1} eq 'NAME') { + if($block =~ /^\s*(\S+?)\s*[,-]/) { + # this is the canonical name + $self->{-name} = $1 unless(defined $self->{-name}); + } } } - $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_link { - my ($msg) = @_; - # this sets @_ - #eval { die "$msg\n" }; - #chomp $@; - $@ = $msg; # this seems to work, too! - undef; } 1; diff --git a/lib/Pod/Find.pm b/lib/Pod/Find.pm new file mode 100644 index 0000000000..399bbba252 --- /dev/null +++ b/lib/Pod/Find.pm @@ -0,0 +1,259 @@ +############################################################################# +# Pod/Find.pm -- finds files containing POD documentation +# +# Author: Marek Rouchal <marek@saftsack.fs.uni-bayreuth.de> +# +# borrowing code from Nick Ing-Simmon's PodToHtml +# This file is part of "PodParser". Pod::Find is free software; +# you can redistribute it and/or modify it under the same terms +# as Perl itself. +############################################################################# + +package Pod::Find; + +use vars qw($VERSION); +$VERSION = 0.10; ## Current version of this package +require 5.005; ## requires this Perl version or later + +############################################################################# + +=head1 NAME + +Pod::Find - find POD documents in directory trees + +=head1 SYNOPSIS + + use Pod::Find qw(pod_find simplify_name); + my %pods = pod_find({ -verbose => 1, -inc => 1 }); + foreach(keys %pods) { + print "found library POD `$pods{$_}' in $_\n"; + } + + print "podname=",simplify_name('a/b/c/mymodule.pod'),"\n"; + +=head1 DESCRIPTION + +B<Pod::Find> provides a function B<pod_find> that searches for POD +documents in a given set of files and directories. It returns a hash +with the file names as keys and the POD name as value. The POD name +is derived from the file name and its position in the directory tree. + +E.g. when searching in F<$HOME/perl5lib>, the file +F<$HOME/perl5lib/MyModule.pm> would get the POD name I<MyModule>, +whereas F<$HOME/perl5lib/Myclass/Subclass.pm> would be +I<Myclass::Subclass>. The name information can be used for POD +translators. + +Only text files containing at least one valid POD command are found. + +A warning is printed if more than one POD file with the same POD name +is found, e.g. F<CPAN.pm> in different directories. This usually +indicates duplicate occurences of modules in the I<@INC> search path. + +The function B<simplify_name> is equivalent to B<basename>, but also +strips Perl-like extensions (.pm, .pl, .pod). + +Note that neither B<pod_find> nor B<simplify_name> are exported by +default so be sure to specify them in the B<use> statement if you need them: + + use Pod::Find qw(pod_find simplify_name); + +=head1 OPTIONS + +The first argument for B<pod_find> may be a hash reference with options. +The rest are either directories that are searched recursively or files. +The POD names of files are the plain basenames with any Perl-like extension +(.pm, .pl, .pod) stripped. + +=over 4 + +=item B<-verbose> + +Print progress information while scanning. + +=item B<-perl> + +Apply Perl-specific heuristics to find the correct PODs. This includes +stripping Perl-like extensions, omitting subdirectories that are numeric +but do I<not> match the current Perl interpreter's version id, suppressing +F<site_perl> as a module hierarchy name etc. + +=item B<-script> + +Search for PODs in the current Perl interpreter's installation +B<scriptdir>. This is taken from the local L<Config|Config> module. + +=item B<-inc> + +Search for PODs in the current Perl interpreter's I<@INC> paths. + +=back + +=head1 AUTHOR + +Marek Rouchal E<lt>marek@saftsack.fs.uni-bayreuth.deE<gt>, +heavily borrowing code from Nick Ing-Simmons' PodToHtml. + +=head1 SEE ALSO + +L<Pod::Parser>, L<Pod::Checker> + +=cut + +use strict; +#use diagnostics; +use Exporter; +use File::Find; +use Cwd; + +use vars qw(@ISA @EXPORT_OK $VERSION); +@ISA = qw(Exporter); +@EXPORT_OK = qw(&pod_find &simplify_name); + +# package global variables +my $SIMPLIFY_RX; + +# return a hash of the +sub pod_find +{ + my %opts; + if(ref $_[0]) { + %opts = %{shift()}; + } + + $opts{-verbose} ||= 0; + $opts{-perl} ||= 0; + + my (@search) = @_; + + if($opts{-script}) { + require Config; + push(@search, $Config::Config{scriptdir}); + $opts{-perl} = 1; + } + + if($opts{-inc}) { + push(@search, grep($_ ne '.',@INC)); + $opts{-perl} = 1; + } + + if($opts{-perl}) { + require Config; + # this code simplifies the POD name for Perl modules: + # * remove "site_perl" + # * remove e.g. "i586-linux" + # * remove e.g. 5.00503 + # * remove pod/ if followed by *.pod (e.g. in pod/perlfunc.pod) + $SIMPLIFY_RX = + qr!^(?i:site_perl/|$Config::Config{archname}/|\d+\.\d+([_.]?\d+)?/|pod/(?=.*?\.pod$))*!o; + } + + my %dirs_visited; + my %pods; + my %names; + my $pwd = cwd(); + + foreach my $try (@search) { + unless($try =~ m:^/:) { + # make path absolute + $try = join('/',$pwd,$try); + } + $try =~ s:/\.?(?=/|$)::; # simplify path + my $name; + if(-f $try) { + if($name = _check_and_extract_name($try, $opts{-verbose})) { + _check_for_duplicates($try, $name, \%names, \%pods); + } + next; + } + my $root_rx = qr!^\Q$try\E/!; + File::Find::find( sub { + my $item = $File::Find::name; + if(-d) { + if($dirs_visited{$item}) { + warn "Directory '$item' already seen, skipping.\n" + if($opts{-verbose}); + $File::Find::prune = 1; + return; + } + else { + $dirs_visited{$item} = 1; + } + if($opts{-perl} && /^(\d+\.[\d_]+)$/ && eval "$1" != $]) { + $File::Find::prune = 1; + warn "Perl $] version mismatch on $_, skipping.\n" + if($opts{-verbose}); + } + return; + } + if($name = _check_and_extract_name($item, $opts{-verbose}, $root_rx)) { + _check_for_duplicates($item, $name, \%names, \%pods); + } + }, $try); # end of File::Find::find + } + chdir $pwd; + %pods; +} + +sub _check_for_duplicates { + my ($file, $name, $names_ref, $pods_ref) = @_; + if($$names_ref{$name}) { + warn "Duplicate POD found (shadowing?): $name ($file)\n"; + warn " Already seen in ", + join(' ', grep($$pods_ref{$_} eq $name, keys %$pods_ref)),"\n"; + } + else { + $$names_ref{$name} = 1; + } + $$pods_ref{$file} = $name; +} + +sub _check_and_extract_name { + my ($file, $verbose, $root_rx) = @_; + + # check extension or executable + unless($file =~ /\.(pod|pm|pl)$/i || (-f $file && -x _ && -T _)) { + return undef; + } + + # check for one line of POD + unless(open(POD,"<$file")) { + warn "Error: $file is unreadable: $!\n"; + return undef; + } + local $/ = undef; + my $pod = <POD>; + close(POD); + unless($pod =~ /\n=(head\d|pod|over|item)\b/) { + warn "No POD in $file, skipping.\n" + if($verbose); + return; + } + undef $pod; + + # strip non-significant path components + # _TODO_ what happens on e.g. Win32? + my $name = $file; + if(defined $root_rx) { + $name =~ s!$root_rx!!; + $name =~ s!$SIMPLIFY_RX!!o if(defined $SIMPLIFY_RX); + } + else { + $name =~ s:^.*/::; + } + $name =~ s/\.(pod|pm|pl)$//i; + $name =~ s!/+!::!g; + $name; +} + +# basic simplification of the POD name: +# basename & strip extension +sub simplify_name { + my ($str) = @_; + $str =~ s:^.*/::; + $str =~ s:\.p([lm]|od)$::i; + $str; +} + +1; + diff --git a/lib/Pod/Html.pm b/lib/Pod/Html.pm index 15757ec80d..4d77bc0a11 100644 --- a/lib/Pod/Html.pm +++ b/lib/Pod/Html.pm @@ -5,7 +5,7 @@ use Getopt::Long; # package for handling command-line parameters use File::Spec::Unix; require Exporter; use vars qw($VERSION); -$VERSION = 1.02; +$VERSION = 1.03; @ISA = Exporter; @EXPORT = qw(pod2html htmlify); use Cwd; @@ -176,10 +176,6 @@ Uses $Config{pod2html} to setup default options. Tom Christiansen, E<lt>tchrist@perl.comE<gt>. -=head1 BUGS - -Has trouble with C<> etc in = commands. - =head1 SEE ALSO L<perlpod> @@ -216,13 +212,8 @@ my $quiet = 0; # not quiet by default my $verbose = 0; # not verbose by default my $doindex = 1; # non-zero if we should generate an index my $listlevel = 0; # current list depth -my @listitem = (); # stack of HTML commands to use when a =item is - # encountered. the top of the stack is the - # current list. -my @listdata = (); # similar to @listitem, but for the text after - # an =item -my @listend = (); # similar to @listitem, but the text to use to - # end the list. +my @listend = (); # the text to use to end the list. +my $after_lpar = 0; # set to true after a par in an =item my $ignore = 1; # whether or not to format text. we don't # format text until we hit our first pod # directive. @@ -236,11 +227,13 @@ my $top = 1; # true if we are at the top of the doc. used # to prevent the first <HR> directive. my $paragraph; # which paragraph we're processing (used # for error messages) +my $ptQuote = 0; # status of double-quote conversion my %pages = (); # associative array used to find the location # of pages referenced by L<> links. my %sections = (); # sections within this page my %items = (); # associative array used to find the location # of =item directives referenced by C<> links +my %local_items = (); # local items - avoid destruction of %items my $Is83; # is dos with short filenames (8.3) sub init_globals { @@ -263,13 +256,8 @@ $quiet = 0; # not quiet by default $verbose = 0; # not verbose by default $doindex = 1; # non-zero if we should generate an index $listlevel = 0; # current list depth -@listitem = (); # stack of HTML commands to use when a =item is - # encountered. the top of the stack is the - # current list. -@listdata = (); # similar to @listitem, but for the text after - # an =item -@listend = (); # similar to @listitem, but the text to use to - # end the list. +@listend = (); # the text to use to end the list. +$after_lpar = 0; # set to true after a par in an =item $ignore = 1; # whether or not to format text. we don't # format text until we hit our first pod # directive. @@ -291,9 +279,28 @@ $paragraph = ''; # which paragraph we're processing (used # of pages referenced by L<> links. #%items = (); # associative array used to find the location # of =item directives referenced by C<> links +%local_items = (); $Is83=$^O eq 'dos'; } +# +# clean_data: global clean-up of pod data +# +sub clean_data($){ + my( $dataref ) = @_; + my $i; + for( $i = 0; $i <= $#$dataref; $i++ ){ + ${$dataref}[$i] =~ s/\s+\Z//; + + # have a look for all-space lines + if( ${$dataref}[$i] =~ /^\s+$/m ){ + my @chunks = split( /^\s+$/m, ${$dataref}[$i] ); + splice( @$dataref, $i, 1, @chunks ); + } + } +} + + sub pod2html { local(@ARGV) = @_; local($/); @@ -341,6 +348,7 @@ sub pod2html { $/ = ""; my @poddata = <POD>; close(POD); + clean_data( \@poddata ); # scan the pod for =head[1-6] directives and build an index my $index = scan_headings(\%sections, @poddata); @@ -410,12 +418,13 @@ END_OF_HEAD get_cache($dircache, $itemcache, \@podpath, $podroot, $recurse); # scan the pod for =item directives - scan_items("", \%items, @poddata); + scan_items( \%local_items, "", @poddata); # put an index at the top of the file. note, if $doindex is 0 we # still generate an index, but surround it with an html comment. # that way some other program can extract it if desired. $index =~ s/--+/-/g; + print HTML "<A NAME=\"__index__\"></A>\n"; print HTML "<!-- INDEX BEGIN -->\n"; print HTML "<!--\n" unless $doindex; print HTML $index; @@ -424,12 +433,16 @@ END_OF_HEAD print HTML "<HR>\n" if $doindex and $index; # now convert this file - warn "Converting input file\n" if $verbose; - foreach my $i (0..$#poddata) { + my $after_item; # set to true after an =item + warn "Converting input file $podfile\n" if $verbose; + foreach my $i (0..$#poddata){ + $ptQuote = 0; # status of quote conversion + $_ = $poddata[$i]; $paragraph = $i+1; if (/^(=.*)/s) { # is it a pod directive? $ignore = 0; + $after_item = 0; $_ = $1; if (/^=begin\s+(\S+)\s*(.*)/si) {# =begin process_begin($1, $2); @@ -443,14 +456,17 @@ END_OF_HEAD next if @begin_stack && $begin_stack[-1] ne 'html'; if (/^=(head[1-6])\s+(.*\S)/s) { # =head[1-6] heading - process_head($1, $2); - } elsif (/^=item\s*(.*\S)/sm) { # =item text - process_item($1); + process_head( $1, $2, $doindex && $index ); + } elsif (/^=item\s*(.*\S)?/sm) { # =item text + warn "$0: $podfile: =item without bullet, number or text" + . " in paragraph $paragraph.\n" if !defined($1) or $1 eq ''; + process_item( $1 ); + $after_item = 1; } elsif (/^=over\s*(.*)/) { # =over N process_over(); } elsif (/^=back/) { # =back process_back(); - } elsif (/^=for\s+(\S+)\s+(.*)/si) {# =for + } elsif (/^=for\s+(\S+)\s*(.*)/si) {# =for process_for($1,$2); } else { /^=(\S*)\s*/; @@ -464,13 +480,53 @@ END_OF_HEAD next if $ignore; next if @begin_stack && $begin_stack[-1] ne 'html'; my $text = $_; - process_text(\$text, 1); - print HTML "<P>\n$text</P>\n"; + if( $text =~ /\A\s+/ ){ + process_pre( \$text ); + print HTML "<PRE>\n$text</PRE>\n"; + + } else { + process_text( \$text ); + + # experimental: check for a paragraph where all lines + # have some ...\t...\t...\n pattern + if( $text =~ /\t/ ){ + my @lines = split( "\n", $text ); + if( @lines > 1 ){ + my $all = 2; + foreach my $line ( @lines ){ + if( $line =~ /\S/ && $line !~ /\t/ ){ + $all--; + last if $all == 0; + } + } + if( $all > 0 ){ + $text =~ s/\t+/<TD>/g; + $text =~ s/^/<TR><TD>/gm; + $text = '<TABLE CELLSPACING=0 CELLPADDING=0>' . + $text . '</TABLE>'; + } + } + } + ## end of experimental + + if( $after_item ){ + print HTML "$text\n"; + $after_lpar = 1; + } else { + print HTML "<P>$text</P>\n"; + } + } + $after_item = 0; } } # finish off any pending directives finish_list(); + + # link to page index + print HTML "<P><A HREF=\"#__index__\"><SMALL>page index</SMALL></A></P>\n" + if $doindex and $index; + print HTML <<END_OF_TAIL; $block </BODY> @@ -532,7 +588,7 @@ Usage: $0 --help --htmlroot=<name> --infile=<name> --outfile=<name> END_OF_USAGE sub parse_command_line { - my ($opt_flush,$opt_help,$opt_htmldir,$opt_htmlroot,$opt_index,$opt_infile,$opt_libpods,$opt_netscape,$opt_outfile,$opt_podpath,$opt_podroot,$opt_norecurse,$opt_recurse,$opt_title,$opt_verbose,$opt_css,$opt_header,$opt_quiet); + my ($opt_flush,$opt_help,$opt_htmldir,$opt_htmlroot,$opt_index,$opt_infile,$opt_libpods,$opt_netscape,$opt_outfile,$opt_podpath,$opt_podroot,$opt_recurse,$opt_title,$opt_verbose,$opt_css,$opt_header,$opt_quiet); unshift @ARGV, split ' ', $Config{pod2html} if $Config{pod2html}; my $result = GetOptions( 'flush' => \$opt_flush, @@ -546,7 +602,6 @@ sub parse_command_line { 'outfile=s' => \$opt_outfile, 'podpath=s' => \$opt_podpath, 'podroot=s' => \$opt_podroot, - 'norecurse' => \$opt_norecurse, 'recurse!' => \$opt_recurse, 'title=s' => \$opt_title, 'header' => \$opt_header, @@ -626,7 +681,6 @@ sub cache_key { # are valid caches of %pages and %items. if they are valid then it loads # them and returns a non-zero value. # - sub load_cache { my($dircache, $itemcache, $podpath, $podroot) = @_; my($tests); @@ -740,15 +794,17 @@ sub scan_podpath { die "$0: error opening $dirname/$pod for input: $!\n"; @poddata = <POD>; close(POD); + clean_data( \@poddata ); - scan_items("$dirname/$pod", @poddata); + scan_items( \%items, "$dirname/$pod", @poddata); } # use the names of files as =item directives too. - foreach $pod (@files) { - $pod =~ /^(.*)(\.pod|\.pm)$/; - $items{$1} = "$dirname/$1.html" if $1; - } +### Don't think this should be done this way - confuses issues.(WL) +### foreach $pod (@files) { +### $pod =~ /^(.*)(\.pod|\.pm)$/; +### $items{$1} = "$dirname/$1.html" if $1; +### } } elsif ($pages{$libpod} =~ /([^:]*\.pod):/ || $pages{$libpod} =~ /([^:]*\.pm):/) { # scan the .pod or .pm file for =item directives @@ -757,8 +813,9 @@ sub scan_podpath { die "$0: error opening $pod for input: $!\n"; @poddata = <POD>; close(POD); + clean_data( \@poddata ); - scan_items("$pod", @poddata); + scan_items( \%items, "$pod", @poddata); } else { warn "$0: shouldn't be here (line ".__LINE__."\n"; } @@ -842,7 +899,7 @@ sub scan_dir { # sub scan_headings { my($sections, @data) = @_; - my($tag, $which_head, $title, $listdepth, $index); + my($tag, $which_head, $otitle, $listdepth, $index); # here we need local $ignore = 0; # unfortunately, we can't have it, because $ignore is lexical @@ -855,9 +912,12 @@ sub scan_headings { # pointing to each of them. foreach my $line (@data) { if ($line =~ /^=(head)([1-6])\s+(.*)/) { - ($tag,$which_head, $title) = ($1,$2,$3); - chomp($title); - $$sections{htmlify(0,$title)} = 1; + ($tag, $which_head, $otitle) = ($1,$2,$3); + + my $title = depod( $otitle ); + my $name = htmlify( $title ); + $$sections{$name} = 1; + $title = process_text( \$otitle ); while ($which_head != $listdepth) { if ($which_head > $listdepth) { @@ -870,8 +930,8 @@ sub scan_headings { } $index .= "\n" . ("\t" x $listdepth) . "<LI>" . - "<A HREF=\"#" . htmlify(0,$title) . "\">" . - html_escape(process_text(\$title, 0)) . "</A></LI>"; + "<A HREF=\"#" . $name . "\">" . + $title . "</A></LI>"; } } @@ -893,7 +953,7 @@ sub scan_headings { # will use this information later on in resolving C<> links. # sub scan_items { - my($pod, @poddata) = @_; + my( $itemref, $pod, @poddata ) = @_; my($i, $item); local $_; @@ -901,28 +961,22 @@ sub scan_items { $pod .= ".html" if $pod; foreach $i (0..$#poddata) { - $_ = $poddata[$i]; - - # remove any formatting instructions - s,[A-Z]<([^<>]*)>,$1,g; - - # figure out what kind of item it is and get the first word of - # it's name. - if (/^=item\s+(\w*)\s*.*$/s) { - if ($1 eq "*") { # bullet list - /\A=item\s+\*\s*(.*?)\s*\Z/s; - $item = $1; - } elsif ($1 =~ /^\d+/) { # numbered list - /\A=item\s+\d+\.?(.*?)\s*\Z/s; - $item = $1; - } else { -# /\A=item\s+(.*?)\s*\Z/s; - /\A=item\s+(\w*)/s; - $item = $1; - } - - $items{$item} = "$pod" if $item; + my $txt = depod( $poddata[$i] ); + + # figure out what kind of item it is. + # Build string for referencing this item. + if ( $txt =~ /\A=item\s+\*\s*(.*)\Z/s ) { # bullet + next unless $1; + $item = $1; + } elsif( $txt =~ /\A=item\s+(?>\d+\.?)\s*(.*)\Z/s ) { # numbered list + $item = $1; + } elsif( $txt =~ /\A=item\s+(.*)\Z/s ) { # plain item + $item = $1; + } else { + next; } + my $fid = fragment_id( $item ); + $$itemref{$fid} = "$pod" if $fid; } } @@ -930,168 +984,167 @@ sub scan_items { # process_head - convert a pod head[1-6] tag and convert it to HTML format. # sub process_head { - my($tag, $heading) = @_; - my $firstword; + my($tag, $heading, $hasindex) = @_; # figure out the level of the =head $tag =~ /head([1-6])/; my $level = $1; - # can't have a heading full of spaces and speechmarks and so on - $firstword = $heading; $firstword =~ s/\s*(\w+)\s.*/$1/; - - print HTML "<P>\n" unless $listlevel; - print HTML "<HR>\n" unless $listlevel || $top; - print HTML "<H$level>"; # unless $listlevel; - #print HTML "<H$level>" unless $listlevel; - my $convert = $heading; process_text(\$convert, 0); - $convert = html_escape($convert); - print HTML '<A NAME="' . htmlify(0,$heading) . "\">$convert</A>"; - print HTML "</H$level>"; # unless $listlevel; - print HTML "\n"; + if( $listlevel ){ + warn "$0: $podfile: unterminated list at =head in paragraph $paragraph. ignoring.\n"; + while( $listlevel ){ + process_back(); + } + } + + print HTML "<P>\n"; + if( $level == 1 && ! $top ){ + print HTML "<A HREF=\"#__index__\"><SMALL>page index</SMALL></A>\n" + if $hasindex; + print HTML "<HR>\n" + } + + my $name = htmlify( depod( $heading ) ); + my $convert = process_text( \$heading ); + print HTML "<H$level><A NAME=\"$name\">$convert</A></H$level>\n"; } + # -# process_item - convert a pod item tag and convert it to HTML format. +# emit_item_tag - print an =item's text +# Note: The global $EmittedItem is used for inhibiting self-references. # -sub process_item { - my $text = $_[0]; - my($i, $quote, $name); +my $EmittedItem; - my $need_preamble = 0; - my $this_entry; +sub emit_item_tag($$$){ + my( $otext, $text, $compact ) = @_; + my $item = fragment_id( $text ); + + $EmittedItem = $item; + ### print STDERR "emit_item_tag=$item ($text)\n"; + + print HTML '<STRONG>'; + if ($items_named{$item}++) { + print HTML process_text( \$otext ); + } else { + my $name = 'item_' . $item; + print HTML qq{<A NAME="$name">}, process_text( \$otext ), '</A>'; + } + print HTML "</STRONG><BR>\n"; + undef( $EmittedItem ); +} + +sub emit_li { + my( $tag ) = @_; + if( $items_seen[$listlevel]++ == 0 ){ + push( @listend, "</$tag>" ); + print HTML "<$tag>\n"; + } + print HTML $tag eq 'DL' ? '<DT>' : '<LI>'; +} +# +# process_item - convert a pod item tag and convert it to HTML format. +# +sub process_item { + my( $otext ) = @_; # lots of documents start a list without doing an =over. this is # bad! but, the proper thing to do seems to be to just assume # they did do an =over. so warn them once and then continue. - warn "$0: $podfile: unexpected =item directive in paragraph $paragraph. ignoring.\n" - unless $listlevel; - process_over() unless $listlevel; + if( $listlevel == 0 ){ + warn "$0: $podfile: unexpected =item directive in paragraph $paragraph. ignoring.\n"; + process_over(); + } - return unless $listlevel; + # formatting: insert a paragraph if preceding item has >1 paragraph + if( $after_lpar ){ + print HTML "<P></P>\n"; + $after_lpar = 0; + } # remove formatting instructions from the text - 1 while $text =~ s/[A-Z]<([^<>]*)>/$1/g; - pre_escape(\$text); - - $need_preamble = $items_seen[$listlevel]++ == 0; - - # check if this is the first =item after an =over - $i = $listlevel - 1; - my $need_new = $listlevel >= @listitem; - - if ($text =~ /\A\*/) { # bullet - - if ($need_preamble) { - push(@listend, "</UL>"); - print HTML "<UL>\n"; + my $text = depod( $otext ); + + # all the list variants: + if( $text =~ /\A\*/ ){ # bullet + emit_li( 'UL' ); + if ($text =~ /\A\*\s+(.+)\Z/s ) { # with additional text + my $tag = $1; + $otext =~ s/\A\*\s+//; + emit_item_tag( $otext, $tag, 1 ); } - print HTML '<LI>'; - if ($text =~ /\A\*\s*(.+)\Z/s) { - print HTML '<STRONG>'; - if ($items_named{$1}++) { - print HTML html_escape($1); - } else { - my $name = 'item_' . htmlify(1,$1); - print HTML qq(<A NAME="$name">), html_escape($1), '</A>'; - } - print HTML '</STRONG>'; + } elsif( $text =~ /\A\d+/ ){ # numbered list + emit_li( 'OL' ); + if ($text =~ /\A(?>\d+\.?)\s*(.+)\Z/s ) { # with additional text + my $tag = $1; + $otext =~ s/\A\d+\.?\s*//; + emit_item_tag( $otext, $tag, 1 ); } - } elsif ($text =~ /\A[\d#]+/) { # numbered list - - if ($need_preamble) { - push(@listend, "</OL>"); - print HTML "<OL>\n"; - } - - print HTML '<LI>'; - if ($text =~ /\A\d+\.?\s*(.+)\Z/s) { - print HTML '<STRONG>'; - if ($items_named{$1}++) { - print HTML html_escape($1); - } else { - my $name = 'item_' . htmlify(0,$1); - print HTML qq(<A NAME="$name">), html_escape($1), '</A>'; - } - print HTML '</STRONG>'; - } - - } else { # all others - - if ($need_preamble) { - push(@listend, '</DL>'); - print HTML "<DL>\n"; - } - - print HTML '<DT>'; - if ($text =~ /(\S+)/) { - print HTML '<STRONG>'; - if ($items_named{$1}++) { - print HTML html_escape($text); - } else { - my $name = 'item_' . htmlify(1,$text); - print HTML qq(<A NAME="$name">), html_escape($text), '</A>'; - } - print HTML '</STRONG>'; + } else { # definition list + emit_li( 'DL' ); + if ($text =~ /\A(.+)\Z/s ){ # should have text + emit_item_tag( $otext, $text, 1 ); } print HTML '<DD>'; } - print HTML "\n"; } # -# process_over - process a pod over tag and start a corresponding HTML -# list. +# process_over - process a pod over tag and start a corresponding HTML list. # sub process_over { # start a new list $listlevel++; + push( @items_seen, 0 ); + $after_lpar = 0; } # # process_back - process a pod back tag and convert it to HTML format. # sub process_back { - warn "$0: $podfile: unexpected =back directive in paragraph $paragraph. ignoring.\n" - unless $listlevel; - return unless $listlevel; + if( $listlevel == 0 ){ + warn "$0: $podfile: unexpected =back directive in paragraph $paragraph. ignoring.\n"; + return; + } # close off the list. note, I check to see if $listend[$listlevel] is # defined because an =item directive may have never appeared and thus # $listend[$listlevel] may have never been initialized. $listlevel--; - print HTML $listend[$listlevel] if defined $listend[$listlevel]; - print HTML "\n"; - - # don't need the corresponding perl code anymore - pop(@listitem); - pop(@listdata); - pop(@listend); + if( defined $listend[$listlevel] ){ + print HTML '<P></P>' if $after_lpar; + print HTML $listend[$listlevel]; + print HTML "\n"; + pop( @listend ); + } + $after_lpar = 0; - pop(@items_seen); + # clean up item count + pop( @items_seen ); } # -# process_cut - process a pod cut tag, thus stop ignoring pod directives. +# process_cut - process a pod cut tag, thus start ignoring pod directives. # sub process_cut { $ignore = 1; } # -# process_pod - process a pod pod tag, thus ignore pod directives until we see a -# corresponding cut. +# process_pod - process a pod pod tag, thus stop ignoring pod directives +# until we see a corresponding cut. # sub process_pod { # no need to set $ignore to 0 cause the main loop did it } # -# process_for - process a =for pod tag. if it's for html, split +# process_for - process a =for pod tag. if it's for html, spit # it out verbatim, if illustration, center it, otherwise ignore it. # sub process_for { @@ -1131,78 +1184,69 @@ sub process_end { if ($begin_stack[-1] ne $whom ) { die "Unmatched begin/end at chunk $paragraph\n" } - pop @begin_stack; + pop( @begin_stack ); } # -# process_text - handles plaintext that appears in the input pod file. -# there may be pod commands embedded within the text so those must be -# converted to html commands. +# process_pre - indented paragraph, made into <PRE></PRE> # -sub process_text { - my($text, $escapeQuotes) = @_; - my($result, $rest, $s1, $s2, $s3, $s4, $match, $bf); - my($podcommand, $params, $tag, $quote); - +sub process_pre { + my( $text ) = @_; + my( $rest ); return if $ignore; - $quote = 0; # status of double-quote conversion - $result = ""; $rest = $$text; - if ($rest =~ /^\s+/) { # preformatted text, no pod directives - $rest =~ s/\n+\Z//; - $rest =~ s#.*# + # insert spaces in place of tabs + $rest =~ s#.*# my $line = $&; 1 while $line =~ s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e; $line; #eg; - $rest =~ s/&/&/g; - $rest =~ s/</</g; - $rest =~ s/>/>/g; - $rest =~ s/"/"/g; - - # try and create links for all occurrences of perl.* within - # the preformatted text. - $rest =~ s{ - (\s*)(perl\w+) - }{ - if (defined $pages{$2}) { # is a link - qq($1<A HREF="$htmlroot/$pages{$2}">$2</A>); - } elsif (defined $pages{dosify($2)}) { # is a link - qq($1<A HREF="$htmlroot/$pages{dosify($2)}">$2</A>); - } else { - "$1$2"; - } - }xeg; -# $rest =~ s/(<A HREF=)([^>:]*:)?([^>:]*)\.pod:([^>:]*:)?/$1$3.html/g; - $rest =~ s{ - (<A\ HREF="?) ([^>:]*:)? ([^>:]*) \.pod: ([^>:]*:)? - }{ - my $url ; - if ( $htmlfileurl ne '' ) { - # Here, we take advantage of the knowledge - # that $htmlfileurl ne '' implies $htmlroot eq ''. - # Since $htmlroot eq '', we need to prepend $htmldir - # on the fron of the link to get the absolute path - # of the link's target. We check for a leading '/' - # to avoid corrupting links that are #, file:, etc. - my $old_url = $3 ; - $old_url = "$htmldir$old_url" - if ( $old_url =~ m{^\/} ) ; - $url = relativize_url( "$old_url.html", $htmlfileurl ); -# print( " a: [$old_url.html,$htmlfileurl,$url]\n" ) ; - } - else { - $url = "$3.html" ; - } - "$1$url" ; - }xeg; - - # Look for embedded URLs and make them in to links. We don't - # relativize them since they are best left as the author intended. - my $urls = '(' . join ('|', qw{ + # convert some special chars to HTML escapes + $rest =~ s/&/&/g; + $rest =~ s/</</g; + $rest =~ s/>/>/g; + $rest =~ s/"/"/g; + + # try and create links for all occurrences of perl.* within + # the preformatted text. + $rest =~ s{ + (\s*)(perl\w+) + }{ + if ( defined $pages{$2} ){ # is a link + qq($1<A HREF="$htmlroot/$pages{$2}">$2</A>); + } elsif (defined $pages{dosify($2)}) { # is a link + qq($1<A HREF="$htmlroot/$pages{dosify($2)}">$2</A>); + } else { + "$1$2"; + } + }xeg; + $rest =~ s{ + (<A\ HREF="?) ([^>:]*:)? ([^>:]*) \.pod: ([^>:]*:)? + }{ + my $url ; + if ( $htmlfileurl ne '' ){ + # Here, we take advantage of the knowledge + # that $htmlfileurl ne '' implies $htmlroot eq ''. + # Since $htmlroot eq '', we need to prepend $htmldir + # on the fron of the link to get the absolute path + # of the link's target. We check for a leading '/' + # to avoid corrupting links that are #, file:, etc. + my $old_url = $3 ; + $old_url = "$htmldir$old_url" if $old_url =~ m{^\/}; + $url = relativize_url( "$old_url.html", $htmlfileurl ); + } else { + $url = "$3.html" ; + } + "$1$url" ; + }xeg; + + # Look for embedded URLs and make them into links. We don't + # relativize them since they are best left as the author intended. + + my $urls = '(' . join ('|', qw{ http telnet mailto @@ -1214,12 +1258,12 @@ sub process_text { } ) . ')'; - my $ltrs = '\w'; - my $gunk = '/#~:.?+=&%@!\-'; - my $punc = '.:?\-'; - my $any = "${ltrs}${gunk}${punc}"; + my $ltrs = '\w'; + my $gunk = '/#~:.?+=&%@!\-'; + my $punc = '.:?\-'; + my $any = "${ltrs}${gunk}${punc}"; - $rest =~ s{ + $rest =~ s{ \b # start at word boundary ( # begin $1 { $urls : # need resource and a colon @@ -1237,166 +1281,76 @@ sub process_text { ) }{<A HREF="$1">$1</A>}igox; - $result = "<PRE>" # text should be as it is (verbatim) - . "$rest\n" - . "</PRE>\n"; - } else { # formatted text - # parse through the string, stopping each time we find a - # pod-escape. once the string has been throughly processed - # we can output it. - while (length $rest) { - # check to see if there are any possible pod directives in - # the remaining part of the text. - if ($rest =~ m/[BCEIFLSZ]</) { - warn "\$rest\t= $rest\n" unless - $rest =~ /\A - ([^<]*?) - ([BCEIFLSZ]?) - < - (.*)\Z/xs; - - $s1 = $1; # pure text - $s2 = $2; # the type of pod-escape that follows - $s3 = '<'; # '<' - $s4 = $3; # the rest of the string - } else { - $s1 = $rest; - $s2 = ""; - $s3 = ""; - $s4 = ""; - } - - if ($s3 eq '<' && $s2) { # a pod-escape - $result .= ($escapeQuotes ? process_puretext($s1, \$quote) : $s1); - $podcommand = "$s2<"; - $rest = $s4; - - # find the matching '>' - $match = 1; - $bf = 0; - while ($match && !$bf) { - $bf = 1; - if ($rest =~ /\A([^<>]*[BCEIFLSZ]<)(.*)\Z/s) { - $bf = 0; - $match++; - $podcommand .= $1; - $rest = $2; - } elsif ($rest =~ /\A([^>]*>)(.*)\Z/s) { - $bf = 0; - $match--; - $podcommand .= $1; - $rest = $2; - } - } - - if ($match != 0) { - warn <<WARN; -$0: $podfile: cannot find matching > for $s2 in paragraph $paragraph. -WARN - $result .= substr $podcommand, 0, 2; - $rest = substr($podcommand, 2) . $rest; - next; - } + # text should be as it is (verbatim) + $$text = $rest; +} - # pull out the parameters to the pod-escape - $podcommand =~ /^([BCFEILSZ]?)<(.*)>$/s; - $tag = $1; - $params = $2; - - # process the text within the pod-escape so that any escapes - # which must occur do. - process_text(\$params, 0) unless $tag eq 'L'; - - $s1 = $params; - if (!$tag || $tag eq " ") { # <> : no tag - $s1 = "<$params>"; - } elsif ($tag eq "L") { # L<> : link - $s1 = process_L($params); - } elsif ($tag eq "I" || # I<> : italicize text - $tag eq "B" || # B<> : bold text - $tag eq "F") { # F<> : file specification - $s1 = process_BFI($tag, $params); - } elsif ($tag eq "C") { # C<> : literal code - $s1 = process_C($params, 1); - } elsif ($tag eq "E") { # E<> : escape - $s1 = process_E($params); - } elsif ($tag eq "Z") { # Z<> : zero-width character - $s1 = process_Z($params); - } elsif ($tag eq "S") { # S<> : non-breaking space - $s1 = process_S($params); - } elsif ($tag eq "X") { # S<> : non-breaking space - $s1 = process_X($params); - } else { - warn "$0: $podfile: unhandled tag '$tag' in paragraph $paragraph\n"; - } - $result .= "$s1"; - } else { - # for pure text we must deal with implicit links and - # double-quotes among other things. - $result .= ($escapeQuotes ? process_puretext("$s1$s2$s3", \$quote) : "$s1$s2$s3"); - $rest = $s4; - } - } - } - $$text = $result; +# +# pure text processing +# +# pure_text/inIS_text: differ with respect to automatic C<> recognition. +# we don't want this to happen within IS +# +sub pure_text($){ + my $text = shift(); + process_puretext( $text, \$ptQuote, 1 ); } -sub html_escape { - my $rest = $_[0]; - $rest =~ s/&(?!\w+;|#)/&/g; # XXX not bulletproof - $rest =~ s/</</g; - $rest =~ s/>/>/g; - $rest =~ s/"/"/g; - return $rest; -} +sub inIS_text($){ + my $text = shift(); + process_puretext( $text, \$ptQuote, 0 ); +} # # process_puretext - process pure text (without pod-escapes) converting # double-quotes and handling implicit C<> links. # sub process_puretext { - my($text, $quote) = @_; - my(@words, $result, $rest, $lead, $trail); + my($text, $quote, $notinIS) = @_; - # convert double-quotes to single-quotes - $text =~ s/\A([^"]*)"/$1''/s if $$quote; - while ($text =~ s/\A([^"]*)["]([^"]*)["]/$1``$2''/sg) {} + ## Guessing at func() or [$@%&]*var references in plain text is destined + ## to produce some strange looking ref's. uncomment to disable: + ## $notinIS = 0; + + my(@words, $lead, $trail); - $$quote = ($text =~ m/"/ ? 1 : 0); - $text =~ s/\A([^"]*)"/$1``/s if $$quote; + # convert double-quotes to single-quotes + if( $$quote && $text =~ s/"/''/s ){ + $$quote = 0; + } + while ($text =~ s/"([^"]*)"/``$1''/sg) {}; + $$quote = 1 if $text =~ s/"/``/s; # keep track of leading and trailing white-space - $lead = ($text =~ /\A(\s*)/s ? $1 : ""); - $trail = ($text =~ /(\s*)\Z/s ? $1 : ""); + $lead = ($text =~ s/\A(\s+)//s ? $1 : ""); + $trail = ($text =~ s/(\s+)\Z//s ? $1 : ""); - # collapse all white space into a single space - $text =~ s/\s+/ /g; - @words = split(" ", $text); + # split at space/non-space boundaries + @words = split( /(?<=\s)(?=\S)|(?<=\S)(?=\s)/, $text ); # process each word individually foreach my $word (@words) { + # skip space runs + next if $word =~ /^\s*$/; # see if we can infer a link - if ($word =~ /^\w+\(/) { + if( $notinIS && $word =~ s/^(\w+)\((.*)\)\W*$/$1/ ) { # has parenthesis so should have been a C<> ref - $word = process_C($word); -# $word =~ /^[^()]*]\(/; -# if (defined $items{$1} && $items{$1}) { -# $word = "\n<CODE><A HREF=\"$htmlroot/$items{$1}#item_" -# . htmlify(0,$word) -# . "\">$word</A></CODE>"; -# } elsif (defined $items{$word} && $items{$word}) { -# $word = "\n<CODE><A HREF=\"$htmlroot/$items{$word}#item_" -# . htmlify(0,$word) -# . "\">$word</A></CODE>"; -# } else { -# $word = "\n<CODE><A HREF=\"#item_" -# . htmlify(0,$word) -# . "\">$word</A></CODE>"; -# } - } elsif ($word =~ /^[\$\@%&*]+\w+$/) { - # perl variables, should be a C<> ref - $word = process_C($word, 1); + ## try for a pagename (perlXXX(1))? + if( $2 =~ /^\d+$/ ){ + my $url = page_sect( $word, '' ); + if( defined $url ){ + $word = "<A HREF=\"$url\">the $word manpage</A>"; + next; + } + } + $word = emit_C( $word ); + +#### disabled. either all (including $\W, $\w+{.*} etc.) or nothing. +## } elsif( $notinIS && $word =~ /^[\$\@%&*]+\w+$/) { +## # perl variables, should be a C<> ref +## $word = emit_C( $word ); + } elsif ($word =~ m,^\w+://\w,) { # looks like a URL # Don't relativize it: leave it as the author intended @@ -1415,37 +1369,270 @@ sub process_puretext { } } - # build a new string based upon our conversion - $result = ""; - $rest = join(" ", @words); - while (length($rest) > 75) { - if ( $rest =~ m/^(.{0,75})\s(.*?)$/o || - $rest =~ m/^(\S*)\s(.*?)$/o) { + # put everything back together + return $lead . join( '', @words ) . $trail; +} + - $result .= "$1\n"; - $rest = $2; +# +# process_text - handles plaintext that appears in the input pod file. +# there may be pod commands embedded within the text so those must be +# converted to html commands. +# + +sub process_text1($$;$); + +sub process_text { + return if $ignore; + my( $tref ) = @_; + my $res = process_text1( 0, $tref ); + $$tref = $res; +} + +sub process_text1($$;$){ + my( $lev, $rstr, $func ) = @_; + $lev++ unless defined $func; + my $res = ''; + + $func ||= ''; + if( $func eq 'B' ){ + # B<text> - boldface + $res = '<STRONG>' . process_text1( $lev, $rstr ) . '</STRONG>'; + + } elsif( $func eq 'C' ){ + # C<code> - can be a ref or <CODE></CODE> + # need to extract text + my $par = go_ahead( $rstr, 'C' ); + + ## clean-up of the link target + my $text = depod( $par ); + + ### my $x = $par =~ /[BI]</ ? 'yes' : 'no' ; + ### print STDERR "-->call emit_C($par) lev=$lev, par with BI=$x\n"; + + $res = emit_C( $text, $lev > 1 || ($par =~ /[BI]</) ); + + } elsif( $func eq 'E' ){ + # E<x> - convert to character + $$rstr =~ s/^(\w+)>//; + $res = "&$1;"; + + } elsif( $func eq 'F' ){ + # F<filename> - italizice + $res = '<EM>' . process_text1( $lev, $rstr ) . '</EM>'; + + } elsif( $func eq 'I' ){ + # I<text> - italizice + $res = '<EM>' . process_text1( $lev, $rstr ) . '</EM>'; + + } elsif( $func eq 'L' ){ + # L<link> - link + ## L<text|cross-ref> => produce text, use cross-ref for linking + ## L<cross-ref> => make text from cross-ref + ## need to extract text + my $par = go_ahead( $rstr, 'L' ); + + # some L<>'s that shouldn't be: + # a) full-blown URL's are emitted as-is + if( $par =~ m{^\w+://}s ){ + return make_URL_href( $par ); + } + # b) C<...> is stripped and treated as C<> + if( $par =~ /^C<(.*)>$/ ){ + my $text = depod( $1 ); + return emit_C( $text, $lev > 1 || ($par =~ /[BI]</) ); + } + + # analyze the contents + $par =~ s/\n/ /g; # undo word-wrapped tags + my $opar = $par; + my $linktext; + if( $par =~ s{^([^|]+)\|}{} ){ + $linktext = $1; + } + + # make sure sections start with a / + $par =~ s{^"}{/"}; + + my( $page, $section, $ident ); + + # check for link patterns + if( $par =~ m{^([^/]+?)/(?!")(.*?)$} ){ # name/ident + # we've got a name/ident (no quotes) + ( $page, $ident ) = ( $1, $2 ); + ### print STDERR "--> L<$par> to page $page, ident $ident\n"; + + } elsif( $par =~ m{^(.*?)/"?(.*?)"?$} ){ # [name]/"section" + # even though this should be a "section", we go for ident first + ( $page, $ident ) = ( $1, $2 ); + ### print STDERR "--> L<$par> to page $page, section $section\n"; + + } elsif( $par =~ /\s/ ){ # this must be a section with missing quotes + ( $page, $section ) = ( '', $par ); + ### print STDERR "--> L<$par> to void page, section $section\n"; + + } else { + ( $page, $section ) = ( $par, '' ); + ### print STDERR "--> L<$par> to page $par, void section\n"; + } + + # now, either $section or $ident is defined. the convoluted logic + # below tries to resolve L<> according to what the user specified. + # failing this, we try to find the next best thing... + my( $url, $ltext, $fid ); + + RESOLVE: { + if( defined $ident ){ + ## try to resolve $ident as an item + ( $url, $fid ) = coderef( $page, $ident ); + if( $url ){ + if( ! defined( $linktext ) ){ + $linktext = $ident; + $linktext .= " in " if $ident && $page; + $linktext .= "the $page manpage" if $page; + } + ### print STDERR "got coderef url=$url\n"; + last RESOLVE; + } + ## no luck: go for a section (auto-quoting!) + $section = $ident; + } + ## now go for a section + my $htmlsection = htmlify( $section ); + $url = page_sect( $page, $htmlsection ); + if( $url ){ + if( ! defined( $linktext ) ){ + $linktext = $section; + $linktext .= " in " if $section && $page; + $linktext .= "the $page manpage" if $page; + } + ### print STDERR "got page/section url=$url\n"; + last RESOLVE; + } + ## no luck: go for an ident + if( $section ){ + $ident = $section; + } else { + $ident = $page; + $page = undef(); + } + ( $url, $fid ) = coderef( $page, $ident ); + if( $url ){ + if( ! defined( $linktext ) ){ + $linktext = $ident; + $linktext .= " in " if $ident && $page; + $linktext .= "the $page manpage" if $page; + } + ### print STDERR "got section=>coderef url=$url\n"; + last RESOLVE; + } + + # warning; show some text. + $linktext = $opar unless defined $linktext; + warn "$0: $podfile: cannot resolve L<$opar> in paragraph $paragraph."; + } + + # now we have an URL or just plain code + $$rstr = $linktext . '>' . $$rstr; + if( defined( $url ) ){ + $res = "<A HREF=\"$url\">" . process_text1( $lev, $rstr ) . '</A>'; + } else { + $res = '<EM>' . process_text1( $lev, $rstr ) . '</EM>'; + } + + } elsif( $func eq 'S' ){ + # S<text> - non-breaking spaces + $res = process_text1( $lev, $rstr ); + $res =~ s/ / /g; + + } elsif( $func eq 'X' ){ + # X<> - ignore + $$rstr =~ s/^[^>]*>//; + + } elsif( $func eq 'Z' ){ + # Z<> - empty + warn "$0: $podfile: invalid X<> in paragraph $paragraph." + unless $$rstr =~ s/^>//; + + } else { + while( $$rstr =~ s/\A(.*?)([BCEFILSXZ]<|>)//s ){ + # all others: either recurse into new function or + # terminate at closing angle bracket + my $pt = $1; + $pt .= '>' if $2 eq '>' && $lev == 1; + $res .= $lev == 1 ? pure_text( $pt ) : inIS_text( $pt ); + return $res if $2 eq '>' && $lev > 1; + if( $2 ne '>' ){ + $res .= process_text1( $lev, $rstr, substr($2,0,1) ); + } + + } + if( $lev == 1 ){ + $res .= pure_text( $$rstr ); } else { - $result .= "$rest\n"; - $rest = ""; + warn "$0: $podfile: undelimited $func<> in paragraph $paragraph."; } } - $result .= $rest if $rest; - - # restore the leading and trailing white-space - $result = "$lead$result$trail"; + return $res; +} - return $result; +# +# go_ahead: extract text of an IS (can be nested) +# +sub go_ahead($$){ + my( $rstr, $func ) = @_; + my $res = ''; + my $level = 1; + while( $$rstr =~ s/\A(.*?)([BCEFILSXZ]<|>)//s ){ + $res .= $1; + if( $2 eq '>' ){ + return $res if --$level == 0; + } else { + ++$level; + } + $res .= $2; + } + warn "$0: $podfile: undelimited $func<> in paragraph $paragraph."; + return $res; } # -# pre_escape - convert & in text to $amp; +# emit_C - output result of C<text> +# $text is the depod-ed text # -sub pre_escape { - my($str) = @_; - $$str =~ s/&(?!\w+;|#)/&/g; # XXX not bulletproof +sub emit_C($;$){ + my( $text, $nocode ) = @_; + my $res; + my( $url, $fid ) = coderef( undef(), $text ); + + # need HTML-safe text + my $linktext = html_escape( $text ); + + if( defined( $url ) && + (!defined( $EmittedItem ) || $EmittedItem ne $fid ) ){ + $res = "<A HREF=\"$url\"><CODE>$linktext</CODE></A>"; + } elsif( 0 && $nocode ){ + $res = $linktext; + } else { + $res = "<CODE>$linktext</CODE>"; + } + return $res; } # +# html_escape: make text safe for HTML +# +sub html_escape { + my $rest = $_[0]; + $rest =~ s/&/&/g; + $rest =~ s/</</g; + $rest =~ s/>/>/g; + $rest =~ s/"/"/g; + return $rest; +} + + +# # dosify - convert filenames to 8.3 # sub dosify { @@ -1460,54 +1647,24 @@ sub dosify { } # -# process_L - convert a pod L<> directive to a corresponding HTML link. -# most of the links made are inferred rather than known about directly -# (i.e it's not known whether the =head\d section exists in the target file, -# or whether a .pod file exists in the case of split files). however, the -# guessing usually works. +# page_sect - make an URL from the text of a L<> # -# Unlike the other directives, this should be called with an unprocessed -# string, else tags in the link won't be matched. -# -sub process_L { - my($str) = @_; - my($s1, $s2, $linktext, $page, $page83, $section, $link); # work strings - - $str =~ s/\n/ /g; # undo word-wrapped tags - $s1 = $str; - for ($s1) { - # LREF: a la HREF L<show this text|man/section> - $linktext = $1 if s:^([^|]+)\|::; - - # make sure sections start with a / - s,^",/",g; - s,^,/,g if (!m,/, && / /); - - # check if there's a section specified - if (m,^(.*?)/"?(.*?)"?$,) { # yes - ($page, $section) = ($1, $2); - } else { # no - ($page, $section) = ($_, ""); - } - - # check if we know that this is a section in this page - if (!defined $pages{$page} && defined $sections{$page}) { - $section = $page; - $page = ""; - } - - # remove trailing punctuation, like () - $section =~ s/\W*$// ; +sub page_sect($$) { + my( $page, $section ) = @_; + my( $linktext, $page83, $link); # work strings + + # check if we know that this is a section in this page + if (!defined $pages{$page} && defined $sections{$page}) { + $section = $page; + $page = ""; + ### print STDERR "reset page='', section=$section\n"; } $page83=dosify($page); $page=$page83 if (defined $pages{$page83}); if ($page eq "") { - $link = "#" . htmlify(0,$section); - $linktext = $section unless defined($linktext); + $link = "#" . htmlify( $section ); } elsif ( $page =~ /::/ ) { - $linktext = ($section ? "$section" : "$page") - unless defined($linktext); $page =~ s,::,/,g; # Search page cache for an entry keyed under the html page name, # then look to see what directory that page might be in. NOTE: @@ -1529,45 +1686,42 @@ sub process_L { # but A::C is found in lib/A/C.pm, then A::B is assumed to be in # lib/A/B.pm. This is also limited, but it's an improvement. # Maybe a hints file so that the links point to the correct places - # non-theless? - # Also, maybe put a warn "$0: cannot resolve..." here. + # nonetheless? + } $link = "$htmlroot/$page.html"; - $link .= "#" . htmlify(0,$section) if ($section); + $link .= "#" . htmlify( $section ) if ($section); } elsif (!defined $pages{$page}) { - warn "$0: $podfile: cannot resolve L<$str> in paragraph $paragraph: no such page '$page'\n" unless $quiet; $link = ""; - $linktext = $page unless defined($linktext); } else { - $linktext = ($section ? "$section" : "the $page manpage") unless defined($linktext); - $section = htmlify(0,$section) if $section ne ""; + $section = htmlify( $section ) if $section ne ""; + ### print STDERR "...section=$section\n"; # if there is a directory by the name of the page, then assume that an # appropriate section will exist in the subdirectory # if ($section ne "" && $pages{$page} =~ /([^:]*[^(\.pod|\.pm)]):/) { if ($section ne "" && $pages{$page} =~ /([^:]*(?<!\.pod)(?<!\.pm)):/) { $link = "$htmlroot/$1/$section.html"; + ### print STDERR "...link=$link\n"; # since there is no directory by the name of the page, the section will # have to exist within a .html of the same name. thus, make sure there # is a .pod or .pm that might become that .html } else { - $section = "#$section"; + $section = "#$section" if $section; + ### print STDERR "...section=$section\n"; + # check if there is a .pod with the page name if ($pages{$page} =~ /([^:]*)\.pod:/) { $link = "$htmlroot/$1.html$section"; } elsif ($pages{$page} =~ /([^:]*)\.pm:/) { $link = "$htmlroot/$1.html$section"; } else { - warn "$0: $podfile: cannot resolve L$str in paragraph $paragraph: ". - "no .pod or .pm found\n"; $link = ""; - $linktext = $section unless defined($linktext); } } } - process_text(\$linktext, 0); if ($link) { # Here, we take advantage of the knowledge that $htmlfileurl ne '' # implies $htmlroot eq ''. This means that the link in question @@ -1576,21 +1730,18 @@ sub process_L { # for other kinds of links, like file:, ftp:, etc. my $url ; if ( $htmlfileurl ne '' ) { - $link = "$htmldir$link" - if ( $link =~ m{^/} ) ; - - $url = relativize_url( $link, $htmlfileurl ) ; -# print( " b: [$link,$htmlfileurl,$url]\n" ) ; + $link = "$htmldir$link" if $link =~ m{^/}; + $url = relativize_url( $link, $htmlfileurl ); +# print( " b: [$link,$htmlfileurl,$url]\n" ); } else { $url = $link ; } + return $url; - $s1 = "<A HREF=\"$url\">$linktext</A>"; } else { - $s1 = "<EM>$linktext</EM>"; + return undef(); } - return $s1; } # @@ -1626,110 +1777,63 @@ sub relativize_url { return $rel_path ; } -# -# process_BFI - process any of the B<>, F<>, or I<> pod-escapes and -# convert them to corresponding HTML directives. -# -sub process_BFI { - my($tag, $str) = @_; - my($s1); # work string - my(%repltext) = ( 'B' => 'STRONG', - 'F' => 'EM', - 'I' => 'EM'); - - # extract the modified text and convert to HTML - $s1 = "<$repltext{$tag}>$str</$repltext{$tag}>"; - return $s1; -} # -# process_C - process the C<> pod-escape. +# coderef - make URL from the text of a C<> # -sub process_C { - my($str, $doref) = @_; - my($s1, $s2); +sub coderef($$){ + my( $page, $item ) = @_; + my( $url ); + + my $fid = fragment_id( $item ); + return( $url, $fid ); + if( defined( $page ) ){ + # we have been given a $page... + $page =~ s{::}{/}g; + + # Do we take it? Item could be a section! + my $base = $items{$fid} || ""; + $base =~ s{[^/]*/}{}; + if( $base ne "$page.html" ){ + ### print STDERR "coderef( $page, $item ): items{$fid} = $items{$fid} = $base => discard page!\n"; + $page = undef(); + } - $s1 = $str; - $s1 =~ s/\([^()]*\)//g; # delete parentheses - $s2 = $s1; - $s1 =~ s/\W//g; # delete bogus characters - $str = html_escape($str); + } else { + # no page - local items precede cached items + if( exists $local_items{$fid} ){ + $page = $local_items{$fid}; + } else { + $page = $items{$fid}; + } + } # if there was a pod file that we found earlier with an appropriate # =item directive, then create a link to that page. - if ($doref && defined $items{$s1}) { - if ( $items{$s1} ) { - my $link = "$htmlroot/$items{$s1}#item_" . htmlify(0,$s2) ; - # Here, we take advantage of the knowledge that $htmlfileurl ne '' - # implies $htmlroot eq ''. - my $url ; - if ( $htmlfileurl ne '' ) { - $link = "$htmldir$link" ; - $url = relativize_url( $link, $htmlfileurl ) ; - } - else { - $url = $link ; + if( defined $page ){ + if( $page ){ + if( exists $pages{$page} and $pages{$page} =~ /([^:.]*)\.[^:]*:/){ + $page = $1 . '.html'; } - $s1 = "<A HREF=\"$url\">$str</A>" ; - } - else { - $s1 = "<A HREF=\"#item_" . htmlify(0,$s2) . "\">$str</A>" ; - } - $s1 =~ s,(perl\w+/(\S+)\.html)#item_\2\b,$1,; - confess "s1 has space: $s1" if $s1 =~ /HREF="[^"]*\s[^"]*"/; - } else { - $s1 = "<CODE>$str</CODE>"; - # warn "$0: $podfile: cannot resolve C<$str> in paragraph $paragraph\n" if $verbose - } - - - return $s1; -} - -# -# process_E - process the E<> pod directive which seems to escape a character. -# -sub process_E { - my($str) = @_; - - for ($str) { - s,([^/].*),\&$1\;,g; - } - - return $str; -} - -# -# process_Z - process the Z<> pod directive which really just amounts to -# ignoring it. this allows someone to start a paragraph with an = -# -sub process_Z { - my($str) = @_; - - # there is no equivalent in HTML for this so just ignore it. - $str = ""; - return $str; -} + my $link = "$htmlroot/$page#item_$fid"; -# -# process_S - process the S<> pod directive which means to convert all -# spaces in the string to non-breaking spaces (in HTML-eze). -# -sub process_S { - my($str) = @_; + # Here, we take advantage of the knowledge that $htmlfileurl + # ne '' implies $htmlroot eq ''. + if ( $htmlfileurl ne '' ) { + $link = "$htmldir$link" ; + $url = relativize_url( $link, $htmlfileurl ) ; + } else { + $url = $link ; + } + } else { + $url = "#item_" . $fid; + } - # convert all spaces in the text to non-breaking spaces in HTML. - $str =~ s/ / /g; - return $str; + confess "url has space: $url" if $url =~ /"[^"]*\s[^"]*"/; + } + return( $url, $fid ); } -# -# process_X - this is supposed to make an index entry. we'll just -# ignore it. -# -sub process_X { - return ''; -} # @@ -1757,29 +1861,129 @@ sub finish_list { # # htmlify - converts a pod section specification to a suitable section -# specification for HTML. if first arg is 1, only takes 1st word. +# specification for HTML. Note that we keep spaces and special characters +# except ", ? (Netscape problem) and the hyphen (writer's problem...). # sub htmlify { - my($compact, $heading) = @_; + my( $heading) = @_; + $heading =~ s/(\s+)/ /g; + $heading =~ s/\s+\Z//; + $heading =~ s/\A\s+//; + # The hyphen is a disgrace to the English language. + $heading =~ s/[-"?]//g; + $heading = lc( $heading ); + return $heading; +} - if ($compact) { - $heading =~ /^(\w+)/; - $heading = $1; - } +# +# depod - convert text by eliminating all interior sequences +# Note: can be called with copy or modify semantics +# +my %E2c; +$E2c{lt} = '<'; +$E2c{gt} = '>'; +$E2c{sol} = '/'; +$E2c{verbar} = '|'; + +sub depod1($;$); + +sub depod($){ + my $string; + if( ref( $_[0] ) ){ + $string = ${$_[0]}; + ${$_[0]} = depod1( \$string ); + } else { + $string = $_[0]; + depod1( \$string ); + } +} - # $heading = lc($heading); - $heading =~ s/[^\w\s]/_/g; - $heading =~ s/(\s+)/ /g; - $heading =~ s/^\s*(.*?)\s*$/$1/s; - $heading =~ s/ /_/g; - $heading =~ s/\A(.{32}).*\Z/$1/s; - $heading =~ s/\s+\Z//; - $heading =~ s/_{2,}/_/g; +sub depod1($;$){ + my( $rstr, $func ) = @_; + my $res = ''; + return $res unless defined $$rstr; + if( ! defined( $func ) ){ + # skip to next begin of an interior sequence + while( $$rstr =~ s/\A(.*?)([BCEFILSXZ])<// ){ + # recurse into its text + $res .= $1 . depod1( $rstr, $2 ); + } + $res .= $$rstr; + } elsif( $func eq 'E' ){ + # E<x> - convert to character + $$rstr =~ s/^(\w+)>//; + $res .= $E2c{$1} || ""; + } elsif( $func eq 'X' ){ + # X<> - ignore + $$rstr =~ s/^[^>]*>//; + } elsif( $func eq 'Z' ){ + # Z<> - empty + $$rstr =~ s/^>//; + } else { + # all others: either recurse into new function or + # terminate at closing angle bracket + while( $$rstr =~ s/\A(.*?)([BCEFILSXZ]<|>)// ){ + $res .= $1; + last if $2 eq '>'; + $res .= depod1( $rstr, substr($2,0,1) ); + } + ## If we're here and $2 ne '>': undelimited interior sequence. + ## Ignored, as this is called without proper indication of where we are. + ## Rely on process_text to produce diagnostics. + } + return $res; +} - return $heading; +# +# fragment_id - construct a fragment identifier from: +# a) =item text +# b) contents of C<...> +# +my @hc; +sub fragment_id { + my $text = shift(); + $text =~ s/\s+\Z//s; + if( $text ){ + # a method or function? + return $1 if $text =~ /(\w+)\s*\(/; + return $1 if $text =~ /->\s*(\w+)\s*\(?/; + + # a variable name? + return $1 if $text =~ /^([$@%*]\S+)/; + + # some pattern matching operator? + return $1 if $text =~ m|^(\w+/).*/\w*$|; + + # fancy stuff... like "do { }" + return $1 if $text =~ m|^(\w+)\s*{.*}$|; + + # honour the perlfunc manpage: func [PAR[,[ ]PAR]...] + # and some funnies with ... Module ... + return $1 if $text =~ m{^([a-z\d]+)(\s+[A-Z\d,/& ]+)?$}; + return $1 if $text =~ m{^([a-z\d]+)\s+Module(\s+[A-Z\d,/& ]+)?$}; + + # text? normalize! + $text =~ s/\s+/_/sg; + $text =~ s{(\W)}{ + defined( $hc[ord($1)] ) ? $hc[ord($1)] + : ( $hc[ord($1)] = sprintf( "%%%02X", ord($1) ) ) }gxe; + $text = substr( $text, 0, 50 ); + } else { + return undef(); + } } -BEGIN { +# +# make_URL_href - generate HTML href from URL +# Special treatment for CGI queries. +# +sub make_URL_href($){ + my( $url ) = @_; + if( $url !~ + s{^(http:[-\w/#~:.+=&%@!]+)(\?.*)$}{<A HREF="$1$2">$1</A>}i ){ + $url = "<A HREF=\"$url\">$url</A>"; + } + return $url; } 1; diff --git a/lib/Pod/ParseUtils.pm b/lib/Pod/ParseUtils.pm new file mode 100644 index 0000000000..a66e8f5e8b --- /dev/null +++ b/lib/Pod/ParseUtils.pm @@ -0,0 +1,792 @@ +############################################################################# +# Pod/ParseUtils.pm -- helpers for POD parsing and conversion +# +# Copyright (C) 1999 by Marek Rouchal. 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::ParseUtils; + +use vars qw($VERSION); +$VERSION = 0.2; ## Current version of this package +require 5.004; ## requires this Perl version or later + +=head1 NAME + +Pod::ParseUtils - helpers for POD parsing and conversion + +=head1 SYNOPSIS + + use Pod::ParseUtils; + + my $list = new Pod::List; + my $link = Pod::Hyperlink->new('Pod::Parser'); + +=head1 DESCRIPTION + +B<Pod::ParseUtils> contains a few object-oriented helper packages for +POD parsing and processing (i.e. in POD formatters and translators). + +=cut + +#----------------------------------------------------------------------------- +# Pod::List +# +# class to hold POD list info (=over, =item, =back) +#----------------------------------------------------------------------------- + +package Pod::List; + +use Carp; + +=head2 Pod::List + +B<Pod::List> can be used to hold information about POD lists +(written as =over ... =item ... =back) for further processing. +The following methods are available: + +=over 4 + +=item new() + +Create a new list object. Properties may be specified through a hash +reference like this: + + my $list = Pod::List->new({ -start => $., -indent => 4 }); + +See the individual methods/properties for details. + +=cut + +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} = []; + $self->{-type} ||= ''; +} + +=item file() + +Without argument, retrieves the file name the list is in. This must +have been set before by either specifying B<-file> in the B<new()> +method or by calling the B<file()> method with a scalar argument. + +=cut + +# The POD file name the list appears in +sub file { + return (@_ > 1) ? ($_[0]->{-file} = $_[1]) : $_[0]->{-file}; +} + +=item start() + +Without argument, retrieves the line number where the list started. +This must have been set before by either specifying B<-start> in the +B<new()> method or by calling the B<start()> method with a scalar +argument. + +=cut + +# The line in the file the node appears +sub start { + return (@_ > 1) ? ($_[0]->{-start} = $_[1]) : $_[0]->{-start}; +} + +=item indent() + +Without argument, retrieves the indent level of the list as specified +in C<=over n>. This must have been set before by either specifying +B<-indent> in the B<new()> method or by calling the B<indent()> method +with a scalar argument. + +=cut + +# indent level +sub indent { + return (@_ > 1) ? ($_[0]->{-indent} = $_[1]) : $_[0]->{-indent}; +} + +=item type() + +Without argument, retrieves the list type, which can be an arbitrary value, +e.g. C<OL>, C<UL>, ... when thinking the HTML way. +This must have been set before by either specifying +B<-type> in the B<new()> method or by calling the B<type()> method +with a scalar argument. + +=cut + +# The type of the list (UL, OL, ...) +sub type { + return (@_ > 1) ? ($_[0]->{-type} = $_[1]) : $_[0]->{-type}; +} + +=item rx() + +Without argument, retrieves a regular expression for simplifying the +individual item strings once the list type has been determined. Usage: +E.g. when converting to HTML, one might strip the leading number in +an ordered list as C<E<lt>OLE<gt>> already prints numbers itself. +This must have been set before by either specifying +B<-rx> in the B<new()> method or by calling the B<rx()> method +with a scalar argument. + +=cut + +# The regular expression to simplify the items +sub rx { + return (@_ > 1) ? ($_[0]->{-rx} = $_[1]) : $_[0]->{-rx}; +} + +=item item() + +Without argument, retrieves the array of the items in this list. +The items may be represented by any scalar. +If an argument has been given, it is pushed on the list of items. + +=cut + +# The individual =items of this list +sub item { + my ($self,$item) = @_; + if(defined $item) { + push(@{$self->{_items}}, $item); + return $item; + } + else { + return @{$self->{_items}}; + } +} + +=item parent() + +Without argument, retrieves information about the parent holding this +list, which is represented as an arbitrary scalar. +This must have been set before by either specifying +B<-parent> in the B<new()> method or by calling the B<parent()> method +with a scalar argument. + +=cut + +# possibility for parsers/translators to store information about the +# lists's parent object +sub parent { + return (@_ > 1) ? ($_[0]->{-parent} = $_[1]) : $_[0]->{-parent}; +} + +=item tag() + +Without argument, retrieves information about the list tag, which can be +any scalar. +This must have been set before by either specifying +B<-tag> in the B<new()> method or by calling the B<tag()> method +with a scalar argument. + +=back + +=cut + +# possibility for parsers/translators to store information about the +# list's object +sub tag { + return (@_ > 1) ? ($_[0]->{-tag} = $_[1]) : $_[0]->{-tag}; +} + +#----------------------------------------------------------------------------- +# Pod::Hyperlink +# +# class to manipulate POD hyperlinks (L<>) +#----------------------------------------------------------------------------- + +package Pod::Hyperlink; + +=head2 Pod::Hyperlink + +B<Pod::Hyperlink> is a class for manipulation of POD hyperlinks. Usage: + + my $link = Pod::Hyperlink->new('alternative text|page/"section in page"'); + +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 for further processing. It can also be +used to construct hyperlinks. + +=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<$@>. + +=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]}; + $self->_construct_text(); + } + 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} = []; +} + +=item parse($string) + +This method can be used to (re)parse a (new) hyperlink, i.e. the contents +of a C<LE<lt>...E<gt>> sequence. The result is stored in the current object. + +=cut + +sub parse { + my $self = shift; + local($_) = $_[0]; + # syntax check the link and extract destination + my ($alttext,$page,$node,$type) = ('','','',''); + + $self->{_warnings} = []; + + # collapse newlines with whitespace + if(s/\s*\n+\s*/ /g) { + $self->warning("collapsing newlines to blanks"); + } + # 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"); + } + unless(length($_)) { + _invalid_link("empty link"); + return undef; + } + + ## Check for different possibilities. This is tedious and error-prone + # we match all possibilities (alttext, page, section/item) + #warn "DEBUG: link=$_\n"; + + # only page + if(m!^(\w+(?:::\w+)*)\s*(\(\w*\)|)$!) { + $page = $1 . $2; + $type = 'page'; + } + # alttext, page and section + elsif(m!^(.+?)\s*[|]\s*(\w+(?:::\w+)*)\s*(\(\w*\)|)\s*/\s*"(.+)"$!) { + ($alttext, $page, $node) = ($1, $2 . $3, $4); + $type = 'section'; + } + # page and section + elsif(m!^(\w+(?:::\w+)*)\s*(\(\w*\)|)\s*/\s*"(.+)"$!) { + ($page, $node) = ($1 . $2, $3); + $type = 'section'; + } + # page and item + elsif(m!^(\w+(?:::\w+)*)\s*(\(\w*\)|)\s*/\s*(.+)$!) { + ($page, $node) = ($1 . $2, $3); + $type = 'item'; + } + # only section + elsif(m!^(?:/\s*|)"(.+)"$!) { + $node = $1; + $type = 'section'; + } + # only item + elsif(m!^/(.+)$!) { + $node = $1; + $type = 'item'; + } + # non-standard: Hyperlink + elsif(m!^((?:http|ftp|mailto|news):.+)$!i) { + $node = $1; + $type = 'hyperlink'; + } + # alttext, page and item + elsif(m!^(.+?)\s*[|]\s*(\w+(?:::\w+)*)\s*(\(\w*\)|)\s*/\s*(.+)$!) { + ($alttext, $page, $node) = ($1, $2 . $3, $4); + $type = 'item'; + } + # alttext and page + elsif(m!^(.+?)\s*[|]\s*(\w+(?:::\w+)*)\s*(\(\w*\)|)$!) { + ($alttext, $page) = ($1, $2 . $3); + $type = 'page'; + } + # alttext and section + elsif(m!^(.+?)\s*[|]\s*(?:/\s*|)"(.+)"$!) { + ($alttext, $node) = ($1,$2); + $type = 'section'; + } + # alttext and item + elsif(m!^(.+?)\s*[|]\s*/(.+)$!) { + ($alttext, $node) = ($1,$2); + } + # nonstandard: alttext and hyperlink + elsif(m!^(.+?)\s*[|]\s*((?:http|ftp|mailto|news):.+)$!) { + ($alttext, $node) = ($1,$2); + $type = 'hyperlink'; + } + # must be an item or a "malformed" section (without "") + else { + $node = $_; + $type = 'item'; + } + + if($page =~ /[(]\w*[)]$/) { + $self->warning("section in `$page' deprecated"); + } + $self->{-page} = $page; + $self->{-node} = $node; + $self->{-alttext} = $alttext; + #warn "DEBUG: page=$page section=$section item=$item alttext=$alttext\n"; + $self->{-type} = $type; + $self->_construct_text(); + 1; +} + +sub _construct_text { + my $self = shift; + my $alttext = $self->alttext(); + my $type = $self->type(); + my $section = $self->node(); + my $page = $self->page(); + my $page_ext = ''; + $page =~ s/([(]\w*[)])$// && ($page_ext = $1); + if($alttext) { + $self->{_text} = $alttext; + } + elsif($type eq 'hyperlink') { + $self->{_text} = $section; + } + else { + $self->{_text} = (!$section ? '' : + $type eq 'item' ? "the $section entry" : + "the section on $section" ) . + ($page ? ($section ? ' in ':'') . "the $page$page_ext manpage" : + ' elsewhere in this document'); + } + # for being marked up later + # use the non-standard markers P<> and Q<>, so that the resulting + # text can be parsed by the translators. It's their job to put + # the correct hypertext around the linktext + if($alttext) { + $self->{_markup} = "Q<$alttext>"; + } + elsif($type eq 'hyperlink') { + $self->{_markup} = "Q<$section>"; + } + else { + $self->{_markup} = (!$section ? '' : + $type eq 'item' ? "the Q<$section> entry" : + "the section on Q<$section>" ) . + ($page ? ($section ? ' in ':'') . "the P<$page>$page_ext manpage" : + ' elsewhere in this document'); + } +} + +=item markup($string) + +Set/retrieve the textual value of the link. This string contains special +markers C<PE<lt>E<gt>> and C<QE<lt>E<gt>> that should be expanded by the +translator's interior sequence expansion engine to the +formatter-specific code to highlight/activate the hyperlink. The details +have to be implemented in the translator. + +=cut + +#' retrieve/set markuped text +sub markup { + return (@_ > 1) ? ($_[0]->{_markup} = $_[1]) : $_[0]->{_markup}; +} + +=item text() + +This method returns the textual representation of the hyperlink as above, +but without markers (read only). Depending on the link type this is one of +the following alternatives (the + and * denote the portions of the text +that are marked up): + + 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 + +=cut + +# The complete link's text +sub text { + $_[0]->{_text}; +} + +=item warning() + +After parsing, this method returns any warnings encountered during the +parsing process. + +=cut + +# Set/retrieve warnings +sub warning { + my $self = shift; + if(@_) { + push(@{$self->{_warnings}}, @_); + return @_; + } + return @{$self->{_warnings}}; +} + +=item line(), file() + +Just simple slots for storing information about the line and the file +the link was encountered in. Has to be filled in manually. + +=cut + +# The line in the file the link appears +sub line { + return (@_ > 1) ? ($_[0]->{-line} = $_[1]) : $_[0]->{-line}; +} + +# The POD file name the link appears in +sub file { + return (@_ > 1) ? ($_[0]->{-file} = $_[1]) : $_[0]->{-file}; +} + +=item page() + +This method sets or returns the POD page this link points to. + +=cut + +# The POD page the link appears on +sub page { + if (@_ > 1) { + $_[0]->{-page} = $_[1]; + $_[0]->_construct_text(); + } + $_[0]->{-page}; +} + +=item node() + +As above, but the destination node text of the link. + +=cut + +# The link destination +sub node { + if (@_ > 1) { + $_[0]->{-node} = $_[1]; + $_[0]->_construct_text(); + } + $_[0]->{-node}; +} + +=item alttext() + +Sets or returns an alternative text specified in the link. + +=cut + +# Potential alternative text +sub alttext { + if (@_ > 1) { + $_[0]->{-alttext} = $_[1]; + $_[0]->_construct_text(); + } + $_[0]->{-alttext}; +} + +=item type() + +The node type, either C<section> or C<item>. As an unofficial type, +there is also C<hyperlink>, derived from e.g. C<LE<lt>http://perl.comE<gt>> + +=cut + +# The type: item or headn +sub type { + return (@_ > 1) ? ($_[0]->{-type} = $_[1]) : $_[0]->{-type}; +} + +=item link() + +Returns the link as contents of C<LE<lt>E<gt>>. Reciprocal to B<parse()>. + +=back + +=cut + +# The link itself +sub link { + my $self = shift; + my $link = $self->page() || ''; + if($self->node()) { + if($self->type() eq 'section') { + $link .= ($link ? '/' : '') . '"' . $self->node() . '"'; + } + elsif($self->type() eq 'hyperlink') { + $link = $self->node(); + } + else { # item + $link .= '/' . $self->node(); + } + } + if($self->alttext()) { + $link = $self->alttext() . '|' . $link; + } + $link; +} + +sub _invalid_link { + my ($msg) = @_; + # this sets @_ + #eval { die "$msg\n" }; + #chomp $@; + $@ = $msg; # this seems to work, too! + undef; +} + +#----------------------------------------------------------------------------- +# Pod::Cache +# +# class to hold POD page details +#----------------------------------------------------------------------------- + +package Pod::Cache; + +=head2 Pod::Cache + +B<Pod::Cache> holds information about a set of POD documents, +especially the nodes for hyperlinks. +The following methods are available: + +=over 4 + +=item new() + +Create a new cache object. This object can hold an arbitrary number of +POD documents of class Pod::Cache::Item. + +=cut + +sub new { + my $this = shift; + my $class = ref($this) || $this; + my $self = []; + bless $self, $class; + return $self; +} + +=item item() + +Add a new item to the cache. Without arguments, this method returns a +list of all cache elements. + +=cut + +sub item { + my ($self,%param) = @_; + if(%param) { + my $item = Pod::Cache::Item->new(%param); + push(@$self, $item); + return $item; + } + else { + return @{$self}; + } +} + +=item find_page($name) + +Look for a POD document named C<$name> in the cache. Returns the +reference to the corresponding Pod::Cache::Item object or undef if +not found. + +=back + +=cut + +sub find_page { + my ($self,$page) = @_; + foreach(@$self) { + if($_->page() eq $page) { + return $_; + } + } + undef; +} + +package Pod::Cache::Item; + +=head2 Pod::Cache::Item + +B<Pod::Cache::Item> holds information about individual POD documents, +that can be grouped in a Pod::Cache object. +It is intended to hold information about the hyperlink nodes of POD +documents. +The following methods are available: + +=over 4 + +=item new() + +Create a new object. + +=cut + +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->{-nodes} = [] unless(defined $self->{-nodes}); +} + +=item page() + +Set/retrieve the POD document name (e.g. "Pod::Parser"). + +=cut + +# The POD page +sub page { + return (@_ > 1) ? ($_[0]->{-page} = $_[1]) : $_[0]->{-page}; +} + +=item description() + +Set/retrieve the POD short description as found in the C<=head1 NAME> +section. + +=cut + +# The POD description, taken out of NAME if present +sub description { + return (@_ > 1) ? ($_[0]->{-description} = $_[1]) : $_[0]->{-description}; +} + +=item path() + +Set/retrieve the POD file storage path. + +=cut + +# The file path +sub path { + return (@_ > 1) ? ($_[0]->{-path} = $_[1]) : $_[0]->{-path}; +} + +=item file() + +Set/retrieve the POD file name. + +=cut + +# The POD file name +sub file { + return (@_ > 1) ? ($_[0]->{-file} = $_[1]) : $_[0]->{-file}; +} + +=item nodes() + +Add a node (or a list of nodes) to the document's node list. Note that +the order is kept, i.e. start with the first node and end with the last. +If no argument is given, the current list of nodes is returned in the +same order the nodes have been added. +A node can be any scalar, but usually is a pair of node string and +unique id for the C<find_node> method to work correctly. + +=cut + +# The POD nodes +sub nodes { + my ($self,@nodes) = @_; + if(@nodes) { + push(@{$self->{-nodes}}, @nodes); + return @nodes; + } + else { + return @{$self->{-nodes}}; + } +} + +=item find_node($name) + +Look for a node named C<$name> in the object's node list. Returns the +unique id of the node (i.e. the second element of the array stored in +the node arry) or undef if not found. + +=back + +=cut + +sub find_node { + my ($self,$node) = @_; + foreach(@{$self->{-nodes}}) { + if($_->[0] eq $node) { + return $_->[1]; # id + } + } + undef; +} + + +=head1 AUTHOR + +Marek Rouchal E<lt>marek@saftsack.fs.uni-bayreuth.deE<gt>, borrowing +a lot of things from L<pod2man> and L<pod2roff> as well as other POD +processing tools by Tom Christiansen, Brad Appleton and Russ Allbery. + +=head1 SEE ALSO + +L<pod2man>, L<pod2roff>, L<Pod::Parser>, L<Pod::Checker>, +L<pod2html> + +=cut + +1; diff --git a/lib/Pod/Parser.pm b/lib/Pod/Parser.pm index c9c67bd8e2..c727142506 100644 --- a/lib/Pod/Parser.pm +++ b/lib/Pod/Parser.pm @@ -142,8 +142,8 @@ For the most part, the B<Pod::Parser> base class should be able to 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 +Note that all we have described here in this quick overview is +the simplest most straightforward 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">. diff --git a/lib/Pod/Usage.pm b/lib/Pod/Usage.pm index 6e6fb7bb80..aa3a009dcf 100644 --- a/lib/Pod/Usage.pm +++ b/lib/Pod/Usage.pm @@ -311,22 +311,58 @@ command line syntax error is detected. They should also provide an option (usually C<-H> or C<-help>) to print a (possibly more verbose) usage message to C<STDOUT>. Some scripts may even wish to go so far as to provide a means of printing their complete documentation to C<STDOUT> -(perhaps by allowing a C<-man> option). The following example uses -B<Pod::Usage> in combination with B<Getopt::Long> to do all of these +(perhaps by allowing a C<-man> option). The following complete example +uses B<Pod::Usage> in combination with B<Getopt::Long> to do all of these things: use Getopt::Long; use Pod::Usage; + my $man = 0; + my $help = 0; ## Parse options and print usage if there is a syntax error, ## or if usage was explicitly requested. - GetOptions("help", "man", "flag1") || pod2usage(2); - pod2usage(1) if ($opt_help); - pod2usage(-verbose => 2) if ($opt_man); + GetOptions('help|?' => \$help, man => \$man) or pod2usage(2); + pod2usage(1) if $help; + pod2usage(-verbose => 2) if $man; ## If no arguments were given, then allow STDIN to be used only ## if it's not connected to a terminal (otherwise print usage) pod2usage("$0: No files given.") if ((@ARGV == 0) && (-t STDIN)); + __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 something + useful with the contents thereof. + + =cut =head1 CAVEATS diff --git a/lib/SelfLoader.pm b/lib/SelfLoader.pm index 4672ac49da..2aa29303fd 100644 --- a/lib/SelfLoader.pm +++ b/lib/SelfLoader.pm @@ -3,7 +3,7 @@ package SelfLoader; require Exporter; @ISA = qw(Exporter); @EXPORT = qw(AUTOLOAD); -$VERSION = "1.09"; +$VERSION = "1.0901"; sub Version {$VERSION} $DEBUG = 0; @@ -12,7 +12,7 @@ my %Cache; # private cache for all SelfLoader's client packages # allow checking for valid ': attrlist' attachments my $nested; $nested = qr{ \( (?: (?> [^()]+ ) | (?p{ $nested }) )* \) }x; -my $one_attr = qr{ (?> (?! \d) \w+ (?:$nested)? ) [\s,]* }x; +my $one_attr = qr{ (?> (?! \d) \w+ (?:$nested)? ) (?:\s*\:\s*|\s+(?!\:)) }x; my $attr_list = qr{ \s* : \s* (?: $one_attr )* }x; sub croak { require Carp; goto &Carp::croak } diff --git a/lib/Shell.pm b/lib/Shell.pm index 0177479de5..62aa82964c 100644 --- a/lib/Shell.pm +++ b/lib/Shell.pm @@ -1,5 +1,6 @@ package Shell; -use vars qw($capture_stderr $VERSION); +use 5.005_64; +our($capture_stderr, $VERSION); $VERSION = '0.2'; @@ -71,7 +72,7 @@ AUTOLOAD { for (\@arr) { s/"/\\\\"/g; s/\\\\\\\\"/\\\\\\\\"""/g; - \$_ = qq["\$_"] if /\s/; + \$_ = qq["\$_"] if /\\s/; } } else { diff --git a/lib/Sys/Hostname.pm b/lib/Sys/Hostname.pm index 4d93f91f9e..63415a6bfe 100644 --- a/lib/Sys/Hostname.pm +++ b/lib/Sys/Hostname.pm @@ -74,25 +74,19 @@ sub hostname { # method 2 - syscall is preferred since it avoids tainting problems eval { local $SIG{__DIE__}; - { - package main; - require "syscall.ph"; - } + require "syscall.ph"; $host = "\0" x 65; ## preload scalar - syscall(&main::SYS_gethostname, $host, 65) == 0; + syscall(&SYS_gethostname, $host, 65) == 0; } # method 2a - syscall using systeminfo instead of gethostname # -- needed on systems like Solaris || eval { local $SIG{__DIE__}; - { - package main; - require "sys/syscall.ph"; - require "sys/systeminfo.ph"; - } + require "sys/syscall.ph"; + require "sys/systeminfo.ph"; $host = "\0" x 65; ## preload scalar - syscall(&main::SYS_systeminfo, &main::SI_HOSTNAME, $host, 65) != -1; + syscall(&SYS_systeminfo, &SI_HOSTNAME, $host, 65) != -1; } # method 3 - trusty old hostname command @@ -102,13 +96,21 @@ sub hostname { $host = `(hostname) 2>/dev/null`; # bsdish } - # method 4 - sysV uname command (may truncate) + # method 4 - use POSIX::uname(), which strictly can't be expected to be + # correct + || eval { + local $SIG{__DIE__}; + require POSIX; + $host = (POSIX::uname())[1]; + } + + # method 5 - sysV uname command (may truncate) || eval { local $SIG{__DIE__}; $host = `uname -n 2>/dev/null`; ## sysVish } - # method 5 - Apollo pre-SR10 + # method 6 - Apollo pre-SR10 || eval { local $SIG{__DIE__}; ($host,$a,$b,$c,$d)=split(/[:\. ]/,`/com/host`,6); diff --git a/lib/Test.pm b/lib/Test.pm index 2187e8cd85..c708f57a05 100644 --- a/lib/Test.pm +++ b/lib/Test.pm @@ -1,9 +1,10 @@ use strict; package Test; +use 5.005_64; use Test::Harness 1.1601 (); use Carp; -use vars (qw($VERSION @ISA @EXPORT @EXPORT_OK $ntest $TestLevel), #public-ish - qw($TESTOUT $ONFAIL %todo %history $planned @FAILDETAIL)); #private-ish +our($VERSION, @ISA, @EXPORT, @EXPORT_OK, $ntest, $TestLevel); #public-ish +our($TESTOUT, $ONFAIL, %todo, %history, $planned, @FAILDETAIL); #private-ish $VERSION = '1.13'; require Exporter; @ISA=('Exporter'); diff --git a/lib/Test/Harness.pm b/lib/Test/Harness.pm index a469cfafa8..61a29dbaaa 100644 --- a/lib/Test/Harness.pm +++ b/lib/Test/Harness.pm @@ -1,14 +1,14 @@ package Test::Harness; -BEGIN {require 5.002;} +use 5.005_64; use Exporter; use Benchmark; use Config; use FileHandle; use strict; -use vars qw($VERSION $verbose $switches $have_devel_corestack $curtest - @ISA @EXPORT @EXPORT_OK); +our($VERSION, $verbose, $switches, $have_devel_corestack, $curtest, + @ISA, @EXPORT, @EXPORT_OK); $have_devel_corestack = 0; $VERSION = "1.1604"; diff --git a/lib/Text/ParseWords.pm b/lib/Text/ParseWords.pm index ada9d70d74..2a6afc3be9 100644 --- a/lib/Text/ParseWords.pm +++ b/lib/Text/ParseWords.pm @@ -49,7 +49,7 @@ sub nested_quotewords { sub parse_line { # We will be testing undef strings - local($^W) = 0; + no warnings; my($delimiter, $keep, $line) = @_; my($quote, $quoted, $unquoted, $delim, $word, @pieces); diff --git a/lib/Text/Soundex.pm b/lib/Text/Soundex.pm index ddc758c94e..3079b90612 100644 --- a/lib/Text/Soundex.pm +++ b/lib/Text/Soundex.pm @@ -5,6 +5,8 @@ require Exporter; @ISA = qw(Exporter); @EXPORT = qw(&soundex $soundex_nocode); +$VERSION = '1.0'; + # $Id: soundex.pl,v 1.2 1994/03/24 00:30:27 mike Exp $ # # Implementation of soundex algorithm as described by Knuth in volume diff --git a/lib/Text/Tabs.pm b/lib/Text/Tabs.pm index c431019908..933f917acd 100644 --- a/lib/Text/Tabs.pm +++ b/lib/Text/Tabs.pm @@ -73,11 +73,11 @@ Text::Tabs -- expand and unexpand tabs per the unix expand(1) and unexpand(1) =head1 SYNOPSIS -use Text::Tabs; + use Text::Tabs; -$tabstop = 4; -@lines_without_tabs = expand(@lines_with_tabs); -@lines_with_tabs = unexpand(@lines_without_tabs); + $tabstop = 4; + @lines_without_tabs = expand(@lines_with_tabs); + @lines_with_tabs = unexpand(@lines_without_tabs); =head1 DESCRIPTION diff --git a/lib/Tie/Array.pm b/lib/Tie/Array.pm index 5ef83c4781..32e269b330 100644 --- a/lib/Tie/Array.pm +++ b/lib/Tie/Array.pm @@ -1,8 +1,9 @@ package Tie::Array; -use vars qw($VERSION); + +use 5.005_64; use strict; use Carp; -$VERSION = '1.01'; +our $VERSION = '1.01'; # Pod documentation after __END__ below. diff --git a/lib/Tie/Handle.pm b/lib/Tie/Handle.pm index 6181eca22c..f64e4b2a5b 100644 --- a/lib/Tie/Handle.pm +++ b/lib/Tie/Handle.pm @@ -1,5 +1,8 @@ package Tie::Handle; +use 5.005_64; +our $VERSION = '1.0'; + =head1 NAME Tie::Handle, Tie::StdHandle - base class definitions for tied handles @@ -183,8 +186,7 @@ sub CLOSE { } package Tie::StdHandle; -use vars qw(@ISA); -@ISA = 'Tie::Handle'; +our @ISA = 'Tie::Handle'; use Carp; sub TIEHANDLE diff --git a/lib/Time/gmtime.pm b/lib/Time/gmtime.pm index 9b823f601e..6ff4bc84a2 100644 --- a/lib/Time/gmtime.pm +++ b/lib/Time/gmtime.pm @@ -2,9 +2,10 @@ package Time::gmtime; use strict; use Time::tm; +use 5.005_64; +our(@ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS, $VERSION); BEGIN { use Exporter (); - use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $VERSION); @ISA = qw(Exporter Time::tm); @EXPORT = qw(gmtime gmctime); @EXPORT_OK = qw( diff --git a/lib/Time/localtime.pm b/lib/Time/localtime.pm index 18a36c7fb9..0ca07af166 100644 --- a/lib/Time/localtime.pm +++ b/lib/Time/localtime.pm @@ -2,9 +2,10 @@ package Time::localtime; use strict; use Time::tm; -BEGIN { +use 5.005_64; +our(@ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS, $VERSION); +BEGIN { use Exporter (); - use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $VERSION); @ISA = qw(Exporter Time::tm); @EXPORT = qw(localtime ctime); @EXPORT_OK = qw( diff --git a/lib/UNIVERSAL.pm b/lib/UNIVERSAL.pm index dc02423029..f2f1fe9e7a 100644 --- a/lib/UNIVERSAL.pm +++ b/lib/UNIVERSAL.pm @@ -62,19 +62,23 @@ The C<isa> and C<can> methods can also be called as subroutines =item UNIVERSAL::isa ( VAL, TYPE ) -C<isa> returns I<true> if the first argument is a reference and either -of the following statements is true. +C<isa> returns I<true> if one of the following statements is true. =over 8 -=item +=item * -C<VAL> is a blessed reference and is blessed into package C<TYPE> -or inherits from package C<TYPE> +C<VAL> is a reference blessed into either package C<TYPE> or a package +which inherits from package C<TYPE>. -=item +=item * -C<VAL> is a reference to a C<TYPE> of perl variable (er 'HASH') +C<VAL> is a reference to a C<TYPE> of Perl variable (e.g. 'HASH'). + +=item * + +C<VAL> is the name of a package that inherits from (or is itself) +package C<TYPE>. =back diff --git a/lib/User/grent.pm b/lib/User/grent.pm index e4e226d119..95e4189c9e 100644 --- a/lib/User/grent.pm +++ b/lib/User/grent.pm @@ -1,9 +1,10 @@ package User::grent; use strict; +use 5.005_64; +our(@EXPORT, @EXPORT_OK, %EXPORT_TAGS); BEGIN { use Exporter (); - use vars qw(@EXPORT @EXPORT_OK %EXPORT_TAGS); @EXPORT = qw(getgrent getgrgid getgrnam getgr); @EXPORT_OK = qw($gr_name $gr_gid $gr_passwd $gr_mem @gr_members); %EXPORT_TAGS = ( FIELDS => [ @EXPORT_OK, @EXPORT ] ); diff --git a/lib/User/pwent.pm b/lib/User/pwent.pm index bb2dace682..39bfea4fe0 100644 --- a/lib/User/pwent.pm +++ b/lib/User/pwent.pm @@ -1,9 +1,10 @@ package User::pwent; use strict; +use 5.005_64; +our(@EXPORT, @EXPORT_OK, %EXPORT_TAGS); BEGIN { use Exporter (); - use vars qw(@EXPORT @EXPORT_OK %EXPORT_TAGS); @EXPORT = qw(getpwent getpwuid getpwnam getpw); @EXPORT_OK = qw( $pw_name $pw_passwd $pw_uid diff --git a/lib/attributes.pm b/lib/attributes.pm index 09f355139f..bbbb8b78ee 100644 --- a/lib/attributes.pm +++ b/lib/attributes.pm @@ -1,6 +1,6 @@ package attributes; -$VERSION = 0.02; +$VERSION = 0.03; @EXPORT_OK = qw(get reftype); @EXPORT = (); @@ -54,7 +54,7 @@ sub import { my $s = ((@pkgattrs == 1) ? '' : 's'); carp "$svtype package attribute$s " . "may clash with future reserved word$s: " . - join(' , ' , @pkgattrs); + join(' : ' , @pkgattrs); } } } @@ -65,7 +65,7 @@ sub import { croak "Invalid $svtype attribute" . (( @badattrs == 1 ) ? '' : 's') . ": " . - join(' , ', @badattrs); + join(' : ', @badattrs); } } @@ -267,7 +267,8 @@ will use that package name. =head2 Syntax of Attribute Lists An attribute list is a sequence of attribute specifications, separated by -whitespace, commas, or both. Each attribute specification is a simple +whitespace or a colon (with optional whitespace). +Each attribute specification is a simple name, optionally followed by a parenthesised parameter list. If such a parameter list is present, it is scanned past as for the rules for the C<q()> operator. (See L<perlop/"Quote and Quote-like Operators">.) @@ -275,8 +276,8 @@ The parameter list is passed as it was found, however, and not as per C<q()>. Some examples of syntactically valid attribute lists: - switch(10,foo(7,3)) , , expensive - Ugly('\(") , Bad + switch(10,foo(7,3)) : expensive + Ugly('\(") :Bad _5x5 locked method @@ -286,7 +287,7 @@ Some examples of syntactically invalid attribute lists (with annotation): Ugly('(') # ()-string not balanced 5x5 # "5x5" not a valid identifier Y2::north # "Y2::north" not a simple identifier - foo + bar # "+" neither a comma nor whitespace + foo + bar # "+" neither a colon nor whitespace =head1 EXPORTS diff --git a/lib/base.pm b/lib/base.pm index 7fb3d2bcb9..3cb42f5bfa 100644 --- a/lib/base.pm +++ b/lib/base.pm @@ -43,14 +43,18 @@ L<fields> =cut package base; -use vars qw($VERSION); -$VERSION = "1.00"; + +use 5.005_64; +our $VERSION = "1.01"; sub import { my $class = shift; my $fields_base; + my $pkg = caller(0); foreach my $base (@_) { + next if $pkg->isa($base); + push @{"$pkg\::ISA"}, $base; unless (exists ${"$base\::"}{VERSION}) { eval "require $base"; # Only ignore "Can't locate" errors from our eval require. @@ -79,8 +83,6 @@ sub import { } } } - my $pkg = caller(0); - push @{"$pkg\::ISA"}, @_; if ($fields_base) { require fields; fields::inherit($pkg, $fields_base); diff --git a/lib/byte.pm b/lib/byte.pm index cc23b40f4f..0424e1778d 100644 --- a/lib/byte.pm +++ b/lib/byte.pm @@ -1,11 +1,11 @@ package byte; sub import { - $^H |= 0x00000010; + $^H |= 0x00000008; } sub unimport { - $^H &= ~0x00000010; + $^H &= ~0x00000008; } sub AUTOLOAD { @@ -20,7 +20,7 @@ __END__ =head1 NAME -byte - Perl pragma to turn force treating strings as bytes not UNICODE +byte - Perl pragma to force byte semantics rather than character semantics =head1 SYNOPSIS @@ -29,5 +29,22 @@ byte - Perl pragma to turn force treating strings as bytes not UNICODE =head1 DESCRIPTION +WARNING: The implementation of Unicode support in Perl is incomplete. +Expect sudden and unannounced changes! + +The C<use byte> pragma disables character semantics for the rest of the +lexical scope in which it appears. C<no byte> can be used to reverse +the effect of C<use byte> within the current lexical scope. + +Perl normally assumes character semantics in the presence of +character data (i.e. data that has come from a source that has +been marked as being of a particular character encoding). + +To understand the implications and differences between character +semantics and byte semantics, see L<perlunicode>. + +=head1 SEE ALSO + +L<perlunicode>, L<utf8> =cut diff --git a/lib/byte_heavy.pl b/lib/byte_heavy.pl index 07c908a689..ec0558561d 100644 --- a/lib/byte_heavy.pl +++ b/lib/byte_heavy.pl @@ -1,8 +1,8 @@ package byte; -sub length ($) -{ - return CORE::length($_[0]); +sub length ($) { + BEGIN { byte::import() } + return CORE::length($_[0]); } 1; diff --git a/lib/caller.pm b/lib/caller.pm deleted file mode 100644 index 91e67a1743..0000000000 --- a/lib/caller.pm +++ /dev/null @@ -1,59 +0,0 @@ -package caller; -use vars qw($VERSION); -$VERSION = "1.0"; - -=head1 NAME - -caller - inherit pragmatic attributes from the context of the caller - -=head1 SYNOPSIS - - use caller qw(encoding); - -=head1 DESCRIPTION - -This pragma allows a module to inherit some attributes from the -context which loaded it. - -Inheriting attributes takes place at compile time; this means -only attributes that are visible in the calling context at compile -time will be propagated. - -Currently, the only supported attribute is C<encoding>. - -=over - -=item encoding - -Indicates that the character set encoding of the caller's context -must be inherited. This can be used to inherit the C<use utf8> -setting in the calling context. - -=back - -=cut - -my %bitmask = ( - # only HINT_UTF8 supported for now - encoding => 0x8 -); - -sub bits { - my $bits = 0; - for my $s (@_) { $bits |= $bitmask{$s} || 0; }; - $bits; -} - -sub import { - shift; - my @cxt = caller(3); - if (@cxt and $cxt[7]) { # was our parent require-d? - $^H |= bits(@_) & $cxt[8]; - } -} - -sub unimport { - # noop currently -} - -1; diff --git a/lib/charnames.pm b/lib/charnames.pm index bd97983abc..817b4c559e 100644 --- a/lib/charnames.pm +++ b/lib/charnames.pm @@ -29,17 +29,15 @@ sub charnames { } die "Unknown charname '$name'" unless @off; - # use caller 'encoding'; # Does not work at compile time? - my $ord = hex substr $txt, $off[0] - 4, 4; - if ($^H & 0x8) { - use utf8; - return chr $ord; + if ($^H & 0x8) { # "use byte" in effect? + use byte; + return chr $ord if $ord <= 255; + my $hex = sprintf '%X=0%o', $ord, $ord; + my $fname = substr $txt, $off[0] + 2, $off[1] - $off[0] - 2; + die "Character 0x$hex with name '$fname' is above 0xFF"; } - return chr $ord if $ord <= 255; - my $hex = sprintf '%X=0%o', $ord, $ord; - my $fname = substr $txt, $off[0] + 2, $off[1] - $off[0] - 2; - die "Character 0x$hex with name '$fname' is above 0xFF"; + return chr $ord; } sub import { diff --git a/lib/constant.pm b/lib/constant.pm index 31f47fbf54..bbfdb78ec4 100644 --- a/lib/constant.pm +++ b/lib/constant.pm @@ -1,15 +1,15 @@ package constant; use strict; -use vars qw( $VERSION %declared ); +use 5.005_64; + +our($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 %keywords = map +($_, 1), qw{ BEGIN INIT CHECK END DESTROY AUTOLOAD }; my %forced_into_main = map +($_, 1), qw{ STDIN STDOUT STDERR ARGV ARGVOUT ENV INC SIG }; diff --git a/lib/diagnostics.pm b/lib/diagnostics.pm index e6a9127158..a2c927baca 100755 --- a/lib/diagnostics.pm +++ b/lib/diagnostics.pm @@ -167,7 +167,7 @@ Tom Christiansen <F<tchrist@mox.perl.com>>, 25 June 1995. =cut -require 5.005_64; +use 5.005_64; use Carp; $VERSION = v1.0; diff --git a/lib/dumpvar.pl b/lib/dumpvar.pl index f473c45bd3..c72781801b 100644 --- a/lib/dumpvar.pl +++ b/lib/dumpvar.pl @@ -312,14 +312,27 @@ sub dumpglob { } } +sub CvGV_name_or_bust { + my $in = shift; + return if $skipCvGV; # Backdoor to avoid problems if XS broken... + $in = \&$in; # Hard reference... + eval {require Devel::Peek; 1} or return; + my $gv = Devel::Peek::CvGV($in) or return; + *$gv{PACKAGE} . '::' . *$gv{NAME}; +} + sub dumpsub { my ($off,$sub) = @_; + my $ini = $sub; + my $s; $sub = $1 if $sub =~ /^\{\*(.*)\}$/; - my $subref = \&$sub; - my $place = $DB::sub{$sub} || (($sub = $subs{"$subref"}) && $DB::sub{$sub}) - || ($subdump && ($sub = findsubs("$subref")) && $DB::sub{$sub}); + my $subref = defined $1 ? \&$sub : \&$ini; + my $place = $DB::sub{$sub} || (($s = $subs{"$subref"}) && $DB::sub{$s}) + || (($s = CvGV_name_or_bust($subref)) && $DB::sub{$s}) + || ($subdump && ($s = findsubs("$subref")) && $DB::sub{$s}); $place = '???' unless defined $place; - print( (' ' x $off) . "&$sub in $place\n" ); + $s = $sub unless defined $s; + print( (' ' x $off) . "&$s in $place\n" ); } sub findsubs { diff --git a/lib/fields.pm b/lib/fields.pm index f54f639b07..bc9e51320f 100644 --- a/lib/fields.pm +++ b/lib/fields.pm @@ -69,63 +69,90 @@ L<perlref/Pseudo-hashes: Using an array as a hash> =cut +use 5.005_64; use strict; no strict 'refs'; -use vars qw(%attr $VERSION); +our(%attr, $VERSION); -$VERSION = "0.02"; +$VERSION = "1.01"; # some constants sub _PUBLIC () { 1 } sub _PRIVATE () { 2 } -sub _INHERITED () { 4 } # The %attr hash holds the attributes of the currently assigned fields # per class. The hash is indexed by class names and the hash value is -# an array reference. The array is indexed with the field numbers -# (minus one) and the values are integer bit masks (or undef). The -# size of the array also indicate the next field index too assign for -# additional fields in this class. +# an array reference. The first element in the array is the lowest field +# number not belonging to a base class. The remaining elements' indices +# are the field numbers. The values are integer bit masks, or undef +# in the case of base class private fields (which occupy a slot but are +# otherwise irrelevant to the class). sub import { my $class = shift; + return unless @_; my $package = caller(0); my $fields = \%{"$package\::FIELDS"}; - my $fattr = ($attr{$package} ||= []); + my $fattr = ($attr{$package} ||= [1]); + my $next = @$fattr; + if ($next > $fattr->[0] + and ($fields->{$_[0]} || 0) >= $fattr->[0]) + { + # There are already fields not belonging to base classes. + # Looks like a possible module reload... + $next = $fattr->[0]; + } foreach my $f (@_) { - if (my $fno = $fields->{$f}) { + my $fno = $fields->{$f}; + + # Allow the module to be reloaded so long as field positions + # have not changed. + if ($fno and $fno != $next) { require Carp; - if ($fattr->[$fno-1] & _INHERITED) { + if ($fno < $fattr->[0]) { Carp::carp("Hides field '$f' in base class") if $^W; } else { Carp::croak("Field name '$f' already in use"); } } - $fields->{$f} = @$fattr + 1; - push(@$fattr, ($f =~ /^_/) ? _PRIVATE : _PUBLIC); + $fields->{$f} = $next; + $fattr->[$next] = ($f =~ /^_/) ? _PRIVATE : _PUBLIC; + $next += 1; + } + if (@$fattr > $next) { + # Well, we gave them the benefit of the doubt by guessing the + # module was reloaded, but they appear to be declaring fields + # in more than one place. We can't be sure (without some extra + # bookkeeping) that the rest of the fields will be declared or + # have the same positions, so punt. + require Carp; + Carp::croak ("Reloaded module must declare all fields at once"); } } -sub inherit # called by base.pm +sub inherit # called by base.pm when $base_fields is nonempty { my($derived, $base) = @_; - - if (keys %{"$derived\::FIELDS"}) { - require Carp; - Carp::croak("Inherited %FIELDS can't override existing %FIELDS"); - } else { - my $base_fields = \%{"$base\::FIELDS"}; - my $derived_fields = \%{"$derived\::FIELDS"}; - - $attr{$derived}[@{$attr{$base}}-1] = undef; - while (my($k,$v) = each %$base_fields) { - next if $attr{$base}[$v-1] & _PRIVATE; - $attr{$derived}[$v-1] = _INHERITED; - $derived_fields->{$k} = $v; - } - } - + my $base_attr = $attr{$base}; + my $derived_attr = $attr{$derived} ||= []; + my $base_fields = \%{"$base\::FIELDS"}; + my $derived_fields = \%{"$derived\::FIELDS"}; + + $derived_attr->[0] = $base_attr ? scalar(@$base_attr) : 1; + while (my($k,$v) = each %$base_fields) { + my($fno); + if ($fno = $derived_fields->{$k} and $fno != $v) { + require Carp; + Carp::croak ("Inherited %FIELDS can't override existing %FIELDS"); + } + if ($base_attr->[$v] & _PRIVATE) { + $derived_attr->[$v] = undef; + } else { + $derived_attr->[$v] = $base_attr->[$v]; + $derived_fields->{$k} = $v; + } + } } sub _dump # sometimes useful for debugging @@ -140,12 +167,12 @@ sub _dump # sometimes useful for debugging for my $f (sort {$fields->{$a} <=> $fields->{$b}} keys %$fields) { my $no = $fields->{$f}; print " $no: $f"; - my $fattr = $attr{$pkg}[$no-1]; + my $fattr = $attr{$pkg}[$no]; if (defined $fattr) { my @a; push(@a, "public") if $fattr & _PUBLIC; push(@a, "private") if $fattr & _PRIVATE; - push(@a, "inherited") if $fattr & _INHERITED; + push(@a, "inherited") if $no < $attr{$pkg}[0]; print "\t(", join(", ", @a), ")"; } print "\n"; diff --git a/lib/lib.pm b/lib/lib.pm index afc979bb45..e46c5fefa6 100644 --- a/lib/lib.pm +++ b/lib/lib.pm @@ -1,13 +1,14 @@ package lib; -use vars qw(@ORIG_INC); +use 5.005_64; use Config; my $archname = $Config{'archname'}; my $ver = $Config{'version'}; +my @inc_version_list = reverse split / /, $Config{'inc_version_list'}; -@ORIG_INC = @INC; # take a handy copy of 'original' value - +our @ORIG_INC = @INC; # take a handy copy of 'original' value +our $VERSION = '0.5564'; sub import { shift; @@ -23,12 +24,15 @@ sub import { Carp::carp("Parameter to use lib must be directory, not file"); } unshift(@INC, $_); + # Add any previous version directories we found at configure time + foreach my $incver (@inc_version_list) + { + unshift(@INC, "$_/$incver") if -d "$_/$incver"; + } # Put a corresponding archlib directory infront of $_ if it # looks like $_ has an archlib directory below it. - if (-d "$_/$archname") { - unshift(@INC, "$_/$archname") if -d "$_/$archname/auto"; - unshift(@INC, "$_/$archname/$ver") if -d "$_/$archname/$ver/auto"; - } + unshift(@INC, "$_/$ver") if -d "$_/$ver"; + unshift(@INC, "$_/$ver/$archname") if -d "$_/$ver/$archname"; } # remove trailing duplicates diff --git a/lib/perl5db.pl b/lib/perl5db.pl index d2bd98e654..de75bd7d86 100644 --- a/lib/perl5db.pl +++ b/lib/perl5db.pl @@ -2,7 +2,7 @@ package DB; # Debugger for Perl 5.00x; perl5db.pl patch level: -$VERSION = 1.04041; +$VERSION = 1.05; $header = "perl5db.pl version $VERSION"; # Enhanced by ilya@math.ohio-state.edu (Ilya Zakharevich) @@ -597,16 +597,26 @@ EOP } }; $cmd =~ s/^l\s+-\s*$/-/; - $cmd =~ /^l\b\s*([\':A-Za-z_][\':\w]*)/ && do { + $cmd =~ /^([lb])\b\s*(\$.*)/s && do { + $evalarg = $2; + my ($s) = &eval; + print($OUT "Error: $@\n"), next CMD if $@; + $s = CvGV_name($s); + print($OUT "Interpreted as: $1 $s\n"); + $cmd = "$1 $s"; + }; + $cmd =~ /^l\b\s*([\':A-Za-z_][\':\w]*(\[.*\])?)/s && do { $subname = $1; $subname =~ s/\'/::/; $subname = $package."::".$subname unless $subname =~ /::/; $subname = "main".$subname if substr($subname,0,2) eq "::"; - @pieces = split(/:/,find_sub($subname)); + @pieces = split(/:/,find_sub($subname) || $sub{$subname}); $subrange = pop @pieces; $file = join(':', @pieces); if ($file ne $filename) { + print $OUT "Switching to file '$file'.\n" + unless $emacs; *dbline = $main::{'_<' . $file}; $max = $#dbline; $filename = $file; @@ -782,7 +792,7 @@ EOP $postponed{$subname} = $break ? "break +0 if $cond" : "compile"; next CMD; }; - $cmd =~ /^b\b\s*([':A-Za-z_][':\w]*)\s*(.*)/ && do { + $cmd =~ /^b\b\s*([':A-Za-z_][':\w]*(?:\[.*\])?)\s*(.*)/ && do { $subname = $1; $cond = $2 || '1'; $subname =~ s/\'/::/; @@ -793,8 +803,8 @@ EOP ($file,$i) = (find_sub($subname) =~ /^(.*):(.*)$/); $i += 0; if ($i) { - $filename = $file; - *dbline = $main::{'_<' . $filename}; + local $filename = $file; + local *dbline = $main::{'_<' . $filename}; $had_breakpoints{$filename} = 1; $max = $#dbline; ++$i while $dbline[$i] == 0 && $i < $max; @@ -884,6 +894,10 @@ EOP $cmd =~ /^c\b\s*([\w:]*)\s*$/ && do { end_report(), next CMD if $finished and $level <= 1; $subname = $i = $1; + # Probably not needed, since we finish an interactive + # sub-session anyway... + # local $filename = $filename; + # local *dbline = *dbline; # XXX Would this work?! if ($i =~ /\D/) { # subroutine name $subname = $package."::".$subname unless $subname =~ /::/; @@ -1254,11 +1268,11 @@ sub save { # The following takes its argument via $evalarg to preserve current @_ sub eval { - my @res; + local @res; # 'my' would make it visible from user code { - my $otrace = $trace; - my $osingle = $single; - my $od = $^D; + local $otrace = $trace; + local $osingle = $single; + local $od = $^D; @res = eval "$usercontext $evalarg;\n"; # '\n' for nice recursive debug $trace = $otrace; $single = $osingle; @@ -1807,11 +1821,18 @@ B<l> I<min>B<+>I<incr> List I<incr>+1 lines starting at I<min>. B<l> I<min>B<->I<max> List lines I<min> through I<max>. B<l> I<line> List single I<line>. B<l> I<subname> List first window of lines from subroutine. +B<l> I<$var> List first window of lines from subroutine referenced by I<$var>. B<l> List next window of lines. B<-> List previous window of lines. B<w> [I<line>] List window around I<line>. B<.> Return to the executed line. -B<f> I<filename> Switch to viewing I<filename>. Must be loaded. +B<f> I<filename> Switch to viewing I<filename>. File must be already loaded. + I<filename> may be either the full name of the file, or a regular + expression matching the full file name: + B<f> I</home/me/foo.pl> and B<f> I<oo\\.> may access the same file. + Evals (with saved bodies) are considered to be filenames: + B<f> I<(eval 7)> and B<f> I<eval 7\\b> access the body of the 7th eval + (in the order of execution). B</>I<pattern>B</> Search forwards for I<pattern>; final B</> is optional. B<?>I<pattern>B<?> Search backwards for I<pattern>; final B<?> is optional. B<L> List all breakpoints and actions. @@ -1823,6 +1844,7 @@ B<b> [I<line>] [I<condition>] I<condition> breaks if it evaluates to true, defaults to '1'. B<b> I<subname> [I<condition>] Set breakpoint at first line of subroutine. +B<b> I<$var> Set breakpoint at first line of subroutine referenced by I<$var>. B<b> B<load> I<filename> Set breakpoint on `require'ing the given file. B<b> B<postpone> I<subname> [I<condition>] Set breakpoint at first line of subroutine after @@ -2051,10 +2073,31 @@ sub signalLevel { $signalLevel; } +sub CvGV_name { + my $in = shift; + my $name = CvGV_name_or_bust($in); + defined $name ? $name : $in; +} + +sub CvGV_name_or_bust { + my $in = shift; + return if $skipCvGV; # Backdoor to avoid problems if XS broken... + $in = \&$in; # Hard reference... + eval {require Devel::Peek; 1} or return; + my $gv = Devel::Peek::CvGV($in) or return; + *$gv{PACKAGE} . '::' . *$gv{NAME}; +} + sub find_sub { my $subr = shift; - return unless defined &$subr; $sub{$subr} or do { + return unless defined &$subr; + my $name = CvGV_name_or_bust($subr); + my $data; + $data = $sub{$name} if defined $name; + return $data if defined $data; + + # Old stupid way... $subr = \&$subr; # Hard reference my $s; for (keys %sub) { diff --git a/lib/strict.pm b/lib/strict.pm index 99ed01d583..f9d60af154 100644 --- a/lib/strict.pm +++ b/lib/strict.pm @@ -38,8 +38,8 @@ use symbolic references (see L<perlref>). =item C<strict vars> This generates a compile-time error if you access a variable that wasn't -declared via C<use vars>, -localized via C<my()> or wasn't fully qualified. Because this is to avoid +declared via "our" or C<use vars>, +localized via C<my()>, or wasn't fully qualified. Because this is to avoid variable suicide problems and subtle dynamic scoping issues, a merely local() variable isn't good enough. See L<perlfunc/my> and L<perlfunc/local>. @@ -50,7 +50,7 @@ L<perlfunc/local>. local $foo = 9; # blows up package Cinna; - use vars qw/ $bar /; # Declares $bar in current package + our $bar; # Declares $bar in current package $bar = 'HgS'; # ok, global declared via pragma The local() generated a compile-time error because you just touched a global diff --git a/lib/unicode/Is/ASCII.pl b/lib/unicode/Is/ASCII.pl index b7843e932f..63f95ae7dd 100644 --- a/lib/unicode/Is/ASCII.pl +++ b/lib/unicode/Is/ASCII.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 0000 007f END diff --git a/lib/unicode/Is/Alnum.pl b/lib/unicode/Is/Alnum.pl index 18200ffdda..d44f744e20 100644 --- a/lib/unicode/Is/Alnum.pl +++ b/lib/unicode/Is/Alnum.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 0030 0039 0041 005a diff --git a/lib/unicode/Is/Alpha.pl b/lib/unicode/Is/Alpha.pl index 1be8129964..0e94688e85 100644 --- a/lib/unicode/Is/Alpha.pl +++ b/lib/unicode/Is/Alpha.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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 005a 0061 007a diff --git a/lib/unicode/Is/BidiAN.pl b/lib/unicode/Is/BidiAN.pl index e3639ba9f9..4a71ae532d 100644 --- a/lib/unicode/Is/BidiAN.pl +++ b/lib/unicode/Is/BidiAN.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 0660 0669 066b 066c diff --git a/lib/unicode/Is/BidiB.pl b/lib/unicode/Is/BidiB.pl index ae1ba37b10..e4ba16567a 100644 --- a/lib/unicode/Is/BidiB.pl +++ b/lib/unicode/Is/BidiB.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 000a 000d diff --git a/lib/unicode/Is/BidiCS.pl b/lib/unicode/Is/BidiCS.pl index 4c16fe7e87..f8d037d118 100644 --- a/lib/unicode/Is/BidiCS.pl +++ b/lib/unicode/Is/BidiCS.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 002c 002e diff --git a/lib/unicode/Is/BidiEN.pl b/lib/unicode/Is/BidiEN.pl index eb8c5e7234..d63270aecf 100644 --- a/lib/unicode/Is/BidiEN.pl +++ b/lib/unicode/Is/BidiEN.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 0030 0039 00b2 00b3 diff --git a/lib/unicode/Is/BidiES.pl b/lib/unicode/Is/BidiES.pl index 50e6d27e1b..5a1a36a6d8 100644 --- a/lib/unicode/Is/BidiES.pl +++ b/lib/unicode/Is/BidiES.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 002f ff0f diff --git a/lib/unicode/Is/BidiET.pl b/lib/unicode/Is/BidiET.pl index 201892260e..5e7af2bbf4 100644 --- a/lib/unicode/Is/BidiET.pl +++ b/lib/unicode/Is/BidiET.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 0023 0025 002b diff --git a/lib/unicode/Is/BidiL.pl b/lib/unicode/Is/BidiL.pl index ae19cbaa2b..8dc4ca87c0 100644 --- a/lib/unicode/Is/BidiL.pl +++ b/lib/unicode/Is/BidiL.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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 005a 0061 007a diff --git a/lib/unicode/Is/BidiON.pl b/lib/unicode/Is/BidiON.pl index 8924a60c0d..bde00ff123 100644 --- a/lib/unicode/Is/BidiON.pl +++ b/lib/unicode/Is/BidiON.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 0021 0022 0026 002a diff --git a/lib/unicode/Is/BidiR.pl b/lib/unicode/Is/BidiR.pl index 5dbdd1b809..fccc1f6d6e 100644 --- a/lib/unicode/Is/BidiR.pl +++ b/lib/unicode/Is/BidiR.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 05be 05c0 diff --git a/lib/unicode/Is/BidiS.pl b/lib/unicode/Is/BidiS.pl index 3270482f0a..b28b3310ea 100644 --- a/lib/unicode/Is/BidiS.pl +++ b/lib/unicode/Is/BidiS.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 0009 000b diff --git a/lib/unicode/Is/BidiWS.pl b/lib/unicode/Is/BidiWS.pl index 8322155635..25d8b8f6aa 100644 --- a/lib/unicode/Is/BidiWS.pl +++ b/lib/unicode/Is/BidiWS.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 000c 0020 diff --git a/lib/unicode/Is/C.pl b/lib/unicode/Is/C.pl index 837115a127..0db83c4bf3 100644 --- a/lib/unicode/Is/C.pl +++ b/lib/unicode/Is/C.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 0000 001f 007f 009f diff --git a/lib/unicode/Is/Cc.pl b/lib/unicode/Is/Cc.pl index 2894c68bdb..d7184e3151 100644 --- a/lib/unicode/Is/Cc.pl +++ b/lib/unicode/Is/Cc.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 0000 001f 007f 009f diff --git a/lib/unicode/Is/Cn.pl b/lib/unicode/Is/Cn.pl index 3054fd6216..ec287c456a 100644 --- a/lib/unicode/Is/Cn.pl +++ b/lib/unicode/Is/Cn.pl @@ -1,2 +1,5 @@ +# !!!!!!! 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 diff --git a/lib/unicode/Is/Cntrl.pl b/lib/unicode/Is/Cntrl.pl index 837115a127..0db83c4bf3 100644 --- a/lib/unicode/Is/Cntrl.pl +++ b/lib/unicode/Is/Cntrl.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 0000 001f 007f 009f diff --git a/lib/unicode/Is/Co.pl b/lib/unicode/Is/Co.pl index 39445370fc..c456d33aea 100644 --- a/lib/unicode/Is/Co.pl +++ b/lib/unicode/Is/Co.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; e000 f8ff END diff --git a/lib/unicode/Is/DCcircle.pl b/lib/unicode/Is/DCcircle.pl index a9d58a44d0..4c47b28b26 100644 --- a/lib/unicode/Is/DCcircle.pl +++ b/lib/unicode/Is/DCcircle.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 2460 2473 24b6 24ea diff --git a/lib/unicode/Is/DCcompat.pl b/lib/unicode/Is/DCcompat.pl index b6d925ba53..75d25695f3 100644 --- a/lib/unicode/Is/DCcompat.pl +++ b/lib/unicode/Is/DCcompat.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 00a8 00af diff --git a/lib/unicode/Is/DCfinal.pl b/lib/unicode/Is/DCfinal.pl index 091bd64c71..33fbf6aff8 100644 --- a/lib/unicode/Is/DCfinal.pl +++ b/lib/unicode/Is/DCfinal.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; fb51 fb53 diff --git a/lib/unicode/Is/DCfont.pl b/lib/unicode/Is/DCfont.pl index c6d24436b3..c72234b3bf 100644 --- a/lib/unicode/Is/DCfont.pl +++ b/lib/unicode/Is/DCfont.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 2102 210a 2113 diff --git a/lib/unicode/Is/DCinital.pl b/lib/unicode/Is/DCinital.pl index 4faba29494..2c9cf47e7d 100644 --- a/lib/unicode/Is/DCinital.pl +++ b/lib/unicode/Is/DCinital.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; fb55 fb59 diff --git a/lib/unicode/Is/DCinitial.pl b/lib/unicode/Is/DCinitial.pl index b4e2b33873..0145b7dd71 100644 --- a/lib/unicode/Is/DCinitial.pl +++ b/lib/unicode/Is/DCinitial.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; fb54 fb58 diff --git a/lib/unicode/Is/DCisolated.pl b/lib/unicode/Is/DCisolated.pl index de7574214b..cc8541eb7b 100644 --- a/lib/unicode/Is/DCisolated.pl +++ b/lib/unicode/Is/DCisolated.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; fb50 fb52 diff --git a/lib/unicode/Is/DCnarrow.pl b/lib/unicode/Is/DCnarrow.pl index a4f448a6ec..9417de1bbd 100644 --- a/lib/unicode/Is/DCnarrow.pl +++ b/lib/unicode/Is/DCnarrow.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; ff61 ffbe ffc2 ffc7 diff --git a/lib/unicode/Is/DCnoBreak.pl b/lib/unicode/Is/DCnoBreak.pl index 5b0e817c7d..1fd9e8735b 100644 --- a/lib/unicode/Is/DCnoBreak.pl +++ b/lib/unicode/Is/DCnoBreak.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 00a0 0f0c diff --git a/lib/unicode/Is/DCsmall.pl b/lib/unicode/Is/DCsmall.pl index 2e05334032..f6c8069163 100644 --- a/lib/unicode/Is/DCsmall.pl +++ b/lib/unicode/Is/DCsmall.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; fe50 fe52 fe54 fe66 diff --git a/lib/unicode/Is/DCsquare.pl b/lib/unicode/Is/DCsquare.pl index 76b4ad8c6f..b55fdd9c6a 100644 --- a/lib/unicode/Is/DCsquare.pl +++ b/lib/unicode/Is/DCsquare.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 3300 3357 3371 3376 diff --git a/lib/unicode/Is/DCsub.pl b/lib/unicode/Is/DCsub.pl index d446ad49f7..98c4dfa87e 100644 --- a/lib/unicode/Is/DCsub.pl +++ b/lib/unicode/Is/DCsub.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 2080 208e END diff --git a/lib/unicode/Is/DCsuper.pl b/lib/unicode/Is/DCsuper.pl index 8e1330ee51..865a26dd92 100644 --- a/lib/unicode/Is/DCsuper.pl +++ b/lib/unicode/Is/DCsuper.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 00aa 00b2 00b3 diff --git a/lib/unicode/Is/DCvertical.pl b/lib/unicode/Is/DCvertical.pl index 1c00407743..5d55483606 100644 --- a/lib/unicode/Is/DCvertical.pl +++ b/lib/unicode/Is/DCvertical.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; fe30 fe44 END diff --git a/lib/unicode/Is/DCwide.pl b/lib/unicode/Is/DCwide.pl index b693b21380..09dae19629 100644 --- a/lib/unicode/Is/DCwide.pl +++ b/lib/unicode/Is/DCwide.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 3000 ff01 ff5e diff --git a/lib/unicode/Is/DecoCanon.pl b/lib/unicode/Is/DecoCanon.pl index 35a08690b7..c5a59f6596 100644 --- a/lib/unicode/Is/DecoCanon.pl +++ b/lib/unicode/Is/DecoCanon.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 00c0 00c5 00c7 00cf diff --git a/lib/unicode/Is/DecoCompat.pl b/lib/unicode/Is/DecoCompat.pl index 944d69155d..43d34fc110 100644 --- a/lib/unicode/Is/DecoCompat.pl +++ b/lib/unicode/Is/DecoCompat.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 00a0 00a8 diff --git a/lib/unicode/Is/Digit.pl b/lib/unicode/Is/Digit.pl index 2ae9c84f02..2ab8156d77 100644 --- a/lib/unicode/Is/Digit.pl +++ b/lib/unicode/Is/Digit.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 0030 0039 0660 0669 diff --git a/lib/unicode/Is/Graph.pl b/lib/unicode/Is/Graph.pl index 723c881dd6..9c94bb722c 100644 --- a/lib/unicode/Is/Graph.pl +++ b/lib/unicode/Is/Graph.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 0021 007e 00a0 021f diff --git a/lib/unicode/Is/L.pl b/lib/unicode/Is/L.pl index 7ab2842a75..c32f83049c 100644 --- a/lib/unicode/Is/L.pl +++ b/lib/unicode/Is/L.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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 005a 0061 007a diff --git a/lib/unicode/Is/Ll.pl b/lib/unicode/Is/Ll.pl index da6b7d76ac..28147943e8 100644 --- a/lib/unicode/Is/Ll.pl +++ b/lib/unicode/Is/Ll.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 0061 007a 00aa diff --git a/lib/unicode/Is/Lm.pl b/lib/unicode/Is/Lm.pl index cc76e43f73..4380afe18e 100644 --- a/lib/unicode/Is/Lm.pl +++ b/lib/unicode/Is/Lm.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 02b0 02b8 02bb 02c1 diff --git a/lib/unicode/Is/Lo.pl b/lib/unicode/Is/Lo.pl index e5f4537dd9..78fab4cd0e 100644 --- a/lib/unicode/Is/Lo.pl +++ b/lib/unicode/Is/Lo.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 01bb 01c0 01c3 diff --git a/lib/unicode/Is/Lower.pl b/lib/unicode/Is/Lower.pl index da6b7d76ac..28147943e8 100644 --- a/lib/unicode/Is/Lower.pl +++ b/lib/unicode/Is/Lower.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 0061 007a 00aa diff --git a/lib/unicode/Is/Lt.pl b/lib/unicode/Is/Lt.pl index 2a6771723e..809c37a1f2 100644 --- a/lib/unicode/Is/Lt.pl +++ b/lib/unicode/Is/Lt.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 01c5 01c8 diff --git a/lib/unicode/Is/Lu.pl b/lib/unicode/Is/Lu.pl index eb8052e70d..8dde2742d0 100644 --- a/lib/unicode/Is/Lu.pl +++ b/lib/unicode/Is/Lu.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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 005a 00c0 00d6 diff --git a/lib/unicode/Is/M.pl b/lib/unicode/Is/M.pl index 0b2bf32916..9367775a82 100644 --- a/lib/unicode/Is/M.pl +++ b/lib/unicode/Is/M.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 0300 034e 0360 0362 diff --git a/lib/unicode/Is/Mc.pl b/lib/unicode/Is/Mc.pl index d707c6712e..937d8d4005 100644 --- a/lib/unicode/Is/Mc.pl +++ b/lib/unicode/Is/Mc.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 0903 093e 0940 diff --git a/lib/unicode/Is/Mirrored.pl b/lib/unicode/Is/Mirrored.pl index b56c8357bc..e2c55a6443 100644 --- a/lib/unicode/Is/Mirrored.pl +++ b/lib/unicode/Is/Mirrored.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 0028 0029 003c diff --git a/lib/unicode/Is/Mn.pl b/lib/unicode/Is/Mn.pl index ffb56f9801..aba40afa57 100644 --- a/lib/unicode/Is/Mn.pl +++ b/lib/unicode/Is/Mn.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 0300 034e 0360 0362 diff --git a/lib/unicode/Is/N.pl b/lib/unicode/Is/N.pl index 6a8072c3de..1291f2713f 100644 --- a/lib/unicode/Is/N.pl +++ b/lib/unicode/Is/N.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 0030 0039 00b2 00b3 diff --git a/lib/unicode/Is/Nd.pl b/lib/unicode/Is/Nd.pl index 2ae9c84f02..2ab8156d77 100644 --- a/lib/unicode/Is/Nd.pl +++ b/lib/unicode/Is/Nd.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 0030 0039 0660 0669 diff --git a/lib/unicode/Is/No.pl b/lib/unicode/Is/No.pl index 0b926a8dec..6a57dc5f89 100644 --- a/lib/unicode/Is/No.pl +++ b/lib/unicode/Is/No.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 00b2 00b3 00b9 diff --git a/lib/unicode/Is/P.pl b/lib/unicode/Is/P.pl index 57b5e24331..8fd1e8e183 100644 --- a/lib/unicode/Is/P.pl +++ b/lib/unicode/Is/P.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 0021 0023 0025 002a diff --git a/lib/unicode/Is/Pd.pl b/lib/unicode/Is/Pd.pl index f1c1439939..58997ca7e9 100644 --- a/lib/unicode/Is/Pd.pl +++ b/lib/unicode/Is/Pd.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 002d 00ad diff --git a/lib/unicode/Is/Pe.pl b/lib/unicode/Is/Pe.pl index 83a22a40c2..8879191c34 100644 --- a/lib/unicode/Is/Pe.pl +++ b/lib/unicode/Is/Pe.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 0029 005d diff --git a/lib/unicode/Is/Po.pl b/lib/unicode/Is/Po.pl index 0e230d8331..e6b8b02520 100644 --- a/lib/unicode/Is/Po.pl +++ b/lib/unicode/Is/Po.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 0021 0023 0025 0027 diff --git a/lib/unicode/Is/Print.pl b/lib/unicode/Is/Print.pl index 8faeea6d95..9560586065 100644 --- a/lib/unicode/Is/Print.pl +++ b/lib/unicode/Is/Print.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 0020 007e 00a0 021f diff --git a/lib/unicode/Is/Ps.pl b/lib/unicode/Is/Ps.pl index fad4da758c..a7dee379eb 100644 --- a/lib/unicode/Is/Ps.pl +++ b/lib/unicode/Is/Ps.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 0028 005b diff --git a/lib/unicode/Is/Punct.pl b/lib/unicode/Is/Punct.pl index 57b5e24331..8fd1e8e183 100644 --- a/lib/unicode/Is/Punct.pl +++ b/lib/unicode/Is/Punct.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 0021 0023 0025 002a diff --git a/lib/unicode/Is/S.pl b/lib/unicode/Is/S.pl index 9292596053..8851766e9f 100644 --- a/lib/unicode/Is/S.pl +++ b/lib/unicode/Is/S.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 0024 002b diff --git a/lib/unicode/Is/Sc.pl b/lib/unicode/Is/Sc.pl index ab2b0d6a30..5776bd6a57 100644 --- a/lib/unicode/Is/Sc.pl +++ b/lib/unicode/Is/Sc.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 0024 00a2 00a5 diff --git a/lib/unicode/Is/Sm.pl b/lib/unicode/Is/Sm.pl index e68877ab80..ae9424cc62 100644 --- a/lib/unicode/Is/Sm.pl +++ b/lib/unicode/Is/Sm.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 002b 003c 003e diff --git a/lib/unicode/Is/So.pl b/lib/unicode/Is/So.pl index 6e937d6b39..4e9dfc2b5e 100644 --- a/lib/unicode/Is/So.pl +++ b/lib/unicode/Is/So.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 00a6 00a7 00a9 diff --git a/lib/unicode/Is/Space.pl b/lib/unicode/Is/Space.pl index d14c3fb78b..4121ef49b8 100644 --- a/lib/unicode/Is/Space.pl +++ b/lib/unicode/Is/Space.pl @@ -1,3 +1,6 @@ +# !!!!!!! 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'; 0009 000a 000c 000d diff --git a/lib/utf8.pm b/lib/utf8.pm index 5ddd4ba21a..d9e9becdda 100644 --- a/lib/utf8.pm +++ b/lib/utf8.pm @@ -1,12 +1,12 @@ package utf8; sub import { - $^H |= 0x00000008; + $^H |= 0x00800000; $enc{caller()} = $_[1] if $_[1]; } sub unimport { - $^H &= ~0x00000008; + $^H &= ~0x00800000; } sub AUTOLOAD { @@ -19,7 +19,7 @@ __END__ =head1 NAME -utf8 - Perl pragma to turn on UTF-8 and Unicode support +utf8 - Perl pragma to enable/disable UTF-8 in source code =head1 SYNOPSIS @@ -28,154 +28,48 @@ utf8 - Perl pragma to turn on UTF-8 and Unicode support =head1 DESCRIPTION -The utf8 pragma tells Perl to use UTF-8 as its internal string -representation for the rest of the enclosing block. (The "no utf8" -pragma tells Perl to switch back to ordinary byte-oriented processing -for the rest of the enclosing block.) Under utf8, many operations that -formerly operated on bytes change to operating on characters. For -ASCII data this makes no difference, because UTF-8 stores ASCII in -single bytes, but for any character greater than C<chr(127)>, the -character is stored in a sequence of two or more bytes, all of which -have the high bit set. But by and large, the user need not worry about -this, because the utf8 pragma hides it from the user. A character -under utf8 is logically just a number ranging from 0 to 2**32 or so. -Larger characters encode to longer sequences of bytes, but again, this -is hidden. +WARNING: The implementation of Unicode support in Perl is incomplete. +Expect sudden and unannounced changes! -Use of the utf8 pragma has the following effects: +The C<use utf8> pragma tells the Perl parser to allow UTF-8 in the +program text in the current lexical scope. The C<no utf8> pragma +tells Perl to switch back to treating the source text as literal +bytes in the current lexical scope. -=over 4 +This pragma is primarily a compatibility device. Perl versions +earlier than 5.6 allowed arbitrary bytes in source code, whereas +in future we would like to standardize on the UTF-8 encoding for +source text. Until UTF-8 becomes the default format for source +text, this pragma should be used to recognize UTF-8 in the source. +When UTF-8 becomes the standard source format, this pragma will +effectively become a no-op. -=item * - -Strings and patterns may contain characters that have an ordinal value -larger than 255. Presuming you use a Unicode editor to edit your -program, these will typically occur directly within the literal strings -as UTF-8 characters, but you can also specify a particular character -with an extension of the C<\x> notation. UTF-8 characters are -specified by putting the hexadecimal code within curlies after the -C<\x>. For instance, a Unicode smiley face is C<\x{263A}>. A -character in the Latin-1 range (128..255) should be written C<\x{ab}> -rather than C<\xab>, since the former will turn into a two-byte UTF-8 -code, while the latter will continue to be interpreted as generating a -8-bit byte rather than a character. In fact, if C<-w> is turned on, it will -produce a warning that you might be generating invalid UTF-8. - -=item * - -Identifiers within the Perl script may contain Unicode alphanumeric -characters, including ideographs. (You are currently on your own when -it comes to using the canonical forms of characters--Perl doesn't (yet) -attempt to canonicalize variable names for you.) - -=item * - -Regular expressions match characters instead of bytes. For instance, -"." matches a character instead of a byte. (However, the C<\C> pattern -is provided to force a match a single byte ("C<char>" in C, hence -C<\C>).) - -=item * +Enabling the C<utf8> pragma has the following effects: -Character classes in regular expressions match characters instead of -bytes, and match against the character properties specified in the -Unicode properties database. So C<\w> can be used to match an ideograph, -for instance. +=over =item * -Named Unicode properties and block ranges make be used as character -classes via the new C<\p{}> (matches property) and C<\P{}> (doesn't -match property) constructs. For instance, C<\p{Lu}> matches any -character with the Unicode uppercase property, while C<\p{M}> matches -any mark character. Single letter properties may omit the brackets, so -that can be written C<\pM> also. Many predefined character classes are -available, such as C<\p{IsMirrored}> and C<\p{InTibetan}>. +Bytes in the source text that have their high-bit set will be treated +as being part of a literal UTF-8 character. This includes most literals +such as identifiers, string constants, constant regular expression patterns +and package names. =item * -The special pattern C<\X> match matches any extended Unicode sequence -(a "combining character sequence" in Standardese), where the first -character is a base character and subsequent characters are mark -characters that apply to the base character. It is equivalent to -C<(?:\PM\pM*)>. - -=item * +In the absence of inputs marked as UTF-8, regular expressions within the +scope of this pragma will default to using character semantics instead +of byte semantics. -The C<tr///> operator translates characters instead of bytes. It can also -be forced to translate between 8-bit codes and UTF-8 regardless of the -surrounding utf8 state. For instance, if you know your input in Latin-1, -you can say: - - use utf8; - while (<>) { - tr/\0-\xff//CU; # latin1 char to utf8 - ... + @bytes_or_chars = split //, $data; # may split to bytes if data + # $data isn't UTF-8 + { + use utf8; # force char semantics + @chars = split //, $data; # splits characters } -Similarly you could translate your output with - - tr/\0-\x{ff}//UC; # utf8 to latin1 char - -No, C<s///> doesn't take /U or /C (yet?). - -=item * - -Case translation operators use the Unicode case translation tables. -Note that C<uc()> translates to uppercase, while C<ucfirst> translates -to titlecase (for languages that make the distinction). Naturally -the corresponding backslash sequences have the same semantics. - -=item * - -Most operators that deal with positions or lengths in the string will -automatically switch to using character positions, including C<chop()>, -C<substr()>, C<pos()>, C<index()>, C<rindex()>, C<sprintf()>, -C<write()>, and C<length()>. Operators that specifically don't switch -include C<vec()>, C<pack()>, and C<unpack()>. Operators that really -don't care include C<chomp()>, as well as any other operator that -treats a string as a bucket of bits, such as C<sort()>, and the -operators dealing with filenames. - -=item * - -The C<pack()>/C<unpack()> letters "C<c>" and "C<C>" do I<not> change, -since they're often used for byte-oriented formats. (Again, think -"C<char>" in the C language.) However, there is a new "C<U>" specifier -that will convert between UTF-8 characters and integers. (It works -outside of the utf8 pragma too.) - -=item * - -The C<chr()> and C<ord()> functions work on characters. This is like -C<pack("U")> and C<unpack("U")>, not like C<pack("C")> and -C<unpack("C")>. In fact, the latter are how you now emulate -byte-oriented C<chr()> and C<ord()> under utf8. - -=item * - -And finally, C<scalar reverse()> reverses by character rather than by byte. - -=back - -=head1 CAVEATS - -As of yet, there is no method for automatically coercing input and -output to some encoding other than UTF-8. This is planned in the near -future, however. - -In any event, you'll need to keep track of whether interfaces to other -modules expect UTF-8 data or something else. The utf8 pragma does not -magically mark strings for you in order to remember their encoding, nor -will any automatic coercion happen (other than that eventually planned -for I/O). If you want such automatic coercion, you can build yourself -a set of pretty object-oriented modules. Expect it to run considerably -slower than than this low-level support. +=head1 SEE ALSO -Use of locales with utf8 may lead to odd results. Currently there is -some attempt to apply 8-bit locale info to characters in the range -0..255, but this is demonstrably incorrect for locales that use -characters above that range (when mapped into Unicode). It will also -tend to run slower. Avoidance of locales is strongly encouraged. +L<perlunicode>, L<byte> =cut diff --git a/lib/utf8_heavy.pl b/lib/utf8_heavy.pl index 0f588237eb..8649e9e07e 100644 --- a/lib/utf8_heavy.pl +++ b/lib/utf8_heavy.pl @@ -38,7 +38,7 @@ sub SWASHNEW { if ($list) { my @tmp = split(/^/m, $list); my %seen; - local $^W = 0; + no warnings; $extras = join '', grep /^[^0-9a-fA-F]/, @tmp; $list = join '', sort { hex $a <=> hex $b } diff --git a/lib/warnings.pm b/lib/warnings.pm index e15d364193..6b87d85f2b 100644 --- a/lib/warnings.pm +++ b/lib/warnings.pm @@ -115,14 +115,15 @@ sub bits { 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 ; + if ($word eq 'FATAL') { + $fatal = 1; + } + else { + if ($catmask = $Bits{$word}) { + $mask |= $catmask ; + $mask |= $DeadBits{$word} if $fatal ; + } } - else - { croak "unknown warning category '$word'" } } return $mask ; @@ -130,12 +131,12 @@ sub bits { sub import { shift; - ${^Warnings} |= bits(@_ ? @_ : 'all') ; + ${^WARNING_BITS} |= bits(@_ ? @_ : 'all') ; } sub unimport { shift; - ${^Warnings} &= ~ bits(@_ ? @_ : 'all') ; + ${^WARNING_BITS} &= ~ bits(@_ ? @_ : 'all') ; } sub enabled @@ -143,7 +144,7 @@ sub enabled my $string = shift ; return 1 - if $bits{$string} && ${^Warnings} & $bits{$string} ; + if $bits{$string} && ${^WARNING_BITS} & $bits{$string} ; return 0 ; } diff --git a/makedef.pl b/makedef.pl index f640f2f2f7..1b77855814 100644 --- a/makedef.pl +++ b/makedef.pl @@ -95,32 +95,20 @@ while (<CFG>) { $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_IMPLICIT_SYS)\b/; $define{$1} = 1 if /^\s*#\s*define\s+(PERL_BINCOMPAT_5005)\b/; } close(CFG); if ($PLATFORM eq 'win32') { warn join(' ',keys %define)."\n"; - if ($define{PERL_OBJECT}) { - print "LIBRARY Perl56\n"; - print "DESCRIPTION 'Perl interpreter'\n"; - print "EXPORTS\n"; -# output_symbol("perl_alloc"); + print "LIBRARY Perl56\n"; + print "DESCRIPTION 'Perl interpreter'\n"; + print "EXPORTS\n"; + if ($define{PERL_IMPLICIT_SYS}) { output_symbol("perl_get_host_info"); output_symbol("perl_alloc_override"); -# output_symbol("perl_construct"); -# output_symbol("perl_destruct"); -# output_symbol("perl_free"); -# output_symbol("perl_parse"); -# output_symbol("perl_run"); -# output_symbol("RunPerl"); -# exit(0); } - else { - print "LIBRARY Perl\n"; - print "DESCRIPTION 'Perl interpreter, export autogenerated'\n"; - print "EXPORTS\n"; - } } elsif ($PLATFORM eq 'os2') { ($v = $]) =~ s/(\d\.\d\d\d)(\d\d)$/$1_$2/; @@ -163,7 +151,7 @@ sub emit_symbols { foreach my $symbol (@$list) { my $skipsym = $symbol; # XXX hack - if ($define{PERL_OBJECT}) { + if ($define{PERL_OBJECT} || $define{MULTIPLICITY}) { $skipsym =~ s/^Perl_[GIT](\w+)_ptr$/PL_$1/; } emit_symbol($symbol) unless exists $skip{$skipsym}; @@ -239,6 +227,7 @@ elsif ($PLATFORM eq 'aix') { Perl_safexrealloc Perl_same_dirent Perl_unlnk + Perl_sys_intern_dup PL_cryptseen PL_opsave PL_statusvalue_vms @@ -446,16 +435,11 @@ sub readvar { return \@syms; } -if ($define{'USE_5005THREADS'} || $define{'MULTIPLICITY'}) { +if ($define{'USE_5005THREADS'}) { 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; @@ -465,7 +449,7 @@ if ($define{'PERL_GLOBAL_STRUCT'}) { # functions from *.sym files -my @syms = ($global_sym, $pp_sym, $globvar_sym); +my @syms = ($global_sym, $globvar_sym); # $pp_sym is not part of the API if ($define{'USE_PERLIO'}) { push @syms, $perlio_sym; @@ -487,7 +471,7 @@ for my $syms (@syms) { # variables -if ($define{'PERL_OBJECT'}) { +if ($define{'PERL_OBJECT'} || $define{'MULTIPLICITY'}) { for my $f ($perlvars_h, $intrpvar_h, $thrdvar_h) { my $glob = readvar($f, sub { "Perl_" . $_[1] . $_[2] . "_ptr" }); emit_symbols $glob; @@ -1034,8 +1034,15 @@ Perl_malloc(register size_t nbytes) 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)); + "Unaligned pointer in the free chain 0x%"UVxf"\n", + PTR2UV(p)); + } + if ((PTR2UV(p->ov_next)) & (MEM_ALIGNBYTES - 1)) { + dTHXo; + PerlIO_printf(PerlIO_stderr(), + "Unaligned `next' pointer in the free " + "chain 0x"UVxf" at 0x%"UVxf"\n", + PTR2UV(p->ov_next), PTR2UV(p)); } #endif nextf[bucket] = p->ov_next; @@ -1748,9 +1755,9 @@ char * Perl_strdup(const char *s) { MEM_SIZE l = strlen(s); - char *s1 = (char *)Perl_malloc(l); + char *s1 = (char *)Perl_malloc(l+1); - Copy(s, s1, (MEM_SIZE)l, char); + Copy(s, s1, (MEM_SIZE)(l+1), char); return s1; } @@ -1776,8 +1783,8 @@ Perl_putenv(char *a) else var = Perl_malloc(l + 1); Copy(a, var, l, char); - val++; - my_setenv(var,val); + var[l + 1] = 0; + my_setenv(var, val+1); if (var != buf) Perl_mfree(var); return 0; @@ -1,6 +1,6 @@ /* mg.c * - * Copyright (c) 1991-1999, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -60,6 +60,14 @@ S_save_magic(pTHX_ I32 mgs_ix, SV *sv) SvFLAGS(sv) |= (SvFLAGS(sv) & (SVp_IOK|SVp_NOK|SVp_POK)) >> PRIVSHIFT; } +/* +=for apidoc mg_magical + +Turns on the magical status of an SV. See C<sv_magic>. + +=cut +*/ + void Perl_mg_magical(pTHX_ SV *sv) { @@ -77,6 +85,14 @@ Perl_mg_magical(pTHX_ SV *sv) } } +/* +=for apidoc mg_get + +Do magic after a value is retrieved from the SV. See C<sv_magic>. + +=cut +*/ + int Perl_mg_get(pTHX_ SV *sv) { @@ -112,6 +128,14 @@ Perl_mg_get(pTHX_ SV *sv) return 0; } +/* +=for apidoc mg_set + +Do magic after a value is assigned to the SV. See C<sv_magic>. + +=cut +*/ + int Perl_mg_set(pTHX_ SV *sv) { @@ -138,6 +162,14 @@ Perl_mg_set(pTHX_ SV *sv) return 0; } +/* +=for apidoc mg_length + +Report on the SV's length. See C<sv_magic>. + +=cut +*/ + U32 Perl_mg_length(pTHX_ SV *sv) { @@ -196,6 +228,14 @@ Perl_mg_size(pTHX_ SV *sv) return 0; } +/* +=for apidoc mg_clear + +Clear something magical that the SV represents. See C<sv_magic>. + +=cut +*/ + int Perl_mg_clear(pTHX_ SV *sv) { @@ -217,6 +257,14 @@ Perl_mg_clear(pTHX_ SV *sv) return 0; } +/* +=for apidoc mg_find + +Finds the magic pointer for type matching the SV. See C<sv_magic>. + +=cut +*/ + MAGIC* Perl_mg_find(pTHX_ SV *sv, int type) { @@ -228,6 +276,14 @@ Perl_mg_find(pTHX_ SV *sv, int type) return 0; } +/* +=for apidoc mg_copy + +Copies the magic from one SV to another. See C<sv_magic>. + +=cut +*/ + int Perl_mg_copy(pTHX_ SV *sv, SV *nsv, const char *key, I32 klen) { @@ -244,6 +300,14 @@ Perl_mg_copy(pTHX_ SV *sv, SV *nsv, const char *key, I32 klen) return count; } +/* +=for apidoc mg_free + +Free any magic storage used by the SV. See C<sv_magic>. + +=cut +*/ + int Perl_mg_free(pTHX_ SV *sv) { @@ -503,10 +567,10 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) sv_setiv(sv, (IV)PL_basetime); #endif break; - case '\027': /* ^W & $^Warnings*/ + case '\027': /* ^W & $^WARNING_BITS & ^WIDE_SYSTEM_CALLS */ if (*(mg->mg_ptr+1) == '\0') sv_setiv(sv, (IV)((PL_dowarn & G_WARN_ON) ? TRUE : FALSE)); - else if (strEQ(mg->mg_ptr, "\027arnings")) { + else if (strEQ(mg->mg_ptr, "\027ARNING_BITS")) { if (PL_compiling.cop_warnings == WARN_NONE || PL_compiling.cop_warnings == WARN_STD) { @@ -519,6 +583,8 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) sv_setsv(sv, PL_compiling.cop_warnings); } } + else if (strEQ(mg->mg_ptr, "\027IDE_SYSTEM_CALLS")) + sv_setiv(sv, (IV)PL_widesyscalls); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '&': @@ -545,6 +611,10 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) PL_tainted = FALSE; } sv_setpvn(sv, s, i); + if ((PL_curpm->op_pmdynflags & PMdf_UTF8) && !IN_BYTE) + SvUTF8_on(sv); + else + SvUTF8_off(sv); if (PL_tainting) PL_tainted = (was_tainted || RX_MATCH_TAINTED(rx)); break; @@ -845,7 +915,7 @@ Perl_magic_clear_all_env(pTHX_ SV *sv, MAGIC *mg) } FreeEnvironmentStrings(envv); # else -# ifdef CYGWIN +# ifdef __CYGWIN__ I32 i; for (i = 0; environ[i]; i++) safesysfree(environ[i]); @@ -859,7 +929,7 @@ Perl_magic_clear_all_env(pTHX_ SV *sv, MAGIC *mg) for (i = 0; environ[i]; i++) safesysfree(environ[i]); # endif /* PERL_USE_SAFE_PUTENV */ -# endif /* CYGWIN */ +# endif /* __CYGWIN__ */ environ[0] = Nullch; @@ -1222,7 +1292,7 @@ Perl_magic_getpos(pTHX_ SV *sv, MAGIC *mg) if (mg && mg->mg_len >= 0) { dTHR; I32 i = mg->mg_len; - if (IN_UTF8) + if (DO_UTF8(lsv)) sv_pos_b2u(lsv, &i); sv_setiv(sv, i + PL_curcop->cop_arybase); return 0; @@ -1238,7 +1308,7 @@ Perl_magic_setpos(pTHX_ SV *sv, MAGIC *mg) SV* lsv = LvTARG(sv); SSize_t pos; STRLEN len; - STRLEN ulen; + STRLEN ulen = 0; dTHR; mg = 0; @@ -1259,12 +1329,10 @@ Perl_magic_setpos(pTHX_ SV *sv, MAGIC *mg) pos = SvIV(sv) - PL_curcop->cop_arybase; - if (IN_UTF8) { + if (DO_UTF8(lsv)) { ulen = sv_len_utf8(lsv); if (ulen) len = ulen; - else - ulen = 0; } if (pos < 0) { @@ -1641,7 +1709,7 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg) PL_basetime = (Time_t)(SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv)); #endif break; - case '\027': /* ^W & $^Warnings */ + case '\027': /* ^W & $^WARNING_BITS & ^WIDE_SYSTEM_CALLS */ if (*(mg->mg_ptr+1) == '\0') { if ( ! (PL_dowarn & G_WARN_ALL_MASK)) { i = SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv); @@ -1649,7 +1717,7 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg) | (i ? G_WARN_ON : G_WARN_OFF) ; } } - else if (strEQ(mg->mg_ptr, "\027arnings")) { + else if (strEQ(mg->mg_ptr, "\027ARNING_BITS")) { if ( ! (PL_dowarn & G_WARN_ALL_MASK)) { if (memEQ(SvPVX(sv), WARN_ALLstring, WARNsize)) { PL_compiling.cop_warnings = WARN_ALL; @@ -1667,6 +1735,8 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg) } } } + else if (strEQ(mg->mg_ptr, "\027IDE_SYSTEM_CALLS")) + PL_widesyscalls = SvTRUE(sv); break; case '.': if (PL_localizing) { @@ -1,6 +1,6 @@ /* mg.h * - * Copyright (c) 1991-1999, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -6,812 +6,9 @@ #ifndef __objXSUB_h__ #define __objXSUB_h__ -/* Variables */ +/* method calls via pPerl (static functions without a "this" pointer need these) */ -#undef PL_Argv -#define PL_Argv (*Perl_IArgv_ptr(aTHXo)) -#undef PL_Cmd -#define PL_Cmd (*Perl_ICmd_ptr(aTHXo)) -#undef PL_DBcv -#define PL_DBcv (*Perl_IDBcv_ptr(aTHXo)) -#undef PL_DBgv -#define PL_DBgv (*Perl_IDBgv_ptr(aTHXo)) -#undef PL_DBline -#define PL_DBline (*Perl_IDBline_ptr(aTHXo)) -#undef PL_DBsignal -#define PL_DBsignal (*Perl_IDBsignal_ptr(aTHXo)) -#undef PL_DBsingle -#define PL_DBsingle (*Perl_IDBsingle_ptr(aTHXo)) -#undef PL_DBsub -#define PL_DBsub (*Perl_IDBsub_ptr(aTHXo)) -#undef PL_DBtrace -#define PL_DBtrace (*Perl_IDBtrace_ptr(aTHXo)) -#undef PL_Dir -#define PL_Dir (*Perl_IDir_ptr(aTHXo)) -#undef PL_Env -#define PL_Env (*Perl_IEnv_ptr(aTHXo)) -#undef PL_LIO -#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_Sock (*Perl_ISock_ptr(aTHXo)) -#undef PL_StdIO -#define PL_StdIO (*Perl_IStdIO_ptr(aTHXo)) -#undef PL_amagic_generation -#define PL_amagic_generation (*Perl_Iamagic_generation_ptr(aTHXo)) -#undef PL_an -#define PL_an (*Perl_Ian_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_basetime (*Perl_Ibasetime_ptr(aTHXo)) -#undef PL_beginav -#define PL_beginav (*Perl_Ibeginav_ptr(aTHXo)) -#undef PL_bitcount -#define PL_bitcount (*Perl_Ibitcount_ptr(aTHXo)) -#undef PL_bufend -#define PL_bufend (*Perl_Ibufend_ptr(aTHXo)) -#undef PL_bufptr -#define PL_bufptr (*Perl_Ibufptr_ptr(aTHXo)) -#undef PL_collation_ix -#define PL_collation_ix (*Perl_Icollation_ix_ptr(aTHXo)) -#undef PL_collation_name -#define PL_collation_name (*Perl_Icollation_name_ptr(aTHXo)) -#undef PL_collation_standard -#define PL_collation_standard (*Perl_Icollation_standard_ptr(aTHXo)) -#undef PL_collxfrm_base -#define PL_collxfrm_base (*Perl_Icollxfrm_base_ptr(aTHXo)) -#undef PL_collxfrm_mult -#define PL_collxfrm_mult (*Perl_Icollxfrm_mult_ptr(aTHXo)) -#undef PL_compcv -#define PL_compcv (*Perl_Icompcv_ptr(aTHXo)) -#undef PL_compiling -#define PL_compiling (*Perl_Icompiling_ptr(aTHXo)) -#undef PL_comppad -#define PL_comppad (*Perl_Icomppad_ptr(aTHXo)) -#undef PL_comppad_name -#define PL_comppad_name (*Perl_Icomppad_name_ptr(aTHXo)) -#undef PL_comppad_name_fill -#define PL_comppad_name_fill (*Perl_Icomppad_name_fill_ptr(aTHXo)) -#undef PL_comppad_name_floor -#define PL_comppad_name_floor (*Perl_Icomppad_name_floor_ptr(aTHXo)) -#undef PL_cop_seqmax -#define PL_cop_seqmax (*Perl_Icop_seqmax_ptr(aTHXo)) -#undef PL_copline -#define PL_copline (*Perl_Icopline_ptr(aTHXo)) -#undef PL_cred_mutex -#define PL_cred_mutex (*Perl_Icred_mutex_ptr(aTHXo)) -#undef PL_cryptseen -#define PL_cryptseen (*Perl_Icryptseen_ptr(aTHXo)) -#undef PL_cshlen -#define PL_cshlen (*Perl_Icshlen_ptr(aTHXo)) -#undef PL_cshname -#define PL_cshname (*Perl_Icshname_ptr(aTHXo)) -#undef PL_curcopdb -#define PL_curcopdb (*Perl_Icurcopdb_ptr(aTHXo)) -#undef PL_curstname -#define PL_curstname (*Perl_Icurstname_ptr(aTHXo)) -#undef PL_curthr -#define PL_curthr (*Perl_Icurthr_ptr(aTHXo)) -#undef PL_dbargs -#define PL_dbargs (*Perl_Idbargs_ptr(aTHXo)) -#undef PL_debstash -#define PL_debstash (*Perl_Idebstash_ptr(aTHXo)) -#undef PL_debug -#define PL_debug (*Perl_Idebug_ptr(aTHXo)) -#undef PL_defgv -#define PL_defgv (*Perl_Idefgv_ptr(aTHXo)) -#undef PL_diehook -#define PL_diehook (*Perl_Idiehook_ptr(aTHXo)) -#undef PL_doextract -#define PL_doextract (*Perl_Idoextract_ptr(aTHXo)) -#undef PL_doswitches -#define PL_doswitches (*Perl_Idoswitches_ptr(aTHXo)) -#undef PL_dowarn -#define PL_dowarn (*Perl_Idowarn_ptr(aTHXo)) -#undef PL_e_script -#define PL_e_script (*Perl_Ie_script_ptr(aTHXo)) -#undef PL_egid -#define PL_egid (*Perl_Iegid_ptr(aTHXo)) -#undef PL_endav -#define PL_endav (*Perl_Iendav_ptr(aTHXo)) -#undef PL_envgv -#define PL_envgv (*Perl_Ienvgv_ptr(aTHXo)) -#undef PL_errgv -#define PL_errgv (*Perl_Ierrgv_ptr(aTHXo)) -#undef PL_error_count -#define PL_error_count (*Perl_Ierror_count_ptr(aTHXo)) -#undef PL_euid -#define PL_euid (*Perl_Ieuid_ptr(aTHXo)) -#undef PL_eval_cond -#define PL_eval_cond (*Perl_Ieval_cond_ptr(aTHXo)) -#undef PL_eval_mutex -#define PL_eval_mutex (*Perl_Ieval_mutex_ptr(aTHXo)) -#undef PL_eval_owner -#define PL_eval_owner (*Perl_Ieval_owner_ptr(aTHXo)) -#undef PL_eval_root -#define PL_eval_root (*Perl_Ieval_root_ptr(aTHXo)) -#undef PL_eval_start -#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_exitlistlen (*Perl_Iexitlistlen_ptr(aTHXo)) -#undef PL_expect -#define PL_expect (*Perl_Iexpect_ptr(aTHXo)) -#undef PL_fdpid -#define PL_fdpid (*Perl_Ifdpid_ptr(aTHXo)) -#undef PL_filemode -#define PL_filemode (*Perl_Ifilemode_ptr(aTHXo)) -#undef PL_forkprocess -#define PL_forkprocess (*Perl_Iforkprocess_ptr(aTHXo)) -#undef PL_formfeed -#define PL_formfeed (*Perl_Iformfeed_ptr(aTHXo)) -#undef PL_generation -#define PL_generation (*Perl_Igeneration_ptr(aTHXo)) -#undef PL_gensym -#define PL_gensym (*Perl_Igensym_ptr(aTHXo)) -#undef PL_gid -#define PL_gid (*Perl_Igid_ptr(aTHXo)) -#undef PL_glob_index -#define PL_glob_index (*Perl_Iglob_index_ptr(aTHXo)) -#undef PL_globalstash -#define PL_globalstash (*Perl_Iglobalstash_ptr(aTHXo)) -#undef PL_he_root -#define PL_he_root (*Perl_Ihe_root_ptr(aTHXo)) -#undef PL_hintgv -#define PL_hintgv (*Perl_Ihintgv_ptr(aTHXo)) -#undef PL_hints -#define PL_hints (*Perl_Ihints_ptr(aTHXo)) -#undef PL_in_clean_all -#define PL_in_clean_all (*Perl_Iin_clean_all_ptr(aTHXo)) -#undef PL_in_clean_objs -#define PL_in_clean_objs (*Perl_Iin_clean_objs_ptr(aTHXo)) -#undef PL_in_my -#define PL_in_my (*Perl_Iin_my_ptr(aTHXo)) -#undef PL_in_my_stash -#define PL_in_my_stash (*Perl_Iin_my_stash_ptr(aTHXo)) -#undef PL_incgv -#define PL_incgv (*Perl_Iincgv_ptr(aTHXo)) -#undef PL_initav -#define PL_initav (*Perl_Iinitav_ptr(aTHXo)) -#undef PL_inplace -#define PL_inplace (*Perl_Iinplace_ptr(aTHXo)) -#undef PL_last_lop -#define PL_last_lop (*Perl_Ilast_lop_ptr(aTHXo)) -#undef PL_last_lop_op -#define PL_last_lop_op (*Perl_Ilast_lop_op_ptr(aTHXo)) -#undef PL_last_swash_hv -#define PL_last_swash_hv (*Perl_Ilast_swash_hv_ptr(aTHXo)) -#undef PL_last_swash_key -#define PL_last_swash_key (*Perl_Ilast_swash_key_ptr(aTHXo)) -#undef PL_last_swash_klen -#define PL_last_swash_klen (*Perl_Ilast_swash_klen_ptr(aTHXo)) -#undef PL_last_swash_slen -#define PL_last_swash_slen (*Perl_Ilast_swash_slen_ptr(aTHXo)) -#undef PL_last_swash_tmps -#define PL_last_swash_tmps (*Perl_Ilast_swash_tmps_ptr(aTHXo)) -#undef PL_last_uni -#define PL_last_uni (*Perl_Ilast_uni_ptr(aTHXo)) -#undef PL_lastfd -#define PL_lastfd (*Perl_Ilastfd_ptr(aTHXo)) -#undef PL_laststatval -#define PL_laststatval (*Perl_Ilaststatval_ptr(aTHXo)) -#undef PL_laststype -#define PL_laststype (*Perl_Ilaststype_ptr(aTHXo)) -#undef PL_lex_brackets -#define PL_lex_brackets (*Perl_Ilex_brackets_ptr(aTHXo)) -#undef PL_lex_brackstack -#define PL_lex_brackstack (*Perl_Ilex_brackstack_ptr(aTHXo)) -#undef PL_lex_casemods -#define PL_lex_casemods (*Perl_Ilex_casemods_ptr(aTHXo)) -#undef PL_lex_casestack -#define PL_lex_casestack (*Perl_Ilex_casestack_ptr(aTHXo)) -#undef PL_lex_defer -#define PL_lex_defer (*Perl_Ilex_defer_ptr(aTHXo)) -#undef PL_lex_dojoin -#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_formbrack -#define PL_lex_formbrack (*Perl_Ilex_formbrack_ptr(aTHXo)) -#undef PL_lex_inpat -#define PL_lex_inpat (*Perl_Ilex_inpat_ptr(aTHXo)) -#undef PL_lex_inwhat -#define PL_lex_inwhat (*Perl_Ilex_inwhat_ptr(aTHXo)) -#undef PL_lex_op -#define PL_lex_op (*Perl_Ilex_op_ptr(aTHXo)) -#undef PL_lex_repl -#define PL_lex_repl (*Perl_Ilex_repl_ptr(aTHXo)) -#undef PL_lex_starts -#define PL_lex_starts (*Perl_Ilex_starts_ptr(aTHXo)) -#undef PL_lex_state -#define PL_lex_state (*Perl_Ilex_state_ptr(aTHXo)) -#undef PL_lex_stuff -#define PL_lex_stuff (*Perl_Ilex_stuff_ptr(aTHXo)) -#undef PL_lineary -#define PL_lineary (*Perl_Ilineary_ptr(aTHXo)) -#undef PL_linestart -#define PL_linestart (*Perl_Ilinestart_ptr(aTHXo)) -#undef PL_linestr -#define PL_linestr (*Perl_Ilinestr_ptr(aTHXo)) -#undef PL_localpatches -#define PL_localpatches (*Perl_Ilocalpatches_ptr(aTHXo)) -#undef PL_main_cv -#define PL_main_cv (*Perl_Imain_cv_ptr(aTHXo)) -#undef PL_main_root -#define PL_main_root (*Perl_Imain_root_ptr(aTHXo)) -#undef PL_main_start -#define PL_main_start (*Perl_Imain_start_ptr(aTHXo)) -#undef PL_max_intro_pending -#define PL_max_intro_pending (*Perl_Imax_intro_pending_ptr(aTHXo)) -#undef PL_maxo -#define PL_maxo (*Perl_Imaxo_ptr(aTHXo)) -#undef PL_maxsysfd -#define PL_maxsysfd (*Perl_Imaxsysfd_ptr(aTHXo)) -#undef PL_mess_sv -#define PL_mess_sv (*Perl_Imess_sv_ptr(aTHXo)) -#undef PL_min_intro_pending -#define PL_min_intro_pending (*Perl_Imin_intro_pending_ptr(aTHXo)) -#undef PL_minus_F -#define PL_minus_F (*Perl_Iminus_F_ptr(aTHXo)) -#undef PL_minus_a -#define PL_minus_a (*Perl_Iminus_a_ptr(aTHXo)) -#undef PL_minus_c -#define PL_minus_c (*Perl_Iminus_c_ptr(aTHXo)) -#undef PL_minus_l -#define PL_minus_l (*Perl_Iminus_l_ptr(aTHXo)) -#undef PL_minus_n -#define PL_minus_n (*Perl_Iminus_n_ptr(aTHXo)) -#undef PL_minus_p -#define PL_minus_p (*Perl_Iminus_p_ptr(aTHXo)) -#undef PL_modglobal -#define PL_modglobal (*Perl_Imodglobal_ptr(aTHXo)) -#undef PL_multi_close -#define PL_multi_close (*Perl_Imulti_close_ptr(aTHXo)) -#undef PL_multi_end -#define PL_multi_end (*Perl_Imulti_end_ptr(aTHXo)) -#undef PL_multi_open -#define PL_multi_open (*Perl_Imulti_open_ptr(aTHXo)) -#undef PL_multi_start -#define PL_multi_start (*Perl_Imulti_start_ptr(aTHXo)) -#undef PL_multiline -#define PL_multiline (*Perl_Imultiline_ptr(aTHXo)) -#undef PL_nexttoke -#define PL_nexttoke (*Perl_Inexttoke_ptr(aTHXo)) -#undef PL_nexttype -#define PL_nexttype (*Perl_Inexttype_ptr(aTHXo)) -#undef PL_nextval -#define PL_nextval (*Perl_Inextval_ptr(aTHXo)) -#undef PL_nice_chunk -#define PL_nice_chunk (*Perl_Inice_chunk_ptr(aTHXo)) -#undef PL_nice_chunk_size -#define PL_nice_chunk_size (*Perl_Inice_chunk_size_ptr(aTHXo)) -#undef PL_nomemok -#define PL_nomemok (*Perl_Inomemok_ptr(aTHXo)) -#undef PL_nthreads -#define PL_nthreads (*Perl_Inthreads_ptr(aTHXo)) -#undef PL_nthreads_cond -#define PL_nthreads_cond (*Perl_Inthreads_cond_ptr(aTHXo)) -#undef PL_numeric_local -#define PL_numeric_local (*Perl_Inumeric_local_ptr(aTHXo)) -#undef PL_numeric_name -#define PL_numeric_name (*Perl_Inumeric_name_ptr(aTHXo)) -#undef PL_numeric_radix -#define PL_numeric_radix (*Perl_Inumeric_radix_ptr(aTHXo)) -#undef PL_numeric_standard -#define PL_numeric_standard (*Perl_Inumeric_standard_ptr(aTHXo)) -#undef PL_ofmt -#define PL_ofmt (*Perl_Iofmt_ptr(aTHXo)) -#undef PL_oldbufptr -#define PL_oldbufptr (*Perl_Ioldbufptr_ptr(aTHXo)) -#undef PL_oldname -#define PL_oldname (*Perl_Ioldname_ptr(aTHXo)) -#undef PL_oldoldbufptr -#define PL_oldoldbufptr (*Perl_Ioldoldbufptr_ptr(aTHXo)) -#undef PL_op_mask -#define PL_op_mask (*Perl_Iop_mask_ptr(aTHXo)) -#undef PL_op_seqmax -#define PL_op_seqmax (*Perl_Iop_seqmax_ptr(aTHXo)) -#undef PL_origalen -#define PL_origalen (*Perl_Iorigalen_ptr(aTHXo)) -#undef PL_origargc -#define PL_origargc (*Perl_Iorigargc_ptr(aTHXo)) -#undef PL_origargv -#define PL_origargv (*Perl_Iorigargv_ptr(aTHXo)) -#undef PL_origenviron -#define PL_origenviron (*Perl_Iorigenviron_ptr(aTHXo)) -#undef PL_origfilename -#define PL_origfilename (*Perl_Iorigfilename_ptr(aTHXo)) -#undef PL_ors -#define PL_ors (*Perl_Iors_ptr(aTHXo)) -#undef PL_orslen -#define PL_orslen (*Perl_Iorslen_ptr(aTHXo)) -#undef PL_osname -#define PL_osname (*Perl_Iosname_ptr(aTHXo)) -#undef PL_pad_reset_pending -#define PL_pad_reset_pending (*Perl_Ipad_reset_pending_ptr(aTHXo)) -#undef PL_padix -#define PL_padix (*Perl_Ipadix_ptr(aTHXo)) -#undef PL_padix_floor -#define PL_padix_floor (*Perl_Ipadix_floor_ptr(aTHXo)) -#undef PL_patchlevel -#define PL_patchlevel (*Perl_Ipatchlevel_ptr(aTHXo)) -#undef PL_pending_ident -#define PL_pending_ident (*Perl_Ipending_ident_ptr(aTHXo)) -#undef PL_perl_destruct_level -#define PL_perl_destruct_level (*Perl_Iperl_destruct_level_ptr(aTHXo)) -#undef PL_perldb -#define PL_perldb (*Perl_Iperldb_ptr(aTHXo)) -#undef PL_pidstatus -#define PL_pidstatus (*Perl_Ipidstatus_ptr(aTHXo)) -#undef PL_preambleav -#define PL_preambleav (*Perl_Ipreambleav_ptr(aTHXo)) -#undef PL_preambled -#define PL_preambled (*Perl_Ipreambled_ptr(aTHXo)) -#undef PL_preprocess -#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_rsfp -#define PL_rsfp (*Perl_Irsfp_ptr(aTHXo)) -#undef PL_rsfp_filters -#define PL_rsfp_filters (*Perl_Irsfp_filters_ptr(aTHXo)) -#undef PL_runops -#define PL_runops (*Perl_Irunops_ptr(aTHXo)) -#undef PL_sawampersand -#define PL_sawampersand (*Perl_Isawampersand_ptr(aTHXo)) -#undef PL_sh_path -#define PL_sh_path (*Perl_Ish_path_ptr(aTHXo)) -#undef PL_sighandlerp -#define PL_sighandlerp (*Perl_Isighandlerp_ptr(aTHXo)) -#undef PL_splitstr -#define PL_splitstr (*Perl_Isplitstr_ptr(aTHXo)) -#undef PL_srand_called -#define PL_srand_called (*Perl_Isrand_called_ptr(aTHXo)) -#undef PL_statusvalue -#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_stopav -#define PL_stopav (*Perl_Istopav_ptr(aTHXo)) -#undef PL_strtab -#define PL_strtab (*Perl_Istrtab_ptr(aTHXo)) -#undef PL_strtab_mutex -#define PL_strtab_mutex (*Perl_Istrtab_mutex_ptr(aTHXo)) -#undef PL_sub_generation -#define PL_sub_generation (*Perl_Isub_generation_ptr(aTHXo)) -#undef PL_sublex_info -#define PL_sublex_info (*Perl_Isublex_info_ptr(aTHXo)) -#undef PL_subline -#define PL_subline (*Perl_Isubline_ptr(aTHXo)) -#undef PL_subname -#define PL_subname (*Perl_Isubname_ptr(aTHXo)) -#undef PL_sv_arenaroot -#define PL_sv_arenaroot (*Perl_Isv_arenaroot_ptr(aTHXo)) -#undef PL_sv_count -#define PL_sv_count (*Perl_Isv_count_ptr(aTHXo)) -#undef PL_sv_mutex -#define PL_sv_mutex (*Perl_Isv_mutex_ptr(aTHXo)) -#undef PL_sv_no -#define PL_sv_no (*Perl_Isv_no_ptr(aTHXo)) -#undef PL_sv_objcount -#define PL_sv_objcount (*Perl_Isv_objcount_ptr(aTHXo)) -#undef PL_sv_root -#define PL_sv_root (*Perl_Isv_root_ptr(aTHXo)) -#undef PL_sv_undef -#define PL_sv_undef (*Perl_Isv_undef_ptr(aTHXo)) -#undef PL_sv_yes -#define PL_sv_yes (*Perl_Isv_yes_ptr(aTHXo)) -#undef PL_svref_mutex -#define PL_svref_mutex (*Perl_Isvref_mutex_ptr(aTHXo)) -#undef PL_sys_intern -#define PL_sys_intern (*Perl_Isys_intern_ptr(aTHXo)) -#undef PL_tainting -#define PL_tainting (*Perl_Itainting_ptr(aTHXo)) -#undef PL_thr_key -#define PL_thr_key (*Perl_Ithr_key_ptr(aTHXo)) -#undef PL_threadnum -#define PL_threadnum (*Perl_Ithreadnum_ptr(aTHXo)) -#undef PL_threads_mutex -#define PL_threads_mutex (*Perl_Ithreads_mutex_ptr(aTHXo)) -#undef PL_threadsv_names -#define PL_threadsv_names (*Perl_Ithreadsv_names_ptr(aTHXo)) -#undef PL_thrsv -#define PL_thrsv (*Perl_Ithrsv_ptr(aTHXo)) -#undef PL_tokenbuf -#define PL_tokenbuf (*Perl_Itokenbuf_ptr(aTHXo)) -#undef PL_uid -#define PL_uid (*Perl_Iuid_ptr(aTHXo)) -#undef PL_unsafe -#define PL_unsafe (*Perl_Iunsafe_ptr(aTHXo)) -#undef PL_utf8_alnum -#define PL_utf8_alnum (*Perl_Iutf8_alnum_ptr(aTHXo)) -#undef PL_utf8_alnumc -#define PL_utf8_alnumc (*Perl_Iutf8_alnumc_ptr(aTHXo)) -#undef PL_utf8_alpha -#define PL_utf8_alpha (*Perl_Iutf8_alpha_ptr(aTHXo)) -#undef PL_utf8_ascii -#define PL_utf8_ascii (*Perl_Iutf8_ascii_ptr(aTHXo)) -#undef PL_utf8_cntrl -#define PL_utf8_cntrl (*Perl_Iutf8_cntrl_ptr(aTHXo)) -#undef PL_utf8_digit -#define PL_utf8_digit (*Perl_Iutf8_digit_ptr(aTHXo)) -#undef PL_utf8_graph -#define PL_utf8_graph (*Perl_Iutf8_graph_ptr(aTHXo)) -#undef PL_utf8_lower -#define PL_utf8_lower (*Perl_Iutf8_lower_ptr(aTHXo)) -#undef PL_utf8_mark -#define PL_utf8_mark (*Perl_Iutf8_mark_ptr(aTHXo)) -#undef PL_utf8_print -#define PL_utf8_print (*Perl_Iutf8_print_ptr(aTHXo)) -#undef PL_utf8_punct -#define PL_utf8_punct (*Perl_Iutf8_punct_ptr(aTHXo)) -#undef PL_utf8_space -#define PL_utf8_space (*Perl_Iutf8_space_ptr(aTHXo)) -#undef PL_utf8_tolower -#define PL_utf8_tolower (*Perl_Iutf8_tolower_ptr(aTHXo)) -#undef PL_utf8_totitle -#define PL_utf8_totitle (*Perl_Iutf8_totitle_ptr(aTHXo)) -#undef PL_utf8_toupper -#define PL_utf8_toupper (*Perl_Iutf8_toupper_ptr(aTHXo)) -#undef PL_utf8_upper -#define PL_utf8_upper (*Perl_Iutf8_upper_ptr(aTHXo)) -#undef PL_utf8_xdigit -#define PL_utf8_xdigit (*Perl_Iutf8_xdigit_ptr(aTHXo)) -#undef PL_uudmap -#define PL_uudmap (*Perl_Iuudmap_ptr(aTHXo)) -#undef PL_warnhook -#define PL_warnhook (*Perl_Iwarnhook_ptr(aTHXo)) -#undef PL_xiv_arenaroot -#define PL_xiv_arenaroot (*Perl_Ixiv_arenaroot_ptr(aTHXo)) -#undef PL_xiv_root -#define PL_xiv_root (*Perl_Ixiv_root_ptr(aTHXo)) -#undef PL_xnv_root -#define PL_xnv_root (*Perl_Ixnv_root_ptr(aTHXo)) -#undef PL_xpv_root -#define PL_xpv_root (*Perl_Ixpv_root_ptr(aTHXo)) -#undef PL_xpvav_root -#define PL_xpvav_root (*Perl_Ixpvav_root_ptr(aTHXo)) -#undef PL_xpvbm_root -#define PL_xpvbm_root (*Perl_Ixpvbm_root_ptr(aTHXo)) -#undef PL_xpvcv_root -#define PL_xpvcv_root (*Perl_Ixpvcv_root_ptr(aTHXo)) -#undef PL_xpvhv_root -#define PL_xpvhv_root (*Perl_Ixpvhv_root_ptr(aTHXo)) -#undef PL_xpviv_root -#define PL_xpviv_root (*Perl_Ixpviv_root_ptr(aTHXo)) -#undef PL_xpvlv_root -#define PL_xpvlv_root (*Perl_Ixpvlv_root_ptr(aTHXo)) -#undef PL_xpvmg_root -#define PL_xpvmg_root (*Perl_Ixpvmg_root_ptr(aTHXo)) -#undef PL_xpvnv_root -#define PL_xpvnv_root (*Perl_Ixpvnv_root_ptr(aTHXo)) -#undef PL_xrv_root -#define PL_xrv_root (*Perl_Ixrv_root_ptr(aTHXo)) -#undef PL_yychar -#define PL_yychar (*Perl_Iyychar_ptr(aTHXo)) -#undef PL_yydebug -#define PL_yydebug (*Perl_Iyydebug_ptr(aTHXo)) -#undef PL_yyerrflag -#define PL_yyerrflag (*Perl_Iyyerrflag_ptr(aTHXo)) -#undef PL_yylval -#define PL_yylval (*Perl_Iyylval_ptr(aTHXo)) -#undef PL_yynerrs -#define PL_yynerrs (*Perl_Iyynerrs_ptr(aTHXo)) -#undef PL_yyval -#define PL_yyval (*Perl_Iyyval_ptr(aTHXo)) -#undef PL_Sv -#define PL_Sv (*Perl_TSv_ptr(aTHXo)) -#undef PL_Xpv -#define PL_Xpv (*Perl_TXpv_ptr(aTHXo)) -#undef PL_av_fetch_sv -#define PL_av_fetch_sv (*Perl_Tav_fetch_sv_ptr(aTHXo)) -#undef PL_bodytarget -#define PL_bodytarget (*Perl_Tbodytarget_ptr(aTHXo)) -#undef PL_bostr -#define PL_bostr (*Perl_Tbostr_ptr(aTHXo)) -#undef PL_chopset -#define PL_chopset (*Perl_Tchopset_ptr(aTHXo)) -#undef PL_colors -#define PL_colors (*Perl_Tcolors_ptr(aTHXo)) -#undef PL_colorset -#define PL_colorset (*Perl_Tcolorset_ptr(aTHXo)) -#undef PL_curcop -#define PL_curcop (*Perl_Tcurcop_ptr(aTHXo)) -#undef PL_curpad -#define PL_curpad (*Perl_Tcurpad_ptr(aTHXo)) -#undef PL_curpm -#define PL_curpm (*Perl_Tcurpm_ptr(aTHXo)) -#undef PL_curstack -#define PL_curstack (*Perl_Tcurstack_ptr(aTHXo)) -#undef PL_curstackinfo -#define PL_curstackinfo (*Perl_Tcurstackinfo_ptr(aTHXo)) -#undef PL_curstash -#define PL_curstash (*Perl_Tcurstash_ptr(aTHXo)) -#undef PL_defoutgv -#define PL_defoutgv (*Perl_Tdefoutgv_ptr(aTHXo)) -#undef PL_defstash -#define PL_defstash (*Perl_Tdefstash_ptr(aTHXo)) -#undef PL_delaymagic -#define PL_delaymagic (*Perl_Tdelaymagic_ptr(aTHXo)) -#undef PL_dirty -#define PL_dirty (*Perl_Tdirty_ptr(aTHXo)) -#undef PL_dumpindent -#define PL_dumpindent (*Perl_Tdumpindent_ptr(aTHXo)) -#undef PL_efloatbuf -#define PL_efloatbuf (*Perl_Tefloatbuf_ptr(aTHXo)) -#undef PL_efloatsize -#define PL_efloatsize (*Perl_Tefloatsize_ptr(aTHXo)) -#undef PL_errors -#define PL_errors (*Perl_Terrors_ptr(aTHXo)) -#undef PL_extralen -#define PL_extralen (*Perl_Textralen_ptr(aTHXo)) -#undef PL_firstgv -#define PL_firstgv (*Perl_Tfirstgv_ptr(aTHXo)) -#undef PL_formtarget -#define PL_formtarget (*Perl_Tformtarget_ptr(aTHXo)) -#undef PL_hv_fetch_ent_mh -#define PL_hv_fetch_ent_mh (*Perl_Thv_fetch_ent_mh_ptr(aTHXo)) -#undef PL_hv_fetch_sv -#define PL_hv_fetch_sv (*Perl_Thv_fetch_sv_ptr(aTHXo)) -#undef PL_in_eval -#define PL_in_eval (*Perl_Tin_eval_ptr(aTHXo)) -#undef PL_last_in_gv -#define PL_last_in_gv (*Perl_Tlast_in_gv_ptr(aTHXo)) -#undef PL_lastgotoprobe -#define PL_lastgotoprobe (*Perl_Tlastgotoprobe_ptr(aTHXo)) -#undef PL_lastscream -#define PL_lastscream (*Perl_Tlastscream_ptr(aTHXo)) -#undef PL_localizing -#define PL_localizing (*Perl_Tlocalizing_ptr(aTHXo)) -#undef PL_mainstack -#define PL_mainstack (*Perl_Tmainstack_ptr(aTHXo)) -#undef PL_markstack -#define PL_markstack (*Perl_Tmarkstack_ptr(aTHXo)) -#undef PL_markstack_max -#define PL_markstack_max (*Perl_Tmarkstack_max_ptr(aTHXo)) -#undef PL_markstack_ptr -#define PL_markstack_ptr (*Perl_Tmarkstack_ptr_ptr(aTHXo)) -#undef PL_maxscream -#define PL_maxscream (*Perl_Tmaxscream_ptr(aTHXo)) -#undef PL_modcount -#define PL_modcount (*Perl_Tmodcount_ptr(aTHXo)) -#undef PL_na -#define PL_na (*Perl_Tna_ptr(aTHXo)) -#undef PL_nrs -#define PL_nrs (*Perl_Tnrs_ptr(aTHXo)) -#undef PL_ofs -#define PL_ofs (*Perl_Tofs_ptr(aTHXo)) -#undef PL_ofslen -#define PL_ofslen (*Perl_Tofslen_ptr(aTHXo)) -#undef PL_op -#define PL_op (*Perl_Top_ptr(aTHXo)) -#undef PL_opsave -#define PL_opsave (*Perl_Topsave_ptr(aTHXo)) -#undef PL_protect -#define PL_protect (*Perl_Tprotect_ptr(aTHXo)) -#undef PL_reg_call_cc -#define PL_reg_call_cc (*Perl_Treg_call_cc_ptr(aTHXo)) -#undef PL_reg_curpm -#define PL_reg_curpm (*Perl_Treg_curpm_ptr(aTHXo)) -#undef PL_reg_eval_set -#define PL_reg_eval_set (*Perl_Treg_eval_set_ptr(aTHXo)) -#undef PL_reg_flags -#define PL_reg_flags (*Perl_Treg_flags_ptr(aTHXo)) -#undef PL_reg_ganch -#define PL_reg_ganch (*Perl_Treg_ganch_ptr(aTHXo)) -#undef PL_reg_leftiter -#define PL_reg_leftiter (*Perl_Treg_leftiter_ptr(aTHXo)) -#undef PL_reg_magic -#define PL_reg_magic (*Perl_Treg_magic_ptr(aTHXo)) -#undef PL_reg_maxiter -#define PL_reg_maxiter (*Perl_Treg_maxiter_ptr(aTHXo)) -#undef PL_reg_oldcurpm -#define PL_reg_oldcurpm (*Perl_Treg_oldcurpm_ptr(aTHXo)) -#undef PL_reg_oldpos -#define PL_reg_oldpos (*Perl_Treg_oldpos_ptr(aTHXo)) -#undef PL_reg_oldsaved -#define PL_reg_oldsaved (*Perl_Treg_oldsaved_ptr(aTHXo)) -#undef PL_reg_oldsavedlen -#define PL_reg_oldsavedlen (*Perl_Treg_oldsavedlen_ptr(aTHXo)) -#undef PL_reg_poscache -#define PL_reg_poscache (*Perl_Treg_poscache_ptr(aTHXo)) -#undef PL_reg_poscache_size -#define PL_reg_poscache_size (*Perl_Treg_poscache_size_ptr(aTHXo)) -#undef PL_reg_re -#define PL_reg_re (*Perl_Treg_re_ptr(aTHXo)) -#undef PL_reg_start_tmp -#define PL_reg_start_tmp (*Perl_Treg_start_tmp_ptr(aTHXo)) -#undef PL_reg_start_tmpl -#define PL_reg_start_tmpl (*Perl_Treg_start_tmpl_ptr(aTHXo)) -#undef PL_reg_starttry -#define PL_reg_starttry (*Perl_Treg_starttry_ptr(aTHXo)) -#undef PL_reg_sv -#define PL_reg_sv (*Perl_Treg_sv_ptr(aTHXo)) -#undef PL_reg_whilem_seen -#define PL_reg_whilem_seen (*Perl_Treg_whilem_seen_ptr(aTHXo)) -#undef PL_regbol -#define PL_regbol (*Perl_Tregbol_ptr(aTHXo)) -#undef PL_regcc -#define PL_regcc (*Perl_Tregcc_ptr(aTHXo)) -#undef PL_regcode -#define PL_regcode (*Perl_Tregcode_ptr(aTHXo)) -#undef PL_regcomp_parse -#define PL_regcomp_parse (*Perl_Tregcomp_parse_ptr(aTHXo)) -#undef PL_regcomp_rx -#define PL_regcomp_rx (*Perl_Tregcomp_rx_ptr(aTHXo)) -#undef PL_regcompp -#define PL_regcompp (*Perl_Tregcompp_ptr(aTHXo)) -#undef PL_regdata -#define PL_regdata (*Perl_Tregdata_ptr(aTHXo)) -#undef PL_regdummy -#define PL_regdummy (*Perl_Tregdummy_ptr(aTHXo)) -#undef PL_regendp -#define PL_regendp (*Perl_Tregendp_ptr(aTHXo)) -#undef PL_regeol -#define PL_regeol (*Perl_Tregeol_ptr(aTHXo)) -#undef PL_regexecp -#define PL_regexecp (*Perl_Tregexecp_ptr(aTHXo)) -#undef PL_regflags -#define PL_regflags (*Perl_Tregflags_ptr(aTHXo)) -#undef PL_regfree -#define PL_regfree (*Perl_Tregfree_ptr(aTHXo)) -#undef PL_regindent -#define PL_regindent (*Perl_Tregindent_ptr(aTHXo)) -#undef PL_reginput -#define PL_reginput (*Perl_Treginput_ptr(aTHXo)) -#undef PL_regint_start -#define PL_regint_start (*Perl_Tregint_start_ptr(aTHXo)) -#undef PL_regint_string -#define PL_regint_string (*Perl_Tregint_string_ptr(aTHXo)) -#undef PL_reginterp_cnt -#define PL_reginterp_cnt (*Perl_Treginterp_cnt_ptr(aTHXo)) -#undef PL_reglastparen -#define PL_reglastparen (*Perl_Treglastparen_ptr(aTHXo)) -#undef PL_regnarrate -#define PL_regnarrate (*Perl_Tregnarrate_ptr(aTHXo)) -#undef PL_regnaughty -#define PL_regnaughty (*Perl_Tregnaughty_ptr(aTHXo)) -#undef PL_regnpar -#define PL_regnpar (*Perl_Tregnpar_ptr(aTHXo)) -#undef PL_regprecomp -#define PL_regprecomp (*Perl_Tregprecomp_ptr(aTHXo)) -#undef PL_regprev -#define PL_regprev (*Perl_Tregprev_ptr(aTHXo)) -#undef PL_regprogram -#define PL_regprogram (*Perl_Tregprogram_ptr(aTHXo)) -#undef PL_regsawback -#define PL_regsawback (*Perl_Tregsawback_ptr(aTHXo)) -#undef PL_regseen -#define PL_regseen (*Perl_Tregseen_ptr(aTHXo)) -#undef PL_regsize -#define PL_regsize (*Perl_Tregsize_ptr(aTHXo)) -#undef PL_regstartp -#define PL_regstartp (*Perl_Tregstartp_ptr(aTHXo)) -#undef PL_regtill -#define PL_regtill (*Perl_Tregtill_ptr(aTHXo)) -#undef PL_regxend -#define PL_regxend (*Perl_Tregxend_ptr(aTHXo)) -#undef PL_restartop -#define PL_restartop (*Perl_Trestartop_ptr(aTHXo)) -#undef PL_retstack -#define PL_retstack (*Perl_Tretstack_ptr(aTHXo)) -#undef PL_retstack_ix -#define PL_retstack_ix (*Perl_Tretstack_ix_ptr(aTHXo)) -#undef PL_retstack_max -#define PL_retstack_max (*Perl_Tretstack_max_ptr(aTHXo)) -#undef PL_rs -#define PL_rs (*Perl_Trs_ptr(aTHXo)) -#undef PL_savestack -#define PL_savestack (*Perl_Tsavestack_ptr(aTHXo)) -#undef PL_savestack_ix -#define PL_savestack_ix (*Perl_Tsavestack_ix_ptr(aTHXo)) -#undef PL_savestack_max -#define PL_savestack_max (*Perl_Tsavestack_max_ptr(aTHXo)) -#undef PL_scopestack -#define PL_scopestack (*Perl_Tscopestack_ptr(aTHXo)) -#undef PL_scopestack_ix -#define PL_scopestack_ix (*Perl_Tscopestack_ix_ptr(aTHXo)) -#undef PL_scopestack_max -#define PL_scopestack_max (*Perl_Tscopestack_max_ptr(aTHXo)) -#undef PL_screamfirst -#define PL_screamfirst (*Perl_Tscreamfirst_ptr(aTHXo)) -#undef PL_screamnext -#define PL_screamnext (*Perl_Tscreamnext_ptr(aTHXo)) -#undef PL_secondgv -#define PL_secondgv (*Perl_Tsecondgv_ptr(aTHXo)) -#undef PL_seen_evals -#define PL_seen_evals (*Perl_Tseen_evals_ptr(aTHXo)) -#undef PL_seen_zerolen -#define PL_seen_zerolen (*Perl_Tseen_zerolen_ptr(aTHXo)) -#undef PL_sortcop -#define PL_sortcop (*Perl_Tsortcop_ptr(aTHXo)) -#undef PL_sortcxix -#define PL_sortcxix (*Perl_Tsortcxix_ptr(aTHXo)) -#undef PL_sortstash -#define PL_sortstash (*Perl_Tsortstash_ptr(aTHXo)) -#undef PL_stack_base -#define PL_stack_base (*Perl_Tstack_base_ptr(aTHXo)) -#undef PL_stack_max -#define PL_stack_max (*Perl_Tstack_max_ptr(aTHXo)) -#undef PL_stack_sp -#define PL_stack_sp (*Perl_Tstack_sp_ptr(aTHXo)) -#undef PL_start_env -#define PL_start_env (*Perl_Tstart_env_ptr(aTHXo)) -#undef PL_statbuf -#define PL_statbuf (*Perl_Tstatbuf_ptr(aTHXo)) -#undef PL_statcache -#define PL_statcache (*Perl_Tstatcache_ptr(aTHXo)) -#undef PL_statgv -#define PL_statgv (*Perl_Tstatgv_ptr(aTHXo)) -#undef PL_statname -#define PL_statname (*Perl_Tstatname_ptr(aTHXo)) -#undef PL_tainted -#define PL_tainted (*Perl_Ttainted_ptr(aTHXo)) -#undef PL_timesbuf -#define PL_timesbuf (*Perl_Ttimesbuf_ptr(aTHXo)) -#undef PL_tmps_floor -#define PL_tmps_floor (*Perl_Ttmps_floor_ptr(aTHXo)) -#undef PL_tmps_ix -#define PL_tmps_ix (*Perl_Ttmps_ix_ptr(aTHXo)) -#undef PL_tmps_max -#define PL_tmps_max (*Perl_Ttmps_max_ptr(aTHXo)) -#undef PL_tmps_stack -#define PL_tmps_stack (*Perl_Ttmps_stack_ptr(aTHXo)) -#undef PL_top_env -#define PL_top_env (*Perl_Ttop_env_ptr(aTHXo)) -#undef PL_toptarget -#define PL_toptarget (*Perl_Ttoptarget_ptr(aTHXo)) -#undef PL_watchaddr -#define PL_watchaddr (*Perl_Twatchaddr_ptr(aTHXo)) -#undef PL_watchok -#define PL_watchok (*Perl_Twatchok_ptr(aTHXo)) -#undef PL_No -#define PL_No (*Perl_GNo_ptr(NULL)) -#undef PL_Yes -#define PL_Yes (*Perl_GYes_ptr(NULL)) -#undef PL_curinterp -#define PL_curinterp (*Perl_Gcurinterp_ptr(NULL)) -#undef PL_do_undump -#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)) - -/* Functions */ - -#if defined(PERL_OBJECT) +#if defined(PERL_CORE) && defined(PERL_OBJECT) /* XXX soon to be eliminated, only a few things in PERLCORE need these now */ @@ -839,18 +36,6 @@ #define Perl_Gv_AMupdate pPerl->Perl_Gv_AMupdate #undef Gv_AMupdate #define Gv_AMupdate Perl_Gv_AMupdate -#undef Perl_append_elem -#define Perl_append_elem pPerl->Perl_append_elem -#undef append_elem -#define append_elem Perl_append_elem -#undef Perl_append_list -#define Perl_append_list pPerl->Perl_append_list -#undef append_list -#define append_list Perl_append_list -#undef Perl_apply -#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 @@ -939,34 +124,14 @@ #define Perl_av_unshift pPerl->Perl_av_unshift #undef av_unshift #define av_unshift Perl_av_unshift -#undef Perl_bind_match -#define Perl_bind_match pPerl->Perl_bind_match -#undef bind_match -#define bind_match Perl_bind_match -#undef Perl_block_end -#define Perl_block_end pPerl->Perl_block_end -#undef block_end -#define block_end Perl_block_end #undef Perl_block_gimme #define Perl_block_gimme pPerl->Perl_block_gimme #undef block_gimme #define block_gimme Perl_block_gimme -#undef Perl_block_start -#define Perl_block_start pPerl->Perl_block_start -#undef block_start -#define block_start Perl_block_start -#undef Perl_boot_core_UNIVERSAL -#define Perl_boot_core_UNIVERSAL pPerl->Perl_boot_core_UNIVERSAL -#undef boot_core_UNIVERSAL -#define boot_core_UNIVERSAL Perl_boot_core_UNIVERSAL #undef Perl_call_list #define Perl_call_list pPerl->Perl_call_list #undef call_list #define call_list Perl_call_list -#undef Perl_cando -#define Perl_cando pPerl->Perl_cando -#undef cando -#define cando Perl_cando #undef Perl_cast_ulong #define Perl_cast_ulong pPerl->Perl_cast_ulong #undef cast_ulong @@ -995,10 +160,6 @@ #undef condpair_magic #define condpair_magic Perl_condpair_magic #endif -#undef Perl_convert -#define Perl_convert pPerl->Perl_convert -#undef convert -#define convert Perl_convert #undef Perl_croak #define Perl_croak pPerl->Perl_croak #undef croak @@ -1061,26 +222,6 @@ #undef fprintf_nocontext #define fprintf_nocontext Perl_fprintf_nocontext #endif -#undef Perl_cv_ckproto -#define Perl_cv_ckproto pPerl->Perl_cv_ckproto -#undef cv_ckproto -#define cv_ckproto Perl_cv_ckproto -#undef Perl_cv_clone -#define Perl_cv_clone pPerl->Perl_cv_clone -#undef cv_clone -#define cv_clone Perl_cv_clone -#undef Perl_cv_const_sv -#define Perl_cv_const_sv pPerl->Perl_cv_const_sv -#undef cv_const_sv -#define cv_const_sv Perl_cv_const_sv -#undef Perl_op_const_sv -#define Perl_op_const_sv pPerl->Perl_op_const_sv -#undef op_const_sv -#define op_const_sv Perl_op_const_sv -#undef Perl_cv_undef -#define Perl_cv_undef pPerl->Perl_cv_undef -#undef cv_undef -#define cv_undef Perl_cv_undef #undef Perl_cx_dump #define Perl_cx_dump pPerl->Perl_cx_dump #undef cx_dump @@ -1105,22 +246,10 @@ #define Perl_get_op_names pPerl->Perl_get_op_names #undef get_op_names #define get_op_names Perl_get_op_names -#undef Perl_get_no_modify -#define Perl_get_no_modify pPerl->Perl_get_no_modify -#undef get_no_modify -#define get_no_modify Perl_get_no_modify -#undef Perl_get_opargs -#define Perl_get_opargs pPerl->Perl_get_opargs -#undef get_opargs -#define get_opargs Perl_get_opargs #undef Perl_get_ppaddr #define Perl_get_ppaddr pPerl->Perl_get_ppaddr #undef get_ppaddr #define get_ppaddr Perl_get_ppaddr -#undef Perl_cxinc -#define Perl_cxinc pPerl->Perl_cxinc -#undef cxinc -#define cxinc Perl_cxinc #undef Perl_deb #define Perl_deb pPerl->Perl_deb #undef deb @@ -1149,98 +278,22 @@ #define Perl_delimcpy pPerl->Perl_delimcpy #undef delimcpy #define delimcpy Perl_delimcpy -#undef Perl_deprecate -#define Perl_deprecate pPerl->Perl_deprecate -#undef deprecate -#define deprecate Perl_deprecate #undef Perl_die #define Perl_die pPerl->Perl_die #undef die #define die Perl_die -#undef Perl_vdie -#define Perl_vdie pPerl->Perl_vdie -#undef vdie -#define vdie Perl_vdie -#undef Perl_die_where -#define Perl_die_where pPerl->Perl_die_where -#undef die_where -#define die_where Perl_die_where #undef Perl_dounwind #define Perl_dounwind pPerl->Perl_dounwind #undef dounwind #define dounwind Perl_dounwind -#undef Perl_do_aexec -#define Perl_do_aexec pPerl->Perl_do_aexec -#undef do_aexec -#define do_aexec Perl_do_aexec -#undef Perl_do_aexec5 -#define Perl_do_aexec5 pPerl->Perl_do_aexec5 -#undef do_aexec5 -#define do_aexec5 Perl_do_aexec5 #undef Perl_do_binmode #define Perl_do_binmode pPerl->Perl_do_binmode #undef do_binmode #define do_binmode Perl_do_binmode -#undef Perl_do_chop -#define Perl_do_chop pPerl->Perl_do_chop -#undef do_chop -#define do_chop Perl_do_chop -#undef Perl_do_close -#define Perl_do_close pPerl->Perl_do_close -#undef do_close -#define do_close Perl_do_close -#undef Perl_do_eof -#define Perl_do_eof pPerl->Perl_do_eof -#undef do_eof -#define do_eof Perl_do_eof -#undef Perl_do_exec -#define Perl_do_exec pPerl->Perl_do_exec -#undef do_exec -#define do_exec Perl_do_exec #if !defined(WIN32) -#undef Perl_do_exec3 -#define Perl_do_exec3 pPerl->Perl_do_exec3 -#undef do_exec3 -#define do_exec3 Perl_do_exec3 #endif -#undef Perl_do_execfree -#define Perl_do_execfree pPerl->Perl_do_execfree -#undef do_execfree -#define do_execfree Perl_do_execfree #if defined(HAS_MSG) || defined(HAS_SEM) || defined(HAS_SHM) -#undef Perl_do_ipcctl -#define Perl_do_ipcctl pPerl->Perl_do_ipcctl -#undef do_ipcctl -#define do_ipcctl Perl_do_ipcctl -#undef Perl_do_ipcget -#define Perl_do_ipcget pPerl->Perl_do_ipcget -#undef do_ipcget -#define do_ipcget Perl_do_ipcget -#undef Perl_do_msgrcv -#define Perl_do_msgrcv pPerl->Perl_do_msgrcv -#undef do_msgrcv -#define do_msgrcv Perl_do_msgrcv -#undef Perl_do_msgsnd -#define Perl_do_msgsnd pPerl->Perl_do_msgsnd -#undef do_msgsnd -#define do_msgsnd Perl_do_msgsnd -#undef Perl_do_semop -#define Perl_do_semop pPerl->Perl_do_semop -#undef do_semop -#define do_semop Perl_do_semop -#undef Perl_do_shmio -#define Perl_do_shmio pPerl->Perl_do_shmio -#undef do_shmio -#define do_shmio Perl_do_shmio #endif -#undef Perl_do_join -#define Perl_do_join pPerl->Perl_do_join -#undef do_join -#define do_join Perl_do_join -#undef Perl_do_kv -#define Perl_do_kv pPerl->Perl_do_kv -#undef do_kv -#define do_kv Perl_do_kv #undef Perl_do_open #define Perl_do_open pPerl->Perl_do_open #undef do_open @@ -1249,58 +302,6 @@ #define Perl_do_open9 pPerl->Perl_do_open9 #undef do_open9 #define do_open9 Perl_do_open9 -#undef Perl_do_pipe -#define Perl_do_pipe pPerl->Perl_do_pipe -#undef do_pipe -#define do_pipe Perl_do_pipe -#undef Perl_do_print -#define Perl_do_print pPerl->Perl_do_print -#undef do_print -#define do_print Perl_do_print -#undef Perl_do_readline -#define Perl_do_readline pPerl->Perl_do_readline -#undef do_readline -#define do_readline Perl_do_readline -#undef Perl_do_chomp -#define Perl_do_chomp pPerl->Perl_do_chomp -#undef do_chomp -#define do_chomp Perl_do_chomp -#undef Perl_do_seek -#define Perl_do_seek pPerl->Perl_do_seek -#undef do_seek -#define do_seek Perl_do_seek -#undef Perl_do_sprintf -#define Perl_do_sprintf pPerl->Perl_do_sprintf -#undef do_sprintf -#define do_sprintf Perl_do_sprintf -#undef Perl_do_sysseek -#define Perl_do_sysseek pPerl->Perl_do_sysseek -#undef do_sysseek -#define do_sysseek Perl_do_sysseek -#undef Perl_do_tell -#define Perl_do_tell pPerl->Perl_do_tell -#undef do_tell -#define do_tell Perl_do_tell -#undef Perl_do_trans -#define Perl_do_trans pPerl->Perl_do_trans -#undef do_trans -#define do_trans Perl_do_trans -#undef Perl_do_vecget -#define Perl_do_vecget pPerl->Perl_do_vecget -#undef do_vecget -#define do_vecget Perl_do_vecget -#undef Perl_do_vecset -#define Perl_do_vecset pPerl->Perl_do_vecset -#undef do_vecset -#define do_vecset Perl_do_vecset -#undef Perl_do_vop -#define Perl_do_vop pPerl->Perl_do_vop -#undef do_vop -#define do_vop Perl_do_vop -#undef Perl_dofile -#define Perl_dofile pPerl->Perl_dofile -#undef dofile -#define dofile Perl_dofile #undef Perl_dowantarray #define Perl_dowantarray pPerl->Perl_dowantarray #undef dowantarray @@ -1351,24 +352,8 @@ #define Perl_fbm_instr pPerl->Perl_fbm_instr #undef fbm_instr #define fbm_instr Perl_fbm_instr -#undef Perl_find_script -#define Perl_find_script pPerl->Perl_find_script -#undef find_script -#define find_script Perl_find_script #if defined(USE_THREADS) -#undef Perl_find_threadsv -#define Perl_find_threadsv pPerl->Perl_find_threadsv -#undef find_threadsv -#define find_threadsv Perl_find_threadsv #endif -#undef Perl_force_list -#define Perl_force_list pPerl->Perl_force_list -#undef force_list -#define force_list Perl_force_list -#undef Perl_fold_constants -#define Perl_fold_constants pPerl->Perl_fold_constants -#undef fold_constants -#define fold_constants Perl_fold_constants #undef Perl_form #define Perl_form pPerl->Perl_form #undef form @@ -1381,15 +366,7 @@ #define Perl_free_tmps pPerl->Perl_free_tmps #undef free_tmps #define free_tmps Perl_free_tmps -#undef Perl_gen_constant_list -#define Perl_gen_constant_list pPerl->Perl_gen_constant_list -#undef gen_constant_list -#define gen_constant_list Perl_gen_constant_list #if !defined(HAS_GETENV_LEN) -#undef Perl_getenv_len -#define Perl_getenv_len pPerl->Perl_getenv_len -#undef getenv_len -#define getenv_len Perl_getenv_len #endif #undef Perl_gp_free #define Perl_gp_free pPerl->Perl_gp_free @@ -1559,34 +536,14 @@ #define Perl_ibcmp_locale pPerl->Perl_ibcmp_locale #undef ibcmp_locale #define ibcmp_locale Perl_ibcmp_locale -#undef Perl_ingroup -#define Perl_ingroup pPerl->Perl_ingroup -#undef ingroup -#define ingroup Perl_ingroup -#undef Perl_init_debugger -#define Perl_init_debugger pPerl->Perl_init_debugger -#undef init_debugger -#define init_debugger Perl_init_debugger #undef Perl_init_stacks #define Perl_init_stacks pPerl->Perl_init_stacks #undef init_stacks #define init_stacks Perl_init_stacks -#undef Perl_intro_my -#define Perl_intro_my pPerl->Perl_intro_my -#undef intro_my -#define intro_my Perl_intro_my #undef Perl_instr #define Perl_instr pPerl->Perl_instr #undef instr #define instr Perl_instr -#undef Perl_io_close -#define Perl_io_close pPerl->Perl_io_close -#undef io_close -#define io_close Perl_io_close -#undef Perl_invert -#define Perl_invert pPerl->Perl_invert -#undef invert -#define invert Perl_invert #undef Perl_is_uni_alnum #define Perl_is_uni_alnum pPerl->Perl_is_uni_alnum #undef is_uni_alnum @@ -1783,247 +740,23 @@ #define Perl_is_utf8_mark pPerl->Perl_is_utf8_mark #undef is_utf8_mark #define is_utf8_mark Perl_is_utf8_mark -#undef Perl_jmaybe -#define Perl_jmaybe pPerl->Perl_jmaybe -#undef jmaybe -#define jmaybe Perl_jmaybe -#undef Perl_keyword -#define Perl_keyword pPerl->Perl_keyword -#undef keyword -#define keyword Perl_keyword #undef Perl_leave_scope #define Perl_leave_scope pPerl->Perl_leave_scope #undef leave_scope #define leave_scope Perl_leave_scope -#undef Perl_lex_end -#define Perl_lex_end pPerl->Perl_lex_end -#undef lex_end -#define lex_end Perl_lex_end -#undef Perl_lex_start -#define Perl_lex_start pPerl->Perl_lex_start -#undef lex_start -#define lex_start Perl_lex_start -#undef Perl_linklist -#define Perl_linklist pPerl->Perl_linklist -#undef linklist -#define linklist Perl_linklist -#undef Perl_list -#define Perl_list pPerl->Perl_list -#undef list -#define list Perl_list -#undef Perl_listkids -#define Perl_listkids pPerl->Perl_listkids -#undef listkids -#define listkids Perl_listkids -#undef Perl_localize -#define Perl_localize pPerl->Perl_localize -#undef localize -#define localize Perl_localize #undef Perl_looks_like_number #define Perl_looks_like_number pPerl->Perl_looks_like_number #undef looks_like_number #define looks_like_number Perl_looks_like_number -#undef Perl_magic_clearenv -#define Perl_magic_clearenv pPerl->Perl_magic_clearenv -#undef magic_clearenv -#define magic_clearenv Perl_magic_clearenv -#undef Perl_magic_clear_all_env -#define Perl_magic_clear_all_env pPerl->Perl_magic_clear_all_env -#undef magic_clear_all_env -#define magic_clear_all_env Perl_magic_clear_all_env -#undef Perl_magic_clearpack -#define Perl_magic_clearpack pPerl->Perl_magic_clearpack -#undef magic_clearpack -#define magic_clearpack Perl_magic_clearpack -#undef Perl_magic_clearsig -#define Perl_magic_clearsig pPerl->Perl_magic_clearsig -#undef magic_clearsig -#define magic_clearsig Perl_magic_clearsig -#undef Perl_magic_existspack -#define Perl_magic_existspack pPerl->Perl_magic_existspack -#undef magic_existspack -#define magic_existspack Perl_magic_existspack -#undef Perl_magic_freeregexp -#define Perl_magic_freeregexp pPerl->Perl_magic_freeregexp -#undef magic_freeregexp -#define magic_freeregexp Perl_magic_freeregexp -#undef Perl_magic_get -#define Perl_magic_get pPerl->Perl_magic_get -#undef magic_get -#define magic_get Perl_magic_get -#undef Perl_magic_getarylen -#define Perl_magic_getarylen pPerl->Perl_magic_getarylen -#undef magic_getarylen -#define magic_getarylen Perl_magic_getarylen -#undef Perl_magic_getdefelem -#define Perl_magic_getdefelem pPerl->Perl_magic_getdefelem -#undef magic_getdefelem -#define magic_getdefelem Perl_magic_getdefelem -#undef Perl_magic_getglob -#define Perl_magic_getglob pPerl->Perl_magic_getglob -#undef magic_getglob -#define magic_getglob Perl_magic_getglob -#undef Perl_magic_getnkeys -#define Perl_magic_getnkeys pPerl->Perl_magic_getnkeys -#undef magic_getnkeys -#define magic_getnkeys Perl_magic_getnkeys -#undef Perl_magic_getpack -#define Perl_magic_getpack pPerl->Perl_magic_getpack -#undef magic_getpack -#define magic_getpack Perl_magic_getpack -#undef Perl_magic_getpos -#define Perl_magic_getpos pPerl->Perl_magic_getpos -#undef magic_getpos -#define magic_getpos Perl_magic_getpos -#undef Perl_magic_getsig -#define Perl_magic_getsig pPerl->Perl_magic_getsig -#undef magic_getsig -#define magic_getsig Perl_magic_getsig -#undef Perl_magic_getsubstr -#define Perl_magic_getsubstr pPerl->Perl_magic_getsubstr -#undef magic_getsubstr -#define magic_getsubstr Perl_magic_getsubstr -#undef Perl_magic_gettaint -#define Perl_magic_gettaint pPerl->Perl_magic_gettaint -#undef magic_gettaint -#define magic_gettaint Perl_magic_gettaint -#undef Perl_magic_getuvar -#define Perl_magic_getuvar pPerl->Perl_magic_getuvar -#undef magic_getuvar -#define magic_getuvar Perl_magic_getuvar -#undef Perl_magic_getvec -#define Perl_magic_getvec pPerl->Perl_magic_getvec -#undef magic_getvec -#define magic_getvec Perl_magic_getvec -#undef Perl_magic_len -#define Perl_magic_len pPerl->Perl_magic_len -#undef magic_len -#define magic_len Perl_magic_len #if defined(USE_THREADS) -#undef Perl_magic_mutexfree -#define Perl_magic_mutexfree pPerl->Perl_magic_mutexfree -#undef magic_mutexfree -#define magic_mutexfree Perl_magic_mutexfree #endif -#undef Perl_magic_nextpack -#define Perl_magic_nextpack pPerl->Perl_magic_nextpack -#undef magic_nextpack -#define magic_nextpack Perl_magic_nextpack -#undef Perl_magic_regdata_cnt -#define Perl_magic_regdata_cnt pPerl->Perl_magic_regdata_cnt -#undef magic_regdata_cnt -#define magic_regdata_cnt Perl_magic_regdata_cnt -#undef Perl_magic_regdatum_get -#define Perl_magic_regdatum_get pPerl->Perl_magic_regdatum_get -#undef magic_regdatum_get -#define magic_regdatum_get Perl_magic_regdatum_get -#undef Perl_magic_set -#define Perl_magic_set pPerl->Perl_magic_set -#undef magic_set -#define magic_set Perl_magic_set -#undef Perl_magic_setamagic -#define Perl_magic_setamagic pPerl->Perl_magic_setamagic -#undef magic_setamagic -#define magic_setamagic Perl_magic_setamagic -#undef Perl_magic_setarylen -#define Perl_magic_setarylen pPerl->Perl_magic_setarylen -#undef magic_setarylen -#define magic_setarylen Perl_magic_setarylen -#undef Perl_magic_setbm -#define Perl_magic_setbm pPerl->Perl_magic_setbm -#undef magic_setbm -#define magic_setbm Perl_magic_setbm -#undef Perl_magic_setdbline -#define Perl_magic_setdbline pPerl->Perl_magic_setdbline -#undef magic_setdbline -#define magic_setdbline Perl_magic_setdbline #if defined(USE_LOCALE_COLLATE) -#undef Perl_magic_setcollxfrm -#define Perl_magic_setcollxfrm pPerl->Perl_magic_setcollxfrm -#undef magic_setcollxfrm -#define magic_setcollxfrm Perl_magic_setcollxfrm #endif -#undef Perl_magic_setdefelem -#define Perl_magic_setdefelem pPerl->Perl_magic_setdefelem -#undef magic_setdefelem -#define magic_setdefelem Perl_magic_setdefelem -#undef Perl_magic_setenv -#define Perl_magic_setenv pPerl->Perl_magic_setenv -#undef magic_setenv -#define magic_setenv Perl_magic_setenv -#undef Perl_magic_setfm -#define Perl_magic_setfm pPerl->Perl_magic_setfm -#undef magic_setfm -#define magic_setfm Perl_magic_setfm -#undef Perl_magic_setisa -#define Perl_magic_setisa pPerl->Perl_magic_setisa -#undef magic_setisa -#define magic_setisa Perl_magic_setisa -#undef Perl_magic_setglob -#define Perl_magic_setglob pPerl->Perl_magic_setglob -#undef magic_setglob -#define magic_setglob Perl_magic_setglob -#undef Perl_magic_setmglob -#define Perl_magic_setmglob pPerl->Perl_magic_setmglob -#undef magic_setmglob -#define magic_setmglob Perl_magic_setmglob -#undef Perl_magic_setnkeys -#define Perl_magic_setnkeys pPerl->Perl_magic_setnkeys -#undef magic_setnkeys -#define magic_setnkeys Perl_magic_setnkeys -#undef Perl_magic_setpack -#define Perl_magic_setpack pPerl->Perl_magic_setpack -#undef magic_setpack -#define magic_setpack Perl_magic_setpack -#undef Perl_magic_setpos -#define Perl_magic_setpos pPerl->Perl_magic_setpos -#undef magic_setpos -#define magic_setpos Perl_magic_setpos -#undef Perl_magic_setsig -#define Perl_magic_setsig pPerl->Perl_magic_setsig -#undef magic_setsig -#define magic_setsig Perl_magic_setsig -#undef Perl_magic_setsubstr -#define Perl_magic_setsubstr pPerl->Perl_magic_setsubstr -#undef magic_setsubstr -#define magic_setsubstr Perl_magic_setsubstr -#undef Perl_magic_settaint -#define Perl_magic_settaint pPerl->Perl_magic_settaint -#undef magic_settaint -#define magic_settaint Perl_magic_settaint -#undef Perl_magic_setuvar -#define Perl_magic_setuvar pPerl->Perl_magic_setuvar -#undef magic_setuvar -#define magic_setuvar Perl_magic_setuvar -#undef Perl_magic_setvec -#define Perl_magic_setvec pPerl->Perl_magic_setvec -#undef magic_setvec -#define magic_setvec Perl_magic_setvec -#undef Perl_magic_set_all_env -#define Perl_magic_set_all_env pPerl->Perl_magic_set_all_env -#undef magic_set_all_env -#define magic_set_all_env Perl_magic_set_all_env -#undef Perl_magic_sizepack -#define Perl_magic_sizepack pPerl->Perl_magic_sizepack -#undef magic_sizepack -#define magic_sizepack Perl_magic_sizepack -#undef Perl_magic_wipepack -#define Perl_magic_wipepack pPerl->Perl_magic_wipepack -#undef magic_wipepack -#define magic_wipepack Perl_magic_wipepack -#undef Perl_magicname -#define Perl_magicname pPerl->Perl_magicname -#undef magicname -#define magicname Perl_magicname #undef Perl_markstack_grow #define Perl_markstack_grow pPerl->Perl_markstack_grow #undef markstack_grow #define markstack_grow Perl_markstack_grow #if defined(USE_LOCALE_COLLATE) -#undef Perl_mem_collxfrm -#define Perl_mem_collxfrm pPerl->Perl_mem_collxfrm -#undef mem_collxfrm -#define mem_collxfrm Perl_mem_collxfrm #endif #undef Perl_mess #define Perl_mess pPerl->Perl_mess @@ -2033,10 +766,6 @@ #define Perl_vmess pPerl->Perl_vmess #undef vmess #define vmess Perl_vmess -#undef Perl_qerror -#define Perl_qerror pPerl->Perl_qerror -#undef qerror -#define qerror Perl_qerror #undef Perl_mg_clear #define Perl_mg_clear pPerl->Perl_mg_clear #undef mg_clear @@ -2073,18 +802,10 @@ #define Perl_mg_size pPerl->Perl_mg_size #undef mg_size #define mg_size Perl_mg_size -#undef Perl_mod -#define Perl_mod pPerl->Perl_mod -#undef mod -#define mod Perl_mod #undef Perl_moreswitches #define Perl_moreswitches pPerl->Perl_moreswitches #undef moreswitches #define moreswitches Perl_moreswitches -#undef Perl_my -#define Perl_my pPerl->Perl_my -#undef my -#define my Perl_my #undef Perl_my_atof #define Perl_my_atof pPerl->Perl_my_atof #undef my_atof @@ -2161,10 +882,6 @@ #undef my_ntohl #define my_ntohl Perl_my_ntohl #endif -#undef Perl_my_unexec -#define Perl_my_unexec pPerl->Perl_my_unexec -#undef my_unexec -#define my_unexec Perl_my_unexec #undef Perl_newANONLIST #define Perl_newANONLIST pPerl->Perl_newANONLIST #undef newANONLIST @@ -2365,70 +1082,18 @@ #define Perl_new_stackinfo pPerl->Perl_new_stackinfo #undef new_stackinfo #define new_stackinfo Perl_new_stackinfo -#undef Perl_nextargv -#define Perl_nextargv pPerl->Perl_nextargv -#undef nextargv -#define nextargv Perl_nextargv #undef Perl_ninstr #define Perl_ninstr pPerl->Perl_ninstr #undef ninstr #define ninstr Perl_ninstr -#undef Perl_oopsCV -#define Perl_oopsCV pPerl->Perl_oopsCV -#undef oopsCV -#define oopsCV Perl_oopsCV #undef Perl_op_free #define Perl_op_free pPerl->Perl_op_free #undef op_free #define op_free Perl_op_free -#undef Perl_package -#define Perl_package pPerl->Perl_package -#undef package -#define package Perl_package -#undef Perl_pad_alloc -#define Perl_pad_alloc pPerl->Perl_pad_alloc -#undef pad_alloc -#define pad_alloc Perl_pad_alloc -#undef Perl_pad_allocmy -#define Perl_pad_allocmy pPerl->Perl_pad_allocmy -#undef pad_allocmy -#define pad_allocmy Perl_pad_allocmy -#undef Perl_pad_findmy -#define Perl_pad_findmy pPerl->Perl_pad_findmy -#undef pad_findmy -#define pad_findmy Perl_pad_findmy -#undef Perl_oopsAV -#define Perl_oopsAV pPerl->Perl_oopsAV -#undef oopsAV -#define oopsAV Perl_oopsAV -#undef Perl_oopsHV -#define Perl_oopsHV pPerl->Perl_oopsHV -#undef oopsHV -#define oopsHV Perl_oopsHV -#undef Perl_pad_leavemy -#define Perl_pad_leavemy pPerl->Perl_pad_leavemy -#undef pad_leavemy -#define pad_leavemy Perl_pad_leavemy #undef Perl_pad_sv #define Perl_pad_sv pPerl->Perl_pad_sv #undef pad_sv #define pad_sv Perl_pad_sv -#undef Perl_pad_free -#define Perl_pad_free pPerl->Perl_pad_free -#undef pad_free -#define pad_free Perl_pad_free -#undef Perl_pad_reset -#define Perl_pad_reset pPerl->Perl_pad_reset -#undef pad_reset -#define pad_reset Perl_pad_reset -#undef Perl_pad_swipe -#define Perl_pad_swipe pPerl->Perl_pad_swipe -#undef pad_swipe -#define pad_swipe Perl_pad_swipe -#undef Perl_peep -#define Perl_peep pPerl->Perl_peep -#undef peep -#define peep Perl_peep #if defined(PERL_OBJECT) #undef Perl_construct #define Perl_construct pPerl->Perl_construct @@ -2527,50 +1192,18 @@ #define Perl_require_pv pPerl->Perl_require_pv #undef require_pv #define require_pv Perl_require_pv -#undef Perl_pidgone -#define Perl_pidgone pPerl->Perl_pidgone -#undef pidgone -#define pidgone Perl_pidgone #undef Perl_pmflag #define Perl_pmflag pPerl->Perl_pmflag #undef pmflag #define pmflag Perl_pmflag -#undef Perl_pmruntime -#define Perl_pmruntime pPerl->Perl_pmruntime -#undef pmruntime -#define pmruntime Perl_pmruntime -#undef Perl_pmtrans -#define Perl_pmtrans pPerl->Perl_pmtrans -#undef pmtrans -#define pmtrans Perl_pmtrans -#undef Perl_pop_return -#define Perl_pop_return pPerl->Perl_pop_return -#undef pop_return -#define pop_return Perl_pop_return #undef Perl_pop_scope #define Perl_pop_scope pPerl->Perl_pop_scope #undef pop_scope #define pop_scope Perl_pop_scope -#undef Perl_prepend_elem -#define Perl_prepend_elem pPerl->Perl_prepend_elem -#undef prepend_elem -#define prepend_elem Perl_prepend_elem -#undef Perl_push_return -#define Perl_push_return pPerl->Perl_push_return -#undef push_return -#define push_return Perl_push_return #undef Perl_push_scope #define Perl_push_scope pPerl->Perl_push_scope #undef push_scope #define push_scope Perl_push_scope -#undef Perl_ref -#define Perl_ref pPerl->Perl_ref -#undef ref -#define ref Perl_ref -#undef Perl_refkids -#define Perl_refkids pPerl->Perl_refkids -#undef refkids -#define refkids Perl_refkids #undef Perl_regdump #define Perl_regdump pPerl->Perl_regdump #undef regdump @@ -2603,10 +1236,6 @@ #define Perl_regnext pPerl->Perl_regnext #undef regnext #define regnext Perl_regnext -#undef Perl_regprop -#define Perl_regprop pPerl->Perl_regprop -#undef regprop -#define regprop Perl_regprop #undef Perl_repeatcpy #define Perl_repeatcpy pPerl->Perl_repeatcpy #undef repeatcpy @@ -2615,39 +1244,7 @@ #define Perl_rninstr pPerl->Perl_rninstr #undef rninstr #define rninstr Perl_rninstr -#undef Perl_rsignal -#define Perl_rsignal pPerl->Perl_rsignal -#undef rsignal -#define rsignal Perl_rsignal -#undef Perl_rsignal_restore -#define Perl_rsignal_restore pPerl->Perl_rsignal_restore -#undef rsignal_restore -#define rsignal_restore Perl_rsignal_restore -#undef Perl_rsignal_save -#define Perl_rsignal_save pPerl->Perl_rsignal_save -#undef rsignal_save -#define rsignal_save Perl_rsignal_save -#undef Perl_rsignal_state -#define Perl_rsignal_state pPerl->Perl_rsignal_state -#undef rsignal_state -#define rsignal_state Perl_rsignal_state -#undef Perl_rxres_free -#define Perl_rxres_free pPerl->Perl_rxres_free -#undef rxres_free -#define rxres_free Perl_rxres_free -#undef Perl_rxres_restore -#define Perl_rxres_restore pPerl->Perl_rxres_restore -#undef rxres_restore -#define rxres_restore Perl_rxres_restore -#undef Perl_rxres_save -#define Perl_rxres_save pPerl->Perl_rxres_save -#undef rxres_save -#define rxres_save Perl_rxres_save #if !defined(HAS_RENAME) -#undef Perl_same_dirent -#define Perl_same_dirent pPerl->Perl_same_dirent -#undef same_dirent -#define same_dirent Perl_same_dirent #endif #undef Perl_savepv #define Perl_savepv pPerl->Perl_savepv @@ -2697,10 +1294,6 @@ #define Perl_save_freesv pPerl->Perl_save_freesv #undef save_freesv #define save_freesv Perl_save_freesv -#undef Perl_save_freeop -#define Perl_save_freeop pPerl->Perl_save_freeop -#undef save_freeop -#define save_freeop Perl_save_freeop #undef Perl_save_freepv #define Perl_save_freepv pPerl->Perl_save_freepv #undef save_freepv @@ -2765,10 +1358,6 @@ #define Perl_save_nogv pPerl->Perl_save_nogv #undef save_nogv #define save_nogv Perl_save_nogv -#undef Perl_save_op -#define Perl_save_op pPerl->Perl_save_op -#undef save_op -#define save_op Perl_save_op #undef Perl_save_scalar #define Perl_save_scalar pPerl->Perl_save_scalar #undef save_scalar @@ -2797,26 +1386,6 @@ #define Perl_save_threadsv pPerl->Perl_save_threadsv #undef save_threadsv #define save_threadsv Perl_save_threadsv -#undef Perl_sawparens -#define Perl_sawparens pPerl->Perl_sawparens -#undef sawparens -#define sawparens Perl_sawparens -#undef Perl_scalar -#define Perl_scalar pPerl->Perl_scalar -#undef scalar -#define scalar Perl_scalar -#undef Perl_scalarkids -#define Perl_scalarkids pPerl->Perl_scalarkids -#undef scalarkids -#define scalarkids Perl_scalarkids -#undef Perl_scalarseq -#define Perl_scalarseq pPerl->Perl_scalarseq -#undef scalarseq -#define scalarseq Perl_scalarseq -#undef Perl_scalarvoid -#define Perl_scalarvoid pPerl->Perl_scalarvoid -#undef scalarvoid -#define scalarvoid Perl_scalarvoid #undef Perl_scan_bin #define Perl_scan_bin pPerl->Perl_scan_bin #undef scan_bin @@ -2833,36 +1402,16 @@ #define Perl_scan_oct pPerl->Perl_scan_oct #undef scan_oct #define scan_oct Perl_scan_oct -#undef Perl_scope -#define Perl_scope pPerl->Perl_scope -#undef scope -#define scope Perl_scope #undef Perl_screaminstr #define Perl_screaminstr pPerl->Perl_screaminstr #undef screaminstr #define screaminstr Perl_screaminstr #if !defined(VMS) -#undef Perl_setenv_getix -#define Perl_setenv_getix pPerl->Perl_setenv_getix -#undef setenv_getix -#define setenv_getix Perl_setenv_getix #endif -#undef Perl_setdefout -#define Perl_setdefout pPerl->Perl_setdefout -#undef setdefout -#define setdefout Perl_setdefout #undef Perl_sharepvn #define Perl_sharepvn pPerl->Perl_sharepvn #undef sharepvn #define sharepvn Perl_sharepvn -#undef Perl_share_hek -#define Perl_share_hek pPerl->Perl_share_hek -#undef share_hek -#define share_hek Perl_share_hek -#undef Perl_sighandler -#define Perl_sighandler pPerl->Perl_sighandler -#undef sighandler -#define sighandler Perl_sighandler #undef Perl_stack_grow #define Perl_stack_grow pPerl->Perl_stack_grow #undef stack_grow @@ -2871,10 +1420,6 @@ #define Perl_start_subparse pPerl->Perl_start_subparse #undef start_subparse #define start_subparse Perl_start_subparse -#undef Perl_sub_crush_depth -#define Perl_sub_crush_depth pPerl->Perl_sub_crush_depth -#undef sub_crush_depth -#define sub_crush_depth Perl_sub_crush_depth #undef Perl_sv_2bool #define Perl_sv_2bool pPerl->Perl_sv_2bool #undef sv_2bool @@ -2943,10 +1488,6 @@ #define Perl_sv_true pPerl->Perl_sv_true #undef sv_true #define sv_true Perl_sv_true -#undef Perl_sv_add_arena -#define Perl_sv_add_arena pPerl->Perl_sv_add_arena -#undef sv_add_arena -#define sv_add_arena Perl_sv_add_arena #undef Perl_sv_backoff #define Perl_sv_backoff pPerl->Perl_sv_backoff #undef sv_backoff @@ -2979,14 +1520,6 @@ #define Perl_sv_chop pPerl->Perl_sv_chop #undef sv_chop #define sv_chop Perl_sv_chop -#undef Perl_sv_clean_all -#define Perl_sv_clean_all pPerl->Perl_sv_clean_all -#undef sv_clean_all -#define sv_clean_all Perl_sv_clean_all -#undef Perl_sv_clean_objs -#define Perl_sv_clean_objs pPerl->Perl_sv_clean_objs -#undef sv_clean_objs -#define sv_clean_objs Perl_sv_clean_objs #undef Perl_sv_clear #define Perl_sv_clear pPerl->Perl_sv_clear #undef sv_clear @@ -3029,10 +1562,6 @@ #define Perl_sv_free pPerl->Perl_sv_free #undef sv_free #define sv_free Perl_sv_free -#undef Perl_sv_free_arenas -#define Perl_sv_free_arenas pPerl->Perl_sv_free_arenas -#undef sv_free_arenas -#define sv_free_arenas Perl_sv_free_arenas #undef Perl_sv_gets #define Perl_sv_gets pPerl->Perl_sv_gets #undef sv_gets @@ -3253,14 +1782,6 @@ #define Perl_unsharepvn pPerl->Perl_unsharepvn #undef unsharepvn #define unsharepvn Perl_unsharepvn -#undef Perl_unshare_hek -#define Perl_unshare_hek pPerl->Perl_unshare_hek -#undef unshare_hek -#define unshare_hek Perl_unshare_hek -#undef Perl_utilize -#define Perl_utilize pPerl->Perl_utilize -#undef utilize -#define utilize Perl_utilize #undef Perl_utf16_to_utf8 #define Perl_utf16_to_utf8 pPerl->Perl_utf16_to_utf8 #undef utf16_to_utf8 @@ -3285,22 +1806,6 @@ #define Perl_uv_to_utf8 pPerl->Perl_uv_to_utf8 #undef uv_to_utf8 #define uv_to_utf8 Perl_uv_to_utf8 -#undef Perl_vivify_defelem -#define Perl_vivify_defelem pPerl->Perl_vivify_defelem -#undef vivify_defelem -#define vivify_defelem Perl_vivify_defelem -#undef Perl_vivify_ref -#define Perl_vivify_ref pPerl->Perl_vivify_ref -#undef vivify_ref -#define vivify_ref Perl_vivify_ref -#undef Perl_wait4pid -#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 @@ -3317,37 +1822,9 @@ #define Perl_vwarner pPerl->Perl_vwarner #undef vwarner #define vwarner Perl_vwarner -#undef Perl_watch -#define Perl_watch pPerl->Perl_watch -#undef watch -#define watch Perl_watch -#undef Perl_whichsig -#define Perl_whichsig pPerl->Perl_whichsig -#undef whichsig -#define whichsig Perl_whichsig -#undef Perl_yyerror -#define Perl_yyerror pPerl->Perl_yyerror -#undef yyerror -#define yyerror Perl_yyerror #if defined(USE_PURE_BISON) -#undef Perl_yylex -#define Perl_yylex pPerl->Perl_yylex -#undef yylex -#define yylex Perl_yylex #else -#undef Perl_yylex -#define Perl_yylex pPerl->Perl_yylex -#undef yylex -#define yylex Perl_yylex #endif -#undef Perl_yyparse -#define Perl_yyparse pPerl->Perl_yyparse -#undef yyparse -#define yyparse Perl_yyparse -#undef Perl_yywarn -#define Perl_yywarn pPerl->Perl_yywarn -#undef yywarn -#define yywarn Perl_yywarn #if defined(MYMALLOC) #undef Perl_dump_mstats #define Perl_dump_mstats pPerl->Perl_dump_mstats @@ -3466,10 +1943,6 @@ #define Perl_get_vtbl pPerl->Perl_get_vtbl #undef get_vtbl #define get_vtbl Perl_get_vtbl -#undef Perl_pv_display -#define Perl_pv_display pPerl->Perl_pv_display -#undef pv_display -#define pv_display Perl_pv_display #undef Perl_dump_indent #define Perl_dump_indent pPerl->Perl_dump_indent #undef dump_indent @@ -3558,10 +2031,6 @@ #define Perl_sv_rvweaken pPerl->Perl_sv_rvweaken #undef sv_rvweaken #define sv_rvweaken Perl_sv_rvweaken -#undef Perl_magic_killbackrefs -#define Perl_magic_killbackrefs pPerl->Perl_magic_killbackrefs -#undef magic_killbackrefs -#define magic_killbackrefs Perl_magic_killbackrefs #undef Perl_newANONATTRSUB #define Perl_newANONATTRSUB pPerl->Perl_newANONATTRSUB #undef newANONATTRSUB @@ -3574,14 +2043,6 @@ #define Perl_newMYSUB pPerl->Perl_newMYSUB #undef newMYSUB #define newMYSUB Perl_newMYSUB -#undef Perl_my_attrs -#define Perl_my_attrs pPerl->Perl_my_attrs -#undef my_attrs -#define my_attrs Perl_my_attrs -#undef Perl_boot_core_xsutils -#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 @@ -3712,1538 +2173,6 @@ #endif #if defined(PERL_OBJECT) #endif -#undef Perl_ck_anoncode -#define Perl_ck_anoncode pPerl->Perl_ck_anoncode -#undef ck_anoncode -#define ck_anoncode Perl_ck_anoncode -#undef Perl_ck_bitop -#define Perl_ck_bitop pPerl->Perl_ck_bitop -#undef ck_bitop -#define ck_bitop Perl_ck_bitop -#undef Perl_ck_concat -#define Perl_ck_concat pPerl->Perl_ck_concat -#undef ck_concat -#define ck_concat Perl_ck_concat -#undef Perl_ck_defined -#define Perl_ck_defined pPerl->Perl_ck_defined -#undef ck_defined -#define ck_defined Perl_ck_defined -#undef Perl_ck_delete -#define Perl_ck_delete pPerl->Perl_ck_delete -#undef ck_delete -#define ck_delete Perl_ck_delete -#undef Perl_ck_eof -#define Perl_ck_eof pPerl->Perl_ck_eof -#undef ck_eof -#define ck_eof Perl_ck_eof -#undef Perl_ck_eval -#define Perl_ck_eval pPerl->Perl_ck_eval -#undef ck_eval -#define ck_eval Perl_ck_eval -#undef Perl_ck_exec -#define Perl_ck_exec pPerl->Perl_ck_exec -#undef ck_exec -#define ck_exec Perl_ck_exec -#undef Perl_ck_exists -#define Perl_ck_exists pPerl->Perl_ck_exists -#undef ck_exists -#define ck_exists Perl_ck_exists -#undef Perl_ck_ftst -#define Perl_ck_ftst pPerl->Perl_ck_ftst -#undef ck_ftst -#define ck_ftst Perl_ck_ftst -#undef Perl_ck_fun -#define Perl_ck_fun pPerl->Perl_ck_fun -#undef ck_fun -#define ck_fun Perl_ck_fun -#undef Perl_ck_fun_locale -#define Perl_ck_fun_locale pPerl->Perl_ck_fun_locale -#undef ck_fun_locale -#define ck_fun_locale Perl_ck_fun_locale -#undef Perl_ck_glob -#define Perl_ck_glob pPerl->Perl_ck_glob -#undef ck_glob -#define ck_glob Perl_ck_glob -#undef Perl_ck_grep -#define Perl_ck_grep pPerl->Perl_ck_grep -#undef ck_grep -#define ck_grep Perl_ck_grep -#undef Perl_ck_index -#define Perl_ck_index pPerl->Perl_ck_index -#undef ck_index -#define ck_index Perl_ck_index -#undef Perl_ck_join -#define Perl_ck_join pPerl->Perl_ck_join -#undef ck_join -#define ck_join Perl_ck_join -#undef Perl_ck_lengthconst -#define Perl_ck_lengthconst pPerl->Perl_ck_lengthconst -#undef ck_lengthconst -#define ck_lengthconst Perl_ck_lengthconst -#undef Perl_ck_lfun -#define Perl_ck_lfun pPerl->Perl_ck_lfun -#undef ck_lfun -#define ck_lfun Perl_ck_lfun -#undef Perl_ck_listiob -#define Perl_ck_listiob pPerl->Perl_ck_listiob -#undef ck_listiob -#define ck_listiob Perl_ck_listiob -#undef Perl_ck_match -#define Perl_ck_match pPerl->Perl_ck_match -#undef ck_match -#define ck_match Perl_ck_match -#undef Perl_ck_method -#define Perl_ck_method pPerl->Perl_ck_method -#undef ck_method -#define ck_method Perl_ck_method -#undef Perl_ck_null -#define Perl_ck_null pPerl->Perl_ck_null -#undef ck_null -#define ck_null Perl_ck_null -#undef Perl_ck_repeat -#define Perl_ck_repeat pPerl->Perl_ck_repeat -#undef ck_repeat -#define ck_repeat Perl_ck_repeat -#undef Perl_ck_require -#define Perl_ck_require pPerl->Perl_ck_require -#undef ck_require -#define ck_require Perl_ck_require -#undef Perl_ck_rfun -#define Perl_ck_rfun pPerl->Perl_ck_rfun -#undef ck_rfun -#define ck_rfun Perl_ck_rfun -#undef Perl_ck_rvconst -#define Perl_ck_rvconst pPerl->Perl_ck_rvconst -#undef ck_rvconst -#define ck_rvconst Perl_ck_rvconst -#undef Perl_ck_sassign -#define Perl_ck_sassign pPerl->Perl_ck_sassign -#undef ck_sassign -#define ck_sassign Perl_ck_sassign -#undef Perl_ck_scmp -#define Perl_ck_scmp pPerl->Perl_ck_scmp -#undef ck_scmp -#define ck_scmp Perl_ck_scmp -#undef Perl_ck_select -#define Perl_ck_select pPerl->Perl_ck_select -#undef ck_select -#define ck_select Perl_ck_select -#undef Perl_ck_shift -#define Perl_ck_shift pPerl->Perl_ck_shift -#undef ck_shift -#define ck_shift Perl_ck_shift -#undef Perl_ck_sort -#define Perl_ck_sort pPerl->Perl_ck_sort -#undef ck_sort -#define ck_sort Perl_ck_sort -#undef Perl_ck_spair -#define Perl_ck_spair pPerl->Perl_ck_spair -#undef ck_spair -#define ck_spair Perl_ck_spair -#undef Perl_ck_split -#define Perl_ck_split pPerl->Perl_ck_split -#undef ck_split -#define ck_split Perl_ck_split -#undef Perl_ck_subr -#define Perl_ck_subr pPerl->Perl_ck_subr -#undef ck_subr -#define ck_subr Perl_ck_subr -#undef Perl_ck_svconst -#define Perl_ck_svconst pPerl->Perl_ck_svconst -#undef ck_svconst -#define ck_svconst Perl_ck_svconst -#undef Perl_ck_trunc -#define Perl_ck_trunc pPerl->Perl_ck_trunc -#undef ck_trunc -#define ck_trunc Perl_ck_trunc -#undef Perl_pp_aassign -#define Perl_pp_aassign pPerl->Perl_pp_aassign -#undef pp_aassign -#define pp_aassign Perl_pp_aassign -#undef Perl_pp_abs -#define Perl_pp_abs pPerl->Perl_pp_abs -#undef pp_abs -#define pp_abs Perl_pp_abs -#undef Perl_pp_accept -#define Perl_pp_accept pPerl->Perl_pp_accept -#undef pp_accept -#define pp_accept Perl_pp_accept -#undef Perl_pp_add -#define Perl_pp_add pPerl->Perl_pp_add -#undef pp_add -#define pp_add Perl_pp_add -#undef Perl_pp_aelem -#define Perl_pp_aelem pPerl->Perl_pp_aelem -#undef pp_aelem -#define pp_aelem Perl_pp_aelem -#undef Perl_pp_aelemfast -#define Perl_pp_aelemfast pPerl->Perl_pp_aelemfast -#undef pp_aelemfast -#define pp_aelemfast Perl_pp_aelemfast -#undef Perl_pp_alarm -#define Perl_pp_alarm pPerl->Perl_pp_alarm -#undef pp_alarm -#define pp_alarm Perl_pp_alarm -#undef Perl_pp_and -#define Perl_pp_and pPerl->Perl_pp_and -#undef pp_and -#define pp_and Perl_pp_and -#undef Perl_pp_andassign -#define Perl_pp_andassign pPerl->Perl_pp_andassign -#undef pp_andassign -#define pp_andassign Perl_pp_andassign -#undef Perl_pp_anoncode -#define Perl_pp_anoncode pPerl->Perl_pp_anoncode -#undef pp_anoncode -#define pp_anoncode Perl_pp_anoncode -#undef Perl_pp_anonhash -#define Perl_pp_anonhash pPerl->Perl_pp_anonhash -#undef pp_anonhash -#define pp_anonhash Perl_pp_anonhash -#undef Perl_pp_anonlist -#define Perl_pp_anonlist pPerl->Perl_pp_anonlist -#undef pp_anonlist -#define pp_anonlist Perl_pp_anonlist -#undef Perl_pp_aslice -#define Perl_pp_aslice pPerl->Perl_pp_aslice -#undef pp_aslice -#define pp_aslice Perl_pp_aslice -#undef Perl_pp_atan2 -#define Perl_pp_atan2 pPerl->Perl_pp_atan2 -#undef pp_atan2 -#define pp_atan2 Perl_pp_atan2 -#undef Perl_pp_av2arylen -#define Perl_pp_av2arylen pPerl->Perl_pp_av2arylen -#undef pp_av2arylen -#define pp_av2arylen Perl_pp_av2arylen -#undef Perl_pp_backtick -#define Perl_pp_backtick pPerl->Perl_pp_backtick -#undef pp_backtick -#define pp_backtick Perl_pp_backtick -#undef Perl_pp_bind -#define Perl_pp_bind pPerl->Perl_pp_bind -#undef pp_bind -#define pp_bind Perl_pp_bind -#undef Perl_pp_binmode -#define Perl_pp_binmode pPerl->Perl_pp_binmode -#undef pp_binmode -#define pp_binmode Perl_pp_binmode -#undef Perl_pp_bit_and -#define Perl_pp_bit_and pPerl->Perl_pp_bit_and -#undef pp_bit_and -#define pp_bit_and Perl_pp_bit_and -#undef Perl_pp_bit_or -#define Perl_pp_bit_or pPerl->Perl_pp_bit_or -#undef pp_bit_or -#define pp_bit_or Perl_pp_bit_or -#undef Perl_pp_bit_xor -#define Perl_pp_bit_xor pPerl->Perl_pp_bit_xor -#undef pp_bit_xor -#define pp_bit_xor Perl_pp_bit_xor -#undef Perl_pp_bless -#define Perl_pp_bless pPerl->Perl_pp_bless -#undef pp_bless -#define pp_bless Perl_pp_bless -#undef Perl_pp_caller -#define Perl_pp_caller pPerl->Perl_pp_caller -#undef pp_caller -#define pp_caller Perl_pp_caller -#undef Perl_pp_chdir -#define Perl_pp_chdir pPerl->Perl_pp_chdir -#undef pp_chdir -#define pp_chdir Perl_pp_chdir -#undef Perl_pp_chmod -#define Perl_pp_chmod pPerl->Perl_pp_chmod -#undef pp_chmod -#define pp_chmod Perl_pp_chmod -#undef Perl_pp_chomp -#define Perl_pp_chomp pPerl->Perl_pp_chomp -#undef pp_chomp -#define pp_chomp Perl_pp_chomp -#undef Perl_pp_chop -#define Perl_pp_chop pPerl->Perl_pp_chop -#undef pp_chop -#define pp_chop Perl_pp_chop -#undef Perl_pp_chown -#define Perl_pp_chown pPerl->Perl_pp_chown -#undef pp_chown -#define pp_chown Perl_pp_chown -#undef Perl_pp_chr -#define Perl_pp_chr pPerl->Perl_pp_chr -#undef pp_chr -#define pp_chr Perl_pp_chr -#undef Perl_pp_chroot -#define Perl_pp_chroot pPerl->Perl_pp_chroot -#undef pp_chroot -#define pp_chroot Perl_pp_chroot -#undef Perl_pp_close -#define Perl_pp_close pPerl->Perl_pp_close -#undef pp_close -#define pp_close Perl_pp_close -#undef Perl_pp_closedir -#define Perl_pp_closedir pPerl->Perl_pp_closedir -#undef pp_closedir -#define pp_closedir Perl_pp_closedir -#undef Perl_pp_complement -#define Perl_pp_complement pPerl->Perl_pp_complement -#undef pp_complement -#define pp_complement Perl_pp_complement -#undef Perl_pp_concat -#define Perl_pp_concat pPerl->Perl_pp_concat -#undef pp_concat -#define pp_concat Perl_pp_concat -#undef Perl_pp_cond_expr -#define Perl_pp_cond_expr pPerl->Perl_pp_cond_expr -#undef pp_cond_expr -#define pp_cond_expr Perl_pp_cond_expr -#undef Perl_pp_connect -#define Perl_pp_connect pPerl->Perl_pp_connect -#undef pp_connect -#define pp_connect Perl_pp_connect -#undef Perl_pp_const -#define Perl_pp_const pPerl->Perl_pp_const -#undef pp_const -#define pp_const Perl_pp_const -#undef Perl_pp_cos -#define Perl_pp_cos pPerl->Perl_pp_cos -#undef pp_cos -#define pp_cos Perl_pp_cos -#undef Perl_pp_crypt -#define Perl_pp_crypt pPerl->Perl_pp_crypt -#undef pp_crypt -#define pp_crypt Perl_pp_crypt -#undef Perl_pp_dbmclose -#define Perl_pp_dbmclose pPerl->Perl_pp_dbmclose -#undef pp_dbmclose -#define pp_dbmclose Perl_pp_dbmclose -#undef Perl_pp_dbmopen -#define Perl_pp_dbmopen pPerl->Perl_pp_dbmopen -#undef pp_dbmopen -#define pp_dbmopen Perl_pp_dbmopen -#undef Perl_pp_dbstate -#define Perl_pp_dbstate pPerl->Perl_pp_dbstate -#undef pp_dbstate -#define pp_dbstate Perl_pp_dbstate -#undef Perl_pp_defined -#define Perl_pp_defined pPerl->Perl_pp_defined -#undef pp_defined -#define pp_defined Perl_pp_defined -#undef Perl_pp_delete -#define Perl_pp_delete pPerl->Perl_pp_delete -#undef pp_delete -#define pp_delete Perl_pp_delete -#undef Perl_pp_die -#define Perl_pp_die pPerl->Perl_pp_die -#undef pp_die -#define pp_die Perl_pp_die -#undef Perl_pp_divide -#define Perl_pp_divide pPerl->Perl_pp_divide -#undef pp_divide -#define pp_divide Perl_pp_divide -#undef Perl_pp_dofile -#define Perl_pp_dofile pPerl->Perl_pp_dofile -#undef pp_dofile -#define pp_dofile Perl_pp_dofile -#undef Perl_pp_dump -#define Perl_pp_dump pPerl->Perl_pp_dump -#undef pp_dump -#define pp_dump Perl_pp_dump -#undef Perl_pp_each -#define Perl_pp_each pPerl->Perl_pp_each -#undef pp_each -#define pp_each Perl_pp_each -#undef Perl_pp_egrent -#define Perl_pp_egrent pPerl->Perl_pp_egrent -#undef pp_egrent -#define pp_egrent Perl_pp_egrent -#undef Perl_pp_ehostent -#define Perl_pp_ehostent pPerl->Perl_pp_ehostent -#undef pp_ehostent -#define pp_ehostent Perl_pp_ehostent -#undef Perl_pp_enetent -#define Perl_pp_enetent pPerl->Perl_pp_enetent -#undef pp_enetent -#define pp_enetent Perl_pp_enetent -#undef Perl_pp_enter -#define Perl_pp_enter pPerl->Perl_pp_enter -#undef pp_enter -#define pp_enter Perl_pp_enter -#undef Perl_pp_entereval -#define Perl_pp_entereval pPerl->Perl_pp_entereval -#undef pp_entereval -#define pp_entereval Perl_pp_entereval -#undef Perl_pp_enteriter -#define Perl_pp_enteriter pPerl->Perl_pp_enteriter -#undef pp_enteriter -#define pp_enteriter Perl_pp_enteriter -#undef Perl_pp_enterloop -#define Perl_pp_enterloop pPerl->Perl_pp_enterloop -#undef pp_enterloop -#define pp_enterloop Perl_pp_enterloop -#undef Perl_pp_entersub -#define Perl_pp_entersub pPerl->Perl_pp_entersub -#undef pp_entersub -#define pp_entersub Perl_pp_entersub -#undef Perl_pp_entertry -#define Perl_pp_entertry pPerl->Perl_pp_entertry -#undef pp_entertry -#define pp_entertry Perl_pp_entertry -#undef Perl_pp_enterwrite -#define Perl_pp_enterwrite pPerl->Perl_pp_enterwrite -#undef pp_enterwrite -#define pp_enterwrite Perl_pp_enterwrite -#undef Perl_pp_eof -#define Perl_pp_eof pPerl->Perl_pp_eof -#undef pp_eof -#define pp_eof Perl_pp_eof -#undef Perl_pp_eprotoent -#define Perl_pp_eprotoent pPerl->Perl_pp_eprotoent -#undef pp_eprotoent -#define pp_eprotoent Perl_pp_eprotoent -#undef Perl_pp_epwent -#define Perl_pp_epwent pPerl->Perl_pp_epwent -#undef pp_epwent -#define pp_epwent Perl_pp_epwent -#undef Perl_pp_eq -#define Perl_pp_eq pPerl->Perl_pp_eq -#undef pp_eq -#define pp_eq Perl_pp_eq -#undef Perl_pp_eservent -#define Perl_pp_eservent pPerl->Perl_pp_eservent -#undef pp_eservent -#define pp_eservent Perl_pp_eservent -#undef Perl_pp_exec -#define Perl_pp_exec pPerl->Perl_pp_exec -#undef pp_exec -#define pp_exec Perl_pp_exec -#undef Perl_pp_exists -#define Perl_pp_exists pPerl->Perl_pp_exists -#undef pp_exists -#define pp_exists Perl_pp_exists -#undef Perl_pp_exit -#define Perl_pp_exit pPerl->Perl_pp_exit -#undef pp_exit -#define pp_exit Perl_pp_exit -#undef Perl_pp_exp -#define Perl_pp_exp pPerl->Perl_pp_exp -#undef pp_exp -#define pp_exp Perl_pp_exp -#undef Perl_pp_fcntl -#define Perl_pp_fcntl pPerl->Perl_pp_fcntl -#undef pp_fcntl -#define pp_fcntl Perl_pp_fcntl -#undef Perl_pp_fileno -#define Perl_pp_fileno pPerl->Perl_pp_fileno -#undef pp_fileno -#define pp_fileno Perl_pp_fileno -#undef Perl_pp_flip -#define Perl_pp_flip pPerl->Perl_pp_flip -#undef pp_flip -#define pp_flip Perl_pp_flip -#undef Perl_pp_flock -#define Perl_pp_flock pPerl->Perl_pp_flock -#undef pp_flock -#define pp_flock Perl_pp_flock -#undef Perl_pp_flop -#define Perl_pp_flop pPerl->Perl_pp_flop -#undef pp_flop -#define pp_flop Perl_pp_flop -#undef Perl_pp_fork -#define Perl_pp_fork pPerl->Perl_pp_fork -#undef pp_fork -#define pp_fork Perl_pp_fork -#undef Perl_pp_formline -#define Perl_pp_formline pPerl->Perl_pp_formline -#undef pp_formline -#define pp_formline Perl_pp_formline -#undef Perl_pp_ftatime -#define Perl_pp_ftatime pPerl->Perl_pp_ftatime -#undef pp_ftatime -#define pp_ftatime Perl_pp_ftatime -#undef Perl_pp_ftbinary -#define Perl_pp_ftbinary pPerl->Perl_pp_ftbinary -#undef pp_ftbinary -#define pp_ftbinary Perl_pp_ftbinary -#undef Perl_pp_ftblk -#define Perl_pp_ftblk pPerl->Perl_pp_ftblk -#undef pp_ftblk -#define pp_ftblk Perl_pp_ftblk -#undef Perl_pp_ftchr -#define Perl_pp_ftchr pPerl->Perl_pp_ftchr -#undef pp_ftchr -#define pp_ftchr Perl_pp_ftchr -#undef Perl_pp_ftctime -#define Perl_pp_ftctime pPerl->Perl_pp_ftctime -#undef pp_ftctime -#define pp_ftctime Perl_pp_ftctime -#undef Perl_pp_ftdir -#define Perl_pp_ftdir pPerl->Perl_pp_ftdir -#undef pp_ftdir -#define pp_ftdir Perl_pp_ftdir -#undef Perl_pp_fteexec -#define Perl_pp_fteexec pPerl->Perl_pp_fteexec -#undef pp_fteexec -#define pp_fteexec Perl_pp_fteexec -#undef Perl_pp_fteowned -#define Perl_pp_fteowned pPerl->Perl_pp_fteowned -#undef pp_fteowned -#define pp_fteowned Perl_pp_fteowned -#undef Perl_pp_fteread -#define Perl_pp_fteread pPerl->Perl_pp_fteread -#undef pp_fteread -#define pp_fteread Perl_pp_fteread -#undef Perl_pp_ftewrite -#define Perl_pp_ftewrite pPerl->Perl_pp_ftewrite -#undef pp_ftewrite -#define pp_ftewrite Perl_pp_ftewrite -#undef Perl_pp_ftfile -#define Perl_pp_ftfile pPerl->Perl_pp_ftfile -#undef pp_ftfile -#define pp_ftfile Perl_pp_ftfile -#undef Perl_pp_ftis -#define Perl_pp_ftis pPerl->Perl_pp_ftis -#undef pp_ftis -#define pp_ftis Perl_pp_ftis -#undef Perl_pp_ftlink -#define Perl_pp_ftlink pPerl->Perl_pp_ftlink -#undef pp_ftlink -#define pp_ftlink Perl_pp_ftlink -#undef Perl_pp_ftmtime -#define Perl_pp_ftmtime pPerl->Perl_pp_ftmtime -#undef pp_ftmtime -#define pp_ftmtime Perl_pp_ftmtime -#undef Perl_pp_ftpipe -#define Perl_pp_ftpipe pPerl->Perl_pp_ftpipe -#undef pp_ftpipe -#define pp_ftpipe Perl_pp_ftpipe -#undef Perl_pp_ftrexec -#define Perl_pp_ftrexec pPerl->Perl_pp_ftrexec -#undef pp_ftrexec -#define pp_ftrexec Perl_pp_ftrexec -#undef Perl_pp_ftrowned -#define Perl_pp_ftrowned pPerl->Perl_pp_ftrowned -#undef pp_ftrowned -#define pp_ftrowned Perl_pp_ftrowned -#undef Perl_pp_ftrread -#define Perl_pp_ftrread pPerl->Perl_pp_ftrread -#undef pp_ftrread -#define pp_ftrread Perl_pp_ftrread -#undef Perl_pp_ftrwrite -#define Perl_pp_ftrwrite pPerl->Perl_pp_ftrwrite -#undef pp_ftrwrite -#define pp_ftrwrite Perl_pp_ftrwrite -#undef Perl_pp_ftsgid -#define Perl_pp_ftsgid pPerl->Perl_pp_ftsgid -#undef pp_ftsgid -#define pp_ftsgid Perl_pp_ftsgid -#undef Perl_pp_ftsize -#define Perl_pp_ftsize pPerl->Perl_pp_ftsize -#undef pp_ftsize -#define pp_ftsize Perl_pp_ftsize -#undef Perl_pp_ftsock -#define Perl_pp_ftsock pPerl->Perl_pp_ftsock -#undef pp_ftsock -#define pp_ftsock Perl_pp_ftsock -#undef Perl_pp_ftsuid -#define Perl_pp_ftsuid pPerl->Perl_pp_ftsuid -#undef pp_ftsuid -#define pp_ftsuid Perl_pp_ftsuid -#undef Perl_pp_ftsvtx -#define Perl_pp_ftsvtx pPerl->Perl_pp_ftsvtx -#undef pp_ftsvtx -#define pp_ftsvtx Perl_pp_ftsvtx -#undef Perl_pp_fttext -#define Perl_pp_fttext pPerl->Perl_pp_fttext -#undef pp_fttext -#define pp_fttext Perl_pp_fttext -#undef Perl_pp_fttty -#define Perl_pp_fttty pPerl->Perl_pp_fttty -#undef pp_fttty -#define pp_fttty Perl_pp_fttty -#undef Perl_pp_ftzero -#define Perl_pp_ftzero pPerl->Perl_pp_ftzero -#undef pp_ftzero -#define pp_ftzero Perl_pp_ftzero -#undef Perl_pp_ge -#define Perl_pp_ge pPerl->Perl_pp_ge -#undef pp_ge -#define pp_ge Perl_pp_ge -#undef Perl_pp_gelem -#define Perl_pp_gelem pPerl->Perl_pp_gelem -#undef pp_gelem -#define pp_gelem Perl_pp_gelem -#undef Perl_pp_getc -#define Perl_pp_getc pPerl->Perl_pp_getc -#undef pp_getc -#define pp_getc Perl_pp_getc -#undef Perl_pp_getlogin -#define Perl_pp_getlogin pPerl->Perl_pp_getlogin -#undef pp_getlogin -#define pp_getlogin Perl_pp_getlogin -#undef Perl_pp_getpeername -#define Perl_pp_getpeername pPerl->Perl_pp_getpeername -#undef pp_getpeername -#define pp_getpeername Perl_pp_getpeername -#undef Perl_pp_getpgrp -#define Perl_pp_getpgrp pPerl->Perl_pp_getpgrp -#undef pp_getpgrp -#define pp_getpgrp Perl_pp_getpgrp -#undef Perl_pp_getppid -#define Perl_pp_getppid pPerl->Perl_pp_getppid -#undef pp_getppid -#define pp_getppid Perl_pp_getppid -#undef Perl_pp_getpriority -#define Perl_pp_getpriority pPerl->Perl_pp_getpriority -#undef pp_getpriority -#define pp_getpriority Perl_pp_getpriority -#undef Perl_pp_getsockname -#define Perl_pp_getsockname pPerl->Perl_pp_getsockname -#undef pp_getsockname -#define pp_getsockname Perl_pp_getsockname -#undef Perl_pp_ggrent -#define Perl_pp_ggrent pPerl->Perl_pp_ggrent -#undef pp_ggrent -#define pp_ggrent Perl_pp_ggrent -#undef Perl_pp_ggrgid -#define Perl_pp_ggrgid pPerl->Perl_pp_ggrgid -#undef pp_ggrgid -#define pp_ggrgid Perl_pp_ggrgid -#undef Perl_pp_ggrnam -#define Perl_pp_ggrnam pPerl->Perl_pp_ggrnam -#undef pp_ggrnam -#define pp_ggrnam Perl_pp_ggrnam -#undef Perl_pp_ghbyaddr -#define Perl_pp_ghbyaddr pPerl->Perl_pp_ghbyaddr -#undef pp_ghbyaddr -#define pp_ghbyaddr Perl_pp_ghbyaddr -#undef Perl_pp_ghbyname -#define Perl_pp_ghbyname pPerl->Perl_pp_ghbyname -#undef pp_ghbyname -#define pp_ghbyname Perl_pp_ghbyname -#undef Perl_pp_ghostent -#define Perl_pp_ghostent pPerl->Perl_pp_ghostent -#undef pp_ghostent -#define pp_ghostent Perl_pp_ghostent -#undef Perl_pp_glob -#define Perl_pp_glob pPerl->Perl_pp_glob -#undef pp_glob -#define pp_glob Perl_pp_glob -#undef Perl_pp_gmtime -#define Perl_pp_gmtime pPerl->Perl_pp_gmtime -#undef pp_gmtime -#define pp_gmtime Perl_pp_gmtime -#undef Perl_pp_gnbyaddr -#define Perl_pp_gnbyaddr pPerl->Perl_pp_gnbyaddr -#undef pp_gnbyaddr -#define pp_gnbyaddr Perl_pp_gnbyaddr -#undef Perl_pp_gnbyname -#define Perl_pp_gnbyname pPerl->Perl_pp_gnbyname -#undef pp_gnbyname -#define pp_gnbyname Perl_pp_gnbyname -#undef Perl_pp_gnetent -#define Perl_pp_gnetent pPerl->Perl_pp_gnetent -#undef pp_gnetent -#define pp_gnetent Perl_pp_gnetent -#undef Perl_pp_goto -#define Perl_pp_goto pPerl->Perl_pp_goto -#undef pp_goto -#define pp_goto Perl_pp_goto -#undef Perl_pp_gpbyname -#define Perl_pp_gpbyname pPerl->Perl_pp_gpbyname -#undef pp_gpbyname -#define pp_gpbyname Perl_pp_gpbyname -#undef Perl_pp_gpbynumber -#define Perl_pp_gpbynumber pPerl->Perl_pp_gpbynumber -#undef pp_gpbynumber -#define pp_gpbynumber Perl_pp_gpbynumber -#undef Perl_pp_gprotoent -#define Perl_pp_gprotoent pPerl->Perl_pp_gprotoent -#undef pp_gprotoent -#define pp_gprotoent Perl_pp_gprotoent -#undef Perl_pp_gpwent -#define Perl_pp_gpwent pPerl->Perl_pp_gpwent -#undef pp_gpwent -#define pp_gpwent Perl_pp_gpwent -#undef Perl_pp_gpwnam -#define Perl_pp_gpwnam pPerl->Perl_pp_gpwnam -#undef pp_gpwnam -#define pp_gpwnam Perl_pp_gpwnam -#undef Perl_pp_gpwuid -#define Perl_pp_gpwuid pPerl->Perl_pp_gpwuid -#undef pp_gpwuid -#define pp_gpwuid Perl_pp_gpwuid -#undef Perl_pp_grepstart -#define Perl_pp_grepstart pPerl->Perl_pp_grepstart -#undef pp_grepstart -#define pp_grepstart Perl_pp_grepstart -#undef Perl_pp_grepwhile -#define Perl_pp_grepwhile pPerl->Perl_pp_grepwhile -#undef pp_grepwhile -#define pp_grepwhile Perl_pp_grepwhile -#undef Perl_pp_gsbyname -#define Perl_pp_gsbyname pPerl->Perl_pp_gsbyname -#undef pp_gsbyname -#define pp_gsbyname Perl_pp_gsbyname -#undef Perl_pp_gsbyport -#define Perl_pp_gsbyport pPerl->Perl_pp_gsbyport -#undef pp_gsbyport -#define pp_gsbyport Perl_pp_gsbyport -#undef Perl_pp_gservent -#define Perl_pp_gservent pPerl->Perl_pp_gservent -#undef pp_gservent -#define pp_gservent Perl_pp_gservent -#undef Perl_pp_gsockopt -#define Perl_pp_gsockopt pPerl->Perl_pp_gsockopt -#undef pp_gsockopt -#define pp_gsockopt Perl_pp_gsockopt -#undef Perl_pp_gt -#define Perl_pp_gt pPerl->Perl_pp_gt -#undef pp_gt -#define pp_gt Perl_pp_gt -#undef Perl_pp_gv -#define Perl_pp_gv pPerl->Perl_pp_gv -#undef pp_gv -#define pp_gv Perl_pp_gv -#undef Perl_pp_gvsv -#define Perl_pp_gvsv pPerl->Perl_pp_gvsv -#undef pp_gvsv -#define pp_gvsv Perl_pp_gvsv -#undef Perl_pp_helem -#define Perl_pp_helem pPerl->Perl_pp_helem -#undef pp_helem -#define pp_helem Perl_pp_helem -#undef Perl_pp_hex -#define Perl_pp_hex pPerl->Perl_pp_hex -#undef pp_hex -#define pp_hex Perl_pp_hex -#undef Perl_pp_hslice -#define Perl_pp_hslice pPerl->Perl_pp_hslice -#undef pp_hslice -#define pp_hslice Perl_pp_hslice -#undef Perl_pp_i_add -#define Perl_pp_i_add pPerl->Perl_pp_i_add -#undef pp_i_add -#define pp_i_add Perl_pp_i_add -#undef Perl_pp_i_divide -#define Perl_pp_i_divide pPerl->Perl_pp_i_divide -#undef pp_i_divide -#define pp_i_divide Perl_pp_i_divide -#undef Perl_pp_i_eq -#define Perl_pp_i_eq pPerl->Perl_pp_i_eq -#undef pp_i_eq -#define pp_i_eq Perl_pp_i_eq -#undef Perl_pp_i_ge -#define Perl_pp_i_ge pPerl->Perl_pp_i_ge -#undef pp_i_ge -#define pp_i_ge Perl_pp_i_ge -#undef Perl_pp_i_gt -#define Perl_pp_i_gt pPerl->Perl_pp_i_gt -#undef pp_i_gt -#define pp_i_gt Perl_pp_i_gt -#undef Perl_pp_i_le -#define Perl_pp_i_le pPerl->Perl_pp_i_le -#undef pp_i_le -#define pp_i_le Perl_pp_i_le -#undef Perl_pp_i_lt -#define Perl_pp_i_lt pPerl->Perl_pp_i_lt -#undef pp_i_lt -#define pp_i_lt Perl_pp_i_lt -#undef Perl_pp_i_modulo -#define Perl_pp_i_modulo pPerl->Perl_pp_i_modulo -#undef pp_i_modulo -#define pp_i_modulo Perl_pp_i_modulo -#undef Perl_pp_i_multiply -#define Perl_pp_i_multiply pPerl->Perl_pp_i_multiply -#undef pp_i_multiply -#define pp_i_multiply Perl_pp_i_multiply -#undef Perl_pp_i_ncmp -#define Perl_pp_i_ncmp pPerl->Perl_pp_i_ncmp -#undef pp_i_ncmp -#define pp_i_ncmp Perl_pp_i_ncmp -#undef Perl_pp_i_ne -#define Perl_pp_i_ne pPerl->Perl_pp_i_ne -#undef pp_i_ne -#define pp_i_ne Perl_pp_i_ne -#undef Perl_pp_i_negate -#define Perl_pp_i_negate pPerl->Perl_pp_i_negate -#undef pp_i_negate -#define pp_i_negate Perl_pp_i_negate -#undef Perl_pp_i_subtract -#define Perl_pp_i_subtract pPerl->Perl_pp_i_subtract -#undef pp_i_subtract -#define pp_i_subtract Perl_pp_i_subtract -#undef Perl_pp_index -#define Perl_pp_index pPerl->Perl_pp_index -#undef pp_index -#define pp_index Perl_pp_index -#undef Perl_pp_int -#define Perl_pp_int pPerl->Perl_pp_int -#undef pp_int -#define pp_int Perl_pp_int -#undef Perl_pp_ioctl -#define Perl_pp_ioctl pPerl->Perl_pp_ioctl -#undef pp_ioctl -#define pp_ioctl Perl_pp_ioctl -#undef Perl_pp_iter -#define Perl_pp_iter pPerl->Perl_pp_iter -#undef pp_iter -#define pp_iter Perl_pp_iter -#undef Perl_pp_join -#define Perl_pp_join pPerl->Perl_pp_join -#undef pp_join -#define pp_join Perl_pp_join -#undef Perl_pp_keys -#define Perl_pp_keys pPerl->Perl_pp_keys -#undef pp_keys -#define pp_keys Perl_pp_keys -#undef Perl_pp_kill -#define Perl_pp_kill pPerl->Perl_pp_kill -#undef pp_kill -#define pp_kill Perl_pp_kill -#undef Perl_pp_last -#define Perl_pp_last pPerl->Perl_pp_last -#undef pp_last -#define pp_last Perl_pp_last -#undef Perl_pp_lc -#define Perl_pp_lc pPerl->Perl_pp_lc -#undef pp_lc -#define pp_lc Perl_pp_lc -#undef Perl_pp_lcfirst -#define Perl_pp_lcfirst pPerl->Perl_pp_lcfirst -#undef pp_lcfirst -#define pp_lcfirst Perl_pp_lcfirst -#undef Perl_pp_le -#define Perl_pp_le pPerl->Perl_pp_le -#undef pp_le -#define pp_le Perl_pp_le -#undef Perl_pp_leave -#define Perl_pp_leave pPerl->Perl_pp_leave -#undef pp_leave -#define pp_leave Perl_pp_leave -#undef Perl_pp_leaveeval -#define Perl_pp_leaveeval pPerl->Perl_pp_leaveeval -#undef pp_leaveeval -#define pp_leaveeval Perl_pp_leaveeval -#undef Perl_pp_leaveloop -#define Perl_pp_leaveloop pPerl->Perl_pp_leaveloop -#undef pp_leaveloop -#define pp_leaveloop Perl_pp_leaveloop -#undef Perl_pp_leavesub -#define Perl_pp_leavesub pPerl->Perl_pp_leavesub -#undef pp_leavesub -#define pp_leavesub Perl_pp_leavesub -#undef Perl_pp_leavesublv -#define Perl_pp_leavesublv pPerl->Perl_pp_leavesublv -#undef pp_leavesublv -#define pp_leavesublv Perl_pp_leavesublv -#undef Perl_pp_leavetry -#define Perl_pp_leavetry pPerl->Perl_pp_leavetry -#undef pp_leavetry -#define pp_leavetry Perl_pp_leavetry -#undef Perl_pp_leavewrite -#define Perl_pp_leavewrite pPerl->Perl_pp_leavewrite -#undef pp_leavewrite -#define pp_leavewrite Perl_pp_leavewrite -#undef Perl_pp_left_shift -#define Perl_pp_left_shift pPerl->Perl_pp_left_shift -#undef pp_left_shift -#define pp_left_shift Perl_pp_left_shift -#undef Perl_pp_length -#define Perl_pp_length pPerl->Perl_pp_length -#undef pp_length -#define pp_length Perl_pp_length -#undef Perl_pp_lineseq -#define Perl_pp_lineseq pPerl->Perl_pp_lineseq -#undef pp_lineseq -#define pp_lineseq Perl_pp_lineseq -#undef Perl_pp_link -#define Perl_pp_link pPerl->Perl_pp_link -#undef pp_link -#define pp_link Perl_pp_link -#undef Perl_pp_list -#define Perl_pp_list pPerl->Perl_pp_list -#undef pp_list -#define pp_list Perl_pp_list -#undef Perl_pp_listen -#define Perl_pp_listen pPerl->Perl_pp_listen -#undef pp_listen -#define pp_listen Perl_pp_listen -#undef Perl_pp_localtime -#define Perl_pp_localtime pPerl->Perl_pp_localtime -#undef pp_localtime -#define pp_localtime Perl_pp_localtime -#undef Perl_pp_lock -#define Perl_pp_lock pPerl->Perl_pp_lock -#undef pp_lock -#define pp_lock Perl_pp_lock -#undef Perl_pp_log -#define Perl_pp_log pPerl->Perl_pp_log -#undef pp_log -#define pp_log Perl_pp_log -#undef Perl_pp_lslice -#define Perl_pp_lslice pPerl->Perl_pp_lslice -#undef pp_lslice -#define pp_lslice Perl_pp_lslice -#undef Perl_pp_lstat -#define Perl_pp_lstat pPerl->Perl_pp_lstat -#undef pp_lstat -#define pp_lstat Perl_pp_lstat -#undef Perl_pp_lt -#define Perl_pp_lt pPerl->Perl_pp_lt -#undef pp_lt -#define pp_lt Perl_pp_lt -#undef Perl_pp_mapstart -#define Perl_pp_mapstart pPerl->Perl_pp_mapstart -#undef pp_mapstart -#define pp_mapstart Perl_pp_mapstart -#undef Perl_pp_mapwhile -#define Perl_pp_mapwhile pPerl->Perl_pp_mapwhile -#undef pp_mapwhile -#define pp_mapwhile Perl_pp_mapwhile -#undef Perl_pp_match -#define Perl_pp_match pPerl->Perl_pp_match -#undef pp_match -#define pp_match Perl_pp_match -#undef Perl_pp_method -#define Perl_pp_method pPerl->Perl_pp_method -#undef pp_method -#define pp_method Perl_pp_method -#undef Perl_pp_method_named -#define Perl_pp_method_named pPerl->Perl_pp_method_named -#undef pp_method_named -#define pp_method_named Perl_pp_method_named -#undef Perl_pp_mkdir -#define Perl_pp_mkdir pPerl->Perl_pp_mkdir -#undef pp_mkdir -#define pp_mkdir Perl_pp_mkdir -#undef Perl_pp_modulo -#define Perl_pp_modulo pPerl->Perl_pp_modulo -#undef pp_modulo -#define pp_modulo Perl_pp_modulo -#undef Perl_pp_msgctl -#define Perl_pp_msgctl pPerl->Perl_pp_msgctl -#undef pp_msgctl -#define pp_msgctl Perl_pp_msgctl -#undef Perl_pp_msgget -#define Perl_pp_msgget pPerl->Perl_pp_msgget -#undef pp_msgget -#define pp_msgget Perl_pp_msgget -#undef Perl_pp_msgrcv -#define Perl_pp_msgrcv pPerl->Perl_pp_msgrcv -#undef pp_msgrcv -#define pp_msgrcv Perl_pp_msgrcv -#undef Perl_pp_msgsnd -#define Perl_pp_msgsnd pPerl->Perl_pp_msgsnd -#undef pp_msgsnd -#define pp_msgsnd Perl_pp_msgsnd -#undef Perl_pp_multiply -#define Perl_pp_multiply pPerl->Perl_pp_multiply -#undef pp_multiply -#define pp_multiply Perl_pp_multiply -#undef Perl_pp_ncmp -#define Perl_pp_ncmp pPerl->Perl_pp_ncmp -#undef pp_ncmp -#define pp_ncmp Perl_pp_ncmp -#undef Perl_pp_ne -#define Perl_pp_ne pPerl->Perl_pp_ne -#undef pp_ne -#define pp_ne Perl_pp_ne -#undef Perl_pp_negate -#define Perl_pp_negate pPerl->Perl_pp_negate -#undef pp_negate -#define pp_negate Perl_pp_negate -#undef Perl_pp_next -#define Perl_pp_next pPerl->Perl_pp_next -#undef pp_next -#define pp_next Perl_pp_next -#undef Perl_pp_nextstate -#define Perl_pp_nextstate pPerl->Perl_pp_nextstate -#undef pp_nextstate -#define pp_nextstate Perl_pp_nextstate -#undef Perl_pp_not -#define Perl_pp_not pPerl->Perl_pp_not -#undef pp_not -#define pp_not Perl_pp_not -#undef Perl_pp_null -#define Perl_pp_null pPerl->Perl_pp_null -#undef pp_null -#define pp_null Perl_pp_null -#undef Perl_pp_oct -#define Perl_pp_oct pPerl->Perl_pp_oct -#undef pp_oct -#define pp_oct Perl_pp_oct -#undef Perl_pp_open -#define Perl_pp_open pPerl->Perl_pp_open -#undef pp_open -#define pp_open Perl_pp_open -#undef Perl_pp_open_dir -#define Perl_pp_open_dir pPerl->Perl_pp_open_dir -#undef pp_open_dir -#define pp_open_dir Perl_pp_open_dir -#undef Perl_pp_or -#define Perl_pp_or pPerl->Perl_pp_or -#undef pp_or -#define pp_or Perl_pp_or -#undef Perl_pp_orassign -#define Perl_pp_orassign pPerl->Perl_pp_orassign -#undef pp_orassign -#define pp_orassign Perl_pp_orassign -#undef Perl_pp_ord -#define Perl_pp_ord pPerl->Perl_pp_ord -#undef pp_ord -#define pp_ord Perl_pp_ord -#undef Perl_pp_pack -#define Perl_pp_pack pPerl->Perl_pp_pack -#undef pp_pack -#define pp_pack Perl_pp_pack -#undef Perl_pp_padany -#define Perl_pp_padany pPerl->Perl_pp_padany -#undef pp_padany -#define pp_padany Perl_pp_padany -#undef Perl_pp_padav -#define Perl_pp_padav pPerl->Perl_pp_padav -#undef pp_padav -#define pp_padav Perl_pp_padav -#undef Perl_pp_padhv -#define Perl_pp_padhv pPerl->Perl_pp_padhv -#undef pp_padhv -#define pp_padhv Perl_pp_padhv -#undef Perl_pp_padsv -#define Perl_pp_padsv pPerl->Perl_pp_padsv -#undef pp_padsv -#define pp_padsv Perl_pp_padsv -#undef Perl_pp_pipe_op -#define Perl_pp_pipe_op pPerl->Perl_pp_pipe_op -#undef pp_pipe_op -#define pp_pipe_op Perl_pp_pipe_op -#undef Perl_pp_pop -#define Perl_pp_pop pPerl->Perl_pp_pop -#undef pp_pop -#define pp_pop Perl_pp_pop -#undef Perl_pp_pos -#define Perl_pp_pos pPerl->Perl_pp_pos -#undef pp_pos -#define pp_pos Perl_pp_pos -#undef Perl_pp_postdec -#define Perl_pp_postdec pPerl->Perl_pp_postdec -#undef pp_postdec -#define pp_postdec Perl_pp_postdec -#undef Perl_pp_postinc -#define Perl_pp_postinc pPerl->Perl_pp_postinc -#undef pp_postinc -#define pp_postinc Perl_pp_postinc -#undef Perl_pp_pow -#define Perl_pp_pow pPerl->Perl_pp_pow -#undef pp_pow -#define pp_pow Perl_pp_pow -#undef Perl_pp_predec -#define Perl_pp_predec pPerl->Perl_pp_predec -#undef pp_predec -#define pp_predec Perl_pp_predec -#undef Perl_pp_preinc -#define Perl_pp_preinc pPerl->Perl_pp_preinc -#undef pp_preinc -#define pp_preinc Perl_pp_preinc -#undef Perl_pp_print -#define Perl_pp_print pPerl->Perl_pp_print -#undef pp_print -#define pp_print Perl_pp_print -#undef Perl_pp_prototype -#define Perl_pp_prototype pPerl->Perl_pp_prototype -#undef pp_prototype -#define pp_prototype Perl_pp_prototype -#undef Perl_pp_prtf -#define Perl_pp_prtf pPerl->Perl_pp_prtf -#undef pp_prtf -#define pp_prtf Perl_pp_prtf -#undef Perl_pp_push -#define Perl_pp_push pPerl->Perl_pp_push -#undef pp_push -#define pp_push Perl_pp_push -#undef Perl_pp_pushmark -#define Perl_pp_pushmark pPerl->Perl_pp_pushmark -#undef pp_pushmark -#define pp_pushmark Perl_pp_pushmark -#undef Perl_pp_pushre -#define Perl_pp_pushre pPerl->Perl_pp_pushre -#undef pp_pushre -#define pp_pushre Perl_pp_pushre -#undef Perl_pp_qr -#define Perl_pp_qr pPerl->Perl_pp_qr -#undef pp_qr -#define pp_qr Perl_pp_qr -#undef Perl_pp_quotemeta -#define Perl_pp_quotemeta pPerl->Perl_pp_quotemeta -#undef pp_quotemeta -#define pp_quotemeta Perl_pp_quotemeta -#undef Perl_pp_rand -#define Perl_pp_rand pPerl->Perl_pp_rand -#undef pp_rand -#define pp_rand Perl_pp_rand -#undef Perl_pp_range -#define Perl_pp_range pPerl->Perl_pp_range -#undef pp_range -#define pp_range Perl_pp_range -#undef Perl_pp_rcatline -#define Perl_pp_rcatline pPerl->Perl_pp_rcatline -#undef pp_rcatline -#define pp_rcatline Perl_pp_rcatline -#undef Perl_pp_read -#define Perl_pp_read pPerl->Perl_pp_read -#undef pp_read -#define pp_read Perl_pp_read -#undef Perl_pp_readdir -#define Perl_pp_readdir pPerl->Perl_pp_readdir -#undef pp_readdir -#define pp_readdir Perl_pp_readdir -#undef Perl_pp_readline -#define Perl_pp_readline pPerl->Perl_pp_readline -#undef pp_readline -#define pp_readline Perl_pp_readline -#undef Perl_pp_readlink -#define Perl_pp_readlink pPerl->Perl_pp_readlink -#undef pp_readlink -#define pp_readlink Perl_pp_readlink -#undef Perl_pp_recv -#define Perl_pp_recv pPerl->Perl_pp_recv -#undef pp_recv -#define pp_recv Perl_pp_recv -#undef Perl_pp_redo -#define Perl_pp_redo pPerl->Perl_pp_redo -#undef pp_redo -#define pp_redo Perl_pp_redo -#undef Perl_pp_ref -#define Perl_pp_ref pPerl->Perl_pp_ref -#undef pp_ref -#define pp_ref Perl_pp_ref -#undef Perl_pp_refgen -#define Perl_pp_refgen pPerl->Perl_pp_refgen -#undef pp_refgen -#define pp_refgen Perl_pp_refgen -#undef Perl_pp_regcmaybe -#define Perl_pp_regcmaybe pPerl->Perl_pp_regcmaybe -#undef pp_regcmaybe -#define pp_regcmaybe Perl_pp_regcmaybe -#undef Perl_pp_regcomp -#define Perl_pp_regcomp pPerl->Perl_pp_regcomp -#undef pp_regcomp -#define pp_regcomp Perl_pp_regcomp -#undef Perl_pp_regcreset -#define Perl_pp_regcreset pPerl->Perl_pp_regcreset -#undef pp_regcreset -#define pp_regcreset Perl_pp_regcreset -#undef Perl_pp_rename -#define Perl_pp_rename pPerl->Perl_pp_rename -#undef pp_rename -#define pp_rename Perl_pp_rename -#undef Perl_pp_repeat -#define Perl_pp_repeat pPerl->Perl_pp_repeat -#undef pp_repeat -#define pp_repeat Perl_pp_repeat -#undef Perl_pp_require -#define Perl_pp_require pPerl->Perl_pp_require -#undef pp_require -#define pp_require Perl_pp_require -#undef Perl_pp_reset -#define Perl_pp_reset pPerl->Perl_pp_reset -#undef pp_reset -#define pp_reset Perl_pp_reset -#undef Perl_pp_return -#define Perl_pp_return pPerl->Perl_pp_return -#undef pp_return -#define pp_return Perl_pp_return -#undef Perl_pp_reverse -#define Perl_pp_reverse pPerl->Perl_pp_reverse -#undef pp_reverse -#define pp_reverse Perl_pp_reverse -#undef Perl_pp_rewinddir -#define Perl_pp_rewinddir pPerl->Perl_pp_rewinddir -#undef pp_rewinddir -#define pp_rewinddir Perl_pp_rewinddir -#undef Perl_pp_right_shift -#define Perl_pp_right_shift pPerl->Perl_pp_right_shift -#undef pp_right_shift -#define pp_right_shift Perl_pp_right_shift -#undef Perl_pp_rindex -#define Perl_pp_rindex pPerl->Perl_pp_rindex -#undef pp_rindex -#define pp_rindex Perl_pp_rindex -#undef Perl_pp_rmdir -#define Perl_pp_rmdir pPerl->Perl_pp_rmdir -#undef pp_rmdir -#define pp_rmdir Perl_pp_rmdir -#undef Perl_pp_rv2av -#define Perl_pp_rv2av pPerl->Perl_pp_rv2av -#undef pp_rv2av -#define pp_rv2av Perl_pp_rv2av -#undef Perl_pp_rv2cv -#define Perl_pp_rv2cv pPerl->Perl_pp_rv2cv -#undef pp_rv2cv -#define pp_rv2cv Perl_pp_rv2cv -#undef Perl_pp_rv2gv -#define Perl_pp_rv2gv pPerl->Perl_pp_rv2gv -#undef pp_rv2gv -#define pp_rv2gv Perl_pp_rv2gv -#undef Perl_pp_rv2hv -#define Perl_pp_rv2hv pPerl->Perl_pp_rv2hv -#undef pp_rv2hv -#define pp_rv2hv Perl_pp_rv2hv -#undef Perl_pp_rv2sv -#define Perl_pp_rv2sv pPerl->Perl_pp_rv2sv -#undef pp_rv2sv -#define pp_rv2sv Perl_pp_rv2sv -#undef Perl_pp_sassign -#define Perl_pp_sassign pPerl->Perl_pp_sassign -#undef pp_sassign -#define pp_sassign Perl_pp_sassign -#undef Perl_pp_scalar -#define Perl_pp_scalar pPerl->Perl_pp_scalar -#undef pp_scalar -#define pp_scalar Perl_pp_scalar -#undef Perl_pp_schomp -#define Perl_pp_schomp pPerl->Perl_pp_schomp -#undef pp_schomp -#define pp_schomp Perl_pp_schomp -#undef Perl_pp_schop -#define Perl_pp_schop pPerl->Perl_pp_schop -#undef pp_schop -#define pp_schop Perl_pp_schop -#undef Perl_pp_scmp -#define Perl_pp_scmp pPerl->Perl_pp_scmp -#undef pp_scmp -#define pp_scmp Perl_pp_scmp -#undef Perl_pp_scope -#define Perl_pp_scope pPerl->Perl_pp_scope -#undef pp_scope -#define pp_scope Perl_pp_scope -#undef Perl_pp_seek -#define Perl_pp_seek pPerl->Perl_pp_seek -#undef pp_seek -#define pp_seek Perl_pp_seek -#undef Perl_pp_seekdir -#define Perl_pp_seekdir pPerl->Perl_pp_seekdir -#undef pp_seekdir -#define pp_seekdir Perl_pp_seekdir -#undef Perl_pp_select -#define Perl_pp_select pPerl->Perl_pp_select -#undef pp_select -#define pp_select Perl_pp_select -#undef Perl_pp_semctl -#define Perl_pp_semctl pPerl->Perl_pp_semctl -#undef pp_semctl -#define pp_semctl Perl_pp_semctl -#undef Perl_pp_semget -#define Perl_pp_semget pPerl->Perl_pp_semget -#undef pp_semget -#define pp_semget Perl_pp_semget -#undef Perl_pp_semop -#define Perl_pp_semop pPerl->Perl_pp_semop -#undef pp_semop -#define pp_semop Perl_pp_semop -#undef Perl_pp_send -#define Perl_pp_send pPerl->Perl_pp_send -#undef pp_send -#define pp_send Perl_pp_send -#undef Perl_pp_seq -#define Perl_pp_seq pPerl->Perl_pp_seq -#undef pp_seq -#define pp_seq Perl_pp_seq -#undef Perl_pp_setpgrp -#define Perl_pp_setpgrp pPerl->Perl_pp_setpgrp -#undef pp_setpgrp -#define pp_setpgrp Perl_pp_setpgrp -#undef Perl_pp_setpriority -#define Perl_pp_setpriority pPerl->Perl_pp_setpriority -#undef pp_setpriority -#define pp_setpriority Perl_pp_setpriority -#undef Perl_pp_setstate -#define Perl_pp_setstate pPerl->Perl_pp_setstate -#undef pp_setstate -#define pp_setstate Perl_pp_setstate -#undef Perl_pp_sge -#define Perl_pp_sge pPerl->Perl_pp_sge -#undef pp_sge -#define pp_sge Perl_pp_sge -#undef Perl_pp_sgrent -#define Perl_pp_sgrent pPerl->Perl_pp_sgrent -#undef pp_sgrent -#define pp_sgrent Perl_pp_sgrent -#undef Perl_pp_sgt -#define Perl_pp_sgt pPerl->Perl_pp_sgt -#undef pp_sgt -#define pp_sgt Perl_pp_sgt -#undef Perl_pp_shift -#define Perl_pp_shift pPerl->Perl_pp_shift -#undef pp_shift -#define pp_shift Perl_pp_shift -#undef Perl_pp_shmctl -#define Perl_pp_shmctl pPerl->Perl_pp_shmctl -#undef pp_shmctl -#define pp_shmctl Perl_pp_shmctl -#undef Perl_pp_shmget -#define Perl_pp_shmget pPerl->Perl_pp_shmget -#undef pp_shmget -#define pp_shmget Perl_pp_shmget -#undef Perl_pp_shmread -#define Perl_pp_shmread pPerl->Perl_pp_shmread -#undef pp_shmread -#define pp_shmread Perl_pp_shmread -#undef Perl_pp_shmwrite -#define Perl_pp_shmwrite pPerl->Perl_pp_shmwrite -#undef pp_shmwrite -#define pp_shmwrite Perl_pp_shmwrite -#undef Perl_pp_shostent -#define Perl_pp_shostent pPerl->Perl_pp_shostent -#undef pp_shostent -#define pp_shostent Perl_pp_shostent -#undef Perl_pp_shutdown -#define Perl_pp_shutdown pPerl->Perl_pp_shutdown -#undef pp_shutdown -#define pp_shutdown Perl_pp_shutdown -#undef Perl_pp_sin -#define Perl_pp_sin pPerl->Perl_pp_sin -#undef pp_sin -#define pp_sin Perl_pp_sin -#undef Perl_pp_sle -#define Perl_pp_sle pPerl->Perl_pp_sle -#undef pp_sle -#define pp_sle Perl_pp_sle -#undef Perl_pp_sleep -#define Perl_pp_sleep pPerl->Perl_pp_sleep -#undef pp_sleep -#define pp_sleep Perl_pp_sleep -#undef Perl_pp_slt -#define Perl_pp_slt pPerl->Perl_pp_slt -#undef pp_slt -#define pp_slt Perl_pp_slt -#undef Perl_pp_sne -#define Perl_pp_sne pPerl->Perl_pp_sne -#undef pp_sne -#define pp_sne Perl_pp_sne -#undef Perl_pp_snetent -#define Perl_pp_snetent pPerl->Perl_pp_snetent -#undef pp_snetent -#define pp_snetent Perl_pp_snetent -#undef Perl_pp_socket -#define Perl_pp_socket pPerl->Perl_pp_socket -#undef pp_socket -#define pp_socket Perl_pp_socket -#undef Perl_pp_sockpair -#define Perl_pp_sockpair pPerl->Perl_pp_sockpair -#undef pp_sockpair -#define pp_sockpair Perl_pp_sockpair -#undef Perl_pp_sort -#define Perl_pp_sort pPerl->Perl_pp_sort -#undef pp_sort -#define pp_sort Perl_pp_sort -#undef Perl_pp_splice -#define Perl_pp_splice pPerl->Perl_pp_splice -#undef pp_splice -#define pp_splice Perl_pp_splice -#undef Perl_pp_split -#define Perl_pp_split pPerl->Perl_pp_split -#undef pp_split -#define pp_split Perl_pp_split -#undef Perl_pp_sprintf -#define Perl_pp_sprintf pPerl->Perl_pp_sprintf -#undef pp_sprintf -#define pp_sprintf Perl_pp_sprintf -#undef Perl_pp_sprotoent -#define Perl_pp_sprotoent pPerl->Perl_pp_sprotoent -#undef pp_sprotoent -#define pp_sprotoent Perl_pp_sprotoent -#undef Perl_pp_spwent -#define Perl_pp_spwent pPerl->Perl_pp_spwent -#undef pp_spwent -#define pp_spwent Perl_pp_spwent -#undef Perl_pp_sqrt -#define Perl_pp_sqrt pPerl->Perl_pp_sqrt -#undef pp_sqrt -#define pp_sqrt Perl_pp_sqrt -#undef Perl_pp_srand -#define Perl_pp_srand pPerl->Perl_pp_srand -#undef pp_srand -#define pp_srand Perl_pp_srand -#undef Perl_pp_srefgen -#define Perl_pp_srefgen pPerl->Perl_pp_srefgen -#undef pp_srefgen -#define pp_srefgen Perl_pp_srefgen -#undef Perl_pp_sselect -#define Perl_pp_sselect pPerl->Perl_pp_sselect -#undef pp_sselect -#define pp_sselect Perl_pp_sselect -#undef Perl_pp_sservent -#define Perl_pp_sservent pPerl->Perl_pp_sservent -#undef pp_sservent -#define pp_sservent Perl_pp_sservent -#undef Perl_pp_ssockopt -#define Perl_pp_ssockopt pPerl->Perl_pp_ssockopt -#undef pp_ssockopt -#define pp_ssockopt Perl_pp_ssockopt -#undef Perl_pp_stat -#define Perl_pp_stat pPerl->Perl_pp_stat -#undef pp_stat -#define pp_stat Perl_pp_stat -#undef Perl_pp_stringify -#define Perl_pp_stringify pPerl->Perl_pp_stringify -#undef pp_stringify -#define pp_stringify Perl_pp_stringify -#undef Perl_pp_stub -#define Perl_pp_stub pPerl->Perl_pp_stub -#undef pp_stub -#define pp_stub Perl_pp_stub -#undef Perl_pp_study -#define Perl_pp_study pPerl->Perl_pp_study -#undef pp_study -#define pp_study Perl_pp_study -#undef Perl_pp_subst -#define Perl_pp_subst pPerl->Perl_pp_subst -#undef pp_subst -#define pp_subst Perl_pp_subst -#undef Perl_pp_substcont -#define Perl_pp_substcont pPerl->Perl_pp_substcont -#undef pp_substcont -#define pp_substcont Perl_pp_substcont -#undef Perl_pp_substr -#define Perl_pp_substr pPerl->Perl_pp_substr -#undef pp_substr -#define pp_substr Perl_pp_substr -#undef Perl_pp_subtract -#define Perl_pp_subtract pPerl->Perl_pp_subtract -#undef pp_subtract -#define pp_subtract Perl_pp_subtract -#undef Perl_pp_symlink -#define Perl_pp_symlink pPerl->Perl_pp_symlink -#undef pp_symlink -#define pp_symlink Perl_pp_symlink -#undef Perl_pp_syscall -#define Perl_pp_syscall pPerl->Perl_pp_syscall -#undef pp_syscall -#define pp_syscall Perl_pp_syscall -#undef Perl_pp_sysopen -#define Perl_pp_sysopen pPerl->Perl_pp_sysopen -#undef pp_sysopen -#define pp_sysopen Perl_pp_sysopen -#undef Perl_pp_sysread -#define Perl_pp_sysread pPerl->Perl_pp_sysread -#undef pp_sysread -#define pp_sysread Perl_pp_sysread -#undef Perl_pp_sysseek -#define Perl_pp_sysseek pPerl->Perl_pp_sysseek -#undef pp_sysseek -#define pp_sysseek Perl_pp_sysseek -#undef Perl_pp_system -#define Perl_pp_system pPerl->Perl_pp_system -#undef pp_system -#define pp_system Perl_pp_system -#undef Perl_pp_syswrite -#define Perl_pp_syswrite pPerl->Perl_pp_syswrite -#undef pp_syswrite -#define pp_syswrite Perl_pp_syswrite -#undef Perl_pp_tell -#define Perl_pp_tell pPerl->Perl_pp_tell -#undef pp_tell -#define pp_tell Perl_pp_tell -#undef Perl_pp_telldir -#define Perl_pp_telldir pPerl->Perl_pp_telldir -#undef pp_telldir -#define pp_telldir Perl_pp_telldir -#undef Perl_pp_threadsv -#define Perl_pp_threadsv pPerl->Perl_pp_threadsv -#undef pp_threadsv -#define pp_threadsv Perl_pp_threadsv -#undef Perl_pp_tie -#define Perl_pp_tie pPerl->Perl_pp_tie -#undef pp_tie -#define pp_tie Perl_pp_tie -#undef Perl_pp_tied -#define Perl_pp_tied pPerl->Perl_pp_tied -#undef pp_tied -#define pp_tied Perl_pp_tied -#undef Perl_pp_time -#define Perl_pp_time pPerl->Perl_pp_time -#undef pp_time -#define pp_time Perl_pp_time -#undef Perl_pp_tms -#define Perl_pp_tms pPerl->Perl_pp_tms -#undef pp_tms -#define pp_tms Perl_pp_tms -#undef Perl_pp_trans -#define Perl_pp_trans pPerl->Perl_pp_trans -#undef pp_trans -#define pp_trans Perl_pp_trans -#undef Perl_pp_truncate -#define Perl_pp_truncate pPerl->Perl_pp_truncate -#undef pp_truncate -#define pp_truncate Perl_pp_truncate -#undef Perl_pp_uc -#define Perl_pp_uc pPerl->Perl_pp_uc -#undef pp_uc -#define pp_uc Perl_pp_uc -#undef Perl_pp_ucfirst -#define Perl_pp_ucfirst pPerl->Perl_pp_ucfirst -#undef pp_ucfirst -#define pp_ucfirst Perl_pp_ucfirst -#undef Perl_pp_umask -#define Perl_pp_umask pPerl->Perl_pp_umask -#undef pp_umask -#define pp_umask Perl_pp_umask -#undef Perl_pp_undef -#define Perl_pp_undef pPerl->Perl_pp_undef -#undef pp_undef -#define pp_undef Perl_pp_undef -#undef Perl_pp_unlink -#define Perl_pp_unlink pPerl->Perl_pp_unlink -#undef pp_unlink -#define pp_unlink Perl_pp_unlink -#undef Perl_pp_unpack -#define Perl_pp_unpack pPerl->Perl_pp_unpack -#undef pp_unpack -#define pp_unpack Perl_pp_unpack -#undef Perl_pp_unshift -#define Perl_pp_unshift pPerl->Perl_pp_unshift -#undef pp_unshift -#define pp_unshift Perl_pp_unshift -#undef Perl_pp_unstack -#define Perl_pp_unstack pPerl->Perl_pp_unstack -#undef pp_unstack -#define pp_unstack Perl_pp_unstack -#undef Perl_pp_untie -#define Perl_pp_untie pPerl->Perl_pp_untie -#undef pp_untie -#define pp_untie Perl_pp_untie -#undef Perl_pp_utime -#define Perl_pp_utime pPerl->Perl_pp_utime -#undef pp_utime -#define pp_utime Perl_pp_utime -#undef Perl_pp_values -#define Perl_pp_values pPerl->Perl_pp_values -#undef pp_values -#define pp_values Perl_pp_values -#undef Perl_pp_vec -#define Perl_pp_vec pPerl->Perl_pp_vec -#undef pp_vec -#define pp_vec Perl_pp_vec -#undef Perl_pp_wait -#define Perl_pp_wait pPerl->Perl_pp_wait -#undef pp_wait -#define pp_wait Perl_pp_wait -#undef Perl_pp_waitpid -#define Perl_pp_waitpid pPerl->Perl_pp_waitpid -#undef pp_waitpid -#define pp_waitpid Perl_pp_waitpid -#undef Perl_pp_wantarray -#define Perl_pp_wantarray pPerl->Perl_pp_wantarray -#undef pp_wantarray -#define pp_wantarray Perl_pp_wantarray -#undef Perl_pp_warn -#define Perl_pp_warn pPerl->Perl_pp_warn -#undef pp_warn -#define pp_warn Perl_pp_warn -#undef Perl_pp_xor -#define Perl_pp_xor pPerl->Perl_pp_xor -#undef pp_xor -#define pp_xor Perl_pp_xor -#endif /* PERL_OBJECT */ +#endif /* PERL_CORE && PERL_OBJECT */ #endif /* __objXSUB_h__ */ @@ -1,6 +1,6 @@ /* op.c * - * Copyright (c) 1991-1999, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -153,22 +153,39 @@ Perl_pad_allocmy(pTHX_ char *name) } if (ckWARN(WARN_UNSAFE) && AvFILLp(PL_comppad_name) >= 0) { SV **svp = AvARRAY(PL_comppad_name); - for (off = AvFILLp(PL_comppad_name); off > PL_comppad_name_floor; off--) { + HV *ourstash = (PL_curstash ? PL_curstash : PL_defstash); + PADOFFSET top = AvFILLp(PL_comppad_name); + for (off = top; off > PL_comppad_name_floor; off--) { if ((sv = svp[off]) && sv != &PL_sv_undef && (SvIVX(sv) == PAD_MAX || SvIVX(sv) == 0) + && (PL_in_my != KEY_our + || ((SvFLAGS(sv) & SVpad_OUR) && GvSTASH(sv) == ourstash)) && strEQ(name, SvPVX(sv))) { - 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")); + --off; + break; + } + } + if (PL_in_my == KEY_our) { + while (off >= 0 && off <= top) { + if ((sv = svp[off]) + && sv != &PL_sv_undef + && ((SvFLAGS(sv) & SVpad_OUR) && GvSTASH(sv) == ourstash) + && strEQ(name, SvPVX(sv))) { 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")); + "\"our\" variable %s redeclared", name); + Perl_warner(aTHX_ WARN_UNSAFE, + "(Did you mean \"local\" instead of \"our\"?)\n"); + break; } - break; + --off; } } } @@ -178,8 +195,8 @@ Perl_pad_allocmy(pTHX_ char *name) sv_setpv(sv, name); if (PL_in_my_stash) { if (*name != '$') - yyerror(Perl_form(aTHX_ "Can't declare class for non-scalar %s in \"my\"", - name)); + yyerror(Perl_form(aTHX_ "Can't declare class for non-scalar %s in \"%s\"", + name, PL_in_my == KEY_our ? "our" : "my")); SvOBJECT_on(sv); (void)SvUPGRADE(sv, SVt_PVMG); SvSTASH(sv) = (HV*)SvREFCNT_inc(PL_in_my_stash); @@ -204,6 +221,31 @@ Perl_pad_allocmy(pTHX_ char *name) return off; } +STATIC PADOFFSET +S_pad_addlex(pTHX_ SV *proto_namesv) +{ + SV *namesv = NEWSV(1103,0); + PADOFFSET newoff = pad_alloc(OP_PADSV, SVs_PADMY); + sv_upgrade(namesv, SVt_PVNV); + sv_setpv(namesv, SvPVX(proto_namesv)); + av_store(PL_comppad_name, newoff, namesv); + 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(proto_namesv) & SVpad_OUR) { /* An "our" variable */ + SvFLAGS(namesv) |= SVpad_OUR; + (void)SvUPGRADE(namesv, SVt_PVGV); + GvSTASH(namesv) = (HV*)SvREFCNT_inc((SV*)GvSTASH(proto_namesv)); + } + if (SvOBJECT(proto_namesv)) { /* A typed var */ + SvOBJECT_on(namesv); + (void)SvUPGRADE(namesv, SVt_PVMG); + SvSTASH(namesv) = (HV*)SvREFCNT_inc((SV*)SvSTASH(proto_namesv)); + PL_sv_objcount++; + } + return newoff; +} + #define FINDLEX_NOSEARCH 1 /* don't search outer contexts */ STATIC PADOFFSET @@ -246,28 +288,10 @@ S_pad_findlex(pTHX_ char *name, PADOFFSET newoff, U32 seq, CV* startcv, } depth = 1; } - oldpad = (AV*)*av_fetch(curlist, depth, FALSE); + oldpad = (AV*)AvARRAY(curlist)[depth]; oldsv = *av_fetch(oldpad, off, TRUE); if (!newoff) { /* Not a mere clone operation. */ - SV *namesv = NEWSV(1103,0); - newoff = pad_alloc(OP_PADSV, SVs_PADMY); - sv_upgrade(namesv, SVt_PVNV); - sv_setpv(namesv, name); - av_store(PL_comppad_name, newoff, namesv); - 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 */ - 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); - SvSTASH(namesv) = (HV*)SvREFCNT_inc((SV*)SvSTASH(sv)); - PL_sv_objcount++; - } + newoff = pad_addlex(sv); if (CvANON(PL_compcv) || SvTYPE(PL_compcv) == SVt_PVFM) { /* "It's closures all the way down." */ CvCLONE_on(PL_compcv); @@ -281,8 +305,23 @@ S_pad_findlex(pTHX_ char *name, PADOFFSET newoff, U32 seq, CV* startcv, bcv && bcv != cv && !CvCLONE(bcv); bcv = CvOUTSIDE(bcv)) { - if (CvANON(bcv)) + if (CvANON(bcv)) { + /* install the missing pad entry in intervening + * nested subs and mark them cloneable. + * XXX fix pad_foo() to not use globals */ + AV *ocomppad_name = PL_comppad_name; + AV *ocomppad = PL_comppad; + SV **ocurpad = PL_curpad; + AV *padlist = CvPADLIST(bcv); + PL_comppad_name = (AV*)AvARRAY(padlist)[0]; + PL_comppad = (AV*)AvARRAY(padlist)[1]; + PL_curpad = AvARRAY(PL_comppad); + pad_addlex(sv); + PL_comppad_name = ocomppad_name; + PL_comppad = ocomppad; + PL_curpad = ocurpad; CvCLONE_on(bcv); + } else { if (ckWARN(WARN_CLOSURE) && !CvUNIQUE(bcv) && !CvUNIQUE(cv)) @@ -1076,7 +1115,7 @@ Perl_scalarvoid(pTHX_ OP *o) case OP_GGRGID: case OP_GETLOGIN: func_ops: - if (!(o->op_private & OPpLVAL_INTRO)) + if (!(o->op_private & (OPpLVAL_INTRO|OPpOUR_INTRO))) useless = PL_op_desc[o->op_type]; break; @@ -1691,7 +1730,7 @@ Perl_ref(pTHX_ OP *o, I32 type) switch (o->op_type) { case OP_ENTERSUB: - if ((type == OP_DEFINED || type == OP_LOCK) && + if ((type == OP_EXISTS || type == OP_DEFINED || type == OP_LOCK) && !(o->op_flags & OPf_STACKED)) { o->op_type = OP_RV2CV; /* entersub => rv2cv */ o->op_ppaddr = PL_ppaddr[OP_RV2CV]; @@ -1847,7 +1886,9 @@ S_my_kid(pTHX_ OP *o, OP *attrs) type != OP_PADHV && type != OP_PUSHMARK) { - yyerror(Perl_form(aTHX_ "Can't declare %s in my", PL_op_desc[o->op_type])); + yyerror(Perl_form(aTHX_ "Can't declare %s in \"%s\"", + PL_op_desc[o->op_type], + PL_in_my == KEY_our ? "our" : "my")); return o; } else if (attrs && type != OP_PUSHMARK) { @@ -1855,6 +1896,9 @@ S_my_kid(pTHX_ OP *o, OP *attrs) SV *padsv; SV **namesvp; + PL_in_my = FALSE; + PL_in_my_stash = Nullhv; + /* check for C<my Dog $spot> when deciding package */ namesvp = av_fetch(PL_comppad_name, o->op_targ, FALSE); if (namesvp && *namesvp && SvOBJECT(*namesvp) && HvNAME(SvSTASH(*namesvp))) @@ -1874,11 +1918,12 @@ Perl_my_attrs(pTHX_ OP *o, OP *attrs) { if (o->op_flags & OPf_PARENS) list(o); - PL_in_my = FALSE; - PL_in_my_stash = Nullhv; if (attrs) SAVEFREEOP(attrs); - return my_kid(o, attrs); + o = my_kid(o, attrs); + PL_in_my = FALSE; + PL_in_my_stash = Nullhv; + return o; } OP * @@ -1986,12 +2031,11 @@ Perl_block_start(pTHX_ int full) int retval = PL_savestack_ix; SAVEI32(PL_comppad_name_floor); - if (full) { - if ((PL_comppad_name_fill = AvFILLp(PL_comppad_name)) > 0) - PL_comppad_name_floor = PL_comppad_name_fill; - else - PL_comppad_name_floor = 0; - } + PL_comppad_name_floor = AvFILLp(PL_comppad_name); + if (full) + PL_comppad_name_fill = PL_comppad_name_floor; + if (PL_comppad_name_floor < 0) + PL_comppad_name_floor = 0; SAVEI32(PL_min_intro_pending); SAVEI32(PL_max_intro_pending); PL_min_intro_pending = 0; @@ -2006,8 +2050,6 @@ Perl_block_start(pTHX_ int full) PL_compiling.cop_warnings = newSVsv(PL_compiling.cop_warnings) ; SAVEFREESV(PL_compiling.cop_warnings) ; } - - return retval; } @@ -2092,16 +2134,18 @@ Perl_localize(pTHX_ OP *o, I32 lex) char *s; for (s = PL_bufptr; *s && (isALNUM(*s) || (*s & 0x80) || strchr("@$%, ",*s)); s++) ; if (*s == ';' || *s == '=') - Perl_warner(aTHX_ WARN_PARENTHESIS, "Parentheses missing around \"%s\" list", - lex ? "my" : "local"); + Perl_warner(aTHX_ WARN_PARENTHESIS, + "Parentheses missing around \"%s\" list", + lex ? (PL_in_my == KEY_our ? "our" : "my") : "local"); } } - PL_in_my = FALSE; - PL_in_my_stash = Nullhv; if (lex) - return my(o); + o = my(o); else - return mod(o, OP_NULL); /* a bit kludgey */ + o = mod(o, OP_NULL); /* a bit kludgey */ + PL_in_my = FALSE; + PL_in_my_stash = Nullhv; + return o; } OP * @@ -2664,15 +2708,19 @@ Perl_pmtrans(pTHX_ OP *o, OP *expr, OP *repl) if (rfirst == 0xffffffff) { diff = tdiff; /* oops, pretend rdiff is infinite */ if (diff > 0) - Perl_sv_catpvf(aTHX_ listsv, "%04x\t%04x\tXXXX\n", tfirst, tlast); + Perl_sv_catpvf(aTHX_ listsv, "%04lx\t%04lx\tXXXX\n", + (long)tfirst, (long)tlast); else - Perl_sv_catpvf(aTHX_ listsv, "%04x\t\tXXXX\n", tfirst); + Perl_sv_catpvf(aTHX_ listsv, "%04lx\t\tXXXX\n", (long)tfirst); } else { if (diff > 0) - Perl_sv_catpvf(aTHX_ listsv, "%04x\t%04x\t%04x\n", tfirst, tfirst + diff, rfirst); + Perl_sv_catpvf(aTHX_ listsv, "%04lx\t%04lx\t%04lx\n", + (long)tfirst, (long)(tfirst + diff), + (long)rfirst); else - Perl_sv_catpvf(aTHX_ listsv, "%04x\t\t%04x\n", tfirst, rfirst); + Perl_sv_catpvf(aTHX_ listsv, "%04lx\t\t%04lx\n", + (long)tfirst, (long)rfirst); if (rfirst + diff > max) max = rfirst + diff; @@ -2819,12 +2867,16 @@ Perl_pmruntime(pTHX_ OP *o, OP *expr, OP *repl) p = SvPV(pat, plen); pm->op_pmflags |= PMf_SKIPWHITE; } + if ((PL_hints & HINT_UTF8) || (SvUTF8(pat) && !(PL_hints & HINT_BYTE))) + pm->op_pmdynflags |= PMdf_UTF8; pm->op_pmregexp = CALLREGCOMP(aTHX_ p, p + plen, pm); if (strEQ("\\s+", pm->op_pmregexp->precomp)) pm->op_pmflags |= PMf_WHITE; op_free(expr); } else { + if (PL_hints & HINT_UTF8) + pm->op_pmdynflags |= PMdf_UTF8; if (pm->op_pmflags & PMf_KEEP || !(PL_hints & HINT_RE_EVAL)) expr = newUNOP((!(PL_hints & HINT_RE_EVAL) ? OP_REGCRESET @@ -3351,7 +3403,7 @@ Perl_newSTATEOP(pTHX_ I32 flags, char *label, OP *o) cop->op_ppaddr = PL_ppaddr[ OP_NEXTSTATE ]; } cop->op_flags = flags; - cop->op_private = (PL_hints & HINT_UTF8); + cop->op_private = (PL_hints & HINT_BYTE); #ifdef NATIVE_HINTS cop->op_private |= NATIVE_HINTS; #endif @@ -3730,6 +3782,9 @@ Perl_newWHILEOP(pTHX_ I32 flags, I32 debuggable, LOOP *loop, I32 whileline, OP * if (!block) block = newOP(OP_NULL, 0); + else if (cont) { + block = scope(block); + } if (cont) next = LINKLIST(cont); @@ -4001,7 +4056,7 @@ S_cv_dump(pTHX_ CV *cv) if (SvPOK(pname[ix])) PerlIO_printf(Perl_debug_log, "\t%4d. 0x%"UVxf" (%s\"%s\" %"IVdf"-%"IVdf")\n", - ix, PTR2UV(ppad[ix]), + (int)ix, PTR2UV(ppad[ix]), SvFAKE(pname[ix]) ? "FAKE " : "", SvPVX(pname[ix]), (IV)I_32(SvNVX(pname[ix])), @@ -4029,8 +4084,7 @@ S_cv_clone2(pTHX_ CV *proto, CV *outside) assert(!CvUNIQUE(proto)); ENTER; - SAVEVPTR(PL_curpad); - SAVESPTR(PL_comppad); + SAVECOMPPAD(); SAVESPTR(PL_comppad_name); SAVESPTR(PL_compcv); @@ -4168,7 +4222,7 @@ Perl_cv_ckproto(pTHX_ CV *cv, GV *gv, char *p) gv_efullname3(name = sv_newmortal(), gv, Nullch); sv_setpv(msg, "Prototype mismatch:"); if (name) - Perl_sv_catpvf(aTHX_ msg, " sub %_", name); + Perl_sv_catpvf(aTHX_ msg, " sub %"SVf, name); if (SvPOK(cv)) Perl_sv_catpvf(aTHX_ msg, " (%s)", SvPVX(cv)); sv_catpv(msg, " vs "); @@ -4176,7 +4230,7 @@ Perl_cv_ckproto(pTHX_ CV *cv, GV *gv, char *p) Perl_sv_catpvf(aTHX_ msg, "(%s)", p); else sv_catpv(msg, "none"); - Perl_warner(aTHX_ WARN_UNSAFE, "%_", msg); + Perl_warner(aTHX_ WARN_UNSAFE, "%"SVf, msg); } } @@ -4251,14 +4305,26 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block) { dTHR; STRLEN n_a; - char *name = o ? SvPVx(cSVOPo->op_sv, n_a) : Nullch; - GV *gv = gv_fetchpv(name ? name : "__ANON__", - GV_ADDMULTI | ((block || attrs) ? 0 : GV_NOINIT), - SVt_PVCV); + char *name; + char *aname; + GV *gv; char *ps = proto ? SvPVx(((SVOP*)proto)->op_sv, n_a) : Nullch; register CV *cv=0; I32 ix; + name = o ? SvPVx(cSVOPo->op_sv, n_a) : Nullch; + if (!name && PERLDB_NAMEANON && CopLINE(PL_curcop)) { + SV *sv = sv_newmortal(); + Perl_sv_setpvf(aTHX_ sv, "__ANON__[%s:%"IVdf"]", + CopFILE(PL_curcop), (IV)CopLINE(PL_curcop)); + aname = SvPVX(sv); + } + else + aname = Nullch; + gv = gv_fetchpv(name ? name : (aname ? aname : "__ANON__"), + GV_ADDMULTI | ((block || attrs) ? 0 : GV_NOINIT), + SVt_PVCV); + if (o) SAVEFREEOP(o); if (proto) @@ -4310,7 +4376,8 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block) && !(CvGV(cv) && GvSTASH(CvGV(cv)) && HvNAME(GvSTASH(CvGV(cv))) && strEQ(HvNAME(GvSTASH(CvGV(cv))), - "autouse"))) { + "autouse"))) + { line_t oldline = CopLINE(PL_curcop); CopLINE_set(PL_curcop, PL_copline); Perl_warner(aTHX_ WARN_REDEFINE, @@ -4465,15 +4532,17 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block) } } - if (name) { + if (name || aname) { char *s; + char *tname = (name ? name : aname); if (PERLDB_SUBLINE && PL_curstash != PL_debstash) { SV *sv = NEWSV(0,0); SV *tmpstr = sv_newmortal(); GV *db_postponed = gv_fetchpv("DB::postponed", GV_ADDMULTI, SVt_PVHV); - CV *cv; + CV *pcv; HV *hv; + char *t; Perl_sv_setpvf(aTHX_ sv, "%s:%ld-%ld", CopFILE(PL_curcop), @@ -4482,21 +4551,22 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block) hv_store(GvHV(PL_DBsub), SvPVX(tmpstr), SvCUR(tmpstr), sv, 0); hv = GvHVn(db_postponed); if (HvFILL(hv) > 0 && hv_exists(hv, SvPVX(tmpstr), SvCUR(tmpstr)) - && (cv = GvCV(db_postponed))) { + && (pcv = GvCV(db_postponed))) + { dSP; PUSHMARK(SP); XPUSHs(tmpstr); PUTBACK; - call_sv((SV*)cv, G_DISCARD); + call_sv((SV*)pcv, G_DISCARD); } } - if ((s = strrchr(name,':'))) + if ((s = strrchr(tname,':'))) s++; else - s = name; + s = tname; - if (*s != 'B' && *s != 'E' && *s != 'S' && *s != 'I') + if (*s != 'B' && *s != 'E' && *s != 'C' && *s != 'I') goto done; if (strEQ(s, "BEGIN")) { @@ -4526,12 +4596,12 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block) 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(); + else if (strEQ(s, "CHECK") && !PL_error_count) { + if (!PL_checkav) + PL_checkav = newAV(); DEBUG_x( dump_sub(gv) ); - av_unshift(PL_stopav, 1); - av_store(PL_stopav, 0, SvREFCNT_inc(cv)); + av_unshift(PL_checkav, 1); + av_store(PL_checkav, 0, SvREFCNT_inc(cv)); GvCV(gv) = 0; } else if (strEQ(s, "INIT") && !PL_error_count) { @@ -4550,6 +4620,15 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block) } /* XXX unsafe for threads if eval_owner isn't held */ +/* +=for apidoc newCONSTSUB + +Creates a constant sub equivalent to Perl C<sub FOO () { 123 }> which is +eligible for inlining at compile-time. + +=cut +*/ + void Perl_newCONSTSUB(pTHX_ HV *stash, char *name, SV *sv) { @@ -4584,6 +4663,14 @@ Perl_newCONSTSUB(pTHX_ HV *stash, char *name, SV *sv) LEAVE; } +/* +=for apidoc U||newXS + +Used by C<xsubpp> to hook up XSUBs as Perl subs. + +=cut +*/ + CV * Perl_newXS(pTHX_ char *name, XSUBADDR_t subaddr, char *filename) { @@ -4642,7 +4729,7 @@ Perl_newXS(pTHX_ char *name, XSUBADDR_t subaddr, char *filename) else s = name; - if (*s != 'B' && *s != 'E' && *s != 'S' && *s != 'I') + if (*s != 'B' && *s != 'E' && *s != 'C' && *s != 'I') goto done; if (strEQ(s, "BEGIN")) { @@ -4658,11 +4745,11 @@ Perl_newXS(pTHX_ char *name, XSUBADDR_t subaddr, char *filename) 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)); + else if (strEQ(s, "CHECK")) { + if (!PL_checkav) + PL_checkav = newAV(); + av_unshift(PL_checkav, 1); + av_store(PL_checkav, 0, SvREFCNT_inc(cv)); GvCV(gv) = 0; } else if (strEQ(s, "INIT")) { @@ -5033,7 +5120,14 @@ Perl_ck_exists(pTHX_ OP *o) o = ck_fun(o); if (o->op_flags & OPf_KIDS) { OP *kid = cUNOPo->op_first; - if (kid->op_type == OP_AELEM) + if (kid->op_type == OP_ENTERSUB) { + (void) ref(kid, o->op_type); + if (kid->op_type != OP_RV2CV && !PL_error_count) + Perl_croak(aTHX_ "%s argument is not a subroutine name", + PL_op_desc[o->op_type]); + o->op_private |= OPpEXISTS_SUB; + } + else 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", @@ -5538,7 +5632,7 @@ Perl_ck_defined(pTHX_ OP *o) /* 19990527 MJD */ break; /* Globals via GV can be undef */ case OP_PADHV: Perl_warner(aTHX_ WARN_DEPRECATED, - "defined(%hash) is deprecated"); + "defined(%%hash) is deprecated"); Perl_warner(aTHX_ WARN_DEPRECATED, "(Maybe you should just omit the defined()?)\n"); break; @@ -6253,7 +6347,8 @@ Perl_peep(pTHX_ register OP *o) if (o->op_next->op_type == OP_RV2SV) { if (!(o->op_next->op_private & OPpDEREF)) { null(o->op_next); - o->op_private |= o->op_next->op_private & OPpLVAL_INTRO; + o->op_private |= o->op_next->op_private & (OPpLVAL_INTRO + | OPpOUR_INTRO); o->op_next = o->op_next->op_next; o->op_type = OP_GVSV; o->op_ppaddr = PL_ppaddr[OP_GVSV]; @@ -6338,8 +6433,10 @@ Perl_peep(pTHX_ register OP *o) line_t oldline = CopLINE(PL_curcop); 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"); + Perl_warner(aTHX_ WARN_EXEC, + "Statement unlikely to be reached"); + Perl_warner(aTHX_ WARN_EXEC, + "(Maybe you meant system() when you said exec()?)\n"); CopLINE_set(PL_curcop, oldline); } } @@ -1,6 +1,6 @@ /* op.h * - * Copyright (c) 1991-1999, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -52,6 +52,20 @@ typedef U32 PADOFFSET; ((op)->op_flags & OPf_WANT) == OPf_WANT_LIST ? G_ARRAY : \ dfl) +/* +=for apidoc Amn|U32|GIMME_V +The XSUB-writer's equivalent to Perl's C<wantarray>. Returns C<G_VOID>, +C<G_SCALAR> or C<G_ARRAY> for void, scalar or array context, +respectively. + +=for apidoc Amn|U32|GIMME +A backward-compatible version of C<GIMME_V> which can only return +C<G_SCALAR> or C<G_ARRAY>; in a void context, it returns C<G_SCALAR>. +Deprecated. Use C<GIMME_V> instead. + +=cut +*/ + #define GIMME_V OP_GIMME(PL_op, block_gimme()) /* Public flags */ @@ -77,6 +91,7 @@ typedef U32 PADOFFSET; /* On flipflop, we saw ... instead of .. */ /* On UNOPs, saw bare parens, e.g. eof(). */ /* On OP_ENTERSUB || OP_NULL, saw a "do". */ + /* On OP_EXISTS, treat av as av, not avhv. */ /* On OP_(ENTER|LEAVE)EVAL, don't clear $@ */ /* On OP_ENTERITER, loop var is per-thread */ /* On pushre, re is /\s+/ imp. by split " " */ @@ -84,6 +99,7 @@ typedef U32 PADOFFSET; /* old names; don't use in new code, but don't break them, either */ #define OPf_LIST OPf_WANT_LIST #define OPf_KNOW OPf_WANT + #define GIMME \ (PL_op->op_flags & OPf_WANT \ ? ((PL_op->op_flags & OPf_WANT) == OPf_WANT_LIST \ @@ -91,6 +107,9 @@ typedef U32 PADOFFSET; : G_SCALAR) \ : dowantarray()) +/* NOTE: OP_NEXTSTATE, OP_DBSTATE, and OP_SETSTATE (i.e. COPs) carry lower + * bits of PL_hints in op_private */ + /* Private for lvalues */ #define OPpLVAL_INTRO 128 /* Lvalue must be localized or lvalue sub */ @@ -136,7 +155,7 @@ typedef U32 PADOFFSET; #define OPpEARLY_CV 32 /* foo() called before sub foo was parsed */ /* OP_?ELEM only */ #define OPpLVAL_DEFER 16 /* Defer creation of array/hash elem */ - /* OP_RV2?V only */ + /* OP_RV2?V, OP_GVSV only */ #define OPpOUR_INTRO 16 /* Defer creation of array/hash elem */ /* for OP_RV2?V, lower bits carry hints (currently only HINT_STRICT_REFS) */ @@ -160,6 +179,9 @@ typedef U32 PADOFFSET; /* Private for OP_DELETE */ #define OPpSLICE 64 /* Operating on a list of keys */ +/* Private for OP_EXISTS */ +#define OPpEXISTS_SUB 64 /* Checking for &sub, not {} or []. */ + /* Private for OP_SORT, OP_PRTF, OP_SPRINTF, OP_FTTEXT, OP_FTBINARY, */ /* string comparisons, and case changers. */ #define OPpLOCALE 64 /* Use locale */ @@ -215,6 +237,7 @@ struct pmop { #define PMdf_USED 0x01 /* pm has been used once already */ #define PMdf_TAINTED 0x02 /* pm compiled from tainted pattern */ +#define PMdf_UTF8 0x04 /* pm compiled from utf8 data */ #define PMf_RETAINT 0x0001 /* taint $1 etc. if target tainted */ #define PMf_ONCE 0x0002 /* use pattern only once per reset */ diff --git a/os2/Makefile.SHs b/os2/Makefile.SHs index 005d7a92b6..3a50dc737c 100644 --- a/os2/Makefile.SHs +++ b/os2/Makefile.SHs @@ -41,7 +41,7 @@ CONFIG_ARGS = $config_args !GROK!THIS! $spitshell >>Makefile <<'!NO!SUBS!' -$(LIBPERL): perl.imp perl_dll perl5.def +$(LIBPERL): perl.imp $(PERL_DLL) perl5.def emximp -o $(LIBPERL) perl.imp $(AOUT_LIBPERL_DLL): perl.imp $(PERL_DLL) perl5.def @@ -96,9 +96,6 @@ perl.linkexp: perl.exports perl.map os2/os2.sym # We link miniperl statically, since .DLL depends on $(DYNALOADER) -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 diff --git a/patchlevel.h b/patchlevel.h index 9670081a00..3c6f5a7c92 100644 --- a/patchlevel.h +++ b/patchlevel.h @@ -5,20 +5,24 @@ #define PERL_REVISION 5 /* age */ #define PERL_VERSION 5 /* epoch */ -#define PERL_SUBVERSION 640 /* generation */ +#define PERL_SUBVERSION 650 /* 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. + Note that this only refers to an out-of-the-box build. Many non-default + options such as usemultiplicity tend to break binary compatibility + more often. + 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. */ +#define PERL_API_SUBVERSION 0 /* Adjust manually as needed. */ /* XXX Note: The selection of non-default Configure options, such as -Duselonglong may invalidate these settings. Currently, Configure @@ -1,6 +1,6 @@ /* perl.c * - * Copyright (c) 1987-1999 Larry Wall + * Copyright (c) 1987-2000 Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -86,6 +86,15 @@ perl_alloc_using(struct IPerlMem* ipM, struct IPerlMem* ipMS, return my_perl; } #else + +/* +=for apidoc perl_alloc + +Allocates a new Perl interpreter. See L<perlembed>. + +=cut +*/ + PerlInterpreter * perl_alloc(void) { @@ -99,6 +108,14 @@ perl_alloc(void) } #endif /* PERL_IMPLICIT_SYS */ +/* +=for apidoc perl_construct + +Initializes a new Perl interpreter. See L<perlembed>. + +=cut +*/ + void perl_construct(pTHXx) { @@ -239,6 +256,14 @@ perl_construct(pTHXx) ENTER; } +/* +=for apidoc perl_destruct + +Shuts down a Perl interpreter. See L<perlembed>. + +=cut +*/ + void perl_destruct(pTHXx) { @@ -453,11 +478,11 @@ perl_destruct(pTHXx) /* startup and shutdown function lists */ SvREFCNT_dec(PL_beginav); SvREFCNT_dec(PL_endav); - SvREFCNT_dec(PL_stopav); + SvREFCNT_dec(PL_checkav); SvREFCNT_dec(PL_initav); PL_beginav = Nullav; PL_endav = Nullav; - PL_stopav = Nullav; + PL_checkav = Nullav; PL_initav = Nullav; /* shortcuts just get cleared */ @@ -664,6 +689,14 @@ perl_destruct(pTHXx) } } +/* +=for apidoc perl_free + +Releases a Perl interpreter. See L<perlembed>. + +=cut +*/ + void perl_free(pTHXx) { @@ -683,6 +716,14 @@ Perl_call_atexit(pTHX_ ATEXIT_t fn, void *ptr) ++PL_exitlistlen; } +/* +=for apidoc perl_parse + +Tells a Perl interpreter to parse a Perl script. See L<perlembed>. + +=cut +*/ + int perl_parse(pTHXx_ XSINIT_t xsinit, int argc, char **argv, char **env) { @@ -742,8 +783,8 @@ setuid perl scripts securely.\n"); env, xsinit); switch (ret) { case 0: - if (PL_stopav) - call_list(oldscope, PL_stopav); + if (PL_checkav) + call_list(oldscope, PL_checkav); return 0; case 1: STATUS_ALL_FAILURE; @@ -754,8 +795,8 @@ setuid perl scripts securely.\n"); LEAVE; FREETMPS; PL_curstash = PL_defstash; - if (PL_stopav) - call_list(oldscope, PL_stopav); + if (PL_checkav) + call_list(oldscope, PL_checkav); return STATUS_NATIVE_EXPORT; case 3: PerlIO_printf(Perl_error_log, "panic: top_env\n"); @@ -804,6 +845,7 @@ S_parse_body(pTHX_ va_list args) #endif case ' ': case '0': + case 'C': case 'F': case 'a': case 'c': @@ -1152,6 +1194,14 @@ print \" \\@INC:\\n @INC\\n\";"); return NULL; } +/* +=for apidoc perl_run + +Tells a Perl interpreter to run. See L<perlembed>. + +=cut +*/ + int perl_run(pTHXx) { @@ -1241,6 +1291,16 @@ S_run_body(pTHX_ va_list args) return NULL; } +/* +=for apidoc p||get_sv + +Returns the SV of the specified Perl scalar. If C<create> is set and the +Perl variable does not exist then it will be created. If C<create> is not +set and the variable does not exist then NULL is returned. + +=cut +*/ + SV* Perl_get_sv(pTHX_ const char *name, I32 create) { @@ -1260,6 +1320,16 @@ Perl_get_sv(pTHX_ const char *name, I32 create) return Nullsv; } +/* +=for apidoc p||get_av + +Returns the AV of the specified Perl array. If C<create> is set and the +Perl variable does not exist then it will be created. If C<create> is not +set and the variable does not exist then NULL is returned. + +=cut +*/ + AV* Perl_get_av(pTHX_ const char *name, I32 create) { @@ -1271,6 +1341,16 @@ Perl_get_av(pTHX_ const char *name, I32 create) return Nullav; } +/* +=for apidoc p||get_hv + +Returns the HV of the specified Perl hash. If C<create> is set and the +Perl variable does not exist then it will be created. If C<create> is not +set and the variable does not exist then NULL is returned. + +=cut +*/ + HV* Perl_get_hv(pTHX_ const char *name, I32 create) { @@ -1282,6 +1362,17 @@ Perl_get_hv(pTHX_ const char *name, I32 create) return Nullhv; } +/* +=for apidoc p||get_cv + +Returns the CV of the specified Perl subroutine. If C<create> is set and +the Perl subroutine does not exist then it will be declared (which has the +same effect as saying C<sub name;>). If C<create> is not set and the +subroutine does not exist then NULL is returned. + +=cut +*/ + CV* Perl_get_cv(pTHX_ const char *name, I32 create) { @@ -1302,6 +1393,14 @@ Perl_get_cv(pTHX_ const char *name, I32 create) /* Be sure to refetch the stack pointer after calling these routines. */ +/* +=for apidoc p||call_argv + +Performs a callback to the specified Perl sub. See L<perlcall>. + +=cut +*/ + I32 Perl_call_argv(pTHX_ const char *sub_name, I32 flags, register char **argv) @@ -1321,6 +1420,14 @@ Perl_call_argv(pTHX_ const char *sub_name, I32 flags, register char **argv) return call_pv(sub_name, flags); } +/* +=for apidoc p||call_pv + +Performs a callback to the specified Perl sub. See L<perlcall>. + +=cut +*/ + I32 Perl_call_pv(pTHX_ const char *sub_name, I32 flags) /* name of the subroutine */ @@ -1329,6 +1436,15 @@ Perl_call_pv(pTHX_ const char *sub_name, I32 flags) return call_sv((SV*)get_cv(sub_name, TRUE), flags); } +/* +=for apidoc p||call_method + +Performs a callback to the specified Perl method. The blessed object must +be on the stack. See L<perlcall>. + +=cut +*/ + I32 Perl_call_method(pTHX_ const char *methname, I32 flags) /* name of the subroutine */ @@ -1347,6 +1463,15 @@ Perl_call_method(pTHX_ const char *methname, I32 flags) } /* May be called with any of a CV, a GV, or an SV containing the name. */ +/* +=for apidoc p||call_sv + +Performs a callback to the Perl sub whose name is in the SV. See +L<perlcall>. + +=cut +*/ + I32 Perl_call_sv(pTHX_ SV *sv, I32 flags) @@ -1509,6 +1634,14 @@ S_call_xbody(pTHX_ OP *myop, int is_eval) /* Eval a string. The G_EVAL flag is always assumed. */ +/* +=for apidoc p||eval_sv + +Tells Perl to C<eval> the string in the SV. + +=cut +*/ + I32 Perl_eval_sv(pTHX_ SV *sv, I32 flags) @@ -1591,6 +1724,14 @@ Perl_eval_sv(pTHX_ SV *sv, I32 flags) return retval; } +/* +=for apidoc p||eval_pv + +Tells Perl to C<eval> the given string and return an SV* result. + +=cut +*/ + SV* Perl_eval_pv(pTHX_ const char *p, I32 croak_on_error) { @@ -1615,6 +1756,14 @@ Perl_eval_pv(pTHX_ const char *p, I32 croak_on_error) /* Require a module. */ +/* +=for apidoc p||require_pv + +Tells Perl to C<require> a module. + +=cut +*/ + void Perl_require_pv(pTHX_ const char *pv) { @@ -1649,6 +1798,7 @@ S_usage(pTHX_ char *name) /* XXX move this out into a module ? */ static char *usage_msg[] = { "-0[octal] specify record separator (\\0, if no argument)", "-a autosplit mode with -n or -p (splits $_ into @F)", +"-C enable native wide character system interfaces", "-c check syntax only (runs BEGIN and END blocks)", "-d[:debugger] run program under debugger", "-D[number/list] set debugging flags (argument is a bit mask or alphabets)", @@ -1704,6 +1854,10 @@ Perl_moreswitches(pTHX_ char *s) } return s + numlen; } + case 'C': + PL_widesyscalls = TRUE; + s++; + return s; case 'F': PL_minus_F = TRUE; PL_splitstr = savepv(s + 1); @@ -1880,15 +2034,15 @@ Perl_moreswitches(pTHX_ char *s) s++; return s; case 'v': - printf("\nThis is perl, v%"UVuf".%"UVuf".%"UVuf" built for %s", - (UV)PERL_REVISION, (UV)PERL_VERSION, (UV)PERL_SUBVERSION, ARCHNAME); + printf(Perl_form(aTHX_ "\nThis is perl, v%v built for %s", + PL_patchlevel, ARCHNAME)); #if defined(LOCAL_PATCH_COUNT) if (LOCAL_PATCH_COUNT > 0) printf("\n(with %d registered patch%s, see perl -V for more detail)", (int)LOCAL_PATCH_COUNT, (LOCAL_PATCH_COUNT!=1) ? "es" : ""); #endif - printf("\n\nCopyright 1987-1999, Larry Wall\n"); + printf("\n\nCopyright 1987-2000, Larry Wall\n"); #ifdef MSDOS printf("\nMS-DOS port Copyright (c) 1989, 1990, Diomidis Spinellis\n"); #endif @@ -2194,7 +2348,7 @@ sed %s -e \"/^[^#]/b\" \ -e \"/^#[ ]*undef[ ]/b\" \ -e \"/^#[ ]*endif/b\" \ -e \"s/^#.*//\" \ - %s | %_ -C %_ %s", + %s | %"SVf" -C %"SVf" %s", (PL_doextract ? "-e \"1,/^#/d\n\"" : ""), #else # ifdef __OPEN_VM @@ -2210,7 +2364,7 @@ sed %s -e \"/^[^#]/b\" \ -e '/^#[ ]*undef[ ]/b' \ -e '/^#[ ]*endif/b' \ -e 's/^[ ]*#.*//' \ - %s | %_ %_ %s", + %s | %"SVf" %"SVf" %s", # else Perl_sv_setpvf(aTHX_ cmd, "\ %s %s -e '/^[^#]/b' \ @@ -2224,7 +2378,7 @@ sed %s -e \"/^[^#]/b\" \ -e '/^#[ ]*undef[ ]/b' \ -e '/^#[ ]*endif/b' \ -e 's/^[ ]*#.*//' \ - %s | %_ -C %_ %s", + %s | %"SVf" -C %"SVf" %s", # endif #ifdef LOC_SED LOC_SED, @@ -2965,14 +3119,21 @@ S_init_perllib(pTHX) incpush(PRIVLIB_EXP, FALSE); #endif -#ifdef SITEARCH_EXP - incpush(SITEARCH_EXP, FALSE); -#endif -#ifdef SITELIB_EXP -#if defined(WIN32) - incpush(SITELIB_EXP, TRUE); +#if defined(WIN32) + incpush(SITELIB_EXP, TRUE); /* XXX Win32 needs inc_version_list support */ #else - incpush(SITELIB_EXP, FALSE); +#ifdef SITELIB_EXP + { + char *path = SITELIB_EXP; + + if (path) { + char buf[1024]; + strcpy(buf,path); + if (strrchr(buf,'/')) /* XXX Hack, Configure var needed */ + *strrchr(buf,'/') = '\0'; + incpush(buf, TRUE); + } + } #endif #endif #if defined(PERL_VENDORLIB_EXP) @@ -3038,6 +3199,11 @@ S_incpush(pTHX_ char *p, int addsubdirs) * archname-specific sub-directories. */ if (addsubdirs) { +#ifdef PERL_INC_VERSION_LIST + /* Configure terminates PERL_INC_VERSION_LIST with a NULL */ + const char *incverlist[] = { PERL_INC_VERSION_LIST }; + const char **incver; +#endif struct stat tmpstatbuf; #ifdef VMS char *unix; @@ -3053,21 +3219,37 @@ S_incpush(pTHX_ char *p, int addsubdirs) "Failed to unixify @INC element \"%s\"\n", SvPV(libdir,len)); #endif - /* .../archname/version if -d .../archname/version/auto */ - Perl_sv_setpvf(aTHX_ subdir, "%_/%s/"PERL_FS_VER_FMT"/auto", libdir, - ARCHNAME, (int)PERL_REVISION, - (int)PERL_VERSION, (int)PERL_SUBVERSION); + /* .../version/archname if -d .../version/archname */ + Perl_sv_setpvf(aTHX_ subdir, "%"SVf"/"PERL_FS_VER_FMT"/%s", libdir, + (int)PERL_REVISION, (int)PERL_VERSION, + (int)PERL_SUBVERSION, ARCHNAME); + if (PerlLIO_stat(SvPVX(subdir), &tmpstatbuf) >= 0 && + S_ISDIR(tmpstatbuf.st_mode)) + av_push(GvAVn(PL_incgv), newSVsv(subdir)); + + /* .../version if -d .../version */ + Perl_sv_setpvf(aTHX_ subdir, "%"SVf"/"PERL_FS_VER_FMT, libdir, + (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")); + av_push(GvAVn(PL_incgv), newSVsv(subdir)); - /* .../archname if -d .../archname/auto */ - Perl_sv_setpvf(aTHX_ subdir, "%_/%s/auto", libdir, ARCHNAME); + /* .../archname if -d .../archname */ + Perl_sv_setpvf(aTHX_ subdir, "%"SVf"/%s", libdir, ARCHNAME); if (PerlLIO_stat(SvPVX(subdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode)) - av_push(GvAVn(PL_incgv), - newSVpvn(SvPVX(subdir), SvCUR(subdir) - sizeof "auto")); + av_push(GvAVn(PL_incgv), newSVsv(subdir)); + +#ifdef PERL_INC_VERSION_LIST + for (incver = incverlist; *incver; incver++) { + /* .../xxx if -d .../xxx */ + Perl_sv_setpvf(aTHX_ subdir, "%"SVf"/%s", libdir, *incver); + if (PerlLIO_stat(SvPVX(subdir), &tmpstatbuf) >= 0 && + S_ISDIR(tmpstatbuf.st_mode)) + av_push(GvAVn(PL_incgv), newSVsv(subdir)); + } +#endif } /* finally push this lib directory on the end of @INC */ @@ -3180,7 +3362,7 @@ Perl_call_list(pTHX_ I32 oldscope, AV *paramList) else Perl_sv_catpvf(aTHX_ atsv, "%s failed--call queue aborted", - paramList == PL_stopav ? "STOP" + paramList == PL_checkav ? "CHECK" : paramList == PL_initav ? "INIT" : "END"); while (PL_scopestack_ix > oldscope) @@ -3204,7 +3386,7 @@ Perl_call_list(pTHX_ I32 oldscope, AV *paramList) Perl_croak(aTHX_ "BEGIN failed--compilation aborted"); else Perl_croak(aTHX_ "%s failed--call queue aborted", - paramList == PL_stopav ? "STOP" + paramList == PL_checkav ? "CHECK" : paramList == PL_initav ? "INIT" : "END"); } @@ -1,6 +1,6 @@ /* perl.h * - * Copyright (c) 1987-1997, Larry Wall + * Copyright (c) 1987-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -37,6 +37,12 @@ /* See L<perlguts/"The Perl API"> for detailed notes on * PERL_IMPLICIT_CONTEXT and PERL_IMPLICIT_SYS */ +#ifdef USE_ITHREADS +# if !defined(MULTIPLICITY) && !defined(PERL_OBJECT) +# define MULTIPLICITY +# endif +#endif + #ifdef USE_THREADS # ifndef PERL_IMPLICIT_CONTEXT # define PERL_IMPLICIT_CONTEXT @@ -71,10 +77,6 @@ # 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 @@ -189,6 +191,10 @@ struct perl_thread; # define dTHX dTHXa(PERL_GET_THX) # define pTHX_ pTHX, # define aTHX_ aTHX, +# define pTHX_1 2 +# define pTHX_2 3 +# define pTHX_3 4 +# define pTHX_4 5 #endif #define STATIC static @@ -221,6 +227,10 @@ struct perl_thread; # define aTHX_ # define dTHXa(a) dNOOP # define dTHX dNOOP +# define pTHX_1 1 +# define pTHX_2 2 +# define pTHX_3 3 +# define pTHX_4 4 #endif #ifndef pTHXo @@ -1674,6 +1684,14 @@ typedef pthread_key_t perl_key; # endif #endif +#ifndef SVf +# ifdef CHECK_FORMAT +# define SVf "p" +# else +# define SVf "_" +# endif +#endif + /* Some unistd.h's give a prototype for pause() even though HAS_PAUSE ends up undefined. This causes the #define below to be rejected by the compmiler. Sigh. @@ -1694,7 +1712,7 @@ typedef pthread_key_t perl_key; # endif #endif -#if defined(CYGWIN) +#if defined(__CYGWIN__) /* USEMYBINMODE * This symbol, if defined, indicates that the program should * use the routine my_binmode(FILE *fp, char iotype) to insure @@ -2024,7 +2042,7 @@ char *crypt (const char*, const char*); # ifndef getenv char *getenv (const char*); # endif /* !getenv */ -#ifndef EPOC +#if !defined(EPOC) && !(defined(__hpux) && defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64) Off_t lseek (int,Off_t,int); #endif # endif /* !DONT_DECLARE_STD */ @@ -2447,8 +2465,8 @@ enum { /* pass one of these to get_vtbl */ #define HINT_INTEGER 0x00000001 #define HINT_STRICT_REFS 0x00000002 /* #define HINT_notused4 0x00000004 */ -#define HINT_UTF8 0x00000008 -#define HINT_BYTE 0x00000010 +#define HINT_BYTE 0x00000008 +/* #define HINT_notused10 0x00000010 */ /* Note: 20,40,80 used for NATIVE_HINTS */ #define HINT_BLOCK_SCOPE 0x00000100 @@ -2467,6 +2485,7 @@ enum { /* pass one of these to get_vtbl */ #define HINT_RE_EVAL 0x00200000 #define HINT_FILETEST_ACCESS 0x00400000 +#define HINT_UTF8 0x00800000 /* Various states of an input record separator SV (rs, nrs) */ #define RsSNARF(sv) (! SvOK(sv)) @@ -2931,16 +2950,22 @@ typedef struct am_table_short AMTS; # endif #endif /* _FASTMATH */ -#define PERLDB_ALL 0x3f /* No _NONAME, _GOTO */ -#define PERLDBf_SUB 0x01 /* Debug sub enter/exit. */ -#define PERLDBf_LINE 0x02 /* Keep line #. */ -#define PERLDBf_NOOPT 0x04 /* Switch off optimizations. */ -#define PERLDBf_INTER 0x08 /* Preserve more data for - later inspections. */ -#define PERLDBf_SUBLINE 0x10 /* Keep subr source lines. */ -#define PERLDBf_SINGLE 0x20 /* Start with single-step on. */ -#define PERLDBf_NONAME 0x40 /* For _SUB: no name of the subr. */ -#define PERLDBf_GOTO 0x80 /* Report goto: call DB::goto. */ +#define PERLDB_ALL (PERLDBf_SUB | PERLDBf_LINE | \ + PERLDBf_NOOPT | PERLDBf_INTER | \ + PERLDBf_SUBLINE| PERLDBf_SINGLE| \ + PERLDBf_NAMEEVAL| PERLDBf_NAMEANON) + /* No _NONAME, _GOTO */ +#define PERLDBf_SUB 0x01 /* Debug sub enter/exit */ +#define PERLDBf_LINE 0x02 /* Keep line # */ +#define PERLDBf_NOOPT 0x04 /* Switch off optimizations */ +#define PERLDBf_INTER 0x08 /* Preserve more data for + later inspections */ +#define PERLDBf_SUBLINE 0x10 /* Keep subr source lines */ +#define PERLDBf_SINGLE 0x20 /* Start with single-step on */ +#define PERLDBf_NONAME 0x40 /* For _SUB: no name of the subr */ +#define PERLDBf_GOTO 0x80 /* Report goto: call DB::goto */ +#define PERLDBf_NAMEEVAL 0x100 /* Informative names for evals */ +#define PERLDBf_NAMEANON 0x200 /* Informative names for anon subs */ #define PERLDB_SUB (PL_perldb && (PL_perldb & PERLDBf_SUB)) #define PERLDB_LINE (PL_perldb && (PL_perldb & PERLDBf_LINE)) @@ -2950,6 +2975,8 @@ typedef struct am_table_short AMTS; #define PERLDB_SINGLE (PL_perldb && (PL_perldb & PERLDBf_SINGLE)) #define PERLDB_SUB_NN (PL_perldb && (PL_perldb & (PERLDBf_NONAME))) #define PERLDB_GOTO (PL_perldb && (PL_perldb & PERLDBf_GOTO)) +#define PERLDB_NAMEEVAL (PL_perldb && (PL_perldb & PERLDBf_NAMEEVAL)) +#define PERLDB_NAMEANON (PL_perldb && (PL_perldb & PERLDBf_NAMEANON)) #ifdef USE_LOCALE_NUMERIC @@ -2985,7 +3012,7 @@ typedef struct am_table_short AMTS; #endif /* !USE_LOCALE_NUMERIC */ -#if !defined(Atol) && defined(USE_LONG_LONG) && defined(HAS_LONG_LONG) +#if !defined(Atol) && defined(HAS_LONG_LONG) # if !defined(Atol) && defined(HAS_STRTOLL) # define Atol(s) strtoll(s, (char**)NULL, 10) # endif @@ -2998,8 +3025,7 @@ typedef struct am_table_short AMTS; # define Atol atol /* we assume atol being available anywhere */ #endif -#if !defined(Strtoul) && defined(USE_LONG_LONG) && defined(HAS_LONG_LONG) \ - && defined(HAS_STRTOULL) +#if !defined(Strtoul) && defined(HAS_LONG_LONG) && defined(HAS_STRTOULL) # define Strtoul strtoull #endif /* is there atouq() anywhere? */ @@ -3142,4 +3168,12 @@ typedef struct am_table_short AMTS; #include "patchlevel.h" #undef PERL_PATCHLEVEL_H_IMPLICIT +/* Mention + + NV_PRESERVES_UV + HAS_ICONV + I_ICONV + + so that Configure picks them up. */ + #endif /* Include guard */ @@ -1,6 +1,6 @@ /* perlio.c * - * Copyright (c) 1996-1999, Nick Ing-Simmons + * Copyright (c) 1996-2000, Nick Ing-Simmons * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -1826,7 +1826,7 @@ case 59: #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, "STOP") || strEQ(name, "INIT")) + || strEQ(name, "INIT") || strEQ(name, "CHECK")) CvSPECIAL_on(PL_compcv); yyval.opval = yyvsp[0].opval; } break; @@ -1,6 +1,6 @@ /* perly.y * - * Copyright (c) 1991-1997, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -337,7 +337,7 @@ startformsub: /* NULL */ /* start a format subroutine scope */ subname : WORD { STRLEN n_a; char *name = SvPV(((SVOP*)$1)->op_sv,n_a); if (strEQ(name, "BEGIN") || strEQ(name, "END") - || strEQ(name, "STOP") || strEQ(name, "INIT")) + || strEQ(name, "INIT") || strEQ(name, "CHECK")) CvSPECIAL_on(PL_compcv); $$ = $1; } ; diff --git a/pod/Makefile b/pod/Makefile index 3aadd9efc6..8199390e63 100644 --- a/pod/Makefile +++ b/pod/Makefile @@ -62,6 +62,8 @@ POD = \ perlcall.pod \ perlcompile.pod \ perltodo.pod \ + perlapi.pod \ + perlintern.pod \ perlhack.pod \ perlhist.pod \ perlfaq.pod \ @@ -124,6 +126,8 @@ MAN = \ perlcall.man \ perlcompile.man \ perltodo.man \ + perlapi.man \ + perlintern.man \ perlhack.man \ perlhist.man \ perlfaq.man \ @@ -186,6 +190,8 @@ HTML = \ perlcall.html \ perlcompile.html \ perltodo.html \ + perlapi.html \ + perlintern.html \ perlhack.html \ perlhist.html \ perlfaq.html \ @@ -248,6 +254,8 @@ TEX = \ perlcall.tex \ perlcompile.tex \ perltodo.tex \ + perlapi.tex \ + perlintern.tex \ perlhack.tex \ perlhist.tex \ perlfaq.tex \ diff --git a/pod/buildtoc b/pod/buildtoc index 41cb76dcb5..f158cbaebb 100644 --- a/pod/buildtoc +++ b/pod/buildtoc @@ -14,7 +14,7 @@ sub output ($); perldbmfilter perldebug perldiag perlsec perltrap perlport perlstyle perlpod perlbook perlembed perlapio perlxs perlxstut perlguts perlcall perlcompile - perlhist + perlapi perlintern perlhist ); for (@pods) { s/$/.pod/ } @@ -114,6 +114,8 @@ podset( @modules[ sort { $modname[$a] cmp $modname[$b] } 0 .. $#modules ] ); Here should be listed all the extra programs' documentation, but they don't all have manual pages yet: + =over + =item a2p =item s2p @@ -132,6 +134,7 @@ podset( @modules[ sort { $modname[$a] cmp $modname[$b] } 0 .. $#modules ] ); =item wrapsuid + =back =head1 AUTHOR @@ -150,8 +153,7 @@ sub podset { while(<>) { if (s/^=head1 (NAME)\s*/=head2 /) { $pod = path2modname($ARGV); - unitem(); - unhead2(); + unhead1(); output "\n \n\n=head2 "; $_ = <>; if ( /^\s*$pod\b/ ) { @@ -164,7 +166,9 @@ sub podset { next; } if (s/^=head1 (.*)/=item $1/) { - unitem(); unhead2(); + unhead2(); + output "=over\n\n" unless $inhead1; + $inhead1 = 1; output $_; nl(); next; } if (s/^=head2 (.*)/=item $1/) { @@ -172,7 +176,6 @@ sub podset { output "=over\n\n" unless $inhead2; $inhead2 = 1; output $_; nl(); next; - } if (s/^=item ([^=].*)\n/$1/) { next if $pod eq 'perldiag'; @@ -188,6 +191,10 @@ sub podset { s/^-X\b/-I<X>/; output $_; next; } + if (s/^=cut\s*\n//) { + unhead1(); + next; + } } } @@ -200,12 +207,20 @@ sub path2modname { return $_; } +sub unhead1 { + unhead2(); + if ($inhead1) { + output "\n\n=back\n\n"; + } + $inhead1 = 0; +} + sub unhead2 { + unitem(); if ($inhead2) { output "\n\n=back\n\n"; } $inhead2 = 0; - $initem = 0; } sub unitem { diff --git a/pod/perl.pod b/pod/perl.pod index 9b5db8250c..d52aff30fa 100644 --- a/pod/perl.pod +++ b/pod/perl.pod @@ -68,6 +68,8 @@ sections: perlxstut Perl XS tutorial perlguts Perl internal functions for those doing extensions perlcall Perl calling conventions from C + perlapi Perl API listing (autogenerated) + perlintern Perl internal functions (autogenerated) perltodo Perl things to do perlhack Perl hackers guide diff --git a/pod/perlapi.pod b/pod/perlapi.pod new file mode 100644 index 0000000000..e6191c0a41 --- /dev/null +++ b/pod/perlapi.pod @@ -0,0 +1,2225 @@ +=head1 NAME + +perlapi - autogenerated documentation for the perl public API + +=head1 DESCRIPTION + +This file contains the documentation of the perl public API generated by +embed.pl, specifically a listing of functions, macros, flags, and variables +that may be used by extension writers. The interfaces of any functions that +are not listed here are subject to change without notice. For this reason, +blindly using functions listed in proto.h is to be avoided when writing +extensions. + +Note that all Perl API global variables must be referenced with the C<PL_> +prefix. Some macros are provided for compatibility with the older, +unadorned names, but this support may be disabled in a future release. + +The listing is alphabetical, case insensitive. + +=over 8 + +=item AvFILL + +Same as C<av_len()>. Deprecated, use C<av_len()> instead. + + int AvFILL(AV* av) + +=item av_clear + +Clears an array, making it empty. Does not free the memory used by the +array itself. + + void av_clear(AV* ar) + +=item av_extend + +Pre-extend an array. The C<key> is the index to which the array should be +extended. + + void av_extend(AV* ar, I32 key) + +=item av_fetch + +Returns the SV at the specified index in the array. The C<key> is the +index. If C<lval> is set then the fetch will be part of a store. Check +that the return value is non-null before dereferencing it to a C<SV*>. + +See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for +more information on how to use this function on tied arrays. + + SV** av_fetch(AV* ar, I32 key, I32 lval) + +=item av_len + +Returns the highest index in the array. Returns -1 if the array is +empty. + + I32 av_len(AV* ar) + +=item av_make + +Creates a new AV and populates it with a list of SVs. The SVs are copied +into the array, so they may be freed after the call to av_make. The new AV +will have a reference count of 1. + + AV* av_make(I32 size, SV** svp) + +=item av_pop + +Pops an SV off the end of the array. Returns C<&PL_sv_undef> if the array +is empty. + + SV* av_pop(AV* ar) + +=item av_push + +Pushes an SV onto the end of the array. The array will grow automatically +to accommodate the addition. + + void av_push(AV* ar, SV* val) + +=item av_shift + +Shifts an SV off the beginning of the array. + + SV* av_shift(AV* ar) + +=item av_store + +Stores an SV in an array. The array index is specified as C<key>. The +return value will be NULL if the operation failed or if the value did not +need to be actually stored within the array (as in the case of tied +arrays). Otherwise it can be dereferenced to get the original C<SV*>. Note +that the caller is responsible for suitably incrementing the reference +count of C<val> before the call, and decrementing it if the function +returned NULL. + +See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for +more information on how to use this function on tied arrays. + + SV** av_store(AV* ar, I32 key, SV* val) + +=item av_undef + +Undefines the array. Frees the memory used by the array itself. + + void av_undef(AV* ar) + +=item av_unshift + +Unshift the given number of C<undef> values onto the beginning of the +array. The array will grow automatically to accommodate the addition. You +must then use C<av_store> to assign values to these new elements. + + void av_unshift(AV* ar, I32 num) + +=item call_argv + +Performs a callback to the specified Perl sub. See L<perlcall>. + +NOTE: the perl_ form of this function is deprecated. + + I32 call_argv(const char* sub_name, I32 flags, char** argv) + +=item call_method + +Performs a callback to the specified Perl method. The blessed object must +be on the stack. See L<perlcall>. + +NOTE: the perl_ form of this function is deprecated. + + I32 call_method(const char* methname, I32 flags) + +=item call_pv + +Performs a callback to the specified Perl sub. See L<perlcall>. + +NOTE: the perl_ form of this function is deprecated. + + I32 call_pv(const char* sub_name, I32 flags) + +=item call_sv + +Performs a callback to the Perl sub whose name is in the SV. See +L<perlcall>. + +NOTE: the perl_ form of this function is deprecated. + + I32 call_sv(SV* sv, I32 flags) + +=item CLASS + +Variable which is setup by C<xsubpp> to indicate the +class name for a C++ XS constructor. This is always a C<char*>. See C<THIS>. + + char* CLASS + +=item Copy + +The XSUB-writer's interface to the C C<memcpy> function. The C<src> is the +source, C<dest> is the destination, C<nitems> is the number of items, and C<type> is +the type. May fail on overlapping copies. See also C<Move>. + + void Copy(void* src, void* dest, int nitems, type) + +=item croak + +This is the XSUB-writer's interface to Perl's C<die> function. Use this +function the same way you use the C C<printf> function. See +C<warn>. + + void croak(const char* pat, ...) + +=item CvSTASH + +Returns the stash of the CV. + + HV* CvSTASH(CV* cv) + +=item dMARK + +Declare a stack marker variable, C<mark>, for the XSUB. See C<MARK> and +C<dORIGMARK>. + + dMARK; + +=item dORIGMARK + +Saves the original stack mark for the XSUB. See C<ORIGMARK>. + + dORIGMARK; + +=item dSP + +Declares a local copy of perl's stack pointer for the XSUB, available via +the C<SP> macro. See C<SP>. + + dSP; + +=item dXSARGS + +Sets up stack and mark pointers for an XSUB, calling dSP and dMARK. This +is usually handled automatically by C<xsubpp>. Declares the C<items> +variable to indicate the number of items on the stack. + + dXSARGS; + +=item dXSI32 + +Sets up the C<ix> variable for an XSUB which has aliases. This is usually +handled automatically by C<xsubpp>. + + dXSI32; + +=item ENTER + +Opening bracket on a callback. See C<LEAVE> and L<perlcall>. + + ENTER; + +=item eval_pv + +Tells Perl to C<eval> the given string and return an SV* result. + +NOTE: the perl_ form of this function is deprecated. + + SV* eval_pv(const char* p, I32 croak_on_error) + +=item eval_sv + +Tells Perl to C<eval> the string in the SV. + +NOTE: the perl_ form of this function is deprecated. + + I32 eval_sv(SV* sv, I32 flags) + +=item EXTEND + +Used to extend the argument stack for an XSUB's return values. Once +used, guarrantees that there is room for at least C<nitems> to be pushed +onto the stack. + + void EXTEND(SP, int nitems) + +=item fbm_compile + +Analyses the string in order to make fast searches on it using fbm_instr() +-- the Boyer-Moore algorithm. + + void fbm_compile(SV* sv, U32 flags) + +=item fbm_instr + +Returns the location of the SV in the string delimited by C<str> and +C<strend>. It returns C<Nullch> if the string can't be found. The C<sv> +does not have to be fbm_compiled, but the search will not be as fast +then. + + char* fbm_instr(unsigned char* big, unsigned char* bigend, SV* littlesv, U32 flags) + +=item FREETMPS + +Closing bracket for temporaries on a callback. See C<SAVETMPS> and +L<perlcall>. + + FREETMPS; + +=item get_av + +Returns the AV of the specified Perl array. If C<create> is set and the +Perl variable does not exist then it will be created. If C<create> is not +set and the variable does not exist then NULL is returned. + +NOTE: the perl_ form of this function is deprecated. + + AV* get_av(const char* name, I32 create) + +=item get_cv + +Returns the CV of the specified Perl subroutine. If C<create> is set and +the Perl subroutine does not exist then it will be declared (which has the +same effect as saying C<sub name;>). If C<create> is not set and the +subroutine does not exist then NULL is returned. + +NOTE: the perl_ form of this function is deprecated. + + CV* get_cv(const char* name, I32 create) + +=item get_hv + +Returns the HV of the specified Perl hash. If C<create> is set and the +Perl variable does not exist then it will be created. If C<create> is not +set and the variable does not exist then NULL is returned. + +NOTE: the perl_ form of this function is deprecated. + + HV* get_hv(const char* name, I32 create) + +=item get_sv + +Returns the SV of the specified Perl scalar. If C<create> is set and the +Perl variable does not exist then it will be created. If C<create> is not +set and the variable does not exist then NULL is returned. + +NOTE: the perl_ form of this function is deprecated. + + SV* get_sv(const char* name, I32 create) + +=item GIMME + +A backward-compatible version of C<GIMME_V> which can only return +C<G_SCALAR> or C<G_ARRAY>; in a void context, it returns C<G_SCALAR>. +Deprecated. Use C<GIMME_V> instead. + + U32 GIMME + +=item GIMME_V + +The XSUB-writer's equivalent to Perl's C<wantarray>. Returns C<G_VOID>, +C<G_SCALAR> or C<G_ARRAY> for void, scalar or array context, +respectively. + + U32 GIMME_V + +=item GvSV + +Return the SV from the GV. + + SV* GvSV(GV* gv) + +=item gv_fetchmeth + +Returns the glob with the given C<name> and a defined subroutine or +C<NULL>. The glob lives in the given C<stash>, or in the stashes +accessible via @ISA and @UNIVERSAL. + +The argument C<level> should be either 0 or -1. If C<level==0>, as a +side-effect creates a glob with the given C<name> in the given C<stash> +which in the case of success contains an alias for the subroutine, and sets +up caching info for this glob. Similarly for all the searched stashes. + +This function grants C<"SUPER"> token as a postfix of the stash name. The +GV returned from C<gv_fetchmeth> may be a method cache entry, which is not +visible to Perl code. So when calling C<perl_call_sv>, you should not use +the GV directly; instead, you should use the method's CV, which can be +obtained from the GV with the C<GvCV> macro. + + GV* gv_fetchmeth(HV* stash, const char* name, STRLEN len, I32 level) + +=item gv_fetchmethod + +See L<gv_fetchmethod_autoload>. + + GV* gv_fetchmethod(HV* stash, const char* name) + +=item gv_fetchmethod_autoload + +Returns the glob which contains the subroutine to call to invoke the method +on the C<stash>. In fact in the presence of autoloading this may be the +glob for "AUTOLOAD". In this case the corresponding variable $AUTOLOAD is +already setup. + +The third parameter of C<gv_fetchmethod_autoload> determines whether +AUTOLOAD lookup is performed if the given method is not present: non-zero +means yes, look for AUTOLOAD; zero means no, don't look for AUTOLOAD. +Calling C<gv_fetchmethod> is equivalent to calling C<gv_fetchmethod_autoload> +with a non-zero C<autoload> parameter. + +These functions grant C<"SUPER"> token as a prefix of the method name. Note +that if you want to keep the returned glob for a long time, you need to +check for it being "AUTOLOAD", since at the later time the call may load a +different subroutine due to $AUTOLOAD changing its value. Use the glob +created via a side effect to do this. + +These functions have the same side-effects and as C<gv_fetchmeth> with +C<level==0>. C<name> should be writable if contains C<':'> or C<' +''>. The warning against passing the GV returned by C<gv_fetchmeth> to +C<perl_call_sv> apply equally to these functions. + + GV* gv_fetchmethod_autoload(HV* stash, const char* name, I32 autoload) + +=item gv_stashpv + +Returns a pointer to the stash for a specified package. If C<create> is +set then the package will be created if it does not already exist. If +C<create> is not set and the package does not exist then NULL is +returned. + + HV* gv_stashpv(const char* name, I32 create) + +=item gv_stashsv + +Returns a pointer to the stash for a specified package. See +C<gv_stashpv>. + + HV* gv_stashsv(SV* sv, I32 create) + +=item G_ARRAY + +Used to indicate array context. See C<GIMME_V>, C<GIMME> and +L<perlcall>. + +=item G_DISCARD + +Indicates that arguments returned from a callback should be discarded. See +L<perlcall>. + +=item G_EVAL + +Used to force a Perl C<eval> wrapper around a callback. See +L<perlcall>. + +=item G_NOARGS + +Indicates that no arguments are being sent to a callback. See +L<perlcall>. + +=item G_SCALAR + +Used to indicate scalar context. See C<GIMME_V>, C<GIMME>, and +L<perlcall>. + +=item G_VOID + +Used to indicate void context. See C<GIMME_V> and L<perlcall>. + +=item HEf_SVKEY + +This flag, used in the length slot of hash entries and magic structures, +specifies the structure contains a C<SV*> pointer where a C<char*> pointer +is to be expected. (For information only--not to be used). + +=item HeHASH + +Returns the computed hash stored in the hash entry. + + U32 HeHASH(HE* he) + +=item HeKEY + +Returns the actual pointer stored in the key slot of the hash entry. The +pointer may be either C<char*> or C<SV*>, depending on the value of +C<HeKLEN()>. Can be assigned to. The C<HePV()> or C<HeSVKEY()> macros are +usually preferable for finding the value of a key. + + void* HeKEY(HE* he) + +=item HeKLEN + +If this is negative, and amounts to C<HEf_SVKEY>, it indicates the entry +holds an C<SV*> key. Otherwise, holds the actual length of the key. Can +be assigned to. The C<HePV()> macro is usually preferable for finding key +lengths. + + STRLEN HeKLEN(HE* he) + +=item HePV + +Returns the key slot of the hash entry as a C<char*> value, doing any +necessary dereferencing of possibly C<SV*> keys. The length of the string +is placed in C<len> (this is a macro, so do I<not> use C<&len>). If you do +not care about what the length of the key is, you may use the global +variable C<PL_na>, though this is rather less efficient than using a local +variable. Remember though, that hash keys in perl are free to contain +embedded nulls, so using C<strlen()> or similar is not a good way to find +the length of hash keys. This is very similar to the C<SvPV()> macro +described elsewhere in this document. + + char* HePV(HE* he, STRLEN len) + +=item HeSVKEY + +Returns the key as an C<SV*>, or C<Nullsv> if the hash entry does not +contain an C<SV*> key. + + SV* HeSVKEY(HE* he) + +=item HeSVKEY_force + +Returns the key as an C<SV*>. Will create and return a temporary mortal +C<SV*> if the hash entry contains only a C<char*> key. + + SV* HeSVKEY_force(HE* he) + +=item HeSVKEY_set + +Sets the key to a given C<SV*>, taking care to set the appropriate flags to +indicate the presence of an C<SV*> key, and returns the same +C<SV*>. + + SV* HeSVKEY_set(HE* he, SV* sv) + +=item HeVAL + +Returns the value slot (type C<SV*>) stored in the hash entry. + + SV* HeVAL(HE* he) + +=item HvNAME + +Returns the package name of a stash. See C<SvSTASH>, C<CvSTASH>. + + char* HvNAME(HV* stash) + +=item hv_clear + +Clears a hash, making it empty. + + void hv_clear(HV* tb) + +=item hv_delete + +Deletes a key/value pair in the hash. The value SV is removed from the +hash and returned to the caller. The C<klen> is the length of the key. +The C<flags> value will normally be zero; if set to G_DISCARD then NULL +will be returned. + + SV* hv_delete(HV* tb, const char* key, U32 klen, I32 flags) + +=item hv_delete_ent + +Deletes a key/value pair in the hash. The value SV is removed from the +hash and returned to the caller. The C<flags> value will normally be zero; +if set to G_DISCARD then NULL will be returned. C<hash> can be a valid +precomputed hash value, or 0 to ask for it to be computed. + + SV* hv_delete_ent(HV* tb, SV* key, I32 flags, U32 hash) + +=item hv_exists + +Returns a boolean indicating whether the specified hash key exists. The +C<klen> is the length of the key. + + bool hv_exists(HV* tb, const char* key, U32 klen) + +=item hv_exists_ent + +Returns a boolean indicating whether the specified hash key exists. C<hash> +can be a valid precomputed hash value, or 0 to ask for it to be +computed. + + bool hv_exists_ent(HV* tb, SV* key, U32 hash) + +=item hv_fetch + +Returns the SV which corresponds to the specified key in the hash. The +C<klen> is the length of the key. If C<lval> is set then the fetch will be +part of a store. Check that the return value is non-null before +dereferencing it to a C<SV*>. + +See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for more +information on how to use this function on tied hashes. + + SV** hv_fetch(HV* tb, const char* key, U32 klen, I32 lval) + +=item hv_fetch_ent + +Returns the hash entry which corresponds to the specified key in the hash. +C<hash> must be a valid precomputed hash number for the given C<key>, or 0 +if you want the function to compute it. IF C<lval> is set then the fetch +will be part of a store. Make sure the return value is non-null before +accessing it. The return value when C<tb> is a tied hash is a pointer to a +static location, so be sure to make a copy of the structure if you need to +store it somewhere. + +See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for more +information on how to use this function on tied hashes. + + HE* hv_fetch_ent(HV* tb, SV* key, I32 lval, U32 hash) + +=item hv_iterinit + +Prepares a starting point to traverse a hash table. Returns the number of +keys in the hash (i.e. the same as C<HvKEYS(tb)>). The return value is +currently only meaningful for hashes without tie magic. + +NOTE: Before version 5.004_65, C<hv_iterinit> used to return the number of +hash buckets that happen to be in use. If you still need that esoteric +value, you can get it through the macro C<HvFILL(tb)>. + + I32 hv_iterinit(HV* tb) + +=item hv_iterkey + +Returns the key from the current position of the hash iterator. See +C<hv_iterinit>. + + char* hv_iterkey(HE* entry, I32* retlen) + +=item hv_iterkeysv + +Returns the key as an C<SV*> from the current position of the hash +iterator. The return value will always be a mortal copy of the key. Also +see C<hv_iterinit>. + + SV* hv_iterkeysv(HE* entry) + +=item hv_iternext + +Returns entries from a hash iterator. See C<hv_iterinit>. + + HE* hv_iternext(HV* tb) + +=item hv_iternextsv + +Performs an C<hv_iternext>, C<hv_iterkey>, and C<hv_iterval> in one +operation. + + SV* hv_iternextsv(HV* hv, char** key, I32* retlen) + +=item hv_iterval + +Returns the value from the current position of the hash iterator. See +C<hv_iterkey>. + + SV* hv_iterval(HV* tb, HE* entry) + +=item hv_magic + +Adds magic to a hash. See C<sv_magic>. + + void hv_magic(HV* hv, GV* gv, int how) + +=item hv_store + +Stores an SV in a hash. The hash key is specified as C<key> and C<klen> is +the length of the key. The C<hash> parameter is the precomputed hash +value; if it is zero then Perl will compute it. The return value will be +NULL if the operation failed or if the value did not need to be actually +stored within the hash (as in the case of tied hashes). Otherwise it can +be dereferenced to get the original C<SV*>. Note that the caller is +responsible for suitably incrementing the reference count of C<val> before +the call, and decrementing it if the function returned NULL. + +See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for more +information on how to use this function on tied hashes. + + SV** hv_store(HV* tb, const char* key, U32 klen, SV* val, U32 hash) + +=item hv_store_ent + +Stores C<val> in a hash. The hash key is specified as C<key>. The C<hash> +parameter is the precomputed hash value; if it is zero then Perl will +compute it. The return value is the new hash entry so created. It will be +NULL if the operation failed or if the value did not need to be actually +stored within the hash (as in the case of tied hashes). Otherwise the +contents of the return value can be accessed using the C<He???> macros +described here. Note that the caller is responsible for suitably +incrementing the reference count of C<val> before the call, and +decrementing it if the function returned NULL. + +See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for more +information on how to use this function on tied hashes. + + HE* hv_store_ent(HV* tb, SV* key, SV* val, U32 hash) + +=item hv_undef + +Undefines the hash. + + void hv_undef(HV* tb) + +=item isALNUM + +Returns a boolean indicating whether the C C<char> is an ascii alphanumeric +character or digit. + + bool isALNUM(char ch) + +=item isALPHA + +Returns a boolean indicating whether the C C<char> is an ascii alphabetic +character. + + bool isALPHA(char ch) + +=item isDIGIT + +Returns a boolean indicating whether the C C<char> is an ascii +digit. + + bool isDIGIT(char ch) + +=item isLOWER + +Returns a boolean indicating whether the C C<char> is a lowercase +character. + + bool isLOWER(char ch) + +=item isSPACE + +Returns a boolean indicating whether the C C<char> is whitespace. + + bool isSPACE(char ch) + +=item isUPPER + +Returns a boolean indicating whether the C C<char> is an uppercase +character. + + bool isUPPER(char ch) + +=item items + +Variable which is setup by C<xsubpp> to indicate the number of +items on the stack. See L<perlxs/"Variable-length Parameter Lists">. + + I32 items + +=item ix + +Variable which is setup by C<xsubpp> to indicate which of an +XSUB's aliases was used to invoke it. See L<perlxs/"The ALIAS: Keyword">. + + I32 ix + +=item LEAVE + +Closing bracket on a callback. See C<ENTER> and L<perlcall>. + + LEAVE; + +=item looks_like_number + +Test if an the content of an SV looks like a number (or is a +number). + + I32 looks_like_number(SV* sv) + +=item MARK + +Stack marker variable for the XSUB. See C<dMARK>. + +=item mg_clear + +Clear something magical that the SV represents. See C<sv_magic>. + + int mg_clear(SV* sv) + +=item mg_copy + +Copies the magic from one SV to another. See C<sv_magic>. + + int mg_copy(SV* sv, SV* nsv, const char* key, I32 klen) + +=item mg_find + +Finds the magic pointer for type matching the SV. See C<sv_magic>. + + MAGIC* mg_find(SV* sv, int type) + +=item mg_free + +Free any magic storage used by the SV. See C<sv_magic>. + + int mg_free(SV* sv) + +=item mg_get + +Do magic after a value is retrieved from the SV. See C<sv_magic>. + + int mg_get(SV* sv) + +=item mg_length + +Report on the SV's length. See C<sv_magic>. + + U32 mg_length(SV* sv) + +=item mg_magical + +Turns on the magical status of an SV. See C<sv_magic>. + + void mg_magical(SV* sv) + +=item mg_set + +Do magic after a value is assigned to the SV. See C<sv_magic>. + + int mg_set(SV* sv) + +=item Move + +The XSUB-writer's interface to the C C<memmove> function. The C<src> is the +source, C<dest> is the destination, C<nitems> is the number of items, and C<type> is +the type. Can do overlapping moves. See also C<Copy>. + + void Move(void* src, void* dest, int nitems, type) + +=item New + +The XSUB-writer's interface to the C C<malloc> function. + + void New(int id, void* ptr, int nitems, type) + +=item newAV + +Creates a new AV. The reference count is set to 1. + + AV* newAV() + +=item Newc + +The XSUB-writer's interface to the C C<malloc> function, with +cast. + + void Newc(int id, void* ptr, int nitems, type, cast) + +=item newCONSTSUB + +Creates a constant sub equivalent to Perl C<sub FOO () { 123 }> which is +eligible for inlining at compile-time. + + void newCONSTSUB(HV* stash, char* name, SV* sv) + +=item newHV + +Creates a new HV. The reference count is set to 1. + + HV* newHV() + +=item newRV_inc + +Creates an RV wrapper for an SV. The reference count for the original SV is +incremented. + + SV* newRV_inc(SV* sv) + +=item newRV_noinc + +Creates an RV wrapper for an SV. The reference count for the original +SV is B<not> incremented. + + SV* newRV_noinc(SV *sv) + +=item NEWSV + +Creates a new SV. A non-zero C<len> parameter indicates the number of +bytes of preallocated string space the SV should have. An extra byte for a +tailing NUL is also reserved. (SvPOK is not set for the SV even if string +space is allocated.) The reference count for the new SV is set to 1. +C<id> is an integer id between 0 and 1299 (used to identify leaks). + + SV* NEWSV(int id, STRLEN len) + +=item newSViv + +Creates a new SV and copies an integer into it. The reference count for the +SV is set to 1. + + SV* newSViv(IV i) + +=item newSVnv + +Creates a new SV and copies a floating point value into it. +The reference count for the SV is set to 1. + + SV* newSVnv(NV n) + +=item newSVpv + +Creates a new SV and copies a string into it. The reference count for the +SV is set to 1. If C<len> is zero, Perl will compute the length using +strlen(). For efficiency, consider using C<newSVpvn> instead. + + SV* newSVpv(const char* s, STRLEN len) + +=item newSVpvf + +Creates a new SV an initialize it with the string formatted like +C<sprintf>. + + SV* newSVpvf(const char* pat, ...) + +=item newSVpvn + +Creates a new SV and copies a string into it. The reference count for the +SV is set to 1. Note that if C<len> is zero, Perl will create a zero length +string. You are responsible for ensuring that the source string is at least +C<len> bytes long. + + SV* newSVpvn(const char* s, STRLEN len) + +=item newSVrv + +Creates a new SV for the RV, C<rv>, to point to. If C<rv> is not an RV then +it will be upgraded to one. If C<classname> is non-null then the new SV will +be blessed in the specified package. The new SV is returned and its +reference count is 1. + + SV* newSVrv(SV* rv, const char* classname) + +=item newSVsv + +Creates a new SV which is an exact duplicate of the original SV. + + SV* newSVsv(SV* old) + +=item newXS + +Used by C<xsubpp> to hook up XSUBs as Perl subs. + +=item newXSproto + +Used by C<xsubpp> to hook up XSUBs as Perl subs. Adds Perl prototypes to +the subs. + +=item Newz + +The XSUB-writer's interface to the C C<malloc> function. The allocated +memory is zeroed with C<memzero>. + + void Newz(int id, void* ptr, int nitems, type) + +=item Nullav + +Null AV pointer. + +=item Nullch + +Null character pointer. + +=item Nullcv + +Null CV pointer. + +=item Nullhv + +Null HV pointer. + +=item Nullsv + +Null SV pointer. + +=item ORIGMARK + +The original stack mark for the XSUB. See C<dORIGMARK>. + +=item perl_alloc + +Allocates a new Perl interpreter. See L<perlembed>. + + PerlInterpreter* perl_alloc() + +=item perl_construct + +Initializes a new Perl interpreter. See L<perlembed>. + + void perl_construct(PerlInterpreter* interp) + +=item perl_destruct + +Shuts down a Perl interpreter. See L<perlembed>. + + void perl_destruct(PerlInterpreter* interp) + +=item perl_free + +Releases a Perl interpreter. See L<perlembed>. + + void perl_free(PerlInterpreter* interp) + +=item perl_parse + +Tells a Perl interpreter to parse a Perl script. See L<perlembed>. + + int perl_parse(PerlInterpreter* interp, XSINIT_t xsinit, int argc, char** argv, char** env) + +=item perl_run + +Tells a Perl interpreter to run. See L<perlembed>. + + int perl_run(PerlInterpreter* interp) + +=item PL_DBsingle + +When Perl is run in debugging mode, with the B<-d> switch, this SV is a +boolean which indicates whether subs are being single-stepped. +Single-stepping is automatically turned on after every step. This is the C +variable which corresponds to Perl's $DB::single variable. See +C<PL_DBsub>. + + SV * PL_DBsingle + +=item PL_DBsub + +When Perl is run in debugging mode, with the B<-d> switch, this GV contains +the SV which holds the name of the sub being debugged. This is the C +variable which corresponds to Perl's $DB::sub variable. See +C<PL_DBsingle>. + + GV * PL_DBsub + +=item PL_DBtrace + +Trace variable used when Perl is run in debugging mode, with the B<-d> +switch. This is the C variable which corresponds to Perl's $DB::trace +variable. See C<PL_DBsingle>. + + SV * PL_DBtrace + +=item PL_dowarn + +The C variable which corresponds to Perl's $^W warning variable. + + bool PL_dowarn + +=item PL_modglobal + +C<PL_modglobal> is a general purpose, interpreter global HV for use by +extensions that need to keep information on a per-interpreter basis. +In a pinch, it can also be used as a symbol table for extensions +to share data among each other. It is a good idea to use keys +prefixed by the package name of the extension that owns the data. + + HV* PL_modglobal + +=item PL_na + +A convenience variable which is typically used with C<SvPV> when one +doesn't care about the length of the string. It is usually more efficient +to either declare a local variable and use that instead or to use the +C<SvPV_nolen> macro. + + STRLEN PL_na + +=item PL_sv_no + +This is the C<false> SV. See C<PL_sv_yes>. Always refer to this as +C<&PL_sv_no>. + + SV PL_sv_no + +=item PL_sv_undef + +This is the C<undef> SV. Always refer to this as C<&PL_sv_undef>. + + SV PL_sv_undef + +=item PL_sv_yes + +This is the C<true> SV. See C<PL_sv_no>. Always refer to this as +C<&PL_sv_yes>. + + SV PL_sv_yes + +=item POPi + +Pops an integer off the stack. + + IV POPi + +=item POPl + +Pops a long off the stack. + + long POPl + +=item POPn + +Pops a double off the stack. + + NV POPn + +=item POPp + +Pops a string off the stack. + + char* POPp + +=item POPs + +Pops an SV off the stack. + + SV* POPs + +=item PUSHi + +Push an integer onto the stack. The stack must have room for this element. +Handles 'set' magic. See C<XPUSHi>. + + void PUSHi(IV iv) + +=item PUSHMARK + +Opening bracket for arguments on a callback. See C<PUTBACK> and +L<perlcall>. + + PUSHMARK; + +=item PUSHn + +Push a double onto the stack. The stack must have room for this element. +Handles 'set' magic. See C<XPUSHn>. + + void PUSHn(NV nv) + +=item PUSHp + +Push a string onto the stack. The stack must have room for this element. +The C<len> indicates the length of the string. Handles 'set' magic. See +C<XPUSHp>. + + void PUSHp(char* str, STRLEN len) + +=item PUSHs + +Push an SV onto the stack. The stack must have room for this element. +Does not handle 'set' magic. See C<XPUSHs>. + + void PUSHs(SV* sv) + +=item PUSHu + +Push an unsigned integer onto the stack. The stack must have room for this +element. See C<XPUSHu>. + + void PUSHu(UV uv) + +=item PUTBACK + +Closing bracket for XSUB arguments. This is usually handled by C<xsubpp>. +See C<PUSHMARK> and L<perlcall> for other uses. + + PUTBACK; + +=item Renew + +The XSUB-writer's interface to the C C<realloc> function. + + void Renew(void* ptr, int nitems, type) + +=item Renewc + +The XSUB-writer's interface to the C C<realloc> function, with +cast. + + void Renewc(void* ptr, int nitems, type, cast) + +=item require_pv + +Tells Perl to C<require> a module. + +NOTE: the perl_ form of this function is deprecated. + + void require_pv(const char* pv) + +=item RETVAL + +Variable which is setup by C<xsubpp> to hold the return value for an +XSUB. This is always the proper type for the XSUB. See +L<perlxs/"The RETVAL Variable">. + + (whatever) RETVAL + +=item Safefree + +The XSUB-writer's interface to the C C<free> function. + + void Safefree(void* src, void* dest, int nitems, type) + +=item savepv + +Copy a string to a safe spot. This does not use an SV. + + char* savepv(const char* sv) + +=item savepvn + +Copy a string to a safe spot. The C<len> indicates number of bytes to +copy. This does not use an SV. + + char* savepvn(const char* sv, I32 len) + +=item SAVETMPS + +Opening bracket for temporaries on a callback. See C<FREETMPS> and +L<perlcall>. + + SAVETMPS; + +=item SP + +Stack pointer. This is usually handled by C<xsubpp>. See C<dSP> and +C<SPAGAIN>. + +=item SPAGAIN + +Refetch the stack pointer. Used after a callback. See L<perlcall>. + + SPAGAIN; + +=item ST + +Used to access elements on the XSUB's stack. + + SV* ST(int ix) + +=item strEQ + +Test two strings to see if they are equal. Returns true or false. + + bool strEQ(char* s1, char* s2) + +=item strGE + +Test two strings to see if the first, C<s1>, is greater than or equal to +the second, C<s2>. Returns true or false. + + bool strGE(char* s1, char* s2) + +=item strGT + +Test two strings to see if the first, C<s1>, is greater than the second, +C<s2>. Returns true or false. + + bool strGT(char* s1, char* s2) + +=item strLE + +Test two strings to see if the first, C<s1>, is less than or equal to the +second, C<s2>. Returns true or false. + + bool strLE(char* s1, char* s2) + +=item strLT + +Test two strings to see if the first, C<s1>, is less than the second, +C<s2>. Returns true or false. + + bool strLT(char* s1, char* s2) + +=item strNE + +Test two strings to see if they are different. Returns true or +false. + + bool strNE(char* s1, char* s2) + +=item strnEQ + +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>). + + bool strnEQ(char* s1, char* s2, STRLEN 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>). + + bool strnNE(char* s1, char* s2, STRLEN len) + +=item StructCopy + +This is an architecture-independant macro to copy one structure to another. + + void StructCopy(type src, type dest, type) + +=item SvCUR + +Returns the length of the string which is in the SV. See C<SvLEN>. + + STRLEN SvCUR(SV* sv) + +=item SvCUR_set + +Set the length of the string which is in the SV. See C<SvCUR>. + + void SvCUR_set(SV* sv, STRLEN len) + +=item SvEND + +Returns a pointer to the last character in the string which is in the SV. +See C<SvCUR>. Access the character as *(SvEND(sv)). + + char* SvEND(SV* sv) + +=item SvGETMAGIC + +Invokes C<mg_get> on an SV if it has 'get' magic. This macro evaluates its +argument more than once. + + void SvGETMAGIC(SV* sv) + +=item SvGROW + +Expands the character buffer in the SV so that it has room for the +indicated number of bytes (remember to reserve space for an extra trailing +NUL character). Calls C<sv_grow> to perform the expansion if necessary. +Returns a pointer to the character buffer. + + void SvGROW(SV* sv, STRLEN len) + +=item SvIOK + +Returns a boolean indicating whether the SV contains an integer. + + bool SvIOK(SV* sv) + +=item SvIOKp + +Returns a boolean indicating whether the SV contains an integer. Checks +the B<private> setting. Use C<SvIOK>. + + bool SvIOKp(SV* sv) + +=item SvIOK_off + +Unsets the IV status of an SV. + + void SvIOK_off(SV* sv) + +=item SvIOK_on + +Tells an SV that it is an integer. + + void SvIOK_on(SV* sv) + +=item SvIOK_only + +Tells an SV that it is an integer and disables all other OK bits. + + void SvIOK_only(SV* sv) + +=item SvIV + +Coerces the given SV to an integer and returns it. + + IV SvIV(SV* sv) + +=item SvIVX + +Returns the integer which is stored in the SV, assuming SvIOK is +true. + + IV SvIVX(SV* sv) + +=item SvLEN + +Returns the size of the string buffer in the SV. See C<SvCUR>. + + STRLEN SvLEN(SV* sv) + +=item SvNIOK + +Returns a boolean indicating whether the SV contains a number, integer or +double. + + bool SvNIOK(SV* sv) + +=item SvNIOKp + +Returns a boolean indicating whether the SV contains a number, integer or +double. Checks the B<private> setting. Use C<SvNIOK>. + + bool SvNIOKp(SV* sv) + +=item SvNIOK_off + +Unsets the NV/IV status of an SV. + + void SvNIOK_off(SV* sv) + +=item SvNOK + +Returns a boolean indicating whether the SV contains a double. + + bool SvNOK(SV* sv) + +=item SvNOKp + +Returns a boolean indicating whether the SV contains a double. Checks the +B<private> setting. Use C<SvNOK>. + + bool SvNOKp(SV* sv) + +=item SvNOK_off + +Unsets the NV status of an SV. + + void SvNOK_off(SV* sv) + +=item SvNOK_on + +Tells an SV that it is a double. + + void SvNOK_on(SV* sv) + +=item SvNOK_only + +Tells an SV that it is a double and disables all other OK bits. + + void SvNOK_only(SV* sv) + +=item SvNV + +Coerce the given SV to a double and return it. + + NV SvNV(SV* sv) + +=item SvNVX + +Returns the double which is stored in the SV, assuming SvNOK is +true. + + NV SvNVX(SV* sv) + +=item SvOK + +Returns a boolean indicating whether the value is an SV. + + bool SvOK(SV* sv) + +=item SvOOK + +Returns a boolean indicating whether the SvIVX is a valid offset value for +the SvPVX. This hack is used internally to speed up removal of characters +from the beginning of a SvPV. When SvOOK is true, then the start of the +allocated string buffer is really (SvPVX - SvIVX). + + bool SvOOK(SV* sv) + +=item SvPOK + +Returns a boolean indicating whether the SV contains a character +string. + + bool SvPOK(SV* sv) + +=item SvPOKp + +Returns a boolean indicating whether the SV contains a character string. +Checks the B<private> setting. Use C<SvPOK>. + + bool SvPOKp(SV* sv) + +=item SvPOK_off + +Unsets the PV status of an SV. + + void SvPOK_off(SV* sv) + +=item SvPOK_on + +Tells an SV that it is a string. + + void SvPOK_on(SV* sv) + +=item SvPOK_only + +Tells an SV that it is a string and disables all other OK bits. + + void SvPOK_only(SV* sv) + +=item SvPV + +Returns a pointer to the string in the SV, or a stringified form of the SV +if the SV does not contain a string. Handles 'get' magic. + + char* SvPV(SV* sv, STRLEN len) + +=item SvPVX + +Returns a pointer to the string in the SV. The SV must contain a +string. + + char* SvPVX(SV* sv) + +=item SvPV_force + +Like <SvPV> but will force the SV into becoming a string (SvPOK). You want +force if you are going to update the SvPVX directly. + + char* SvPV_force(SV* sv, STRLEN len) + +=item SvPV_nolen + +Returns a pointer to the string in the SV, or a stringified form of the SV +if the SV does not contain a string. Handles 'get' magic. + + char* SvPV_nolen(SV* sv) + +=item SvREFCNT + +Returns the value of the object's reference count. + + U32 SvREFCNT(SV* sv) + +=item SvREFCNT_dec + +Decrements the reference count of the given SV. + + void SvREFCNT_dec(SV* sv) + +=item SvREFCNT_inc + +Increments the reference count of the given SV. + + SV* SvREFCNT_inc(SV* sv) + +=item SvROK + +Tests if the SV is an RV. + + bool SvROK(SV* sv) + +=item SvROK_off + +Unsets the RV status of an SV. + + void SvROK_off(SV* sv) + +=item SvROK_on + +Tells an SV that it is an RV. + + void SvROK_on(SV* sv) + +=item SvRV + +Dereferences an RV to return the SV. + + SV* SvRV(SV* sv) + +=item SvSETMAGIC + +Invokes C<mg_set> on an SV if it has 'set' magic. This macro evaluates its +argument more than once. + + void SvSETMAGIC(SV* sv) + +=item SvSetSV + +Calls C<sv_setsv> if dsv is not the same as ssv. May evaluate arguments +more than once. + + void SvSetSV(SV* dsb, SV* ssv) + +=item SvSetSV_nosteal + +Calls a non-destructive version of C<sv_setsv> if dsv is not the same as +ssv. May evaluate arguments more than once. + + void SvSetSV_nosteal(SV* dsv, SV* ssv) + +=item SvSTASH + +Returns the stash of the SV. + + HV* SvSTASH(SV* sv) + +=item SvTAINT + +Taints an SV if tainting is enabled + + void SvTAINT(SV* sv) + +=item SvTAINTED + +Checks to see if an SV is tainted. Returns TRUE if it is, FALSE if +not. + + bool SvTAINTED(SV* sv) + +=item SvTAINTED_off + +Untaints an SV. Be I<very> careful with this routine, as it short-circuits +some of Perl's fundamental security features. XS module authors should not +use this function unless they fully understand all the implications of +unconditionally untainting the value. Untainting should be done in the +standard perl fashion, via a carefully crafted regexp, rather than directly +untainting variables. + + void SvTAINTED_off(SV* sv) + +=item SvTAINTED_on + +Marks an SV as tainted. + + void SvTAINTED_on(SV* sv) + +=item SvTRUE + +Returns a boolean indicating whether Perl would evaluate the SV as true or +false, defined or undefined. Does not handle 'get' magic. + + bool SvTRUE(SV* sv) + +=item SvTYPE + +Returns the type of the SV. See C<svtype>. + + svtype SvTYPE(SV* sv) + +=item svtype + +An enum of flags for Perl types. These are found in the file B<sv.h> +in the C<svtype> enum. Test these flags with the C<SvTYPE> macro. + +=item SVt_IV + +Integer type flag for scalars. See C<svtype>. + +=item SVt_NV + +Double type flag for scalars. See C<svtype>. + +=item SVt_PV + +Pointer type flag for scalars. See C<svtype>. + +=item SVt_PVAV + +Type flag for arrays. See C<svtype>. + +=item SVt_PVCV + +Type flag for code refs. See C<svtype>. + +=item SVt_PVHV + +Type flag for hashes. See C<svtype>. + +=item SVt_PVMG + +Type flag for blessed scalars. See C<svtype>. + +=item SvUPGRADE + +Used to upgrade an SV to a more complex form. Uses C<sv_upgrade> to +perform the upgrade if necessary. See C<svtype>. + + void SvUPGRADE(SV* sv, svtype type) + +=item SvUV + +Coerces the given SV to an unsigned integer and returns it. + + UV SvUV(SV* sv) + +=item SvUVX + +Returns the unsigned integer which is stored in the SV, assuming SvIOK is +true. + + UV SvUVX(SV* sv) + +=item sv_2mortal + +Marks an SV as mortal. The SV will be destroyed when the current context +ends. + + SV* sv_2mortal(SV* sv) + +=item sv_bless + +Blesses an SV into a specified package. The SV must be an RV. The package +must be designated by its stash (see C<gv_stashpv()>). The reference count +of the SV is unaffected. + + SV* sv_bless(SV* sv, HV* stash) + +=item sv_catpv + +Concatenates the string onto the end of the string which is in the SV. +Handles 'get' magic, but not 'set' magic. See C<sv_catpv_mg>. + + void sv_catpv(SV* sv, const char* ptr) + +=item sv_catpvf + +Processes its arguments like C<sprintf> and appends the formatted output +to an SV. Handles 'get' magic, but not 'set' magic. C<SvSETMAGIC()> must +typically be called after calling this function to handle 'set' magic. + + void sv_catpvf(SV* sv, const char* pat, ...) + +=item sv_catpvf_mg + +Like C<sv_catpvf>, but also handles 'set' magic. + + void sv_catpvf_mg(SV *sv, const char* pat, ...) + +=item sv_catpvn + +Concatenates the string onto the end of the string which is in the SV. The +C<len> indicates number of bytes to copy. Handles 'get' magic, but not +'set' magic. See C<sv_catpvn_mg>. + + void sv_catpvn(SV* sv, const char* ptr, STRLEN len) + +=item sv_catpvn_mg + +Like C<sv_catpvn>, but also handles 'set' magic. + + void sv_catpvn_mg(SV *sv, const char *ptr, STRLEN len) + +=item sv_catpv_mg + +Like C<sv_catpv>, but also handles 'set' magic. + + void sv_catpv_mg(SV *sv, const char *ptr) + +=item sv_catsv + +Concatenates the string from SV C<ssv> onto the end of the string in SV +C<dsv>. Handles 'get' magic, but not 'set' magic. See C<sv_catsv_mg>. + + void sv_catsv(SV* dsv, SV* ssv) + +=item sv_catsv_mg + +Like C<sv_catsv>, but also handles 'set' magic. + + void sv_catsv_mg(SV *dstr, SV *sstr) + +=item sv_chop + +Efficient removal of characters from the beginning of the string buffer. +SvPOK(sv) must be true and the C<ptr> must be a pointer to somewhere inside +the string buffer. The C<ptr> becomes the first character of the adjusted +string. + + void sv_chop(SV* sv, char* ptr) + +=item sv_cmp + +Compares the strings in two SVs. Returns -1, 0, or 1 indicating whether the +string in C<sv1> is less than, equal to, or greater than the string in +C<sv2>. + + I32 sv_cmp(SV* sv1, SV* sv2) + +=item sv_dec + +Auto-decrement of the value in the SV. + + void sv_dec(SV* sv) + +=item sv_derived_from + +Returns a boolean indicating whether the SV is derived from the specified +class. This is the function that implements C<UNIVERSAL::isa>. It works +for class names as well as for objects. + + bool sv_derived_from(SV* sv, const char* name) + +=item sv_eq + +Returns a boolean indicating whether the strings in the two SVs are +identical. + + I32 sv_eq(SV* sv1, SV* sv2) + +=item sv_grow + +Expands the character buffer in the SV. This will use C<sv_unref> and will +upgrade the SV to C<SVt_PV>. Returns a pointer to the character buffer. +Use C<SvGROW>. + + char* sv_grow(SV* sv, STRLEN newlen) + +=item sv_inc + +Auto-increment of the value in the SV. + + void sv_inc(SV* sv) + +=item sv_insert + +Inserts a string at the specified offset/length within the SV. Similar to +the Perl substr() function. + + void sv_insert(SV* bigsv, STRLEN offset, STRLEN len, char* little, STRLEN littlelen) + +=item sv_isa + +Returns a boolean indicating whether the SV is blessed into the specified +class. This does not check for subtypes; use C<sv_derived_from> to verify +an inheritance relationship. + + int sv_isa(SV* sv, const char* name) + +=item sv_isobject + +Returns a boolean indicating whether the SV is an RV pointing to a blessed +object. If the SV is not an RV, or if the object is not blessed, then this +will return false. + + int sv_isobject(SV* sv) + +=item sv_len + +Returns the length of the string in the SV. See also C<SvCUR>. + + STRLEN sv_len(SV* sv) + +=item sv_magic + +Adds magic to an SV. + + void sv_magic(SV* sv, SV* obj, int how, const char* name, I32 namlen) + +=item sv_mortalcopy + +Creates a new SV which is a copy of the original SV. The new SV is marked +as mortal. + + SV* sv_mortalcopy(SV* oldsv) + +=item sv_newmortal + +Creates a new SV which is mortal. The reference count of the SV is set to 1. + + SV* sv_newmortal() + +=item sv_setiv + +Copies an integer into the given SV. Does not handle 'set' magic. See +C<sv_setiv_mg>. + + void sv_setiv(SV* sv, IV num) + +=item sv_setiv_mg + +Like C<sv_setiv>, but also handles 'set' magic. + + void sv_setiv_mg(SV *sv, IV i) + +=item sv_setnv + +Copies a double into the given SV. Does not handle 'set' magic. See +C<sv_setnv_mg>. + + void sv_setnv(SV* sv, NV num) + +=item sv_setnv_mg + +Like C<sv_setnv>, but also handles 'set' magic. + + void sv_setnv_mg(SV *sv, NV num) + +=item sv_setpv + +Copies a string into an SV. The string must be null-terminated. Does not +handle 'set' magic. See C<sv_setpv_mg>. + + void sv_setpv(SV* sv, const char* ptr) + +=item sv_setpvf + +Processes its arguments like C<sprintf> and sets an SV to the formatted +output. Does not handle 'set' magic. See C<sv_setpvf_mg>. + + void sv_setpvf(SV* sv, const char* pat, ...) + +=item sv_setpvf_mg + +Like C<sv_setpvf>, but also handles 'set' magic. + + void sv_setpvf_mg(SV *sv, const char* pat, ...) + +=item sv_setpviv + +Copies an integer into the given SV, also updating its string value. +Does not handle 'set' magic. See C<sv_setpviv_mg>. + + void sv_setpviv(SV* sv, IV num) + +=item sv_setpviv_mg + +Like C<sv_setpviv>, but also handles 'set' magic. + + void sv_setpviv_mg(SV *sv, IV iv) + +=item sv_setpvn + +Copies a string into an SV. The C<len> parameter indicates the number of +bytes to be copied. Does not handle 'set' magic. See C<sv_setpvn_mg>. + + void sv_setpvn(SV* sv, const char* ptr, STRLEN len) + +=item sv_setpvn_mg + +Like C<sv_setpvn>, but also handles 'set' magic. + + void sv_setpvn_mg(SV *sv, const char *ptr, STRLEN len) + +=item sv_setpv_mg + +Like C<sv_setpv>, but also handles 'set' magic. + + void sv_setpv_mg(SV *sv, const char *ptr) + +=item sv_setref_iv + +Copies an integer into a new SV, optionally blessing the SV. The C<rv> +argument will be upgraded to an RV. That RV will be modified to point to +the new SV. The C<classname> argument indicates the package for the +blessing. Set C<classname> to C<Nullch> to avoid the blessing. The new SV +will be returned and will have a reference count of 1. + + SV* sv_setref_iv(SV* rv, const char* classname, IV iv) + +=item sv_setref_nv + +Copies a double into a new SV, optionally blessing the SV. The C<rv> +argument will be upgraded to an RV. That RV will be modified to point to +the new SV. The C<classname> argument indicates the package for the +blessing. Set C<classname> to C<Nullch> to avoid the blessing. The new SV +will be returned and will have a reference count of 1. + + SV* sv_setref_nv(SV* rv, const char* classname, NV nv) + +=item sv_setref_pv + +Copies a pointer into a new SV, optionally blessing the SV. The C<rv> +argument will be upgraded to an RV. That RV will be modified to point to +the new SV. If the C<pv> argument is NULL then C<PL_sv_undef> will be placed +into the SV. The C<classname> argument indicates the package for the +blessing. Set C<classname> to C<Nullch> to avoid the blessing. The new SV +will be returned and will have a reference count of 1. + +Do not use with other Perl types such as HV, AV, SV, CV, because those +objects will become corrupted by the pointer copy process. + +Note that C<sv_setref_pvn> copies the string while this copies the pointer. + + SV* sv_setref_pv(SV* rv, const char* classname, void* pv) + +=item sv_setref_pvn + +Copies a string into a new SV, optionally blessing the SV. The length of the +string must be specified with C<n>. The C<rv> argument will be upgraded to +an RV. That RV will be modified to point to the new SV. The C<classname> +argument indicates the package for the blessing. Set C<classname> to +C<Nullch> to avoid the blessing. The new SV will be returned and will have +a reference count of 1. + +Note that C<sv_setref_pv> copies the pointer while this copies the string. + + SV* sv_setref_pvn(SV* rv, const char* classname, char* pv, STRLEN n) + +=item sv_setsv + +Copies the contents of the source SV C<ssv> into the destination SV C<dsv>. +The source SV may be destroyed if it is mortal. Does not handle 'set' +magic. See the macro forms C<SvSetSV>, C<SvSetSV_nosteal> and +C<sv_setsv_mg>. + + void sv_setsv(SV* dsv, SV* ssv) + +=item sv_setsv_mg + +Like C<sv_setsv>, but also handles 'set' magic. + + void sv_setsv_mg(SV *dstr, SV *sstr) + +=item sv_setuv + +Copies an unsigned integer into the given SV. Does not handle 'set' magic. +See C<sv_setuv_mg>. + + void sv_setuv(SV* sv, UV num) + +=item sv_setuv_mg + +Like C<sv_setuv>, but also handles 'set' magic. + + void sv_setuv_mg(SV *sv, UV u) + +=item sv_unref + +Unsets the RV status of the SV, and decrements the reference count of +whatever was being referenced by the RV. This can almost be thought of +as a reversal of C<newSVrv>. See C<SvROK_off>. + + void sv_unref(SV* sv) + +=item sv_upgrade + +Upgrade an SV to a more complex form. Use C<SvUPGRADE>. See +C<svtype>. + + bool sv_upgrade(SV* sv, U32 mt) + +=item sv_usepvn + +Tells an SV to use C<ptr> to find its string value. Normally the string is +stored inside the SV but sv_usepvn allows the SV to use an outside string. +The C<ptr> should point to memory that was allocated by C<malloc>. The +string length, C<len>, must be supplied. This function will realloc the +memory pointed to by C<ptr>, so that pointer should not be freed or used by +the programmer after giving it to sv_usepvn. Does not handle 'set' magic. +See C<sv_usepvn_mg>. + + void sv_usepvn(SV* sv, char* ptr, STRLEN len) + +=item sv_usepvn_mg + +Like C<sv_usepvn>, but also handles 'set' magic. + + void sv_usepvn_mg(SV *sv, char *ptr, STRLEN len) + +=item sv_vcatpvfn + +Processes its arguments like C<vsprintf> and appends the formatted output +to an SV. Uses an array of SVs if the C style variable argument list is +missing (NULL). When running with taint checks enabled, indicates via +C<maybe_tainted> if results are untrustworthy (often due to the use of +locales). + + void sv_vcatpvfn(SV* sv, const char* pat, STRLEN patlen, va_list* args, SV** svargs, I32 svmax, bool *maybe_tainted) + +=item sv_vsetpvfn + +Works like C<vcatpvfn> but copies the text into the SV instead of +appending it. + + void sv_vsetpvfn(SV* sv, const char* pat, STRLEN patlen, va_list* args, SV** svargs, I32 svmax, bool *maybe_tainted) + +=item THIS + +Variable which is setup by C<xsubpp> to designate the object in a C++ +XSUB. This is always the proper type for the C++ object. See C<CLASS> and +L<perlxs/"Using XS With C++">. + + (whatever) THIS + +=item toLOWER + +Converts the specified character to lowercase. + + char toLOWER(char ch) + +=item toUPPER + +Converts the specified character to uppercase. + + char toUPPER(char ch) + +=item warn + +This is the XSUB-writer's interface to Perl's C<warn> function. Use this +function the same way you use the C C<printf> function. See +C<croak>. + + void warn(const char* pat, ...) + +=item XPUSHi + +Push an integer onto the stack, extending the stack if necessary. Handles +'set' magic. See C<PUSHi>. + + void XPUSHi(IV iv) + +=item XPUSHn + +Push a double onto the stack, extending the stack if necessary. Handles +'set' magic. See C<PUSHn>. + + void XPUSHn(NV nv) + +=item XPUSHp + +Push a string onto the stack, extending the stack if necessary. The C<len> +indicates the length of the string. Handles 'set' magic. See +C<PUSHp>. + + void XPUSHp(char* str, STRLEN len) + +=item XPUSHs + +Push an SV onto the stack, extending the stack if necessary. Does not +handle 'set' magic. See C<PUSHs>. + + void XPUSHs(SV* sv) + +=item XPUSHu + +Push an unsigned integer onto the stack, extending the stack if necessary. +See C<PUSHu>. + + void XPUSHu(UV uv) + +=item XS + +Macro to declare an XSUB and its C parameter list. This is handled by +C<xsubpp>. + +=item XSRETURN + +Return from XSUB, indicating number of items on the stack. This is usually +handled by C<xsubpp>. + + void XSRETURN(int nitems) + +=item XSRETURN_EMPTY + +Return an empty list from an XSUB immediately. + + XSRETURN_EMPTY; + +=item XSRETURN_IV + +Return an integer from an XSUB immediately. Uses C<XST_mIV>. + + void XSRETURN_IV(IV iv) + +=item XSRETURN_NO + +Return C<&PL_sv_no> from an XSUB immediately. Uses C<XST_mNO>. + + XSRETURN_NO; + +=item XSRETURN_NV + +Return an double from an XSUB immediately. Uses C<XST_mNV>. + + void XSRETURN_NV(NV nv) + +=item XSRETURN_PV + +Return a copy of a string from an XSUB immediately. Uses C<XST_mPV>. + + void XSRETURN_PV(char* str) + +=item XSRETURN_UNDEF + +Return C<&PL_sv_undef> from an XSUB immediately. Uses C<XST_mUNDEF>. + + XSRETURN_UNDEF; + +=item XSRETURN_YES + +Return C<&PL_sv_yes> from an XSUB immediately. Uses C<XST_mYES>. + + XSRETURN_YES; + +=item XST_mIV + +Place an integer into the specified position C<pos> on the stack. The +value is stored in a new mortal SV. + + void XST_mIV(int pos, IV iv) + +=item XST_mNO + +Place C<&PL_sv_no> into the specified position C<pos> on the +stack. + + void XST_mNO(int pos) + +=item XST_mNV + +Place a double into the specified position C<pos> on the stack. The value +is stored in a new mortal SV. + + void XST_mNV(int pos, NV nv) + +=item XST_mPV + +Place a copy of a string into the specified position C<pos> on the stack. +The value is stored in a new mortal SV. + + void XST_mPV(int pos, char* str) + +=item XST_mUNDEF + +Place C<&PL_sv_undef> into the specified position C<pos> on the +stack. + + void XST_mUNDEF(int pos) + +=item XST_mYES + +Place C<&PL_sv_yes> into the specified position C<pos> on the +stack. + + void XST_mYES(int pos) + +=item XS_VERSION + +The version identifier for an XS module. This is usually +handled automatically by C<ExtUtils::MakeMaker>. See C<XS_VERSION_BOOTCHECK>. + +=item XS_VERSION_BOOTCHECK + +Macro to verify that a PM module's $VERSION variable matches the XS +module's C<XS_VERSION> variable. This is usually handled automatically by +C<xsubpp>. See L<perlxs/"The VERSIONCHECK: Keyword">. + + XS_VERSION_BOOTCHECK; + +=item Zero + +The XSUB-writer's interface to the C C<memzero> function. The C<dest> is the +destination, C<nitems> is the number of items, and C<type> is the type. + + void Zero(void* dest, int nitems, type) + +=back + +=head1 AUTHORS + +Until May 1997, this document was maintained by Jeff Okamoto +<okamoto@corp.hp.com>. It is now maintained as part of Perl itself. + +With lots of help and suggestions from Dean Roehrich, Malcolm Beattie, +Andreas Koenig, Paul Hudson, Ilya Zakharevich, Paul Marquess, Neil +Bowers, Matthew Green, Tim Bunce, Spider Boardman, Ulrich Pfeifer, +Stephen McCamant, and Gurusamy Sarathy. + +API Listing originally by Dean Roehrich <roehrich@cray.com>. + +Updated to be autogenerated from comments in the source by Benjamin Stuhl. + +=head1 SEE ALSO + +perlguts(1), perlxs(1), perlxstut(1), perlintern(1) + diff --git a/pod/perlcompile.pod b/pod/perlcompile.pod index 0ba94187db..04dc019b36 100644 --- a/pod/perlcompile.pod +++ b/pod/perlcompile.pod @@ -409,7 +409,7 @@ formats are defined and used within a program and the modules it loads. See L</"The Cross Referencing Back End"> for details about usage. -=cut +=back =head1 KNOWN PROBLEMS diff --git a/pod/perldebug.pod b/pod/perldebug.pod index 56997322d6..2431fc47f1 100644 --- a/pod/perldebug.pod +++ b/pod/perldebug.pod @@ -145,7 +145,7 @@ List C<incr+1> lines starting at C<min>. =item l min-max -List lines C<min> through C<max>. C<l -> is synonymous to C<->. +List lines C<min> through C<max>. C<l E<45>> is synonymous to C<E<45>>. =item l line @@ -153,7 +153,8 @@ List a single line. =item l subname -List first window of lines from subroutine. +List first window of lines from subroutine. I<subname> may +be a variable which contains a code reference. =item - @@ -174,6 +175,12 @@ Switch to viewing a different file or eval statement. If C<filename> is not a full filename as found in values of %INC, it is considered as a regexp. +C<eval>ed strings (when accessible) are considered to be filenames: +C<f (eval 7)> and C<f eval 7\b> access the body of the 7th C<eval>ed string +(in the order of execution). The bodies of currently executed C<eval> +and of C<eval>ed strings which define subroutines are saved, thus are +accessible by this mechanism. + =item /pattern/ Search forwards for pattern; final / is optional. @@ -245,7 +252,9 @@ that begin an executable statement. Conditions don't use B<if>: =item b subname [condition] -Set a breakpoint at the first line of the named subroutine. +Set a breakpoint at the first line of the named subroutine. I<subname> may +be a variable which contains a code reference (in this case I<condition> +is not supported). =item b postpone subname [condition] diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 9c040ed835..33ab171746 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -24,10 +24,10 @@ responsibility to ensure that warnings are enabled judiciously. =over 4 -=item STOP is a new keyword +=item CHECK 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 +subroutines named C<CHECK> 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. @@ -149,6 +149,14 @@ needs to be written with additional parentheses now: The behavior remains unaffected when C<not> is not followed by parentheses. +=item Semantics of bareword prototype C<(*)> have changed + +Arguments prototyped as C<*> will now be visible within the subroutine +as either a simple scalar or as a reference to a typeglob. Perl 5.005 +always coerced simple scalar arguments to a typeglob, which wasn't useful +in situations where the subroutine must distinguish between a simple +scalar and a typeglob. See L<perlsub/Prototypes>. + =back =head2 C Source Incompatibilities @@ -242,20 +250,70 @@ change#3386, also needs perlguts documentation =head2 Binary Incompatibilities -The default build of this release is binary compatible with the 5.005 -release or its maintenance versions. +In general, the default build of this release is expected to be binary +compatible for extensions built with the 5.005 release or its maintenance +versions. However, specific platforms may have broken binary compatibility +due to changes in the defaults used in hints files. Therefore, please be +sure to always check the platform-specific README files for any notes to +the contrary. The usethreads or usemultiplicity builds are B<not> binary compatible with the corresponding builds in 5.005. +On platforms that require an explicit list of exports (AIX, OS/2 and Windows, +among others), purely internal symbols such as parser functions and the +run time opcodes are not exported by default. Perl 5.005 used to export +all functions irrespective of whether they were considered part of the +public API or not. + +For the full list of public API functions, see L<perlapi>. + =head1 Installation and Configuration Improvements +=head2 -Dusethreads means something different + +WARNING: Support for threads continues to be an experimental feature. +Interfaces and implementation are subject to sudden and drastic changes. + +The -Dusethreads flag now enables the experimental interpreter-based thread +support by default. To get the flavor of experimental threads that was in +5.005 instead, you need to ask for -Duse5005threads. + +As of v5.5.640, interpreter-threads support is still lacking a way to +create new threads from Perl (i.e., C<use Thread;> will not work with +interpreter threads). C<use Thread;> continues to be available when you +ask for -Duse5005threads, bugs and all. + +=head2 Perl's version numbering has changed + +Beginning with Perl version 5.6, the version number convention has been +changed to a "dotted tuple" scheme that is more commonly found in open +source projects. + +Maintenance versions of v5.6.0 will be released as v5.6.1, v5.6.2 etc. +The next development series following v5.6 will be numbered v5.7.x, +beginning with v5.7.0, and the next major production release following +v5.6 will be v5.8. + +The v1.2.3 syntax is also now legal in Perl. See L<Support for version tuples> +for more on that. + +To cope with the new versioning system's use of at least three significant +digits for each version component, the method used for incrementing the +subversion number has also changed slightly. We assume that versions older +than v5.6 have been incrementing the subversion component in multiples of +10. Versions after v5.6 will increment them by 1. Thus, using the new +notation, 5.005_03 is the same as v5.5.30, and the first maintenance +version following v5.6 will be v5.6.1, which amounts to a floating point +value of 5.006_001). + =head2 New Configure flags The following new flags may be enabled on the Configure command line by running Configure with C<-Dflag>. usemultiplicity + use5005threads uselongdouble usemorebits @@ -320,10 +378,11 @@ building and installing from source, the defaults should be fine. =head2 Unicode and UTF-8 support Perl can optionally use UTF-8 as its internal representation for character -strings. The C<utf8> pragma enables this support in the current lexical -scope. See L<utf8> for more information. +strings. The C<utf8> and C<byte> pragmas are used to control this support +in the current lexical scope. See L<perlunicode>, L<utf8> and L<byte> for +more information. -=head2 Interpreter threads +=head2 Interpreter cloning, threads, and concurrency WARNING: This is an experimental feature in a pre-alpha state. Use at your own risk. @@ -347,24 +406,24 @@ 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. +Support for cloning interpreters and interpreter concurrency can be +enabled using the -Dusethreads Configure option (see win32/Makefile for +how to enable it on Windows.) The resulting perl executable will be +functionally identical to one that was built with -Dmultiplicity, 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. +-Dusethreads enables, the cpp macros USE_ITHREADS by default, which 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. +concurrently in different threads. -Dusethreads only provides the +additional functionality of the perl_clone() API call and other +support for running B<cloned> interpreters concurrently. [XXX TODO - the Compiler backends may be broken when USE_ITHREADS is enabled.] @@ -381,23 +440,74 @@ WARNING: This is an experimental feature. change#4081 [TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>, -Tuomas Lukka <lukka@fas.harvard.edu>)] +Tuomas Lukka <lukka@iki.fi>)] =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>. +package that was current where the variable was declared. 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 Support for version tuples + +Literals of the form v1.2.3.4 are now parsed as the utf8 string +C<"\x{1}\x{2}\x{3}\x{4}">. This allows comparing version numbers using +regular string comparison operators C<eq>, C<ne>, C<lt>, C<gt> etc. + +These "dotted tuples" are dual-valued. They are both strings of utf8 +characters, and floating point numbers. Thus v1.2.3.4 has the string +value C<"\x{1}\x{2}\x{3}\x{4}"> and the numeric value 1.002_003_004. +As another example, v5.5.640 has the string value C<"\x{5}\x{5}\x{280}"> +(remember 280 hexadecimal is 640 decimal) and the numeric value +5.005_64. + +In conjunction with the new C<$^V> magic variable (which contains +the perl version in this format), such literals can be used to +check if you're running a particular version of Perl. + + if ($^V and $^V gt v5.5.640) { + # new style version numbers are supported + } + +C<require> and C<use> also support such literals: + + require v5.6.0; # croak if $^V lt v5.6.0 + use v5.6.0; # same, but croaks at compile-time + +C<sprintf> and C<printf> support the Perl-specific format type C<%v> +to print arbitrary strings as dotted tuples. + + printf "v%v", $^V; # prints current version, such as "v5.5.650" =head2 Weak references WARNING: This is an experimental feature. -change#3385, also need perlguts documentation +In previous versions of Perl, you couldn't cache objects so as +to allow them to be deleted if the last reference from outside +the cache is deleted. The reference in the cache would hold a +reference count on the object and the objects would never be +destroyed. + +Another familiar problem is with circular references. When an +object references itself, its reference count would never go +down to zero, and it would not get destroyed until the program +is about to exit. + +Weak references solve this by allowing you to "weaken" any +reference, that is, make it not count towards the reference count. +When the last non-weak reference to an object is deleted, the object +is destroyed and all the weak references to the object are +automatically undef-ed. -[TODO - Tuomas Lukka <lukka@fas.harvard.edu>] +To use this feature, you need the WeakRef package from CPAN, which +contains additional documentation. + +change#3385, also need perlguts documentation +[TODO - Tuomas Lukka <lukka@iki.fi>] =head2 File globbing implemented internally @@ -425,6 +535,12 @@ 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() is supported on subroutine names + +The exists() builtin now works on subroutine names. A subroutine +is considered to exist if it has been declared (even if implicitly). +See L<perlfunc/exists> for examples. + =head2 exists() and delete() are supported on array elements The exists() and delete() builtins now work on simple arrays as well. @@ -447,16 +563,17 @@ See L<perlfunc/exists> and L<perlfunc/delete> for examples. The length argument of C<syswrite()> has become optional. -=head2 Filehandles can be autovivified +=head2 File and directory handles 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: +handle constructors (open(), opendir(), pipe(), socketpair(), sysopen(), +socket(), and accept()) now autovivify a file or directory handle +if the handle passed to them is an uninitialized scalar variable. This +allows the constructs such as 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, "@_" @@ -529,7 +646,9 @@ start losing precision (their lower digits). If you have filesystems that support "large files" (files larger than 2 gigabytes), you may now also be able to create and access them from Perl. You have to use Configure -Duselargefiles. Turning on the -large file support turns on also the 64-bit support, for obvious reasons. +large file support turns on also the 64-bit support on many platforms. +Beware that unless your filesystem also supports "sparse files" seeking +to umpteen petabytes may be unadvisable. Note that in addition to requiring a proper file system to do large files you may also need to adjust your per-process (or your @@ -552,13 +671,13 @@ 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 -range of precision of your double precision floating point numbers +range and precision of your double precision floating point numbers (that is, Perl's numbers). Use Configure -Duselongdouble to enable this support (if it is available). =head2 "more bits" -You can Configure -Dusemorebits to turn on both the 64-bit support +You can "Configure -Dusemorebits" to turn on both the 64-bit support and the long double support. =head2 Enhanced support for sort() subroutines @@ -660,14 +779,24 @@ acquire special meaning in any future version of Perl. Formerly, if you wanted to mark a subroutine as being a method call or as requiring an automatic lock() when it is entered, you had to declare that with a C<use attrs> pragma in the body of the subroutine. -That can now be accomplished with a declaration syntax, like this: +That can now be accomplished with declaration syntax, like this: + + sub mymethod : locked method ; + ... + sub mymethod : locked method { + ... + } - sub mymethod : locked, method ; + sub othermethod :locked :method ; ... - sub mymethod : locked, method { + sub othermethod :locked :method { ... } + +(Note how only the first C<:> is mandatory, and whitespace surrounding +the C<:> is optional.) + F<AutoSplit.pm> and F<SelfLoader.pm> have been updated to keep the attributes with the stubs they provide. See L<attributes>. @@ -711,6 +840,12 @@ 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 New variable $^V contains Perl version in v5.6.0 format + +C<$^V> contains the Perl version number as a version tuple that +can be used in string or numeric comparisons. See +C<Support for version tuples> for an example. + =head2 Optional Y2K warnings If Perl is built with the cpp macro C<PERL_Y2KWARN> defined, @@ -724,9 +859,10 @@ See L<INSTALL> and L<README.Y2K>. =head2 E<lt>HANDLEE<gt> on empty files -With C<$/> set to C<undef>, slurping an empty file returns a string of +With C<$/> set to C<undef>, "slurping" an empty file returns a string of zero length (instead of C<undef>, as it used to) the first time the -HANDLE is read. Further reads yield C<undef>. +HANDLE is read after C<$/> is set to C<undef>. Further reads yield +C<undef>. This means that the following will append "foo" to an empty file (it used to do nothing): @@ -907,7 +1043,7 @@ 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. +See L<CHECK blocks> for how to run things when the compile phase ends. =head2 Potential to leak DATA filehandles @@ -1072,6 +1208,14 @@ 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. +The glob() operator is implemented via the L<File::Glob> extension, +which supports glob syntax of the C shell. This increases the flexibility +of the glob() operator, but there may be compatibility issues for +programs that relied on the older globbing syntax. If you want to +preserve compatibility with the older syntax, you might want to put +a C<use File::DosGlob;> in your program. For details and compatibility +information, see L<File::Glob>. + [TODO - GSAR] =head1 New tests @@ -1114,6 +1258,10 @@ File test operators. Verify operations that access pad objects (lexicals and temporaries). +=item op/exists_sub + +Verify C<exists &sub> operations. + =back =head1 Modules and Pragmata @@ -1239,10 +1387,12 @@ change#4135, also needs docs in module pod =item Fcntl More Fcntl constants added: F_SETLK64, F_SETLKW64, O_LARGEFILE for -large (more than 4G) file access (64-bit support is not yet -working, though, so no need to get overly excited), Free/Net/OpenBSD -locking behaviour flags F_FLOCK, F_POSIX, Linux F_SHLCK, and -O_ACCMODE: the mask of O_RDONLY, O_WRONLY, and O_RDWR. +large file (more than 4GB) access Note that the O_LARGEFILE is +automatically/transparently added to sysopen() flags if large file +support has been configured), Free/Net/OpenBSD locking behaviour flags +F_FLOCK, F_POSIX, Linux F_SHLCK, and O_ACCMODE: the combined mask of +O_RDONLY, O_WRONLY, and O_RDWR. Also SEEK_SET, SEEK_CUR, and SEEK_END +added for one-stop shopping of the seek/sysseek constants. =item File::Compare @@ -1390,9 +1540,66 @@ act as mutators (accessor $z->Re(), mutator $z->Re(3)). A little bit of radial trigonometry (cylindrical and spherical), radial coordinate conversions, and the great circle distance were added. -=item Pod::Parser +=item Pod::Parser, Pod::InputObjects + +Pod::Parser is a base class for parsing and selecting sections of +pod documentation from an input stream. This module takes care of +identifying pod paragraphs and commands in the input and hands off the +parsed paragraphs and commands to user-defined methods which are free +to interpret or translate them as they see fit. + +Pod::InputObjects defines some input objects needed by Pod::Parser, and +for advanced users of Pod::Parser that need more about a command besides +its name and text. + +As of release 5.6 of Perl, Pod::Parser is now the officially sanctioned +"base parser code" recommended for use by all pod2xxx translators. +Pod::Text (pod2text) and Pod::Man (pod2man) have already been converted +to use Pod::Parser and efforts to convert Pod::HTML (pod2html) are already +underway. For any questions or comments about pod parsing and translating +issues and utilities, please use the pod-people@perl.org mailing list. + +For further information, please see L<Pod::Parser> and L<Pod::InputObjects>. + +=item Pod::Checker, podchecker + +This utility checks pod files for correct syntax, according to +L<perlpod>. Obvious errors are flagged as such, while warnings are +printed for mistakes that can be handled gracefully. The checklist is +not complete yet. See L<Pod::Checker>. + +=item Pod::ParseUtils, Pod::Find + +These modules provide a set of gizmos that are useful mainly for pod +translators. L<Pod::Find|Pod::Find> traverses directory structures and +returns found pod files, along with their canonical names (like +C<File::Spec::Unix>). L<Pod::ParseUtils|Pod::ParseUtils> contains +B<Pod::List> (useful for storing pod list information), B<Pod::Hyperlink> +(for parsing the contents of C<LE<gt>E<lt>> sequences) and B<Pod::Cache> +(for caching information about pod files, e.g. link nodes). + +=item Pod::Select, podselect + +Pod::Select is a subclass of Pod::Parser which provides a function +named "podselect()" to filter out user-specified sections of raw pod +documentation from an input stream. podselect is a script that provides +access to Pod::Select from other scripts to be used as a filter. +See L<Pod::Select>. + +=item Pod::Usage, pod2usage -[TODO - Brad Appleton <bradapp@enteract.com>] +Pod::Usage provides the function "pod2usage()" to print usage messages for +a Perl script based on its embedded pod documentation. The pod2usage() +function is generally useful to all script authors since it lets them +write and maintain a single source (the pods) for documentation, thus +removing the need to create and maintain redundant usage message text +consisting of information already in the pods. + +There is also a pod2usage script which can be used from other kinds of +scripts to print usage messages from pods (even for non-Perl scripts +with pods embedded in comments). + +For details and examples, please see L<Pod::Usage>. =item Pod::Text and Pod::Man @@ -1409,6 +1616,11 @@ 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 Sys::Syslog + +Sys::Syslog now uses XSUBs to access facilities from syslog.h so it +no longer requires syslog.ph to exist. + =item Time::Local The timelocal() and timegm() functions used to silently return bogus @@ -1462,10 +1674,6 @@ syntax. See L<perlsub/"Subroutine Attributes"> and L<attributes>. C<use utf8> to enable UTF-8 and Unicode support. -C<use caller 'encoding'> allows modules to inherit pragmatic attributes -from the caller's context. C<encoding> is currently the only supported -attribute. - Lexical warnings pragma, C<use warnings;>, to control optional warnings. See L<perllexwarn>. @@ -1499,6 +1707,10 @@ change#4232 =over 4 +=item perlapi.pod + +The official list of public Perl API functions. + =item perlcompile.pod An introduction to using the Perl Compiler suite. @@ -1511,6 +1723,11 @@ An introduction to writing Perl source filters. Some guidelines for hacking the Perl source code. +=item perlintern.pod + +A list of internal functions in the Perl source code. +(List is currently empty.) + =item perlopentut.pod A tutorial on using open() effectively. @@ -1523,17 +1740,34 @@ A tutorial that introduces the essentials of references. A tutorial on managing class data for object modules. +=item perlunicode.pod + +An introduction to Unicode support features in Perl. + =back =head1 New or Changed Diagnostics =over 4 +=item "%s" variable %s masks earlier declaration in same %s + +(W) A "my" or "our" variable has been redeclared in the current scope or statement, +effectively eliminating all access to the previous instance. This is almost +always a typographical error. Note that the earlier variable will still exist +until the end of the scope or until all closure referents to it are +destroyed. + =item "my sub" not yet implemented (F) Lexically scoped subroutines are not yet implemented. Don't try that yet. +=item "our" variable %s redeclared + +(W) You seem to have already declared the same global once before in the +current lexical scope. + =item '!' allowed only after types %s (F) The '!' is allowed in pack() and unpack() only after certain types. @@ -1592,6 +1826,30 @@ 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 argument is not a HASH or ARRAY element + +(F) The argument to exists() must be a hash or array element, such as: + + $foo{$bar} + $ref->[12]->["susie"] + +=item %s argument is not a HASH or ARRAY element or slice + +(F) The argument to delete() must be either a hash or array element, such as: + + $foo{$bar} + $ref->[12]->["susie"] + +or a hash or array slice, such as: + + @foo[$bar, $baz, $xyzzy] + @{$ref->[12]}{"susie", "queue"} + +=item %s argument is not a subroutine name + +(F) The argument to exists() for C<exists &sub> must be a subroutine +name, and not a subroutine call. C<exists &sub()> will generate this error. + =item %s package attribute may clash with future reserved word: %s (W) A lowercase attribute name was used that had a package-specific handler. @@ -1654,6 +1912,17 @@ so it was truncated to the string shown. (P) For some reason you can't check the filesystem of the script for nosuid. +=item Can't declare class for non-scalar %s in "%s" + +(S) Currently, only scalar variables can declared with a specific class +qualifier in a "my" or "our" declaration. The semantics may be extended +for other types of variables in future. + +=item Can't declare %s in "%s" + +(F) Only scalar, array, and hash variables may be declared as "my" or +"our" variables. They must have ordinary identifiers as names. + =item Can't ignore signal CHLD, forcing to default (W) Perl has detected that it is being run with the SIGCHLD signal @@ -1739,6 +2008,11 @@ just use C<if (%hash) { # not empty }> for example. See Server error. +=item Did you mean "local" instead of "our"? + +(W) Remember that "our" does not localize the declared global variable. +You have declared it again in the same lexical scope, which seems superfluous. + =item Document contains no data See Server error. @@ -1763,6 +2037,19 @@ intended it to be a read/write filehandle, you needed to open it with you intended only to read from the file, use "E<lt>". See L<perlfunc/open>. +=item flock() on closed filehandle %s + +(W) The filehandle you're attempting to flock() got itself closed some +time before now. Check your logic flow. flock() operates on filehandles. +Are you attempting to call flock() on a dirhandle by the same name? + +=item Global symbol "%s" requires explicit package name + +(F) You've said "use strict vars", which indicates that all variables +must either be lexically scoped (using "my"), declared beforehand using +"our", or explicitly qualified to say which package the global variable +is in (using "::"). + =item Hexadecimal number > 0xffffffff non-portable (W) The hexadecimal number you specified is larger than 2**32-1 @@ -1824,14 +2111,14 @@ 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 +(F) Something other than a colon or whitespace was seen between the elements of an attribute list. If the previous attribute 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 +(F) Something other than a colon 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. @@ -1866,6 +2153,22 @@ construction, but the command was missing or blank. (F) The reserved syntax for lexically scoped subroutines requires that they have a name with which they can be found. +=item No %s specified for -%c + +(F) The indicated command line switch needs a mandatory argument, but +you haven't specified one. + +=item No package name allowed for variable %s in "our" + +(F) Fully qualified variable names are not allowed in "our" declarations, +because that doesn't make much sense under existing semantics. Such +syntax is reserved for future extensions. + +=item No space allowed after -%c + +(F) The argument to the indicated command line switch must follow immediately +after the switch, without intervening spaces. + =item no UTC offset information; assuming local time is UTC (S) A warning peculiar to VMS. Perl was unable to find the local @@ -1896,6 +2199,18 @@ reference. (P) Failed an internal consistency check while trying to reset all weak references to an object. +=item Parentheses missing around "%s" list + +(W) You said something like + + my $foo, $bar = @_; + +when you meant + + my ($foo, $bar) = @_; + +Remember that "my", "our" and "local" bind closer than comma. + =item Possible Y2K bug: %s (W) You are concatenating the number 19 with another number, which @@ -1957,8 +2272,8 @@ L<perlvms>) so that the environ array isn't the target of the change to =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<|->. +of valid modes: C<E<lt>>, C<E<gt>>, C<E<gt>E<gt>>, C<+E<lt>>, +C<+E<gt>>, C<+E<gt>E<gt>>, C<-|>, C<|E<45>>. =item Unknown process %x sent message to prime_env_iter: %s diff --git a/pod/perldiag.pod b/pod/perldiag.pod index f82cd25409..39112035fb 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -31,6 +31,14 @@ C<"%(-?@> sort before the letters, while C<[> and C<\> sort after. =over 4 +=item "%s" variable %s masks earlier declaration in same %s + +(W) A "my" or "our" variable has been redeclared in the current scope or statement, +effectively eliminating all access to the previous instance. This is almost +always a typographical error. Note that the earlier variable will still exist +until the end of the scope or until all closure referents to it are +destroyed. + =item "my sub" not yet implemented (F) Lexically scoped subroutines are not yet implemented. Don't try that @@ -42,19 +50,16 @@ yet. to try to declare one with a package qualifier on the front. Use local() if you want to localize a package variable. -=item "my" variable %s masks earlier declaration in same %s - -(W) A lexical variable has been redeclared in the current scope or statement, -effectively eliminating all access to the previous instance. This is almost -always a typographical error. Note that the earlier variable will still exist -until the end of the scope or until all closure referents to it are -destroyed. - =item "no" not allowed in expression (F) The "no" keyword is recognized and executed at compile time, and returns no useful value. See L<perlmod>. +=item "our" variable %s redeclared + +(W) You seem to have already declared the same global once before in the +current lexical scope. + =item "use" not allowed in expression (F) The "use" keyword is recognized and executed at compile time, and returns @@ -159,6 +164,11 @@ or a hash or array slice, such as: @foo[$bar, $baz, $xyzzy] @{$ref->[12]}{"susie", "queue"} +=item %s argument is not a subroutine name + +(F) The argument to exists() for C<exists &sub> must be a subroutine +name, and not a subroutine call. C<exists &sub()> will generate this error. + =item %s did not return a true value (F) A required (or used) file must return a true value to indicate that @@ -280,7 +290,7 @@ the string being unpacked. See L<perlfunc/pack>. (F) You wrote C<require E<lt>fileE<gt>> when you should have written C<require 'file'>. -=item accept() on closed socket +=item accept() on closed socket %s (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>. @@ -518,7 +528,7 @@ likely depends on its correct operation, Perl just gave up. (4294967295) and therefore non-portable between systems. See L<perlport> for more on portability concerns. -=item bind() on closed socket +=item bind() on closed socket %s (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>. @@ -679,10 +689,16 @@ only with arrays that have a hash reference at index 0. (P) An error peculiar to VMS. The process is suffering from exhausted quotas or other plumbing problems. -=item Can't declare %s in my +=item Can't declare class for non-scalar %s in "%s" + +(S) Currently, only scalar variables can declared with a specific class +qualifier in a "my" or "our" declaration. The semantics may be extended +for other types of variables in future. -(F) Only scalar, array, and hash variables may be declared as lexical variables. -They must have ordinary identifiers as names. +=item Can't declare %s in "%s" + +(F) Only scalar, array, and hash variables may be declared as "my" or +"our" variables. They must have ordinary identifiers as names. =item Can't do inplace edit on %s: %s @@ -1187,7 +1203,7 @@ than in the regular expression engine; or rewriting the regular expression so that it is simpler or backtracks less. (See L<perlbook> for information on I<Mastering Regular Expressions>.) -=item connect() on closed socket +=item connect() on closed socket %s (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>. @@ -1202,13 +1218,13 @@ See L<perlsub/"Constant Functions"> and L<constant>. =item Constant subroutine %s redefined -(S) You redefined a subroutine which had previously been eligible for +(S|W) You redefined a subroutine which had previously been eligible for inlining. See L<perlsub/"Constant Functions"> for commentary and workarounds. =item Constant subroutine %s undefined -(S) You undefined a subroutine which had previously been eligible for +(W) You undefined a subroutine which had previously been eligible for inlining. See L<perlsub/"Constant Functions"> for commentary and workarounds. @@ -1273,6 +1289,11 @@ See Server error. (W) You probably referred to an imported subroutine &FOO as $FOO or some such. +=item Did you mean "local" instead of "our"? + +(W) Remember that "our" does not localize the declared global variable. +You have declared it again in the same lexical scope, which seems superfluous. + =item Did you mean $ or @ instead of %? (W) You probably said %hash{$key} when you meant $hash{$key} or @hash{@keys}. @@ -1321,7 +1342,7 @@ unlikely to be what you want. =item %s failed--call queue aborted -(F) An untrapped exception was raised while executing a STOP, INIT, or +(F) An untrapped exception was raised while executing a CHECK, INIT, or END subroutine. Processing of the remainder of the queue of such routines has been prematurely ended. @@ -1453,6 +1474,12 @@ a literal "at" sign, or was meant to introduce a variable name that happens to be missing. So you have to put either the backslash or the name. +=item flock() on closed filehandle %s + +(W) The filehandle you're attempting to flock() got itself closed some +time before now. Check your logic flow. flock() operates on filehandles. +Are you attempting to call flock() on a dirhandle by the same name? + =item Format %s redefined (W) You redefined a format. To suppress this warning, say @@ -1489,7 +1516,7 @@ when you meant because if it did, it'd feel morally obligated to return every hostname on the Internet. -=item get%sname() on closed socket +=item get%sname() on closed socket %s (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? @@ -1509,8 +1536,9 @@ the line, and you really meant a "less than". =item Global symbol "%s" requires explicit package name (F) You've said "use strict vars", which indicates that all variables -must either be lexically scoped (using "my"), or explicitly qualified to -say which package the global variable is in (using "::"). +must either be lexically scoped (using "my"), declared beforehand using +"our", or explicitly qualified to say which package the global variable +is in (using "::"). =item goto must have label @@ -1556,22 +1584,11 @@ line was ignored. =item Illegal character %s (carriage return) -(F) A carriage return character was found in the input. This is an -error, and not a warning, because carriage return characters can break -multi-line strings, including here documents (e.g., C<print E<lt>E<lt>EOF;>). - -Under Unix, this error is usually caused by executing Perl code -- -either the main program, a module, or an eval'd string -- that was -transferred over a network connection from a non-Unix system without -properly converting the text file format. - -Under systems that use something other than '\n' to delimit lines of -text, this error can also be caused by reading Perl code from a file -handle that is in binary mode (as set by the C<binmode> operator). - -In either case, the Perl code in question will probably need to be -converted with something like C<s/\x0D\x0A?/\n/g> before it can be -executed. +(F) Perl normally treats carriage returns in the program text as it +would any other whitespace, which means you should never see this +error when Perl was built using standard options. For some reason, +your version of Perl appears to have been built without this support. +Talk to your Perl administrator. =item Illegal division by zero @@ -1717,7 +1734,7 @@ See L<perlfunc/sprintf>. =item Invalid separator character %s in attribute list -(F) Something other than a comma or whitespace was seen between the +(F) Something other than a colon or whitespace was seen between the elements of an attribute list. If the previous attribute had a parenthesised parameter list, perhaps that list was terminated too soon. See L<attributes>. @@ -1766,7 +1783,7 @@ L<perlfunc/last>. (F) While under the C<use filetest> pragma, switching the real and effective uids or gids failed. -=item listen() on closed socket +=item listen() on closed socket %s (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>. @@ -1978,6 +1995,12 @@ where you wanted to redirect stdout. and found a 'E<gt>' or a 'E<gt>E<gt>' on the command line, but can't find the name of the file to which to write data destined for stdout. +=item No package name allowed for variable %s in "our" + +(F) Fully qualified variable names are not allowed in "our" declarations, +because that doesn't make much sense under existing semantics. Such +syntax is reserved for future extensions. + =item No Perl script found in input (F) You called C<perl -x>, but no line was found in the file beginning @@ -2136,9 +2159,15 @@ on portability concerns. See also L<perlport> for writing portable code. +=item Octal number in vector unsupported + +(F) Numbers with a leading C<0> are not currently allowed in vectors. The +octal number interpretation of such numbers may be supported in a future +version. + =item Odd number of elements in hash assignment -(S) You specified an odd number of elements to initialize a hash, which +(W) You specified an odd number of elements to initialize a hash, which is odd, because hashes come in key/value pairs. =item Offset outside string @@ -2384,7 +2413,7 @@ when you meant my ($foo, $bar) = @_; -Remember that "my" and "local" bind closer than comma. +Remember that "my", "our" and "local" bind closer than comma. =item Perl %3.3f required--this is only version %s, stopped @@ -2654,7 +2683,7 @@ that had previously been marked as free. (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 %s (W) The socket you're sending to got itself closed sometime before now. Check your logic flow. @@ -2743,7 +2772,7 @@ because the world might have written on it already. (F) You don't have System V shared memory IPC on your system. -=item shutdown() on closed socket +=item shutdown() on closed socket %s (W) You tried to do a shutdown on a closed socket. Seems a bit superfluous. @@ -2881,7 +2910,7 @@ into Perl yourself. 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 %s (W) The filehandle you're writing to got itself closed sometime before now. Check your logic flow. @@ -3103,8 +3132,8 @@ representative, who probably put it there in the first place. =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<|->. +of valid modes: C<E<lt>>, C<E<gt>>, C<E<gt>E<gt>>, C<+E<lt>>, +C<+E<gt>>, C<+E<gt>E<gt>>, C<-|>, C<|E<45>>. =item Unknown process %x sent message to prime_env_iter: %s @@ -3492,7 +3521,7 @@ already have a subroutine of that name declared, which means that Perl 5 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 %cetsockopt() on closed fd +=item %cetsockopt() on closed socket %s (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? @@ -3562,3 +3591,4 @@ in F<README.os2>. =back +=cut diff --git a/pod/perlfaq2.pod b/pod/perlfaq2.pod index 80b150d89c..3b0a79ffee 100644 --- a/pod/perlfaq2.pod +++ b/pod/perlfaq2.pod @@ -344,7 +344,7 @@ following list is I<not> the complete list of CPAN mirrors. 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. Perl Mongers attempts to maintain a +subscription information. The Perl Mongers attempt to maintain a list of mailing lists at: http://www.perl.org/support/online_support.html#mail diff --git a/pod/perlfilter.pod b/pod/perlfilter.pod index a2eb1d855b..d5fae925b1 100644 --- a/pod/perlfilter.pod +++ b/pod/perlfilter.pod @@ -19,12 +19,10 @@ 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. +read it from a file into memory for parsing and compilation. 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 diff --git a/pod/perlfork.pod b/pod/perlfork.pod index 533dcfab31..d930e9396e 100644 --- a/pod/perlfork.pod +++ b/pod/perlfork.pod @@ -172,6 +172,73 @@ 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 Forking pipe open() not yet implemented + +The C<open(FOO, "|-")> and C<open(BAR, "-|")> constructs are not yet +implemented. This limitation can be easily worked around in new code +by creating a pipe explicitly. The following example shows how to +write to a forked child: + + # simulate open(FOO, "|-") + sub pipe_to_fork ($) { + my $parent = shift; + pipe my $child, $parent or die; + my $pid = fork(); + die "fork() failed: $!" unless defined $pid; + if ($pid) { + close $child; + } + else { + close $parent; + open(STDIN, "<&=" . fileno($child)) or die; + } + $pid; + } + + if (pipe_to_fork('FOO')) { + # parent + print FOO "pipe_to_fork\n"; + close FOO; + } + else { + # child + while (<STDIN>) { print; } + close STDIN; + exit(0); + } + +And this one reads from the child: + + # simulate open(FOO, "-|") + sub pipe_from_fork ($) { + my $parent = shift; + pipe $parent, my $child or die; + my $pid = fork(); + die "fork() failed: $!" unless defined $pid; + if ($pid) { + close $child; + } + else { + close $parent; + open(STDOUT, ">&=" . fileno($child)) or die; + } + $pid; + } + + if (pipe_from_fork('BAR')) { + # parent + while (<BAR>) { print; } + close BAR; + } + else { + # child + print "pipe_from_fork\n"; + close STDOUT; + exit(0); + } + +Forking pipe open() constructs will be supported in future. + =item Global state maintained by XSUBs External subroutines (XSUBs) that maintain their own global state may @@ -217,6 +284,8 @@ representation for pseudo-process IDs will be implemented in future. This document may be incomplete in some respects. +=back + =head1 AUTHOR Support for concurrent interpreters and the fork() emulation was implemented diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index d730b43e47..88cbb0a6e5 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -523,8 +523,8 @@ C<eval EXPR> statement. In particular, for a C<eval BLOCK> statement, $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 -C<use utf8>. +compiled with. The C<$hints> value is subject to change between versions +of Perl, and is not meant for external use. Furthermore, when called from within the DB package, caller returns more detailed information: it sets the list variable C<@DB::args> to be the @@ -539,8 +539,10 @@ previous time C<caller> was called. =item chdir EXPR Changes the working directory to EXPR, if possible. If EXPR is omitted, -changes to the user's home directory. Returns true upon success, -false otherwise. See the example under C<die>. +changes to the directory specified by C<$ENV{HOME}>, if set; if not, +changes to the directory specified by C<$ENV{LOGDIR}>. If neither is +set, C<chdir> does nothing. It returns true upon success, false +otherwise. See the example under C<die>. =item chmod LIST @@ -1422,8 +1424,16 @@ element is not autovivified if it doesn't exist. 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. +Given an expression that specifies the name of a subroutine, +returns true if the specified subroutine has ever been declared, even +if it is undefined. Mentioning a subroutine name for exists or defined +does not count as declaring it. + + print "Exists\n" if exists &subroutine; + print "Defined\n" if defined &subroutine; + Note that the EXPR can be arbitrarily complicated as long as the final -operation is a hash or array key lookup: +operation is a hash or array key lookup or subroutine name: if (exists $ref->{A}->{B}->{$key}) { } if (exists $hash{A}{B}{$key}) { } @@ -1431,6 +1441,8 @@ operation is a hash or array key lookup: if (exists $ref->{A}->{B}->[$ix]) { } if (exists $hash{A}{B}[$ix]) { } + if (exists &{$ref->{A}{B}{$key}}) { } + 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 @@ -1448,6 +1460,12 @@ release. See L<perlref/"Pseudo-hashes"> for specifics on how exists() acts when used on a pseudo-hash. +Use of a subroutine call, rather than a subroutine name, as an argument +to exists() is an error. + + exists ⊂ # OK + exists &sub(); # Error + =item exit EXPR Evaluates EXPR and exits immediately with that value. Example: @@ -1541,11 +1559,11 @@ in the way of your getting your job done.) OPERATION is one of LOCK_SH, LOCK_EX, or LOCK_UN, possibly combined with LOCK_NB. These constants are traditionally valued 1, 2, 8 and 4, but -you can use the symbolic names if import them from the Fcntl module, +you can use the symbolic names if you import them from the Fcntl module, either individually, or as a group using the ':flock' tag. LOCK_SH requests a shared lock, LOCK_EX requests an exclusive lock, and LOCK_UN -releases a previously requested lock. If LOCK_NB is added to LOCK_SH or -LOCK_EX then C<flock> will return immediately rather than blocking +releases a previously requested lock. If LOCK_NB is bitwise-or'ed with +LOCK_SH or LOCK_EX then C<flock> will return immediately rather than blocking waiting for the lock (check the return status to see if you got it). To avoid the possibility of miscoordination, Perl now flushes FILEHANDLE @@ -3508,13 +3526,16 @@ for this. Other restrictions include whether it works on directories, open files, or pre-existing files. Check L<perlport> and either the rename(2) manpage or equivalent system documentation for details. +=item require VERSION + =item require EXPR =item require Demands some semantics specified by EXPR, or by C<$_> if EXPR is not -supplied. If EXPR is numeric, demands that the current version of Perl -(C<$]> or $PERL_VERSION) be equal or greater than EXPR. +supplied. If a version number or tuple is specified, or if EXPR is +numeric, demands that the current version of Perl +(C<$^V> or C<$]> or $PERL_VERSION) be equal or greater than EXPR. Otherwise, demands that a library file be included if it hasn't already been included. The file is included via the do-FILE mechanism, which is @@ -3886,7 +3907,7 @@ array by 1 and moving everything down. If there are no elements in the 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<INIT {}>, C<STOP {}>, and C<END {}> +the C<eval ''>, C<BEGIN {}>, C<INIT {}>, C<CHECK {}>, and C<END {}> constructs. See also C<unshift>, C<push>, and C<pop>. C<Shift()> and C<unshift> do the @@ -4289,6 +4310,10 @@ In addition, Perl permits the following widely-supported conversions: %n special: *stores* the number of characters output so far into the next variable in the parameter list +And the following Perl-specific conversion: + + %v a string, output as a tuple of integers ("Perl" is 80.101.114.108) + Finally, for backward (and we do mean "backward") compatibility, Perl permits these unnecessary but widely-supported conversions: @@ -5125,13 +5150,17 @@ package. It is exactly equivalent to except that Module I<must> be a bareword. -If the first argument to C<use> is a number, it is treated as a version -number instead of a module name. If the version of the Perl interpreter -is less than VERSION, then an error message is printed and Perl exits -immediately. This is often useful if you need to check the current -Perl version before C<use>ing library modules that have changed in -incompatible ways from older versions of Perl. (We try not to do -this more than we have to.) +If the first argument to C<use> is a number or a version tuple, it is +treated as a version instead of a module name. If the version +of the Perl interpreter is less than VERSION, then an error message +is printed and Perl exits immediately. + + use 5.005_03; # version number + use v5.6.0; # version tuple + +This is often useful if you need to check the current Perl version before +C<use>ing library modules that have changed in incompatible ways from +older versions of Perl. (We try not to do this more than we have to.) The C<BEGIN> forces the C<require> and C<import> to happen at compile time. The C<require> makes sure the module is loaded into memory if it hasn't been @@ -5141,8 +5170,7 @@ features back into the current package. The module can implement its C<import> method any way it likes, though most modules just choose to derive their C<import> method via inheritance from the C<Exporter> class that is defined in the C<Exporter> module. See L<Exporter>. If no C<import> -method can be found then the error is currently silently ignored. This -may change to a fatal error in a future version. +method can be found then the call is skipped. If you don't want your namespace altered, explicitly supply an empty list: @@ -5245,9 +5273,13 @@ to give the expression the correct precedence as in vec($image, $max_x * $x + $y, 8) = 3; -Vectors created with C<vec> can also be manipulated with the logical -operators C<|>, C<&>, and C<^>, which will assume a bit vector -operation is desired when both operands are strings. +If the selected element is off the end of the string, the value 0 is +returned. If an element off the end of the string is written to, +Perl will first extend the string with sufficiently many zero bytes. + +Strings created with C<vec> can also be manipulated with the logical +operators C<|>, C<&>, C<^>, and C<~>. These operators will assume a bit +vector operation is desired when both operands are strings. See L<perlop/"Bitwise String Operators">. The following code will build up an ASCII string saying C<'PerlPerlPerl'>. diff --git a/pod/perlguts.pod b/pod/perlguts.pod index a8d820ef2e..eec6edca8d 100644 --- a/pod/perlguts.pod +++ b/pod/perlguts.pod @@ -1,12 +1,13 @@ =head1 NAME -perlguts - Perl's Internal Functions +perlguts - Introduction to the Perl API =head1 DESCRIPTION -This document attempts to describe some of the internal functions of the -Perl executable. It is far from complete and probably contains many errors. -Please refer any questions or comments to the author below. +This document attempts to describe how to use the Perl API, as well as containing +some info on the basic workings of the Perl core. It is far from complete +and probably contains many errors. Please refer any questions or +comments to the author below. =head1 Variables @@ -22,11 +23,13 @@ Each typedef has specific routines that manipulate the various data types. =head2 What is an "IV"? -Perl uses a special typedef IV which is a simple integer type that is +Perl uses a special typedef IV which is a simple signed integer type that is guaranteed to be large enough to hold a pointer (as well as an integer). +Additionally, there is the UV, which is simply an unsigned IV. Perl also uses two special typedefs, I32 and I16, which will always be at -least 32-bits and 16-bits long, respectively. +least 32-bits and 16-bits long, respectively. (Again, there are U32 and U16, +as well.) =head2 Working with SVs @@ -87,11 +90,12 @@ in an SV to a C function or system call. To access the actual value that an SV points to, you can use the macros: SvIV(SV*) + SvUV(SV*) SvNV(SV*) SvPV(SV*, STRLEN len) SvPV_nolen(SV*) -which will automatically coerce the actual scalar type into an IV, double, +which will automatically coerce the actual scalar type into an IV, UV, double, or string. In the C<SvPV> macro, the length of the string returned is placed into the @@ -817,6 +821,8 @@ to an C<mg_type> of '\0') contains: Thus, when an SV is determined to be magical and of type '\0', if a get operation is being performed, the routine C<magic_get> is called. All the various routines for the various magical types begin with C<magic_>. +NOTE: the magic routines are not considered part of the Perl API, and may +not be exported by the Perl library. The current kinds of Magic Virtual Tables are: @@ -1218,12 +1224,12 @@ For more information, consult L<perlxs> and L<perlxstut>. There are four routines that can be used to call a Perl subroutine from within a C program. These four are: - I32 perl_call_sv(SV*, I32); - I32 perl_call_pv(const char*, I32); - I32 perl_call_method(const char*, I32); - I32 perl_call_argv(const char*, I32, register char**); + I32 call_sv(SV*, I32); + I32 call_pv(const char*, I32); + I32 call_method(const char*, I32); + I32 call_argv(const char*, I32, register char**); -The routine most often used is C<perl_call_sv>. The C<SV*> argument +The routine most often used is C<call_sv>. The C<SV*> argument contains either the name of the Perl subroutine to be called, or a reference to the subroutine. The second argument consists of flags that control the context in which the subroutine is called, whether @@ -1233,7 +1239,11 @@ trapped, and how to treat return values. All four routines return the number of arguments that the subroutine returned on the Perl stack. -When using any of these routines (except C<perl_call_argv>), the programmer +These routines used to be called C<perl_call_sv> etc., before Perl v5.6.0, +but those names are now deprecated; macros of the same name are provided for +compatibility. + +When using any of these routines (except C<call_argv>), the programmer must manipulate the Perl stack. These include the following macros and functions: @@ -1512,7 +1522,7 @@ additional complications for conditionals). These optimizations are done in the subroutine peep(). Optimizations performed at this stage are subject to the same restrictions as in the pass 2. -=head1 The Perl Internal API +=head1 How multiple interpreters and concurrency are supported WARNING: This information is subject to radical changes prior to the Perl 5.6 release. Use with caution. @@ -1545,13 +1555,20 @@ the Perl source (as it does in so many other situations) makes heavy use of macros and subroutine naming conventions. First problem: deciding which functions will be public API functions and -which will be private. Those functions whose names begin C<Perl_> are -public, and those whose names begin C<S_> are private (think "S" for -"secret" or "static"). - -Some functions have no prefix (e.g., restore_rsfp in toke.c). These -are not parts of the object or pseudo-structure because you need to -pass pointers to them to other subroutines. +which will be private. All functions whose names begin C<S_> are private +(think "S" for "secret" or "static"). All other functions begin with +"Perl_", but just because a function begins with "Perl_" does not mean it is +part of the API. The easiest way to be B<sure> a function is part of the API +is to find its entry in L<perlapi>. If it exists in L<perlapi>, it's part +of the API. If it doesn't, and you think it should be (i.e., you need it fo +r your extension), send mail via L<perlbug> explaining why you think it +should be. + +(L<perlapi> itself is generated by embed.pl, a Perl script that generates +significant portions of the Perl source code. It has a list of almost +all the functions defined by the Perl interpreter along with their calling +characteristics and some flags. Functions that are part of the public API +are marked with an 'A' in its flags.) Second problem: there must be a syntax so that the same subroutine declarations and calls can pass a structure as their first argument, @@ -1766,2107 +1783,11 @@ The Perl engine/interpreter and the host are orthogonal entities. There could be one or more interpreters in a process, and one or more "hosts", with free association between them. -=head1 API LISTING - -This is a listing of functions, macros, flags, and variables that may be -used by extension writers. The interfaces of any functions that are not -listed here are subject to change without notice. For this reason, -blindly using functions listed in proto.h is to be avoided when writing -extensions. - -Note that all Perl API global variables must be referenced with the C<PL_> -prefix. Some macros are provided for compatibility with the older, -unadorned names, but this support may be disabled in a future release. - -The sort order of the listing is case insensitive, with any -occurrences of '_' ignored for the purpose of sorting. - -=over 8 - -=item av_clear - -Clears an array, making it empty. Does not free the memory used by the -array itself. - - void av_clear (AV* ar) - -=item av_extend - -Pre-extend an array. The C<key> is the index to which the array should be -extended. - - void av_extend (AV* ar, I32 key) - -=item av_fetch - -Returns the SV at the specified index in the array. The C<key> is the -index. If C<lval> is set then the fetch will be part of a store. Check -that the return value is non-null before dereferencing it to a C<SV*>. - -See L<Understanding the Magic of Tied Hashes and Arrays> for more -information on how to use this function on tied arrays. - - SV** av_fetch (AV* ar, I32 key, I32 lval) - -=item AvFILL - -Same as C<av_len()>. Deprecated, use C<av_len()> instead. - -=item av_len - -Returns the highest index in the array. Returns -1 if the array is empty. - - I32 av_len (AV* ar) - -=item av_make - -Creates a new AV and populates it with a list of SVs. The SVs are copied -into the array, so they may be freed after the call to av_make. The new AV -will have a reference count of 1. - - AV* av_make (I32 size, SV** svp) - -=item av_pop - -Pops an SV off the end of the array. Returns C<&PL_sv_undef> if the array is -empty. - - SV* av_pop (AV* ar) - -=item av_push - -Pushes an SV onto the end of the array. The array will grow automatically -to accommodate the addition. - - void av_push (AV* ar, SV* val) - -=item av_shift - -Shifts an SV off the beginning of the array. - - SV* av_shift (AV* ar) - -=item av_store - -Stores an SV in an array. The array index is specified as C<key>. The -return value will be NULL if the operation failed or if the value did not -need to be actually stored within the array (as in the case of tied arrays). -Otherwise it can be dereferenced to get the original C<SV*>. Note that the -caller is responsible for suitably incrementing the reference count of C<val> -before the call, and decrementing it if the function returned NULL. - -See L<Understanding the Magic of Tied Hashes and Arrays> for more -information on how to use this function on tied arrays. - - SV** av_store (AV* ar, I32 key, SV* val) - -=item av_undef - -Undefines the array. Frees the memory used by the array itself. - - void av_undef (AV* ar) - -=item av_unshift - -Unshift the given number of C<undef> values onto the beginning of the -array. The array will grow automatically to accommodate the addition. -You must then use C<av_store> to assign values to these new elements. - - void av_unshift (AV* ar, I32 num) - -=item CLASS - -Variable which is setup by C<xsubpp> to indicate the class name for a C++ XS -constructor. This is always a C<char*>. See C<THIS> and -L<perlxs/"Using XS With C++">. - -=item Copy - -The XSUB-writer's interface to the C C<memcpy> function. The C<s> is the -source, C<d> is the destination, C<n> is the number of items, and C<t> is -the type. May fail on overlapping copies. See also C<Move>. - - void Copy( s, d, n, t ) - -=item croak - -This is the XSUB-writer's interface to Perl's C<die> function. Use this -function the same way you use the C C<printf> function. See C<warn>. - -=item CvSTASH - -Returns the stash of the CV. - - HV* CvSTASH( SV* sv ) - -=item PL_DBsingle - -When Perl is run in debugging mode, with the B<-d> switch, this SV is a -boolean which indicates whether subs are being single-stepped. -Single-stepping is automatically turned on after every step. This is the C -variable which corresponds to Perl's $DB::single variable. See C<PL_DBsub>. - -=item PL_DBsub - -When Perl is run in debugging mode, with the B<-d> switch, this GV contains -the SV which holds the name of the sub being debugged. This is the C -variable which corresponds to Perl's $DB::sub variable. See C<PL_DBsingle>. -The sub name can be found by - - SvPV( GvSV( PL_DBsub ), len ) - -=item PL_DBtrace - -Trace variable used when Perl is run in debugging mode, with the B<-d> -switch. This is the C variable which corresponds to Perl's $DB::trace -variable. See C<PL_DBsingle>. - -=item dMARK - -Declare a stack marker variable, C<mark>, for the XSUB. See C<MARK> and -C<dORIGMARK>. - -=item dORIGMARK - -Saves the original stack mark for the XSUB. See C<ORIGMARK>. - -=item PL_dowarn - -The C variable which corresponds to Perl's $^W warning variable. - -=item dSP - -Declares a local copy of perl's stack pointer for the XSUB, available via -the C<SP> macro. See C<SP>. - -=item dXSARGS - -Sets up stack and mark pointers for an XSUB, calling dSP and dMARK. This is -usually handled automatically by C<xsubpp>. Declares the C<items> variable -to indicate the number of items on the stack. - -=item dXSI32 - -Sets up the C<ix> variable for an XSUB which has aliases. This is usually -handled automatically by C<xsubpp>. - -=item do_binmode - -Switches filehandle to binmode. C<iotype> is what C<IoTYPE(io)> would -contain. - - do_binmode(fp, iotype, TRUE); - -=item ENTER - -Opening bracket on a callback. See C<LEAVE> and L<perlcall>. - - ENTER; - -=item EXTEND - -Used to extend the argument stack for an XSUB's return values. - - EXTEND( sp, int x ) - -=item fbm_compile - -Analyses the string in order to make fast searches on it using fbm_instr() -- -the Boyer-Moore algorithm. - - void fbm_compile(SV* sv, U32 flags) - -=item fbm_instr - -Returns the location of the SV in the string delimited by C<str> and -C<strend>. It returns C<Nullch> if the string can't be found. The -C<sv> does not have to be fbm_compiled, but the search will not be as -fast then. - - char* fbm_instr(char *str, char *strend, SV *sv, U32 flags) - -=item FREETMPS - -Closing bracket for temporaries on a callback. See C<SAVETMPS> and -L<perlcall>. - - FREETMPS; - -=item G_ARRAY - -Used to indicate array context. See C<GIMME_V>, C<GIMME> and L<perlcall>. - -=item G_DISCARD - -Indicates that arguments returned from a callback should be discarded. See -L<perlcall>. - -=item G_EVAL - -Used to force a Perl C<eval> wrapper around a callback. See L<perlcall>. - -=item GIMME - -A backward-compatible version of C<GIMME_V> which can only return -C<G_SCALAR> or C<G_ARRAY>; in a void context, it returns C<G_SCALAR>. - -=item GIMME_V - -The XSUB-writer's equivalent to Perl's C<wantarray>. Returns -C<G_VOID>, C<G_SCALAR> or C<G_ARRAY> for void, scalar or array -context, respectively. - -=item G_NOARGS - -Indicates that no arguments are being sent to a callback. See L<perlcall>. - -=item G_SCALAR - -Used to indicate scalar context. See C<GIMME_V>, C<GIMME>, and L<perlcall>. - -=item gv_fetchmeth - -Returns the glob with the given C<name> and a defined subroutine or -C<NULL>. The glob lives in the given C<stash>, or in the stashes -accessible via @ISA and @UNIVERSAL. - -The argument C<level> should be either 0 or -1. If C<level==0>, as a -side-effect creates a glob with the given C<name> in the given -C<stash> which in the case of success contains an alias for the -subroutine, and sets up caching info for this glob. Similarly for all -the searched stashes. - -This function grants C<"SUPER"> token as a postfix of the stash name. - -The GV returned from C<gv_fetchmeth> may be a method cache entry, -which is not visible to Perl code. So when calling C<perl_call_sv>, -you should not use the GV directly; instead, you should use the -method's CV, which can be obtained from the GV with the C<GvCV> macro. - - GV* gv_fetchmeth (HV* stash, const char* name, STRLEN len, I32 level) - -=item gv_fetchmethod - -=item gv_fetchmethod_autoload - -Returns the glob which contains the subroutine to call to invoke the -method on the C<stash>. In fact in the presence of autoloading this may -be the glob for "AUTOLOAD". In this case the corresponding variable -$AUTOLOAD is already setup. - -The third parameter of C<gv_fetchmethod_autoload> determines whether AUTOLOAD -lookup is performed if the given method is not present: non-zero means -yes, look for AUTOLOAD; zero means no, don't look for AUTOLOAD. Calling -C<gv_fetchmethod> is equivalent to calling C<gv_fetchmethod_autoload> with a -non-zero C<autoload> parameter. - -These functions grant C<"SUPER"> token as a prefix of the method name. - -Note that if you want to keep the returned glob for a long time, you -need to check for it being "AUTOLOAD", since at the later time the call -may load a different subroutine due to $AUTOLOAD changing its value. -Use the glob created via a side effect to do this. - -These functions have the same side-effects and as C<gv_fetchmeth> with -C<level==0>. C<name> should be writable if contains C<':'> or C<'\''>. -The warning against passing the GV returned by C<gv_fetchmeth> to -C<perl_call_sv> apply equally to these functions. - - GV* gv_fetchmethod (HV* stash, const char* name) - GV* gv_fetchmethod_autoload (HV* stash, const char* name, I32 autoload) - -=item G_VOID - -Used to indicate void context. See C<GIMME_V> and L<perlcall>. - -=item gv_stashpv - -Returns a pointer to the stash for a specified package. If C<create> is set -then the package will be created if it does not already exist. If C<create> -is not set and the package does not exist then NULL is returned. - - HV* gv_stashpv (const char* name, I32 create) - -=item gv_stashsv - -Returns a pointer to the stash for a specified package. See C<gv_stashpv>. - - HV* gv_stashsv (SV* sv, I32 create) - -=item GvSV - -Return the SV from the GV. - -=item HEf_SVKEY - -This flag, used in the length slot of hash entries and magic -structures, specifies the structure contains a C<SV*> pointer where a -C<char*> pointer is to be expected. (For information only--not to be used). - -=item HeHASH - -Returns the computed hash stored in the hash entry. - - U32 HeHASH(HE* he) - -=item HeKEY - -Returns the actual pointer stored in the key slot of the hash entry. -The pointer may be either C<char*> or C<SV*>, depending on the value of -C<HeKLEN()>. Can be assigned to. The C<HePV()> or C<HeSVKEY()> macros -are usually preferable for finding the value of a key. - - char* HeKEY(HE* he) - -=item HeKLEN - -If this is negative, and amounts to C<HEf_SVKEY>, it indicates the entry -holds an C<SV*> key. Otherwise, holds the actual length of the key. -Can be assigned to. The C<HePV()> macro is usually preferable for finding -key lengths. - - int HeKLEN(HE* he) - -=item HePV - -Returns the key slot of the hash entry as a C<char*> value, doing any -necessary dereferencing of possibly C<SV*> keys. The length of -the string is placed in C<len> (this is a macro, so do I<not> use -C<&len>). If you do not care about what the length of the key is, -you may use the global variable C<PL_na>, though this is rather less -efficient than using a local variable. Remember though, that hash -keys in perl are free to contain embedded nulls, so using C<strlen()> -or similar is not a good way to find the length of hash keys. -This is very similar to the C<SvPV()> macro described elsewhere in -this document. - - char* HePV(HE* he, STRLEN len) - -=item HeSVKEY - -Returns the key as an C<SV*>, or C<Nullsv> if the hash entry -does not contain an C<SV*> key. - - HeSVKEY(HE* he) - -=item HeSVKEY_force - -Returns the key as an C<SV*>. Will create and return a temporary -mortal C<SV*> if the hash entry contains only a C<char*> key. - - HeSVKEY_force(HE* he) - -=item HeSVKEY_set - -Sets the key to a given C<SV*>, taking care to set the appropriate flags -to indicate the presence of an C<SV*> key, and returns the same C<SV*>. - - HeSVKEY_set(HE* he, SV* sv) - -=item HeVAL - -Returns the value slot (type C<SV*>) stored in the hash entry. - - HeVAL(HE* he) - -=item hv_clear - -Clears a hash, making it empty. - - void hv_clear (HV* tb) - -=item hv_delete - -Deletes a key/value pair in the hash. The value SV is removed from the hash -and returned to the caller. The C<klen> is the length of the key. The -C<flags> value will normally be zero; if set to G_DISCARD then NULL will be -returned. - - SV* hv_delete (HV* tb, const char* key, U32 klen, I32 flags) - -=item hv_delete_ent - -Deletes a key/value pair in the hash. The value SV is removed from the hash -and returned to the caller. The C<flags> value will normally be zero; if set -to G_DISCARD then NULL will be returned. C<hash> can be a valid precomputed -hash value, or 0 to ask for it to be computed. - - SV* hv_delete_ent (HV* tb, SV* key, I32 flags, U32 hash) - -=item hv_exists - -Returns a boolean indicating whether the specified hash key exists. The -C<klen> is the length of the key. - - bool hv_exists (HV* tb, const char* key, U32 klen) - -=item hv_exists_ent - -Returns a boolean indicating whether the specified hash key exists. C<hash> -can be a valid precomputed hash value, or 0 to ask for it to be computed. - - bool hv_exists_ent (HV* tb, SV* key, U32 hash) - -=item hv_fetch - -Returns the SV which corresponds to the specified key in the hash. The -C<klen> is the length of the key. If C<lval> is set then the fetch will be -part of a store. Check that the return value is non-null before -dereferencing it to a C<SV*>. - -See L<Understanding the Magic of Tied Hashes and Arrays> for more -information on how to use this function on tied hashes. - - SV** hv_fetch (HV* tb, const char* key, U32 klen, I32 lval) - -=item hv_fetch_ent - -Returns the hash entry which corresponds to the specified key in the hash. -C<hash> must be a valid precomputed hash number for the given C<key>, or -0 if you want the function to compute it. IF C<lval> is set then the -fetch will be part of a store. Make sure the return value is non-null -before accessing it. The return value when C<tb> is a tied hash -is a pointer to a static location, so be sure to make a copy of the -structure if you need to store it somewhere. - -See L<Understanding the Magic of Tied Hashes and Arrays> for more -information on how to use this function on tied hashes. - - HE* hv_fetch_ent (HV* tb, SV* key, I32 lval, U32 hash) - -=item hv_iterinit - -Prepares a starting point to traverse a hash table. - - I32 hv_iterinit (HV* tb) - -Returns the number of keys in the hash (i.e. the same as C<HvKEYS(tb)>). -The return value is currently only meaningful for hashes without tie -magic. - -NOTE: Before version 5.004_65, C<hv_iterinit> used to return the number -of hash buckets that happen to be in use. If you still need that -esoteric value, you can get it through the macro C<HvFILL(tb)>. - -=item hv_iterkey - -Returns the key from the current position of the hash iterator. See -C<hv_iterinit>. - - char* hv_iterkey (HE* entry, I32* retlen) - -=item hv_iterkeysv - -Returns the key as an C<SV*> from the current position of the hash -iterator. The return value will always be a mortal copy of the -key. Also see C<hv_iterinit>. - - SV* hv_iterkeysv (HE* entry) - -=item hv_iternext - -Returns entries from a hash iterator. See C<hv_iterinit>. - - HE* hv_iternext (HV* tb) - -=item hv_iternextsv - -Performs an C<hv_iternext>, C<hv_iterkey>, and C<hv_iterval> in one -operation. - - SV* hv_iternextsv (HV* hv, char** key, I32* retlen) - -=item hv_iterval - -Returns the value from the current position of the hash iterator. See -C<hv_iterkey>. - - SV* hv_iterval (HV* tb, HE* entry) - -=item hv_magic - -Adds magic to a hash. See C<sv_magic>. - - void hv_magic (HV* hv, GV* gv, int how) - -=item HvNAME - -Returns the package name of a stash. See C<SvSTASH>, C<CvSTASH>. - - char* HvNAME (HV* stash) - -=item hv_store - -Stores an SV in a hash. The hash key is specified as C<key> and C<klen> is -the length of the key. The C<hash> parameter is the precomputed hash -value; if it is zero then Perl will compute it. The return value will be -NULL if the operation failed or if the value did not need to be actually -stored within the hash (as in the case of tied hashes). Otherwise it can -be dereferenced to get the original C<SV*>. Note that the caller is -responsible for suitably incrementing the reference count of C<val> -before the call, and decrementing it if the function returned NULL. - -See L<Understanding the Magic of Tied Hashes and Arrays> for more -information on how to use this function on tied hashes. - - SV** hv_store (HV* tb, const char* key, U32 klen, SV* val, U32 hash) - -=item hv_store_ent - -Stores C<val> in a hash. The hash key is specified as C<key>. The C<hash> -parameter is the precomputed hash value; if it is zero then Perl will -compute it. The return value is the new hash entry so created. It will be -NULL if the operation failed or if the value did not need to be actually -stored within the hash (as in the case of tied hashes). Otherwise the -contents of the return value can be accessed using the C<He???> macros -described here. Note that the caller is responsible for suitably -incrementing the reference count of C<val> before the call, and decrementing -it if the function returned NULL. - -See L<Understanding the Magic of Tied Hashes and Arrays> for more -information on how to use this function on tied hashes. - - HE* hv_store_ent (HV* tb, SV* key, SV* val, U32 hash) - -=item hv_undef - -Undefines the hash. - - void hv_undef (HV* tb) - -=item isALNUM - -Returns a boolean indicating whether the C C<char> is an ascii alphanumeric -character or digit. - - int isALNUM (char c) - -=item isALPHA - -Returns a boolean indicating whether the C C<char> is an ascii alphabetic -character. - - int isALPHA (char c) - -=item isDIGIT - -Returns a boolean indicating whether the C C<char> is an ascii digit. - - int isDIGIT (char c) - -=item isLOWER - -Returns a boolean indicating whether the C C<char> is a lowercase character. - - int isLOWER (char c) - -=item isSPACE - -Returns a boolean indicating whether the C C<char> is whitespace. - - int isSPACE (char c) - -=item isUPPER - -Returns a boolean indicating whether the C C<char> is an uppercase character. - - int isUPPER (char c) - -=item items - -Variable which is setup by C<xsubpp> to indicate the number of items on the -stack. See L<perlxs/"Variable-length Parameter Lists">. - -=item ix - -Variable which is setup by C<xsubpp> to indicate which of an XSUB's aliases -was used to invoke it. See L<perlxs/"The ALIAS: Keyword">. - -=item LEAVE - -Closing bracket on a callback. See C<ENTER> and L<perlcall>. - - LEAVE; - -=item looks_like_number - -Test if an the content of an SV looks like a number (or is a number). - - int looks_like_number(SV*) - - -=item MARK - -Stack marker variable for the XSUB. See C<dMARK>. - -=item mg_clear - -Clear something magical that the SV represents. See C<sv_magic>. - - int mg_clear (SV* sv) - -=item mg_copy - -Copies the magic from one SV to another. See C<sv_magic>. - - int mg_copy (SV *, SV *, const char *, STRLEN) - -=item mg_find - -Finds the magic pointer for type matching the SV. See C<sv_magic>. - - MAGIC* mg_find (SV* sv, int type) - -=item mg_free - -Free any magic storage used by the SV. See C<sv_magic>. - - int mg_free (SV* sv) - -=item mg_get - -Do magic after a value is retrieved from the SV. See C<sv_magic>. - - int mg_get (SV* sv) - -=item mg_len - -Report on the SV's length. See C<sv_magic>. - - U32 mg_len (SV* sv) - -=item mg_magical - -Turns on the magical status of an SV. See C<sv_magic>. - - void mg_magical (SV* sv) - -=item mg_set - -Do magic after a value is assigned to the SV. See C<sv_magic>. - - int mg_set (SV* sv) - -=item modglobal - -C<modglobal> is a general purpose, interpreter global HV for use by -extensions that need to keep information on a per-interpreter basis. -In a pinch, it can also be used as a symbol table for extensions -to share data among each other. It is a good idea to use keys -prefixed by the package name of the extension that owns the data. - -=item Move - -The XSUB-writer's interface to the C C<memmove> function. The C<s> is the -source, C<d> is the destination, C<n> is the number of items, and C<t> is -the type. Can do overlapping moves. See also C<Copy>. - - void Move( s, d, n, t ) - -=item PL_na - -A convenience variable which is typically used with C<SvPV> when one doesn't -care about the length of the string. It is usually more efficient to -either declare a local variable and use that instead or to use the C<SvPV_nolen> -macro. - -=item New - -The XSUB-writer's interface to the C C<malloc> function. - - void* New( x, void *ptr, int size, type ) - -=item newAV - -Creates a new AV. The reference count is set to 1. - - AV* newAV (void) - -=item Newc - -The XSUB-writer's interface to the C C<malloc> function, with cast. - - void* Newc( x, void *ptr, int size, type, cast ) - -=item newCONSTSUB - -Creates a constant sub equivalent to Perl C<sub FOO () { 123 }> -which is eligible for inlining at compile-time. - - void newCONSTSUB(HV* stash, char* name, SV* sv) - -=item newHV - -Creates a new HV. The reference count is set to 1. - - HV* newHV (void) - -=item newRV_inc - -Creates an RV wrapper for an SV. The reference count for the original SV is -incremented. - - SV* newRV_inc (SV* ref) - -For historical reasons, "newRV" is a synonym for "newRV_inc". - -=item newRV_noinc - -Creates an RV wrapper for an SV. The reference count for the original -SV is B<not> incremented. - - SV* newRV_noinc (SV* ref) - -=item NEWSV - -Creates a new SV. A non-zero C<len> parameter indicates the number of -bytes of preallocated string space the SV should have. An extra byte -for a tailing NUL is also reserved. (SvPOK is not set for the SV even -if string space is allocated.) The reference count for the new SV is -set to 1. C<id> is an integer id between 0 and 1299 (used to identify -leaks). - - SV* NEWSV (int id, STRLEN len) - -=item newSViv - -Creates a new SV and copies an integer into it. The reference count for the -SV is set to 1. - - SV* newSViv (IV i) - -=item newSVnv - -Creates a new SV and copies a double into it. The reference count for the -SV is set to 1. - - SV* newSVnv (NV i) - -=item newSVpv - -Creates a new SV and copies a string into it. The reference count for the -SV is set to 1. If C<len> is zero, Perl will compute the length using -strlen(). For efficiency, consider using C<newSVpvn> instead. - - SV* newSVpv (const char* s, STRLEN len) - -=item newSVpvf - -Creates a new SV an initialize it with the string formatted like -C<sprintf>. - - SV* newSVpvf(const char* pat, ...) - -=item newSVpvn - -Creates a new SV and copies a string into it. The reference count for the -SV is set to 1. Note that if C<len> is zero, Perl will create a zero length -string. You are responsible for ensuring that the source string is at least -C<len> bytes long. - - SV* newSVpvn (const char* s, STRLEN len) - -=item newSVrv - -Creates a new SV for the RV, C<rv>, to point to. If C<rv> is not an RV then -it will be upgraded to one. If C<classname> is non-null then the new SV will -be blessed in the specified package. The new SV is returned and its -reference count is 1. - - SV* newSVrv (SV* rv, const char* classname) - -=item newSVsv - -Creates a new SV which is an exact duplicate of the original SV. - - SV* newSVsv (SV* old) - -=item newXS - -Used by C<xsubpp> to hook up XSUBs as Perl subs. - -=item newXSproto - -Used by C<xsubpp> to hook up XSUBs as Perl subs. Adds Perl prototypes to -the subs. - -=item Newz - -The XSUB-writer's interface to the C C<malloc> function. The allocated -memory is zeroed with C<memzero>. - - void* Newz( x, void *ptr, int size, type ) - -=item Nullav - -Null AV pointer. - -=item Nullch - -Null character pointer. - -=item Nullcv - -Null CV pointer. - -=item Nullhv - -Null HV pointer. - -=item Nullsv - -Null SV pointer. - -=item ORIGMARK - -The original stack mark for the XSUB. See C<dORIGMARK>. - -=item perl_alloc - -Allocates a new Perl interpreter. See L<perlembed>. - -=item perl_call_argv - -Performs a callback to the specified Perl sub. See L<perlcall>. - - I32 perl_call_argv (const char* subname, I32 flags, char** argv) - -=item perl_call_method - -Performs a callback to the specified Perl method. The blessed object must -be on the stack. See L<perlcall>. - - I32 perl_call_method (const char* methname, I32 flags) - -=item perl_call_pv - -Performs a callback to the specified Perl sub. See L<perlcall>. - - I32 perl_call_pv (const char* subname, I32 flags) - -=item perl_call_sv - -Performs a callback to the Perl sub whose name is in the SV. See -L<perlcall>. - - I32 perl_call_sv (SV* sv, I32 flags) - -=item perl_construct - -Initializes a new Perl interpreter. See L<perlembed>. - -=item perl_destruct - -Shuts down a Perl interpreter. See L<perlembed>. - -=item perl_eval_sv - -Tells Perl to C<eval> the string in the SV. - - I32 perl_eval_sv (SV* sv, I32 flags) - -=item perl_eval_pv - -Tells Perl to C<eval> the given string and return an SV* result. - - SV* perl_eval_pv (const char* p, I32 croak_on_error) - -=item perl_free - -Releases a Perl interpreter. See L<perlembed>. - -=item perl_get_av - -Returns the AV of the specified Perl array. If C<create> is set and the -Perl variable does not exist then it will be created. If C<create> is not -set and the variable does not exist then NULL is returned. - - AV* perl_get_av (const char* name, I32 create) - -=item perl_get_cv - -Returns the CV of the specified Perl subroutine. If C<create> is set and -the Perl subroutine does not exist then it will be declared (which has -the same effect as saying C<sub name;>). If C<create> is not -set and the subroutine does not exist then NULL is returned. - - CV* perl_get_cv (const char* name, I32 create) - -=item perl_get_hv - -Returns the HV of the specified Perl hash. If C<create> is set and the Perl -variable does not exist then it will be created. If C<create> is not -set and the variable does not exist then NULL is returned. - - HV* perl_get_hv (const char* name, I32 create) - -=item perl_get_sv - -Returns the SV of the specified Perl scalar. If C<create> is set and the -Perl variable does not exist then it will be created. If C<create> is not -set and the variable does not exist then NULL is returned. - - SV* perl_get_sv (const char* name, I32 create) - -=item perl_parse - -Tells a Perl interpreter to parse a Perl script. See L<perlembed>. - -=item perl_require_pv - -Tells Perl to C<require> a module. - - void perl_require_pv (const char* pv) - -=item perl_run - -Tells a Perl interpreter to run. See L<perlembed>. - -=item POPi - -Pops an integer off the stack. - - int POPi() - -=item POPl - -Pops a long off the stack. - - long POPl() - -=item POPp - -Pops a string off the stack. - - char* POPp() - -=item POPn - -Pops a double off the stack. - - double POPn() - -=item POPs - -Pops an SV off the stack. - - SV* POPs() - -=item PUSHMARK - -Opening bracket for arguments on a callback. See C<PUTBACK> and L<perlcall>. - - PUSHMARK(p) - -=item PUSHi - -Push an integer onto the stack. The stack must have room for this element. -Handles 'set' magic. See C<XPUSHi>. - - void PUSHi(int d) - -=item PUSHn - -Push a double onto the stack. The stack must have room for this element. -Handles 'set' magic. See C<XPUSHn>. - - void PUSHn(double d) - -=item PUSHp - -Push a string onto the stack. The stack must have room for this element. -The C<len> indicates the length of the string. Handles 'set' magic. See -C<XPUSHp>. - - void PUSHp(char *c, int len ) - -=item PUSHs - -Push an SV onto the stack. The stack must have room for this element. Does -not handle 'set' magic. See C<XPUSHs>. - - void PUSHs(sv) - -=item PUSHu - -Push an unsigned integer onto the stack. The stack must have room for -this element. See C<XPUSHu>. - - void PUSHu(unsigned int d) - - -=item PUTBACK - -Closing bracket for XSUB arguments. This is usually handled by C<xsubpp>. -See C<PUSHMARK> and L<perlcall> for other uses. - - PUTBACK; - -=item Renew - -The XSUB-writer's interface to the C C<realloc> function. - - void* Renew( void *ptr, int size, type ) - -=item Renewc - -The XSUB-writer's interface to the C C<realloc> function, with cast. - - void* Renewc( void *ptr, int size, type, cast ) - -=item RETVAL - -Variable which is setup by C<xsubpp> to hold the return value for an XSUB. -This is always the proper type for the XSUB. -See L<perlxs/"The RETVAL Variable">. - -=item safefree - -The XSUB-writer's interface to the C C<free> function. - -=item safemalloc - -The XSUB-writer's interface to the C C<malloc> function. - -=item saferealloc - -The XSUB-writer's interface to the C C<realloc> function. - -=item savepv - -Copy a string to a safe spot. This does not use an SV. - - char* savepv (const char* sv) - -=item savepvn - -Copy a string to a safe spot. The C<len> indicates number of bytes to -copy. This does not use an SV. - - char* savepvn (const char* sv, I32 len) - -=item SAVETMPS - -Opening bracket for temporaries on a callback. See C<FREETMPS> and -L<perlcall>. - - SAVETMPS; - -=item SP - -Stack pointer. This is usually handled by C<xsubpp>. See C<dSP> and -C<SPAGAIN>. - -=item SPAGAIN - -Refetch the stack pointer. Used after a callback. See L<perlcall>. - - SPAGAIN; - -=item ST - -Used to access elements on the XSUB's stack. - - SV* ST(int x) - -=item strEQ - -Test two strings to see if they are equal. Returns true or false. - - int strEQ( char *s1, char *s2 ) - -=item strGE - -Test two strings to see if the first, C<s1>, is greater than or equal to the -second, C<s2>. Returns true or false. - - int strGE( char *s1, char *s2 ) - -=item strGT - -Test two strings to see if the first, C<s1>, is greater than the second, -C<s2>. Returns true or false. - - int strGT( char *s1, char *s2 ) - -=item strLE - -Test two strings to see if the first, C<s1>, is less than or equal to the -second, C<s2>. Returns true or false. - - int strLE( char *s1, char *s2 ) - -=item strLT - -Test two strings to see if the first, C<s1>, is less than the second, -C<s2>. Returns true or false. - - int strLT( char *s1, char *s2 ) - -=item strNE - -Test two strings to see if they are different. Returns true or false. - - int strNE( char *s1, char *s2 ) - -=item strnEQ - -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( 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( const char *s1, const char *s2, size_t len ) - -=item sv_2mortal - -Marks an SV as mortal. The SV will be destroyed when the current context -ends. - - SV* sv_2mortal (SV* sv) - -=item sv_bless - -Blesses an SV into a specified package. The SV must be an RV. The package -must be designated by its stash (see C<gv_stashpv()>). The reference count -of the SV is unaffected. - - SV* sv_bless (SV* sv, HV* stash) - -=item sv_catpv - -Concatenates the string onto the end of the string which is in the SV. -Handles 'get' magic, but not 'set' magic. See C<sv_catpv_mg>. - - void sv_catpv (SV* sv, const char* ptr) - -=item sv_catpv_mg - -Like C<sv_catpv>, but also handles 'set' magic. - - void sv_catpvn (SV* sv, const char* ptr) - -=item sv_catpvn - -Concatenates the string onto the end of the string which is in the SV. The -C<len> indicates number of bytes to copy. Handles 'get' magic, but not -'set' magic. See C<sv_catpvn_mg>. - - void sv_catpvn (SV* sv, const char* ptr, STRLEN len) - -=item sv_catpvn_mg - -Like C<sv_catpvn>, but also handles 'set' magic. - - void sv_catpvn_mg (SV* sv, const char* ptr, STRLEN len) - -=item sv_catpvf - -Processes its arguments like C<sprintf> and appends the formatted output -to an SV. Handles 'get' magic, but not 'set' magic. C<SvSETMAGIC()> must -typically be called after calling this function to handle 'set' magic. - - void sv_catpvf (SV* sv, const char* pat, ...) - -=item sv_catpvf_mg - -Like C<sv_catpvf>, but also handles 'set' magic. - - void sv_catpvf_mg (SV* sv, const char* pat, ...) - -=item sv_catsv - -Concatenates the string from SV C<ssv> onto the end of the string in SV -C<dsv>. Handles 'get' magic, but not 'set' magic. See C<sv_catsv_mg>. - - void sv_catsv (SV* dsv, SV* ssv) - -=item sv_catsv_mg - -Like C<sv_catsv>, but also handles 'set' magic. - - void sv_catsv_mg (SV* dsv, SV* ssv) - -=item sv_chop - -Efficient removal of characters from the beginning of the string -buffer. SvPOK(sv) must be true and the C<ptr> must be a pointer to -somewhere inside the string buffer. The C<ptr> becomes the first -character of the adjusted string. - - void sv_chop(SV* sv, const char *ptr) - - -=item sv_cmp - -Compares the strings in two SVs. Returns -1, 0, or 1 indicating whether the -string in C<sv1> is less than, equal to, or greater than the string in -C<sv2>. - - I32 sv_cmp (SV* sv1, SV* sv2) - -=item SvCUR - -Returns the length of the string which is in the SV. See C<SvLEN>. - - int SvCUR (SV* sv) - -=item SvCUR_set - -Set the length of the string which is in the SV. See C<SvCUR>. - - void SvCUR_set (SV* sv, int val) - -=item sv_dec - -Auto-decrement of the value in the SV. - - void sv_dec (SV* sv) - -=item sv_derived_from - -Returns a boolean indicating whether the SV is derived from the specified -class. This is the function that implements C<UNIVERSAL::isa>. It works -for class names as well as for objects. - - bool sv_derived_from (SV* sv, const char* name); - -=item SvEND - -Returns a pointer to the last character in the string which is in the SV. -See C<SvCUR>. Access the character as - - char* SvEND(sv) - -=item sv_eq - -Returns a boolean indicating whether the strings in the two SVs are -identical. - - I32 sv_eq (SV* sv1, SV* sv2) - -=item SvGETMAGIC - -Invokes C<mg_get> on an SV if it has 'get' magic. This macro evaluates -its argument more than once. - - void SvGETMAGIC(SV *sv) - -=item SvGROW - -Expands the character buffer in the SV so that it has room for the -indicated number of bytes (remember to reserve space for an extra -trailing NUL character). Calls C<sv_grow> to perform the expansion if -necessary. Returns a pointer to the character buffer. - - char* SvGROW(SV* sv, STRLEN len) - -=item sv_grow - -Expands the character buffer in the SV. This will use C<sv_unref> and will -upgrade the SV to C<SVt_PV>. Returns a pointer to the character buffer. -Use C<SvGROW>. - -=item sv_inc - -Auto-increment of the value in the SV. - - void sv_inc (SV* sv) - -=item sv_insert - -Inserts a string at the specified offset/length within the SV. -Similar to the Perl substr() function. - - void sv_insert(SV *sv, STRLEN offset, STRLEN len, - char *str, STRLEN strlen) - -=item SvIOK - -Returns a boolean indicating whether the SV contains an integer. - - int SvIOK (SV* SV) - -=item SvIOK_off - -Unsets the IV status of an SV. - - void SvIOK_off (SV* sv) - -=item SvIOK_on - -Tells an SV that it is an integer. - - void SvIOK_on (SV* sv) - -=item SvIOK_only - -Tells an SV that it is an integer and disables all other OK bits. - - void SvIOK_only (SV* sv) - -=item SvIOKp - -Returns a boolean indicating whether the SV contains an integer. Checks the -B<private> setting. Use C<SvIOK>. - - int SvIOKp (SV* SV) - -=item sv_isa - -Returns a boolean indicating whether the SV is blessed into the specified -class. This does not check for subtypes; use C<sv_derived_from> to verify -an inheritance relationship. - - int sv_isa (SV* sv, char* name) - -=item sv_isobject - -Returns a boolean indicating whether the SV is an RV pointing to a blessed -object. If the SV is not an RV, or if the object is not blessed, then this -will return false. - - int sv_isobject (SV* sv) - -=item SvIV - -Coerces the given SV to an integer and returns it. - - int SvIV (SV* sv) - -=item SvIVX - -Returns the integer which is stored in the SV, assuming SvIOK is true. - - int SvIVX (SV* sv) - -=item SvLEN - -Returns the size of the string buffer in the SV. See C<SvCUR>. - - int SvLEN (SV* sv) - -=item sv_len - -Returns the length of the string in the SV. Use C<SvCUR>. - - STRLEN sv_len (SV* sv) - -=item sv_magic - -Adds magic to an SV. - - void sv_magic (SV* sv, SV* obj, int how, const char* name, I32 namlen) - -=item sv_mortalcopy - -Creates a new SV which is a copy of the original SV. The new SV is marked -as mortal. - - SV* sv_mortalcopy (SV* oldsv) - -=item sv_newmortal - -Creates a new SV which is mortal. The reference count of the SV is set to 1. - - SV* sv_newmortal (void) - -=item SvNIOK - -Returns a boolean indicating whether the SV contains a number, integer or -double. - - int SvNIOK (SV* SV) - -=item SvNIOK_off - -Unsets the NV/IV status of an SV. - - void SvNIOK_off (SV* sv) - -=item SvNIOKp - -Returns a boolean indicating whether the SV contains a number, integer or -double. Checks the B<private> setting. Use C<SvNIOK>. - - int SvNIOKp (SV* SV) - -=item PL_sv_no - -This is the C<false> SV. See C<PL_sv_yes>. Always refer to this as C<&PL_sv_no>. - -=item SvNOK - -Returns a boolean indicating whether the SV contains a double. - - int SvNOK (SV* SV) - -=item SvNOK_off - -Unsets the NV status of an SV. - - void SvNOK_off (SV* sv) - -=item SvNOK_on - -Tells an SV that it is a double. - - void SvNOK_on (SV* sv) - -=item SvNOK_only - -Tells an SV that it is a double and disables all other OK bits. - - void SvNOK_only (SV* sv) - -=item SvNOKp - -Returns a boolean indicating whether the SV contains a double. Checks the -B<private> setting. Use C<SvNOK>. - - int SvNOKp (SV* SV) - -=item SvNV - -Coerce the given SV to a double and return it. - - double SvNV (SV* sv) - -=item SvNVX - -Returns the double which is stored in the SV, assuming SvNOK is true. - - double SvNVX (SV* sv) - -=item SvOK - -Returns a boolean indicating whether the value is an SV. - - int SvOK (SV* sv) - -=item SvOOK - -Returns a boolean indicating whether the SvIVX is a valid offset value -for the SvPVX. This hack is used internally to speed up removal of -characters from the beginning of a SvPV. When SvOOK is true, then the -start of the allocated string buffer is really (SvPVX - SvIVX). - - int SvOOK(SV* sv) - -=item SvPOK - -Returns a boolean indicating whether the SV contains a character string. - - int SvPOK (SV* SV) - -=item SvPOK_off - -Unsets the PV status of an SV. - - void SvPOK_off (SV* sv) - -=item SvPOK_on - -Tells an SV that it is a string. - - void SvPOK_on (SV* sv) - -=item SvPOK_only - -Tells an SV that it is a string and disables all other OK bits. - - void SvPOK_only (SV* sv) - -=item SvPOKp - -Returns a boolean indicating whether the SV contains a character string. -Checks the B<private> setting. Use C<SvPOK>. - - int SvPOKp (SV* SV) - -=item SvPV - -Returns a pointer to the string in the SV, or a stringified form of the SV -if the SV does not contain a string. Handles 'get' magic. - - char* SvPV (SV* sv, STRLEN len) - -=item SvPV_force - -Like <SvPV> but will force the SV into becoming a string (SvPOK). You -want force if you are going to update the SvPVX directly. - - char* SvPV_force(SV* sv, STRLEN len) - -=item SvPV_nolen - -Returns a pointer to the string in the SV, or a stringified form of the SV -if the SV does not contain a string. Handles 'get' magic. - - char* SvPV_nolen (SV* sv) - -=item SvPVX - -Returns a pointer to the string in the SV. The SV must contain a string. - - char* SvPVX (SV* sv) - -=item SvREFCNT - -Returns the value of the object's reference count. - - int SvREFCNT (SV* sv) - -=item SvREFCNT_dec - -Decrements the reference count of the given SV. - - void SvREFCNT_dec (SV* sv) - -=item SvREFCNT_inc - -Increments the reference count of the given SV. - - void SvREFCNT_inc (SV* sv) - -=item SvROK - -Tests if the SV is an RV. - - int SvROK (SV* sv) - -=item SvROK_off - -Unsets the RV status of an SV. - - void SvROK_off (SV* sv) - -=item SvROK_on - -Tells an SV that it is an RV. - - void SvROK_on (SV* sv) - -=item SvRV - -Dereferences an RV to return the SV. - - SV* SvRV (SV* sv) - -=item SvSETMAGIC - -Invokes C<mg_set> on an SV if it has 'set' magic. This macro evaluates -its argument more than once. - - void SvSETMAGIC( SV *sv ) - -=item sv_setiv - -Copies an integer into the given SV. Does not handle 'set' magic. -See C<sv_setiv_mg>. - - void sv_setiv (SV* sv, IV num) - -=item sv_setiv_mg - -Like C<sv_setiv>, but also handles 'set' magic. - - void sv_setiv_mg (SV* sv, IV num) - -=item sv_setnv - -Copies a double into the given SV. Does not handle 'set' magic. -See C<sv_setnv_mg>. - - void sv_setnv (SV* sv, double num) - -=item sv_setnv_mg - -Like C<sv_setnv>, but also handles 'set' magic. - - void sv_setnv_mg (SV* sv, double num) - -=item sv_setpv - -Copies a string into an SV. The string must be null-terminated. -Does not handle 'set' magic. See C<sv_setpv_mg>. - - void sv_setpv (SV* sv, const char* ptr) - -=item sv_setpv_mg - -Like C<sv_setpv>, but also handles 'set' magic. - - void sv_setpv_mg (SV* sv, const char* ptr) - -=item sv_setpviv - -Copies an integer into the given SV, also updating its string value. -Does not handle 'set' magic. See C<sv_setpviv_mg>. - - void sv_setpviv (SV* sv, IV num) - -=item sv_setpviv_mg - -Like C<sv_setpviv>, but also handles 'set' magic. - - void sv_setpviv_mg (SV* sv, IV num) - -=item sv_setpvn - -Copies a string into an SV. The C<len> parameter indicates the number of -bytes to be copied. Does not handle 'set' magic. See C<sv_setpvn_mg>. - - void sv_setpvn (SV* sv, const char* ptr, STRLEN len) - -=item sv_setpvn_mg - -Like C<sv_setpvn>, but also handles 'set' magic. - - void sv_setpvn_mg (SV* sv, const char* ptr, STRLEN len) - -=item sv_setpvf - -Processes its arguments like C<sprintf> and sets an SV to the formatted -output. Does not handle 'set' magic. See C<sv_setpvf_mg>. - - void sv_setpvf (SV* sv, const char* pat, ...) - -=item sv_setpvf_mg - -Like C<sv_setpvf>, but also handles 'set' magic. - - void sv_setpvf_mg (SV* sv, const char* pat, ...) - -=item sv_setref_iv - -Copies an integer into a new SV, optionally blessing the SV. The C<rv> -argument will be upgraded to an RV. That RV will be modified to point to -the new SV. The C<classname> argument indicates the package for the -blessing. Set C<classname> to C<Nullch> to avoid the blessing. The new SV -will be returned and will have a reference count of 1. - - SV* sv_setref_iv (SV *rv, char *classname, IV iv) - -=item sv_setref_nv - -Copies a double into a new SV, optionally blessing the SV. The C<rv> -argument will be upgraded to an RV. That RV will be modified to point to -the new SV. The C<classname> argument indicates the package for the -blessing. Set C<classname> to C<Nullch> to avoid the blessing. The new SV -will be returned and will have a reference count of 1. - - SV* sv_setref_nv (SV *rv, char *classname, double nv) - -=item sv_setref_pv - -Copies a pointer into a new SV, optionally blessing the SV. The C<rv> -argument will be upgraded to an RV. That RV will be modified to point to -the new SV. If the C<pv> argument is NULL then C<PL_sv_undef> will be placed -into the SV. The C<classname> argument indicates the package for the -blessing. Set C<classname> to C<Nullch> to avoid the blessing. The new SV -will be returned and will have a reference count of 1. - - SV* sv_setref_pv (SV *rv, char *classname, void* pv) - -Do not use with integral Perl types such as HV, AV, SV, CV, because those -objects will become corrupted by the pointer copy process. - -Note that C<sv_setref_pvn> copies the string while this copies the pointer. - -=item sv_setref_pvn - -Copies a string into a new SV, optionally blessing the SV. The length of the -string must be specified with C<n>. The C<rv> argument will be upgraded to -an RV. That RV will be modified to point to the new SV. The C<classname> -argument indicates the package for the blessing. Set C<classname> to -C<Nullch> to avoid the blessing. The new SV will be returned and will have -a reference count of 1. - - SV* sv_setref_pvn (SV *rv, char *classname, char* pv, I32 n) - -Note that C<sv_setref_pv> copies the pointer while this copies the string. - -=item SvSetSV - -Calls C<sv_setsv> if dsv is not the same as ssv. May evaluate arguments -more than once. - - void SvSetSV (SV* dsv, SV* ssv) - -=item SvSetSV_nosteal - -Calls a non-destructive version of C<sv_setsv> if dsv is not the same as ssv. -May evaluate arguments more than once. - - void SvSetSV_nosteal (SV* dsv, SV* ssv) - -=item sv_setsv - -Copies the contents of the source SV C<ssv> into the destination SV C<dsv>. -The source SV may be destroyed if it is mortal. Does not handle 'set' magic. -See the macro forms C<SvSetSV>, C<SvSetSV_nosteal> and C<sv_setsv_mg>. - - void sv_setsv (SV* dsv, SV* ssv) - -=item sv_setsv_mg - -Like C<sv_setsv>, but also handles 'set' magic. - - void sv_setsv_mg (SV* dsv, SV* ssv) - -=item sv_setuv - -Copies an unsigned integer into the given SV. Does not handle 'set' magic. -See C<sv_setuv_mg>. - - void sv_setuv (SV* sv, UV num) - -=item sv_setuv_mg - -Like C<sv_setuv>, but also handles 'set' magic. - - void sv_setuv_mg (SV* sv, UV num) - -=item SvSTASH - -Returns the stash of the SV. - - HV* SvSTASH (SV* sv) - -=item SvTAINT - -Taints an SV if tainting is enabled - - void SvTAINT (SV* sv) - -=item SvTAINTED - -Checks to see if an SV is tainted. Returns TRUE if it is, FALSE if not. - - int SvTAINTED (SV* sv) - -=item SvTAINTED_off - -Untaints an SV. Be I<very> careful with this routine, as it short-circuits -some of Perl's fundamental security features. XS module authors should -not use this function unless they fully understand all the implications -of unconditionally untainting the value. Untainting should be done in -the standard perl fashion, via a carefully crafted regexp, rather than -directly untainting variables. - - void SvTAINTED_off (SV* sv) - -=item SvTAINTED_on - -Marks an SV as tainted. - - void SvTAINTED_on (SV* sv) - -=item SVt_IV - -Integer type flag for scalars. See C<svtype>. - -=item SVt_PV - -Pointer type flag for scalars. See C<svtype>. - -=item SVt_PVAV - -Type flag for arrays. See C<svtype>. - -=item SVt_PVCV - -Type flag for code refs. See C<svtype>. - -=item SVt_PVHV - -Type flag for hashes. See C<svtype>. - -=item SVt_PVMG - -Type flag for blessed scalars. See C<svtype>. - -=item SVt_NV - -Double type flag for scalars. See C<svtype>. - -=item SvTRUE - -Returns a boolean indicating whether Perl would evaluate the SV as true or -false, defined or undefined. Does not handle 'get' magic. - - int SvTRUE (SV* sv) - -=item SvTYPE - -Returns the type of the SV. See C<svtype>. - - svtype SvTYPE (SV* sv) - -=item svtype - -An enum of flags for Perl types. These are found in the file B<sv.h> in the -C<svtype> enum. Test these flags with the C<SvTYPE> macro. - -=item PL_sv_undef - -This is the C<undef> SV. Always refer to this as C<&PL_sv_undef>. - -=item sv_unref - -Unsets the RV status of the SV, and decrements the reference count of -whatever was being referenced by the RV. This can almost be thought of -as a reversal of C<newSVrv>. See C<SvROK_off>. - - void sv_unref (SV* sv) - -=item SvUPGRADE - -Used to upgrade an SV to a more complex form. Uses C<sv_upgrade> to perform -the upgrade if necessary. See C<svtype>. - - bool SvUPGRADE (SV* sv, svtype mt) - -=item sv_upgrade - -Upgrade an SV to a more complex form. Use C<SvUPGRADE>. See C<svtype>. - -=item sv_usepvn - -Tells an SV to use C<ptr> to find its string value. Normally the string is -stored inside the SV but sv_usepvn allows the SV to use an outside string. -The C<ptr> should point to memory that was allocated by C<malloc>. The -string length, C<len>, must be supplied. This function will realloc the -memory pointed to by C<ptr>, so that pointer should not be freed or used by -the programmer after giving it to sv_usepvn. Does not handle 'set' magic. -See C<sv_usepvn_mg>. - - void sv_usepvn (SV* sv, char* ptr, STRLEN len) - -=item sv_usepvn_mg - -Like C<sv_usepvn>, but also handles 'set' magic. - - void sv_usepvn_mg (SV* sv, char* ptr, STRLEN len) - -=item sv_vcatpvfn - -Processes its arguments like C<vsprintf> and appends the formatted output -to an SV. Uses an array of SVs if the C style variable argument list is -missing (NULL). When running with taint checks enabled, indicates via -C<maybe_tainted> if results are untrustworthy (often due to the use of -locales). - - void sv_catpvfn (SV* sv, const char* pat, STRLEN patlen, - va_list *args, SV **svargs, I32 svmax, - bool *maybe_tainted); - -=item sv_vsetpvfn - -Works like C<vcatpvfn> but copies the text into the SV instead of -appending it. - - void sv_setpvfn (SV* sv, const char* pat, STRLEN patlen, - va_list *args, SV **svargs, I32 svmax, - bool *maybe_tainted); - -=item SvUV - -Coerces the given SV to an unsigned integer and returns it. - - UV SvUV(SV* sv) - -=item SvUVX - -Returns the unsigned integer which is stored in the SV, assuming SvIOK is true. - - UV SvUVX(SV* sv) - -=item PL_sv_yes - -This is the C<true> SV. See C<PL_sv_no>. Always refer to this as C<&PL_sv_yes>. - -=item THIS - -Variable which is setup by C<xsubpp> to designate the object in a C++ XSUB. -This is always the proper type for the C++ object. See C<CLASS> and -L<perlxs/"Using XS With C++">. - -=item toLOWER - -Converts the specified character to lowercase. - - int toLOWER (char c) - -=item toUPPER - -Converts the specified character to uppercase. - - int toUPPER (char c) - -=item warn - -This is the XSUB-writer's interface to Perl's C<warn> function. Use this -function the same way you use the C C<printf> function. See C<croak()>. - -=item XPUSHi - -Push an integer onto the stack, extending the stack if necessary. Handles -'set' magic. See C<PUSHi>. - - XPUSHi(int d) - -=item XPUSHn - -Push a double onto the stack, extending the stack if necessary. Handles 'set' -magic. See C<PUSHn>. - - XPUSHn(double d) - -=item XPUSHp - -Push a string onto the stack, extending the stack if necessary. The C<len> -indicates the length of the string. Handles 'set' magic. See C<PUSHp>. - - XPUSHp(char *c, int len) - -=item XPUSHs - -Push an SV onto the stack, extending the stack if necessary. Does not -handle 'set' magic. See C<PUSHs>. - - XPUSHs(sv) - -=item XPUSHu - -Push an unsigned integer onto the stack, extending the stack if -necessary. See C<PUSHu>. - -=item XS - -Macro to declare an XSUB and its C parameter list. This is handled by -C<xsubpp>. - -=item XSRETURN - -Return from XSUB, indicating number of items on the stack. This is usually -handled by C<xsubpp>. - - XSRETURN(int x) - -=item XSRETURN_EMPTY - -Return an empty list from an XSUB immediately. - - XSRETURN_EMPTY; - -=item XSRETURN_IV - -Return an integer from an XSUB immediately. Uses C<XST_mIV>. - - XSRETURN_IV(IV v) - -=item XSRETURN_NO - -Return C<&PL_sv_no> from an XSUB immediately. Uses C<XST_mNO>. - - XSRETURN_NO; - -=item XSRETURN_NV - -Return an double from an XSUB immediately. Uses C<XST_mNV>. - - XSRETURN_NV(NV v) - -=item XSRETURN_PV - -Return a copy of a string from an XSUB immediately. Uses C<XST_mPV>. - - XSRETURN_PV(char *v) - -=item XSRETURN_UNDEF - -Return C<&PL_sv_undef> from an XSUB immediately. Uses C<XST_mUNDEF>. - - XSRETURN_UNDEF; - -=item XSRETURN_YES - -Return C<&PL_sv_yes> from an XSUB immediately. Uses C<XST_mYES>. - - XSRETURN_YES; - -=item XST_mIV - -Place an integer into the specified position C<i> on the stack. The value is -stored in a new mortal SV. - - XST_mIV( int i, IV v ) - -=item XST_mNV - -Place a double into the specified position C<i> on the stack. The value is -stored in a new mortal SV. - - XST_mNV( int i, NV v ) - -=item XST_mNO - -Place C<&PL_sv_no> into the specified position C<i> on the stack. - - XST_mNO( int i ) - -=item XST_mPV - -Place a copy of a string into the specified position C<i> on the stack. The -value is stored in a new mortal SV. - - XST_mPV( int i, char *v ) - -=item XST_mUNDEF - -Place C<&PL_sv_undef> into the specified position C<i> on the stack. - - XST_mUNDEF( int i ) - -=item XST_mYES - -Place C<&PL_sv_yes> into the specified position C<i> on the stack. - - XST_mYES( int i ) - -=item XS_VERSION - -The version identifier for an XS module. This is usually handled -automatically by C<ExtUtils::MakeMaker>. See C<XS_VERSION_BOOTCHECK>. - -=item XS_VERSION_BOOTCHECK - -Macro to verify that a PM module's $VERSION variable matches the XS module's -C<XS_VERSION> variable. This is usually handled automatically by -C<xsubpp>. See L<perlxs/"The VERSIONCHECK: Keyword">. - -=item Zero - -The XSUB-writer's interface to the C C<memzero> function. The C<d> is the -destination, C<n> is the number of items, and C<t> is the type. - - void Zero( d, n, t ) - -=back - =head1 AUTHORS Until May 1997, this document was maintained by Jeff Okamoto -<okamoto@corp.hp.com>. It is now maintained as part of Perl itself. +<okamoto@corp.hp.com>. It is now maintained as part of Perl itself +by the Perl 5 Porters <perl5-porters@perl.org>. With lots of help and suggestions from Dean Roehrich, Malcolm Beattie, Andreas Koenig, Paul Hudson, Ilya Zakharevich, Paul Marquess, Neil @@ -3874,3 +1795,10 @@ Bowers, Matthew Green, Tim Bunce, Spider Boardman, Ulrich Pfeifer, Stephen McCamant, and Gurusamy Sarathy. API Listing originally by Dean Roehrich <roehrich@cray.com>. + +Modifications to autogenerate the API listing (L<perlapi>) by Benjamin +Stuhl. + +=head1 SEE ALSO + +perlapi(1), perlintern(1), perlxs(1), perlembed(1) diff --git a/pod/perlhist.pod b/pod/perlhist.pod index f39117e7e4..7a8d1e5879 100644 --- a/pod/perlhist.pod +++ b/pod/perlhist.pod @@ -9,7 +9,7 @@ perlhist - the Perl history records =begin RCS # -# $Id: perlhist.pod,v 1.57 1999/01/26 17:38:07 jhi Exp $ +# $Id: perlhist.pod,v 1.2 2000/01/24 11:44:47 jhi Exp $ # =end RCS @@ -316,7 +316,7 @@ the strings?). 5.005_03-MT4 1999-Jan-26 5.005_03-MT5 1999-Jan-28 5.005_03 1999-Mar-28 - Chip 5.005_04 1999-***-** + Chip 5.005_04 2000-***-** Sarathy 5.005_50 1998-Jul-26 The 5.6 development track. 5.005_51 1998-Aug-10 @@ -330,8 +330,10 @@ the strings?). 5.005_59 1999-Aug-02 5.005_60 1999-Aug-02 5.005_61 1999-Aug-20 - 5.005_62 1999-Sep-** - 5.6 beta 1999-***-** + 5.005_62 1999-Oct-15 + 5.005_63 1999-Dec-09 + 5.5.640 2000-Feb-02 + 5.5.650 2000-Feb-08 5.6 beta1 =head2 SELECTED RELEASE SIZES diff --git a/pod/perlintern.pod b/pod/perlintern.pod new file mode 100644 index 0000000000..58eeac6e95 --- /dev/null +++ b/pod/perlintern.pod @@ -0,0 +1,26 @@ +=head1 NAME + +perlintern - autogenerated documentation of purely B<internal> + Perl functions + +=head1 DESCRIPTION + +This file is the autogenerated documentation of functions in the +Perl intrepreter that are documented using Perl's internal documentation +format but are not marked as part of the Perl API. In other words, +B<they are not for use in extensions>! + +=over 8 + +=back + +=head1 AUTHORS + +The autodocumentation system was orignally added to the Perl core by +Benjamin Stuhl. Documentation is by whoever was kind enough to +document their functions. + +=head1 SEE ALSO + +perlguts(1), perlapi(1) + diff --git a/pod/perlmod.pod b/pod/perlmod.pod index 351ba73c5a..994c3eb5dc 100644 --- a/pod/perlmod.pod +++ b/pod/perlmod.pod @@ -213,7 +213,7 @@ This also has implications for the use of the SUPER:: qualifier =head2 Package Constructors and Destructors Four special subroutines act as package constructors and destructors. -These are the C<BEGIN>, C<STOP>, C<INIT>, and C<END> routines. The +These are the C<BEGIN>, C<CHECK>, 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 @@ -245,9 +245,9 @@ 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 +Similar to C<END> blocks, C<CHECK> 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 +LIFO order. C<CHECK> 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 diff --git a/pod/perlop.pod b/pod/perlop.pod index 547ee5328e..d932704666 100644 --- a/pod/perlop.pod +++ b/pod/perlop.pod @@ -169,11 +169,11 @@ search or modify the string $_ by default. This operator makes that kind of operation work on some other string. The right argument is a search pattern, substitution, or transliteration. The left argument is what is supposed to be searched, substituted, or transliterated instead of the default -$_. The return value indicates the success of the operation. (If the +$_. The return value indicates the success of the operation. If the 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). +time. This can be less efficient than an explicit search, because the +pattern must be compiled every time the expression is evaluated. Binary "!~" is just like "=~" except the return value is negated in the logical sense. @@ -362,7 +362,7 @@ With the C-style operators that would have been written like this: unlink("alpha", "beta", "gamma") || (gripe(), next LINE); -Use "or" for assignment is unlikely to do what you want; see below. +Using "or" for assignment is unlikely to do what you want; see below. =head2 Range Operators @@ -789,7 +789,7 @@ the trailing delimiter. This avoids expensive run-time recompilations, and is useful when the value you are interpolating won't change over the life of the script. However, mentioning C</o> constitutes a promise that you won't change the variables in the pattern. If you change them, -Perl won't even notice. See also L<qr//>. +Perl won't even notice. See also L<"qr//">. If the PATTERN evaluates to the empty string, the last I<successfully> matched regular expression is used instead. @@ -1802,6 +1802,18 @@ operation you intend by using C<""> or C<0+>, as in the examples below. See L<perlfunc/vec> for information on how to manipulate individual bits in a bit vector. +=head2 Version tuples + +A literal of the form C<v1.20.300.4000> is parsed as a dual-valued quantity. +It has the string value of C<"\x{1}\x{14}\x{12c}\x{fa0}"> (i.e., a UTF-8 +string) and a numeric value of C<1 + 20/1000 + 300/1000000 + 4000/1000000000>. +This is useful for representing Unicode strings, and for comparing version +numbers using the string comparison operators, C<cmp>, C<gt>, C<lt> etc. + +Such "version tuples" or "vectors" are accepted by both C<require> and +C<use>. The C<$^V> variable contains the running Perl interpreter's +version in this format. See L<perlvar/$^V>. + =head2 Integer Arithmetic By default, Perl assumes that it must do most of its arithmetic in @@ -1889,3 +1901,5 @@ limited-precision representations. The non-standard modules SSLeay::BN and Math::Pari provide equivalent functionality (and much more) with a substantial performance savings. + +=cut diff --git a/pod/perlopentut.pod b/pod/perlopentut.pod index 5d2be3039e..fd32bd9f49 100644 --- a/pod/perlopentut.pod +++ b/pod/perlopentut.pod @@ -494,7 +494,7 @@ to mean standard input, per the standard convention. You've probably noticed how Perl's C<warn> and C<die> functions can produce messages like: - Some warning at scriptname line 29, <FH> chunk 7. + Some warning at scriptname line 29, <FH> line 7. That's because you opened a filehandle FH, and had read in seven records from it. But what was the name of the file, not the handle? @@ -510,7 +510,7 @@ temporarily, then all you have to do is this: Since you're using the pathname of the file as its handle, you'll get warnings more like - Some warning at scriptname line 29, </etc/motd> chunk 7. + Some warning at scriptname line 29, </etc/motd> line 7. =head2 Single Argument Open diff --git a/pod/perlport.pod b/pod/perlport.pod index 21f144c237..7a500f8838 100644 --- a/pod/perlport.pod +++ b/pod/perlport.pod @@ -870,7 +870,8 @@ Even though VOS allows the slash character to appear in object names, because the VOS port of Perl interprets it as a pathname delimiting character, VOS files, directories, or links whose names contain a slash character cannot be processed. Such files must be -renamed before they can be processed by Perl. +renamed before they can be processed by Perl. Note that VOS limits +file names to 32 or fewer characters. The following C functions are unimplemented on VOS, and any attempt by Perl to use them will result in a fatal error message and an immediate @@ -883,7 +884,7 @@ The value of C<$^O> on VOS is "VOS". To determine the architecture that you are running on without resorting to loading all of C<%Config> you can examine the content of the C<@INC> array like so: - if (grep(/VOS/, @INC)) { + if ($^O =~ /VOS/) { print "I'm on a Stratus box!\n"; } else { print "I'm not on a Stratus box!\n"; @@ -894,13 +895,13 @@ can examine the content of the C<@INC> array like so: print "This box is a Stratus XA/R!\n"; } elsif (grep(/7100/, @INC)) { - print "This box is a Stratus HP 7100 or 8000!\n"; + print "This box is a Stratus HP 7100 or 8xxx!\n"; } elsif (grep(/8000/, @INC)) { - print "This box is a Stratus HP 8000!\n"; + print "This box is a Stratus HP 8xxx!\n"; } else { - print "This box is a Stratus 68K...\n"; + print "This box is a Stratus 68K!\n"; } Also see: @@ -1401,11 +1402,11 @@ Not implemented. (Plan9, Win32, S<RISC OS>) =item endpwent -Not implemented. (S<Mac OS>, Win32, VM/ESA) +Not implemented. (S<Mac OS>, MPE/iX, VM/ESA, Win32) =item endgrent -Not implemented. (S<Mac OS>, Win32, VMS, S<RISC OS>, VM/ESA) +Not implemented. (S<Mac OS>, MPE/iX, S<RISC OS>, VM/ESA, VMS, Win32) =item endhostent @@ -1462,11 +1463,14 @@ the process. (Win32) =item link OLDFILE,NEWFILE -Not implemented. (S<Mac OS>, Win32, VMS, S<RISC OS>) +Not implemented. (S<Mac OS>, MPE/iX, VMS, S<RISC OS>) Link count not updated because hard links are not quite that hard (They are sort of half-way between hard and soft links). (AmigaOS) +Hard links are implemented on Win32 (Windows NT and Windows 2000) +under NTFS only. + =item lstat FILEHANDLE =item lstat EXPR @@ -1494,7 +1498,7 @@ Not implemented. (S<Mac OS>, Win32, VMS, Plan9, S<RISC OS>, VOS) The C<|> variants are supported only if ToolServer is installed. (S<Mac OS>) -open to C<|-> and C<-|> are unsupported. (S<Mac OS>, Win32, S<RISC OS>) +open to C<|E<45>> and C<-|> are unsupported. (S<Mac OS>, Win32, S<RISC OS>) =item pipe READHANDLE,WRITEHANDLE @@ -1522,6 +1526,10 @@ Only reliable on sockets. (S<RISC OS>) Not implemented. (S<Mac OS>, Win32, VMS, S<RISC OS>, VOS) +=item setgrent + +Not implemented. (MPE/iX, Win32) + =item setpgrp PID,PGRP Not implemented. (S<Mac OS>, Win32, VMS, S<RISC OS>, VOS) @@ -1530,6 +1538,10 @@ Not implemented. (S<Mac OS>, Win32, VMS, S<RISC OS>, VOS) Not implemented. (S<Mac OS>, Win32, VMS, S<RISC OS>, VOS) +=item setpwent + +Not implemented. (MPE/iX, Win32) + =item setsockopt SOCKET,LEVEL,OPTNAME,OPTVAL Not implemented. (S<Mac OS>, Plan9) diff --git a/pod/perlre.pod b/pod/perlre.pod index 70ec00c6cb..d2f64d2eb6 100644 --- a/pod/perlre.pod +++ b/pod/perlre.pod @@ -269,8 +269,6 @@ Any punctuation character. Any hexadecimal digit. Though this may feel silly (/0-9a-f/i would work just fine) it is included for completeness. -=item - =back You can negate the [::] character classes by prefixing the class name diff --git a/pod/perlrun.pod b/pod/perlrun.pod index 5eb3b829f0..8aa06fb2bf 100644 --- a/pod/perlrun.pod +++ b/pod/perlrun.pod @@ -4,7 +4,7 @@ perlrun - how to execute the Perl interpreter =head1 SYNOPSIS -B<perl> S<[ B<-sTuUWX> ]> +B<perl> S<[ B<-CsTuUWX> ]> S<[ B<-hv> ] [ B<-V>[:I<configvar>] ]> S<[ B<-cw> ] [ B<-d>[:I<debugger>] ] [ B<-D>[I<number/list>] ]> S<[ B<-pna> ] [ B<-F>I<pattern> ] [ B<-l>[I<octal>] ] [ B<-0>[I<octal>] ]> @@ -265,10 +265,18 @@ is equivalent to An alternate delimiter may be specified using B<-F>. +=item B<-C> + +enables Perl to use the native wide character APIs on the target system. +The magic variable C<${^WIDE_SYSTEM_CALLS}> reflects the state of +this switch. See L<perlvar/"${^WIDE_SYSTEM_CALLS}">. + +This feature is currently only implemented on the Win32 platform. + =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<STOP>, and +executing it. Actually, it I<will> execute C<BEGIN>, C<CHECK>, 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. diff --git a/pod/perlsub.pod b/pod/perlsub.pod index 416763f6d8..927e944c93 100644 --- a/pod/perlsub.pod +++ b/pod/perlsub.pod @@ -207,7 +207,7 @@ core, as are modules whose names are in all lower case. A 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<STOP>, C<INIT>, C<END>, C<AUTOLOAD>, and +things include C<BEGIN>, C<CHECK>, C<INIT>, C<END>, C<AUTOLOAD>, and C<DESTROY>--plus all functions mentioned in L<perltie>. =head2 Private Variables via my() @@ -454,7 +454,7 @@ starts to run: } See L<perlmod/"Package Constructors and Destructors"> about the -special triggered functions, C<BEGIN>, C<STOP>, C<INIT> and C<END>. +special triggered functions, C<BEGIN>, C<CHECK>, 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 @@ -928,11 +928,21 @@ Unbackslashed prototype characters have special meanings. Any unbackslashed C<@> or C<%> eats all remaining arguments, and forces list context. An argument represented by C<$> forces scalar context. An C<&> requires an anonymous subroutine, which, if passed as the first -argument, does not require the C<sub> keyword or a subsequent comma. A -C<*> allows the subroutine to accept a bareword, constant, scalar expression, +argument, does not require the C<sub> keyword or a subsequent comma. + +A C<*> allows the subroutine to accept a bareword, constant, scalar expression, typeglob, or a reference to a typeglob in that slot. The value will be available to the subroutine either as a simple scalar, or (in the latter -two cases) as a reference to the typeglob. +two cases) as a reference to the typeglob. If you wish to always convert +such arguments to a typeglob reference, use Symbol::qualify_to_ref() as +follows: + + use Symbol 'qualify_to_ref'; + + sub foo (*) { + my $fh = qualify_to_ref(shift, caller); + ... + } A semicolon separates mandatory arguments from optional arguments. It is redundant before C<@> or C<%>, which gobble up everything else. @@ -1220,7 +1230,7 @@ functions to Perl code in L<perlxs>. A subroutine declaration or definition may have a list of attributes associated with it. If such an attribute list is present, it is -broken up at space or comma boundaries and treated as though a +broken up at space or colon boundaries and treated as though a C<use attributes> had been seen. See L<attributes> for details about what attributes are currently supported. Unlike the limitation with the obsolescent C<use attrs>, the @@ -1234,8 +1244,8 @@ nest properly. Examples of valid syntax (even though the attributes are unknown): - sub fnord (&\%) : switch(10,foo(7,3)) , , expensive ; - sub plugh () : Ugly('\(") , Bad ; + sub fnord (&\%) : switch(10,foo(7,3)) : expensive ; + sub plugh () : Ugly('\(") :Bad ; sub xyzzy : _5x5 { ... } Examples of invalid syntax: @@ -1244,7 +1254,7 @@ Examples of invalid syntax: sub snoid : Ugly('(') ; # ()-string not balanced sub xyzzy : 5x5 ; # "5x5" not a valid identifier sub plugh : Y2::north ; # "Y2::north" not a simple identifier - sub snurt : foo + bar ; # "+" not a comma or space + sub snurt : foo + bar ; # "+" not a colon or space The attribute list is passed as a list of constant strings to the code which associates them with the subroutine. In particular, the second example diff --git a/pod/perlsyn.pod b/pod/perlsyn.pod index 1f3ae50f2d..f07bdfeabf 100644 --- a/pod/perlsyn.pod +++ b/pod/perlsyn.pod @@ -5,21 +5,14 @@ perlsyn - Perl syntax =head1 DESCRIPTION A Perl script consists of a sequence of declarations and statements. -The only things that need to be declared in Perl are report formats -and subroutines. See the sections below for more information on those -declarations. All uninitialized user-created objects are assumed to -start with a C<null> or C<0> value until they are defined by some explicit -operation such as assignment. (Though you can get warnings about the -use of undefined values if you like.) The sequence of statements is -executed just once, unlike in B<sed> and B<awk> scripts, where the -sequence of statements is executed for each input line. While this means -that you must explicitly loop over the lines of your input file (or -files), it also means you have much more control over which files and -which lines you look at. (Actually, I'm lying--it is possible to do an -implicit loop with either the B<-n> or B<-p> switch. It's just not the -mandatory default like it is in B<sed> and B<awk>.) - -=head2 Declarations +The sequence of statements is executed just once, unlike in B<sed> +and B<awk> scripts, where the sequence of statements is executed +for each input line. While this means that you must explicitly +loop over the lines of your input file (or files), it also means +you have much more control over which files and which lines you look at. +(Actually, I'm lying--it is possible to do an implicit loop with +either the B<-n> or B<-p> switch. It's just not the mandatory +default like it is in B<sed> and B<awk>.) Perl is, for the most part, a free-form language. (The only exception to this is format declarations, for obvious reasons.) Text from a @@ -29,11 +22,27 @@ interpreted either as division or pattern matching, depending on the context, and C++ C<//> comments just look like a null regular expression, so don't do that. +=head2 Declarations + +The only things you need to declare in Perl are report formats +and subroutines--and even undefined subroutines can be handled +through AUTOLOAD. A variable holds the undefined value (C<undef>) +until it has been assigned a defined value, which is anything +other than C<undef>. When used as a number, C<undef> is treated +as C<0>; when used as a string, it is treated the empty string, +C<"">; and when used as a reference that isn't being assigned +to, it is treated as an error. If you enable warnings, you'll +be notified of an uninitialized value whenever you treat C<undef> +as a string or a number. Well, usually. Boolean ("don't-care") +contexts and operators such as C<++>, C<-->, C<+=>, C<-=>, and +C<.=> are always exempt from such warnings. + A declaration can be put anywhere a statement can, but has no effect on the execution of the primary sequence of statements--declarations all take effect at compile time. Typically all the declarations are put at the beginning or the end of the script. However, if you're using -lexically-scoped private variables created with C<my()>, you'll have to make sure +lexically-scoped private variables created with C<my()>, you'll +have to make sure your format or subroutine definition is within the same block scope as the my if you expect to be able to access those private variables. diff --git a/pod/perltoc.pod b/pod/perltoc.pod index dee5951db5..2f8f3a27af 100644 --- a/pod/perltoc.pod +++ b/pod/perltoc.pod @@ -13,6 +13,8 @@ through to locate the proper section you're looking for. =head2 perl - Practical Extraction and Report Language +=over + =item SYNOPSIS =item DESCRIPTION @@ -43,9 +45,13 @@ environment, with integrated editor support, POSIX 1003.1 compliant library =item NOTES +=back + =head2 perlfaq - frequently asked questions about Perl ($Date: 1999/05/23 20:38:02 $) +=over + =item DESCRIPTION perlfaq: Structural overview of the FAQ, L<perlfaq1>: General Questions @@ -293,9 +299,13 @@ authors 23/May/99, 13/April/99, 7/January/99, 22/June/98, 24/April/97, 23/April/97, 25/March/97, 18/March/97, 17/March/97 Version, Initial Release: 11/March/97 +=back + =head2 perlfaq1 - General Questions About Perl ($Revision: 1.23 $, $Date: 1999/05/23 16:08:30 $) +=over + =item DESCRIPTION =over @@ -336,8 +346,12 @@ Scheme, or Tcl? =item AUTHOR AND COPYRIGHT -=head2 perlfaq2 - Obtaining and Learning about Perl ($Revision: 1.31 $, -$Date: 1999/04/14 03:46:19 $) +=back + +=head2 perlfaq2 - Obtaining and Learning about Perl ($Revision: 1.32 $, +$Date: 1999/10/14 18:46:09 $) + +=over =item DESCRIPTION @@ -385,15 +399,19 @@ References, Tutorials =item Where do I send bug reports? -=item What is perl.com? +=item What is perl.com? Perl Mongers? pm.org? perl.org? =back =item AUTHOR AND COPYRIGHT +=back + =head2 perlfaq3 - Programming Tools ($Revision: 1.38 $, $Date: 1999/05/23 16:08:30 $) +=over + =item DESCRIPTION =over @@ -468,9 +486,13 @@ mean? =item AUTHOR AND COPYRIGHT +=back + =head2 perlfaq4 - Data Manipulation ($Revision: 1.49 $, $Date: 1999/05/23 20:37:49 $) +=over + =item DESCRIPTION =item Data: Numbers @@ -677,9 +699,13 @@ array of hashes or arrays? =item AUTHOR AND COPYRIGHT +=back + =head2 perlfaq5 - Files and Formats ($Revision: 1.38 $, $Date: 1999/05/23 16:08:30 $) +=over + =item DESCRIPTION =over @@ -764,8 +790,12 @@ protected files? Isn't this a bug in Perl? =item AUTHOR AND COPYRIGHT +=back + =head2 perlfaq6 - Regexes ($Revision: 1.27 $, $Date: 1999/05/23 16:08:30 $) +=over + =item DESCRIPTION =over @@ -826,9 +856,13 @@ file? =item AUTHOR AND COPYRIGHT +=back + =head2 perlfaq7 - Perl Language Issues ($Revision: 1.28 $, $Date: 1999/05/23 20:36:18 $) +=over + =item DESCRIPTION =over @@ -901,9 +935,13 @@ is in scope? =item AUTHOR AND COPYRIGHT +=back + =head2 perlfaq8 - System Interaction ($Revision: 1.39 $, $Date: 1999/05/23 18:37:57 $) +=over + =item DESCRIPTION =over @@ -1027,9 +1065,13 @@ search path? =item AUTHOR AND COPYRIGHT +=back + =head2 perlfaq9 - Networking ($Revision: 1.26 $, $Date: 1999/05/23 16:08:30 $) +=over + =item DESCRIPTION =over @@ -1089,7 +1131,11 @@ CGI script to do bad things? =item AUTHOR AND COPYRIGHT -=head2 perldelta - what's new for perl v5.6 (as of v5.005_62) +=back + +=head2 perldelta - what's new for perl v5.6 (as of v5.005_64) + +=over =item DESCRIPTION @@ -1099,18 +1145,19 @@ CGI script to do bad things? =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 +CHECK is a new keyword, 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, delete(), values() 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, Parenthesized not() +behaves like a list operator, Semantics of bareword prototype C<(*)> have +changed =item C Source Incompatibilities -C<PERL_POLLUTE>, C<PERL_IMPLICIT_CONTEXT>, C<PERL_POLLUTE_MALLOC>, C<PL_na> -and C<dTHR> Issues +C<PERL_POLLUTE>, C<PERL_IMPLICIT_CONTEXT>, C<PERL_POLLUTE_MALLOC> =item Compatible C Source API Changes @@ -1140,7 +1187,7 @@ C<PATCHLEVEL> is now C<PERL_VERSION>, Support for C++ exceptions =item C<-A> flag -=item New Installation Scheme +=item Enhanced Installation Directories =back @@ -1150,6 +1197,8 @@ C<PATCHLEVEL> is now C<PERL_VERSION>, Support for C++ exceptions =item Unicode and UTF-8 support +=item Interpreter threads + =item Lexically scoped warning categories =item Lvalue subroutines @@ -1158,20 +1207,30 @@ C<PATCHLEVEL> is now C<PERL_VERSION>, Support for C++ exceptions =item Weak references +=item File globbing implemented internally + =item Binary numbers supported =item Some arrows may be omitted in calls through references +=item exists() is supported on subroutine names + +=item exists() and delete() are supported on array elements + =item syswrite() ease-of-use -=item Filehandles can be autovivified +=item File and directory handles can be autovivified =item 64-bit support =item Large file support +=item Long doubles + =item "more bits" +=item Enhanced support for sort() subroutines + =item Better syntax checks on parenthesized unary operators =item POSIX character class syntax [: :] supported @@ -1224,6 +1283,8 @@ C<PATCHLEVEL> is now C<PERL_VERSION>, Support for C++ exceptions =item Where possible, buffered data discarded from duped input filehandle +=item eof() has the same old magic as <> + =item system(), backticks and pipe open now reflect exec() failure =item Implicitly closed filehandles are safer @@ -1304,12 +1365,12 @@ C<PATCHLEVEL> is now C<PERL_VERSION>, Support for C++ exceptions =item Modules -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 +attributes, B, ByteLoader, constant, charnames, Data::Dumper, DB, DB_File, +Devel::DProf, Dumpvalue, Benchmark, Devel::Peek, ExtUtils::MakeMaker, +Fcntl, File::Compare, File::Find, File::Glob, File::Spec, +File::Spec::Functions, Getopt::Long, IO, JPL, lib, Math::BigInt, +Math::Complex, Math::Trig, Pod::Parser, Pod::Text and Pod::Man, SDBM_File, +Time::Local, Win32, DBM Filters =item Pragmata @@ -1329,44 +1390,55 @@ Win32, DBM Filters =item Documentation Changes -perlopentut.pod, perlreftut.pod, perltootc.pod, perlcompile.pod - -=item New Diagnostics - -"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 +perlapi.pod, perlcompile.pod, perlfilter.pod, perlhack.pod, perlintern.pod, +perlopentut.pod, perlreftut.pod, perltootc.pod + +=item New or Changed Diagnostics + +"%s" variable %s masks earlier declaration in same %s, "my sub" not yet +implemented, "our" variable %s redeclared, '!' 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, /%s/: Unrecognized escape +\\%c passed through, /%s/: Unrecognized escape \\%c in character class +passed through, /%s/ should probably be written as "%s", %s() called too +early to check prototype, %s argument is not a HASH or ARRAY element, %s +argument is not a HASH or ARRAY element or slice, %s argument is not a +subroutine name, %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 +of script "%s", Can't declare class for non-scalar %s in "%s", Can't +declare %s in "%s", Can't ignore signal CHLD, forcing to default, 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, +Did you mean "local" instead of "our"?, Document contains no data, entering +effective %s failed, false [] range "%s" in regexp, Filehandle %s opened +only for output, flock() on closed filehandle %s, Global symbol "%s" +requires explicit package name, 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 [] range "%s" +in regexp, 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 %s specified for -%c, No package name allowed +for variable %s in "our", No space allowed after -%c, 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, Parentheses missing around "%s" list, Possible Y2K bug: +%s, Premature end of script headers, Repeat count in pack overflows, Repeat +count in unpack overflows, 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 environ 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 @@ -1385,8 +1457,12 @@ mean "${$}<digit>" is deprecated =item HISTORY +=back + =head2 perldata - Perl data types +=over + =item DESCRIPTION =over @@ -1409,8 +1485,12 @@ mean "${$}<digit>" is deprecated =item SEE ALSO +=back + =head2 perlsyn - Perl syntax +=over + =item DESCRIPTION =over @@ -1437,8 +1517,12 @@ mean "${$}<digit>" is deprecated =back +=back + =head2 perlop - Perl operators and precedence +=over + =item SYNOPSIS =item DESCRIPTION @@ -1528,8 +1612,12 @@ regular expressions =back +=back + =head2 perlre - Perl regular expressions +=over + =item DESCRIPTION i, m, s, x @@ -1538,7 +1626,7 @@ i, m, s, x =item Regular Expressions -cntrl, graph, print, punct, xdigit, +cntrl, graph, print, punct, xdigit =item Extended Patterns @@ -1555,6 +1643,13 @@ C<(?(condition)yes-pattern|no-pattern)>, C<(?(condition)yes-pattern)> =item Repeated patterns matching zero-length substring +=item Combining pieces together + +C<ST>, C<S|T>, C<S{REPEAT_COUNT}>, C<S{min,max}>, C<S{min,max}?>, C<S?>, +C<S*>, C<S+>, C<S??>, C<S*?>, C<S+?>, C<(?E<gt>S)>, C<(?=S)>, C<(?<=S)>, +C<(?!S)>, C<(?<!S)>, C<(?p{ EXPR })>, +C<(?(condition)yes-pattern|no-pattern)> + =item Creating custom RE engines =back @@ -1563,8 +1658,12 @@ C<(?(condition)yes-pattern|no-pattern)>, C<(?(condition)yes-pattern)> =item SEE ALSO +=back + =head2 perlrun - how to execute the Perl interpreter +=over + =item SYNOPSIS =item DESCRIPTION @@ -1594,8 +1693,12 @@ B<-x> I<directory> HOME, LOGDIR, PATH, PERL5LIB, PERL5OPT, PERLLIB, PERL5DB, PERL5SHELL (specific to the Win32 port), PERL_DEBUG_MSTATS, PERL_DESTRUCT_LEVEL +=back + =head2 perlfunc - Perl builtin functions +=over + =item DESCRIPTION =over @@ -1642,13 +1745,13 @@ endnetent, endprotoent, endservent, getsockname SOCKET, getsockopt SOCKET,LEVEL,OPTNAME, glob EXPR, glob, gmtime EXPR, goto LABEL, goto EXPR, goto &NAME, grep BLOCK LIST, grep EXPR,LIST, hex EXPR, hex, import, index STR,SUBSTR,POSITION, index STR,SUBSTR, int EXPR, int, ioctl -FILEHANDLE,FUNCTION,SCALAR, join EXPR,LIST, keys HASH, kill LIST, last -LABEL, last, lc EXPR, lc, lcfirst EXPR, lcfirst, length EXPR, length, link -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, my EXPR : -ATTRIBUTES, next LABEL, next, no Module LIST, oct EXPR, oct, open +FILEHANDLE,FUNCTION,SCALAR, join EXPR,LIST, keys HASH, kill SIGNAL, LIST, +last LABEL, last, lc EXPR, lc, lcfirst EXPR, lcfirst, length EXPR, length, +link 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, 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, @@ -1691,8 +1794,12 @@ PID,FLAGS, wantarray, warn LIST, write FILEHANDLE, write EXPR, write, y/// =back +=back + =head2 perlvar - Perl predefined variables +=over + =item DESCRIPTION =over @@ -1717,10 +1824,11 @@ $CHILD_ERROR, $?, $OS_ERROR, $ERRNO, $!, $EXTENDED_OS_ERROR, $^E, $EVAL_ERROR, $@, $PROCESS_ID, $PID, $$, $REAL_USER_ID, $UID, $<, $EFFECTIVE_USER_ID, $EUID, $>, $REAL_GROUP_ID, $GID, $(, $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, ${^Warnings}, $EXECUTABLE_NAME, -$^X, $ARGV, @ARGV, @INC, @_, %INC, %ENV, $ENV{expr}, %SIG, $SIG{expr} +$COMPILING, $^C, $DEBUGGING, $^D, $SYSTEM_FD_MAX, $^F, $^H, %^H, +$INPLACE_EDIT, $^I, $^M, $OSNAME, $^O, $PERLDB, $^P, 0x01, 0x02, 0x04, +0x08, 0x10, 0x20, $^R, $^S, $BASETIME, $^T, $WARNING, $^W, ${^WARNING_BITS}, +$EXECUTABLE_NAME, $^X, $ARGV, @ARGV, @INC, @_, %INC, %ENV, $ENV{expr}, +%SIG, $SIG{expr} =item Error Indicators @@ -1730,8 +1838,12 @@ $^X, $ARGV, @ARGV, @INC, @_, %INC, %ENV, $ENV{expr}, %SIG, $SIG{expr} =item BUGS +=back + =head2 perlsub - Perl subroutines +=over + =item SYNOPSIS =item DESCRIPTION @@ -1770,8 +1882,12 @@ You want to temporarily change just one element of an array or hash =item SEE ALSO +=back + =head2 perlmod - Perl modules (packages and symbol tables) +=over + =item DESCRIPTION =over @@ -1790,8 +1906,12 @@ You want to temporarily change just one element of an array or hash =item SEE ALSO +=back + =head2 perlmodlib - constructing new Perl modules and finding existing ones +=over + =item DESCRIPTION =item THE PERL MODULE LIBRARY @@ -1800,42 +1920,42 @@ You want to temporarily change just one element of an array or hash =item Pragmatic Modules -attributes, attrs, autouse, base, blib, constant, diagnostics, fields, -filetest, integer, less, lib, locale, ops, overload, re, sigtrap, strict, -subs, utf8, vars, warnings, vmsish +attributes, attrs, autouse, base, blib, caller, charnames, constant, +diagnostics, fields, filetest, integer, less, lib, locale, ops, overload, +re, sigtrap, strict, subs, utf8, vars, warnings =item Standard Modules AnyDBM_File, AutoLoader, AutoSplit, B, 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::Terse, B::Xref, Benchmark, CGI, CGI::Apache, -CGI::Carp, CGI::Cookie, CGI::Fast, CGI::Push, CGI::Switch, CPAN, -CPAN::FirstTime, CPAN::Nox, Carp, Class::Struct, Config, Cwd, DB, DB_File, -Data::Dumper, Devel::Peek, Devel::SelfStubber, DirHandle, Dumpvalue, -DynaLoader, English, Env, Errno, Exporter, ExtUtils::Command, -ExtUtils::Embed, ExtUtils::Install, ExtUtils::Installed, ExtUtils::Liblist, -ExtUtils::MM_OS2, ExtUtils::MM_Unix, ExtUtils::MM_VMS, ExtUtils::MM_Win32, -ExtUtils::MakeMaker, ExtUtils::Manifest, ExtUtils::Miniperl, +B::Showlex, B::Stackobj, B::Terse, B::Xref, Benchmark, ByteLoader, CGI, +CGI::Apache, CGI::Carp, CGI::Cookie, CGI::Fast, CGI::Pretty, CGI::Push, +CGI::Switch, CPAN, CPAN::FirstTime, CPAN::Nox, Carp, Carp::Heavy, +Class::Struct, Config, Cwd, DB, DB_File, Data::Dumper, Devel::DProf, +Devel::Peek, Devel::SelfStubber, DirHandle, Dumpvalue, DynaLoader, English, +Env, Errno, Exporter, Exporter::Heavy, ExtUtils::Command, ExtUtils::Embed, +ExtUtils::Install, ExtUtils::Installed, ExtUtils::Liblist, +ExtUtils::MM_Cygwin, ExtUtils::MM_OS2, ExtUtils::MM_Unix, ExtUtils::MM_VMS, +ExtUtils::MM_Win32, ExtUtils::MakeMaker, ExtUtils::Manifest, ExtUtils::Mkbootstrap, ExtUtils::Mksymlists, ExtUtils::Packlist, -ExtUtils::testlib, Fatal, Fcntl, File::Basename, File::Compare, File::Copy, -File::DosGlob, File::Find, File::Path, File::Spec, File::Spec::Functions, -File::Spec::Mac, File::Spec::OS2, File::Spec::Unix, File::Spec::VMS, -File::Spec::Win32, File::stat, FileCache, FileHandle, FindBin, GDBM_File, -Getopt::Long, Getopt::Std, I18N::Collate, IO, IO::Dir, IO::File, -IO::Handle, IO::Pipe, IO::Poll, IO::Seekable, IO::Select, IO::Socket, -IO::Socket::INET, IO::Socket::UNIX, IPC::Msg, IPC::Open2, IPC::Open3, -IPC::Semaphore, IPC::SysV, Math::BigFloat, Math::BigInt, Math::Complex, -Math::Trig, NDBM_File, Net::Ping, Net::hostent, Net::netent, Net::protoent, -Net::servent, O, Opcode, POSIX, Pod::Html, Pod::Text, SDBM_File, Safe, -Search::Dict, SelectSaver, SelfLoader, Shell, Socket, Symbol, -Sys::Hostname, Sys::Syslog, Term::Cap, Term::Complete, Term::ReadLine, -Test, Test::Harness, Text::Abbrev, Text::ParseWords, Text::Soundex, -Text::Tabs -- expand and unexpand tabs per the unix expand(1) and -unexpand(1), Text::Wrap, Thread, Thread::Queue, Thread::Semaphore, -Thread::Signal, Thread::Specific, Tie::Array, Tie::Handle, Tie::Hash, -Tie::StdHash, Tie::RefHash, Tie::Scalar, Tie::StdScalar, Tie::SubstrHash, -Time::Local, Time::gmtime, Time::localtime, Time::tm, UNIVERSAL, -User::grent, User::pwent +ExtUtils::testlib, Fatal, Fcntl, File::Basename, File::CheckTree, +File::Compare, File::Copy, File::DosGlob, File::Find, File::Glob, +File::Path, File::Spec, File::Spec::Functions, File::Spec::Mac, +File::Spec::OS2, File::Spec::Unix, File::Spec::VMS, File::Spec::Win32, +File::stat, FileCache, FileHandle, FindBin, GDBM_File, Getopt::Long, +Getopt::Std, I18N::Collate, IO, IO::Dir, IO::File, IO::Handle, IO::Pipe, +IO::Poll, IO::Seekable, IO::Select, IO::Socket, IO::Socket::INET, +IO::Socket::UNIX, IPC::Msg, IPC::Open2, IPC::Open3, IPC::Semaphore, +IPC::SysV, Math::BigFloat, Math::BigInt, Math::Complex, Math::Trig, +Net::Ping, Net::hostent, Net::netent, Net::protoent, Net::servent, O, +Opcode, POSIX, Pod::Checker, Pod::Html, Pod::InputObjects, Pod::Man, +Pod::Parser, Pod::Select, Pod::Text, Pod::Text::Color, Pod::Usage, +SDBM_File, Safe, Search::Dict, SelectSaver, SelfLoader, Shell, Socket, +Symbol, Sys::Hostname, Sys::Syslog, Term::Cap, Term::Complete, +Term::ReadLine, Test, Test::Harness, Text::Abbrev, Text::ParseWords, +Text::Soundex, Text::Wrap, Tie::Array, Tie::Handle, Tie::Hash, +Tie::RefHash, Tie::Scalar, Tie::SubstrHash, Time::Local, Time::gmtime, +Time::localtime, Time::tm, UNIVERSAL, User::grent, User::pwent =item Extension Modules @@ -1855,8 +1975,8 @@ World Wide Web, HTML, HTTP, CGI, MIME, Server and Daemon Utilities, Archiving and Compression, Images, Pixmap and Bitmap Manipulation, Drawing, and Graphing, Mail and Usenet News, Control Flow Utilities (callbacks and exceptions etc), File Handle and Input/Output Stream Utilities, -Miscellaneous Modules, Africa, Asia, Australasia, Europe, North America, -South America +Miscellaneous Modules, Africa, Asia, Australasia, Central America, Europe, +North America, South America =item Modules: Creation, Use, and Abuse @@ -1895,8 +2015,12 @@ can then be reduced to a small =item NOTE +=back + =head2 perlmodinstall - Installing CPAN Modules +=over + =item DESCRIPTION =over @@ -1914,8 +2038,50 @@ module (sometimes unnecessary), B<INSTALL> the module =item COPYRIGHT +=back + +=head2 perlfork - Perl's fork() emulation + +=over + +=item SYNOPSIS + +=item DESCRIPTION + +=over + +=item Behavior of other Perl features in forked pseudo-processes + +$$ or $PROCESS_ID, %ENV, chdir() and all other builtins that accept +filenames, wait() and waitpid(), kill(), exec(), exit(), Open handles to +files, directories and network sockets + +=item Resource limits + +=item Killing the parent process + +=item Lifetime of the parent process and pseudo-processes + +=item CAVEATS AND LIMITATIONS + +BEGIN blocks, Open filehandles, Forking pipe open() not yet implemented, +Global state maintained by XSUBs, Interpreter embedded in larger +application, Thread-safety of extensions + +=back + +=item BUGS + +=item AUTHOR + +=item SEE ALSO + +=back + =head2 perlform - Perl formats +=over + =item DESCRIPTION =over @@ -1936,9 +2102,13 @@ module (sometimes unnecessary), B<INSTALL> the module =item WARNINGS +=back + =head2 perllocale - Perl locale handling (internationalization and localization) +=over + =item DESCRIPTION =item PREPARING TO USE LOCALES @@ -1990,12 +2160,11 @@ localization) B<Comparison operators> (C<lt>, C<le>, C<ge>, C<gt> and C<cmp>):, B<Case-mapping interpolation> (with C<\l>, C<\L>, C<\u> or C<\U>), B<Matching operator> (C<m//>):, B<Substitution operator> (C<s///>):, -B<In-memory formatting function> (sprintf()):, B<Output formatting -functions> (printf() and write()):, B<Case-mapping functions> (lc(), -lcfirst(), uc(), ucfirst()):, B<POSIX locale-dependent functions> -(localeconv(), strcoll(),strftime(), strxfrm()):, B<POSIX character class -tests> (isalnum(), isalpha(), isdigit(),isgraph(), islower(), isprint(), -ispunct(), isspace(), isupper(), +B<Output formatting functions> (printf() and write()):, B<Case-mapping +functions> (lc(), lcfirst(), uc(), ucfirst()):, B<POSIX locale-dependent +functions> (localeconv(), strcoll(),strftime(), strxfrm()):, B<POSIX +character class tests> (isalnum(), isalpha(), isdigit(),isgraph(), +islower(), isprint(), ispunct(), isspace(), isupper(), isxdigit()): =item ENVIRONMENT @@ -2035,8 +2204,12 @@ LC_NUMERIC, LC_TIME, LANG =item HISTORY +=back + =head2 perlref - Perl references and nested data structures +=over + =item NOTE =item DESCRIPTION @@ -2061,8 +2234,12 @@ LC_NUMERIC, LC_TIME, LANG =item SEE ALSO +=back + =head2 perlreftut - Mark's very short tutorial about references +=over + =item DESCRIPTION =item Who Needs Complicated Data Structures? @@ -2097,8 +2274,12 @@ LC_NUMERIC, LC_TIME, LANG =back +=back + =head2 perldsc - Perl Data Structures Cookbook +=over + =item DESCRIPTION arrays of arrays, hashes of arrays, arrays of hashes, hashes of hashes, @@ -2182,8 +2363,12 @@ more elaborate constructs =item AUTHOR +=back + =head2 perllol - Manipulating Arrays of Arrays in Perl +=over + =item DESCRIPTION =item Declaration and Access of Arrays of Arrays @@ -2198,8 +2383,12 @@ more elaborate constructs =item AUTHOR +=back + =head2 perltoot - Tom's object-oriented tutorial for perl +=over + =item DESCRIPTION =item Creating a Class @@ -2294,8 +2483,12 @@ more elaborate constructs =back +=back + =head2 perltootc - Tom's OO Tutorial for Class Data in Perl +=over + =item DESCRIPTION =item Class Data as Package Variables @@ -2342,8 +2535,12 @@ more elaborate constructs =item HISTORY +=back + =head2 perlobj - Perl objects +=over + =item DESCRIPTION =over @@ -2372,8 +2569,12 @@ isa(CLASS), can(METHOD), VERSION( [NEED] ) =item SEE ALSO +=back + =head2 perltie - how to hide an object class in a simple variable +=over + =item SYNOPSIS =item DESCRIPTION @@ -2410,8 +2611,12 @@ LIST, READ this, LIST, READLINE this, GETC this, CLOSE this, DESTROY this =item AUTHOR +=back + =head2 perlbot - Bag'o Object Tricks (the BOT) +=over + =item DESCRIPTION =item OO SCALING TIPS @@ -2436,9 +2641,13 @@ LIST, READ this, LIST, READLINE this, GETC this, CLOSE this, DESTROY this =item DELEGATION +=back + =head2 perlipc - Perl interprocess communication (signals, fifos, pipes, safe subprocesses, sockets, and semaphores) +=over + =item DESCRIPTION =item Signals @@ -2511,8 +2720,12 @@ Proto, LocalPort, Listen, Reuse =item SEE ALSO +=back + =head2 perldbmfilter - Perl DBM Filters +=over + =item SYNOPSIS =item DESCRIPTION @@ -2534,8 +2747,12 @@ B<filter_fetch_value> =item AUTHOR +=back + =head2 perldebug - Perl debugging +=over + =item DESCRIPTION =item The Perl Debugger @@ -2623,12 +2840,20 @@ C<anchored(TYPE)> =back +=back + =head2 perldiag - various Perl diagnostics +=over + =item DESCRIPTION +=back + =head2 perlsec - Perl security +=over + =item DESCRIPTION =over @@ -2647,8 +2872,12 @@ C<anchored(TYPE)> =item SEE ALSO +=back + =head2 perltrap - Perl traps for the unwary +=over + =item DESCRIPTION =over @@ -2674,7 +2903,7 @@ Subroutine, Signal, Sorting Traps, OS Traps, DBM Traps, Unclassified Traps Discontinuance, Deprecation, BugFix, Discontinuance, Discontinuance, Discontinuance, BugFix, Discontinuance, Discontinuance, BugFix, -Discontinuance, Discontinuance, Deprecation, Discontinuance +Discontinuance, Deprecation, Discontinuance =item Parsing Traps @@ -2682,7 +2911,7 @@ Parsing, Parsing, Parsing, Parsing =item Numerical Traps -Numerical, Numerical, Numerical +Numerical, Numerical, Numerical, Bitwise string ops =item General data type traps @@ -2728,8 +2957,12 @@ LIMIT specified =back +=back + =head2 perlport - Writing portable Perl +=over + =item DESCRIPTION Not all Perl programs have to be portable, Nearly all of Perl already I<is> @@ -2841,7 +3074,7 @@ getnetent, getprotoent, getservent, setpwent, setgrent, sethostent STAYOPEN, setnetent STAYOPEN, setprotoent STAYOPEN, setservent STAYOPEN, endpwent, endgrent, endhostent, endnetent, endprotoent, endservent, getsockopt SOCKET,LEVEL,OPTNAME, glob EXPR, glob, ioctl -FILEHANDLE,FUNCTION,SCALAR, kill LIST, link OLDFILE,NEWFILE, lstat +FILEHANDLE,FUNCTION,SCALAR, kill SIGNAL, LIST, link OLDFILE,NEWFILE, lstat FILEHANDLE, lstat EXPR, lstat, msgctl ID,CMD,ARG, msgget KEY,FLAGS, msgsnd ID,MSG,FLAGS, msgrcv ID,VAR,SIZE,TYPE,FLAGS, open FILEHANDLE,EXPR, open FILEHANDLE, pipe READHANDLE,WRITEHANDLE, readlink EXPR, readlink, select @@ -2859,22 +3092,30 @@ wait, waitpid PID,FLAGS =item CHANGES -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 +v1.45, 20 December 1999, 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 VERSION +=back + =head2 perlstyle - Perl style guide +=over + =item DESCRIPTION +=back + =head2 perlpod - plain old documentation +=over + =item DESCRIPTION =over @@ -2897,12 +3138,20 @@ v1.23, 10 July 1998 =item AUTHOR +=back + =head2 perlbook - Perl book information +=over + =item DESCRIPTION +=back + =head2 perlembed - how to embed perl in your C program +=over + =item DESCRIPTION =over @@ -2943,8 +3192,12 @@ program =item COPYRIGHT +=back + =head2 perlapio - perl's IO abstraction interface. +=over + =item SYNOPSIS =item DESCRIPTION @@ -2973,8 +3226,12 @@ B<PerlIO_get_base(f)>, B<PerlIO_get_bufsiz(f)> =back +=back + =head2 perlxs - XS language reference manual +=over + =item DESCRIPTION =over @@ -3063,8 +3320,12 @@ B<PerlIO_get_base(f)>, B<PerlIO_get_bufsiz(f)> =item AUTHOR +=back + =head2 perlxstut, perlXStut - Tutorial for writing XSUBs +=over + =item DESCRIPTION =item SPECIAL NOTES @@ -3107,7 +3368,11 @@ B<PerlIO_get_base(f)>, B<PerlIO_get_bufsiz(f)> =item What has happened here? -=item More about XSUBPP +=item Anatomy of .xs file + +=item Getting the fat out of XSUBs + +=item More about XSUB arguments =item The Argument Stack @@ -3143,7 +3408,11 @@ B<PerlIO_get_base(f)>, B<PerlIO_get_bufsiz(f)> =back -=head2 perlguts - Perl's Internal Functions +=back + +=head2 perlguts - Introduction to the Perl API + +=over =item DESCRIPTION @@ -3239,7 +3508,7 @@ C<void save_hptr(HV **hptr)> =back -=item The Perl Internal API +=item How multiple interpreters and concurrency are supported =over @@ -3251,57 +3520,16 @@ C<void save_hptr(HV **hptr)> =back -=item API LISTING +=item AUTHORS -av_clear, av_extend, av_fetch, AvFILL, av_len, av_make, av_pop, av_push, -av_shift, av_store, av_undef, av_unshift, CLASS, Copy, croak, CvSTASH, -PL_DBsingle, PL_DBsub, PL_DBtrace, dMARK, dORIGMARK, PL_dowarn, dSP, -dXSARGS, dXSI32, do_binmode, ENTER, EXTEND, fbm_compile, fbm_instr, -FREETMPS, G_ARRAY, G_DISCARD, G_EVAL, GIMME, GIMME_V, G_NOARGS, G_SCALAR, -gv_fetchmeth, gv_fetchmethod, gv_fetchmethod_autoload, G_VOID, gv_stashpv, -gv_stashsv, GvSV, HEf_SVKEY, HeHASH, HeKEY, HeKLEN, HePV, HeSVKEY, -HeSVKEY_force, HeSVKEY_set, HeVAL, hv_clear, hv_delete, hv_delete_ent, -hv_exists, hv_exists_ent, hv_fetch, hv_fetch_ent, hv_iterinit, hv_iterkey, -hv_iterkeysv, hv_iternext, hv_iternextsv, hv_iterval, hv_magic, HvNAME, -hv_store, hv_store_ent, hv_undef, isALNUM, isALPHA, isDIGIT, isLOWER, -isSPACE, isUPPER, items, ix, LEAVE, looks_like_number, MARK, mg_clear, -mg_copy, mg_find, mg_free, mg_get, mg_len, mg_magical, mg_set, modglobal, -Move, PL_na, New, newAV, Newc, newCONSTSUB, newHV, newRV_inc, newRV_noinc, -NEWSV, newSViv, newSVnv, newSVpv, newSVpvf, newSVpvn, newSVrv, newSVsv, -newXS, newXSproto, Newz, Nullav, Nullch, Nullcv, Nullhv, Nullsv, ORIGMARK, -perl_alloc, perl_call_argv, perl_call_method, perl_call_pv, perl_call_sv, -perl_construct, perl_destruct, perl_eval_sv, perl_eval_pv, perl_free, -perl_get_av, perl_get_cv, perl_get_hv, perl_get_sv, perl_parse, -perl_require_pv, perl_run, POPi, POPl, POPp, POPn, POPs, PUSHMARK, PUSHi, -PUSHn, PUSHp, PUSHs, PUSHu, PUTBACK, Renew, Renewc, RETVAL, safefree, -safemalloc, saferealloc, savepv, savepvn, SAVETMPS, SP, SPAGAIN, ST, strEQ, -strGE, strGT, strLE, strLT, strNE, strnEQ, strnNE, sv_2mortal, sv_bless, -sv_catpv, sv_catpv_mg, sv_catpvn, sv_catpvn_mg, sv_catpvf, sv_catpvf_mg, -sv_catsv, sv_catsv_mg, sv_chop, sv_cmp, SvCUR, SvCUR_set, sv_dec, -sv_derived_from, SvEND, sv_eq, SvGETMAGIC, SvGROW, sv_grow, sv_inc, -sv_insert, SvIOK, SvIOK_off, SvIOK_on, SvIOK_only, SvIOKp, sv_isa, -sv_isobject, SvIV, SvIVX, SvLEN, sv_len, sv_magic, sv_mortalcopy, -sv_newmortal, SvNIOK, SvNIOK_off, SvNIOKp, PL_sv_no, SvNOK, SvNOK_off, -SvNOK_on, SvNOK_only, SvNOKp, SvNV, SvNVX, SvOK, SvOOK, SvPOK, SvPOK_off, -SvPOK_on, SvPOK_only, SvPOKp, SvPV, SvPV_force, SvPV_nolen, SvPVX, -SvREFCNT, SvREFCNT_dec, SvREFCNT_inc, SvROK, SvROK_off, SvROK_on, SvRV, -SvSETMAGIC, sv_setiv, sv_setiv_mg, sv_setnv, sv_setnv_mg, sv_setpv, -sv_setpv_mg, sv_setpviv, sv_setpviv_mg, sv_setpvn, sv_setpvn_mg, sv_setpvf, -sv_setpvf_mg, sv_setref_iv, sv_setref_nv, sv_setref_pv, sv_setref_pvn, -SvSetSV, SvSetSV_nosteal, sv_setsv, sv_setsv_mg, sv_setuv, sv_setuv_mg, -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_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 SEE ALSO -=item AUTHORS +=back =head2 perlcall - Perl calling conventions from C +=over + =item DESCRIPTION An Error Handler, An Event Driven Program @@ -3382,8 +3610,12 @@ callback =item DATE +=back + =head2 perlcompile - Introduction to the Perl Compiler-Translator +=over + =item DESCRIPTION =over @@ -3422,8 +3654,80 @@ B::Stash, B::Terse, B::Xref =item AUTHOR +=back + +=head2 perlapi - autogenerated documentation for the perl public API + +=over + +=item DESCRIPTION + +AvFILL, av_clear, av_extend, av_fetch, av_len, av_make, av_pop, av_push, +av_shift, av_store, av_undef, av_unshift, call_argv, call_method, call_pv, +call_sv, CLASS, Copy, croak, CvSTASH, dMARK, dORIGMARK, dSP, dXSARGS, +dXSI32, ENTER, eval_pv, eval_sv, EXTEND, fbm_compile, fbm_instr, FREETMPS, +get_av, get_cv, get_hv, get_sv, GIMME, GIMME_V, GvSV, gv_fetchmeth, +gv_fetchmethod, gv_fetchmethod_autoload, gv_stashpv, gv_stashsv, G_ARRAY, +G_DISCARD, G_EVAL, G_NOARGS, G_SCALAR, G_VOID, HEf_SVKEY, HeHASH, HeKEY, +HeKLEN, HePV, HeSVKEY, HeSVKEY_force, HeSVKEY_set, HeVAL, HvNAME, hv_clear, +hv_delete, hv_delete_ent, hv_exists, hv_exists_ent, hv_fetch, hv_fetch_ent, +hv_iterinit, hv_iterkey, hv_iterkeysv, hv_iternext, hv_iternextsv, +hv_iterval, hv_magic, hv_store, hv_store_ent, hv_undef, isALNUM, isALPHA, +isDIGIT, isLOWER, isSPACE, isUPPER, items, ix, LEAVE, looks_like_number, +MARK, mg_clear, mg_copy, mg_find, mg_free, mg_get, mg_length, mg_magical, +mg_set, Move, New, newAV, Newc, newCONSTSUB, newHV, newRV_inc, newRV_noinc, +NEWSV, newSViv, newSVnv, newSVpv, newSVpvf, newSVpvn, newSVrv, newSVsv, +newXS, newXSproto, Newz, Nullav, Nullch, Nullcv, Nullhv, Nullsv, ORIGMARK, +perl_alloc, perl_construct, perl_destruct, perl_free, perl_parse, perl_run, +PL_DBsingle, PL_DBsub, PL_DBtrace, PL_dowarn, PL_modglobal, PL_na, +PL_sv_no, PL_sv_undef, PL_sv_yes, POPi, POPl, POPn, POPp, POPs, PUSHi, +PUSHMARK, PUSHn, PUSHp, PUSHs, PUSHu, PUTBACK, Renew, Renewc, require_pv, +RETVAL, Safefree, savepv, savepvn, SAVETMPS, SP, SPAGAIN, ST, strEQ, strGE, +strGT, strLE, strLT, strNE, strnEQ, strnNE, StructCopy, SvCUR, SvCUR_set, +SvEND, SvGETMAGIC, SvGROW, SvIOK, SvIOKp, SvIOK_off, SvIOK_on, SvIOK_only, +SvIV, SvIVX, SvLEN, SvNIOK, SvNIOKp, SvNIOK_off, SvNOK, SvNOKp, SvNOK_off, +SvNOK_on, SvNOK_only, SvNV, SvNVX, SvOK, SvOOK, SvPOK, SvPOKp, SvPOK_off, +SvPOK_on, SvPOK_only, SvPV, SvPVX, SvPV_force, SvPV_nolen, SvREFCNT, +SvREFCNT_dec, SvREFCNT_inc, SvROK, SvROK_off, SvROK_on, SvRV, SvSETMAGIC, +SvSetSV, SvSetSV_nosteal, SvSTASH, SvTAINT, SvTAINTED, SvTAINTED_off, +SvTAINTED_on, SvTRUE, SvTYPE, svtype, SVt_IV, SVt_NV, SVt_PV, SVt_PVAV, +SVt_PVCV, SVt_PVHV, SVt_PVMG, SvUPGRADE, SvUV, SvUVX, sv_2mortal, sv_bless, +sv_catpv, sv_catpvf, sv_catpvf_mg, sv_catpvn, sv_catpvn_mg, sv_catpv_mg, +sv_catsv, sv_catsv_mg, sv_chop, sv_cmp, sv_dec, sv_derived_from, sv_eq, +sv_grow, sv_inc, sv_insert, sv_isa, sv_isobject, sv_len, sv_magic, +sv_mortalcopy, sv_newmortal, sv_setiv, sv_setiv_mg, sv_setnv, sv_setnv_mg, +sv_setpv, sv_setpvf, sv_setpvf_mg, sv_setpviv, sv_setpviv_mg, sv_setpvn, +sv_setpvn_mg, sv_setpv_mg, sv_setref_iv, sv_setref_nv, sv_setref_pv, +sv_setref_pvn, sv_setsv, sv_setsv_mg, sv_setuv, sv_setuv_mg, sv_unref, +sv_upgrade, sv_usepvn, sv_usepvn_mg, sv_vcatpvfn, sv_vsetpvfn, 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_mNO, XST_mNV, +XST_mPV, XST_mUNDEF, XST_mYES, XS_VERSION, XS_VERSION_BOOTCHECK, Zero + +=item AUTHORS + +=item SEE ALSO + +=back + +=head2 perlintern - autogenerated documentation of purely B<internal> + Perl functions + +=over + +=item DESCRIPTION + +=item AUTHORS + +=item SEE ALSO + +=back + =head2 perlhist - the Perl history records +=over + =item DESCRIPTION =item INTRODUCTION @@ -3448,24 +3752,36 @@ B::Stash, B::Terse, B::Xref =item THE KEEPERS OF THE RECORDS +=back + =head1 PRAGMA DOCUMENTATION =head2 attrs - set/get attributes of a subroutine (deprecated) +=over + =item SYNOPSIS =item DESCRIPTION method, locked +=back + =head2 re - Perl pragma to alter regular expression behaviour +=over + =item SYNOPSIS =item DESCRIPTION +=back + =head2 attributes - get/set subroutine or variable attributes +=over + =item SYNOPSIS =item DESCRIPTION @@ -3488,20 +3804,40 @@ FETCH_I<type>_ATTRIBUTES, MODIFY_I<type>_ATTRIBUTES =back +=item EXPORTS + +=over + +=item Default exports + +=item Available exports + +=item Export tags defined + +=back + =item EXAMPLES =item SEE ALSO +=back + =head2 attrs - set/get attributes of a subroutine (deprecated) +=over + =item SYNOPSIS =item DESCRIPTION method, locked +=back + =head2 autouse - postpone load of modules until a function is used +=over + =item SYNOPSIS =item DESCRIPTION @@ -3512,8 +3848,12 @@ method, locked =item SEE ALSO +=back + =head2 base - Establish IS-A relationship with base class at compile time +=over + =item SYNOPSIS =item DESCRIPTION @@ -3522,8 +3862,12 @@ method, locked =item SEE ALSO +=back + =head2 blib - Use MakeMaker's uninstalled version of a package +=over + =item SYNOPSIS =item DESCRIPTION @@ -3532,17 +3876,36 @@ method, locked =item AUTHOR +=back + +=head2 byte - Perl pragma to turn force treating strings as bytes not +UNICODE + +=over + +=item SYNOPSIS + +=item DESCRIPTION + +=back + =head2 caller - inherit pragmatic attributes from the context of the caller +=over + =item SYNOPSIS =item DESCRIPTION encoding +=back + =head2 charnames - define character names for C<\N{named}> string literal escape. +=over + =item SYNOPSIS =item DESCRIPTION @@ -3551,8 +3914,12 @@ escape. =item BUGS +=back + =head2 constant - Perl pragma to declare constants +=over + =item SYNOPSIS =item DESCRIPTION @@ -3567,9 +3934,13 @@ escape. =item COPYRIGHT +=back + =head2 diagnostics - Perl compiler pragma to force verbose warning diagnostics +=over + =item SYNOPSIS =item DESCRIPTION @@ -3590,16 +3961,24 @@ diagnostics =item AUTHOR +=back + =head2 fields - compile-time class fields +=over + =item SYNOPSIS =item DESCRIPTION =item SEE ALSO +=back + =head2 filetest - Perl pragma to control the filetest permission operators +=over + =item SYNOPSIS $can_perhaps_read = -r "file"; # use the mode bits @@ -3617,21 +3996,33 @@ diagnostics =back +=back + =head2 integer - Perl pragma to compute arithmetic in integer instead of double +=over + =item SYNOPSIS =item DESCRIPTION +=back + =head2 less - perl pragma to request less of something from the compiler +=over + =item SYNOPSIS =item DESCRIPTION +=back + =head2 lib - manipulate @INC at compile time +=over + =item SYNOPSIS =item DESCRIPTION @@ -3650,23 +4041,35 @@ double =item AUTHOR +=back + =head2 locale - Perl pragma to use and avoid POSIX locales for built-in operations +=over + =item SYNOPSIS =item DESCRIPTION +=back + =head2 ops - Perl pragma to restrict unsafe operations when compiling +=over + =item SYNOPSIS =item DESCRIPTION =item SEE ALSO +=back + =head2 overload - Package for overloading perl operations +=over + =item SYNOPSIS =item DESCRIPTION @@ -3757,14 +4160,22 @@ integer, float, binary, q, qr =item BUGS +=back + =head2 re - Perl pragma to alter regular expression behaviour +=over + =item SYNOPSIS =item DESCRIPTION +=back + =head2 sigtrap - Perl pragma to enable simple signal handling +=over + =item SYNOPSIS =item DESCRIPTION @@ -3789,44 +4200,68 @@ B<untrapped>, B<any>, I<signal>, I<number> =item EXAMPLES +=back + =head2 strict - Perl pragma to restrict unsafe constructs +=over + =item SYNOPSIS =item DESCRIPTION C<strict refs>, C<strict vars>, C<strict subs> +=back + =head2 subs - Perl pragma to predeclare sub names +=over + =item SYNOPSIS =item DESCRIPTION +=back + =head2 utf8 - Perl pragma to turn on UTF-8 and Unicode support +=over + =item SYNOPSIS =item DESCRIPTION =item CAVEATS -=head2 vars - Perl pragma to predeclare global variable names +=back + +=head2 vars - Perl pragma to predeclare global variable names (obsolete) + +=over =item SYNOPSIS =item DESCRIPTION +=back + =head2 warnings - Perl pragma to control optional warnings +=over + =item SYNOPSIS =item DESCRIPTION +=back + =head1 MODULE DOCUMENTATION =head2 AnyDBM_File - provide framework for multiple DBMs +=over + =item SYNOPSIS =item DESCRIPTION @@ -3841,8 +4276,12 @@ C<strict refs>, C<strict vars>, C<strict subs> =item SEE ALSO +=back + =head2 AutoLoader - load subroutines only on demand +=over + =item SYNOPSIS =item DESCRIPTION @@ -3865,8 +4304,12 @@ C<strict refs>, C<strict vars>, C<strict subs> =item SEE ALSO +=back + =head2 AutoSplit - split a package for autoloading +=over + =item SYNOPSIS =item DESCRIPTION @@ -3881,8 +4324,12 @@ $keep, $check, $modtime =item DIAGNOSTICS +=back + =head2 B - The Perl Compiler +=over + =item SYNOPSIS =item DESCRIPTION @@ -3931,8 +4378,8 @@ USEFUL, PREVIOUS, RARE, TABLE =item B::GV METHODS -NAME, STASH, SV, IO, FORM, AV, HV, EGV, CV, CVGEN, LINE, FILEGV, GvREFCNT, -FLAGS +NAME, STASH, SV, IO, FORM, AV, HV, EGV, CV, CVGEN, LINE, FILE, FILEGV, +GvREFCNT, FLAGS =item B::IO METHODS @@ -3945,7 +4392,7 @@ FILL, MAX, OFF, ARRAY, AvFLAGS =item B::CV METHODS -STASH, START, ROOT, GV, FILEGV, DEPTH, PADLIST, OUTSIDE, XSUB, XSUBANY, +STASH, START, ROOT, GV, FILE, DEPTH, PADLIST, OUTSIDE, XSUB, XSUBANY, CvFLAGS =item B::HV METHODS @@ -3980,11 +4427,11 @@ pmreplroot, pmreplstart, pmnext, pmregexp, pmflags, pmpermflags, precomp =item B::SVOP METHOD -sv +sv, gv -=item B::GVOP METHOD +=item B::PADOP METHOD -gv +padix =item B::PVOP METHOD @@ -3996,7 +4443,7 @@ redoop, nextop, lastop =item B::COP METHODS -label, stash, filegv, cop_seq, arybase, line +label, stash, file, cop_seq, arybase, line =back @@ -4009,40 +4456,56 @@ hash(STR), cast_I32(I), minus_c, cstring(STR), class(OBJ), threadsv_names =item AUTHOR +=back + =head2 B::Asmdata - Autogenerated data about Perl ops, used to generate bytecode +=over + =item SYNOPSIS =item DESCRIPTION =item AUTHOR +=back + =head2 B::Assembler - Assemble Perl bytecode +=over + =item SYNOPSIS =item DESCRIPTION =item AUTHOR +=back + =head2 B::Bblock - Walk basic blocks +=over + =item SYNOPSIS =item DESCRIPTION =item AUTHOR +=back + =head2 B::Bytecode - Perl compiler's bytecode backend +=over + =item SYNOPSIS =item DESCRIPTION =item OPTIONS -B<-ofilename>, B<-->, B<-f>, B<-fcompress-nullops>, +B<-ofilename>, B<-afilename>, B<-->, B<-f>, B<-fcompress-nullops>, B<-fomit-sequence-numbers>, B<-fbypass-nullops>, B<-fstrip-syntax-tree>, B<-On>, B<-D>, B<-Do>, B<-Db>, B<-Da>, B<-DC>, B<-S>, B<-m> @@ -4052,8 +4515,12 @@ B<-On>, B<-D>, B<-Do>, B<-Db>, B<-Da>, B<-DC>, B<-S>, B<-m> =item AUTHOR +=back + =head2 B::C - Perl compiler's C backend +=over + =item SYNOPSIS =item DESCRIPTION @@ -4069,8 +4536,12 @@ B<-DC>, B<-DM>, B<-f>, B<-fcog>, B<-fno-cog>, B<-On> =item AUTHOR +=back + =head2 B::CC - Perl compiler's optimized C translation backend +=over + =item SYNOPSIS =item DESCRIPTION @@ -4101,16 +4572,24 @@ B<-ffreetmps-each-bblock>, B<-ffreetmps-each-loop>, B<-fomit-taint>, B<-On> =item AUTHOR +=back + =head2 B::Debug - Walk Perl syntax tree, printing debug info about ops +=over + =item SYNOPSIS =item DESCRIPTION =item AUTHOR +=back + =head2 B::Deparse - Perl compiler backend to produce perl code +=over + =item SYNOPSIS =item DESCRIPTION @@ -4138,16 +4617,24 @@ B<T>, B<v>I<STRING>B<.> =item AUTHOR +=back + =head2 B::Disassembler - Disassemble Perl bytecode +=over + =item SYNOPSIS =item DESCRIPTION =item AUTHOR +=back + =head2 B::Lint - Perl lint +=over + =item SYNOPSIS =item DESCRIPTION @@ -4165,8 +4652,12 @@ B<-u Package> =item AUTHOR +=back + =head2 B::O, O - Generic interface to Perl Compiler backends +=over + =item SYNOPSIS =item DESCRIPTION @@ -4177,32 +4668,48 @@ B<-u Package> =item AUTHOR +=back + =head2 B::Showlex - Show lexical variables used in functions or files +=over + =item SYNOPSIS =item DESCRIPTION =item AUTHOR +=back + =head2 B::Stackobj - Helper module for CC backend +=over + =item SYNOPSIS =item DESCRIPTION =item AUTHOR +=back + =head2 B::Terse - Walk Perl syntax tree, printing terse info about ops +=over + =item SYNOPSIS =item DESCRIPTION =item AUTHOR +=back + =head2 B::Xref - Generates cross reference reports for Perl programs +=over + =item SYNOPSIS =item DESCRIPTION @@ -4215,15 +4722,23 @@ C<-oFILENAME>, C<-r>, C<-D[tO]> =item AUTHOR +=back + =head2 Bblock, B::Bblock - Walk basic blocks +=over + =item SYNOPSIS =item DESCRIPTION =item AUTHOR -=head2 Benchmark - benchmark running times of code +=back + +=head2 Benchmark - benchmark running times of Perl code + +=over =item SYNOPSIS @@ -4251,16 +4766,24 @@ STYLE ] ), cmpthese ( RESULTSHASHREF ), countit(TIME, CODE), disablecache ( =item NOTES +=item EXAMPLES + =item INHERITANCE =item CAVEATS +=item SEE ALSO + =item AUTHORS =item MODIFICATION HISTORY +=back + =head2 ByteLoader - load byte compiled perl code +=over + =item SYNOPSIS =item DESCRIPTION @@ -4269,15 +4792,19 @@ STYLE ] ), cmpthese ( RESULTSHASHREF ), countit(TIME, CODE), disablecache ( =item SEE ALSO +=back + =head2 Bytecode, B::Bytecode - Perl compiler's bytecode backend +=over + =item SYNOPSIS =item DESCRIPTION =item OPTIONS -B<-ofilename>, B<-->, B<-f>, B<-fcompress-nullops>, +B<-ofilename>, B<-afilename>, B<-->, B<-f>, B<-fcompress-nullops>, B<-fomit-sequence-numbers>, B<-fbypass-nullops>, B<-fstrip-syntax-tree>, B<-On>, B<-D>, B<-Do>, B<-Db>, B<-Da>, B<-DC>, B<-S>, B<-m> @@ -4287,8 +4814,12 @@ B<-On>, B<-D>, B<-Do>, B<-Db>, B<-Da>, B<-DC>, B<-S>, B<-m> =item AUTHOR +=back + =head2 CGI - Simple Common Gateway Interface Class +=over + =item SYNOPSIS =item ABSTRACT @@ -4524,23 +5055,31 @@ MacEachern (dougm@opengroup.org), Robin Houston (robin@oneworld.org), =item SEE ALSO -=head2 CGI::Apache - Make things work with CGI.pm against Perl-Apache API +=back + +=head2 CGI::Apache - Backward compatibility module for CGI.pm + +=over =item SYNOPSIS +=item ABSTRACT + =item DESCRIPTION -=item NOTE 1 +=item AUTHOR INFORMATION -=item NOTE 2 +=item BUGS =item SEE ALSO -=item AUTHOR +=back =head2 CGI::Carp, B<CGI::Carp> - CGI routines for writing to the HTTPD (or other) error log +=over + =item SYNOPSIS =item DESCRIPTION @@ -4561,8 +5100,12 @@ other) error log =item SEE ALSO +=back + =head2 CGI::Cookie - Interface to Netscape Cookies +=over + =item SYNOPSIS =item DESCRIPTION @@ -4591,8 +5134,12 @@ B<name()>, B<value()>, B<domain()>, B<path()>, B<expires()> =item SEE ALSO +=back + =head2 CGI::Fast - CGI Interface for Fast CGI +=over + =item SYNOPSIS =item DESCRIPTION @@ -4613,8 +5160,12 @@ B<name()>, B<value()>, B<domain()>, B<path()>, B<expires()> =item SEE ALSO +=back + =head2 CGI::Pretty - module to produce nicely formatted HTML code +=over + =item SYNOPSIS =item DESCRIPTION @@ -4623,6 +5174,8 @@ B<name()>, B<value()>, B<domain()>, B<path()>, B<expires()> =item Tags that won't be formatted +=item Customizing the Indenting + =back =item BUGS @@ -4631,8 +5184,12 @@ B<name()>, B<value()>, B<domain()>, B<path()>, B<expires()> =item SEE ALSO +=back + =head2 CGI::Push - Simple Interface to Server Push +=over + =item SYNOPSIS =item DESCRIPTION @@ -4657,19 +5214,30 @@ B<name()>, B<value()>, B<domain()>, B<path()>, B<expires()> =item SEE ALSO -=head2 CGI::Switch - Try more than one constructors and return the first -object available +=back + +=head2 CGI::Switch - Backward compatibility module for defunct CGI::Switch + +=over =item SYNOPSIS +=item ABSTRACT + =item DESCRIPTION +=item AUTHOR INFORMATION + +=item BUGS + =item SEE ALSO -=item AUTHOR +=back =head2 CPAN - query, download and build perl modules from CPAN sites +=over + =item SYNOPSIS =item DESCRIPTION @@ -4741,23 +5309,35 @@ http firewall, ftp firewall, One way visibility, SOCKS, IP Masquerade =item SEE ALSO +=back + =head2 CPAN::FirstTime - Utility for CPAN::Config file Initialization +=over + =item SYNOPSIS =item DESCRIPTION +=back + =head2 CPANox, CPAN::Nox - Wrapper around CPAN.pm without using any XS module +=over + =item SYNOPSIS =item DESCRIPTION =item SEE ALSO +=back + =head2 Carp, carp - warn of errors (from perspective of caller) +=over + =item SYNOPSIS =item DESCRIPTION @@ -4770,14 +5350,22 @@ module =item BUGS +=back + =head2 Carp::Heavy - Carp guts +=over + =item SYNOPIS =item DESCRIPTION +=back + =head2 Class::Struct - declare struct-like datatypes as Perl classes +=over + =item SYNOPSIS =item DESCRIPTION @@ -4801,8 +5389,12 @@ Example 1, Example 2, Example 3 =item Author and Modification History +=back + =head2 Config - access Perl configuration information +=over + =item SYNOPSIS =item DESCRIPTION @@ -4823,8 +5415,9 @@ C<_a>, C<_exe>, C<_o> =item a -C<afs>, C<alignbytes>, C<ansi2knr>, C<aphostname>, C<apiversion>, C<ar>, -C<archlib>, C<archlibexp>, C<archname64>, C<archname>, C<archobjs>, C<awk> +C<afs>, C<alignbytes>, C<ansi2knr>, C<aphostname>, C<api_revision>, +C<api_subversion>, C<api_version>, C<api_versionstring>, C<ar>, C<archlib>, +C<archlibexp>, C<archname64>, C<archname>, C<archobjs>, C<awk> =item b @@ -4834,11 +5427,14 @@ C<byacc>, C<byteorder> =item c C<c>, C<castflags>, C<cat>, C<cc>, C<cccdlflags>, C<ccdlflags>, C<ccflags>, -C<ccsymbols>, C<cf_by>, C<cf_email>, C<cf_time>, C<chgrp>, C<chmod>, -C<chown>, C<clocktype>, C<comm>, C<compress>, C<contains>, C<cp>, C<cpio>, -C<cpp>, C<cpp_stuff>, C<cppccsymbols>, C<cppflags>, C<cpplast>, -C<cppminus>, C<cpprun>, C<cppstdin>, C<cppsymbols>, C<crosscompile>, -C<cryptlib>, C<csh> +C<ccsymbols>, C<cf_by>, C<cf_email>, C<cf_time>, C<charsize>, C<chgrp>, +C<chmod>, C<chown>, C<clocktype>, C<comm>, C<compress> + +=item C + +C<CONFIGDOTSH>, C<contains>, C<cp>, C<cpio>, C<cpp>, C<cpp_stuff>, +C<cppccsymbols>, C<cppflags>, C<cpplast>, C<cppminus>, C<cpprun>, +C<cppstdin>, C<cppsymbols>, C<crosscompile>, C<cryptlib>, C<csh> =item d @@ -4846,62 +5442,61 @@ 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_closedir>, 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_fs_data_s>, 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_gethname>, C<d_gethostprotos>, C<d_getlogin>, C<d_getmnt>, +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_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_index>, C<d_inetaton>, C<d_int64t>, C<d_isascii>, C<d_killpg>, +C<d_lchown>, C<d_ldbl_dig>, C<d_link>, C<d_locconv>, C<d_lockf>, +C<d_longdbl>, C<d_longlong>, C<d_lstat>, 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_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_setspent>, C<d_setvbuf>, C<d_sfio>, C<d_shm>, C<d_shmat>, +C<d_msg_proxy>, C<d_msgctl>, C<d_msgget>, C<d_msgrcv>, C<d_msgsnd>, +C<d_mymalloc>, C<d_nice>, C<d_nvpresuv>, 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_quad>, C<d_readdir>, +C<d_readlink>, 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_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_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_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_sigsetjmp>, C<d_socket>, C<d_sockpair>, C<d_sqrtl>, C<d_statblks>, +C<d_statfs_f_flags>, C<d_statfs_s>, 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_strchr>, C<d_strcoll>, C<d_strctcpy>, C<d_strerrm>, +C<d_strerror>, C<d_strtod>, C<d_strtol>, C<d_strtold>, C<d_strtoll>, +C<d_strtoul>, C<d_strtoull>, C<d_strtouq>, 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_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<d_umask>, C<d_uname>, C<d_union_semun>, C<d_ustat>, C<d_vendorbin>, +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_xenix>, C<date>, C<db_hashtype>, C<db_prefixtype>, C<defvoidused>, C<direntrytype>, C<dlext>, C<dlsrc>, C<doublesize>, C<drand01>, C<dynamic_ext> @@ -4913,12 +5508,12 @@ C<exe_ext>, C<expr>, C<extensions> =item f C<fflushall>, C<fflushNULL>, C<find>, C<firstmakefile>, C<flex>, -C<fpostype>, C<freetype>, C<full_ar>, C<full_csh>, C<full_sed> +C<fpossize>, C<fpostype>, C<freetype>, C<full_ar>, C<full_csh>, C<full_sed> =item g -C<gccversion>, C<gidtype>, C<glibpth>, C<grep>, C<groupcat>, C<groupstype>, -C<gzip> +C<gccversion>, C<gidformat>, C<gidsign>, C<gidsize>, C<gidtype>, +C<glibpth>, C<grep>, C<groupcat>, C<groupstype>, C<gzip> =item h @@ -4926,24 +5521,27 @@ C<h_fcntl>, C<h_sysfile>, C<hint>, C<hostcat>, C<huge> =item i -C<i_arpainet>, C<i_bsdioctl>, C<i_db>, C<i_dbm>, C<i_dirent>, C<i_dld>, -C<i_dlfcn>, C<i_fcntl>, C<i_float>, C<i_gdbm>, C<i_grp>, C<i_inttypes>, -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_shadow>, C<i_socks>, +C<i16size>, C<i16type>, C<i32size>, C<i32type>, C<i64size>, C<i64type>, +C<i8size>, C<i8type>, C<i_arpainet>, C<i_bsdioctl>, C<i_db>, C<i_dbm>, +C<i_dirent>, C<i_dld>, C<i_dlfcn>, C<i_fcntl>, C<i_float>, C<i_gdbm>, +C<i_grp>, C<i_inttypes>, 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_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_sysmount>, C<i_sysndir>, C<i_sysparam>, C<i_sysresrc>, C<i_syssecrt>, +C<i_sysselct>, C<i_syssockio>, C<i_sysstat>, C<i_sysstatfs>, 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<i_sysuio>, C<i_sysun>, C<i_sysvfs>, C<i_syswait>, C<i_termio>, +C<i_termios>, C<i_time>, C<i_unistd>, C<i_ustat>, C<i_utime>, C<i_values>, +C<i_varargs>, C<i_varhdr>, C<i_vfork>, C<ignore_versioned_solibs>, +C<inc_version_list>, C<inc_version_list_init>, 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> +C<installsitearch>, C<installsitebin>, C<installsitelib>, C<installstyle>, +C<installusrbinperl>, C<installvendorbin>, C<installvendorlib>, C<intsize>, +C<ivdformat>, C<ivsize>, C<ivtype> =item k @@ -4965,14 +5563,14 @@ C<man3direxp>, C<man3ext> =item M -C<Mcc>, C<medium>, C<mips_type>, C<mkdir>, C<mmaptype>, C<models>, -C<modetype>, C<more>, C<multiarch>, C<mv>, C<myarchname>, C<mydomain>, -C<myhostname>, C<myuname> +C<Mcc>, C<medium>, C<mips_type>, C<mkdir>, C<models>, C<modetype>, C<more>, +C<multiarch>, C<mv>, C<myarchname>, C<mydomain>, C<myhostname>, C<myuname> =item n C<n>, C<netdb_hlen_type>, C<netdb_host_type>, C<netdb_name_type>, -C<netdb_net_type>, C<nm>, C<nm_opt>, C<nm_so_opt>, C<nonxs_ext>, C<nroff> +C<netdb_net_type>, C<nm>, C<nm_opt>, C<nm_so_opt>, C<nonxs_ext>, C<nroff>, +C<nvsize>, C<nvtype> =item o @@ -4981,10 +5579,18 @@ C<orderlib>, C<osname>, C<osvers> =item p -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<pm_apiversion>, C<pmake>, C<pr>, C<prefix>, C<prefixexp>, C<privlib>, -C<privlibexp>, C<prototype>, C<ptrsize> +C<package>, C<pager>, C<passcat>, C<patchlevel>, C<path_sep>, C<perl> + +=item P + +C<PERL_REVISION>, C<PERL_SUBVERSION>, C<PERL_VERSION>, 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> + +=item q + +C<quadkind>, C<quadtype> =item r @@ -4997,13 +5603,14 @@ C<sched_yield>, C<scriptdir>, C<scriptdirexp>, C<sed>, C<seedfunc>, 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<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<sitearch>, C<sitearchexp>, C<sitebin>, C<sitebinexp>, 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> @@ -5014,20 +5621,23 @@ C<touch>, C<tr>, C<trnl>, C<troff> =item u -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<usesocks>, C<usethreads>, C<usevendorprefix>, -C<usevfork>, C<usrinc>, C<uuname> +C<u16size>, C<u16type>, C<u32size>, C<u32type>, C<u64size>, C<u64type>, +C<u8size>, C<u8type>, C<uidformat>, C<uidsign>, C<uidsize>, C<uidtype>, +C<uname>, C<uniq>, C<uquadtype>, C<use5005threads>, C<use64bits>, C<usedl>, +C<useithreads>, C<uselargefiles>, C<uselongdouble>, C<uselonglong>, +C<usemorebits>, C<usemultiplicity>, C<usemymalloc>, C<usenm>, C<useopcode>, +C<useperlio>, C<useposix>, C<usesfio>, C<useshrplib>, C<usesocks>, +C<usethreads>, C<usevendorprefix>, C<usevfork>, C<usrinc>, C<uuname>, +C<uvoformat>, C<uvsize>, C<uvtype>, C<uvuformat>, C<uvxformat> =item v -C<vendorlib>, C<vendorlibexp>, C<vendorprefix>, C<vendorprefixexp>, -C<version>, C<vi>, C<voidflags> +C<vendorbin>, C<vendorbinexp>, C<vendorlib>, C<vendorlibexp>, +C<vendorprefix>, C<vendorprefixexp>, C<version>, C<vi>, C<voidflags> =item x -C<xlibpth>, C<xs_apiversion> +C<xlibpth> =item z @@ -5037,16 +5647,24 @@ C<zcat>, C<zip> =item NOTE +=back + =head2 Cwd, getcwd - get pathname of current working directory +=over + =item SYNOPSIS =item DESCRIPTION +=back + =head2 DB - programmatic interface to the Perl debugging API (draft, subject to change) +=over + =item SYNOPSIS =item DESCRIPTION @@ -5076,8 +5694,12 @@ CLIENT->output(LIST) =item AUTHOR +=back + =head2 DB_File - Perl5 access to Berkeley DB version 1.x +=over + =item SYNOPSIS =item DESCRIPTION @@ -5167,7 +5789,11 @@ B<filter_fetch_value> =over -=item Locking Databases +=item Locking: The Trouble with fd + +=item Safe ways to lock a database + +B<Tie::DB_Lock>, B<Tie::DB_LockFile>, B<DB_File::Lock> =item Sharing Databases With C Applications @@ -5203,9 +5829,13 @@ B<filter_fetch_value> =item AUTHOR +=back + =head2 Data::Dumper - stringified perl data structures, suitable for both printing and C<eval> +=over + =item SYNOPSIS =item DESCRIPTION @@ -5255,8 +5885,12 @@ Dumper =item SEE ALSO +=back + =head2 Devel::DProf - a Perl code profiler +=over + =item SYNOPSIS =item DESCRIPTION @@ -5271,8 +5905,12 @@ Dumper =item SEE ALSO +=back + =head2 Devel::Peek - A data debugging tool for the XS programmer +=over + =item SYNOPSIS =item DESCRIPTION @@ -5309,20 +5947,32 @@ Dumper =item SEE ALSO +=back + =head2 Devel::SelfStubber - generate stubs for a SelfLoading module +=over + =item SYNOPSIS =item DESCRIPTION +=back + =head2 DirHandle - supply object methods for directory handles +=over + =item SYNOPSIS =item DESCRIPTION +=back + =head2 Dumpvalue - provides screen dump of Perl data. +=over + =item SYNOPSIS =item DESCRIPTION @@ -5343,8 +5993,12 @@ veryCompact, set, get =back +=back + =head2 DynaLoader - Dynamically load C libraries into Perl code +=over + =item SYNOPSIS =item DESCRIPTION @@ -5357,23 +6011,48 @@ bootstrap() =item AUTHOR +=back + +=head2 DynaLoader::XSLoader, XSLoader - Dynamically load C libraries into +Perl code + +=over + +=item SYNOPSIS + +=item DESCRIPTION + +=item AUTHOR + +=back + =head2 English - use nice English (or awk) names for ugly punctuation variables +=over + =item SYNOPSIS =item DESCRIPTION +=back + =head2 Env - perl module that imports environment variables +=over + =item SYNOPSIS =item DESCRIPTION =item AUTHOR +=back + =head2 Errno - System errno constants +=over + =item SYNOPSIS =item DESCRIPTION @@ -5382,8 +6061,12 @@ variables =item COPYRIGHT +=back + =head2 Exporter - Implements default import method for modules +=over + =item SYNOPSIS =item DESCRIPTION @@ -5406,22 +6089,50 @@ variables =back +=back + =head2 Exporter::Heavy - Exporter guts +=over + =item SYNOPIS =item DESCRIPTION +=back + =head2 ExtUtils::Command - utilities to replace common UNIX commands in Makefiles etc. +=over + =item SYNOPSIS =item DESCRIPTION -cat, eqtime src dst, rm_f files..., rm_f files..., touch files .., mv -source... destination, cp source... destination, chmod mode files.., mkpath -directory.., test_f file +=back + +cat + +eqtime src dst + +rm_f files... + +rm_f files... + +touch files .. + +mv source... destination + +cp source... destination + +chmod mode files.. + +mkpath directory.. + +test_f file + +=over =item BUGS @@ -5429,8 +6140,12 @@ directory.., test_f file =item AUTHOR +=back + =head2 ExtUtils::Embed - Utilities for embedding Perl in C/C++ applications +=over + =item SYNOPSIS =item DESCRIPTION @@ -5448,14 +6163,22 @@ ccopts(), xsi_header(), xsi_protos(@modules), xsi_body(@modules) =item AUTHOR +=back + =head2 ExtUtils::Install - install files from here to there +=over + =item SYNOPSIS =item DESCRIPTION +=back + =head2 ExtUtils::Installed - Inventory management of installed modules +=over + =item SYNOPSIS =item DESCRIPTION @@ -5471,8 +6194,12 @@ packlist(), version() =item AUTHOR +=back + =head2 ExtUtils::Liblist - determine libraries to use and how to use them +=over + =item SYNOPSIS =item DESCRIPTION @@ -5501,24 +6228,36 @@ For static extensions, For dynamic extensions, For dynamic extensions =item SEE ALSO +=back + =head2 ExtUtils::MM_Cygwin - methods to override UN*X behaviour in ExtUtils::MakeMaker +=over + =item SYNOPSIS =item DESCRIPTION canonpath, cflags, manifypods, perl_archive +=back + =head2 ExtUtils::MM_OS2 - methods to override UN*X behaviour in ExtUtils::MakeMaker +=over + =item SYNOPSIS =item DESCRIPTION +=back + =head2 ExtUtils::MM_Unix - methods used by ExtUtils::MakeMaker +=over + =item SYNOPSIS =item DESCRIPTION @@ -5529,37 +6268,203 @@ ExtUtils::MakeMaker =item Preloaded methods -canonpath, catdir, catfile, curdir, rootdir, updir +canonpath + +=back + +=back + +catdir + +catfile + +curdir + +rootdir + +updir + +=over =item SelfLoaded methods -c_o (o), cflags (o), clean (o), const_cccmd (o), const_config (o), -const_loadlibs (o), constants (o), depend (o), dir_target (o), dist (o), -dist_basics (o), dist_ci (o), dist_core (o), dist_dir (o), dist_test (o), -dlsyms (o), dynamic (o), dynamic_bs (o), dynamic_lib (o), exescan, -extliblist, file_name_is_absolute, find_perl +c_o (o) + +=back + +cflags (o) + +clean (o) + +const_cccmd (o) + +const_config (o) + +const_loadlibs (o) + +constants (o) + +depend (o) + +dir_target (o) + +dist (o) + +dist_basics (o) + +dist_ci (o) + +dist_core (o) + +dist_dir (o) + +dist_test (o) + +dlsyms (o) + +dynamic (o) + +dynamic_bs (o) + +dynamic_lib (o) + +exescan + +extliblist + +file_name_is_absolute + +find_perl + +=over =item Methods to actually produce chunks of text for the Makefile -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 +fixin =back +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 + +=over + =item SEE ALSO +=back + =head2 ExtUtils::MM_VMS - methods to override UN*X behaviour in ExtUtils::MakeMaker +=over + =item SYNOPSIS =item DESCRIPTION @@ -5568,42 +6473,159 @@ ExtUtils::MakeMaker =item Methods always loaded -wraplist, rootdir (override) +wraplist + +=back + +=back + +rootdir (override) + +=over =item SelfLoaded methods -guess_name (override), find_perl (override), path (override), maybe_command -(override), maybe_command_in_dirs (override), perl_script (override), -file_name_is_absolute (override), replace_manpage_separator, init_others -(override), constants (override), cflags (override), const_cccmd -(override), pm_to_blib (override), tool_autosplit (override), tool_sxubpp -(override), xsubpp_version (override), tools_other (override), dist -(override), c_o (override), xs_c (override), xs_o (override), top_targets -(override), dlsyms (override), dynamic_lib (override), dynamic_bs -(override), static_lib (override), manifypods (override), processPL -(override), installbin (override), subdir_x (override), clean (override), -realclean (override), dist_basics (override), dist_core (override), -dist_dir (override), dist_test (override), install (override), perldepend -(override), makefile (override), test (override), test_via_harness -(override), test_via_script (override), makeaperl (override), nicetext -(override) +guess_name (override) =back +find_perl (override) + +path (override) + +maybe_command (override) + +maybe_command_in_dirs (override) + +perl_script (override) + +file_name_is_absolute (override) + +replace_manpage_separator + +init_others (override) + +constants (override) + +cflags (override) + +const_cccmd (override) + +pm_to_blib (override) + +tool_autosplit (override) + +tool_sxubpp (override) + +xsubpp_version (override) + +tools_other (override) + +dist (override) + +c_o (override) + +xs_c (override) + +xs_o (override) + +top_targets (override) + +dlsyms (override) + +dynamic_lib (override) + +dynamic_bs (override) + +static_lib (override) + +manifypods (override) + +processPL (override) + +installbin (override) + +subdir_x (override) + +clean (override) + +realclean (override) + +dist_basics (override) + +dist_core (override) + +dist_dir (override) + +dist_test (override) + +install (override) + +perldepend (override) + +makefile (override) + +test (override) + +test_via_harness (override) + +test_via_script (override) + +makeaperl (override) + +nicetext (override) + =head2 ExtUtils::MM_Win32 - methods to override UN*X behaviour in ExtUtils::MakeMaker +=over + =item SYNOPSIS =item DESCRIPTION -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), htmlifypods (o), -manifypods (o), dist_ci (o), dist_core (o), pasthru (o) +=back + +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) + +htmlifypods (o) + +manifypods (o) + +dist_ci (o) + +dist_core (o) + +pasthru (o) =head2 ExtUtils::MakeMaker - create an extension Makefile +=over + =item SYNOPSIS =item DESCRIPTION @@ -5675,8 +6697,12 @@ PERL_MM_OPT =item AUTHORS +=back + =head2 ExtUtils::Manifest - utilities to write and check a MANIFEST file +=over + =item SYNOPSIS =item DESCRIPTION @@ -5696,23 +6722,35 @@ C<Added to MANIFEST:> I<file> =item AUTHOR +=back + =head2 ExtUtils::Miniperl, writemain - write the C code for perlmain.c +=over + =item SYNOPSIS =item DESCRIPTION =item SEE ALSO +=back + =head2 ExtUtils::Mkbootstrap - make a bootstrap file for use by DynaLoader +=over + =item SYNOPSIS =item DESCRIPTION +=back + =head2 ExtUtils::Mksymlists - write linker options files for dynamic extension +=over + =item SYNOPSIS =item DESCRIPTION @@ -5723,8 +6761,12 @@ DLBASE, DL_FUNCS, DL_VARS, FILE, FUNCLIST, IMPORTS, NAME =item REVISION +=back + =head2 ExtUtils::Packlist - manage .packlist files +=over + =item SYNOPSIS =item DESCRIPTION @@ -5739,22 +6781,34 @@ new(), read(), write(), validate(), packlist_file() =item AUTHOR +=back + =head2 ExtUtils::testlib - add blib/* directories to @INC +=over + =item SYNOPSIS =item DESCRIPTION +=back + =head2 Fatal - replace functions with equivalents which succeed or die +=over + =item SYNOPSIS =item DESCRIPTION =item AUTHOR +=back + =head2 Fcntl - load the C Fcntl.h defines +=over + =item SYNOPSIS =item DESCRIPTION @@ -5763,8 +6817,12 @@ new(), read(), write(), validate(), packlist_file() =item EXPORTED SYMBOLS +=back + =head2 File::Basename, fileparse - split a pathname into pieces +=over + =item SYNOPSIS =item DESCRIPTION @@ -5775,14 +6833,22 @@ fileparse_set_fstype, fileparse C<basename>, C<dirname> +=back + =head2 File::CheckTree, validate - run many filetest checks on a tree +=over + =item SYNOPSIS =item DESCRIPTION +=back + =head2 File::Compare - Compare files or filehandles +=over + =item SYNOPSIS =item DESCRIPTION @@ -5791,8 +6857,12 @@ C<basename>, C<dirname> =item AUTHOR +=back + =head2 File::Copy - Copy files or filehandles +=over + =item SYNOPSIS =item DESCRIPTION @@ -5809,8 +6879,12 @@ rmscopy($from,$to[,$date_flag]) =item AUTHOR +=back + =head2 File::DosGlob - DOS like globbing and then some +=over + =item SYNOPSIS =item DESCRIPTION @@ -5825,15 +6899,47 @@ rmscopy($from,$to[,$date_flag]) =item SEE ALSO +=back + =head2 File::Find, find - traverse a file tree +=over + =item SYNOPSIS =item DESCRIPTION -=item BUGS +C<wanted>, C<bydepth>, C<follow>, C<follow_fast>, C<follow_skip>, +C<no_chdir>, C<untaint>, C<untaint_pattern>, C<untaint_skip> + +=item CAVEAT + +=back + +=head2 File::Glob - Perl extension for BSD glob routine + +=over + +=item SYNOPSIS + +=item DESCRIPTION + +C<GLOB_ERR>, C<GLOB_MARK>, C<GLOB_NOCASE>, C<GLOB_NOCHECK>, C<GLOB_NOSORT>, +C<GLOB_BRACE>, C<GLOB_NOMAGIC>, C<GLOB_QUOTE>, C<GLOB_TILDE>, C<GLOB_CSH> + +=item DIAGNOSTICS + +C<GLOB_NOSPACE>, C<GLOB_ABEND> + +=item NOTES + +=item AUTHOR + +=back + +=head2 File::Path - create or remove directory trees -=head2 File::Path - create or remove a series of directories +=over =item SYNOPSIS @@ -5841,8 +6947,12 @@ rmscopy($from,$to[,$date_flag]) =item AUTHORS +=back + =head2 File::Spec - portably perform operations on file names +=over + =item SYNOPSIS =item DESCRIPTION @@ -5851,8 +6961,12 @@ rmscopy($from,$to[,$date_flag]) =item AUTHORS +=back + =head2 File::Spec::Functions - portably perform operations on file names +=over + =item SYNOPSIS =item DESCRIPTION @@ -5865,72 +6979,190 @@ rmscopy($from,$to[,$date_flag]) =item SEE ALSO +=back + =head2 File::Spec::Mac - File::Spec for MacOS +=over + =item SYNOPSIS =item DESCRIPTION =item METHODS -canonpath, catdir, catfile, curdir, devnull, rootdir, tmpdir, updir, -file_name_is_absolute, path +canonpath + +=back + +catdir + +catfile + +curdir + +devnull + +rootdir + +tmpdir + +updir + +file_name_is_absolute + +path + +=over =item SEE ALSO +=back + =head2 File::Spec::OS2 - methods for OS/2 file specs +=over + =item SYNOPSIS =item DESCRIPTION +=back + =head2 File::Spec::Unix - methods used by File::Spec +=over + =item SYNOPSIS =item DESCRIPTION =item METHODS -canonpath, catdir, catfile, curdir, devnull, rootdir, tmpdir, updir, -no_upwards, file_name_is_absolute, path, join, splitpath, splitdir, -catpath, abs2rel, rel2abs +canonpath + +=back + +catdir + +catfile + +curdir + +devnull + +rootdir + +tmpdir + +updir + +no_upwards + +file_name_is_absolute + +path + +join + +splitpath + +splitdir + +catpath + +abs2rel + +rel2abs + +=over =item SEE ALSO +=back + =head2 File::Spec::VMS - methods for VMS file specs +=over + =item SYNOPSIS =item DESCRIPTION -eliminate_macros, fixpath +eliminate_macros + +=back + +fixpath =over =item Methods always loaded -catdir, catfile, curdir (override), devnull (override), rootdir (override), -tmpdir (override), updir (override), path (override), file_name_is_absolute -(override) +catdir =back +catfile + +curdir (override) + +devnull (override) + +rootdir (override) + +tmpdir (override) + +updir (override) + +path (override) + +file_name_is_absolute (override) + +=over + =item SEE ALSO +=back + =head2 File::Spec::Win32 - methods for Win32 file specs +=over + =item SYNOPSIS =item DESCRIPTION -devnull, tmpdir, catfile, canonpath, splitpath, splitdir, catpath, abs2rel, +devnull + +=back + +tmpdir + +catfile + +canonpath + +splitpath + +splitdir + +catpath + +abs2rel + rel2abs +=over + =item SEE ALSO +=back + =head2 File::stat - by-name interface to Perl's built-in stat() functions +=over + =item SYNOPSIS =item DESCRIPTION @@ -5939,16 +7171,24 @@ rel2abs =item AUTHOR +=back + =head2 FileCache - keep more files open than the system permits +=over + =item SYNOPSIS =item DESCRIPTION =item BUGS +=back + =head2 FileHandle - supply object methods for filehandles +=over + =item SYNOPSIS =item DESCRIPTION @@ -5957,8 +7197,12 @@ $fh->print, $fh->printf, $fh->getline, $fh->getlines =item SEE ALSO +=back + =head2 FindBin - Locate directory of original perl script +=over + =item SYNOPSIS =item DESCRIPTION @@ -5971,8 +7215,12 @@ $fh->print, $fh->printf, $fh->getline, $fh->getlines =item COPYRIGHT +=back + =head2 GDBM_File - Perl5 access to the gdbm library. +=over + =item SYNOPSIS =item DESCRIPTION @@ -5983,9 +7231,13 @@ $fh->print, $fh->printf, $fh->getline, $fh->getlines =item SEE ALSO +=back + =head2 Getopt::Long, GetOptions - extended processing of command line options +=over + =item SYNOPSIS =item DESCRIPTION @@ -6025,28 +7277,44 @@ $Getopt::Long::VERSION, $Getopt::Long::error =item COPYRIGHT AND DISCLAIMER +=back + =head2 Getopt::Std, getopt - Process single-character switches with switch clustering +=over + =item SYNOPSIS =item DESCRIPTION +=back + =head2 I18N::Collate - compare 8-bit scalar data according to the current locale +=over + =item SYNOPSIS =item DESCRIPTION +=back + =head2 IO - load various IO modules +=over + =item SYNOPSIS =item DESCRIPTION +=back + =head2 IO::Dir - supply object methods for directory handles +=over + =item SYNOPSIS =item DESCRIPTION @@ -6060,8 +7328,12 @@ rewind (), close (), tie %hash, IO::Dir, DIRNAME [, OPTIONS ] =item COPYRIGHT +=back + =head2 IO::File - supply object methods for filehandles +=over + =item SYNOPSIS =item DESCRIPTION @@ -6078,8 +7350,12 @@ open( FILENAME [,MODE [,PERMS]] ) =item HISTORY +=back + =head2 IO::Handle - supply object methods for I/O handles +=over + =item SYNOPSIS =item DESCRIPTION @@ -6103,8 +7379,12 @@ $io->blocking ( [ BOOL ] ), $io->untaint =item HISTORY +=back + =head2 IO::Pipe - supply object methods for pipes +=over + =item SYNOPSIS =item DESCRIPTION @@ -6123,8 +7403,12 @@ reader ([ARGS]), writer ([ARGS]), handles () =item COPYRIGHT +=back + =head2 IO::Poll - Object interface to system poll call +=over + =item SYNOPSIS =item DESCRIPTION @@ -6140,8 +7424,12 @@ IO ), handles( [ EVENT_MASK ] ) =item COPYRIGHT +=back + =head2 IO::Seekable - supply seek based methods for I/O objects +=over + =item SYNOPSIS =item DESCRIPTION @@ -6150,8 +7438,12 @@ IO ), handles( [ EVENT_MASK ] ) =item HISTORY +=back + =head2 IO::Select - OO interface to the select system call +=over + =item SYNOPSIS =item DESCRIPTION @@ -6172,8 +7464,12 @@ count (), bits(), select ( READ, WRITE, ERROR [, TIMEOUT ] ) =item COPYRIGHT +=back + =head2 IO::Socket - Object interface to socket communications +=over + =item SYNOPSIS =item DESCRIPTION @@ -6193,8 +7489,12 @@ sockopt(OPT [, VAL]), sockdomain, socktype, protocol, connected =item COPYRIGHT +=back + =head2 IO::Socket::INET - Object interface for AF_INET domain sockets +=over + =item SYNOPSIS =item DESCRIPTION @@ -6218,8 +7518,12 @@ sockaddr (), sockport (), sockhost (), peeraddr (), peerport (), peerhost =item COPYRIGHT +=back + =head2 IO::Socket::UNIX - Object interface for AF_UNIX domain sockets +=over + =item SYNOPSIS =item DESCRIPTION @@ -6238,9 +7542,13 @@ hostpath(), peerpath() =item COPYRIGHT +=back + =head2 IO::lib::IO::Dir, IO::Dir - supply object methods for directory handles +=over + =item SYNOPSIS =item DESCRIPTION @@ -6254,8 +7562,12 @@ rewind (), close (), tie %hash, IO::Dir, DIRNAME [, OPTIONS ] =item COPYRIGHT +=back + =head2 IO::lib::IO::File, IO::File - supply object methods for filehandles +=over + =item SYNOPSIS =item DESCRIPTION @@ -6272,9 +7584,13 @@ open( FILENAME [,MODE [,PERMS]] ) =item HISTORY +=back + =head2 IO::lib::IO::Handle, IO::Handle - supply object methods for I/O handles +=over + =item SYNOPSIS =item DESCRIPTION @@ -6298,8 +7614,12 @@ $io->blocking ( [ BOOL ] ), $io->untaint =item HISTORY +=back + =head2 IO::lib::IO::Pipe, IO::Pipe - supply object methods for pipes +=over + =item SYNOPSIS =item DESCRIPTION @@ -6318,8 +7638,12 @@ reader ([ARGS]), writer ([ARGS]), handles () =item COPYRIGHT +=back + =head2 IO::lib::IO::Poll, IO::Poll - Object interface to system poll call +=over + =item SYNOPSIS =item DESCRIPTION @@ -6335,9 +7659,13 @@ IO ), handles( [ EVENT_MASK ] ) =item COPYRIGHT +=back + =head2 IO::lib::IO::Seekable, IO::Seekable - supply seek based methods for I/O objects +=over + =item SYNOPSIS =item DESCRIPTION @@ -6346,9 +7674,13 @@ I/O objects =item HISTORY +=back + =head2 IO::lib::IO::Select, IO::Select - OO interface to the select system call +=over + =item SYNOPSIS =item DESCRIPTION @@ -6369,9 +7701,13 @@ count (), bits(), select ( READ, WRITE, ERROR [, TIMEOUT ] ) =item COPYRIGHT +=back + =head2 IO::lib::IO::Socket, IO::Socket - Object interface to socket communications +=over + =item SYNOPSIS =item DESCRIPTION @@ -6391,9 +7727,13 @@ sockopt(OPT [, VAL]), sockdomain, socktype, protocol, connected =item COPYRIGHT +=back + =head2 IO::lib::IO::Socket::INET, IO::Socket::INET - Object interface for AF_INET domain sockets +=over + =item SYNOPSIS =item DESCRIPTION @@ -6417,9 +7757,13 @@ sockaddr (), sockport (), sockhost (), peeraddr (), peerport (), peerhost =item COPYRIGHT +=back + =head2 IO::lib::IO::Socket::UNIX, IO::Socket::UNIX - Object interface for AF_UNIX domain sockets +=over + =item SYNOPSIS =item DESCRIPTION @@ -6438,8 +7782,12 @@ hostpath(), peerpath() =item COPYRIGHT +=back + =head2 IPC::Msg - SysV Msg IPC object class +=over + =item SYNOPSIS =item DESCRIPTION @@ -6456,8 +7804,12 @@ FLAGS ] ), stat =item COPYRIGHT +=back + =head2 IPC::Open2, open2 - open a process for both reading and writing +=over + =item SYNOPSIS =item DESCRIPTION @@ -6466,17 +7818,25 @@ FLAGS ] ), stat =item SEE ALSO +=back + =head2 IPC::Open3, open3 - open a process for reading, writing, and error handling +=over + =item SYNOPSIS =item DESCRIPTION =item WARNING +=back + =head2 IPC::Semaphore - SysV Semaphore IPC object class +=over + =item SYNOPSIS =item DESCRIPTION @@ -6494,8 +7854,12 @@ set ( NAME => VALUE [, NAME => VALUE ...] ), setall ( VALUES ), setval ( N =item COPYRIGHT +=back + =head2 IPC::SysV - SysV IPC constants +=over + =item SYNOPSIS =item DESCRIPTION @@ -6508,8 +7872,12 @@ ftok( PATH, ID ) =item COPYRIGHT +=back + =head2 IPC::SysV::Msg, IPC::Msg - SysV Msg IPC object class +=over + =item SYNOPSIS =item DESCRIPTION @@ -6526,9 +7894,13 @@ FLAGS ] ), stat =item COPYRIGHT +=back + =head2 IPC::SysV::Semaphore, IPC::Semaphore - SysV Semaphore IPC object class +=over + =item SYNOPSIS =item DESCRIPTION @@ -6546,8 +7918,12 @@ set ( NAME => VALUE [, NAME => VALUE ...] ), setall ( VALUES ), setval ( N =item COPYRIGHT +=back + =head2 Math::BigFloat - Arbitrary length float math package +=over + =item SYNOPSIS =item DESCRIPTION @@ -6559,8 +7935,12 @@ performed =item AUTHOR +=back + =head2 Math::BigInt - Arbitrary size integer math package +=over + =item SYNOPSIS =item DESCRIPTION @@ -6575,9 +7955,13 @@ Canonical notation, Input, Output =item AUTHOR +=back + =head2 Math::Complex - complex numbers and associated mathematical functions +=over + =item SYNOPSIS =item DESCRIPTION @@ -6598,8 +7982,12 @@ functions =item AUTHORS +=back + =head2 Math::Trig - trigonometric functions +=over + =item SYNOPSIS =item DESCRIPTION @@ -6639,14 +8027,22 @@ cylindrical_to_spherical, spherical_to_cartesian, spherical_to_cylindrical =item AUTHORS +=back + =head2 NDBM_File - Tied access to ndbm files +=over + =item SYNOPSIS =item DESCRIPTION +=back + =head2 Net::Ping - check a remote host for reachability +=over + =item SYNOPSIS =item DESCRIPTION @@ -6664,9 +8060,13 @@ $timeout]);, $p->close();, pingecho($host [, $timeout]); =item NOTES +=back + =head2 Net::hostent - by-name interface to Perl's built-in gethost*() functions +=over + =item SYNOPSIS =item DESCRIPTION @@ -6677,9 +8077,13 @@ functions =item AUTHOR +=back + =head2 Net::netent - by-name interface to Perl's built-in getnet*() functions +=over + =item SYNOPSIS =item DESCRIPTION @@ -6690,9 +8094,13 @@ functions =item AUTHOR +=back + =head2 Net::protoent - by-name interface to Perl's built-in getproto*() functions +=over + =item SYNOPSIS =item DESCRIPTION @@ -6701,9 +8109,13 @@ functions =item AUTHOR +=back + =head2 Net::servent - by-name interface to Perl's built-in getserv*() functions +=over + =item SYNOPSIS =item DESCRIPTION @@ -6714,8 +8126,12 @@ functions =item AUTHOR +=back + =head2 O - Generic interface to Perl Compiler backends +=over + =item SYNOPSIS =item DESCRIPTION @@ -6726,14 +8142,22 @@ functions =item AUTHOR +=back + =head2 ODBM_File - Tied access to odbm files +=over + =item SYNOPSIS =item DESCRIPTION +=back + =head2 Opcode - Disable named opcodes when compiling perl code +=over + =item SYNOPSIS =item DESCRIPTION @@ -6758,6 +8182,10 @@ opdump (PAT) =item TO DO (maybe) +=back + +=over + =item Predefined Opcode Tags :base_core, :base_mem, :base_loop, :base_io, :base_orig, :base_math, @@ -6769,9 +8197,13 @@ opdump (PAT) =item AUTHORS +=back + =head2 Opcode::Safe, Safe - Compile and execute code in restricted compartments +=over + =item SYNOPSIS =item DESCRIPTION @@ -6799,17 +8231,25 @@ Memory, CPU, Snooping, Signals, State Changes =back +=back + =head2 Opcode::ops, ops - Perl pragma to restrict unsafe operations when compiling +=over + =item SYNOPSIS =item DESCRIPTION =item SEE ALSO +=back + =head2 POSIX - Perl interface to IEEE Std 1003.1 +=over + =item SYNOPSIS =item DESCRIPTION @@ -6935,20 +8375,64 @@ Constants, Macros =item CREATION +=back + =head2 Pod::Checker, podchecker() - check pod documents for syntax errors +=over + =item SYNOPSIS =item OPTIONS/ARGUMENTS +=over + +=item Options + +B<-warnings> =E<gt> I<val> + +=back + =item DESCRIPTION +=over + +=item Warnings + +=back + +=item DIAGNOSTICS + +=item RETURN VALUE + =item EXAMPLES =item AUTHOR +=back + +=head2 Pod::Checker, Pod::Hyperlink - class for manipulation of POD +hyperlinks + +=over + +=item SYNOPSIS + +=item DESCRIPTION + +=item METHODS + +new(), parse(), markup($on,$off,$pageon,$pageoff), text(), warning(), +page(), node(), type(), alttext(), line(), file() + +=item AUTHOR + +=back + =head2 Pod::Html - module to convert pod files to HTML +=over + =item SYNOPSIS =item DESCRIPTION @@ -6965,15 +8449,17 @@ verbose, quiet =item AUTHOR -=item BUGS - =item SEE ALSO =item COPYRIGHT +=back + =head2 Pod::InputObjects - objects representing POD input paragraphs, commands, etc. +=over + =item SYNOPSIS =item REQUIRES @@ -6985,96 +8471,224 @@ commands, etc. B<Pod::InputSource>, B<Pod::Paragraph>, B<Pod::InteriorSequence>, B<Pod::ParseTree> +=back + +=over + =item B<Pod::InputSource> +=back + =over =item B<new()> +=back + +=over + =item B<name()> +=back + +=over + =item B<handle()> +=back + +=over + =item B<was_cutting()> =back +=over + =item B<Pod::Paragraph> +=back + =over =item B<new()> +=back + +=over + =item B<cmd_name()> +=back + +=over + =item B<text()> +=back + +=over + =item B<raw_text()> +=back + +=over + =item B<cmd_prefix()> +=back + +=over + =item B<cmd_separator()> +=back + +=over + =item B<parse_tree()> +=back + +=over + =item B<file_line()> =back +=over + =item B<Pod::InteriorSequence> +=back + =over =item B<new()> +=back + +=over + =item B<cmd_name()> +=back + +=over + =item B<prepend()> +=back + +=over + =item B<append()> +=back + +=over + =item B<nested()> +=back + +=over + =item B<raw_text()> +=back + +=over + =item B<left_delimiter()> +=back + +=over + =item B<right_delimiter()> +=back + +=over + =item B<parse_tree()> +=back + +=over + =item B<file_line()> +=back + +=over + =item B<DESTROY()> =back +=over + =item B<Pod::ParseTree> +=back + =over =item B<new()> +=back + +=over + =item B<top()> +=back + +=over + =item B<children()> +=back + +=over + =item B<prepend()> +=back + +=over + =item B<append()> +=back + +=over + =item B<raw_text()> +=back + +=over + =item B<DESTROY()> =back +=over + =item SEE ALSO =item AUTHOR +=back + =head2 Pod::Man - Convert POD data to formatted *roff input +=over + =item SYNOPSIS =item DESCRIPTION @@ -7095,8 +8709,12 @@ EE<lt>%sE<gt>, Unknown sequence %s, Unmatched =back =item AUTHOR +=back + =head2 Pod::Parser - base class for creating POD filters and translators +=over + =item SYNOPSIS =item REQUIRES @@ -7111,91 +8729,231 @@ EE<lt>%sE<gt>, Unknown sequence %s, Unmatched =back B<-want_nonPODs> (default: unset), B<-process_cut_cmd> (default: unset) +=back + +=over + =item RECOMMENDED SUBROUTINE/METHOD OVERRIDES +=back + +=over + =item B<command()> C<$cmd>, C<$text>, C<$line_num>, C<$pod_para> +=back + +=over + =item B<verbatim()> C<$text>, C<$line_num>, C<$pod_para> +=back + +=over + =item B<textblock()> C<$text>, C<$line_num>, C<$pod_para> +=back + +=over + =item B<interior_sequence()> +=back + +=over + =item OPTIONAL SUBROUTINE/METHOD OVERRIDES +=back + +=over + =item B<new()> +=back + +=over + =item B<initialize()> +=back + +=over + =item B<begin_pod()> +=back + +=over + =item B<begin_input()> +=back + +=over + =item B<end_input()> +=back + +=over + =item B<end_pod()> +=back + +=over + =item B<preprocess_line()> +=back + +=over + =item B<preprocess_paragraph()> +=back + +=over + =item METHODS FOR PARSING AND PROCESSING +=back + +=over + =item B<parse_text()> 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> +=back + +=over + =item B<interpolate()> +=back + +=over + =item B<parse_paragraph()> +=back + +=over + =item B<parse_from_filehandle()> +=back + +=over + =item B<parse_from_file()> +=back + +=over + =item ACCESSOR METHODS +=back + +=over + =item B<errorsub()> +=back + +=over + =item B<cutting()> +=back + +=over + =item B<parseopts()> +=back + +=over + =item B<output_file()> +=back + +=over + =item B<output_handle()> +=back + +=over + =item B<input_file()> +=back + +=over + =item B<input_handle()> +=back + +=over + =item B<input_streams()> +=back + +=over + =item B<top_stream()> +=back + +=over + =item PRIVATE METHODS AND DATA +=back + +=over + =item B<_push_input_stream()> +=back + +=over + =item B<_pop_input_stream()> +=back + +=over + =item TREE-BASED PARSING =item SEE ALSO =item AUTHOR +=back + =head2 Pod::Select, podselect() - extract selected sections of POD from input +=over + =item SYNOPSIS =item REQUIRES @@ -7208,44 +8966,100 @@ input =item RANGE SPECIFICATIONS +=back + +=over + =item OBJECT METHODS +=back + +=over + =item B<curr_headings()> +=back + +=over + =item B<select()> +=back + +=over + =item B<add_selection()> +=back + +=over + =item B<clear_selections()> +=back + +=over + =item B<match_section()> +=back + +=over + =item B<is_selected()> +=back + +=over + =item EXPORTED FUNCTIONS +=back + +=over + =item B<podselect()> B<-output>, B<-sections>, B<-ranges> +=back + +=over + =item PRIVATE METHODS AND DATA +=back + +=over + =item B<_compile_section_spec()> +=back + =over =item $self->{_SECTION_HEADINGS} +=back + +=over + =item $self->{_SELECTED_SECTIONS} =back +=over + =item SEE ALSO =item AUTHOR +=back + =head2 Pod::Text - Convert POD data to formatted ASCII text +=over + =item SYNOPSIS =item DESCRIPTION @@ -7265,8 +9079,12 @@ Unknown sequence: %s, Unmatched =back =item AUTHOR +=back + =head2 Pod::Text::Color - Convert POD data to formatted color ASCII text +=over + =item SYNOPSIS =item DESCRIPTION @@ -7277,9 +9095,13 @@ Unknown sequence: %s, Unmatched =back =item AUTHOR +=back + =head2 Pod::Text::Termcap, Pod::Text::Color - Convert POD data to ASCII text with format escapes +=over + =item SYNOPSIS =item DESCRIPTION @@ -7288,9 +9110,13 @@ text with format escapes =item AUTHOR +=back + =head2 Pod::Usage, pod2usage() - print a usage message from embedded pod documentation +=over + =item SYNOPSIS =item ARGUMENTS @@ -7314,14 +9140,22 @@ C<-pathlist> =item ACKNOWLEDGEMENTS +=back + =head2 SDBM_File - Tied access to sdbm files +=over + =item SYNOPSIS =item DESCRIPTION +=back + =head2 Safe - Compile and execute code in restricted compartments +=over + =item SYNOPSIS =item DESCRIPTION @@ -7349,20 +9183,32 @@ Memory, CPU, Snooping, Signals, State Changes =back +=back + =head2 Search::Dict, look - search for key in dictionary file +=over + =item SYNOPSIS =item DESCRIPTION +=back + =head2 SelectSaver - save and restore selected file handle +=over + =item SYNOPSIS =item DESCRIPTION +=back + =head2 SelfLoader - load functions only on demand +=over + =item SYNOPSIS =item DESCRIPTION @@ -7385,17 +9231,25 @@ Memory, CPU, Snooping, Signals, State Changes =item Multiple packages and fully qualified subroutine names +=back + =head2 Shell - run shell commands transparently within perl +=over + =item SYNOPSIS =item DESCRIPTION =item AUTHOR +=back + =head2 Socket, sockaddr_in, sockaddr_un, inet_aton, inet_ntoa - load the C socket.h defines and structure manipulators +=over + =item SYNOPSIS =item DESCRIPTION @@ -7406,23 +9260,35 @@ SOCKADDR_IN, pack_sockaddr_in PORT, IP_ADDRESS, unpack_sockaddr_in SOCKADDR_IN, sockaddr_un PATHNAME, sockaddr_un SOCKADDR_UN, pack_sockaddr_un PATH, unpack_sockaddr_un SOCKADDR_UN +=back + =head2 Symbol - manipulate Perl symbols and their names +=over + =item SYNOPSIS =item DESCRIPTION +=back + =head2 Sys::Hostname - Try every conceivable way to get hostname +=over + =item SYNOPSIS =item DESCRIPTION =item AUTHOR +=back + =head2 Syslog, Sys::Syslog, openlog, closelog, setlogmask, syslog - Perl interface to the UNIX syslog(3) calls +=over + =item SYNOPSIS =item DESCRIPTION @@ -7439,16 +9305,24 @@ closelog =item AUTHOR +=back + =head2 Term::Cap - Perl termcap interface +=over + =item SYNOPSIS =item DESCRIPTION =item EXAMPLES +=back + =head2 Term::Complete - Perl word completion module +=over + =item SYNOPSIS =item DESCRIPTION @@ -7461,9 +9335,13 @@ E<lt>tabE<gt>, ^D, ^U, E<lt>delE<gt>, E<lt>bsE<gt> =item AUTHOR +=back + =head2 Term::ReadLine - Perl interface to various C<readline> packages. If no real package is found, substitutes stubs instead of basic functions. +=over + =item SYNOPSIS =item DESCRIPTION @@ -7481,8 +9359,12 @@ C<tkRunning>, C<ornaments>, C<newTTY> =item ENVIRONMENT +=back + =head2 Test - provides a simple framework for writing test scripts +=over + =item SYNOPSIS =item DESCRIPTION @@ -7499,8 +9381,12 @@ NORMAL TESTS, SKIPPED TESTS, TODO TESTS =item AUTHOR +=back + =head2 Test::Harness - run perl standard test scripts with statistics +=over + =item SYNOPSIS =item DESCRIPTION @@ -7528,17 +9414,25 @@ C<All tests successful.\nFiles=%d, Tests=%d, %s>, C<FAILED tests =item BUGS +=back + =head2 Text::Abbrev, abbrev - create an abbreviation table from a list +=over + =item SYNOPSIS =item DESCRIPTION =item EXAMPLE +=back + =head2 Text::ParseWords - parse text into an array of tokens or array of arrays +=over + =item SYNOPSIS =item DESCRIPTION @@ -7553,9 +9447,13 @@ backslashed double-quote) =item AUTHORS +=back + =head2 Text::Soundex - Implementation of the Soundex Algorithm as Described by Knuth +=over + =item SYNOPSIS =item DESCRIPTION @@ -7566,9 +9464,13 @@ by Knuth =item AUTHOR +=back + =head2 Text::Tabs -- expand and unexpand tabs per the unix expand(1) and unexpand(1) +=over + =item SYNOPSIS =item DESCRIPTION @@ -7577,8 +9479,12 @@ unexpand(1) =item AUTHOR +=back + =head2 Text::Wrap - line wrapping to form simple paragraphs +=over + =item SYNOPSIS =item DESCRIPTION @@ -7587,8 +9493,12 @@ unexpand(1) =item AUTHOR +=back + =head2 Thread - multithreading +=over + =item SYNOPSIS =item DESCRIPTION @@ -7607,8 +9517,12 @@ join, eval, detach, equal, tid =item SEE ALSO +=back + =head2 Thread::Queue - thread-safe queues +=over + =item SYNOPSIS =item DESCRIPTION @@ -7619,8 +9533,12 @@ new, enqueue LIST, dequeue, dequeue_nb, pending =item SEE ALSO +=back + =head2 Thread::Semaphore - thread-safe semaphores +=over + =item SYNOPSIS =item DESCRIPTION @@ -7629,38 +9547,54 @@ new, enqueue LIST, dequeue, dequeue_nb, pending new, new NUMBER, down, down NUMBER, up, up NUMBER +=back + =head2 Thread::Signal - Start a thread which runs signal handlers reliably +=over + =item SYNOPSIS =item DESCRIPTION =item BUGS +=back + =head2 Thread::Specific - thread-specific keys +=over + =item SYNOPSIS =item DESCRIPTION +=back + =head2 Tie::Array - base class for tied arrays +=over + =item SYNOPSIS =item DESCRIPTION TIEARRAY classname, LIST, STORE this, index, value, FETCH this, index, -FETCHSIZE this, STORESIZE this, count, EXTEND this, count, CLEAR this, -DESTROY this, PUSH this, LIST, POP this, SHIFT this, UNSHIFT this, LIST, -SPLICE this, offset, length, LIST +FETCHSIZE this, STORESIZE this, count, EXTEND this, count, EXISTS this, +key, DELETE this, key, CLEAR this, DESTROY this, PUSH this, LIST, POP this, +SHIFT this, UNSHIFT this, LIST, SPLICE this, offset, length, LIST =item CAVEATS =item AUTHOR +=back + =head2 Tie::Handle, Tie::StdHandle - base class definitions for tied handles +=over + =item SYNOPSIS =item DESCRIPTION @@ -7672,8 +9606,12 @@ EOF this, TELL this, SEEK this, offset, whence, DESTROY this =item MORE INFORMATION +=back + =head2 Tie::Hash, Tie::StdHash - base class definitions for tied hashes +=over + =item SYNOPSIS =item DESCRIPTION @@ -7685,8 +9623,12 @@ this, NEXTKEY this, lastkey, EXISTS this, key, DELETE this, key, CLEAR this =item MORE INFORMATION +=back + =head2 Tie::RefHash - use references as hash keys +=over + =item SYNOPSIS =item DESCRIPTION @@ -7699,9 +9641,13 @@ this, NEXTKEY this, lastkey, EXISTS this, key, DELETE this, key, CLEAR this =item SEE ALSO +=back + =head2 Tie::Scalar, Tie::StdScalar - base class definitions for tied scalars +=over + =item SYNOPSIS =item DESCRIPTION @@ -7710,16 +9656,24 @@ TIESCALAR classname, LIST, FETCH this, STORE this, value, DESTROY this =item MORE INFORMATION +=back + =head2 Tie::SubstrHash - Fixed-table-size, fixed-key-length hashing +=over + =item SYNOPSIS =item DESCRIPTION =item CAVEATS +=back + =head2 Time::Local - efficiently compute time from local and GMT time +=over + =item SYNOPSIS =item DESCRIPTION @@ -7728,9 +9682,13 @@ TIESCALAR classname, LIST, FETCH this, STORE this, value, DESTROY this =item BUGS +=back + =head2 Time::gmtime - by-name interface to Perl's built-in gmtime() function +=over + =item SYNOPSIS =item DESCRIPTION @@ -7739,9 +9697,13 @@ function =item AUTHOR +=back + =head2 Time::localtime - by-name interface to Perl's built-in localtime() function +=over + =item SYNOPSIS =item DESCRIPTION @@ -7750,16 +9712,24 @@ function =item AUTHOR +=back + =head2 Time::tm - internal object used by Time::gmtime and Time::localtime +=over + =item SYNOPSIS =item DESCRIPTION =item AUTHOR +=back + =head2 UNIVERSAL - base class for ALL classes (blessed references) +=over + =item SYNOPSIS =item DESCRIPTION @@ -7767,9 +9737,13 @@ function isa ( TYPE ), can ( METHOD ), VERSION ( [ REQUIRE ] ), UNIVERSAL::isa ( VAL, TYPE ), UNIVERSAL::can ( VAL, METHOD ) +=back + =head2 User::grent - by-name interface to Perl's built-in getgr*() functions +=over + =item SYNOPSIS =item DESCRIPTION @@ -7778,9 +9752,13 @@ functions =item AUTHOR +=back + =head2 User::pwent - by-name interface to Perl's built-in getpw*() functions +=over + =item SYNOPSIS =item DESCRIPTION @@ -7789,11 +9767,27 @@ functions =item AUTHOR +=back + +=head2 XSLoader - Dynamically load C libraries into Perl code + +=over + +=item SYNOPSIS + +=item DESCRIPTION + +=item AUTHOR + +=back + =head1 AUXILIARY DOCUMENTATION Here should be listed all the extra programs' documentation, but they don't all have manual pages yet: +=over + =item a2p =item s2p @@ -7812,6 +9806,8 @@ don't all have manual pages yet: =item wrapsuid +=back + =head1 AUTHOR Larry Wall <F<larry@wall.org>>, with the help of oodles diff --git a/pod/perltodo.pod b/pod/perltodo.pod index 7836acf677..55a29bd3be 100644 --- a/pod/perltodo.pod +++ b/pod/perltodo.pod @@ -297,6 +297,8 @@ subject on perl5-porters. Ronald Kimball (rjk@linguist.dartmouth.edu) has volunteered. +=back + =head2 Include a search tool perldoc should be able to 'grep' fulltext indices of installed POD @@ -824,7 +826,7 @@ Workarounds to help Win32 dynamic loading. =head2 END blocks -END blocks need saving in compiled output, now that STOP blocks +END blocks need saving in compiled output, now that CHECK blocks are available. =head2 _AUTOLOAD diff --git a/pod/perlunicode.pod b/pod/perlunicode.pod new file mode 100644 index 0000000000..bc880364d3 --- /dev/null +++ b/pod/perlunicode.pod @@ -0,0 +1,232 @@ +=head1 NAME + +perlunicode - Unicode support in Perl + +=head1 DESCRIPTION + +WARNING: The implementation of Unicode support in Perl is incomplete. +Expect sudden and unannounced changes! + +Beginning with version 5.6, Perl uses logically wide characters to +represent strings internally. This internal representation of strings +uses the UTF-8 encoding. + +In future, Perl-level operations will expect to work with characters +rather than bytes, in general. + +However, as strictly an interim compatibility measure, Perl v5.6 aims to +provide a safe migration path from byte semantics to character semantics +for programs. For operations where Perl can unambiguously decide that the +input data is characters, Perl now switches to character semantics. +For operations where this determination cannot be made without additional +information from the user, Perl decides in favor of compatibility, and +chooses to use byte semantics. + +This behavior preserves compatibility with earlier versions of Perl, +which allowed byte semantics in Perl operations, but only as long as +none of the program's inputs are marked as being as source of Unicode +character data. Such data may come from filehandles, from calls to +external programs, from information provided by the system (such as %ENV), +or from literals and constants in the source text. Later, in +L</Character encodings for input and output>, we'll see how such +inputs may be marked as being Unicode character data sources. + +If the C<-C> command line switch is used, (or the ${^WIDE_SYSTEM_CALLS} +global flag is set to C<1>), all system calls will use the +corresponding wide character APIs. This is currently only implemented +on Windows. + +Regardless of the above, the C<byte> pragma can always be used to force +byte semantics in a particular lexical scope. See L<byte>. + +The C<utf8> pragma is primarily a compatibility device that enables +recognition of UTF-8 in literals encountered by the parser. It is also +used for enabling some of the more experimental Unicode support features. +Note that this pragma is only required until a future version of Perl +in which character semantics will become the default. This pragma may +then become a no-op. See L<utf8>. + +Unless mentioned otherwise, Perl operators will use character semantics +when they are dealing with Unicode data, and byte semantics otherwise. +Thus, character semantics for these operations apply transparently; if +the input data came from a Unicode source (for example, by adding a +character encoding discipline to the filehandle whence it came, or a +literal UTF-8 string constant in the program), character semantics +apply; otherwise, byte semantics are in effect. To force byte semantics +on Unicode data, the C<byte> pragma should be used. + +Under character semantics, many operations that formerly operated on +bytes change to operating on characters. For ASCII data this makes +no difference, because UTF-8 stores ASCII in single bytes, but for +any character greater than C<chr(127)>, the character is stored in +a sequence of two or more bytes, all of which have the high bit set. +But by and large, the user need not worry about this, because Perl +hides it from the user. A character in Perl is logically just a number +ranging from 0 to 2**32 or so. Larger characters encode to longer +sequences of bytes internally, but again, this is just an internal +detail which is hidden at the Perl level. + +=head2 Effects of character semantics + +Character semantics have the following effects: + +=over 4 + +=item * + +Strings and patterns may contain characters that have an ordinal value +larger than 255. In Perl v5.6, this is only enabled if the lexical +scope has a C<use utf8> declaration (due to compatibility needs) but +future versions may enable this by default. + +Presuming you use a Unicode editor to edit your program, such characters +will typically occur directly within the literal strings as UTF-8 +characters, but you can also specify a particular character with an +extension of the C<\x> notation. UTF-8 characters are specified by +putting the hexadecimal code within curlies after the C<\x>. For instance, +a Unicode smiley face is C<\x{263A}>. A character in the Latin-1 range +(128..255) should be written C<\x{ab}> rather than C<\xab>, since the +former will turn into a two-byte UTF-8 code, while the latter will +continue to be interpreted as generating a 8-bit byte rather than a +character. In fact, if C<-w> is turned on, it will produce a warning +that you might be generating invalid UTF-8. + +=item * + +Identifiers within the Perl script may contain Unicode alphanumeric +characters, including ideographs. (You are currently on your own when +it comes to using the canonical forms of characters--Perl doesn't (yet) +attempt to canonicalize variable names for you.) + +This also needs C<use utf8> currently. [XXX: Why?!? High-bit chars were +syntax errors when they occurred within identifiers in previous versions, +so this should probably be enabled by default.] + +=item * + +Regular expressions match characters instead of bytes. For instance, +"." matches a character instead of a byte. (However, the C<\C> pattern +is provided to force a match a single byte ("C<char>" in C, hence +C<\C>).) + +Unicode support in regular expressions needs C<use utf8> currently. +[XXX: Because the SWASH routines need to be loaded. And the RE engine +appears to need an overhaul to dynamically match Unicode anyway--the +current RE compiler creates different nodes with and without C<use utf8>.] + +=item * + +Character classes in regular expressions match characters instead of +bytes, and match against the character properties specified in the +Unicode properties database. So C<\w> can be used to match an ideograph, +for instance. + +C<use utf8> is needed to enable this. See above. + +=item * + +Named Unicode properties and block ranges make be used as character +classes via the new C<\p{}> (matches property) and C<\P{}> (doesn't +match property) constructs. For instance, C<\p{Lu}> matches any +character with the Unicode uppercase property, while C<\p{M}> matches +any mark character. Single letter properties may omit the brackets, so +that can be written C<\pM> also. Many predefined character classes are +available, such as C<\p{IsMirrored}> and C<\p{InTibetan}>. + +C<use utf8> is needed to enable this. See above. + +=item * + +The special pattern C<\X> match matches any extended Unicode sequence +(a "combining character sequence" in Standardese), where the first +character is a base character and subsequent characters are mark +characters that apply to the base character. It is equivalent to +C<(?:\PM\pM*)>. + +C<use utf8> is needed to enable this. See above. + +=item * + +The C<tr///> operator translates characters instead of bytes. It can also +be forced to translate between 8-bit codes and UTF-8 regardless of the +surrounding utf8 state. For instance, if you know your input in Latin-1, +you can say: + + use utf8; + while (<>) { + tr/\0-\xff//CU; # latin1 char to utf8 + ... + } + +Similarly you could translate your output with + + tr/\0-\x{ff}//UC; # utf8 to latin1 char + +No, C<s///> doesn't take /U or /C (yet?). + +C<use utf8> is needed to enable this. See above. + +=item * + +Case translation operators use the Unicode case translation tables +when provided character input. Note that C<uc()> translates to +uppercase, while C<ucfirst> translates to titlecase (for languages +that make the distinction). Naturally the corresponding backslash +sequences have the same semantics. + +=item * + +Most operators that deal with positions or lengths in the string will +automatically switch to using character positions, including C<chop()>, +C<substr()>, C<pos()>, C<index()>, C<rindex()>, C<sprintf()>, +C<write()>, and C<length()>. Operators that specifically don't switch +include C<vec()>, C<pack()>, and C<unpack()>. Operators that really +don't care include C<chomp()>, as well as any other operator that +treats a string as a bucket of bits, such as C<sort()>, and the +operators dealing with filenames. + +=item * + +The C<pack()>/C<unpack()> letters "C<c>" and "C<C>" do I<not> change, +since they're often used for byte-oriented formats. (Again, think +"C<char>" in the C language.) However, there is a new "C<U>" specifier +that will convert between UTF-8 characters and integers. (It works +outside of the utf8 pragma too.) + +=item * + +The C<chr()> and C<ord()> functions work on characters. This is like +C<pack("U")> and C<unpack("U")>, not like C<pack("C")> and +C<unpack("C")>. In fact, the latter are how you now emulate +byte-oriented C<chr()> and C<ord()> under utf8. + +=item * + +And finally, C<scalar reverse()> reverses by character rather than by byte. + +=back + +=head2 Character encodings for input and output + +[XXX: This feature is not yet implemented.] + +=head1 CAVEATS + +As of yet, there is no method for automatically coercing input and +output to some encoding other than UTF-8. This is planned in the near +future, however. + +Whether an arbitrary piece of data will be treated as "characters" or +"bytes" by internal operations cannot be divined at the current time. + +Use of locales with utf8 may lead to odd results. Currently there is +some attempt to apply 8-bit locale info to characters in the range +0..255, but this is demonstrably incorrect for locales that use +characters above that range (when mapped into Unicode). It will also +tend to run slower. Avoidance of locales is strongly encouraged. + +=head1 SEE ALSO + +L<byte>, L<utf8>, L<perlvar/"${^WIDE_SYSTEM_CALLS}"> + +=cut diff --git a/pod/perlvar.pod b/pod/perlvar.pod index 5e705313d5..f0cb109005 100644 --- a/pod/perlvar.pod +++ b/pod/perlvar.pod @@ -185,7 +185,7 @@ $+[0] - $-[0]>. Similarly, C<$>I<n> coincides with C<substr $_, $-[>I<n>C<], $+[>I<n>C<] - $-[>I<n>C<]> if C<$-[>I<n>C<]> is defined, and $+ coincides with C<substr $_, $-[$#-], $+[$#-]>. One can use C<$#+> to find the number of subgroups in the last successful match. Contrast with -C<$#->, the last I<matched> subgroup. Compare with C<@->. +C<$#E<45>>, the last I<matched> subgroup. Compare with C<@E<45>>. =item $MULTILINE_MATCHING @@ -421,7 +421,7 @@ I<n>-th subpattern, or undef if the subpattern did not match. Thus after a match against $_, $& coincides with C<substr $_, $-[0], $+[0] - $-[0]>. Similarly, C<$>I<n> coincides with C<substr $_, $-[>I<n>C<], $+[>I<n>C<] - $-[>I<n>C<]> if C<$-[>I<n>C<]> is defined, and $+ coincides with -C<substr $_, $-[$#-], $+[$#-]>. One can use C<$#-> to find the last +C<substr $_, $-[$#-], $+[$#-]>. One can use C<$#E<45>> to find the last matched subgroup in the last successful match. Contrast with C<$#+>, the number of subgroups in the regular expression. Compare with C<@+>. @@ -686,6 +686,8 @@ of perl in the right bracket?) Example: See also the documentation of C<use VERSION> and C<require VERSION> for a convenient way to fail if the running Perl interpreter is too old. +See C<$^V> for a more modern representation of the Perl version. + =item $COMPILING =item $^C @@ -717,8 +719,54 @@ C<$^F> when the open() or pipe() was called, not the time of the exec(). =item $^H -The current set of syntax checks enabled by C<use strict> and other block -scoped compiler hints. See the documentation of C<strict> for more details. +WARNING: This variable is strictly for internal use only. Its availability, +behavior, and contents are subject to change without notice. + +This variable contains compile-time hints for the Perl interpreter. At the +end of compilation of a BLOCK the value of this variable is restored to the +value when the interpreter started to compile the BLOCK. + +When perl begins to parse any block construct that provides a lexical scope +(e.g., eval body, required file, subroutine body, loop body, or conditional +block), the existing value of $^H is saved, but its value is left unchanged. +When the compilation of the block is completed, it regains the saved value. +Between the points where its value is saved and restored, code that +executes within BEGIN blocks is free to change the value of $^H. + +This behavior provides the semantic of lexical scoping, and is used in, +for instance, the C<use strict> pragma. + +The contents should be an integer; different bits of it are used for +different pragmatic flags. Here's an example: + + sub add_100 { $^H |= 0x100 } + + sub foo { + BEGIN { add_100() } + bar->baz($boon); + } + +Consider what happens during execution of the BEGIN block. At this point +the BEGIN block has already been compiled, but the body of foo() is still +being compiled. The new value of $^H will therefore be visible only while +the body of foo() is being compiled. + +Substitution of the above BEGIN block with: + + BEGIN { require strict; strict->import('vars') } + +demonstrates how C<use strict 'vars'> is implemented. Here's a conditional +version of the same lexical pragma: + + BEGIN { require strict; strict->import('vars') if $condition } + +=item %^H + +WARNING: This variable is strictly for internal use only. Its availability, +behavior, and contents are subject to change without notice. + +The %^H hash provides the same scoping semantic as $^H. This makes it +useful for implementation of lexically scoped pragmas. =item $INPLACE_EDIT @@ -784,6 +832,23 @@ Keep info about source lines on which a subroutine is defined. Start with single-step on. +=item 0x40 + +Use subroutine address instead of name when reporting. + +=item 0x80 + +Report C<goto &subroutine> as well. + +=item 0x100 + +Provide informative "file" names for evals based on the place they were compiled. + +=item 0x200 + +Provide informative names to anonymous subroutines based on the place they +were compiled. + =back Some bits may be relevant at compile-time only, some at @@ -808,6 +873,28 @@ The time at which the program began running, in seconds since the epoch (beginning of 1970). The values returned by the B<-M>, B<-A>, and B<-C> filetests are based on this value. +=item $PERL_VERSION_TUPLE + +=item $^V + +The revision, version, and subversion of the Perl interpreter, represented +as a "version tuple". Version tuples have both a numeric value and a +string value. The numeric value is a floating point number that amounts +to revision + version/1000 + subversion/1000000, and the string value +is made of characters possibly in the UTF-8 range: +C<chr($revision) . chr($version) . chr($subversion)>. + +This can be used to determine whether the Perl interpreter executing a +script is in the right range of versions. (Mnemonic: use ^V for Version +control.) Example: + + warn "No "our" declarations!\n" if $^V and $^V lt v5.6; + +See also the documentation of C<use VERSION> and C<require VERSION> +for a convenient way to fail if the running Perl interpreter is too old. + +See also C<$]> for an older representation of the Perl version. + =item $WARNING =item $^W @@ -816,11 +903,26 @@ The current value of the warning switch, initially true if B<-w> was used, false otherwise, but directly modifiable. (Mnemonic: related to the B<-w> switch.) See also L<warnings>. -=item ${^Warnings} +=item ${^WARNING_BITS} The current set of warning checks enabled by the C<use warnings> pragma. See the documentation of C<warnings> for more details. +=item ${^WIDE_SYSTEM_CALLS} + +Global flag that enables system calls made by Perl to use wide character +APIs native to the system, if available. This is currently only implemented +on the Windows platform. + +This can also be enabled from the command line using the C<-C> switch. + +The initial value is typically C<0> for compatibility with Perl versions +earlier than 5.6, but may be automatically set to C<1> by Perl if the system +provides a user-settable default (e.g., C<$ENV{LC_CTYPE}>). + +The C<byte> pragma always overrides the effect of this flag in the current +lexical scope. See L<byte>. + =item $EXECUTABLE_NAME =item $^X diff --git a/pod/roffitall b/pod/roffitall index 7ddffe76c5..9f9e3e9e49 100644 --- a/pod/roffitall +++ b/pod/roffitall @@ -71,6 +71,8 @@ toroff=` $mandir/perlcall.1 \ $mandir/perlcompile.1 \ $mandir/perltodo.1 \ + $mandir/perlapi.1 \ + $mandir/perlintern.1 \ $mandir/perlhack.1 \ $mandir/perlhist.1 \ $mandir/perldelta.1 \ @@ -1,6 +1,6 @@ /* pp.c * - * Copyright (c) 1991-1999, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -47,7 +47,7 @@ typedef unsigned UBW; * have an integral type (except char) small enough to be represented * in a double without loss; that is, it has no 32-bit type. */ -#if LONGSIZE > 4 && defined(_CRAY) && !defined(_CRAYMPP) +#if LONGSIZE > 4 && defined(_CRAY) # define BW_BITS 32 # define BW_MASK ((1 << BW_BITS) - 1) # define BW_SIGN (1 << (BW_BITS - 1)) @@ -86,7 +86,7 @@ typedef unsigned UBW; # define PERL_NATINT_PACK #endif -#if BYTEORDER > 0xFFFF && defined(_CRAY) && !defined(_CRAYMPP) +#if LONGSIZE > 4 && defined(_CRAY) # if BYTEORDER == 0x12345678 # define OFF16(p) (char*)(p) # define OFF32(p) (char*)(p) @@ -389,7 +389,7 @@ PP(pp_pos) mg = mg_find(sv, 'g'); if (mg && mg->mg_len >= 0) { I32 i = mg->mg_len; - if (IN_UTF8) + if (DO_UTF8(sv)) sv_pos_b2u(sv, &i); PUSHi(i + PL_curcop->cop_arybase); RETURN; @@ -1426,7 +1426,7 @@ PP(pp_negate) sv_setsv(TARG, sv); *SvPV_force(TARG, len) = *s == '-' ? '+' : '-'; } - else if (IN_UTF8 && *(U8*)s >= 0xc0 && isIDFIRST_utf8((U8*)s)) { + else if (DO_UTF8(sv) && *(U8*)s >= 0xc0 && isIDFIRST_utf8((U8*)s)) { sv_setpvn(TARG, "-", 1); sv_catsv(TARG, sv); } @@ -1930,13 +1930,12 @@ PP(pp_oct) PP(pp_length) { djSP; dTARGET; + SV *sv = TOPs; - if (IN_UTF8) { - SETi( sv_len_utf8(TOPs) ); - RETURN; - } - - SETi( sv_len(TOPs) ); + if (DO_UTF8(sv)) + SETi(sv_len_utf8(sv)); + else + SETi(sv_len(sv)); RETURN; } @@ -1957,6 +1956,7 @@ PP(pp_substr) STRLEN repl_len; SvTAINTED_off(TARG); /* decontaminate */ + SvUTF8_off(TARG); /* decontaminate */ if (MAXARG > 2) { if (MAXARG > 3) { sv = POPs; @@ -1968,7 +1968,7 @@ PP(pp_substr) sv = POPs; PUTBACK; tmps = SvPV(sv, curlen); - if (IN_UTF8) { + if (DO_UTF8(sv)) { utfcurlen = sv_len_utf8(sv); if (utfcurlen == curlen) utfcurlen = 0; @@ -2017,8 +2017,10 @@ PP(pp_substr) RETPUSHUNDEF; } else { - if (utfcurlen) + if (utfcurlen) { sv_pos_u2b(sv, &pos, &rem); + SvUTF8_on(TARG); + } tmps += pos; sv_setpvn(TARG, tmps, rem); if (repl) @@ -2106,7 +2108,7 @@ PP(pp_index) little = POPs; big = POPs; tmps = SvPV(big, biglen); - if (IN_UTF8 && offset > 0) + if (offset > 0 && DO_UTF8(big)) sv_pos_u2b(big, &offset, 0); if (offset < 0) offset = 0; @@ -2117,7 +2119,7 @@ PP(pp_index) retval = -1; else retval = tmps2 - tmps; - if (IN_UTF8 && retval > 0) + if (retval > 0 && DO_UTF8(big)) sv_pos_b2u(big, &retval); PUSHi(retval + arybase); RETURN; @@ -2145,7 +2147,7 @@ PP(pp_rindex) if (MAXARG < 3) offset = blen; else { - if (IN_UTF8 && offset > 0) + if (offset > 0 && DO_UTF8(big)) sv_pos_u2b(big, &offset, 0); offset = offset - arybase + llen; } @@ -2158,7 +2160,7 @@ PP(pp_rindex) retval = -1; else retval = tmps2 - tmps; - if (IN_UTF8 && retval > 0) + if (retval > 0 && DO_UTF8(big)) sv_pos_b2u(big, &retval); PUSHi(retval + arybase); RETURN; @@ -2179,10 +2181,11 @@ PP(pp_ord) djSP; dTARGET; UV value; STRLEN n_a; - U8 *tmps = (U8*)POPpx; + SV *tmpsv = POPs; + U8 *tmps = (U8*)SvPVx(tmpsv,n_a); I32 retlen; - if (IN_UTF8 && (*tmps & 0x80)) + if ((*tmps & 0x80) && DO_UTF8(tmpsv)) value = utf8_to_uv(tmps, &retlen); else value = (UV)(*tmps & 255); @@ -2198,12 +2201,13 @@ PP(pp_chr) (void)SvUPGRADE(TARG,SVt_PV); - if (IN_UTF8 && value >= 128) { + if (value > 255 && !IN_BYTE) { SvGROW(TARG,8); tmps = SvPVX(TARG); tmps = (char*)uv_to_utf8((U8*)tmps, (UV)value); SvCUR_set(TARG, tmps - SvPVX(TARG)); *tmps = '\0'; + SvUTF8_on(TARG); (void)SvPOK_only(TARG); XPUSHs(TARG); RETURN; @@ -2214,6 +2218,7 @@ PP(pp_chr) tmps = SvPVX(TARG); *tmps++ = value; *tmps = '\0'; + SvUTF8_off(TARG); /* decontaminate */ (void)SvPOK_only(TARG); XPUSHs(TARG); RETURN; @@ -2245,7 +2250,7 @@ PP(pp_ucfirst) register U8 *s; STRLEN slen; - if (IN_UTF8 && (s = (U8*)SvPV(sv, slen)) && slen && (*s & 0xc0) == 0xc0) { + if (DO_UTF8(sv) && (s = (U8*)SvPV(sv, slen)) && slen && (*s & 0xc0) == 0xc0) { I32 ulen; U8 tmpbuf[10]; U8 *tend; @@ -2265,6 +2270,7 @@ PP(pp_ucfirst) dTARGET; sv_setpvn(TARG, (char*)tmpbuf, tend - tmpbuf); sv_catpvn(TARG, (char*)(s + ulen), slen - ulen); + SvUTF8_on(TARG); SETs(TARG); } else { @@ -2275,6 +2281,7 @@ PP(pp_ucfirst) else { if (!SvPADTMP(sv) || SvREADONLY(sv)) { dTARGET; + SvUTF8_off(TARG); /* decontaminate */ sv_setsv(TARG, sv); sv = TARG; SETs(sv); @@ -2302,7 +2309,7 @@ PP(pp_lcfirst) register U8 *s; STRLEN slen; - if (IN_UTF8 && (s = (U8*)SvPV(sv, slen)) && slen && (*s & 0xc0) == 0xc0) { + if (DO_UTF8(sv) && (s = (U8*)SvPV(sv, slen)) && slen && (*s & 0xc0) == 0xc0) { I32 ulen; U8 tmpbuf[10]; U8 *tend; @@ -2322,6 +2329,7 @@ PP(pp_lcfirst) dTARGET; sv_setpvn(TARG, (char*)tmpbuf, tend - tmpbuf); sv_catpvn(TARG, (char*)(s + ulen), slen - ulen); + SvUTF8_on(TARG); SETs(TARG); } else { @@ -2332,6 +2340,7 @@ PP(pp_lcfirst) else { if (!SvPADTMP(sv) || SvREADONLY(sv)) { dTARGET; + SvUTF8_off(TARG); /* decontaminate */ sv_setsv(TARG, sv); sv = TARG; SETs(sv); @@ -2346,7 +2355,6 @@ PP(pp_lcfirst) else *s = toLOWER(*s); } - SETs(sv); } if (SvSMAGICAL(sv)) mg_set(sv); @@ -2360,7 +2368,7 @@ PP(pp_uc) register U8 *s; STRLEN len; - if (IN_UTF8) { + if (DO_UTF8(sv)) { dTARGET; I32 ulen; register U8 *d; @@ -2368,6 +2376,7 @@ PP(pp_uc) s = (U8*)SvPV(sv,len); if (!len) { + SvUTF8_off(TARG); /* decontaminate */ sv_setpvn(TARG, "", 0); SETs(TARG); } @@ -2392,6 +2401,7 @@ PP(pp_uc) } } *d = '\0'; + SvUTF8_on(TARG); SvCUR_set(TARG, d - (U8*)SvPVX(TARG)); SETs(TARG); } @@ -2399,6 +2409,7 @@ PP(pp_uc) else { if (!SvPADTMP(sv) || SvREADONLY(sv)) { dTARGET; + SvUTF8_off(TARG); /* decontaminate */ sv_setsv(TARG, sv); sv = TARG; SETs(sv); @@ -2431,7 +2442,7 @@ PP(pp_lc) register U8 *s; STRLEN len; - if (IN_UTF8) { + if (DO_UTF8(sv)) { dTARGET; I32 ulen; register U8 *d; @@ -2439,6 +2450,7 @@ PP(pp_lc) s = (U8*)SvPV(sv,len); if (!len) { + SvUTF8_off(TARG); /* decontaminate */ sv_setpvn(TARG, "", 0); SETs(TARG); } @@ -2463,6 +2475,7 @@ PP(pp_lc) } } *d = '\0'; + SvUTF8_on(TARG); SvCUR_set(TARG, d - (U8*)SvPVX(TARG)); SETs(TARG); } @@ -2470,6 +2483,7 @@ PP(pp_lc) else { if (!SvPADTMP(sv) || SvREADONLY(sv)) { dTARGET; + SvUTF8_off(TARG); /* decontaminate */ sv_setsv(TARG, sv); sv = TARG; SETs(sv); @@ -2504,11 +2518,12 @@ PP(pp_quotemeta) register char *s = SvPV(sv,len); register char *d; + SvUTF8_off(TARG); /* decontaminate */ if (len) { (void)SvUPGRADE(TARG, SVt_PV); SvGROW(TARG, (len * 2) + 1); d = SvPVX(TARG); - if (IN_UTF8) { + if (DO_UTF8(sv)) { while (len) { if (*s & 0x80) { STRLEN ulen = UTF8SKIP(s); @@ -2525,6 +2540,7 @@ PP(pp_quotemeta) len--; } } + SvUTF8_on(TARG); } else { while (len--) { @@ -2701,8 +2717,22 @@ PP(pp_delete) PP(pp_exists) { djSP; - SV *tmpsv = POPs; - HV *hv = (HV*)POPs; + SV *tmpsv; + HV *hv; + + if (PL_op->op_private & OPpEXISTS_SUB) { + GV *gv; + CV *cv; + SV *sv = POPs; + cv = sv_2cv(sv, &hv, &gv, FALSE); + if (cv) + RETPUSHYES; + if (gv && isGV(gv) && GvCV(gv) && !GvCVGEN(gv)) + RETPUSHYES; + RETPUSHNO; + } + tmpsv = POPs; + hv = (HV*)POPs; if (SvTYPE(hv) == SVt_PVHV) { if (hv_exists_ent(hv, tmpsv, 0)) RETPUSHYES; @@ -3170,13 +3200,14 @@ PP(pp_reverse) dTARGET; STRLEN len; + SvUTF8_off(TARG); /* decontaminate */ if (SP - MARK > 1) do_join(TARG, &PL_sv_no, MARK, SP); else sv_setsv(TARG, (SP > MARK) ? *SP : DEFSV); up = SvPV_force(TARG, len); if (len > 1) { - if (IN_UTF8) { /* first reverse each character */ + if (DO_UTF8(TARG)) { /* first reverse each character */ U8* s = (U8*)SvPVX(TARG); U8* send = (U8*)(s + len); while (s < send) { @@ -1,6 +1,6 @@ /* pp.h * - * Copyright (c) 1991-1999, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -17,6 +17,38 @@ #define PP(s) OP * Perl_##s(pTHX) +/* +=for apidoc AmU||SP +Stack pointer. This is usually handled by C<xsubpp>. See C<dSP> and +C<SPAGAIN>. + +=for apidoc AmU||MARK +Stack marker variable for the XSUB. See C<dMARK>. + +=for apidoc Ams||PUSHMARK +Opening bracket for arguments on a callback. See C<PUTBACK> and +L<perlcall>. + +=for apidoc Ams||dSP +Declares a local copy of perl's stack pointer for the XSUB, available via +the C<SP> macro. See C<SP>. + +=for apidoc Ams||dMARK +Declare a stack marker variable, C<mark>, for the XSUB. See C<MARK> and +C<dORIGMARK>. + +=for apidoc Ams||dORIGMARK +Saves the original stack mark for the XSUB. See C<ORIGMARK>. + +=for apidoc AmU||ORIGMARK +The original stack mark for the XSUB. See C<dORIGMARK>. + +=for apidoc Ams||SPAGAIN +Refetch the stack pointer. Used after a callback. See L<perlcall>. + +=cut +*/ + #define SP sp #define MARK mark #define TARG targ @@ -52,6 +84,29 @@ #define NORMAL PL_op->op_next #define DIE return Perl_die +/* +=for apidoc Ams||PUTBACK +Closing bracket for XSUB arguments. This is usually handled by C<xsubpp>. +See C<PUSHMARK> and L<perlcall> for other uses. + +=for apidoc Amn|SV*|POPs +Pops an SV off the stack. + +=for apidoc Amn|char*|POPp +Pops a string off the stack. + +=for apidoc Amn|NV|POPn +Pops a double off the stack. + +=for apidoc Amn|IV|POPi +Pops an integer off the stack. + +=for apidoc Amn|long|POPl +Pops a long off the stack. + +=cut +*/ + #define PUTBACK PL_stack_sp = sp #define RETURN return PUTBACK, NORMAL #define RETURNOP(o) return PUTBACK, o @@ -84,6 +139,58 @@ #endif /* Go to some pains in the rare event that we must extend the stack. */ + +/* +=for apidoc Am|void|EXTEND|SP|int nitems +Used to extend the argument stack for an XSUB's return values. Once +used, guarrantees that there is room for at least C<nitems> to be pushed +onto the stack. + +=for apidoc Am|void|PUSHs|SV* sv +Push an SV onto the stack. The stack must have room for this element. +Does not handle 'set' magic. See C<XPUSHs>. + +=for apidoc Am|void|PUSHp|char* str|STRLEN len +Push a string onto the stack. The stack must have room for this element. +The C<len> indicates the length of the string. Handles 'set' magic. See +C<XPUSHp>. + +=for apidoc Am|void|PUSHn|NV nv +Push a double onto the stack. The stack must have room for this element. +Handles 'set' magic. See C<XPUSHn>. + +=for apidoc Am|void|PUSHi|IV iv +Push an integer onto the stack. The stack must have room for this element. +Handles 'set' magic. See C<XPUSHi>. + +=for apidoc Am|void|PUSHu|UV uv +Push an unsigned integer onto the stack. The stack must have room for this +element. See C<XPUSHu>. + +=for apidoc Am|void|XPUSHs|SV* sv +Push an SV onto the stack, extending the stack if necessary. Does not +handle 'set' magic. See C<PUSHs>. + +=for apidoc Am|void|XPUSHp|char* str|STRLEN len +Push a string onto the stack, extending the stack if necessary. The C<len> +indicates the length of the string. Handles 'set' magic. See +C<PUSHp>. + +=for apidoc Am|void|XPUSHn|NV nv +Push a double onto the stack, extending the stack if necessary. Handles +'set' magic. See C<PUSHn>. + +=for apidoc Am|void|XPUSHi|IV iv +Push an integer onto the stack, extending the stack if necessary. Handles +'set' magic. See C<PUSHi>. + +=for apidoc Am|void|XPUSHu|UV uv +Push an unsigned integer onto the stack, extending the stack if necessary. +See C<PUSHu>. + +=cut +*/ + #define EXTEND(p,n) STMT_START { if (PL_stack_max - p < (n)) { \ sp = stack_grow(sp,p, (int) (n)); \ } } STMT_END @@ -1,6 +1,6 @@ /* pp_ctl.c * - * Copyright (c) 1991-1999, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -114,6 +114,8 @@ PP(pp_regcomp) PL_reginterp_cnt = I32_MAX; /* Mark as safe. */ pm->op_pmflags = pm->op_pmpermflags; /* reset case sensitivity */ + if (DO_UTF8(tmpstr)) + pm->op_pmdynflags |= PMdf_UTF8; pm->op_pmregexp = CALLREGCOMP(aTHX_ t, t + len, pm); PL_reginterp_cnt = 0; /* XXXX Be extra paranoid - needed inside tie/overload accessors. */ @@ -296,7 +298,8 @@ PP(pp_formline) NV value; bool gotsome; STRLEN len; - STRLEN fudge = SvCUR(tmpForm) * (IN_UTF8 ? 3 : 1) + 1; + STRLEN fudge = SvCUR(tmpForm) * (IN_BYTE ? 1 : 3) + 1; + bool item_is_utf = FALSE; if (!SvMAGICAL(tmpForm) || !SvCOMPILED(tmpForm)) { SvREADONLY_off(tmpForm); @@ -374,7 +377,7 @@ PP(pp_formline) case FF_CHECKNL: item = s = SvPV(sv, len); itemsize = len; - if (IN_UTF8) { + if (DO_UTF8(sv)) { itemsize = sv_len_utf8(sv); if (itemsize != len) { I32 itembytes; @@ -393,11 +396,13 @@ PP(pp_formline) break; s++; } + item_is_utf = TRUE; itemsize = s - item; sv_pos_b2u(sv, &itemsize); break; } } + item_is_utf = FALSE; if (itemsize > fieldsize) itemsize = fieldsize; send = chophere = s + itemsize; @@ -414,7 +419,7 @@ PP(pp_formline) case FF_CHECKCHOP: item = s = SvPV(sv, len); itemsize = len; - if (IN_UTF8) { + if (DO_UTF8(sv)) { itemsize = sv_len_utf8(sv); if (itemsize != len) { I32 itembytes; @@ -452,9 +457,11 @@ PP(pp_formline) itemsize = chophere - item; sv_pos_b2u(sv, &itemsize); } + item_is_utf = TRUE; break; } } + item_is_utf = FALSE; if (itemsize <= fieldsize) { send = chophere = s + itemsize; while (s < send) { @@ -510,7 +517,7 @@ PP(pp_formline) case FF_ITEM: arg = itemsize; s = item; - if (IN_UTF8) { + if (item_is_utf) { while (arg--) { if (*s & 0x80) { switch (UTF8SKIP(s)) { @@ -553,6 +560,7 @@ PP(pp_formline) case FF_LINEGLOB: item = s = SvPV(sv, len); itemsize = len; + item_is_utf = FALSE; /* XXX is this correct? */ if (itemsize) { gotsome = TRUE; send = s + itemsize; @@ -1302,7 +1310,7 @@ Perl_qerror(pTHX_ SV *err) else if (PL_errors) sv_catsv(PL_errors, err); else - Perl_warn(aTHX_ "%_", err); + Perl_warn(aTHX_ "%"SVf, err); ++PL_error_count; } @@ -1959,10 +1967,17 @@ PP(pp_next) if (cxix < cxstack_ix) dounwind(cxix); - TOPBLOCK(cx); - oldsave = PL_scopestack[PL_scopestack_ix - 1]; - LEAVE_SCOPE(oldsave); - return cx->blk_loop.next_op; + cx = &cxstack[cxstack_ix]; + { + OP *nextop = cx->blk_loop.next_op; + /* clean scope, but only if there's no continue block */ + if (nextop == cUNOPx(cx->blk_loop.last_op)->op_first->op_next) { + TOPBLOCK(cx); + oldsave = PL_scopestack[PL_scopestack_ix - 1]; + LEAVE_SCOPE(oldsave); + } + return nextop; + } } PP(pp_redo) @@ -2391,8 +2406,7 @@ PP(pp_goto) /* Eventually we may want to stack the needed arguments * for each op. For now, we punt on the hard ones. */ if (PL_op->op_type == OP_ENTERITER) - DIE(aTHX_ "Can't \"goto\" into the middle of a foreach loop", - label); + DIE(aTHX_ "Can't \"goto\" into the middle of a foreach loop"); CALL_FPTR(PL_op->op_ppaddr)(aTHX); } PL_op = oldop; @@ -2556,7 +2570,8 @@ Perl_sv_compile_2op(pTHX_ SV *sv, OP** startop, char *code, AV** avp) I32 optype; OP dummy; OP *oop = PL_op, *rop; - char tmpbuf[TYPE_DIGITS(long) + 12 + 10]; + char tbuf[TYPE_DIGITS(long) + 12 + 10]; + char *tmpbuf = tbuf; char *safestr; ENTER; @@ -2570,7 +2585,15 @@ Perl_sv_compile_2op(pTHX_ SV *sv, OP** startop, char *code, AV** avp) } SAVECOPFILE(&PL_compiling); SAVECOPLINE(&PL_compiling); - sprintf(tmpbuf, "_<(%.10s_eval %lu)", code, (unsigned long)++PL_evalseq); + if (PERLDB_NAMEEVAL && CopLINE(PL_curcop)) { + SV *sv = sv_newmortal(); + Perl_sv_setpvf(aTHX_ sv, "_<(%.10seval %lu)[%s:%"IVdf"]", + code, (unsigned long)++PL_evalseq, + CopFILE(PL_curcop), (IV)CopLINE(PL_curcop)); + tmpbuf = SvPVX(sv); + } + else + sprintf(tmpbuf, "_<(%.10s_eval %lu)", code, (unsigned long)++PL_evalseq); CopFILE_set(&PL_compiling, tmpbuf+2); CopLINE_set(&PL_compiling, 1); /* XXX For C<eval "...">s within BEGIN {} blocks, this ends up @@ -2842,7 +2865,7 @@ PP(pp_require) sv = POPs; if (SvNIOKp(sv)) { UV rev, ver, sver; - if (SvPOKp(sv) && SvUTF8(sv)) { /* require v5.6.1 */ + if (SvPOKp(sv)) { /* require v5.6.1 */ I32 len; U8 *s = (U8*)SvPVX(sv); U8 *end = (U8*)SvPVX(sv) + SvCUR(sv); @@ -2869,7 +2892,7 @@ PP(pp_require) && 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, + "v%d.%d.%d, stopped", rev, ver, sver, PERL_REVISION, PERL_VERSION, PERL_SUBVERSION); } } @@ -2884,7 +2907,7 @@ PP(pp_require) + 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, + "v%d.%d.%d, stopped", rev, ver, sver, PERL_REVISION, PERL_VERSION, PERL_SUBVERSION); } } @@ -3141,7 +3164,8 @@ PP(pp_entereval) register PERL_CONTEXT *cx; dPOPss; I32 gimme = GIMME_V, was = PL_sub_generation; - char tmpbuf[TYPE_DIGITS(long) + 12]; + char tbuf[TYPE_DIGITS(long) + 12]; + char *tmpbuf = tbuf; char *safestr; STRLEN len; OP *ret; @@ -3157,7 +3181,15 @@ PP(pp_entereval) /* switch to eval mode */ SAVECOPFILE(&PL_compiling); - sprintf(tmpbuf, "_<(eval %lu)", (unsigned long)++PL_evalseq); + if (PERLDB_NAMEEVAL && CopLINE(PL_curcop)) { + SV *sv = sv_newmortal(); + Perl_sv_setpvf(aTHX_ sv, "_<(eval %lu)[%s:%"IVdf"]", + (unsigned long)++PL_evalseq, + CopFILE(PL_curcop), (IV)CopLINE(PL_curcop)); + tmpbuf = SvPVX(sv); + } + else + sprintf(tmpbuf, "_<(eval %lu)", (unsigned long)++PL_evalseq); CopFILE_set(&PL_compiling, tmpbuf+2); CopLINE_set(&PL_compiling, 1); /* XXX For C<eval "...">s within BEGIN {} blocks, this ends up @@ -1,6 +1,6 @@ /* pp_hot.c * - * Copyright (c) 1991-1999, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -87,6 +87,8 @@ PP(pp_stringify) char *s; s = SvPV(TOPs,len); sv_setpvn(TARG,s,len); + if (SvUTF8(TOPs) && !IN_BYTE) + SvUTF8_on(TARG); SETTARG; RETURN; } @@ -365,15 +367,15 @@ PP(pp_print) } else if (!(fp = IoOFP(io))) { if (ckWARN2(WARN_CLOSED, WARN_IO)) { - SV* sv = sv_newmortal(); - gv_efullname3(sv, gv, Nullch); - if (IoIFP(io)) + if (IoIFP(io)) { + SV* sv = sv_newmortal(); + gv_efullname3(sv, gv, Nullch); Perl_warner(aTHX_ WARN_IO, "Filehandle %s opened only for input", SvPV(sv,n_a)); + } else if (ckWARN(WARN_CLOSED)) - Perl_warner(aTHX_ WARN_CLOSED, - "print() on closed filehandle %s", SvPV(sv,n_a)); + report_closed_fh(gv, io, "print", "filehandle"); } SETERRNO(EBADF,IoIFP(io)?RMS$_FAC:RMS$_IFI); goto just_say_no; @@ -1041,6 +1043,7 @@ yup: /* Confirmed by INTUIT */ rx->startp[0] = s - truebase; rx->endp[0] = s - truebase + rx->minlen; } + rx->nparens = rx->lastparen = 0; /* used by @- and @+ */ LEAVE_SCOPE(oldsave); RETPUSHYES; @@ -1256,13 +1259,8 @@ Perl_do_readline(pTHX) Perl_warner(aTHX_ WARN_CLOSED, "glob failed (can't start child: %s)", Strerror(errno)); - else { - SV* sv = sv_newmortal(); - gv_efullname3(sv, PL_last_in_gv, Nullch); - Perl_warner(aTHX_ WARN_CLOSED, - "readline() on closed filehandle %s", - SvPV_nolen(sv)); - } + else + report_closed_fh(PL_last_in_gv, io, "readline", "filehandle"); } if (gimme == G_SCALAR) { (void)SvOK_off(TARG); @@ -1310,7 +1308,7 @@ Perl_do_readline(pTHX) if (!do_close(PL_last_in_gv, FALSE) && ckWARN(WARN_CLOSED)) { Perl_warner(aTHX_ WARN_CLOSED, "glob failed (child exited with status %d%s)", - STATUS_CURRENT >> 8, + (int)(STATUS_CURRENT >> 8), (STATUS_CURRENT & 0x80) ? ", core dumped" : ""); } } @@ -2742,7 +2740,7 @@ S_method_common(pTHX_ SV* meth, U32* hashp) !(ob=(SV*)GvIO(iogv))) { if (!packname || - ((*(U8*)packname >= 0xc0 && IN_UTF8) + ((*(U8*)packname >= 0xc0 && DO_UTF8(sv)) ? !isIDFIRST_utf8((U8*)packname) : !isIDFIRST(*packname) )) @@ -1,6 +1,6 @@ /* pp_sys.c * - * Copyright (c) 1991-1999, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -77,7 +77,7 @@ extern "C" int syscall(unsigned long,...); compiling multithreaded and singlethreaded ($ccflags et al). HOST_NOT_FOUND is typically defined in <netdb.h>. */ -#if defined(HOST_NOT_FOUND) && !defined(h_errno) +#if defined(HOST_NOT_FOUND) && !defined(h_errno) && !defined(__CYGWIN__) extern int h_errno; #endif @@ -442,7 +442,7 @@ PP(pp_warn) if (!tmps || !len) tmpsv = sv_2mortal(newSVpvn("Warning: something's wrong", 26)); - Perl_warn(aTHX_ "%_", tmpsv); + Perl_warn(aTHX_ "%"SVf, tmpsv); RETSETYES; } @@ -500,7 +500,7 @@ PP(pp_die) if (!tmps || !len) tmpsv = sv_2mortal(newSVpvn("Died", 4)); - DIE(aTHX_ "%_", tmpsv); + DIE(aTHX_ "%"SVf, tmpsv); } /* I/O. */ @@ -1271,15 +1271,15 @@ PP(pp_leavewrite) fp = IoOFP(io); if (!fp) { if (ckWARN2(WARN_CLOSED,WARN_IO)) { - SV* sv = sv_newmortal(); - gv_efullname3(sv, gv, Nullch); - if (IoIFP(io)) + if (IoIFP(io)) { + SV* sv = sv_newmortal(); + gv_efullname3(sv, gv, Nullch); Perl_warner(aTHX_ WARN_IO, "Filehandle %s opened only for input", SvPV_nolen(sv)); + } else if (ckWARN(WARN_CLOSED)) - Perl_warner(aTHX_ WARN_CLOSED, - "write() on closed filehandle %s", SvPV_nolen(sv)); + report_closed_fh(gv, io, "write", "filehandle"); } PUSHs(&PL_sv_no); } @@ -1352,14 +1352,14 @@ PP(pp_prtf) } else if (!(fp = IoOFP(io))) { if (ckWARN2(WARN_CLOSED,WARN_IO)) { - gv_efullname3(sv, gv, Nullch); - if (IoIFP(io)) + if (IoIFP(io)) { + gv_efullname3(sv, gv, Nullch); Perl_warner(aTHX_ WARN_IO, "Filehandle %s opened only for input", SvPV(sv,n_a)); + } else if (ckWARN(WARN_CLOSED)) - Perl_warner(aTHX_ WARN_CLOSED, - "printf() on closed filehandle %s", SvPV(sv,n_a)); + report_closed_fh(gv, io, "printf", "filehandle"); } SETERRNO(EBADF,IoIFP(io)?RMS$_FAC:RMS$_IFI); goto just_say_no; @@ -1629,9 +1629,9 @@ PP(pp_send) length = -1; if (ckWARN(WARN_CLOSED)) { if (PL_op->op_type == OP_SYSWRITE) - Perl_warner(aTHX_ WARN_CLOSED, "syswrite() on closed filehandle"); + report_closed_fh(gv, io, "syswrite", "filehandle"); else - Perl_warner(aTHX_ WARN_CLOSED, "send() on closed socket"); + report_closed_fh(gv, io, "send", "socket"); } } else if (PL_op->op_type == OP_SYSWRITE) { @@ -1791,7 +1791,11 @@ PP(pp_sysseek) if (gv && (mg = SvTIED_mg((SV*)gv, 'q'))) { PUSHMARK(SP); XPUSHs(SvTIED_obj((SV*)gv, mg)); +#if LSEEKSIZE > IVSIZE + XPUSHs(sv_2mortal(newSVnv((NV) offset))); +#else XPUSHs(sv_2mortal(newSViv((IV) offset))); +#endif XPUSHs(sv_2mortal(newSViv((IV) whence))); PUTBACK; ENTER; @@ -1835,13 +1839,17 @@ PP(pp_truncate) tmpgv = gv_fetchpv(POPpx, FALSE, SVt_PVIO); do_ftruncate: TAINT_PROPER("truncate"); - if (!GvIO(tmpgv) || !IoIFP(GvIOp(tmpgv)) || + if (!GvIO(tmpgv) || !IoIFP(GvIOp(tmpgv))) + result = 0; + else { + PerlIO_flush(IoIFP(GvIOp(tmpgv))); #ifdef HAS_TRUNCATE - ftruncate(PerlIO_fileno(IoIFP(GvIOn(tmpgv))), len) < 0) + if (ftruncate(PerlIO_fileno(IoIFP(GvIOn(tmpgv))), len) < 0) #else - my_chsize(PerlIO_fileno(IoIFP(GvIOn(tmpgv))), len) < 0) + if (my_chsize(PerlIO_fileno(IoIFP(GvIOn(tmpgv))), len) < 0) #endif - result = 0; + result = 0; + } } else { SV *sv = POPs; @@ -1984,8 +1992,12 @@ PP(pp_flock) (void)PerlIO_flush(fp); value = (I32)(PerlLIO_flock(PerlIO_fileno(fp), argtype) >= 0); } - else + else { value = 0; + SETERRNO(EBADF,RMS$_IFI); + if (ckWARN(WARN_CLOSED)) + report_closed_fh(gv, GvIO(gv), "flock", "filehandle"); + } PUSHi(value); RETURN; #else @@ -2138,7 +2150,7 @@ PP(pp_bind) nuts: if (ckWARN(WARN_CLOSED)) - Perl_warner(aTHX_ WARN_CLOSED, "bind() on closed socket"); + report_closed_fh(gv, io, "bind", "socket"); SETERRNO(EBADF,SS$_IVCHAN); RETPUSHUNDEF; #else @@ -2168,7 +2180,7 @@ PP(pp_connect) nuts: if (ckWARN(WARN_CLOSED)) - Perl_warner(aTHX_ WARN_CLOSED, "connect() on closed socket"); + report_closed_fh(gv, io, "connect", "socket"); SETERRNO(EBADF,SS$_IVCHAN); RETPUSHUNDEF; #else @@ -2194,7 +2206,7 @@ PP(pp_listen) nuts: if (ckWARN(WARN_CLOSED)) - Perl_warner(aTHX_ WARN_CLOSED, "listen() on closed socket"); + report_closed_fh(gv, io, "listen", "socket"); SETERRNO(EBADF,SS$_IVCHAN); RETPUSHUNDEF; #else @@ -2248,7 +2260,7 @@ PP(pp_accept) nuts: if (ckWARN(WARN_CLOSED)) - Perl_warner(aTHX_ WARN_CLOSED, "accept() on closed socket"); + report_closed_fh(ggv, ggv ? GvIO(ggv) : 0, "accept", "socket"); SETERRNO(EBADF,SS$_IVCHAN); badexit: @@ -2275,7 +2287,7 @@ PP(pp_shutdown) nuts: if (ckWARN(WARN_CLOSED)) - Perl_warner(aTHX_ WARN_CLOSED, "shutdown() on closed socket"); + report_closed_fh(gv, io, "shutdown", "socket"); SETERRNO(EBADF,SS$_IVCHAN); RETPUSHUNDEF; #else @@ -2354,8 +2366,9 @@ PP(pp_ssockopt) nuts: if (ckWARN(WARN_CLOSED)) - Perl_warner(aTHX_ WARN_CLOSED, "%cetsockopt() on closed socket", - optype == OP_GSOCKOPT ? 'g' : 's'); + report_closed_fh(gv, io, + optype == OP_GSOCKOPT ? "getsockopt" : "setsockopt", + "socket"); SETERRNO(EBADF,SS$_IVCHAN); nuts2: RETPUSHUNDEF; @@ -2428,8 +2441,10 @@ PP(pp_getpeername) nuts: if (ckWARN(WARN_CLOSED)) - Perl_warner(aTHX_ WARN_CLOSED, "get%sname() on closed socket", - optype == OP_GETSOCKNAME ? "sock" : "peer"); + report_closed_fh(gv, io, + optype == OP_GETSOCKNAME ? "getsockname" + : "getpeername", + "socket"); SETERRNO(EBADF,SS$_IVCHAN); nuts2: RETPUSHUNDEF; @@ -99,22 +99,78 @@ PERL_CALLCONV I32 Perl_my_chsize(pTHX_ int fd, Off_t length); PERL_CALLCONV MAGIC* Perl_condpair_magic(pTHX_ SV *sv); #endif 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_croak(pTHX_ const char* pat, ...) __attribute__((noreturn)) +#ifdef CHECK_FORMAT + __attribute__((format(printf,pTHX_1,pTHX_2))) +#endif +; PERL_CALLCONV void Perl_vcroak(pTHX_ const char* pat, va_list* args) __attribute__((noreturn)); #if defined(PERL_IMPLICIT_CONTEXT) -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, ...); +PERL_CALLCONV void Perl_croak_nocontext(const char* pat, ...) __attribute__((noreturn)) +#ifdef CHECK_FORMAT + __attribute__((format(printf,1,2))) +#endif +; +PERL_CALLCONV OP* Perl_die_nocontext(const char* pat, ...) +#ifdef CHECK_FORMAT + __attribute__((format(printf,1,2))) +#endif +; +PERL_CALLCONV void Perl_deb_nocontext(const char* pat, ...) +#ifdef CHECK_FORMAT + __attribute__((format(printf,1,2))) +#endif +; +PERL_CALLCONV char* Perl_form_nocontext(const char* pat, ...) +#ifdef CHECK_FORMAT + __attribute__((format(printf,1,2))) +#endif +; +PERL_CALLCONV SV* Perl_mess_nocontext(const char* pat, ...) +#ifdef CHECK_FORMAT + __attribute__((format(printf,1,2))) +#endif +; +PERL_CALLCONV void Perl_warn_nocontext(const char* pat, ...) +#ifdef CHECK_FORMAT + __attribute__((format(printf,1,2))) +#endif +; +PERL_CALLCONV void Perl_warner_nocontext(U32 err, const char* pat, ...) +#ifdef CHECK_FORMAT + __attribute__((format(printf,2,3))) +#endif +; +PERL_CALLCONV SV* Perl_newSVpvf_nocontext(const char* pat, ...) +#ifdef CHECK_FORMAT + __attribute__((format(printf,1,2))) +#endif +; +PERL_CALLCONV void Perl_sv_catpvf_nocontext(SV* sv, const char* pat, ...) +#ifdef CHECK_FORMAT + __attribute__((format(printf,2,3))) +#endif +; +PERL_CALLCONV void Perl_sv_setpvf_nocontext(SV* sv, const char* pat, ...) +#ifdef CHECK_FORMAT + __attribute__((format(printf,2,3))) +#endif +; +PERL_CALLCONV void Perl_sv_catpvf_mg_nocontext(SV* sv, const char* pat, ...) +#ifdef CHECK_FORMAT + __attribute__((format(printf,2,3))) +#endif +; +PERL_CALLCONV void Perl_sv_setpvf_mg_nocontext(SV* sv, const char* pat, ...) +#ifdef CHECK_FORMAT + __attribute__((format(printf,2,3))) +#endif +; +PERL_CALLCONV int Perl_fprintf_nocontext(PerlIO* stream, const char* fmt, ...) +#ifdef CHECK_FORMAT + __attribute__((format(printf,2,3))) +#endif +; #endif PERL_CALLCONV void Perl_cv_ckproto(pTHX_ CV* cv, GV* gv, char* p); PERL_CALLCONV CV* Perl_cv_clone(pTHX_ CV* proto); @@ -131,7 +187,11 @@ 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_deb(pTHX_ const char* pat, ...) +#ifdef CHECK_FORMAT + __attribute__((format(printf,pTHX_1,pTHX_2))) +#endif +; 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); @@ -139,7 +199,11 @@ 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_die(pTHX_ const char* pat, ...) +#ifdef CHECK_FORMAT + __attribute__((format(printf,pTHX_1,pTHX_2))) +#endif +; 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); @@ -199,7 +263,11 @@ 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_form(pTHX_ const char* pat, ...) +#ifdef CHECK_FORMAT + __attribute__((format(printf,pTHX_1,pTHX_2))) +#endif +; 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); @@ -369,7 +437,11 @@ PERL_CALLCONV void Perl_markstack_grow(pTHX); #if defined(USE_LOCALE_COLLATE) 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_mess(pTHX_ const char* pat, ...) +#ifdef CHECK_FORMAT + __attribute__((format(printf,pTHX_1,pTHX_2))) +#endif +; 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); @@ -456,7 +528,11 @@ 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_newSVpvf(pTHX_ const char* pat, ...) +#ifdef CHECK_FORMAT + __attribute__((format(printf,pTHX_1,pTHX_2))) +#endif +; 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); @@ -620,7 +696,11 @@ 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_catpvf(pTHX_ SV* sv, const char* pat, ...) +#ifdef CHECK_FORMAT + __attribute__((format(printf,pTHX_2,pTHX_3))) +#endif +; 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); @@ -663,7 +743,11 @@ 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_setpvf(pTHX_ SV* sv, const char* pat, ...) +#ifdef CHECK_FORMAT + __attribute__((format(printf,pTHX_2,pTHX_3))) +#endif +; 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); @@ -710,10 +794,19 @@ 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_closed_fh(pTHX_ GV *gv, IO *io, const char *func, const char *obj); PERL_CALLCONV void Perl_report_uninit(pTHX); -PERL_CALLCONV void Perl_warn(pTHX_ const char* pat, ...); +PERL_CALLCONV void Perl_warn(pTHX_ const char* pat, ...) +#ifdef CHECK_FORMAT + __attribute__((format(printf,pTHX_1,pTHX_2))) +#endif +; 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_warner(pTHX_ U32 err, const char* pat, ...) +#ifdef CHECK_FORMAT + __attribute__((format(printf,pTHX_2,pTHX_3))) +#endif +; 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); @@ -743,12 +836,20 @@ 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_catpvf_mg(pTHX_ SV *sv, const char* pat, ...) +#ifdef CHECK_FORMAT + __attribute__((format(printf,pTHX_2,pTHX_3))) +#endif +; 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_setpvf_mg(pTHX_ SV *sv, const char* pat, ...) +#ifdef CHECK_FORMAT + __attribute__((format(printf,pTHX_2,pTHX_3))) +#endif +; 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); @@ -760,7 +861,11 @@ 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_indent(pTHX_ I32 level, PerlIO *file, const char* pat, ...) +#ifdef CHECK_FORMAT + __attribute__((format(printf,pTHX_3,pTHX_4))) +#endif +; 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); @@ -864,6 +969,7 @@ STATIC OP* S_too_few_arguments(pTHX_ OP *o, char* name); STATIC OP* S_too_many_arguments(pTHX_ OP *o, char* name); STATIC void S_op_clear(pTHX_ OP* o); STATIC void S_null(pTHX_ OP* o); +STATIC PADOFFSET S_pad_addlex(pTHX_ SV* name); STATIC PADOFFSET S_pad_findlex(pTHX_ char* name, PADOFFSET newoff, U32 seq, CV* startcv, I32 cx_ix, I32 saweval, U32 flags); STATIC OP* S_newDEFSVOP(pTHX); STATIC OP* S_new_logop(pTHX_ I32 type, I32 flags, OP **firstp, OP **otherp); @@ -69,7 +69,7 @@ * **** Alterations to Henry's code are... **** - **** Copyright (c) 1991-1999, Larry Wall + **** Copyright (c) 1991-2000, Larry Wall **** **** You may distribute under the terms of either the GNU General Public **** License or the Artistic License, as specified in the README file. @@ -1339,8 +1339,9 @@ Perl_pregcomp(pTHX_ char *exp, char *xend, PMOP *pm) if (exp == NULL) FAIL("NULL regexp argument"); - if (PL_curcop == &PL_compiling ? (PL_hints & HINT_UTF8) : IN_UTF8) + if (pm->op_pmdynflags & PMdf_UTF8) { PL_reg_flags |= RF_utf8; + } else PL_reg_flags = 0; @@ -1602,7 +1603,7 @@ Perl_pregcomp(pTHX_ char *exp, char *xend, PMOP *pm) 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", + PerlIO_printf(Perl_debug_log, "synthetic stclass `%s'.\n", SvPVX(sv)))); } @@ -1651,7 +1652,7 @@ Perl_pregcomp(pTHX_ char *exp, char *xend, PMOP *pm) 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", + PerlIO_printf(Perl_debug_log, "synthetic stclass `%s'.\n", SvPVX(sv)))); } } @@ -3372,10 +3373,10 @@ S_regclassutf8(pTHX) if (!SIZE_ONLY) { if (value == 'p') Perl_sv_catpvf(aTHX_ listsv, - "+utf8::%.*s\n", n, PL_regcomp_parse); + "+utf8::%.*s\n", (int)n, PL_regcomp_parse); else Perl_sv_catpvf(aTHX_ listsv, - "!utf8::%.*s\n", n, PL_regcomp_parse); + "!utf8::%.*s\n", (int)n, PL_regcomp_parse); } PL_regcomp_parse = e + 1; lastvalue = OOB_UTF8; @@ -3936,7 +3937,7 @@ Perl_regprop(pTHX_ SV *sv, regnode *o) else if (k == WHILEM && o->flags) /* Ordinal/of */ Perl_sv_catpvf(aTHX_ sv, "[%d/%d]", o->flags & 0xf, o->flags>>4); else if (k == REF || k == OPEN || k == CLOSE || k == GROUPP ) - Perl_sv_catpvf(aTHX_ sv, "%d", ARG(o)); /* Parenth number */ + Perl_sv_catpvf(aTHX_ sv, "%d", (int)ARG(o)); /* Parenth number */ else if (k == LOGICAL) Perl_sv_catpvf(aTHX_ sv, "[%d]", o->flags); /* 2: embedded, otherwise 1 */ else if (k == ANYOF) { @@ -66,7 +66,7 @@ * **** Alterations to Henry's code are... **** - **** Copyright (c) 1991-1999, Larry Wall + **** Copyright (c) 1991-2000, Larry Wall **** **** You may distribute under the terms of either the GNU General Public **** License or the Artistic License, as specified in the README file. @@ -2335,6 +2335,7 @@ S_regmatch(pTHX_ regnode *prog) I32 onpar = PL_regnpar; pm.op_pmflags = 0; + pm.op_pmdynflags = (UTF||DO_UTF8(ret) ? PMdf_UTF8 : 0); re = CALLREGCOMP(aTHX_ t, t + len, &pm); if (!(SvFLAGS(ret) & (SVs_TEMP | SVs_PADTMP | SVf_READONLY))) @@ -1,6 +1,6 @@ /* run.c * - * Copyright (c) 1991-1999, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -1,6 +1,6 @@ /* scope.c * - * Copyright (c) 1991-1999, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -934,6 +934,13 @@ Perl_leave_scope(pTHX_ I32 base) } *(I32*)&PL_hints = (I32)SSPOPINT; break; + case SAVEt_COMPPAD: + PL_comppad = (AV*)SSPOPPTR; + if (PL_comppad) + PL_curpad = AvARRAY(PL_comppad); + else + PL_curpad = Null(SV**); + break; default: Perl_croak(aTHX_ "panic: leave_scope inconsistency"); } @@ -31,6 +31,7 @@ #define SAVEt_DESTRUCTOR_X 30 #define SAVEt_VPTR 31 #define SAVEt_I8 32 +#define SAVEt_COMPPAD 33 #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)) @@ -46,6 +47,24 @@ #define SSPOPDPTR (PL_savestack[--PL_savestack_ix].any_dptr) #define SSPOPDXPTR (PL_savestack[--PL_savestack_ix].any_dxptr) +/* +=for apidoc Ams||SAVETMPS +Opening bracket for temporaries on a callback. See C<FREETMPS> and +L<perlcall>. + +=for apidoc Ams||FREETMPS +Closing bracket for temporaries on a callback. See C<SAVETMPS> and +L<perlcall>. + +=for apidoc Ams||ENTER +Opening bracket on a callback. See C<LEAVE> and L<perlcall>. + +=for apidoc Ams||LEAVE +Closing bracket on a callback. See C<ENTER> and L<perlcall>. + +=cut +*/ + #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() @@ -114,6 +133,19 @@ } \ } STMT_END +#define SAVECOMPPAD() \ + STMT_START { \ + if (PL_comppad && PL_curpad == AvARRAY(PL_comppad)) { \ + SSCHECK(2); \ + SSPUSHPTR((SV*)PL_comppad); \ + SSPUSHINT(SAVEt_COMPPAD); \ + } \ + else { \ + SAVEVPTR(PL_curpad); \ + SAVESPTR(PL_comppad); \ + } \ + } STMT_END + #ifdef USE_ITHREADS # define SAVECOPSTASH(cop) SAVEPPTR(CopSTASHPV(cop)) # define SAVECOPFILE(cop) SAVEPPTR(CopFILE(cop)) @@ -1,6 +1,6 @@ /* sv.c * - * Copyright (c) 1991-1999, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -921,6 +921,15 @@ S_my_safemalloc(MEM_SIZE size) #define new_XPVIO() (void*)my_safemalloc(sizeof(XPVIO)) #define del_XPVIO(p) my_safefree((char*)p) +/* +=for apidoc sv_upgrade + +Upgrade an SV to a more complex form. Use C<SvUPGRADE>. See +C<svtype>. + +=cut +*/ + bool Perl_sv_upgrade(pTHX_ register SV *sv, U32 mt) { @@ -1210,6 +1219,16 @@ Perl_sv_backoff(pTHX_ register SV *sv) return 0; } +/* +=for apidoc sv_grow + +Expands the character buffer in the SV. This will use C<sv_unref> and will +upgrade the SV to C<SVt_PV>. Returns a pointer to the character buffer. +Use C<SvGROW>. + +=cut +*/ + char * Perl_sv_grow(pTHX_ register SV *sv, register STRLEN newlen) { @@ -1259,6 +1278,15 @@ Perl_sv_grow(pTHX_ register SV *sv, register STRLEN newlen) return s; } +/* +=for apidoc sv_setiv + +Copies an integer into the given SV. Does not handle 'set' magic. See +C<sv_setiv_mg>. + +=cut +*/ + void Perl_sv_setiv(pTHX_ register SV *sv, IV i) { @@ -1292,6 +1320,14 @@ Perl_sv_setiv(pTHX_ register SV *sv, IV i) SvTAINT(sv); } +/* +=for apidoc sv_setiv_mg + +Like C<sv_setiv>, but also handles 'set' magic. + +=cut +*/ + void Perl_sv_setiv_mg(pTHX_ register SV *sv, IV i) { @@ -1299,6 +1335,15 @@ Perl_sv_setiv_mg(pTHX_ register SV *sv, IV i) SvSETMAGIC(sv); } +/* +=for apidoc sv_setuv + +Copies an unsigned integer into the given SV. Does not handle 'set' magic. +See C<sv_setuv_mg>. + +=cut +*/ + void Perl_sv_setuv(pTHX_ register SV *sv, UV u) { @@ -1307,6 +1352,14 @@ Perl_sv_setuv(pTHX_ register SV *sv, UV u) SvUVX(sv) = u; } +/* +=for apidoc sv_setuv_mg + +Like C<sv_setuv>, but also handles 'set' magic. + +=cut +*/ + void Perl_sv_setuv_mg(pTHX_ register SV *sv, UV u) { @@ -1314,6 +1367,15 @@ Perl_sv_setuv_mg(pTHX_ register SV *sv, UV u) SvSETMAGIC(sv); } +/* +=for apidoc sv_setnv + +Copies a double into the given SV. Does not handle 'set' magic. See +C<sv_setnv_mg>. + +=cut +*/ + void Perl_sv_setnv(pTHX_ register SV *sv, NV num) { @@ -1346,6 +1408,14 @@ Perl_sv_setnv(pTHX_ register SV *sv, NV num) SvTAINT(sv); } +/* +=for apidoc sv_setnv_mg + +Like C<sv_setnv>, but also handles 'set' magic. + +=cut +*/ + void Perl_sv_setnv_mg(pTHX_ register SV *sv, NV num) { @@ -1872,6 +1942,15 @@ S_asUV(pTHX_ SV *sv) * with a possible addition of IS_NUMBER_NEG. */ +/* +=for apidoc looks_like_number + +Test if an the content of an SV looks like a number (or is a +number). + +=cut +*/ + I32 Perl_looks_like_number(pTHX_ SV *sv) { @@ -2325,6 +2404,17 @@ Perl_sv_2bool(pTHX_ register SV *sv) * as temporary. */ +/* +=for apidoc sv_setsv + +Copies the contents of the source SV C<ssv> into the destination SV C<dsv>. +The source SV may be destroyed if it is mortal. Does not handle 'set' +magic. See the macro forms C<SvSetSV>, C<SvSetSV_nosteal> and +C<sv_setsv_mg>. + +=cut +*/ + void Perl_sv_setsv(pTHX_ SV *dstr, register SV *sstr) { @@ -2679,7 +2769,7 @@ Perl_sv_setsv(pTHX_ SV *dstr, register SV *sstr) *SvEND(dstr) = '\0'; (void)SvPOK_only(dstr); } - if (SvUTF8(sstr)) + if (DO_UTF8(sstr)) SvUTF8_on(dstr); /*SUPPRESS 560*/ if (sflags & SVp_NOK) { @@ -2721,6 +2811,14 @@ Perl_sv_setsv(pTHX_ SV *dstr, register SV *sstr) SvTAINT(dstr); } +/* +=for apidoc sv_setsv_mg + +Like C<sv_setsv>, but also handles 'set' magic. + +=cut +*/ + void Perl_sv_setsv_mg(pTHX_ SV *dstr, register SV *sstr) { @@ -2728,6 +2826,15 @@ Perl_sv_setsv_mg(pTHX_ SV *dstr, register SV *sstr) SvSETMAGIC(dstr); } +/* +=for apidoc sv_setpvn + +Copies a string into an SV. The C<len> parameter indicates the number of +bytes to be copied. Does not handle 'set' magic. See C<sv_setpvn_mg>. + +=cut +*/ + void Perl_sv_setpvn(pTHX_ register SV *sv, register const char *ptr, register STRLEN len) { @@ -2750,6 +2857,14 @@ Perl_sv_setpvn(pTHX_ register SV *sv, register const char *ptr, register STRLEN SvTAINT(sv); } +/* +=for apidoc sv_setpvn_mg + +Like C<sv_setpvn>, but also handles 'set' magic. + +=cut +*/ + void Perl_sv_setpvn_mg(pTHX_ register SV *sv, register const char *ptr, register STRLEN len) { @@ -2757,6 +2872,15 @@ Perl_sv_setpvn_mg(pTHX_ register SV *sv, register const char *ptr, register STRL SvSETMAGIC(sv); } +/* +=for apidoc sv_setpv + +Copies a string into an SV. The string must be null-terminated. Does not +handle 'set' magic. See C<sv_setpv_mg>. + +=cut +*/ + void Perl_sv_setpv(pTHX_ register SV *sv, register const char *ptr) { @@ -2777,6 +2901,14 @@ Perl_sv_setpv(pTHX_ register SV *sv, register const char *ptr) SvTAINT(sv); } +/* +=for apidoc sv_setpv_mg + +Like C<sv_setpv>, but also handles 'set' magic. + +=cut +*/ + void Perl_sv_setpv_mg(pTHX_ register SV *sv, register const char *ptr) { @@ -2784,6 +2916,20 @@ Perl_sv_setpv_mg(pTHX_ register SV *sv, register const char *ptr) SvSETMAGIC(sv); } +/* +=for apidoc sv_usepvn + +Tells an SV to use C<ptr> to find its string value. Normally the string is +stored inside the SV but sv_usepvn allows the SV to use an outside string. +The C<ptr> should point to memory that was allocated by C<malloc>. The +string length, C<len>, must be supplied. This function will realloc the +memory pointed to by C<ptr>, so that pointer should not be freed or used by +the programmer after giving it to sv_usepvn. Does not handle 'set' magic. +See C<sv_usepvn_mg>. + +=cut +*/ + void Perl_sv_usepvn(pTHX_ register SV *sv, register char *ptr, register STRLEN len) { @@ -2805,6 +2951,14 @@ Perl_sv_usepvn(pTHX_ register SV *sv, register char *ptr, register STRLEN len) SvTAINT(sv); } +/* +=for apidoc sv_usepvn_mg + +Like C<sv_usepvn>, but also handles 'set' magic. + +=cut +*/ + void Perl_sv_usepvn_mg(pTHX_ register SV *sv, register char *ptr, register STRLEN len) { @@ -2826,6 +2980,17 @@ Perl_sv_force_normal(pTHX_ register SV *sv) sv_unglob(sv); } +/* +=for apidoc sv_chop + +Efficient removal of characters from the beginning of the string buffer. +SvPOK(sv) must be true and the C<ptr> must be a pointer to somewhere inside +the string buffer. The C<ptr> becomes the first character of the adjusted +string. + +=cut +*/ + void Perl_sv_chop(pTHX_ register SV *sv, register char *ptr) /* like set but assuming ptr is in sv */ @@ -2858,6 +3023,16 @@ Perl_sv_chop(pTHX_ register SV *sv, register char *ptr) /* like set but assuming SvIVX(sv) += delta; } +/* +=for apidoc sv_catpvn + +Concatenates the string onto the end of the string which is in the SV. The +C<len> indicates number of bytes to copy. Handles 'get' magic, but not +'set' magic. See C<sv_catpvn_mg>. + +=cut +*/ + void Perl_sv_catpvn(pTHX_ register SV *sv, register const char *ptr, register STRLEN len) { @@ -2871,10 +3046,18 @@ Perl_sv_catpvn(pTHX_ register SV *sv, register const char *ptr, register STRLEN Move(ptr,SvPVX(sv)+tlen,len,char); SvCUR(sv) += len; *SvEND(sv) = '\0'; - (void)SvPOK_only(sv); /* validate pointer */ + (void)SvPOK_only_UTF8(sv); /* validate pointer */ SvTAINT(sv); } +/* +=for apidoc sv_catpvn_mg + +Like C<sv_catpvn>, but also handles 'set' magic. + +=cut +*/ + void Perl_sv_catpvn_mg(pTHX_ register SV *sv, register const char *ptr, register STRLEN len) { @@ -2882,6 +3065,15 @@ Perl_sv_catpvn_mg(pTHX_ register SV *sv, register const char *ptr, register STRL SvSETMAGIC(sv); } +/* +=for apidoc sv_catsv + +Concatenates the string from SV C<ssv> onto the end of the string in SV +C<dsv>. Handles 'get' magic, but not 'set' magic. See C<sv_catsv_mg>. + +=cut +*/ + void Perl_sv_catsv(pTHX_ SV *dstr, register SV *sstr) { @@ -2891,8 +3083,18 @@ Perl_sv_catsv(pTHX_ SV *dstr, register SV *sstr) return; if (s = SvPV(sstr, len)) sv_catpvn(dstr,s,len); + if (SvUTF8(sstr)) + SvUTF8_on(dstr); } +/* +=for apidoc sv_catsv_mg + +Like C<sv_catsv>, but also handles 'set' magic. + +=cut +*/ + void Perl_sv_catsv_mg(pTHX_ SV *dstr, register SV *sstr) { @@ -2900,6 +3102,15 @@ Perl_sv_catsv_mg(pTHX_ SV *dstr, register SV *sstr) SvSETMAGIC(dstr); } +/* +=for apidoc sv_catpv + +Concatenates the string onto the end of the string which is in the SV. +Handles 'get' magic, but not 'set' magic. See C<sv_catpv_mg>. + +=cut +*/ + void Perl_sv_catpv(pTHX_ register SV *sv, register const char *ptr) { @@ -2916,10 +3127,18 @@ Perl_sv_catpv(pTHX_ register SV *sv, register const char *ptr) ptr = SvPVX(sv); Move(ptr,SvPVX(sv)+tlen,len+1,char); SvCUR(sv) += len; - (void)SvPOK_only(sv); /* validate pointer */ + (void)SvPOK_only_UTF8(sv); /* validate pointer */ SvTAINT(sv); } +/* +=for apidoc sv_catpv_mg + +Like C<sv_catpv>, but also handles 'set' magic. + +=cut +*/ + void Perl_sv_catpv_mg(pTHX_ register SV *sv, register const char *ptr) { @@ -2942,6 +3161,14 @@ Perl_newSV(pTHX_ STRLEN len) /* name is assumed to contain an SV* if (name && namelen == HEf_SVKEY) */ +/* +=for apidoc sv_magic + +Adds magic to an SV. + +=cut +*/ + void Perl_sv_magic(pTHX_ register SV *sv, SV *obj, int how, const char *name, I32 namlen) { @@ -3190,6 +3417,15 @@ S_sv_del_backref(pTHX_ SV *sv) } } +/* +=for apidoc sv_insert + +Inserts a string at the specified offset/length within the SV. Similar to +the Perl substr() function. + +=cut +*/ + void Perl_sv_insert(pTHX_ SV *bigstr, STRLEN offset, STRLEN len, char *little, STRLEN littlelen) { @@ -3540,6 +3776,14 @@ Perl_sv_free(pTHX_ SV *sv) del_SV(sv); } +/* +=for apidoc sv_len + +Returns the length of the string in the SV. See also C<SvCUR>. + +=cut +*/ + STRLEN Perl_sv_len(pTHX_ register SV *sv) { @@ -3641,6 +3885,15 @@ Perl_sv_pos_b2u(pTHX_ register SV *sv, I32* offsetp) return; } +/* +=for apidoc sv_eq + +Returns a boolean indicating whether the strings in the two SVs are +identical. + +=cut +*/ + I32 Perl_sv_eq(pTHX_ register SV *str1, register SV *str2) { @@ -3667,6 +3920,16 @@ Perl_sv_eq(pTHX_ register SV *str1, register SV *str2) return memEQ(pv1, pv2, cur1); } +/* +=for apidoc sv_cmp + +Compares the strings in two SVs. Returns -1, 0, or 1 indicating whether the +string in C<sv1> is less than, equal to, or greater than the string in +C<sv2>. + +=cut +*/ + I32 Perl_sv_cmp(pTHX_ register SV *str1, register SV *str2) { @@ -4063,6 +4326,14 @@ screamer2: } +/* +=for apidoc sv_inc + +Auto-increment of the value in the SV. + +=cut +*/ + void Perl_sv_inc(pTHX_ register SV *sv) { @@ -4164,6 +4435,14 @@ Perl_sv_inc(pTHX_ register SV *sv) *d = d[1]; } +/* +=for apidoc sv_dec + +Auto-decrement of the value in the SV. + +=cut +*/ + void Perl_sv_dec(pTHX_ register SV *sv) { @@ -4224,6 +4503,15 @@ Perl_sv_dec(pTHX_ register SV *sv) sv_setnv(sv,Atof(SvPVX(sv)) - 1.0); /* punt */ } +/* +=for apidoc sv_mortalcopy + +Creates a new SV which is a copy of the original SV. The new SV is marked +as mortal. + +=cut +*/ + /* Make a string that will exist for the duration of the expression * evaluation. Actually, it may have to last longer than that, but * hopefully we won't free it until it has been assigned to a @@ -4243,6 +4531,14 @@ Perl_sv_mortalcopy(pTHX_ SV *oldstr) return sv; } +/* +=for apidoc sv_newmortal + +Creates a new SV which is mortal. The reference count of the SV is set to 1. + +=cut +*/ + SV * Perl_sv_newmortal(pTHX) { @@ -4256,6 +4552,15 @@ Perl_sv_newmortal(pTHX) return sv; } +/* +=for apidoc sv_2mortal + +Marks an SV as mortal. The SV will be destroyed when the current context +ends. + +=cut +*/ + /* same thing without the copying */ SV * @@ -4272,6 +4577,16 @@ Perl_sv_2mortal(pTHX_ register SV *sv) return sv; } +/* +=for apidoc newSVpv + +Creates a new SV and copies a string into it. The reference count for the +SV is set to 1. If C<len> is zero, Perl will compute the length using +strlen(). For efficiency, consider using C<newSVpvn> instead. + +=cut +*/ + SV * Perl_newSVpv(pTHX_ const char *s, STRLEN len) { @@ -4284,6 +4599,17 @@ Perl_newSVpv(pTHX_ const char *s, STRLEN len) return sv; } +/* +=for apidoc newSVpvn + +Creates a new SV and copies a string into it. The reference count for the +SV is set to 1. Note that if C<len> is zero, Perl will create a zero length +string. You are responsible for ensuring that the source string is at least +C<len> bytes long. + +=cut +*/ + SV * Perl_newSVpvn(pTHX_ const char *s, STRLEN len) { @@ -4308,6 +4634,15 @@ Perl_newSVpvf_nocontext(const char* pat, ...) } #endif +/* +=for apidoc newSVpvf + +Creates a new SV an initialize it with the string formatted like +C<sprintf>. + +=cut +*/ + SV * Perl_newSVpvf(pTHX_ const char* pat, ...) { @@ -4328,6 +4663,15 @@ Perl_vnewSVpvf(pTHX_ const char* pat, va_list* args) return sv; } +/* +=for apidoc newSVnv + +Creates a new SV and copies a floating point value into it. +The reference count for the SV is set to 1. + +=cut +*/ + SV * Perl_newSVnv(pTHX_ NV n) { @@ -4338,6 +4682,15 @@ Perl_newSVnv(pTHX_ NV n) return sv; } +/* +=for apidoc newSViv + +Creates a new SV and copies an integer into it. The reference count for the +SV is set to 1. + +=cut +*/ + SV * Perl_newSViv(pTHX_ IV i) { @@ -4348,6 +4701,15 @@ Perl_newSViv(pTHX_ IV i) return sv; } +/* +=for apidoc newRV_noinc + +Creates an RV wrapper for an SV. The reference count for the original +SV is B<not> incremented. + +=cut +*/ + SV * Perl_newRV_noinc(pTHX_ SV *tmpRef) { @@ -4362,12 +4724,21 @@ Perl_newRV_noinc(pTHX_ SV *tmpRef) return sv; } +/* newRV_inc is #defined to newRV in sv.h */ SV * Perl_newRV(pTHX_ SV *tmpRef) { return newRV_noinc(SvREFCNT_inc(tmpRef)); } +/* +=for apidoc newSVsv + +Creates a new SV which is an exact duplicate of the original SV. + +=cut +*/ + /* make an exact duplicate of old */ SV * @@ -4582,8 +4953,7 @@ Perl_sv_true(pTHX_ register SV *sv) if (SvPOK(sv)) { register XPV* tXpv; if ((tXpv = (XPV*)SvANY(sv)) && - (*tXpv->xpv_pv > '0' || - tXpv->xpv_cur > 1 || + (tXpv->xpv_cur > 1 || (tXpv->xpv_cur && *tXpv->xpv_pv != '0'))) return 1; else @@ -4759,6 +5129,16 @@ Perl_sv_reftype(pTHX_ SV *sv, int ob) } } +/* +=for apidoc sv_isobject + +Returns a boolean indicating whether the SV is an RV pointing to a blessed +object. If the SV is not an RV, or if the object is not blessed, then this +will return false. + +=cut +*/ + int Perl_sv_isobject(pTHX_ SV *sv) { @@ -4774,6 +5154,16 @@ Perl_sv_isobject(pTHX_ SV *sv) return 1; } +/* +=for apidoc sv_isa + +Returns a boolean indicating whether the SV is blessed into the specified +class. This does not check for subtypes; use C<sv_derived_from> to verify +an inheritance relationship. + +=cut +*/ + int Perl_sv_isa(pTHX_ SV *sv, const char *name) { @@ -4790,6 +5180,17 @@ Perl_sv_isa(pTHX_ SV *sv, const char *name) return strEQ(HvNAME(SvSTASH(sv)), name); } +/* +=for apidoc newSVrv + +Creates a new SV for the RV, C<rv>, to point to. If C<rv> is not an RV then +it will be upgraded to one. If C<classname> is non-null then the new SV will +be blessed in the specified package. The new SV is returned and its +reference count is 1. + +=cut +*/ + SV* Perl_newSVrv(pTHX_ SV *rv, const char *classname) { @@ -4815,6 +5216,24 @@ Perl_newSVrv(pTHX_ SV *rv, const char *classname) return sv; } +/* +=for apidoc sv_setref_pv + +Copies a pointer into a new SV, optionally blessing the SV. The C<rv> +argument will be upgraded to an RV. That RV will be modified to point to +the new SV. If the C<pv> argument is NULL then C<PL_sv_undef> will be placed +into the SV. The C<classname> argument indicates the package for the +blessing. Set C<classname> to C<Nullch> to avoid the blessing. The new SV +will be returned and will have a reference count of 1. + +Do not use with other Perl types such as HV, AV, SV, CV, because those +objects will become corrupted by the pointer copy process. + +Note that C<sv_setref_pvn> copies the string while this copies the pointer. + +=cut +*/ + SV* Perl_sv_setref_pv(pTHX_ SV *rv, const char *classname, void *pv) { @@ -4827,6 +5246,18 @@ Perl_sv_setref_pv(pTHX_ SV *rv, const char *classname, void *pv) return rv; } +/* +=for apidoc sv_setref_iv + +Copies an integer into a new SV, optionally blessing the SV. The C<rv> +argument will be upgraded to an RV. That RV will be modified to point to +the new SV. The C<classname> argument indicates the package for the +blessing. Set C<classname> to C<Nullch> to avoid the blessing. The new SV +will be returned and will have a reference count of 1. + +=cut +*/ + SV* Perl_sv_setref_iv(pTHX_ SV *rv, const char *classname, IV iv) { @@ -4834,6 +5265,18 @@ Perl_sv_setref_iv(pTHX_ SV *rv, const char *classname, IV iv) return rv; } +/* +=for apidoc sv_setref_nv + +Copies a double into a new SV, optionally blessing the SV. The C<rv> +argument will be upgraded to an RV. That RV will be modified to point to +the new SV. The C<classname> argument indicates the package for the +blessing. Set C<classname> to C<Nullch> to avoid the blessing. The new SV +will be returned and will have a reference count of 1. + +=cut +*/ + SV* Perl_sv_setref_nv(pTHX_ SV *rv, const char *classname, NV nv) { @@ -4841,6 +5284,21 @@ Perl_sv_setref_nv(pTHX_ SV *rv, const char *classname, NV nv) return rv; } +/* +=for apidoc sv_setref_pvn + +Copies a string into a new SV, optionally blessing the SV. The length of the +string must be specified with C<n>. The C<rv> argument will be upgraded to +an RV. That RV will be modified to point to the new SV. The C<classname> +argument indicates the package for the blessing. Set C<classname> to +C<Nullch> to avoid the blessing. The new SV will be returned and will have +a reference count of 1. + +Note that C<sv_setref_pv> copies the pointer while this copies the string. + +=cut +*/ + SV* Perl_sv_setref_pvn(pTHX_ SV *rv, const char *classname, char *pv, STRLEN n) { @@ -4848,6 +5306,16 @@ Perl_sv_setref_pvn(pTHX_ SV *rv, const char *classname, char *pv, STRLEN n) return rv; } +/* +=for apidoc sv_bless + +Blesses an SV into a specified package. The SV must be an RV. The package +must be designated by its stash (see C<gv_stashpv()>). The reference count +of the SV is unaffected. + +=cut +*/ + SV* Perl_sv_bless(pTHX_ SV *sv, HV *stash) { @@ -4897,6 +5365,16 @@ S_sv_unglob(pTHX_ SV *sv) SvFLAGS(sv) |= SVt_PVMG; } +/* +=for apidoc sv_unref + +Unsets the RV status of the SV, and decrements the reference count of +whatever was being referenced by the RV. This can almost be thought of +as a reversal of C<newSVrv>. See C<SvROK_off>. + +=cut +*/ + void Perl_sv_unref(pTHX_ SV *sv) { @@ -4943,6 +5421,15 @@ Perl_sv_tainted(pTHX_ SV *sv) return FALSE; } +/* +=for apidoc sv_setpviv + +Copies an integer into the given SV, also updating its string value. +Does not handle 'set' magic. See C<sv_setpviv_mg>. + +=cut +*/ + void Perl_sv_setpviv(pTHX_ SV *sv, IV iv) { @@ -4954,6 +5441,14 @@ Perl_sv_setpviv(pTHX_ SV *sv, IV iv) } +/* +=for apidoc sv_setpviv_mg + +Like C<sv_setpviv>, but also handles 'set' magic. + +=cut +*/ + void Perl_sv_setpviv_mg(pTHX_ SV *sv, IV iv) { @@ -4988,6 +5483,15 @@ Perl_sv_setpvf_mg_nocontext(SV *sv, const char* pat, ...) } #endif +/* +=for apidoc sv_setpvf + +Processes its arguments like C<sprintf> and sets an SV to the formatted +output. Does not handle 'set' magic. See C<sv_setpvf_mg>. + +=cut +*/ + void Perl_sv_setpvf(pTHX_ SV *sv, const char* pat, ...) { @@ -5003,6 +5507,14 @@ Perl_sv_vsetpvf(pTHX_ SV *sv, const char* pat, va_list* args) sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); } +/* +=for apidoc sv_setpvf_mg + +Like C<sv_setpvf>, but also handles 'set' magic. + +=cut +*/ + void Perl_sv_setpvf_mg(pTHX_ SV *sv, const char* pat, ...) { @@ -5041,6 +5553,16 @@ Perl_sv_catpvf_mg_nocontext(SV *sv, const char* pat, ...) } #endif +/* +=for apidoc sv_catpvf + +Processes its arguments like C<sprintf> and appends the formatted output +to an SV. Handles 'get' magic, but not 'set' magic. C<SvSETMAGIC()> must +typically be called after calling this function to handle 'set' magic. + +=cut +*/ + void Perl_sv_catpvf(pTHX_ SV *sv, const char* pat, ...) { @@ -5056,6 +5578,14 @@ Perl_sv_vcatpvf(pTHX_ SV *sv, const char* pat, va_list* args) sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); } +/* +=for apidoc sv_catpvf_mg + +Like C<sv_catpvf>, but also handles 'set' magic. + +=cut +*/ + void Perl_sv_catpvf_mg(pTHX_ SV *sv, const char* pat, ...) { @@ -5072,6 +5602,15 @@ Perl_sv_vcatpvf_mg(pTHX_ SV *sv, const char* pat, va_list* args) SvSETMAGIC(sv); } +/* +=for apidoc sv_vsetpvfn + +Works like C<vcatpvfn> but copies the text into the SV instead of +appending it. + +=cut +*/ + void Perl_sv_vsetpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV **svargs, I32 svmax, bool *maybe_tainted) { @@ -5079,6 +5618,18 @@ Perl_sv_vsetpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV sv_vcatpvfn(sv, pat, patlen, args, svargs, svmax, maybe_tainted); } +/* +=for apidoc sv_vcatpvfn + +Processes its arguments like C<vsprintf> and appends the formatted output +to an SV. Uses an array of SVs if the C style variable argument list is +missing (NULL). When running with taint checks enabled, indicates via +C<maybe_tainted> if results are untrustworthy (often due to the use of +locales). + +=cut +*/ + void Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV **svargs, I32 svmax, bool *maybe_tainted) { @@ -5089,6 +5640,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV STRLEN origlen; I32 svix = 0; static char nullstr[] = "(null)"; + SV *argsv; /* no matter what, this is a string now */ (void)SvPV_force(sv, origlen); @@ -5103,12 +5655,18 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV char *s = va_arg(*args, char*); sv_catpv(sv, s ? s : nullstr); } - else if (svix < svmax) + else if (svix < svmax) { sv_catsv(sv, *svargs); + if (DO_UTF8(*svargs)) + SvUTF8_on(sv); + } return; case '_': if (args) { - sv_catsv(sv, va_arg(*args, SV*)); + argsv = va_arg(*args, SV*); + sv_catsv(sv, argsv); + if (DO_UTF8(argsv)) + SvUTF8_on(sv); return; } /* See comment on '_' below */ @@ -5127,6 +5685,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV STRLEN zeros = 0; bool has_precis = FALSE; STRLEN precis = 0; + bool is_utf = FALSE; char esignbuf[4]; U8 utf8buf[10]; @@ -5267,22 +5826,20 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV goto string; case 'c': - if (IN_UTF8) { - if (args) - uv = va_arg(*args, int); - else - uv = (svix < svmax) ? SvIVx(svargs[svix++]) : 0; - + if (args) + uv = va_arg(*args, int); + else + uv = (svix < svmax) ? SvIVx(svargs[svix++]) : 0; + if ((uv > 255 || (uv > 127 && SvUTF8(sv))) && !IN_BYTE) { eptr = (char*)utf8buf; elen = uv_to_utf8((U8*)eptr, uv) - utf8buf; - goto string; + is_utf = TRUE; + } + else { + c = (char)uv; + eptr = &c; + elen = 1; } - if (args) - c = va_arg(*args, int); - else - c = (svix < svmax) ? SvIVx(svargs[svix++]) : 0; - eptr = &c; - elen = 1; goto string; case 's': @@ -5302,17 +5859,76 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV } } else if (svix < svmax) { - eptr = SvPVx(svargs[svix++], elen); - if (IN_UTF8) { + argsv = svargs[svix++]; + eptr = SvPVx(argsv, elen); + if (DO_UTF8(argsv)) { if (has_precis && precis < elen) { I32 p = precis; - sv_pos_u2b(svargs[svix - 1], &p, 0); /* sticks at end */ + sv_pos_u2b(argsv, &p, 0); /* sticks at end */ precis = p; } if (width) { /* fudge width (can't fudge elen) */ - width += elen - sv_len_utf8(svargs[svix - 1]); + width += elen - sv_len_utf8(argsv); + } + is_utf = TRUE; + } + } + goto string; + + case 'v': + if (args) + argsv = va_arg(*args, SV*); + else if (svix < svmax) + argsv = svargs[svix++]; + { + STRLEN len; + U8 *str = (U8*)SvPVx(argsv,len); + I32 vlen = len*3+1; + SV *vsv = NEWSV(73,vlen); + I32 ulen; + I32 vfree = vlen; + U8 *vptr = (U8*)SvPVX(vsv); + STRLEN vcur = 0; + bool utf = DO_UTF8(argsv); + + if (utf) + is_utf = TRUE; + while (len) { + UV uv; + + if (utf) + uv = utf8_to_uv(str, &ulen); + else { + uv = *str; + ulen = 1; } + str += ulen; + len -= ulen; + eptr = ebuf + sizeof ebuf; + do { + *--eptr = '0' + uv % 10; + } while (uv /= 10); + elen = (ebuf + sizeof ebuf) - eptr; + while (elen >= vfree-1) { + STRLEN off = vptr - (U8*)SvPVX(vsv); + vfree += vlen; + vlen *= 2; + SvGROW(vsv, vlen); + vptr = (U8*)SvPVX(vsv) + off; + } + memcpy(vptr, eptr, elen); + vptr += elen; + *vptr++ = '.'; + vfree -= elen + 1; + vcur += elen + 1; + } + if (vcur) { + vcur--; + vptr[-1] = '\0'; } + SvCUR_set(vsv,vcur); + eptr = SvPVX(vsv); + elen = vcur; } goto string; @@ -5324,7 +5940,10 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV */ if (!args) goto unknown; - eptr = SvPVx(va_arg(*args, SV*), elen); + argsv = va_arg(*args,SV*); + eptr = SvPVx(argsv, elen); + if (DO_UTF8(argsv)) + is_utf = TRUE; string: if (has_precis && elen > precis) @@ -5618,7 +6237,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV (UV)c & 0xFF); } else sv_catpv(msg, "end of string"); - Perl_warner(aTHX_ WARN_PRINTF, "%_", msg); /* yes, this is reentrant */ + Perl_warner(aTHX_ WARN_PRINTF, "%"SVf, msg); /* yes, this is reentrant */ } /* output mangled stuff ... */ @@ -5667,6 +6286,8 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV memset(p, ' ', gap); p += gap; } + if (is_utf) + SvUTF8_on(sv); *p = '\0'; SvCUR(sv) = p - SvPVX(sv); } @@ -5834,7 +6455,7 @@ void * Perl_ptr_table_fetch(pTHX_ PTR_TBL_t *tbl, void *sv) { PTR_TBL_ENT_t *tblent; - UV hash = (UV)sv; + UV hash = PTR2UV(sv); assert(tbl); tblent = tbl->tbl_ary[hash & tbl->tbl_max]; for (; tblent; tblent = tblent->next) { @@ -5851,7 +6472,7 @@ Perl_ptr_table_store(pTHX_ PTR_TBL_t *tbl, void *oldv, void *newv) /* 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; + UV hash = PTR2UV(oldv); bool i = 1; assert(tbl); @@ -5891,7 +6512,7 @@ Perl_ptr_table_split(pTHX_ PTR_TBL_t *tbl) continue; curentp = ary + oldsize; for (entp = ary, ent = *ary; ent; ent = *entp) { - if ((newsize & (UV)ent->oldval) != i) { + if ((newsize & PTR2UV(ent->oldval)) != i) { *entp = ent->next; ent->next = *curentp; *curentp = ent; @@ -6585,6 +7206,10 @@ Perl_ss_dup(pTHX_ PerlInterpreter *proto_perl) i = POPINT(ss,ix); TOPINT(nss,ix) = i; break; + case SAVEt_COMPPAD: + av = (AV*)POPPTR(ss,ix); + TOPPTR(nss,ix) = av_dup(av); + break; default: Perl_croak(aTHX_ "panic: ss_dup inconsistency"); } @@ -6833,7 +7458,7 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags, 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_checkav = av_dup_inc(proto_perl->Icheckav); PL_initav = av_dup_inc(proto_perl->Iinitav); PL_sub_generation = proto_perl->Isub_generation; @@ -1,6 +1,6 @@ /* sv.h * - * Copyright (c) 1991-1999, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -11,6 +11,35 @@ #undef sv_flags /* Convex has this in <signal.h> for sigvec() */ #endif +/* +=for apidoc AmU||svtype +An enum of flags for Perl types. These are found in the file B<sv.h> +in the C<svtype> enum. Test these flags with the C<SvTYPE> macro. + +=for apidoc AmU||SVt_PV +Pointer type flag for scalars. See C<svtype>. + +=for apidoc AmU||SVt_IV +Integer type flag for scalars. See C<svtype>. + +=for apidoc AmU||SVt_NV +Double type flag for scalars. See C<svtype>. + +=for apidoc AmU||SVt_PVMG +Type flag for blessed scalars. See C<svtype>. + +=for apidoc AmU||SVt_PVAV +Type flag for arrays. See C<svtype>. + +=for apidoc AmU||SVt_PVHV +Type flag for hashes. See C<svtype>. + +=for apidoc AmU||SVt_PVCV +Type flag for code refs. See C<svtype>. + +=cut +*/ + typedef enum { SVt_NULL, /* 0 */ SVt_IV, /* 1 */ @@ -68,6 +97,26 @@ struct io { U32 sv_flags; /* what we are */ }; +/* +=for apidoc Am|U32|SvREFCNT|SV* sv +Returns the value of the object's reference count. + +=for apidoc Am|SV*|SvREFCNT_inc|SV* sv +Increments the reference count of the given SV. + +=for apidoc Am|void|SvREFCNT_dec|SV* sv +Decrements the reference count of the given SV. + +=for apidoc Am|svtype|SvTYPE|SV* sv +Returns the type of the SV. See C<svtype>. + +=for apidoc Am|void|SvUPGRADE|SV* sv|svtype type +Used to upgrade an SV to a more complex form. Uses C<sv_upgrade> to +perform the upgrade if necessary. See C<svtype>. + +=cut +*/ + #define SvANY(sv) (sv)->sv_any #define SvFLAGS(sv) (sv)->sv_flags #define SvREFCNT(sv) (sv)->sv_refcnt @@ -330,6 +379,123 @@ struct xpvio { /* The following macros define implementation-independent predicates on SVs. */ +/* +=for apidoc Am|bool|SvNIOK|SV* sv +Returns a boolean indicating whether the SV contains a number, integer or +double. + +=for apidoc Am|bool|SvNIOKp|SV* sv +Returns a boolean indicating whether the SV contains a number, integer or +double. Checks the B<private> setting. Use C<SvNIOK>. + +=for apidoc Am|void|SvNIOK_off|SV* sv +Unsets the NV/IV status of an SV. + +=for apidoc Am|bool|SvOK|SV* sv +Returns a boolean indicating whether the value is an SV. + +=for apidoc Am|bool|SvIOKp|SV* sv +Returns a boolean indicating whether the SV contains an integer. Checks +the B<private> setting. Use C<SvIOK>. + +=for apidoc Am|bool|SvNOKp|SV* sv +Returns a boolean indicating whether the SV contains a double. Checks the +B<private> setting. Use C<SvNOK>. + +=for apidoc Am|bool|SvPOKp|SV* sv +Returns a boolean indicating whether the SV contains a character string. +Checks the B<private> setting. Use C<SvPOK>. + +=for apidoc Am|bool|SvIOK|SV* sv +Returns a boolean indicating whether the SV contains an integer. + +=for apidoc Am|void|SvIOK_on|SV* sv +Tells an SV that it is an integer. + +=for apidoc Am|void|SvIOK_off|SV* sv +Unsets the IV status of an SV. + +=for apidoc Am|void|SvIOK_only|SV* sv +Tells an SV that it is an integer and disables all other OK bits. + +=for apidoc Am|bool|SvNOK|SV* sv +Returns a boolean indicating whether the SV contains a double. + +=for apidoc Am|void|SvNOK_on|SV* sv +Tells an SV that it is a double. + +=for apidoc Am|void|SvNOK_off|SV* sv +Unsets the NV status of an SV. + +=for apidoc Am|void|SvNOK_only|SV* sv +Tells an SV that it is a double and disables all other OK bits. + +=for apidoc Am|bool|SvPOK|SV* sv +Returns a boolean indicating whether the SV contains a character +string. + +=for apidoc Am|void|SvPOK_on|SV* sv +Tells an SV that it is a string. + +=for apidoc Am|void|SvPOK_off|SV* sv +Unsets the PV status of an SV. + +=for apidoc Am|void|SvPOK_only|SV* sv +Tells an SV that it is a string and disables all other OK bits. + +=for apidoc Am|bool|SvOOK|SV* sv +Returns a boolean indicating whether the SvIVX is a valid offset value for +the SvPVX. This hack is used internally to speed up removal of characters +from the beginning of a SvPV. When SvOOK is true, then the start of the +allocated string buffer is really (SvPVX - SvIVX). + +=for apidoc Am|bool|SvROK|SV* sv +Tests if the SV is an RV. + +=for apidoc Am|void|SvROK_on|SV* sv +Tells an SV that it is an RV. + +=for apidoc Am|void|SvROK_off|SV* sv +Unsets the RV status of an SV. + +=for apidoc Am|SV*|SvRV|SV* sv +Dereferences an RV to return the SV. + +=for apidoc Am|IV|SvIVX|SV* sv +Returns the integer which is stored in the SV, assuming SvIOK is +true. + +=for apidoc Am|UV|SvUVX|SV* sv +Returns the unsigned integer which is stored in the SV, assuming SvIOK is +true. + +=for apidoc Am|NV|SvNVX|SV* sv +Returns the double which is stored in the SV, assuming SvNOK is +true. + +=for apidoc Am|char*|SvPVX|SV* sv +Returns a pointer to the string in the SV. The SV must contain a +string. + +=for apidoc Am|STRLEN|SvCUR|SV* sv +Returns the length of the string which is in the SV. See C<SvLEN>. + +=for apidoc Am|STRLEN|SvLEN|SV* sv +Returns the size of the string buffer in the SV. See C<SvCUR>. + +=for apidoc Am|char*|SvEND|SV* sv +Returns a pointer to the last character in the string which is in the SV. +See C<SvCUR>. Access the character as *(SvEND(sv)). + +=for apidoc Am|HV*|SvSTASH|SV* sv +Returns the stash of the SV. + +=for apidoc Am|void|SvCUR_set|SV* sv|STRLEN len +Set the length of the string which is in the SV. See C<SvCUR>. + +=cut +*/ + #define SvNIOK(sv) (SvFLAGS(sv) & (SVf_IOK|SVf_NOK)) #define SvNIOKp(sv) (SvFLAGS(sv) & (SVp_IOK|SVp_NOK)) #define SvNIOK_off(sv) (SvFLAGS(sv) &= ~(SVf_IOK|SVf_NOK| \ @@ -337,9 +503,10 @@ struct xpvio { #define SvOK(sv) (SvFLAGS(sv) & SVf_OK) #define SvOK_off(sv) (SvFLAGS(sv) &= ~(SVf_OK|SVf_AMAGIC| \ - SVf_IVisUV), \ + SVf_IVisUV|SVf_UTF8), \ SvOOK_off(sv)) -#define SvOK_off_exc_UV(sv) (SvFLAGS(sv) &= ~(SVf_OK|SVf_AMAGIC), \ +#define SvOK_off_exc_UV(sv) (SvFLAGS(sv) &= ~(SVf_OK|SVf_AMAGIC| \ + SVf_UTF8), \ SvOOK_off(sv)) #define SvOKp(sv) (SvFLAGS(sv) & (SVp_IOK|SVp_NOK|SVp_POK)) @@ -381,7 +548,11 @@ struct xpvio { #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 SvPOK_only(sv) (SvFLAGS(sv) &= ~(SVf_OK|SVf_AMAGIC|SVf_IVisUV), \ +#define SvPOK_only(sv) (SvFLAGS(sv) &= ~(SVf_OK|SVf_AMAGIC| \ + SVf_IVisUV|SVf_UTF8), \ + SvFLAGS(sv) |= (SVf_POK|SVp_POK)) +#define SvPOK_only_UTF8(sv) (SvFLAGS(sv) &= ~(SVf_OK|SVf_AMAGIC| \ + SVf_IVisUV), \ SvFLAGS(sv) |= (SVf_POK|SVp_POK)) #define SvOOK(sv) (SvFLAGS(sv) & SVf_OOK) @@ -537,6 +708,28 @@ struct xpvio { #define IoTYPE(sv) ((XPVIO*) SvANY(sv))->xio_type #define IoFLAGS(sv) ((XPVIO*) SvANY(sv))->xio_flags +/* +=for apidoc Am|bool|SvTAINTED|SV* sv +Checks to see if an SV is tainted. Returns TRUE if it is, FALSE if +not. + +=for apidoc Am|void|SvTAINTED_on|SV* sv +Marks an SV as tainted. + +=for apidoc Am|void|SvTAINTED_off|SV* sv +Untaints an SV. Be I<very> careful with this routine, as it short-circuits +some of Perl's fundamental security features. XS module authors should not +use this function unless they fully understand all the implications of +unconditionally untainting the value. Untainting should be done in the +standard perl fashion, via a carefully crafted regexp, rather than directly +untainting variables. + +=for apidoc Am|void|SvTAINT|SV* sv +Taints an SV if tainting is enabled + +=cut +*/ + #define SvTAINTED(sv) (SvMAGICAL(sv) && sv_tainted(sv)) #define SvTAINTED_on(sv) STMT_START{ if(PL_tainting){sv_taint(sv);} }STMT_END #define SvTAINTED_off(sv) STMT_START{ if(PL_tainting){sv_untaint(sv);} }STMT_END @@ -550,6 +743,35 @@ struct xpvio { } \ } STMT_END +/* +=for apidoc Am|char*|SvPV_force|SV* sv|STRLEN len +Like <SvPV> but will force the SV into becoming a string (SvPOK). You want +force if you are going to update the SvPVX directly. + +=for apidoc Am|char*|SvPV|SV* sv|STRLEN len +Returns a pointer to the string in the SV, or a stringified form of the SV +if the SV does not contain a string. Handles 'get' magic. + +=for apidoc Am|char*|SvPV_nolen|SV* sv +Returns a pointer to the string in the SV, or a stringified form of the SV +if the SV does not contain a string. Handles 'get' magic. + +=for apidoc Am|IV|SvIV|SV* sv +Coerces the given SV to an integer and returns it. + +=for apidoc Am|NV|SvNV|SV* sv +Coerce the given SV to a double and return it. + +=for apidoc Am|UV|SvUV|SV* sv +Coerces the given SV to an unsigned integer and returns it. + +=for apidoc Am|bool|SvTRUE|SV* sv +Returns a boolean indicating whether Perl would evaluate the SV as true or +false, defined or undefined. Does not handle 'get' magic. + +=cut +*/ + #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) @@ -676,8 +898,7 @@ struct xpvio { : SvPOK(sv) \ ? (({XPV *nxpv = (XPV*)SvANY(sv); \ nxpv && \ - (*nxpv->xpv_pv > '0' || \ - nxpv->xpv_cur > 1 || \ + (nxpv->xpv_cur > 1 || \ (nxpv->xpv_cur && *nxpv->xpv_pv != '0')); }) \ ? 1 \ : 0) \ @@ -712,8 +933,7 @@ struct xpvio { ? 0 \ : SvPOK(sv) \ ? ((PL_Xpv = (XPV*)SvANY(sv)) && \ - (*PL_Xpv->xpv_pv > '0' || \ - PL_Xpv->xpv_cur > 1 || \ + (PL_Xpv->xpv_cur > 1 || \ (PL_Xpv->xpv_cur && *PL_Xpv->xpv_pv != '0')) \ ? 1 \ : 0) \ @@ -728,10 +948,45 @@ struct xpvio { #endif /* !__GNU__ */ #endif /* !CRIPPLED_CC */ +/* +=for apidoc Am|SV*|newRV_inc|SV* sv + +Creates an RV wrapper for an SV. The reference count for the original SV is +incremented. + +=cut +*/ + #define newRV_inc(sv) newRV(sv) /* the following macros update any magic values this sv is associated with */ +/* +=for apidoc Am|void|SvGETMAGIC|SV* sv +Invokes C<mg_get> on an SV if it has 'get' magic. This macro evaluates its +argument more than once. + +=for apidoc Am|void|SvSETMAGIC|SV* sv +Invokes C<mg_set> on an SV if it has 'set' magic. This macro evaluates its +argument more than once. + +=for apidoc Am|void|SvSetSV|SV* dsb|SV* ssv +Calls C<sv_setsv> if dsv is not the same as ssv. May evaluate arguments +more than once. + +=for apidoc Am|void|SvSetSV_nosteal|SV* dsv|SV* ssv +Calls a non-destructive version of C<sv_setsv> if dsv is not the same as +ssv. May evaluate arguments more than once. + +=for apidoc Am|void|SvGROW|SV* sv|STRLEN len +Expands the character buffer in the SV so that it has room for the +indicated number of bytes (remember to reserve space for an extra trailing +NUL character). Calls C<sv_grow> to perform the expansion if necessary. +Returns a pointer to the character buffer. + +=cut +*/ + #define SvGETMAGIC(x) STMT_START { if (SvGMAGICAL(x)) mg_get(x); } STMT_END #define SvSETMAGIC(x) STMT_START { if (SvSMAGICAL(x)) mg_set(x); } STMT_END diff --git a/t/cmd/while.t b/t/cmd/while.t index 392c13779f..46bbdea15a 100755 --- a/t/cmd/while.t +++ b/t/cmd/while.t @@ -1,8 +1,6 @@ #!./perl -# $RCSfile: while.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:15 $ - -print "1..15\n"; +print "1..19\n"; open (tmp,'>Cmd_while.tmp') || die "Can't create Cmd_while.tmp."; print tmp "tvi925\n"; @@ -128,3 +126,37 @@ while (1) { $i++; print "not " unless $` . $& . $' eq "abc"; print "ok $i\n"; + +# check that scope cleanup happens right when there's a continue block +{ + my $var = 16; + while (my $i = ++$var) { + next if $i == 17; + last if $i > 17; + my $i = 0; + } + continue { + print "ok ", $var-1, "\nok $i\n"; + } +} + +{ + local $l = 18; + { + local $l = 0 + } + continue { + print "ok $l\n" + } +} + +{ + local $l = 19; + my $x = 0; + while (!$x++) { + local $l = 0 + } + continue { + print "ok $l\n" + } +} diff --git a/t/comp/use.t b/t/comp/use.t index 1099547393..2594f0a547 100755 --- a/t/comp/use.t +++ b/t/comp/use.t @@ -44,9 +44,7 @@ unless ($@) { print "ok ",$i++,"\n"; - -use lib; # I know that this module will be there. - +{ use lib } # check that subparse saves pending tokens local $lib::VERSION = 1.0; @@ -16,7 +16,7 @@ if (defined &Win32::IsWinNT && Win32::IsWinNT()) { $Is_Dosish = '' if Win32::FsType() eq 'NTFS'; } -print "1..28\n"; +print "1..29\n"; $wd = (($^O eq 'MSWin32') ? `cd` : `pwd`); chop($wd); @@ -152,11 +152,12 @@ else { truncate "Iofs.tmp", 0; if (-z "Iofs.tmp") {print "ok 24\n"} else {print "not ok 24\n"} open(FH, ">Iofs.tmp") or die "Can't create Iofs.tmp"; + binmode FH; { select FH; $| = 1; select STDOUT } { use strict; - print FH "helloworld\n"; - truncate FH, 5; + print FH "x\n" x 200; + truncate(FH, 200) or die "Can't truncate FH: $!"; } if ($^O eq 'dos' # Not needed on HPFS, but needed on HPFS386 ?! @@ -164,7 +165,7 @@ else { { 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"} + if (-s "Iofs.tmp" == 200) {print "ok 25\n"} else {print "not ok 25\n"} truncate FH, 0; if ($^O eq 'dos' # Not needed on HPFS, but needed on HPFS386 ?! @@ -176,10 +177,20 @@ else { close FH; } +# check if rename() can be used to just change case of filename +chdir './tmp'; +open(fh,'>x') || die "Can't create x"; +close(fh); +rename('x', 'X'); +print 'not ' unless -e 'X'; +print "ok 27\n"; +unlink 'X'; +chdir $wd || die "Can't cd back to $wd"; + # check if rename() works on directories rename 'tmp', 'tmp1' or print "not "; -print "ok 27\n"; --d 'tmp1' or print "not "; print "ok 28\n"; +-d 'tmp1' or print "not "; +print "ok 29\n"; END { rmdir 'tmp1'; unlink "Iofs.tmp"; } diff --git a/t/io/tell.t b/t/io/tell.t index 31287e1d19..b89aefb230 100755 --- a/t/io/tell.t +++ b/t/io/tell.t @@ -7,7 +7,7 @@ print "1..21\n"; $TST = 'tst'; $Is_Dosish = ($^O eq 'MSWin32' or $^O eq 'dos' or - $^O eq 'os2' or $^O eq 'mint'); + $^O eq 'os2' or $^O eq 'mint' or $^O eq 'cygwin'); open($TST, '../Configure') || (die "Can't open ../Configure"); binmode $TST if $Is_Dosish; diff --git a/t/lib/cgi-html.t b/t/lib/cgi-html.t index e878b21e50..c51318e344 100755 --- a/t/lib/cgi-html.t +++ b/t/lib/cgi-html.t @@ -69,12 +69,12 @@ test(15,start_html(-Title=>'The world of foo') ."\n" eq <<END,"start_html()"); END ; test(16,($cookie=cookie(-name=>'fred',-value=>['chocolate','chip'],-path=>'/')) eq - 'fred=chocolate&chip; domain=localhost; path=/',"cookie()"); + 'fred=chocolate&chip; path=/',"cookie()"); if (!$Is_EBCDIC) { -test(17,header(-Cookie=>$cookie) =~ m!^Set-Cookie: fred=chocolate&chip\; domain=localhost; path=/\015\012Date:.*\015\012Content-Type: text/html\015\012\015\012!s, +test(17,header(-Cookie=>$cookie) =~ m!^Set-Cookie: fred=chocolate&chip\; path=/\015\012Date:.*\015\012Content-Type: text/html\015\012\015\012!s, "header(-cookie)"); } else { -test(17,header(-Cookie=>$cookie) =~ m!^Set-Cookie: fred=chocolate&chip\; domain=localhost; path=/\r\nDate:.*\r\nContent-Type: text/html\r\n\r\n!s, +test(17,header(-Cookie=>$cookie) =~ m!^Set-Cookie: fred=chocolate&chip\; path=/\r\nDate:.*\r\nContent-Type: text/html\r\n\r\n!s, "header(-cookie)"); } test(18,start_h3 eq '<H3>'); diff --git a/t/lib/charnames.t b/t/lib/charnames.t index 9775b141b2..84949896ac 100644 --- a/t/lib/charnames.t +++ b/t/lib/charnames.t @@ -16,7 +16,7 @@ print "not " unless "Here\N{EXCLAMATION MARK}?" eq "Here\041?"; print "ok 1\n"; { - no utf8; # UTEST can switch it on + use byte; # UTEST can switch utf8 on print "# \$res=$res \$\@='$@'\nnot " if $res = eval <<'EOE' diff --git a/t/lib/dumper.t b/t/lib/dumper.t index 0ac269620d..3167535d78 100755 --- a/t/lib/dumper.t +++ b/t/lib/dumper.t @@ -56,11 +56,11 @@ sub TEST { if (defined &Data::Dumper::Dumpxs) { print "### XS extension loaded, will run XS tests\n"; - $TMAX = 174; $XS = 1; + $TMAX = 186; $XS = 1; } else { print "### XS extensions not loaded, will NOT run XS tests\n"; - $TMAX = 87; $XS = 0; + $TMAX = 93; $XS = 0; } print "1..$TMAX\n"; @@ -301,11 +301,11 @@ EOT # #0 # 10, # #1 -# '', +# do{my $o}, # #2 # { # 'a' => 1, -# 'b' => '', +# 'b' => do{my $o}, # 'c' => [], # 'd' => {} # } @@ -331,10 +331,10 @@ EOT #*::foo = \5; #*::foo = [ # 10, -# '', +# do{my $o}, # { # 'a' => 1, -# 'b' => '', +# 'b' => do{my $o}, # 'c' => [], # 'd' => {} # } @@ -364,7 +364,7 @@ EOT #*::foo = \@bar; #*::foo = { # 'a' => 1, -# 'b' => '', +# 'b' => do{my $o}, # 'c' => [], # 'd' => {} #}; @@ -391,7 +391,7 @@ EOT #*::foo = $bar; #*::foo = { # 'a' => 1, -# 'b' => '', +# 'b' => do{my $o}, # 'c' => [], # 'd' => {} #}; @@ -640,7 +640,7 @@ TEST q(Data::Dumper->new([\&z,$c],['*a','*c'])->Seen({'*b' => \&z})->Dumpxs;) $WANT = <<'EOT'; #@a = ( # undef, -# '' +# do{my $o} #); #$a[1] = \$a[0]; EOT @@ -677,7 +677,7 @@ TEST q(Data::Dumper->new([$a,$b],['a','b'])->Purity(1)->Dumpxs;) # { # a => \[ # { -# c => '' +# c => do{my $o} # }, # { # d => \[] @@ -768,3 +768,34 @@ TEST q(Data::Dumper->new([$a,$b,$c],['a','b','c'])->Maxdepth(1)->Dump;); TEST q(Data::Dumper->new([$a,$b,$c],['a','b','c'])->Maxdepth(1)->Dumpxs;) if $XS; } + +{ + $a = \$a; + $b = [$a]; + +############# 175 +## + $WANT = <<'EOT'; +#$b = [ +# \$b->[0] +#]; +EOT + +TEST q(Data::Dumper->new([$b],['b'])->Purity(0)->Dump;); +TEST q(Data::Dumper->new([$b],['b'])->Purity(0)->Dumpxs;) + if $XS; + +############# 181 +## + $WANT = <<'EOT'; +#$b = [ +# \do{my $o} +#]; +#${$b->[0]} = $b->[0]; +EOT + + +TEST q(Data::Dumper->new([$b],['b'])->Purity(1)->Dump;); +TEST q(Data::Dumper->new([$b],['b'])->Purity(1)->Dumpxs;) + if $XS; +} diff --git a/t/lib/fields.t b/t/lib/fields.t index da874d674e..74be2c2a4f 100755 --- a/t/lib/fields.t +++ b/t/lib/fields.t @@ -56,6 +56,14 @@ package Foo::Bar::Baz; use base 'Foo::Bar'; use fields qw(foo bar baz); +# Test repeatability for when modules get reloaded. +package B1; +use fields qw(b1 b2 b3); + +package D3; +use base 'B2'; +use fields qw(b1 d1 _b1 _d1); # hide b1 + package main; sub fstr diff --git a/t/lib/thread.t b/t/lib/thread.t index edfb443fc8..6b3c800f9b 100755 --- a/t/lib/thread.t +++ b/t/lib/thread.t @@ -72,7 +72,7 @@ $t->join->join; { package Loch::Ness; sub new { bless [], shift } - sub monster : locked, method { + sub monster : locked : method { my($s, $m) = @_; print "ok $m\n"; } diff --git a/t/op/attrs.t b/t/op/attrs.t index e89c2cb816..615e4d3343 100644 --- a/t/op/attrs.t +++ b/t/op/attrs.t @@ -63,12 +63,12 @@ mytest; BEGIN {++$ntests} my $anon1; -eval '$anon1 = sub ($) : locked,,method { $_[0]++ }'; +eval '$anon1 = sub ($) : locked:method { $_[0]++ }'; mytest; BEGIN {++$ntests} my $anon2; -eval '$anon2 = sub : locked , method { $_[0]++ }'; +eval '$anon2 = sub : locked : method { $_[0]++ }'; mytest; BEGIN {++$ntests} diff --git a/t/op/closure.t b/t/op/closure.t index 2284be6df1..c691d6f034 100755 --- a/t/op/closure.t +++ b/t/op/closure.t @@ -12,7 +12,7 @@ BEGIN { use Config; -print "1..169\n"; +print "1..171\n"; my $test = 1; sub test (&) { @@ -157,6 +157,31 @@ test { &{$foo[4]}(4) }; +for my $n (0..4) { + $foo[$n] = sub { + # no intervening reference to $n here + sub { $n == $_[0] } + }; +} + +test { + $foo[0]->()->(0) and + $foo[1]->()->(1) and + $foo[2]->()->(2) and + $foo[3]->()->(3) and + $foo[4]->()->(4) +}; + +{ + my $w; + $w = sub { + my ($i) = @_; + test { $i == 10 }; + sub { $w }; + }; + $w->(10); +} + # Additional tests by Tom Phoenix <rootbeer@teleport.com>. { diff --git a/t/op/exists_sub.t b/t/op/exists_sub.t new file mode 100755 index 0000000000..3363dfd837 --- /dev/null +++ b/t/op/exists_sub.t @@ -0,0 +1,46 @@ +#!./perl + +BEGIN { + chdir 't' if -d 't'; + unshift @INC, '../lib'; +} + +print "1..9\n"; + +sub t1; +sub t2 : locked; +sub t3 (); +sub t4 ($); +sub t5 {1;} +{ + package P1; + sub tmc {1;} + package P2; + @ISA = 'P1'; +} + +print "not " unless exists &t1 && not defined &t1; +print "ok 1\n"; +print "not " unless exists &t2 && not defined &t2; +print "ok 2\n"; +print "not " unless exists &t3 && not defined &t3; +print "ok 3\n"; +print "not " unless exists &t4 && not defined &t4; +print "ok 4\n"; +print "not " unless exists &t5 && defined &t5; +print "ok 5\n"; +P2::->tmc; +print "not " unless not exists &P2::tmc && not defined &P2::tmc; +print "ok 6\n"; +my $ref; +$ref->{A}[0] = \&t4; +print "not " unless exists &{$ref->{A}[0]} && not defined &{$ref->{A}[0]}; +print "ok 7\n"; +undef &P1::tmc; +print "not " unless exists &P1::tmc && not defined &P1::tmc; +print "ok 8\n"; +eval 'exists &t5()'; +print "not " unless $@; +print "ok 9\n"; + +exit 0; diff --git a/t/op/fork.t b/t/op/fork.t index b743a4589f..d82c04ff79 100755 --- a/t/op/fork.t +++ b/t/op/fork.t @@ -6,7 +6,10 @@ BEGIN { chdir 't' if -d 't'; unshift @INC, '../lib'; require Config; import Config; - unless ($Config{'d_fork'} || ($^O eq 'MSWin32' && $Config{'useithreads'})) { + unless ($Config{'d_fork'} + or ($^O eq 'MSWin32' and $Config{useithreads} + and $Config{ccflags} =~ /-DPERL_IMPLICIT_SYS/)) + { print "1..0 # Skip: no fork\n"; exit 0; } @@ -21,7 +24,7 @@ print "1..", scalar @prgs, "\n"; $tmpfile = "forktmp000"; 1 while -f ++$tmpfile; -END { unlink $tmpfile if $tmpfile; } +END { close TEST; unlink $tmpfile if $tmpfile; } $CAT = (($^O eq 'MSWin32') ? '.\perl -e "print <>"' : 'cat'); @@ -51,6 +54,8 @@ for (@prgs){ # bison says 'parse error' instead of 'syntax error', # various yaccs may or may not capitalize 'syntax'. $results =~ s/^(syntax|parse) error/syntax error/mig; + $results =~ s/^\n*Process terminated by SIG\w+\n?//mg + if $^O eq 'os2'; my @results = sort split /\n/, $results; if ( "@results" ne "@expected" ) { print STDERR "PROG: $switch\n$prog\n"; @@ -317,3 +322,50 @@ BEGIN { #print "outer\n" EXPECT inner +######## +sub pipe_to_fork ($$) { + my $parent = shift; + my $child = shift; + pipe($child, $parent) or die; + my $pid = fork(); + die "fork() failed: $!" unless defined $pid; + close($pid ? $child : $parent); + $pid; +} + +if (pipe_to_fork('PARENT','CHILD')) { + # parent + print PARENT "pipe_to_fork\n"; + close PARENT; +} +else { + # child + while (<CHILD>) { print; } + close CHILD; + exit; +} + +sub pipe_from_fork ($$) { + my $parent = shift; + my $child = shift; + pipe($parent, $child) or die; + my $pid = fork(); + die "fork() failed: $!" unless defined $pid; + close($pid ? $child : $parent); + $pid; +} + +if (pipe_from_fork('PARENT','CHILD')) { + # parent + while (<PARENT>) { print; } + close PARENT; +} +else { + # child + print CHILD "pipe_from_fork\n"; + close CHILD; + exit; +} +EXPECT +pipe_from_fork +pipe_to_fork diff --git a/t/op/grep.t b/t/op/grep.t index 45d0e25a27..3a7f8ad984 100755 --- a/t/op/grep.t +++ b/t/op/grep.t @@ -4,7 +4,7 @@ # grep() and map() tests # -print "1..3\n"; +print "1..27\n"; $test = 1; @@ -29,3 +29,71 @@ sub ok { $test++; } +{ + print map({$_} ("ok $test\n")); + $test++; + print map + ({$_} ("ok $test\n")); + $test++; + print((map({a => $_}, ("ok $test\n")))[0]->{a}); + $test++; + print((map + ({a=>$_}, + ("ok $test\n")))[0]->{a}); + $test++; + print map { $_ } ("ok $test\n"); + $test++; + print map + { $_ } ("ok $test\n"); + $test++; + print((map {a => $_}, ("ok $test\n"))[0]->{a}); + $test++; + print((map + {a=>$_}, + ("ok $test\n"))[0]->{a}); + $test++; + my $x = "ok \xFF\xFF\n"; + print map($_&$x,("ok $test\n")); + $test++; + print map + ($_ & $x, ("ok $test\n")); + $test++; + print map { $_ & $x } ("ok $test\n"); + $test++; + print map + { $_&$x } ("ok $test\n"); + $test++; + + print grep({$_} ("ok $test\n")); + $test++; + print grep + ({$_} ("ok $test\n")); + $test++; + print grep({a => $_}->{a}, ("ok $test\n")); + $test++; + print grep + ({a => $_}->{a}, + ("ok $test\n")); + $test++; + print grep { $_ } ("ok $test\n"); + $test++; + print grep + { $_ } ("ok $test\n"); + $test++; + print grep {a => $_}->{a}, ("ok $test\n"); + $test++; + print grep + {a => $_}->{a}, + ("ok $test\n"); + $test++; + print grep($_&"X",("ok $test\n")); + $test++; + print grep + ($_&"X", ("ok $test\n")); + $test++; + print grep { $_ & "X" } ("ok $test\n"); + $test++; + print grep + { $_ & "X" } ("ok $test\n"); + $test++; +} diff --git a/t/op/misc.t b/t/op/misc.t index 9f8c7dedab..6ffc04cbcf 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -357,11 +357,11 @@ 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" } +CHECK { print "check <",shift,">\n" } EXPECT argv <a b c d e> begin <a> -stop <b> +check <b> init <c> end <d> argv <e> diff --git a/t/op/ver.t b/t/op/ver.t new file mode 100755 index 0000000000..e05264682c --- /dev/null +++ b/t/op/ver.t @@ -0,0 +1,33 @@ +#!./perl + +BEGIN { + chdir 't' if -d 't'; + unshift @INC, "../lib"; +} + +print "1..6\n"; + +my $test = 1; + +use v5.5.640; +require v5.5.640; +print "ok $test\n"; ++$test; + +print "not " unless v1.20.300.4000 eq "\x{1}\x{14}\x{12c}\x{fa0}"; +print "ok $test\n"; ++$test; + +print "not " unless v1.20.300.4000 > 1.0203039 and v1.20.300.4000 < 1.0203041; +print "ok $test\n"; ++$test; + +print "not " unless sprintf("%v", "Perl") eq '80.101.114.108'; +print "ok $test\n"; ++$test; + +print "not " unless sprintf("%v", v1.22.333.4444) eq '1.22.333.4444'; +print "ok $test\n"; ++$test; + +{ + use byte; + print "not " unless + sprintf("%v", v1.22.333.4444) eq '1.22.197.141.225.133.156'; + print "ok $test\n"; ++$test; +} diff --git a/t/pod/poderrs.t b/t/pod/poderrs.t index 9f7f6bd341..e27130ce39 100755 --- a/t/pod/poderrs.t +++ b/t/pod/poderrs.t @@ -82,12 +82,12 @@ L</"begin or begin"> L<"end with begin"> L</OoPs> -=head2 Garbled (almost) links +=head2 Some links with problems -L<s s / s s / ss> -L<".".":"> -L<"h"/"hh"> -L<a|b|c> +L<abc +def> +L<> +L<"Warnings"> this one is ok =head2 Warnings diff --git a/t/pod/poderrs.xr b/t/pod/poderrs.xr index 70408cd2f4..157d1306ba 100644 --- a/t/pod/poderrs.xr +++ b/t/pod/poderrs.xr @@ -1,6 +1,4 @@ *** 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 @@ -9,27 +7,26 @@ ** 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: =over on line 43 without closing =back (at head2) at line 45 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: =over on line 51 without closing =back (at head2) at line 55 in file pod/poderrs.t +*** ERROR: =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: =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: collapsing newlines to blanks at line 87 in file pod/poderrs.t +*** ERROR: malformed link L<> : empty link at line 89 in file pod/poderrs.t +*** WARNING: section in `passwd(5)' deprecated 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 +*** WARNING: 2 unescaped <> in paragraph 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. +*** ERROR: unresolved internal link `abc def' at line 87 in file pod/poderrs.t +pod/poderrs.t has 24 pod syntax errors. diff --git a/t/pragma/diagnostics.t b/t/pragma/diagnostics.t new file mode 100755 index 0000000000..8c9a152a18 --- /dev/null +++ b/t/pragma/diagnostics.t @@ -0,0 +1,37 @@ +#!./perl + +BEGIN { + chdir '..' if -d '../pod'; + unshift @INC, './lib' if -d './lib'; +} + + +######################### We start with some black magic to print on failure. + +# Change 1..1 below to 1..last_test_to_print . +# (It may become useful if the test is moved to ./t subdirectory.) +use strict; + +use vars qw($Test_Num $Total_tests); + +my $loaded; +BEGIN { $| = 1; $^W = 1; $Test_Num = 1 } +END {print "not ok $Test_Num\n" unless $loaded;} +print "1..$Total_tests\n"; +BEGIN { require diagnostics; } # Don't want diagnostics' noise yet. +$loaded = 1; +ok($loaded, 'compile'); +######################### End of black magic. + +sub ok { + my($test, $name) = shift; + print "not " unless $test; + print "ok $Test_Num"; + print " - $name" if defined $name; + print "\n"; + $Test_Num++; +} + + +# Change this to your # of ok() calls + 1 +BEGIN { $Total_tests = 1 } diff --git a/t/pragma/strict-vars b/t/pragma/strict-vars index dc11f5d59e..9352c4b04c 100644 --- a/t/pragma/strict-vars +++ b/t/pragma/strict-vars @@ -339,3 +339,18 @@ ${foo} = 10; our $foo; EXPECT "our" variable $foo masks earlier declaration in same scope at - line 7. +######## + +# multiple our declarations in same scope, same package, warning +use strict 'vars'; +use warnings; +our $foo; +{ + our $foo; + package Foo; + our $foo; +} +EXPECT +"our" variable $foo redeclared at - line 7. +(Did you mean "local" instead of "our"?) +Name "Foo::foo" used only once: possible typo at - line 9. diff --git a/t/pragma/warn/2use b/t/pragma/warn/2use index 384b3b361e..396f20142c 100644 --- a/t/pragma/warn/2use +++ b/t/pragma/warn/2use @@ -5,11 +5,9 @@ TODO __END__ -# check illegal category is caught -use warnings 'blah' ; +# ignore unknown warning categories +use warnings 'this-should-never-be-a-warning-category' ; EXPECT -unknown warning category 'blah' at - line 3 -BEGIN failed--compilation aborted at - line 3. ######## # Check compile time scope of pragma diff --git a/t/pragma/warn/doop b/t/pragma/warn/doop index cce6bdc07c..c16e24f919 100644 --- a/t/pragma/warn/doop +++ b/t/pragma/warn/doop @@ -1,6 +1,6 @@ doop.c AOK - Malformed UTF-8 character + \x%s will produce malformed UTF-8 character; use \x{%s} for that __END__ @@ -9,7 +9,6 @@ use utf8 ; $_ = "\x80 \xff" ; chop ; EXPECT -Malformed UTF-8 character at - line 4. ######## # doop.c BEGIN { @@ -28,4 +27,3 @@ chop ; EXPECT \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. diff --git a/t/pragma/warn/pp b/t/pragma/warn/pp index eb09e059ba..4c70fd5d6f 100644 --- a/t/pragma/warn/pp +++ b/t/pragma/warn/pp @@ -30,7 +30,8 @@ Mandatory Warnings ------------------ - Malformed UTF-8 character + Malformed UTF-8 character (not tested: difficult to produce with + perl now) __END__ # pp.c @@ -109,7 +110,6 @@ use utf8 ; $_ = "\x80 \xff" ; reverse ; EXPECT -Malformed UTF-8 character at - line 4. ######## # pp.c BEGIN { @@ -128,4 +128,3 @@ reverse ; EXPECT \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. diff --git a/t/pragma/warn/pp_hot b/t/pragma/warn/pp_hot index 7e19dc5c94..312f7da9b2 100644 --- a/t/pragma/warn/pp_hot +++ b/t/pragma/warn/pp_hot @@ -83,10 +83,17 @@ Filehandle main::FOO opened only for output at - line 8. use warnings 'closed' ; close STDIN ; print STDIN "anc"; +opendir STDIN, "."; +print STDIN "anc"; +closedir STDIN; no warnings 'closed' ; print STDIN "anc"; +opendir STDIN, "."; +print STDIN "anc"; EXPECT print() on closed filehandle main::STDIN at - line 4. +print() on closed filehandle main::STDIN at - line 6. +(Are you trying to call print() on dirhandle main::STDIN?) ######## # pp_hot.c [pp_rv2av] use warnings 'uninitialized' ; @@ -124,11 +131,16 @@ Reference found where even-sized list expected at - line 3. ######## # pp_hot.c [Perl_do_readline] use warnings 'closed' ; -close STDIN ; $a = <STDIN> ; +close STDIN ; $a = <STDIN> ; +opendir STDIN, "." ; $a = <STDIN> ; +closedir STDIN; no warnings 'closed' ; +opendir STDIN, "." ; $a = <STDIN> ; $a = <STDIN> ; EXPECT readline() on closed filehandle main::STDIN at - line 3. +readline() on closed filehandle main::STDIN at - line 4. +(Are you trying to call readline() on dirhandle main::STDIN?) ######## # pp_hot.c [Perl_do_readline] use warnings 'io' ; diff --git a/t/pragma/warn/pp_sys b/t/pragma/warn/pp_sys index ea4b536842..5808536752 100644 --- a/t/pragma/warn/pp_sys +++ b/t/pragma/warn/pp_sys @@ -27,47 +27,51 @@ close STDIN ; printf STDIN "fred" - syswrite() on closed filehandle [pp_send] + syswrite() on closed filehandle %s [pp_send] close STDIN; syswrite STDIN, "fred", 1; - send() on closed socket [pp_send] + send() on closed socket %s [pp_send] close STDIN; send STDIN, "fred", 1 - bind() on closed socket [pp_bind] + bind() on closed socket %s [pp_bind] close STDIN; bind STDIN, "fred" ; - connect() on closed socket [pp_connect] + connect() on closed socket %s [pp_connect] close STDIN; connect STDIN, "fred" ; - listen() on closed socket [pp_listen] + listen() on closed socket %s [pp_listen] close STDIN; listen STDIN, 2; - accept() on closed socket [pp_accept] + accept() on closed socket %s [pp_accept] close STDIN; - accept STDIN, "fred" ; + accept "fred", STDIN ; - shutdown() on closed socket [pp_shutdown] + shutdown() on closed socket %s [pp_shutdown] close STDIN; shutdown STDIN, 0; - setsockopt() on closed socket [pp_ssockopt] - getsockopt() on closed socket [pp_ssockopt] + setsockopt() on closed socket %s [pp_ssockopt] + getsockopt() on closed socket %s [pp_ssockopt] close STDIN; setsockopt STDIN, 1,2,3; getsockopt STDIN, 1,2; - getsockname() on closed socket [pp_getpeername] - getpeername() on closed socket [pp_getpeername] + getsockname() on closed socket %s [pp_getpeername] + getpeername() on closed socket %s [pp_getpeername] close STDIN; getsockname STDIN; getpeername STDIN; + flock() on closed socket %s [pp_flock] + close STDIN; + flock STDIN, 8; + warn(warn_nl, "stat"); [pp_stat] Test on unopened file <%s> @@ -111,10 +115,17 @@ format STDIN = . close STDIN; write STDIN; +opendir STDIN, "."; +write STDIN; +closedir STDIN; no warnings 'closed' ; write STDIN; +opendir STDIN, "."; +write STDIN; EXPECT write() on closed filehandle main::STDIN at - line 6. +write() on closed filehandle main::STDIN at - line 8. +(Are you trying to call write() on dirhandle main::STDIN?) ######## # pp_sys.c [pp_leavewrite] use warnings 'io' ; @@ -147,10 +158,17 @@ Filehandle main::abc never opened at - line 4. use warnings 'closed' ; close STDIN ; printf STDIN "fred"; +opendir STDIN, "."; +printf STDIN "fred"; +closedir STDIN; no warnings 'closed' ; printf STDIN "fred"; +opendir STDIN, "."; +printf STDIN "fred"; EXPECT printf() on closed filehandle main::STDIN at - line 4. +printf() on closed filehandle main::STDIN at - line 6. +(Are you trying to call printf() on dirhandle main::STDIN?) ######## # pp_sys.c [pp_prtf] use warnings 'io' ; @@ -164,10 +182,32 @@ Filehandle main::STDIN opened only for input at - line 3. use warnings 'closed' ; close STDIN; syswrite STDIN, "fred", 1; +opendir STDIN, "."; +syswrite STDIN, "fred", 1; +closedir STDIN; no warnings 'closed' ; syswrite STDIN, "fred", 1; +opendir STDIN, "."; +syswrite STDIN, "fred", 1; EXPECT -syswrite() on closed filehandle at - line 4. +syswrite() on closed filehandle main::STDIN at - line 4. +syswrite() on closed filehandle main::STDIN at - line 6. +(Are you trying to call syswrite() on dirhandle main::STDIN?) +######## +# pp_sys.c [pp_flock] +use warnings 'closed' ; +close STDIN; +flock STDIN, 8; +opendir STDIN, "."; +flock STDIN, 8; +no warnings 'closed' ; +flock STDIN, 8; +opendir STDIN, "."; +flock STDIN, 8; +EXPECT +flock() on closed filehandle main::STDIN at - line 4. +flock() on closed filehandle main::STDIN at - line 6. +(Are you trying to call flock() on dirhandle main::STDIN?) ######## # pp_sys.c [pp_prtf pp_send pp_bind pp_connect pp_listen pp_accept pp_shutdown pp_ssockopt ppp_getpeername] use warnings 'io' ; @@ -194,12 +234,24 @@ send STDIN, "fred", 1; bind STDIN, "fred" ; connect STDIN, "fred" ; listen STDIN, 2; -accept STDIN, "fred" ; +accept "fred", STDIN; +shutdown STDIN, 0; +setsockopt STDIN, 1,2,3; +getsockopt STDIN, 1,2; +getsockname STDIN; +getpeername STDIN; +opendir STDIN, "."; +send STDIN, "fred", 1; +bind STDIN, "fred" ; +connect STDIN, "fred" ; +listen STDIN, 2; +accept "fred", STDIN; shutdown STDIN, 0; setsockopt STDIN, 1,2,3; getsockopt STDIN, 1,2; getsockname STDIN; getpeername STDIN; +closedir STDIN; no warnings 'io' ; send STDIN, "fred", 1; bind STDIN, "fred" ; @@ -211,17 +263,48 @@ setsockopt STDIN, 1,2,3; getsockopt STDIN, 1,2; getsockname STDIN; getpeername STDIN; +opendir STDIN, "."; +send STDIN, "fred", 1; +bind STDIN, "fred" ; +connect STDIN, "fred" ; +listen STDIN, 2; +accept "fred", STDIN; +shutdown STDIN, 0; +setsockopt STDIN, 1,2,3; +getsockopt STDIN, 1,2; +getsockname STDIN; +getpeername STDIN; EXPECT -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. +send() on closed socket main::STDIN at - line 22. +bind() on closed socket main::STDIN at - line 23. +connect() on closed socket main::STDIN at - line 24. +listen() on closed socket main::STDIN at - line 25. +accept() on closed socket main::STDIN at - line 26. +shutdown() on closed socket main::STDIN at - line 27. +setsockopt() on closed socket main::STDIN at - line 28. +getsockopt() on closed socket main::STDIN at - line 29. +getsockname() on closed socket main::STDIN at - line 30. +getpeername() on closed socket main::STDIN at - line 31. +send() on closed socket main::STDIN at - line 33. +(Are you trying to call send() on dirhandle main::STDIN?) +bind() on closed socket main::STDIN at - line 34. +(Are you trying to call bind() on dirhandle main::STDIN?) +connect() on closed socket main::STDIN at - line 35. +(Are you trying to call connect() on dirhandle main::STDIN?) +listen() on closed socket main::STDIN at - line 36. +(Are you trying to call listen() on dirhandle main::STDIN?) +accept() on closed socket main::STDIN at - line 37. +(Are you trying to call accept() on dirhandle main::STDIN?) +shutdown() on closed socket main::STDIN at - line 38. +(Are you trying to call shutdown() on dirhandle main::STDIN?) +setsockopt() on closed socket main::STDIN at - line 39. +(Are you trying to call setsockopt() on dirhandle main::STDIN?) +getsockopt() on closed socket main::STDIN at - line 40. +(Are you trying to call getsockopt() on dirhandle main::STDIN?) +getsockname() on closed socket main::STDIN at - line 41. +(Are you trying to call getsockname() on dirhandle main::STDIN?) +getpeername() on closed socket main::STDIN at - line 42. +(Are you trying to call getpeername() on dirhandle main::STDIN?) ######## # pp_sys.c [pp_stat] use warnings 'newline' ; diff --git a/t/pragma/warn/sv b/t/pragma/warn/sv index 97d61bca17..cdec48e2c2 100644 --- a/t/pragma/warn/sv +++ b/t/pragma/warn/sv @@ -38,8 +38,8 @@ Mandatory Warnings ------------------ - Malformed UTF-8 character [sv_pos_b2u] - my $a = rindex "a\xff bc ", "bc" ; + Malformed UTF-8 character [sv_pos_b2u] (not tested: difficult to produce + with perl now) Mandatory Warnings TODO ------------------ @@ -286,8 +286,6 @@ $^W =0 ; my $a = rindex "a\xff bc ", "bc" ; EXPECT \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'; diff --git a/t/pragma/warn/toke b/t/pragma/warn/toke index 515241ab4d..48f97dd10c 100644 --- a/t/pragma/warn/toke +++ b/t/pragma/warn/toke @@ -89,10 +89,6 @@ toke.c AOK sub time {} my $a = time() - Use of \\x{} without utf8 declaration - $_ = " \x{123} " ; - - \x%.*s will produce malformed UTF-8 character; use \x{%.*s} for that use utf8 ; $_ = "\xffe" @@ -440,18 +436,7 @@ EXPECT Ambiguous call resolved as CORE::time(), qualify as such or use & at - line 4. ######## # toke.c -use warnings 'utf8' ; -eval <<'EOE'; -{ -#line 30 "foo" - $_ = " \x{123} " ; -} -EOE -EXPECT -Use of \x{} without utf8 declaration at foo line 30. -######## -# toke.c -no warnings 'utf8' ; +use warnings ; eval <<'EOE'; { #line 30 "foo" diff --git a/t/pragma/warn/utf8 b/t/pragma/warn/utf8 index 19b8d1db3a..cb1f202b8d 100644 --- a/t/pragma/warn/utf8 +++ b/t/pragma/warn/utf8 @@ -1,14 +1,13 @@ utf8.c AOK - All Mandatory warnings - [utf8_to_uv] Malformed UTF-8 character my $a = ord "\x80" ; Malformed UTF-8 character my $a = ord "\xf080" ; + <<<<<< this warning can't be easily triggered from perl anymore [utf16_to_utf8] Malformed UTF-16 surrogate @@ -19,7 +18,6 @@ __END__ use utf8 ; my $a = ord "\x80" ; EXPECT -Malformed UTF-8 character at - line 3. ######## # utf8.c [utf8_to_uv] BEGIN { @@ -37,15 +35,12 @@ my $a = ord "\x80" ; my $a = ord "\x80" ; } EXPECT -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 ; my $a = ord "\xf080" ; EXPECT -Malformed UTF-8 character at - line 3. ######## # utf8.c [utf8_to_uv] BEGIN { @@ -63,6 +58,4 @@ my $a = ord "\xf080" ; my $a = ord "\xf080" ; } EXPECT -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. @@ -56,6 +56,18 @@ PERLVAR(Tretstack_max, I32) PERLVAR(TSv, SV *) /* used to hold temporary values */ PERLVAR(TXpv, XPV *) /* used to hold temporary values */ + +/* +=for apidoc Amn|STRLEN|PL_na + +A convenience variable which is typically used with C<SvPV> when one +doesn't care about the length of the string. It is usually more efficient +to either declare a local variable and use that instead or to use the +C<SvPV_nolen> macro. + +=cut +*/ + PERLVAR(Tna, STRLEN) /* for use in SvPV when length is Not Applicable */ @@ -1,6 +1,6 @@ /* toke.c * - * Copyright (c) 1991-1999, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -32,19 +32,8 @@ static void restore_rsfp(pTHXo_ void *f); #define XFAKEBRACK 128 #define XENUMMASK 127 +/*#define UTF (SvUTF8(PL_linestr) && !(PL_hints & HINT_BYTE))*/ #define UTF (PL_hints & HINT_UTF8) -/* - * Note: we try to be careful never to call the isXXX_utf8() functions - * unless we're pretty sure we've seen the beginning of a UTF-8 character - * (that is, the two high bits are set). Otherwise we risk loading in the - * heavy-duty SWASHINIT and SWASHGET routines unnecessarily. - */ -#define isIDFIRST_lazy(p) ((!UTF || (*((U8*)p) < 0xc0)) \ - ? isIDFIRST(*(p)) \ - : isIDFIRST_utf8((U8*)p)) -#define isALNUM_lazy(p) ((!UTF || (*((U8*)p) < 0xc0)) \ - ? isALNUM(*(p)) \ - : isALNUM_utf8((U8*)p)) /* In variables name $^X, these are the legal values for X. * 1999-02-27 mjd-perl-patch@plover.com */ @@ -223,9 +212,9 @@ S_no_op(pTHX_ char *what, char *s) yywarn(Perl_form(aTHX_ "%s found where operator expected", what)); if (is_first) Perl_warn(aTHX_ "\t(Missing semicolon on previous line?)\n"); - else if (PL_oldoldbufptr && isIDFIRST_lazy(PL_oldoldbufptr)) { + else if (PL_oldoldbufptr && isIDFIRST_lazy_if(PL_oldoldbufptr,UTF)) { char *t; - for (t = PL_oldoldbufptr; *t && (isALNUM_lazy(t) || *t == ':'); t++) ; + for (t = PL_oldoldbufptr; *t && (isALNUM_lazy_if(t,UTF) || *t == ':'); t++) ; if (t < PL_bufptr && isSPACE(*t)) Perl_warn(aTHX_ "\t(Do you need to predeclare %.*s?)\n", t - PL_oldoldbufptr, PL_oldoldbufptr); @@ -387,6 +376,15 @@ Perl_lex_start(pTHX_ SV *line) SAVEI32(PL_lex_state); SAVEVPTR(PL_lex_inpat); SAVEI32(PL_lex_inwhat); + if (PL_lex_state == LEX_KNOWNEXT) { + I32 toke = PL_nexttoke; + while (--toke >= 0) { + SAVEI32(PL_nexttype[toke]); + SAVEVPTR(PL_nextval[toke]); + } + SAVEI32(PL_nexttoke); + PL_nexttoke = 0; + } SAVECOPLINE(PL_curcop); SAVEPPTR(PL_bufptr); SAVEPPTR(PL_bufend); @@ -495,8 +493,6 @@ S_incline(pTHX_ char *s) *t = '\0'; if (t - s > 0) CopFILE_set(PL_curcop, s); - else - CopFILE_set(PL_curcop, PL_origfilename); *t = ch; CopLINE_set(PL_curcop, atoi(n)-1); } @@ -635,7 +631,7 @@ S_check_uni(pTHX) return; while (isSPACE(*PL_last_uni)) PL_last_uni++; - for (s = PL_last_uni; isALNUM_lazy(s) || *s == '-'; s++) ; + for (s = PL_last_uni; isALNUM_lazy_if(s,UTF) || *s == '-'; s++) ; if ((t = strchr(s, '(')) && t < PL_bufptr) return; if (ckWARN_d(WARN_AMBIGUOUS)){ @@ -758,7 +754,7 @@ S_force_word(pTHX_ register char *start, int token, int check_keyword, int allow start = skipspace(start); s = start; - if (isIDFIRST_lazy(s) || + if (isIDFIRST_lazy_if(s,UTF) || (allow_pack && *s == ':') || (allow_initial_tick && *s == '\'') ) { @@ -1161,6 +1157,7 @@ S_scan_const(pTHX_ char *start) register char *s = start; /* start of the constant */ register char *d = SvPVX(sv); /* destination for copies */ bool dorange = FALSE; /* are we in a translit range? */ + bool has_utf = FALSE; /* embedded \x{} */ I32 len; /* ? */ I32 utf = (PL_lex_inwhat == OP_TRANS && PL_sublex_info.sub_op) ? (PL_sublex_info.sub_op->op_private & (OPpTRANS_FROM_UTF|OPpTRANS_TO_UTF)) @@ -1266,7 +1263,8 @@ S_scan_const(pTHX_ char *start) } /* check for embedded arrays (@foo, @:foo, @'foo, @{foo}, @$foo) */ - else if (*s == '@' && s[1] && (isALNUM_lazy(s+1) || strchr(":'{$", s[1]))) + else if (*s == '@' && s[1] + && (isALNUM_lazy_if(s+1,UTF) || strchr(":'{$", s[1]))) break; /* check for embedded scalars. only stop if we're sure it's a @@ -1286,11 +1284,14 @@ S_scan_const(pTHX_ char *start) if (ckWARN(WARN_UTF8)) { (void)utf8_to_uv((U8*)s, &len); /* could cvt latin-1 to utf8 here... */ if (len) { + has_utf = TRUE; while (len--) *d++ = *s++; continue; } } + else + has_utf = TRUE; /* assume valid utf8 */ } /* backslashes */ @@ -1355,28 +1356,30 @@ S_scan_const(pTHX_ char *start) ++s; if (*s == '{') { char* e = strchr(s, '}'); + UV uv; if (!e) { yyerror("Missing right brace on \\x{}"); e = s; } - if (!utf) { - dTHR; - if (ckWARN(WARN_UTF8)) - Perl_warner(aTHX_ WARN_UTF8, - "Use of \\x{} without utf8 declaration"); - } /* note: utf always shorter than hex */ - d = (char*)uv_to_utf8((U8*)d, - (UV)scan_hex(s + 1, e - s - 1, &len)); + uv = (UV)scan_hex(s + 1, e - s - 1, &len); + if (uv > 127) { + d = (char*)uv_to_utf8((U8*)d, uv); + has_utf = TRUE; + } + else + *d++ = (char)uv; s = e + 1; } else { + /* XXX collapse this branch into the one above */ UV uv = (UV)scan_hex(s, 2, &len); if (utf && PL_lex_inwhat == OP_TRANS && utf != (OPpTRANS_FROM_UTF|OPpTRANS_TO_UTF)) { d = (char*)uv_to_utf8((U8*)d, uv); /* doing a CU or UC */ + has_utf = TRUE; } else { if (uv >= 127 && UTF) { @@ -1384,7 +1387,7 @@ S_scan_const(pTHX_ char *start) if (ckWARN(WARN_UTF8)) Perl_warner(aTHX_ WARN_UTF8, "\\x%.*s will produce malformed UTF-8 character; use \\x{%.*s} for that", - len,s,len,s); + (int)len,s,(int)len,s); } *d++ = (char)uv; } @@ -1487,6 +1490,8 @@ S_scan_const(pTHX_ char *start) *d = '\0'; SvCUR_set(sv, d - SvPVX(sv)); SvPOK_on(sv); + if (has_utf) + SvUTF8_on(sv); /* shrink the sv if we allocated more than we used */ if (SvCUR(sv) + 5 < SvLEN(sv)) { @@ -1595,7 +1600,7 @@ S_intuit_more(pTHX_ register char *s) case '&': case '$': weight -= seen[un_char] * 10; - if (isALNUM_lazy(s+1)) { + if (isALNUM_lazy_if(s+1,UTF)) { scan_ident(s, send, tmpbuf, sizeof tmpbuf, FALSE); if ((int)strlen(tmpbuf) > 1 && gv_fetchpv(tmpbuf,FALSE, SVt_PV)) weight -= 100; @@ -1679,7 +1684,7 @@ S_intuit_more(pTHX_ register char *s) * Not a method if it's really "print foo $bar" * Method if it's really "foo package::" (interpreted as package->foo) * Not a method if bar is known to be a subroutne ("sub bar; foo bar") - * Not a method if bar is a filehandle or package, but is quotd with + * Not a method if bar is a filehandle or package, but is quoted with * => */ @@ -1978,6 +1983,10 @@ Perl_yylex(pTHX) */ if (PL_in_my) { if (PL_in_my == KEY_our) { /* "our" is merely analogous to "my" */ + if (strchr(PL_tokenbuf,':')) + yyerror(Perl_form(aTHX_ "No package name allowed for " + "variable %s in \"our\"", + PL_tokenbuf)); tmp = pad_allocmy(PL_tokenbuf); } else { @@ -2283,7 +2292,7 @@ Perl_yylex(pTHX) retry: switch (*s) { default: - if (isIDFIRST_lazy(s)) + if (isIDFIRST_lazy_if(s,UTF)) goto keylookup; Perl_croak(aTHX_ "Unrecognized character \\x%02X", *s & 255); case 4: @@ -2651,7 +2660,7 @@ Perl_yylex(pTHX) else if (*s == '>') { s++; s = skipspace(s); - if (isIDFIRST_lazy(s)) { + if (isIDFIRST_lazy_if(s,UTF)) { s = force_word(s,METHOD,FALSE,TRUE,FALSE); TOKEN(ARROW); } @@ -2747,8 +2756,23 @@ Perl_yylex(pTHX) grabattrs: s = skipspace(s); attrs = Nullop; - while (isIDFIRST_lazy(s)) { + while (isIDFIRST_lazy_if(s,UTF)) { d = scan_word(s, PL_tokenbuf, sizeof PL_tokenbuf, FALSE, &len); + if (isLOWER(*s) && (tmp = keyword(PL_tokenbuf, len))) { + if (tmp < 0) tmp = -tmp; + switch (tmp) { + case KEY_or: + case KEY_and: + case KEY_for: + case KEY_unless: + case KEY_if: + case KEY_while: + case KEY_until: + goto got_attrs; + default: + break; + } + } if (*d == '(') { d = scan_str(d,TRUE,TRUE); if (!d) { @@ -2780,11 +2804,13 @@ Perl_yylex(pTHX) newSVpvn(s, len))); } s = skipspace(d); - while (*s == ',') + if (*s == ':' && s[1] != ':') s = skipspace(s+1); + else if (s == d) + break; /* require real whitespace or :'s */ } - tmp = (PL_expect == XOPERATOR ? '=' : '{'); /*'}' for vi */ - if (*s != ';' && *s != tmp) { + tmp = (PL_expect == XOPERATOR ? '=' : '{'); /*'}(' for vi */ + if (*s != ';' && *s != tmp && (tmp != '=' || *s != ')')) { char q = ((*s == '\'') ? '"' : '\''); /* If here for an expression, and parsed no attrs, back off. */ if (tmp == '=' && !attrs) { @@ -2804,6 +2830,7 @@ Perl_yylex(pTHX) op_free(attrs); OPERATOR(':'); } + got_attrs: if (attrs) { PL_nextval[PL_nexttoke].opval = attrs; force_next(THING); @@ -2874,7 +2901,7 @@ Perl_yylex(pTHX) while (d < PL_bufend && (*d == ' ' || *d == '\t')) d++; } - if (d < PL_bufend && isIDFIRST_lazy(d)) { + if (d < PL_bufend && isIDFIRST_lazy_if(d,UTF)) { d = scan_word(d, PL_tokenbuf + 1, sizeof PL_tokenbuf - 1, FALSE, &len); while (d < PL_bufend && (*d == ' ' || *d == '\t')) @@ -2965,9 +2992,9 @@ Perl_yylex(pTHX) } t++; } - else if (isALNUM_lazy(t)) { + else if (isALNUM_lazy_if(t,UTF)) { t += UTF8SKIP(t); - while (t < PL_bufend && isALNUM_lazy(t)) + while (t < PL_bufend && isALNUM_lazy_if(t,UTF)) t += UTF8SKIP(t); } while (t < PL_bufend && isSPACE(*t)) @@ -3027,7 +3054,9 @@ Perl_yylex(pTHX) AOPERATOR(ANDAND); s--; if (PL_expect == XOPERATOR) { - if (ckWARN(WARN_SEMICOLON) && isIDFIRST_lazy(s) && PL_bufptr == PL_linestart) { + if (ckWARN(WARN_SEMICOLON) + && isIDFIRST_lazy_if(s,UTF) && PL_bufptr == PL_linestart) + { CopLINE_dec(PL_curcop); Perl_warner(aTHX_ WARN_SEMICOLON, PL_warn_nosemi); CopLINE_inc(PL_curcop); @@ -3157,7 +3186,7 @@ Perl_yylex(pTHX) } } - if (s[1] == '#' && (isIDFIRST_lazy(s+2) || strchr("{$:+-", s[2]))) { + if (s[1] == '#' && (isIDFIRST_lazy_if(s+2,UTF) || strchr("{$:+-", s[2]))) { PL_tokenbuf[0] = '@'; s = scan_ident(s + 1, PL_bufend, PL_tokenbuf + 1, sizeof PL_tokenbuf - 1, FALSE); @@ -3200,7 +3229,7 @@ Perl_yylex(pTHX) PL_tokenbuf[0] = '@'; if (ckWARN(WARN_SYNTAX)) { for(t = s + 1; - isSPACE(*t) || isALNUM_lazy(t) || *t == '$'; + isSPACE(*t) || isALNUM_lazy_if(t,UTF) || *t == '$'; t++) ; if (*t++ == ',') { PL_bufptr = skipspace(PL_bufptr); @@ -3220,7 +3249,7 @@ Perl_yylex(pTHX) char tmpbuf[sizeof PL_tokenbuf]; STRLEN len; for (t++; isSPACE(*t); t++) ; - if (isIDFIRST_lazy(t)) { + if (isIDFIRST_lazy_if(t,UTF)) { t = scan_word(t, tmpbuf, sizeof tmpbuf, TRUE, &len); for (; isSPACE(*t); t++) ; if (*t == ';' && get_cv(tmpbuf, FALSE)) @@ -3238,9 +3267,9 @@ Perl_yylex(pTHX) PL_expect = XOPERATOR; else if (strchr("$@\"'`q", *s)) PL_expect = XTERM; /* e.g. print $fh "foo" */ - else if (strchr("&*<%", *s) && isIDFIRST_lazy(s+1)) + else if (strchr("&*<%", *s) && isIDFIRST_lazy_if(s+1,UTF)) PL_expect = XTERM; /* e.g. print $fh &sub */ - else if (isIDFIRST_lazy(s)) { + else if (isIDFIRST_lazy_if(s,UTF)) { char tmpbuf[sizeof PL_tokenbuf]; scan_word(s, tmpbuf, sizeof tmpbuf, TRUE, &len); if (tmp = keyword(tmpbuf, len)) { @@ -3298,7 +3327,7 @@ Perl_yylex(pTHX) if (ckWARN(WARN_SYNTAX)) { if (*s == '[' || *s == '{') { char *t = s + 1; - while (*t && (isALNUM_lazy(t) || strchr(" \t$#+-'\"", *t))) + while (*t && (isALNUM_lazy_if(t,UTF) || strchr(" \t$#+-'\"", *t))) t++; if (*t == '}' || *t == ']') { t++; @@ -3319,7 +3348,8 @@ Perl_yylex(pTHX) /* Disable warning on "study /blah/" */ if (PL_oldoldbufptr == PL_last_uni && (*PL_last_uni != 's' || s - PL_last_uni < 5 - || memNE(PL_last_uni, "study", 5) || isALNUM_lazy(PL_last_uni+5))) + || memNE(PL_last_uni, "study", 5) + || isALNUM_lazy_if(PL_last_uni+5,UTF))) check_uni(); s = scan_pat(s,OP_MATCH); TERM(sublex_start()); @@ -3645,7 +3675,7 @@ Perl_yylex(pTHX) /* Two barewords in a row may indicate method call. */ - if ((isIDFIRST_lazy(s) || *s == '$') && (tmp=intuit_method(s,gv))) + if ((isIDFIRST_lazy_if(s,UTF) || *s == '$') && (tmp=intuit_method(s,gv))) return tmp; /* If not a declared subroutine, it's an indirect object. */ @@ -3691,7 +3721,7 @@ Perl_yylex(pTHX) /* If followed by a bareword, see if it looks like indir obj. */ - if ((isIDFIRST_lazy(s) || *s == '$') && (tmp = intuit_method(s,gv))) + if ((isIDFIRST_lazy_if(s,UTF) || *s == '$') && (tmp = intuit_method(s,gv))) return tmp; /* Not a method, so call it a subroutine (if defined) */ @@ -3840,9 +3870,9 @@ Perl_yylex(pTHX) case KEY_AUTOLOAD: case KEY_DESTROY: case KEY_BEGIN: - case KEY_END: - case KEY_STOP: + case KEY_CHECK: case KEY_INIT: + case KEY_END: if (PL_expect == XSTATE) { s = PL_bufptr; goto really_sub; @@ -4025,7 +4055,7 @@ Perl_yylex(pTHX) case KEY_foreach: yylval.ival = CopLINE(PL_curcop); s = skipspace(s); - if (PL_expect == XSTATE && isIDFIRST_lazy(s)) { + if (PL_expect == XSTATE && isIDFIRST_lazy_if(s,UTF)) { char *p = s; if ((PL_bufend - p) >= 3 && strnEQ(p, "my", 2) && isSPACE(*(p + 2))) @@ -4034,7 +4064,7 @@ Perl_yylex(pTHX) strnEQ(p, "our", 3) && isSPACE(*(p + 3))) p += 3; p = skipspace(p); - if (isIDFIRST_lazy(p)) { + if (isIDFIRST_lazy_if(p,UTF)) { p = scan_ident(p, PL_bufend, PL_tokenbuf, sizeof PL_tokenbuf, TRUE); p = skipspace(p); @@ -4066,7 +4096,7 @@ Perl_yylex(pTHX) Rop(OP_SGE); case KEY_grep: - LOP(OP_GREPSTART, *s == '(' ? XTERM : XREF); + LOP(OP_GREPSTART, XREF); case KEY_goto: s = force_word(s,WORD,TRUE,FALSE,FALSE); @@ -4228,7 +4258,7 @@ Perl_yylex(pTHX) TERM(sublex_start()); case KEY_map: - LOP(OP_MAPSTART, *s == '(' ? XTERM : XREF); + LOP(OP_MAPSTART, XREF); case KEY_mkdir: LOP(OP_MKDIR,XTERM); @@ -4249,7 +4279,7 @@ Perl_yylex(pTHX) case KEY_my: PL_in_my = tmp; s = skipspace(s); - if (isIDFIRST_lazy(s)) { + if (isIDFIRST_lazy_if(s,UTF)) { s = scan_word(s, PL_tokenbuf, sizeof PL_tokenbuf, TRUE, &len); if (len == 3 && strnEQ(PL_tokenbuf, "sub", 3)) goto really_sub; @@ -4287,9 +4317,9 @@ Perl_yylex(pTHX) case KEY_open: s = skipspace(s); - if (isIDFIRST_lazy(s)) { + if (isIDFIRST_lazy_if(s,UTF)) { char *t; - for (d = s; isALNUM_lazy(d); d++) ; + for (d = s; isALNUM_lazy_if(d,UTF); d++) ; t = skipspace(d); if (strchr("|&*+-=!?:.", *t) && ckWARN_d(WARN_AMBIGUOUS)) Perl_warner(aTHX_ WARN_AMBIGUOUS, @@ -4428,7 +4458,7 @@ Perl_yylex(pTHX) else { *PL_tokenbuf = '\0'; s = force_word(s,WORD,TRUE,TRUE,FALSE); - if (isIDFIRST_lazy(PL_tokenbuf)) + if (isIDFIRST_lazy_if(PL_tokenbuf,UTF)) gv_stashpvn(PL_tokenbuf, strlen(PL_tokenbuf), TRUE); else if (*s == '<') yyerror("<> should be quotes"); @@ -4619,7 +4649,7 @@ Perl_yylex(pTHX) s = skipspace(s); - if (isIDFIRST_lazy(s) || *s == '\'' || + if (isIDFIRST_lazy_if(s,UTF) || *s == '\'' || (*s == ':' && s[1] == ':')) { PL_expect = XBLOCK; @@ -4903,6 +4933,7 @@ Perl_keyword(pTHX_ register char *d, I32 len) break; case 'C': if (strEQ(d,"CORE")) return -KEY_CORE; + if (strEQ(d,"CHECK")) return KEY_CHECK; break; case 'c': switch (len) { @@ -5286,9 +5317,6 @@ Perl_keyword(pTHX_ register char *d, I32 len) break; } break; - case 'S': - if (strEQ(d,"STOP")) return KEY_STOP; - break; case 's': switch (d[1]) { case 0: return KEY_s; @@ -5511,9 +5539,9 @@ S_checkcomma(pTHX_ register char *s, char *name, char *what) s++; while (s < PL_bufend && isSPACE(*s)) s++; - if (isIDFIRST_lazy(s)) { + if (isIDFIRST_lazy_if(s,UTF)) { w = s++; - while (isALNUM_lazy(s)) + while (isALNUM_lazy_if(s,UTF)) s++; while (s < PL_bufend && isSPACE(*s)) s++; @@ -5635,7 +5663,7 @@ S_scan_word(pTHX_ register char *s, char *dest, STRLEN destlen, int allow_packag Perl_croak(aTHX_ ident_too_long); if (isALNUM(*s)) /* UTF handled below */ *d++ = *s++; - else if (*s == '\'' && allow_package && isIDFIRST_lazy(s+1)) { + else if (*s == '\'' && allow_package && isIDFIRST_lazy_if(s+1,UTF)) { *d++ = ':'; *d++ = ':'; s++; @@ -5687,7 +5715,7 @@ S_scan_ident(pTHX_ register char *s, register char *send, char *dest, STRLEN des Perl_croak(aTHX_ ident_too_long); if (isALNUM(*s)) /* UTF handled below */ *d++ = *s++; - else if (*s == '\'' && isIDFIRST_lazy(s+1)) { + else if (*s == '\'' && isIDFIRST_lazy_if(s+1,UTF)) { *d++ = ':'; *d++ = ':'; s++; @@ -5718,7 +5746,7 @@ S_scan_ident(pTHX_ register char *s, register char *send, char *dest, STRLEN des return s; } if (*s == '$' && s[1] && - (isALNUM_lazy(s+1) || strchr("${", s[1]) || strnEQ(s+1,"::",2)) ) + (isALNUM_lazy_if(s+1,UTF) || strchr("${", s[1]) || strnEQ(s+1,"::",2)) ) { return s; } @@ -5745,11 +5773,11 @@ S_scan_ident(pTHX_ register char *s, register char *send, char *dest, STRLEN des } } } - if (isIDFIRST_lazy(d)) { + if (isIDFIRST_lazy_if(d,UTF)) { d++; if (UTF) { e = s; - while (e < send && isALNUM_lazy(e) || *e == ':') { + while (e < send && isALNUM_lazy_if(e,UTF) || *e == ':') { e += UTF8SKIP(e); while (e < send && *e & 0x80 && is_utf8_mark((U8*)e)) e += UTF8SKIP(e); @@ -6053,9 +6081,9 @@ S_scan_heredoc(pTHX_ register char *s) s++, term = '\''; else term = '"'; - if (!isALNUM_lazy(s)) + if (!isALNUM_lazy_if(s,UTF)) deprecate("bare << to mean <<\"\""); - for (; isALNUM_lazy(s); s++) { + for (; isALNUM_lazy_if(s,UTF); s++) { if (d < e) *d++ = *s; } @@ -6266,7 +6294,7 @@ S_scan_inputsymbol(pTHX_ char *start) if (*d == '$' && d[1]) d++; /* allow <Pkg'VALUE> or <Pkg::VALUE> */ - while (*d && (isALNUM_lazy(d) || *d == '\'' || *d == ':')) + while (*d && (isALNUM_lazy_if(d,UTF) || *d == '\'' || *d == ':')) d++; /* If we've tried to read what we allow filehandles to look like, and @@ -6382,6 +6410,7 @@ S_scan_str(pTHX_ char *start, int keep_quoted, int keep_delims) register char term; /* terminating character */ register char *to; /* current position in the sv's data */ I32 brackets = 1; /* bracket nesting level */ + bool has_utf = FALSE; /* is there any utf8 content? */ /* skip space before the delimiter */ if (isSPACE(*s)) @@ -6392,6 +6421,9 @@ S_scan_str(pTHX_ char *start, int keep_quoted, int keep_delims) /* after skipping whitespace, the next character is the terminator */ term = *s; + if ((term & 0x80) && UTF) + has_utf = TRUE; + /* mark where we are */ PL_multi_start = CopLINE(PL_curcop); PL_multi_open = term; @@ -6436,6 +6468,8 @@ S_scan_str(pTHX_ char *start, int keep_quoted, int keep_delims) have found the terminator */ else if (*s == term) break; + else if (!has_utf && (*s & 0x80) && UTF) + has_utf = TRUE; *to = *s; } } @@ -6463,6 +6497,8 @@ S_scan_str(pTHX_ char *start, int keep_quoted, int keep_delims) break; else if (*s == PL_multi_open) brackets++; + else if (!has_utf && (*s & 0x80) && UTF) + has_utf = TRUE; *to = *s; } } @@ -6474,7 +6510,8 @@ S_scan_str(pTHX_ char *start, int keep_quoted, int keep_delims) * this next chunk reads more into the buffer if we're not done yet */ - if (s < PL_bufend) break; /* handle case where we are done yet :-) */ + if (s < PL_bufend) + break; /* handle case where we are done yet :-) */ #ifndef PERL_STRICT_CR if (to - SvPVX(sv) >= 2) { @@ -6521,6 +6558,8 @@ S_scan_str(pTHX_ char *start, int keep_quoted, int keep_delims) if (keep_delims) sv_catpvn(sv, s, 1); + if (has_utf) + SvUTF8_on(sv); PL_multi_end = CopLINE(PL_curcop); s++; @@ -6857,6 +6896,7 @@ Perl_scan_num(pTHX_ char *start) U8 tmpbuf[10]; U8 *tmpend; NV nshift = 1.0; + bool utf8 = FALSE; s++; /* get past 'v' */ sv = NEWSV(92,5); @@ -6864,12 +6904,21 @@ Perl_scan_num(pTHX_ char *start) sv_setpvn(sv, "", 0); do { + if (*s == '0' && isDIGIT(s[1])) + yyerror("Octal number in vector unsupported"); rev = atoi(s); s = ++pos; while (isDIGIT(*pos)) pos++; - tmpend = uv_to_utf8(tmpbuf, rev); + if (rev > 127) { + tmpend = uv_to_utf8(tmpbuf, rev); + utf8 = TRUE; + } + else { + tmpbuf[0] = (U8)rev; + tmpend = &tmpbuf[1]; + } *tmpend = '\0'; sv_catpvn(sv, (const char*)tmpbuf, tmpend - tmpbuf); if (rev > 0) @@ -6877,9 +6926,12 @@ Perl_scan_num(pTHX_ char *start) nshift *= 1000; } while (*pos == '.' && isDIGIT(pos[1])); + if (*s == '0' && isDIGIT(s[1])) + yyerror("Octal number in vector unsupported"); rev = atoi(s); s = pos; tmpend = uv_to_utf8(tmpbuf, rev); + utf8 = utf8 || rev > 127; *tmpend = '\0'; sv_catpvn(sv, (const char*)tmpbuf, tmpend - tmpbuf); if (rev > 0) @@ -6888,7 +6940,8 @@ Perl_scan_num(pTHX_ char *start) SvPOK_on(sv); SvNOK_on(sv); SvREADONLY_on(sv); - SvUTF8_on(sv); + if (utf8) + SvUTF8_on(sv); } } break; @@ -7009,8 +7062,7 @@ Perl_start_subparse(pTHX_ I32 is_format, U32 flags) SAVEI32(PL_subline); save_item(PL_subname); SAVEI32(PL_padix); - SAVEVPTR(PL_curpad); - SAVESPTR(PL_comppad); + SAVECOMPPAD(); SAVESPTR(PL_comppad_name); SAVESPTR(PL_compcv); SAVEI32(PL_comppad_name_fill); @@ -7122,7 +7174,7 @@ Perl_yyerror(pTHX_ char *s) PL_multi_end = 0; } if (PL_in_eval & EVAL_WARNONLY) - Perl_warn(aTHX_ "%_", msg); + Perl_warn(aTHX_ "%"SVf, msg); else qerror(msg); if (PL_error_count >= 10) diff --git a/universal.c b/universal.c index aa5487ff0e..1e5a1a0efe 100644 --- a/universal.c +++ b/universal.c @@ -73,6 +73,16 @@ S_isa_lookup(pTHX_ HV *stash, const char *name, int len, int level) return boolSV(strEQ(name, "UNIVERSAL")); } +/* +=for apidoc sv_derived_from + +Returns a boolean indicating whether the SV is derived from the specified +class. This is the function that implements C<UNIVERSAL::isa>. It works +for class names as well as for objects. + +=cut +*/ + bool Perl_sv_derived_from(pTHX_ SV *sv, const char *name) { @@ -122,7 +122,7 @@ # ifdef POSIX_BC # define PERL_SYS_INIT(c,v) sigignore(SIGFPE); MALLOC_INIT # else -# ifdef CYGWIN +# ifdef __CYGWIN__ # define PERL_SYS_INIT(c,v) Perl_my_setenv_init(&environ); MALLOC_INIT # else # define PERL_SYS_INIT(c,v) MALLOC_INIT @@ -1,6 +1,6 @@ /* utf8.c * - * Copyright (c) 1998-1999, Larry Wall + * Copyright (c) 1998-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -84,6 +84,11 @@ Perl_uv_to_utf8(pTHX_ U8 *d, UV uv) #ifdef HAS_QUAD { *d++ = 0xff; /* Can't match U+FFFE! */ + *d++ = 0x80; /* 6 Reserved bits */ + *d++ = (((uv >> 60) & 0x0f) | 0x80); /* 2 Reserved bits */ + *d++ = (((uv >> 54) & 0x3f) | 0x80); + *d++ = (((uv >> 48) & 0x3f) | 0x80); + *d++ = (((uv >> 42) & 0x3f) | 0x80); *d++ = (((uv >> 36) & 0x3f) | 0x80); *d++ = (((uv >> 30) & 0x3f) | 0x80); *d++ = (((uv >> 24) & 0x3f) | 0x80); @@ -120,8 +125,8 @@ Perl_utf8_to_uv(pTHX_ U8* s, I32* retlen) else if (!(uv & 0x08)) { len = 4; uv &= 0x07; } else if (!(uv & 0x04)) { len = 5; uv &= 0x03; } else if (!(uv & 0x02)) { len = 6; uv &= 0x01; } - else if (!(uv & 0x01)) { len = 7; uv &= 0x00; } - else len = 8; /* whoa! */ + else if (!(uv & 0x01)) { len = 7; uv = 0; } + else { len = 13; uv = 0; } /* whoa! */ if (retlen) *retlen = len; @@ -1,6 +1,6 @@ /* utf8.h * - * Copyright (c) 1998-1999, Larry Wall + * Copyright (c) 1998-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -18,7 +18,8 @@ EXTCONST unsigned char PL_utf8skip[] = { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* bogus */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* bogus */ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, /* scripts */ -3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,6,6,7,8, /* cjk etc. */ +3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,6,6, /* cjk etc. */ +7,13, /* Perl extended (not UTF-8). Up to 72bit allowed (64-bit + reserved). */ }; #else EXTCONST unsigned char PL_utf8skip[]; @@ -26,7 +27,23 @@ EXTCONST unsigned char PL_utf8skip[]; END_EXTERN_C -#define IN_UTF8 (PL_curcop->op_private & HINT_UTF8) +/*#define IN_UTF8 (PL_curcop->op_private & HINT_UTF8)*/ #define IN_BYTE (PL_curcop->op_private & HINT_BYTE) +#define DO_UTF8(sv) (SvUTF8(sv) && !IN_BYTE) #define UTF8SKIP(s) PL_utf8skip[*(U8*)s] + +/* + * Note: we try to be careful never to call the isXXX_utf8() functions + * unless we're pretty sure we've seen the beginning of a UTF-8 character + * (that is, the two high bits are set). Otherwise we risk loading in the + * heavy-duty SWASHINIT and SWASHGET routines unnecessarily. + */ +#define isIDFIRST_lazy_if(p,c) ((!c || (*((U8*)p) < 0xc0)) \ + ? isIDFIRST(*(p)) \ + : isIDFIRST_utf8((U8*)p)) +#define isALNUM_lazy_if(p,c) ((!c || (*((U8*)p) < 0xc0)) \ + ? isALNUM(*(p)) \ + : isALNUM_utf8((U8*)p)) +#define isIDFIRST_lazy(p) isIDFIRST_lazy_if(p,1) +#define isALNUM_lazy(p) isALNUM_lazy_if(p,1) @@ -1,6 +1,6 @@ /* util.c * - * Copyright (c) 1991-1999, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -912,6 +912,15 @@ Perl_mem_collxfrm(pTHX_ const char *s, STRLEN len, STRLEN *xlen) If FBMcf_TAIL, the table is created as if the string has a trailing \n. */ +/* +=for apidoc fbm_compile + +Analyses the string in order to make fast searches on it using fbm_instr() +-- the Boyer-Moore algorithm. + +=cut +*/ + void Perl_fbm_compile(pTHX_ SV *sv, U32 flags) { @@ -972,6 +981,17 @@ Perl_fbm_compile(pTHX_ SV *sv, U32 flags) /* If SvTAIL is actually due to \Z or \z, this gives false positives if multiline */ +/* +=for apidoc fbm_instr + +Returns the location of the SV in the string delimited by C<str> and +C<strend>. It returns C<Nullch> if the string can't be found. The C<sv> +does not have to be fbm_compiled, but the search will not be as fast +then. + +=cut +*/ + char * Perl_fbm_instr(pTHX_ unsigned char *big, register unsigned char *bigend, SV *littlestr, U32 flags) { @@ -1304,6 +1324,14 @@ Perl_ibcmp_locale(pTHX_ const char *s1, const char *s2, register I32 len) /* copy a string to a safe spot */ +/* +=for apidoc savepv + +Copy a string to a safe spot. This does not use an SV. + +=cut +*/ + char * Perl_savepv(pTHX_ const char *sv) { @@ -1316,6 +1344,15 @@ Perl_savepv(pTHX_ const char *sv) /* same thing but with a known length */ +/* +=for apidoc savepvn + +Copy a string to a safe spot. The C<len> indicates number of bytes to +copy. This does not use an SV. + +=cut +*/ + char * Perl_savepvn(pTHX_ const char *sv, register I32 len) { @@ -1620,6 +1657,16 @@ Perl_croak_nocontext(const char *pat, ...) } #endif /* PERL_IMPLICIT_CONTEXT */ +/* +=for apidoc croak + +This is the XSUB-writer's interface to Perl's C<die> function. Use this +function the same way you use the C C<printf> function. See +C<warn>. + +=cut +*/ + void Perl_croak(pTHX_ const char *pat, ...) { @@ -1699,6 +1746,16 @@ Perl_warn_nocontext(const char *pat, ...) } #endif /* PERL_IMPLICIT_CONTEXT */ +/* +=for apidoc warn + +This is the XSUB-writer's interface to Perl's C<warn> function. Use this +function the same way you use the C C<printf> function. See +C<croak>. + +=cut +*/ + void Perl_warn(pTHX_ const char *pat, ...) { @@ -1824,7 +1881,7 @@ Perl_vwarner(pTHX_ U32 err, const char* pat, va_list* args) } #ifndef VMS /* VMS' my_setenv() is in VMS.c */ -#if !defined(WIN32) && !defined(CYGWIN) +#if !defined(WIN32) && !defined(__CYGWIN__) void Perl_my_setenv(pTHX_ char *nam, char *val) { @@ -1874,8 +1931,8 @@ Perl_my_setenv(pTHX_ char *nam, char *val) #endif /* PERL_USE_SAFE_PUTENV */ } -#else /* WIN32 || CYGWIN */ -#if defined(CYGWIN) +#else /* WIN32 || __CYGWIN__ */ +#if defined(__CYGWIN__) /* * Save environ of perl.exe, currently Cygwin links in separate environ's * for each exe/dll. Probably should be a member of impure_ptr. @@ -3702,7 +3759,8 @@ Perl_my_fflush_all(pTHX) } NV -Perl_my_atof(pTHX_ const char* s) { +Perl_my_atof(pTHX_ const char* s) +{ #ifdef USE_LOCALE_NUMERIC if ((PL_hints & HINT_LOCALE) && PL_numeric_local) { NV x, y; @@ -3721,3 +3779,23 @@ Perl_my_atof(pTHX_ const char* s) { return Perl_atof(s); #endif } + +void +Perl_report_closed_fh(pTHX_ GV *gv, IO *io, const char *func, const char *obj) +{ + SV *sv; + char *name; + + assert(gv); + + sv = sv_newmortal(); + gv_efullname3(sv, gv, Nullch); + name = SvPVX(sv); + + Perl_warner(aTHX_ WARN_CLOSED, "%s() on closed %s %s", func, obj, name); + + if (io && IoDIRP(io)) + Perl_warner(aTHX_ WARN_CLOSED, + "(Are you trying to call %s() on dirhandle %s?)\n", + func, name); +} @@ -1,6 +1,6 @@ /* util.h * - * Copyright (c) 1991-1997, Larry Wall + * Copyright (c) 1991-2000, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. diff --git a/utils/dprofpp.PL b/utils/dprofpp.PL index ba099c0279..a6a1d911a5 100644 --- a/utils/dprofpp.PL +++ b/utils/dprofpp.PL @@ -22,7 +22,7 @@ my $dprof_pm = '../ext/Devel/DProf/DProf.pm'; my $VERSION = 0; open( PM, "<$dprof_pm" ) || die "Can't open $dprof_pm: $!"; while(<PM>){ - if( /^\$Devel::DProf::VERSION\s*=\s*'(\d+)'/ ){ + if( /^\$Devel::DProf::VERSION\s*=\s*'([\d._]+)'/ ){ $VERSION = $1; last; } @@ -45,7 +45,7 @@ $Config{'startperl'} require 5.003; -my \$VERSION = $VERSION; +my \$VERSION = '$VERSION'; !GROK!THIS! diff --git a/utils/h2xs.PL b/utils/h2xs.PL index ca55c0ace2..76e2d65e8b 100644 --- a/utils/h2xs.PL +++ b/utils/h2xs.PL @@ -956,6 +956,7 @@ END static double constant(char *name, int len, int arg) { + errno = 0; if (strEQ(name + $offarg, "$list->[0]")) { /* $pref removed */ #ifdef $pref$list->[0] return $protect$pref$list->[0]; @@ -994,6 +995,9 @@ END static double constant$npref(char *name, int len, int arg) { +END + + print $fh <<"END" if $npref eq ''; errno = 0; END @@ -1286,19 +1290,22 @@ EOP warn "Writing $ext$modpname/Makefile.PL\n"; open(PL, ">Makefile.PL") || die "Can't create $ext$modpname/Makefile.PL: $!\n"; -print PL <<'END'; +print PL <<END; use ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. +WriteMakefile( + 'NAME' => '$module', + 'VERSION_FROM' => '$modfname.pm', # finds \$VERSION + 'PREREQ_PM' => {}, # e.g., Module::Name => 1.1 END -print PL "WriteMakefile(\n"; -print PL " 'NAME' => '$module',\n"; -print PL " 'VERSION_FROM' => '$modfname.pm', # finds \$VERSION\n"; -if( ! $opt_X ){ # print C stuff, unless XS is disabled +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' => '$opt_F', # e.g., '-DHAVE_SOMETHING' \n"; - print PL " 'INC' => '', # e.g., '-I/usr/include/other' \n"; + print PL <<END; + 'LIBS' => ['$extralibs'], # e.g., '-lm' + 'DEFINE' => '$opt_F', # e.g., '-DHAVE_SOMETHING' + 'INC' => '', # e.g., '-I/usr/include/other' +END } print PL ");\n"; close(PL) || die "Can't close $ext$modpname/Makefile.PL: $!\n"; diff --git a/utils/perlbug.PL b/utils/perlbug.PL index c46df79ef3..97f8d867da 100644 --- a/utils/perlbug.PL +++ b/utils/perlbug.PL @@ -57,12 +57,14 @@ print "Extracting $file (with variable substitutions)\n"; # In this section, perl variables will be expanded during extraction. # You can use $Config{...} to use Configure variables. +my $extract_version = sprintf("v%v", $^V); + print OUT <<"!GROK!THIS!"; $Config{startperl} eval 'exec $Config{perlpath} -S \$0 \${1+"\$@"}' if \$running_under_some_shell; -my \$config_tag1 = '$] - $Config{cf_time}'; +my \$config_tag1 = '$extract_version - $Config{cf_time}'; my \$patchlevel_date = $patchlevel_date; my \$patch_tags = '$patch_tags'; @@ -76,7 +78,7 @@ my \@patches = ( print OUT <<'!NO!SUBS!'; use Config; -use File::Spec::Functions; +use File::Spec; # keep perlbug Perl 5.005 compatible use Getopt::Std; use strict; @@ -131,7 +133,9 @@ my( $file, $usefile, $cc, $address, $perlbug, $testaddress, $filename, $subject, $from, $verbose, $ed, $outfile, $Is_MacOS, $fh, $me, $Is_MSWin32, $Is_VMS, $msg, $body, $andcc, %REP, $ok); -my $config_tag2 = "$] - $Config{cf_time}"; +my $perl_version = $^V ? sprintf("v%v", $^V) : $]; + +my $config_tag2 = "$perl_version - $Config{cf_time}"; Init(); @@ -242,7 +246,7 @@ EOF $::opt_C = 1; # don't send a copy to the local admin $::opt_s = 1; # we have a subject line $subject = ($::opt_n ? 'Not ' : '') - . "OK: perl $] ${patch_tags}on" + . "OK: perl $perl_version ${patch_tags}on" ." $::Config{'archname'} $::Config{'osvers'} $subject"; $ok = 1; } else { @@ -470,7 +474,7 @@ EOF print REP <<EOF; This is a $reptype report for perl from $from, -generated with the help of perlbug $Version running under perl $]. +generated with the help of perlbug $Version running under perl $perl_version. EOF @@ -513,12 +517,12 @@ sub Dump { local(*OUT) = @_; print REP "\n---\n"; - print REP "This perlbug was built using Perl $config_tag2\n", - "It is being executed now by Perl $config_tag1.\n\n" + print REP "This perlbug was built using Perl $config_tag1\n", + "It is being executed now by Perl $config_tag2.\n\n" if $config_tag2 ne $config_tag1; print OUT <<EOF; -Site configuration information for perl $]: +Site configuration information for perl $perl_version: EOF if ($::Config{cf_by} and $::Config{cf_time}) { @@ -534,7 +538,7 @@ EOF print OUT <<EOF; --- -\@INC for perl $]: +\@INC for perl $perl_version: EOF for my $i (@INC) { print OUT " $i\n"; @@ -543,7 +547,7 @@ EOF print OUT <<EOF; --- -Environment for perl $]: +Environment for perl $perl_version: EOF my @env = qw(PATH LD_LIBRARY_PATH LANG PERL_BADLANG SHELL HOME LOGDIR LANGUAGE); @@ -557,7 +561,7 @@ EOF "\n"; } if ($verbose) { - print OUT "\nComplete configuration data for perl $]:\n\n"; + print OUT "\nComplete configuration data for perl $perl_version:\n\n"; my $value; foreach (sort keys %::Config) { $value = $::Config{$_}; @@ -848,8 +852,8 @@ sub filename { : '/tmp'; $filename = "bugrep0$$"; # $dir .= "\\" if $Is_MSWin32 and $dir !~ m|[\\/]$|; - $filename++ while -e catfile($dir, $filename); - $filename = catfile($dir, $filename); + $filename++ while -e File::Spec->catfile($dir, $filename); + $filename = File::Spec->catfile($dir, $filename); } sub paraprint { diff --git a/utils/perldoc.PL b/utils/perldoc.PL index 5dd0e1b1fb..c4a9113b4a 100644 --- a/utils/perldoc.PL +++ b/utils/perldoc.PL @@ -559,6 +559,13 @@ if ($opt_q) { local @ARGV = @found; # I'm lazy, sue me. my $found = 0; my %found_in; + my $rx = eval { qr/$opt_q/ }; + die <<EOD unless $rx; +Invalid regular expression '$opt_q' given as -q pattern: + $@ +Did you mean \\Q$opt_q ? + +EOD while (<>) { if (/^=head2\s+.*(?:$opt_q)/oi) { diff --git a/vms/descrip_mms.template b/vms/descrip_mms.template index 1a37d876c0..d8b49c7cea 100644 --- a/vms/descrip_mms.template +++ b/vms/descrip_mms.template @@ -230,7 +230,7 @@ NOOP = continue # are built using these macros should depend on $(MINIPERL_EXE) MINIPERL_EXE = Sys$Disk:[]miniperl$(E) MINIPERL = MCR $(MINIPERL_EXE) "-I[.lib]" -XSUBPP = $(MINIPERL) [.lib.extutils]xsubpp -noprototypes +XSUBPP = $(MINIPERL) "-I[.ext.re]" [.lib.extutils]xsubpp -noprototypes # Macro to invoke a preexisting copy of Perl. This is used to regenerate # some header files when rebuilding Perl, but premade versions are provided # in the distribution, so it's OK if this doesn't work; it's here to make @@ -315,7 +315,8 @@ ac10 = $(ARCHCORE)regexp.h $(ARCHCORE)regnodes.h $(ARCHCORE)scope.h ac11 = $(ARCHCORE)sv.h $(ARCHCORE)thrdvar.h $(ARCHCORE)opnames.h ac12 = $(ARCHCORE)thread.h $(ARCHCORE)utf8.h $(ARCHCORE)util.h ac13 = $(ARCHCORE)vmsish.h $(ARCHCORE)warnings.h $(ARCHCORE)xsub.h -ac = $(ac0) $(ac1) $(ac2) $(ac3) $(ac4) $(ac5) $(ac6) $(ac7) $(ac8) $(ac9) $(ac10) $(ac11) $(ac12) $(ac13) +ac14 = $(ARCHCORE)perlshr_attr.opt $(ARCHCORE)perlshr_bld.opt +ac = $(ac0) $(ac1) $(ac2) $(ac3) $(ac4) $(ac5) $(ac6) $(ac7) $(ac8) $(ac9) $(ac10) $(ac11) $(ac12) $(ac13) $(ac14) CRTL = []crtl.opt CRTLOPTS =,$(CRTL)/Options @@ -339,7 +340,7 @@ CRTLOPTS =,$(CRTL)/Options .endif # Modules which must be installed before we can build extensions -LIBPREREQ = $(ARCHDIR)Config.pm [.lib]DynaLoader.pm [.lib]vmsish.pm [.lib.VMS]Filespec.pm [.lib.ExtUtils]XSSymSet.pm +LIBPREREQ = $(ARCHDIR)Config.pm [.lib]DynaLoader.pm [.lib]XSLoader.pm [.lib]vmsish.pm [.lib.VMS]Filespec.pm [.lib.ExtUtils]XSSymSet.pm utils1 = [.lib.pod]perldoc.com [.lib.ExtUtils]Miniperl.pm [.utils]c2ph.com [.utils]h2ph.com [.utils]h2xs.com [.lib]perlbug.com [.lib]perlcc.com [.utils]dprofpp.com utils2 = [.lib]splain.com [.utils]pl2pm.com @@ -457,10 +458,19 @@ $(ARCHDIR)config.pm : [.lib]config.pm @ If F$Search("[.lib]auto.dir").eqs."" Then Create/Directory [.lib.auto] @ $(MINIPERL) -e "use AutoSplit; autosplit_lib_modules(@ARGV)" [.lib]DynaLoader.pm +[.lib]XSLoader.pm : [.ext.dynaloader]xsloader.pm + Copy/Log/NoConfirm [.ext.dynaloader]xsloader.pm [.lib]XSLoader.pm + @ If F$Search("[.lib]auto.dir").eqs."" Then Create/Directory [.lib.auto] + @ $(MINIPERL) -e "use AutoSplit; autosplit_lib_modules(@ARGV)" [.lib]XSLoader.pm + [.ext.dynaloader]dynaloader.pm : [.ext.dynaloader]dynaloader_pm.pl $(MINIPERL) $(MMS$SOURCE) @ Rename/Log dynaloader.pm [.ext.dynaloader] +[.ext.dynaloader]xsloader.pm : [.ext.dynaloader]xsloader_pm.pl + $(MINIPERL) $(MMS$SOURCE) + @ Rename/Log xsloader.pm [.ext.dynaloader] + dynext : $(LIBPREREQ) $(DBG)perlshr$(E) @build_ext "$(dynamic_ext)" "$(MINIPERL_EXE)" "$(MMS)" @@ -796,6 +806,7 @@ test : all [.t.lib]vmsfspec.t [.t.lib]vmsish.t # install ought not need a source, but it doesn't work if one's not # there. Go figure... install : $(MINIPERL_EXE) + If F$TrnLnm("Sys") .nes. "" Then Deass SYS $(MINIPERL) installperl archify : all @@ -1085,6 +1096,7 @@ tidy : cleanlis - If F$Search("[.Lib.Auto...]*.al;-1").nes."" Then Purge/NoConfirm/Log [.Lib.Auto...]*.al - If F$Search("[.Lib.Auto...]autosplit.ix;-1").nes."" Then Purge/NoConfirm/Log [.Lib.Auto...]autosplit.ix - If F$Search("[.Lib]DynaLoader.pm;-1").nes."" Then Purge/NoConfirm/Log [.Lib]DynaLoader.pm + - If F$Search("[.Lib]XSLoader.pm;-1").nes."" Then Purge/NoConfirm/Log [.Lib]XSLoader.pm - If F$Search("[.Lib]Socket.pm;-1").nes."" Then Purge/NoConfirm/Log [.Lib]Socket.pm - If F$Search("[.Lib]Config.pm;-1").nes."" Then Purge/NoConfirm/Log [.Lib]Config.pm - If F$Search("$(ARCHDIR)Config.pm;-1").nes."" Then Purge/NoConfirm/Log $(ARCHDIR)Config.pm @@ -1117,6 +1129,7 @@ clean : tidy - If F$Search("[.Ext.DynaLoader]DL_VMS$(O)").nes."" Then Delete/NoConfirm/Log [.Ext.DynaLoader]DL_VMS$(O);* - If F$Search("[.Ext.DynaLoader]DL_VMS.C").nes."" Then Delete/NoConfirm/Log [.Ext.DynaLoader]DL_VMS.C;* - If F$Search("[.Ext.DynaLoader]DynaLoader.pm").nes."" Then Delete/NoConfirm/Log [.Ext.DynaLoader]DynaLoader.pm;* + - If F$Search("[.Ext.DynaLoader]XSLoader.pm").nes."" Then Delete/NoConfirm/Log [.Ext.DynaLoader]XSLoader.pm;* - If F$Search("[.Ext.Socket]Socket$(O)").nes."" Then Delete/NoConfirm/Log [.Ext.Socket]Socket$(O);* - If F$Search("[.Ext.Socket]Socket.C").nes."" Then Delete/NoConfirm/Log [.Ext.Socket]Socket.C;* - If F$Search("[.VMS.Ext...]*.C").nes."" Then Delete/NoConfirm/Log [.VMS.Ext...]*.C;* @@ -1133,7 +1146,9 @@ realclean : clean - If F$Search("Descrip.MMS").nes."" Then Delete/NoConfirm/Log Descrip.MMS;* - If F$Search("Build_Ext.Com").nes."" Then Delete/NoConfirm/Log Build_Ext.Com;* - $(MINIPERL) -e "use File::Path; rmtree(['lib/auto','lib/VMS','lib/$(ARCH)'],1,0);" + - If F$Search("*.TS").nes."" Then Delete/NoConfirm/Log *.TS;* - If F$Search("[.Lib]DynaLoader.pm").nes."" Then Delete/NoConfirm/Log [.Lib]DynaLoader.pm;* + - If F$Search("[.Lib]XSLoader.pm").nes."" Then Delete/NoConfirm/Log [.Lib]XSLoader.pm;* - If F$Search("[.Lib]Socket.pm").nes."" Then Delete/NoConfirm/Log [.Lib]Socket.pm;* - If F$Search("[.Lib]Config.pm").nes."" Then Delete/NoConfirm/Log [.Lib]Config.pm;* - If F$Search("[.Lib]*.com").nes."" Then Delete/NoConfirm/Log [.Lib]*.com;* diff --git a/vms/perly_c.vms b/vms/perly_c.vms index ebc7d57cc3..b17faeade1 100644 --- a/vms/perly_c.vms +++ b/vms/perly_c.vms @@ -1828,7 +1828,7 @@ case 59: #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, "STOP") || strEQ(name, "INIT")) + || strEQ(name, "INIT") || strEQ(name, "CHECK")) CvSPECIAL_on(PL_compcv); yyval.opval = yyvsp[0].opval; } break; diff --git a/vms/subconfigure.com b/vms/subconfigure.com index 1e0d003826..b5d89bfaf1 100644 --- a/vms/subconfigure.com +++ b/vms/subconfigure.com @@ -63,6 +63,7 @@ $ myname = myhostname $ if "''myname'" .eqs. "" THEN myname = f$trnlnm("SYS$NODE") $! $! ##ADD NEW CONSTANTS HERE## +$ perl_d_nv_preserves_uv = "define" $ perl_d_fs_data_s = "undef" $ perl_d_getmnt = "undef" $ perl_d_sqrtl = "define" @@ -488,10 +489,13 @@ $ perl_arch = "''perl_arch'-thread" $ perl_archname = "''perl_archname'-thread" $ perl_d_old_pthread_create_joinable = "undef" $ perl_old_pthread_create_joinable = " " +$ perl_use5005threads = "define" $ ELSE $ perl_d_old_pthread_create_joinable = "undef" $ perl_old_pthread_create_joinable = " " +$ perl_use5005threads = "undef" $ ENDIF +$ perl_useithreads = "undef" $ perl_osvers=f$edit(osvers, "TRIM") $ if (perl_subversion + 0).eq.0 $ THEN @@ -1588,6 +1592,144 @@ $ ENDIF $ ENDIF $ WRITE_RESULT "d_strtoull is ''perl_d_strtoull'" $! +$! Check for strtouq +$! +$ OS +$ WS "#ifdef __DECC +$ WS "#include <stdlib.h> +$ WS "#endif +$ WS "#include <string.h> +$ WS "int main() +$ WS "{" +$ WS "unsigned __int64 result; +$ WS "result = strtouq(""123123"", NULL, 10); +$ WS "exit(0); +$ WS "}" +$ CS +$ DEFINE SYS$ERROR _NLA0: +$ DEFINE SYS$OUTPUT _NLA0: +$ on error then continue +$ on warning then continue +$ 'Checkcc' temp.c +$ savedstatus = $status +$ teststatus = f$extract(9,1,savedstatus) +$ if (teststatus.nes."1") +$ THEN +$ perl_d_strtouq="undef" +$ DEASSIGN SYS$OUTPUT +$ DEASSIGN SYS$ERROR +$ ELSE +$ If (Needs_Opt.eqs."Yes") +$ THEN +$ link temp.obj,temp.opt/opt +$ else +$ link temp.obj +$ endif +$ savedstatus = $status +$ teststatus = f$extract(9,1,savedstatus) +$ DEASSIGN SYS$OUTPUT +$ DEASSIGN SYS$ERROR +$ if (teststatus.nes."1") +$ THEN +$ perl_d_strtouq="undef" +$ ELSE +$ perl_d_strtouq="define" +$ ENDIF +$ ENDIF +$ WRITE_RESULT "d_strtouq is ''perl_d_strtouq'" +$! +$! Check for strtoll +$! +$ OS +$ WS "#ifdef __DECC +$ WS "#include <stdlib.h> +$ WS "#endif +$ WS "#include <string.h> +$ WS "int main() +$ WS "{" +$ WS "__int64 result; +$ WS "result = strtoll(""123123"", NULL, 10); +$ WS "exit(0); +$ WS "}" +$ CS +$ DEFINE SYS$ERROR _NLA0: +$ DEFINE SYS$OUTPUT _NLA0: +$ on error then continue +$ on warning then continue +$ 'Checkcc' temp.c +$ savedstatus = $status +$ teststatus = f$extract(9,1,savedstatus) +$ if (teststatus.nes."1") +$ THEN +$ perl_d_strtoll="undef" +$ DEASSIGN SYS$OUTPUT +$ DEASSIGN SYS$ERROR +$ ELSE +$ If (Needs_Opt.eqs."Yes") +$ THEN +$ link temp.obj,temp.opt/opt +$ else +$ link temp.obj +$ endif +$ savedstatus = $status +$ teststatus = f$extract(9,1,savedstatus) +$ DEASSIGN SYS$OUTPUT +$ DEASSIGN SYS$ERROR +$ if (teststatus.nes."1") +$ THEN +$ perl_d_strtoll="undef" +$ ELSE +$ perl_d_strtoll="define" +$ ENDIF +$ ENDIF +$ WRITE_RESULT "d_strtoll is ''perl_d_strtoll'" +$! +$! Check for strtold +$! +$ OS +$ WS "#ifdef __DECC +$ WS "#include <stdlib.h> +$ WS "#endif +$ WS "#include <string.h> +$ WS "int main() +$ WS "{" +$ WS "long double result; +$ WS "result = strtold(""123123"", NULL, 10); +$ WS "exit(0); +$ WS "}" +$ CS +$ DEFINE SYS$ERROR _NLA0: +$ DEFINE SYS$OUTPUT _NLA0: +$ on error then continue +$ on warning then continue +$ 'Checkcc' temp.c +$ savedstatus = $status +$ teststatus = f$extract(9,1,savedstatus) +$ if (teststatus.nes."1") +$ THEN +$ perl_d_strtold="undef" +$ DEASSIGN SYS$OUTPUT +$ DEASSIGN SYS$ERROR +$ ELSE +$ If (Needs_Opt.eqs."Yes") +$ THEN +$ link temp.obj,temp.opt/opt +$ else +$ link temp.obj +$ endif +$ savedstatus = $status +$ teststatus = f$extract(9,1,savedstatus) +$ DEASSIGN SYS$OUTPUT +$ DEASSIGN SYS$ERROR +$ if (teststatus.nes."1") +$ THEN +$ perl_d_strtold="undef" +$ ELSE +$ perl_d_strtold="define" +$ ENDIF +$ ENDIF +$ WRITE_RESULT "d_strtold is ''perl_d_strtold'" +$! $! Check for atoll $! $ OS @@ -2941,8 +3083,8 @@ $ perl_i16type="short" $ perl_u16type="unsigned short" $ perl_i32type="int" $ perl_u32type="unsigned int" -$ perl_i64type="long" -$ perl_u64type="unsigned long" +$ perl_i64type="long long" +$ perl_u64type="unsigned long long" $ perl_nvtype="double" $! $ GOTO beyond_type_size_check @@ -3117,6 +3259,9 @@ $ WC "# Time: " + perl_cf_time $ WC "" $ WC "CONFIGDOTSH=true" $ WC "package='" + perl_package + "'" +$ WC "d_nv_preserves_uv='" + perl_d_nv_preserves_uv + "'" +$ WC "use5005threads='" + perl_use5005threads + "'" +$ WC "useithreads='" + perl_useithreads + "'" $ WC "CONFIG='" + perl_config + "'" $ WC "cf_time='" + perl_cf_time + "'" $ WC "cf_by='" + perl_cf_by+ "'" @@ -3574,6 +3719,9 @@ $ WC "crosscompile='" + perl_crosscompile + "'" $ WC "multiarch='" + perl_multiarch + "'" $ WC "sched_yield='" + perl_sched_yield + "'" $ WC "d_strtoull='" + perl_d_strtoull + "'" +$ WC "d_strtouq='" + perl_d_strtouq + "'" +$ WC "d_strtoll='" + perl_d_strtoll + "'" +$ WC "d_strtold='" + perl_d_strtold + "'" $ WC "usesocks='" + perl_usesocks + "'" $ WC "d_vendorlib='" + perl_d_vendorlib + "'" $ WC "vendorlibexp='" + perl_vendorlibexp + "'" diff --git a/vos/Changes b/vos/Changes index 42262a93fb..9af03d1c5f 100644 --- a/vos/Changes +++ b/vos/Changes @@ -1,6 +1,22 @@ This file documents the changes made to port Perl to the Stratus VOS operating system. +After 5.005_63: + Supplied "config.pl" perl script that takes "config_h.SH_orig" + and "config.def" as input and produces "config.h.new". + With some luck, you will just need to edit "config.def" + to create a new port. + Updated "build.cm". + Updated "compile_perl.cm". + Added "config.def". + Updated "config.h". + Added "config.pl". + Updated "config_h.SH_orig". + Updated "perl.bind". + Updated "README.vos". + Updated "vos_dummies.c". + Updated "vosish.h". + after 5.005_02: Initial release. Supplied "build.cm" command macro to build perl. @@ -10,7 +26,7 @@ after 5.005_02: Supplied "config.h" to configure Perl 5 to VOS. Unfortunately, since VOS does not have the configure tool, this file was built by hand by editing "config_h.SH". - Supplied "config_h.SH.orig", which is the version of this file + Supplied "config_h.SH_orig", which is the version of this file that was current for version 5.005_02. Use this to discover any subsequent changes to config_h.SH that must be hand-copied into the real config.h. diff --git a/vos/build.cm b/vos/build.cm index 937e4d7807..8719d050c4 100644 --- a/vos/build.cm +++ b/vos/build.cm @@ -32,6 +32,10 @@ &if &cpu& = pa8000 &then &set_string obj .8000 & +&if &cpu& = mc68020 +&then &set_string obj2 .68k +&else &set_string obj2 &obj& +& &set_string cpu -processor &cpu& & & If requested, compile the source code. @@ -39,72 +43,88 @@ &if &recompile& = 0 &then &goto CHECK_REBIND & -!set_library_paths include << < &POSIX&>incl <tcp_os_incl &+ +!set_library_paths include << < &POSIX&>incl &+ (master_disk)>system>include_library & +&if (exists *.obj -link) +&then !unlink *.obj -no_ask -brief +& & Suppress several harmless compiler warning and advice messages. +& Use -list -show_include all -show_macros both_ways when debugging. & -!cc <<av.c -suppress_diag 2006 2064 2065 &cpu& -O4 -&if (command_status) ^= 0 &then &return -!cc <<byterun.c -suppress_diag 2006 &cpu& -O4 +&set_string cflags '-u -O4 -D_POSIX_C_SOURCE=199309L -DPERL_CORE' +& +!cc <<av.c -suppress_diag 2006 2064 2065 &cpu& &cflags& &if (command_status) ^= 0 &then &return -!cc <<deb.c -suppress_diag 2006 &cpu& -O4 +!cc <<deb.c -suppress_diag 2006 &cpu& &cflags& &if (command_status) ^= 0 &then &return -!cc <<doio.c -suppress_diag 2006 &cpu& -O4 +!cc <<doio.c -suppress_diag 2006 &cpu& &cflags& &if (command_status) ^= 0 &then &return -!cc <<doop.c -suppress_diag 2006 &cpu& -O4 +!cc <<doop.c -suppress_diag 2006 &cpu& &cflags& &if (command_status) ^= 0 &then &return -!cc <<dump.c -suppress_diag 2006 &cpu& -O4 +!cc <<dump.c -suppress_diag 2006 &cpu& &cflags& &if (command_status) ^= 0 &then &return -!cc <<ebcdic.c -suppress_diag 2006 &cpu& -O4 +!cc <<ebcdic.c -suppress_diag 2006 &cpu& &cflags& &if (command_status) ^= 0 &then &return -!cc <<globals.c -suppress_diag 2006 &cpu& -O4 +!cc <<globals.c -suppress_diag 2006 &cpu& &cflags& &if (command_status) ^= 0 &then &return -!cc <<gv.c -suppress_diag 2006 2065 &cpu& -O4 +!cc <<gv.c -suppress_diag 2006 2065 &cpu& &cflags& &if (command_status) ^= 0 &then &return -!cc <<hv.c -suppress_diag 2006 &cpu& -O4 +!cc <<hv.c -suppress_diag 2006 &cpu& &cflags& &if (command_status) ^= 0 &then &return -& !cc <<malloc.c -suppress_diag 2006 &cpu& -O4 +& !cc <<malloc.c -suppress_diag 2006 &cpu& &cflags& & &if (command_status) ^= 0 &then &return -!cc <<mg.c -suppress_diag 2006 2064 2065 &cpu& -O4 +!cc <<mg.c -suppress_diag 2006 2064 2065 &cpu& &cflags& +&if (command_status) ^= 0 &then &return +!cc <<miniperlmain.c -suppress_diag 2006 &cpu& &cflags& +&if (command_status) ^= 0 &then &return +!cc <<op.c -suppress_diag 2006 2064 2065 &cpu& &cflags& +&if (command_status) ^= 0 &then &return +!cc <<perl.c -suppress_diag 2006 2053 2065 &cpu& &cflags& &+ + -DARCHLIB="/system/ported/perl/lib/5.005&obj2&" &+ + -DARCHLIB_EXP="/system/ported/perl/lib/5.005&obj2&" &+ + -DSITEARCH="/system/ported/perl/lib/site/5.005&obj2&" &+ + -DSITEARCH_EXP="/system/ported/perl/lib/site/5.005&obj2&" &if (command_status) ^= 0 &then &return -!cc <<miniperlmain.c -suppress_diag 2006 &cpu& -O4 +!cc <<perlapi.c &cpu& &cflags& &if (command_status) ^= 0 &then &return -!cc <<op.c -suppress_diag 2006 2064 2065 &cpu& -O4 +!cc <<perlio.c -suppress_diag 2006 &cpu& &cflags& &if (command_status) ^= 0 &then &return -!cc <<perl.c -suppress_diag 2006 2065 &cpu& -O4 &+ - -DARCHLIB=">system>ported>perl&obj&" &+ - -DARCHLIB_EXP=">system>ported>perl&obj&" +!cc <<perly.c -suppress_diag 2006 &cpu& &cflags& &if (command_status) ^= 0 &then &return -!cc <<perlio.c -suppress_diag 2006 &cpu& -O4 +& compiling pp.c for the PA-RISC hits compiler bug pcg-98; avoid it. +& The bug is fixed in VOS 14.1.0 and all later releases. +&if (index (string &cpu&) pa) > 0 & (module_info os_release) < 'VOS Release 14.1.0' +&then !cc <<pp.c -suppress_diag 2006 2064 2065 &cpu& &cflags& -no_schedule +&else !cc <<pp.c -suppress_diag 2006 2064 2065 &cpu& &cflags& &if (command_status) ^= 0 &then &return -!cc <<perly.c -suppress_diag 2006 &cpu& -O4 +!cc <<pp_ctl.c -suppress_diag 2006 2064 2065 &cpu& &cflags& &if (command_status) ^= 0 &then &return -!cc <<pp.c -suppress_diag 2006 2064 &cpu& -O4 +!cc <<pp_hot.c -suppress_diag 2006 2064 2065 &cpu& &cflags& &if (command_status) ^= 0 &then &return -!cc <<pp_ctl.c -suppress_diag 2006 2064 2065 &cpu& -O4 +!cc <<pp_sys.c -suppress_diag 2006 2064 2065 &cpu& &cflags& &if (command_status) ^= 0 &then &return -!cc <<pp_hot.c -suppress_diag 2006 2064 &cpu& -O4 +!cc <<regcomp.c -suppress_diag 2006 2064 &cpu& &cflags& &if (command_status) ^= 0 &then &return -!cc <<pp_sys.c -suppress_diag 2006 2064 2065 &cpu& -O4 +!cc <<regexec.c -suppress_diag 2006 2064 &cpu& &cflags& &if (command_status) ^= 0 &then &return -!cc <<regcomp.c -suppress_diag 2006 &cpu& -O4 +!cc <<run.c -suppress_diag 2006 2065 &cpu& &cflags& &if (command_status) ^= 0 &then &return -!cc <<regexec.c -suppress_diag 2006 &cpu& -O4 +!cc <<scope.c -suppress_diag 2006 2064 2065 &cpu& &cflags& &if (command_status) ^= 0 &then &return -!cc <<run.c -suppress_diag 2006 &cpu& -O4 +!cc <<sv.c -suppress_diag 2006 2065 &cpu& &cflags& &if (command_status) ^= 0 &then &return -!cc <<scope.c -suppress_diag 2006 2064 2065 &cpu& -O4 +!cc <<taint.c -suppress_diag 2006 &cpu& &cflags& &if (command_status) ^= 0 &then &return -!cc <<sv.c -suppress_diag 2006 2065 &cpu& -O4 +!cc <<toke.c -suppress_diag 2006 2064 2065 &cpu& &cflags& &if (command_status) ^= 0 &then &return -!cc <<taint.c -suppress_diag 2006 &cpu& -O4 +!cc <<universal.c -suppress_diag 2006 &cpu& &cflags& &if (command_status) ^= 0 &then &return -!cc <<toke.c -suppress_diag 2006 2065 &cpu& -O4 +!cc <<utf8.c -suppress_diag 2065 &cpu& &cflags& &if (command_status) ^= 0 &then &return -!cc <<universal.c -suppress_diag 2006 &cpu& -O4 +!cc <<util.c -suppress_diag 2006 2065 &cpu& &cflags& &if (command_status) ^= 0 &then &return -!cc <<util.c -suppress_diag 2006 2065 &cpu& -O4 +!cc <<xsutils.c &cpu& &cflags& &if (command_status) ^= 0 &then &return !cc <vos_dummies.c &cpu& -O4 &if (command_status) ^= 0 &then &return @@ -115,16 +135,16 @@ &if &rebind& = 0 &then &return & -&if (exists -directory (master_disk)>system>tcp_os>object_library&obj&) -&then &set_string tcp_objlib (master_disk)>system>tcp_os>object_library&obj& +&if (exists -directory (master_disk)>system>tcp_os>object_library&obj2&) +&then &set_string tcp_objlib (master_disk)>system>tcp_os>object_library&obj2& &else &set_string tcp_objlib (master_disk)>system>tcp_os>object_library & -&if (exists -directory (master_disk)>system>object_library&obj&) -&then &set_string objlib (master_disk)>system>object_library&obj& +&if (exists -directory (master_disk)>system>object_library&obj2&) +&then &set_string objlib (master_disk)>system>object_library&obj2& &else &set_string objlib (master_disk)>system>object_library & -&if (exists -directory (master_disk)>system>c_object_library&obj&) -&then &set_string c_objlib (master_disk)>system>c_object_library&obj& +&if (exists -directory (master_disk)>system>c_object_library&obj2&) +&then &set_string c_objlib (master_disk)>system>c_object_library&obj2& &else &set_string c_objlib (master_disk)>system>c_object_library & !set_library_paths object . &+ diff --git a/vos/compile_perl.cm b/vos/compile_perl.cm index a75d4e4740..86a8d6a182 100644 --- a/vos/compile_perl.cm +++ b/vos/compile_perl.cm @@ -1,13 +1,40 @@ +& This command macro creates the appropriate subdirectory +& for the specified processor type and then runs the +& build macro in that subdirectory to create the perl +& executable program module file. +& Written 99-02-03 by Paul Green (Paul_Green@stratus.com) +& +&begin_parameters + cpu option(-processor)name,allow(mc68020,i80860,pa7100,pa8000),=mc68020 + recompile switch(-recompile),=1 + rebind switch(-rebind),=1 + module option(-module)module_name,='(current_module)' +&end_parameters &echo command_lines -& This macro assumes you have either licensed the cross-compilers or -& have one module of each type of architecture. Comment-out or edit -& the lines that are different for your system. -!change_current_dir obj -!start_process '<build.cm -processor mc68020' -module m75 -!change_current_dir <obj.860 -!start_process '<build.cm -processor i80860' -module m10 -!change_current_dir <obj.7100 -!start_process '<build.cm -processor pa7100' -module m9 -!change_current_dir <obj.8000 -!start_process '<build.cm -processor pa8000' -module m9 +& +&if &recompile& +&then &set_string recompile -recompile +&else &set_string recompile -no_recompile +& +&if &rebind& +&then &set_string rebind -rebind +&else &set_string rebind -no_rebind +& +&if &cpu& = mc68020 +&then &set_string obj '' +&if &cpu& = i80860 +&then &set_string obj .860 +&if &cpu& = pa7100 +&then &set_string obj .7100 +&if &cpu& = pa8000 +&then &set_string obj .8000 +& +&if ^ (exists obj&obj& -directory) +&then !create_dir obj&obj& +& +&if ^ (exists obj&obj&>build.out) +&then !create_file obj&obj&>build.out ; set_implicit_locking obj&obj&>build.out +& +!change_current_dir obj&obj& +!start_process (string <build -processor &cpu& &recompile& &rebind&) -module &module& !change_current_dir < diff --git a/vos/config.def b/vos/config.def new file mode 100644 index 0000000000..ce33890996 --- /dev/null +++ b/vos/config.def @@ -0,0 +1,439 @@ +$alignbytes='8' +$aphostname='' +$archlib='' +$archlibexp='' +$archname='vos' +$bin='/system/ported/command_library' +$binexp='/system/ported/command_library' +$byteorder='4321' +$castflags='0' +$cf_by='Paul_Green@stratus.com' +$cf_time='2000-02-03 19:13 UCT' +$cpp_stuff='42' +$cpplast='-' +$cppminus='-' +$cpprun='cc -E -' +$cppstdin='cc -E' +$crosscompile='undef' +$d_access='undef' +$d_accessx='undef' +$d_alarm='define' +$d_archlib='undef' +$d_atolf='undef' +$d_atoll='undef' +$d_attribut='undef' +$d_bcmp='undef' +$d_bcopy='undef' +$d_bincompat5005='undef' +$d_bsdgetpgrp='undef' +$d_bsdsetpgrp='undef' +$d_bzero='undef' +$d_casti32='undef' +$d_castneg='define' +$d_charvspr='undef' +$d_chown='undef' +$d_chroot='undef' +$d_chsize='undef' +$d_const='define' +$d_crypt='undef' +$d_csh='undef' +$d_cuserid='undef' +$d_dbl_dig='define' +$d_difftime='define' +$d_dirnamlen='undef' +$d_dlerror='undef' +$d_dlsymun='undef' +$d_dosuid='undef' +$d_drand48proto='undef' +$d_dup2='undef' +$d_eaccess='undef' +$d_endgrent='undef' +$d_endhent='define' +$d_endnent='define' +$d_endpent='define' +$d_endpwent='undef' +$d_endsent='define' +$d_endspent='undef' +$d_eofnblk='define' +$d_fchmod='define' +$d_fchown='undef' +$d_fcntl='define' +$d_fd_set='undef' +$d_fgetpos='define' +$d_flexfnam='define' +$d_flock='undef' +$d_fork='undef' +$d_fpathconf='define' +$d_fpos64_t='undef' +$d_fs_data_s='undef' +$d_fseeko='undef' +$d_fsetpos='define' +$d_fstatfs='undef' +$d_fstatvfs='undef' +$d_ftello='undef' +$d_Gconvert='sprintf((b),"%.*g",(n),(x))' +$d_getgrent='undef' +$d_getgrps='undef' +$d_gethbyaddr='define' +$d_gethbyname='define' +$d_gethent='define' +$d_gethname='define' +$d_gethostprotos='define' +$d_getlogin='define' +$d_getmnt='undef' +$d_getmntent='undef' +$d_getnbyaddr='define' +$d_getnbyname='define' +$d_getnent='define' +$d_getnetprotos='define' +$d_getpbyname='define' +$d_getpbynumber='define' +$d_getpent='define' +$d_getpgid='undef' +$d_getpgrp2='undef' +$d_getpgrp='define' +$d_getppid='define' +$d_getprior='undef' +$d_getprotoprotos='define' +$d_getpwent='undef' +$d_getsbyname='define' +$d_getsbyport='define' +$d_getsent='define' +$d_getservprotos='define' +$d_getspent='undef' +$d_getspnam='undef' +$d_gettimeod='undef' +$d_gnulibc='undef' +$d_grpasswd='undef' +$d_hasmntopt='undef' +$d_htonl='define' +$d_index='undef' +$d_inetaton='undef' +$d_int64t='undef' +$d_isascii='define' +$d_killpg='undef' +$d_lchown='undef' +$d_ldbl_dig='define' +$d_link='undef' +$d_locconv='define' +$d_lockf='define' +$d_longdbl='define' +$d_longlong='undef' +$d_lstat='define' +$d_mblen='define' +$d_mbstowcs='define' +$d_mbtowc='define' +$d_memchr='define' +$d_memcmp='define' +$d_memcpy='define' +$d_memmove='define' +$d_memset='define' +$d_mkdir='define' +$d_mkfifo='define' +$d_mktime='define' +$d_msg='undef' +$d_msg_ctrunc='undef' +$d_msg_dontroute='undef' +$d_msg_oob='undef' +$d_msg_peek='undef' +$d_msg_proxy='undef' +$d_mymalloc='undef' +$d_nice='undef' +$d_nv_preserves_uv='define' +$d_off64_t='undef' +$d_old_pthread_create_joinable='undef' +$d_oldpthreads='undef' +$d_open3='define' +$d_pathconf='define' +$d_pause='define' +$d_phostname='undef' +$d_pipe='define' +$d_poll='define' +$d_PRIfldbl='define' +$d_PRIgldbl='define' +$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_quad='undef' +$d_readdir='define' +$d_readlink='define' +$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='undef' +$d_select='define' +$d_sem='undef' +$d_semctl_semid_ds='undef' +$d_semctl_semun='undef' +$d_setegid='undef' +$d_seteuid='undef' +$d_setgrent='undef' +$d_setgrps='undef' +$d_sethent='define' +$d_setlinebuf='undef' +$d_setlocale='define' +$d_setnent='define' +$d_setpent='define' +$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='define' +$d_setsid='undef' +$d_setspent='undef' +$d_setvbuf='define' +$d_sfio='undef' +$d_shm='undef' +$d_shmatprototype='define' +$d_sigaction='undef' +$d_sigsetjmp='undef' +$d_sitearch='undef' +$d_socket='define' +$d_sockpair='undef' +$d_sqrtl='undef' +$d_statblks='undef' +$d_statfs_f_flags='undef' +$d_statfs_s='undef' +$d_stdio_cnt_lval='define' +$d_stdio_ptr_lval='define' +$d_stdio_stream_array='define' +$d_stdiobase='define' +$d_stdstdio='define' +$d_strchr='define' +$d_strcoll='define' +$d_strctcpy='define' +$d_strerrm='strerror(e)' +$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='define' +$d_symlink='define' +$d_syscall='undef' +$d_sysconf='define' +$d_syserrlst='define' +$d_system='define' +$d_tcgetpgrp='undef' +$d_tcsetpgrp='undef' +$d_telldir='undef' +$d_telldirproto='undef' +$d_times='define' +$d_truncate='undef' +$d_tzname='define' +$d_umask='define' +$d_uname='define' +$d_union_semun='undef' +$d_ustat='undef' +$d_vendorlib='define' +$d_vfork='undef' +$d_void_closedir='undef' +$d_volatile='define' +$d_vprintf='define' +$d_wait4='undef' +$d_waitpid='define' +$d_wcstombs='define' +$d_wctomb='define' +$db_hashtype='int' +$db_prefixtype='int' +$defvoidused='15' +$direntrytype='struct dirent' +$doublesize='8' +$drand01='rand()/(RAND_MAX+1)' +$eagain='EAGAIN' +$ebcdic='undef' +$fflushall='undef' +$fflushNULL='define' +$fpostype='fpos_t' +$freetype='void' +$full_csh='' +$full_sed='/system/ported/command_library/sed.pm' +$gidformat='"d"' +$gidsize='4' +$gidtype='gid_t' +$groupstype='gid_t' +$i16size='2' +$i16type='short' +$i32size='4' +$i32type='int' +$i64size='_error_' +$i64type='_error_' +$i8size='1' +$i8type='char' +$i_arpainet='define' +$i_dbm='undef' +$i_dirent='define' +$i_dlfcn='undef' +$i_fcntl='define' +$i_float='define' +$i_grp='undef' +$i_inttypes='undef' +$i_limits='define' +$i_locale='define' +$i_machcthr='undef' +$i_math='define' +$i_memory='undef' +$i_mntent='undef' +$i_ndbm='undef' +$i_netdb='define' +$i_neterrno='undef' +$i_netinettcp='undef' +$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_sysioctl='define' +$i_sysmount='undef' +$i_sysndir='undef' +$i_sysparam='undef' +$i_sysresrc='undef' +$i_syssecrt='undef' +$i_sysselct='define' +$i_sysstat='define' +$i_sysstatfs='undef' +$i_sysstatvfs='undef' +$i_systime='define' +$i_systimek='undef' +$i_systimes='define' +$i_systypes='define' +$i_sysuio='undef' +$i_sysun='undef' +$i_sysvfs='undef' +$i_syswait='define' +$i_termio='undef' +$i_termios='define' +$i_time='undef' +$i_unistd='define' +$i_ustat='undef' +$i_utime='define' +$i_values='define' +$i_varargs='undef' +$i_vfork='undef' +$Id='$Id' +$inc_version_list_init='' +$installusrbinperl='undef' +$intsize='4' +$ivdformat='"d"' +$ivsize='4' +$ivtype='int' +$longdblsize='8' +$longlongsize='_error_' +$longsize='4' +$lseeksize='4' +$lseektype='off_t' +$malloctype='void *' +$modetype='mode_t' +$multiarch='undef' +$myuname='VOS' +$netdb_hlen_type='int' +$netdb_host_type='char *' +$netdb_name_type='char *' +$netdb_net_type='long' +$nvtype='double' +$o_nonblock='O_NONBLOCK' +$old_pthread_create_joinable='' +$osname='VOS' +$package='perl5' +$pidtype='pid_t' +$pm_apiversion='5.00563' +$privlib='/system/ported/perl/lib/5.005' +$privlibexp='/system/ported/perl/lib/5.005' +$prototype='define' +$ptrsize='4' +$quadkind='_error_' +$quadtype='_error_' +$randbits='15' +$randseedtype='unsigned int' +$rd_nodata='-1' +$sched_yield='' +$seedfunc='srand' +$selectminbits='1' +$selecttype='fd_set *' +$sh='/bin/sh' +$shmattype='void *' +$shortsize='2' +$sig_name_init='"ZERO","ABRT","FPE","ILL","INT","SEGV","TERM","USR1","USR2","IO","HUP","URG","ALRM","KILL","PIPE","QUIT","CHLD","CONT","STOP","TSTP","TTIN","TTOU","BUS","RT1","RT2","RT3","RT4","RT5","RT6","RT7","RT8",0' +$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,0' +$signal_t='void' +$sitearch='' +$sitearchexp='' +$sitelib='/system/ported/perl/lib/site/5.005' +$sitelibexp='/system/ported/perl/lib/site/5.005' +$sizetype='size_t' +$sPRIfldbl='"Lf"' +$sPRIgldbl='"Lg"' +$src='%es#lang/vos_ftp_site/pub/vos/alpha/perl' +$ssizetype='ssize_t' +$startperl='!perl.pm' +$stdchar='unsigned char' +$stdio_base='((fp)->_base)' +$stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)' +$stdio_cnt='((fp)->_cnt)' +$stdio_ptr='((fp)->_ptr)' +$stdio_stream_array='_iob' +$timetype='time_t' +$u16size='2' +$u16type='unsigned short' +$u32size='4' +$u32type='unsigned int' +$u64size='_error_' +$u64type='_error_' +$u8size='1' +$u8type='unsigned char' +$uidformat='"d"' +$uidsize='4' +$uidtype='uid_t' +$uquadtype='_error_' +$use5005threads='undef' +$use64bits='undef' +$usedl='undef' +$uselargefiles='undef' +$uselongdouble='define' +$uselonglong='undef' +$usemorebits='undef' +$usemultiplicity='undef' +$useperlio='undef' +$usesocks='undef' +$usethreads='undef' +$uvoformat='"o"' +$uvsize='4' +$uvtype='unsigned int' +$uvuformat='"u"' +$uvxformat='"x"' +$vendorlibexp='' +$voidflags='15' +$xs_apiversion='5.00563' diff --git a/vos/config.h b/vos/config.h index d12893a326..c1fdd06dec 100644 --- a/vos/config.h +++ b/vos/config.h @@ -1,9 +1,21 @@ -/* This is config.h for Stratus VOS. It was created by hand - from the distribution copy of config_h.SH. */ +/* + * 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 $ + */ -/* Configuration time: March 5, 1999 - * Configured by: Paul Green - * Target system: Stratus VOS +/* + * Package name : perl5 + * Source directory : %es#lang/vos_ftp_site/pub/vos/alpha/perl + * Configuration time: 2000-02-03 19:13 UCT + * Configured by : Paul_Green@stratus.com + * Target system : VOS */ #ifndef _config_h_ @@ -14,32 +26,6 @@ */ #define LOC_SED "/system/ported/command_library/sed.pm" /**/ -/* 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 "/system/ported/command_library" /**/ -#define BIN_EXP "/system/ported/command_library" /**/ - -/* 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 "". - */ -#define CPPSTDIN "cc -E" -#define CPPMINUS "-" - /* HAS_ALARM: * This symbol, if defined, indicates that the alarm routine is * available. @@ -50,7 +36,7 @@ * This symbol indicates the C compiler can check for function attributes, * such as printf formats. This is normally only supported by GNU cc. */ -/*#define HASATTRIBUTE / **/ +/*#define HASATTRIBUTE /**/ #ifndef HASATTRIBUTE #define __attribute__(_arg_) #endif @@ -89,7 +75,7 @@ * 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 / **/ +/*#define HAS_CHSIZE /**/ /* HASCONST: * This symbol, if defined, indicates that this C compiler knows about @@ -152,8 +138,8 @@ * 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 /**/ /* PG: ASSUME THESE ARE NO-OPS W/O SETUID */ -/*#define DOSUID / **/ +#define SETUID_SCRIPTS_ARE_SECURE_NOW /**/ +/*#define DOSUID /**/ /* HAS_DUP2: * This symbol, if defined, indicates that the dup2 routine is @@ -195,7 +181,7 @@ * This symbol, if defined, indicates that the flock routine is * available to do file locking. */ -/*#define HAS_FLOCK / **/ +/*#define HAS_FLOCK /**/ /* HAS_FORK: * This symbol, if defined, indicates that the fork routine is @@ -215,7 +201,7 @@ * <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 / **/ +/*#define HAS_GETTIMEOFDAY /**/ #ifdef HAS_GETTIMEOFDAY #define Timeval struct timeval /* Structure used by gettimeofday() */ #endif @@ -227,13 +213,6 @@ */ /*#define HAS_GETGROUPS /**/ -/* 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. - */ -#define HAS_UNAME /**/ - /* HAS_GETLOGIN: * This symbol, if defined, indicates that the getlogin routine is * available to get the login name. @@ -255,14 +234,14 @@ * This symbol, if defined, indicates that getpgrp needs one * arguments whereas USG one needs none. */ -/*#define HAS_GETPGRP /**/ -/*#define USE_BSD_GETPGRP / **/ +#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 / **/ +/*#define HAS_GETPGRP2 /**/ /* HAS_GETPPID: * This symbol, if defined, indicates that the getppid routine is @@ -276,37 +255,12 @@ */ /*#define HAS_GETPRIORITY /**/ -/* 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_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 /**/ /* PG: WE HAVE OTHERS, NOT THIS ONE. */ +/*#define HAS_INET_ATON /**/ /* HAS_KILLPG: * This symbol, if defined, indicates that the killpg routine is available @@ -404,12 +358,6 @@ */ #define HAS_MKTIME /**/ -/* 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_NICE: * This symbol, if defined, indicates that the nice routine is * available. @@ -433,7 +381,7 @@ * This symbol, if defined, indicates that the pause routine is * available to suspend a process until a signal is received. */ -/*#define HAS_PAUSE /**/ +#define HAS_PAUSE /**/ /* HAS_PIPE: * This symbol, if defined, indicates that the pipe routine is @@ -500,12 +448,6 @@ */ #define HAS_SELECT /**/ -/* HAS_SEM: - * This symbol, if defined, indicates that the entire sem*(2) library is - * supported. - */ -/*#define HAS_SEM /**/ - /* HAS_SETEGID: * This symbol, if defined, indicates that the setegid routine is available * to change the effective gid of the current program. @@ -535,7 +477,7 @@ * This symbol, if defined, indicates that the setpgid(pid, gpid) * routine is available to set process group ID. */ -/*#define HAS_SETPGID /**/ +/*#define HAS_SETPGID /**/ /* HAS_SETPGRP: * This symbol, if defined, indicates that the setpgrp routine is @@ -547,13 +489,13 @@ * for a POSIX interface. */ /*#define HAS_SETPGRP /**/ -/*#define USE_BSD_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 / **/ +/*#define HAS_SETPGRP2 /**/ /* HAS_SETPRIORITY: * This symbol, if defined, indicates that the setpriority routine is @@ -572,7 +514,7 @@ * process. */ /*#define HAS_SETREGID /**/ -/*#define HAS_SETRESGID / **/ +/*#define HAS_SETRESGID /**/ /* HAS_SETREUID: * This symbol, if defined, indicates that the setreuid routine is @@ -585,19 +527,19 @@ * process. */ /*#define HAS_SETREUID /**/ -/*#define HAS_SETRESUID / **/ +/*#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 / **/ +/*#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 / **/ +/*#define HAS_SETRUID /**/ /* HAS_SETSID: * This symbol, if defined, indicates that the setsid routine is @@ -605,12 +547,6 @@ */ /*#define HAS_SETSID /**/ -/* HAS_SHM: - * This symbol, if defined, indicates that the entire shm*(2) library is - * supported. - */ -/*#define HAS_SHM /**/ - /* Shmat_t: * This symbol holds the return type of the shmat() system call. * Usually set to 'void *' or 'char *'. @@ -618,19 +554,13 @@ /* 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, + * 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 /**/ -/* 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_STRCHR: * This symbol is defined to indicate that the strchr()/strrchr() * functions are available for string searching. If not, try the @@ -641,7 +571,7 @@ * functions are available for string searching. */ #define HAS_STRCHR /**/ -/*#define HAS_INDEX / **/ +/*#define HAS_INDEX /**/ /* HAS_STRCOLL: * This symbol, if defined, indicates that the strcoll routine is @@ -656,25 +586,6 @@ */ #define USE_STRUCT_COPY /**/ -/* 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_STRTOD: * This symbol, if defined, indicates that the strtod routine is * available to provide better numeric string conversion than atof(). @@ -745,7 +656,7 @@ * 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 @@ -753,11 +664,6 @@ */ #define HAS_UMASK /**/ -/* HAS_VFORK: - * This symbol, if defined, indicates that vfork() exists. - */ -/*#define HAS_VFORK / **/ - /* HASVOLATILE: * This symbol, if defined, indicates that this C compiler knows about * the volatile declaration. @@ -790,17 +696,11 @@ */ #define HAS_WCTOMB /**/ -/* EBCDIC: - * This symbol, if defined, indicates that this system uses - * EBCDIC encoding. - */ -/*#define EBCDIC /**/ - /* I_ARPA_INET: - * This symbol, if defined, indicates that <arpa/inet.h> exists and should - * be included. + * 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 /**/ +#define I_ARPA_INET /**/ /* I_DBM: * This symbol, if defined, indicates that <dbm.h> exists and should @@ -830,7 +730,7 @@ * portably declare your directory entries. */ #define I_DIRENT /**/ -/*#define DIRNAMLEN / **/ +/*#define DIRNAMLEN /**/ #define Direntry_t struct dirent /* I_DLFCN: @@ -851,32 +751,6 @@ */ #define I_FLOAT /**/ -/* 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 - * contains gr_passwd. - */ -/* HAS_SETGRENT: - * This symbol, if defined, indicates that the getgrent routine is - * available for initializing sequential access of the group database. - */ -/* HAS_GETGRENT: - * This symbol, if defined, indicates that the getgrent routine is - * available for sequential access of the group database. - */ -/* HAS_ENDGRENT: - * This symbol, if defined, indicates that the getgrent routine is - * available for finalizing sequential access of the group database. - */ -/*#define I_GRP /**/ -/*#define GRPASSWD /**/ -/*#define HAS_SETGRENT /**/ -/*#define HAS_GETGRENT /**/ -/*#define HAS_ENDGRENT /**/ - /* 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 @@ -900,7 +774,7 @@ * This symbol, if defined, indicates to the C program that it should * include <memory.h>. */ -/*#define I_MEMORY / **/ +/*#define I_MEMORY /**/ /* I_NDBM: * This symbol, if defined, indicates that <ndbm.h> exists and should @@ -912,19 +786,19 @@ * This symbol, if defined, indicates that <net/errno.h> exists and * should be included. */ -/*#define I_NET_ERRNO / **/ +/*#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 /**/ /* PG: just "in.h" on VOS */ +#define I_NETINET_IN /**/ /* I_SFIO: * This symbol, if defined, indicates to the C program that it should * include <sfio.h>. */ -/*#define I_SFIO / **/ +/*#define I_SFIO /**/ /* I_STDDEF: * This symbol, if defined, indicates that <stddef.h> exists and should @@ -948,25 +822,25 @@ * This symbol, if defined, indicates to the C program that it should * include <sys/dir.h>. */ -/*#define I_SYS_DIR / **/ +/*#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 / **/ +/*#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 /**/ /* PG: just ioctl.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 / **/ +/*#define I_SYS_NDIR /**/ /* I_SYS_PARAM: * This symbol, if defined, indicates to the C program that it should @@ -984,7 +858,7 @@ * 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 /**/ +#define I_SYS_SELECT /**/ /* I_SYS_STAT: * This symbol, if defined, indicates to the C program that it should @@ -1032,9 +906,9 @@ * <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 /**/ /* PG: PREFERED, NOT THERE YET */ -/*#define I_SGTTY / **/ +/*#define I_TERMIO /**/ +#define I_TERMIOS /**/ +/*#define I_SGTTY /**/ /* I_UNISTD: * This symbol, if defined, indicates to the C program that it should @@ -1065,13 +939,13 @@ * include <varargs.h>. */ #define I_STDARG /**/ -/*#define I_VARARGS / **/ +/*#define I_VARARGS /**/ /* I_VFORK: * This symbol, if defined, indicates to the C program that it should * include vfork.h. */ -/*#define I_VFORK / **/ +/*#define I_VFORK /**/ /* CAN_PROTOTYPE: * If defined, this macro indicates that the C compiler can handle @@ -1106,20 +980,94 @@ */ #define STDCHAR unsigned char /**/ +/* 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 _error_ /**/ +# define Uquad_t _error_ /**/ +# define QUADKIND _error_ /**/ +# 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 /**/ + +/* 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. - * On NeXT starting with 3.2, you can build "Fat" Multiple Architecture - * Binaries (MAB) for targets with varying alignment. 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. - * The default is eight, for safety. + * 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. */ -#define MEM_ALIGNBYTES 8 /**/ +#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 @@ -1130,14 +1078,31 @@ * so the default case (for NeXT) is big endian to catch them. * This might matter for NeXT 3.0. */ -#ifndef NeXT -#define BYTEORDER 0x1234 /* large digits for MSB */ -#else /* NeXT */ -#ifdef __LITTLE_ENDIAN__ -#define BYTEORDER 0x1234 -#else /* __BIG_ENDIAN__ */ -#define BYTEORDER 0x4321 -#endif /* ENDIAN CHECK */ +#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 0x4321 /* large digits for MSB */ #endif /* NeXT */ /* CASTI32: @@ -1158,14 +1123,20 @@ * 2 = couldn't cast >= 0x80000000 * 4 = couldn't cast in argument expression list */ -#define CASTNEGFLOAT /**/ +#define CASTNEGFLOAT /**/ #define CASTFLAGS 0 /**/ /* VOID_CLOSEDIR: * This symbol, if defined, indicates that the closedir() routine * does not return a value. */ -/*#define VOID_CLOSEDIR / **/ +/*#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 @@ -1214,7 +1185,7 @@ * probably use memmove() or memcpy(). If neither is defined, roll your * own version. */ -/*#define HAS_SAFE_BCOPY /**/ /* PG: VOS has bcopy; do not know if it is safe. */ +/*#define HAS_SAFE_BCOPY /**/ /* HAS_SAFE_MEMCPY: * This symbol, if defined, indicates that the memcpy routine is available @@ -1222,14 +1193,14 @@ * probably use memmove() or memcpy(). If neither is defined, roll your * own version. */ -/*#define HAS_SAFE_MEMCPY / **/ +/*#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 / **/ /* PG: VOS GUESS */ +#define HAS_SANE_MEMCMP /**/ /* HAS_SIGACTION: * This symbol, if defined, indicates that Vr4's sigaction() routine @@ -1237,6 +1208,13 @@ */ /*#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. */ @@ -1332,7 +1310,7 @@ * symbol. */ #define HAS_VPRINTF /**/ -/*#define USE_CHAR_VSPRINTF / **/ +/*#define USE_CHAR_VSPRINTF /**/ /* DOUBLESIZE: * This symbol contains the size of a double, so that the C preprocessor @@ -1352,25 +1330,9 @@ * This symbol, if defined, indicates to the C program that it should * include <sys/time.h> with KERNEL defined. */ -/*#define I_TIME / **/ +/*#define I_TIME /**/ #define I_SYS_TIME /**/ -/*#define I_SYS_TIME_KERNEL / **/ - -/* 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 /**/ +/*#define I_SYS_TIME_KERNEL /**/ /* VAL_O_NONBLOCK: * This symbol is to be used during open() or fcntl(F_SETFL) to turn on @@ -1407,11 +1369,30 @@ */ #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 contains the number of bits of random number the rand() - * function produces. Usual values are 15, 16, and 31. + * 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 RANDBITS 15 /**/ +#define Drand01() rand()/(RAND_MAX+1) /**/ +#define Rand_seed_t unsigned int /**/ +#define seedDrand01(x) srand((Rand_seed_t)x) /**/ +#define RANDBITS 15 /**/ /* SSize_t: * This symbol holds the type used by functions that return @@ -1423,6 +1404,100 @@ */ #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 "" /**/ +/*#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 "/system/ported/command_library" /**/ +#define BIN_EXP "/system/ported/command_library" /**/ + +/* 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 "/system/ported/perl/lib/5.005" /**/ +#define PRIVLIB_EXP "/system/ported/perl/lib/5.005" /**/ + +/* 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. + */ +/* 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 "" /**/ +/*#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. + * 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. + */ +/* 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 "/system/ported/perl/lib/site/5.005" /**/ +#define SITELIB_EXP "/system/ported/perl/lib/site/5.005" /**/ + +/* 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 @@ -1450,37 +1525,95 @@ #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 "cc -E" +#define CPPMINUS "-" +#define CPPRUN "cc -E -" +#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 "/bin/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 /**/ +#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 /**/ +#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 /**/ +#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 /**/ +#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 @@ -1500,6 +1633,35 @@ */ #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. + */ +/* 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 /**/ +/*#define 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. @@ -1535,6 +1697,13 @@ #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. @@ -1552,6 +1721,31 @@ #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. @@ -1567,8 +1761,7 @@ #endif /* HAS_LONG_LONG: - * This symbol will be defined if the C compiler supports - * 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 @@ -1577,9 +1770,33 @@ */ /*#define HAS_LONG_LONG /**/ #ifdef HAS_LONG_LONG -/*#define LONGLONGSIZE $longlongsize /**/ +#define LONGLONGSIZE _error_ /**/ #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_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 @@ -1605,6 +1822,12 @@ */ #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. @@ -1618,6 +1841,12 @@ */ #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. @@ -1626,8 +1855,71 @@ * This symbol, if defined, indicates that the BSD socketpair() call is * supported. */ -#define HAS_SOCKET /**/ -/*#define HAS_SOCKETPAIR / **/ +/* 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. + */ +#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 /**/ + +/* 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_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 @@ -1651,6 +1943,11 @@ /*#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 @@ -1669,9 +1966,20 @@ * getgroups() or setgropus().. */ #if defined(HAS_GETGROUPS) || defined(HAS_SETGROUPS) -#define Groups_t gid_t /* Type for 2nd arg to [gs]etgroups() */ +#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. @@ -1714,30 +2022,21 @@ * This symbol, if defined, indicates to the C program that struct passwd * contains pw_passwd. */ -/* HAS_SETPWENT: - * This symbol, if defined, indicates that the getpwrent routine is - * available for initializing sequential access of the passwd database. - */ -/* HAS_GETPWENT: - * This symbol, if defined, indicates that the getpwent routine is - * available for sequential access of the password database. - */ -/* HAS_ENDPWENT: - * This symbol, if defined, indicates that the getpwent routine is - * available for finalizing sequential access of the passwd database. - */ /*#define I_PWD /**/ -/*#define PWQUOTA / **/ +/*#define PWQUOTA /**/ /*#define PWAGE /**/ -/*#define PWCHANGE / **/ -/*#define PWCLASS / **/ -/*#define PWEXPIRE / **/ +/*#define PWCHANGE /**/ +/*#define PWCLASS /**/ +/*#define PWEXPIRE /**/ /*#define PWCOMMENT /**/ /*#define PWGECOS /**/ /*#define PWPASSWD /**/ -/*#define HAS_SETPWENT /**/ -/*#define HAS_GETPWENT /**/ -/*#define HAS_ENDPWENT /**/ + +/* 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 @@ -1782,11 +2081,8 @@ * The last element is 0, corresponding to the 0 at the end of * the sig_name list. */ -/*#define SIG_NAME "ZERO","HUP","INT","QUIT","ILL","TRAP","ABRT","EMT","FPE","KILL","BUS","SEGV","SYS","PIPE","ALRM","TERM","USR1","USR2","CHLD","PWR","WINCH","URG","IO","STOP","TSTP","CONT","TTIN","TTOU","VTALRM","PROF","XCPU","XFSZ","WAITING","LWP","FREEZE","THAW","CANCEL","RTMIN","NUM38","NUM39","NUM40","NUM41","NUM42","NUM43","RTMAX","IOT","CLD","POLL",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,6,18,22,0 /**/ - -#define SIG_NAME "ZERO","ABRT","FPE","ILL","INT","SEGV","TERM","USR1","USR2","IO","POLL","HUP","URG","ALRM","KILL","PIPE","QUIT","CHLD","CONT","STOP","TSTP","TTIN","TTOU","BUS","RT1","RT2","RT3","RT4","RT5","RT6","RT7","RT8",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,0 +#define SIG_NAME "ZERO","ABRT","FPE","ILL","INT","SEGV","TERM","USR1","USR2","IO","HUP","URG","ALRM","KILL","PIPE","QUIT","CHLD","CONT","STOP","TSTP","TTIN","TTOU","BUS","RT1","RT2","RT3","RT4","RT5","RT6","RT7","RT8",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,0 /**/ /* VOIDFLAGS: * This symbol indicates how much support of the void type is given by this @@ -1813,21 +2109,25 @@ #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. +/* HAS_ATOLF: + * This symbol, if defined, indicates that the atolf routine is + * available to convert strings into long doubles. */ -/* 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 HAS_ATOLF /**/ + +/* HAS_ATOLL: + * This symbol, if defined, indicates that the atoll routine is + * available to convert strings into long longs. */ -/*#define ARCHLIB "/opt/perl/lib/i86pc-solaris/5.00305" /**/ -/*#define ARCHLIB_EXP "/opt/perl/lib/i86pc-solaris/5.00305" /**/ +/*#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. + */ +/*#define PERL_BINCOMPAT_5005 /**/ /* DLSYM_NEEDS_UNDERSCORE: * This symbol, if defined, indicates that we need to prepend an @@ -1837,18 +2137,155 @@ */ /*#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. + */ +/*#define HAS_ENDSPENT /**/ + +/* 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 /**/ + +/* 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_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_HASMNTOPT: + * This symbol, if defined, indicates that the hasmntopt routine is + * available to query the mount options of file systems. + */ +/*#define HAS_HASMNTOPT /**/ + +/* 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 HAS_INT64_T /**/ + +/* 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_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 /**/ + /* USE_SFIO: * This symbol, if defined, indicates that sfio should * be used. */ /*#define USE_SFIO /**/ +/* HAS_SQRTL: + * This symbol, if defined, indicates that the sqrtl routine is + * available to do long double square roots. + */ +/*#define HAS_SQRTL /**/ + +/* 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 /**/ + +/* 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_USTAT: + * This symbol, if defined, indicates that the ustat system call is + * available to query file system statistics by dev_t. + */ +/*#define HAS_USTAT /**/ + /* 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 @@ -1859,53 +2296,212 @@ * 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 /**/ +#define DB_Hash_t int /**/ +#define DB_Prefix_t int /**/ -/* 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_INTTYPES: + * This symbol, if defined, indicates to the C program that it should + * include <inttypes.h>. */ -/* 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_INTTYPES /**/ + +/* I_MNTENT: + * This symbol, if defined, indicates that <mntent.h> exists and + * should be included. */ -#define PRIVLIB "/system/ported/perl" /**/ -#define PRIVLIB_EXP "/system/ported/perl" /**/ +/*#define I_MNTENT /**/ -/* 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. +/* I_NETINET_TCP: + * This symbol, if defined, indicates to the C program that it should + * include <netinet/tcp.h>. */ -/* 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 I_NETINET_TCP /**/ + +/* I_POLL: + * This symbol, if defined, indicates that <poll.h> exists and + * should be included. */ -#define SITEARCH "/system/ported/site_command_library" /**/ -#define SITEARCH_EXP "/system/ported/site_command_library" /**/ +/*#define I_POLL /**/ -/* 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. +/* I_SHADOW: + * This symbol, if defined, indicates that <shadow.h> exists and + * should be included. */ -/* 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 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_SYS_VFS: + * This symbol, if defined, indicates that <sys/vfs.h> exists and + * should be included. + */ +/*#define I_SYS_VFS /**/ + +/* I_USTAT: + * This symbol, if defined, indicates that <ustat.h> exists and + * should be included. + */ +/*#define I_USTAT /**/ + +/* 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 SITELIB "/system/ported/site_command_library" /**/ -#define SITELIB_EXP "/system/ported/site_command_library" /**/ +#define PERL_PRIfldbl "Lf" /**/ +#define PERL_PRIgldbl "Lg" /**/ + +/* IVTYPE: + * This symbol defines the C type used for Perl's IV. + */ +/* UVTYPE: + * This symbol defines the C type used for Perl's UV. + */ +/* I8TYPE: + * This symbol defines the C type used for Perl's I8. + */ +/* U8TYPE: + * This symbol defines the C type used for Perl's U8. + */ +/* I16TYPE: + * This symbol defines the C type used for Perl's I16. + */ +/* U16TYPE: + * This symbol defines the C type used for Perl's U16. + */ +/* I32TYPE: + * This symbol defines the C type used for Perl's I32. + */ +/* U32TYPE: + * This symbol defines the C type used for Perl's U32. + */ +/* I64TYPE: + * This symbol defines the C type used for Perl's I64. + */ +/* U64TYPE: + * This symbol defines the C type used for Perl's U64. + */ +/* NVTYPE: + * This symbol defines the C type used for Perl's NV. + */ +/* IVSIZE: + * This symbol contains the sizeof(IV). + */ +/* UVSIZE: + * This symbol contains the sizeof(UV). + */ +/* I8SIZE: + * This symbol contains the sizeof(I8). + */ +/* U8SIZE: + * This symbol contains the sizeof(U8). + */ +/* I16SIZE: + * This symbol contains the sizeof(I16). + */ +/* U16SIZE: + * This symbol contains the sizeof(U16). + */ +/* I32SIZE: + * This symbol contains the sizeof(I32). + */ +/* U32SIZE: + * This symbol contains the sizeof(U32). + */ +/* I64SIZE: + * This symbol contains the sizeof(I64). + */ +/* U64SIZE: + * This symbol contains the sizeof(U64). + */ +#define IVTYPE int /**/ +#define UVTYPE unsigned int /**/ +#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 _error_ /**/ +#define U64TYPE _error_ /**/ +#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 _error_ /**/ +#define U64SIZE _error_ /**/ +#endif + +/* IVdf: + * This symbol defines the format string used for printing a Perl IV + * as a signed decimal integer. + */ +/* UVuf: + * This symbol defines the format string used for printing a Perl UV + * as an unsigned decimal integer. + */ +/* UVof: + * This symbol defines the format string used for printing a Perl UV + * as an unsigned octal integer. + */ +/* UVxf: + * This symbol defines the format string used for printing a Perl UV + * as an unsigned hexadecimal integer. + */ +#define IVdf "d" /**/ +#define UVuf "u" /**/ +#define UVof "o" /**/ +#define UVxf "x" /**/ + +/* 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 1 /**/ /* STARTPERL: * This variable contains the string to put in front of a perl @@ -1914,12 +2510,128 @@ */ #define STARTPERL "!perl.pm" /**/ +/* 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 + +/* HAS_STRTOULL: + * This symbol, if defined, indicates that the strtoull routine is + * available to convert strings into unsigned long longs. + */ +/*#define HAS_STRTOULL /**/ + +/* USE_64_BITS: + * 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 MULTIPLICITY +/*#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. */ -/*#define USE_PERLIO / **/ +#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 + +/* PERL_XS_APIVERSION: + * This variable contains the version of the oldest perl binary + * compatible with the present perl. perl.c:incpush() and + * lib/lib.pm will automatically search in for older + * directories across major versions back to xs_apiversion. + * 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. + * Since this can depend on compile time options (such as + * bincompat) it is set by Configure. Other non-default sources + * of potential incompatibility, such as multiplicity, threads, + * debugging, 64bits, sfio, etc., are not checked for currently, + * though in principle we could go snooping around in old + * Config.pm files. + */ +/* PERL_PM_APIVERSION: + * This variable contains the version of the oldest perl + * compatible with the present perl. (That is, pure perl modules + * written for pm_apiversion will still work for the current + * version). perl.c:incpush() and lib/lib.pm will automatically + * search in /system/ported/perl/lib/site/5.005 for older directories across major versions + * back to pm_apiversion. This is only useful if you have a perl + * library directory tree structured like the default one. The + * versioned site_perl library was introduced in 5.005, so that's + * the default setting for this variable. It's hard to imagine + * it changing before Perl6. It is included here for symmetry + * with xs_apiveprsion -- the searching algorithms will + * (presumably) be similar. + * See the INSTALL file for how this works. + */ +#define PERL_XS_APIVERSION 5.00563 /* Change to string for tuples?*/ +#define PERL_PM_APIVERSION 5.00563 /* Change to string for tuples?*/ + +/* 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 @@ -1927,7 +2639,7 @@ * 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 /**/ +#define HAS_GETHOST_PROTOS /**/ /* HAS_GETNET_PROTOS: * This symbol, if defined, indicates that <netdb.h> includes @@ -1935,7 +2647,7 @@ * 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 /**/ +#define HAS_GETNET_PROTOS /**/ /* HAS_GETPROTO_PROTOS: * This symbol, if defined, indicates that <netdb.h> includes @@ -1943,7 +2655,7 @@ * 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 /**/ +#define HAS_GETPROTO_PROTOS /**/ /* HAS_GETSERV_PROTOS: * This symbol, if defined, indicates that <netdb.h> includes @@ -1951,7 +2663,7 @@ * 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 /**/ +#define HAS_GETSERV_PROTOS /**/ /* Netdb_host_t: * This symbol holds the type used for the 1st argument @@ -1988,33 +2700,49 @@ * where library files may be held under a private library, for * instance. */ -#define ARCHNAME "vos" /**/ +#define ARCHNAME "vos" /**/ -/* I_MACH_CTHREADS: - * This symbol, if defined, indicates to the C program that it should - * include <mach/cthreads.h>. +/* 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 I_MACH_CTHREADS /**/ - -/* I_PTHREAD: - * This symbol, if defined, indicates to the C program that it should - * include <pthread.h>. - */ -/*#define I_PTHREAD /**/ +/*#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. + * 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. + * 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>. + */ +/*#define I_MACH_CTHREADS /**/ + +/* I_PTHREAD: + * This symbol, if defined, indicates to the C program that it should + * include <pthread.h>. + */ +/*#define I_PTHREAD /**/ + /* USE_THREADS: * This symbol, if defined, indicates that Perl should * be built to use threads. @@ -2023,7 +2751,9 @@ * This symbol, if defined, indicates that Perl should * be built to use the old draft POSIX threads API. */ +#ifndef USE_TTHREADS /*#define USE_THREADS /**/ +#endif /*#define OLD_PTHREADS_API /**/ /* Time_t: @@ -2047,6 +2777,16 @@ */ #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, @@ -2061,7 +2801,15 @@ * 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 */ /* Mode_t: * This symbol holds the type used to declare file modes @@ -2086,6 +2834,16 @@ */ #define Size_t size_t /* length paramater for string functions */ +/* Uid_t_f: + * This symbol defines the format string used for printing a Uid_t. + */ +#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 @@ -2093,12 +2851,4 @@ */ #define Uid_t uid_t /* UID type */ -/* _POSIX_C_SOURCE: - * VOS must have this symbol defined before we include any of the - * standard headers (e.g., sys/types.h). - */ -#ifndef _POSIX_C_SOURCE -#define _POSIX_C_SOURCE -#endif - #endif diff --git a/vos/config.pl b/vos/config.pl new file mode 100644 index 0000000000..c6014ade9a --- /dev/null +++ b/vos/config.pl @@ -0,0 +1,84 @@ +# This file fills in a config_h.SH template based on the data +# of the file config.def and outputs a config.h. +# +# Written January 24, 2000 by Jarkko Hietaniemi [jhi@iki.fi] +# Modified February 2, 2000 by Paul Green [Paul_Green@stratus.com] + +# +# Read in the definitions file +# + +if (open(CONFIG_DEF, "config.def")) { + while (<CONFIG_DEF>) { + if (/^([^=]+)='(.*)'$/) { + my ($var, $val) = ($1, $2); + $define{$var} = $val; + } else { + warn "config.def: $.: illegal line: $_"; + } + } +} else { + die "$0: Cannot open config.def: $!"; +} + +close (CONFIG_DEF); + +# +# Open the template input file. +# + +unless (open(CONFIG_SH, "config_h.SH_orig")) { + die "$0: Cannot open config_h.SH_orig: $!"; +} + +# +# Open the output file. +# + +unless (open(CONFIG_H, ">config.h.new")) { + die "$0: Cannot open config.h.new for output: $!"; +} + +# +# Skip lines before the first !GROK!THIS! +# + +while (<CONFIG_SH>) { + last if /^sed <<!GROK!THIS!/; +} + +# +# Process the rest of the file, a line at a time. +# Stop when the next !GROK!THIS! is found. +# + +while (<CONFIG_SH>) { + last if /^!GROK!THIS!/; +# +# The case of #$d_foo at the BOL has to be handled carefully. +# If $d_foo is "undef", then we must first comment out the entire line. +# + if (/^#\$\w+/) { + s@^#(\$\w+)@("$define{$1}" eq "undef")?"/*#define":"#$define{$1}"@e; + } +# +# There could be multiple $variables on this line. +# Find and replace all of them. +# + if (/(\$\w+)/) { + s/(\$\w+)/(exists $define{$1}) ? $define{$1} : $1/ge; + print CONFIG_H; + } +# +# There are no variables, just print the line out. +# + else { + print CONFIG_H; + } +} + +unless (close (CONFIG_H)) { + die "$0: Cannot close config.h.new: $!"; + } + +close (CONFIG_SH); diff --git a/vos/config_h.SH_orig b/vos/config_h.SH_orig index eb3a8b6d42..56df72c16a 100755 --- a/vos/config_h.SH_orig +++ b/vos/config_h.SH_orig @@ -44,32 +44,6 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #define LOC_SED "$full_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 "$bin" /**/ -#define BIN_EXP "$binexp" /**/ - -/* 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 "". - */ -#define CPPSTDIN "$cppstdin" -#define CPPMINUS "$cppminus" - /* HAS_ALARM: * This symbol, if defined, indicates that the alarm routine is * available. @@ -239,54 +213,6 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #$d_fsetpos HAS_FSETPOS /**/ -/* I_SYS_MOUNT: - * This symbol, if defined, indicates to the C program that it should - * include <sys/mount.h>. - */ -#$i_sysmount I_SYS_MOUNT /**/ - -/* HAS_FSTATFS: - * This symbol, if defined, indicates that the fstatfs routine is - * available to stat the filesystem of a file descriptor. - */ -#$d_fstatfs HAS_FSTATFS /**/ - -/* HAS_STRUCT_STATFS_FLAGS: - * This symbol, if defined, indicates that the struct statfs has - * the f_flags member for mount flags. - */ -#$d_statfsflags HAS_STRUCT_STATFS_FLAGS /**/ - -/* I_SYS_STATVFS: - * This symbol, if defined, indicates to the C program that it should - * include <sys/statvfs.h>. - */ -#$i_sysstatvfs I_SYS_STATVFS /**/ - -/* HAS_FSTATVFS: - * This symbol, if defined, indicates that the fstatvfs routine is - * available to stat the filesystem of a file descriptor. - */ -#$d_fstatvfs HAS_FSTATVFS /**/ - -/* I_MNTENT: - * This symbol, if defined, indicates to the C program that it should - * include <mntent.h>. - */ -#$i_mntent I_MNTENT /**/ - -/* HAS_GETMNTENT: - * This symbol, if defined, indicates that the getmntent routine is - * available to lookup mount entries in some data base or other. - */ -#$d_getmntent HAS_GETMNTENT /**/ - -/* HAS_HASMNTOPT: - * This symbol, if defined, indicates that the hasmntopt routine is - * available to query mount entries returned by getmntent. - */ -#$d_hasmntopt HAS_HASMNTOPT /**/ - /* HAS_GETTIMEOFDAY: * This symbol, if defined, indicates that the gettimeofday() system * call is available for a sub-second accuracy clock. Usually, the file @@ -305,13 +231,6 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #$d_getgrps HAS_GETGROUPS /**/ -/* 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. - */ -#$d_uname HAS_UNAME /**/ - /* HAS_GETLOGIN: * This symbol, if defined, indicates that the getlogin routine is * available to get the login name. @@ -354,31 +273,6 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #$d_getprior HAS_GETPRIORITY /**/ -/* 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. - */ -#$d_htonl HAS_HTONL /**/ -#$d_htonl HAS_HTONS /**/ -#$d_htonl HAS_NTOHL /**/ -#$d_htonl HAS_NTOHS /**/ - /* 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" @@ -482,12 +376,6 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #$d_mktime HAS_MKTIME /**/ -/* 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_NICE: * This symbol, if defined, indicates that the nice routine is * available. @@ -578,12 +466,6 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #$d_select HAS_SELECT /**/ -/* HAS_SEM: - * This symbol, if defined, indicates that the entire sem*(2) library is - * supported. - */ -#$d_sem HAS_SEM /**/ - /* HAS_SETEGID: * This symbol, if defined, indicates that the setegid routine is available * to change the effective gid of the current program. @@ -683,12 +565,6 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #$d_setsid HAS_SETSID /**/ -/* HAS_SHM: - * This symbol, if defined, indicates that the entire shm*(2) library is - * supported. - */ -#$d_shm HAS_SHM /**/ - /* Shmat_t: * This symbol holds the return type of the shmat() system call. * Usually set to 'void *' or 'char *'. @@ -696,19 +572,13 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- /* 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, + * 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 $shmattype /**/ #$d_shmatprototype HAS_SHMAT_PROTOTYPE /**/ -/* USE_STAT_BLOCKS: - * This symbol is defined if this system has a stat structure declaring - * st_blksize and st_blocks. - */ -#$d_statblks USE_STAT_BLOCKS /**/ - /* HAS_STRCHR: * This symbol is defined to indicate that the strchr()/strrchr() * functions are available for string searching. If not, try the @@ -734,25 +604,6 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #$d_strctcpy USE_STRUCT_COPY /**/ -/* 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. - */ -#$d_strerror HAS_STRERROR /**/ -#$d_syserrlst HAS_SYS_ERRLIST /**/ -#define Strerror(e) $d_strerrm - /* HAS_STRTOD: * This symbol, if defined, indicates that the strtod routine is * available to provide better numeric string conversion than atof(). @@ -831,11 +682,6 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #$d_umask HAS_UMASK /**/ -/* HAS_VFORK: - * This symbol, if defined, indicates that vfork() exists. - */ -#$d_vfork HAS_VFORK /**/ - /* HASVOLATILE: * This symbol, if defined, indicates that this C compiler knows about * the volatile declaration. @@ -868,17 +714,11 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #$d_wctomb HAS_WCTOMB /**/ -/* EBCDIC: - * This symbol, if defined, indicates that this system uses - * EBCDIC encoding. - */ -#$ebcdic EBCDIC /**/ - /* I_ARPA_INET: - * This symbol, if defined, indicates that <arpa/inet.h> exists and should - * be included. + * This symbol, if defined, indicates to the C program that it should + * include <arpa/inet.h> to get inet_addr and friends declarations. */ -#$i_arpainet I_ARPA_INET /**/ +#$i_arpainet I_ARPA_INET /**/ /* I_DBM: * This symbol, if defined, indicates that <dbm.h> exists and should @@ -929,32 +769,6 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #$i_float I_FLOAT /**/ -/* 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 - * contains gr_passwd. - */ -/* HAS_SETGRENT: - * This symbol, if defined, indicates that the getgrent routine is - * available for initializing sequential access of the group database. - */ -/* HAS_GETGRENT: - * This symbol, if defined, indicates that the getgrent routine is - * available for sequential access of the group database. - */ -/* HAS_ENDGRENT: - * This symbol, if defined, indicates that the getgrent routine is - * available for finalizing sequential access of the group database. - */ -#$i_grp I_GRP /**/ -#$d_grpasswd GRPASSWD /**/ -#$d_setgrent HAS_SETGRENT /**/ -#$d_getgrent HAS_GETGRENT /**/ -#$d_endgrent HAS_ENDGRENT /**/ - /* 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 @@ -1184,20 +998,94 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #define STDCHAR $stdchar /**/ +/* 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 /**/ + +/* CROSSCOMPILE: + * This symbol, if defined, signifies that we our + * build process is a cross-compilation. + */ +#$crosscompile 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 $intsize /**/ +#define LONGSIZE $longsize /**/ +#define SHORTSIZE $shortsize /**/ + +/* 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. + */ +#$multiarch MULTIARCH /**/ + /* MEM_ALIGNBYTES: - * This symbol contains the number of bytes required to align a - * double. Usual values are 2, 4 and 8. - * On NeXT starting with 3.2, you can build "Fat" Multiple Architecture - * Binaries (MAB) for targets with varying alignment. 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. - * The default is eight, for safety. + * 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. */ -#define MEM_ALIGNBYTES $alignbytes /**/ +#if defined(CROSSCOMPILE) || defined(MULTIARCH) +# define MEM_ALIGNBYTES 8 +#else +#define MEM_ALIGNBYTES $alignbytes +#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 @@ -1208,14 +1096,31 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- * so the default case (for NeXT) is big endian to catch them. * This might matter for NeXT 3.0. */ -#ifndef NeXT +#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 0x$byteorder /* large digits for MSB */ -#else /* NeXT */ -#ifdef __LITTLE_ENDIAN__ -#define BYTEORDER 0x1234 -#else /* __BIG_ENDIAN__ */ -#define BYTEORDER 0x4321 -#endif /* ENDIAN CHECK */ #endif /* NeXT */ /* CASTI32: @@ -1245,6 +1150,12 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #$d_void_closedir VOID_CLOSEDIR /**/ +/* HAS_FD_SET: + * This symbol, when defined, indicates presence of the fd_set typedef + * in <sys/types.h> + */ +#$d_fd_set HAS_FD_SET /**/ + /* Gconvert: * This preprocessor macro is defined to convert a floating point * number to a string without a trailing decimal point. This @@ -1315,6 +1226,13 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #$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. */ @@ -1434,22 +1352,6 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- #$i_systime I_SYS_TIME /**/ #$i_systimek I_SYS_TIME_KERNEL /**/ -/* 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 $intsize /**/ -#define LONGSIZE $longsize /**/ -#define SHORTSIZE $shortsize /**/ - /* 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 @@ -1485,11 +1387,30 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #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 contains the number of bits of random number the rand() - * function produces. Usual values are 15, 16, and 31. + * 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 RANDBITS $randbits /**/ +#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 @@ -1501,6 +1422,100 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #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. + * 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. + */ +/* 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_sitearch SITEARCH "$sitearch" /**/ +#$d_sitearch 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. + * 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. + */ +/* 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 @@ -1528,6 +1543,46 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- #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. */ @@ -1536,6 +1591,12 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- #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. @@ -1554,12 +1615,24 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #$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. + */ +#$d_getgrent HAS_GETGRENT /**/ + /* HAS_GETHOSTBYADDR: * This symbol, if defined, indicates that the gethostbyaddr() routine is * available to look up hosts by their IP addresses. @@ -1578,6 +1651,35 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #$d_gethent 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. + */ +/* 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 /**/ +#ifdef HAS_PHOSTNAME +#define PHOSTNAME "$aphostname" /* 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. @@ -1613,6 +1715,13 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- #$d_getpbyname HAS_GETPROTOBYNAME /**/ #$d_getpbynumber 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. + */ +#$d_getpwent 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. @@ -1630,6 +1739,31 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- #$d_getsbyname HAS_GETSERVBYNAME /**/ #$d_getsbyport 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. + */ +#$d_htonl HAS_HTONL /**/ +#$d_htonl HAS_HTONS /**/ +#$d_htonl HAS_NTOHL /**/ +#$d_htonl HAS_NTOHS /**/ + /* HAS_LONG_DOUBLE: * This symbol will be defined if the C compiler supports long * doubles. @@ -1645,8 +1779,7 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- #endif /* HAS_LONG_LONG: - * This symbol will be defined if the C compiler supports - * 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 @@ -1658,6 +1791,30 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- #define LONGLONGSIZE $longlongsize /**/ #endif +/* HAS_MEMCHR: + * This symbol, if defined, indicates that the memchr routine is available + * to locate characters within a C string. + */ +#$d_memchr HAS_MEMCHR /**/ + +/* 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_SEM: + * This symbol, if defined, indicates that the entire sem*(2) library is + * supported. + */ +#$d_sem HAS_SEM /**/ + +/* HAS_SETGRENT: + * This symbol, if defined, indicates that the setgrent routine is + * available for initializing sequential access of the group database. + */ +#$d_setgrent 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 @@ -1683,6 +1840,12 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #$d_setpent HAS_SETPROTOENT /**/ +/* HAS_SETPWENT: + * This symbol, if defined, indicates that the setpwent routine is + * available for initializing sequential access of the passwd database. + */ +#$d_setpwent HAS_SETPWENT /**/ + /* HAS_SETSERVENT: * This symbol, if defined, indicates that the setservent() routine is * available. @@ -1696,6 +1859,12 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #$d_setvbuf HAS_SETVBUF /**/ +/* HAS_SHM: + * This symbol, if defined, indicates that the entire shm*(2) library is + * supported. + */ +#$d_shm HAS_SHM /**/ + /* HAS_SOCKET: * This symbol, if defined, indicates that the BSD socket interface is * supported. @@ -1704,8 +1873,71 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- * This symbol, if defined, indicates that the BSD socketpair() call is * supported. */ -#$d_socket HAS_SOCKET /**/ -#$d_sockpair HAS_SOCKETPAIR /**/ +/* 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. + */ +#$d_socket HAS_SOCKET /**/ +#$d_sockpair HAS_SOCKETPAIR /**/ +#$d_msg_ctrunc HAS_MSG_CTRUNC /**/ +#$d_msg_dontroute HAS_MSG_DONTROUTE /**/ +#$d_msg_oob HAS_MSG_OOB /**/ +#$d_msg_peek HAS_MSG_PEEK /**/ +#$d_msg_proxy HAS_MSG_PROXY /**/ +#$d_scm_rights HAS_SCM_RIGHTS /**/ + +/* 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_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. + */ +#$d_strerror HAS_STRERROR /**/ +#$d_syserrlst HAS_SYS_ERRLIST /**/ +#define Strerror(e) $d_strerrm /* HAS_UNION_SEMUN: * This symbol, if defined, indicates that the union semun is @@ -1729,6 +1961,11 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- #$d_semctl_semun USE_SEMCTL_SEMUN /**/ #$d_semctl_semid_ds USE_SEMCTL_SEMID_DS /**/ +/* HAS_VFORK: + * This symbol, if defined, indicates that vfork() exists. + */ +#$d_vfork 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 @@ -1750,6 +1987,17 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- #define Groups_t $groupstype /* 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. + */ +#$i_grp I_GRP /**/ +#$d_grpasswd GRPASSWD /**/ + /* I_NETDB: * This symbol, if defined, indicates that <netdb.h> exists and * should be included. @@ -1792,18 +2040,6 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- * This symbol, if defined, indicates to the C program that struct passwd * contains pw_passwd. */ -/* HAS_SETPWENT: - * This symbol, if defined, indicates that the getpwrent routine is - * available for initializing sequential access of the passwd database. - */ -/* HAS_GETPWENT: - * This symbol, if defined, indicates that the getpwent routine is - * available for sequential access of the password database. - */ -/* HAS_ENDPWENT: - * This symbol, if defined, indicates that the getpwent routine is - * available for finalizing sequential access of the passwd database. - */ #$i_pwd I_PWD /**/ #$d_pwquota PWQUOTA /**/ #$d_pwage PWAGE /**/ @@ -1813,9 +2049,12 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- #$d_pwcomment PWCOMMENT /**/ #$d_pwgecos PWGECOS /**/ #$d_pwpasswd PWPASSWD /**/ -#$d_setpwent HAS_SETPWENT /**/ -#$d_getpwent HAS_GETPWENT /**/ -#$d_endpwent HAS_ENDPWENT /**/ + +/* I_SYSUIO: + * This symbol, if defined, indicates that <sys/uio.h> exists and + * should be included. + */ +#$i_sysuio I_SYSUIO /**/ /* Free_t: * This variable contains the return type of free(). It is usually @@ -1888,21 +2127,25 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- #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 $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. +/* HAS_ATOLF: + * This symbol, if defined, indicates that the atolf routine is + * available to convert strings into long doubles. */ -/* 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_atolf HAS_ATOLF /**/ + +/* HAS_ATOLL: + * This symbol, if defined, indicates that the atoll routine is + * available to convert strings into long longs. */ -#$d_archlib ARCHLIB "$archlib" /**/ -#$d_archlib ARCHLIB_EXP "$archlibexp" /**/ +#$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. + */ +#$d_bincompat5005 PERL_BINCOMPAT_5005 /**/ /* DLSYM_NEEDS_UNDERSCORE: * This symbol, if defined, indicates that we need to prepend an @@ -1912,18 +2155,155 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #$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. + */ +#$d_endspent HAS_ENDSPENT /**/ + +/* 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 /**/ + +/* 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_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_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_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. + */ +#$d_int64t HAS_INT64_T /**/ + +/* 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_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 /**/ + /* USE_SFIO: * This symbol, if defined, indicates that sfio should * be used. */ #$d_sfio USE_SFIO /**/ +/* HAS_SQRTL: + * This symbol, if defined, indicates that the sqrtl routine is + * available to do long double square roots. + */ +#$d_sqrtl HAS_SQRTL /**/ + +/* 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 /**/ + +/* 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 /**/ + +/* 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 /**/ + /* USE_DYNAMIC_LOADING: * This symbol, if defined, indicates that dynamic loading of * some sort is available. */ #$usedl 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. + */ +#$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 @@ -1937,18 +2317,200 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- #define DB_Hash_t $db_hashtype /**/ #define DB_Prefix_t $db_prefixtype /**/ -/* 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_INTTYPES: + * This symbol, if defined, indicates to the C program that it should + * include <inttypes.h>. */ -/* 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. +#$i_inttypes I_INTTYPES /**/ + +/* I_MNTENT: + * This symbol, if defined, indicates that <mntent.h> exists and + * should be included. */ -#define PRIVLIB "$privlib" /**/ -#define PRIVLIB_EXP "$privlibexp" /**/ +#$i_mntent I_MNTENT /**/ + +/* 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_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_SYS_VFS: + * This symbol, if defined, indicates that <sys/vfs.h> exists and + * should be included. + */ +#$i_sysvfs I_SYS_VFS /**/ + +/* I_USTAT: + * This symbol, if defined, indicates that <ustat.h> exists and + * should be included. + */ +#$i_ustat I_USTAT /**/ + +/* 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 /**/ + +/* IVTYPE: + * This symbol defines the C type used for Perl's IV. + */ +/* UVTYPE: + * This symbol defines the C type used for Perl's UV. + */ +/* I8TYPE: + * This symbol defines the C type used for Perl's I8. + */ +/* U8TYPE: + * This symbol defines the C type used for Perl's U8. + */ +/* I16TYPE: + * This symbol defines the C type used for Perl's I16. + */ +/* U16TYPE: + * This symbol defines the C type used for Perl's U16. + */ +/* I32TYPE: + * This symbol defines the C type used for Perl's I32. + */ +/* U32TYPE: + * This symbol defines the C type used for Perl's U32. + */ +/* I64TYPE: + * This symbol defines the C type used for Perl's I64. + */ +/* U64TYPE: + * This symbol defines the C type used for Perl's U64. + */ +/* NVTYPE: + * This symbol defines the C type used for Perl's NV. + */ +/* IVSIZE: + * This symbol contains the sizeof(IV). + */ +/* UVSIZE: + * This symbol contains the sizeof(UV). + */ +/* I8SIZE: + * This symbol contains the sizeof(I8). + */ +/* U8SIZE: + * This symbol contains the sizeof(U8). + */ +/* I16SIZE: + * This symbol contains the sizeof(I16). + */ +/* U16SIZE: + * This symbol contains the sizeof(U16). + */ +/* I32SIZE: + * This symbol contains the sizeof(I32). + */ +/* U32SIZE: + * This symbol contains the sizeof(U32). + */ +/* I64SIZE: + * This symbol contains the sizeof(I64). + */ +/* U64SIZE: + * This symbol contains the sizeof(U64). + */ +#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 + +/* IVdf: + * This symbol defines the format string used for printing a Perl IV + * as a signed decimal integer. + */ +/* UVuf: + * This symbol defines the format string used for printing a Perl UV + * as an unsigned decimal integer. + */ +/* UVof: + * This symbol defines the format string used for printing a Perl UV + * as an unsigned octal integer. + */ +/* UVxf: + * This symbol defines the format string used for printing a Perl UV + * as an unsigned hexadecimal integer. + */ +#define IVdf $ivdformat /**/ +#define UVuf $uvuformat /**/ +#define UVof $uvoformat /**/ +#define UVxf $uvxformat /**/ /* SELECT_MIN_BITS: * This symbol holds the minimum number of bits operated by select. @@ -1959,51 +2521,135 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #define SELECT_MIN_BITS $selectminbits /**/ -/* 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. +/* 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. */ -/* 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 STARTPERL "$startperl" /**/ + +/* 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 SITEARCH "$sitearch" /**/ -#define SITEARCH_EXP "$sitearchexp" /**/ +#$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY /**/ +#define STDIO_STREAM_ARRAY $stdio_stream_array -/* 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. +/* HAS_STRTOULL: + * This symbol, if defined, indicates that the strtoull routine is + * available to convert strings into unsigned long longs. */ -/* 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. +#$d_strtoull HAS_STRTOULL /**/ + +/* USE_64_BITS: + * 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). */ -#define SITELIB "$sitelib" /**/ -#define SITELIB_EXP "$sitelibexp" /**/ +#ifndef USE_64_BITS +#$use64bits USE_64_BITS /**/ +#endif -/* 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. +/* 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. */ -#define STARTPERL "$startperl" /**/ +#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 MULTIPLICITY +#$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 + +/* PERL_XS_APIVERSION: + * This variable contains the version of the oldest perl binary + * compatible with the present perl. perl.c:incpush() and + * lib/lib.pm will automatically search in $sitearch for older + * directories across major versions back to xs_apiversion. + * 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. + * Since this can depend on compile time options (such as + * bincompat) it is set by Configure. Other non-default sources + * of potential incompatibility, such as multiplicity, threads, + * debugging, 64bits, sfio, etc., are not checked for currently, + * though in principle we could go snooping around in old + * Config.pm files. + */ +/* PERL_PM_APIVERSION: + * This variable contains the version of the oldest perl + * compatible with the present perl. (That is, pure perl modules + * written for pm_apiversion will still work for the current + * version). perl.c:incpush() and lib/lib.pm will automatically + * search in $sitelib for older directories across major versions + * back to pm_apiversion. This is only useful if you have a perl + * library directory tree structured like the default one. The + * versioned site_perl library was introduced in 5.005, so that's + * the default setting for this variable. It's hard to imagine + * it changing before Perl6. It is included here for symmetry + * with xs_apiveprsion -- the searching algorithms will + * (presumably) be similar. + * See the INSTALL file for how this works. + */ +#define PERL_XS_APIVERSION $xs_apiversion /* Change to string for tuples?*/ +#define PERL_PM_APIVERSION $pm_apiversion /* Change to string for tuples?*/ + +/* 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 @@ -2074,36 +2720,46 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #define ARCHNAME "$archname" /**/ -/* I_MACH_CTHREADS: - * This symbol, if defined, indicates to the C program that it should - * include <mach/cthreads.h>. +/* 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 I_MACH_CTHREADS /**/ - -/* I_PTHREAD: - * This symbol, if defined, indicates to the C program that it should - * include <pthread.h>. - */ -/*#define I_PTHREAD /**/ +#$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. + * 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. + * 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 /**/ -/* PTHREADS_CREATED_JOINABLE: - * This symbol, if defined, indicates that pthreads are created - * in the joinable (aka undetached) state. +/* I_MACH_CTHREADS: + * This symbol, if defined, indicates to the C program that it should + * include <mach/cthreads.h>. */ -#$d_pthreads_created_joinable PTHREADS_CREATED_JOINABLE /**/ +#$i_machcthr I_MACH_CTHREADS /**/ + +/* I_PTHREAD: + * This symbol, if defined, indicates to the C program that it should + * include <pthread.h>. + */ +#$i_pthread I_PTHREAD /**/ /* USE_THREADS: * This symbol, if defined, indicates that Perl should @@ -2113,7 +2769,9 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- * This symbol, if defined, indicates that Perl should * be built to use the old draft POSIX threads API. */ +#ifndef USE_TTHREADS #$usethreads USE_THREADS /**/ +#endif #$d_oldpthreads OLD_PTHREADS_API /**/ /* Time_t: @@ -2137,6 +2795,16 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #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, @@ -2151,7 +2819,15 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- * 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 */ /* Mode_t: * This symbol holds the type used to declare file modes @@ -2176,6 +2852,16 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #define Size_t $sizetype /* length paramater for string functions */ +/* Uid_t_f: + * This symbol defines the format string used for printing a Uid_t. + */ +#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 diff --git a/vos/perl.bind b/vos/perl.bind index 731d7c01f4..714ce3d680 100644 --- a/vos/perl.bind +++ b/vos/perl.bind @@ -2,9 +2,6 @@ name: perl; /* entry: main; */ -variables: - s$c_options init (4); /* Use VOS-style pathnames. */ - modules: miniperlmain, av, deb, @@ -17,6 +14,7 @@ modules: miniperlmain, mg, op, perl, + perlapi, perlio, perly, pp, @@ -31,7 +29,9 @@ modules: miniperlmain, taint, toke, universal, + utf8, util, + xsutils, vos_dummies, tcp_runtime, tcp_gethost; diff --git a/vos/test_vos_dummies.c b/vos/test_vos_dummies.c index 2f5cc941eb..7d86c303a0 100644 --- a/vos/test_vos_dummies.c +++ b/vos/test_vos_dummies.c @@ -1,6 +1,6 @@ /* +++begin copyright+++ ******************************************* */ /* */ -/* COPYRIGHT (c) 1997, 1998 Stratus Computer, Inc. */ +/* COPYRIGHT (c) 1997, 1998, 2000 Stratus Computer (DE), Inc. */ /* */ /* This program is free software; you can redistribute it and/or */ /* modify it under the terms of either: */ diff --git a/vos/vos_dummies.c b/vos/vos_dummies.c index b14c444888..3c0852db60 100644 --- a/vos/vos_dummies.c +++ b/vos/vos_dummies.c @@ -1,6 +1,6 @@ /* +++begin copyright+++ ******************************************* */ /* */ -/* COPYRIGHT (c) 1997, 1998 Stratus Computer, Inc. */ +/* COPYRIGHT (c) 1997, 1998, 1999, 2000 Stratus Computer (DE), Inc. */ /* */ /* This program is free software; you can redistribute it and/or */ /* modify it under the terms of either: */ @@ -29,7 +29,7 @@ /* */ /* +++end copyright+++ ********************************************* */ -#define _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 199309L #include <stdio.h> #include <string.h> @@ -46,7 +46,7 @@ static void bomb (char *p_name) { char_varying(256) msgvs; - strcpy_vstr_nstr (&msgvs, "FATAL ERROR: Call to missing function '"); + strcpy_vstr_nstr (&msgvs, "FATAL ERROR: Call to unimplemented function '"); strcat_vstr_nstr (&msgvs, p_name); strcat_vstr_nstr (&msgvs, "'. Entering debugger."); s$write_code (&msgvs, &0); @@ -76,21 +76,6 @@ extern int do_spawn () bomb ("do_spawn"); } -extern int execlp (const char *_file, const char *_arg, ...) -{ - bomb ("execlp"); -} - -extern int execl (const char *_path, const char *_arg, ...) -{ - bomb ("execl"); -} - -extern int execvp (const char *_file, char *const _argv[], ...) -{ - bomb ("execvp"); -} - extern pid_t fork (void) { bomb ("fork"); diff --git a/vos/vosish.h b/vos/vosish.h index 16487023a9..c5c819a57b 100644 --- a/vos/vosish.h +++ b/vos/vosish.h @@ -54,7 +54,7 @@ * This symbol is defined if this system has a stat structure declaring * st_rdev */ -#define USE_STAT_RDEV / **/ +/*#define USE_STAT_RDEV / **/ /* ACME_MESS: * This symbol, if defined, indicates that error messages should be @@ -89,7 +89,7 @@ */ /* #define ALTERNATE_SHEBANG "#!" / **/ -#if !defined(NSIG) || defined(M_UNIX) || defined(M_XENIX) +#if !defined(NSIG) || defined(M_UNIX) || defined(M_XENIX) || defined(__NetBSD__) # include <signal.h> #endif @@ -114,12 +114,20 @@ #define Fflush(fp) fflush(fp) #define Mkdir(path,mode) mkdir((path),(mode)) +/* these should be set in a hint file, not here */ #ifndef PERL_SYS_INIT #ifdef PERL_SCO5 -/* this should be set in a hint file, not here */ # define PERL_SYS_INIT(c,v) fpsetmask(0); MALLOC_INIT #else -# define PERL_SYS_INIT(c,v) MALLOC_INIT +# ifdef POSIX_BC +# define PERL_SYS_INIT(c,v) sigignore(SIGFPE); MALLOC_INIT +# else +# ifdef CYGWIN +# define PERL_SYS_INIT(c,v) Perl_my_setenv_init(&environ); MALLOC_INIT +# else +# define PERL_SYS_INIT(c,v) MALLOC_INIT +# endif +# endif #endif #endif diff --git a/warnings.pl b/warnings.pl index 72d19af67b..9d571038e2 100644 --- a/warnings.pl +++ b/warnings.pl @@ -300,14 +300,15 @@ sub bits { 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 ; + if ($word eq 'FATAL') { + $fatal = 1; + } + else { + if ($catmask = $Bits{$word}) { + $mask |= $catmask ; + $mask |= $DeadBits{$word} if $fatal ; + } } - else - { croak "unknown warning category '$word'" } } return $mask ; @@ -315,12 +316,12 @@ sub bits { sub import { shift; - ${^Warnings} |= bits(@_ ? @_ : 'all') ; + ${^WARNING_BITS} |= bits(@_ ? @_ : 'all') ; } sub unimport { shift; - ${^Warnings} &= ~ bits(@_ ? @_ : 'all') ; + ${^WARNING_BITS} &= ~ bits(@_ ? @_ : 'all') ; } sub enabled @@ -328,7 +329,7 @@ sub enabled my $string = shift ; return 1 - if $bits{$string} && ${^Warnings} & $bits{$string} ; + if $bits{$string} && ${^WARNING_BITS} & $bits{$string} ; return 0 ; } diff --git a/win32/Makefile b/win32/Makefile index c100d45777..6bf5e6ec33 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -29,7 +29,7 @@ INST_TOP = $(INST_DRV)\perl # versioned installation can be obtained by setting INST_TOP above to a # path that includes an arbitrary version string. # -INST_VER = \5.5.640 +INST_VER = \5.5.650 # # Comment this out if you DON'T want your perl installation to have @@ -43,42 +43,47 @@ INST_VER = \5.5.640 INST_ARCH = \$(ARCHNAME) # -# XXX WARNING! This option currently undergoing changes. May be broken. +# uncomment to enable multiple interpreters. This is need for fork() +# emulation. # -# uncomment to enable threads-capabilities -# -#USE_5005THREADS= define +#USE_MULTI = define # -# XXX WARNING! This option currently undergoing changes. May be broken. +# XXX WARNING! This option is still very experimental. May be broken. # -# uncomment to enable multiple interpreters +# Beginnings of interpreter cloning/threads; still very incomplete. +# This should be enabled to get the fork() emulation. This needs +# USE_MULTI as well. # -#USE_MULTI = define +#USE_ITHREADS = define # -# XXX WARNING! This option currently undergoing changes. May be broken. -# -# uncomment next line if you want to use the perl object -# Currently, this cannot be enabled if you ask for threads above +# uncomment to enable the implicit "host" layer for all system calls +# made by perl. This needs USE_MULTI above. This is also needed to +# get fork(). # -#USE_OBJECT = define +#USE_IMP_SYS = define # -# XXX WARNING! This option currently undergoing changes. May be broken. +# WARNING! This option is deprecated and will eventually go away (enable +# USE_ITHREADS instead). # -# 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! +# uncomment to enable threads-capabilities. This is incompatible with +# USE_ITHREADS, and is only here for people who may have come to rely +# on the experimental Thread support that was in 5.005. # -#USE_ITHREADS = define +#USE_5005THREADS= 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(). +# WARNING! This option is deprecated and will eventually go away (enable +# USE_MULTI instead). # -#USE_IMP_SYS = define +# uncomment next line if you want to use the PERL_OBJECT build option. +# DO NOT ENABLE unless you have legacy code that relies on the C++ +# CPerlObj class that was available in 5.005. This cannot be enabled +# if you ask for USE_5005THREADS above. +# +#USE_OBJECT = define # # uncomment one of the following lines if you are using either @@ -102,7 +107,6 @@ INST_ARCH = \$(ARCHNAME) # 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 @@ -132,7 +136,7 @@ INST_ARCH = \$(ARCHNAME) # WARNING: Turning this on/off WILL break binary compatibility with extensions # you may have compiled with/without it. Be prepared to recompile all # extensions if you change the default. Currently, this cannot be enabled -# if you ask for USE_OBJECT above. +# if you ask for USE_IMP_SYS above. # #PERL_MALLOC = define @@ -222,6 +226,10 @@ USE_5005THREADS = undef USE_ITHREADS = undef !ENDIF +!IF "$(USE_IMP_SYS)" == "define" +PERL_MALLOC = undef +!ENDIF + !IF "$(USE_MULTI)" == "" USE_MULTI = undef !ENDIF @@ -242,6 +250,15 @@ USE_IMP_SYS = undef USE_PERLCRT = undef !ENDIF +!IF "$(USE_IMP_SYS)$(USE_MULTI)$(USE_5005THREADS)$(USE_OBJECT)" == "defineundefundefundef" +USE_MULTI = define +!ENDIF + +!IF "$(USE_ITHREADS)$(USE_MULTI)$(USE_OBJECT)" == "defineundefundef" +USE_MULTI = define +USE_5005THREADS = undef +!ENDIF + !IF "$(USE_MULTI)$(USE_5005THREADS)$(USE_OBJECT)" != "undefundefundef" BUILDOPT = $(BUILDOPT) -DPERL_IMPLICIT_CONTEXT !ENDIF @@ -415,17 +432,12 @@ $(o).dll: -out:$@ $(LINK_FLAGS) $(LIBFILES) $< $(LIBPERL) .rc.res: - $(RSC) $< + $(RSC) -i.. $< # # various targets -!IF "$(USE_OBJECT)" == "define" PERLIMPLIB = ..\perl56.lib PERLDLL = ..\perl56.dll -!ELSE -PERLIMPLIB = ..\perl.lib -PERLDLL = ..\perl.dll -!ENDIF MINIPERL = ..\miniperl.exe MINIDIR = .\mini @@ -469,10 +481,6 @@ MAKE = nmake -nologo CFGSH_TMPL = config.vc CFGH_TMPL = config_H.vc -!IF "$(BUILD_FOR_WIN95)" == "define" -PERL95EXE = ..\perl95.exe -!ENDIF - XCOPY = xcopy /f /r /i /d RCOPY = xcopy /f /r /i /e /d NOOP = @echo @@ -536,15 +544,6 @@ WIN32_SRC = $(WIN32_SRC) .\win32thread.c WIN32_SRC = $(WIN32_SRC) .\$(CRYPT_SRC) !ENDIF -PERL95_SRC = \ - perl95.c \ - win32mt.c \ - win32sckmt.c - -!IF "$(CRYPT_SRC)" != "" -PERL95_SRC = $(PERL95_SRC) .\$(CRYPT_SRC) -!ENDIF - DLL_SRC = $(DYNALOADER).c X2P_SRC = \ @@ -607,7 +606,6 @@ MINICORE_OBJ = $(MICROCORE_OBJ:..\=.\mini\) \ $(MINIDIR)\perlio$(o) MINIWIN32_OBJ = $(WIN32_OBJ:.\=.\mini\) MINI_OBJ = $(MINICORE_OBJ) $(MINIWIN32_OBJ) -PERL95_OBJ = $(PERL95_SRC:.c=.obj) DLL_OBJ = $(DLL_SRC:.c=.obj) X2P_OBJ = $(X2P_SRC:.c=.obj) @@ -616,7 +614,6 @@ PERLEXE_OBJ = perlmain$(o) PERLDLL_OBJ = $(PERLDLL_OBJ) $(WIN32_OBJ) $(DLL_OBJ) #PERLEXE_OBJ = $(PERLEXE_OBJ) $(WIN32_OBJ) $(DLL_OBJ) -#PERL95_OBJ = $(PERL95_OBJ) DynaLoadmt$(o) !IF "$(USE_SETARGV)" != "" SETARGV_OBJ = setargv$(o) @@ -736,7 +733,7 @@ CFG_VARS = \ # Top targets # -all : .\config.h $(GLOBEXE) $(MINIMOD) $(CONFIGPM) $(PERLEXE) $(PERL95EXE) \ +all : .\config.h $(GLOBEXE) $(MINIMOD) $(CONFIGPM) $(PERLEXE) \ $(X2P) $(EXTENSION_DLL) $(EXTENSION_PM) $(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c @@ -810,7 +807,6 @@ $(MINI_OBJ) : $(CORE_NOCFG_H) $(WIN32_OBJ) : $(CORE_H) $(CORE_OBJ) : $(CORE_H) $(DLL_OBJ) : $(CORE_H) -$(PERL95_OBJ) : $(CORE_H) $(X2P_OBJ) : $(CORE_H) perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym ..\pp.sym ..\makedef.pl @@ -858,37 +854,10 @@ $(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES) $(LINK32) -subsystem:console -out:$@ $(LINK_FLAGS) $(LIBFILES) \ $(PERLEXE_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) $(PERLEXE_RES) copy $(PERLEXE) $(WPERLEXE) - editbin /subsystem:windows $(WPERLEXE) + $(MINIPERL) -I..\lib bin\exetype.pl $(WPERLEXE) WINDOWS copy splittree.pl .. $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR) -!IF "$(BUILD_FOR_WIN95)" == "define" - -perl95.c : runperl.c - copy runperl.c perl95.c - -perl95$(o) : perl95.c - $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c perl95.c - -win32sckmt$(o) : win32sck.c - $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \ - $(OBJOUT_FLAG)win32sckmt$(o) win32sck.c - -win32mt$(o) : win32.c - $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \ - $(OBJOUT_FLAG)win32mt$(o) win32.c - -DynaLoadmt$(o) : $(DYNALOADER).c - $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \ - $(OBJOUT_FLAG)DynaLoadmt$(o) $(DYNALOADER).c - -$(PERL95EXE): $(PERLDLL) $(CONFIGPM) $(PERL95_OBJ) - $(LINK32) -subsystem:console -nodefaultlib -out:$@ $(LINK_FLAGS) \ - $(LIBBASEFILES) $(PERL95_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) \ - libcmt.lib - -!ENDIF - $(DYNALOADER).c: $(MINIPERL) $(EXTDIR)\DynaLoader\dl_win32.xs $(CONFIGPM) if not exist $(AUTODIR) mkdir $(AUTODIR) cd $(EXTDIR)\$(*B) @@ -1015,7 +984,7 @@ utils: $(PERLEXE) $(X2P) $(PERLEXE) $(PL2BAT) $(UTILS) distclean: clean - -del /f $(MINIPERL) $(PERLEXE) $(PERL95EXE) $(PERLDLL) $(GLOBEXE) \ + -del /f $(MINIPERL) $(PERLEXE) $(PERLDLL) $(GLOBEXE) \ $(PERLIMPLIB) ..\miniperl.lib $(MINIMOD) -del /f *.def *.map -del /f $(EXTENSION_DLL) $(EXTENSION_PM) @@ -1046,7 +1015,6 @@ distclean: clean cd ..\win32 -del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new -del /f $(CONFIGPM) - -del /f perl95.c -del /f bin\*.bat cd $(EXTDIR) -del /s *.lib *.def *.map *.pdb *.bs Makefile *$(o) pm_to_blib @@ -1058,9 +1026,6 @@ install : all installbare installhtml installbare : utils $(PERLEXE) ..\installperl -!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)\*.* diff --git a/win32/bin/exetype.pl b/win32/bin/exetype.pl new file mode 100644 index 0000000000..5846b3ee3b --- /dev/null +++ b/win32/bin/exetype.pl @@ -0,0 +1,61 @@ +#!perl -w +use strict; +unless (@ARGV == 2) { + print "Usage: $0 exefile [CONSOLE|WINDOWS]\n"; + exit; +} +unless ($ARGV[1] =~ /^(console|windows)$/i) { + print "Invalid subsystem $ARGV[1], please use CONSOLE or WINDOWS\n"; + exit; +} +my ($record,$magic,$offset,$size); +open EXE, "+< $ARGV[0]" or die "Cannot open $ARGV[0]: $!"; +binmode EXE; +read EXE, $record, 32*4; +($magic,$offset) = unpack "Sx58L", $record; +die "Not an MSDOS executable file" unless $magic == 0x5a4d; +seek EXE, $offset, 0; +read EXE, $record, 24; +($magic,$size) = unpack "Lx16S", $record; +die "PE header not found" unless $magic == 0x4550; +die "Optional header not in NT32 format" unless $size == 224; +seek EXE, $offset+24+68, 0; +print EXE pack "S", uc($ARGV[1]) eq 'CONSOLE' ? 3 : 2; +close EXE; +__END__ + +=head1 NAME + +exetype - Change executable subsystem type between "Console" and "Windows" + +=head1 SYNOPSIS + + C:\perl\bin> copy perl.exe guiperl.exe + C:\perl\bin> exetype guiperl.exe windows + +=head1 DESCRIPTION + +This program edits an executable file to indicate which subsystem the +operating system must invoke for execution. + +You can specify any of the following subsystems: + +=over + +=item CONSOLE + +The CONSOLE subsystem handles a Win32 character-mode application that +use a console supplied by the operating system. + +=item WINDOWS + +The WINDOWS subsystem handles an application that does not require a +console and creates its own windows, if required. + +=back + +=head1 AUTHOR + +Jan Dubois <jand@activestate.com> + +=cut diff --git a/win32/config.bc b/win32/config.bc index 137347e349..fd70a3f560 100644 --- a/win32/config.bc +++ b/win32/config.bc @@ -472,6 +472,7 @@ i_varhdr='varargs.h' i_vfork='undef' ignore_versioned_solibs='' inc_version_list='' +inc_version_list_init='0' incpath='' inews='' installarchlib='~INST_TOP~~INST_VER~\lib~INST_ARCH~' diff --git a/win32/config.gc b/win32/config.gc index abfc288cc2..10a1c778f9 100644 --- a/win32/config.gc +++ b/win32/config.gc @@ -472,6 +472,7 @@ i_varhdr='varargs.h' i_vfork='undef' ignore_versioned_solibs='' inc_version_list='' +inc_version_list_init='0' incpath='' inews='' installarchlib='~INST_TOP~~INST_VER~\lib~INST_ARCH~' diff --git a/win32/config.vc b/win32/config.vc index 729beb8cd4..5514827e86 100644 --- a/win32/config.vc +++ b/win32/config.vc @@ -472,6 +472,7 @@ i_varhdr='varargs.h' i_vfork='undef' ignore_versioned_solibs='' inc_version_list='' +inc_version_list_init='0' incpath='' inews='' installarchlib='~INST_TOP~~INST_VER~\lib~INST_ARCH~' diff --git a/win32/config_H.bc b/win32/config_H.bc index 399111f2b1..e89f71eecd 100644 --- a/win32/config_H.bc +++ b/win32/config_H.bc @@ -1082,7 +1082,7 @@ * 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 "c:\\perl\\5.5.650\\lib\\MSWin32-x86" /**/ /*#define ARCHLIB_EXP "" /**/ /* ARCHNAME: @@ -1113,8 +1113,8 @@ * 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" /**/ +#define BIN "c:\\perl\\5.5.650\\bin\\MSWin32-x86" /**/ +#define BIN_EXP "c:\\perl\\5.5.650\\bin\\MSWin32-x86" /**/ /* PERL_BINCOMPAT_5005: * This symbol, if defined, indicates that Perl 5.006 should be @@ -2305,7 +2305,7 @@ * for a C initialization string. See the inc_version_list entry * in Porting/Glossary for more details. */ -#define PERL_INC_VERSION_LIST /**/ +#define PERL_INC_VERSION_LIST 0 /**/ /* HAS_OFF64_T: * This symbol will be defined if the C compiler supports off64_t. @@ -2540,8 +2540,8 @@ * 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.5.640\\lib" /**/ -#define PRIVLIB_EXP (win32_get_privlib("5.5.640")) /**/ +#define PRIVLIB "c:\\perl\\5.5.650\\lib" /**/ +#define PRIVLIB_EXP (win32_get_privlib("5.5.650")) /**/ /* PTRSIZE: * This symbol contains the size of a pointer, so that the C preprocessor @@ -2639,7 +2639,7 @@ * 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.5.640\\lib\\MSWin32-x86" /**/ +#define SITEARCH "c:\\perl\\site\\5.5.650\\lib\\MSWin32-x86" /**/ /*#define SITEARCH_EXP "" /**/ /* SITELIB: @@ -2657,8 +2657,8 @@ * 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.5.640\\lib" /**/ -#define SITELIB_EXP (win32_get_sitelib("5.5.640")) /**/ +#define SITELIB "c:\\perl\\site\\5.5.650\\lib" /**/ +#define SITELIB_EXP (win32_get_sitelib("5.5.650")) /**/ /* Size_t: * This symbol holds the type used to declare length parameters diff --git a/win32/config_H.gc b/win32/config_H.gc index 9575e4325e..d9adb8f8d7 100644 --- a/win32/config_H.gc +++ b/win32/config_H.gc @@ -1082,7 +1082,7 @@ * 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 "c:\\perl\\5.5.650\\lib\\MSWin32-x86" /**/ /*#define ARCHLIB_EXP "" /**/ /* ARCHNAME: @@ -1113,8 +1113,8 @@ * 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" /**/ +#define BIN "c:\\perl\\5.5.650\\bin\\MSWin32-x86" /**/ +#define BIN_EXP "c:\\perl\\5.5.650\\bin\\MSWin32-x86" /**/ /* PERL_BINCOMPAT_5005: * This symbol, if defined, indicates that Perl 5.006 should be @@ -2305,7 +2305,7 @@ * for a C initialization string. See the inc_version_list entry * in Porting/Glossary for more details. */ -#define PERL_INC_VERSION_LIST /**/ +#define PERL_INC_VERSION_LIST 0 /**/ /* HAS_OFF64_T: * This symbol will be defined if the C compiler supports off64_t. @@ -2540,8 +2540,8 @@ * 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.5.640\\lib" /**/ -#define PRIVLIB_EXP (win32_get_privlib("5.5.640")) /**/ +#define PRIVLIB "c:\\perl\\5.5.650\\lib" /**/ +#define PRIVLIB_EXP (win32_get_privlib("5.5.650")) /**/ /* PTRSIZE: * This symbol contains the size of a pointer, so that the C preprocessor @@ -2639,7 +2639,7 @@ * 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.5.640\\lib\\MSWin32-x86" /**/ +#define SITEARCH "c:\\perl\\site\\5.5.650\\lib\\MSWin32-x86" /**/ /*#define SITEARCH_EXP "" /**/ /* SITELIB: @@ -2657,8 +2657,8 @@ * 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.5.640\\lib" /**/ -#define SITELIB_EXP (win32_get_sitelib("5.5.640")) /**/ +#define SITELIB "c:\\perl\\site\\5.5.650\\lib" /**/ +#define SITELIB_EXP (win32_get_sitelib("5.5.650")) /**/ /* Size_t: * This symbol holds the type used to declare length parameters diff --git a/win32/config_H.vc b/win32/config_H.vc index dc019993ae..1cd5e65a60 100644 --- a/win32/config_H.vc +++ b/win32/config_H.vc @@ -1082,7 +1082,7 @@ * 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 "c:\\perl\\5.5.650\\lib\\MSWin32-x86" /**/ /*#define ARCHLIB_EXP "" /**/ /* ARCHNAME: @@ -1113,8 +1113,8 @@ * 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" /**/ +#define BIN "c:\\perl\\5.5.650\\bin\\MSWin32-x86" /**/ +#define BIN_EXP "c:\\perl\\5.5.650\\bin\\MSWin32-x86" /**/ /* PERL_BINCOMPAT_5005: * This symbol, if defined, indicates that Perl 5.006 should be @@ -2305,7 +2305,7 @@ * for a C initialization string. See the inc_version_list entry * in Porting/Glossary for more details. */ -#define PERL_INC_VERSION_LIST /**/ +#define PERL_INC_VERSION_LIST 0 /**/ /* HAS_OFF64_T: * This symbol will be defined if the C compiler supports off64_t. @@ -2540,8 +2540,8 @@ * 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.5.640\\lib" /**/ -#define PRIVLIB_EXP (win32_get_privlib("5.5.640")) /**/ +#define PRIVLIB "c:\\perl\\5.5.650\\lib" /**/ +#define PRIVLIB_EXP (win32_get_privlib("5.5.650")) /**/ /* PTRSIZE: * This symbol contains the size of a pointer, so that the C preprocessor @@ -2639,7 +2639,7 @@ * 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.5.640\\lib\\MSWin32-x86" /**/ +#define SITEARCH "c:\\perl\\site\\5.5.650\\lib\\MSWin32-x86" /**/ /*#define SITEARCH_EXP "" /**/ /* SITELIB: @@ -2657,8 +2657,8 @@ * 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.5.640\\lib" /**/ -#define SITELIB_EXP (win32_get_sitelib("5.5.640")) /**/ +#define SITELIB "c:\\perl\\site\\5.5.650\\lib" /**/ +#define SITELIB_EXP (win32_get_sitelib("5.5.650")) /**/ /* Size_t: * This symbol holds the type used to declare length parameters diff --git a/win32/makefile.mk b/win32/makefile.mk index e6ed1765a7..64f89fdbb3 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -33,7 +33,7 @@ INST_TOP *= $(INST_DRV)\perl # versioned installation can be obtained by setting INST_TOP above to a # path that includes an arbitrary version string. # -INST_VER *= \5.5.640 +INST_VER *= \5.5.650 # # Comment this out if you DON'T want your perl installation to have @@ -47,43 +47,47 @@ INST_VER *= \5.5.640 INST_ARCH *= \$(ARCHNAME) # -# XXX WARNING! This option currently undergoing changes. May be broken. +# uncomment to enable multiple interpreters. This is need for fork() +# emulation. # -# uncomment to enable threads-capabilities -# -#USE_5005THREADS *= define +#USE_MULTI *= define # -# XXX WARNING! This option currently undergoing changes. May be broken. +# XXX WARNING! This option is still very experimental. May be broken. # -# uncomment to enable multiple interpreters +# Beginnings of interpreter cloning/threads; still very incomplete. +# This should be enabled to get the fork() emulation. This needs +# USE_MULTI as well. # -#USE_MULTI *= define +#USE_ITHREADS *= define # -# XXX WARNING! This option currently undergoing changes. May be broken. -# -# uncomment next line if you want to use the perl object -# Currently, this cannot be enabled if you ask for threads above, or -# if you are using GCC or EGCS. +# uncomment to enable the implicit "host" layer for all system calls +# made by perl. This needs USE_MULTI above. This is also needed to +# get fork(). # -#USE_OBJECT *= define +#USE_IMP_SYS *= define # -# XXX WARNING! This option currently undergoing changes. May be broken. +# WARNING! This option is deprecated and will eventually go away (enable +# USE_ITHREADS instead). # -# 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! +# uncomment to enable threads-capabilities. This is incompatible with +# USE_ITHREADS, and is only here for people who may have come to rely +# on the experimental Thread support that was in 5.005. # -#USE_ITHREADS *= define +#USE_5005THREADS *= 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(). +# WARNING! This option is deprecated and will eventually go away (enable +# USE_MULTI instead). # -#USE_IMP_SYS *= define +# uncomment next line if you want to use the PERL_OBJECT build option. +# DO NOT ENABLE unless you have legacy code that relies on the C++ +# CPerlObj class that was available in 5.005. This cannot be enabled +# if you ask for USE_5005THREADS above. +# +#USE_OBJECT *= define # # uncomment exactly one of the following @@ -150,7 +154,7 @@ CCTYPE *= BORLAND # WARNING: Turning this on/off WILL break binary compatibility with extensions # you may have compiled with/without it. Be prepared to recompile all # extensions if you change the default. Currently, this cannot be enabled -# if you ask for USE_OBJECT above. +# if you ask for USE_IMP_SYS above. # #PERL_MALLOC *= define @@ -243,12 +247,25 @@ USE_5005THREADS *= undef USE_ITHREADS != undef .ENDIF +.IF "$(USE_IMP_SYS)" == "define" +PERL_MALLOC != undef +.ENDIF + USE_MULTI *= undef USE_OBJECT *= undef USE_ITHREADS *= undef USE_IMP_SYS *= undef USE_PERLCRT *= undef +.IF "$(USE_IMP_SYS)$(USE_MULTI)$(USE_5005THREADS)$(USE_OBJECT)" == "defineundefundefundef" +USE_MULTI != define +.ENDIF + +.IF "$(USE_ITHREADS)$(USE_MULTI)$(USE_OBJECT)" == "defineundefundef" +USE_MULTI != define +USE_5005THREADS != undef +.ENDIF + .IF "$(USE_MULTI)$(USE_5005THREADS)$(USE_OBJECT)" != "undefundefundef" BUILDOPT += -DPERL_IMPLICIT_CONTEXT .ENDIF @@ -523,7 +540,7 @@ $(o).dll: .ENDIF .rc.res: - $(RSC) $< + $(RSC) -i.. $< # # various targets @@ -583,19 +600,11 @@ PERLIMPLIB = ..\libperl$(a) CFGSH_TMPL = config.vc CFGH_TMPL = config_H.vc -.IF "$(USE_PERLCRT)" != "define" -PERL95EXE = ..\perl95.exe -.ENDIF .ENDIF -.IF "$(USE_OBJECT)" == "define" PERLIMPLIB *= ..\perl56$(a) PERLDLL = ..\perl56.dll -.ELSE -PERLIMPLIB *= ..\perl$(a) -PERLDLL = ..\perl.dll -.ENDIF XCOPY = xcopy /f /r /i /d RCOPY = xcopy /f /r /i /e /d @@ -659,15 +668,6 @@ WIN32_SRC += .\win32thread.c WIN32_SRC += .\$(CRYPT_SRC) .ENDIF -PERL95_SRC = \ - perl95.c \ - win32mt.c \ - win32sckmt.c - -.IF "$(CRYPT_SRC)" != "" -PERL95_SRC += .\$(CRYPT_SRC) -.ENDIF - DLL_SRC = $(DYNALOADER).c X2P_SRC = \ @@ -728,7 +728,6 @@ WIN32_OBJ = $(WIN32_SRC:db:+$(o)) MINICORE_OBJ = $(MINIDIR)\{$(MICROCORE_OBJ:f) miniperlmain$(o) perlio$(o)} MINIWIN32_OBJ = $(MINIDIR)\{$(WIN32_OBJ:f)} MINI_OBJ = $(MINICORE_OBJ) $(MINIWIN32_OBJ) -PERL95_OBJ = $(PERL95_SRC:db:+$(o)) DLL_OBJ = $(DLL_SRC:db:+$(o)) X2P_OBJ = $(X2P_SRC:db:+$(o)) @@ -875,7 +874,7 @@ RIGHTMAKE = __not_needed # all : .\config.h $(GLOBEXE) $(MINIPERL) $(MK2) \ - $(RIGHTMAKE) $(MINIMOD) $(CONFIGPM) $(PERLEXE) $(PERL95EXE) \ + $(RIGHTMAKE) $(MINIMOD) $(CONFIGPM) $(PERLEXE) \ $(X2P) $(EXTENSION_DLL) $(EXTENSION_PM) $(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c @@ -1014,7 +1013,6 @@ $(MINI_OBJ) : $(CORE_NOCFG_H) $(WIN32_OBJ) : $(CORE_H) $(CORE_OBJ) : $(CORE_H) $(DLL_OBJ) : $(CORE_H) -$(PERL95_OBJ) : $(CORE_H) $(X2P_OBJ) : $(CORE_H) perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym ..\pp.sym ..\makedef.pl @@ -1096,43 +1094,12 @@ $(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES) .ELSE $(LINK32) -subsystem:console -out:$@ $(BLINK_FLAGS) $(LIBFILES) \ $(PERLEXE_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) $(PERLEXE_RES) - copy $(PERLEXE) $(WPERLEXE) - editbin /subsystem:windows $(WPERLEXE) .ENDIF + copy $(PERLEXE) $(WPERLEXE) + $(MINIPERL) -I..\lib bin\exetype.pl $(WPERLEXE) WINDOWS copy splittree.pl .. $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR) -.IF "$(CCTYPE)" != "BORLAND" -.IF "$(CCTYPE)" != "GCC" -.IF "$(USE_PERLCRT)" != "define" - -perl95.c : runperl.c - copy runperl.c perl95.c - -perl95$(o) : perl95.c - $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c perl95.c - -win32sckmt$(o) : win32sck.c - $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \ - $(OBJOUT_FLAG)win32sckmt$(o) win32sck.c - -win32mt$(o) : win32.c - $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \ - $(OBJOUT_FLAG)win32mt$(o) win32.c - -DynaLoadmt$(o) : $(DYNALOADER).c - $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \ - $(OBJOUT_FLAG)DynaLoadmt$(o) $(DYNALOADER).c - -$(PERL95EXE): $(PERLDLL) $(CONFIGPM) $(PERL95_OBJ) - $(LINK32) -subsystem:console -nodefaultlib -out:$@ $(BLINK_FLAGS) \ - $(LIBBASEFILES) $(PERL95_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) \ - libcmt.lib - -.ENDIF -.ENDIF -.ENDIF - $(DYNALOADER).c: $(MINIPERL) $(EXTDIR)\DynaLoader\dl_win32.xs $(CONFIGPM) if not exist $(AUTODIR) mkdir $(AUTODIR) cd $(EXTDIR)\$(*B) && ..\$(MINIPERL) -I..\..\lib $(*B)_pm.PL @@ -1237,7 +1204,7 @@ utils: $(PERLEXE) $(X2P) $(PERLEXE) $(PL2BAT) $(UTILS) distclean: clean - -del /f $(MINIPERL) $(PERLEXE) $(PERL95EXE) $(PERLDLL) $(GLOBEXE) \ + -del /f $(MINIPERL) $(PERLEXE) $(PERLDLL) $(GLOBEXE) \ $(PERLIMPLIB) ..\miniperl$(a) $(MINIMOD) -del /f *.def *.map -del /f $(EXTENSION_DLL) $(EXTENSION_PM) @@ -1263,9 +1230,6 @@ distclean: clean -cd ..\x2p && del /f find2perl s2p *.bat -del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new -del /f $(CONFIGPM) -.IF "$(PERL95EXE)" != "" - -del /f perl95.c -.ENDIF -del /f bin\*.bat -cd $(EXTDIR) && del /s *$(a) *.def *.map *.pdb *.bs Makefile *$(o) \ pm_to_blib @@ -1276,9 +1240,6 @@ install : all installbare installhtml 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)\*.* diff --git a/win32/perlhost.h b/win32/perlhost.h index 93cb4580b0..4b4ad586a4 100644 --- a/win32/perlhost.h +++ b/win32/perlhost.h @@ -1628,7 +1628,7 @@ PerlProcSignal(struct IPerlProc* piPerl, int sig, Sighandler_t subcode) } #ifdef USE_ITHREADS -static DWORD WINAPI +static THREAD_RET_TYPE win32_start_child(LPVOID arg) { PerlInterpreter *my_perl = (PerlInterpreter*)arg; @@ -1740,9 +1740,14 @@ PerlProcFork(struct IPerlProc* piPerl) id = win32_start_child((LPVOID)new_perl); PERL_SET_INTERP(aTHXo); # else +# ifdef USE_RTL_THREAD_API + handle = (HANDLE)_beginthreadex((void*)NULL, 0, win32_start_child, + (void*)new_perl, 0, (unsigned*)&id); +# else handle = CreateThread(NULL, 0, win32_start_child, (LPVOID)new_perl, 0, &id); - PERL_SET_INTERP(aTHXo); +# endif + PERL_SET_INTERP(aTHXo); /* XXX perl_clone*() set TLS */ if (!handle) Perl_croak(aTHX_ "panic: pseudo fork() failed"); w32_pseudo_child_handles[w32_num_pseudo_children] = handle; diff --git a/win32/perllib.c b/win32/perllib.c index 9ccf5a0043..26135f864e 100644 --- a/win32/perllib.c +++ b/win32/perllib.c @@ -87,8 +87,6 @@ perl_get_host_info(struct IPerlMemInfo* perlMemInfo, } } -#ifdef PERL_OBJECT - EXTERN_C PerlInterpreter* perl_alloc_override(struct IPerlMem** ppMem, struct IPerlMem** ppMemShared, struct IPerlMem** ppMemParse, struct IPerlEnv** ppEnv, @@ -97,33 +95,26 @@ perl_alloc_override(struct IPerlMem** ppMem, struct IPerlMem** ppMemShared, struct IPerlProc** ppProc) { PerlInterpreter *my_perl = NULL; - try - { - 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; - } + 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) { +#ifdef PERL_OBJECT + CPerlObj* pPerl = (CPerlObj*)my_perl; +#endif + w32_internal_host = pHost; } } - catch(...) - { - win32_fprintf(stderr, "%s\n", "Error: Unable to allocate memory"); - my_perl = NULL; - } - return my_perl; } @@ -131,34 +122,29 @@ EXTERN_C PerlInterpreter* perl_alloc(void) { PerlInterpreter* my_perl = NULL; - try - { - 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; - } + 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) { +#ifdef PERL_OBJECT + CPerlObj* pPerl = (CPerlObj*)my_perl; +#endif + w32_internal_host = pHost; } } - catch(...) - { - win32_fprintf(stderr, "%s\n", "Error: Unable to allocate memory"); - my_perl = NULL; - } - return my_perl; } +#ifdef PERL_OBJECT + EXTERN_C void perl_construct(PerlInterpreter* my_perl) { @@ -263,30 +249,6 @@ perl_parse(PerlInterpreter* my_perl, void (*xsinit)(CPerlObj*), int argc, char** #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 */ @@ -297,13 +259,19 @@ static DWORD g_TlsAllocIndex; EXTERN_C DllExport bool SetPerlInterpreter(void *interp) { - return TlsSetValue(g_TlsAllocIndex, interp); + DWORD dwErr = GetLastError(); + bool bResult = TlsSetValue(g_TlsAllocIndex, interp); + SetLastError(dwErr); + return bResult; } EXTERN_C DllExport void* GetPerlInterpreter(void) { - return TlsGetValue(g_TlsAllocIndex); + DWORD dwErr = GetLastError(); + LPVOID pResult = TlsGetValue(g_TlsAllocIndex); + SetLastError(dwErr); + return pResult; } EXTERN_C DllExport int diff --git a/win32/win32.c b/win32/win32.c index 78955fc046..71097ea1ae 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -671,7 +671,7 @@ win32_opendir(char *filename) WIN32_FIND_DATAW wFindData; HANDLE fh; char buffer[MAX_PATH*2]; - WCHAR wbuffer[MAX_PATH]; + WCHAR wbuffer[MAX_PATH+1]; char* ptr; len = strlen(filename); @@ -942,9 +942,9 @@ remove_dead_process(long child) if (child >= 0) { dTHXo; CloseHandle(w32_child_handles[child]); - Copy(&w32_child_handles[child+1], &w32_child_handles[child], + Move(&w32_child_handles[child+1], &w32_child_handles[child], (w32_num_children-child-1), HANDLE); - Copy(&w32_child_pids[child+1], &w32_child_pids[child], + Move(&w32_child_pids[child+1], &w32_child_pids[child], (w32_num_children-child-1), DWORD); w32_num_children--; } @@ -969,9 +969,9 @@ 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], + Move(&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], + Move(&w32_pseudo_child_pids[child+1], &w32_pseudo_child_pids[child], (w32_num_pseudo_children-child-1), DWORD); w32_num_pseudo_children--; } @@ -1030,13 +1030,14 @@ win32_sleep(unsigned int t) } DllExport int -win32_stat(const char *path, struct stat *buffer) +win32_stat(const char *path, struct stat *sbuf) { dTHXo; - char t[MAX_PATH+1]; + char buffer[MAX_PATH+1]; int l = strlen(path); int res; - WCHAR wbuffer[MAX_PATH]; + WCHAR wbuffer[MAX_PATH+1]; + WCHAR* pwbuffer; HANDLE handle; int nlink = 1; @@ -1045,17 +1046,20 @@ win32_stat(const char *path, struct stat *buffer) /* FindFirstFile() and stat() are buggy with a trailing * backslash, so change it to a forward slash :-( */ case '\\': - strncpy(t, path, l-1); - t[l - 1] = '/'; - t[l] = '\0'; - path = t; + strncpy(buffer, path, l-1); + buffer[l - 1] = '/'; + buffer[l] = '\0'; + path = buffer; break; /* FindFirstFile() is buggy with "x:", so add a dot :-( */ case ':': if (l == 2 && isALPHA(path[0])) { - t[0] = path[0]; t[1] = ':'; t[2] = '.'; t[3] = '\0'; + buffer[0] = path[0]; + buffer[1] = ':'; + buffer[2] = '.'; + buffer[3] = '\0'; l = 3; - path = t; + path = buffer; } break; } @@ -1066,11 +1070,12 @@ win32_stat(const char *path, struct stat *buffer) /* 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); + pwbuffer = PerlDir_mapW(wbuffer); + handle = CreateFileW(pwbuffer, 0, 0, NULL, OPEN_EXISTING, 0, NULL); } else { path = PerlDir_mapA(path); + l = strlen(path); handle = CreateFileA(path, 0, 0, NULL, OPEN_EXISTING, 0, NULL); } if (handle != INVALID_HANDLE_VALUE) { @@ -1080,34 +1085,34 @@ win32_stat(const char *path, struct stat *buffer) CloseHandle(handle); } - /* wbuffer or path will be mapped correctly above */ + /* pwbuffer or path will be mapped correctly above */ if (USING_WIDE()) { - res = _wstat(wbuffer, (struct _stat *)buffer); + res = _wstat(pwbuffer, (struct _stat *)sbuf); } else { - res = stat(path, buffer); + res = stat(path, sbuf); } - buffer->st_nlink = nlink; + sbuf->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 - * buffer->st_*time (but note that's not available on the + * sbuf->st_*time (but note that's not available on the * Windows of 1995) */ DWORD r; if (USING_WIDE()) { - r = GetFileAttributesW(wbuffer); + r = GetFileAttributesW(pwbuffer); } else { r = GetFileAttributesA(path); } if (r != 0xffffffff && (r & FILE_ATTRIBUTE_DIRECTORY)) { - /* buffer may still contain old garbage since stat() failed */ - Zero(buffer, 1, struct stat); - buffer->st_mode = S_IFDIR | S_IREAD; + /* sbuf may still contain old garbage since stat() failed */ + Zero(sbuf, 1, struct stat); + sbuf->st_mode = S_IFDIR | S_IREAD; errno = 0; if (!(r & FILE_ATTRIBUTE_READONLY)) - buffer->st_mode |= S_IWRITE | S_IEXEC; + sbuf->st_mode |= S_IWRITE | S_IEXEC; return 0; } } @@ -1117,28 +1122,28 @@ win32_stat(const char *path, struct stat *buffer) { /* The drive can be inaccessible, some _stat()s are buggy */ if (USING_WIDE() - ? !GetVolumeInformationW(wbuffer,NULL,0,NULL,NULL,NULL,NULL,0) + ? !GetVolumeInformationW(pwbuffer,NULL,0,NULL,NULL,NULL,NULL,0) : !GetVolumeInformationA(path,NULL,0,NULL,NULL,NULL,NULL,0)) { errno = ENOENT; return -1; } } #ifdef __BORLANDC__ - if (S_ISDIR(buffer->st_mode)) - buffer->st_mode |= S_IWRITE | S_IEXEC; - else if (S_ISREG(buffer->st_mode)) { + if (S_ISDIR(sbuf->st_mode)) + sbuf->st_mode |= S_IWRITE | S_IEXEC; + else if (S_ISREG(sbuf->st_mode)) { if (l >= 4 && path[l-4] == '.') { const char *e = path + l - 3; if (strnicmp(e,"exe",3) && strnicmp(e,"bat",3) && strnicmp(e,"com",3) && (IsWin95() || strnicmp(e,"cmd",3))) - buffer->st_mode &= ~S_IEXEC; + sbuf->st_mode &= ~S_IEXEC; else - buffer->st_mode |= S_IEXEC; + sbuf->st_mode |= S_IEXEC; } else - buffer->st_mode &= ~S_IEXEC; + sbuf->st_mode &= ~S_IEXEC; } #endif } @@ -1228,7 +1233,7 @@ DllExport char * win32_getenv(const char *name) { dTHXo; - WCHAR wBuffer[MAX_PATH]; + WCHAR wBuffer[MAX_PATH+1]; DWORD needlen; SV *curitem = Nullsv; @@ -1392,23 +1397,28 @@ win32_unlink(const char *filename) DWORD attrs; if (USING_WIDE()) { - WCHAR wBuffer[MAX_PATH]; + WCHAR wBuffer[MAX_PATH+1]; + WCHAR* pwBuffer; A2WHELPER(filename, wBuffer, sizeof(wBuffer)); - wcscpy(wBuffer, PerlDir_mapW(wBuffer)); - attrs = GetFileAttributesW(wBuffer); + pwBuffer = PerlDir_mapW(wBuffer); + attrs = GetFileAttributesW(pwBuffer); + if (attrs == 0xFFFFFFFF) + goto fail; if (attrs & FILE_ATTRIBUTE_READONLY) { - (void)SetFileAttributesW(wBuffer, attrs & ~FILE_ATTRIBUTE_READONLY); - ret = _wunlink(wBuffer); + (void)SetFileAttributesW(pwBuffer, attrs & ~FILE_ATTRIBUTE_READONLY); + ret = _wunlink(pwBuffer); if (ret == -1) - (void)SetFileAttributesW(wBuffer, attrs); + (void)SetFileAttributesW(pwBuffer, attrs); } else - ret = _wunlink(wBuffer); + ret = _wunlink(pwBuffer); } else { filename = PerlDir_mapA(filename); attrs = GetFileAttributesA(filename); + if (attrs == 0xFFFFFFFF) + goto fail; if (attrs & FILE_ATTRIBUTE_READONLY) { (void)SetFileAttributesA(filename, attrs & ~FILE_ATTRIBUTE_READONLY); ret = unlink(filename); @@ -1419,6 +1429,9 @@ win32_unlink(const char *filename) ret = unlink(filename); } return ret; +fail: + errno = ENOENT; + return -1; } DllExport int @@ -1430,13 +1443,14 @@ win32_utime(const char *filename, struct utimbuf *times) FILETIME ftAccess; FILETIME ftWrite; struct utimbuf TimeBuffer; - WCHAR wbuffer[MAX_PATH]; + WCHAR wbuffer[MAX_PATH+1]; + WCHAR* pwbuffer; int rc; if (USING_WIDE()) { A2WHELPER(filename, wbuffer, sizeof(wbuffer)); - wcscpy(wbuffer, PerlDir_mapW(wbuffer)); - rc = _wutime(wbuffer, (struct _utimbuf*)times); + pwbuffer = PerlDir_mapW(wbuffer); + rc = _wutime(pwbuffer, (struct _utimbuf*)times); } else { filename = PerlDir_mapA(filename); @@ -1454,7 +1468,7 @@ win32_utime(const char *filename, struct utimbuf *times) /* This will (and should) still fail on readonly files */ if (USING_WIDE()) { - handle = CreateFileW(wbuffer, GENERIC_READ | GENERIC_WRITE, + handle = CreateFileW(pwbuffer, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL); } @@ -1683,6 +1697,8 @@ FAILED: return -1; } +#ifndef PERL_OBJECT + static UINT timerid = 0; static VOID CALLBACK TimerProc(HWND win, UINT msg, UINT id, DWORD time) @@ -1692,10 +1708,12 @@ static VOID CALLBACK TimerProc(HWND win, UINT msg, UINT id, DWORD time) timerid=0; sighandler(14); } +#endif /* !PERL_OBJECT */ DllExport unsigned int win32_alarm(unsigned int sec) { +#ifndef PERL_OBJECT /* * the 'obvious' implentation is SetTimer() with a callback * which does whatever receiving SIGALRM would do @@ -1720,6 +1738,7 @@ win32_alarm(unsigned int sec) timerid=0; } } +#endif /* !PERL_OBJECT */ return 0; } @@ -1740,53 +1759,71 @@ win32_crypt(const char *txt, const char *salt) #endif } -#ifdef USE_FIXED_OSFHANDLE +/* C doesn't like repeat struct definitions */ -EXTERN_C int __cdecl _alloc_osfhnd(void); -EXTERN_C int __cdecl _set_osfhnd(int fh, long value); -EXTERN_C void __cdecl _lock_fhandle(int); -EXTERN_C void __cdecl _unlock_fhandle(int); -EXTERN_C void __cdecl _unlock(int); +#if defined(USE_FIXED_OSFHANDLE) || defined(PERL_MSVCRT_READFIX) -#if (_MSC_VER >= 1000) -typedef struct { +#ifndef _CRTIMP +#define _CRTIMP __declspec(dllimport) +#endif + +/* + * 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 */ -#if defined (_MT) && !defined (DLL_FOR_WIN32S) int lockinitflag; CRITICAL_SECTION lock; -#endif /* defined (_MT) && !defined (DLL_FOR_WIN32S) */ -} ioinfo; +} ioinfo; -EXTERN_C ioinfo * __pioinfo[]; -#define IOINFO_L2E 5 -#define IOINFO_ARRAY_ELTS (1 << IOINFO_L2E) -#define _pioinfo(i) (__pioinfo[i >> IOINFO_L2E] + (i & (IOINFO_ARRAY_ELTS - 1))) -#define _osfile(i) (_pioinfo(i)->osfile) +/* + * 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 -#else /* (_MSC_VER >= 1000) */ -extern char _osfile[]; -#endif /* (_MSC_VER >= 1000) */ +/* + * 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) + +#endif + +#ifdef USE_FIXED_OSFHANDLE #define FOPEN 0x01 /* file handle open */ +#define FNOINHERIT 0x10 /* file handle opened O_NOINHERIT */ #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 _STREAM_LOCKS 26 /* Table of stream locks */ -#define _LAST_STREAM_LOCK (_STREAM_LOCKS+_NSTREAM_-1) /* Last stream lock */ -#define _FH_LOCKS (_LAST_STREAM_LOCK+1) /* Table of fh locks */ - /*** *int my_open_osfhandle(long osfhandle, int flags) - open C Runtime file handle * *Purpose: * This function allocates a free C Runtime file handle and associates * it with the Win32 HANDLE specified by the first parameter. This is a -* temperary fix for WIN95's brain damage GetFileType() error on socket -* we just bypass that call for socket +* temperary fix for WIN95's brain damage GetFileType() error on socket +* we just bypass that call for socket +* +* This works with MSVC++ 4.0+ or GCC/Mingw32 * *Entry: * long osfhandle - Win32 HANDLE to associate with C Runtime file handle. @@ -1800,6 +1837,31 @@ extern char _osfile[]; * *******************************************************************************/ +/* + * we fake up some parts of the CRT that aren't exported by MSVCRT.dll + * this lets sockets work on Win9X with GCC and should fix the problems + * with perl95.exe + * -- BKS, 1-23-2000 +*/ + +/* since we are not doing a dup2(), this works fine */ + +#define _set_osfhnd(fh, osfh) (void)(_osfhnd(fh) = osfh) + +/* create an ioinfo entry, kill its handle, and steal the entry */ + +static int +_alloc_osfhnd(void) +{ + HANDLE hF = CreateFile("NUL", 0, 0, NULL, OPEN_ALWAYS, 0, NULL); + int fh = _open_osfhandle((long)hF, 0); + CloseHandle(hF); + if (fh == -1) + return fh; + EnterCriticalSection(&(_pioinfo(fh)->lock)); + return fh; +} + static int my_open_osfhandle(long osfhandle, int flags) { @@ -1815,6 +1877,9 @@ my_open_osfhandle(long osfhandle, int flags) if (flags & O_TEXT) fileflags |= FTEXT; + if (flags & O_NOINHERIT) + fileflags |= FNOINHERIT; + /* attempt to allocate a C Runtime file handle */ if ((fh = _alloc_osfhnd()) == -1) { errno = EMFILE; /* too many open files */ @@ -1827,18 +1892,12 @@ my_open_osfhandle(long osfhandle, int flags) fileflags |= FOPEN; /* mark as open */ -#if (_MSC_VER >= 1000) _osfile(fh) = fileflags; /* set osfile entry */ - _unlock_fhandle(fh); -#else - _osfile[fh] = fileflags; /* set osfile entry */ - _unlock(fh+_FH_LOCKS); /* unlock handle */ -#endif + LeaveCriticalSection(&_pioinfo(fh)->lock); return fh; /* return handle */ } -#define _open_osfhandle my_open_osfhandle #endif /* USE_FIXED_OSFHANDLE */ /* simulate flock by locking a range on the file */ @@ -2048,7 +2107,8 @@ DllExport FILE * win32_fopen(const char *filename, const char *mode) { dTHXo; - WCHAR wMode[MODE_SIZE], wBuffer[MAX_PATH]; + WCHAR wMode[MODE_SIZE], wBuffer[MAX_PATH+1]; + FILE *f; if (!*filename) return NULL; @@ -2059,9 +2119,14 @@ win32_fopen(const char *filename, const char *mode) if (USING_WIDE()) { A2WHELPER(mode, wMode, sizeof(wMode)); A2WHELPER(filename, wBuffer, sizeof(wBuffer)); - return _wfopen(PerlDir_mapW(wBuffer), wMode); + f = _wfopen(PerlDir_mapW(wBuffer), wMode); } - return fopen(PerlDir_mapA(filename), mode); + else + f = fopen(PerlDir_mapA(filename), mode); + /* avoid buffering headaches for child processes */ + if (f && *mode == 'a') + win32_fseek(f, 0, SEEK_END); + return f; } #ifndef USE_SOCKETS_AS_HANDLES @@ -2074,18 +2139,24 @@ win32_fdopen(int handle, const char *mode) { dTHXo; WCHAR wMode[MODE_SIZE]; + FILE *f; if (USING_WIDE()) { A2WHELPER(mode, wMode, sizeof(wMode)); - return _wfdopen(handle, wMode); + f = _wfdopen(handle, wMode); } - return fdopen(handle, (char *) mode); + else + f = fdopen(handle, (char *) mode); + /* avoid buffering headaches for child processes */ + if (f && *mode == 'a') + win32_fseek(f, 0, SEEK_END); + return f; } DllExport FILE * win32_freopen(const char *path, const char *mode, FILE *stream) { dTHXo; - WCHAR wMode[MODE_SIZE], wBuffer[MAX_PATH]; + WCHAR wMode[MODE_SIZE], wBuffer[MAX_PATH+1]; if (stricmp(path, "/dev/null")==0) path = "NUL"; @@ -2391,11 +2462,11 @@ win32_link(const char *oldname, const char *newname) { dTHXo; BOOL (__stdcall *pfnCreateHardLinkW)(LPCWSTR,LPCWSTR,LPSECURITY_ATTRIBUTES); - WCHAR wOldName[MAX_PATH]; - WCHAR wNewName[MAX_PATH]; + WCHAR wOldName[MAX_PATH+1]; + WCHAR wNewName[MAX_PATH+1]; if (IsWin95()) - Perl_die(aTHX_ PL_no_func, "link"); + Perl_croak(aTHX_ PL_no_func, "link"); pfnCreateHardLinkW = (BOOL (__stdcall *)(LPCWSTR, LPCWSTR, LPSECURITY_ATTRIBUTES)) @@ -2417,26 +2488,31 @@ win32_link(const char *oldname, const char *newname) DllExport int win32_rename(const char *oname, const char *newname) { - WCHAR wOldName[MAX_PATH]; - WCHAR wNewName[MAX_PATH]; - char szOldName[MAX_PATH]; + WCHAR wOldName[MAX_PATH+1]; + WCHAR wNewName[MAX_PATH+1]; + char szOldName[MAX_PATH+1]; + char szNewName[MAX_PATH+1]; BOOL bResult; + dTHXo; + /* XXX despite what the documentation says about MoveFileEx(), * it doesn't work under Windows95! */ if (IsWinNT()) { - dTHXo; + DWORD dwFlags = MOVEFILE_COPY_ALLOWED; if (USING_WIDE()) { A2WHELPER(oname, wOldName, sizeof(wOldName)); A2WHELPER(newname, wNewName, sizeof(wNewName)); + if (wcsicmp(wNewName, wOldName)) + dwFlags |= MOVEFILE_REPLACE_EXISTING; wcscpy(wOldName, PerlDir_mapW(wOldName)); - bResult = MoveFileExW(wOldName,PerlDir_mapW(wNewName), - MOVEFILE_COPY_ALLOWED|MOVEFILE_REPLACE_EXISTING); + bResult = MoveFileExW(wOldName,PerlDir_mapW(wNewName), dwFlags); } else { - strcpy(szOldName, PerlDir_mapA(szOldName)); - bResult = MoveFileExA(szOldName,PerlDir_mapA(newname), - MOVEFILE_COPY_ALLOWED|MOVEFILE_REPLACE_EXISTING); + if (stricmp(newname, oname)) + dwFlags |= MOVEFILE_REPLACE_EXISTING; + strcpy(szOldName, PerlDir_mapA(oname)); + bResult = MoveFileExA(szOldName,PerlDir_mapA(newname), dwFlags); } if (!bResult) { DWORD err = GetLastError(); @@ -2461,14 +2537,17 @@ win32_rename(const char *oname, const char *newname) } else { int retval = 0; - char tmpname[MAX_PATH+1]; + char szTmpName[MAX_PATH+1]; char dname[MAX_PATH+1]; char *endname = Nullch; STRLEN tmplen = 0; DWORD from_attr, to_attr; + strcpy(szOldName, PerlDir_mapA(oname)); + strcpy(szNewName, PerlDir_mapA(newname)); + /* if oname doesn't exist, do nothing */ - from_attr = GetFileAttributes(oname); + from_attr = GetFileAttributes(szOldName); if (from_attr == 0xFFFFFFFF) { errno = ENOENT; return -1; @@ -2478,7 +2557,7 @@ win32_rename(const char *oname, const char *newname) * don't delete it in case oname happens to be the same file * (but perhaps accessed via a different path) */ - to_attr = GetFileAttributes(newname); + to_attr = GetFileAttributes(szNewName); if (to_attr != 0xFFFFFFFF) { /* if newname is a directory, we fail * XXX could overcome this with yet more convoluted logic */ @@ -2486,29 +2565,29 @@ win32_rename(const char *oname, const char *newname) errno = EACCES; return -1; } - tmplen = strlen(newname); - strcpy(tmpname,newname); - endname = tmpname+tmplen; - for (; endname > tmpname ; --endname) { + tmplen = strlen(szNewName); + strcpy(szTmpName,szNewName); + endname = szTmpName+tmplen; + for (; endname > szTmpName ; --endname) { if (*endname == '/' || *endname == '\\') { *endname = '\0'; break; } } - if (endname > tmpname) - endname = strcpy(dname,tmpname); + if (endname > szTmpName) + endname = strcpy(dname,szTmpName); else endname = "."; /* get a temporary filename in same directory * XXX is this really the best we can do? */ - if (!GetTempFileName((LPCTSTR)endname, "plr", 0, tmpname)) { + if (!GetTempFileName((LPCTSTR)endname, "plr", 0, szTmpName)) { errno = ENOENT; return -1; } - DeleteFile(tmpname); + DeleteFile(szTmpName); - retval = rename(newname, tmpname); + retval = rename(szNewName, szTmpName); if (retval != 0) { errno = EACCES; return retval; @@ -2516,16 +2595,16 @@ win32_rename(const char *oname, const char *newname) } /* rename oname to newname */ - retval = rename(oname, newname); + retval = rename(szOldName, szNewName); /* if we created a temporary file before ... */ if (endname != Nullch) { /* ...and rename succeeded, delete temporary file/directory */ if (retval == 0) - DeleteFile(tmpname); + DeleteFile(szTmpName); /* else restore it to what it was */ else - (void)rename(tmpname, newname); + (void)rename(szTmpName, szNewName); } return retval; } @@ -2555,7 +2634,7 @@ win32_open(const char *path, int flag, ...) dTHXo; va_list ap; int pmode; - WCHAR wBuffer[MAX_PATH]; + WCHAR wBuffer[MAX_PATH+1]; va_start(ap, flag); pmode = va_arg(ap, int); @@ -2609,44 +2688,8 @@ win32_dup2(int fd1,int fd2) #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 __cdecl +_fixed_read(int fh, void *buf, unsigned cnt) { int bytes_read; /* number of bytes read */ char *buffer; /* buffer to read to */ @@ -2842,7 +2885,7 @@ win32_mkdir(const char *dir, int mode) { dTHXo; if (USING_WIDE()) { - WCHAR wBuffer[MAX_PATH]; + WCHAR wBuffer[MAX_PATH+1]; A2WHELPER(dir, wBuffer, sizeof(wBuffer)); return _wmkdir(PerlDir_mapW(wBuffer)); } @@ -2854,7 +2897,7 @@ win32_rmdir(const char *dir) { dTHXo; if (USING_WIDE()) { - WCHAR wBuffer[MAX_PATH]; + WCHAR wBuffer[MAX_PATH+1]; A2WHELPER(dir, wBuffer, sizeof(wBuffer)); return _wrmdir(PerlDir_mapW(wBuffer)); } @@ -2866,7 +2909,7 @@ win32_chdir(const char *dir) { dTHXo; if (USING_WIDE()) { - WCHAR wBuffer[MAX_PATH]; + WCHAR wBuffer[MAX_PATH+1]; A2WHELPER(dir, wBuffer, sizeof(wBuffer)); return _wchdir(wBuffer); } @@ -2878,7 +2921,7 @@ win32_access(const char *path, int mode) { dTHXo; if (USING_WIDE()) { - WCHAR wBuffer[MAX_PATH]; + WCHAR wBuffer[MAX_PATH+1]; A2WHELPER(path, wBuffer, sizeof(wBuffer)); return _waccess(PerlDir_mapW(wBuffer), mode); } @@ -2890,7 +2933,7 @@ win32_chmod(const char *path, int mode) { dTHXo; if (USING_WIDE()) { - WCHAR wBuffer[MAX_PATH]; + WCHAR wBuffer[MAX_PATH+1]; A2WHELPER(path, wBuffer, sizeof(wBuffer)); return _wchmod(PerlDir_mapW(wBuffer), mode); } @@ -3378,6 +3421,10 @@ win32_free(void *block) int win32_open_osfhandle(long handle, int flags) { +#ifdef USE_FIXED_OSFHANDLE + if (IsWin95()) + return my_open_osfhandle(handle, flags); +#endif return _open_osfhandle(handle, flags); } @@ -3393,7 +3440,7 @@ win32_dynaload(const char* filename) dTHXo; HMODULE hModule; if (USING_WIDE()) { - WCHAR wfilename[MAX_PATH]; + WCHAR wfilename[MAX_PATH+1]; A2WHELPER(filename, wfilename, sizeof(wfilename)); hModule = LoadLibraryExW(PerlDir_mapW(wfilename), NULL, LOAD_WITH_ALTERED_SEARCH_PATH); } @@ -3827,15 +3874,15 @@ XS(w32_CopyFile) if (items != 3) Perl_croak(aTHX_ "usage: Win32::CopyFile($from, $to, $overwrite)"); if (USING_WIDE()) { - WCHAR wSourceFile[MAX_PATH]; - WCHAR wDestFile[MAX_PATH]; + WCHAR wSourceFile[MAX_PATH+1]; + WCHAR wDestFile[MAX_PATH+1]; 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]; + char szSourceFile[MAX_PATH+1]; strcpy(szSourceFile, PerlDir_mapA(SvPV_nolen(ST(0)))); bResult = CopyFileA(szSourceFile, PerlDir_mapA(SvPV_nolen(ST(1))), !SvTRUE(ST(2))); } diff --git a/win32/win32.h b/win32/win32.h index 9d56578229..65d24e4c65 100644 --- a/win32/win32.h +++ b/win32/win32.h @@ -123,15 +123,18 @@ struct utsname { #define PERL_SOCK_SYSREAD_IS_RECV #define PERL_SOCK_SYSWRITE_IS_SEND +#define PERL_NO_FORCE_LINK /* no need for PL_force_link_funcs */ /* if USE_WIN32_RTL_ENV is not defined, Perl uses direct Win32 calls * to read the environment, bypassing the runtime's (usually broken) * facilities for accessing the same. See note in util.c/my_setenv(). */ /*#define USE_WIN32_RTL_ENV */ -/* Define USE_FIXED_OSFHANDLE to fix VC's _open_osfhandle() on W95. - * Can only enable it if not using the DLL CRT (it doesn't expose internals) */ -#if defined(_MSC_VER) && !defined(_DLL) && defined(_M_IX86) +/* Define USE_FIXED_OSFHANDLE to fix MSVCRT's _open_osfhandle() on W95. + It now uses some black magic to work seamlessly with the DLL CRT and + works with MSVC++ 4.0+ or GCC/Mingw32 + -- BKS 1-24-2000 */ +#if (defined(_M_IX86) && _MSC_VER >= 1000) || defined(__MINGW32__) #define USE_FIXED_OSFHANDLE #endif @@ -160,6 +163,7 @@ struct utsname { #define _access access #define _chdir chdir #define _getpid getpid +#define wcsicmp _wcsicmp #include <sys/types.h> #ifndef DllMain @@ -229,7 +233,7 @@ typedef long gid_t; /* compatibility stuff for other compilers goes here */ -#if !defined(PERL_OBJECT) && defined(PERL_MEMBER_PTR_SIZE) +#if !defined(PERL_OBJECT) && defined(PERL_CAPI) && defined(PERL_MEMBER_PTR_SIZE) # define STRUCT_MGVTBL_DEFINITION \ struct mgvtbl { \ union { \ @@ -265,7 +269,7 @@ struct mgvtbl { \ U8 op_flags; \ U8 op_private; -#endif /* !PERL_OBJECT && PERL_MEMBER_PTR_SIZE */ +#endif /* !PERL_OBJECT && PERL_CAPI && PERL_MEMBER_PTR_SIZE */ START_EXTERN_C @@ -418,13 +422,17 @@ struct interp_intern { /* Use CP_ACP when mode is ANSI */ /* Use CP_UTF8 when mode is UTF8 */ -#define A2WHELPER(lpa, lpw, nBytes)\ - lpw[0] = 0, MultiByteToWideChar((IN_UTF8) ? CP_UTF8 : CP_ACP, 0, lpa, -1, lpw, (nBytes/sizeof(WCHAR))) +#define A2WHELPER_LEN(lpa, alen, lpw, nBytes)\ + (lpw[0] = 0, MultiByteToWideChar((IN_BYTE) ? CP_ACP : CP_UTF8, 0, \ + lpa, alen, lpw, (nBytes/sizeof(WCHAR)))) +#define A2WHELPER(lpa, lpw, nBytes) A2WHELPER_LEN(lpa, -1, lpw, nBytes) -#define W2AHELPER(lpw, lpa, nChars)\ - lpa[0] = '\0', WideCharToMultiByte((IN_UTF8) ? CP_UTF8 : CP_ACP, 0, lpw, -1, (LPSTR)lpa, nChars, NULL, NULL) +#define W2AHELPER_LEN(lpw, wlen, lpa, nChars)\ + (lpa[0] = '\0', WideCharToMultiByte((IN_BYTE) ? CP_ACP : CP_UTF8, 0, \ + lpw, wlen, (LPSTR)lpa, nChars,NULL,NULL)) +#define W2AHELPER(lpw, lpa, nChars) W2AHELPER_LEN(lpw, -1, lpa, nChars) -#define USING_WIDE() (PerlEnv_os_id() == VER_PLATFORM_WIN32_NT) +#define USING_WIDE() (PL_widesyscalls && PerlEnv_os_id() == VER_PLATFORM_WIN32_NT) #ifdef USE_ITHREADS # define PERL_WAIT_FOR_CHILDREN \ diff --git a/x2p/find2perl.PL b/x2p/find2perl.PL index da94dc9eab..99bb3afabb 100644 --- a/x2p/find2perl.PL +++ b/x2p/find2perl.PL @@ -50,6 +50,8 @@ my $startperl = "#! $perlpath -w"; # # Modified 1999-06-10, 1999-07-07 to migrate to cleaner perl5 usage # Ken Pizzini <ken@halcyon.com> +# +# Modified 2000-01-28 to use the 'follow' option of File::Find my @roots = (); while ($ARGV[0] =~ /^[^-!(]/) { @@ -68,6 +70,7 @@ my $initfile = ''; my $initnewer = ''; my $out = ''; my %init = (); +my ($follow_in_effect,$Skip_And) = (0,0); while (@ARGV) { $_ = shift; @@ -80,10 +83,9 @@ while (@ARGV) { --$indent_depth; $out .= &tab . ")"; } elsif ($_ eq 'follow') { + $follow_in_effect= 1; $stat = 'stat'; - $decl = "\nmy %already_seen = ();\n"; - $out .= &tab . '(not $already_seen{"$dev,$ino"}) &&' . "\n"; - $out .= &tab . '(($already_seen{"$dev,$ino"} = !(-d _)) || 1)'; + $Skip_And= 1; } elsif ($_ eq '!') { $out .= &tab . "!"; next; @@ -235,7 +237,7 @@ while (@ARGV) { $init{saw_or} = 1; shift; } else { - $out .= " &&" unless $ARGV[0] eq ')'; + $out .= " &&" unless $Skip_And || $ARGV[0] eq ')'; $out .= "\n"; shift if $ARGV[0] eq '-a'; } @@ -301,10 +303,12 @@ if (exists $init{declarestat}) { END } +if ( $follow_in_effect ) { +$out =~ s/lstat\(\$_\)/lstat(_)/; print <<"END"; $decl # Traverse desired filesystems -File::Find::$find(\\&wanted, $roots); +File::Find::$find( {wanted => \\&wanted, follow => 1}, $roots); $flushall sub wanted { @@ -312,7 +316,19 @@ $out; } END +} else { +print <<"END"; +$decl +# Traverse desired filesystems +File::Find::$find({wanted => \\&wanted}, $roots); +$flushall +sub wanted { +$out; +} + +END +} if (exists $init{doexec}) { print <<'END'; @@ -709,7 +725,12 @@ not evaluated if PREDICATE1 is true. =item C<-follow> -Follow (dereference) symlinks. [XXX doesn't work fully, see L<BUGS>] +Follow (dereference) symlinks. The checking of file attributes depends +on the position of the C<-follow> option. If it precedes the file +check option, an C<stat> is done which means the file check applies to the +file the symbolic link is pointing to. If C<-follow> option follows the +file check option, this now applies to the symbolic link itself, i.e. +an C<lstat> is done. =item C<-depth> @@ -852,11 +873,6 @@ Predicates which take a numeric argument N can come in three forms: * N is prefixed with a -: match values less than N * N is not prefixed with either + or -: match only values equal to N -=head1 BUGS - -The -follow option doesn't really work yet, because File::Find doesn't -support following symlinks. - =head1 SEE ALSO find @@ -23,7 +23,7 @@ void XS_attributes_bootstrap(pTHXo_ CV *cv); * * The various bootstrap definitions can take care of doing * package-specific newXS() calls. Since the layout of the - * bundled lib/*.pm files is in a version-specific directory, + * bundled *.pm files is in a version-specific directory, * version checks in these bootstrap calls are optional. */ |