diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 2001-10-19 16:30:43 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 2001-10-19 16:30:43 +0000 |
commit | 0af71dba73667d8fa3e845db4ca9d01e3491e5d5 (patch) | |
tree | e479b1a158087d18ea60eeafebeaf073554b1303 | |
parent | 9f16d962dace601f24c23063432e8a8eb01bfa4a (diff) | |
parent | afa38808e08264de7bcd3b2241ab41424d64d0d4 (diff) | |
download | perl-0af71dba73667d8fa3e845db4ca9d01e3491e5d5.tar.gz |
Integrate mainline
p4raw-id: //depot/perlio@12507
99 files changed, 10721 insertions, 2300 deletions
@@ -31,6 +31,409 @@ or any other branch. Version v5.7.2 Development release working toward v5.8 -------------- ____________________________________________________________________________ +[ 12493] By: jhi on 2001/10/18 12:58:31 + Log: Add the lib/unicore/To/Spec*.pl to the MANIFEST. + Branch: perl + ! MANIFEST +____________________________________________________________________________ +[ 12492] By: jhi on 2001/10/18 12:37:28 + Log: Wrong skip() arguments. + Branch: perl + ! ext/B/t/terse.t +____________________________________________________________________________ +[ 12491] By: jhi on 2001/10/18 12:17:16 + Log: Subject: try#2: [proposed PATCH Perl@12401] ieee floats, rand() & old systems + From: lane@DUPHY4.Physics.Drexel.Edu (Charles Lane) + Date: Wed, 17 Oct 2001 09:10:53 EDT + Message-Id: <011017090944.15ad2e@DUPHY4.Physics.Drexel.Edu> + Branch: perl + ! configure.com embedvar.h opcode.pl perlapi.h perlvars.h + ! pod/perlapi.pod vms/vms.c +____________________________________________________________________________ +[ 12490] By: ams on 2001/10/18 09:31:00 + Log: Subject: PATCH perl.pod: Suggested reorganization of table of contents + From: Mark-Jason Dominus <mjd@plover.com> + Date: Thu, 18 Oct 2001 06:25:35 -0400 + Message-Id: <20011018102535.19264.qmail@plover.com> + Branch: perl + ! pod/perl.pod +____________________________________________________________________________ +[ 12489] By: jhi on 2001/10/18 02:24:52 + Log: Prettyprinting. + Branch: perl + ! lib/unicore/In.pl lib/unicore/Is.pl lib/unicore/mktables +____________________________________________________________________________ +[ 12488] By: jhi on 2001/10/18 00:47:19 + Log: Regen toc. + Branch: perl + ! pod/buildtoc.PL pod/perl.pod pod/perltoc.pod +____________________________________________________________________________ +[ 12487] By: jhi on 2001/10/18 00:43:18 + Log: Add perlintro, from Skud. + Branch: perl + + pod/perlintro.pod + ! MANIFEST +____________________________________________________________________________ +[ 12486] By: jhi on 2001/10/18 00:10:44 + Log: FAQ sync. + Branch: perl + ! pod/perlfaq.pod pod/perlfaq2.pod pod/perlfaq3.pod + ! pod/perlfaq5.pod pod/perlfaq6.pod pod/perlfaq7.pod + ! pod/perlfaq8.pod pod/perlfaq9.pod +____________________________________________________________________________ +[ 12485] By: jhi on 2001/10/17 23:57:15 + Log: Oh, bother. In Tru64 cc -std1 was looking rather nice + in speed (upto 20% speedup in certain operations) but meanwhile + regexps and arithmetics got slower (5-10%) (according to + perlbench average speedup is negligible, and within measuring + flutter, 1%). Therefore retracting all the changes + aimed at getting -std1 to compile cleanly: #12475, #12476, + #12479, #12480, #12481, #12482, #12483, #12484. + Branch: perl + ! doio.c mg.c miniperlmain.c perl.c perl.h perlio.c pp_ctl.c + ! pp_hot.c pp_sys.c toke.c +____________________________________________________________________________ +[ 12484] By: jhi on 2001/10/17 21:58:40 + Log: (retracted by #12485) + Strict ANSI doesn't like the third argument of main() + so enable ignoring it if using ultra picky compiler. + Branch: perl + ! miniperlmain.c +____________________________________________________________________________ +[ 12483] By: jhi on 2001/10/17 21:48:24 + Log: (retracted by #12485) + Move the VMS_FOO_ERROR codes next to the SETERRNO() definition. + Branch: perl + ! perl.h +____________________________________________________________________________ +[ 12482] By: jhi on 2001/10/17 21:42:57 + Log: (retracted by #12485) + Add explanatory comment. + Branch: perl + ! mg.c +____________________________________________________________________________ +[ 12481] By: jhi on 2001/10/17 20:50:37 + Log: (retracted by #12485) + More dollar$hiding. + Branch: perl + ! doio.c perl.h pp_sys.c +____________________________________________________________________________ +[ 12480] By: jhi on 2001/10/17 20:27:34 + Log: (retracted by #12485) + KISS. + Branch: perl + ! mg.c +____________________________________________________________________________ +[ 12479] By: jhi on 2001/10/17 19:57:34 + Log: (retracted by #12485) + Thou shalt not #ifdef inside macro invocations, + noticed by Rafael Garcia-Suarez. + Branch: perl + ! mg.c +____________________________________________________________________________ +[ 12478] By: ams on 2001/10/17 18:50:55 + Log: Subject: [PATCH pp_sys.c] coredump fix in pp_accept() + From: Anton Berezin <tobez@tobez.org> + Date: Wed, 17 Oct 2001 18:25:48 +0200 + Message-Id: <20011017182548.A12082@heechee.tobez.org> + Branch: perl + ! pp_sys.c +____________________________________________________________________________ +[ 12476] By: jhi on 2001/10/17 16:46:50 + Log: (retracted by #12485) + Unterminated #ifdef. + Branch: perl + ! mg.c +____________________________________________________________________________ +[ 12475] By: jhi on 2001/10/17 16:42:49 + Log: (retracted by #12485) + Avoid dollar signs in identifiers (in non-VMS) to + placate ultra picky ANSI compilers (such as DEC^WCPQ^WHP). + Branch: perl + ! doio.c mg.c perl.c perl.h perlio.c pp_ctl.c pp_hot.c pp_sys.c + ! toke.c +____________________________________________________________________________ +[ 12474] By: ams on 2001/10/17 15:14:50 + Log: Subject: Two AIX patches + From: H.Merijn Brand <h.m.brand@hccnet.nl> + Date: Wed, 17 Oct 2001 18:04:35 +0200 + Message-Id: <20011017180223.1346.H.M.BRAND@hccnet.nl> + Branch: perl + ! hints/aix.sh makedef.pl +____________________________________________________________________________ +[ 12473] By: jhi on 2001/10/17 14:48:38 + Log: Limiting the Time::HiRes::sleep and usleep to + one second is not a good policy if drop-in + replacement is still a goal. + Branch: perl + ! ext/Time/HiRes/HiRes.pm ext/Time/HiRes/HiRes.t + ! ext/Time/HiRes/HiRes.xs +____________________________________________________________________________ +[ 12472] By: jhi on 2001/10/17 11:00:54 + Log: Subject: [PATCH] Test::Simple 0.32 + From: Michael G Schwern <schwern@pobox.com> + Date: Wed, 17 Oct 2001 03:42:41 -0400 + Message-ID: <20011017034241.A25038@blackrider> + Branch: perl + + lib/Test/Builder.pm lib/Test/Simple/t/Builder.t + + lib/Test/Simple/t/filehandles.t lib/Test/Simple/t/import.t + + lib/Test/Simple/t/is_deeply.t lib/Test/Simple/t/no_ending.t + + lib/Test/Simple/t/no_header.t lib/Test/Simple/t/output.t + + lib/Test/Simple/t/plan.t lib/Test/Simple/t/plan_no_plan.t + + lib/Test/Simple/t/plan_skip_all.t lib/Test/Simple/t/use_ok.t + - lib/Test/Utils.pm t/lib/Test/Simple/Catch/More.pm + ! MANIFEST lib/Test/More.pm lib/Test/Simple.pm + ! lib/Test/Simple/Changes lib/Test/Simple/t/More.t + ! lib/Test/Simple/t/exit.t lib/Test/Simple/t/extra.t + ! lib/Test/Simple/t/fail-like.t lib/Test/Simple/t/fail-more.t + ! lib/Test/Simple/t/fail.t lib/Test/Simple/t/missing.t + ! lib/Test/Simple/t/no_plan.t lib/Test/Simple/t/plan_is_noplan.t + ! lib/Test/Simple/t/simple.t lib/Test/Simple/t/skip.t + ! lib/Test/Simple/t/skipall.t lib/Test/Simple/t/todo.t + ! lib/Test/Simple/t/undef.t lib/Test/Simple/t/useing.t + ! t/lib/Test/Simple/Catch.pm + ! t/lib/Test/Simple/sample_tests/five_fail.plx +____________________________________________________________________________ +[ 12471] By: jhi on 2001/10/17 10:25:06 + Log: Subject: [PATCH t/TEST t/harness vms/test.com] Set PERL_CORE environment var + From: Michael G Schwern <schwern@pobox.com> + Date: Wed, 17 Oct 2001 04:04:13 -0400 + Message-ID: <20011017040413.C25550@blackrider> + Branch: perl + ! t/TEST t/harness vms/test.com +____________________________________________________________________________ +[ 12470] By: jhi on 2001/10/17 02:25:01 + Log: Regen doc with perlmodstyle added. + Branch: perl + ! pod/buildtoc.PL pod/perl.pod pod/perltoc.pod +____________________________________________________________________________ +[ 12469] By: jhi on 2001/10/17 02:24:02 + Log: Pod cleanup. + Branch: perl + ! lib/File/Spec.pm lib/File/Spec/Mac.pm +____________________________________________________________________________ +[ 12468] By: jhi on 2001/10/17 02:16:11 + Log: Subject: perlmodstyle as a patch + From: Kirrily Robert <skud@infotrope.net> + Date: Tue, 16 Oct 2001 22:47:23 -0400 + Message-ID: <20011016224723.A20673@infotrope.net> + Branch: perl + + pod/perlmodstyle.pod + ! MANIFEST +____________________________________________________________________________ +[ 12467] By: jhi on 2001/10/17 00:59:43 + Log: Subject: [PATCH] for perlhack.pod - no p5p archive on deja/google + From: Ian Phillipps <Ian_Phillipps@yahoo.co.uk> + Date: Thu, 6 Sep 2001 11:09:40 +0100 + Message-ID: <20010906110939.A914@homer.diplex.co.uk> + + Mention also the develooper p5p archive. + Branch: perl + ! pod/perlhack.pod +____________________________________________________________________________ +[ 12466] By: jhi on 2001/10/17 00:57:38 + Log: Subject: [PATCH lib/ExtUtils/MakeMaker.pm] PREREQ_PM does not really require. + From: Kay Röpke <kroepke@dolphin-services.de> + Date: Tue, 16 Oct 2001 17:23:52 +0200 + Message-Id: <E15tW4O-0003J7-00@mrvdom03.schlund.de> + Branch: perl + ! lib/ExtUtils/MakeMaker.pm +____________________________________________________________________________ +[ 12465] By: jhi on 2001/10/17 00:54:28 + Log: Add the special casing mappings (from SpecCase.txt) + (except for the hyper special case mappings that have + the condition list); the special casing mappings are + unused for now. Small tidying up on mktables. + Branch: perl + + lib/unicore/To/SpecLower.pl lib/unicore/To/SpecTitle.pl + + lib/unicore/To/SpecUpper.pl + ! lib/unicore/mktables +____________________________________________________________________________ +[ 12464] By: jhi on 2001/10/16 22:38:24 + Log: Subject: [PATCH] Doc patch on here-docs (perlop and perldata) + From: "David H. Adler" <dha@panix.com> + Date: Tue, 16 Oct 2001 11:59:35 -0400 + Message-ID: <20011016115935.A13078@panix.com> + + Subject: [ PATCH ] perldata patch, revised + From: "David H. Adler" <dha@panix.com> + Date: Tue, 16 Oct 2001 18:26:49 -0400 + Message-ID: <20011016182649.C23970@panix.com> + Branch: perl + ! pod/perldata.pod pod/perlop.pod +____________________________________________________________________________ +[ 12463] By: jhi on 2001/10/16 19:39:25 + Log: Integrate perlio: PerlIO_dup (for all but Win32). + Branch: perl + !> embed.h embed.pl ext/Encode/Encode.xs + !> ext/PerlIO/Scalar/Scalar.xs ext/PerlIO/Via/Via.xs hv.c perl.h + !> perlio.c perlio.h perliol.h pod/perlapi.pod proto.h sv.c sv.h + !> win32/win32io.c +____________________________________________________________________________ +[ 12462] By: nick on 2001/10/16 19:11:30 + Log: PerlIOXxxx_dups for all but Win32 + Branch: perlio + ! ext/Encode/Encode.xs ext/PerlIO/Scalar/Scalar.xs + ! ext/PerlIO/Via/Via.xs +____________________________________________________________________________ +[ 12461] By: nick on 2001/10/16 18:28:48 + Log: Implement PerlIOStdio_dup (explains core dumps - dup + was not setting up a FILE * to be fclosed()). + Branch: perlio + ! perlio.c +____________________________________________________________________________ +[ 12460] By: nick on 2001/10/16 17:31:47 + Log: When USE_ITHREADS avoid SV * in PerlIO_debug, at risk of buffer + overflow. + Branch: perlio + ! perlio.c +____________________________________________________________________________ +[ 12459] By: jhi on 2001/10/16 17:10:22 + Log: Subject: [PATCH perl@12443] VMS 64-bit configure + From: "Craig A. Berry" <craigberry@mac.com> + Date: Tue, 16 Oct 2001 13:08:38 -0500 + Message-Id: <5.1.0.14.2.20011016122704.029eaea8@exchi01> + Branch: perl + ! configure.com +____________________________________________________________________________ +[ 12458] By: jhi on 2001/10/16 17:07:20 + Log: Can't expect too much accuracy from a sleep of one second. + (I think this will also fail with high load.) + Branch: perl + ! ext/Time/HiRes/HiRes.t +____________________________________________________________________________ +[ 12457] By: jhi on 2001/10/16 16:50:24 + Log: Subject: WIN64 (Itanium) port of Perl 5.6.1 + From: "Werner, Randolf" <randolf.werner@sap.com> + Date: Tue, 16 Oct 2001 18:33:02 +0200 + Message-ID: <816D93CCC927D31188570008C75D1DE10A5CB1F8@dbwdfx1a.wdf.sap-ag.de> + Branch: perl + + win32/Makefile.win64 win32/config.win64 win32/config_H.win64 + ! MANIFEST Porting/makerel ext/SDBM_File/sdbm/sdbm.c +____________________________________________________________________________ +[ 12456] By: nick on 2001/10/16 14:08:16 + Log: Builds under ithreads (but fails all threads tests) + Branch: perlio + ! hv.c perlio.c sv.c +____________________________________________________________________________ +[ 12455] By: jhi on 2001/10/16 13:59:32 + Log: I think the Perl_sortsv needs *not* be skipped? + Branch: perl + ! makedef.pl +____________________________________________________________________________ +[ 12454] By: jhi on 2001/10/16 13:05:38 + Log: Subject: [ PATCH ] maint/perl/t/op/groups.t for build on Cygwin + From: "Gerrit P. Haase" <gerrit.haase@convey.de> + Date: Tue, 16 Oct 2001 15:32:44 +0200 + Message-ID: <3BCC531C.11494.3E433F@localhost> + Branch: perl + ! t/op/groups.t +____________________________________________________________________________ +[ 12453] By: jhi on 2001/10/16 13:04:38 + Log: Subject: [ PATCH ] maint/perl/t/io/fs.t for build on Cygwin + From: "Gerrit P. Haase" <gerrit.haase@convey.de> + Date: Tue, 16 Oct 2001 15:01:04 +0200 + Message-ID: <3BCC4BB0.30935.2145B7@localhost> + Branch: perl + ! t/io/fs.t +____________________________________________________________________________ +[ 12452] By: jhi on 2001/10/16 12:03:49 + Log: A forgotten deletion. + Branch: perl + - lib/unicore/mktables.PL +____________________________________________________________________________ +[ 12451] By: nick on 2001/10/16 11:32:48 + Log: Skeleton of "PerlIO_dup" coded. + Still-passes all tests non-threaded (well it would wouldn't it!) + Branch: perlio + ! embed.h embed.pl ext/Encode/Encode.xs + ! ext/PerlIO/Scalar/Scalar.xs ext/PerlIO/Via/Via.xs perl.h + ! perlio.c perlio.h perliol.h pod/perlapi.pod proto.h sv.c sv.h + ! win32/win32io.c +____________________________________________________________________________ +[ 12450] By: jhi on 2001/10/16 02:27:51 + Log: Document the problem with the swash_fetch() API that affects + more complex case conversions. + Branch: perl + ! lib/utf8_heavy.pl utf8.c +____________________________________________________________________________ +[ 12449] By: jhi on 2001/10/16 01:55:48 + Log: Make Time::HiRes::sleep() and usleep() to return + the number of seconds (a floating point value) and + microseconds (an integer) actually slept (well, + modulo the time spent in measuring the time actually + slept...), to be a better drop-in replacement for + the builtin sleep(). Noticed by Chris Nandor. + + Also make usleep() to croak if fed illegal number + of useconds (anything greater than 1_000_000). + Branch: perl + ! ext/Time/HiRes/HiRes.pm ext/Time/HiRes/HiRes.t + ! ext/Time/HiRes/HiRes.xs +____________________________________________________________________________ +[ 12448] By: jhi on 2001/10/16 00:57:05 + Log: A missing SvREFCNT_dec. + Branch: perl + ! perl.c +____________________________________________________________________________ +[ 12447] By: nick on 2001/10/15 20:27:53 + Log: Beginings of PerlIO_dup support (unstable) + Branch: perlio + ! perlio.c perliol.h +____________________________________________________________________________ +[ 12446] By: jhi on 2001/10/15 18:44:19 + Log: In AIX vac 5 just can't seem to get regcomp right. + Branch: perl + ! hints/aix.sh +____________________________________________________________________________ +[ 12445] By: jhi on 2001/10/15 16:44:04 + Log: Bump the version number to agree with the maintperl one. + Branch: perl + ! lib/Tie/RefHash.pm +____________________________________________________________________________ +[ 12444] By: nick on 2001/10/15 15:59:57 + Log: Integrate mainline + Branch: perlio + +> lib/Math/BigInt/t/Math/Subclass.pm + +> lib/Math/BigInt/t/bigfltpm.inc lib/Math/BigInt/t/calling.t + +> lib/Math/BigInt/t/subclass.t lib/unicore/In/163.pl + +> lib/unicore/In/164.pl lib/unicore/In/165.pl + +> lib/unicore/In/166.pl lib/unicore/In/167.pl + +> lib/unicore/In/168.pl lib/unicore/In/169.pl + +> lib/unicore/In/170.pl lib/unicore/In/171.pl lib/unicore/Is.pl + +> lib/unicore/Is/Title.pl lib/unicore/Lbrk.pl + +> lib/unicore/mktables + - lib/unicore/Is/SylA.pl lib/unicore/Is/SylAA.pl + - lib/unicore/Is/SylAAI.pl lib/unicore/Is/SylAI.pl + - lib/unicore/Is/SylC.pl lib/unicore/Is/SylE.pl + - lib/unicore/Is/SylEE.pl lib/unicore/Is/SylI.pl + - lib/unicore/Is/SylII.pl lib/unicore/Is/SylN.pl + - lib/unicore/Is/SylO.pl lib/unicore/Is/SylOO.pl + - lib/unicore/Is/SylU.pl lib/unicore/Is/SylV.pl + - lib/unicore/Is/SylWA.pl lib/unicore/Is/SylWAA.pl + - lib/unicore/Is/SylWC.pl lib/unicore/Is/SylWE.pl + - lib/unicore/Is/SylWEE.pl lib/unicore/Is/SylWI.pl + - lib/unicore/Is/SylWII.pl lib/unicore/Is/SylWO.pl + - lib/unicore/Is/SylWOO.pl lib/unicore/Is/SylWU.pl + - lib/unicore/Is/SylWV.pl lib/unicore/Is/Syllable.pl + - lib/unicore/syllables.txt + !> (integrate 344 files) +____________________________________________________________________________ +[ 12443] By: jhi on 2001/10/15 13:40:20 + Log: Casting tweak from Paul Marquess, helps Merijn on AIX. + Branch: perl + ! ext/DB_File/DB_File.xs +____________________________________________________________________________ +[ 12442] By: jhi on 2001/10/15 13:35:36 + Log: Sync the skip() amounts with the number of tests. + Branch: perl + ! lib/Term/Complete.t +____________________________________________________________________________ +[ 12441] By: jhi on 2001/10/15 13:11:03 + Log: Update Changes. + Branch: perl + ! Changes patchlevel.h +____________________________________________________________________________ [ 12440] By: jhi on 2001/10/15 12:58:24 Log: MacOS Classic catdir() rewrite from Thomas Wegner (backward incompatibility, but a deliberate one, @@ -1169,6 +1169,7 @@ lib/Term/Complete.t See if Term::Complete works lib/Term/ReadLine.pm Stub readline library lib/termcap.pl Perl library supporting termcap usage lib/Test.pm A simple framework for writing test scripts +lib/Test/Builder.pm For writing new test libraries lib/Test/Harness.pm A test harness lib/Test/Harness/Changes Test::Harness lib/Test/Harness/t/base.t Test::Harness @@ -1177,20 +1178,31 @@ lib/Test/Harness/t/test-harness.t Test::Harness test lib/Test/More.pm More utilities for writing tests lib/Test/Simple.pm Basic utility for writing tests lib/Test/Simple/Changes Test::Simple changes +lib/Test/Simple/t/Builder.t Test::Builder tests lib/Test/Simple/t/exit.t Test::Simple test, exit codes lib/Test/Simple/t/extra.t Test::Simple test lib/Test/Simple/t/fail-like.t Test::More test, like() failures lib/Test/Simple/t/fail-more.t Test::More test, tests failing lib/Test/Simple/t/fail.t Test::Simple test, test failures +lib/Test/Simple/t/filehandles.t Test::Simple test, STDOUT can be played with +lib/Test/Simple/t/import.t Test::More test, importing functions +lib/Test/Simple/t/is_deeply.t Test::More test, is_deeply() lib/Test/Simple/t/missing.t Test::Simple test, missing tests lib/Test/Simple/t/More.t Test::More test, basic stuff +lib/Test/Simple/t/no_ending.t Test::Builder test, no_ending() +lib/Test/Simple/t/no_header.t Test::Builder test, no_header() lib/Test/Simple/t/no_plan.t Test::Simple test, forgot the plan +lib/Test/Simple/t/output.t Test::Builder test, output methods +lib/Test/Simple/t/plan.t Test::More test, plan() lib/Test/Simple/t/plan_is_noplan.t Test::Simple test, no_plan +lib/Test/Simple/t/plan_no_plan.t Test::More test, plan() w/no_plan +lib/Test/Simple/t/plan_skip_all.t Test::More test, plan() w/skip_all lib/Test/Simple/t/simple.t Test::Simple test, basic stuff lib/Test/Simple/t/skip.t Test::More test, SKIP tests lib/Test/Simple/t/skipall.t Test::More test, skip all tests lib/Test/Simple/t/todo.t Test::More test, TODO tests lib/Test/Simple/t/undef.t Test::More test, undefs don't cause warnings +lib/Test/Simple/t/use_ok.t Test::More test, use_ok() lib/Test/Simple/t/useing.t Test::More test, compile test lib/Test/t/fail.t See if Test works lib/Test/t/mix.t See if Test works @@ -1200,7 +1212,6 @@ lib/Test/t/skip.t See if Test works lib/Test/t/success.t See if Test works lib/Test/t/todo.t See if Test works lib/Test/Tutorial.pod A tutorial on writing tests -lib/Test/Utils.pm Utility module for Test::Simple/More lib/Text/Abbrev.pm An abbreviation table builder lib/Text/Abbrev.t Test Text::Abbrev lib/Text/Balanced.pm Text::Balanced @@ -1587,6 +1598,9 @@ lib/unicore/Scripts.txt Unicode character database lib/unicore/SpecCase.txt Unicode character database lib/unicore/To/Digit.pl Unicode character database lib/unicore/To/Lower.pl Unicode character database +lib/unicore/To/SpecLower.pl Unicode character database +lib/unicore/To/SpecTitle.pl Unicode character database +lib/unicore/To/SpecUpper.pl Unicode character database lib/unicore/To/Title.pl Unicode character database lib/unicore/To/Upper.pl Unicode character database lib/unicore/UCD.html Unicode character database @@ -1822,6 +1836,7 @@ 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/perlintro.pod Perl introduction for beginners pod/perliol.pod Internals of PerlIO with layers. pod/perlipc.pod IPC info pod/perllexwarn.pod Lexical Warnings info @@ -1831,6 +1846,7 @@ pod/perlmod.pod Module mechanism info pod/perlmodinstall.pod Installing CPAN Modules pod/perlmodlib.PL Generate pod/perlmodlib.pod pod/perlmodlib.pod Module policy info +pod/perlmodstyle.pod Perl module style guide pod/perlnewmod.pod Preparing a new module for distribution pod/perlnumber.pod Semantics of numbers and numeric operations pod/perlobj.pod Object info @@ -2032,7 +2048,6 @@ t/lib/strict/refs Tests of "use strict 'refs'" for strict.t t/lib/strict/subs Tests of "use strict 'subs'" for strict.t t/lib/strict/vars Tests of "use strict 'vars'" for strict.t t/lib/Test/Simple/Catch.pm Utility module for testing Test::Simple -t/lib/Test/Simple/Catch/More.pm Utility module for testing Test::More t/lib/Test/Simple/sample_tests/death.plx for exit.t t/lib/Test/Simple/sample_tests/death_in_eval.plx for exit.t t/lib/Test/Simple/sample_tests/extras.plx for exit.t @@ -2325,10 +2340,12 @@ win32/buildext.pl Build extensions once miniperl is built win32/config.bc Win32 base line config.sh (Borland C++ build) win32/config.gc Win32 base line config.sh (mingw32/gcc build) win32/config.vc Win32 base line config.sh (Visual C++ build) +win32/config.win64 Win64 base line config.sh (MS IA64 compiler) win32/config_H.bc Win32 config header (Borland C++ build) win32/config_H.gc Win32 config header (GNU build)? win32/config_h.PL Perl code to convert Win32 config.sh to config.h win32/config_H.vc Win32 config header (Visual C++ build) +win32/config_H.win64 Win64 config header (MS IA64 compiler) win32/config_sh.PL Perl code to update Win32 config.sh from Makefile win32/des_fcrypt.patch Win32 port win32/distclean.bat Remove _ALL_ files not listed here in MANIFEST @@ -2341,6 +2358,7 @@ win32/include/netdb.h Win32 port win32/include/sys/socket.h Win32 port win32/Makefile Win32 makefile for NMAKE (Visual C++ build) win32/makefile.mk Win32 makefile for DMAKE (BC++, VC++ builds) +win32/Makefile.win64 Win64 makefile for NMAKE (MS IA64 compiler) win32/mdelete.bat multifile delete win32/perlglob.c Win32 port win32/perlhost.h Perl "host" implementation diff --git a/Porting/makerel b/Porting/makerel index 3abfeb72cb..0a6636e87f 100644 --- a/Porting/makerel +++ b/Porting/makerel @@ -128,6 +128,7 @@ my @writables = qw( vms/perly_c.vms vms/perly_h.vms win32/Makefile + win32/Makefile.win64 win32/makefile.mk win32/config_H.bc win32/config_H.gc @@ -144,6 +145,7 @@ my @crlf = qw( README.dos README.win32 win32/Makefile + win32/Makefile.win64 win32/makefile.mk wince/Makefile.ce wince/README.compile diff --git a/configure.com b/configure.com index ea09a29f8c..82fa3ed4a0 100644 --- a/configure.com +++ b/configure.com @@ -2231,7 +2231,11 @@ $! $! Ask if they want to build with 64-bit support $ IF (archname.eqs."VMS_AXP").and.("''f$extract(1,3, f$getsyi(""version""))'".ges."7.1") $ THEN -$ dflt = use64bitint +$ dflt = "n" +$ IF F$TYPE(use64bitint) .NES. "" +$ THEN +$ IF use64bitint .OR. use64bitint .eqs. "define" THEN dflt = "y" +$ ENDIF $ echo "" $ echo "You can have native 64-bit long integers." $ echo "" @@ -2249,25 +2253,32 @@ $ IF ans $ THEN use64bitint="Y" $ ELSE use64bitint="N" $ ENDIF -$ IF (use64bitint) +$! +$ dflt = "n" +$ IF F$TYPE(use64bitall) .NES. "" +$ THEN +$ IF use64bitall .OR. use64bitall .eqs. "define" THEN dflt = "y" +$ ENDIF +$ echo "" +$ echo "You may also choose to try maximal 64-bitness. It means using as much" +$ echo "64-bitness as possible on the platform. This in turn means even more" +$ echo "binary incompatibilities. On the other hand, your platform may not" +$ echo "have any more 64-bitness available than what you already have chosen." +$ echo "" +$ echo "If this does not make any sense to you, just accept the default ''dflt'." +$ rp = "Try to use maximal 64-bit support, if available? [''dflt'] " +$ GOSUB myread +$ IF ans .EQS. "" THEN ans = dflt +$ IF ans +$ THEN use64bitall="Y" +$ ELSE use64bitall="N" +$ ENDIF +$ IF use64bitall .AND. .NOT. use64bitint $ THEN -$ dflt = use64bitall -$ echo "" -$ echo "Since you chose 64-bitness you may want to try maximal 64-bitness." -$ echo "What you have chosen is minimal 64-bitness which means just enough" -$ echo "to get 64-bit integers. The maximal means using as much 64-bitness" -$ echo "as is possible on the platform. This in turn means even more binary" -$ echo "incompatibilities. On the other hand, your platform may not have" -$ echo "any more maximal 64-bitness than what you already have chosen." $ echo "" -$ echo "If this does not make any sense to you, just accept the default ''dflt'." -$ rp = "Try to use full 64-bit support, if available? [''dflt'] " -$ GOSUB myread -$ IF ans .EQS. "" THEN ans = dflt -$ IF ans -$ THEN use64bitall="Y" -$ ELSE use64bitall="N" -$ ENDIF +$ echo "Since you have chosen a maximally 64-bit build, I'm also turning on" +$ echo "the use of 64-bit integers." +$ use64bitint="Y" $ ENDIF $ ENDIF ! AXP && >= 7.1 $! @@ -2363,6 +2374,9 @@ $ rp = "Use IEEE math? [''dflt'] " $ GOSUB myread $ IF ans .eqs. "" THEN ans = "''dflt'" $ use_ieee_math = "''ans'" +$ ELSE +$ be_case_sensitive = "n" +$ use_ieee_math = "n" $ ENDIF $! CC Flags $ echo "" @@ -2830,11 +2844,31 @@ $ uselargefiles = "define" $ uselongdouble = "define" $ alignbytes="16" $ usemorebits = "define" +$ ivdformat="""Ld""" +$ uvuformat="""Lu""" +$ uvoformat="""Lo""" +$ uvxformat="""Lx""" +$ uvXUformat="""LX""" $ ELSE $ use64bitint = "undef" $ uselargefiles = "undef" $ uselongdouble = "undef" $ usemorebits = "undef" +$ ivdformat="""ld""" +$ uvuformat="""lu""" +$ uvoformat="""lo""" +$ uvxformat="""lx""" +$ uvXUformat="""lX""" +$ ENDIF +$ IF uselongdouble .OR. uselongdouble .EQS. "define" +$ THEN +$ nveformat="""Le""" +$ nvfformat="""Lf""" +$ nvgformat="""Lg""" +$ ELSE +$ nveformat="""e""" +$ nvfformat="""f""" +$ nvgformat="""g""" $ ENDIF $ IF use64bitall .OR. use64bitall .EQS. "define" $ THEN @@ -2912,6 +2946,7 @@ $ d_PRIgldbl = "define" $ d_PRIu64 = "define" $ d_PRIo64 = "define" $ d_PRIx64 = "define" +$ d_PRIXU64 = "define" $ sPRId64 = """Ld""" $ sPRIEUldbl = """LE""" $ sPRIFUldbl = """LF""" @@ -4479,6 +4514,7 @@ $! $! Check rand48 and its ilk $! $ echo4 "Looking for a random number function..." +$ d_use_rand = "undef" $ OS $ WS "#if defined(__DECC) || defined(__DECCXX)" $ WS "#include <stdlib.h>" @@ -4519,9 +4555,10 @@ $ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link $ THEN $ echo4 "OK, found random()." $ ELSE -$ drand01="(((float)rand())/((float)RAND_MAX))" +$ drand01="(((float)rand())*PL_my_inv_rand_max)" $ randseedtype = "unsigned" $ seedfunc = "srand" +$ d_use_rand = "define" $ echo4 "Yick, looks like I have to use rand()." $ ENDIF $ ENDIF @@ -4872,16 +4909,6 @@ $ d_nv_preserves_uv_bits = tmp $ ENDIF $ DELETE/SYMBOL tmp $! -$ ivdformat="""ld""" -$ uvuformat="""lu""" -$ uvoformat="""lo""" -$ uvxformat="""lx""" -$ uvXUformat="""lX""" -$! uselongdouble? -$ nveformat="""e""" -$ nvfformat="""f""" -$ nvgformat="""g""" -$! $! Finally the composite ones. All config $! $ myuname="''osname' ''myname' ''osvers' ''F$EDIT(hwname, "TRIM")'" @@ -4965,7 +4992,7 @@ $ WC "d_Gconvert='my_gconvert(x,n,t,b)'" $ WC "d_PRIEldbl='" + d_PRIEUldbl + "'" $ WC "d_PRIFldbl='" + d_PRIFUldbl + "'" $ WC "d_PRIGldbl='" + d_PRIGUldbl + "'" -$ WC "d_PRIX64='" + d_PRIXU64 + "'" +$ WC "d_PRIXU64='" + d_PRIXU64 + "'" $ WC "d_PRId64='" + d_PRId64 + "'" $ WC "d_PRIeldbl='" + d_PRIeldbl + "'" $ WC "d_PRIfldbl='" + d_PRIfldbl + "'" @@ -5705,6 +5732,7 @@ $ THEN $! Alas this does not help to build Fcntl $! WC "#define PERL_IGNORE_FPUSIG SIGFPE" $ ENDIF +$ if d_use_rand .EQS. "define" then WC "#define Drand01_is_rand" $ CLOSE CONFIG $! $ echo4 "Doing variable substitutions on .SH files..." diff --git a/embedvar.h b/embedvar.h index d2e15a0801..26c0eb12a6 100644 --- a/embedvar.h +++ b/embedvar.h @@ -1321,6 +1321,7 @@ #define PL_do_undump (PL_Vars.Gdo_undump) #define PL_hexdigit (PL_Vars.Ghexdigit) #define PL_malloc_mutex (PL_Vars.Gmalloc_mutex) +#define PL_my_inv_rand_max (PL_Vars.Gmy_inv_rand_max) #define PL_op_mutex (PL_Vars.Gop_mutex) #define PL_patleave (PL_Vars.Gpatleave) #define PL_sharedsv_space (PL_Vars.Gsharedsv_space) @@ -1335,6 +1336,7 @@ #define PL_Gdo_undump PL_do_undump #define PL_Ghexdigit PL_hexdigit #define PL_Gmalloc_mutex PL_malloc_mutex +#define PL_Gmy_inv_rand_max PL_my_inv_rand_max #define PL_Gop_mutex PL_op_mutex #define PL_Gpatleave PL_patleave #define PL_Gsharedsv_space PL_sharedsv_space diff --git a/ext/B/t/terse.t b/ext/B/t/terse.t index 336b7a7970..281d65c113 100644 --- a/ext/B/t/terse.t +++ b/ext/B/t/terse.t @@ -82,7 +82,8 @@ sub bar { SKIP: { use Config; - skip("- printing RVs not working under threads") if $Config{usethreads}; + skip("- printing RVs not working under threads", 1) + if $Config{usethreads}; # Schwern's example of finding an RV my $path = join " ", map { qq["-I$_"] } @INC; my $redir = $^O eq 'MacOS' ? '' : "2>&1"; diff --git a/ext/SDBM_File/sdbm/sdbm.c b/ext/SDBM_File/sdbm/sdbm.c index d41c770dfb..31889d97f3 100644 --- a/ext/SDBM_File/sdbm/sdbm.c +++ b/ext/SDBM_File/sdbm/sdbm.c @@ -36,12 +36,11 @@ #ifndef sun extern int errno; #endif +#endif extern Malloc_t malloc proto((MEM_SIZE)); extern Free_t free proto((Malloc_t)); -#endif - /* * forward */ diff --git a/ext/Time/HiRes/HiRes.pm b/ext/Time/HiRes/HiRes.pm index d664c627df..72fc6065df 100644 --- a/ext/Time/HiRes/HiRes.pm +++ b/ext/Time/HiRes/HiRes.pm @@ -105,8 +105,9 @@ seconds like Time::HiRes::time() (see below). =item usleep ( $useconds ) -Issues a usleep for the number of microseconds specified. See also -Time::HiRes::sleep() below. +Issues a usleep for the number of microseconds specified. Returns the +number of microseconds actually slept. See also Time::HiRes::sleep() +below. =item ualarm ( $useconds [, $interval_useconds ] ) @@ -143,9 +144,11 @@ separate values. =item sleep ( $floating_seconds ) -Converts $floating_seconds to microseconds and issues a usleep for the -result. This function can be imported, resulting in a nice drop-in -replacement for the C<sleep> provided with perl, see the EXAMPLES below. +Converts $floating_seconds to microseconds and issues a usleep for the +result. Returns the number of seconds actually slept (a floating +point value). This function can be imported, resulting in a nice +drop-in replacement for the C<sleep> provided with perl, see the +EXAMPLES below. =item alarm ( $floating_seconds [, $interval_floating_seconds ] ) diff --git a/ext/Time/HiRes/HiRes.t b/ext/Time/HiRes/HiRes.t index feeb5cf9a9..e0f0cf7889 100644 --- a/ext/Time/HiRes/HiRes.t +++ b/ext/Time/HiRes/HiRes.t @@ -3,7 +3,7 @@ BEGIN { @INC = '../lib'; } -BEGIN { $| = 1; print "1..19\n"; } +BEGIN { $| = 1; print "1..21\n"; } END {print "not ok 1\n" unless $loaded;} @@ -223,3 +223,9 @@ unless (defined &Time::HiRes::setitimer $SIG{VTALRM} = 'DEFAULT'; } +$a = abs(sleep(1.5) - 1.5); +print $a < 0.1 ? "ok 20 # $a\n" : "not ok 20 # $a\n"; + +$a = abs(usleep(1_500_000) / 1_500_000 - 1.0); +print $a < 0.1 ? "ok 21 # $a\n" : "not ok 21 # $a\n"; + diff --git a/ext/Time/HiRes/HiRes.xs b/ext/Time/HiRes/HiRes.xs index d7d9bda2a6..3bb1aa4162 100644 --- a/ext/Time/HiRes/HiRes.xs +++ b/ext/Time/HiRes/HiRes.xs @@ -367,20 +367,54 @@ constant(name, arg) char * name int arg -#ifdef HAS_USLEEP +#if defined(HAS_USLEEP) && defined(HAS_GETTIMEOFDAY) -void +NV usleep(useconds) - int useconds + NV useconds + PREINIT: + struct timeval Ta, Tb; + CODE: + gettimeofday(&Ta, NULL); + if (items > 0) { + if (useconds > 1E6) { + IV seconds = (IV) (useconds / 1E6); + sleep(seconds); + useconds -= 1E6 * seconds; + } + usleep((UV)useconds); + } else + PerlProc_pause(); + gettimeofday(&Tb, NULL); +#if 0 + printf("[%ld %ld] [%ld %ld]\n", Tb.tv_sec, Tb.tv_usec, Ta.tv_sec, Ta.tv_usec); +#endif + RETVAL = 1E6*(Tb.tv_sec-Ta.tv_sec)+(NV)((IV)Tb.tv_usec-(IV)Ta.tv_usec); -void + OUTPUT: + RETVAL + +NV sleep(...) - PROTOTYPE: ;$ + PREINIT: + struct timeval Ta, Tb; CODE: - if (items > 0) - usleep((int)(SvNV(ST(0)) * 1000000)); - else + gettimeofday(&Ta, NULL); + if (items > 0) { + NV seconds = SvNV(ST(0)); + IV useconds = 1E6 * (seconds - (IV)seconds); + sleep(seconds); + usleep(useconds); + } else PerlProc_pause(); + gettimeofday(&Tb, NULL); +#if 0 + printf("[%ld %ld] [%ld %ld]\n", Tb.tv_sec, Tb.tv_usec, Ta.tv_sec, Ta.tv_usec); +#endif + RETVAL = (NV)(Tb.tv_sec-Ta.tv_sec)+0.000001*(NV)(Tb.tv_usec-Ta.tv_usec); + + OUTPUT: + RETVAL #endif diff --git a/hints/aix.sh b/hints/aix.sh index 40c7b66ae4..f862051024 100644 --- a/hints/aix.sh +++ b/hints/aix.sh @@ -123,7 +123,7 @@ case "$osvers" in ccflags="$ccflags -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE" case "$cc" in *gcc*) ;; - *) ccflags="$ccflags -qmaxmem=16384" ;; + *) ccflags="$ccflags -qmaxmem=16384 -qnoansialias" ;; esac nm_opt='-B' ;; diff --git a/hints/openbsd.sh b/hints/openbsd.sh index 8e7c4e5ce1..3b73578a9d 100644 --- a/hints/openbsd.sh +++ b/hints/openbsd.sh @@ -88,7 +88,9 @@ $define|true|[yY]*) # any openbsd version dependencies with pthreads? ccflags="-pthread $ccflags" ldflags="-pthread $ldflags" + # Add -lpthread. Also change from -lc to -lc_r libswanted="$libswanted pthread" + libswanted=`echo " $libswanted "| sed -e 's/ c / c_r /' -e 's/^ //' -e 's/ $//'` # This is strange. usevfork="$undef" esac diff --git a/lib/ExtUtils/MakeMaker.pm b/lib/ExtUtils/MakeMaker.pm index 3a3690feab..ef8bfab2dc 100644 --- a/lib/ExtUtils/MakeMaker.pm +++ b/lib/ExtUtils/MakeMaker.pm @@ -209,7 +209,7 @@ sub full_setup { PERLRUN PERLRUNINST PERL_ARCHLIB PERL_CORE PERL_LIB PERL_SRC PERM_RW PERM_RWX PL_FILES PM PM_FILTER PMLIBDIRS POLLUTE PPM_INSTALL_EXEC - PPM_INSTALL_SCRIPT PREFIX + PPM_INSTALL_SCRIPT PREFIX PREREQ_FATAL PREREQ_PM SKIP TEST_LIBS TYPEMAPS VERSION VERSION_FROM XS XSOPT XSPROTOARG XS_VERSION clean depend dist dynamic_lib linkext macro realclean tool_autosplit @@ -339,26 +339,26 @@ sub ExtUtils::MakeMaker::new { my %configure_att; # record &{$self->{CONFIGURE}} attributes my(%initial_att) = %$self; # record initial attributes + my(%unsatisfied) = (); my($prereq); foreach $prereq (sort keys %{$self->{PREREQ_PM}}) { my $eval = "require $prereq"; eval $eval; if ($@) { - warn "Warning: prerequisite $prereq $self->{PREREQ_PM}->{$prereq} not found. We have " - . ($prereq->VERSION || 'unknown version'); - } - elsif ($prereq->VERSION < $self->{PREREQ_PM}->{$prereq} ){ - warn "Warning: prerequisite $prereq $self->{PREREQ_PM}->{$prereq} not found"; -# Why is/was this 'delete' here? We need PREREQ_PM later to make PPDs. -# } else { -# delete $self->{PREREQ_PM}{$prereq}; + warn "Warning: prerequisite $prereq $self->{PREREQ_PM}->{$prereq} not found.\n" unless $self->{PREREQ_FATAL}; + $unsatisfied{$prereq} = 'not installed'; + } elsif ($prereq->VERSION < $self->{PREREQ_PM}->{$prereq} ){ + warn "Warning: prerequisite $prereq $self->{PREREQ_PM}->{$prereq} not found. We have" + . ($prereq->VERSION || 'unknown version') unless $self->{PREREQ_FATAL}; + $unsatisfied{$prereq} = $self->{PREREQ_PM}->{$prereq} ? $self->{PREREQ_PM}->{$prereq} : 'unknown version' ; } } -# if (@unsatisfied){ + if (%unsatisfied && $self->{PREREQ_FATAL}){ # unless (defined $ExtUtils::MakeMaker::useCPAN) { -# print qq{MakeMaker WARNING: prerequisites not found (@unsatisfied) -# Please install these modules first and rerun 'perl Makefile.PL'.\n}; + my $failedprereqs = join ', ', map {"$_ $unsatisfied{$_}"} keys %unsatisfied; + die qq{MakeMaker FATAL: prerequisites not found ($failedprereqs) + Please install these modules first and rerun 'perl Makefile.PL'.\n}; # if ($ExtUtils::MakeMaker::hasCPAN) { # $ExtUtils::MakeMaker::useCPAN = prompt(qq{Should I try to use the CPAN module to fetch them for you?},"yes"); # } else { @@ -370,10 +370,10 @@ sub ExtUtils::MakeMaker::new { # require CPAN; # CPAN->import(@unsatisfied); # } else { -# die qq{prerequisites not found (@unsatisfied)}; +# die qq{prerequisites not found (@unsatisfied)}; # } # warn qq{WARNING: prerequisites not found (@unsatisfied)}; -# } + } if (defined $self->{CONFIGURE}) { if (ref $self->{CONFIGURE} eq 'CODE') { @@ -1788,6 +1788,20 @@ extension (e.g. Fcntl for SDBM_File) are the keys of the hash and the desired version is the value. If the required version number is 0, we only check if any version is installed already. +=item PREREQ_FATAL + +Bool. If this parameter is true, failing to have the required modules +(or the right versions thereof) will be fatal. perl Makefile.PL will die +with the proper message. + +Note: see L<Test::Harness> for a shortcut for stopping tests early if +you are missing dependencies. + +Do I<not> use this parameter for simple requirements, which could be resolved +at a later time, e.g. after an unsuccessful B<make test> of your module. + +It is I<extremely> rare to have to use C<PREREQ_FATAL> at all! + =item SKIP Arrayref. E.g. [qw(name1 name2)] skip (do not write) sections of the diff --git a/lib/File/Spec.pm b/lib/File/Spec.pm index 0f90a45b62..f177f68831 100644 --- a/lib/File/Spec.pm +++ b/lib/File/Spec.pm @@ -75,14 +75,14 @@ forms of these methods. =over 2 -=item canonpath() +=item canonpath No physical check on the filesystem, but a logical cleanup of a path. $cpath = File::Spec->canonpath( $path ) ; -=item catdir() +=item catdir Concatenate two or more directory names to form a complete path ending with a directory. But remove the trailing slash from the resulting diff --git a/lib/File/Spec/Mac.pm b/lib/File/Spec/Mac.pm index bba21eee01..dfce6a3559 100644 --- a/lib/File/Spec/Mac.pm +++ b/lib/File/Spec/Mac.pm @@ -75,71 +75,77 @@ calls like the following are allowed. -Here are the rules that are used in C<catdir()>; note that we try to be as -compatible as possible to Unix: +Here are the rules that are used in C<catdir()>; note that we try to be as +compatible as possible to Unix: =over 2 - =item 1. -The resulting path is relative by default, i.e. the resulting path will have a -leading colon. +The resulting path is relative by default, i.e. the resulting path will have a +leading colon. =item 2. -A trailing colon is added automatically to the resulting path, to denote a -directory. +A trailing colon is added automatically to the resulting path, to denote a +directory. =item 3. -Generally, each argument has one leading ":" and one trailing ":" removed (if -any). They are then joined together by a ":". Special treatment applies for -arguments denoting updir paths like "::lib:", see (4), or arguments consisting -solely of colons ("colon paths"), see (5). +Generally, each argument has one leading ":" and one trailing ":" +removed (if any). They are then joined together by a ":". Special +treatment applies for arguments denoting updir paths like "::lib:", +see (4), or arguments consisting solely of colons ("colon paths"), +see (5). =item 4. -When an updir path like ":::lib::" is passed as argument, the number of -directories to climb up is handled correctly, not removing leading or trailing -colons when necessary. E.g. + +When an updir path like ":::lib::" is passed as argument, the number +of directories to climb up is handled correctly, not removing leading +or trailing colons when necessary. E.g. catdir(":::a","::b","c") = ":::a::b:c:" catdir(":::a::","::b","c") = ":::a:::b:c:" =item 5. -Adding a colon ":" or empty string "" to a path at I<any> position doesn't -alter the path, i.e. these arguments are ignored. (When a "" is passed as -the first argument, it has a special meaning, see (6) ). This way, a colon -":" is handled like a "." (curdir) on Unix, while an empty string "" is -generally ignored (see C<Unix-E<gt>canonpath()> ). Likewise, a "::" is handled -like a ".." (updir), and a ":::" is handled like a "../.." etc. E.g. + +Adding a colon ":" or empty string "" to a path at I<any> position +doesn't alter the path, i.e. these arguments are ignored. (When a "" +is passed as the first argument, it has a special meaning, see +(6)). This way, a colon ":" is handled like a "." (curdir) on Unix, +while an empty string "" is generally ignored (see +C<Unix-E<gt>canonpath()> ). Likewise, a "::" is handled like a ".." +(updir), and a ":::" is handled like a "../.." etc. E.g. catdir("a",":",":","b") = ":a:b:" catdir("a",":","::",":b") = ":a::b:" - =item 6. -If the first argument is an empty string "" or is a volume name, i.e. matches -the pattern /^[^:]+:/, the resulting path is B<absolute>. + +If the first argument is an empty string "" or is a volume name, i.e. matches +the pattern /^[^:]+:/, the resulting path is B<absolute>. =item 7. -Passing an empty string "" as the first argument to C<catdir()> is like passing -C<File::Spec-E<gt>rootdir()> as the first argument, i.e. + +Passing an empty string "" as the first argument to C<catdir()> is +like passingC<File::Spec-E<gt>rootdir()> as the first argument, i.e. catdir("","a","b") is the same as catdir(rootdir(),"a","b"). -This is true on Unix, where C<catdir("","a","b")> yields "/a/b" and C<rootdir()> is -"/". Note that C<rootdir()> on Mac OS is the startup volume, which is the closest -in concept to Unix' "/". This should help to run existing scripts originally written -for Unix. +This is true on Unix, where C<catdir("","a","b")> yields "/a/b" and +C<rootdir()> is "/". Note that C<rootdir()> on Mac OS is the startup +volume, which is the closest in concept to Unix' "/". This should help +to run existing scripts originally written for Unix. =item 8. -For absolute paths, some cleanup is done, to ensure that the volume name isn't -immediately followed by updirs. This is invalid, because this would go beyond -"root". Generally, these cases are handled like their Unix counterparts: + +For absolute paths, some cleanup is done, to ensure that the volume +name isn't immediately followed by updirs. This is invalid, because +this would go beyond "root". Generally, these cases are handled like +their Unix counterparts: Unix: Unix->catdir("","") = "/" @@ -152,20 +158,24 @@ immediately followed by updirs. This is invalid, because this would go beyond Mac->catdir("","::") = rootdir() # can't go beyond root Mac->catdir("",":","::","::","a") = rootdir() . "a:" # (e.g. "HD:a:") -However, this approach is limited to the first arguments following "root" (again, see -C<Unix-E<gt>canonpath()> ). If there are more arguments that move up the directory -tree, an invalid path going beyond root can be created. +However, this approach is limited to the first arguments following +"root" (again, see C<Unix-E<gt>canonpath()> ). If there are more +arguments that move up the directory tree, an invalid path going +beyond root can be created. =back -As you've seen, you can force C<catdir()> to create an absolute path by passing either -an empty string or a path that begins with a volume name as the first argument. However, -you are strongly encouraged not to do so, since this is done only for backward -compatibility. Newer versions of File::Spec come with a method called C<catpath()> (see -below), that is designed to offer a portable solution for the creation of absolute paths. -It takes volume, directory and file portions and returns an entire path. While -C<catdir()> is still suitable for the concatenation of I<directory names>, you are -encouraged to use C<catpath()> to concatenate I<volume names> and I<directory paths>. E.g. +As you've seen, you can force C<catdir()> to create an absolute path +by passing either an empty string or a path that begins with a volume +name as the first argument. However, you are strongly encouraged not +to do so, since this is done only for backward compatibility. Newer +versions of File::Spec come with a method called C<catpath()> (see +below), that is designed to offer a portable solution for the creation +of absolute paths. It takes volume, directory and file portions and +returns an entire path. While C<catdir()> is still suitable for the +concatenation of I<directory names>, you are encouraged to use +C<catpath()> to concatenate I<volume names> and I<directory +paths>. E.g. $dir = File::Spec->catdir("tmp","sources"); $abs_path = File::Spec->catpath("MacintoshHD:", $dir,""); diff --git a/lib/Test/Builder.pm b/lib/Test/Builder.pm new file mode 100644 index 0000000000..99ec519222 --- /dev/null +++ b/lib/Test/Builder.pm @@ -0,0 +1,965 @@ +package Test::Builder; + +use 5.004; + +# $^C was only introduced in 5.005-ish. We do this to prevent +# use of uninitialized value warnings in older perls. +$^C ||= 0; + +use strict; +use vars qw($VERSION $CLASS); +$VERSION = 0.03; +$CLASS = __PACKAGE__; + +my $IsVMS = $^O eq 'VMS'; + +use vars qw($Level); +my @Test_Results = (); +my @Test_Details = (); +my($Test_Died) = 0; +my($Have_Plan) = 0; +my $Curr_Test = 0; + + +=head1 NAME + +Test::Builder - Backend for building test libraries + +=head1 SYNOPSIS + + package My::Test::Module; + use Test::Builder; + require Exporter; + @ISA = qw(Exporter); + @EXPORT = qw(ok); + + my $Test = Test::Builder->new; + $Test->output('my_logfile'); + + sub import { + my($self) = shift; + my $pack = caller; + + $Test->exported_to($pack); + $Test->plan(@_); + + $self->export_to_level(1, $self, 'ok'); + } + + sub ok { + my($test, $name) = @_; + + $Test->ok($test, $name); + } + + +=head1 DESCRIPTION + +I<THIS IS ALPHA GRADE SOFTWARE> The interface will change. + +Test::Simple and Test::More have proven to be popular testing modules, +but they're not always flexible enough. Test::Builder provides the +a building block upon which to write your own test libraries. + +=head2 Construction + +=over 4 + +=item B<new> + + my $Test = Test::Builder->new; + +Returns a Test::Builder object representing the current state of the +test. + +Since you only run one test per program, there is B<one and only one> +Test::Builder object. No matter how many times you call new(), you're +getting the same object. (This is called a singleton). + +=cut + +my $Test; +sub new { + my($class) = shift; + $Test ||= bless ['Move along, nothing to see here'], $class; + return $Test; +} + +=back + +=head2 Setting up tests + +These methods are for setting up tests and declaring how many there +are. You usually only want to call one of these methods. + +=over 4 + +=item B<exported_to> + + my $pack = $Test->exported_to; + $Test->exported_to($pack); + +Tells Test::Builder what package you exported your functions to. +This is important for getting TODO tests right. + +=cut + +my $Exported_To; +sub exported_to { + my($self, $pack) = @_; + + if( defined $pack ) { + $Exported_To = $pack; + } + return $Exported_To; +} + +=item B<plan> + + $Test->plan('no_plan'); + $Test->plan( skip_all => $reason ); + $Test->plan( tests => $num_tests ); + +A convenient way to set up your tests. Call this and Test::Builder +will print the appropriate headers and take the appropriate actions. + +If you call plan(), don't call any of the other methods below. + +=cut + +sub plan { + my($self, $cmd, $arg) = @_; + + return unless $cmd; + + if( $cmd eq 'no_plan' ) { + $self->no_plan; + } + elsif( $cmd eq 'skip_all' ) { + return $self->skip_all($arg); + } + elsif( $cmd eq 'tests' ) { + if( $arg ) { + return $self->expected_tests($arg); + } + elsif( !defined $arg ) { + die "Got an undefined number of tests. Looks like you tried to ". + "say how many tests you plan to run but made a mistake.\n"; + } + elsif( !$arg ) { + die "You said to run 0 tests! You've got to run something.\n"; + } + } +} + +=item B<expected_tests> + + my $max = $Test->expected_tests; + $Test->expected_tests($max); + +Gets/sets the # of tests we expect this test to run and prints out +the appropriate headers. + +=cut + +my $Expected_Tests = 0; +sub expected_tests { + my($self, $max) = @_; + + if( defined $max ) { + $Expected_Tests = $max; + $Have_Plan = 1; + + $self->_print("1..$max\n") unless $self->no_header; + } + return $Expected_Tests; +} + + +=item B<no_plan> + + $Test->no_plan; + +Declares that this test will run an indeterminate # of tests. + +=cut + +my($No_Plan) = 0; +sub no_plan { + $No_Plan = 1; + $Have_Plan = 1; +} + +=item B<skip_all> + + $Test->skip_all; + $Test->skip_all($reason); + +Skips all the tests, using the given $reason. Exits immediately with 0. + +=cut + +my $Skip_All = 0; +sub skip_all { + my($self, $reason) = @_; + + my $out = "1..0"; + $out .= " # Skip $reason" if $reason; + $out .= "\n"; + + $Skip_All = 1; + + $self->_print($out) unless $self->no_header; + exit(0); +} + +=back + +=head2 Running tests + +These actually run the tests, analogous to the functions in +Test::More. + +$name is always optional. + +=over 4 + +=item B<ok> + + $Test->ok($test, $name); + +Your basic test. Pass if $test is true, fail if $test is false. Just +like Test::Simple's ok(). + +=cut + +sub ok { + my($self, $test, $name) = @_; + + unless( $Have_Plan ) { + die "You tried to run a test without a plan! Gotta have a plan.\n"; + } + + $Curr_Test++; + + $self->diag(<<ERR) if defined $name and $name =~ /^[\d\s]+$/; +You named your test '$name'. You shouldn't use numbers for your test names. +Very confusing. +ERR + + my($pack, $file, $line) = $self->caller; + + my $todo = $self->todo($pack); + + my $out; + unless( $test ) { + $out .= "not "; + $Test_Results[$Curr_Test-1] = $todo ? 1 : 0; + } + else { + $Test_Results[$Curr_Test-1] = 1; + } + + $out .= "ok"; + $out .= " $Curr_Test" if $self->use_numbers; + + if( defined $name ) { + $name =~ s|#|\\#|g; # # in a name can confuse Test::Harness. + $out .= " - $name"; + } + + if( $todo ) { + my $what_todo = $todo; + $out .= " # TODO $what_todo"; + } + + $out .= "\n"; + + $self->_print($out); + + unless( $test ) { + my $msg = $todo ? "Failed (TODO)" : "Failed"; + $self->diag("$msg test ($file at line $line)\n"); + } + + return $test ? 1 : 0; +} + +=item B<is_eq> + + $Test->is_eq($got, $expected, $name); + +Like Test::More's is(). Checks if $got eq $expected. This is the +string version. + +=item B<is_num> + + $Test->is_num($get, $expected, $name); + +Like Test::More's is(). Checks if $got == $expected. This is the +numeric version. + +=cut + +sub is_eq { + my $self = shift; + local $Level = $Level + 1; + return $self->_is('eq', @_); +} + +sub is_num { + my $self = shift; + local $Level = $Level + 1; + return $self->_is('==', @_); +} + +sub _is { + my($self, $type, $got, $expect, $name) = @_; + + my $test; + { + local $^W = 0; # so we can compare undef quietly + $test = $type eq 'eq' ? $got eq $expect + : $got == $expect; + } + local $Level = $Level + 1; + my $ok = $self->ok($test, $name); + + unless( $ok ) { + $got = defined $got ? "'$got'" : 'undef'; + $expect = defined $expect ? "'$expect'" : 'undef'; + $self->diag(sprintf <<DIAGNOSTIC, $got, $expect); + got: %s +expected: %s +DIAGNOSTIC + } + + return $ok; +} + +=item B<like> + + $Test->like($this, qr/$regex/, $name); + $Test->like($this, '/$regex/', $name); + +Like Test::More's like(). Checks if $this matches the given $regex. + +You'll want to avoid qr// if you want your tests to work before 5.005. + +=cut + +sub like { + my($self, $this, $regex, $name) = @_; + + local $Level = $Level + 1; + + my $ok = 0; + if( ref $regex eq 'Regexp' ) { + local $^W = 0; + $ok = $self->ok( $this =~ $regex ? 1 : 0, $name ); + } + # Check if it looks like '/foo/' + elsif( my($re, $opts) = $regex =~ m{^ /(.*)/ (\w*) $ }sx ) { + local $^W = 0; + $ok = $self->ok( $this =~ /(?$opts)$re/ ? 1 : 0, $name ); + } + else { + $ok = $self->ok( 0, $name ); + + $self->diag("'$regex' doesn't look much like a regex to me."); + + return $ok; + } + + unless( $ok ) { + $this = defined $this ? "'$this'" : 'undef'; + $self->diag(sprintf <<DIAGNOSTIC, $this); + %s +doesn't match '$regex' +DIAGNOSTIC + + } + + return $ok; +} + +=item B<skip> + + $Test->skip; + $Test->skip($why); + +Skips the current test, reporting $why. + +=cut + +sub skip { + my($self, $why) = @_; + $why ||= ''; + + unless( $Have_Plan ) { + die "You tried to run tests without a plan! Gotta have a plan.\n"; + } + + $Curr_Test++; + + $Test_Results[$Curr_Test-1] = 1; + + my $out = "ok"; + $out .= " $Curr_Test" if $self->use_numbers; + $out .= " # skip $why\n"; + + $Test->_print($out); + + return 1; +} + +=begin _unimplemented + +=item B<skip_rest> + + $Test->skip_rest; + $Test->skip_rest($reason); + +Like skip(), only it skips all the rest of the tests you plan to run +and terminates the test. + +If you're running under no_plan, it skips once and terminates the +test. + +=end _unimplemented + +=back + + +=head2 Test style + +=over 4 + +=item B<level> + + $Test->level($how_high); + +How far up the call stack should $Test look when reporting where the +test failed. + +Defaults to 1. + +Setting $Test::Builder::Level overrides. This is typically useful +localized: + + { + local $Test::Builder::Level = 2; + $Test->ok($test); + } + +=cut + +sub level { + my($self, $level) = @_; + + if( defined $level ) { + $Level = $level; + } + return $Level; +} + +$CLASS->level(1); + + +=item B<use_numbers> + + $Test->use_numbers($on_or_off); + +Whether or not the test should output numbers. That is, this if true: + + ok 1 + ok 2 + ok 3 + +or this if false + + ok + ok + ok + +Most useful when you can't depend on the test output order, such as +when threads or forking is involved. + +Test::Harness will accept either, but avoid mixing the two styles. + +Defaults to on. + +=cut + +my $Use_Nums = 1; +sub use_numbers { + my($self, $use_nums) = @_; + + if( defined $use_nums ) { + $Use_Nums = $use_nums; + } + return $Use_Nums; +} + +=item B<no_header> + + $Test->no_header($no_header); + +If set to true, no "1..N" header will be printed. + +=item B<no_ending> + + $Test->no_ending($no_ending); + +Normally, Test::Builder does some extra diagnostics when the test +ends. It also changes the exit code as described in Test::Simple. + +If this is true, none of that will be done. + +=cut + +my($No_Header, $No_Ending) = (0,0); +sub no_header { + my($self, $no_header) = @_; + + if( defined $no_header ) { + $No_Header = $no_header; + } + return $No_Header; +} + +sub no_ending { + my($self, $no_ending) = @_; + + if( defined $no_ending ) { + $No_Ending = $no_ending; + } + return $No_Ending; +} + + +=back + +=head2 Output + +Controlling where the test output goes. + +=over 4 + +=item B<diag> + + $Test->diag(@msgs); + +Prints out the given $message. Normally, it uses the failure_output() +handle, but if this is for a TODO test, the todo_output() handle is +used. + +Output will be indented and prepended with a # as not to interfere +with test output. + +We encourage using this rather than calling print directly. + +=cut + +sub diag { + my($self, @msgs) = @_; + + # Prevent printing headers when compiling (ie. -c) + return if $^C; + + # Escape each line with a #. + foreach (@msgs) { + s/^([^#])/# $1/; + s/\n([^#])/\n# $1/g; + } + + local $Level = $Level + 1; + my $fh = $self->todo ? $self->todo_output : $self->failure_output; + local($\, $", $,) = (undef, ' ', ''); + print $fh @msgs; +} + +=begin _private + +=item B<_print> + + $Test->_print(@msgs); + +Prints to the output() filehandle. + +=end _private + +=cut + +sub _print { + my($self, @msgs) = @_; + + # Prevent printing headers when only compiling. Mostly for when + # tests are deparsed with B::Deparse + return if $^C; + + local($\, $", $,) = (undef, ' ', ''); + my $fh = $self->output; + print $fh @msgs; +} + + +=item B<output> + + $Test->output($fh); + $Test->output($file); + +Where normal "ok/not ok" test output should go. + +Defaults to STDOUT. + +=item B<failure_output> + + $Test->failure_output($fh); + $Test->failure_output($file); + +Where diagnostic output on test failures and diag() should go. + +Defaults to STDERR. + +=item B<todo_output> + + $Test->todo_output($fh); + $Test->todo_output($file); + +Where diagnostics about todo test failures and diag() should go. + +Defaults to STDOUT. + +=cut + +my($Out_FH, $Fail_FH, $Todo_FH); +sub output { + my($self, $fh) = @_; + + if( defined $fh ) { + $Out_FH = _new_fh($fh); + } + return $Out_FH; +} + +sub failure_output { + my($self, $fh) = @_; + + if( defined $fh ) { + $Fail_FH = _new_fh($fh); + } + return $Fail_FH; +} + +sub todo_output { + my($self, $fh) = @_; + + if( defined $fh ) { + $Todo_FH = _new_fh($fh); + } + return $Todo_FH; +} + +sub _new_fh { + my($file_or_fh) = shift; + + my $fh; + unless( UNIVERSAL::isa($file_or_fh, 'GLOB') ) { + $fh = do { local *FH }; + open $fh, ">$file_or_fh" or + die "Can't open test output log $file_or_fh: $!"; + } + else { + $fh = $file_or_fh; + } + + return $fh; +} + +unless( $^C ) { + # We dup STDOUT and STDERR so people can change them in their + # test suites while still getting normal test output. + open(TESTOUT, ">&STDOUT") or die "Can't dup STDOUT: $!"; + open(TESTERR, ">&STDERR") or die "Can't dup STDERR: $!"; + _autoflush(\*TESTOUT); + _autoflush(\*TESTERR); + $CLASS->output(\*TESTOUT); + $CLASS->failure_output(\*TESTERR); + $CLASS->todo_output(\*TESTOUT); +} + +sub _autoflush { + my($fh) = shift; + my $old_fh = select $fh; + $| = 1; + select $old_fh; +} + + +=back + + +=head2 Test Status and Info + +=over 4 + +=item B<current_test> + + my $curr_test = $Test->current_test; + $Test->current_test($num); + +Gets/sets the current test # we're on. + +You usually shouldn't have to set this. + +=cut + +sub current_test { + my($self, $num) = @_; + + if( defined $num ) { + $Curr_Test = $num; + } + return $Curr_Test; +} + + +=item B<summary> + + my @tests = $Test->summary; + +A simple summary of the tests so far. True for pass, false for fail. +This is a logical pass/fail, so todos are passes. + +Of course, test #1 is $tests[0], etc... + +=cut + +sub summary { + my($self) = shift; + + return @Test_Results; +} + +=item B<details> I<UNIMPLEMENTED> + + my @tests = $Test->details; + +Like summary(), but with a lot more detail. + + $tests[$test_num - 1] = + { ok => is the test considered ok? + actual_ok => did it literally say 'ok'? + name => name of the test (if any) + type => 'skip' or 'todo' (if any) + reason => reason for the above (if any) + }; + +=item B<todo> + + my $todo_reason = $Test->todo; + my $todo_reason = $Test->todo($pack); + +todo() looks for a $TODO variable in your tests. If set, all tests +will be considered 'todo' (see Test::More and Test::Harness for +details). Returns the reason (ie. the value of $TODO) if running as +todo tests, false otherwise. + +todo() is pretty part about finding the right package to look for +$TODO in. It uses the exported_to() package to find it. If that's +not set, it's pretty good at guessing the right package to look at. + +Sometimes there is some confusion about where todo() should be looking +for the $TODO variable. If you want to be sure, tell it explicitly +what $pack to use. + +=cut + +sub todo { + my($self, $pack) = @_; + + $pack = $pack || $self->exported_to || $self->caller(1); + + no strict 'refs'; + return defined ${$pack.'::TODO'} ? ${$pack.'::TODO'} + : 0; +} + +=item B<caller> + + my $package = $Test->caller; + my($pack, $file, $line) = $Test->caller; + my($pack, $file, $line) = $Test->caller($height); + +Like the normal caller(), except it reports according to your level(). + +=cut + +sub caller { + my($self, $height) = @_; + $height ||= 0; + + my @caller = CORE::caller($self->level + $height + 1); + return wantarray ? @caller : $caller[0]; +} + +=back + +=cut + +=begin _private + +=over 4 + +=item B<_sanity_check> + + _sanity_check(); + +Runs a bunch of end of test sanity checks to make sure reality came +through ok. If anything is wrong it will die with a fairly friendly +error message. + +=cut + +#'# +sub _sanity_check { + _whoa($Curr_Test < 0, 'Says here you ran a negative number of tests!'); + _whoa(!$Have_Plan and $Curr_Test, + 'Somehow your tests ran without a plan!'); + _whoa($Curr_Test != @Test_Results, + 'Somehow you got a different number of results than tests ran!'); +} + +=item B<_whoa> + + _whoa($check, $description); + +A sanity check, similar to assert(). If the $check is true, something +has gone horribly wrong. It will die with the given $description and +a note to contact the author. + +=cut + +sub _whoa { + my($check, $desc) = @_; + if( $check ) { + die <<WHOA; +WHOA! $desc +This should never happen! Please contact the author immediately! +WHOA + } +} + +=item B<_my_exit> + + _my_exit($exit_num); + +Perl seems to have some trouble with exiting inside an END block. 5.005_03 +and 5.6.1 both seem to do odd things. Instead, this function edits $? +directly. It should ONLY be called from inside an END block. It +doesn't actually exit, that's your job. + +=cut + +sub _my_exit { + $? = $_[0]; + + return 1; +} + + +=back + +=end _private + +=cut + +$SIG{__DIE__} = sub { + # We don't want to muck with death in an eval, but $^S isn't + # totally reliable. 5.005_03 and 5.6.1 both do the wrong thing + # with it. Instead, we use caller. This also means it runs under + # 5.004! + my $in_eval = 0; + for( my $stack = 1; my $sub = (CORE::caller($stack))[3]; $stack++ ) { + $in_eval = 1 if $sub =~ /^\(eval\)/; + } + $Test_Died = 1 unless $in_eval; +}; + +sub _ending { + my $self = shift; + + _sanity_check(); + + # Bailout if plan() was never called. This is so + # "require Test::Simple" doesn't puke. + do{ _my_exit(0) && return } if !$Have_Plan; + + # Figure out if we passed or failed and print helpful messages. + if( @Test_Results ) { + # The plan? We have no plan. + if( $No_Plan ) { + $self->_print("1..$Curr_Test\n") unless $self->no_header; + $Expected_Tests = $Curr_Test; + } + + my $num_failed = grep !$_, @Test_Results[0..$Expected_Tests-1]; + $num_failed += abs($Expected_Tests - @Test_Results); + + if( $Curr_Test < $Expected_Tests ) { + $self->diag(<<"FAIL"); +# Looks like you planned $Expected_Tests tests but only ran $Curr_Test. +FAIL + } + elsif( $Curr_Test > $Expected_Tests ) { + my $num_extra = $Curr_Test - $Expected_Tests; + $self->diag(<<"FAIL"); +# Looks like you planned $Expected_Tests tests but ran $num_extra extra. +FAIL + } + elsif ( $num_failed ) { + $self->diag(<<"FAIL"); +# Looks like you failed $num_failed tests of $Expected_Tests. +FAIL + } + + if( $Test_Died ) { + $self->diag(<<"FAIL"); +# Looks like your test died just after $Curr_Test. +FAIL + + _my_exit( 255 ) && return; + } + + _my_exit( $num_failed <= 254 ? $num_failed : 254 ) && return; + } + elsif ( $Skip_All ) { + _my_exit( 0 ) && return; + } + else { + $self->diag("# No tests run!\n"); + _my_exit( 255 ) && return; + } +} + +END { + $Test->_ending if defined $Test and !$Test->no_ending; +} + +=head1 EXAMPLES + +At this point, Test::Simple and Test::More are your best examples. + +=head1 AUTHOR + +Original code by chromatic, maintained by Michael G Schwern +E<lt>schwern@pobox.comE<gt> + +=head1 SEE ALSO + +Test::Simple, Test::More, Test::Harness + +=cut + +1; diff --git a/lib/Test/More.pm b/lib/Test/More.pm index 92d1d88ba3..038122a5aa 100644 --- a/lib/Test/More.pm +++ b/lib/Test/More.pm @@ -3,54 +3,35 @@ package Test::More; use 5.004; use strict; -use Carp; -use Test::Utils; +use Test::Builder; -BEGIN { - require Test::Simple; - *TESTOUT = \*Test::Simple::TESTOUT; - *TESTERR = \*Test::Simple::TESTERR; + +# Can't use Carp because it might cause use_ok() to accidentally succeed +# even though the module being used forgot to use Carp. Yes, this +# actually happened. +sub _carp { + my($file, $line) = (caller(1))[1,2]; + warn @_, sprintf " at $file line $line\n"; } + + require Exporter; -use vars qw($VERSION @ISA @EXPORT $TODO); -$VERSION = '0.19'; +use vars qw($VERSION @ISA @EXPORT %EXPORT_TAGS $TODO); +$VERSION = '0.32'; @ISA = qw(Exporter); @EXPORT = qw(ok use_ok require_ok - is isnt like + is isnt like is_deeply skip todo pass fail eq_array eq_hash eq_set - skip $TODO plan can_ok isa_ok ); +my $Test = Test::Builder->new; -sub import { - my($class, $plan, @args) = @_; - - if( defined $plan ) { - if( $plan eq 'skip_all' ) { - $Test::Simple::Skip_All = 1; - my $out = "1..0"; - $out .= " # Skip @args" if @args; - $out .= "\n"; - - my_print *TESTOUT, $out; - exit(0); - } - else { - Test::Simple->import($plan => @args); - } - } - else { - Test::Simple->import; - } - - __PACKAGE__->_export_to_level(1, __PACKAGE__); -} # 5.004's Exporter doesn't have export_to_level. sub _export_to_level @@ -85,6 +66,8 @@ Test::More - yet another framework for writing test scripts isnt($this, $that, $test_name); like($this, qr/that/, $test_name); + is_deeply($complex_structure1, $complex_structure2, $test_name); + SKIP: { skip $why, $how_many unless $have_some_feature; @@ -152,6 +135,54 @@ Your script will declare a skip with the reason why you skipped and exit immediately with a zero (success). See L<Test::Harness> for details. +If you want to control what functions Test::More will export, you +have to use the 'import' option. For example, to import everything +but 'fail', you'd do: + + use Test::More tests => 23, import => ['!fail']; + +Alternatively, you can use the plan() function. Useful for when you +have to calculate the number of tests. + + use Test::More; + plan tests => keys %Stuff * 3; + +or for deciding between running the tests at all: + + use Test::More; + if( $^O eq 'MacOS' ) { + plan skip_all => 'Test irrelevent on MacOS'; + } + else { + plan tests => 42; + } + +=cut + +sub plan { + my(@plan) = @_; + + my $caller = caller; + + $Test->exported_to($caller); + $Test->plan(@plan); + + my @imports = (); + foreach my $idx (0..$#plan) { + if( $plan[$idx] eq 'import' ) { + @imports = @{$plan[$idx+1]}; + last; + } + } + + __PACKAGE__->_export_to_level(1, __PACKAGE__, @imports); +} + +sub import { + my($class) = shift; + goto &plan; +} + =head2 Test names @@ -220,7 +251,10 @@ This is actually Test::Simple's ok() routine. =cut -# We get ok() from Test::Simple's import(). +sub ok ($;$) { + my($test, $name) = @_; + $Test->ok($test, $name); +} =item B<is> @@ -282,27 +316,7 @@ function which is an alias of isnt(). =cut sub is ($$;$) { - my($this, $that, $name) = @_; - - my $test; - { - local $^W = 0; # so is(undef, undef) works quietly. - $test = $this eq $that; - } - my $ok = @_ == 3 ? ok($test, $name) - : ok($test); - - unless( $ok ) { - $this = defined $this ? "'$this'" : 'undef'; - $that = defined $that ? "'$that'" : 'undef'; - my_print *TESTERR, sprintf <<DIAGNOSTIC, $this, $that; -# got: %s -# expected: %s -DIAGNOSTIC - - } - - return $ok; + $Test->is_eq(@_); } sub isnt ($$;$) { @@ -314,15 +328,14 @@ sub isnt ($$;$) { $test = $this ne $that; } - my $ok = @_ == 3 ? ok($test, $name) - : ok($test); + my $ok = $Test->ok($test, $name); unless( $ok ) { $that = defined $that ? "'$that'" : 'undef'; - my_print *TESTERR, sprintf <<DIAGNOSTIC, $that; -# it should not be %s -# but it is. + $Test->diag(sprintf <<DIAGNOSTIC, $that); +it should not be %s +but it is. DIAGNOSTIC } @@ -364,42 +377,7 @@ diagnostics on failure. =cut sub like ($$;$) { - my($this, $regex, $name) = @_; - - my $ok = 0; - if( ref $regex eq 'Regexp' ) { - local $^W = 0; - $ok = @_ == 3 ? ok( $this =~ $regex ? 1 : 0, $name ) - : ok( $this =~ $regex ? 1 : 0 ); - } - # Check if it looks like '/foo/i' - elsif( my($re, $opts) = $regex =~ m{^ /(.*)/ (\w*) $ }sx ) { - local $^W = 0; - $ok = @_ == 3 ? ok( $this =~ /(?$opts)$re/ ? 1 : 0, $name ) - : ok( $this =~ /(?$opts)$re/ ? 1 : 0 ); - } - else { - # Can't use fail() here, the call stack will be fucked. - my $ok = @_ == 3 ? ok(0, $name ) - : ok(0); - - my_print *TESTERR, <<ERR; -# '$regex' doesn't look much like a regex to me. Failing the test. -ERR - - return $ok; - } - - unless( $ok ) { - $this = defined $this ? "'$this'" : 'undef'; - my_print *TESTERR, sprintf <<DIAGNOSTIC, $this; -# %s -# doesn't match '$regex' -DIAGNOSTIC - - } - - return $ok; + $Test->like(@_); } =item B<can_ok> @@ -430,7 +408,7 @@ sub can_ok ($@) { my @nok = (); foreach my $method (@methods) { - my $test = "$class->can('$method')"; + my $test = "'$class'->can('$method')"; eval $test || push @nok, $method; } @@ -438,16 +416,16 @@ sub can_ok ($@) { $name = @methods == 1 ? "$class->can($methods[0])" : "$class->can(...)"; - ok( !@nok, $name ); + my $ok = $Test->ok( !@nok, $name ); - my_print *TESTERR, map "# $class->can('$_') failed\n", @nok; + $Test->diag(map "$class->can('$_') failed\n", @nok); - return !@nok; + return $ok; } =item B<isa_ok> - isa_ok($object, $class); + isa_ok($object, $class, $object_name); Checks to see if the given $object->isa($class). Also checks to make sure the object was defined in the first place. Handy for this sort @@ -463,32 +441,38 @@ where you'd otherwise have to write to safeguard against your test script blowing up. +The diagnostics of this test normally just refer to 'the object'. If +you'd like them to be more specific, you can supply an $object_name +(for example 'Test customer'). + =cut -sub isa_ok ($$) { - my($object, $class) = @_; +sub isa_ok ($$;$) { + my($object, $class, $obj_name) = @_; my $diag; - my $name = "object->isa('$class')"; + $obj_name = 'The object' unless defined $obj_name; + my $name = "$obj_name isa $class"; if( !defined $object ) { - $diag = "The object isn't defined"; + $diag = "$obj_name isn't defined"; } elsif( !ref $object ) { - $diag = "The object isn't a reference"; + $diag = "$obj_name isn't a reference"; } elsif( !$object->isa($class) ) { - $diag = "The object isn't a '$class'"; + $diag = "$obj_name isn't a '$class'"; } + my $ok; if( $diag ) { - ok( 0, $name ); - my_print *TESTERR, "# $diag\n"; - return 0; + $ok = $Test->ok( 0, $name ); + $Test->diag("$diag\n"); } else { - ok( 1, $name ); - return 1; + $ok = $Test->ok( 1, $name ); } + + return $ok; } @@ -510,15 +494,11 @@ Use these very, very, very sparingly. =cut sub pass (;$) { - my($name) = @_; - return @_ == 1 ? ok(1, $name) - : ok(1); + $Test->ok(1, @_); } sub fail (;$) { - my($name) = @_; - return @_ == 1 ? ok(0, $name) - : ok(0); + $Test->ok(0, @_); } =back @@ -564,13 +544,13 @@ require $module; $module->import(\@imports); USE - my $ok = ok( !$@, "use $module;" ); + my $ok = $Test->ok( !$@, "use $module;" ); unless( $ok ) { chomp $@; - my_print *TESTERR, <<DIAGNOSTIC; -# Tried to use '$module'. -# Error: $@ + $Test->diag(<<DIAGNOSTIC); +Tried to use '$module'. +Error: $@ DIAGNOSTIC } @@ -596,11 +576,11 @@ package $pack; require $module; REQUIRE - my $ok = ok( !$@, "require $module;" ); + my $ok = $Test->ok( !$@, "require $module;" ); unless( $ok ) { chomp $@; - my_print *TESTERR, <<DIAGNOSTIC; + $Test->diag(<<DIAGNOSTIC); # Tried to require '$module'. # Error: $@ DIAGNOSTIC @@ -658,7 +638,8 @@ If pigs cannot fly, the whole block of tests will be skipped completely. Test::More will output special ok's which Test::Harness interprets as skipped tests. Its important to include $how_many tests are in the block so the total number of tests comes out right (unless -you're using C<no_plan>). +you're using C<no_plan>, in which case you can leave $how_many off if +you like). You'll typically use this when a feature is missing, like an optional module is not installed or the operating system doesn't have some @@ -673,15 +654,16 @@ See L</Why are skip and todo so weird?> #'# sub skip { my($why, $how_many) = @_; - unless( $how_many >= 1 ) { + + unless( defined $how_many ) { # $how_many can only be avoided when no_plan is in use. - carp "skip() needs to know \$how_many tests are in the block" - if $Test::Simple::Planned_Tests; + _carp "skip() needs to know \$how_many tests are in the block" + unless $Test::Builder::No_Plan; $how_many = 1; } for( 1..$how_many ) { - Test::Simple::_skipped($why); + $Test->skip($why); } local $^W = 0; @@ -738,6 +720,83 @@ quite sure what will happen with filehandles. =over 4 +=item B<is_deeply> + + is_deeply( $this, $that, $test_name ); + +Similar to is(), except that if $this and $that are hash or array +references, it does a deep comparison walking each data structure to +see if they are equivalent. If the two structures are different, it +will display the place where they start differing. + +B<NOTE> Display of scalar refs is not quite 100% + +=cut + +use vars qw(@Data_Stack); +my $DNE = bless [], 'Does::Not::Exist'; +sub is_deeply { + my($this, $that, $name) = @_; + + my $ok; + if( !ref $this || !ref $that ) { + $ok = $Test->is_eq($this, $that, $name); + } + else { + local @Data_Stack = (); + if( _deep_check($this, $that) ) { + $ok = $Test->ok(1, $name); + } + else { + $ok = $Test->ok(0, $name); + $ok = $Test->diag(_format_stack(@Data_Stack)); + } + } + + return $ok; +} + +sub _format_stack { + my(@Stack) = @_; + + my $var = '$FOO'; + my $did_arrow = 0; + foreach my $entry (@Stack) { + my $type = $entry->{type} || ''; + my $idx = $entry->{'idx'}; + if( $type eq 'HASH' ) { + $var .= "->" unless $did_arrow++; + $var .= "{$idx}"; + } + elsif( $type eq 'ARRAY' ) { + $var .= "->" unless $did_arrow++; + $var .= "[$idx]"; + } + elsif( $type eq 'REF' ) { + $var = "\${$var}"; + } + } + + my @vals = @{$Stack[-1]{vals}}[0,1]; + my @vars = (); + ($vars[0] = $var) =~ s/\$FOO/ \$got/; + ($vars[1] = $var) =~ s/\$FOO/\$expected/; + + my $out = "Structures begin differing at:\n"; + foreach my $idx (0..$#vals) { + my $val = $vals[$idx]; + $vals[$idx] = !defined $val ? 'undef' : + $val eq $DNE ? "Does not exist" + : "'$val'"; + } + + $out .= "$vars[0] = $vals[0]\n"; + $out .= "$vars[1] = $vals[1]\n"; + + return $out; +} + + =item B<eq_array> eq_array(\@this, \@that); @@ -750,13 +809,18 @@ multi-level structures are handled correctly. #'# sub eq_array { my($a1, $a2) = @_; - return 0 unless @$a1 == @$a2; return 1 if $a1 eq $a2; my $ok = 1; - for (0..$#{$a1}) { - my($e1,$e2) = ($a1->[$_], $a2->[$_]); + my $max = $#$a1 > $#$a2 ? $#$a1 : $#$a2; + for (0..$max) { + my $e1 = $_ > $#$a1 ? $DNE : $a1->[$_]; + my $e2 = $_ > $#$a2 ? $DNE : $a2->[$_]; + + push @Data_Stack, { type => 'ARRAY', idx => $_, vals => [$e1, $e2] }; $ok = _deep_check($e1,$e2); + pop @Data_Stack if $ok; + last unless $ok; } return $ok; @@ -785,7 +849,21 @@ sub _deep_check { { $ok = eq_hash($e1, $e2); } + elsif( UNIVERSAL::isa($e1, 'REF') and + UNIVERSAL::isa($e2, 'REF') ) + { + push @Data_Stack, { type => 'REF', vals => [$e1, $e2] }; + $ok = _deep_check($$e1, $$e2); + pop @Data_Stack if $ok; + } + elsif( UNIVERSAL::isa($e1, 'SCALAR') and + UNIVERSAL::isa($e2, 'SCALAR') ) + { + push @Data_Stack, { type => 'REF', vals => [$e1, $e2] }; + $ok = _deep_check($$e1, $$e2); + } else { + push @Data_Stack, { vals => [$e1, $e2] }; $ok = 0; } } @@ -806,13 +884,18 @@ is a deep check. sub eq_hash { my($a1, $a2) = @_; - return 0 unless keys %$a1 == keys %$a2; return 1 if $a1 eq $a2; my $ok = 1; - foreach my $k (keys %$a1) { - my($e1, $e2) = ($a1->{$k}, $a2->{$k}); + my $bigger = keys %$a1 > keys %$a2 ? $a1 : $a2; + foreach my $k (keys %$bigger) { + my $e1 = exists $a1->{$k} ? $a1->{$k} : $DNE; + my $e2 = exists $a2->{$k} ? $a2->{$k} : $DNE; + + push @Data_Stack, { type => 'HASH', idx => $k, vals => [$e1, $e2] }; $ok = _deep_check($e1, $e2); + pop @Data_Stack if $ok; + last unless $ok; } diff --git a/lib/Test/Simple.pm b/lib/Test/Simple.pm index f72f393d48..b314ed5b6c 100644 --- a/lib/Test/Simple.pm +++ b/lib/Test/Simple.pm @@ -3,86 +3,23 @@ package Test::Simple; use 5.004; use strict 'vars'; -use Test::Utils; - use vars qw($VERSION); +$VERSION = '0.32'; -$VERSION = '0.19'; - -my(@Test_Results) = (); -my($Num_Tests, $Planned_Tests, $Test_Died) = (0,0,0); -my($Have_Plan) = 0; -my $IsVMS = $^O eq 'VMS'; +use Test::Builder; +my $Test = Test::Builder->new; - -# I'd like to have Test::Simple interfere with the program being -# tested as little as possible. This includes using Exporter or -# anything else (including strict). sub import { - # preserve caller() - if( @_ > 1 ) { - if( $_[1] eq 'no_plan' ) { - goto &no_plan; - } - else { - goto &plan - } - } -} - -sub plan { - my($class, %config) = @_; - - if( !exists $config{tests} ) { - die "You have to tell $class how many tests you plan to run.\n". - " use $class tests => 42; for example.\n"; - } - elsif( !defined $config{tests} ) { - die "Got an undefined number of tests. Looks like you tried to tell ". - "$class how many tests you plan to run but made a mistake.\n"; - } - elsif( !$config{tests} ) { - die "You told $class you plan to run 0 tests! You've got to run ". - "something.\n"; - } - else { - $Planned_Tests = $config{tests}; - } - - $Have_Plan = 1; - - my_print *TESTOUT, "1..$Planned_Tests\n"; - - no strict 'refs'; - my($caller) = caller; + my $self = shift; + my $caller = caller; *{$caller.'::ok'} = \&ok; - -} - -sub no_plan { - $Have_Plan = 1; - - my($caller) = caller; - no strict 'refs'; - *{$caller.'::ok'} = \&ok; + $Test->exported_to($caller); + $Test->plan(@_); } -unless( $^C ) { - $| = 1; - open(*TESTOUT, ">&STDOUT") or _whoa(1, "Can't dup STDOUT!"); - open(*TESTERR, ">&STDOUT") or _whoa(1, "Can't dup STDOUT!"); - { - my $orig_fh = select TESTOUT; - $| = 1; - select TESTERR; - $| = 1; - select $orig_fh; - } -} - =head1 NAME Test::Simple - Basic utilities for writing tests. @@ -147,82 +84,7 @@ will do what you mean (fail if stuff is empty) =cut sub ok ($;$) { - my($test, $name) = @_; - - unless( $Have_Plan ) { - die "You tried to use ok() without a plan! Gotta have a plan.\n". - " use Test::Simple tests => 23; for example.\n"; - } - - $Num_Tests++; - - my_print *TESTERR, <<ERR if defined $name and $name =~ /^[\d\s]+$/; -You named your test '$name'. You shouldn't use numbers for your test names. -Very confusing. -ERR - - - my($pack, $file, $line) = caller; - # temporary special case for Test::More & Parrot::Test's calls. - if( $pack eq 'Test::More' || $pack eq 'Parrot::Test' ) { - ($pack, $file, $line) = caller(1); - } - - my($is_todo) = ${$pack.'::TODO'} ? 1 : 0; - - # We must print this all in one shot or else it will break on VMS - my $msg; - unless( $test ) { - $msg .= "not "; - $Test_Results[$Num_Tests-1] = $is_todo ? 1 : 0; - } - else { - $Test_Results[$Num_Tests-1] = 1; - } - $msg .= "ok $Num_Tests"; - - if( defined $name ) { - $name =~ s|#|\\#|g; # # in a name can confuse Test::Harness. - $msg .= " - $name"; - } - if( $is_todo ) { - my $what_todo = ${$pack.'::TODO'}; - $msg .= " # TODO $what_todo"; - } - $msg .= "\n"; - - my_print *TESTOUT, $msg; - - #'# - unless( $test ) { - my $msg = $is_todo ? "Failed (TODO)" : "Failed"; - my_print *TESTERR, "# $msg test ($file at line $line)\n"; - } - - return $test ? 1 : 0; -} - - -sub _skipped { - my($why) = shift; - - unless( $Have_Plan ) { - die "You tried to use ok() without a plan! Gotta have a plan.\n". - " use Test::Simple tests => 23; for example.\n"; - } - - $Num_Tests++; - - # XXX Set this to "Skip" instead? - $Test_Results[$Num_Tests-1] = 1; - - # We must print this all in one shot or else it will break on VMS - my $msg; - $msg .= "ok $Num_Tests # skip $why\n"; - - my_print *TESTOUT, $msg; - - return 1; + $Test->ok(@_); } @@ -249,142 +111,6 @@ So the exit codes are... If you fail more than 254 tests, it will be reported as 254. -=begin _private - -=over 4 - -=item B<_sanity_check> - - _sanity_check(); - -Runs a bunch of end of test sanity checks to make sure reality came -through ok. If anything is wrong it will die with a fairly friendly -error message. - -=cut - -#'# -sub _sanity_check { - _whoa($Num_Tests < 0, 'Says here you ran a negative number of tests!'); - _whoa(!$Have_Plan and $Num_Tests, - 'Somehow your tests ran without a plan!'); - _whoa($Num_Tests != @Test_Results, - 'Somehow you got a different number of results than tests ran!'); -} - -=item B<_whoa> - - _whoa($check, $description); - -A sanity check, similar to assert(). If the $check is true, something -has gone horribly wrong. It will die with the given $description and -a note to contact the author. - -=cut - -sub _whoa { - my($check, $desc) = @_; - if( $check ) { - die <<WHOA; -WHOA! $desc -This should never happen! Please contact the author immediately! -WHOA - } -} - -=item B<_my_exit> - - _my_exit($exit_num); - -Perl seems to have some trouble with exiting inside an END block. 5.005_03 -and 5.6.1 both seem to do odd things. Instead, this function edits $? -directly. It should ONLY be called from inside an END block. It -doesn't actually exit, that's your job. - -=cut - -sub _my_exit { - $? = $_[0]; - - return 1; -} - - -=back - -=end _private - -=cut - -$SIG{__DIE__} = sub { - # We don't want to muck with death in an eval, but $^S isn't - # totally reliable. 5.005_03 and 5.6.1 both do the wrong thing - # with it. Instead, we use caller. This also means it runs under - # 5.004! - my $in_eval = 0; - for( my $stack = 1; my $sub = (caller($stack))[3]; $stack++ ) { - $in_eval = 1 if $sub =~ /^\(eval\)/; - } - $Test_Died = 1 unless $in_eval; -}; - -END { - _sanity_check(); - - # Bailout if import() was never called. This is so - # "require Test::Simple" doesn't puke. - do{ _my_exit(0) && return } if !$Have_Plan and !$Num_Tests; - - # Figure out if we passed or failed and print helpful messages. - if( $Num_Tests ) { - # The plan? We have no plan. - unless( $Planned_Tests ) { - my_print *TESTOUT, "1..$Num_Tests\n"; - $Planned_Tests = $Num_Tests; - } - - my $num_failed = grep !$_, @Test_Results[0..$Planned_Tests-1]; - $num_failed += abs($Planned_Tests - @Test_Results); - - if( $Num_Tests < $Planned_Tests ) { - my_print *TESTERR, <<"FAIL"; -# Looks like you planned $Planned_Tests tests but only ran $Num_Tests. -FAIL - } - elsif( $Num_Tests > $Planned_Tests ) { - my $num_extra = $Num_Tests - $Planned_Tests; - my_print *TESTERR, <<"FAIL"; -# Looks like you planned $Planned_Tests tests but ran $num_extra extra. -FAIL - } - elsif ( $num_failed ) { - my_print *TESTERR, <<"FAIL"; -# Looks like you failed $num_failed tests of $Planned_Tests. -FAIL - } - - if( $Test_Died ) { - my_print *TESTERR, <<"FAIL"; -# Looks like your test died just after $Num_Tests. -FAIL - - _my_exit( 255 ) && return; - } - - _my_exit( $num_failed <= 254 ? $num_failed : 254 ) && return; - } - elsif ( $Test::Simple::Skip_All ) { - _my_exit( 0 ) && return; - } - else { - my_print *TESTERR, "# No tests run!\n"; - _my_exit( 255 ) && return; - } -} - - -=pod - This module is by no means trying to be a complete testing system. Its just to get you started. Once you're off the ground its recommended you look at L<Test::More>. diff --git a/lib/Test/Simple/Changes b/lib/Test/Simple/Changes index fd9e3f628d..2a6ee40967 100644 --- a/lib/Test/Simple/Changes +++ b/lib/Test/Simple/Changes @@ -1,5 +1,30 @@ Revision history for Perl extension Test::Simple +0.32 Tue Oct 16 16:52:02 EDT 2001 + * Finally added a seperate plan() function + * Adding a name field to isa_ok() + (Requested by Dave Rolsky) + - Test::More was using Carp.pm, causing the occasional false positive. + (Reported by Tatsuhiko Miyagawa) + +0.31 Mon Oct 8 19:24:53 EDT 2001 + * Added an import option to Test::More + * Added no_ending and no_header options to Test::Builder + (Thanks to Dave Rolsky for giving this a swift kick in the ass) + * Added is_deeply(). Display of scalar refs not quite 100% + (Thanks to Stas Bekman for Apache::TestUtil idea thievery) + - Fixed a minor warning with skip() + (Thanks to Wolfgang Weisselberg for finding this one) + +0.30 Thu Sep 27 22:10:04 EDT 2001 + * Added Test::Builder + * Diagnostics are back to using STDERR *unless* it's from a todo + test. Those go to STDOUT. + - Fixed it so nothing is printed if a test is run with a -c flag. + Handy when a test is being deparsed with B::Deparse. + +0.20 *UNRELEASED* + 0.19 Tue Sep 18 17:48:32 EDT 2001 * Test::Simple and Test::More no longer print their diagnostics to STDERR. It instead goes to STDOUT. diff --git a/lib/Test/Simple/t/Builder.t b/lib/Test/Simple/t/Builder.t new file mode 100644 index 0000000000..64dfbea7aa --- /dev/null +++ b/lib/Test/Simple/t/Builder.t @@ -0,0 +1,21 @@ +#!/usr/bin/perl -w + +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; +} + +use Test::Builder; +my $Test = Test::Builder->new; + +$Test->plan( tests => 4 ); + +my $default_lvl = $Test->level; +$Test->level(0); + +$Test->ok( 1, 'compiled and new()' ); +$Test->ok( $default_lvl == 1, 'level()' ); + +$Test->is_eq('foo', 'foo', 'is_eq'); +$Test->is_num('23.0', '23', 'is_num'); + diff --git a/lib/Test/Simple/t/More.t b/lib/Test/Simple/t/More.t index 7dc679649c..ee23f6fbae 100644 --- a/lib/Test/Simple/t/More.t +++ b/lib/Test/Simple/t/More.t @@ -1,4 +1,11 @@ -use Test::More tests => 22; +#!perl -w + +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; +} + +use Test::More tests => 24; use_ok('Text::Soundex'); require_ok('Test::More'); @@ -46,6 +53,7 @@ my @complex_array2 = ( [qw(498 10 29)], ); +is_deeply( \@complex_array1, \@complex_array2, 'is_deeply with arrays' ); ok( eq_array(\@complex_array1, \@complex_array2), 'eq_array with complicated arrays' ); ok( eq_set(\@complex_array1, \@complex_array2), @@ -70,9 +78,8 @@ my %hash2 = ( foo => 23, har => { foo => 24, bar => 42 }, ); - -ok( eq_hash(\%hash1, \%hash2), - 'eq_hash with complicated hashes'); +is_deeply( \%hash1, \%hash2, 'is_deeply with complicated hashes' ); +ok( eq_hash(\%hash1, \%hash2), 'eq_hash with complicated hashes'); %hash1 = ( foo => 23, bar => [qw(this that whatever)], diff --git a/lib/Test/Simple/t/exit.t b/lib/Test/Simple/t/exit.t index 855533c175..439ccf0ee1 100644 --- a/lib/Test/Simple/t/exit.t +++ b/lib/Test/Simple/t/exit.t @@ -6,7 +6,10 @@ BEGIN { # Can't use Test.pm, that's a 5.005 thing. package My::Test; -use File::Spec; +unless( eval { require File::Spec } ) { + print "1..0 # Skip Need File::Spec to run this test\n"; + exit(0); +} my $test_num = 1; # Utility testing functions. diff --git a/lib/Test/Simple/t/extra.t b/lib/Test/Simple/t/extra.t index e01240abed..acb23fd055 100644 --- a/lib/Test/Simple/t/extra.t +++ b/lib/Test/Simple/t/extra.t @@ -1,3 +1,5 @@ +#!perl -w + BEGIN { chdir 't' if -d 't'; @INC = '../lib'; @@ -26,7 +28,7 @@ package main; require Test::Simple; -push @INC, '../t/lib'; +push @INC, '../t/lib/'; require Test::Simple::Catch; my($out, $err) = Test::Simple::Catch::caught(); @@ -49,7 +51,11 @@ ok 4 - Car not ok 5 - Sar OUT - My::Test::ok($$err =~ /Looks like you planned 3 tests but ran 2 extra/); + My::Test::ok($$err eq <<ERR); +# Failed test ($0 at line 31) +# Failed test ($0 at line 34) +# Looks like you planned 3 tests but ran 2 extra. +ERR exit 0; } diff --git a/lib/Test/Simple/t/fail-like.t b/lib/Test/Simple/t/fail-like.t index 40a70e68e5..0821713574 100644 --- a/lib/Test/Simple/t/fail-like.t +++ b/lib/Test/Simple/t/fail-like.t @@ -11,13 +11,18 @@ BEGIN { # There was a bug with like() involving a qr// not failing properly. # This tests against that. -use strict; - BEGIN { chdir 't' if -d 't'; @INC = '../lib'; } +use strict; +use lib '../t/lib'; + +require Test::Simple::Catch; +my($out, $err) = Test::Simple::Catch::caught(); + + # Can't use Test.pm, that's a 5.005 thing. package My::Test; @@ -40,11 +45,6 @@ sub ok ($;$) { package main; require Test::More; - -push @INC, '../t/lib'; -require Test::Simple::Catch::More; -my($out, $err) = Test::Simple::Catch::More::caught(); - Test::More->import(tests => 1); eval q{ like( "foo", qr/that/, 'is foo like that' ); }; diff --git a/lib/Test/Simple/t/fail-more.t b/lib/Test/Simple/t/fail-more.t index c8b0b59793..6c61762c4c 100644 --- a/lib/Test/Simple/t/fail-more.t +++ b/lib/Test/Simple/t/fail-more.t @@ -1,10 +1,17 @@ -use strict; +#!perl -w BEGIN { chdir 't' if -d 't'; @INC = '../lib'; } +use strict; +use lib '../t/lib'; + +require Test::Simple::Catch; +my($out, $err) = Test::Simple::Catch::caught(); + + # Can't use Test.pm, that's a 5.005 thing. package My::Test; @@ -29,15 +36,10 @@ sub ok ($;$) { package main; require Test::More; - -push @INC, '../t/lib'; -require Test::Simple::Catch::More; -my($out, $err) = Test::Simple::Catch::More::caught(); - -Test::More->import(tests => 10); +Test::More->import(tests => 12); # Preserve the line numbers. -#line 31 +#line 38 ok( 0, 'failing' ); is( "foo", "bar", 'foo is bar?'); isnt("foo", "foo", 'foo isnt foo?' ); @@ -49,13 +51,15 @@ fail('fail()'); can_ok('Mooble::Hooble::Yooble', qw(this that)); isa_ok(bless([], "Foo"), "Wibble"); +isa_ok(42, "Wibble", "My Wibble"); +isa_ok(undef, "Wibble", "Another Wibble"); use_ok('Hooble::mooble::yooble'); require_ok('ALL::YOUR::BASE::ARE::BELONG::TO::US::wibble'); END { My::Test::ok($$out eq <<OUT, 'failing output'); -1..10 +1..12 not ok 1 - failing not ok 2 - foo is bar? not ok 3 - foo isnt foo? @@ -63,42 +67,48 @@ not ok 4 - foo isn't foo? not ok 5 - is foo like that not ok 6 - fail() not ok 7 - Mooble::Hooble::Yooble->can(...) -not ok 8 - object->isa('Wibble') -not ok 9 - use Hooble::mooble::yooble; -not ok 10 - require ALL::YOUR::BASE::ARE::BELONG::TO::US::wibble; +not ok 8 - The object isa Wibble +not ok 9 - My Wibble isa Wibble +not ok 10 - Another Wibble isa Wibble +not ok 11 - use Hooble::mooble::yooble; +not ok 12 - require ALL::YOUR::BASE::ARE::BELONG::TO::US::wibble; OUT my $err_re = <<ERR; -# Failed test ($0 at line 31) -# Failed test ($0 at line 32) +# Failed test ($0 at line 38) +# Failed test ($0 at line 39) # got: 'foo' # expected: 'bar' -# Failed test ($0 at line 33) +# Failed test ($0 at line 40) # it should not be 'foo' # but it is. -# Failed test ($0 at line 34) +# Failed test ($0 at line 41) # it should not be 'foo' # but it is. -# Failed test ($0 at line 36) +# Failed test ($0 at line 43) # 'foo' # doesn't match '/that/' -# Failed test ($0 at line 38) -# Failed test ($0 at line 40) +# Failed test ($0 at line 45) +# Failed test ($0 at line 47) # Mooble::Hooble::Yooble->can('this') failed # Mooble::Hooble::Yooble->can('that') failed -# Failed test ($0 at line 41) +# Failed test ($0 at line 48) # The object isn't a 'Wibble' +# Failed test ($0 at line 49) +# My Wibble isn't a reference +# Failed test ($0 at line 50) +# Another Wibble isn't defined ERR my $filename = quotemeta $0; my $more_err_re = <<ERR; -# Failed test \\($filename at line 43\\) +# Failed test \\($filename at line 52\\) # Tried to use 'Hooble::mooble::yooble'. # Error: Can't locate Hooble.* in \\\@INC .* -# Failed test \\($filename at line 44\\) +# Failed test \\($filename at line 53\\) # Tried to require 'ALL::YOUR::BASE::ARE::BELONG::TO::US::wibble'. # Error: Can't locate ALL.* in \\\@INC .* -# Looks like you failed 10 tests of 10. +# Looks like you failed 12 tests of 12. ERR unless( My::Test::ok($$err =~ /^\Q$err_re\E$more_err_re$/, diff --git a/lib/Test/Simple/t/fail.t b/lib/Test/Simple/t/fail.t index d4be3f021e..9c8f0bde8c 100644 --- a/lib/Test/Simple/t/fail.t +++ b/lib/Test/Simple/t/fail.t @@ -1,10 +1,17 @@ -use strict; +#!perl -w BEGIN { chdir 't' if -d 't'; @INC = '../lib'; } +use strict; +use lib qw(../t/lib); + +require Test::Simple::Catch; +my($out, $err) = Test::Simple::Catch::caught(); + + # Can't use Test.pm, that's a 5.005 thing. package My::Test; @@ -27,14 +34,9 @@ sub ok ($;$) { package main; require Test::Simple; - -push @INC, '../t/lib'; -require Test::Simple::Catch; -my($out, $err) = Test::Simple::Catch::caught(); - Test::Simple->import(tests => 5); -#line 32 +#line 35 ok( 1, 'passing' ); ok( 2, 'passing still' ); ok( 3, 'still passing' ); @@ -52,7 +54,11 @@ not ok 4 - oh no! not ok 5 - damnit OUT - My::Test::ok($$err =~ /Looks like you failed 2 tests of 5/); + My::Test::ok($$err eq <<ERR); +# Failed test ($0 at line 38) +# Failed test ($0 at line 39) +# Looks like you failed 2 tests of 5. +ERR # Prevent Test::Simple from exiting with non zero exit 0; diff --git a/lib/Test/Simple/t/filehandles.t b/lib/Test/Simple/t/filehandles.t new file mode 100644 index 0000000000..3b3c553dc7 --- /dev/null +++ b/lib/Test/Simple/t/filehandles.t @@ -0,0 +1,14 @@ +#!perl -w + +use Test::More tests => 1; + +tie *STDOUT, "Dev::Null" or die $!; + +print "not ok 1\n"; # this should not print. +pass 'STDOUT can be mucked with'; + + +package Dev::Null; + +sub TIEHANDLE { bless {} } +sub PRINT { 1 } diff --git a/lib/Test/Simple/t/import.t b/lib/Test/Simple/t/import.t new file mode 100644 index 0000000000..bf0b5a9c58 --- /dev/null +++ b/lib/Test/Simple/t/import.t @@ -0,0 +1,9 @@ +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; +} + +use Test::More tests => 2, import => [qw(!fail)]; + +can_ok(__PACKAGE__, qw(ok pass like isa_ok)); +ok( !__PACKAGE__->can('fail'), 'fail() not exported' ); diff --git a/lib/Test/Simple/t/is_deeply.t b/lib/Test/Simple/t/is_deeply.t new file mode 100644 index 0000000000..ea0c15092a --- /dev/null +++ b/lib/Test/Simple/t/is_deeply.t @@ -0,0 +1,211 @@ +#!perl -w + +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; +} + +use strict; +use lib qw(../t/lib); + +use Test::Builder; +require Test::Simple::Catch; +my($out, $err) = Test::Simple::Catch::caught(); +Test::Builder->new->no_header(1); +Test::Builder->new->no_ending(1); + +# Can't use Test.pm, that's a 5.005 thing. +package main; + +print "1..22\n"; + +my $test_num = 1; +# Utility testing functions. +sub is ($$;$) { + my($this, $that, $name) = @_; + my $test = $$this eq $that; + my $ok = ''; + $ok .= "not " unless $test; + $ok .= "ok $test_num"; + $ok .= " - $name" if defined $name; + $ok .= "\n"; + print $ok; + + unless( $test ) { + print "# got \n$$this"; + print "# expected \n$that"; + } + $test_num++; + + $$this = ''; + + return $test; +} + +sub like ($$;$) { + my($this, $regex, $name) = @_; + + my $test = $$this =~ /$regex/; + + my $ok = ''; + $ok .= "not " unless $test; + $ok .= "ok $test_num"; + $ok .= " - $name" if defined $name; + $ok .= "\n"; + print $ok; + + unless( $test ) { + print "# got \n$$this"; + print "# expected \n$regex"; + } + $test_num++; + + $$this = ''; + + + return $test; +} + + +require Test::More; +Test::More->import(tests => 11, import => ['is_deeply']); + +my $Filename = quotemeta $0; + +#line 68 +is_deeply('foo', 'bar', 'plain strings'); +is( $out, "not ok 1 - plain strings\n", 'plain strings' ); +is( $err, <<ERR, ' right diagnostic' ); +# Failed test ($0 at line 68) +# got: 'foo' +# expected: 'bar' +ERR + + +#line 78 +is_deeply({}, [], 'different types'); +is( $out, "not ok 2 - different types\n", 'different types' ); +like( $err, <<ERR, ' right diagnostic' ); +# Failed test \\($Filename at line 78\\) +# Structures begin differing at: +# \\\$got = 'HASH\\(0x[0-9a-f]+\\)' +# \\\$expected = 'ARRAY\\(0x[0-9a-f]+\\)' +ERR + +#line 88 +is_deeply({ this => 42 }, { this => 43 }, 'hashes with different values'); +is( $out, "not ok 3 - hashes with different values\n", + 'hashes with different values' ); +is( $err, <<ERR, ' right diagnostic' ); +# Failed test ($0 at line 88) +# Structures begin differing at: +# \$got->{this} = '42' +# \$expected->{this} = '43' +ERR + +#line 99 +is_deeply({ that => 42 }, { this => 42 }, 'hashes with different keys'); +is( $out, "not ok 4 - hashes with different keys\n", + 'hashes with different keys' ); +is( $err, <<ERR, ' right diagnostic' ); +# Failed test ($0 at line 99) +# Structures begin differing at: +# \$got->{this} = Does not exist +# \$expected->{this} = '42' +ERR + +#line 110 +is_deeply([1..9], [1..10], 'arrays of different length'); +is( $out, "not ok 5 - arrays of different length\n", + 'arrays of different length' ); +is( $err, <<ERR, ' right diagnostic' ); +# Failed test ($0 at line 110) +# Structures begin differing at: +# \$got->[9] = Does not exist +# \$expected->[9] = '10' +ERR + +#line 121 +is_deeply([undef, undef], [undef], 'arrays of undefs' ); +is( $out, "not ok 6 - arrays of undefs\n", 'arrays of undefs' ); +is( $err, <<ERR, ' right diagnostic' ); +# Failed test ($0 at line 121) +# Structures begin differing at: +# \$got->[1] = undef +# \$expected->[1] = Does not exist +ERR + +#line 131 +is_deeply({ foo => undef }, {}, 'hashes of undefs', 'hashes of undefs' ); +is( $out, "not ok 7 - hashes of undefs\n", 'hashes of undefs' ); +is( $err, <<ERR, ' right diagnostic' ); +# Failed test ($0 at line 131) +# Structures begin differing at: +# \$got->{foo} = undef +# \$expected->{foo} = Does not exist +ERR + +#line 141 +is_deeply(\42, \23, 'scalar refs'); +is( $out, "not ok 8 - scalar refs\n", 'scalar refs' ); +is( $err, <<ERR, ' right diagnostic' ); +# Failed test ($0 at line 141) +# Structures begin differing at: +# \${ \$got} = '42' +# \${\$expected} = '23' +ERR + +#line 151 +is_deeply([], \23, 'mixed scalar and array refs'); +is( $out, "not ok 9 - mixed scalar and array refs\n", + 'mixed scalar and array refs' ); +like( $err, <<ERR, ' right diagnostic' ); +# Failed test \\($Filename at line 151\\) +# Structures begin differing at: +# \\\$got = 'ARRAY\\(0x[0-9a-f]+\\)' +# \\\$expected = 'SCALAR\\(0x[0-9a-f]+\\)' +ERR + + +my($a1, $a2, $a3); +$a1 = \$a2; $a2 = \$a3; +$a3 = 42; + +my($b1, $b2, $b3); +$b1 = \$b2; $b2 = \$b3; +$b3 = 23; + +#line 173 +is_deeply($a1, $b1, 'deep scalar refs'); +is( $out, "not ok 10 - deep scalar refs\n", 'deep scalar refs' ); +is( $err, <<ERR, ' right diagnostic' ); +# Failed test ($0 at line 173) +# Structures begin differing at: +# \${\${ \$got}} = '42' +# \${\${\$expected}} = '23' +ERR + +# I don't know how to properly display this structure. +# $a2 = { foo => \$a3 }; +# $b2 = { foo => \$b3 }; +# is_deeply([$a1], [$b1], 'deep mixed scalar refs'); + +my $foo = { + this => [1..10], + that => { up => "down", left => "right" }, + }; + +my $bar = { + this => [1..10], + that => { up => "down", left => "right", foo => 42 }, + }; + +#line 198 +is_deeply( $foo, $bar, 'deep structures' ); +is( $out, "not ok 11 - deep structures\n", 'deep structures' ); +is( $err, <<ERR, ' right diagnostic' ); +# Failed test ($0 at line 198) +# Structures begin differing at: +# \$got->{that}{foo} = Does not exist +# \$expected->{that}{foo} = '42' +ERR diff --git a/lib/Test/Simple/t/missing.t b/lib/Test/Simple/t/missing.t index 21235a9ee8..9030329cbf 100644 --- a/lib/Test/Simple/t/missing.t +++ b/lib/Test/Simple/t/missing.t @@ -1,10 +1,9 @@ -# Can't use Test.pm, that's a 5.005 thing. - BEGIN { chdir 't' if -d 't'; @INC = '../lib'; } +# Can't use Test.pm, that's a 5.005 thing. package My::Test; print "1..2\n"; @@ -44,7 +43,10 @@ ok 1 - Foo not ok 2 - Bar OUT - My::Test::ok($$err =~ /Looks like you planned 5 tests but only ran 2/); + My::Test::ok($$err eq <<ERR); +# Failed test ($0 at line 31) +# Looks like you planned 5 tests but only ran 2. +ERR exit 0; } diff --git a/lib/Test/Simple/t/no_ending.t b/lib/Test/Simple/t/no_ending.t new file mode 100644 index 0000000000..c8bd396113 --- /dev/null +++ b/lib/Test/Simple/t/no_ending.t @@ -0,0 +1,19 @@ +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; +} + +use Test::Builder; + +BEGIN { + my $t = Test::Builder->new; + $t->no_ending(1); +} + +use Test::More tests => 3; + +# Normally, Test::More would yell that we ran too few tests, but we +# supressed the ending diagnostics. +pass; +print "ok 2\n"; +print "ok 3\n"; diff --git a/lib/Test/Simple/t/no_header.t b/lib/Test/Simple/t/no_header.t new file mode 100644 index 0000000000..b0a8d491f2 --- /dev/null +++ b/lib/Test/Simple/t/no_header.t @@ -0,0 +1,19 @@ +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; +} + +# STDOUT must be unbuffered else our prints might come out after +# Test::More's. +$| = 1; + +use Test::Builder; + +BEGIN { + Test::Builder->new->no_header(1); +} + +use Test::More tests => 1; + +print "1..1\n"; +pass; diff --git a/lib/Test/Simple/t/no_plan.t b/lib/Test/Simple/t/no_plan.t index 94d75cb8ba..beca5a6ffa 100644 --- a/lib/Test/Simple/t/no_plan.t +++ b/lib/Test/Simple/t/no_plan.t @@ -1,10 +1,9 @@ -# Can't use Test.pm, that's a 5.005 thing. - BEGIN { chdir 't' if -d 't'; @INC = '../lib'; } +# Can't use Test.pm, that's a 5.005 thing. package My::Test; print "1..12\n"; @@ -53,12 +52,12 @@ eval { My::Test::ok($$out eq ''); My::Test::ok($$err eq ''); -My::Test::ok($@ =~ /You told Test::Simple you plan to run 0 tests!/); +My::Test::ok($@ =~ /You said to run 0 tests!/); eval { Test::Simple::ok(1); }; -My::Test::ok( $@ =~ /You tried to use ok\(\) without a plan!/); +My::Test::ok( $@ =~ /You tried to run a test without a plan!/); END { diff --git a/lib/Test/Simple/t/output.t b/lib/Test/Simple/t/output.t new file mode 100644 index 0000000000..ef89a0705b --- /dev/null +++ b/lib/Test/Simple/t/output.t @@ -0,0 +1,54 @@ +#!perl -w + +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; +} + +# Can't use Test.pm, that's a 5.005 thing. +print "1..3\n"; + +my $test_num = 1; +# Utility testing functions. +sub ok ($;$) { + my($test, $name) = @_; + my $ok = ''; + $ok .= "not " unless $test; + $ok .= "ok $test_num"; + $ok .= " - $name" if defined $name; + $ok .= "\n"; + print $ok; + $test_num++; +} + +use Test::Builder; +my $Test = Test::Builder->new(); + +my $result; +my $out = $Test->output('foo'); + +ok( defined $out ); + +print $out "hi!\n"; +close *$out; + +undef $out; +open(IN, 'foo') or die $!; +chomp(my $line = <IN>); + +ok($line eq 'hi!'); + +open(FOO, ">>foo") or die $!; +$out = $Test->output(\*FOO); +$old = select *$out; +print "Hello!\n"; +close *$out; +undef $out; +select $old; +open(IN, 'foo') or die $!; +my @lines = <IN>; +close IN; + +ok($lines[1] =~ /Hello!/); + +unlink('foo'); diff --git a/lib/Test/Simple/t/plan.t b/lib/Test/Simple/t/plan.t new file mode 100644 index 0000000000..d5d299df11 --- /dev/null +++ b/lib/Test/Simple/t/plan.t @@ -0,0 +1,11 @@ +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; +} + +use Test::More; + +plan tests => 2; + +pass('Just testing plan()'); +pass('Testing it some more'); diff --git a/lib/Test/Simple/t/plan_is_noplan.t b/lib/Test/Simple/t/plan_is_noplan.t index 98e962ac39..6d1ed1739e 100644 --- a/lib/Test/Simple/t/plan_is_noplan.t +++ b/lib/Test/Simple/t/plan_is_noplan.t @@ -1,13 +1,16 @@ +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; +} + # Can't use Test.pm, that's a 5.005 thing. package My::Test; # This feature requires a fairly new version of Test::Harness BEGIN { - chdir 't' if -d 't'; - @INC = '../lib'; require Test::Harness; if( $Test::Harness::VERSION < 1.20 ) { - print "1..0\n"; + print "1..0 # Skipped: Need Test::Harness 1.20 or up\n"; exit(0); } } @@ -33,8 +36,8 @@ package main; require Test::Simple; push @INC, '../t/lib'; -require Test::Simple::Catch::More; -my($out, $err) = Test::Simple::Catch::More::caught(); +require Test::Simple::Catch; +my($out, $err) = Test::Simple::Catch::caught(); Test::Simple->import('no_plan'); diff --git a/lib/Test/Simple/t/plan_no_plan.t b/lib/Test/Simple/t/plan_no_plan.t new file mode 100644 index 0000000000..0ccc8177aa --- /dev/null +++ b/lib/Test/Simple/t/plan_no_plan.t @@ -0,0 +1,56 @@ +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; +} + +# Can't use Test.pm, that's a 5.005 thing. +package My::Test; + +print "1..2\n"; + +my $test_num = 1; +# Utility testing functions. +sub ok ($;$) { + my($test, $name) = @_; + my $ok = ''; + $ok .= "not " unless $test; + $ok .= "ok $test_num"; + $ok .= " - $name" if defined $name; + $ok .= "\n"; + print $ok; + $test_num++; +} + + +package main; + +require Test::More; +Test::More->import; +my($out, $err); + +BEGIN { + require Test::Harness; +} + +if( $Test::Harness::VERSION < 1.20 ) { + plan(skip_all => 'Need Test::Harness 1.20 or up'); +} +else { + push @INC, '../t/lib'; + require Test::Simple::Catch; + ($out, $err) = Test::Simple::Catch::caught(); + plan('no_plan'); +} + +pass('Just testing'); +ok(1, 'Testing again'); + +END { + My::Test::ok($$out eq <<OUT); +ok 1 - Just testing +ok 2 - Testing again +1..2 +OUT + + My::Test::ok($$err eq ''); +} diff --git a/lib/Test/Simple/t/plan_skip_all.t b/lib/Test/Simple/t/plan_skip_all.t new file mode 100644 index 0000000000..925c04b3d5 --- /dev/null +++ b/lib/Test/Simple/t/plan_skip_all.t @@ -0,0 +1,10 @@ +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; +} + +use Test::More; + +plan skip_all => 'Just testing plan & skip_all'; + +fail('We should never get here'); diff --git a/lib/Test/Simple/t/simple.t b/lib/Test/Simple/t/simple.t index 7f4f1f42d8..de0f9f522e 100644 --- a/lib/Test/Simple/t/simple.t +++ b/lib/Test/Simple/t/simple.t @@ -1,3 +1,8 @@ +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; +} + use strict; BEGIN { $| = 1; $^W = 1; } diff --git a/lib/Test/Simple/t/skip.t b/lib/Test/Simple/t/skip.t index 2b469495ec..fb4daca2ab 100644 --- a/lib/Test/Simple/t/skip.t +++ b/lib/Test/Simple/t/skip.t @@ -1,4 +1,11 @@ -use Test::More tests => 9; +#!perl -w + +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; +} + +use Test::More tests => 15; # If we skip with the same name, Test::Harness will report it back and # we won't get lots of false bug reports. @@ -41,3 +48,37 @@ SKIP: { fail("Deliberate failure"); fail("And again"); } + + +{ + my $warning; + local $SIG{__WARN__} = sub { $warning = join "", @_ }; + SKIP: { + # perl gets the line number a little wrong on the first + # statement inside a block. + 1 == 1; +#line 56 + skip $Why; + fail("So very failed"); + } + is( $warning, "skip() needs to know \$how_many tests are in the ". + "block at $0 line 56\n", + 'skip without $how_many warning' ); +} + + +SKIP: { + skip "Not skipping here.", 4 if 0; + + pass("This is supposed to run"); + + # Testing out nested skips. + SKIP: { + skip $Why, 2; + fail("AHHH!"); + fail("You're a failure"); + } + + pass("This is supposed to run, too"); +} + diff --git a/lib/Test/Simple/t/skipall.t b/lib/Test/Simple/t/skipall.t index 061bfc7dd7..e41dbc7082 100644 --- a/lib/Test/Simple/t/skipall.t +++ b/lib/Test/Simple/t/skipall.t @@ -1,10 +1,10 @@ -use strict; - BEGIN { chdir 't' if -d 't'; @INC = '../lib'; } +use strict; + # Can't use Test.pm, that's a 5.005 thing. package My::Test; @@ -28,8 +28,8 @@ package main; require Test::More; push @INC, '../t/lib'; -require Test::Simple::Catch::More; -my($out, $err) = Test::Simple::Catch::More::caught(); +require Test::Simple::Catch; +my($out, $err) = Test::Simple::Catch::caught(); Test::More->import('skip_all'); diff --git a/lib/Test/Simple/t/todo.t b/lib/Test/Simple/t/todo.t index 7cbde9519c..499229c944 100644 --- a/lib/Test/Simple/t/todo.t +++ b/lib/Test/Simple/t/todo.t @@ -1,12 +1,16 @@ -#! /usr/local/bin/perl -w +#!perl -w + BEGIN { chdir 't' if -d 't'; @INC = '../lib'; +} + +BEGIN { require Test::Harness; require Test::More; if( $Test::Harness::VERSION < 1.23 ) { - Test::More->import(skip_all => 'Need the new Test::Harness'); + Test::More->import(skip_all => 'Need Test::Harness 1.23 or up'); } else { Test::More->import(tests => 13); diff --git a/lib/Test/Simple/t/undef.t b/lib/Test/Simple/t/undef.t index 67507a5c6f..97ae307d48 100644 --- a/lib/Test/Simple/t/undef.t +++ b/lib/Test/Simple/t/undef.t @@ -1,3 +1,8 @@ +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; +} + use strict; use Test::More tests => 10; diff --git a/lib/Test/Simple/t/use_ok.t b/lib/Test/Simple/t/use_ok.t new file mode 100644 index 0000000000..e6e306dd93 --- /dev/null +++ b/lib/Test/Simple/t/use_ok.t @@ -0,0 +1,26 @@ +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; +} + +use Test::More tests => 7; + +# Using Symbol because it's core and exports lots of stuff. +{ + package Foo::one; + ::use_ok("Symbol"); + ::ok( defined &gensym, 'use_ok() no args exports defaults' ); +} + +{ + package Foo::two; + ::use_ok("Symbol", qw(qualify)); + ::ok( !defined &gensym, ' one arg, defaults overriden' ); + ::ok( defined &qualify, ' right function exported' ); +} + +{ + package Foo::three; + ::use_ok("Symbol", qw(gensym ungensym)); + ::ok( defined &gensym && defined &ungensym, ' multiple args' ); +} diff --git a/lib/Test/Simple/t/useing.t b/lib/Test/Simple/t/useing.t index 93ad4619c8..5e5420a74e 100644 --- a/lib/Test/Simple/t/useing.t +++ b/lib/Test/Simple/t/useing.t @@ -1,5 +1,17 @@ -use Test::More tests => 2; +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; +} -use_ok("Test::More"); +use Test::More tests => 5; -use_ok("Test::Simple"); +require_ok('Test::Builder'); +require_ok("Test::More"); +require_ok("Test::Simple"); + +{ + package Foo; + use Test::More import => [qw(ok is can_ok)]; + can_ok('Foo', qw(ok is can_ok)); + ok( !Foo->can('like'), 'import working properly' ); +} diff --git a/lib/Test/Utils.pm b/lib/Test/Utils.pm deleted file mode 100644 index 1d00f90e8c..0000000000 --- a/lib/Test/Utils.pm +++ /dev/null @@ -1,28 +0,0 @@ -package Test::Utils; - -use 5.004; - -use strict; -require Exporter; -use vars qw($VERSION @EXPORT @EXPORT_TAGS @ISA); - -$VERSION = '0.02'; - -@ISA = qw(Exporter); -@EXPORT = qw( my_print print ); - - - -# Special print function to guard against $\ and -l munging. -sub my_print (*@) { - my($fh, @args) = @_; - - return 1 if $^C; - - local $\; - print $fh @args; -} - -sub print { die "DON'T USE PRINT! Use _print instead" } - -1; diff --git a/lib/Tie/RefHash.pm b/lib/Tie/RefHash.pm index 8555635691..ef7d2b7b20 100644 --- a/lib/Tie/RefHash.pm +++ b/lib/Tie/RefHash.pm @@ -1,6 +1,6 @@ package Tie::RefHash; -our $VERSION = '1.21'; +our $VERSION = '1.3_00'; =head1 NAME @@ -21,7 +21,7 @@ This module provides the ability to use references as hash keys if you first C<tie> the hash variable to this module. Normally, only the keys of the tied hash itself are preserved as references; to use references as keys in hashes-of-hashes, use Tie::RefHash::Nestable, -included as part of Tie::Hash. +included as part of Tie::RefHash. It is implemented using the standard perl TIEHASH interface. Please see the C<tie> entry in perlfunc(1) and perltie(1) for more information. @@ -59,7 +59,7 @@ Gurusamy Sarathy gsar@activestate.com =head1 VERSION -Version 1.21 22 Jun 1999 +Version 1.3 =head1 SEE ALSO @@ -67,8 +67,8 @@ perl(1), perlfunc(1), perltie(1) =cut -require 5.003_11; use Tie::Hash; +use vars '@ISA'; @ISA = qw(Tie::Hash); use strict; @@ -148,7 +148,8 @@ sub CLEAR { } package Tie::RefHash::Nestable; -use vars '@ISA'; @ISA = qw(Tie::RefHash); +use vars '@ISA'; +@ISA = 'Tie::RefHash'; sub STORE { my($s, $k, $v) = @_; diff --git a/lib/unicore/Blocks.pl b/lib/unicore/Blocks.pl index b58ff0d184..c1b26174ad 100644 --- a/lib/unicore/Blocks.pl +++ b/lib/unicore/Blocks.pl @@ -90,7 +90,7 @@ FE70 FEFE Arabic Presentation Forms-B FEFF Specials FF00 FFEF Halfwidth and Fullwidth Forms FFF0 FFFD Specials -10300 1032F Old Italic +10300 1032F Old Italic Block 10330 1034F Gothic Block 10400 1044F Deseret Block 1D000 1D0FF Byzantine Musical Symbols diff --git a/lib/unicore/In.pl b/lib/unicore/In.pl index cd872faac1..8e3cdf5924 100644 --- a/lib/unicore/In.pl +++ b/lib/unicore/In.pl @@ -3,178 +3,178 @@ # Any changes made here will be lost! %utf8::In = ( -'ARABIC' => '16', -'ARMENIAN' => '14', -'ASCII_Hex_Digit' => '152', -'Alphabetic' => '164', -'Alphabetic Presentation Forms' => '129', -'Any' => '171', -'Arabic Block' => '62', -'Arabic Presentation Forms-A' => '130', -'Arabic Presentation Forms-B' => '134', -'Armenian Block' => '60', -'Arrows' => '96', -'Assigned' => '163', -'BENGALI' => '20', -'BOPOMOFO' => '45', -'Basic Latin' => '51', -'Bengali Block' => '66', -'Bidi_Control' => '159', -'Block Elements' => '103', -'Bopomofo Block' => '114', -'Bopomofo Extended' => '117', -'Box Drawing' => '102', -'Braille Patterns' => '107', -'Byzantine Musical Symbols' => '140', -'CANADIAN-ABORIGINAL' => '37', -'CHEROKEE' => '36', -'CJK Compatibility' => '119', -'CJK Compatibility Forms' => '132', -'CJK Compatibility Ideographs' => '128', -'CJK Compatibility Ideographs Supplement' => '144', -'CJK Ideograph' => '1', -'CJK Ideograph Extension A' => '0', -'CJK Ideograph Extension B' => '7', -'CJK Radicals Supplement' => '108', -'CJK Symbols and Punctuation' => '111', -'CJK Unified Ideographs' => '121', -'CJK Unified Ideographs Extension A' => '120', -'CJK Unified Ideographs Extension B' => '143', -'CYRILLIC' => '13', -'Cherokee Block' => '82', -'Combining Diacritical Marks' => '57', -'Combining Half Marks' => '131', -'Combining Marks for Symbols' => '93', -'Common' => '50', -'Control Pictures' => '99', -'Currency Symbols' => '92', -'Cyrillic Block' => '59', -'DESERET' => '49', -'DEVANAGARI' => '19', -'Dash' => '151', -'Deseret Block' => '139', -'Devanagari Block' => '65', -'Diacritic' => '154', -'Dingbats' => '106', -'ETHIOPIC' => '35', -'Enclosed Alphanumerics' => '101', -'Enclosed CJK Letters and Months' => '118', -'Ethiopic Block' => '81', -'Extender' => '155', -'GEORGIAN' => '33', -'GOTHIC' => '48', -'GREEK' => '11', -'GUJARATI' => '22', -'GURMUKHI' => '21', -'General Punctuation' => '90', -'Geometric Shapes' => '104', -'Georgian Block' => '79', -'Gothic Block' => '138', -'Greek Block' => '58', -'Greek Extended' => '89', -'Gujarati Block' => '68', -'Gurmukhi Block' => '67', -'HAN' => '42', -'HANGUL' => '34', -'HEBREW' => '15', -'HIRAGANA' => '43', -'Halfwidth and Fullwidth Forms' => '136', -'Hangul Compatibility Jamo' => '115', -'Hangul Jamo' => '80', -'Hangul Syllable' => '2', -'Hangul Syllables' => '124', -'Hebrew Block' => '61', -'Hex_Digit' => '153', -'High Private Use Surrogates' => '126', -'High Surrogates' => '125', -'Hiragana Block' => '112', -'Hyphen' => '150', -'ID_Continue' => '170', -'ID_Start' => '169', -'INHERITED' => '12', -'IPA Extensions' => '55', -'Ideographic' => '161', -'Ideographic Description Characters' => '110', -'Join_Control' => '158', -'KANNADA' => '26', -'KATAKANA' => '44', -'KHMER' => '40', -'Kanbun' => '116', -'Kangxi Radicals' => '109', -'Kannada Block' => '72', -'Katakana Block' => '113', -'Khmer Block' => '86', -'LAO' => '30', -'LATIN' => '10', -'Lampersand' => '168', -'Lao Block' => '76', -'Latin Extended Additional' => '88', -'Latin Extended-A' => '53', -'Latin Extended-B' => '54', -'Latin-1 Supplement' => '52', -'Letterlike Symbols' => '94', -'Low Surrogate' => '5', -'Low Surrogates' => '127', -'Lowercase' => '165', -'MALAYALAM' => '27', -'MONGOLIAN' => '41', -'MYANMAR' => '32', -'Malayalam Block' => '73', -'Math' => '167', -'Mathematical Alphanumeric Symbols' => '142', -'Mathematical Operators' => '97', -'Miscellaneous Symbols' => '105', -'Miscellaneous Technical' => '98', -'Mongolian Block' => '87', -'Musical Symbols' => '141', -'Myanmar Block' => '78', -'Non Private Use High Surrogate' => '3', -'Noncharacter_Code_Point' => '162', -'Number Forms' => '95', -'OGHAM' => '38', -'OLD-ITALIC' => '47', -'ORIYA' => '23', -'Ogham Block' => '84', -'Old Italic' => '137', -'Optical Character Recognition' => '100', -'Oriya Block' => '69', -'Other_Alphabetic' => '157', -'Other_Lowercase' => '156', -'Other_Math' => '149', -'Other_Uppercase' => '160', -'Plane 15 Private Use' => '8', -'Plane 16 Private Use' => '9', -'Private Use' => '6', -'Private Use High Surrogate' => '4', -'Quotation_Mark' => '148', -'RUNIC' => '39', -'Runic Block' => '85', -'SINHALA' => '28', -'SYRIAC' => '17', -'Sinhala Block' => '74', -'Small Form Variants' => '133', -'Spacing Modifier Letters' => '56', -'Specials' => '135', -'Superscripts and Subscripts' => '91', -'Syriac Block' => '63', -'TAMIL' => '24', -'TELUGU' => '25', -'THAANA' => '18', -'THAI' => '29', -'TIBETAN' => '31', -'Tags' => '145', -'Tamil Block' => '70', -'Telugu Block' => '71', -'Terminal_Punctuation' => '147', -'Thaana Block' => '64', -'Thai Block' => '75', -'Tibetan Block' => '77', -'Unified Canadian Aboriginal Syllabics' => '83', -'Uppercase' => '166', -'White_space' => '146', -'YI' => '46', -'Yi Radicals' => '123', -'Yi Syllables' => '122', +'Alphabetic' => '164', +'Alphabetic Presentation Forms' => '129', +'Any' => '171', +'ARABIC' => '16', +'Arabic Block' => '62', +'Arabic Presentation Forms-A' => '130', +'Arabic Presentation Forms-B' => '134', +'ARMENIAN' => '14', +'Armenian Block' => '60', +'Arrows' => '96', +'ASCII_Hex_Digit' => '152', +'Assigned' => '163', +'Basic Latin' => '51', +'BENGALI' => '20', +'Bengali Block' => '66', +'Bidi_Control' => '159', +'Block Elements' => '103', +'BOPOMOFO' => '45', +'Bopomofo Block' => '114', +'Bopomofo Extended' => '117', +'Box Drawing' => '102', +'Braille Patterns' => '107', +'Byzantine Musical Symbols' => '140', +'CANADIAN-ABORIGINAL' => '37', +'CHEROKEE' => '36', +'Cherokee Block' => '82', +'CJK Compatibility' => '119', +'CJK Compatibility Forms' => '132', +'CJK Compatibility Ideographs' => '128', +'CJK Compatibility Ideographs Supplement' => '144', +'CJK Ideograph' => '1', +'CJK Ideograph Extension A' => '0', +'CJK Ideograph Extension B' => '7', +'CJK Radicals Supplement' => '108', +'CJK Symbols and Punctuation' => '111', +'CJK Unified Ideographs' => '121', +'CJK Unified Ideographs Extension A' => '120', +'CJK Unified Ideographs Extension B' => '143', +'Combining Diacritical Marks' => '57', +'Combining Half Marks' => '131', +'Combining Marks for Symbols' => '93', +'Common' => '50', +'Control Pictures' => '99', +'Currency Symbols' => '92', +'CYRILLIC' => '13', +'Cyrillic Block' => '59', +'Dash' => '151', +'DESERET' => '49', +'Deseret Block' => '139', +'DEVANAGARI' => '19', +'Devanagari Block' => '65', +'Diacritic' => '154', +'Dingbats' => '106', +'Enclosed Alphanumerics' => '101', +'Enclosed CJK Letters and Months' => '118', +'ETHIOPIC' => '35', +'Ethiopic Block' => '81', +'Extender' => '155', +'General Punctuation' => '90', +'Geometric Shapes' => '104', +'GEORGIAN' => '33', +'Georgian Block' => '79', +'GOTHIC' => '48', +'Gothic Block' => '138', +'GREEK' => '11', +'Greek Block' => '58', +'Greek Extended' => '89', +'GUJARATI' => '22', +'Gujarati Block' => '68', +'GURMUKHI' => '21', +'Gurmukhi Block' => '67', +'Halfwidth and Fullwidth Forms' => '136', +'HAN' => '42', +'HANGUL' => '34', +'Hangul Compatibility Jamo' => '115', +'Hangul Jamo' => '80', +'Hangul Syllable' => '2', +'Hangul Syllables' => '124', +'HEBREW' => '15', +'Hebrew Block' => '61', +'Hex_Digit' => '153', +'High Private Use Surrogates' => '126', +'High Surrogates' => '125', +'HIRAGANA' => '43', +'Hiragana Block' => '112', +'Hyphen' => '150', +'ID_Continue' => '170', +'ID_Start' => '169', +'Ideographic' => '161', +'Ideographic Description Characters' => '110', +'INHERITED' => '12', +'IPA Extensions' => '55', +'Join_Control' => '158', +'Kanbun' => '116', +'Kangxi Radicals' => '109', +'KANNADA' => '26', +'Kannada Block' => '72', +'KATAKANA' => '44', +'Katakana Block' => '113', +'KHMER' => '40', +'Khmer Block' => '86', +'Lampersand' => '168', +'LAO' => '30', +'Lao Block' => '76', +'LATIN' => '10', +'Latin Extended Additional' => '88', +'Latin Extended-A' => '53', +'Latin Extended-B' => '54', +'Latin-1 Supplement' => '52', +'Letterlike Symbols' => '94', +'Low Surrogate' => '5', +'Low Surrogates' => '127', +'Lowercase' => '165', +'MALAYALAM' => '27', +'Malayalam Block' => '73', +'Math' => '167', +'Mathematical Alphanumeric Symbols' => '142', +'Mathematical Operators' => '97', +'Miscellaneous Symbols' => '105', +'Miscellaneous Technical' => '98', +'MONGOLIAN' => '41', +'Mongolian Block' => '87', +'Musical Symbols' => '141', +'MYANMAR' => '32', +'Myanmar Block' => '78', +'Non Private Use High Surrogate' => '3', +'Noncharacter_Code_Point' => '162', +'Number Forms' => '95', +'OGHAM' => '38', +'Ogham Block' => '84', +'Old Italic Block' => '137', +'OLD-ITALIC' => '47', +'Optical Character Recognition' => '100', +'ORIYA' => '23', +'Oriya Block' => '69', +'Other_Alphabetic' => '157', +'Other_Lowercase' => '156', +'Other_Math' => '149', +'Other_Uppercase' => '160', +'Plane 15 Private Use' => '8', +'Plane 16 Private Use' => '9', +'Private Use' => '6', +'Private Use High Surrogate' => '4', +'Quotation_Mark' => '148', +'RUNIC' => '39', +'Runic Block' => '85', +'SINHALA' => '28', +'Sinhala Block' => '74', +'Small Form Variants' => '133', +'Spacing Modifier Letters' => '56', +'Specials' => '135', +'Superscripts and Subscripts' => '91', +'SYRIAC' => '17', +'Syriac Block' => '63', +'Tags' => '145', +'TAMIL' => '24', +'Tamil Block' => '70', +'TELUGU' => '25', +'Telugu Block' => '71', +'Terminal_Punctuation' => '147', +'THAANA' => '18', +'Thaana Block' => '64', +'THAI' => '29', +'Thai Block' => '75', +'TIBETAN' => '31', +'Tibetan Block' => '77', +'Unified Canadian Aboriginal Syllabics' => '83', +'Uppercase' => '166', +'White_space' => '146', +'YI' => '46', +'Yi Radicals' => '123', +'Yi Syllables' => '122', ); %utf8::InPat = ( @@ -187,10 +187,10 @@ }, 'ar' => { 'ARABIC' => '16', - 'ARMENIAN' => '14', 'Arabic(?:[-_]|\s+)?Block' => '62', 'Arabic(?:[-_]|\s+)?Presentation(?:[-_]|\s+)?Forms(?:[-_]|\s+)?A' => '130', 'Arabic(?:[-_]|\s+)?Presentation(?:[-_]|\s+)?Forms(?:[-_]|\s+)?B' => '134', + 'ARMENIAN' => '14', 'Armenian(?:[-_]|\s+)?Block' => '60', 'Arrows' => '96', }, @@ -263,8 +263,8 @@ }, 'de' => { 'DESERET' => '49', - 'DEVANAGARI' => '19', 'Deseret(?:[-_]|\s+)?Block' => '139', + 'DEVANAGARI' => '19', 'Devanagari(?:[-_]|\s+)?Block' => '65', }, 'di' => { @@ -283,9 +283,9 @@ 'Extender' => '155', }, 'ge' => { - 'GEORGIAN' => '33', 'General(?:[-_]|\s+)?Punctuation' => '90', 'Geometric(?:[-_]|\s+)?Shapes' => '104', + 'GEORGIAN' => '33', 'Georgian(?:[-_]|\s+)?Block' => '79', }, 'go' => { @@ -299,14 +299,14 @@ }, 'gu' => { 'GUJARATI' => '22', - 'GURMUKHI' => '21', 'Gujarati(?:[-_]|\s+)?Block' => '68', + 'GURMUKHI' => '21', 'Gurmukhi(?:[-_]|\s+)?Block' => '67', }, 'ha' => { + 'Halfwidth(?:[-_]|\s+)?and(?:[-_]|\s+)?Fullwidth(?:[-_]|\s+)?Forms' => '136', 'HAN' => '42', 'HANGUL' => '34', - 'Halfwidth(?:[-_]|\s+)?and(?:[-_]|\s+)?Fullwidth(?:[-_]|\s+)?Forms' => '136', 'Hangul(?:[-_]|\s+)?Compatibility(?:[-_]|\s+)?Jamo' => '115', 'Hangul(?:[-_]|\s+)?Jamo' => '80', 'Hangul(?:[-_]|\s+)?Syllable' => '2', @@ -318,9 +318,9 @@ 'Hex(?:[-_]|\s+)?Digit' => '153', }, 'hi' => { - 'HIRAGANA' => '43', 'High(?:[-_]|\s+)?Private(?:[-_]|\s+)?Use(?:[-_]|\s+)?Surrogates' => '126', 'High(?:[-_]|\s+)?Surrogates' => '125', + 'HIRAGANA' => '43', 'Hiragana(?:[-_]|\s+)?Block' => '112', }, 'hy' => { @@ -342,11 +342,11 @@ 'Join(?:[-_]|\s+)?Control' => '158', }, 'ka' => { - 'KANNADA' => '26', - 'KATAKANA' => '44', 'Kanbun' => '116', 'Kangxi(?:[-_]|\s+)?Radicals' => '109', + 'KANNADA' => '26', 'Kannada(?:[-_]|\s+)?Block' => '72', + 'KATAKANA' => '44', 'Katakana(?:[-_]|\s+)?Block' => '113', }, 'kh' => { @@ -354,10 +354,10 @@ 'Khmer(?:[-_]|\s+)?Block' => '86', }, 'la' => { - 'LAO' => '30', - 'LATIN' => '10', 'Lampersand' => '168', + 'LAO' => '30', 'Lao(?:[-_]|\s+)?Block' => '76', + 'LATIN' => '10', 'Latin(?:[-_]|\s+)?Extended(?:[-_]|\s+)?Additional' => '88', 'Latin(?:[-_]|\s+)?Extended(?:[-_]|\s+)?A' => '53', 'Latin(?:[-_]|\s+)?Extended(?:[-_]|\s+)?B' => '54', @@ -405,8 +405,8 @@ 'Ogham(?:[-_]|\s+)?Block' => '84', }, 'ol' => { + 'Old(?:[-_]|\s+)?Italic(?:[-_]|\s+)?Block' => '137', 'OLD(?:[-_]|\s+)?ITALIC' => '47', - 'Old(?:[-_]|\s+)?Italic' => '137', }, 'op' => { 'Optical(?:[-_]|\s+)?Character(?:[-_]|\s+)?Recognition' => '100', @@ -455,8 +455,8 @@ 'Syriac(?:[-_]|\s+)?Block' => '63', }, 'ta' => { - 'TAMIL' => '24', 'Tags' => '145', + 'TAMIL' => '24', 'Tamil(?:[-_]|\s+)?Block' => '70', }, 'te' => { @@ -466,8 +466,8 @@ }, 'th' => { 'THAANA' => '18', - 'THAI' => '29', 'Thaana(?:[-_]|\s+)?Block' => '64', + 'THAI' => '29', 'Thai(?:[-_]|\s+)?Block' => '75', }, 'ti' => { @@ -489,3 +489,146 @@ 'Yi(?:[-_]|\s+)?Syllables' => '122', }, ); + +%utf8::InScript = +( + 10 => 'LATIN', + 11 => 'GREEK', + 12 => 'INHERITED', + 13 => 'CYRILLIC', + 14 => 'ARMENIAN', + 15 => 'HEBREW', + 16 => 'ARABIC', + 17 => 'SYRIAC', + 18 => 'THAANA', + 19 => 'DEVANAGARI', + 20 => 'BENGALI', + 21 => 'GURMUKHI', + 22 => 'GUJARATI', + 23 => 'ORIYA', + 24 => 'TAMIL', + 25 => 'TELUGU', + 26 => 'KANNADA', + 27 => 'MALAYALAM', + 28 => 'SINHALA', + 29 => 'THAI', + 30 => 'LAO', + 31 => 'TIBETAN', + 32 => 'MYANMAR', + 33 => 'GEORGIAN', + 34 => 'HANGUL', + 35 => 'ETHIOPIC', + 36 => 'CHEROKEE', + 37 => 'CANADIAN-ABORIGINAL', + 38 => 'OGHAM', + 39 => 'RUNIC', + 40 => 'KHMER', + 41 => 'MONGOLIAN', + 42 => 'HAN', + 43 => 'HIRAGANA', + 44 => 'KATAKANA', + 45 => 'BOPOMOFO', + 46 => 'YI', + 47 => 'OLD-ITALIC', + 48 => 'GOTHIC', + 49 => 'DESERET', +); + +%utf8::InBlock = +( + 51 => 'Basic Latin', + 52 => 'Latin-1 Supplement', + 53 => 'Latin Extended-A', + 54 => 'Latin Extended-B', + 55 => 'IPA Extensions', + 56 => 'Spacing Modifier Letters', + 57 => 'Combining Diacritical Marks', + 58 => 'Greek', + 59 => 'Cyrillic', + 60 => 'Armenian', + 61 => 'Hebrew', + 62 => 'Arabic', + 63 => 'Syriac', + 64 => 'Thaana', + 65 => 'Devanagari', + 66 => 'Bengali', + 67 => 'Gurmukhi', + 68 => 'Gujarati', + 69 => 'Oriya', + 70 => 'Tamil', + 71 => 'Telugu', + 72 => 'Kannada', + 73 => 'Malayalam', + 74 => 'Sinhala', + 75 => 'Thai', + 76 => 'Lao', + 77 => 'Tibetan', + 78 => 'Myanmar', + 79 => 'Georgian', + 80 => 'Hangul Jamo', + 81 => 'Ethiopic', + 82 => 'Cherokee', + 83 => 'Unified Canadian Aboriginal Syllabics', + 84 => 'Ogham', + 85 => 'Runic', + 86 => 'Khmer', + 87 => 'Mongolian', + 88 => 'Latin Extended Additional', + 89 => 'Greek Extended', + 90 => 'General Punctuation', + 91 => 'Superscripts and Subscripts', + 92 => 'Currency Symbols', + 93 => 'Combining Marks for Symbols', + 94 => 'Letterlike Symbols', + 95 => 'Number Forms', + 96 => 'Arrows', + 97 => 'Mathematical Operators', + 98 => 'Miscellaneous Technical', + 99 => 'Control Pictures', + 100 => 'Optical Character Recognition', + 101 => 'Enclosed Alphanumerics', + 102 => 'Box Drawing', + 103 => 'Block Elements', + 104 => 'Geometric Shapes', + 105 => 'Miscellaneous Symbols', + 106 => 'Dingbats', + 107 => 'Braille Patterns', + 108 => 'CJK Radicals Supplement', + 109 => 'Kangxi Radicals', + 110 => 'Ideographic Description Characters', + 111 => 'CJK Symbols and Punctuation', + 112 => 'Hiragana', + 113 => 'Katakana', + 114 => 'Bopomofo', + 115 => 'Hangul Compatibility Jamo', + 116 => 'Kanbun', + 117 => 'Bopomofo Extended', + 118 => 'Enclosed CJK Letters and Months', + 119 => 'CJK Compatibility', + 120 => 'CJK Unified Ideographs Extension A', + 121 => 'CJK Unified Ideographs', + 122 => 'Yi Syllables', + 123 => 'Yi Radicals', + 124 => 'Hangul Syllables', + 125 => 'High Surrogates', + 126 => 'High Private Use Surrogates', + 127 => 'Low Surrogates', + 128 => 'CJK Compatibility Ideographs', + 129 => 'Alphabetic Presentation Forms', + 130 => 'Arabic Presentation Forms-A', + 131 => 'Combining Half Marks', + 132 => 'CJK Compatibility Forms', + 133 => 'Small Form Variants', + 134 => 'Arabic Presentation Forms-B', + 135 => 'Specials', + 136 => 'Halfwidth and Fullwidth Forms', + 137 => 'Old Italic', + 138 => 'Gothic', + 139 => 'Deseret', + 140 => 'Byzantine Musical Symbols', + 141 => 'Musical Symbols', + 142 => 'Mathematical Alphanumeric Symbols', + 143 => 'CJK Unified Ideographs Extension B', + 144 => 'CJK Compatibility Ideographs Supplement', + 145 => 'Tags', +); diff --git a/lib/unicore/In/137.pl b/lib/unicore/In/137.pl index 71615739f1..6be2e0dbc2 100644 --- a/lib/unicore/In/137.pl +++ b/lib/unicore/In/137.pl @@ -2,5 +2,5 @@ # This file is built by mktables from e.g. Unicode.txt. # Any changes made here will be lost! return <<'END'; -10300 1032F Old Italic +10300 1032F Old Italic Block END diff --git a/lib/unicore/Is.pl b/lib/unicore/Is.pl index ef99c29d3b..6ee87e3e91 100644 --- a/lib/unicore/Is.pl +++ b/lib/unicore/Is.pl @@ -3,48 +3,48 @@ # Any changes made here will be lost! %utf8::Is = ( -'Close Punctuation' => 'Pe', -'Connector Punctuation' => 'Pc', -'Control' => 'Cc', -'Currency Symbol' => 'Sc', -'Dash Punctuation' => 'Pd', -'Decimal Digit Number' => 'Nd', -'Enclosing Mark' => 'Me', -'Final Punctuation' => 'Pf', -'Format' => 'Cf', -'Initial Punctuation' => 'Pi', -'Letter' => 'L', -'Letter Number' => 'Nl', -'Line Separator' => 'Zl', -'Lowercase Letter' => 'Ll', -'Mark' => 'M', -'Math Symbol' => 'Sm', -'Modifier Letter' => 'Lm', -'Modifier Symbol' => 'Sk', -'Non-Spacing Mark' => 'Mn', -'Not Assigned' => 'Cn', -'Number' => 'N', -'Open Punctuation' => 'Ps', -'Other' => 'C', -'Other Control' => 'Cc', -'Other Format' => 'Cf', -'Other Letter' => 'Lo', -'Other Not Assigned' => 'Cn', -'Other Number' => 'No', -'Other Private Use' => 'Co', -'Other Punctuation' => 'Po', -'Other Surrogate' => 'Cs', -'Other Symbol' => 'So', -'Paragraph Separator' => 'Zp', -'Private Use' => 'Co', -'Punctuation' => 'P', -'Separator' => 'Z', -'Space Separator' => 'Zs', -'Spacing Combining Mark' => 'Mc', -'Surrogate' => 'Cs', -'Symbol' => 'S', -'Titlecase Letter' => 'Lt', -'Uppercase Letter' => 'Lu', +'Close Punctuation' => 'Pe', +'Connector Punctuation' => 'Pc', +'Control' => 'Cc', +'Currency Symbol' => 'Sc', +'Dash Punctuation' => 'Pd', +'Decimal Digit Number' => 'Nd', +'Enclosing Mark' => 'Me', +'Final Punctuation' => 'Pf', +'Format' => 'Cf', +'Initial Punctuation' => 'Pi', +'Letter' => 'L', +'Letter Number' => 'Nl', +'Line Separator' => 'Zl', +'Lowercase Letter' => 'Ll', +'Mark' => 'M', +'Math Symbol' => 'Sm', +'Modifier Letter' => 'Lm', +'Modifier Symbol' => 'Sk', +'Non-Spacing Mark' => 'Mn', +'Not Assigned' => 'Cn', +'Number' => 'N', +'Open Punctuation' => 'Ps', +'Other' => 'C', +'Other Control' => 'Cc', +'Other Format' => 'Cf', +'Other Letter' => 'Lo', +'Other Not Assigned' => 'Cn', +'Other Number' => 'No', +'Other Private Use' => 'Co', +'Other Punctuation' => 'Po', +'Other Surrogate' => 'Cs', +'Other Symbol' => 'So', +'Paragraph Separator' => 'Zp', +'Private Use' => 'Co', +'Punctuation' => 'P', +'Separator' => 'Z', +'Space Separator' => 'Zs', +'Spacing Combining Mark' => 'Mc', +'Surrogate' => 'Cs', +'Symbol' => 'S', +'Titlecase Letter' => 'Lt', +'Uppercase Letter' => 'Lu', ); %utf8::IsPat = ( diff --git a/lib/unicore/To/SpecLower.pl b/lib/unicore/To/SpecLower.pl new file mode 100644 index 0000000000..18c073b98b --- /dev/null +++ b/lib/unicore/To/SpecLower.pl @@ -0,0 +1,107 @@ +# !!!!!!! DO NOT EDIT THIS FILE !!!!!!! +# This file is built by mktables from e.g. Unicode.txt. +# Any changes made here will be lost! +return <<'END'; +00DF 00DF +0149 0149 +01F0 01F0 +0390 0390 +03B0 03B0 +0587 0587 +1E96 1E96 +1E97 1E97 +1E98 1E98 +1E99 1E99 +1E9A 1E9A +1F50 1F50 +1F52 1F52 +1F54 1F54 +1F56 1F56 +1F80 1F80 +1F81 1F81 +1F82 1F82 +1F83 1F83 +1F84 1F84 +1F85 1F85 +1F86 1F86 +1F87 1F87 +1F88 1F80 +1F89 1F81 +1F8A 1F82 +1F8B 1F83 +1F8C 1F84 +1F8D 1F85 +1F8E 1F86 +1F8F 1F87 +1F90 1F90 +1F91 1F91 +1F92 1F92 +1F93 1F93 +1F94 1F94 +1F95 1F95 +1F96 1F96 +1F97 1F97 +1F98 1F90 +1F99 1F91 +1F9A 1F92 +1F9B 1F93 +1F9C 1F94 +1F9D 1F95 +1F9E 1F96 +1F9F 1F97 +1FA0 1FA0 +1FA1 1FA1 +1FA2 1FA2 +1FA3 1FA3 +1FA4 1FA4 +1FA5 1FA5 +1FA6 1FA6 +1FA7 1FA7 +1FA8 1FA0 +1FA9 1FA1 +1FAA 1FA2 +1FAB 1FA3 +1FAC 1FA4 +1FAD 1FA5 +1FAE 1FA6 +1FAF 1FA7 +1FB2 1FB2 +1FB3 1FB3 +1FB4 1FB4 +1FB6 1FB6 +1FB7 1FB7 +1FBC 1FB3 +1FC2 1FC2 +1FC3 1FC3 +1FC4 1FC4 +1FC6 1FC6 +1FC7 1FC7 +1FCC 1FC3 +1FD2 1FD2 +1FD3 1FD3 +1FD6 1FD6 +1FD7 1FD7 +1FE2 1FE2 +1FE3 1FE3 +1FE4 1FE4 +1FE6 1FE6 +1FE7 1FE7 +1FF2 1FF2 +1FF3 1FF3 +1FF4 1FF4 +1FF6 1FF6 +1FF7 1FF7 +1FFC 1FF3 +FB00 FB00 +FB01 FB01 +FB02 FB02 +FB03 FB03 +FB04 FB04 +FB05 FB05 +FB06 FB06 +FB13 FB13 +FB14 FB14 +FB15 FB15 +FB16 FB16 +FB17 FB17 +END diff --git a/lib/unicore/To/SpecTitle.pl b/lib/unicore/To/SpecTitle.pl new file mode 100644 index 0000000000..c3e1911408 --- /dev/null +++ b/lib/unicore/To/SpecTitle.pl @@ -0,0 +1,106 @@ +# !!!!!!! DO NOT EDIT THIS FILE !!!!!!! +# This file is built by mktables from e.g. Unicode.txt. +# Any changes made here will be lost! +return <<'END'; +00DF 0053 0073 +0149 02BC 004E +01F0 004A 030C +0390 0399 0308 0301 +03B0 03A5 0308 0301 +0587 0535 0582 +1E96 0048 0331 +1E97 0054 0308 +1E98 0057 030A +1E99 0059 030A +1E9A 0041 02BE +1F50 03A5 0313 +1F52 03A5 0313 0300 +1F54 03A5 0313 0301 +1F56 03A5 0313 0342 +1F80 1F88 +1F81 1F89 +1F82 1F8A +1F83 1F8B +1F84 1F8C +1F85 1F8D +1F86 1F8E +1F87 1F8F +1F88 1F88 +1F89 1F89 +1F8A 1F8A +1F8B 1F8B +1F8C 1F8C +1F8D 1F8D +1F8E 1F8E +1F8F 1F8F +1F90 1F98 +1F91 1F99 +1F92 1F9A +1F93 1F9B +1F94 1F9C +1F95 1F9D +1F96 1F9E +1F97 1F9F +1F98 1F98 +1F99 1F99 +1F9A 1F9A +1F9B 1F9B +1F9C 1F9C +1F9D 1F9D +1F9E 1F9E +1F9F 1F9F +1FA0 1FA8 +1FA1 1FA9 +1FA2 1FAA +1FA3 1FAB +1FA4 1FAC +1FA5 1FAD +1FA6 1FAE +1FA7 1FAF +1FA8 1FA8 +1FA9 1FA9 +1FAA 1FAA +1FAB 1FAB +1FAC 1FAC +1FAD 1FAD +1FAE 1FAE +1FAF 1FAF +1FB2 1FBA 0345 +1FB3 1FBC +1FB4 0386 0345 +1FB6 0391 0342 +1FB7 0391 0342 0345 +1FBC 1FBC +1FC2 1FCA 0345 +1FC3 1FCC +1FC4 0389 0345 +1FC6 0397 0342 +1FC7 0397 0342 0345 +1FCC 1FCC +1FD2 0399 0308 0300 +1FD3 0399 0308 0301 +1FD6 0399 0342 +1FD7 0399 0308 0342 +1FE2 03A5 0308 0300 +1FE3 03A5 0308 0301 +1FE4 03A1 0313 +1FE6 03A5 0342 +1FE7 03A5 0308 0342 +1FF2 1FFA 0345 +1FF3 1FFC +1FF4 038F 0345 +1FF6 03A9 0342 +1FF7 03A9 0342 0345 +1FFC 1FFC +FB00 0046 0066 +FB01 0046 0069 +FB02 0046 006C +FB03 0046 0066 0069 +FB04 0046 0066 006C +FB05 FB06 0053 0074 +FB13 0544 0576 +FB14 0544 0565 +FB15 0544 056B +FB16 054E 0576 +FB17 0544 056D +END diff --git a/lib/unicore/To/SpecUpper.pl b/lib/unicore/To/SpecUpper.pl new file mode 100644 index 0000000000..e5af4b1089 --- /dev/null +++ b/lib/unicore/To/SpecUpper.pl @@ -0,0 +1,106 @@ +# !!!!!!! DO NOT EDIT THIS FILE !!!!!!! +# This file is built by mktables from e.g. Unicode.txt. +# Any changes made here will be lost! +return <<'END'; +00DF 0053 0053 +0149 02BC 004E +01F0 004A 030C +0390 0399 0308 0301 +03B0 03A5 0308 0301 +0587 0535 0552 +1E96 0048 0331 +1E97 0054 0308 +1E98 0057 030A +1E99 0059 030A +1E9A 0041 02BE +1F50 03A5 0313 +1F52 03A5 0313 0300 +1F54 03A5 0313 0301 +1F56 03A5 0313 0342 +1F80 1F08 0399 +1F81 1F09 0399 +1F82 1F0A 0399 +1F83 1F0B 0399 +1F84 1F0C 0399 +1F85 1F0D 0399 +1F86 1F0E 0399 +1F87 1F0F 0399 +1F88 1F08 0399 +1F89 1F09 0399 +1F8A 1F0A 0399 +1F8B 1F0B 0399 +1F8C 1F0C 0399 +1F8D 1F0D 0399 +1F8E 1F0E 0399 +1F8F 1F0F 0399 +1F90 1F28 0399 +1F91 1F29 0399 +1F92 1F2A 0399 +1F93 1F2B 0399 +1F94 1F2C 0399 +1F95 1F2D 0399 +1F96 1F2E 0399 +1F97 1F2F 0399 +1F98 1F28 0399 +1F99 1F29 0399 +1F9A 1F2A 0399 +1F9B 1F2B 0399 +1F9C 1F2C 0399 +1F9D 1F2D 0399 +1F9E 1F2E 0399 +1F9F 1F2F 0399 +1FA0 1F68 0399 +1FA1 1F69 0399 +1FA2 1F6A 0399 +1FA3 1F6B 0399 +1FA4 1F6C 0399 +1FA5 1F6D 0399 +1FA6 1F6E 0399 +1FA7 1F6F 0399 +1FA8 1F68 0399 +1FA9 1F69 0399 +1FAA 1F6A 0399 +1FAB 1F6B 0399 +1FAC 1F6C 0399 +1FAD 1F6D 0399 +1FAE 1F6E 0399 +1FAF 1F6F 0399 +1FB2 1FBA 0399 +1FB3 0391 0399 +1FB4 0386 0399 +1FB6 0391 0342 +1FB7 0391 0342 0399 +1FBC 0391 0399 +1FC2 1FCA 0399 +1FC3 0397 0399 +1FC4 0389 0399 +1FC6 0397 0342 +1FC7 0397 0342 0399 +1FCC 0397 0399 +1FD2 0399 0308 0300 +1FD3 0399 0308 0301 +1FD6 0399 0342 +1FD7 0399 0308 0342 +1FE2 03A5 0308 0300 +1FE3 03A5 0308 0301 +1FE4 03A1 0313 +1FE6 03A5 0342 +1FE7 03A5 0308 0342 +1FF2 1FFA 0399 +1FF3 03A9 0399 +1FF4 038F 0399 +1FF6 03A9 0342 +1FF7 03A9 0342 0399 +1FFC 03A9 0399 +FB00 0046 0046 +FB01 0046 0049 +FB02 0046 004C +FB03 0046 0046 0049 +FB04 0046 0046 004C +FB05 FB06 0053 0054 +FB13 0544 0546 +FB14 0544 0535 +FB15 0544 053B +FB16 054E 0546 +FB17 0544 053D +END diff --git a/lib/unicore/mktables b/lib/unicore/mktables index 5b2d7869f5..3328f69326 100644 --- a/lib/unicore/mktables +++ b/lib/unicore/mktables @@ -5,10 +5,10 @@ # from the Unicode database files (lib/unicore/*.txt). # -my $LastUnicodeCodepoint = 0x10FFFF; # As of Unicode 3.1.1. - use strict; +my $LastUnicodeCodepoint = 0x10FFFF; # As of Unicode 3.1.1. + mkdir("In", 0755); mkdir("Is", 0755); mkdir("To", 0755); @@ -103,6 +103,9 @@ my %In; my $InId = 0; my %InIn; +my %InScript; +my %InBlock; + # # Read in the Unicode.txt, the main Unicode database. # @@ -123,9 +126,9 @@ if (open(my $Unicode, "Unicode.txt")) { my @Mirrored; my %To; while (<$Unicode>) { - next if /^\#/ || /^\s*$/; - next unless /^[0-9a-f]+\s*;/i; + next unless /^[0-9A-Fa-f]+;/; s/\s+$//; + my ($code, $name, $cat, $comb, $bidi, $deco, $decimal, $digit, $number, $mirrored, $unicode10, $comment, @@ -259,10 +262,7 @@ if (open(my $LineBrk, "LineBrk.txt")) { my %Lbrk; while (<$LineBrk>) { - next if /^\#/ || /^\s*$/; - s/\s+$//; - s/\s*\#.*//; - next unless /^([0-9a-f]+)(?:\.\.([0-9a-f]+))?\s*;\s*(.+)$/i; + next unless /^([0-9A-Fa-f]+)(?:\.\.([0-9A-Fa-f]+))?\s*;\s*(\w+)/; my ($first, $last, $lbrk) = ($1, $2, $3); @@ -291,9 +291,9 @@ if (open(my $ArabShap, "ArabShap.txt")) { my @ArabLinkGroup; while (<$ArabShap>) { - next if /^\#/ || /^\s*$/; - next unless /^[0-9a-f]+\s*;/i; + next unless /^[0-9A-Fa-f]+;/; s/\s+$//; + my ($code, $name, $link, $linkgroup) = split(/\s*;\s*/); append(\@ArabLink, $code, $link); @@ -314,11 +314,9 @@ if (open(my $Jamo, "Jamo.txt")) { my @Short; while (<$Jamo>) { - next if /^\#/ || /^\s*$/; - next unless /^[0-9a-f]+\s*;/i; - s/\s*\#.*//; - s/\s+$//; - my ($code, $short) = split(/\s*;\s*/); + next unless /^([0-9A-Fa-f]+)\s*;\s*(\w*)/; + + my ($code, $short) = ($1, $2); append(\@Short, $code, $short); } @@ -336,10 +334,7 @@ my @Scripts; if (open(my $Scripts, "Scripts.txt")) { while (<$Scripts>) { - next if /^\#/ || /^\s*$/; - s/\s*\#.*//; - s/\s+$//; - next unless /^([0-9a-f]+)(?:\.\.([0-9a-f]+))?\s*;\s*(.+)$/i; + next unless /^([0-9A-Fa-f]+)(?:\.\.([0-9A-Fa-f]+))?\s*;\s*(.+?)\s*\#/; # Wait until all the scripts have been read since # they are not listed in numeric order. @@ -363,8 +358,9 @@ for my $script (sort { $a->[0] <=> $b->[0] } @Scripts) { extend($Script{$name}, $last); } unless (defined $In{$name}) { - $In{$name} = $InId++; - $InIn{$name} = $Script{$name}; + $InScript{$InId} = $name; + $In{$name} = $InId++; + $InIn{$name} = $Script{$name}; } } @@ -387,17 +383,22 @@ my %Blocks; if (open(my $Blocks, "Blocks.txt")) { while (<$Blocks>) { - next if /^\#/ || /^\s*$/; - s/\s*\#.*//; - s/\s+$//; - next unless /^([0-9a-f]+)\.\.([0-9a-f]+)\s*;\s*(.+)$/i; - + next unless /^([0-9A-Fa-f]+)\.\.([0-9A-Fa-f]+)\s*;\s*(.+?)\s*$/; + my ($first, $last, $name) = ($1, $2, $3); + my $origname = $name; # If there's a naming conflict (the script names are # in uppercase), the name of the block has " Block" # appended to it. - $name = "$name Block" if defined $In{"\U$name"}; + my $pat = $name; + $pat =~ s/([- _])/(?:[-_]|\\s+)?/g; + for my $i (values %InScript) { + if ($i =~ /^$pat$/i) { + $name .= " Block"; + last; + } + } append(\@Blocks, $first, $name); append($Blocks{$name} ||= [], $first, $name); @@ -406,8 +407,9 @@ if (open(my $Blocks, "Blocks.txt")) { extend($Blocks{$name}, $last); } unless (defined $In{$name}) { - $In{$name} = $InId++; - $InIn{$name} = $Blocks{$name}; + $InBlock{$InId} = $origname; + $In{$name} = $InId++; + $InIn{$name} = $Blocks{$name}; } } } else { @@ -430,10 +432,7 @@ my @Props; if (open(my $Props, "PropList.txt")) { while (<$Props>) { - next if /^\#/ || /^\s*$/; - s/\s*\#.*//; - s/\s+$//; - next unless /^([0-9a-f]+)(?:\.\.([0-9a-f]+))?\s*;\s*(\w+)/i; + next unless /^([0-9A-Fa-f]+)(?:\.\.([0-9A-Fa-f]+))?\s*;\s*(.+?)\s*\#/; # Wait until all the extended properties have been read since # they are not listed in numeric order. @@ -559,7 +558,7 @@ sub mapping { %utf8::${name} = ( EOT - for my $i (sort keys %$map) { + for my $i (sort { lc $a cmp lc $b } keys %$map) { my $pat = $i; # Here is the 'fuzzification': accept any space, # dash, or underbar where in the official name @@ -569,7 +568,7 @@ EOT # The prefix length of 2 is enough spread, # and besides, we have 'Yi' as an In category. push @{$pat{lc(substr($i, 0, 2))}}, [ $i, $pat ]; - print $fh "'$i' => '$map->{$i}',\n"; + printf $fh "%-45s => '$map->{$i}',\n", "'$i'"; } print $fh <<EOT; ); @@ -605,6 +604,39 @@ EOT mapping(\%In, "In"); +# +# Append the InScript and InBlock mappings. +# These are needed only if Script= and Block= syntaxes are used. +# + +if (open(my $In, ">>In.pl")) { + print $In <<EOT; + +%utf8::InScript = +( +EOT + for my $i (sort { $a <=> $b } keys %InScript) { + printf $In "%4d => '$InScript{$i}',\n", $i; + } + print $In <<EOT; +); +EOT + + print $In <<EOT; + +%utf8::InBlock = +( +EOT + for my $i (sort { $a <=> $b } keys %InBlock) { + printf $In "%4d => '$InBlock{$i}',\n", $i; + } + print $In <<EOT; +); +EOT +} else { + die "$0: In.pl: $!\n"; +} + # Easy low-calorie cheat. use File::Copy; copy("In/$In{Noncharacter_Code_Point}.pl", "Is/Cn.pl"); @@ -682,5 +714,48 @@ my %Is = ( mapping(\%Is, "Is"); +# +# Read in the special cases. +# + +my %Case; + +if (open(my $SpecCase, "SpecCase.txt")) { + while (<$SpecCase>) { + next unless /^[0-9A-Fa-f]+;/; + s/\#.*//; + s/\s+$//; + + my ($code, $lower, $title, $upper, $condition) = split(/\s*;\s*/); + + if ($condition) { # not implemented yet + print "# SKIPPING $_\n"; + next; + } + + # Wait until all the special cases have been read since + # they are not listed in numeric order. + my $ix = hex($code); + push @{$Case{Lower}}, [ $ix, $code, $lower ]; + push @{$Case{Title}}, [ $ix, $code, $title ]; + push @{$Case{Upper}}, [ $ix, $code, $upper ]; + } +} else { + die "$0: SpecCase.txt: $!\n"; +} + +# Now write out the special cases properties in their code point order. +# The To/Spec{Lower,Title,Upper}.pl are unused for now since the swash +# routines do not do returning multiple characters. + +for my $case (qw(Lower Title Upper)) { + my @case; + for my $prop (sort { $a->[0] <=> $b->[0] } @{$Case{$case}}) { + my ($ix, $code, $to) = @$prop; + append(\@case, $code, $to); + } + flush(\@case, "To/Spec$case.pl"); +} + # That's all, folks! diff --git a/lib/unicore/mktables.PL b/lib/unicore/mktables.PL deleted file mode 100755 index e281edd972..0000000000 --- a/lib/unicore/mktables.PL +++ /dev/null @@ -1,879 +0,0 @@ -#!../../miniperl - -use bytes; - -$UnicodeData = "Unicode.txt"; -$SyllableData = "syllables.txt"; -$PropData = "PropList.txt"; - -my $UnicodeLastHex = '10FFFF'; - -# Note: we try to keep filenames unique within first 8 chars. Using -# subdirectories for the following helps. -mkdir "In", 0755; -mkdir "Is", 0755; -mkdir "To", 0755; - -@todo = ( -# typical - - # 005F: SPACING UNDERSCROE - ['IsWord', '$cat =~ /^[LMN]/ or $code eq "005F"', ''], - ['IsAlnum', '$cat =~ /^[LMN]/', ''], - ['IsAlpha', '$cat =~ /^[LM]/', ''], - # 0009: HORIZONTAL TABULATION - # 000A: LINE FEED - # 000B: VERTICAL TABULATION - # 000C: FORM FEED - # 000D: CARRIAGE RETURN - # 0020: SPACE - ['IsSpace', '$cat =~ /^Z/ || - $code =~ /^(0009|000A|000B|000C|000D)$/', ''], - ['IsSpacePerl', - '$cat =~ /^Z/ || - $code =~ /^(0009|000A|000C|000D)$/', ''], - ['IsBlank', '$code =~ /^(0020|0009)$/ || - $cat =~ /^Z[^lp]$/', ''], - ['IsDigit', '$cat =~ /^Nd$/', ''], - ['IsUpper', '$cat =~ /^L[ut]$/', ''], - ['IsLower', '$cat =~ /^Ll$/', ''], - ['IsASCII', '$code le "007f"', ''], - ['IsCntrl', '$cat =~ /^C/', ''], - ['IsGraph', '$cat =~ /^([LMNPS]|Co)/', ''], - ['IsPrint', '$cat =~ /^([LMNPS]|Co|Zs)/', ''], - ['IsPunct', '$cat =~ /^P/', ''], - # 003[0-9]: DIGIT ZERO..NINE, 00[46][1-6]: A..F, a..f - ['IsXDigit', '$code =~ /^00(3[0-9]|[46][1-6])$/', ''], - ['ToUpper', '$up', '$up'], - ['ToLower', '$down', '$down'], - ['ToTitle', '$title', '$title'], - ['ToDigit', '$dec ne ""', '$dec'], - -# Name - - ['Name', '$name', '$name'], - -# Category - - ['Category', '$cat', '$cat'], - -# Normative - - ['IsM', '$cat =~ /^M/', ''], # Mark - ['IsMn', '$cat eq "Mn"', ''], # Mark, Non-Spacing - ['IsMc', '$cat eq "Mc"', ''], # Mark, Combining - ['IsMe', '$cat eq "Me"', ''], # Mark, Enclosing - - ['IsN', '$cat =~ /^N/', ''], # Number - ['IsNd', '$cat eq "Nd"', ''], # Number, Decimal Digit - ['IsNo', '$cat eq "No"', ''], # Number, Other - ['IsNl', '$cat eq "Nl"', ''], # Number, Letter - - ['IsZ', '$cat =~ /^Z/', ''], # Separator - ['IsZs', '$cat eq "Zs"', ''], # Separator, Space - ['IsZl', '$cat eq "Zl"', ''], # Separator, Line - ['IsZp', '$cat eq "Zp"', ''], # Separator, Paragraph - - ['IsC', '$cat =~ /^C/', ''], # Crazy - ['IsCc', '$cat eq "Cc"', ''], # Other, Control or Format - ['IsCo', '$cat eq "Co"', ''], # Other, Private Use - ['IsCn', '$cat eq "Cn"', ''], # Other, Not Assigned - ['IsCf', '$cat eq "Cf"', ''], # Other, Format - ['IsCs', '$cat eq "Cs"', ''], # Other, Surrogate - ['IsCn', 'Unassigned Code Value',$PropData], # Other, Not Assigned - -# Informative - - ['IsL', '$cat =~ /^L/', ''], # Letter - ['IsLu', '$cat eq "Lu"', ''], # Letter, Uppercase - ['IsLl', '$cat eq "Ll"', ''], # Letter, Lowercase - ['IsLt', '$cat eq "Lt"', ''], # Letter, Titlecase - ['IsLm', '$cat eq "Lm"', ''], # Letter, Modifier - ['IsLo', '$cat eq "Lo"', ''], # Letter, Other - - ['IsP', '$cat =~ /^P/', ''], # Punctuation - ['IsPd', '$cat eq "Pd"', ''], # Punctuation, Dash - ['IsPs', '$cat eq "Ps"', ''], # Punctuation, Open - ['IsPe', '$cat eq "Pe"', ''], # Punctuation, Close - ['IsPo', '$cat eq "Po"', ''], # Punctuation, Other - ['IsPc', '$cat eq "Pc"', ''], # Punctuation, Connector - ['IsPi', '$cat eq "Pi"', ''], # Punctuation, Initial quote - ['IsPf', '$cat eq "Pf"', ''], # Punctuation, Final quote - - ['IsS', '$cat =~ /^S/', ''], # Symbol - ['IsSm', '$cat eq "Sm"', ''], # Symbol, Math - ['IsSk', '$cat eq "Sk"', ''], # Symbol, Modifier - ['IsSc', '$cat eq "Sc"', ''], # Symbol, Currency - ['IsSo', '$cat eq "So"', ''], # Symbol, Other - -# Combining class - ['CombiningClass', '$comb', '$comb'], - -# BIDIRECTIONAL PROPERTIES - - ['Bidirectional', '$bid', '$bid'], - -# Strong types: - - ['IsBidiL', '$bid eq "L"', ''], # Left-Right; Most alphabetic, - # syllabic, and logographic - # characters (e.g., CJK - # ideographs) - ['IsBidiR', '$bid eq "R"', ''], # Right-Left; Arabic, Hebrew, - # and punctuation specific to - # those scripts - - ['IsBidiLRE', '$bid eq "LRE"', ''], # Left-to-Right Embedding - ['IsBidiLRO', '$bid eq "LRO"', ''], # Left-to-Right Override - ['IsBidiAL', '$bid eq "AL"', ''], # Right-to-Left Arabic - ['IsBidiRLE', '$bid eq "RLE"', ''], # Right-to-Left Embedding - ['IsBidiRLO', '$bid eq "RLO"', ''], # Right-to-Left Override - ['IsBidiPDF', '$bid eq "PDF"', ''], # Pop Directional Format - ['IsBidiNSM', '$bid eq "NSM"', ''], # Non-Spacing Mark - ['IsBidiBN', '$bid eq "BN"', ''], # Boundary Neutral - -# Weak types: - - ['IsBidiEN','$bid eq "EN"', ''], # European Number - ['IsBidiES','$bid eq "ES"', ''], # European Number Separator - ['IsBidiET','$bid eq "ET"', ''], # European Number Terminator - ['IsBidiAN','$bid eq "AN"', ''], # Arabic Number - ['IsBidiCS','$bid eq "CS"', ''], # Common Number Separator - -# Separators: - - ['IsBidiB', '$bid eq "B"', ''], # Block Separator - ['IsBidiS', '$bid eq "S"', ''], # Segment Separator - -# Neutrals: - - ['IsBidiWS','$bid eq "WS"', ''], # Whitespace - ['IsBidiON','$bid eq "ON"', ''], # Other Neutrals ; All other - # characters: punctuation, - # symbols - -# Decomposition - - ['Decomposition', '$decomp', '$decomp'], - ['IsDecoCanon', '$decomp && $decomp !~ /^</', ''], - ['IsDecoCompat', '$decomp =~ /^</', ''], - ['IsDCfont', '$decomp =~ /^<font>/', ''], - ['IsDCnoBreak', '$decomp =~ /^<noBreak>/', ''], - ['IsDCinitial', '$decomp =~ /^<initial>/', ''], - ['IsDCmedial', '$decomp =~ /^<medial>/', ''], - ['IsDCfinal', '$decomp =~ /^<final>/', ''], - ['IsDCisolated', '$decomp =~ /^<isolated>/', ''], - ['IsDCcircle', '$decomp =~ /^<circle>/', ''], - ['IsDCsuper', '$decomp =~ /^<super>/', ''], - ['IsDCsub', '$decomp =~ /^<sub>/', ''], - ['IsDCvertical', '$decomp =~ /^<vertical>/', ''], - ['IsDCwide', '$decomp =~ /^<wide>/', ''], - ['IsDCnarrow', '$decomp =~ /^<narrow>/', ''], - ['IsDCsmall', '$decomp =~ /^<small>/', ''], - ['IsDCsquare', '$decomp =~ /^<square>/', ''], - ['IsDCfraction', '$decomp =~ /^<fraction>/', ''], - ['IsDCcompat', '$decomp =~ /^<compat>/', ''], - -# Number - - ['Number', '$num ne ""', '$num'], - -# Mirrored - - ['IsMirrored', '$mir eq "Y"', ''], - -# Arabic - - ['ArabLink', '1', '$link'], - ['ArabLnkGrp', '1', '$linkgroup'], - -# Jamo - - ['JamoShort', '1', '$short'], - -# Syllables - - syllable_defs(), - -# Line break properties - Normative - - ['IsLbrkBK','$brk eq "BK"', ''], # Mandatory Break - ['IsLbrkCR','$brk eq "CR"', ''], # Carriage Return - ['IsLbrkLF','$brk eq "LF"', ''], # Line Feed - ['IsLbrkCM','$brk eq "CM"', ''], # Attached Characters and Combining Marks - ['IsLbrkSG','$brk eq "SG"', ''], # Surrogates - ['IsLbrkGL','$brk eq "GL"', ''], # Non-breaking (Glue) - ['IsLbrkCB','$brk eq "CB"', ''], # Contingent Break Opportunity - ['IsLbrkSP','$brk eq "SP"', ''], # Space - ['IsLbrkZW','$brk eq "ZW"', ''], # Zero Width Space - -# Line break properties - Informative - ['IsLbrkXX','$brk eq "XX"', ''], # Unknown - ['IsLbrkOP','$brk eq "OP"', ''], # Opening Punctuation - ['IsLbrkCL','$brk eq "CL"', ''], # Closing Punctuation - ['IsLbrkQU','$brk eq "QU"', ''], # Ambiguous Quotation - ['IsLbrkNS','$brk eq "NS"', ''], # Non Starter - ['IsLbrkEX','$brk eq "EX"', ''], # Exclamation/Interrogation - ['IsLbrkSY','$brk eq "SY"', ''], # Symbols Allowing Breaks - ['IsLbrkIS','$brk eq "IS"', ''], # Infix Separator (Numeric) - ['IsLbrkPR','$brk eq "PR"', ''], # Prefix (Numeric) - ['IsLbrkPO','$brk eq "PO"', ''], # Postfix (Numeric) - ['IsLbrkNU','$brk eq "NU"', ''], # Numeric - ['IsLbrkAL','$brk eq "AL"', ''], # Ordinary Alphabetic and Symbol Characters - ['IsLbrkID','$brk eq "ID"', ''], # Ideographic - ['IsLbrkIN','$brk eq "IN"', ''], # Inseparable - ['IsLbrkHY','$brk eq "HY"', ''], # Hyphen - ['IsLbrkBB','$brk eq "BB"', ''], # Break Opportunity Before - ['IsLbrkBA','$brk eq "BA"', ''], # Break Opportunity After - ['IsLbrkSA','$brk eq "SA"', ''], # Complex Context (South East Asian) - ['IsLbrkAI','$brk eq "AI"', ''], # Ambiguous (Alphabetic or Ideographic) - ['IsLbrkB2','$brk eq "B2"', ''], # Break Opportunity Before and After -); - -# This is not written for speed... - -my %InIdScript; -my %InIdBlock; -my $InId = 0; - -foreach $file (@todo) { - my ($table, $wanted, $val) = @$file; - next if @ARGV and not grep { $_ eq $table } @ARGV; - print $table, "\n"; - $table =~ s/\W+//g; - if ($table =~ /^(Is|To)(.+)/) { - open(OUT, ">$1/$2.pl") or die "Can't create $1/$2.pl: $!\n"; - } - else { - open(OUT, ">$table.pl") or die "Can't create $table.pl: $!\n"; - } - print OUT <<EOH; -# !!!!!!! DO NOT EDIT THIS FILE !!!!!!! -# This file is built by $0 from e.g. $UnicodeData. -# Any changes made here will be lost! -EOH - print OUT <<"END"; -return <<'END'; -END - print OUT proplist($table, $wanted, $val); - print OUT "END\n"; - close OUT; -} - -print "Scripts\n"; -open(UD, 'Scripts.txt') or die "Can't open Scripts.txt: $!\n"; -open(OUT, ">Scripts.pl") or die "Can't create Scripts.pl: $!\n"; -print OUT <<EOH; -# !!!!!!! DO NOT EDIT THIS FILE !!!!!!! -# This file is built by $0 from e.g. $UnicodeData. -# Any changes made here will be lost! -EOH -print OUT <<"END"; -return <<'END'; -END - -my %Scripts; -my $ScriptsVec = ''; -my $lastlast = 0; - -while (<UD>) { - next if /^#/; - next if /^$/; - chomp; - ($code, $last, $name) = /^([0-9a-f]+)(?:\.\.([0-9a-f]+))?\s+;\s+(.+)\s+\#/i; - if ($name) { - my $InName = $name; - my $id; - unless (exists $InIdScript{$InName}) { - print "\t$InName\n"; - $id = $Scripts{$InName} = $InIdScript{$InName} = $InId++; - open(SCRIPT, ">In/$id.pl") or die "create In/$id.pl: $!\n"; - print SCRIPT <<EOH; -# !!!!!!! DO NOT EDIT THIS FILE !!!!!!! -# This file is built by $0 from e.g. $UnicodeData. -# Any changes made here will be lost! -return <<'END'; -EOH - close(SCRIPT); - } else { - $id = $InIdScript{$InName}; - } - $last = "" unless defined $last; - print OUT "$code\t$last\t$name\t# In/$id.pl\n"; - open(SCRIPT, ">>In/$id.pl"); - print SCRIPT <<END; -$code $last -END - close SCRIPT; - } - my $firsti = hex($code); - my $lasti = $last ? hex($last) : $firsti; - for my $i ($firsti..$lasti) { - vec($ScriptsVec, $i, 1) = 1; - } - $lastlast = $lasti if $lasti > $lastlast; - print "\t\t$code..$last\n"; -} - -for my $id (values %InIdScript) { - open(SCRIPT, ">>In/$id.pl"); - print SCRIPT <<END2; -END -END2 - close(SCRIPT); -} - -print OUT "END\n"; -close OUT; - -# Must treat blocks specially. - -exit if @ARGV and not grep { $_ eq Block } @ARGV; -print "Blocks\n"; -open(UD, 'Blocks.txt') or die "Can't open Blocks.txt: $!\n"; -open(OUT, ">Blocks.pl") or die "Can't create Blocks.pl: $!\n"; -print OUT <<EOH; -# !!!!!!! DO NOT EDIT THIS FILE !!!!!!! -# This file is built by $0 from e.g. $UnicodeData. -# Any changes made here will be lost! -EOH -print OUT <<"END"; -return <<'END'; -END - -while (<UD>) { - next if /^#/; - next if /^$/; - chomp; - ($code, $last, $name) = /^([0-9a-f]+)\.\.([0-9a-f]+); (.+?)\s*$/i; - if ($name) { - my $InName = $name; - print "\t$InName\n"; - my $id; - # TODO: only the first one of Private Use blocks qualifies - unless (exists $InIdBlock{$InName}) { - $InIdBlock{$InName} = $InId++; - } - $id = $InIdBlock{$InName}; - open(BLOCK, ">In/$id.pl") or die "create In/$id.pl: $!\n"; - print OUT "$code\t$last\t$name\t# In/$id.pl\n"; - print BLOCK <<EOH; -# !!!!!!! DO NOT EDIT THIS FILE !!!!!!! -# This file is built by $0 from e.g. $UnicodeData. -# Any changes made here will be lost! -EOH - print BLOCK <<"END2"; -return <<'END'; -$code $last -END -END2 - close BLOCK; - } -} - -print OUT "END\n"; -close OUT; - -# -# \p{Common} is any code point not assigned to a script -# - -my $first; - -sub flush_zero_range { - my ($i) = @_; - if (defined $first) { - my $last = $i - 1; - $last = $last == $first ? "" : sprintf("%04x", $last); - printf SCRIPT "%04x\t$last\n", $first; - printf "\t\t%04x..$last\n", $first; - undef $first; - } -} - -print "\tCommon\n"; -my $CommonId = $Scripts{Common} = $InIdScript{Common} = $InId++; -open(SCRIPT, ">In/$CommonId.pl") or die "create In/$CommonId.pl: $!\n"; -print SCRIPT <<EOH; -# !!!!!!! DO NOT EDIT THIS FILE !!!!!!! -# This file is built by $0 from e.g. $UnicodeData. -# Any changes made here will be lost! -return <<'END'; -EOH - -undef $first; -for my $i (0..$lastlast) { - if (vec($ScriptsVec, $i, 1)) { - defined $first && flush_zero_range($i); - } else { - $first = $i unless defined $first; - } -} -flush_zero_range($lastlast+1); -print SCRIPT "END\n"; -close(SCRIPT); - -# -# \p{Any} is 0..10FFFF (in Unicode 3.1.1) -# - -print "\tAny\n"; -my $AnyId = $Scripts{Any} = $InIdScript{Any} = $InId++; -open(SCRIPT, ">In/$AnyId.pl") or die "create In/$AnyId.pl: $!\n"; -print SCRIPT <<EOH; -# !!!!!!! DO NOT EDIT THIS FILE !!!!!!! -# This file is built by $0 from e.g. $UnicodeData. -# Any changes made here will be lost! -return <<END; -0000 $UnicodeLastHex -END -EOH - -my $CnVec = ''; - -open(UD, 'PropList.txt') or die "Can't open PropList.txt: $!\n"; - -my $InIdProp; -while (<UD>) { - next if /^#/; - next if /^$/; - chomp; - ($code, $last, $name) = /^([0-9a-f]+)(?:\.\.([0-9a-f]+))?\s+; (\w+)\s/i; - $last = "" unless defined $last; - if ($name) { - my $InName = $name; - my $id; - unless (exists $InIdScript{$InName}) { - print "\t$InName\n"; - print PROP <<EOH if defined $InIdProp; -END -EOH - $id = $InIdProp = $InIdScript{$InName} = $InId++; - open(PROP, ">In/$id.pl") or die "create In/$id.pl: $!\n"; - print PROP <<EOH; -# !!!!!!! DO NOT EDIT THIS FILE !!!!!!! -# This file is built by $0 from e.g. $UnicodeData. -# Any changes made here will be lost! -return <<END; -EOH - } - $id = $InIdScript{$InName}; - print PROP "\L$code\t\L$last\n"; - if ($InName eq 'Noncharacter_Code_Point') { - my $firsti = hex($code); - my $lasti = $last ? hex($last) : $firsti; - for my $i ($firsti..$lasti) { - vec($CnVec, $i, 1) = 1; - } - } - } -} -print PROP "END\n"; - -print "\tAssigned\n"; -my $AssignedId = $Scripts{Assigned} = $InIdScript{Assigned} = $InId++; -open(SCRIPT, ">In/$AssignedId.pl") or die "create In/$AssignedId.pl: $!\n"; -print SCRIPT <<EOH; -# !!!!!!! DO NOT EDIT THIS FILE !!!!!!! -# This file is built by $0 from e.g. $UnicodeData. -# Any changes made here will be lost! -return <<'END'; -EOH - -undef $first; -for my $i (0..hex($UnicodeLastHex)) { - if (vec($CnVec, $i, 1)) { - defined $first && flush_zero_range($i); - } else { - $first = $i unless defined $first; - } -} -flush_zero_range(hex($UnicodeLastHex)+1); -print SCRIPT "END\n"; - -# -# \p{Alphabetic} is \pL and \p{Other_Alphabetic} -# - -print "\tAlphabetic\n"; -my @Alphabetic; -push @Alphabetic, split(/\n/, do "Is/L.pl"); -push @Alphabetic, split(/\n/, do "In/$InIdScript{Other_Alphabetic}.pl"); -$id = $InIdScript{Alphabetic} = $InId++; -open(PROP, ">In/$id.pl") or die "create In/$id.pl: $!\n"; -print PROP <<EOH; -# !!!!!!! DO NOT EDIT THIS FILE !!!!!!! -# This file is built by $0 from e.g. $UnicodeData. -# Any changes made here will be lost! -return <<END; -EOH -for (sort { hex($a) <=> hex($b) } @Alphabetic) { - print PROP "$_\n"; -} -print PROP <<EOH; -END -EOH - -# -# \p{Lowercase} is \p{Ll} and \p{Other_Lowercase} -# - -print "\tLowercase\n"; -my @Lowercase; -push @Lowercase, split(/\n/, do "Is/Ll.pl"); -push @Lowercase, split(/\n/, do "In/$InIdScript{Other_Lowercase}.pl"); -$id = $InIdScript{Lowercase} = $InId++; -open(PROP, ">In/$id.pl") or die "create In/$id.pl: $!\n"; -print PROP <<EOH; -# !!!!!!! DO NOT EDIT THIS FILE !!!!!!! -# This file is built by $0 from e.g. $UnicodeData. -# Any changes made here will be lost! -return <<END; -EOH -for (sort { hex($a) <=> hex($b) } @Lowercase) { - print PROP "$_\n"; -} -print PROP <<EOH; -END -EOH - -# -# \p{Uppercase} is \p{Lu} and \p{Other_Uppercase} -# - -print "\tUppercase\n"; -my @Uppercase; -push @Uppercase, split(/\n/, do "Is/Lu.pl"); -push @Uppercase, split(/\n/, do "In/$InIdScript{Other_Uppercase}.pl"); -$id = $InIdScript{Uppercase} = $InId++; -open(PROP, ">In/$id.pl") or die "create In/$id.pl: $!\n"; -print PROP <<EOH; -# !!!!!!! DO NOT EDIT THIS FILE !!!!!!! -# This file is built by $0 from e.g. $UnicodeData. -# Any changes made here will be lost! -return <<END; -EOH -for (sort { hex($a) <=> hex($b) } @Uppercase) { - print PROP "$_\n"; -} -print PROP <<EOH; -END -EOH - -# -# \p{Math} is \p{Sm} and \p{Other_Math} -# - -print "\tMath\n"; -my @Math; -push @Math, split(/\n/, do "Is/Sm.pl"); -push @Math, split(/\n/, do "In/$InIdScript{Other_Math}.pl"); -$id = $InIdScript{Math} = $InId++; -open(PROP, ">In/$id.pl") or die "create In/$id.pl: $!\n"; -print PROP <<EOH; -# !!!!!!! DO NOT EDIT THIS FILE !!!!!!! -# This file is built by $0 from e.g. $UnicodeData. -# Any changes made here will be lost! -return <<END; -EOH -for (sort { hex($a) <=> hex($b) } @Math) { - print PROP "$_\n"; -} -print PROP <<EOH; -END -EOH - -# -# \p{L&} is \p{Ll}, \p{Lu} and \p{Lt} -# - -print "\tLampersand\n"; -my @Lampersand; -push @Lampersand, split(/\n/, do "Is/Ll.pl"); -push @Lampersand, split(/\n/, do "Is/Lu.pl"); -push @Lampersand, split(/\n/, do "Is/Lt.pl"); -$id = $InIdScript{Lampersand} = $InId++; -open(PROP, ">In/$id.pl") or die "create In/$id.pl: $!\n"; -print PROP <<EOH; -# !!!!!!! DO NOT EDIT THIS FILE !!!!!!! -# This file is built by $0 from e.g. $UnicodeData. -# Any changes made here will be lost! -return <<END; -EOH -for (sort { hex($a) <=> hex($b) } @Lampersand) { - print PROP "$_\n"; -} -print PROP <<EOH; -END -EOH - -# -# \p{ID_Start} is \p{Ll}, \p{Lu}, \p{Lt}, \p{Lm}, \p{Lo}, and \p{Nl} -# - -print "\tID_Start\n"; -my @ID_Start; -push @ID_Start, split(/\n/, do "Is/Ll.pl"); -push @ID_Start, split(/\n/, do "Is/Lu.pl"); -push @ID_Start, split(/\n/, do "Is/Lt.pl"); -push @ID_Start, split(/\n/, do "Is/Lm.pl"); -push @ID_Start, split(/\n/, do "Is/Lo.pl"); -push @ID_Start, split(/\n/, do "Is/Nl.pl"); -$id = $InIdScript{ID_Start} = $InId++; -open(PROP, ">In/$id.pl") or die "create In/$id.pl: $!\n"; -print PROP <<EOH; -# !!!!!!! DO NOT EDIT THIS FILE !!!!!!! -# This file is built by $0 from e.g. $UnicodeData. -# Any changes made here will be lost! -return <<END; -EOH -for (sort { hex($a) <=> hex($b) } @ID_Start) { - print PROP "$_\n"; -} -print PROP <<EOH; -END -EOH - -# -# \p{ID_Continue} is \p{ID_Start}, \p{Mn}, \p{Mc}, \p{Nd}, and \p{Pc} -# - -print "\tID_Continue\n"; -my @ID_Continue; -push @ID_Continue, split(/\n/, do "In/$InIdScript{ID_Start}.pl"); -push @ID_Continue, split(/\n/, do "Is/Mn.pl"); -push @ID_Continue, split(/\n/, do "Is/Mc.pl"); -push @ID_Continue, split(/\n/, do "Is/Nd.pl"); -push @ID_Continue, split(/\n/, do "Is/Pc.pl"); -$id = $InIdScript{ID_Continue} = $InId++; -open(PROP, ">In/$id.pl") or die "create In/$id.pl: $!\n"; -print PROP <<EOH; -# !!!!!!! DO NOT EDIT THIS FILE !!!!!!! -# This file is built by $0 from e.g. $UnicodeData. -# Any changes made here will be lost! -return <<END; -EOH -for (sort { hex($a) <=> hex($b) } @ID_Continue) { - print PROP "$_\n"; -} -print PROP <<EOH; -END -EOH - -open(INID, ">In.pl"); - -print INID <<EOH; -# !!!!!!! DO NOT EDIT THIS FILE !!!!!!! -# This file is built by $0 from e.g. $UnicodeData. -# Any changes made here will be lost! -%utf8::In = ( -EOH - -my %InIdScriptById = reverse %InIdScript; -my %InIdBlockById = reverse %InIdBlock; - -my @InIdScriptById = sort { $a <=> $b } keys %InIdScriptById; -my @InIdBlockById = sort { $a <=> $b } keys %InIdBlockById; - -my %InId; -my %IdIdLcName; - -for my $id (@InIdScriptById) { - my $name = $InIdScriptById{$id}; - my $lcname = lc($name); - $InId{$name} = $id; - $IdIdLcName{$lcname} = $id; -} - -for my $id (@InIdBlockById) { - my $name = $InIdBlockById{$id}; - my $lcname = lc($name); - if (exists $IdIdLcName{$lcname}) { - $InId{"$name Block"} = $id; - } else { - $InId{$name} = $id; - } - $IdIdLcName{$lcname} = $id; -} - -my @InId = sort { $InId{$a} <=> $InId{$b} } keys %InId; - -my %InIdPrefix; - -foreach my $in (@InId) { - my $inpat = $in; - $inpat =~ s/([- _])/(?:[-_]|\\s+)?/g; - my $inprefix = lc(substr($in, 0, 2)); - push @{$InIdPrefix{$inprefix}}, [ $in, $inpat ]; - printf INID "%-45s => %3d,\n", "'$in'", $InId{$in}; -} - -print INID ");\n"; - -print INID <<EOH; -%utf8::InPat = ( -EOH - -foreach my $prefix (sort keys %InIdPrefix) { - printf INID "'$prefix' => {\n"; - foreach my $ininpat (@{$InIdPrefix{$prefix}}) { - my ($in, $inpat) = @$ininpat; - printf INID "\t'$inpat' => '$in',\n"; - } - printf INID "},\n"; -} - -print INID ");\n"; - -close(INID); - -################################################## - -sub proplist { - my ($table, $wanted, $val) = @_; - my @wanted; - my $out; - my $split; - - return listFromPropFile($wanted) if $val eq $PropData; - - if ($table =~ /^Arab/) { - open(UD, "ArabShap.txt") or warn "Can't open $table: $!"; - - $split = '($code, $name, $link, $linkgroup) = split(/; */);'; - } - elsif ($table =~ /^Jamo/) { - open(UD, "Jamo.txt") or warn "Can't open $table: $!"; - - $split = '($code, $short, $name) = split(/; */); $code =~ s/^U\+//;'; - } - elsif ($table =~ /^IsSyl/) { - open(UD, $SyllableData) or warn "Can't open $table: $!"; - - $split = '($code, $short, $syl) = split(/; */); $code =~ s/^U\+//;'; - } - elsif ($table =~ /^IsLbrk/) { - open(UD, "LineBrk.txt") or warn "Can't open $table: $!"; - - $split = '($code, $brk, $name) = /^([0-9a-f]+);(\w+) # (.+)/i;'; - } - else { - open(UD, $UnicodeData) or warn "Can't open $UnicodeData: $!"; - - $split = '($code, $name, $cat, $comb, $bid, $decomp, $dec, $dig, $num, $mir, $uni1, - $comment, $up, $down, $title) = split(/;/);'; - } - - if ($table =~ /^(?:To|Is)[A-Z]/) { - eval <<"END"; - while (<UD>) { - next if /^#/; - next if /^\\s/; - s/\\s+\$//; - $split - if ($wanted) { - push(\@wanted, [hex \$code, hex $val, \$name =~ /, First>\$/]); - } - } -END - die $@ if $@; - - while (@wanted) { - $beg = shift @wanted; - $last = $beg; - while (@wanted and $wanted[0]->[0] == $last->[0] + 1 and - (not $val or $wanted[0]->[1] == $last->[1] + 1)) { - $last = shift @wanted; - } - $out .= sprintf "%04x", $beg->[0]; - if ($beg->[2]) { - $last = shift @wanted; - } - if ($beg == $last) { - $out .= "\t"; - } - else { - $out .= sprintf "\t%04x", $last->[0]; - } - $out .= sprintf "\t%04x", $beg->[1] if $val; - $out .= "\n"; - } - } - else { - eval <<"END"; - while (<UD>) { - next if /^#/; - next if /^\\s*\$/; - chop; - $split - if ($wanted) { - push(\@wanted, [hex \$code, $val, \$name =~ /, First>\$/]); - } - } -END - die $@ if $@; - - while (@wanted) { - $beg = shift @wanted; - $last = $beg; - while (@wanted and $wanted[0]->[0] == $last->[0] + 1 and - ($wanted[0]->[1] eq $last->[1])) { - $last = shift @wanted; - } - $out .= sprintf "%04x", $beg->[0]; - if ($beg->[2]) { - $last = shift @wanted; - } - if ($beg == $last) { - $out .= "\t"; - } - else { - $out .= sprintf "\t%04x", $last->[0]; - } - $out .= sprintf "\t%s\n", $beg->[1]; - } - } - $out; -} - -sub listFromPropFile { - my ($wanted) = @_; - my $out; - - open (UD, $PropData) or die "Can't open $PropData: $!\n"; - local($/) = "\n" . '*' x 43 . "\n\nProperty dump for:"; # not 42? - - <UD>; - while (<UD>) { - chomp; - if (s/0x[\d\w]+\s+\((.*?)\)// and $wanted eq $1) { - s/\(\d+ chars\)//g; - s/^\s+//mg; - s/\s+$//mg; - s/\.\./\t/g; - $out = lc $_; - last; - } - } - close (UD); - "$out\n"; -} - -sub syllable_defs { - my @defs; - my %seen; - - open (SD, $SyllableData) or die "Can't open $SyllableData: $!\n"; - while (<SD>) { - next if /^\s*(#|$)/; - s/\s+$//; - ($code, $name, $syl) = split /; */; - next unless $syl; - push (@defs, ["IsSyl$syl", qq{\$syl eq "$syl"}, '']) - unless $seen{$syl}++; - } - close (SD); - return (@defs); -} - -# eof diff --git a/lib/utf8_heavy.pl b/lib/utf8_heavy.pl index bbc082b1e0..0cc71f4368 100644 --- a/lib/utf8_heavy.pl +++ b/lib/utf8_heavy.pl @@ -27,7 +27,7 @@ sub SWASHNEW { unless (defined $file) { defined %utf8::Is || do "unicore/Is.pl"; - if ($type =~ /^(?:Is)?[- _]?([A-Z].*)$/i) { + if ($type =~ /^(?:Is|Category\s*=\s*)?[- _]?([A-Z].*)$/i) { my $istype = $1; print "istype = $istype\n" if DEBUG; unless ($list = do "unicore/Is/$istype.pl") { @@ -55,10 +55,11 @@ sub SWASHNEW { unless (defined $file) { defined %utf8::In || do "unicore/In.pl"; $type = 'Lampersand' if $type =~ /^(?:Is)?L&$/; - if ($type =~ /^(?:In)?[- _]?(?!herited$)(.+)/i) { - my $intype = $1; - print "intype = $intype\n" if DEBUG; - if (exists $utf8::Is{$istype}) { + if ($type =~ /^(In|(?:Script|Block)\s*=\s*)?[- _]?(?!herited$)(.+)/i) { + my $incat = $1; + my $intype = $2; + print "incat = $incat, intype = $intype\n" if DEBUG; + if (exists $utf8::In{$intype}) { $file = "unicore/In/$utf8::In{$intype}"; } else { my $inprefix = substr(lc($intype), 0, 2); @@ -69,7 +70,13 @@ sub SWASHNEW { for my $k (keys %{$utf8::InPat{$inprefix}}) { print "inprefix = $inprefix, In = $In, k = $k\n" if DEBUG; if ($In =~ /^$k$/i) { - $file = "unicore/In/$utf8::InPat{$inprefix}->{$k}"; + my $i = $utf8::InPat{$inprefix}->{$k}; + print "inprefix = $inprefix, In = $In, k = $k, i = $i\n" if DEBUG; + next if $incat =~ /^S/ && + !exists $utf8::InScript{$i}; + next if $incat =~ /^B/ && + !exists $utf8::InBlock{$i}; + $file = "unicore/In/$i"; print "inprefix = $inprefix, In = $In, k = $k, file = $file\n" if DEBUG; last; } @@ -159,6 +166,7 @@ sub SWASHNEW { # NOTE: utf8.c:swash_init() assumes entries are never modified once generated. sub SWASHGET { + # See utf8.c:Perl_swash_fetch for problems with this interface. my ($self, $start, $len) = @_; local $^D = 0 if $^D; my $type = $self->{TYPE}; diff --git a/makedef.pl b/makedef.pl index c10eeb7ff8..61107ffc77 100644 --- a/makedef.pl +++ b/makedef.pl @@ -235,7 +235,6 @@ if ($PLATFORM eq 'win32') { Perl_my_chsize Perl_same_dirent Perl_setenv_getix - Perl_sortsv Perl_unlnk Perl_watch Perl_safexcalloc @@ -631,6 +630,7 @@ my @syms = ($global_sym, $globvar_sym); # $pp_sym is not part of the API my @layer_syms = qw( PerlIOBase_clearerr PerlIOBase_close + PerlIOBase_dup PerlIOBase_eof PerlIOBase_error PerlIOBase_fileno @@ -656,6 +656,7 @@ my @layer_syms = qw( PerlIO_pending PerlIO_allocate PerlIO_push + PerlIO_sv_dup PerlIO_unread ); @@ -1147,6 +1148,7 @@ sub output_symbol { 1; __DATA__ # extra globals not included above. +Perl_cxinc perl_alloc perl_alloc_using perl_clone @@ -1156,42 +1158,43 @@ perl_destruct perl_free perl_parse perl_run -Perl_cxinc -PerlIO_define_layer -PerlIOBuf_set_ptrcnt -PerlIOBuf_get_cnt -PerlIOBuf_get_ptr -PerlIOBuf_bufsiz PerlIOBase_clearerr -PerlIOBase_setlinebuf +PerlIOBase_close +PerlIOBase_dup +PerlIOBase_eof +PerlIOBase_error +PerlIOBase_fileno PerlIOBase_pushed PerlIOBase_read +PerlIOBase_setlinebuf PerlIOBase_unread -PerlIOBase_error -PerlIOBase_eof -PerlIOBuf_tell -PerlIOBuf_seek -PerlIOBuf_write -PerlIOBuf_unread -PerlIOBuf_read -PerlIOBuf_open -PerlIOBase_fileno -PerlIOBuf_pushed +PerlIOBuf_bufsiz PerlIOBuf_fill PerlIOBuf_flush -PerlIOBase_close -PerlIO_define_layer -PerlIO_pending -PerlIO_unread -PerlIO_push +PerlIOBuf_get_cnt +PerlIOBuf_get_ptr +PerlIOBuf_open +PerlIOBuf_pushed +PerlIOBuf_read +PerlIOBuf_seek +PerlIOBuf_set_ptrcnt +PerlIOBuf_tell +PerlIOBuf_unread +PerlIOBuf_write PerlIO_allocate -PerlIO_arg_fetch PerlIO_apply_layers -perlsio_binmode +PerlIO_arg_fetch PerlIO_binmode +PerlIO_define_layer +PerlIO_define_layer +PerlIO_getpos PerlIO_init -PerlIO_tmpfile +PerlIO_pending +PerlIO_push PerlIO_setpos -PerlIO_getpos -PerlIO_vsprintf PerlIO_sprintf +PerlIO_sv_dup +PerlIO_tmpfile +PerlIO_unread +PerlIO_vsprintf +perlsio_binmode @@ -4249,15 +4249,9 @@ Perl_cv_undef(pTHX_ CV *cv) * CV, they don't hold a refcount on the outside CV. This avoids * the refcount loop between the outer CV (which keeps a refcount to * the closure prototype in the pad entry for pp_anoncode()) and the - * closure prototype, and the ensuing memory leak. This does not - * apply to closures generated within eval"", since eval"" CVs are - * ephemeral. --GSAR */ - if (!CvANON(cv) || CvCLONED(cv) - || (CvOUTSIDE(cv) && SvTYPE(CvOUTSIDE(cv)) == SVt_PVCV - && CvEVAL(CvOUTSIDE(cv)) && !CvGV(CvOUTSIDE(cv)))) - { + * closure prototype, and the ensuing memory leak. --GSAR */ + if (!CvANON(cv) || CvCLONED(cv)) SvREFCNT_dec(CvOUTSIDE(cv)); - } CvOUTSIDE(cv) = Nullcv; if (CvCONST(cv)) { SvREFCNT_dec((SV*)CvXSUBANY(cv).any_ptr); @@ -4904,17 +4898,12 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block) } } - /* If a potential closure prototype, don't keep a refcount on - * outer CV, unless the latter happens to be a passing eval"". + /* If a potential closure prototype, don't keep a refcount on outer CV. * This is okay as the lifetime of the prototype is tied to the * lifetime of the outer CV. Avoids memory leak due to reference * loop. --GSAR */ - if (!name && CvOUTSIDE(cv) - && !(SvTYPE(CvOUTSIDE(cv)) == SVt_PVCV - && CvEVAL(CvOUTSIDE(cv)) && !CvGV(CvOUTSIDE(cv)))) - { + if (!name) SvREFCNT_dec(CvOUTSIDE(cv)); - } if (name || aname) { char *s; @@ -1,7 +1,9 @@ #!/usr/bin/perl -open(OC, ">opcode.h.new") || die "Can't create opcode.h.new: $!\n"; -open(ON, ">opnames.h.new") || die "Can't create opnames.h.new: $!\n"; +$opcode_new = 'opcode.h-new'; +$opname_new = 'opnames.h-new'; +open(OC, ">$opcode_new") || die "Can't create $opcode_new: $!\n"; +open(ON, ">$opname_new") || die "Can't create $opname_new: $!\n"; select OC; # Read data. @@ -262,11 +264,14 @@ close ON or die "Error closing opnames.h: $!"; chmod 0600, 'opcode.h'; # required by dosish filesystems chmod 0600, 'opnames.h'; # required by dosish filesystems -rename 'opcode.h.new', 'opcode.h' or die "renaming opcode.h: $!\n"; -rename 'opnames.h.new', 'opnames.h' or die "renaming opnames.h: $!\n"; +rename $opcode_new, 'opcode.h' or die "renaming opcode.h: $!\n"; +rename $opname_new, 'opnames.h' or die "renaming opnames.h: $!\n"; -open PP, '>pp_proto.h.new' or die "Error creating pp_proto.h.new: $!"; -open PPSYM, '>pp.sym.new' or die "Error creating pp.sym.new: $!"; +$pp_proto_new = 'pp_proto.h-new'; +$pp_sym_new = 'pp.sym-new'; + +open PP, ">$pp_proto_new" or die "Error creating $pp_proto_new: $!"; +open PPSYM, ">$pp_sym_new" or die "Error creating $pp_sym_new: $!"; print PP <<"END"; /* !!!!!!! DO NOT EDIT THIS FILE !!!!!!! @@ -307,8 +312,8 @@ close PPSYM or die "Error closing pp.sym: $!"; chmod 0600, 'pp_proto.h'; # required by dosish filesystems chmod 0600, 'pp.sym'; # required by dosish filesystems -rename 'pp_proto.h.new', 'pp_proto.h' or die "rename pp_proto.h: $!\n"; -rename 'pp.sym.new', 'pp.sym' or die "rename pp.sym: $!\n"; +rename $pp_proto_new, 'pp_proto.h' or die "rename pp_proto.h: $!\n"; +rename $pp_sym_new, 'pp.sym' or die "rename pp.sym: $!\n"; ########################################################################### sub tab { diff --git a/patchlevel.h b/patchlevel.h index 63c5c8ba66..fe2a1afd20 100644 --- a/patchlevel.h +++ b/patchlevel.h @@ -70,7 +70,7 @@ #if !defined(PERL_PATCHLEVEL_H_IMPLICIT) && !defined(LOCAL_PATCH_COUNT) static char *local_patches[] = { NULL - ,"DEVEL12440" + ,"DEVEL12493" ,NULL }; @@ -659,6 +659,7 @@ perl_destruct(pTHXx) SvREFCNT_dec(PL_utf8_xdigit); SvREFCNT_dec(PL_utf8_mark); SvREFCNT_dec(PL_utf8_toupper); + SvREFCNT_dec(PL_utf8_totitle); SvREFCNT_dec(PL_utf8_tolower); PL_utf8_alnum = Nullsv; PL_utf8_alnumc = Nullsv; @@ -923,6 +923,8 @@ END_EXTERN_C #define PL_hexdigit (*Perl_Ghexdigit_ptr(NULL)) #undef PL_malloc_mutex #define PL_malloc_mutex (*Perl_Gmalloc_mutex_ptr(NULL)) +#undef PL_my_inv_rand_max +#define PL_my_inv_rand_max (*Perl_Gmy_inv_rand_max_ptr(NULL)) #undef PL_op_mutex #define PL_op_mutex (*Perl_Gop_mutex_ptr(NULL)) #undef PL_patleave diff --git a/perlvars.h b/perlvars.h index 704192422a..e70dd7f772 100644 --- a/perlvars.h +++ b/perlvars.h @@ -40,3 +40,7 @@ PERLVAR(Gop_mutex, perl_mutex) /* Mutex for op refcounting */ PERLVAR(Gsharedsv_space, PerlInterpreter*) /* The shared sv space */ PERLVAR(Gsharedsv_space_mutex, perl_mutex) /* Mutex protecting the shared sv space */ #endif + +#if defined(VMS) && defined(Drand01_is_rand) +PERLVAR(Gmy_inv_rand_max, float) /* nasty compiler bug workaround */ +#endif diff --git a/pod/buildtoc.PL b/pod/buildtoc.PL index 601aa75ece..5d789624db 100644 --- a/pod/buildtoc.PL +++ b/pod/buildtoc.PL @@ -95,6 +95,7 @@ if (-d "pod") { qw( perl + perlintro perlfaq perltoc perlbook @@ -149,8 +150,9 @@ if (-d "pod") { perlsec perlmod - perlmodlib perlmodinstall + perlmodlib + perlmodstyle perlnewmod perlfaq1 diff --git a/pod/perl.pod b/pod/perl.pod index d6bc93bf4e..9d585b5d61 100644 --- a/pod/perl.pod +++ b/pod/perl.pod @@ -12,54 +12,75 @@ B<perl> S<[ B<-sTuU> ]> S<[ B<-hv> ] [ B<-V>[:I<configvar>] ]> S<[ B<-i>[I<extension>] ]> S<[ B<-e> I<'command'> ] [ B<--> ] [ I<programfile> ] [ I<argument> ]...> -For ease of access, the Perl manual has been split up into several sections: +If you're new to Perl, you should start with L<perlintro>, which is a +general intro for beginners and provides some background to help you +navigate the rest of Perl's extensive documentation. + +For ease of access, the Perl manual has been split up into several sections. + +=head2 Overview perl Perl overview (this section) - perlfaq Perl frequently asked questions + perlintro Perl introduction for beginners perltoc Perl documentation table of contents - perlbook Perl book information - perlsyn Perl syntax - perldata Perl data structures - perlop Perl operators and precedence - perlsub Perl subroutines - perlfunc Perl builtin functions +=head2 Tutorials + perlreftut Perl references short introduction perldsc Perl data structures intro + perllol Perl data structures: arrays of arrays + perlrequick Perl regular expressions quick start - perlpod Perl plain old documentation + perlretut Perl regular expressions tutorial + + perlboot Perl OO tutorial for beginners + perltoot Perl OO tutorial, part 1 + perltooc Perl OO tutorial, part 2 + perlbot Perl OO tricks and examples + perlstyle Perl style guide + perltrap Perl traps for the unwary + perldebtut Perl debugging tutorial + perlfaq Perl frequently asked questions + perlfaq1 General Questions About Perl + perlfaq2 Obtaining and Learning about Perl + perlfaq3 Programming Tools + perlfaq4 Data Manipulation + perlfaq5 Files and Formats + perlfaq6 Regexes + perlfaq7 Perl Language Issues + perlfaq8 System Interaction + perlfaq9 Networking + +=head2 Reference Manual + + perlsyn Perl syntax + perldata Perl data structures + perlop Perl operators and precedence + perlsub Perl subroutines + perlfunc Perl built-in functions + perlopentut Perl open() tutorial + perlpod Perl plain old documentation perlrun Perl execution and options perldiag Perl diagnostic messages perllexwarn Perl warnings and their control - perldebtut Perl debugging tutorial perldebug Perl debugging - perlvar Perl predefined variables - perllol Perl data structures: arrays of arrays - perlopentut Perl open() tutorial - perlretut Perl regular expressions tutorial - perlre Perl regular expressions, the rest of the story perlref Perl references, the rest of the story - perlform Perl formats - - perlboot Perl OO tutorial for beginners - perltoot Perl OO tutorial, part 1 - perltooc Perl OO tutorial, part 2 perlobj Perl objects - perlbot Perl OO tricks and examples perltie Perl objects hidden behind simple variables + perldbmfilter Perl DBM filters perlipc Perl interprocess communication perlfork Perl fork() information perlnumber Perl number semantics perlthrtut Perl threads tutorial - perlothrtut Perl old threads tutorial + perlothrtut Perl threads tutorial perlport Perl portability guide perllocale Perl locale support @@ -70,21 +91,18 @@ For ease of access, the Perl manual has been split up into several sections: perlmod Perl modules: how they work perlmodlib Perl modules: how to write and use + perlmodstyle Perl modules: how to write modules with style perlmodinstall Perl modules: how to install from CPAN perlnewmod Perl modules: preparing a new module for distribution - perlfaq1 General Questions About Perl - perlfaq2 Obtaining and Learning about Perl - perlfaq3 Programming Tools - perlfaq4 Data Manipulation - perlfaq5 Files and Formats - perlfaq6 Regexes - perlfaq7 Perl Language Issues - perlfaq8 System Interaction - perlfaq9 Networking + perlutil utilities packaged with the Perl distribution perlcompile Perl compiler suite intro + perlfilter Perl source filters + +=head2 Internals and C Language Interface + perlembed Perl ways to embed perl in your C or C++ application perldebguts Perl debugging guts and tips perlxstut Perl XS tutorial @@ -92,16 +110,19 @@ For ease of access, the Perl manual has been split up into several sections: perlclib Internal replacements for standard C library functions perlguts Perl internal functions for those doing extensions perlcall Perl calling conventions from C - perlutil utilities packaged with the Perl distribution - perlfilter Perl source filters - perldbmfilter Perl DBM filters + perlapi Perl API listing (autogenerated) perlintern Perl internal functions (autogenerated) perliol C API for Perl's implementation of IO in Layers perlapio Perl internal IO abstraction interface - perltodo Perl things to do + perlhack Perl hackers guide +=head2 Miscellaneous + + perlbook Perl book information + perltodo Perl things to do + perlhist Perl history records perldelta Perl changes since previous version perl572delta Perl changes in version 5.7.2 @@ -111,6 +132,8 @@ For ease of access, the Perl manual has been split up into several sections: perl5005delta Perl changes in version 5.005 perl5004delta Perl changes in version 5.004 +=head2 Platform-Specific + perlaix Perl notes for AIX perlamiga Perl notes for AmigaOS perlapollo Perl notes for Apollo DomainOS @@ -140,8 +163,6 @@ For ease of access, the Perl manual has been split up into several sections: perlvos Perl notes for Stratus VOS perlwin32 Perl notes for Windows -(If you're intending to read these straight through for the first time, -the suggested order will tend to reduce the number of forward references.) By default, the manpages listed above are installed in the F</usr/local/man/> directory. diff --git a/pod/perlapi.pod b/pod/perlapi.pod index ad4d3e45b2..0abdc1cb03 100644 --- a/pod/perlapi.pod +++ b/pod/perlapi.pod @@ -2397,22 +2397,22 @@ which guarantees to evaluate sv only once. =for hackers Found in file sv.h -=item SvNVx +=item SvNVX -Coerces the given SV to a double and returns it. Guarantees to evaluate -sv only once. Use the more efficent C<SvNV> otherwise. +Returns the raw value in the SV's NV slot, without checks or conversions. +Only use when you are sure SvNOK is true. See also C<SvNV()>. - NV SvNVx(SV* sv) + NV SvNVX(SV* sv) =for hackers Found in file sv.h -=item SvNVX +=item SvNVx -Returns the raw value in the SV's NV slot, without checks or conversions. -Only use when you are sure SvNOK is true. See also C<SvNV()>. +Coerces the given SV to a double and returns it. Guarantees to evaluate +sv only once. Use the more efficent C<SvNV> otherwise. - NV SvNVX(SV* sv) + NV SvNVx(SV* sv) =for hackers Found in file sv.h @@ -2606,21 +2606,21 @@ Like C<SvPV_nolen>, but converts sv to uft8 first if necessary. =for hackers Found in file sv.h -=item SvPVX +=item SvPVx -Returns a pointer to the physical string in the SV. The SV must contain a -string. +A version of C<SvPV> which guarantees to evaluate sv only once. - char* SvPVX(SV* sv) + char* SvPVx(SV* sv, STRLEN len) =for hackers Found in file sv.h -=item SvPVx +=item SvPVX -A version of C<SvPV> which guarantees to evaluate sv only once. +Returns a pointer to the physical string in the SV. The SV must contain a +string. - char* SvPVx(SV* sv, STRLEN len) + char* SvPVX(SV* sv) =for hackers Found in file sv.h @@ -2827,19 +2827,19 @@ false, defined or undefined. Does not handle 'get' magic. =for hackers Found in file sv.h -=item svtype +=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. +Returns the type of the SV. See C<svtype>. + + svtype SvTYPE(SV* sv) =for hackers Found in file sv.h -=item SvTYPE - -Returns the type of the SV. See C<svtype>. +=item svtype - svtype SvTYPE(SV* sv) +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 hackers Found in file sv.h diff --git a/pod/perldata.pod b/pod/perldata.pod index e4932a5f76..3e2482e784 100644 --- a/pod/perldata.pod +++ b/pod/perldata.pod @@ -415,95 +415,9 @@ and is almost always right. If it does guess wrong, or if you're just plain paranoid, you can force the correct interpretation with curly braces as above. -A line-oriented form of quoting is based on the shell "here-document" -syntax. Following a C<< << >> you specify a string to terminate -the quoted material, and all lines following the current line down to -the terminating string are the value of the item. The terminating -string may be either an identifier (a word), or some quoted text. If -quoted, the type of quotes you use determines the treatment of the -text, just as in regular quoting. An unquoted identifier works like -double quotes. There must be no space between the C<< << >> and -the identifier, unless the identifier is quoted. (If you put a space it -will be treated as a null identifier, which is valid, and matches the first -empty line.) The terminating string must appear by itself (unquoted and -with no surrounding whitespace) on the terminating line. - - print <<EOF; - The price is $Price. - EOF - - print << "EOF"; # same as above - The price is $Price. - EOF - - print << `EOC`; # execute commands - echo hi there - echo lo there - EOC - - print <<"foo", <<"bar"; # you can stack them - I said foo. - foo - I said bar. - bar - - myfunc(<< "THIS", 23, <<'THAT'); - Here's a line - or two. - THIS - and here's another. - THAT - -Just don't forget that you have to put a semicolon on the end -to finish the statement, as Perl doesn't know you're not going to -try to do this: - - print <<ABC - 179231 - ABC - + 20; - -If you want your here-docs to be indented with the -rest of the code, you'll need to remove leading whitespace -from each line manually: - - ($quote = <<'FINIS') =~ s/^\s+//gm; - The Road goes ever on and on, - down from the door where it began. - FINIS - -If you use a here-doc within a delimited construct, such as in C<s///eg>, -the quoted material must come on the lines following the final delimiter. -So instead of - - s/this/<<E . 'that' - the other - E - . 'more '/eg; - -you have to write - - s/this/<<E . 'that' - . 'more '/eg; - the other - E - -If the terminating identifier is on the last line of the program, you -must be sure there is a newline after it; otherwise, Perl will give the -warning B<Can't find string terminator "END" anywhere before EOF...>. - -Additionally, the quoting rules for the identifier are not related to -Perl's quoting rules -- C<q()>, C<qq()>, and the like are not supported -in place of C<''> and C<"">, and the only interpolation is for backslashing -the quoting character: - - print << "abc\"def"; - testing... - abc"def - -Finally, quoted strings cannot span multiple lines. The general rule is -that the identifier must be a string literal. Stick with that, and you -should be safe. +If you're looking for the information on how to use here-documents, +which used to be here, that's been moved to L<perlop> in the section on +L<Quote and Quote-like Operators>. =head2 List value constructors @@ -527,26 +441,26 @@ Note that the value of an actual array in scalar context is the length of the array; the following assigns the value 3 to $foo: @foo = ('cc', '-E', $bar); - $foo = @foo; # $foo gets 3 + $foo = @foo; # $foo gets 3 You may have an optional comma before the closing parenthesis of a list literal, so that you can say: @foo = ( - 1, - 2, - 3, + 1, + 2, + 3, ); To use a here-document to assign an array, one line per element, you might use an approach like this: @sauces = <<End_Lines =~ m/(\S.*\S)/g; - normal tomato - spicy tomato - green chile - pesto - white wine + normal tomato + spicy tomato + green chile + pesto + white wine End_Lines LISTs do automatic interpolation of sublists. That is, when a LIST is @@ -607,8 +521,8 @@ function: List assignment in scalar context returns the number of elements produced by the expression on the right side of the assignment: - $x = (($foo,$bar) = (3,2,1)); # set $x to 3, not 2 - $x = (($foo,$bar) = f()); # set $x to f()'s return count + $x = (($foo,$bar) = (3,2,1)); # set $x to 3, not 2 + $x = (($foo,$bar) = f()); # set $x to f()'s return count This is handy when you want to do a list assignment in a Boolean context, because most list functions return a null list when finished, @@ -663,23 +577,23 @@ interpreted as a string--if it's a bareword that would be a legal identifier. This makes it nice for initializing hashes: %map = ( - red => 0x00f, - blue => 0x0f0, - green => 0xf00, + red => 0x00f, + blue => 0x0f0, + green => 0xf00, ); or for initializing hash references to be used as records: $rec = { - witch => 'Mable the Merciless', - cat => 'Fluffy the Ferocious', - date => '10/31/1776', + witch => 'Mable the Merciless', + cat => 'Fluffy the Ferocious', + date => '10/31/1776', }; or for using call-by-named-parameter to complicated functions: $field = $query->radio_group( - name => 'group_name', + name => 'group_name', values => ['eenie','meenie','minie'], default => 'meenie', linebreak => 'true', @@ -695,33 +609,33 @@ of how to arrange for an output ordering. A common way to access an array or a hash is one scalar element at a time. You can also subscript a list to get a single element from it. - $whoami = $ENV{"USER"}; # one element from the hash - $parent = $ISA[0]; # one element from the array - $dir = (getpwnam("daemon"))[7]; # likewise, but with list + $whoami = $ENV{"USER"}; # one element from the hash + $parent = $ISA[0]; # one element from the array + $dir = (getpwnam("daemon"))[7]; # likewise, but with list A slice accesses several elements of a list, an array, or a hash simultaneously using a list of subscripts. It's more convenient than writing out the individual elements as a list of separate scalar values. - ($him, $her) = @folks[0,-1]; # array slice - @them = @folks[0 .. 3]; # array slice - ($who, $home) = @ENV{"USER", "HOME"}; # hash slice - ($uid, $dir) = (getpwnam("daemon"))[2,7]; # list slice + ($him, $her) = @folks[0,-1]; # array slice + @them = @folks[0 .. 3]; # array slice + ($who, $home) = @ENV{"USER", "HOME"}; # hash slice + ($uid, $dir) = (getpwnam("daemon"))[2,7]; # list slice Since you can assign to a list of variables, you can also assign to an array or hash slice. @days[3..5] = qw/Wed Thu Fri/; @colors{'red','blue','green'} - = (0xff0000, 0x0000ff, 0x00ff00); + = (0xff0000, 0x0000ff, 0x00ff00); @folks[0, -1] = @folks[-1, 0]; The previous assignments are exactly equivalent to ($days[3], $days[4], $days[5]) = qw/Wed Thu Fri/; ($colors{'red'}, $colors{'blue'}, $colors{'green'}) - = (0xff0000, 0x0000ff, 0x00ff00); + = (0xff0000, 0x0000ff, 0x00ff00); ($folks[0], $folks[-1]) = ($folks[0], $folks[-1]); Since changing a slice changes the original array or hash that it's @@ -731,9 +645,9 @@ values of the array or hash. foreach (@array[ 4 .. 10 ]) { s/peter/paul/ } foreach (@hash{keys %hash}) { - s/^\s+//; # trim leading whitespace - s/\s+$//; # trim trailing whitespace - s/(\w+)/\u\L$1/g; # "titlecase" words + s/^\s+//; # trim leading whitespace + s/\s+$//; # trim trailing whitespace + s/(\w+)/\u\L$1/g; # "titlecase" words } A slice of an empty list is still an empty list. Thus: @@ -751,7 +665,7 @@ This makes it easy to write loops that terminate when a null list is returned: while ( ($home, $user) = (getpwent)[7,0]) { - printf "%-8s %s\n", $user, $home; + printf "%-8s %s\n", $user, $home; } As noted earlier in this document, the scalar sense of list assignment @@ -809,10 +723,10 @@ operator. These last until their block is exited, but may be passed back. For example: sub newopen { - my $path = shift; - local *FH; # not my! - open (FH, $path) or return undef; - return *FH; + my $path = shift; + local *FH; # not my! + open (FH, $path) or return undef; + return *FH; } $fh = newopen('/etc/passwd'); @@ -835,14 +749,14 @@ that must be passed around, as in the following example: sub myopen { open my $fh, "@_" - or die "Can't open '@_': $!"; - return $fh; + or die "Can't open '@_': $!"; + return $fh; } { my $f = myopen("</etc/motd"); - print <$f>; - # $f implicitly closed here + print <$f>; + # $f implicitly closed here } Another way to create anonymous filehandles is with the Symbol diff --git a/pod/perlfaq.pod b/pod/perlfaq.pod index 556a010676..4c65915401 100644 --- a/pod/perlfaq.pod +++ b/pod/perlfaq.pod @@ -1,6 +1,6 @@ =head1 NAME -perlfaq - frequently asked questions about Perl ($Date: 2001/09/20 03:03:00 $) +perlfaq - frequently asked questions about Perl ($Date: 2001/10/16 13:27:22 $) =head1 DESCRIPTION @@ -1372,7 +1372,7 @@ of perlfaq7 on variable names within variables. =item 7/January/99 -Small touchups here and there. Added all questions in this +Small touch ups here and there. Added all questions in this document as a sort of table of contents. =item 22/June/98 diff --git a/pod/perlfaq2.pod b/pod/perlfaq2.pod index 0832fb6e06..52dc457c8e 100644 --- a/pod/perlfaq2.pod +++ b/pod/perlfaq2.pod @@ -1,6 +1,6 @@ =head1 NAME -perlfaq2 - Obtaining and Learning about Perl ($Revision: 1.1 $, $Date: 2001/09/20 03:03:00 $) +perlfaq2 - Obtaining and Learning about Perl ($Revision: 1.2 $, $Date: 2001/10/16 13:27:22 $) =head1 DESCRIPTION @@ -440,7 +440,7 @@ in releases and comes in well-defined packages. There is a very large user community and an extensive literature. The comp.lang.perl.* newsgroups and several of the mailing lists provide free answers to your questions in near real-time. Perl has traditionally been supported by -Larry, scores of software designers and developers, and myriads of +Larry, scores of software designers and developers, and myriad programmers, all working for free to create a useful thing to make life better for everyone. diff --git a/pod/perlfaq3.pod b/pod/perlfaq3.pod index 27a54fa781..e4d03fb50a 100644 --- a/pod/perlfaq3.pod +++ b/pod/perlfaq3.pod @@ -1,6 +1,6 @@ =head1 NAME -perlfaq3 - Programming Tools ($Revision: 1.7 $, $Date: 2001/10/09 22:17:53 $) +perlfaq3 - Programming Tools ($Revision: 1.8 $, $Date: 2001/10/17 14:14:20 $) =head1 DESCRIPTION @@ -869,30 +869,11 @@ For modules, get the CGI or LWP modules from CPAN. For textbooks, see the two especially dedicated to web stuff in the question on books. For problems and questions related to the web, like ``Why do I get 500 Errors'' or ``Why doesn't it run from the browser right -when it runs fine on the command line'', see these sources: - - WWW Security FAQ - http://www.w3.org/Security/Faq/ - - Web FAQ - http://www.boutell.com/faq/ - - CGI FAQ - http://www.webthing.com/tutorials/cgifaq.html - - HTTP Spec - http://www.w3.org/pub/WWW/Protocols/HTTP/ - - HTML Spec - http://www.w3.org/TR/REC-html40/ - http://www.w3.org/pub/WWW/MarkUp/ - - CGI Spec - http://www.w3.org/CGI/ - - CGI Security FAQ - http://www.go2net.com/people/paulp/cgi-security/safe-cgi.txt +when it runs fine on the command line'', see the troubleshooting +guides and references in L<perlfaq9> or in the CGI MetaFAQ: + http://www.perl.org/CGI_MetaFAQ.html + =head2 Where can I learn about object-oriented Perl programming? A good place to start is L<perltoot>, and you can use L<perlobj>, diff --git a/pod/perlfaq5.pod b/pod/perlfaq5.pod index bfd6d35494..95957eb204 100644 --- a/pod/perlfaq5.pod +++ b/pod/perlfaq5.pod @@ -1,6 +1,6 @@ =head1 NAME -perlfaq5 - Files and Formats ($Revision: 1.2 $, $Date: 2001/09/26 10:44:41 $) +perlfaq5 - Files and Formats ($Revision: 1.3 $, $Date: 2001/10/16 13:27:22 $) =head1 DESCRIPTION @@ -67,7 +67,7 @@ or even this: $document = join('', <$sock>); print "DOC IS: $document\n"; -Note the bizarrely hardcoded carriage return and newline in their octal +Note the bizarrely hard coded carriage return and newline in their octal equivalents. This is the ONLY way (currently) to assure a proper flush on all platforms, including Macintosh. That's the way things work in network programming: you really should specify the exact bit pattern @@ -242,7 +242,7 @@ Berkeley-style ps: We've used C<$$var> in a way that forbidden by C<use strict 'refs'>. That is, we've promoted a string to a scalar variable reference using -symbolic references. This is ok in small programs, but doesn't scale +symbolic references. This is okay in small programs, but doesn't scale well. It also only works on global variables, not lexicals. =head2 How can I make a filehandle local to a subroutine? How do I pass filehandles between subroutines? How do I make an array of filehandles? @@ -376,7 +376,7 @@ In the examples above, we assigned the filehandle to a scalar variable before using it. That is because only simple scalar variables, not expressions or subscripts of hashes or arrays, can be used with built-ins like C<print>, C<printf>, or the diamond operator. Using -something other than a simple scalar varaible as a filehandle is +something other than a simple scalar variable as a filehandle is illegal and won't even compile: @fd = (*STDIN, *STDOUT, *STDERR); @@ -733,7 +733,7 @@ If you know you are only writing code to run on an OS and filesystem that does implement append mode correctly (a local filesystem on a modern Unix for example), and you keep the file in block-buffered mode and you write less than one buffer-full of output between each manual flushing -of the buffer then each bufferload is almost garanteed to be written to +of the buffer then each bufferload is almost guaranteed to be written to the end of the file in one chunk without getting intermingled with anyone else's output. You can also use the syswrite() function which is simply a wrapper around your systems write(2) system call. @@ -771,7 +771,7 @@ Don't forget them or you'll be quite sorry. If you want to retrieve the time at which the file was last read, written, or had its meta-data (owner, etc) changed, you use the B<-M>, -B<-A>, or B<-C> filetest operations as documented in L<perlfunc>. These +B<-A>, or B<-C> file test operations as documented in L<perlfunc>. These retrieve the age of the file (measured against the start-time of your program) in days as a floating point number. To retrieve the "raw" time in seconds since the epoch, you would call the stat function, @@ -1024,7 +1024,7 @@ Or write a small C program using the editor of champions: % ./fionread 0x4004667f -And then hard-code it, leaving porting as an exercise to your successor. +And then hard code it, leaving porting as an exercise to your successor. $FIONREAD = 0x4004667f; # XXX: opsys dependent diff --git a/pod/perlfaq6.pod b/pod/perlfaq6.pod index 1cad81559a..4a52259800 100644 --- a/pod/perlfaq6.pod +++ b/pod/perlfaq6.pod @@ -1,6 +1,6 @@ =head1 NAME -perlfaq6 - Regexes ($Revision: 1.1 $, $Date: 2001/09/20 03:03:00 $) +perlfaq6 - Regexes ($Revision: 1.3 $, $Date: 2001/10/16 13:27:22 $) =head1 DESCRIPTION @@ -194,7 +194,7 @@ properties of bitwise xor on ASCII strings. print; -And here it is as a subroutine, modelled after the above: +And here it is as a subroutine, modeled after the above: sub preserve_case($$) { my ($old, $new) = @_; @@ -383,20 +383,30 @@ A slight modification also removes C++ comments: =head2 Can I use Perl regular expressions to match balanced text? -Although Perl regular expressions are more powerful than "mathematical" -regular expressions because they feature conveniences like backreferences -(C<\1> and its ilk), they still aren't powerful enough--with -the possible exception of bizarre and experimental features in the -development-track releases of Perl. You still need to use non-regex -techniques to parse balanced text, such as the text enclosed between -matching parentheses or braces, for example. +Historically, Perl regular expressions were not capable of matching +balanced text. As of more recent versions of perl including 5.6.1 +experimental features have been added that make it possible to do this. +Look at the documentation for the (??{ }) construct in recent perlre manual +pages to see an example of matching balanced parentheses. Be sure to take +special notice of the warnings present in the manual before making use +of this feature. + +CPAN contains many modules that can be useful for matching text +depending on the context. Damian Conway provides some useful +patterns in Regexp::Common. The module Text::Balanced provides a +general solution to this problem. + +One of the common applications of balanced text matching is working +with XML and HTML. There are many modules available that support +these needs. Two examples are HTML::Parser and XML::Parser. There +are many others. An elaborate subroutine (for 7-bit ASCII only) to pull out balanced and possibly nested single chars, like C<`> and C<'>, C<{> and C<}>, or C<(> and C<)> can be found in http://www.perl.com/CPAN/authors/id/TOMC/scripts/pull_quotes.gz . -The C::Scan module from CPAN contains such subs for internal use, +The C::Scan module from CPAN also contains such subs for internal use, but they are undocumented. =head2 What does it mean that regexes are greedy? How can I get around it? diff --git a/pod/perlfaq7.pod b/pod/perlfaq7.pod index 50dc83fb53..b1d39178da 100644 --- a/pod/perlfaq7.pod +++ b/pod/perlfaq7.pod @@ -1,6 +1,6 @@ =head1 NAME -perlfaq7 - Perl Language Issues ($Revision: 1.1 $, $Date: 2001/09/20 03:03:00 $) +perlfaq7 - Perl Language Issues ($Revision: 1.2 $, $Date: 2001/10/16 13:27:22 $) =head1 DESCRIPTION @@ -184,7 +184,7 @@ own module. Make sure to change the names appropriately. # if using RCS/CVS, this next line may be preferred, # but beware two-digit versions. - $VERSION = do{my@r=q$Revision: 1.1 $=~/\d+/g;sprintf '%d.'.'%02d'x$#r,@r}; + $VERSION = do{my@r=q$Revision: 1.2 $=~/\d+/g;sprintf '%d.'.'%02d'x$#r,@r}; @ISA = qw(Exporter); @EXPORT = qw(&func1 &func2 &func3); @@ -682,7 +682,7 @@ construct like this: Here's a simple example of a switch based on pattern matching, this time lined up in a way to make it look more like a switch statement. -We'll do a multi-way conditional based on the type of reference stored +We'll do a multiway conditional based on the type of reference stored in $whatchamacallit: SWITCH: for (ref $whatchamacallit) { diff --git a/pod/perlfaq8.pod b/pod/perlfaq8.pod index e2fd28c83b..19be3be74f 100644 --- a/pod/perlfaq8.pod +++ b/pod/perlfaq8.pod @@ -1,6 +1,6 @@ =head1 NAME -perlfaq8 - System Interaction ($Revision: 1.1 $, $Date: 2001/09/20 03:03:00 $) +perlfaq8 - System Interaction ($Revision: 1.2 $, $Date: 2001/10/16 13:27:22 $) =head1 DESCRIPTION @@ -294,7 +294,7 @@ of code just because you're afraid of a little $| variable: DEV->autoflush(1); As mentioned in the previous item, this still doesn't work when using -socket I/O between Unix and Macintosh. You'll need to hardcode your +socket I/O between Unix and Macintosh. You'll need to hard code your line terminators, in that case. =item non-blocking input @@ -435,7 +435,7 @@ program. (There is no way to set the time and date on a per-process basis.) This mechanism will work for Unix, MS-DOS, Windows, and NT; the VMS equivalent is C<set time>. -However, if all you want to do is change your timezone, you can +However, if all you want to do is change your time zone, you can probably get away with setting an environment variable: $ENV{TZ} = "MST7MDT"; # unixish diff --git a/pod/perlfaq9.pod b/pod/perlfaq9.pod index 3bf862f3eb..f7b81d5e5a 100644 --- a/pod/perlfaq9.pod +++ b/pod/perlfaq9.pod @@ -1,6 +1,6 @@ =head1 NAME -perlfaq9 - Networking ($Revision: 1.2 $, $Date: 2001/09/28 06:40:07 $) +perlfaq9 - Networking ($Revision: 1.3 $, $Date: 2001/10/16 13:27:22 $) =head1 DESCRIPTION @@ -487,7 +487,7 @@ Or you might be able use the CPAN module Mail::Mailer: The Mail::Internet module uses Net::SMTP which is less Unix-centric than Mail::Mailer, but less reliable. Avoid raw SMTP commands. There are many reasons to use a mail transport agent like sendmail. These -include queueing, MX records, and security. +include queuing, MX records, and security. =head2 How do I use MIME to make an attachment to a mail message? diff --git a/pod/perlhack.pod b/pod/perlhack.pod index 8d3b54b1fe..e60c6073a0 100644 --- a/pod/perlhack.pod +++ b/pod/perlhack.pod @@ -14,10 +14,14 @@ messages a day, depending on the heatedness of the debate. Most days there are two or three patches, extensions, features, or bugs being discussed at a time. -A searchable archive of the list is at: +A searchable archive of the list is at either: http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/ +or + + http://archive.develooper.com/perl5-porters@perl.org/ + List subscribers (the porters themselves) come in several flavours. Some are quiet curious lurkers, who rarely pitch in and instead watch the ongoing development to ensure they're forewarned of new changes or diff --git a/pod/perlintro.pod b/pod/perlintro.pod new file mode 100644 index 0000000000..8a80ef4cee --- /dev/null +++ b/pod/perlintro.pod @@ -0,0 +1,645 @@ +=head1 NAME + +perlintro -- a brief introduction and overview of Perl + +=head1 DESCRIPTION + +This document is intended to give you a quick overview of the Perl +programming language, along with pointers to further documentation. It +is intended as a "bootstrap" guide for those who are new to the +language, and provides just enough information for you to be able to +read other peoples' Perl and understand roughly what it's doing, or +write your own simple scripts. + +This introductory document does not aim to be complete. It does not +even aim to be entirely accurate. In some cases perfection has been +sacrificed in the goal of getting the general idea across. You are +I<strongly> advised to follow this introduction with more information +from the full Perl manual, the table of contents to which can be found +in L<perltoc>. + +Throughout this document you'll see references to other parts of the +Perl documentation. You can read that documentation using the C<perldoc> +command or whatever method you're using to read this document. + +=head2 What is Perl? + +Perl is a general-purpose programming language originally developed for +text manipulation and now used for a wide range of tasks including +system administration, web development, network programming, GUI +development, and more. + +The language is intended to be practical (easy to use, efficient, +complete) rather than beautiful (tiny, elegant, minimal). Its major +features are that it's easy to use, supports both procedural and +object-oriented (OO) programming, has powerful built-in support for text +processing, and has one of the world's most impressive collections of +third-party modules. + +Different definitions of Perl are given in L<perl>, L<perlfaq1> and +no doubt other places. From this we can determine that Perl is different +things to different people, but that lots of people think it's at least +worth writing about. + +=head2 Running Perl programs + +To run a Perl program from the Unix command line: + + perl progname.pl + +Alternatively, put this as the first line of your script: + + #!/usr/bin/env perl + +... and run the script as C</path/to/script.pl>. Of course, it'll need +to be executable first, so C<chmod 755 script.pl> (under Unix). + +For more information, including instructions for other platforms such as +Windows and MacOS, read L<perlrun>. + +=head2 Basic syntax overview + +A Perl script or program consists of one or more statements. These +statements are simply written in the script in a straightforward +fashion. There is no need to have a C<main()> function or anything of +that kind. + +Perl statements end in a semi-colon: + + print "Hello, world"; + +Comments start with a hash symbol and run to the end of the line + + # This is a comment + +Whitespace is irrelevant: + + print + "Hello, world" + ; + +... except inside quoted strings: + + # this would print with a linebreak in the middle + print "Hello + world"; + +Double quotes or single quotes may be used around literal strings: + + print "Hello, world"; + print 'Hello, world'; + +However, only double quotes "interpolate" variables and special +characters such as newlines (C<\n>): + + print "Hello, $name\n"; # works fine + print 'Hello, $name\n'; # prints $name\n literally + +Numbers don't need quotes around them: + + print 42; + +You can use parentheses for functions' arguments or omit them +according to your personal taste. They are only required +occasionally to clarify issues of precedence. + + print("Hello, world\n"); + print "Hello, world\n"; + +More detailed information about Perl syntax can be found in L<perlsyn>. + +=head2 Perl variable types + +Perl has three main variable types: scalars, arrays, and hashes. + +=over 4 + +=item Scalars + +A scalar represents a single value: + + my $animal = "camel"; + my $answer = 42; + +Scalar values can be strings, integers or floating point numbers, and Perl +will automatically convert between them as required. There is no need +to pre-declare your variable types. + +Scalar values can be used in various ways: + + print $animal; + print "The animal is $animal\n"; + print "The square of $answer is ", $answer * $answer, "\n"; + +There are a number of "magic" scalars with names that look like +punctuation or line noise. These special variables are used for all +kinds of purposes, and are documented in L<perlvar>. The only one you +need to know about for now is C<$_> which is the "default variable". +It's used as the default argument to a number of functions in Perl, and +it's set implicitly by certain looping constructs. + + print; # prints contents of $_ by default + +=item Arrays + +An array represents a list of values: + + my @animals = ("camel", "llama", "owl"); + my @numbers = (23, 42, 69); + my @mixed = ("camel", 42, 1.23); + +Arrays are zero-indexed. Here's how you get at elements in an array: + + print $animals[0]; # prints "camel" + print $animals[1]; # prints "llama" + +The special variable C<$#array> tells you the index of the last element +of an array: + + print $mixed[$#mixed]; # last element, prints 1.23 + +You might be tempted to use C<$#array + 1> to tell you how many items there +are in an array. Don't bother. As it happens, using C<@array> where Perl +expects to find a scalar value ("in scalar context") will give you the number +of elements in the array: + + if (@animals < 5) { ... } + +The elements we're getting from the array start with a C<$> because +we're getting just a single value out of the array -- you ask for a scalar, +you get a scalar. + +To get multiple values from a array: + + @animals[0,1]; # gives ("camel", "llama"); + @animals[0..2]; # gives ("camel", "llama", "owl"); + @animals[1..$#animals]; # gives all except the first element + +This is called an "array slice". + +You can do various useful things to lists: + + my @sorted = sort @animals; + my @backwards = reverse @numbers; + +There are a couple of special arrays too, such as C<@ARGV> (the command +line arguments to your script) and C<@_> (the arguments passed to a +subroutine). These are documented in L<perlvar>. + +=item Hashes + +A hash represents a set of key/value pairs: + + my %fruit_color = ("apple", "red", "banana", "yellow"); + +You can use whitespace and the C<< => >> operator to lay them out more +nicely: + + my %fruit_color = ( + apple => "red", + banana => "yellow", + ); + +To get at hash elements: + + $fruit_color{"apple"}; # gives "red" + +You can get at lists of keys and values with C<keys()> and +C<values()>. + + my @fruits = keys %fruit_colors; + my @colors = values %fruit_colors; + +Hashes have no particular internal order, though you can sort the keys +and loop through them. + +Just like special scalars and arrays, there are also special hashes. +The most well known of these is C<%ENV> which contains environment +variables. Read all about it (and other special variables) in +L<perlvar>. + +=back + +Scalars, arrays and hashes are documented more fully in L<perldata>. + +More complex data types can be constructed using references, which allow +you to build lists and hashes within lists and hashes. + +A reference is a scalar value and can refer to any other Perl data +type. So by storing a reference as the value of an array or hash +element, you can easily create lists and hashes within lists and +hashes. The following example shows a 2 level hash of hash +structure using anonymous hash references. + + my $variables = { + scalar => { + description => "single item", + sigil => '$', + }, + array => { + description => "ordered list of items", + sigil => '@', + }, + hash => { + description => "key/value pairs", + sigil => '%', + }, + }; + + print "Scalars begin with a $variables->{'scalar'}->{'sigil'}\n"; + +Exhaustive information on the topic of references can be found in +L<perlreftut>, L<perllol>, L<perlref> and L<perldsc>. + +=head2 Variable scoping + +Throughout the previous section all the examples have used the syntax: + + my $var = "value"; + +The C<my> is actually not required; you could just use: + + $var = "value"; + +However, the above usage will create global variables throughout your +program, which is bad programming practice. C<my> creates lexically +scoped variables instead. The variables are scoped to the block +(i.e. a bunch of statements surrounded by curly-braces) in which they +are defined. + + my $a = "foo"; + if ($some_condition) { + my $b = "bar"; + print $a; # prints "foo" + print $b; # prints "bar" + } + print $a; # prints "foo" + print $b; # prints nothing; $b has fallen out of scope + +Using C<my> in combination with a C<use strict;> at the top of +your Perl scripts means that the interpreter will pick up certain common +programming errors. For instance, in the example above, the final +C<print $b> would cause a compile-time error and prevent you from +running the program. Using C<strict> is highly recommended. + +=head2 Conditional and looping constructs + +Perl has most of the usual conditional and looping constructs except for +case/switch (but if you really want it, there is a Switch module in Perl +5.8 and newer, and on CPAN. See the section on modules, below, for more +information about modules and CPAN). + +The conditions can be any Perl expression. See the list of operators in +the next section for information on comparison and boolean logic operators, +which are commonly used in conditional statements. + +=over 4 + +=item if + + if ( condition ) { + ... + } elsif ( other condition ) { + ... + } else { + ... + } + +There's also a negated version of it: + + unless ( condition ) { + ... + } + +This is provided as a more readable version of C<if (! condition)>. + +Note that the braces are required in Perl, even if you've only got one +line in the block. However, there is a clever way of making your one-line +conditional blocks more English like: + + # the traditional way + if ($zippy) { + print "Yow!"; + } + + # the Perlish post-condition way + print "Yow!" if $zippy; + print "We have no bananas" unless $bananas; + +=item while + + while ( condition ) { + ... + } + +There's also a negated version, for the same reason we have C<unless>: + + until ( condition ) { + ... + } + +You can also use C<while> in a post-condition: + + print "LA LA LA\n" while 1; # loops forever + +=item for + +Exactly like C: + + for ($i=0; $i <= $max; $i++) { + ... + } + +The C style for loop is rarely needed in Perl since Perl provides +the the more friendly list scanning C<foreach> loop. + +=item foreach + + foreach (@array) { + print "This element is $_\n"; + } + + # you don't have to use the default $_ either... + foreach my $key (keys %hash) { + print "The value of $key is $hash{$key}\n"; + } + +=back + +For more detail on looping constructs (and some that weren't mentioned in +this overview) see L<perlsyn>. + +=head2 Builtin operators and functions + +Perl comes with a wide selection of builtin functions. Some of the ones +we've already seen include C<print>, C<sort> and C<reverse>. A list of +them is given at the start of L<perlfunc> and you can easily read +about any given function by using C<perldoc -f functionname>. + +Perl operators are documented in full in L<perlop>, but here are a few +of the most common ones: + +=over 4 + +=item Arithmetic + + + addition + - subtraction + * multiplication + / division + +=item Numeric comparison + + == equality + != inequality + < less than + > greater than + <= less than or equal + >= greater than or equal + +=item String comparison + + eq equality + ne inequality + lt less than + gt greater than + le less than or equal + ge greater than or equal + +(Why do we have separate numeric and string comparisons? Because we don't +have special variable types, and Perl needs to know whether to sort +numerically (where 99 is less than 100) or alphabetically (where 100 comes +before 99). + +=item Boolean logic + + && and + || or + ! not + +(C<and>, C<or> and C<not> aren't just in the above table as descriptions +of the operators -- they're also supported as operators in their own +right. They're more readable than the C-style operators, but have +different precedence to C<&&> and friends. Check L<perlop> for more +detail.) + +=item Miscellaneous + + = assignment + . string concatenation + x string multiplication + .. range operator (creates a list of numbers) + +=back + +Many operators can be combined with a C<=> as follows: + + $a += 1; # same as $a = $a + 1 + $a -= 1; # same as $a = $a - 1 + $a .= "\n"; # same as $a = $a . "\n"; + +=head2 Files and I/O + +You can open a file for input or output using the C<open()> function. +It's documented in extravagant detail in L<perlfunc> and L<perlopentut>, +but in short: + + open(INFILE, "input.txt") or die "Can't open input.txt: $!"; + open(OUTFILE, ">output.txt") or die "Can't open output.txt: $!"; + open(LOGFILE, ">>my.log") or die "Can't open logfile: $!"; + +You can read from an open filehandle using the C<< <> >> operator. In +scalar context it reads a single line from the filehandle, and in list +context it reads the whole file in, assigning each line to an element of +the list: + + my $line = <INFILE>; + my @lines = <INFILE>; + +Reading in the whole file at one time is called slurping. It can +be useful but it may be a memory hog. Most text file processing +can be done a line at a time with Perl's looping constructs. + +The C<< <> >> operator is most often seen in a C<while> loop: + + while (<INFILE>) { # assigns each line in turn to $_ + print "Just read in this line: $_"; + } + +We've already seen how to print to standard output using C<print()>. +However, C<print()> can also take an optional first argument specifying +which filehandle to print to: + + print STDERR "This is your final warning.\n"; + print OUTFILE $record; + print LOGFILE $logmessage; + +When you're done with your filehandles, you should C<close()> them +(though to be honest, Perl will clean up after you if you forget): + + close INFILE; + +=head2 Regular expressions + +Perl's regular expression support is both broad and deep, and is the +subject of lengthy documentation in L<perlrequick>, L<perlretut>, and +elsewhere. However, in short: + +=over 4 + +=item Simple matching + + if (/foo/) { ... } # true if $_ contains "foo" + if ($a =~ /foo/) { ... } # true if $a contains "foo" + +The C<//> matching operator is documented in L<perlop>. It operates on +C<$_> by default, or can be bound to another variable using the C<=~> +binding operator (also documented in L<perlop>). + +=item Simple substitution + + s/foo/bar/; # replaces foo with bar in $_ + $a =~ s/foo/bar/; # replaces foo with bar in $a + $a =~ s/foo/bar/g; # replaces ALL INSTANCES of foo with bar in $a + +The C<s///> substitution operator is documented in L<perlop>. + +=item More complex regular expressions + +You don't just have to match on fixed strings. In fact, you can match +on just about anything you could dream of by using more complex regular +expressions. These are documented at great length in L<perlre>, but for +the meantime, here's a quick cheat sheet: + + . a single character + \s a whitespace character (space, tab, newline) + \S non-whitespace character + \d a digit (0-9) + \D a non-digit + \w a word character (a-z, A-Z, 0-9, _) + \W a non-word character + [aeiou] matches a single character in the given set + [^aeiou] matches a single character outside the given set + (foo|bar|baz) matches any of the alternatives specified + + ^ start of string + $ end of string + +Quantifiers can be used to specify how many of the previous thing you +want to match on, where "thing" means either a literal character, one +of the metacharacters listed above, or a group of characters or +metacharacters in parentheses. + + * zero or more of the previous thing + + one or more of the previous thing + ? zero or one of the previous thing + {3} matches exactly 3 of the previous thing + {3,6} matches between 3 and 6 of the previous thing + {3,} matches 3 or more of the previous thing + +Some brief examples: + + /^\d+/ string starts with one or more digits + /^$/ nothing in the string (start and end are adjacent) + /(\d\s){3}/ a three digits, each followed by a whitespace + character (eg "3 4 5 ") + /(a.)+/ matches a string in which every odd-numbered letter + is a (eg "abacadaf") + + # This loop reads from STDIN, and prints non-blank lines: + while (<>) { + next if /^$/; + print; + } + +=item Parentheses for capturing + +As well as grouping, parentheses serve a second purpose. They can be +used to capture the results of parts of the regexp match for later use. +The results end up in C<$1>, C<$2> and so on. + + # a cheap and nasty way to break an email address up into parts + + if ($email =~ /([^@])+@(.+)/) { + print "Username is $1\n"; + print "Hostname is $2\n"; + } + +=item Other regexp features + +Perl regexps also support backreferences, lookaheads, and all kinds of +other complex details. Read all about them in L<perlrequick>, +L<perlretut>, and L<perlre>. + +=back + +=head2 Writing subroutines + +Writing subroutines is easy: + + sub log { + my $logmessage = shift; + print LOGFILE $logmessage; + } + +What's that C<shift>? Well, the arguments to a subroutine are available +to us as a special array called C<@_> (see L<perlvar> for more on that). +The default argument to the C<shift> function just happens to be C<@_>. +So C<my $logmessage = shift;> shifts the first item off the list of +arguments and assigns it to C<$logmessage>. + +We can manipulate C<@_> in other ways too: + + my ($logmessage, $priority) = @_; # common + my $logmessage = $_[0]; # uncommon, and ugly + +Subroutines can also return values: + + sub square { + my $num = shift; + my $result = $num * $num; + return $result; + } + +For more information on writing subroutines, see L<perlsub>. + +=head2 OO Perl + +OO Perl is relatively simple and is implemented using references which +know what sort of object they are based on Perl's concept of packages. +However, OO Perl is largely beyond the scope of this document. +Read L<perlboot>, L<perltoot>, L<perltooc> and L<perlobj>. + +As a beginning Perl programmer, your most common use of OO Perl will be +in using third-party modules, which are documented below. + +=head2 Using Perl modules + +Perl modules provide a range of features to help you avoid reinventing +the wheel, and can be downloaded from CPAN (http://www.cpan.org). A +number of popular modules are included with the Perl distribution +itself. + +Categories of modules range from text manipulation to network protocols +to database integration to graphics. A categorized list of modules is +also available from CPAN. + +To learn how to install modules you download from CPAN, read +L<perlmodinstall> + +To learn how to use a particular module, use C<perldoc Module::Name>. +Typically you will want to C<use Module::Name>, which will then give you +access to exported functions or an OO interface to the module. + +L<perlfaq> contains questions and answers related to many common +tasks, and often provides suggestions for good CPAN modules to use. + +L<perlmod> describes Perl modules in general. L<perlmodlib> lists the +modules which came with your Perl installation. + +If you feel the urge to write Perl modules, L<perlnewmod> will give you +good advice. + +=head1 AUTHOR + +Kirrily "Skud" Robert <skud@cpan.org> diff --git a/pod/perlmodstyle.pod b/pod/perlmodstyle.pod new file mode 100644 index 0000000000..4da7311f7a --- /dev/null +++ b/pod/perlmodstyle.pod @@ -0,0 +1,731 @@ +=head1 NAME + +perlmodstyle - Perl module style guide + +=head1 INTRODUCTION + +This document attempts to describe the Perl Community's "best practice" +for writing Perl modules. It extends the recommendations found in +L<perlstyle> , which should be considered required reading +before reading this document. + +While this document is intended to be useful to all module authors, it is +particularly aimed at authors who wish to publish their modules on CPAN. + +The focus is on elements of style which are visible to the users of a +module, rather than those parts which are only seen by the module's +developers. However, many of the guidelines presented in this document +can be extrapolated and applied successfully to a module's internals. + +This document differs from L<perlnewmod> in that it is a style guide +rather than a tutorial on creating CPAN modules. It provides a +checklist against which modules can be compared to determine whether +they conform to best practice, without necessarily describing in detail +how to achieve this. + +All the advice contained in this document has been gleaned from +extensive conversations with experienced CPAN authors and users. Every +piece of advice given here is the result of previous mistakes. This +information is here to help you avoid the same mistakes and the extra +work that would inevitably be required to fix them. + +The first section of this document provides an itemized checklist; +subsequent sections provide a more detailed discussion of the items on +the list. The final section, "Common Pitfalls", describes some of the +most popular mistakes made by CPAN authors. + +=head1 QUICK CHECKLIST + +For more detail on each item in this checklist, see below. + +=head2 Before you start + +=over 4 + +=item * + +Don't re-invent the wheel + +=item * + +Patch, extend or subclass an existing module where possible + +=item * + +Do one thing and do it well + +=item * + +Choose an appropriate name + +=back + +=head2 The API + +=over 4 + +=item * + +API should be understandable by the average programmer + +=item * + +Simple methods for simple tasks + +=item * + +Separate functionality from output + +=item * + +Consistent naming of subroutines or methods + +=item * + +Use named parameters (a hash or hashref) when there are more than two +parameters + +=back + +=head2 Stability + +=over 4 + +=item * + +Ensure your module works under C<use strict> and C<-w> + +=item * + +Stable modules should maintain backwards compatibility + +=back + +=head2 Documentation + +=over 4 + +=item * + +Write documentation in POD + +=item * + +Document purpose, scope and target applications + +=item * + +Document each publically accessible method or subroutine, including params and return values + +=item * + +Give examples of use in your documentation + +=item * + +Provide a README file and perhaps also release notes, changelog, etc + +=item * + +Provide links to further information (URL, email) + +=back + +=head2 Release considerations + +=over 4 + +=item * + +Specify pre-requisites in Makefile.PL + +=item * + +Specify Perl version requirements with C<use> + +=item * + +Include tests with your module + +=item * + +Choose a sensible and consistent version numbering scheme (X.YY is the common Perl module numbering scheme) + +=item * + +Increment the version number for every change, no matter how small + +=item * + +Package the module using "make dist" + +=item * + +Choose an appropriate license (GPL/Artistic is a good default) + +=back + +=head1 BEFORE YOU START WRITING A MODULE + +Try not to launch headlong into developing your module without spending +some time thinking first. A little forethought may save you a vast +amount of effort later on. + +=head2 Has it been done before? + +You may not even need to write the module. Check whether it's already +been done in Perl, and avoid re-inventing the wheel unless you have a +good reason. + +If an existing module B<almost> does what you want, consider writing a +patch, writing a subclass, or otherwise extending the existing module +rather than rewriting it. + +=head2 Do one thing and do it well + +At the risk of stating the obvious, modules are intended to be modular. +A Perl developer should be able to use modules to put together the +building blocks of their application. However, it's important that the +blocks are the right shape, and that the developer shouldn't have to use +a big block when all they need is a small one. + +Your module should have a clearly defined scope which is no longer than +a single sentence. Can your module be broken down into a family of +related modules? + +Bad example: + +"FooBar.pm provides an implementation of the FOO protocol and the +related BAR standard." + +Good example: + +"Foo.pm provides an implementation of the FOO protocol. Bar.pm +implements the related BAR protocol." + +This means that if a developer only needs a module for the BAR standard, +they should not be forced to install libraries for FOO as well. + +=head2 What's in a name? + +Make sure you choose an appropriate name for your module early on. This +will help people find and remember your module, and make programming +with your module more intuitive. + +When naming your module, consider the following: + +=over 4 + +=item * + +Be descriptive (i.e. accurately describes the purpose of the module). + +=item * + +Be consistent with existing modules. + +=item * + +Reflect the functionality of the module, not the implementation. + +=item * + +Avoid starting a new top-level hierarchy, especially if a suitable +hierarchy already exists under which you could place your module. + +=back + +You should contact modules@perl.org to ask them about your module name +before publishing your module. You should also try to ask people who +are already familiar with the module's application domain and the CPAN +naming system. Authors of similar modules, or modules with similar +names, may be a good place to start. + +=head1 DESIGNING AND WRITING YOUR MODULE + +Considerations for module design and coding: + +=head2 To OO or not to OO? + +Your module may be object oriented (OO) or not, or it may have both kinds +of interfaces available. There are pros and cons of each technique, which +should be considered when you design your API. + +According to Damian Conway, you should consider using OO: + +=over 4 + +=item * + +When the system is large or likely to become so + +=item * + +When the data is aggregated in obvious structures that will become objects + +=item * + +When the types of data form a natural hierarchy that can make use of inheritance + +=item * + +When operations on data vary according to data type (making +polymorphic invocation of methods feasible) + +=item * + +When it is likely that new data types may be later introduced +into the system, and will need to be handled by existing code + +=item * + +When interactions between data are best represented by +overloaded operators + +=item * + +When the implementation of system components is likely to +change over time (and hence should be encapsulated) + +=item * + +When the system design is itself object-oriented + +=item * + +When large amounts of client code will use the software (and +should be insulated from changes in its implementation) + +=item * + +When many separate operations will need to be applied to the +same set of data + +=back + +Think carefully about whether OO is appropriate for your module. +Gratuitous object orientation results in complex APIs which are +difficult for the average module user to understand or use. + +=head2 Designing your API + +Your interfaces should be understandable by an average Perl programmer. +The following guidelines may help you judge whether your API is +sufficiently straightforward: + +=over 4 + +=item Write simple routines to do simple things. + +It's better to have numerous simple routines than a few monolithic ones. +If your routine changes its behaviour significantly based on its +arguments, it's a sign that you should have two (or more) separate +routines. + +=item Separate functionality from output. + +Return your results in the most generic form possible and allow the user +to choose how to use them. The most generic form possible is usually a +Perl data structure which can then be used to generate a text report, +HTML, XML, a database query, or whatever else your users require. + +If your routine iterates through some kind of list (such as a list of +files, or records in a database) you may consider providing a callback +so that users can manipulate each element of the list in turn. +File::Find provides an example of this with its +C<find(\&wanted, $dir)> syntax. + +=item Provide sensible shortcuts and defaults. + +Don't require every module user to jump through the same hoops to achieve a +simple result. You can always include optional parameters or routines for +more complex or non-standard behaviour. If most of your users have to +type a few almost identical lines of code when they start using your +module, it's a sign that you should have made that behaviour a default. +Another good indicator that you should use defaults is if most of your +users call your routines with the same arguments. + +=item Naming conventions + +Your naming should be consistent. For instance, it's better to have: + + display_day(); + display_week(); + display_year(); + +than + + display_day(); + week_display(); + show_year(); + +This applies equally to method names, parameter names, and anything else +which is visible to the user (and most things that aren't!) + +=item Parameter passing + +Use named parameters. It's easier to use a hash like this: + + $obj->do_something( + name => "wibble", + type => "text", + size => 1024, + ); + +... than to have a long list of unnamed parameters like this: + + $obj->do_something("wibble", "text", 1024); + +While the list of arguments might work fine for one, two or even three +arguments, any more arguments become hard for the module user to +remember, and hard for the module author to manage. If you want to add +a new parameter you will have to add it to the end of the list for +backward compatibility, and this will probably make your list order +unintuitive. Also, if many elements may be undefined you may see the +following unattractive method calls: + + $obj->do_something(undef, undef, undef, undef, undef, undef, 1024); + +Provide sensible defaults for parameters which have them. Don't make +your users specify parameters which will almost always be the same. + +The issue of whether to pass the arguments in a hash or a hashref is +largely a matter of personal style. + +The use of hash keys starting with a hyphen (C<-name>) or entirely in +upper case (C<NAME>) is a relic of older versions of Perl in which +ordinary lower case strings were not handled correctly by the C<=E<gt>> +operator. While some modules retain uppercase or hyphenated argument +keys for historical reasons or as a matter of personal style, most new +modules should use simple lower case keys. Whatever you choose, be +consistent! + +=back + +=head2 Strictness and warnings + +Your module should run successfully under the strict pragma and should +run without generating any warnings. Your module should also handle +taint-checking where appropriate, though this can cause difficulties in +many cases. + +=head2 Backwards compatibility + +Modules which are "stable" should not break backwards compatibility +without at least a long transition phase and a major change in version +number. + +=head2 Error handling and messages + +When your module encounters an error it should do one or more of: + +=over 4 + +=item * + +Return an undefined value. + +=item * + +set C<$Module::errstr> or similar (C<errstr> is a common name used by +DBI and other popular modules; if you choose something else, be sure to +document it clearly). + +=item * + +C<warn()> or C<carp()> a message to STDERR. + +=item * + +C<croak()> only when your module absolutely cannot figure out what to +do. (C<croak()> is a better version of C<die()> for use within +modules, which reports its errors from the perspective of the caller. +See L<Carp> for details of C<croak()>, C<carp()> and other useful +routines.) + +=item * + +As an alternative to the above, you may prefer to throw exceptions using +the Error module. + +=back + +Configurable error handling can be very useful to your users. Consider +offering a choice of levels for warning and debug messages, an option to +send messages to a separate file, a way to specify an error-handling +routine, or other such features. Be sure to default all these options +to the commonest use. + +=head1 DOCUMENTING YOUR MODULE + +=head2 POD + +Your module should include documentation aimed at Perl developers. +You should use Perl's "plain old documentation" (POD) for your general +technical documentation, though you may wish to write additional +documentation (white papers, tutorials, etc) in some other format. +You need to cover the following subjects: + +=over 4 + +=item * + +A synopsis of the common uses of the module + +=item * + +The purpose, scope and target applications of your module + +=item * + +Use of each publically accessible method or subroutine, including +parameters and return values + +=item * + +Examples of use + +=item * + +Sources of further information + +=item * + +A contact email address for the author/maintainer + +=back + +The level of detail in Perl module documentation generally goes from +less detailed to more detailed. Your SYNOPSIS section should contain a +minimal example of use (perhaps as little as one line of code; skip the +unusual use cases or or anything not needed by most users); the +DESCRIPTION should describe your module in broad terms, generally in +just a few paragraphs; more detail of the module's routines or methods, +lengthy code examples, or other in-depth material should be given in +subsequent sections. + +Ideally, someone who's slightly familiar with your module should be able +to refresh their memory without hitting "page down". As your reader +continues through the document, they should receive a progressively +greater amount of knowledge. + +The recommended order of sections in Perl module documentation is: + +=over 4 + +=item * + +NAME + +=item * + +SYNOPSIS + +=item * + +DESCRIPTION + +=item * + +One or more sections or subsections giving greater detail of available +methods and routines and any other relevant information. + +=item * + +BUGS/CAVEATS/etc + +=item * + +AUTHOR + +=item * + +SEE ALSO + +=item * + +COPYRIGHT and LICENSE + +=back + +Keep your documentation near the code it documents ("inline" +documentation). Include POD for a given method right above that +method's subroutine. This makes it easier to keep the documentation up +to date, and avoids having to document each piece of code twice (once in +POD and once in comments). + +=head2 README, INSTALL, release notes, changelogs + +Your module should also include a README file describing the module and +giving pointers to further information (website, author email). + +An INSTALL file should be included, and should contain simple installation +instructions (usually "perl Makefile.PL; make; make install"). + +Release notes or changelogs should be produced for each release of your +software describing user-visible changes to your module, in terms +relevant to the user. + +=head1 RELEASE CONSIDERATIONS + +=head2 Version numbering + +Version numbers should indicate at least major and minor releases, and +possibly sub-minor releases. A major release is one in which most of +the functionality has changed, or in which major new functionality is +added. A minor release is one in which a small amount of functionality +has been added or changed. Sub-minor version numbers are usually used +for changes which do not affect functionality, such as documentation +patches. + +The most common CPAN version numbering scheme looks like this: + + 1.00, 1.10, 1.11, 1.20, 1.30, 1.31, 1.32 + +A correct CPAN version number is a floating point number with at least +2 digits after the decimal. You can test whether it conforms to CPAN by +using + + perl -MExtUtils::MakeMaker -le 'print MM->parse_version(shift)' 'Foo.pm' + +If you want to release a 'beta' or 'alpha' version of a module but don't +want CPAN.pm to list it as most recent use an '_' after the regular +version number followed by at least 2 digits, eg. 1.20_01 + +Never release anything (even a one-word documentation patch) without +incrementing the number. Even a one-word documentation patch should +result in a change in version at the sub-minor level. + +=head2 Pre-requisites + +Module authors should carefully consider whether to rely on other +modules, and which modules to rely on. + +Most importantly, choose modules which are as stable as possible. In +order of preference: + +=over 4 + +=item * + +Core Perl modules + +=item * + +Stable CPAN modules + +=item * + +Unstable CPAN modules + +=item * + +Modules not available from CPAN + +=back + +Specify version requirements for other Perl modules in the +pre-requisites in your Makefile.PL. + +Be sure to specify Perl version requirements both in Makefile.PL and +with C<require 5.6.1> or similar. + +=head2 Testing + +All modules should be tested before distribution (using "make disttest", +and the tests should also be available to people installing the modules +(using "make test"). + +The importance of these tests is proportional to the alleged stability of a +module -- a module which purports to be stable or which hopes to achieve wide +use should adhere to as strict a testing regime as possible. + +Useful modules to help you write tests (with minimum impact on your +development process or your time) include Test::Simple, Carp::Assert +and Test::Inline. + +=head2 Packaging + +Modules should be packaged using the standard MakeMaker tools, allowing +them to be installed in a consistent manner. Use "make dist" to create +your package. + +Tools exist to help you build your module in a MakeMaker-friendly style. +These include ExtUtils::ModuleMaker and h2xs. See also L<perlnewmod>. + +=head2 Licensing + +Make sure that your module has a license, and that the full text of it +is included in the distribution (unless it's a common one and the terms +of the license don't require you to include it). + +If you don't know what license to use, dual licensing under the GPL +and Artistic licenses (the same as Perl itself) is a good idea. + +=head1 COMMON PITFALLS + +=head2 Reinventing the wheel + +There are certain application spaces which are already very, very well +served by CPAN. One example is templating systems, another is date and +time modules, and there are many more. While it is a rite of passage to +write your own version of these things, please consider carefully +whether the Perl world really needs you to publish it. + +=head2 Trying to do too much + +Your module will be part of a developer's toolkit. It will not, in +itself, form the B<entire> toolkit. It's tempting to add extra features +until your code is a monolithic system rather than a set of modular +building blocks. + +=head2 Inappropriate documentation + +Don't fall into the trap of writing for the wrong audience. Your +primary audience is a reasonably experienced developer with at least +a moderate understanding of your module's application domain, who's just +downloaded your module and wants to start using it as quickly as possible. + +Tutorials, end-user documentation, research papers, FAQs etc are not +appropriate in a module's main documentation. If you really want to +write these, include them as sub-documents such as C<My::Module::Tutorial> or +C<My::Module::FAQ> and provide a link in the SEE ALSO section of the +main documentation. + +=head1 SEE ALSO + +=over 4 + +=item L<perlstyle> + +General Perl style guide + +=item L<perlnewmod> + +How to create a new module + +=item L<perlpod> + +POD documentation + +=item L<podchecker> + +Verifies your POD's correctness + +=item Testing tools + +L<Test::Simple>, L<Test::Inline>, L<Carp::Assert> + +=item http://pause.perl.org/ + +Perl Authors Upload Server. Contains links to information for module +authors. + +=item Any good book on software engineering + +=back + +=head1 AUTHOR + +Kirrily "Skud" Robert <skud@cpan.org> + diff --git a/pod/perlop.pod b/pod/perlop.pod index 9ae391821a..1b5d3e7152 100644 --- a/pod/perlop.pod +++ b/pod/perlop.pod @@ -664,6 +664,7 @@ any pair of delimiters you choose. qr{} Pattern yes* s{}{} Substitution yes* tr{}{} Transliteration no (but see below) + <<EOF here-doc yes* * unless the delimiter is ''. @@ -1343,6 +1344,98 @@ must use an eval(): eval "tr/$oldlist/$newlist/, 1" or die $@; +=item <<EOF + +A line-oriented form of quoting is based on the shell "here-document" +syntax. Following a C<< << >> you specify a string to terminate +the quoted material, and all lines following the current line down to +the terminating string are the value of the item. The terminating +string may be either an identifier (a word), or some quoted text. If +quoted, the type of quotes you use determines the treatment of the +text, just as in regular quoting. An unquoted identifier works like +double quotes. There must be no space between the C<< << >> and +the identifier, unless the identifier is quoted. (If you put a space it +will be treated as a null identifier, which is valid, and matches the first +empty line.) The terminating string must appear by itself (unquoted and +with no surrounding whitespace) on the terminating line. + + print <<EOF; + The price is $Price. + EOF + + print << "EOF"; # same as above + The price is $Price. + EOF + + print << `EOC`; # execute commands + echo hi there + echo lo there + EOC + + print <<"foo", <<"bar"; # you can stack them + I said foo. + foo + I said bar. + bar + + myfunc(<< "THIS", 23, <<'THAT'); + Here's a line + or two. + THIS + and here's another. + THAT + +Just don't forget that you have to put a semicolon on the end +to finish the statement, as Perl doesn't know you're not going to +try to do this: + + print <<ABC + 179231 + ABC + + 20; + +If you want your here-docs to be indented with the +rest of the code, you'll need to remove leading whitespace +from each line manually: + + ($quote = <<'FINIS') =~ s/^\s+//gm; + The Road goes ever on and on, + down from the door where it began. + FINIS + +If you use a here-doc within a delimited construct, such as in C<s///eg>, +the quoted material must come on the lines following the final delimiter. +So instead of + + s/this/<<E . 'that' + the other + E + . 'more '/eg; + +you have to write + + s/this/<<E . 'that' + . 'more '/eg; + the other + E + +If the terminating identifier is on the last line of the program, you +must be sure there is a newline after it; otherwise, Perl will give the +warning B<Can't find string terminator "END" anywhere before EOF...>. + +Additionally, the quoting rules for the identifier are not related to +Perl's quoting rules -- C<q()>, C<qq()>, and the like are not supported +in place of C<''> and C<"">, and the only interpolation is for backslashing +the quoting character: + + print << "abc\"def"; + testing... + abc"def + +Finally, quoted strings cannot span multiple lines. The general rule is +that the identifier must be a string literal. Stick with that, and you +should be safe. + =back =head2 Gory details of parsing quoted constructs diff --git a/pod/perltoc.pod b/pod/perltoc.pod index 50802434ec..3ad81d4f12 100644 --- a/pod/perltoc.pod +++ b/pod/perltoc.pod @@ -17,6 +17,20 @@ through to locate the proper section you're looking for. =item SYNOPSIS +=over 4 + +=item Overview + +=item Tutorials + +=item Internals and C Language Interface + +=item Miscellaneous + +=item Platform-Specific + +=back + =item DESCRIPTION =item AVAILABILITY @@ -37,8 +51,56 @@ through to locate the proper section you're looking for. =back -=head2 perlfaq - frequently asked questions about Perl ($Date: 2001/09/20 -03:03:00 $) +=head2 perlintro -- a brief introduction and overview of Perl + +=over 4 + +=item DESCRIPTION + +=over 4 + +=item What is Perl? + +=item Running Perl programs + +=item Basic syntax overview + +=item Perl variable types + +Scalars, Arrays, Hashes + +=item Variable scoping + +=item Conditional and looping constructs + +if, while, for, foreach + +=item Builtin operators and functions + +Arithmetic, Numeric comparison, String comparison, Boolean logic, +Miscellaneous + +=item Files and I/O + +=item Regular expressions + +Simple matching, Simple substitution, More complex regular expressions, +Parentheses for capturing, Other regexp features + +=item Writing subroutines + +=item OO Perl + +=item Using Perl modules + +=back + +=item AUTHOR + +=back + +=head2 perlfaq - frequently asked questions about Perl ($Date: 2001/10/16 +13:27:22 $) =over 4 @@ -238,7 +300,7 @@ unary &, unary *, (TYPE) ?PATTERN?, m/PATTERN/cgimosx, /PATTERN/cgimosx, q/STRING/, C<'STRING'>, qq/STRING/, "STRING", qr/STRING/imosx, qx/STRING/, `STRING`, qw/STRING/, s/PATTERN/REPLACEMENT/egimosx, tr/SEARCHLIST/REPLACEMENTLIST/cds, -y/SEARCHLIST/REPLACEMENTLIST/cds +y/SEARCHLIST/REPLACEMENTLIST/cds, <<EOF =item Gory details of parsing quoted constructs @@ -908,10 +970,10 @@ $GID, $(, $EFFECTIVE_GROUP_ID, $EGID, $), $PROGRAM_NAME, $0, $[, $], $COMPILING, $^C, $DEBUGGING, $^D, $SYSTEM_FD_MAX, $^F, $^H, %^H, $INPLACE_EDIT, $^I, $^M, $OSNAME, $^O, $PERLDB, $^P, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x100, 0x200, $LAST_REGEXP_CODE_RESULT, $^R, -$EXCEPTIONS_BEING_CAUGHT, $^S, $BASETIME, $^T, $PERL_VERSION, $^V, -$WARNING, $^W, ${^WARNING_BITS}, ${^WIDE_SYSTEM_CALLS}, $EXECUTABLE_NAME, -$^X, ARGV, $ARGV, @ARGV, @F, @INC, @_, %INC, %ENV, $ENV{expr}, %SIG, -$SIG{expr} +$EXCEPTIONS_BEING_CAUGHT, $^S, $BASETIME, $^T, ${^TAINT}, $PERL_VERSION, +$^V, $WARNING, $^W, ${^WARNING_BITS}, ${^WIDE_SYSTEM_CALLS}, +$EXECUTABLE_NAME, $^X, ARGV, $ARGV, @ARGV, @F, @INC, @_, %INC, %ENV, +$ENV{expr}, %SIG, $SIG{expr} =item Error Indicators @@ -2196,6 +2258,31 @@ chcp, dataset access, OS/390, z/OS iconv, locales =back +=head2 perlmodinstall - Installing CPAN Modules + +=over 4 + +=item DESCRIPTION + +=over 4 + +=item PREAMBLE + +B<DECOMPRESS> the file, B<UNPACK> the file into a directory, B<BUILD> the +module (sometimes unnecessary), B<INSTALL> the module + +=back + +=item PORTABILITY + +=item HEY + +=item AUTHOR + +=item COPYRIGHT + +=back + =head2 perlmodlib - constructing new Perl modules and finding existing ones =over 4 @@ -2299,28 +2386,104 @@ Adding a Copyright Notice =back -=head2 perlmodinstall - Installing CPAN Modules +=head2 perlmodstyle - Perl module style guide =over 4 -=item DESCRIPTION +=item INTRODUCTION + +=item QUICK CHECKLIST =over 4 -=item PREAMBLE +=item Before you start -B<DECOMPRESS> the file, B<UNPACK> the file into a directory, B<BUILD> the -module (sometimes unnecessary), B<INSTALL> the module +=item The API + +=item Stability + +=item Documentation + +=item Release considerations =back -=item PORTABILITY +=item BEFORE YOU START WRITING A MODULE -=item HEY +=over 4 -=item AUTHOR +=item Has it been done before? -=item COPYRIGHT +=item Do one thing and do it well + +=item What's in a name? + +=back + +=item DESIGNING AND WRITING YOUR MODULE + +=over 4 + +=item To OO or not to OO? + +=item Designing your API + +Write simple routines to do simple things, Separate functionality from +output, Provide sensible shortcuts and defaults, Naming conventions, +Parameter passing + +=item Strictness and warnings + +=item Backwards compatibility + +=item Error handling and messages + +=back + +=item DOCUMENTING YOUR MODULE + +=over 4 + +=item POD + +=item README, INSTALL, release notes, changelogs + +=back + +=item RELEASE CONSIDERATIONS + +=over 4 + +=item Version numbering + +=item Pre-requisites + +=item Testing + +=item Packaging + +=item Licensing + +=back + +=item COMMON PITFALLS + +=over 4 + +=item Reinventing the wheel + +=item Trying to do too much + +=item Inappropriate documentation + +=back + +=item SEE ALSO + +L<perlstyle>, L<perlnewmod>, L<perlpod>, L<podchecker>, Testing tools, +http://pause.perl.org/, Any good book on software engineering + +=item AUTHOR =back @@ -2406,8 +2569,8 @@ Scheme, or Tcl? =back -=head2 perlfaq2 - Obtaining and Learning about Perl ($Revision: 1.1 $, -$Date: 2001/09/20 03:03:00 $) +=head2 perlfaq2 - Obtaining and Learning about Perl ($Revision: 1.2 $, +$Date: 2001/10/16 13:27:22 $) =over 4 @@ -2462,8 +2625,8 @@ References, Tutorials, Task-Oriented, Special Topics =back -=head2 perlfaq3 - Programming Tools ($Revision: 1.1 $, $Date: 2001/09/20 -03:03:00 $) +=head2 perlfaq3 - Programming Tools ($Revision: 1.8 $, $Date: 2001/10/17 +14:14:20 $) =over 4 @@ -2509,6 +2672,9 @@ MultiEdit, SlickEdit, Bash, Ksh, Tcsh, Zsh, BBEdit and BBEdit Lite, Alpha =item How can I make my Perl program take less memory? +Don't slurp!, Use map and grep selectively, Avoid unnecessary quotes and +stringification, Pass by reference, Tie large variables to disk + =item Is it unsafe to return a pointer to local data? =item How can I free an array or hash so my program shrinks? @@ -2529,8 +2695,6 @@ MultiEdit, SlickEdit, Bash, Ksh, Tcsh, Zsh, BBEdit and BBEdit Lite, Alpha =item Where can I learn about CGI or Web programming in Perl? -=item Where can I learn about object-oriented Perl programming? - =item Where can I learn about linking C with Perl? [h2xs, xsubpp] =item I've read perlembed, perlguts, etc., but I can't embed perl in @@ -2547,8 +2711,8 @@ mean? =back -=head2 perlfaq4 - Data Manipulation ($Revision: 1.1 $, $Date: 2001/09/20 -03:03:00 $) +=head2 perlfaq4 - Data Manipulation ($Revision: 1.5 $, $Date: 2001/10/12 +15:20:13 $) =over 4 @@ -2757,8 +2921,8 @@ array of hashes or arrays? =back -=head2 perlfaq5 - Files and Formats ($Revision: 1.1 $, $Date: 2001/09/20 -03:03:00 $) +=head2 perlfaq5 - Files and Formats ($Revision: 1.3 $, $Date: 2001/10/16 +13:27:22 $) =over 4 @@ -2850,7 +3014,7 @@ protected files? Isn't this a bug in Perl? =back -=head2 perlfaq6 - Regexes ($Revision: 1.1 $, $Date: 2001/09/20 03:03:00 $) +=head2 perlfaq6 - Regexes ($Revision: 1.3 $, $Date: 2001/10/16 13:27:22 $) =over 4 @@ -2916,8 +3080,8 @@ file? =back -=head2 perlfaq7 - Perl Language Issues ($Revision: 1.1 $, $Date: 2001/09/20 -03:03:00 $) +=head2 perlfaq7 - Perl Language Issues ($Revision: 1.2 $, $Date: 2001/10/16 +13:27:22 $) =over 4 @@ -2995,8 +3159,8 @@ is in scope? =back -=head2 perlfaq8 - System Interaction ($Revision: 1.1 $, $Date: 2001/09/20 -03:03:00 $) +=head2 perlfaq8 - System Interaction ($Revision: 1.2 $, $Date: 2001/10/16 +13:27:22 $) =over 4 @@ -3123,7 +3287,7 @@ search path? =back -=head2 perlfaq9 - Networking ($Revision: 1.1 $, $Date: 2001/09/20 03:03:00 +=head2 perlfaq9 - Networking ($Revision: 1.3 $, $Date: 2001/10/16 13:27:22 $) =over 4 @@ -3132,6 +3296,8 @@ $) =over 4 +=item What is the correct form of response from a CGI script? + =item My CGI script runs from the command line but not the browser. (500 Server Error) @@ -3936,19 +4102,19 @@ PL_sv_yes, POPi, POPl, POPn, POPp, POPpbytex, POPpx, POPs, PUSHi, PUSHMARK, PUSHn, PUSHp, PUSHs, PUSHu, PUTBACK, Renew, Renewc, require_pv, RETVAL, Safefree, savepv, savepvn, SAVETMPS, scan_bin, scan_hex, scan_oct, sharedsv_find, sharedsv_init, sharedsv_lock, sharedsv_new, -sharedsv_thrcnt_dec, sharedsv_thrcnt_inc, sharedsv_unlock, SP, SPAGAIN, ST, -strEQ, strGE, strGT, strLE, strLT, strNE, strnEQ, strnNE, StructCopy, -SvCUR, SvCUR_set, SvEND, SvGETMAGIC, SvGROW, SvIOK, SvIOKp, SvIOK_notUV, -SvIOK_off, SvIOK_on, SvIOK_only, SvIOK_only_UV, SvIOK_UV, SvIV, SvIVX, -SvIVx, SvLEN, SvNIOK, SvNIOKp, SvNIOK_off, SvNOK, SvNOKp, SvNOK_off, -SvNOK_on, SvNOK_only, SvNV, SvNVx, SvNVX, SvOK, SvOOK, SvPOK, SvPOKp, -SvPOK_off, SvPOK_on, SvPOK_only, SvPOK_only_UTF8, SvPV, SvPVbyte, +sharedsv_thrcnt_dec, sharedsv_thrcnt_inc, sharedsv_unlock, sortsv, SP, +SPAGAIN, ST, strEQ, strGE, strGT, strLE, strLT, strNE, strnEQ, strnNE, +StructCopy, SvCUR, SvCUR_set, SvEND, SvGETMAGIC, SvGROW, SvIOK, SvIOKp, +SvIOK_notUV, SvIOK_off, SvIOK_on, SvIOK_only, SvIOK_only_UV, SvIOK_UV, +SvIV, SvIVX, SvIVx, SvLEN, SvNIOK, SvNIOKp, SvNIOK_off, SvNOK, SvNOKp, +SvNOK_off, SvNOK_on, SvNOK_only, SvNV, SvNVX, SvNVx, SvOK, SvOOK, SvPOK, +SvPOKp, SvPOK_off, SvPOK_on, SvPOK_only, SvPOK_only_UTF8, SvPV, SvPVbyte, SvPVbytex, SvPVbytex_force, SvPVbyte_force, SvPVbyte_nolen, SvPVutf8, -SvPVutf8x, SvPVutf8x_force, SvPVutf8_force, SvPVutf8_nolen, SvPVX, SvPVx, +SvPVutf8x, SvPVutf8x_force, SvPVutf8_force, SvPVutf8_nolen, SvPVx, SvPVX, SvPV_force, SvPV_force_nomg, SvPV_nolen, SvREFCNT, SvREFCNT_dec, SvREFCNT_inc, SvROK, SvROK_off, SvROK_on, SvRV, SvSETMAGIC, SvSetMagicSV, SvSetMagicSV_nosteal, SvSetSV, SvSetSV_nosteal, SvSTASH, SvTAINT, -SvTAINTED, SvTAINTED_off, SvTAINTED_on, SvTRUE, svtype, SvTYPE, SVt_IV, +SvTAINTED, SvTAINTED_off, SvTAINTED_on, SvTRUE, SvTYPE, svtype, SVt_IV, SVt_NV, SVt_PV, SVt_PVAV, SVt_PVCV, SVt_PVHV, SVt_PVMG, SvUOK, SvUPGRADE, SvUTF8, SvUTF8_off, SvUTF8_on, SvUV, SvUVX, SvUVx, sv_2bool, sv_2cv, sv_2io, sv_2iv, sv_2mortal, sv_2nv, sv_2pvbyte, sv_2pvbyte_nolen, @@ -6072,6 +6238,8 @@ Source, Compiled Module Source, Perl Modules/Scripts =over 4 +=item Using perl as shipped with HP-UX + =item Compiling Perl 5 on HP-UX =item PA-RISC @@ -6082,6 +6250,8 @@ Source, Compiled Module Source, Perl Modules/Scripts =item PA-RISC 2.0 +=item Itanium + =item Portability Between PA-RISC Versions =item Itanium Processor Family and HP-UX @@ -6106,6 +6276,8 @@ Source, Compiled Module Source, Perl Modules/Scripts =back +=item nss_delete core dump from op/pwent or op/grent + =item AUTHOR =item DATE @@ -6669,6 +6841,8 @@ DATAMODEL_NATIVE specified", sh: ar: not found =item op/stat.t test 4 in Solaris +=item nss_delete core dump from op/pwent or op/grent + =back =item PREBUILT BINARIES OF PERL FOR SOLARIS. @@ -6938,7 +7112,8 @@ leaks! =item BUGS -creating a thread from within a thread is unsafe under win32 +creating a thread from within a thread is unsafe under win32, +PERL_OLD_SIGNALS are not threadsafe, will not be =item SEE ALSO @@ -7425,7 +7600,8 @@ leaks! =item BUGS -creating a thread from within a thread is unsafe under win32 +creating a thread from within a thread is unsafe under win32, +PERL_OLD_SIGNALS are not threadsafe, will not be =item SEE ALSO @@ -9315,7 +9491,9 @@ $Data::Dumper::Toaster I<or> $I<OBJ>->Toaster(I<[NEWVAL]>), $Data::Dumper::Deepcopy I<or> $I<OBJ>->Deepcopy(I<[NEWVAL]>), $Data::Dumper::Quotekeys I<or> $I<OBJ>->Quotekeys(I<[NEWVAL]>), $Data::Dumper::Bless I<or> $I<OBJ>->Bless(I<[NEWVAL]>), -$Data::Dumper::Maxdepth I<or> $I<OBJ>->Maxdepth(I<[NEWVAL]>) +$Data::Dumper::Maxdepth I<or> $I<OBJ>->Maxdepth(I<[NEWVAL]>), +$Data::Dumper::Useperl I<or> $I<OBJ>->Useperl(I<[NEWVAL]>), +$Data::Dumper::Sortkeys I<or> $I<OBJ>->Sortkeys(I<[NEWVAL]>) =item Exports @@ -9487,8 +9665,8 @@ $md5->addfile($io_handle), $md5->digest, $md5->hexdigest, $md5->b64digest =item Creation C<arrayDepth>, C<hashDepth>, C<compactDump>, C<veryCompact>, C<globPrint>, -C<DumpDBFiles>, C<DumpPackages>, C<DumpReused>, C<tick>, C<HighBit>, -C<printUndef>, C<UsageOnly>, unctrl, subdump, bareStringify, quoteHighBit, +C<dumpDBFiles>, C<dumpPackages>, C<dumpReused>, C<tick>, C<quoteHighBit>, +C<printUndef>, C<usageOnly>, unctrl, subdump, bareStringify, quoteHighBit, stopDbSignal =item Methods @@ -9785,7 +9963,7 @@ test_f file =item USAGE -IV, UV, NV, PV, PVN, PVN, YES, NO, UNDEF +IV, UV, NV, PV, PVN, SV, YES, NO, UNDEF =item FUNCTIONS @@ -9807,6 +9985,8 @@ params WHAT dump_names +dogfood + C_constant, name, type, value, macro, default, pre, post, def_pre =item def_post @@ -9814,6 +9994,8 @@ XS_constant PACKAGE, TYPES, SUBNAME, C_SUBNAME autoload PACKAGE, VERSION, AUTOLOADER +WriteMakefileSnippet + WriteConstants ATTRIBUTE =E<gt> VALUE [, ...], NAME, DEFAULT_TYPE, BREAKOUT_AT, NAMES, C_FILE, XS_FILE, SUBNAME, C_SUBNAME @@ -10401,8 +10583,8 @@ MAKEAPERL, MAKEFILE, MAN1PODS, MAN3PODS, MAP_TARGET, MYEXTLIB, NAME, NEEDS_LINKING, NOECHO, NORECURS, NO_VC, OBJECT, OPTIMIZE, PERL, PERL_CORE, PERLMAINCC, PERL_ARCHLIB, PERL_LIB, PERL_MALLOC_OK, PERLRUN, PERM_RW, PERM_RWX, PL_FILES, PM, PMLIBDIRS, PM_FILTER, POLLUTE, PPM_INSTALL_EXEC, -PPM_INSTALL_SCRIPT, PREFIX, PREREQ_PM, SKIP, TEST_LIBS, VERSION, -VERSION_FROM, XS, XSOPT, XSPROTOARG, XS_VERSION +PPM_INSTALL_SCRIPT, PREFIX, PREREQ_PM, PREREQ_FATAL, SKIP, TEST_LIBS, +VERSION, VERSION_FROM, XS, XSOPT, XSPROTOARG, XS_VERSION =item Additional lowercase attributes @@ -10629,6 +10811,8 @@ rmscopy($from,$to[,$date_flag]) =item DESCRIPTION +=item NOTES + =item EXPORTS (by request only) =item BUGS @@ -10707,7 +10891,7 @@ C<GLOB_NOSPACE>, C<GLOB_ABEND> canonpath, catdir, catfile, curdir, devnull, rootdir, tmpdir, updir, no_upwards, case_tolerant, file_name_is_absolute, path, join, splitpath, -splitdir, catpath, abs2rel, rel2abs +splitdir, catpath(), abs2rel, rel2abs() =item SEE ALSO @@ -10731,7 +10915,7 @@ tmpdir path -canonpath +canonpath() splitpath @@ -10741,7 +10925,7 @@ catpath abs2rel -rel2abs +rel2abs() =over 4 @@ -10767,7 +10951,7 @@ rel2abs =back -=head2 File::Spec::Mac - File::Spec for MacOS +=head2 File::Spec::Mac - File::Spec for Mac OS (Classic) =over 4 @@ -10781,7 +10965,7 @@ canonpath =back -catdir +catdir() catfile @@ -10803,7 +10987,7 @@ splitpath splitdir -catpath +catpath() abs2rel @@ -10811,6 +10995,8 @@ rel2abs =over 4 +=item AUTHORS + =item SEE ALSO =back @@ -10836,11 +11022,11 @@ modules =item METHODS -canonpath +canonpath() =back -catdir +catdir() catfile @@ -10868,11 +11054,11 @@ splitpath splitdir -catpath +catpath() abs2rel -rel2abs +rel2abs() =over 4 @@ -11180,6 +11366,8 @@ B<$_>, B<$status>, B<filter_read> and B<filter_read_exact>, B<filter_del> =item EXPORTABLE VARIABLES +=item KNOWN ISSUES + =item KNOWN BUGS =item AUTHORS @@ -15287,6 +15475,110 @@ NORMAL TESTS, SKIPPED TESTS, TODO TESTS =back +=head2 Test::Builder - Backend for building test libraries + +=over 4 + +=item SYNOPSIS + +=item DESCRIPTION + +=over 4 + +=item Construction + +B<new> + +=back + +=back + +=over 4 + +=item Setting up tests + +B<exported_to> + +=back + +B<plan> + +B<expected_tests> + +B<no_plan> + +B<skip_all> + +=over 4 + +=item Running tests + +B<ok> + +=back + +B<is_eq>, B<is_num> + +B<like> + +B<skip> + +B<skip_rest> + +=over 4 + +=item Test style + +B<level> + +=back + +B<use_numbers> + +B<no_header>, B<no_ending> + +=over 4 + +=item Output + +B<diag> + +=back + +B<_print> + +B<output>, B<failure_output>, B<todo_output> + +=over 4 + +=item Test Status and Info + +B<current_test> + +=back + +B<summary> + +B<details> I<UNIMPLEMENTED>, B<todo> + +B<caller> + +B<_sanity_check> + +B<_whoa> + +B<_my_exit> + +=over 4 + +=item EXAMPLES + +=item AUTHOR + +=item SEE ALSO + +=back + =head2 Test::Harness - run perl standard test scripts with statistics =over 4 @@ -15365,6 +15657,12 @@ C<HARNESS_ACTIVE> =item I love it when a plan comes together +=back + +=back + +=over 4 + =item Test names =item I'm ok, you're not ok. @@ -15373,8 +15671,6 @@ B<ok> =back -=back - B<is>, B<isnt> B<like> @@ -15409,10 +15705,12 @@ B<TODO: BLOCK> =item Comparision functions -B<eq_array> +B<is_deeply> =back +B<eq_array> + B<eq_hash> B<eq_set> @@ -15446,12 +15744,6 @@ B<ok> =back -B<_sanity_check> - -B<_whoa> - -B<_my_exit> - =over 4 =item EXAMPLE @@ -15641,6 +15933,8 @@ unexpand(1) =item DESCRIPTION +=item OVERRIDES + =item EXAMPLE =item AUTHOR diff --git a/pod/perltodo.pod b/pod/perltodo.pod index b903593ff2..5fae97ac99 100644 --- a/pod/perltodo.pod +++ b/pod/perltodo.pod @@ -77,12 +77,8 @@ Allow for the metaproperties: C<XID Start>, C<XID Continue>, C<NF*_NO>, C<NF*_MAYBE> (require the DerivedCoreProperties and DerviceNormalizationProperties files). -There are also enumerated properties: C<Decomposition Type>, -C<Numeric Type>, C<East Asian Width>, C<Line Break>. These -properties have multiple values: for uniqueness the property -value should be appended. For example, C<\p{IsAlphabetic}> -wouldbe the binary property, while C<\p{AlphabeticLineBreak}> -would mean the enumerated property. +There are also multiple value properties still unimplemented: +C<Numeric Type>, C<East Asian Width>. =item * diff --git a/pod/perlunicode.pod b/pod/perlunicode.pod index dd1d726fab..6bd0423c68 100644 --- a/pod/perlunicode.pod +++ b/pod/perlunicode.pod @@ -250,6 +250,8 @@ The following reserved ranges have C<In> tests: Low Surrogate Private Surrogate CJK Ideograph Extension B + Plane 15 Private Use + Plane 16 Private Use For example C<"\x{AC00}" =~ \p{HangulSyllable}> will test true. (Handling of surrogates is not implemented yet.) @@ -309,7 +311,7 @@ The scripts available for C<\p{In...}> and C<\P{In...}>, for example Hangul Ethiopic Cherokee - CanadianAboriginal + Canadian Aboriginal Ogham Runic Khmer @@ -319,7 +321,7 @@ The scripts available for C<\p{In...}> and C<\P{In...}>, for example Bopomofo Han Yi - OldItalic + Old Italic Gothic Deseret Inherited @@ -384,101 +386,101 @@ preferential Unicode character class definition; this meant that the definitions of some character classes changed (the ones in the below list that have the C<Block> appended). - BasicLatin - Latin1Supplement - LatinExtendedA - LatinExtendedB - IPAExtensions - SpacingModifierLetters - CombiningDiacriticalMarks - GreekBlock - CyrillicBlock - ArmenianBlock - HebrewBlock - ArabicBlock - SyriacBlock - ThaanaBlock - DevanagariBlock - BengaliBlock - GurmukhiBlock - GujaratiBlock - OriyaBlock - TamilBlock - TeluguBlock - KannadaBlock - MalayalamBlock - SinhalaBlock - ThaiBlock - LaoBlock - TibetanBlock - MyanmarBlock - GeorgianBlock - HangulJamo - EthiopicBlock - CherokeeBlock - UnifiedCanadianAboriginalSyllabics - OghamBlock - RunicBlock - KhmerBlock - MongolianBlock - LatinExtendedAdditional - GreekExtended - GeneralPunctuation - SuperscriptsandSubscripts - CurrencySymbols - CombiningMarksforSymbols - LetterlikeSymbols - NumberForms + Basic Latin + Latin 1 Supplement + Latin Extended-A + Latin Extended-B + IPA Extensions + Spacing Modifier Letters + Combining Diacritical Marks + Greek Block + Cyrillic Block + Armenian Block + Hebrew Block + Arabic Block + Syriac Block + Thaana Block + Devanagari Block + Bengali Block + Gurmukhi Block + Gujarati Block + Oriya Block + Tamil Block + Telugu Block + Kannada Block + Malayalam Block + Sinhala Block + Thai Block + Lao Block + Tibetan Block + Myanmar Block + Georgian Block + Hangul Jamo + Ethiopic Block + Cherokee Block + Unified Canadian Aboriginal Syllabics + Ogham Block + Runic Block + Khmer Block + Mongolian Block + Latin Extended Additional + Greek Extended + General Punctuation + Superscripts and Subscripts + Currency Symbols + Combining Marks for Symbols + Letterlike Symbols + Number Forms Arrows - MathematicalOperators - MiscellaneousTechnical - ControlPictures - OpticalCharacterRecognition - EnclosedAlphanumerics - BoxDrawing - BlockElements - GeometricShapes - MiscellaneousSymbols + Mathematical Operators + Miscellaneous Technical + Control Pictures + Optical Character Recognition + Enclosed Alphanumerics + Box Drawing + Block Elements + Geometric Shapes + Miscellaneous Symbols Dingbats - BraillePatterns - CJKRadicalsSupplement - KangxiRadicals - IdeographicDescriptionCharacters - CJKSymbolsandPunctuation - HiraganaBlock - KatakanaBlock - BopomofoBlock - HangulCompatibilityJamo + Braille Patterns + CJK Radicals Supplement + Kangxi Radicals + Ideographic Description Characters + CJK Symbols and Punctuation + Hiragana Block + Katakana Block + Bopomofo Block + Hangul Compatibility Jamo Kanbun - BopomofoExtended - EnclosedCJKLettersandMonths - CJKCompatibility - CJKUnifiedIdeographsExtensionA - CJKUnifiedIdeographs - YiSyllables - YiRadicals - HangulSyllables - HighSurrogates - HighPrivateUseSurrogates - LowSurrogates - PrivateUse - CJKCompatibilityIdeographs - AlphabeticPresentationForms - ArabicPresentationFormsA - CombiningHalfMarks - CJKCompatibilityForms - SmallFormVariants - ArabicPresentationFormsB + Bopomofo Extended + Enclosed CJK Letters and Months + CJK Compatibility + CJK Unified Ideographs Extension A + CJK Unified Ideographs + Yi Syllables + Yi Radicals + Hangul Syllables + High Surrogates + High Private Use Surrogates + Low Surrogates + Private Use + CJK Compatibility Ideographs + Alphabetic Presentation Forms + Arabic Presentation Forms-A + Combining Half Marks + CJK Compatibility Forms + Small Form Variants + Arabic Presentation Forms-B Specials - HalfwidthandFullwidthForms - OldItalicBlock - GothicBlock - DeseretBlock - ByzantineMusicalSymbols - MusicalSymbols - MathematicalAlphanumericSymbols - CJKUnifiedIdeographsExtensionB - CJKCompatibilityIdeographsSupplement + Halfwidth and Fullwidth Forms + Old Italic Block + Gothic Block + Deseret Block + Byzantine Musical Symbols + Musical Symbols + Mathematical Alphanumeric Symbols + CJK Unified Ideographs Extension B + CJK Compatibility Ideographs Supplement Tags =item * @@ -2464,12 +2464,11 @@ PP(pp_accept) goto nuts; nstio = GvIOn(ngv); - if (IoIFP(nstio)) - do_close(ngv, FALSE); - fd = PerlSock_accept(PerlIO_fileno(IoIFP(gstio)), (struct sockaddr *)&saddr, &len); if (fd < 0) goto badexit; + if (IoIFP(nstio)) + do_close(ngv, FALSE); IoIFP(nstio) = PerlIO_fdopen(fd, "r"); IoOFP(nstio) = PerlIO_fdopen(fd, "w"); IoTYPE(nstio) = IoTYPE_SOCKET; @@ -5,6 +5,10 @@ $| = 1; +# Let tests know they're running in the perl core. Useful for modules +# which live dual lives on CPAN. +$ENV{PERL_CORE} = 1; + # Cheesy version of Getopt::Std. Maybe we should replace it with that. if ($#ARGV >= 0) { foreach my $idx (0..$#ARGV) { @@ -14,6 +14,10 @@ use Test::Harness; $Test::Harness::switches = ""; # Too much noise otherwise $Test::Harness::verbose = shift if @ARGV && $ARGV[0] eq '-v'; +# Let tests know they're running in the perl core. Useful for modules +# which live dual lives on CPAN. +$ENV{PERL_CORE} = 1; + #fudge DATA for now. %datahandle = qw( lib/bigint.t 1 @@ -245,14 +245,21 @@ else { } # 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"; +if ($^O eq 'cygwin') { + print "ok 27 # skipped: works only if check_case is set to relaxed.\n"; +} else { + chdir './tmp'; + open(fh,'>x') || die "Can't create x"; + close(fh); + rename('x', 'X'); + + # this works on win32 only, because fs isn't casesensitive + 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 if ($Is_VMSish) { @@ -267,4 +274,5 @@ print "ok 28\n"; -d 'tmp1' or print "not "; print "ok 29\n"; -END { rmdir 'tmp1'; 1 while unlink "Iofs.tmp"; } +# need to remove 'tmp' if rename() in test 28 failed! +END { rmdir 'tmp1'; rmdir 'tmp'; unlink "Iofs.tmp"; } diff --git a/t/lib/Test/Simple/Catch.pm b/t/lib/Test/Simple/Catch.pm index 3460a64dcb..e1ccd7ce45 100644 --- a/t/lib/Test/Simple/Catch.pm +++ b/t/lib/Test/Simple/Catch.pm @@ -1,16 +1,18 @@ # For testing Test::Simple; package Test::Simple::Catch; -my $out = tie *Test::Simple::TESTOUT, __PACKAGE__; -my $err = tie *Test::Simple::TESTERR, __PACKAGE__; +use Symbol; +my($out_fh, $err_fh) = (gensym, gensym); +my $out = tie *$out_fh, __PACKAGE__; +my $err = tie *$err_fh, __PACKAGE__; -# We have to use them to shut up a "used only once" warning. -() = (*Test::Simple::TESTOUT, *Test::Simple::TESTERR); +use Test::Builder; +my $t = Test::Builder->new; +$t->output($out_fh); +$t->failure_output($err_fh); +$t->todo_output($err_fh); -sub caught { return $out, $err } - -# Prevent Test::Simple from exiting in its END block. -*Test::Simple::exit = sub {}; +sub caught { return($out, $err) } sub PRINT { my $self = shift; @@ -25,5 +27,6 @@ sub TIEHANDLE { sub READ {} sub READLINE {} sub GETC {} +sub FILENO {} 1; diff --git a/t/lib/Test/Simple/Catch/More.pm b/t/lib/Test/Simple/Catch/More.pm deleted file mode 100644 index f4dee3f3ad..0000000000 --- a/t/lib/Test/Simple/Catch/More.pm +++ /dev/null @@ -1,30 +0,0 @@ -# For testing Test::More; -package Test::Simple::Catch::More; - -my $out = tie *Test::Simple::TESTOUT, __PACKAGE__; -tie *Test::More::TESTOUT, __PACKAGE__, $out; -my $err = tie *Test::More::TESTERR, __PACKAGE__; -tie *Test::Simple::TESTERR, __PACKAGE__, $err; - -# We have to use them to shut up a "used only once" warning. -() = (*Test::More::TESTOUT, *Test::More::TESTERR); - -sub caught { return $out, $err } - - -sub PRINT { - my $self = shift; - $$self .= join '', @_; -} - -sub TIEHANDLE { - my($class, $self) = @_; - my $foo = ''; - $self = $self || \$foo; - return bless $self, $class; -} -sub READ {} -sub READLINE {} -sub GETC {} - -1; diff --git a/t/lib/Test/Simple/sample_tests/five_fail.plx b/t/lib/Test/Simple/sample_tests/five_fail.plx index d33b84519b..c058e1f8f0 100644 --- a/t/lib/Test/Simple/sample_tests/five_fail.plx +++ b/t/lib/Test/Simple/sample_tests/five_fail.plx @@ -1,6 +1,6 @@ require Test::Simple; -push @INC, 't/lib'; +use lib 't/lib'; require Test::Simple::Catch; my($out, $err) = Test::Simple::Catch::caught(); diff --git a/t/op/groups.t b/t/op/groups.t index 0531826dba..3228729426 100755 --- a/t/op/groups.t +++ b/t/op/groups.t @@ -100,8 +100,11 @@ print "1..2\n"; $pwgid = $( + 0; ($pwgnam) = getgrgid($pwgid); -@basegroup{$pwgid,$pwgnam} = (1,1); - +if ($^O eq 'cygwin') { # basegroup on Cygwin has id = 0. + @basegroup{$pwgid,$pwgnam} = (0,0); +} else { + @basegroup{$pwgid,$pwgnam} = (1,1); +} $seen{$pwgid}++; for (split(' ', $()) { diff --git a/t/op/pat.t b/t/op/pat.t index 0f978d106b..66179212b2 100755 --- a/t/op/pat.t +++ b/t/op/pat.t @@ -6,7 +6,7 @@ $| = 1; -print "1..747\n"; +print "1..750\n"; BEGIN { chdir 't' if -d 't'; @@ -2243,3 +2243,15 @@ print "# some Unicode properties\n"; print "not " unless "\x{AC00}" =~ /\p{HangulSyllable}/; print "ok 747\n"; } + +{ + print "not " unless "\x{0100}" =~ /\p{Script=Latin}/; + print "ok 748\n"; + + print "not " unless "\x{0100}" =~ /\p{Block=LatinExtendedA}/; + print "ok 749\n"; + + print "not " unless "\x{0100}" =~ /\p{Category=UppercaseLetter}/; + print "ok 750\n"; +} + diff --git a/t/run/kill_perl.t b/t/run/kill_perl.t index ce98e01807..7e4f3a8b8e 100644 --- a/t/run/kill_perl.t +++ b/t/run/kill_perl.t @@ -629,16 +629,6 @@ EOT EXPECT ok ######## -# test that closures generated by eval"" hold on to the CV of the eval"" -# for their entire lifetime -$code = eval q[ - sub { eval '$x = "ok 1\n"'; } -]; -&{$code}(); -print $x; -EXPECT -ok 1 -######## # This test is here instead of pragma/locale.t because # the bug depends on in the internal state of the locale # settings and pragma/locale messes up that state pretty badly. @@ -1281,6 +1281,12 @@ Perl_swash_init(pTHX_ char* pkg, char* name, SV *listsv, I32 minbits, I32 none) return retval; } + +/* This API is wrong for special case conversions since we may need to + * return several Unicode characters for a single Unicode character + * (see lib/unicore/SpecCase.txt) The SWASHGET in lib/utf8_heavy.pl is + * the lower-level routine, and it is similarly broken for returning + * multiple values. --jhi */ UV Perl_swash_fetch(pTHX_ SV *sv, U8 *ptr, bool do_utf8) { diff --git a/vms/test.com b/vms/test.com index ce98bff0d8..6720dba357 100644 --- a/vms/test.com +++ b/vms/test.com @@ -134,6 +134,10 @@ foreach $file (@exclist) { $skip{$file}++; } $| = 1; +# Let tests know they're running in the perl core. Useful for modules +# which live dual lives on CPAN. +$ENV{PERL_CORE} = 1; + @ARGV = grep($_,@ARGV); # remove empty elements due to "''p1'" syntax if (lc($ARGV[0]) eq '-v') { @@ -6935,6 +6935,15 @@ init_os_extras() store_pipelocs(aTHX); +#ifdef Drand01_is_rand +/* this hackery brought to you by a bug in DECC for /ieee=denorm */ + { + int ix = RAND_MAX; + float x = (float)ix; + PL_my_inv_rand_max = 1./x; + } +#endif + return; } diff --git a/win32/Makefile.win64 b/win32/Makefile.win64 new file mode 100644 index 0000000000..11b96f463e --- /dev/null +++ b/win32/Makefile.win64 @@ -0,0 +1,1173 @@ +# +# Makefile to build perl on Windows NT 64 Bit using Microsoft NMAKE. +# +# Building for Itanium requires the latest SDK, a (currently unsupported) +# native Microsoft IA64 Compiler (13.00.9367.7 for IA-64 or higher), and +# of course an Itanium box running Windows XP. +# Quick start: +# 1) Edit INST_TOP and INST_DRV in this Makefile if necessary. +# 2) nmake -f Makefile.win64 +# 3) nmake -f Makefile.win64 test +# => Currently lib/posix.t 2 and op/64bitint.t 23, 53-55 will fail +# 4) nmake -f Makefile.win64 install +# +# This Configuration eanbles 64 Bit porting warning (/Wp64). Watch out for C4700 +# warnings when porting addon modules to WIN64, most of them will result in runtime +# crashes. Remember that most data types remain unchanged on WIN64. Especially long +# is still 32 Bit. Native 64 Bit datatypes are for example __int64 or size_t. If +# you really need to add WIN64 specific code use ifdef _WIN64. +# +# randolf.werner@sap.com + +## +## Make sure you read README.win32 *before* you mess with anything here! +## +## If you want a configuration that is the same as ActivePerl (see +## www.ActiveState.com) make sure you set at least BUILD_FLAVOR below! +## + +## +## Build configuration. Edit the values below to suit your needs. +## + +# +# Set these to wherever you want "nmake install" to put your newly +# built perl. Setting it to a path with spaces is NOT recommended. +# +INST_DRV = c: +INST_TOP = $(INST_DRV)\perl64 + +# +# uncomment one of the following lines if you are using either +# Visual C++ 2.x, or Visual C++ 5.x (aka Visual Studio 97) _without_ +# service pack 3 applied. +# +# If you have 5.x SP3 or later, or 6.x, no change is required. +# +#CCTYPE = MSVC20 +#CCTYPE = MSVC_PRE_50SP3 + +# +# set the install locations of the compiler include/libraries. Running +# VCVARS32.BAT is *required* when using Visual C. Some versions of +# Visual C earlier than 5.x SP3 don't define MSVCDIR in the environment. +# If such is the case you may have to set CCHOME explicitly. Spaces in +# the path name should not be quoted. +# +# If you have run VCVARS32.BAT and have VC 5.x SP3 or later, the defaults +# should just work. +# +#CCHOME = f:\msvc20 +CCHOME = $(MSVCDIR) +CCINCDIR = $(CCHOME)\include +CCLIBDIR = $(CCHOME)\lib + +# +# if you have the source for des_fcrypt(), uncomment CRYPT_SRC and make sure +# the file exists (see README.win32). File should be located in the same +# directory as this makefile. +# +# If you didn't set CRYPT_SRC and if you have des_fcrypt() available in a +# library, uncomment CRYPT_LIB, and make sure the library exists (see +# README.win32). Specify the full pathname of the library. +# +# If you don't enable one of these, the crypt() builtin will fail to work. +# (Generally not critical.) +# +#CRYPT_SRC = fcrypt.c +#CRYPT_LIB = fcrypt.lib + +# +# uncomment this option if you want to bulk-enable all the options that +# ActiveState uses to build their ActivePerl distribution. If you set this, +# there should be no need to set any of the other options that follow. +# +# If you don't enable this, the defaults below will get you the most +# efficient perl configuration possible that will also be compatible +# with the build defaults used on Unix platforms. On the other hand, +# the ActivePerl configuration will get you fork() emulation at the +# cost of some added bloat. +# +#BUILD_FLAVOR = ActivePerl + +# +# uncomment next line if you want debug version of perl (big and slow). +# If not enabled, we automatically try to use maximum optimization +# with all compilers that are known to have a working optimizer. +# +#CFG = Debug + +# +# Comment this out if you DON'T want your perl installation to be versioned. +# This means that the new installation will overwrite any files from the +# old installation at the same INST_TOP location. Leaving it enabled is +# the safest route, as perl adds the extra version directory to all the +# locations it installs files to. If you disable it, an alternative +# versioned installation can be obtained by setting INST_TOP above to a +# path that includes an arbitrary version string. +# +INST_VER = \5.6.1 + +# +# Comment this out if you DON'T want your perl installation to have +# architecture specific components. This means that architecture- +# specific files will be installed along with the architecture-neutral +# files. Leaving it enabled is safer and more flexible, in case you +# want to build multiple flavors of perl and install them together in +# the same location. Commenting it out gives you a simpler +# installation that is easier to understand for beginners. +# +INST_ARCH = \$(ARCHNAME) + +# +# uncomment to enable multiple interpreters. This is need for fork() +# emulation. +# +#USE_MULTI = define + +# +# Beginnings of interpreter cloning/threads; still very incomplete. +# This should be enabled to get the fork() emulation. This needs +# USE_MULTI as well. +# +#USE_ITHREADS = define + +# +# 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_IMP_SYS = define + +# +# WARNING! This option is deprecated and will eventually go away (enable +# USE_ITHREADS instead). +# +# 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_5005THREADS= define + +# +# WARNING! This option is deprecated and will eventually go away (enable +# USE_MULTI instead). +# +# 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 or USE_MULTI above. +# +#USE_OBJECT = define + +# +# uncomment to enable use of PerlCRT.DLL when using the Visual C compiler. +# It has patches that fix known bugs in older versions of MSVCRT.DLL. +# This currently requires VC 5.0 with Service Pack 3 or later. +# Get it from CPAN at http://www.perl.com/CPAN/authors/id/D/DO/DOUGL/ +# and follow the directions in the package to install. +# +# Not recommended if you have VC 6.x and you're not running Windows 9x. +# +#USE_PERLCRT = define + +# +# uncomment to enable linking with setargv.obj under the Visual C +# compiler. Setting this option enables perl to expand wildcards in +# arguments, but it may be harder to use alternate methods like +# File::DosGlob that are more powerful, or use perl inside shells +# that do the expansion for you. This option is supported only +# with Visual C. +# +#USE_SETARGV = define + +# +# set this if you wish to use perl's malloc +# 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_IMP_SYS above. +# +#PERL_MALLOC = define + +# +# Additional compiler flags can be specified here. +# + +# +# This should normally be disabled. Adding -DPERL_POLLUTE enables support +# for old symbols by default, at the expense of extreme pollution. You most +# probably just want to build modules that won't compile with +# perl Makefile.PL POLLUTE=1 +# instead of enabling this. Please report such modules to the respective +# authors. +# +#BUILDOPT = $(BUILDOPT) -DPERL_POLLUTE + +# +# This should normally be disabled. Enabling it will disable the File::Glob +# implementation of CORE::glob. +# +#BUILDOPT = $(BUILDOPT) -DPERL_EXTERNAL_GLOB + +# +# This should normally be disabled. Enabling it causes perl to read scripts +# in text mode (which is the 5.005 behavior) and will break ByteLoader. +#BUILDOPT = $(BUILDOPT) -DPERL_TEXTMODE_SCRIPTS + +# +# specify semicolon-separated list of extra directories that modules will +# look for libraries (spaces in path names need not be quoted) +# +EXTRALIBDIRS = + +# +# set this to your email address (perl will guess a value from +# from your loginname and your hostname, which may not be right) +# +#EMAIL = + +## +## Build configuration ends. +## + +##################### CHANGE THESE ONLY IF YOU MUST ##################### + +!IF "$(BUILD_FLAVOR)" == "ActivePerl" +INST_VER = +INST_ARCH = +USE_MULTI = define +USE_ITHREADS = define +USE_IMP_SYS = define +USE_5005THREADS = undef +USE_OBJECT = undef +USE_PERLCRT = undef +USE_SETARGV = +PERL_MALLOC = undef +!ENDIF + +!IF "$(CRYPT_SRC)$(CRYPT_LIB)" == "" +D_CRYPT = undef +!ELSE +D_CRYPT = define +CRYPT_FLAG = -DHAVE_DES_FCRYPT +!ENDIF + +!IF "$(USE_OBJECT)" == "define" +PERL_MALLOC = undef +USE_5005THREADS = undef +USE_MULTI = undef +USE_IMP_SYS = define +!ENDIF + +!IF "$(PERL_MALLOC)" == "" +PERL_MALLOC = undef +!ENDIF + +!IF "$(USE_5005THREADS)" == "" +USE_5005THREADS = undef +!ENDIF + +!IF "$(USE_5005THREADS)" == "define" +USE_ITHREADS = undef +!ENDIF + +!IF "$(USE_IMP_SYS)" == "define" +PERL_MALLOC = undef +!ENDIF + +!IF "$(CCTYPE)" == "" +CCTYPE = MSVC60 +!ENDIF + +!IF "$(USE_MULTI)" == "" +USE_MULTI = undef +!ENDIF + +!IF "$(USE_OBJECT)" == "" +USE_OBJECT = undef +!ENDIF + +!IF "$(USE_ITHREADS)" == "" +USE_ITHREADS = undef +!ENDIF + +!IF "$(USE_IMP_SYS)" == "" +USE_IMP_SYS = undef +!ENDIF + +!IF "$(USE_PERLCRT)" == "" +USE_PERLCRT = undef +!ENDIF + +!IF "$(USE_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 + +!IF "$(USE_IMP_SYS)" != "undef" +BUILDOPT = $(BUILDOPT) -DPERL_IMPLICIT_SYS +!ENDIF + +!IF "$(PROCESSOR_ARCHITECTURE)" == "" +PROCESSOR_ARCHITECTURE = x86 +!ENDIF + +!IF "$(USE_OBJECT)" == "define" +ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-object +!ELSE +!IF "$(USE_5005THREADS)" == "define" +ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-thread +!ELSE +!IF "$(USE_MULTI)" == "define" +ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-multi +!ELSE +ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE) +!ENDIF +!ENDIF +!ENDIF + +!IF "$(USE_ITHREADS)" == "define" +ARCHNAME = $(ARCHNAME)-thread +!ENDIF + +# Visual Studio 98 specific +!IF "$(CCTYPE)" == "MSVC60" +# VC 6.0 can load the socket dll on demand. Makes the test suite +# run in about 10% less time. +DELAYLOAD = -DELAYLOAD:wsock32.dll -DELAYLOAD:shell32.dll delayimp.lib +!ENDIF + + +ARCHDIR = ..\lib\$(ARCHNAME) +COREDIR = ..\lib\CORE +AUTODIR = ..\lib\auto +LIBDIR = ..\lib +EXTDIR = ..\ext +PODDIR = ..\pod +EXTUTILSDIR = $(LIBDIR)\ExtUtils + +# +INST_SCRIPT = $(INST_TOP)$(INST_VER)\bin +INST_BIN = $(INST_SCRIPT)$(INST_ARCH) +INST_LIB = $(INST_TOP)$(INST_VER)\lib +INST_ARCHLIB = $(INST_LIB)$(INST_ARCH) +INST_COREDIR = $(INST_ARCHLIB)\CORE +INST_POD = $(INST_LIB)\pod +INST_HTML = $(INST_TOP)$(INST_VER)\html + +# +# Programs to compile, build .lib files and link +# + +CC = cl +LINK32 = link +LIB32 = $(LINK32) -lib +RSC = rc + +# +# Options +# + +INCLUDES = -I$(COREDIR) -I.\include -I. -I.. +#PCHFLAGS = -Fpc:\temp\vcmoduls.pch -YX +DEFINES = -DWIN32 -D_CONSOLE -DNO_STRICT $(CRYPT_FLAG) +LOCDEFS = -DPERLDLL -DPERL_CORE +SUBSYS = console +CXX_FLAG = -TP -GX + +!IF "$(USE_PERLCRT)" != "define" +LIBC = msvcrt.lib +!ELSE +LIBC = PerlCRT.lib +!ENDIF + +PERLEXE_RES = +PERLDLL_RES = + +!IF "$(CFG)" == "Debug" +! IF "$(CCTYPE)" == "MSVC20" +OPTIMIZE = -DCONSERVATIVE -Wp64 -Od -Op -MD -Z7 -DDEBUGGING +! ELSE +OPTIMIZE = -DCONSERVATIVE -Wp64 -Od -Op -MD -Zi -DDEBUGGING +! ENDIF +LINK_DBG = -debug +!ELSE +# -O1 yields smaller code, which turns out to be faster than -O2 +OPTIMIZE = -DCONSERVATIVE -Wp64 -O2 -Op -MD -Zi -DNDEBUG +# VC 6.0 seems capable of compiling perl correctly with optimizations +# enabled. Anything earlier fails tests. +! IF "$(CCTYPE)" == "MSVC20" || "$(CCTYPE)" == "MSVC_PRE_50SP3" +OPTIMIZE = -DCONSERVATIVE -Wp64 -O2 -Op -MD -Zi -DNDEBUG +! ENDIF +LINK_DBG = -debug +!ENDIF + + +!IF "$(USE_OBJECT)" == "define" +OPTIMIZE = $(OPTIMIZE) $(CXX_FLAG) +BUILDOPT = $(BUILDOPT) -DPERL_OBJECT +!ENDIF + +!IF "$(USE_PERLCRT)" != "define" +BUILDOPT = $(BUILDOPT) +!ENDIF + +LIBBASEFILES = $(CRYPT_LIB) \ + oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib \ + comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \ + netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib \ + version.lib odbc32.lib odbccp32.lib + +# we add LIBC here, since we may be using PerlCRT.dll +LIBFILES = $(LIBBASEFILES) $(LIBC) + +CFLAGS = -nologo -Gf -W3 $(INCLUDES) $(DEFINES) $(LOCDEFS) \ + $(PCHFLAGS) $(OPTIMIZE) +LINK_FLAGS = -nologo -nodefaultlib $(LINK_DBG) \ + -libpath:"$(INST_COREDIR)" \ + -machine:$(PROCESSOR_ARCHITECTURE) +OBJOUT_FLAG = -Fo +EXEOUT_FLAG = -Fe + +CFLAGS_O = $(CFLAGS) $(BUILDOPT) + +#################### do not edit below this line ####################### +############# NO USER-SERVICEABLE PARTS BEYOND THIS POINT ############## + +o = .obj + +# +# Rules +# + +.SUFFIXES : .c $(o) .dll .lib .exe .rc .res + +.c$(o): + $(CC) -c -I$(<D) $(CFLAGS_O) $(OBJOUT_FLAG)$@ $< + +.y.c: + $(NOOP) + +$(o).dll: + $(LINK32) -dll -subsystem:windows -implib:$(*B).lib -def:$(*B).def \ + -out:$@ $(LINK_FLAGS) $(LIBFILES) $< $(LIBPERL) + +.rc.res: + $(RSC) -i.. $< + +# +# various targets +PERLIMPLIB = ..\perl56.lib +PERLDLL = ..\perl56.dll + +MINIPERL = ..\miniperl.exe +MINIDIR = .\mini +PERLEXE = ..\perl.exe +WPERLEXE = ..\wperl.exe +GLOBEXE = ..\perlglob.exe +CONFIGPM = ..\lib\Config.pm +MINIMOD = ..\lib\ExtUtils\Miniperl.pm +X2P = ..\x2p\a2p.exe + +PL2BAT = bin\pl2bat.pl +GLOBBAT = bin\perlglob.bat + +UTILS = \ + ..\utils\h2ph \ + ..\utils\splain \ + ..\utils\dprofpp \ + ..\utils\perlbug \ + ..\utils\pl2pm \ + ..\utils\c2ph \ + ..\utils\h2xs \ + ..\utils\perldoc \ + ..\utils\perlcc \ + ..\pod\checkpods \ + ..\pod\pod2html \ + ..\pod\pod2latex \ + ..\pod\pod2man \ + ..\pod\pod2text \ + ..\pod\pod2usage \ + ..\pod\podchecker \ + ..\pod\podselect \ + ..\x2p\find2perl \ + ..\x2p\s2p \ + bin\exetype.pl \ + bin\runperl.pl \ + bin\pl2bat.pl \ + bin\perlglob.pl \ + bin\search.pl + +MAKE = nmake -nologo + +CFGSH_TMPL = config.win64 +CFGH_TMPL = config_H.win64 + +XCOPY = xcopy /f /r /i /d +RCOPY = xcopy /f /r /i /e /d +NOOP = @echo +NULL = + +# +# filenames given to xsubpp must have forward slashes (since it puts +# full pathnames in #line strings) +XSUBPP = ..\$(MINIPERL) -I..\..\lib ..\$(EXTUTILSDIR)\xsubpp \ + -C++ -prototypes + +MICROCORE_SRC = \ + ..\av.c \ + ..\deb.c \ + ..\doio.c \ + ..\doop.c \ + ..\dump.c \ + ..\globals.c \ + ..\gv.c \ + ..\hv.c \ + ..\mg.c \ + ..\op.c \ + ..\perl.c \ + ..\perlapi.c \ + ..\perly.c \ + ..\pp.c \ + ..\pp_ctl.c \ + ..\pp_hot.c \ + ..\pp_sys.c \ + ..\regcomp.c \ + ..\regexec.c \ + ..\run.c \ + ..\scope.c \ + ..\sv.c \ + ..\taint.c \ + ..\toke.c \ + ..\universal.c \ + ..\utf8.c \ + ..\util.c \ + ..\xsutils.c + +EXTRACORE_SRC = $(EXTRACORE_SRC) perllib.c + +!IF "$(PERL_MALLOC)" == "define" +EXTRACORE_SRC = $(EXTRACORE_SRC) ..\malloc.c +!ENDIF + +!IF "$(USE_OBJECT)" != "define" +EXTRACORE_SRC = $(EXTRACORE_SRC) ..\perlio.c +!ENDIF + +WIN32_SRC = \ + .\win32.c \ + .\win32sck.c \ + .\win32thread.c + +!IF "$(CRYPT_SRC)" != "" +WIN32_SRC = $(WIN32_SRC) .\$(CRYPT_SRC) +!ENDIF + +DLL_SRC = $(DYNALOADER).c + +X2P_SRC = \ + ..\x2p\a2p.c \ + ..\x2p\hash.c \ + ..\x2p\str.c \ + ..\x2p\util.c \ + ..\x2p\walk.c + +CORE_NOCFG_H = \ + ..\av.h \ + ..\cop.h \ + ..\cv.h \ + ..\dosish.h \ + ..\embed.h \ + ..\form.h \ + ..\gv.h \ + ..\handy.h \ + ..\hv.h \ + ..\iperlsys.h \ + ..\mg.h \ + ..\nostdio.h \ + ..\op.h \ + ..\opcode.h \ + ..\perl.h \ + ..\perlapi.h \ + ..\perlsdio.h \ + ..\perlsfio.h \ + ..\perly.h \ + ..\pp.h \ + ..\proto.h \ + ..\regexp.h \ + ..\scope.h \ + ..\sv.h \ + ..\thread.h \ + ..\unixish.h \ + ..\utf8.h \ + ..\util.h \ + ..\warnings.h \ + ..\XSUB.h \ + ..\EXTERN.h \ + ..\perlvars.h \ + ..\intrpvar.h \ + ..\thrdvar.h \ + .\include\dirent.h \ + .\include\netdb.h \ + .\include\sys\socket.h \ + .\win32.h + +CORE_H = $(CORE_NOCFG_H) .\config.h + +MICROCORE_OBJ = $(MICROCORE_SRC:.c=.obj) +CORE_OBJ = $(MICROCORE_OBJ) $(EXTRACORE_SRC:.c=.obj) +WIN32_OBJ = $(WIN32_SRC:.c=.obj) +MINICORE_OBJ = $(MICROCORE_OBJ:..\=.\mini\) \ + $(MINIDIR)\miniperlmain$(o) \ + $(MINIDIR)\perlio$(o) +MINIWIN32_OBJ = $(WIN32_OBJ:.\=.\mini\) +MINI_OBJ = $(MINICORE_OBJ) $(MINIWIN32_OBJ) +DLL_OBJ = $(DLL_SRC:.c=.obj) +X2P_OBJ = $(X2P_SRC:.c=.obj) + +PERLDLL_OBJ = $(CORE_OBJ) +PERLEXE_OBJ = perlmain$(o) + +PERLDLL_OBJ = $(PERLDLL_OBJ) $(WIN32_OBJ) $(DLL_OBJ) +#PERLEXE_OBJ = $(PERLEXE_OBJ) $(WIN32_OBJ) $(DLL_OBJ) + +!IF "$(USE_SETARGV)" != "" +SETARGV_OBJ = setargv$(o) +!ENDIF + +DYNAMIC_EXT = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B re \ + Data/Dumper Devel/Peek ByteLoader Devel/DProf File/Glob \ + Sys/Hostname +STATIC_EXT = DynaLoader +NONXS_EXT = Errno + +DYNALOADER = $(EXTDIR)\DynaLoader\DynaLoader +SOCKET = $(EXTDIR)\Socket\Socket +FCNTL = $(EXTDIR)\Fcntl\Fcntl +OPCODE = $(EXTDIR)\Opcode\Opcode +SDBM_FILE = $(EXTDIR)\SDBM_File\SDBM_File +IO = $(EXTDIR)\IO\IO +POSIX = $(EXTDIR)\POSIX\POSIX +ATTRS = $(EXTDIR)\attrs\attrs +THREAD = $(EXTDIR)\Thread\Thread +B = $(EXTDIR)\B\B +RE = $(EXTDIR)\re\re +DUMPER = $(EXTDIR)\Data\Dumper\Dumper +ERRNO = $(EXTDIR)\Errno\Errno +PEEK = $(EXTDIR)\Devel\Peek\Peek +BYTELOADER = $(EXTDIR)\ByteLoader\ByteLoader +DPROF = $(EXTDIR)\Devel\DProf\DProf +GLOB = $(EXTDIR)\File\Glob\Glob +HOSTNAME = $(EXTDIR)\Sys\Hostname\Hostname + +SOCKET_DLL = $(AUTODIR)\Socket\Socket.dll +FCNTL_DLL = $(AUTODIR)\Fcntl\Fcntl.dll +OPCODE_DLL = $(AUTODIR)\Opcode\Opcode.dll +SDBM_FILE_DLL = $(AUTODIR)\SDBM_File\SDBM_File.dll +IO_DLL = $(AUTODIR)\IO\IO.dll +POSIX_DLL = $(AUTODIR)\POSIX\POSIX.dll +ATTRS_DLL = $(AUTODIR)\attrs\attrs.dll +THREAD_DLL = $(AUTODIR)\Thread\Thread.dll +B_DLL = $(AUTODIR)\B\B.dll +DUMPER_DLL = $(AUTODIR)\Data\Dumper\Dumper.dll +PEEK_DLL = $(AUTODIR)\Devel\Peek\Peek.dll +RE_DLL = $(AUTODIR)\re\re.dll +BYTELOADER_DLL = $(AUTODIR)\ByteLoader\ByteLoader.dll +DPROF_DLL = $(AUTODIR)\Devel\DProf\DProf.dll +GLOB_DLL = $(AUTODIR)\File\Glob\Glob.dll +HOSTNAME_DLL = $(AUTODIR)\Sys\Hostname\Hostname.dll + +ERRNO_PM = $(LIBDIR)\Errno.pm + +EXTENSION_C = \ + $(SOCKET).c \ + $(FCNTL).c \ + $(OPCODE).c \ + $(SDBM_FILE).c \ + $(IO).c \ + $(POSIX).c \ + $(ATTRS).c \ + $(THREAD).c \ + $(RE).c \ + $(DUMPER).c \ + $(PEEK).c \ + $(B).c \ + $(BYTELOADER).c \ + $(DPROF).c \ + $(GLOB).c \ + $(HOSTNAME).c + +EXTENSION_DLL = \ + $(SOCKET_DLL) \ + $(FCNTL_DLL) \ + $(OPCODE_DLL) \ + $(SDBM_FILE_DLL)\ + $(IO_DLL) \ + $(POSIX_DLL) \ + $(ATTRS_DLL) \ + $(DUMPER_DLL) \ + $(PEEK_DLL) \ + $(B_DLL) \ + $(RE_DLL) \ + $(THREAD_DLL) \ + $(BYTELOADER_DLL) \ + $(DPROF_DLL) \ + $(GLOB_DLL) \ + $(HOSTNAME_DLL) + +EXTENSION_PM = \ + $(ERRNO_PM) + +POD2HTML = $(PODDIR)\pod2html +POD2MAN = $(PODDIR)\pod2man +POD2LATEX = $(PODDIR)\pod2latex +POD2TEXT = $(PODDIR)\pod2text + +CFG_VARS = \ + "INST_DRV=$(INST_DRV)" \ + "INST_TOP=$(INST_TOP)" \ + "INST_VER=$(INST_VER)" \ + "INST_ARCH=$(INST_ARCH)" \ + "archname=$(ARCHNAME)" \ + "cc=$(CC)" \ + "ccflags=-nologo $(OPTIMIZE:"=\") $(DEFINES) $(BUILDOPT)" \ + "cf_email=$(EMAIL)" \ + "d_crypt=$(D_CRYPT)" \ + "d_mymalloc=$(PERL_MALLOC)" \ + "libs=$(LIBFILES)" \ + "incpath=$(CCINCDIR:"=\")" \ + "libperl=$(PERLIMPLIB:..\=)" \ + "libpth=$(CCLIBDIR:"=\");$(EXTRALIBDIRS:"=\")" \ + "libc=$(LIBC)" \ + "make=nmake" \ + "static_ext=$(STATIC_EXT)" \ + "dynamic_ext=$(DYNAMIC_EXT)" \ + "nonxs_ext=$(NONXS_EXT)" \ + "use5005threads=$(USE_5005THREADS)" \ + "useithreads=$(USE_ITHREADS)" \ + "usethreads=$(USE_5005THREADS)" \ + "usemultiplicity=$(USE_MULTI)" \ + "LINK_FLAGS=$(LINK_FLAGS:"=\")" \ + "optimize=$(OPTIMIZE:"=\")" + +# +# Top targets +# + +all : .\config.h $(GLOBEXE) $(MINIMOD) $(CONFIGPM) $(PERLEXE) \ + $(X2P) $(EXTENSION_DLL) $(EXTENSION_PM) + +$(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c + +#------------------------------------------------------------ + +$(GLOBEXE) : perlglob$(o) + $(LINK32) $(LINK_FLAGS) $(LIBFILES) -out:$@ -subsystem:$(SUBSYS) \ + perlglob$(o) setargv$(o) + +perlglob$(o) : perlglob.c + +config.w32 : $(CFGSH_TMPL) + copy $(CFGSH_TMPL) config.w32 + +.\config.h : $(CFGH_TMPL) + -del /f config.h + copy $(CFGH_TMPL) config.h + +..\config.sh : config.w32 $(MINIPERL) config_sh.PL + $(MINIPERL) -I..\lib config_sh.PL $(CFG_VARS) config.w32 > ..\config.sh + +# this target is for when changes to the main config.sh happen +# edit config.{b,v,g}c and make this target once for each supported +# compiler (e.g. `dmake CCTYPE=BORLAND regen_config_h`) +regen_config_h: + perl config_sh.PL $(CFG_VARS) $(CFGSH_TMPL) > ..\config.sh + cd .. + -del /f perl.exe + perl configpm + cd win32 + -del /f $(CFGH_TMPL) + -mkdir $(COREDIR) + -perl -I..\lib config_h.PL "INST_VER=$(INST_VER)" + rename config.h $(CFGH_TMPL) + +$(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl + cd .. && miniperl configpm + if exist lib\* $(RCOPY) lib\*.* ..\lib\$(NULL) + $(XCOPY) ..\*.h $(COREDIR)\*.* + $(XCOPY) *.h $(COREDIR)\*.* + $(XCOPY) ..\ext\re\re.pm $(LIBDIR)\*.* + $(RCOPY) include $(COREDIR)\*.* + $(MINIPERL) -I..\lib config_h.PL "INST_VER=$(INST_VER)" \ + || $(MAKE) /$(MAKEFLAGS) $(CONFIGPM) + +$(MINIPERL) : $(MINIDIR) $(MINI_OBJ) + $(LINK32) -subsystem:console -out:$@ @<< + $(LINK_FLAGS) $(LIBFILES) $(MINI_OBJ) +<< + +$(MINIDIR) : + if not exist "$(MINIDIR)" mkdir "$(MINIDIR)" + +$(MINICORE_OBJ) : $(CORE_NOCFG_H) + $(CC) -c $(CFLAGS) -DPERL_EXTERNAL_GLOB $(OBJOUT_FLAG)$@ ..\$(*F).c + +$(MINIWIN32_OBJ) : $(CORE_NOCFG_H) + $(CC) -c $(CFLAGS) $(OBJOUT_FLAG)$@ $(*F).c + +# -DPERL_IMPLICIT_SYS needs C++ for perllib.c +# This is the only file that depends on perlhost.h, vmem.h, and vdir.h +!IF "$(USE_IMP_SYS)$(USE_OBJECT)" == "defineundef" +perllib$(o) : perllib.c .\perlhost.h .\vdir.h .\vmem.h + $(CC) -c -I. $(CFLAGS_O) $(CXX_FLAG) $(OBJOUT_FLAG)$@ perllib.c +!ENDIF + +# 1. we don't want to rebuild miniperl.exe when config.h changes +# 2. we don't want to rebuild miniperl.exe with non-default config.h +$(MINI_OBJ) : $(CORE_NOCFG_H) + +$(WIN32_OBJ) : $(CORE_H) +$(CORE_OBJ) : $(CORE_H) +$(DLL_OBJ) : $(CORE_H) +$(X2P_OBJ) : $(CORE_H) + +perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym ..\pp.sym ..\makedef.pl + $(MINIPERL) -w ..\makedef.pl PLATFORM=win32 $(OPTIMIZE) $(DEFINES) $(BUILDOPT) \ + CCTYPE=$(CCTYPE) > perldll.def + +$(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES) + $(LINK32) -dll -def:perldll.def -base:0x28000000 -out:$@ @<< + $(LINK_FLAGS) $(DELAYLOAD) $(LIBFILES) $(PERLDLL_OBJ) $(PERLDLL_RES) +<< + $(XCOPY) $(PERLIMPLIB) $(COREDIR) + +$(MINIMOD) : $(MINIPERL) ..\minimod.pl + cd .. && miniperl minimod.pl > lib\ExtUtils\Miniperl.pm + +..\x2p\a2p$(o) : ..\x2p\a2p.c + $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\a2p.c + +..\x2p\hash$(o) : ..\x2p\hash.c + $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\hash.c + +..\x2p\str$(o) : ..\x2p\str.c + $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\str.c + +..\x2p\util$(o) : ..\x2p\util.c + $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\util.c + +..\x2p\walk$(o) : ..\x2p\walk.c + $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\walk.c + +$(X2P) : $(MINIPERL) $(X2P_OBJ) + $(MINIPERL) ..\x2p\find2perl.PL + $(MINIPERL) ..\x2p\s2p.PL + $(LINK32) -subsystem:console -out:$@ @<< + $(LINK_FLAGS) $(LIBFILES) $(X2P_OBJ) +<< + +perlmain.c : runperl.c + copy runperl.c perlmain.c + +perlmain$(o) : perlmain.c + $(CC) $(CFLAGS_O) -UPERLDLL $(OBJOUT_FLAG)$@ -c perlmain.c + +$(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES) + $(LINK32) -subsystem:console -out:$@ -stack:0x1000000 $(LINK_FLAGS) \ + $(LIBFILES) $(PERLEXE_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) $(PERLEXE_RES) + copy $(PERLEXE) $(WPERLEXE) + $(MINIPERL) -I..\lib bin\exetype.pl $(WPERLEXE) WINDOWS + copy splittree.pl .. + $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR) + +$(DYNALOADER).c: $(MINIPERL) $(EXTDIR)\DynaLoader\dl_win32.xs $(CONFIGPM) + if not exist $(AUTODIR) mkdir $(AUTODIR) + cd $(EXTDIR)\$(*B) + ..\$(MINIPERL) -I..\..\lib $(*B)_pm.PL + ..\$(MINIPERL) -I..\..\lib XSLoader_pm.PL + cd ..\..\win32 + $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL) + $(XCOPY) $(EXTDIR)\$(*B)\XSLoader.pm $(LIBDIR)\$(NULL) + cd $(EXTDIR)\$(*B) + $(XSUBPP) dl_win32.xs > $(*B).c + cd ..\..\win32 + +$(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs + copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs + +$(DUMPER_DLL): $(PERLEXE) $(DUMPER).xs + cd $(EXTDIR)\Data\$(*B) + ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl + $(MAKE) + cd ..\..\..\win32 + +$(DPROF_DLL): $(PERLEXE) $(DPROF).xs + cd $(EXTDIR)\Devel\$(*B) + ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl + $(MAKE) + cd ..\..\..\win32 + +$(GLOB_DLL): $(PERLEXE) $(GLOB).xs + cd $(EXTDIR)\File\$(*B) + ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl + $(MAKE) + cd ..\..\..\win32 + +$(PEEK_DLL): $(PERLEXE) $(PEEK).xs + cd $(EXTDIR)\Devel\$(*B) + ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl + $(MAKE) + cd ..\..\..\win32 + +$(RE_DLL): $(PERLEXE) $(RE).xs + cd $(EXTDIR)\$(*B) + ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl + $(MAKE) + cd ..\..\win32 + +$(B_DLL): $(PERLEXE) $(B).xs + cd $(EXTDIR)\$(*B) + ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl + $(MAKE) + cd ..\..\win32 + +$(THREAD_DLL): $(PERLEXE) $(THREAD).xs + cd $(EXTDIR)\$(*B) + ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl + $(MAKE) + cd ..\..\win32 + +$(ATTRS_DLL): $(PERLEXE) $(ATTRS).xs + cd $(EXTDIR)\$(*B) + ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl + $(MAKE) + cd ..\..\win32 + +$(POSIX_DLL): $(PERLEXE) $(POSIX).xs + cd $(EXTDIR)\$(*B) + ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl + $(MAKE) + cd ..\..\win32 + +$(IO_DLL): $(PERLEXE) $(IO).xs + cd $(EXTDIR)\$(*B) + ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl + $(MAKE) + cd ..\..\win32 + +$(SDBM_FILE_DLL) : $(PERLEXE) $(SDBM_FILE).xs + cd $(EXTDIR)\$(*B) + ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl + $(MAKE) + cd ..\..\win32 + +$(FCNTL_DLL): $(PERLEXE) $(FCNTL).xs + cd $(EXTDIR)\$(*B) + ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl + $(MAKE) + cd ..\..\win32 + +$(OPCODE_DLL): $(PERLEXE) $(OPCODE).xs + cd $(EXTDIR)\$(*B) + ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl + $(MAKE) + cd ..\..\win32 + +$(SOCKET_DLL): $(PERLEXE) $(SOCKET).xs + cd $(EXTDIR)\$(*B) + ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl + $(MAKE) + cd ..\..\win32 + +$(HOSTNAME_DLL): $(PERLEXE) $(HOSTNAME).xs + cd $(EXTDIR)\Sys\$(*B) + ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl + $(MAKE) + cd ..\..\..\win32 + +$(BYTELOADER_DLL): $(PERLEXE) $(BYTELOADER).xs + cd $(EXTDIR)\$(*B) + ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl + $(MAKE) + cd ..\..\win32 + +$(ERRNO_PM): $(PERLEXE) $(ERRNO)_pm.PL + cd $(EXTDIR)\$(*B) + ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl + $(MAKE) + cd ..\..\win32 + +doc: $(PERLEXE) + $(PERLEXE) -I..\lib ..\installhtml --podroot=.. --htmldir=./html \ + --podpath=pod:lib:ext:utils --htmlroot="file://$(INST_HTML::=|)" \ + --libpod=perlfunc:perlguts:perlvar:perlrun:perlop --recurse + +utils: $(PERLEXE) $(X2P) + cd ..\utils + $(MAKE) PERL=$(MINIPERL) + cd ..\pod + copy ..\README.aix .\perlaix.pod + copy ..\README.amiga .\perlamiga.pod + copy ..\README.bs2000 .\perlbs2000.pod + copy ..\README.cygwin .\perlcygwin.pod + copy ..\README.dos .\perldos.pod + copy ..\README.epoc .\perlepoc.pod + copy ..\README.hpux .\perlhpux.pod + copy ..\README.mpeix .\perlmpeix.pod + copy ..\README.os2 .\perlos2.pod + copy ..\README.os390 .\perlos390.pod + copy ..\README.solaris .\perlsolaris.pod + copy ..\README.vmesa .\perlvmesa.pod + copy ..\vms\perlvms.pod .\perlvms.pod + copy ..\README.vos .\perlvos.pod + copy ..\README.win32 .\perlwin32.pod + $(MAKE) -f ..\win32\pod.mak converters + cd ..\win32 + $(PERLEXE) $(PL2BAT) $(UTILS) + +distclean: clean + -del /f $(MINIPERL) $(PERLEXE) $(PERLDLL) $(GLOBEXE) \ + $(PERLIMPLIB) ..\miniperl.lib $(MINIMOD) + -del /f *.def *.map + -del /f $(EXTENSION_DLL) $(EXTENSION_PM) + -del /f $(EXTENSION_C) $(DYNALOADER).c $(ERRNO).pm + -del /f $(EXTDIR)\DynaLoader\dl_win32.xs $(EXTDIR)\DynaLoader\DynaLoader.pm + -del /f $(LIBDIR)\.exists $(LIBDIR)\attrs.pm $(LIBDIR)\DynaLoader.pm + -del /f $(LIBDIR)\XSLoader.pm $(EXTDIR)\DynaLoader\XSLoader.pm + -del /f $(LIBDIR)\Devel\.exists $(LIBDIR)\File\.exists $(LIBDIR)\Sys\.exists + -del /f $(LIBDIR)\Fcntl.pm $(LIBDIR)\IO.pm $(LIBDIR)\Opcode.pm + -del /f $(LIBDIR)\ops.pm $(LIBDIR)\Safe.pm $(LIBDIR)\Thread.pm + -del /f $(LIBDIR)\SDBM_File.pm $(LIBDIR)\Socket.pm $(LIBDIR)\POSIX.pm + -del /f $(LIBDIR)\B.pm $(EXTDIR)\B\defsubs.h $(LIBDIR)\O.pm $(LIBDIR)\re.pm + -del /f $(LIBDIR)\Data\Dumper.pm $(LIBDIR)\ByteLoader.pm + -del /f $(LIBDIR)\Devel\Peek.pm $(LIBDIR)\Devel\DProf.pm + -del /f $(LIBDIR)\File\Glob.pm + -if exist $(LIBDIR)\IO rmdir /s /q $(LIBDIR)\IO || rmdir /s $(LIBDIR)\IO + -if exist $(LIBDIR)\Thread rmdir /s /q $(LIBDIR)\Thread || rmdir /s $(LIBDIR)\Thread + -if exist $(LIBDIR)\B rmdir /s /q $(LIBDIR)\B || rmdir /s $(LIBDIR)\B + -if exist $(LIBDIR)\Data rmdir /s /q $(LIBDIR)\Data || rmdir /s $(LIBDIR)\Data + cd $(PODDIR) + -del /f *.html *.bat checkpods \ + perlaix.pod perlamiga.pod perlbs2000.pod perlcygwin.pod \ + perldos.pod perlepoc.pod perlhpux.pod perlmachten.pod \ + perlmacos.pod perlmpeix.pod perlos2.pod perlos390.pod \ + perlsolaris.pod perlvmesa.pod perlvms.pod perlvos.pod \ + perlwin32.pod pod2html pod2latex pod2man pod2text pod2usage \ + podchecker podselect + cd ..\utils + -del /f h2ph splain perlbug pl2pm c2ph h2xs perldoc dprofpp \ + *.bat perlcc pstruct + cd ..\win32 + cd ..\x2p + -del /f find2perl s2p + -del /f *.bat + cd ..\win32 + -del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new + -del /f $(CONFIGPM) + -del /f bin\*.bat + cd $(EXTDIR) + -del /s *.lib *.def *.map *.pdb *.bs Makefile *$(o) pm_to_blib + cd ..\win32 + -if exist $(AUTODIR) rmdir /s /q $(AUTODIR) || rmdir /s $(AUTODIR) + -if exist $(COREDIR) rmdir /s /q $(COREDIR) || rmdir /s $(COREDIR) + +install : all installbare installhtml + +installbare : utils + $(PERLEXE) ..\installperl + if exist $(WPERLEXE) $(XCOPY) $(WPERLEXE) $(INST_BIN)\*.* + $(XCOPY) $(GLOBEXE) $(INST_BIN)\*.* + $(XCOPY) bin\*.bat $(INST_SCRIPT)\*.* + +installhtml : doc + $(RCOPY) html\*.* $(INST_HTML)\*.* + +inst_lib : $(CONFIGPM) + copy splittree.pl .. + $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR) + $(RCOPY) ..\lib $(INST_LIB)\*.* + +minitest : $(MINIPERL) $(GLOBEXE) $(CONFIGPM) utils + $(XCOPY) $(MINIPERL) ..\t\perl.exe + $(XCOPY) $(GLOBEXE) ..\t\$(NULL) + attrib -r ..\t\*.* + copy test ..\t + cd ..\t + $(MINIPERL) -I..\lib test base/*.t comp/*.t cmd/*.t io/*.t op/*.t pragma/*.t + cd ..\win32 + +test-prep : all utils + $(XCOPY) $(PERLEXE) ..\t\$(NULL) + $(XCOPY) $(PERLDLL) ..\t\$(NULL) + $(XCOPY) $(GLOBEXE) ..\t\$(NULL) + +test : test-prep + cd ..\t + $(PERLEXE) -I..\lib harness + cd ..\win32 + +test-notty : test-prep + set PERL_SKIP_TTY_TEST=1 + cd ..\t + $(PERLEXE) -I..\lib harness + cd ..\win32 + +test-wide : test-prep + set HARNESS_PERL_SWITCHES=-C + cd ..\t + $(PERLEXE) -I..\lib harness + cd ..\win32 + +test-wide-notty : test-prep + set PERL_SKIP_TTY_TEST=1 + set HARNESS_PERL_SWITCHES=-C + cd ..\t + $(PERLEXE) -I..\lib harness + cd ..\win32 + +clean : + -@erase miniperlmain$(o) + -@erase $(MINIPERL) + -@erase perlglob$(o) + -@erase perlmain$(o) + -@erase config.w32 + -@erase /f config.h + -@erase $(GLOBEXE) + -@erase $(PERLEXE) + -@erase $(WPERLEXE) + -@erase $(PERLDLL) + -@erase $(CORE_OBJ) + -if exist $(MINIDIR) rmdir /s /q $(MINIDIR) || rmdir /s $(MINIDIR) + -@erase $(WIN32_OBJ) + -@erase $(DLL_OBJ) + -@erase $(X2P_OBJ) + -@erase ..\*$(o) ..\*.lib ..\*.exp *$(o) *.lib *.exp *.res + -@erase ..\t\*.exe ..\t\*.dll ..\t\*.bat + -@erase ..\x2p\*.exe ..\x2p\*.bat + -@erase *.ilk + -@erase *.pdb + +# Handy way to run perlbug -ok without having to install and run the +# installed perlbug. We don't re-run the tests here - we trust the user. +# Please *don't* use this unless all tests pass. +# If you want to report test failures, use "nmake nok" instead. +ok: utils + $(PERLEXE) -I..\lib ..\utils\perlbug -ok -s "(UNINSTALLED)" + +okfile: utils + $(PERLEXE) -I..\lib ..\utils\perlbug -ok -s "(UNINSTALLED)" -F perl.ok + +nok: utils + $(PERLEXE) -I..\lib ..\utils\perlbug -nok -s "(UNINSTALLED)" + +nokfile: utils + $(PERLEXE) -I..\lib ..\utils\perlbug -nok -s "(UNINSTALLED)" -F perl.nok diff --git a/win32/config.win64 b/win32/config.win64 new file mode 100644 index 0000000000..70414246b2 --- /dev/null +++ b/win32/config.win64 @@ -0,0 +1,807 @@ +# Configured by: ~cf_email~ +## Target system: WIN32 +Author='' +CONFIGDOTSH='true' +Date='$Date' +Header='' +Id='$Id' +Locker='' +Log='$Log' +RCSfile='$RCSfile' +Revision='$Revision' +Source='' +State='' +_a='.lib' +_exe='.exe' +_o='.obj' +afs='false' +alignbytes='8' +ansi2knr='' +aphostname='' +api_revision='~PERL_API_REVISION~' +api_subversion='~PERL_API_SUBVERSION~' +api_version='~PERL_API_VERSION~' +api_versionstring='~PERL_API_REVISION~.~PERL_API_VERSION~.~PERL_API_SUBVERSION~' +ar='lib' +archlib='~INST_TOP~~INST_VER~\lib~INST_ARCH~' +archlibexp='~INST_TOP~~INST_VER~\lib~INST_ARCH~' +archname64='' +archname='MSWin32' +archobjs='' +awk='awk' +baserev='5' +bash='' +bin='~INST_TOP~~INST_VER~\bin~INST_ARCH~' +bincompat5005='undef' +binexp='~INST_TOP~~INST_VER~\bin~INST_ARCH~' +bison='' +byacc='byacc' +byteorder='1234' +c='' +castflags='0' +cat='type' +cc='~CC~' +cccdlflags=' ' +ccdlflags=' ' +ccflags='-MD -DWIN32' +ccflags_uselargefiles='' +ccname='~CC~' +ccsymbols='' +ccversion='' +cf_by='nobody' +cf_email='nobody@no.where.net' +cf_time='' +charsize='1' +chgrp='' +chmod='' +chown='' +clocktype='clock_t' +comm='' +compress='' +contains='grep' +cp='copy' +cpio='' +cpp='cl -nologo -E' +cpp_stuff='42' +cppccsymbols='' +cppflags='-DWIN32' +cpplast='' +cppminus='' +cpprun='cl -nologo -E' +cppstdin='cl -nologo -E' +cppsymbols='' +crosscompile='undef' +cryptlib='' +csh='undef' +d_SCNfldbl='undef' +d__fwalk='undef' +d_Gconvert='sprintf((b),"%.*g",(n),(x))' +d_PRIEUldbl='undef' +d_PRIFUldbl='undef' +d_PRIGUldbl='undef' +d_PRIXU64='undef' +d_PRId64='undef' +d_PRIeldbl='undef' +d_PRIfldbl='undef' +d_PRIgldbl='undef' +d_PRIi64='undef' +d_PRIo64='undef' +d_PRIu64='undef' +d_PRIx64='undef' +d_access='define' +d_accessx='undef' +d_alarm='undef' +d_archlib='define' +d_atolf='undef' +d_atoll='undef' +d_attribut='undef' +d_bcmp='undef' +d_bcopy='undef' +d_bincompat5005='undef' +d_bsd='define' +d_bsdgetpgrp='undef' +d_bsdsetpgrp='undef' +d_bzero='undef' +d_casti32='undef' +d_castneg='define' +d_charvspr='undef' +d_chown='undef' +d_chroot='undef' +d_chsize='define' +d_closedir='define' +d_const='define' +d_crypt='undef' +d_csh='undef' +d_cuserid='undef' +d_dbl_dig='define' +d_difftime='define' +d_dirnamlen='define' +d_dlerror='define' +d_dlopen='define' +d_dlsymun='undef' +d_dosuid='undef' +d_drand48proto='undef' +d_dup2='define' +d_eaccess='undef' +d_endgrent='undef' +d_endhent='undef' +d_endnent='undef' +d_endpent='undef' +d_endpwent='undef' +d_endsent='undef' +d_eofnblk='define' +d_eunice='undef' +d_fchmod='undef' +d_fchown='undef' +d_fcntl='undef' +d_fcntl_can_lock='undef' +d_fd_macros='define' +d_fd_set='define' +d_fds_bits='define' +d_fgetpos='define' +d_flexfnam='define' +d_flock='define' +d_fork='undef' +d_fpathconf='undef' +d_fpos64_t='undef' +d_frexpl='undef' +d_fs_data_s='undef' +d_fseeko='undef' +d_fsetpos='define' +d_fstatfs='undef' +d_fstatvfs='undef' +d_fsync='undef' +d_ftello='undef' +d_ftime='define' +d_getcwd='undef' +d_getespwnam='undef' +d_getfsstat='undef' +d_getgrent='undef' +d_getgrps='undef' +d_gethbyaddr='define' +d_gethbyname='define' +d_gethent='undef' +d_gethname='define' +d_gethostprotos='define' +d_getlogin='define' +d_getmnt='undef' +d_getmntent='undef' +d_getnbyaddr='undef' +d_getnbyname='undef' +d_getnent='undef' +d_getnetprotos='undef' +d_getpagsz='undef' +d_getpbyname='define' +d_getpbynumber='define' +d_getpent='undef' +d_getpgid='undef' +d_getpgrp2='undef' +d_getpgrp='undef' +d_getppid='undef' +d_getprior='undef' +d_getprotoprotos='define' +d_getprpwnam='undef' +d_getpwent='undef' +d_getsbyname='define' +d_getsbyport='define' +d_getsent='undef' +d_getservprotos='define' +d_getspnam='undef' +d_gettimeod='undef' +d_gnulibc='undef' +d_grpasswd='undef' +d_hasmntopt='undef' +d_htonl='define' +d_iconv='undef' +d_index='undef' +d_inetaton='undef' +d_int64_t='undef' +d_isascii='define' +d_isnan='define' +d_isnanl='undef' +d_killpg='undef' +d_lchown='undef' +d_ldbl_dig='define' +d_link='define' +d_locconv='define' +d_lockf='undef' +d_longdbl='define' +d_longlong='undef' +d_lseekproto='define' +d_lstat='undef' +d_madvise='undef' +d_mblen='define' +d_mbstowcs='define' +d_mbtowc='define' +d_memchr='define' +d_memcmp='define' +d_memcpy='define' +d_memmove='define' +d_memset='define' +d_mkdir='define' +d_mkdtemp='undef' +d_mkfifo='undef' +d_mkstemp='undef' +d_mkstemps='undef' +d_mktime='define' +d_mmap='undef' +d_modfl='undef' +d_mprotect='undef' +d_msg='undef' +d_msg_ctrunc='undef' +d_msg_dontroute='undef' +d_msg_oob='undef' +d_msg_peek='undef' +d_msg_proxy='undef' +d_msgctl='undef' +d_msgget='undef' +d_msgrcv='undef' +d_msgsnd='undef' +d_msync='undef' +d_munmap='undef' +d_mymalloc='undef' +d_nice='undef' +d_nv_preserves_uv='define' +d_nv_preserves_uv_bits='64' +d_off64_t='undef' +d_old_pthread_create_joinable='undef' +d_oldpthreads='undef' +d_oldsock='undef' +d_open3='undef' +d_pathconf='undef' +d_pause='define' +d_perl_otherlibdirs='undef' +d_phostname='undef' +d_pipe='define' +d_poll='undef' +d_portable='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_qgcvt='undef' +d_quad='define' +d_readdir='define' +d_readlink='undef' +d_rename='define' +d_rewinddir='define' +d_rmdir='define' +d_safebcpy='undef' +d_safemcpy='undef' +d_sanemcmp='define' +d_sbrkproto='undef' +d_sched_yield='undef' +d_scm_rights='undef' +d_seekdir='define' +d_select='define' +d_sem='undef' +d_semctl='undef' +d_semctl_semid_ds='undef' +d_semctl_semun='undef' +d_semget='undef' +d_semop='undef' +d_setegid='undef' +d_seteuid='undef' +d_setgrent='undef' +d_setgrps='undef' +d_sethent='undef' +d_setlinebuf='undef' +d_setlocale='define' +d_setnent='undef' +d_setpent='undef' +d_setpgid='undef' +d_setpgrp2='undef' +d_setpgrp='undef' +d_setprior='undef' +d_setproctitle='undef' +d_setpwent='undef' +d_setregid='undef' +d_setresgid='undef' +d_setresuid='undef' +d_setreuid='undef' +d_setrgid='undef' +d_setruid='undef' +d_setsent='undef' +d_setsid='undef' +d_setvbuf='define' +d_sfio='undef' +d_shm='undef' +d_shmat='undef' +d_shmatprototype='undef' +d_shmctl='undef' +d_shmdt='undef' +d_shmget='undef' +d_sigaction='undef' +d_sigsetjmp='undef' +d_socket='define' +d_socklen_t='undef' +d_sockpair='undef' +d_socks5_init='undef' +d_sqrtl='undef' +d_statblks='undef' +d_statfs_f_flags='undef' +d_statfs_s='undef' +d_statvfs='undef' +d_stdio_cnt_lval='define' +d_stdio_ptr_lval='define' +d_stdio_ptr_lval_sets_cnt='undef' +d_stdio_ptr_lval_nochange_cnt='undef' +d_stdio_stream_array='undef' +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='undef' +d_symlink='undef' +d_syscall='undef' +d_sysconf='undef' +d_sysernlst='' +d_syserrlst='define' +d_system='define' +d_tcgetpgrp='undef' +d_tcsetpgrp='undef' +d_telldir='define' +d_telldirproto='define' +d_time='define' +d_times='define' +d_truncate='undef' +d_tzname='define' +d_umask='define' +d_uname='define' +d_union_semun='define' +d_ustat='undef' +d_vendorarch='undef' +d_vendorbin='undef' +d_vendorlib='undef' +d_vfork='undef' +d_void_closedir='undef' +d_voidsig='define' +d_voidtty='' +d_volatile='define' +d_vprintf='define' +d_wait4='undef' +d_waitpid='define' +d_wcstombs='define' +d_wctomb='define' +d_xenix='undef' +date='date' +db_hashtype='int' +db_prefixtype='int' +defvoidused='15' +direntrytype='struct direct' +dlext='dll' +dlsrc='dl_win32.xs' +doublesize='8' +drand01='(rand()/(double)((unsigned)1<<RANDBITS))' +dynamic_ext='Socket IO Fcntl Opcode SDBM_File attrs Thread' +eagain='EAGAIN' +ebcdic='undef' +echo='echo' +egrep='egrep' +emacs='' +eunicefix=':' +exe_ext='.exe' +expr='expr' +extensions='~static_ext~ ~dynamic_ext~ ~nonxs_ext~' +fflushNULL='define' +fflushall='undef' +find='find' +firstmakefile='makefile' +flex='' +fpossize='4' +fpostype='fpos_t' +freetype='void' +full_ar='' +full_csh='' +full_sed='' +gccosandvers='' +gccversion='' +gidformat='"ld"' +gidsign='-1' +gidsize='4' +gidtype='gid_t' +glibpth='/usr/shlib /lib/pa1.1 /usr/lib/large /lib /usr/lib /usr/lib/386 /lib/386 /lib/large /usr/lib/small /lib/small /usr/ccs/lib /usr/ucblib /usr/shlib ' +grep='grep' +groupcat='' +groupstype='gid_t' +gzip='gzip' +h_fcntl='false' +h_sysfile='true' +hint='recommended' +hostcat='ypcat hosts' +i16size='2' +i16type='short' +i32size='4' +i32type='long' +i64size='8' +i64type='__int64' +i8size='1' +i8type='char' +i_arpainet='define' +i_bsdioctl='' +i_db='undef' +i_dbm='undef' +i_dirent='define' +i_dld='undef' +i_dlfcn='define' +i_fcntl='define' +i_float='define' +i_gdbm='undef' +i_grp='undef' +i_iconv='undef' +i_ieeefp='undef' +i_inttypes='undef' +i_libutil='undef' +i_limits='define' +i_locale='define' +i_machcthr='undef' +i_malloc='define' +i_math='define' +i_memory='undef' +i_mntent='undef' +i_ndbm='undef' +i_netdb='undef' +i_neterrno='undef' +i_netinettcp='undef' +i_niin='undef' +i_poll='undef' +i_prot='undef' +i_pthread='undef' +i_pwd='undef' +i_rpcsvcdbm='define' +i_sfio='undef' +i_sgtty='undef' +i_shadow='undef' +i_socks='undef' +i_stdarg='define' +i_stddef='define' +i_stdlib='define' +i_string='define' +i_sunmath='undef' +i_sysaccess='undef' +i_sysdir='undef' +i_sysfile='undef' +i_sysfilio='define' +i_sysin='undef' +i_sysioctl='undef' +i_syslog='undef' +i_sysmman='undef' +i_sysmode='undef' +i_sysmount='undef' +i_sysndir='undef' +i_sysparam='undef' +i_sysresrc='undef' +i_syssecrt='undef' +i_sysselct='undef' +i_syssockio='' +i_sysstatfs='undef' +i_sysstatvfs='undef' +i_sysstat='define' +i_systime='undef' +i_systimek='undef' +i_systimes='undef' +i_systypes='define' +i_sysuio='undef' +i_sysun='undef' +i_sysutsname='undef' +i_sysvfs='undef' +i_syswait='undef' +i_termio='undef' +i_termios='undef' +i_time='define' +i_unistd='undef' +i_ustat='undef' +i_utime='define' +i_values='undef' +i_varargs='undef' +i_varhdr='varargs.h' +i_vfork='undef' +ignore_versioned_solibs='' +inc_version_list='' +inc_version_list_init='0' +incpath='' +inews='' +installarchlib='~INST_TOP~~INST_VER~\lib~INST_ARCH~' +installbin='~INST_TOP~~INST_VER~\bin~INST_ARCH~' +installman1dir='~INST_TOP~~INST_VER~\man\man1' +installman3dir='~INST_TOP~~INST_VER~\man\man3' +installprefix='~INST_TOP~~INST_VER~' +installprefixexp='~INST_TOP~~INST_VER~' +installhtmldir='~INST_TOP~~INST_VER~\html' +installhtmlhelpdir='~INST_TOP~~INST_VER~\htmlhelp' +installprivlib='~INST_TOP~~INST_VER~\lib' +installscript='~INST_TOP~~INST_VER~\bin' +installsitearch='~INST_TOP~\site~INST_VER~\lib~INST_ARCH~' +installsitebin='~INST_TOP~~INST_VER~\bin~INST_ARCH~' +installsitelib='~INST_TOP~\site~INST_VER~\lib' +installstyle='lib' +installusrbinperl='undef' +installvendorarch='' +installvendorbin='' +installvendorlib='' +intsize='4' +issymlink='' +ivdformat='"ld"' +ivsize='8' +ivtype='__int64' +known_extensions='~static_ext~ ~dynamic_ext~ ~nonxs_ext~' +ksh='' +ld='~LINK32~' +lddlflags='-dll ~LINK_FLAGS~' +ldflags='~LINK_FLAGS~' +ldflags_uselargefiles='' +ldlibpthname='' +less='less' +lib_ext='.lib' +libc='msvcrt.lib' +libperl='perl.lib' +libpth='' +libs='' +libsdirs='' +libsfiles='' +libsfound='' +libspath='' +libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' +libswanted_uselargefiles='' +line='line' +lint='' +lkflags='' +ln='' +lns='copy' +locincpth='/usr/local/include /opt/local/include /usr/gnu/include /opt/gnu/include /usr/GNU/include /opt/GNU/include' +loclibpth='/usr/local/lib /opt/local/lib /usr/gnu/lib /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib' +longdblsize='10' +longlongsize='8' +longsize='4' +lp='' +lpr='' +ls='dir' +lseeksize='4' +lseektype='off_t' +mail='' +mailx='' +make='nmake' +make_set_make='#' +mallocobj='malloc.o' +mallocsrc='malloc.c' +malloctype='void *' +man1dir='~INST_TOP~~INST_VER~\man\man1' +man1direxp='~INST_TOP~~INST_VER~\man\man1' +man1ext='1' +man3dir='~INST_TOP~~INST_VER~\man\man3' +man3direxp='~INST_TOP~~INST_VER~\man\man3' +man3ext='3' +mips_type='' +mkdir='mkdir' +mmaptype='void *' +modetype='mode_t' +more='more /e' +multiarch='undef' +mv='' +myarchname='MSWin32' +mydomain='' +myhostname='' +myuname='' +n='-n' +netdb_hlen_type='int' +netdb_host_type='char *' +netdb_name_type='char *' +netdb_net_type='long' +nm='' +nm_opt='' +nm_so_opt='' +nonxs_ext='Errno' +nroff='' +nvEUformat='"E"' +nvFUformat='"F"' +nvGUformat='"G"' +nveformat='"e"' +nvfformat='"f"' +nvgformat='"g"' +nvsize='8' +nvtype='double' +o_nonblock='O_NONBLOCK' +obj_ext='.obj' +old_pthread_create_joinable='' +optimize='-O' +orderlib='false' +osname='MSWin32' +osvers='4.0' +otherlibdirs='' +package='perl5' +pager='more /e' +passcat='' +patchlevel='~PERL_VERSION~' +path_sep=';' +perl5='' +perl='perl' +perladmin='' +perllibs='~libs~' +perlpath='~INST_TOP~~INST_VER~\bin~INST_ARCH~\perl.exe' +pg='' +phostname='hostname' +pidtype='int' +plibpth='' +pm_apiversion='5.005' +pmake='' +pr='' +prefix='~INST_TOP~' +prefixexp='~INST_DRV~' +privlib='~INST_TOP~~INST_VER~\lib' +privlibexp='~INST_TOP~~INST_VER~\lib' +prototype='define' +ptrsize='8' +quadkind='4' +quadtype='__int64' +randbits='15' +randfunc='rand' +randseedtype='unsigned' +ranlib='rem' +rd_nodata='-1' +revision='5' +rm='del' +rmail='' +runnm='true' +sPRIEUldbl='"E"' +sPRIFUldbl='"F"' +sPRIGUldbl='"G"' +sPRIXU64='"lX"' +sPRId64='"ld"' +sPRIeldbl='"e"' +sPRIfldbl='"f"' +sPRIgldbl='"g"' +sPRIi64='"li"' +sPRIo64='"lo"' +sPRIu64='"lu"' +sPRIx64='"lx"' +sSCNfldbl='"f"' +sched_yield='' +scriptdir='~INST_TOP~~INST_VER~\bin' +scriptdirexp='~INST_TOP~~INST_VER~\bin' +sed='sed' +seedfunc='srand' +selectminbits='32' +selecttype='Perl_fd_set *' +sendmail='blat' +sh='cmd /x /c' +shar='' +sharpbang='#!' +shmattype='void *' +shortsize='2' +shrpenv='' +shsharp='true' +sig_count='26' +sig_name='ZERO NUM01 INT QUIT ILL NUM05 NUM06 NUM07 FPE KILL NUM10 SEGV NUM12 PIPE ALRM TERM NUM16 NUM17 NUM18 NUM19 CHLD BREAK ABRT STOP NUM24 CONT CLD' +sig_name_init='"ZERO", "NUM01", "INT", "QUIT", "ILL", "NUM05", "NUM06", "NUM07", "FPE", "KILL", "NUM10", "SEGV", "NUM12", "PIPE", "ALRM", "TERM", "NUM16", "NUM17", "NUM18", "NUM19", "CHLD", "BREAK", "ABRT", "STOP", "NUM24", "CONT", "CLD", 0' +sig_num='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 20 0' +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, 20, 0' +signal_t='void' +sitearch='~INST_TOP~\site~INST_VER~\lib~INST_ARCH~' +sitearchexp='~INST_TOP~\site~INST_VER~\lib~INST_ARCH~' +sitebin='~INST_TOP~\site~INST_VER~\bin~INST_ARCH~' +sitebinexp='~INST_TOP~\site~INST_VER~\bin~INST_ARCH~' +sitelib='~INST_TOP~\site~INST_VER~\lib' +sitelib_stem='' +sitelibexp='~INST_TOP~\site~INST_VER~\lib' +siteprefix='~INST_TOP~\site~INST_VER~' +siteprefixexp='~INST_TOP~\site~INST_VER~' +sizesize='8' +sizetype='size_t' +sleep='' +smail='' +so='dll' +sockethdr='' +socketlib='' +socksizetype='int' +sort='sort' +spackage='Perl5' +spitshell='' +src='' +ssizetype='__int64' +startperl='#!perl' +startsh='#!/bin/sh' +static_ext='DynaLoader' +stdchar='char' +stdio_base='((fp)->_base)' +stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)' +stdio_cnt='((fp)->_cnt)' +stdio_filbuf='' +stdio_ptr='((fp)->_ptr)' +stdio_stream_array='' +strings='/usr/include/string.h' +submit='' +subversion='~PERL_SUBVERSION~' +sysman='/usr/man/man1' +tail='' +tar='' +tbl='' +tee='' +test='' +timeincl='/usr/include/sys/time.h ' +timetype='time_t' +touch='touch' +tr='' +trnl='\012' +troff='' +u16size='2' +u16type='unsigned short' +u32size='4' +u32type='unsigned long' +u64size='8' +u64type='unsigned __int64' +u8size='1' +u8type='unsigned char' +uidformat='"ld"' +uidsign='-1' +uidsize='4' +uidtype='uid_t' +uname='uname' +uniq='uniq' +uquadtype='unsigned __int64' +use5005threads='undef' +use64bitall='undef' +use64bitint='define' +usedl='define' +useithreads='undef' +uselargefiles='undef' +uselongdouble='undef' +usemorebits='undef' +usemultiplicity='undef' +usemymalloc='n' +usenm='false' +useopcode='true' +useperlio='undef' +useposix='true' +usesfio='false' +useshrplib='yes' +usesocks='undef' +usethreads='undef' +usevendorprefix='undef' +usevfork='false' +usrinc='/usr/include' +uuname='' +uvXUformat='"lX"' +uvoformat='"lo"' +uvsize='8' +uvtype='unsigned __int64' +uvuformat='"lu"' +uvxformat='"lx"' +vendorarch='' +vendorarchexp='' +vendorbin='' +vendorbinexp='' +vendorlib='' +vendorlib_stem='' +vendorlibexp='' +vendorprefix='' +vendorprefixexp='' +version='~VERSION~' +versiononly='undef' +vi='' +voidflags='15' +xlibpth='/usr/lib/386 /lib/386' +xs_apiversion='5.6.0' +zcat='' +zip='zip' +PERL_REVISION='~PERL_REVISION~' +PERL_SUBVERSION='~PERL_SUBVERSION~' +PERL_VERSION='~PERL_VERSION~' +PERL_API_REVISION='~PERL_API_REVISION~' +PERL_API_SUBVERSION='~PERL_API_SUBVERSION~' +PERL_API_VERSION='~PERL_API_VERSION~' diff --git a/win32/config_H.win64 b/win32/config_H.win64 new file mode 100644 index 0000000000..43e8a95939 --- /dev/null +++ b/win32/config_H.win64 @@ -0,0 +1,3219 @@ +/* + * This file was produced by running the config_h.SH script, which + * gets its values from config.sh, which is generally produced by + * running Configure. + * + * Feel free to modify any of this as the need arises. Note, however, + * that running config_h.SH again will wipe out any changes you've made. + * For a more permanent change edit config.sh and rerun config_h.SH. + * + * $Id: Config_h.U,v 3.0.1.5 1997/02/28 14:57:43 ram Exp $ + */ + +/* + * Package name : perl5 + * Source directory : + * Configuration time: Fri Oct 5 19:47:34 2001 + * Configured by : nt5admin + * Target system : + */ + +#ifndef _config_h_ +#define _config_h_ + +/* LOC_SED: + * This symbol holds the complete pathname to the sed program. + */ +#define LOC_SED "" /**/ + +/* HAS_ALARM: + * This symbol, if defined, indicates that the alarm routine is + * available. + */ +/*#define HAS_ALARM /**/ + +/* HASATTRIBUTE: + * This symbol indicates the C compiler can check for function attributes, + * such as printf formats. This is normally only supported by GNU cc. + */ +/*#define HASATTRIBUTE /**/ +#ifndef HASATTRIBUTE +#define __attribute__(_arg_) +#endif + +/* HAS_BCMP: + * This symbol is defined if the bcmp() routine is available to + * compare blocks of memory. + */ +/*#define HAS_BCMP /**/ + +/* HAS_BCOPY: + * This symbol is defined if the bcopy() routine is available to + * copy blocks of memory. + */ +/*#define HAS_BCOPY /**/ + +/* HAS_BZERO: + * This symbol is defined if the bzero() routine is available to + * set a memory block to 0. + */ +/*#define HAS_BZERO /**/ + +/* HAS_CHOWN: + * This symbol, if defined, indicates that the chown routine is + * available. + */ +/*#define HAS_CHOWN /**/ + +/* HAS_CHROOT: + * This symbol, if defined, indicates that the chroot routine is + * available. + */ +/*#define HAS_CHROOT /**/ + +/* HAS_CHSIZE: + * This symbol, if defined, indicates that the chsize routine is available + * to truncate files. You might need a -lx to get this routine. + */ +#define HAS_CHSIZE /**/ + +/* HASCONST: + * This symbol, if defined, indicates that this C compiler knows about + * the const type. There is no need to actually test for that symbol + * within your programs. The mere use of the "const" keyword will + * trigger the necessary tests. + */ +#define HASCONST /**/ +#ifndef HASCONST +#define const +#endif + +/* HAS_CRYPT: + * This symbol, if defined, indicates that the crypt routine is available + * to encrypt passwords and the like. + */ +/*#define HAS_CRYPT /**/ + +/* HAS_CUSERID: + * This symbol, if defined, indicates that the cuserid routine is + * available to get character login names. + */ +/*#define HAS_CUSERID /**/ + +/* HAS_DBL_DIG: + * This symbol, if defined, indicates that this system's <float.h> + * or <limits.h> defines the symbol DBL_DIG, which is the number + * of significant digits in a double precision number. If this + * symbol is not defined, a guess of 15 is usually pretty good. + */ +#define HAS_DBL_DIG /**/ + +/* HAS_DIFFTIME: + * This symbol, if defined, indicates that the difftime routine is + * available. + */ +#define HAS_DIFFTIME /**/ + +/* HAS_DLERROR: + * This symbol, if defined, indicates that the dlerror routine is + * available to return a string describing the last error that + * occurred from a call to dlopen(), dlclose() or dlsym(). + */ +#define HAS_DLERROR /**/ + +/* SETUID_SCRIPTS_ARE_SECURE_NOW: + * This symbol, if defined, indicates that the bug that prevents + * setuid scripts from being secure is not present in this kernel. + */ +/* DOSUID: + * This symbol, if defined, indicates that the C program should + * check the script that it is executing for setuid/setgid bits, and + * attempt to emulate setuid/setgid on systems that have disabled + * setuid #! scripts because the kernel can't do it securely. + * It is up to the package designer to make sure that this emulation + * is done securely. Among other things, it should do an fstat on + * the script it just opened to make sure it really is a setuid/setgid + * script, it should make sure the arguments passed correspond exactly + * to the argument on the #! line, and it should not trust any + * subprocesses to which it must pass the filename rather than the + * file descriptor of the script to be executed. + */ +/*#define SETUID_SCRIPTS_ARE_SECURE_NOW /**/ +/*#define DOSUID /**/ + +/* HAS_DUP2: + * This symbol, if defined, indicates that the dup2 routine is + * available to duplicate file descriptors. + */ +#define HAS_DUP2 /**/ + +/* HAS_FCHMOD: + * This symbol, if defined, indicates that the fchmod routine is available + * to change mode of opened files. If unavailable, use chmod(). + */ +/*#define HAS_FCHMOD /**/ + +/* HAS_FCHOWN: + * This symbol, if defined, indicates that the fchown routine is available + * to change ownership of opened files. If unavailable, use chown(). + */ +/*#define HAS_FCHOWN /**/ + +/* HAS_FCNTL: + * This symbol, if defined, indicates to the C program that + * the fcntl() function exists. + */ +/*#define HAS_FCNTL /**/ + +/* HAS_FGETPOS: + * This symbol, if defined, indicates that the fgetpos routine is + * available to get the file position indicator, similar to ftell(). + */ +#define HAS_FGETPOS /**/ + +/* HAS_FLOCK: + * This symbol, if defined, indicates that the flock routine is + * available to do file locking. + */ +#define HAS_FLOCK /**/ + +/* HAS_FORK: + * This symbol, if defined, indicates that the fork routine is + * available. + */ +/*#define HAS_FORK /**/ + +/* HAS_FSETPOS: + * This symbol, if defined, indicates that the fsetpos routine is + * available to set the file position indicator, similar to fseek(). + */ +#define HAS_FSETPOS /**/ + +/* HAS_GETTIMEOFDAY: + * This symbol, if defined, indicates that the gettimeofday() system + * call is available for a sub-second accuracy clock. Usually, the file + * <sys/resource.h> needs to be included (see I_SYS_RESOURCE). + * The type "Timeval" should be used to refer to "struct timeval". + */ +/*#define HAS_GETTIMEOFDAY /**/ +#ifdef HAS_GETTIMEOFDAY +#define Timeval struct timeval /* Structure used by gettimeofday() */ +#endif + +/* HAS_GETGROUPS: + * This symbol, if defined, indicates that the getgroups() routine is + * available to get the list of process groups. If unavailable, multiple + * groups are probably not supported. + */ +/*#define HAS_GETGROUPS /**/ + +/* HAS_GETLOGIN: + * This symbol, if defined, indicates that the getlogin routine is + * available to get the login name. + */ +#define HAS_GETLOGIN /**/ + +/* HAS_GETPGID: + * This symbol, if defined, indicates to the C program that + * the getpgid(pid) function is available to get the + * process group id. + */ +/*#define HAS_GETPGID /**/ + +/* HAS_GETPGRP2: + * This symbol, if defined, indicates that the getpgrp2() (as in DG/UX) + * routine is available to get the current process group. + */ +/*#define HAS_GETPGRP2 /**/ + +/* HAS_GETPPID: + * This symbol, if defined, indicates that the getppid routine is + * available to get the parent process ID. + */ +/*#define HAS_GETPPID /**/ + +/* HAS_GETPRIORITY: + * This symbol, if defined, indicates that the getpriority routine is + * available to get a process's priority. + */ +/*#define HAS_GETPRIORITY /**/ + +/* HAS_INET_ATON: + * This symbol, if defined, indicates to the C program that the + * inet_aton() function is available to parse IP address "dotted-quad" + * strings. + */ +/*#define HAS_INET_ATON /**/ + +/* HAS_KILLPG: + * This symbol, if defined, indicates that the killpg routine is available + * to kill process groups. If unavailable, you probably should use kill + * with a negative process number. + */ +/*#define HAS_KILLPG /**/ + +/* HAS_LINK: + * This symbol, if defined, indicates that the link routine is + * available to create hard links. + */ +#define HAS_LINK /**/ + +/* HAS_LOCALECONV: + * This symbol, if defined, indicates that the localeconv routine is + * available for numeric and monetary formatting conventions. + */ +#define HAS_LOCALECONV /**/ + +/* HAS_LOCKF: + * This symbol, if defined, indicates that the lockf routine is + * available to do file locking. + */ +/*#define HAS_LOCKF /**/ + +/* HAS_LSTAT: + * This symbol, if defined, indicates that the lstat routine is + * available to do file stats on symbolic links. + */ +/*#define HAS_LSTAT /**/ + +/* HAS_MBLEN: + * This symbol, if defined, indicates that the mblen routine is available + * to find the number of bytes in a multibye character. + */ +#define HAS_MBLEN /**/ + +/* HAS_MBSTOWCS: + * This symbol, if defined, indicates that the mbstowcs routine is + * available to covert a multibyte string into a wide character string. + */ +#define HAS_MBSTOWCS /**/ + +/* HAS_MBTOWC: + * This symbol, if defined, indicates that the mbtowc routine is available + * to covert a multibyte to a wide character. + */ +#define HAS_MBTOWC /**/ + +/* HAS_MEMCMP: + * This symbol, if defined, indicates that the memcmp routine is available + * to compare blocks of memory. + */ +#define HAS_MEMCMP /**/ + +/* HAS_MEMCPY: + * This symbol, if defined, indicates that the memcpy routine is available + * to copy blocks of memory. + */ +#define HAS_MEMCPY /**/ + +/* HAS_MEMMOVE: + * This symbol, if defined, indicates that the memmove routine is available + * to copy potentially overlapping blocks of memory. This should be used + * only when HAS_SAFE_BCOPY is not defined. If neither is there, roll your + * own version. + */ +#define HAS_MEMMOVE /**/ + +/* HAS_MEMSET: + * This symbol, if defined, indicates that the memset routine is available + * to set blocks of memory. + */ +#define HAS_MEMSET /**/ + +/* HAS_MKDIR: + * This symbol, if defined, indicates that the mkdir routine is available + * to create directories. Otherwise you should fork off a new process to + * exec /bin/mkdir. + */ +#define HAS_MKDIR /**/ + +/* HAS_MKFIFO: + * This symbol, if defined, indicates that the mkfifo routine is + * available to create FIFOs. Otherwise, mknod should be able to + * do it for you. However, if mkfifo is there, mknod might require + * super-user privileges which mkfifo will not. + */ +/*#define HAS_MKFIFO /**/ + +/* HAS_MKTIME: + * This symbol, if defined, indicates that the mktime routine is + * available. + */ +#define HAS_MKTIME /**/ + +/* HAS_MSYNC: + * This symbol, if defined, indicates that the msync system call is + * available to synchronize a mapped file. + */ +/*#define HAS_MSYNC /**/ + +/* HAS_MUNMAP: + * This symbol, if defined, indicates that the munmap system call is + * available to unmap a region, usually mapped by mmap(). + */ +/*#define HAS_MUNMAP /**/ + +/* HAS_NICE: + * This symbol, if defined, indicates that the nice routine is + * available. + */ +/*#define HAS_NICE /**/ + +/* HAS_PATHCONF: + * This symbol, if defined, indicates that pathconf() is available + * to determine file-system related limits and options associated + * with a given filename. + */ +/* HAS_FPATHCONF: + * This symbol, if defined, indicates that pathconf() is available + * to determine file-system related limits and options associated + * with a given open file descriptor. + */ +/*#define HAS_PATHCONF /**/ +/*#define HAS_FPATHCONF /**/ + +/* HAS_PAUSE: + * This symbol, if defined, indicates that the pause routine is + * available to suspend a process until a signal is received. + */ +#define HAS_PAUSE /**/ + +/* HAS_PIPE: + * This symbol, if defined, indicates that the pipe routine is + * available to create an inter-process channel. + */ +#define HAS_PIPE /**/ + +/* HAS_POLL: + * This symbol, if defined, indicates that the poll routine is + * available to poll active file descriptors. You may safely + * include <poll.h> when this symbol is defined. + */ +/*#define HAS_POLL /**/ + +/* HAS_READDIR: + * This symbol, if defined, indicates that the readdir routine is + * available to read directory entries. You may have to include + * <dirent.h>. See I_DIRENT. + */ +#define HAS_READDIR /**/ + +/* HAS_SEEKDIR: + * This symbol, if defined, indicates that the seekdir routine is + * available. You may have to include <dirent.h>. See I_DIRENT. + */ +#define HAS_SEEKDIR /**/ + +/* HAS_TELLDIR: + * This symbol, if defined, indicates that the telldir routine is + * available. You may have to include <dirent.h>. See I_DIRENT. + */ +#define HAS_TELLDIR /**/ + +/* HAS_REWINDDIR: + * This symbol, if defined, indicates that the rewinddir routine is + * available. You may have to include <dirent.h>. See I_DIRENT. + */ +#define HAS_REWINDDIR /**/ + +/* HAS_READLINK: + * This symbol, if defined, indicates that the readlink routine is + * available to read the value of a symbolic link. + */ +/*#define HAS_READLINK /**/ + +/* HAS_RENAME: + * This symbol, if defined, indicates that the rename routine is available + * to rename files. Otherwise you should do the unlink(), link(), unlink() + * trick. + */ +#define HAS_RENAME /**/ + +/* HAS_RMDIR: + * This symbol, if defined, indicates that the rmdir routine is + * available to remove directories. Otherwise you should fork off a + * new process to exec /bin/rmdir. + */ +#define HAS_RMDIR /**/ + +/* HAS_SELECT: + * This symbol, if defined, indicates that the select routine is + * available to select active file descriptors. If the timeout field + * is used, <sys/time.h> may need to be included. + */ +#define HAS_SELECT /**/ + +/* HAS_SETEGID: + * This symbol, if defined, indicates that the setegid routine is available + * to change the effective gid of the current program. + */ +/*#define HAS_SETEGID /**/ + +/* HAS_SETEUID: + * This symbol, if defined, indicates that the seteuid routine is available + * to change the effective uid of the current program. + */ +/*#define HAS_SETEUID /**/ + +/* HAS_SETLINEBUF: + * This symbol, if defined, indicates that the setlinebuf routine is + * available to change stderr or stdout from block-buffered or unbuffered + * to a line-buffered mode. + */ +/*#define HAS_SETLINEBUF /**/ + +/* HAS_SETLOCALE: + * This symbol, if defined, indicates that the setlocale routine is + * available to handle locale-specific ctype implementations. + */ +#define HAS_SETLOCALE /**/ + +/* HAS_SETPGID: + * This symbol, if defined, indicates that the setpgid(pid, gpid) + * routine is available to set process group ID. + */ +/*#define HAS_SETPGID /**/ + +/* HAS_SETPGRP2: + * This symbol, if defined, indicates that the setpgrp2() (as in DG/UX) + * routine is available to set the current process group. + */ +/*#define HAS_SETPGRP2 /**/ + +/* HAS_SETPRIORITY: + * This symbol, if defined, indicates that the setpriority routine is + * available to set a process's priority. + */ +/*#define HAS_SETPRIORITY /**/ + +/* HAS_SETREGID: + * This symbol, if defined, indicates that the setregid routine is + * available to change the real and effective gid of the current + * process. + */ +/* HAS_SETRESGID: + * This symbol, if defined, indicates that the setresgid routine is + * available to change the real, effective and saved gid of the current + * process. + */ +/*#define HAS_SETREGID /**/ +/*#define HAS_SETRESGID /**/ + +/* HAS_SETREUID: + * This symbol, if defined, indicates that the setreuid routine is + * available to change the real and effective uid of the current + * process. + */ +/* HAS_SETRESUID: + * This symbol, if defined, indicates that the setresuid routine is + * available to change the real, effective and saved uid of the current + * process. + */ +/*#define HAS_SETREUID /**/ +/*#define HAS_SETRESUID /**/ + +/* HAS_SETRGID: + * This symbol, if defined, indicates that the setrgid routine is available + * to change the real gid of the current program. + */ +/*#define HAS_SETRGID /**/ + +/* HAS_SETRUID: + * This symbol, if defined, indicates that the setruid routine is available + * to change the real uid of the current program. + */ +/*#define HAS_SETRUID /**/ + +/* HAS_SETSID: + * This symbol, if defined, indicates that the setsid routine is + * available to set the process group ID. + */ +/*#define HAS_SETSID /**/ + +/* Shmat_t: + * This symbol holds the return type of the shmat() system call. + * Usually set to 'void *' or 'char *'. + */ +/* HAS_SHMAT_PROTOTYPE: + * This symbol, if defined, indicates that the sys/shm.h includes + * a prototype for shmat(). Otherwise, it is up to the program to + * guess one. Shmat_t shmat _((int, Shmat_t, int)) is a good guess, + * but not always right so it should be emitted by the program only + * when HAS_SHMAT_PROTOTYPE is not defined to avoid conflicting defs. + */ +#define Shmat_t void * /**/ +/*#define HAS_SHMAT_PROTOTYPE /**/ + +/* HAS_STRCHR: + * This symbol is defined to indicate that the strchr()/strrchr() + * functions are available for string searching. If not, try the + * index()/rindex() pair. + */ +/* HAS_INDEX: + * This symbol is defined to indicate that the index()/rindex() + * functions are available for string searching. + */ +#define HAS_STRCHR /**/ +/*#define HAS_INDEX /**/ + +/* HAS_STRCOLL: + * This symbol, if defined, indicates that the strcoll routine is + * available to compare strings using collating information. + */ +#define HAS_STRCOLL /**/ + +/* USE_STRUCT_COPY: + * This symbol, if defined, indicates that this C compiler knows how + * to copy structures. If undefined, you'll need to use a block copy + * routine of some sort instead. + */ +#define USE_STRUCT_COPY /**/ + +/* HAS_STRTOD: + * This symbol, if defined, indicates that the strtod routine is + * available to provide better numeric string conversion than atof(). + */ +#define HAS_STRTOD /**/ + +/* HAS_STRTOL: + * This symbol, if defined, indicates that the strtol routine is available + * to provide better numeric string conversion than atoi() and friends. + */ +#define HAS_STRTOL /**/ + +/* HAS_STRTOUL: + * This symbol, if defined, indicates that the strtoul routine is + * available to provide conversion of strings to unsigned long. + */ +#define HAS_STRTOUL /**/ + +/* HAS_STRXFRM: + * This symbol, if defined, indicates that the strxfrm() routine is + * available to transform strings. + */ +#define HAS_STRXFRM /**/ + +/* HAS_SYMLINK: + * This symbol, if defined, indicates that the symlink routine is available + * to create symbolic links. + */ +/*#define HAS_SYMLINK /**/ + +/* HAS_SYSCALL: + * This symbol, if defined, indicates that the syscall routine is + * available to call arbitrary system calls. If undefined, that's tough. + */ +/*#define HAS_SYSCALL /**/ + +/* HAS_SYSCONF: + * This symbol, if defined, indicates that sysconf() is available + * to determine system related limits and options. + */ +/*#define HAS_SYSCONF /**/ + +/* HAS_SYSTEM: + * This symbol, if defined, indicates that the system routine is + * available to issue a shell command. + */ +#define HAS_SYSTEM /**/ + +/* HAS_TCGETPGRP: + * This symbol, if defined, indicates that the tcgetpgrp routine is + * available to get foreground process group ID. + */ +/*#define HAS_TCGETPGRP /**/ + +/* HAS_TCSETPGRP: + * This symbol, if defined, indicates that the tcsetpgrp routine is + * available to set foreground process group ID. + */ +/*#define HAS_TCSETPGRP /**/ + +/* HAS_TRUNCATE: + * This symbol, if defined, indicates that the truncate routine is + * available to truncate files. + */ +/*#define HAS_TRUNCATE /**/ + +/* HAS_TZNAME: + * This symbol, if defined, indicates that the tzname[] array is + * available to access timezone names. + */ +#define HAS_TZNAME /**/ + +/* HAS_UMASK: + * This symbol, if defined, indicates that the umask routine is + * available to set and get the value of the file creation mask. + */ +#define HAS_UMASK /**/ + +/* HASVOLATILE: + * This symbol, if defined, indicates that this C compiler knows about + * the volatile declaration. + */ +#define HASVOLATILE /**/ +#ifndef HASVOLATILE +#define volatile +#endif + +/* HAS_WAIT4: + * This symbol, if defined, indicates that wait4() exists. + */ +/*#define HAS_WAIT4 /**/ + +/* HAS_WAITPID: + * This symbol, if defined, indicates that the waitpid routine is + * available to wait for child process. + */ +#define HAS_WAITPID /**/ + +/* HAS_WCSTOMBS: + * This symbol, if defined, indicates that the wcstombs routine is + * available to convert wide character strings to multibyte strings. + */ +#define HAS_WCSTOMBS /**/ + +/* HAS_WCTOMB: + * This symbol, if defined, indicates that the wctomb routine is available + * to covert a wide character to a multibyte. + */ +#define HAS_WCTOMB /**/ + +/* I_ARPA_INET: + * This symbol, if defined, indicates to the C program that it should + * include <arpa/inet.h> to get inet_addr and friends declarations. + */ +#define I_ARPA_INET /**/ + +/* I_DBM: + * This symbol, if defined, indicates that <dbm.h> exists and should + * be included. + */ +/* I_RPCSVC_DBM: + * This symbol, if defined, indicates that <rpcsvc/dbm.h> exists and + * should be included. + */ +/*#define I_DBM /**/ +#define I_RPCSVC_DBM /**/ + +/* I_DIRENT: + * This symbol, if defined, indicates to the C program that it should + * include <dirent.h>. Using this symbol also triggers the definition + * of the Direntry_t define which ends up being 'struct dirent' or + * 'struct direct' depending on the availability of <dirent.h>. + */ +/* DIRNAMLEN: + * This symbol, if defined, indicates to the C program that the length + * of directory entry names is provided by a d_namlen field. Otherwise + * you need to do strlen() on the d_name field. + */ +/* Direntry_t: + * This symbol is set to 'struct direct' or 'struct dirent' depending on + * whether dirent is available or not. You should use this pseudo type to + * portably declare your directory entries. + */ +#define I_DIRENT /**/ +#define DIRNAMLEN /**/ +#define Direntry_t struct direct + +/* I_DLFCN: + * This symbol, if defined, indicates that <dlfcn.h> exists and should + * be included. + */ +#define I_DLFCN /**/ + +/* I_FCNTL: + * This manifest constant tells the C program to include <fcntl.h>. + */ +#define I_FCNTL /**/ + +/* I_FLOAT: + * This symbol, if defined, indicates to the C program that it should + * include <float.h> to get definition of symbols like DBL_MAX or + * DBL_MIN, i.e. machine dependent floating point values. + */ +#define I_FLOAT /**/ + +/* I_LIMITS: + * This symbol, if defined, indicates to the C program that it should + * include <limits.h> to get definition of symbols like WORD_BIT or + * LONG_MAX, i.e. machine dependant limitations. + */ +#define I_LIMITS /**/ + +/* I_LOCALE: + * This symbol, if defined, indicates to the C program that it should + * include <locale.h>. + */ +#define I_LOCALE /**/ + +/* I_MATH: + * This symbol, if defined, indicates to the C program that it should + * include <math.h>. + */ +#define I_MATH /**/ + +/* I_MEMORY: + * This symbol, if defined, indicates to the C program that it should + * include <memory.h>. + */ +/*#define I_MEMORY /**/ + +/* I_NDBM: + * This symbol, if defined, indicates that <ndbm.h> exists and should + * be included. + */ +/*#define I_NDBM /**/ + +/* I_NET_ERRNO: + * This symbol, if defined, indicates that <net/errno.h> exists and + * should be included. + */ +/*#define I_NET_ERRNO /**/ + +/* I_NETINET_IN: + * This symbol, if defined, indicates to the C program that it should + * include <netinet/in.h>. Otherwise, you may try <sys/in.h>. + */ +/*#define I_NETINET_IN /**/ + +/* I_SFIO: + * This symbol, if defined, indicates to the C program that it should + * include <sfio.h>. + */ +/*#define I_SFIO /**/ + +/* I_STDDEF: + * This symbol, if defined, indicates that <stddef.h> exists and should + * be included. + */ +#define I_STDDEF /**/ + +/* I_STDLIB: + * This symbol, if defined, indicates that <stdlib.h> exists and should + * be included. + */ +#define I_STDLIB /**/ + +/* I_STRING: + * This symbol, if defined, indicates to the C program that it should + * include <string.h> (USG systems) instead of <strings.h> (BSD systems). + */ +#define I_STRING /**/ + +/* I_SYS_DIR: + * This symbol, if defined, indicates to the C program that it should + * include <sys/dir.h>. + */ +/*#define I_SYS_DIR /**/ + +/* I_SYS_FILE: + * This symbol, if defined, indicates to the C program that it should + * include <sys/file.h> to get definition of R_OK and friends. + */ +/*#define I_SYS_FILE /**/ + +/* I_SYS_IOCTL: + * This symbol, if defined, indicates that <sys/ioctl.h> exists and should + * be included. Otherwise, include <sgtty.h> or <termio.h>. + */ +/*#define I_SYS_IOCTL /**/ + +/* I_SYS_NDIR: + * This symbol, if defined, indicates to the C program that it should + * include <sys/ndir.h>. + */ +/*#define I_SYS_NDIR /**/ + +/* I_SYS_PARAM: + * This symbol, if defined, indicates to the C program that it should + * include <sys/param.h>. + */ +/*#define I_SYS_PARAM /**/ + +/* I_SYS_RESOURCE: + * This symbol, if defined, indicates to the C program that it should + * include <sys/resource.h>. + */ +/*#define I_SYS_RESOURCE /**/ + +/* I_SYS_SELECT: + * This symbol, if defined, indicates to the C program that it should + * include <sys/select.h> in order to get definition of struct timeval. + */ +/*#define I_SYS_SELECT /**/ + +/* I_SYS_STAT: + * This symbol, if defined, indicates to the C program that it should + * include <sys/stat.h>. + */ +#define I_SYS_STAT /**/ + +/* I_SYS_TIMES: + * This symbol, if defined, indicates to the C program that it should + * include <sys/times.h>. + */ +/*#define I_SYS_TIMES /**/ + +/* I_SYS_TYPES: + * This symbol, if defined, indicates to the C program that it should + * include <sys/types.h>. + */ +#define I_SYS_TYPES /**/ + +/* I_SYS_UN: + * This symbol, if defined, indicates to the C program that it should + * include <sys/un.h> to get UNIX domain socket definitions. + */ +/*#define I_SYS_UN /**/ + +/* I_SYS_WAIT: + * This symbol, if defined, indicates to the C program that it should + * include <sys/wait.h>. + */ +/*#define I_SYS_WAIT /**/ + +/* I_TERMIO: + * This symbol, if defined, indicates that the program should include + * <termio.h> rather than <sgtty.h>. There are also differences in + * the ioctl() calls that depend on the value of this symbol. + */ +/* I_TERMIOS: + * This symbol, if defined, indicates that the program should include + * the POSIX termios.h rather than sgtty.h or termio.h. + * There are also differences in the ioctl() calls that depend on the + * value of this symbol. + */ +/* I_SGTTY: + * This symbol, if defined, indicates that the program should include + * <sgtty.h> rather than <termio.h>. There are also differences in + * the ioctl() calls that depend on the value of this symbol. + */ +/*#define I_TERMIO /**/ +/*#define I_TERMIOS /**/ +/*#define I_SGTTY /**/ + +/* I_UNISTD: + * This symbol, if defined, indicates to the C program that it should + * include <unistd.h>. + */ +/*#define I_UNISTD /**/ + +/* I_UTIME: + * This symbol, if defined, indicates to the C program that it should + * include <utime.h>. + */ +#define I_UTIME /**/ + +/* I_VALUES: + * This symbol, if defined, indicates to the C program that it should + * include <values.h> to get definition of symbols like MINFLOAT or + * MAXLONG, i.e. machine dependant limitations. Probably, you + * should use <limits.h> instead, if it is available. + */ +/*#define I_VALUES /**/ + +/* I_STDARG: + * This symbol, if defined, indicates that <stdarg.h> exists and should + * be included. + */ +/* I_VARARGS: + * This symbol, if defined, indicates to the C program that it should + * include <varargs.h>. + */ +#define I_STDARG /**/ +/*#define I_VARARGS /**/ + +/* I_VFORK: + * This symbol, if defined, indicates to the C program that it should + * include vfork.h. + */ +/*#define I_VFORK /**/ + +/* CAN_PROTOTYPE: + * If defined, this macro indicates that the C compiler can handle + * function prototypes. + */ +/* _: + * This macro is used to declare function parameters for folks who want + * to make declarations with prototypes using a different style than + * the above macros. Use double parentheses. For example: + * + * int main _((int argc, char *argv[])); + */ +#define CAN_PROTOTYPE /**/ +#ifdef CAN_PROTOTYPE +#define _(args) args +#else +#define _(args) () +#endif + +/* SH_PATH: + * This symbol contains the full pathname to the shell used on this + * on this system to execute Bourne shell scripts. Usually, this will be + * /bin/sh, though it's possible that some systems will have /bin/ksh, + * /bin/pdksh, /bin/ash, /bin/bash, or even something such as + * D:/bin/sh.exe. + */ +#define SH_PATH "cmd /x /c" /**/ + +/* 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 /**/ + +/* HAS_QUAD: + * This symbol, if defined, tells that there's a 64-bit integer type, + * Quad_t, and its unsigned counterpar, Uquad_t. QUADKIND will be one + * of QUAD_IS_INT, QUAD_IS_LONG, QUAD_IS_LONG_LONG, or QUAD_IS_INT64_T. + */ +#define HAS_QUAD /**/ +#ifdef HAS_QUAD +# define Quad_t __int64 /**/ +# define Uquad_t unsigned __int64 /**/ +# define QUADKIND 4 /**/ +# define QUAD_IS_INT 1 +# define QUAD_IS_LONG 2 +# define QUAD_IS_LONG_LONG 3 +# define QUAD_IS_INT64_T 4 +#endif + +/* HAS_ACCESSX: + * This symbol, if defined, indicates that the accessx routine is + * available to do extended access checks. + */ +/*#define HAS_ACCESSX /**/ + +/* HAS_EACCESS: + * This symbol, if defined, indicates that the eaccess routine is + * available to do extended access checks. + */ +/*#define HAS_EACCESS /**/ + +/* I_SYS_ACCESS: + * This symbol, if defined, indicates to the C program that it should + * include <sys/access.h>. + */ +/*#define I_SYS_ACCESS /**/ + +/* I_SYS_SECURITY: + * This symbol, if defined, indicates to the C program that it should + * include <sys/security.h>. + */ +/*#define I_SYS_SECURITY /**/ + +/* OSNAME: + * This symbol contains the name of the operating system, as determined + * by Configure. You shouldn't rely on it too much; the specific + * feature tests from Configure are generally more reliable. + */ +#define OSNAME "MSWin32" /**/ + +/* MEM_ALIGNBYTES: + * This symbol contains the number of bytes required to align a + * double, or a long double when applicable. Usual values are 2, + * 4 and 8. The default is eight, for safety. + */ +#if defined(CROSSCOMPILE) || defined(MULTIARCH) +# define MEM_ALIGNBYTES 8 +#else +#define MEM_ALIGNBYTES 8 +#endif + +/* ARCHLIB: + * This variable, if defined, holds the name of the directory in + * which the user wants to put architecture-dependent public + * library files for perl5. It is most often a local directory + * such as /usr/local/lib. Programs using this variable must be + * prepared to deal with filename expansion. If ARCHLIB is the + * same as PRIVLIB, it is not defined, since presumably the + * program already searches PRIVLIB. + */ +/* ARCHLIB_EXP: + * This symbol contains the ~name expanded version of ARCHLIB, to be used + * in programs that are not prepared to deal with ~ expansion at run-time. + */ +#define ARCHLIB "c:\\perl64\\5.6.1\\lib\\MSWin32-IA64" /**/ +/*#define ARCHLIB_EXP "" /**/ + +/* ARCHNAME: + * This symbol holds a string representing the architecture name. + * It may be used to construct an architecture-dependant pathname + * where library files may be held under a private library, for + * instance. + */ +#define ARCHNAME "MSWin32-IA64" /**/ + +/* HAS_ATOLF: + * This symbol, if defined, indicates that the atolf routine is + * available to convert strings into long doubles. + */ +/*#define HAS_ATOLF /**/ + +/* HAS_ATOLL: + * This symbol, if defined, indicates that the atoll routine is + * available to convert strings into long longs. + */ +/*#define HAS_ATOLL /**/ + +/* BIN: + * This symbol holds the path of the bin directory where the package will + * be installed. Program must be prepared to deal with ~name substitution. + */ +/* BIN_EXP: + * This symbol is the filename expanded version of the BIN symbol, for + * programs that do not want to deal with that at run-time. + */ +#define BIN "c:\\perl64\\5.6.1\\bin\\MSWin32-IA64" /**/ +#define BIN_EXP "c:\\perl64\\5.6.1\\bin\\MSWin32-IA64" /**/ + +/* PERL_BINCOMPAT_5005: + * This symbol, if defined, indicates that this version of Perl should be + * binary-compatible with Perl 5.005. This is impossible for builds + * that use features like threads and multiplicity it is always undef + * for those versions. + */ +/*#define PERL_BINCOMPAT_5005 /**/ + +/* BYTEORDER: + * This symbol holds the hexadecimal constant defined in byteorder, + * i.e. 0x1234 or 0x4321, etc... + * If the compiler supports cross-compiling or multiple-architecture + * binaries (eg. on NeXT systems), use compiler-defined macros to + * determine the byte order. + * On NeXT 3.2 (and greater), you can build "Fat" Multiple Architecture + * Binaries (MAB) on either big endian or little endian machines. + * The endian-ness is available at compile-time. This only matters + * for perl, where the config.h can be generated and installed on + * one system, and used by a different architecture to build an + * extension. Older versions of NeXT that might not have + * defined either *_ENDIAN__ were all on Motorola 680x0 series, + * so the default case (for NeXT) is big endian to catch them. + * This might matter for NeXT 3.0. + */ +#if defined(CROSSCOMPILE) || defined(MULTIARCH) +# ifdef __LITTLE_ENDIAN__ +# if LONGSIZE == 4 +# define BYTEORDER 0x1234 +# else +# if LONGSIZE == 8 +# define BYTEORDER 0x12345678 +# endif +# endif +# else +# ifdef __BIG_ENDIAN__ +# if LONGSIZE == 4 +# define BYTEORDER 0x4321 +# else +# if LONGSIZE == 8 +# define BYTEORDER 0x87654321 +# endif +# endif +# endif +# endif +# if !defined(BYTEORDER) && (defined(NeXT) || defined(__NeXT__)) +# define BYTEORDER 0x4321 +# endif +#else +#define BYTEORDER 0x12345678 /* large digits for MSB */ +#endif /* NeXT */ + +/* CAT2: + * This macro catenates 2 tokens together. + */ +/* STRINGIFY: + * This macro surrounds its token with double quotes. + */ +#if 42 == 1 +#define CAT2(a,b) a/**/b +#define STRINGIFY(a) "a" + /* If you can get stringification with catify, tell me how! */ +#endif +#if 42 == 42 +#define PeRl_CaTiFy(a, b) a ## b +#define PeRl_StGiFy(a) #a +/* the additional level of indirection enables these macros to be + * used as arguments to other macros. See K&R 2nd ed., page 231. */ +#define CAT2(a,b) PeRl_CaTiFy(a,b) +#define StGiFy(a) PeRl_StGiFy(a) +#define STRINGIFY(a) PeRl_StGiFy(a) +#endif +#if 42 != 1 && 42 != 42 +# include "Bletch: How does this C preprocessor catenate tokens?" +#endif + +/* CPPSTDIN: + * This symbol contains the first part of the string which will invoke + * the C preprocessor on the standard input and produce to standard + * output. Typical value of "cc -E" or "/lib/cpp", but it can also + * call a wrapper. See CPPRUN. + */ +/* CPPMINUS: + * This symbol contains the second part of the string which will invoke + * the C preprocessor on the standard input and produce to standard + * output. This symbol will have the value "-" if CPPSTDIN needs a minus + * to specify standard input, otherwise the value is "". + */ +/* CPPRUN: + * This symbol contains the string which will invoke a C preprocessor on + * the standard input and produce to standard output. It needs to end + * with CPPLAST, after all other preprocessor flags have been specified. + * The main difference with CPPSTDIN is that this program will never be a + * pointer to a shell wrapper, i.e. it will be empty if no preprocessor is + * available directly to the user. Note that it may well be different from + * the preprocessor used to compile the C program. + */ +/* CPPLAST: + * This symbol is intended to be used along with CPPRUN in the same manner + * symbol CPPMINUS is used with CPPSTDIN. It contains either "-" or "". + */ +#define CPPSTDIN "cl -nologo -E" +#define CPPMINUS "" +#define CPPRUN "cl -nologo -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 /**/ + +/* CASTI32: + * This symbol is defined if the C compiler can cast negative + * or large floating point numbers to 32-bit ints. + */ +/*#define CASTI32 /**/ + +/* CASTNEGFLOAT: + * This symbol is defined if the C compiler can cast negative + * numbers to unsigned longs, ints and shorts. + */ +/* CASTFLAGS: + * This symbol contains flags that say what difficulties the compiler + * has casting odd floating values to unsigned long: + * 0 = ok + * 1 = couldn't cast < 0 + * 2 = couldn't cast >= 0x80000000 + * 4 = couldn't cast in argument expression list + */ +#define CASTNEGFLOAT /**/ +#define CASTFLAGS 0 /**/ + +/* VOID_CLOSEDIR: + * This symbol, if defined, indicates that the closedir() routine + * does not return a value. + */ +/*#define VOID_CLOSEDIR /**/ + +/* HAS_CSH: + * This symbol, if defined, indicates that the C-shell exists. + */ +/* CSH: + * This symbol, if defined, contains the full pathname of csh. + */ +/*#define HAS_CSH /**/ +#ifdef HAS_CSH +#define CSH "" /**/ +#endif + +/* DLSYM_NEEDS_UNDERSCORE: + * This symbol, if defined, indicates that we need to prepend an + * underscore to the symbol name before calling dlsym(). This only + * makes sense if you *have* dlsym, which we will presume is the + * case if you're using dl_dlopen.xs. + */ +/*#define DLSYM_NEEDS_UNDERSCORE /**/ + +/* HAS_DRAND48_PROTO: + * This symbol, if defined, indicates that the system provides + * a prototype for the drand48() function. Otherwise, it is up + * to the program to supply one. A good guess is + * extern double drand48 _((void)); + */ +/*#define HAS_DRAND48_PROTO /**/ + +/* HAS_ENDGRENT: + * This symbol, if defined, indicates that the getgrent routine is + * available for finalizing sequential access of the group database. + */ +/*#define HAS_ENDGRENT /**/ + +/* HAS_ENDHOSTENT: + * This symbol, if defined, indicates that the endhostent() routine is + * available to close whatever was being used for host queries. + */ +/*#define HAS_ENDHOSTENT /**/ + +/* HAS_ENDNETENT: + * This symbol, if defined, indicates that the endnetent() routine is + * available to close whatever was being used for network queries. + */ +/*#define HAS_ENDNETENT /**/ + +/* HAS_ENDPROTOENT: + * This symbol, if defined, indicates that the endprotoent() routine is + * available to close whatever was being used for protocol queries. + */ +/*#define HAS_ENDPROTOENT /**/ + +/* HAS_ENDPWENT: + * This symbol, if defined, indicates that the getgrent routine is + * available for finalizing sequential access of the passwd database. + */ +/*#define HAS_ENDPWENT /**/ + +/* HAS_ENDSERVENT: + * This symbol, if defined, indicates that the endservent() routine is + * available to close whatever was being used for service queries. + */ +/*#define HAS_ENDSERVENT /**/ + +/* HAS_FD_SET: + * This symbol, when defined, indicates presence of the fd_set typedef + * in <sys/types.h> + */ +#define HAS_FD_SET /**/ + +/* FLEXFILENAMES: + * This symbol, if defined, indicates that the system supports filenames + * longer than 14 characters. + */ +#define FLEXFILENAMES /**/ + +/* HAS_FPOS64_T: + * This symbol will be defined if the C compiler supports fpos64_t. + */ +/*#define HAS_FPOS64_T /**/ + +/* HAS_FREXPL: + * This symbol, if defined, indicates that the frexpl routine is + * available to break a long double floating-point number into + * a normalized fraction and an integral power of 2. + */ +/*#define HAS_FREXPL /**/ + +/* HAS_STRUCT_FS_DATA: + * This symbol, if defined, indicates that the struct fs_data + * to do statfs() is supported. + */ +/*#define HAS_STRUCT_FS_DATA /**/ + +/* HAS_FSEEKO: + * This symbol, if defined, indicates that the fseeko routine is + * available to fseek beyond 32 bits (useful for ILP32 hosts). + */ +/*#define HAS_FSEEKO /**/ + +/* HAS_FSTATFS: + * This symbol, if defined, indicates that the fstatfs routine is + * available to stat filesystems by file descriptors. + */ +/*#define HAS_FSTATFS /**/ + +/* HAS_FTELLO: + * This symbol, if defined, indicates that the ftello routine is + * available to ftell beyond 32 bits (useful for ILP32 hosts). + */ +/*#define HAS_FTELLO /**/ + +/* Gconvert: + * This preprocessor macro is defined to convert a floating point + * number to a string without a trailing decimal point. This + * emulates the behavior of sprintf("%g"), but is sometimes much more + * efficient. If gconvert() is not available, but gcvt() drops the + * trailing decimal point, then gcvt() is used. If all else fails, + * a macro using sprintf("%g") is used. Arguments for the Gconvert + * macro are: value, number of digits, whether trailing zeros should + * be retained, and the output buffer. + * Possible values are: + * d_Gconvert='gconvert((x),(n),(t),(b))' + * d_Gconvert='gcvt((x),(n),(b))' + * d_Gconvert='sprintf((b),"%.*g",(n),(x))' + * The last two assume trailing zeros should not be kept. + */ +#define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x)) + +/* HAS_GETCWD: + * This symbol, if defined, indicates that the getcwd routine is + * available to get the current working directory. + */ +/*#define HAS_GETCWD /**/ + +/* HAS_GETESPWNAM: + * This symbol, if defined, indicates that the getespwnam system call is + * available to retrieve enchanced (shadow) password entries by name. + */ +/*#define HAS_GETESPWNAM /**/ + +/* HAS_GETFSSTAT: + * This symbol, if defined, indicates that the getfsstat routine is + * available to stat filesystems in bulk. + */ +/*#define HAS_GETFSSTAT /**/ + +/* HAS_GETGRENT: + * This symbol, if defined, indicates that the getgrent routine is + * available for sequential access of the group database. + */ +/*#define HAS_GETGRENT /**/ + +/* HAS_GETHOSTBYADDR: + * This symbol, if defined, indicates that the gethostbyaddr() routine is + * available to look up hosts by their IP addresses. + */ +#define HAS_GETHOSTBYADDR /**/ + +/* HAS_GETHOSTBYNAME: + * This symbol, if defined, indicates that the gethostbyname() routine is + * available to look up host names in some data base or other. + */ +#define HAS_GETHOSTBYNAME /**/ + +/* HAS_GETHOSTENT: + * This symbol, if defined, indicates that the gethostent() routine is + * available to look up host names in some data base or another. + */ +/*#define HAS_GETHOSTENT /**/ + +/* HAS_GETHOSTNAME: + * This symbol, if defined, indicates that the C program may use the + * gethostname() routine to derive the host name. See also HAS_UNAME + * and PHOSTNAME. + */ +/* HAS_UNAME: + * This symbol, if defined, indicates that the C program may use the + * uname() routine to derive the host name. See also HAS_GETHOSTNAME + * and PHOSTNAME. + */ +/* PHOSTNAME: + * This symbol, if defined, indicates the command to feed to the + * popen() routine to derive the host name. See also HAS_GETHOSTNAME + * and HAS_UNAME. Note that the command uses a fully qualified path, + * so that it is safe even if used by a process with super-user + * privileges. + */ +/* 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_GETHOST_PROTOS: + * This symbol, if defined, indicates that <netdb.h> includes + * prototypes for gethostent(), gethostbyname(), and + * gethostbyaddr(). Otherwise, it is up to the program to guess + * them. See netdbtype.U for probing for various Netdb_xxx_t types. + */ +#define HAS_GETHOST_PROTOS /**/ + +/* HAS_GETMNT: + * This symbol, if defined, indicates that the getmnt routine is + * available to get filesystem mount info by filename. + */ +/*#define HAS_GETMNT /**/ + +/* HAS_GETMNTENT: + * This symbol, if defined, indicates that the getmntent routine is + * available to iterate through mounted file systems to get their info. + */ +/*#define HAS_GETMNTENT /**/ + +/* HAS_GETNETBYADDR: + * This symbol, if defined, indicates that the getnetbyaddr() routine is + * available to look up networks by their IP addresses. + */ +/*#define HAS_GETNETBYADDR /**/ + +/* HAS_GETNETBYNAME: + * This symbol, if defined, indicates that the getnetbyname() routine is + * available to look up networks by their names. + */ +/*#define HAS_GETNETBYNAME /**/ + +/* HAS_GETNETENT: + * This symbol, if defined, indicates that the getnetent() routine is + * available to look up network names in some data base or another. + */ +/*#define HAS_GETNETENT /**/ + +/* HAS_GETNET_PROTOS: + * This symbol, if defined, indicates that <netdb.h> includes + * prototypes for getnetent(), getnetbyname(), and + * getnetbyaddr(). Otherwise, it is up to the program to guess + * them. See netdbtype.U for probing for various Netdb_xxx_t types. + */ +/*#define HAS_GETNET_PROTOS /**/ + +/* HAS_GETPAGESIZE: + * This symbol, if defined, indicates that the getpagesize system call + * is available to get system page size, which is the granularity of + * many memory management calls. + */ +/*#define HAS_GETPAGESIZE /**/ + +/* HAS_GETPROTOENT: + * This symbol, if defined, indicates that the getprotoent() routine is + * available to look up protocols in some data base or another. + */ +/*#define HAS_GETPROTOENT /**/ + +/* HAS_GETPROTOBYNAME: + * This symbol, if defined, indicates that the getprotobyname() + * routine is available to look up protocols by their name. + */ +/* HAS_GETPROTOBYNUMBER: + * This symbol, if defined, indicates that the getprotobynumber() + * routine is available to look up protocols by their number. + */ +#define HAS_GETPROTOBYNAME /**/ +#define HAS_GETPROTOBYNUMBER /**/ + +/* HAS_GETPROTO_PROTOS: + * This symbol, if defined, indicates that <netdb.h> includes + * prototypes for getprotoent(), getprotobyname(), and + * getprotobyaddr(). Otherwise, it is up to the program to guess + * them. See netdbtype.U for probing for various Netdb_xxx_t types. + */ +#define HAS_GETPROTO_PROTOS /**/ + +/* HAS_GETPRPWNAM: + * This symbol, if defined, indicates that the getprpwnam system call is + * available to retrieve protected (shadow) password entries by name. + */ +/*#define HAS_GETPRPWNAM /**/ + +/* HAS_GETPWENT: + * This symbol, if defined, indicates that the getpwent routine is + * available for sequential access of the passwd database. + * If this is not available, the older getpw() function may be available. + */ +/*#define HAS_GETPWENT /**/ + +/* HAS_GETSERVENT: + * This symbol, if defined, indicates that the getservent() routine is + * available to look up network services in some data base or another. + */ +/*#define HAS_GETSERVENT /**/ + +/* HAS_GETSERV_PROTOS: + * This symbol, if defined, indicates that <netdb.h> includes + * prototypes for getservent(), getservbyname(), and + * getservbyaddr(). Otherwise, it is up to the program to guess + * them. See netdbtype.U for probing for various Netdb_xxx_t types. + */ +#define HAS_GETSERV_PROTOS /**/ + +/* HAS_GETSPNAM: + * This symbol, if defined, indicates that the getspnam system call is + * available to retrieve SysV shadow password entries by name. + */ +/*#define HAS_GETSPNAM /**/ + +/* HAS_GETSERVBYNAME: + * This symbol, if defined, indicates that the getservbyname() + * routine is available to look up services by their name. + */ +/* HAS_GETSERVBYPORT: + * This symbol, if defined, indicates that the getservbyport() + * routine is available to look up services by their port. + */ +#define HAS_GETSERVBYNAME /**/ +#define HAS_GETSERVBYPORT /**/ + +/* HAS_GNULIBC: + * This symbol, if defined, indicates to the C program that + * 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. + */ +/*#define HAS_HASMNTOPT /**/ + +/* 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_ICONV: + * This symbol, if defined, indicates that the iconv routine is + * available to do character set conversions. + */ +/*#define HAS_ICONV /**/ + +/* 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_ISASCII: + * This manifest constant lets the C program know that isascii + * is available. + */ +#define HAS_ISASCII /**/ + +/* HAS_ISNAN: + * This symbol, if defined, indicates that the isnan routine is + * available to check whether a double is a NaN. + */ +#define HAS_ISNAN /**/ + +/* HAS_ISNANL: + * This symbol, if defined, indicates that the isnanl routine is + * available to check whether a long double is a NaN. + */ +/*#define HAS_ISNANL /**/ + +/* HAS_LCHOWN: + * This symbol, if defined, indicates that the lchown routine is + * available to operate on a symbolic link (instead of following the + * link). + */ +/*#define HAS_LCHOWN /**/ + +/* HAS_LDBL_DIG: + * This symbol, if defined, indicates that this system's <float.h> + * or <limits.h> defines the symbol LDBL_DIG, which is the number + * of significant digits in a long double precision number. Unlike + * for DBL_DIG, there's no good guess for LDBL_DIG if it is undefined. + */ +#define HAS_LDBL_DIG /**/ + +/* HAS_LONG_DOUBLE: + * This symbol will be defined if the C compiler supports long + * doubles. + */ +/* LONG_DOUBLESIZE: + * This symbol contains the size of a long double, so that the + * C preprocessor can make decisions based on it. It is only + * defined if the system supports long doubles. + */ +#define HAS_LONG_DOUBLE /**/ +#ifdef HAS_LONG_DOUBLE +#define LONG_DOUBLESIZE 10 /**/ +#endif + +/* HAS_LONG_LONG: + * This symbol will be defined if the C compiler supports long long. + */ +/* LONGLONGSIZE: + * This symbol contains the size of a long long, so that the + * C preprocessor can make decisions based on it. It is only + * defined if the system supports long long. + */ +/*#define HAS_LONG_LONG /**/ +#ifdef HAS_LONG_LONG +#define LONGLONGSIZE 8 /**/ +#endif + +/* HAS_LSEEK_PROTO: + * This symbol, if defined, indicates that the system provides + * a prototype for the lseek() function. Otherwise, it is up + * to the program to supply one. A good guess is + * extern off_t lseek(int, off_t, int); + */ +#define HAS_LSEEK_PROTO /**/ + +/* HAS_MADVISE: + * This symbol, if defined, indicates that the madvise system call is + * available to map a file into memory. + */ +/*#define HAS_MADVISE /**/ + +/* HAS_MEMCHR: + * This symbol, if defined, indicates that the memchr routine is available + * to locate characters within a C string. + */ +#define HAS_MEMCHR /**/ + +/* HAS_MKDTEMP: + * This symbol, if defined, indicates that the mkdtemp routine is + * available to exclusively create a uniquely named temporary directory. + */ +/*#define HAS_MKDTEMP /**/ + +/* HAS_MKSTEMP: + * This symbol, if defined, indicates that the mkstemp routine is + * available to exclusively create and open a uniquely named + * temporary file. + */ +/*#define HAS_MKSTEMP /**/ + +/* HAS_MKSTEMPS: + * This symbol, if defined, indicates that the mkstemps routine is + * available to excluslvely create and open a uniquely named + * (with a suffix) temporary file. + */ +/*#define HAS_MKSTEMPS /**/ + +/* HAS_MMAP: + * This symbol, if defined, indicates that the mmap system call is + * available to map a file into memory. + */ +/* Mmap_t: + * This symbol holds the return type of the mmap() system call + * (and simultaneously the type of the first argument). + * Usually set to 'void *' or 'cadd_t'. + */ +/*#define HAS_MMAP /**/ +#define Mmap_t void * /**/ + +/* HAS_MODFL: + * This symbol, if defined, indicates that the modfl routine is + * available to split a long double x into a fractional part f and + * an integer part i such that |f| < 1.0 and (f + i) = x. + */ +/*#define HAS_MODFL /**/ + +/* HAS_MPROTECT: + * This symbol, if defined, indicates that the mprotect system call is + * available to modify the access protection of a memory mapped file. + */ +/*#define HAS_MPROTECT /**/ + +/* HAS_MSG: + * This symbol, if defined, indicates that the entire msg*(2) library is + * supported (IPC mechanism based on message queues). + */ +/*#define HAS_MSG /**/ + +/* HAS_OFF64_T: + * This symbol will be defined if the C compiler supports off64_t. + */ +/*#define HAS_OFF64_T /**/ + +/* HAS_OPEN3: + * This manifest constant lets the C program know that the three + * argument form of open(2) is available. + */ +/*#define HAS_OPEN3 /**/ + +/* OLD_PTHREAD_CREATE_JOINABLE: + * This symbol, if defined, indicates how to create pthread + * in joinable (aka undetached) state. NOTE: not defined + * if pthread.h already has defined PTHREAD_CREATE_JOINABLE + * (the new version of the constant). + * If defined, known values are PTHREAD_CREATE_UNDETACHED + * and __UNDETACHED. + */ +/*#define OLD_PTHREAD_CREATE_JOINABLE /**/ + +/* HAS_PTHREAD_YIELD: + * This symbol, if defined, indicates that the pthread_yield + * routine is available to yield the execution of the current + * thread. sched_yield is preferable to pthread_yield. + */ +/* SCHED_YIELD: + * This symbol defines the way to yield the execution of + * the current thread. Known ways are sched_yield, + * pthread_yield, and pthread_yield with NULL. + */ +/* HAS_SCHED_YIELD: + * This symbol, if defined, indicates that the sched_yield + * routine is available to yield the execution of the current + * thread. sched_yield is preferable to pthread_yield. + */ +/*#define HAS_PTHREAD_YIELD /**/ +#define SCHED_YIELD /**/ +/*#define HAS_SCHED_YIELD /**/ + +/* HAS_SAFE_BCOPY: + * This symbol, if defined, indicates that the bcopy routine is available + * to copy potentially overlapping memory blocks. Otherwise you should + * probably use memmove() or memcpy(). If neither is defined, roll your + * own version. + */ +/*#define HAS_SAFE_BCOPY /**/ + +/* HAS_SAFE_MEMCPY: + * This symbol, if defined, indicates that the memcpy routine is available + * to copy potentially overlapping memory blocks. Otherwise you should + * probably use memmove() or memcpy(). If neither is defined, roll your + * own version. + */ +/*#define HAS_SAFE_MEMCPY /**/ + +/* HAS_SANE_MEMCMP: + * This symbol, if defined, indicates that the memcmp routine is available + * and can be used to compare relative magnitudes of chars with their high + * bits set. If it is not defined, roll your own version. + */ +#define HAS_SANE_MEMCMP /**/ + +/* HAS_SEM: + * This symbol, if defined, indicates that the entire sem*(2) library is + * supported. + */ +/*#define HAS_SEM /**/ + +/* HAS_SETGRENT: + * This symbol, if defined, indicates that the setgrent routine is + * available for initializing sequential access of the group database. + */ +/*#define HAS_SETGRENT /**/ + +/* HAS_SETGROUPS: + * This symbol, if defined, indicates that the setgroups() routine is + * available to set the list of process groups. If unavailable, multiple + * groups are probably not supported. + */ +/*#define HAS_SETGROUPS /**/ + +/* HAS_SETHOSTENT: + * This symbol, if defined, indicates that the sethostent() routine is + * available. + */ +/*#define HAS_SETHOSTENT /**/ + +/* HAS_SETNETENT: + * This symbol, if defined, indicates that the setnetent() routine is + * available. + */ +/*#define HAS_SETNETENT /**/ + +/* HAS_SETPROTOENT: + * This symbol, if defined, indicates that the setprotoent() routine is + * available. + */ +/*#define HAS_SETPROTOENT /**/ + +/* HAS_SETPROCTITLE: + * This symbol, if defined, indicates that the setproctitle routine is + * available to set process title. + */ +/*#define HAS_SETPROCTITLE /**/ + +/* HAS_SETPWENT: + * This symbol, if defined, indicates that the setpwent routine is + * available for initializing sequential access of the passwd database. + */ +/*#define HAS_SETPWENT /**/ + +/* HAS_SETSERVENT: + * This symbol, if defined, indicates that the setservent() routine is + * available. + */ +/*#define HAS_SETSERVENT /**/ + +/* HAS_SETVBUF: + * This symbol, if defined, indicates that the setvbuf routine is + * available to change buffering on an open stdio stream. + * to a line-buffered mode. + */ +#define HAS_SETVBUF /**/ + +/* USE_SFIO: + * This symbol, if defined, indicates that sfio should + * be used. + */ +/*#define USE_SFIO /**/ + +/* HAS_SHM: + * This symbol, if defined, indicates that the entire shm*(2) library is + * supported. + */ +/*#define HAS_SHM /**/ + +/* HAS_SIGACTION: + * This symbol, if defined, indicates that Vr4's sigaction() routine + * is available. + */ +/*#define HAS_SIGACTION /**/ + +/* HAS_SIGSETJMP: + * This variable indicates to the C program that the sigsetjmp() + * routine is available to save the calling process's registers + * and stack environment for later use by siglongjmp(), and + * to optionally save the process's signal mask. See + * Sigjmp_buf, Sigsetjmp, and Siglongjmp. + */ +/* Sigjmp_buf: + * This is the buffer type to be used with Sigsetjmp and Siglongjmp. + */ +/* Sigsetjmp: + * This macro is used in the same way as sigsetjmp(), but will invoke + * traditional setjmp() if sigsetjmp isn't available. + * See HAS_SIGSETJMP. + */ +/* Siglongjmp: + * This macro is used in the same way as siglongjmp(), but will invoke + * traditional longjmp() if siglongjmp isn't available. + * See HAS_SIGSETJMP. + */ +/*#define HAS_SIGSETJMP /**/ +#ifdef HAS_SIGSETJMP +#define Sigjmp_buf sigjmp_buf +#define Sigsetjmp(buf,save_mask) sigsetjmp((buf),(save_mask)) +#define Siglongjmp(buf,retval) siglongjmp((buf),(retval)) +#else +#define Sigjmp_buf jmp_buf +#define Sigsetjmp(buf,save_mask) setjmp((buf)) +#define Siglongjmp(buf,retval) longjmp((buf),(retval)) +#endif + +/* HAS_SOCKET: + * This symbol, if defined, indicates that the BSD socket interface is + * supported. + */ +/* HAS_SOCKETPAIR: + * This symbol, if defined, indicates that the BSD socketpair() call is + * supported. + */ +/* HAS_MSG_CTRUNC: + * This symbol, if defined, indicates that the MSG_CTRUNC is supported. + * Checking just with #ifdef might not be enough because this symbol + * has been known to be an enum. + */ +/* HAS_MSG_DONTROUTE: + * This symbol, if defined, indicates that the MSG_DONTROUTE is supported. + * Checking just with #ifdef might not be enough because this symbol + * has been known to be an enum. + */ +/* HAS_MSG_OOB: + * This symbol, if defined, indicates that the MSG_OOB is supported. + * Checking just with #ifdef might not be enough because this symbol + * has been known to be an enum. + */ +/* HAS_MSG_PEEK: + * This symbol, if defined, indicates that the MSG_PEEK is supported. + * Checking just with #ifdef might not be enough because this symbol + * has been known to be an enum. + */ +/* HAS_MSG_PROXY: + * This symbol, if defined, indicates that the MSG_PROXY is supported. + * Checking just with #ifdef might not be enough because this symbol + * has been known to be an enum. + */ +/* HAS_SCM_RIGHTS: + * This symbol, if defined, indicates that the SCM_RIGHTS is supported. + * Checking just with #ifdef might not be enough because this symbol + * has been known to be an enum. + */ +#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 /**/ + +/* HAS_SOCKS5_INIT: + * This symbol, if defined, indicates that the socks5_init routine is + * available to initialize SOCKS 5. + */ +/*#define HAS_SOCKS5_INIT /**/ + +/* HAS_SQRTL: + * This symbol, if defined, indicates that the sqrtl routine is + * available to do long double square roots. + */ +/*#define HAS_SQRTL /**/ + +/* USE_STAT_BLOCKS: + * This symbol is defined if this system has a stat structure declaring + * st_blksize and st_blocks. + */ +#ifndef USE_STAT_BLOCKS +/*#define USE_STAT_BLOCKS /**/ +#endif + +/* HAS_STRUCT_STATFS_F_FLAGS: + * This symbol, if defined, indicates that the struct statfs + * does have the f_flags member containing the mount flags of + * the filesystem containing the file. + * This kind of struct statfs is coming from <sys/mount.h> (BSD 4.3), + * not from <sys/statfs.h> (SYSV). Older BSDs (like Ultrix) do not + * have statfs() and struct statfs, they have ustat() and getmnt() + * with struct ustat and struct fs_data. + */ +/*#define HAS_STRUCT_STATFS_F_FLAGS /**/ + +/* HAS_STRUCT_STATFS: + * This symbol, if defined, indicates that the struct statfs + * to do statfs() is supported. + */ +/*#define HAS_STRUCT_STATFS /**/ + +/* HAS_FSTATVFS: + * This symbol, if defined, indicates that the fstatvfs routine is + * available to stat filesystems by file descriptors. + */ +/*#define HAS_FSTATVFS /**/ + +/* USE_STDIO_PTR: + * This symbol is defined if the _ptr and _cnt fields (or similar) + * of the stdio FILE structure can be used to access the stdio buffer + * for a file handle. If this is defined, then the FILE_ptr(fp) + * and FILE_cnt(fp) macros will also be defined and should be used + * to access these fields. + */ +/* FILE_ptr: + * This macro is used to access the _ptr field (or equivalent) of the + * FILE structure pointed to by its argument. This macro will always be + * defined if USE_STDIO_PTR is defined. + */ +/* STDIO_PTR_LVALUE: + * This symbol is defined if the FILE_ptr macro can be used as an + * lvalue. + */ +/* FILE_cnt: + * This macro is used to access the _cnt field (or equivalent) of the + * FILE structure pointed to by its argument. This macro will always be + * defined if USE_STDIO_PTR is defined. + */ +/* STDIO_CNT_LVALUE: + * This symbol is defined if the FILE_cnt macro can be used as an + * lvalue. + */ +/* STDIO_PTR_LVAL_SETS_CNT: + * This symbol is defined if using the FILE_ptr macro as an lvalue + * to increase the pointer by n has the side effect of decreasing the + * value of File_cnt(fp) by n. + */ +/* STDIO_PTR_LVAL_NOCHANGE_CNT: + * This symbol is defined if using the FILE_ptr macro as an lvalue + * to increase the pointer by n leaves File_cnt(fp) unchanged. + */ +#define USE_STDIO_PTR /**/ +#ifdef USE_STDIO_PTR +#define FILE_ptr(fp) ((fp)->_ptr) +#define STDIO_PTR_LVALUE /**/ +#define FILE_cnt(fp) ((fp)->_cnt) +#define STDIO_CNT_LVALUE /**/ +/*#define STDIO_PTR_LVAL_SETS_CNT /**/ +/*#define STDIO_PTR_LVAL_NOCHANGE_CNT /**/ +#endif + +/* USE_STDIO_BASE: + * This symbol is defined if the _base field (or similar) of the + * stdio FILE structure can be used to access the stdio buffer for + * a file handle. If this is defined, then the FILE_base(fp) macro + * will also be defined and should be used to access this field. + * Also, the FILE_bufsiz(fp) macro will be defined and should be used + * to determine the number of bytes in the buffer. USE_STDIO_BASE + * will never be defined unless USE_STDIO_PTR is. + */ +/* FILE_base: + * This macro is used to access the _base field (or equivalent) of the + * FILE structure pointed to by its argument. This macro will always be + * defined if USE_STDIO_BASE is defined. + */ +/* FILE_bufsiz: + * This macro is used to determine the number of bytes in the I/O + * buffer pointed to by _base field (or equivalent) of the FILE + * structure pointed to its argument. This macro will always be defined + * if USE_STDIO_BASE is defined. + */ +#define USE_STDIO_BASE /**/ +#ifdef USE_STDIO_BASE +#define FILE_base(fp) ((fp)->_base) +#define FILE_bufsiz(fp) ((fp)->_cnt + (fp)->_ptr - (fp)->_base) +#endif + +/* HAS_STRERROR: + * This symbol, if defined, indicates that the strerror routine is + * 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_STRTOLD: + * This symbol, if defined, indicates that the strtold routine is + * available to convert strings to long doubles. + */ +/*#define HAS_STRTOLD /**/ + +/* HAS_STRTOLL: + * This symbol, if defined, indicates that the strtoll routine is + * available to convert strings to long longs. + */ +/*#define HAS_STRTOLL /**/ + +/* HAS_STRTOULL: + * This symbol, if defined, indicates that the strtoull routine is + * available to convert strings to unsigned long longs. + */ +/*#define HAS_STRTOULL /**/ + +/* HAS_STRTOUQ: + * This symbol, if defined, indicates that the strtouq routine is + * available to convert strings to unsigned long longs (quads). + */ +/*#define HAS_STRTOUQ /**/ + +/* HAS_TELLDIR_PROTO: + * This symbol, if defined, indicates that the system provides + * a prototype for the telldir() function. Otherwise, it is up + * to the program to supply one. A good guess is + * extern long telldir _((DIR*)); + */ +#define HAS_TELLDIR_PROTO /**/ + +/* Time_t: + * This symbol holds the type returned by time(). It can be long, + * or time_t on BSD sites (in which case <sys/types.h> should be + * included). + */ +#define Time_t time_t /* Time type */ + +/* HAS_TIMES: + * This symbol, if defined, indicates that the times() routine exists. + * Note that this became obsolete on some systems (SUNOS), which now + * use getrusage(). It may be necessary to include <sys/times.h>. + */ +#define HAS_TIMES /**/ + +/* HAS_UNION_SEMUN: + * This symbol, if defined, indicates that the union semun is + * defined by including <sys/sem.h>. If not, the user code + * probably needs to define it as: + * union semun { + * int val; + * struct semid_ds *buf; + * unsigned short *array; + * } + */ +/* USE_SEMCTL_SEMUN: + * This symbol, if defined, indicates that union semun is + * used for semctl IPC_STAT. + */ +/* USE_SEMCTL_SEMID_DS: + * This symbol, if defined, indicates that struct semid_ds * is + * used for semctl IPC_STAT. + */ +#define HAS_UNION_SEMUN /**/ +/*#define USE_SEMCTL_SEMUN /**/ +/*#define USE_SEMCTL_SEMID_DS /**/ + +/* HAS_USTAT: + * This symbol, if defined, indicates that the ustat system call is + * available to query file system statistics by dev_t. + */ +/*#define HAS_USTAT /**/ + +/* HAS_VFORK: + * This symbol, if defined, indicates that vfork() exists. + */ +/*#define HAS_VFORK /**/ + +/* Signal_t: + * This symbol's value is either "void" or "int", corresponding to the + * appropriate return type of a signal handler. Thus, you can declare + * a signal handler using "Signal_t (*handler)()", and define the + * handler using "Signal_t handler(sig)". + */ +#define Signal_t void /* Signal handler's return type */ + +/* HAS_VPRINTF: + * This symbol, if defined, indicates that the vprintf routine is available + * to printf with a pointer to an argument list. If unavailable, you + * may need to write your own, probably in terms of _doprnt(). + */ +/* USE_CHAR_VSPRINTF: + * This symbol is defined if this system has vsprintf() returning type + * (char*). The trend seems to be to declare it as "int vsprintf()". It + * is up to the package author to declare vsprintf correctly based on the + * symbol. + */ +#define HAS_VPRINTF /**/ +/*#define USE_CHAR_VSPRINTF /**/ + +/* USE_DYNAMIC_LOADING: + * This symbol, if defined, indicates that dynamic loading of + * some sort is available. + */ +#define USE_DYNAMIC_LOADING /**/ + +/* DOUBLESIZE: + * This symbol contains the size of a double, so that the C preprocessor + * can make decisions based on it. + */ +#define DOUBLESIZE 8 /**/ + +/* EBCDIC: + * This symbol, if defined, indicates that this system uses + * EBCDIC encoding. + */ +/*#define EBCDIC /**/ + +/* FFLUSH_NULL: + * This symbol, if defined, tells that fflush(NULL) does flush + * all pending stdio output. + */ +/* FFLUSH_ALL: + * This symbol, if defined, tells that to flush + * all pending stdio output one must loop through all + * the stdio file handles stored in an array and fflush them. + * Note that if fflushNULL is defined, fflushall will not + * even be probed for and will be left undefined. + */ +#define FFLUSH_NULL /**/ +/*#define FFLUSH_ALL /**/ + +/* Fpos_t: + * This symbol holds the type used to declare file positions in libc. + * It can be fpos_t, long, uint, etc... It may be necessary to include + * <sys/types.h> to get any typedef'ed information. + */ +#define Fpos_t fpos_t /* File position type */ + +/* Gid_t_f: + * This symbol defines the format string used for printing a Gid_t. + */ +#define Gid_t_f "ld" /**/ + +/* Gid_t_sign: + * This symbol holds the signedess of a Gid_t. + * 1 for unsigned, -1 for signed. + */ +#define Gid_t_sign -1 /* GID sign */ + +/* Gid_t_size: + * This symbol holds the size of a Gid_t in bytes. + */ +#define Gid_t_size 4 /* GID size */ + +/* Gid_t: + * This symbol holds the return type of getgid() and the type of + * argument to setrgid() and related functions. Typically, + * it is the type of group ids in the kernel. It can be int, ushort, + * gid_t, etc... It may be necessary to include <sys/types.h> to get + * any typedef'ed information. + */ +#define Gid_t gid_t /* Type for getgid(), etc... */ + +/* Groups_t: + * This symbol holds the type used for the second argument to + * getgroups() and setgroups(). Usually, this is the same as + * gidtype (gid_t) , but sometimes it isn't. + * It can be int, ushort, gid_t, etc... + * It may be necessary to include <sys/types.h> to get any + * typedef'ed information. This is only required if you have + * getgroups() or setgroups().. + */ +#if defined(HAS_GETGROUPS) || defined(HAS_SETGROUPS) +#define Groups_t gid_t /* Type for 2nd arg to [sg]etgroups() */ +#endif + +/* DB_Prefix_t: + * This symbol contains the type of the prefix structure element + * in the <db.h> header file. In older versions of DB, it was + * int, while in newer ones it is u_int32_t. + */ +/* DB_Hash_t: + * This symbol contains the type of the prefix structure element + * in the <db.h> header file. In older versions of DB, it was + * int, while in newer ones it is size_t. + */ +#define DB_Hash_t int /**/ +#define DB_Prefix_t int /**/ + +/* I_GRP: + * This symbol, if defined, indicates to the C program that it should + * include <grp.h>. + */ +/* 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_ICONV: + * This symbol, if defined, indicates that <iconv.h> exists and + * should be included. + */ +/*#define I_ICONV /**/ + +/* I_IEEEFP: + * This symbol, if defined, indicates that <ieeefp.h> exists and + * should be included. + */ +/*#define I_IEEEFP /**/ + +/* I_INTTYPES: + * This symbol, if defined, indicates to the C program that it should + * include <inttypes.h>. + */ +/*#define I_INTTYPES /**/ + +/* I_LIBUTIL: + * This symbol, if defined, indicates that <libutil.h> exists and + * should be included. + */ +/*#define I_LIBUTIL /**/ + +/* I_MACH_CTHREADS: + * This symbol, if defined, indicates to the C program that it should + * include <mach/cthreads.h>. + */ +/*#define I_MACH_CTHREADS /**/ + +/* I_MNTENT: + * This symbol, if defined, indicates that <mntent.h> exists and + * should be included. + */ +/*#define I_MNTENT /**/ + +/* I_NETDB: + * This symbol, if defined, indicates that <netdb.h> exists and + * should be included. + */ +/*#define I_NETDB /**/ + +/* I_NETINET_TCP: + * This symbol, if defined, indicates to the C program that it should + * include <netinet/tcp.h>. + */ +/*#define I_NETINET_TCP /**/ + +/* I_POLL: + * This symbol, if defined, indicates that <poll.h> exists and + * should be included. + */ +/*#define I_POLL /**/ + +/* I_PROT: + * This symbol, if defined, indicates that <prot.h> exists and + * should be included. + */ +/*#define I_PROT /**/ + +/* I_PTHREAD: + * This symbol, if defined, indicates to the C program that it should + * include <pthread.h>. + */ +/*#define I_PTHREAD /**/ + +/* I_PWD: + * This symbol, if defined, indicates to the C program that it should + * include <pwd.h>. + */ +/* PWQUOTA: + * This symbol, if defined, indicates to the C program that struct passwd + * contains pw_quota. + */ +/* PWAGE: + * This symbol, if defined, indicates to the C program that struct passwd + * contains pw_age. + */ +/* PWCHANGE: + * This symbol, if defined, indicates to the C program that struct passwd + * contains pw_change. + */ +/* PWCLASS: + * This symbol, if defined, indicates to the C program that struct passwd + * contains pw_class. + */ +/* PWEXPIRE: + * This symbol, if defined, indicates to the C program that struct passwd + * contains pw_expire. + */ +/* PWCOMMENT: + * This symbol, if defined, indicates to the C program that struct passwd + * contains pw_comment. + */ +/* PWGECOS: + * This symbol, if defined, indicates to the C program that struct passwd + * contains pw_gecos. + */ +/* PWPASSWD: + * This symbol, if defined, indicates to the C program that struct passwd + * contains pw_passwd. + */ +/*#define I_PWD /**/ +/*#define PWQUOTA /**/ +/*#define PWAGE /**/ +/*#define PWCHANGE /**/ +/*#define PWCLASS /**/ +/*#define PWEXPIRE /**/ +/*#define PWCOMMENT /**/ +/*#define PWGECOS /**/ +/*#define PWPASSWD /**/ + +/* I_SHADOW: + * This symbol, if defined, indicates that <shadow.h> exists and + * should be included. + */ +/*#define I_SHADOW /**/ + +/* I_SOCKS: + * This symbol, if defined, indicates that <socks.h> exists and + * should be included. + */ +/*#define I_SOCKS /**/ + +/* I_SUNMATH: + * This symbol, if defined, indicates that <sunmath.h> exists and + * should be included. + */ +/*#define I_SUNMATH /**/ + +/* I_SYSLOG: + * This symbol, if defined, indicates that <syslog.h> exists and + * should be included. + */ +/*#define I_SYSLOG /**/ + +/* I_SYSMODE: + * This symbol, if defined, indicates that <sys/mode.h> exists and + * should be included. + */ +/*#define I_SYSMODE /**/ + +/* I_SYS_MOUNT: + * This symbol, if defined, indicates that <sys/mount.h> exists and + * should be included. + */ +/*#define I_SYS_MOUNT /**/ + +/* I_SYS_STATFS: + * This symbol, if defined, indicates that <sys/statfs.h> exists. + */ +/*#define I_SYS_STATFS /**/ + +/* I_SYS_STATVFS: + * This symbol, if defined, indicates that <sys/statvfs.h> exists and + * should be included. + */ +/*#define I_SYS_STATVFS /**/ + +/* I_SYSUIO: + * This symbol, if defined, indicates that <sys/uio.h> exists and + * should be included. + */ +/*#define I_SYSUIO /**/ + +/* I_SYSUTSNAME: + * This symbol, if defined, indicates that <sys/utsname.h> exists and + * should be included. + */ +/*#define I_SYSUTSNAME /**/ + +/* I_SYS_VFS: + * This symbol, if defined, indicates that <sys/vfs.h> exists and + * should be included. + */ +/*#define I_SYS_VFS /**/ + +/* I_TIME: + * This symbol, if defined, indicates to the C program that it should + * include <time.h>. + */ +/* I_SYS_TIME: + * This symbol, if defined, indicates to the C program that it should + * include <sys/time.h>. + */ +/* I_SYS_TIME_KERNEL: + * This symbol, if defined, indicates to the C program that it should + * include <sys/time.h> with KERNEL defined. + */ +#define I_TIME /**/ +/*#define I_SYS_TIME /**/ +/*#define I_SYS_TIME_KERNEL /**/ + +/* I_USTAT: + * This symbol, if defined, indicates that <ustat.h> exists and + * should be included. + */ +/*#define I_USTAT /**/ + +/* PERL_INC_VERSION_LIST: + * This variable specifies the list of subdirectories in over + * which perl.c:incpush() and lib/lib.pm will automatically + * search when adding directories to @INC, in a format suitable + * for a C initialization string. See the inc_version_list entry + * in Porting/Glossary for more details. + */ +#define PERL_INC_VERSION_LIST 0 /**/ + +/* 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 /**/ + +/* 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. + */ +/* PERL_PRIeldbl: + * This symbol, if defined, contains the string used by stdio to + * format long doubles (format 'e') for output. + */ +/* PERL_SCNfldbl: + * This symbol, if defined, contains the string used by stdio to + * format long doubles (format 'f') for input. + */ +/*#define PERL_PRIfldbl "f" /**/ +/*#define PERL_PRIgldbl "g" /**/ +/*#define PERL_PRIeldbl "e" /**/ +/*#define PERL_SCNfldbl "f" /**/ + +/* Off_t: + * This symbol holds the type used to declare offsets in the kernel. + * It can be int, long, off_t, etc... It may be necessary to include + * <sys/types.h> to get any typedef'ed information. + */ +/* LSEEKSIZE: + * This symbol holds the number of bytes used by the Off_t. + */ +/* Off_t_size: + * This symbol holds the number of bytes used by the Off_t. + */ +#define Off_t off_t /* <offset> type */ +#define LSEEKSIZE 4 /* <offset> size */ +#define Off_t_size 4 /* <offset> size */ + +/* Free_t: + * This variable contains the return type of free(). It is usually + * void, but occasionally int. + */ +/* Malloc_t: + * This symbol is the type of pointer returned by malloc and realloc. + */ +#define Malloc_t void * /**/ +#define Free_t void /**/ + +/* MYMALLOC: + * This symbol, if defined, indicates that we're using our own malloc. + */ +/*#define MYMALLOC /**/ + +/* Mode_t: + * This symbol holds the type used to declare file modes + * for systems calls. It is usually mode_t, but may be + * int or unsigned short. It may be necessary to include <sys/types.h> + * to get any typedef'ed information. + */ +#define Mode_t mode_t /* file mode parameter for system calls */ + +/* VAL_O_NONBLOCK: + * This symbol is to be used during open() or fcntl(F_SETFL) to turn on + * non-blocking I/O for the file descriptor. Note that there is no way + * back, i.e. you cannot turn it blocking again this way. If you wish to + * alternatively switch between blocking and non-blocking, use the + * ioctl(FIOSNBIO) call instead, but that is not supported by all devices. + */ +/* VAL_EAGAIN: + * This symbol holds the errno error code set by read() when no data was + * present on the non-blocking file descriptor. + */ +/* RD_NODATA: + * This symbol holds the return code from read() when no data is present + * on the non-blocking file descriptor. Be careful! If EOF_NONBLOCK is + * not defined, then you can't distinguish between no data and EOF by + * issuing a read(). You'll have to find another way to tell for sure! + */ +/* EOF_NONBLOCK: + * This symbol, if defined, indicates to the C program that a read() on + * a non-blocking file descriptor will return 0 on EOF, and not the value + * held in RD_NODATA (-1 usually, in that case!). + */ +#define VAL_O_NONBLOCK O_NONBLOCK +#define VAL_EAGAIN EAGAIN +#define RD_NODATA -1 +#define EOF_NONBLOCK + +/* Netdb_host_t: + * This symbol holds the type used for the 1st argument + * to gethostbyaddr(). + */ +/* Netdb_hlen_t: + * This symbol holds the type used for the 2nd argument + * to gethostbyaddr(). + */ +/* Netdb_name_t: + * This symbol holds the type used for the argument to + * gethostbyname(). + */ +/* Netdb_net_t: + * This symbol holds the type used for the 1st argument to + * getnetbyaddr(). + */ +#define Netdb_host_t char * /**/ +#define Netdb_hlen_t int /**/ +#define Netdb_name_t char * /**/ +#define Netdb_net_t long /**/ + +/* PERL_OTHERLIBDIRS: + * This variable contains a colon-separated set of paths for the perl + * binary to search for additional library files or modules. + * These directories will be tacked to the end of @INC. + * Perl will automatically search below each path for version- + * and architecture-specific directories. See PERL_INC_VERSION_LIST + * for more details. + */ +/*#define PERL_OTHERLIBDIRS "" /**/ + +/* 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). + */ +/* NVSIZE: + * This symbol contains the sizeof(NV). + */ +/* NV_PRESERVES_UV: + * This symbol, if defined, indicates that a variable of type NVTYPE + * can preserve all the bits of a variable of type UVTYPE. + */ +/* NV_PRESERVES_UV_BITS: + * This symbol contains the number of bits a variable of type NVTYPE + * can preserve of a variable of type UVTYPE. + */ +#define IVTYPE __int64 /**/ +#define UVTYPE unsigned __int64 /**/ +#define I8TYPE char /**/ +#define U8TYPE unsigned char /**/ +#define I16TYPE short /**/ +#define U16TYPE unsigned short /**/ +#define I32TYPE long /**/ +#define U32TYPE unsigned long /**/ +#ifdef HAS_QUAD +#define I64TYPE __int64 /**/ +#define U64TYPE unsigned __int64 /**/ +#endif +#define NVTYPE double /**/ +#define IVSIZE 8 /**/ +#define UVSIZE 8 /**/ +#define I8SIZE 1 /**/ +#define U8SIZE 1 /**/ +#define I16SIZE 2 /**/ +#define U16SIZE 2 /**/ +#define I32SIZE 4 /**/ +#define U32SIZE 4 /**/ +#ifdef HAS_QUAD +#define I64SIZE 8 /**/ +#define U64SIZE 8 /**/ +#endif +#define NVSIZE 8 /**/ +#define NV_PRESERVES_UV +#define NV_PRESERVES_UV_BITS 64 + +/* 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 in lowercase abcdef. + */ +/* NVef: + * This symbol defines the format string used for printing a Perl NV + * using %e-ish floating point format. + */ +/* NVff: + * This symbol defines the format string used for printing a Perl NV + * using %f-ish floating point format. + */ +/* NVgf: + * This symbol defines the format string used for printing a Perl NV + * using %g-ish floating point format. + */ +#define IVdf "ld" /**/ +#define UVuf "lu" /**/ +#define UVof "lo" /**/ +#define UVxf "lx" /**/ +#define NVef "e" /**/ +#define NVff "f" /**/ +#define NVgf "g" /**/ + +/* Pid_t: + * This symbol holds the type used to declare process ids in the kernel. + * It can be int, uint, pid_t, etc... It may be necessary to include + * <sys/types.h> to get any typedef'ed information. + */ +#define Pid_t int /* PID type */ + +/* PRIVLIB: + * This symbol contains the name of the private library for this package. + * The library is private in the sense that it needn't be in anyone's + * execution path, but it should be accessible by the world. The program + * should be prepared to do ~ expansion. + */ +/* PRIVLIB_EXP: + * This symbol contains the ~name expanded version of PRIVLIB, to be used + * in programs that are not prepared to deal with ~ expansion at run-time. + */ +#define PRIVLIB "c:\\perl64\\5.6.1\\lib" /**/ +#define PRIVLIB_EXP (win32_get_privlib("5.6.1")) /**/ + +/* PTRSIZE: + * This symbol contains the size of a pointer, so that the C preprocessor + * can make decisions based on it. It will be sizeof(void *) if + * the compiler supports (void *); otherwise it will be + * sizeof(char *). + */ +#define PTRSIZE 8 /**/ + +/* Drand01: + * This macro is to be used to generate uniformly distributed + * random numbers over the range [0., 1.[. You may have to supply + * an 'extern double drand48();' in your program since SunOS 4.1.3 + * doesn't provide you with anything relevant in it's headers. + * See HAS_DRAND48_PROTO. + */ +/* Rand_seed_t: + * This symbol defines the type of the argument of the + * random seed function. + */ +/* seedDrand01: + * This symbol defines the macro to be used in seeding the + * random number generator (see Drand01). + */ +/* RANDBITS: + * This symbol indicates how many bits are produced by the + * function used to generate normalized random numbers. + * Values include 15, 16, 31, and 48. + */ +#define Drand01() (rand()/(double)((unsigned)1<<RANDBITS)) /**/ +#define Rand_seed_t unsigned /**/ +#define seedDrand01(x) srand((Rand_seed_t)x) /**/ +#define RANDBITS 15 /**/ + +/* SELECT_MIN_BITS: + * This symbol holds the minimum number of bits operated by select. + * That is, if you do select(n, ...), how many bits at least will be + * cleared in the masks if some activity is detected. Usually this + * is either n or 32*ceil(n/32), especially many little-endians do + * the latter. This is only useful if you have select(), naturally. + */ +#define SELECT_MIN_BITS 32 /**/ + +/* Select_fd_set_t: + * This symbol holds the type used for the 2nd, 3rd, and 4th + * arguments to select. Usually, this is 'fd_set *', if HAS_FD_SET + * is defined, and 'int *' otherwise. This is only useful if you + * have select(), of course. + */ +#define Select_fd_set_t Perl_fd_set * /**/ + +/* SIG_NAME: + * This symbol contains a list of signal names in order of + * signal number. This is intended + * to be used as a static array initialization, like this: + * char *sig_name[] = { SIG_NAME }; + * The signals in the list are separated with commas, and each signal + * is surrounded by double quotes. There is no leading SIG in the signal + * name, i.e. SIGQUIT is known as "QUIT". + * Gaps in the signal numbers (up to NSIG) are filled in with NUMnn, + * etc., where nn is the actual signal number (e.g. NUM37). + * The signal number for sig_name[i] is stored in sig_num[i]. + * The last element is 0 to terminate the list with a NULL. This + * corresponds to the 0 at the end of the sig_num list. + */ +/* SIG_NUM: + * This symbol contains a list of signal numbers, in the same order as the + * SIG_NAME list. It is suitable for static array initialization, as in: + * int sig_num[] = { SIG_NUM }; + * The signals in the list are separated with commas, and the indices + * within that list and the SIG_NAME list match, so it's easy to compute + * the signal name from a number or vice versa at the price of a small + * dynamic linear lookup. + * Duplicates are allowed, but are moved to the end of the list. + * The signal number corresponding to sig_name[i] is sig_number[i]. + * if (i < NSIG) then sig_number[i] == i. + * The last element is 0, corresponding to the 0 at the end of + * the sig_name list. + */ +#define SIG_NAME "ZERO", "NUM01", "INT", "QUIT", "ILL", "NUM05", "NUM06", "NUM07", "FPE", "KILL", "NUM10", "SEGV", "NUM12", "PIPE", "ALRM", "TERM", "NUM16", "NUM17", "NUM18", "NUM19", "CHLD", "BREAK", "ABRT", "STOP", "NUM24", "CONT", "CLD", 0 /**/ +#define SIG_NUM 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 20, 0 /**/ + +/* 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 "c:\\perl64\\site\\5.6.1\\lib\\MSWin32-IA64" /**/ +/*#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. + */ +/* SITELIB_STEM: + * This define is SITELIB_EXP with any trailing version-specific component + * removed. The elements in inc_version_list (inc_version_list.U) can + * be tacked onto this variable to generate a list of directories to search. + */ +#define SITELIB "c:\\perl64\\site\\5.6.1\\lib" /**/ +#define SITELIB_EXP (win32_get_sitelib("5.6.1")) /**/ +#define SITELIB_STEM "" /**/ + +/* Size_t_size: + * This symbol holds the size of a Size_t in bytes. + */ +#define Size_t_size 8 /**/ + +/* Size_t: + * This symbol holds the type used to declare length parameters + * for string functions. It is usually size_t, but may be + * unsigned long, int, etc. It may be necessary to include + * <sys/types.h> to get any typedef'ed information. + */ +#define Size_t size_t /* length paramater for string functions */ + +/* Sock_size_t: + * This symbol holds the type used for the size argument of + * various socket calls (just the base type, not the pointer-to). + */ +#define Sock_size_t int /**/ + +/* SSize_t: + * This symbol holds the type used by functions that return + * a count of bytes or an error condition. It must be a signed type. + * It is usually ssize_t, but may be long or int, etc. + * It may be necessary to include <sys/types.h> or <unistd.h> + * to get any typedef'ed information. + * We will pick a type such that sizeof(SSize_t) == sizeof(Size_t). + */ +#define SSize_t __int64 /* signed count of bytes */ + +/* STARTPERL: + * This variable contains the string to put in front of a perl + * script to make sure (one hopes) that it runs with perl and not + * some shell. + */ +#define STARTPERL "#!perl" /**/ + +/* HAS_STDIO_STREAM_ARRAY: + * This symbol, if defined, tells that there is an array + * holding the stdio streams. + */ +/* STDIO_STREAM_ARRAY: + * This symbol tells the name of the array holding the stdio streams. + * Usual values include _iob, __iob, and __sF. + */ +/*#define HAS_STDIO_STREAM_ARRAY /**/ +#define STDIO_STREAM_ARRAY + +/* Uid_t_f: + * This symbol defines the format string used for printing a Uid_t. + */ +#define Uid_t_f "ld" /**/ + +/* Uid_t_sign: + * This symbol holds the signedess of a Uid_t. + * 1 for unsigned, -1 for signed. + */ +#define Uid_t_sign -1 /* UID sign */ + +/* Uid_t_size: + * This symbol holds the size of a Uid_t in bytes. + */ +#define Uid_t_size 4 /* UID size */ + +/* Uid_t: + * This symbol holds the type used to declare user ids in the kernel. + * It can be int, ushort, uid_t, etc... It may be necessary to include + * <sys/types.h> to get any typedef'ed information. + */ +#define Uid_t uid_t /* UID type */ + +/* USE_64_BIT_INT: + * This symbol, if defined, indicates that 64-bit integers should + * be used when available. If not defined, the native integers + * will be employed (be they 32 or 64 bits). The minimal possible + * 64-bitness is used, just enough to get 64-bit integers into Perl. + * This may mean using for example "long longs", while your memory + * may still be limited to 2 gigabytes. + */ +/* USE_64_BIT_ALL: + * 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). The maximal possible + * 64-bitness is employed: LP64 or ILP64, meaning that you will + * be able to use more than 2 gigabytes of memory. This mode is + * even more binary incompatible than USE_64_BIT_INT. You may not + * be able to run the resulting executable in a 32-bit CPU at all or + * you may need at least to reboot your OS to 64-bit mode. + */ +#ifndef USE_64_BIT_INT +#define USE_64_BIT_INT /**/ +#endif + +#ifndef USE_64_BIT_ALL +/*#define USE_64_BIT_ALL /**/ +#endif + +/* USE_LARGE_FILES: + * This symbol, if defined, indicates that large file support + * should be used when available. + */ +#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_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 + +/* 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. + */ +#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 + +/* USE_ITHREADS: + * This symbol, if defined, indicates that Perl should be built to + * use the interpreter-based threading implementation. + */ +/* USE_5005THREADS: + * This symbol, if defined, indicates that Perl should be built to + * use the 5.005-based threading implementation. + */ +/* OLD_PTHREADS_API: + * This symbol, if defined, indicates that Perl should + * be built to use the old draft POSIX threads API. + */ +/*#define USE_5005THREADS /**/ +/*#define USE_ITHREADS /**/ +#if defined(USE_5005THREADS) && !defined(USE_ITHREADS) +#define USE_THREADS /* until src is revised*/ +#endif +/*#define OLD_PTHREADS_API /**/ + +/* PERL_VENDORARCH: + * If defined, this symbol contains the name of a private library. + * 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. + * It may have a ~ on the front. + * The standard distribution will put nothing in this directory. + * Vendors who distribute perl may wish to place their own + * architecture-dependent modules and extensions in this directory with + * MakeMaker Makefile.PL INSTALLDIRS=vendor + * or equivalent. See INSTALL for details. + */ +/* PERL_VENDORARCH_EXP: + * This symbol contains the ~name expanded version of PERL_VENDORARCH, to be used + * in programs that are not prepared to deal with ~ expansion at run-time. + */ +/*#define PERL_VENDORARCH "" /**/ +/*#define PERL_VENDORARCH_EXP "" /**/ + +/* 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. + */ +/* PERL_VENDORLIB_STEM: + * This define is PERL_VENDORLIB_EXP with any trailing version-specific component + * removed. The elements in inc_version_list (inc_version_list.U) can + * be tacked onto this variable to generate a list of directories to search. + */ +/*#define PERL_VENDORLIB_EXP "" /**/ +/*#define PERL_VENDORLIB_STEM "" /**/ + +/* VOIDFLAGS: + * This symbol indicates how much support of the void type is given by this + * compiler. What various bits mean: + * + * 1 = supports declaration of void + * 2 = supports arrays of pointers to functions returning void + * 4 = supports comparisons between pointers to void functions and + * addresses of void functions + * 8 = suports declaration of generic void pointers + * + * The package designer should define VOIDUSED to indicate the requirements + * of the package. This can be done either by #defining VOIDUSED before + * including config.h, or by defining defvoidused in Myinit.U. If the + * latter approach is taken, only those flags will be tested. If the + * level of void support necessary is not present, defines void to int. + */ +#ifndef VOIDUSED +#define VOIDUSED 15 +#endif +#define VOIDFLAGS 15 +#if (VOIDFLAGS & VOIDUSED) != VOIDUSED +#define void int /* is void to be avoided? */ +#define M_VOID /* Xenix strikes again */ +#endif + +/* 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 c:\\perl64\\site\\5.6.1\\lib\\MSWin32-IA64 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 c:\\perl64\\site\\5.6.1\\lib 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.6.0" +#define PERL_PM_APIVERSION "5.005" + +/* HAS_GETPGRP: + * This symbol, if defined, indicates that the getpgrp routine is + * available to get the current process group. + */ +/* USE_BSD_GETPGRP: + * This symbol, if defined, indicates that getpgrp needs one + * arguments whereas USG one needs none. + */ +/*#define HAS_GETPGRP /**/ +/*#define USE_BSD_GETPGRP /**/ + +/* HAS_SETPGRP: + * This symbol, if defined, indicates that the setpgrp routine is + * available to set the current process group. + */ +/* USE_BSD_SETPGRP: + * This symbol, if defined, indicates that setpgrp needs two + * arguments whereas USG one needs none. See also HAS_SETPGID + * for a POSIX interface. + */ +/*#define HAS_SETPGRP /**/ +/*#define USE_BSD_SETPGRP /**/ + +/* STDCHAR: + * This symbol is defined to be the type of char used in stdio.h. + * It has the values "unsigned char" or "char". + */ +#define STDCHAR char /**/ + +/* HAS__FWALK: + * This symbol, if defined, indicates that the _fwalk system call is + * available to apply a function to all the file handles. + */ +/*#define HAS__FWALK /**/ + +/* FCNTL_CAN_LOCK: + * This symbol, if defined, indicates that fcntl() can be used + * for file locking. Normally on Unix systems this is defined. + * It may be undefined on VMS. + */ +/*#define FCNTL_CAN_LOCK /**/ + +/* HAS_FSYNC: + * This symbol, if defined, indicates that the fsync routine is + * available to write a file's modified data and attributes to + * permanent storage. + */ +/*#define HAS_FSYNC /**/ + +/* HAS_SBRK_PROTO: + * This symbol, if defined, indicates that the system provides + * a prototype for the sbrk() function. Otherwise, it is up + * to the program to supply one. Good guesses are + * extern void* sbrk _((int)); + * extern void* sbrk _((size_t)); + */ +/*#define HAS_SBRK_PROTO /**/ + +#endif |